bool load() { if (loaded) return true; lib = SDL_LoadObject("libgtk-3.so.0"); if (!lib) lib = SDL_LoadObject("libgtk-x11-2.0.so.0"); if (!lib) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Cannot show open file dialog: no GTK library available."); return false; } loadFunc(g_free); loadFunc(gtk_dialog_get_type); loadFunc(gtk_dialog_run); loadFunc(gtk_events_pending); loadFunc(gtk_file_chooser_add_filter); loadFunc(gtk_file_chooser_dialog_new); loadFunc(gtk_file_chooser_get_filename); loadFunc(gtk_file_chooser_get_type); loadFunc(gtk_file_filter_add_pattern); loadFunc(gtk_file_filter_new); loadFunc(gtk_file_filter_set_name); loadFunc(gtk_init_check); loadFunc(gtk_main_iteration); loadFunc(gtk_widget_destroy); loadFunc(gtk_window_get_type); loadFunc(gtk_window_new); loadFunc(g_type_check_instance_cast); loaded = true; return true; }
void Unit::merge() { if (UNLIKELY(!m_initialMergeDone)) { SimpleLock lock(m_preConstsLock); if (LIKELY(!m_initialMergeDone)) { if (!RuntimeOption::RepoAuthoritative) { Transl::mergePreConsts(m_preConsts); } for (MutableFuncRange fr(nonMainFuncs()); !fr.empty();) { loadFunc(fr.popFront()); } m_initialMergeDone = true; } } Func** it = funcHoistableBegin(); Func** fend = funcEnd(); if (it != fend) { bool debugger = isDebuggerAttached(); do { Func* func = *it; ASSERT(func->top()); setCachedFunc(func, debugger); } while (++it != fend); } bool redoHoistable = false; int ix = m_firstHoistablePreClass; int end = m_firstMergablePreClass; // iterate over all the potentially hoistable classes // with no fatals on failure while (ix < end) { PreClass* pre = (PreClass*)m_mergeables[ix++]; if (!defClass(pre, false)) redoHoistable = true; } if (UNLIKELY(redoHoistable)) { // if this unit isnt mergeOnly, we're done if (!isMergeOnly()) return; // as a special case, if all the classes are potentially // hoistable, we dont list them twice, but instead // iterate over them again // At first glance, it may seem like we could leave // the maybe-hoistable classes out of the second list // and then always reset ix to 0; but that gets this // case wrong if there's an autoloader for C, and C // extends B: // // class A {} // class B implements I {} // class D extends C {} // // because now A and D go on the maybe-hoistable list // B goes on the never hoistable list, and we // fatal trying to instantiate D before B if (end == (int)m_mergeables.size()) ix = m_firstHoistablePreClass; } end = m_mergeables.size(); // iterate over all but the guaranteed hoistable classes // fataling if we fail. while (ix < end) { PreClass* pre = (PreClass*)m_mergeables[ix++]; defClass(pre, true); } }
void SelectMenu::load(const std::string& map) { loadFunc(funcObject, map); }