AIScripting::AIScripting(void) { lState = lua_open(); LoadLuaLibraries(); RegisterClasses(); }
CorePackage::CorePackage(CoreApiPtr pCore) { m_pCore = pCore; RegisterClasses(); RegisterTemplates(); }
//--------------------------------------------------------------------------- int Initialization() { TPersistentClass classes[] = { __classid(TButton) }; // to copy button to clipboard RegisterClasses(classes, (sizeof(classes)/sizeof(classes[0])) - 1); return 0; }
void csSCF::RegisterClasses (char const* xml, const char* context) { csMemFile file(xml, strlen(xml)); csTinyDocumentSystem docsys; csRef<iDocument> doc = docsys.CreateDocument(); if (doc->Parse(&file, true) == 0) RegisterClasses(doc, context); }
bool CFidgetApp::Initialize(HINSTANCE hInstance, int nCmdShow) { m_hInstance = hInstance; TIME_Initialize(); init_timer(); SeedRandomNumberGenerator(); if (!EnableHook()) { return false; } m_hRichEdit = ::LoadLibrary(L"Msftedit.dll"); if (NULL != m_hRichEdit) { m_bMsftEdit = true; } else { m_hRichEdit = ::LoadLibrary(L"Riched20.dll"); if (NULL != m_hRichEdit) { m_bMsftEdit = false; } else { return false; } } m_pMainFrame = new (std::nothrow) CMainFrame; if ( NULL == m_pMainFrame || !RegisterClasses()) { return false; } int xSize = ::GetSystemMetrics(SM_CXSCREEN); int ySize = ::GetSystemMetrics(SM_CYSCREEN); int cx = (9*xSize)/10; int cy = (9*ySize)/10; int x = (xSize - cx)/2; int y = (ySize - cy)/2; if (!m_pMainFrame->Create(x, y, cx, cy)) { UnregisterClasses(); return false; } m_pMainFrame->ShowWindow(nCmdShow); m_pMainFrame->UpdateWindow(); return true; }
occi_environment() : env_(0) { MAPNIK_LOG_DEBUG(occi) << "occi_environment: constructor"; env_ = oracle::occi::Environment::createEnvironment( (oracle::occi::Environment::Mode)(oracle::occi::Environment::OBJECT | oracle::occi::Environment::THREADED_MUTEXED)); RegisterClasses(env_); }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdline, int show) { instance = hInstance; hFont = CreateFont(-17, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana"); hFont2 = CreateFont(-11, 0, 0, 0, FW_NORMAL, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana"); RegisterClasses(); hwndmain = CreateMainWindow(); CreateWindowContent(hwndmain); return MessageLoop(); }
bool csSCF::RegisterPlugin (const char* path) { csRef<iDocument> metadata; csRef<iString> msg; if (IsVerbose(SCF_VERBOSE_PLUGIN_REGISTER)) csPrintfErr("SCF_NOTIFY: registering plugin %s (no context)\n", path); if ((msg = csGetPluginMetadata (path, metadata)) != 0) { csPrintfErr("SCF_ERROR: couldn't retrieve metadata for '%s': %s\n", path, msg->GetData ()); return false; } RegisterClasses (path, metadata); return true; }
static oracle::occi::Environment* get_environment () { if (env_ == 0) { #ifdef MAPNIK_DEBUG std::clog << "occi_environment constructor" << std::endl; #endif int mode = oracle::occi::Environment::OBJECT | oracle::occi::Environment::THREADED_MUTEXED; env_ = oracle::occi::Environment::createEnvironment ((oracle::occi::Environment::Mode) mode); RegisterClasses (env_); } return env_; }
csSCF::csSCF (unsigned int v) : scfImplementation<csSCF> (this), verbose(v) #ifdef CS_REF_TRACKER ,refTracker(0) #endif { SCF = PrivateSCF = this; #if defined(CS_DEBUG) || defined (CS_MEMORY_TRACKER) object_reg = 0; #endif #ifdef CS_REF_TRACKER refTracker = new csRefTracker(); if (!classIDs) classIDs = new csStringHash; #endif if (!ClassRegistry) ClassRegistry = new scfClassRegistry (); if (!LibraryRegistry) LibraryRegistry = new scfLibraryVector (); if (!libraryNames) libraryNames = new csStringSet; staticContextID = contexts.Request (SCF_STATIC_CLASS_CONTEXT); size_t i; for (i = 0; i < staticClasses.Length(); i++) { const scfStaticClass& c = staticClasses[i]; RegisterClass (c.func, c.iClassID, c.Description, c.Dependencies, SCF_STATIC_CLASS_CONTEXT); } for (i = 0; i < staticXml.Length(); i++) { RegisterClasses (staticXml[i], SCF_STATIC_CLASS_CONTEXT); } for (i = 0; i < staticFactoryFuncs.Length(); i++) { const scfStaticFactoryFunc& ff = staticFactoryFuncs[i]; RegisterFactoryFunc (ff.func, ff.FactClass); } }
static int LaunchScreenSaver(HWND hParent) { BOOL foo; UINT style; RECT rc; MSG msg; /* don't allow other tasks to get into the foreground */ if (w95 && !fChildPreview) SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, &foo, 0); msg.wParam = 0; /* register classes, both user defined and classes used by screen saver library */ if (!RegisterClasses()) { MessageBox(NULL, TEXT("RegisterClasses() failed"), NULL, MB_ICONHAND); goto restore; } /* a slightly different approach needs to be used when displaying in a preview window */ if (hParent) { style = WS_CHILD; GetClientRect(hParent, &rc); } else { style = WS_POPUP; rc.left = GetSystemMetrics(SM_XVIRTUALSCREEN); rc.top = GetSystemMetrics(SM_YVIRTUALSCREEN); rc.right = GetSystemMetrics(SM_CXVIRTUALSCREEN); rc.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN); style |= WS_VISIBLE; } /* create main screen saver window */ hMainWindow = CreateWindowEx(hParent ? 0 : WS_EX_TOPMOST, CLASS_SCRNSAVE, TEXT("SCREENSAVER"), style, rc.left, rc.top, rc.right, rc.bottom, hParent, NULL, hMainInstance, NULL); /* display window and start pumping messages */ if (hMainWindow) { UpdateWindow(hMainWindow); ShowWindow(hMainWindow, SW_SHOW); while (GetMessage(&msg, NULL, 0, 0) == TRUE) { TranslateMessage(&msg); DispatchMessage(&msg); } } restore: /* restore system */ if (w95 && !fChildPreview) SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, FALSE, &foo, 0); FreeLibrary(hPwdLib); return msg.wParam; }
void csSCF::RegisterClasses (iDocument* doc, const char* context) { RegisterClasses (0, doc, context); }
void csSCF::ScanPluginsInt (csPathsList const* pluginPaths, const char* context) { if (pluginPaths) { // Search plugins in pluginpaths csRef<iStringArray> plugins; size_t i, j; for (i = 0; i < pluginPaths->Length(); i++) { csPathsList::Entry const& pathrec = (*pluginPaths)[i]; if (IsVerbose(SCF_VERBOSE_PLUGIN_SCAN)) { char const* x = scannedDirs.Contains(pathrec.path) ? "re-" : ""; csPrintfErr("SCF_NOTIFY: %sscanning plugin directory: %s " "(context `%s'; recursive %s)\n", x, pathrec.path.GetData(), GetContextName(pathrec.type), pathrec.scanRecursive ? "yes" : "no"); } if (plugins) plugins->Empty(); csRef<iStringArray> messages = csScanPluginDir (pathrec.path, plugins, pathrec.scanRecursive); scannedDirs.Request(pathrec.path); if ((messages != 0) && (messages->GetSize () > 0)) { csPrintfErr("SCF_WARNING: the following issue(s) arose while " "scanning '%s':", pathrec.path.GetData()); for (j = 0; j < messages->GetSize (); j++) csPrintfErr(" %s\n", messages->Get (j)); } csRef<iDocument> metadata; csRef<iString> msg; for (j = 0; j < plugins->GetSize (); j++) { char const* plugin = plugins->Get(j); msg = csGetPluginMetadata (plugin, metadata); if (msg != 0) { csPrintfErr("SCF_ERROR: metadata retrieval error for %s: %s\n", plugin, msg->GetData ()); } // It is possible for an error or warning message to be generated even // when metadata is also obtained. Likewise, it is possible for no // metadata to be obtained yet also to have no error message. The // latter case is indicative of csScanPluginDir() returning "potential" // plugins which turn out to not be Crystal Space plugins after all. // For instance, on Windows, the scan might find a DLL which is not a // Crystal Space DLL; that is, which does not contain embedded // metadata. This is a valid case, which we simply ignore since it is // legal for non-CS libraries to exist alongside CS plugins in the // scanned directories. if (metadata) RegisterClasses(plugin, metadata, context ? context : pathrec.type.GetData()); } } } }