Пример #1
0
LibX11exports *LibX11::loadExports()
{
	static void *libX11 = nullptr;
	static void *libXext = nullptr;
	static LibX11exports *libX11exports = nullptr;

	if(!libX11)
	{
		libX11 = loadLibrary("libX11.so");

		if(libX11)
		{
			libXext = loadLibrary("libXext.so");
			libX11exports = new LibX11exports(libX11, libXext);
		}
		else   // Might have failed to load due to sandboxing. Search the global scope for pre-loaded library.
		{
			if(getProcAddress(RTLD_DEFAULT, "XOpenDisplay"))
			{
				libX11exports = new LibX11exports(RTLD_DEFAULT, RTLD_DEFAULT);
			}

			libX11 = (void*)-1;   // Don't attempt loading more than once.
		}
	}

	return libX11exports;
}
Пример #2
0
extern "C" DECLSPEC void SDLCALL Java_paulscode_android_mupen64plusae_jni_NativeExports_loadLibraries(JNIEnv* env, jclass cls, jstring jlibPath, jint jandroidSDK)
{
    LOGI("Loading native libraries");

    // Clear stale error messages
    dlerror();

    // Get the library path from the java-managed string
    const char *libPath = env->GetStringUTFChars(jlibPath, 0);
    char path[256];
    strcpy(path, libPath);
    env->ReleaseStringUTFChars(jlibPath, libPath);

#ifdef __i386__ // ARM libraries are already PIC-compliant
    // Check if PIC libraries are needed
    if (jandroidSDK >= ANDROID_SDK_VERSION_M)
    {
        coreLibraryName = "mupen64plus-core-pic";
    }
#endif

    // Open shared libraries
    handleAEI      = loadLibrary(path, "ae-imports");
    handleSDL      = loadLibrary(path, "SDL2");
    handleFreetype = loadLibrary(path, "freetype");
    handleCore     = loadLibrary(path, coreLibraryName);
    handleFront    = loadLibrary(path, "mupen64plus-ui-console");

    // Make sure we don't have any typos
    if (!handleAEI || !handleSDL || !handleFreetype || !handleCore || !handleFront )
    {
        LOGE("Could not load libraries: be sure the paths are correct");
    }

    // Find and call the JNI_OnLoad functions manually since we aren't loading the libraries from Java
    pJNI_OnLoad JNI_OnLoad0 = (pJNI_OnLoad) locateFunction(handleAEI, "ae-imports", "JNI_OnLoad");
    pJNI_OnLoad JNI_OnLoad1 = (pJNI_OnLoad) locateFunction(handleSDL, "SDL2",       "JNI_OnLoad");
    JNI_OnLoad0(mVm, mReserved);
    JNI_OnLoad1(mVm, mReserved);
    JNI_OnLoad0 = NULL;
    JNI_OnLoad1 = NULL;

    // Find library functions
    aeiInit       = (pAeiInit)       locateFunction(handleAEI,   "ae-imports",             "Android_JNI_InitImports");
    sdlInit       = (pSdlInit)       locateFunction(handleSDL,   "SDL2",                   "SDL_Android_Init");
    sdlSetScreen  = (pSdlSetScreen)  locateFunction(handleSDL,   "SDL2",                   "Android_SetScreenResolution");
    sdlMainReady  = (pVoidFunc)      locateFunction(handleSDL,   "SDL2",                   "SDL_SetMainReady");
    coreDoCommand = (pCoreDoCommand) locateFunction(handleCore,  coreLibraryName,          "CoreDoCommand");
    coreShutdown  = (pCoreShutdown)  locateFunction(handleCore,  coreLibraryName,          "CoreShutdown");
    frontMain     = (pFrontMain)     locateFunction(handleFront, "mupen64plus-ui-console", "SDL_main");
    nativeResume  = (pNativeResume)  locateFunction(handleSDL,   "SDL2",                   "Java_org_libsdl_app_SDLActivity_nativeResume");
    nativePause   = (pNativePause)   locateFunction(handleSDL,   "SDL2",                   "Java_org_libsdl_app_SDLActivity_nativePause");

    // Make sure we don't have any typos
    if (!aeiInit || !sdlInit || !sdlSetScreen || !sdlMainReady || !coreDoCommand || !frontMain || !nativeResume || !nativePause || !coreShutdown)
    {
        LOGE("Could not load library functions: be sure they are named and typedef'd correctly");
    }
}
Пример #3
0
void Foam::codedBase::updateLibrary
(
    const word& name
) const
{
    const dictionary& dict = this->codeDict();

    dynamicCode::checkSecurity
    (
        "codedBase::updateLibrary()",
        dict
    );

    dynamicCodeContext context(dict);

    // codeName: name + _<sha1>
    // codeDir : name
    dynamicCode dynCode
    (
        name + context.sha1().str(true),
        name
    );
    const fileName libPath = dynCode.libPath();


    // the correct library was already loaded => we are done
    if (libs().findLibrary(libPath))
    {
        return;
    }

    Info<< "Using dynamicCode for " << this->description().c_str()
        << " at line " << dict.startLineNumber()
        << " in " << dict.name() << endl;


    // remove instantiation of fvPatchField provided by library
    this->clearRedirect();

    // may need to unload old library
    unloadLibrary
    (
        oldLibPath_,
        dynamicCode::libraryBaseName(oldLibPath_),
        context.dict()
    );

    // try loading an existing library (avoid compilation when possible)
    if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
    {
        createLibrary(dynCode, context);

        loadLibrary(libPath, dynCode.codeName(), context.dict());
    }

    // retain for future reference
    oldLibPath_ = libPath;
}
Пример #4
0
void Foam::codedFunctionObject::updateLibrary() const
{
    dynamicCode::checkSecurity
    (
        "codedFunctionObject::updateLibrary()",
        dict_
    );

    dynamicCodeContext context(dict_);

    // codeName: redirectType + _<sha1>
    // codeDir : redirectType
    dynamicCode dynCode
    (
        redirectType_ + context.sha1().str(true),
        redirectType_
    );
    const fileName libPath = dynCode.libPath();


    // the correct library was already loaded => we are done
    if (const_cast<Time&>(time_).libs().findLibrary(libPath))
    {
        return;
    }

    Info<< "Using dynamicCode for functionObject " << name()
        << " at line " << dict_.startLineNumber()
        << " in " << dict_.name() << endl;


    // remove instantiation of fvPatchField provided by library
    redirectFunctionObjectPtr_.clear();

    // may need to unload old library
    unloadLibrary
    (
        oldLibPath_,
        dynamicCode::libraryBaseName(oldLibPath_),
        context.dict()
    );

    // try loading an existing library (avoid compilation when possible)
    if (!loadLibrary(libPath, dynCode.codeName(), context.dict()))
    {
        createLibrary(dynCode, context);

        loadLibrary(libPath, dynCode.codeName(), context.dict());
    }

    // retain for future reference
    oldLibPath_ = libPath;
}
Пример #5
0
void APILoader::loadDefaultLibraries(bool useEGL, int librariesMask, LoadMode mode) {
    if (useEGL) {
        loadLibrary(ApiLibrary(LIBRARY_EGL & librariesMask), mode);
    } else {
#ifdef _WIN32
        loadLibrary(ApiLibrary(LIBRARY_WGL & librariesMask), mode);
        loadLibrary(ApiLibrary(LIBRARY_WINGDI & librariesMask), mode);
#else
        loadLibrary(ApiLibrary(LIBRARY_GLX & librariesMask), mode);
#endif
        loadLibrary(ApiLibrary(LIBRARY_GL & librariesMask), mode);
    }
}
Пример #6
0
MpdLibraryDb::MpdLibraryDb(QObject *p)
    : LibraryDb(p, "MPD")
    , loading(false)
    , coverQuery(nullptr)
    , albumIdOnlyCoverQuery(nullptr)
    , artistImageQuery(nullptr)
{
    connect(MPDConnection::self(), SIGNAL(updatingLibrary(time_t)), this, SLOT(updateStarted(time_t)));
    connect(MPDConnection::self(), SIGNAL(librarySongs(QList<Song>*)), this, SLOT(insertSongs(QList<Song>*)));
    connect(MPDConnection::self(), SIGNAL(updatedLibrary()), this, SLOT(updateFinished()));
    connect(MPDConnection::self(), SIGNAL(statsUpdated(MPDStatsValues)), this, SLOT(statsUpdated(MPDStatsValues)));
    connect(this, SIGNAL(loadLibrary()), MPDConnection::self(), SLOT(loadLibrary()));
    connect(MPDConnection::self(), SIGNAL(connectionChanged(MPDConnectionDetails)), this, SLOT(connectionChanged(MPDConnectionDetails)));
    DBUG;
}
Пример #7
0
		IPlugin* load(const char* path) override
		{
			g_log_info.log("plugins") << "loading plugin " << path;
			typedef IPlugin* (*PluginCreator)(Engine&);

			auto* lib = loadLibrary(path);
			if (lib)
			{
				PluginCreator creator = (PluginCreator)getLibrarySymbol(lib, "createPlugin");
				if (creator)
				{
					IPlugin* plugin = creator(m_engine);
					if (!plugin || !plugin->create())
					{
						LUMIX_DELETE(m_engine.getAllocator(), plugin);
						ASSERT(false);
						return nullptr;
					}
					m_plugins.push(plugin);
					m_libraries.push(lib);
					m_library_loaded.invoke(lib);
					g_log_info.log("plugins") << "plugin loaded";
					return plugin;
				}
			}
			unloadLibrary(lib);
			return 0;
		}
void DIALOG_SPICE_MODEL::onSelectLibrary( wxCommandEvent& event )
{
    wxString searchPath = wxFileName( m_modelLibrary->GetValue() ).GetPath();

    if( searchPath.IsEmpty() )
        searchPath = Prj().GetProjectPath();

    wxString     wildcards = SpiceLibraryFileWildcard() + "|" + AllFilesWildcard();
    wxFileDialog openDlg( this, _( "Select library" ), searchPath, "", wildcards,
            wxFD_OPEN | wxFD_FILE_MUST_EXIST );

    if( openDlg.ShowModal() == wxID_CANCEL )
        return;

    wxFileName libPath( openDlg.GetPath() );

    // Try to convert the path to relative to project
    if( libPath.MakeRelativeTo( Prj().GetProjectPath() ) && !libPath.GetFullPath().StartsWith( ".." ) )
        m_modelLibrary->SetValue( libPath.GetFullPath() );
    else
        m_modelLibrary->SetValue( openDlg.GetPath() );

    loadLibrary( openDlg.GetPath() );
    m_modelName->Popup();
}
Пример #9
0
int main(int argc, char* argv[]) {
    int i;
    if (argc < 3) {
        printf("Incorrect Usage\n");
        printf("%s <input file> <output file>\n", argv[0]);
        return 0;
    }
 
    //int* length;
    int* length = malloc(sizeof(int));
    Library library = loadLibrary(argv[1], length);
     
    sortLibrary(library, *length);
    printLibrary(library, *length);
    //writeLibrary(library, *length, argv[0]);
    writeLibrary(library, *length, argv[2]);
 
    free(library);
     
    
    //for (i = 0; i < length; i++)
    for(i=0;i<*length;i++)
    {
        free(library[i].name);
        //free(library[i].author)
        free(library[i].author);
    }
    
    free(length);
 
    return 0;
}
Пример #10
0
KNMusicPlugin::KNMusicPlugin(QObject *parent) :
    KNAbstractMusicPlugin(parent)
{
    //Initial infrastructure.
    initialInfrastructure();
    //Load detail info first.
    loadDetailInfo(new KNMusicDetailDialog);
    //Initial parser.
    initialParser();
    //Initial menus.
    initialSoloMenu(new KNMusicSoloMenu);
    initialMultiMenu(new KNMusicMultiMenu);

    //Load plugins.
    loadSearch(new KNMusicSearch);
#ifdef ENABLE_LIBBASS
    loadBackend(new KNMusicBackendBass);
#endif
#ifdef ENABLE_LIBVLC
    loadBackend(new KNMusicBackendVLC);
#endif
    loadDetailTooptip(new KNMusicDetailTooltip);
    loadNowPlaying(new KNMusicNowPlaying);
    loadHeaderPlayer(new KNMusicHeaderPlayer);
    loadHeaderLyrics(new KNMusicHeaderLyrics);
    loadLibrary(new KNMusicLibrary);
    loadPlaylistManager(new KNMusicPlaylistManager);

    //Connect retranslate request.
    connect(KNLocaleManager::instance(), &KNLocaleManager::requireRetranslate,
            this, &KNMusicPlugin::retranslate);
}
Пример #11
0
/**
 * Resolve an entry point for a package function entry (used on
 * a restore or reflatten);
 *
 * @param name   Name of the target function.
 *
 * @return The target entry point.
 */
PREGISTEREDROUTINE PackageManager::resolveRegisteredRoutineEntry(RexxString *packageName, RexxString *name)
{
    // if there's no package name, then this is stored in raw name form (I don't believe this should
    // ever happen....but.
    if (packageName == OREF_NULL)
    {
        REXXPFN entry = NULL;

        const char *functionName = name->getStringData();
        {
            UnsafeBlock releaser;
            // now go resolve this entry pointer
            RexxResolveRoutine(functionName, &entry);
        }

        // this is a failure
        if (entry == NULL)
        {
            reportException(Error_Execution_library_routine, name);
        }
        return (PREGISTEREDROUTINE)entry;
    }
    else
    {
        LibraryPackage *package = loadLibrary(packageName);

        // if no entry, something bad has gone wrong
        if (package == NULL)
        {
            reportException(Error_Execution_library_routine, name, packageName);
        }
        return package->resolveRegisteredRoutineEntry(name);
    }
}
Пример #12
0
/**
 * Process the basics of RxFuncAdd().  This will return 0 if the function can be
 * resolved and is callable, 1 otherwise.  If the target function is not in a
 * loadable package file, this will also do the global registration.
 *
 * @param name   The name of the registered function.
 * @param module The name of the library containing the function.
 * @param proc   The target procedure name (ignored if the target library
 *               is a self-loading one).
 *
 * @return 0 if the function registration worked and the function is callable.
 *         1 otherwise.
 *
 * @remarks  Note that we return TheFalseObject (0) if the function is resolved
 *           and callable and TheTrueObject (1) for failure.  This is because
 *           RxFuncAdd() directly returns this result. RxFuncAdd() is documented
 *           to return 0 on success and 1 on failure.
 */
RexxObject *PackageManager::addRegisteredRoutine(RexxString *name, RexxString *module, RexxString *proc)
{
    // make sure we're using uppercase name versions here.
    name = name->upper();
    ProtectedObject p1(name);

    // see if we have this one already, either from a package or previously loaded
    RoutineClass *func = getLoadedRoutine(name);

    // if we have this, then we can return it directly.
    if (func != OREF_NULL)
    {
        return TheFalseObject;
    }

    // see if this package is resolveable/loadable.
    LibraryPackage *package = loadLibrary(module);
    if (package != OREF_NULL)
    {
        // See if this is resolvable in this context.  If we got it,
        // return 0, the false object.
        return getLoadedRoutine(name) != OREF_NULL ? TheFalseObject : TheTrueObject;
    }

    // ok, this is not a converted new-style package.  Now try registering the function and
    // resolving it in this process.  This will also add this to the local cache
    return resolveRoutine(name, module, proc) != OREF_NULL ? TheFalseObject : TheTrueObject;
}
Пример #13
0
OperatingSystem::OperatingSystem()
{
	lastProcessId_ = 0;

	addLibrary("kernel32.dll");
	addLibrary("openAL32.dll");
	addLibrary("foundation.dll");

	addProcess("explorer.exe");
	addProcess("winlogon.exe");
	addProcess("taskeng.exe");
	addProcess("test.exe");

	/*auto proc = processes_[1];
	proc->createNewThread();
	proc->createNewThread();
	proc->loadLibrary(getLibraryByName("kernel32.dll"));
	
	proc->killThread(2);
	if (!proc->killThread(0)) {
		delete proc;
		processes_.erase(1);
	}

	killProcess("test.exe");*/ // <--- ето работаит

	auto proc = processes_[0];
	proc->loadLibrary(getLibraryByName("kernel32.dll"));
	deleteLibrary("kernel32.dll");
}
Пример #14
0
void LibraryPage::refresh()
{
    view->goToTop();
    if (!MusicLibraryModel::self()->fromXML()) {
        emit loadLibrary();
    }
}
Пример #15
0
OPStatus InputPlugin::loadPlugin(const char * libPath, InputPlugin*& outplug)
{
    if (nullptr != outplug)
    {
        LOG_DEBUG(InputPlugin) << "Existing Plugin object";
        return OP_ERROR;
    }

    InputPlugin* plugin = new InputPlugin;

    if (OP_ERROR == loadLibrary(libPath, plugin->_libHandle, plugin->_pluginInfo))
    {
        delete plugin;
        LOG_ERROR(InputPlugin) << "Error loading library " << libPath;
        return OP_ERROR;
    }

    //Find entries for functions in DLL
    void(*InitFunc)(void);
    
    plugin->loadDefaults();
    plugin->loadPJ64Settings();

    getPluginFunction(plugin->_libHandle, "ControllerCommand", plugin->ControllerCommand);
    getPluginFunction(plugin->_libHandle, "InitiateControllers", InitFunc);
    getPluginFunction(plugin->_libHandle, "ReadController", plugin->ReadController);
    getPluginFunction(plugin->_libHandle, "GetKeys", plugin->GetKeys);
    getPluginFunction(plugin->_libHandle, "RumbleCommand", plugin->RumbleCommand);

    //version 102 functions
    getPluginFunction(plugin->_libHandle, "PluginLoaded", plugin->PluginOpened);

    //Make sure dll had all needed functions
    if (InitFunc == nullptr ||
        plugin->CloseLib == nullptr)
    {
        freeLibrary(plugin->_libHandle);
        delete plugin;
        LOG_ERROR(InputPlugin) << "Invalid plugin: not all required functions are found";
        return OP_ERROR;
    }

    if (plugin->_pluginInfo.Version >= 0x0102)
    {
        if (plugin->PluginOpened == nullptr)
        {
            freeLibrary(plugin->_libHandle);
            delete plugin;
            LOG_ERROR(InputPlugin) << "Invalid plugin: not all required functions are found";
            return OP_ERROR;
        }

        plugin->PluginOpened();
    }

    // Return it
    outplug = plugin; plugin = nullptr;

    return OP_OK;
}
Пример #16
0
void SoundComponentLoader::initialize(const std::string& repository){

	m_SndComponentRepository = repository;

	if(!m_IsInitialized){

		if(!fs::exists(repository)){

			LOG_ERROR("Cannot open sound component repository");
			return; // remain uninitialized
		}

		fs::path repo(repository);

		// Iterate through all files in the directory
		for(fs::recursive_directory_iterator end, iter(repo); iter != end; ++iter){
			if(!fs::is_directory(iter.status()) && !fs::extension(*iter).compare(".so")){

				LOG_DEBUG("Found library: " << *iter);

				loadLibrary(iter->path().string());
			}
		}
	}

	m_IsInitialized = true;
}
Пример #17
0
bool PluginManager::loadByPath(const std::string& pluginPath,
    PF_PluginType type)
{
    // Only filenames that start with libpdal_plugin are candidates to be loaded
    // at runtime.  PDAL plugins are to be named in a specified form:

    // libpdal_plugin_{stagetype}_{name}

    // For example, libpdal_plugin_writer_text or libpdal_plugin_filter_color

    bool loaded(false);

    boost::filesystem::path path(pluginPath);
    std::string pathname = Utils::tolower(path.filename().string());

    // If we are a valid type, and we're not yet already
    // loaded in the LibraryMap, load it.
    if (pluginTypeValid(pathname, type) &&
        m_dynamicLibraryMap.find(path.string()) == m_dynamicLibraryMap.end())
    {
        std::string errorString;
        auto completePath(boost::filesystem::complete(path).string());

        if (DynamicLibrary *d = loadLibrary(completePath, errorString))
        {
            if (PF_InitFunc initFunc =
                    (PF_InitFunc)(d->getSymbol("PF_initPlugin")))
            {
                loaded = initializePlugin(initFunc);
            }
        }
    }

    return loaded;
}
Пример #18
0
/** Opens all suitable DLLs on a given path.
*  @param filePath :: The filepath to the directory where the libraries are.
*  @param isRecursive :: Whether to search subdirectories.
*  @return The number of libraries opened.
*/
int LibraryManagerImpl::OpenAllLibraries(const std::string &filePath,
                                         bool isRecursive) {
  g_log.debug() << "Opening all libraries in " << filePath << "\n";
  int libCount = 0;
  // validate inputs
  Poco::File libPath;
  try {
    libPath = Poco::File(filePath);
  } catch (...) {
    return libCount;
  }
  if (libPath.exists() && libPath.isDirectory()) {
    DllOpen::addSearchDirectory(filePath);
    // Iteratate over the available files
    Poco::DirectoryIterator end_itr;
    for (Poco::DirectoryIterator itr(libPath); itr != end_itr; ++itr) {
      const Poco::Path &item = itr.path();
      if (item.isDirectory()) {
        if (isRecursive) {
          libCount += OpenAllLibraries(item.toString());
        }
      } else {
        if (skip(item.toString()))
          continue;
        if (loadLibrary(item.toString())) {
          ++libCount;
        }
      }
    }
  } else {
    g_log.error("In OpenAllLibraries: " + filePath + " must be a directory.");
  }

  return libCount;
}
Пример #19
0
CLibrary::CLibrary(const std::string &libName, bool addNelDecoration, bool tryLibPath, bool ownership)
: _PureNelLibrary(NULL)
{
	loadLibrary(libName, addNelDecoration, tryLibPath, ownership);
	// Assert here !
	nlassert(_LibHandle != NULL);
}
Пример #20
0
bool ComponentManager::loadPlugin(const std::string & filePath, const bool reload)
{
    // Load plugin library
    bool res = loadLibrary(filePath, reload);

    return res;
}
Пример #21
0
void MpdLibraryDb::statsUpdated(const MPDStatsValues &stats)
{
    if (!loading && stats.dbUpdate>currentVersion) {
        DBUG << stats.dbUpdate << currentVersion;
        loading=true;
        emit loadLibrary();
    }
}
Пример #22
0
void APILoader::loadLibraries(int apiLibraries) {
    int j = 1;
    for (size_t i = 1; i < sizeof(apiLibraries) * 8; i++) {
        if (apiLibraries & j)
            loadLibrary(ApiLibrary(j));
        j *= 2;
    }
}
Пример #23
0
CPPUNIT_NS_BEGIN


DynamicLibraryManager::DynamicLibraryManager( const std::string &libraryFileName )
    : m_libraryHandle( NULL )
    , m_libraryName( libraryFileName )
{
  loadLibrary( libraryFileName );
}
Пример #24
0
    void *symbol(const QString& sym) const {
        if (!loadLibrary()) {
            return 0L;
        }

        // FIXME: might be a good idea to cache this per-symbol

        return _lib->symbol(QFile::encodeName(sym + "_" + _plugLib));
    }
Пример #25
0
		IPlugin* load(const char* path) override
		{
			char path_with_ext[MAX_PATH_LENGTH];
			copyString(path_with_ext, path);
			const char* ext =
			#ifdef _WIN32
				".dll";
			#elif defined __linux__
				".so";
			#else 
				#error Unknown platform
			#endif
			if (!PathUtils::hasExtension(path, ext + 1)) catString(path_with_ext, ext);
			g_log_info.log("Core") << "loading plugin " << path_with_ext;
			typedef IPlugin* (*PluginCreator)(Engine&);
			auto* lib = loadLibrary(path_with_ext);
			if (lib)
			{
				PluginCreator creator = (PluginCreator)getLibrarySymbol(lib, "createPlugin");
				if (creator)
				{
					IPlugin* plugin = creator(m_engine);
					if (!plugin)
					{
						g_log_error.log("Core") << "createPlugin failed.";
						LUMIX_DELETE(m_engine.getAllocator(), plugin);
						ASSERT(false);
					}
					else
					{
						addPlugin(plugin);
						m_libraries.push(lib);
						m_library_loaded.invoke(lib);
						g_log_info.log("Core") << "Plugin loaded.";
						Debug::StackTree::refreshModuleList();
						return plugin;
					}
				}
				else
				{
					g_log_error.log("Core") << "No createPlugin function in plugin.";
				}
				unloadLibrary(lib);
			}
			else
			{
				auto* plugin = StaticPluginRegister::create(path, m_engine);
				if (plugin)
				{
					g_log_info.log("Core") << "Plugin loaded.";
					addPlugin(plugin);
					return plugin;
				}
				g_log_warning.log("Core") << "Failed to load plugin.";
			}
			return nullptr;
		}
Пример #26
0
LibraryPage::LibraryPage(QWidget *p)
    : QWidget(p)
{
    setupUi(this);
    addToPlayQueue->setDefaultAction(StdActions::self()->addToPlayQueueAction);
    replacePlayQueue->setDefaultAction(StdActions::self()->replacePlayQueueAction);

    view->addAction(StdActions::self()->addToPlayQueueAction);
    view->addAction(StdActions::self()->replacePlayQueueAction);
    view->addAction(StdActions::self()->addWithPriorityAction);
    view->addAction(StdActions::self()->addToStoredPlaylistAction);
    #ifdef TAGLIB_FOUND
    #ifdef ENABLE_DEVICES_SUPPORT
    view->addAction(StdActions::self()->copyToDeviceAction);
    #endif
    view->addAction(StdActions::self()->organiseFilesAction);
    view->addAction(StdActions::self()->editTagsAction);
    #ifdef ENABLE_REPLAYGAIN_SUPPORT
    view->addAction(StdActions::self()->replaygainAction);
    #endif
    view->addAction(StdActions::self()->setCoverAction);
    #ifdef ENABLE_DEVICES_SUPPORT
    view->addSeparator();
    view->addAction(StdActions::self()->deleteSongsAction);
    #endif
    #endif // TAGLIB_FOUND

    connect(this, SIGNAL(add(const QStringList &, bool, quint8)), MPDConnection::self(), SLOT(add(const QStringList &, bool, quint8)));
    connect(this, SIGNAL(addSongsToPlaylist(const QString &, const QStringList &)), MPDConnection::self(), SLOT(addToPlaylist(const QString &, const QStringList &)));
    connect(genreCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(searchItems()));
    connect(MPDConnection::self(), SIGNAL(updatingLibrary()), view, SLOT(updating()));
    connect(MPDConnection::self(), SIGNAL(updatedLibrary()), view, SLOT(updated()));
    connect(MPDConnection::self(), SIGNAL(updatingDatabase()), view, SLOT(updating()));
    connect(MPDConnection::self(), SIGNAL(updatedDatabase()), view, SLOT(updated()));
    connect(MusicLibraryModel::self(), SIGNAL(updateGenres(const QSet<QString> &)), genreCombo, SLOT(update(const QSet<QString> &)));
    connect(this, SIGNAL(loadLibrary()), MPDConnection::self(), SLOT(loadLibrary()));
    connect(view, SIGNAL(itemsSelected(bool)), this, SLOT(controlActions()));
    connect(view, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(itemDoubleClicked(const QModelIndex &)));
    connect(view, SIGNAL(searchItems()), this, SLOT(searchItems()));
    connect(view, SIGNAL(rootIndexSet(QModelIndex)), this, SLOT(updateGenres(QModelIndex)));
    proxy.setSourceModel(MusicLibraryModel::self());
    view->setModel(&proxy);
    view->load(metaObject()->className());
}
Пример #27
0
bool PluginManager::load(const std::string & filePath, const bool reload)
{
    // Load plugin library
    bool res = loadLibrary(filePath, reload);

    // Announce loaded plugins have changed
    pluginsChanged();

    return res;
}
Пример #28
0
/**
 * Initialize the package manager global state.
 */
void PackageManager::initialize()
{
    packages = new_directory();               // create the tables for the manager
    packageRoutines = new_directory();
    registeredRoutines = new_directory();
    loadedRequires = new_directory();
    // load the internal library first
    loadInternalPackage(OREF_REXX, rexxPackage);
    loadLibrary(OREF_REXXUTIL); // load the rexxutil package automatically
}
Пример #29
0
/**
 * Resolve an entry point for a package function entry (used on
 * a restore or reflatten);
 *
 * @param name   Name of the target function.
 *
 * @return The target entry point.
 */
PNATIVEROUTINE PackageManager::resolveRoutineEntry(RexxString *packageName, RexxString *name)
{
    LibraryPackage *package = loadLibrary(packageName);

    // if no entry, something bad has gone wrong
    if (package == NULL)
    {
        reportException(Error_Execution_library_method, name, packageName);
    }
    return package->resolveRoutineEntry(name);
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    setObjectName("MainWindow");

    if (!loadPlugin()||!loadLibrary()) {
        QMessageBox::information(this, "Error", "Could not load the plugin");
    }
     testButton = new QPushButton;
     pencil = customWidgetInterface->createWidget(this);
     videoEditInterface->getDockWidget()->setTitleBarWidget(new QWidget);
     videoEditInterface->getDockWidget()->setFloating(false);

     //connect(testButton,SIGNAL(clicked(bool)),this,SLOT(showMain()));
     connect(videoEditInterface->getTheDialog(),SIGNAL(saveCurrentFrameSignal(int)),pencil,SLOT(saveProject()));
     connect(pencil,SIGNAL(postURL(QString,QString)),videoEditInterface->getTheDialog(),SLOT(loadCurrentFrame(QString,QString)));
     connect(videoEditInterface->getTheDialog(),SIGNAL(openThisPicture(QString,int)),pencil,SLOT(reopenProject(QString)));
     ((QMainWindow*)pencil)->addDockWidget(Qt::BottomDockWidgetArea,videoEditInterface->getDockWidget());




//     m_leftToolBar = loadUIPlugin();
//     if(m_leftToolBar != NULL){
//         m_leftToolBar->install((QMainWindow*)pencil);
//         connect(m_leftToolBar->getSignalBox(),
//                          SIGNAL(whichToolsBoardBtnWasClicked(int)),
//                          pencil, SLOT(whatToolOpen(int)));
//         connect(m_leftToolBar->getSignalBox(), SIGNAL(colorChanged(QColor)),
//                          pencil, SLOT(UIsetColor(QColor)));
//         connect(m_leftToolBar->getSignalBox(),
//                          SIGNAL(materialImagePathChanged(QString)),
//                          pencil, SLOT(importMaterial(QString)));
//     }
//     sliderWidthValue(int newWidth);
//    sliderFeatherValue(int newFeather);
     m_leftToolBar = loadUIPlugin<LeftToolBarInterface *>();
     if(m_leftToolBar != NULL){
         m_leftToolBar->install((QMainWindow*)pencil);
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(whichToolsBoardBtnWasClicked(int)),
                          pencil, SLOT(whatToolOpen(int)));
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(penWidthChanged(int)),
                          pencil, SLOT(sliderWidthValue(int)));
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(penFeatherChanged(int)),
                          pencil, SLOT(sliderFeatherValue(int)));
         QObject::connect(m_leftToolBar->getSignalBox(), SIGNAL(colorChanged(QColor)),
                          pencil, SLOT(UIsetColor(QColor)));
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(materialImagePathChanged(QString)),
                          pencil, SLOT(importMaterial(QString)));
     }