void EditorApplication::onStartUp() { // Find the path to data files //// First, look for EditorData folder in the direct descendant of the working directory if (FileSystem::exists("EditorData")) { mBuiltinDataPath = FileSystem::getWorkingDirectoryPath(); mBuiltinDataPath.append("EditorData/"); } else { // Then check the source distribution itself, in case we're running directly from the build directory mBuiltinDataPath = Path(RAW_APP_ROOT) + Path("Data/"); if (!FileSystem::exists(mBuiltinDataPath)) LOGERR("Cannot find builtin assets for the editor at path '" + mBuiltinDataPath.toString() + "'."); } Application::onStartUp(); // In editor we render game on a separate surface, handled in Game window SceneManager::instance().setMainRenderTarget(nullptr); loadEditorSettings(); mProjectSettings = bs_shared_ptr_new<ProjectSettings>(); ScriptCodeImporter* scriptCodeImporter = bs_new<ScriptCodeImporter>(); Importer::instance()._registerAssetImporter(scriptCodeImporter); // Hidden dependency: Needs to be done before BuiltinEditorResources import as shader include lookup requires it ProjectLibrary::startUp(); BuiltinEditorResources::startUp(); { auto inputConfig = VirtualInput::instance().getConfiguration(); inputConfig->registerButton("Copy", BC_C, ButtonModifier::Ctrl); inputConfig->registerButton("Cut", BC_X, ButtonModifier::Ctrl); inputConfig->registerButton("Paste", BC_V, ButtonModifier::Ctrl); } UndoRedo::startUp(); EditorWindowManager::startUp(); EditorWidgetManager::startUp(); DropDownWindowManager::startUp(); ScenePicking::startUp(); Selection::startUp(); GizmoManager::startUp(); BuildManager::startUp(); CodeEditorManager::startUp(); MainEditorWindow::create(getPrimaryWindow()); ScriptManager::startUp(); }
/** Register mouse and keyboard inputs that will be used for controlling the camera. */ void setUpInput() { // Register input configuration // Banshee allows you to use VirtualInput system which will map input device buttons // and axes to arbitrary names, which allows you to change input buttons without affecting // the code that uses it, since the code is only aware of the virtual names. // If you want more direct input, see Input class. auto inputConfig = VirtualInput::instance().getConfiguration(); // Camera controls for buttons (digital 0-1 input, e.g. keyboard or gamepad button) inputConfig->registerButton("Forward", BC_W); inputConfig->registerButton("Back", BC_S); inputConfig->registerButton("Left", BC_A); inputConfig->registerButton("Right", BC_D); inputConfig->registerButton("Forward", BC_UP); inputConfig->registerButton("Back", BC_BACK); inputConfig->registerButton("Left", BC_LEFT); inputConfig->registerButton("Right", BC_RIGHT); inputConfig->registerButton("FastMove", BC_LSHIFT); inputConfig->registerButton("RotateObj", BC_MOUSE_LEFT); inputConfig->registerButton("RotateCam", BC_MOUSE_RIGHT); // Camera controls for axes (analog input, e.g. mouse or gamepad thumbstick) // These return values in [-1.0, 1.0] range. inputConfig->registerAxis("Horizontal", VIRTUAL_AXIS_DESC((UINT32)InputAxis::MouseX)); inputConfig->registerAxis("Vertical", VIRTUAL_AXIS_DESC((UINT32)InputAxis::MouseY)); }
static Bool shotInit (CompPlugin *p) { if (getCoreABI() != CORE_ABIVERSION) { compLogMessage ("screenshot", CompLogLevelError, "ABI mismatch\n" "\tPlugin was compiled with ABI: %d\n" "\tFusilli Core was compiled with ABI: %d\n", CORE_ABIVERSION, getCoreABI()); return FALSE; } displayPrivateIndex = allocateDisplayPrivateIndex (); if (displayPrivateIndex < 0) return FALSE; bananaIndex = bananaLoadPlugin ("screenshot"); if (bananaIndex == -1) return FALSE; bananaAddChangeNotifyCallBack (bananaIndex, shotChangeNotify); const BananaValue * option_initiate_button = bananaGetOption (bananaIndex, "initiate_button", -1); registerButton (option_initiate_button->s, &initiate_button); return TRUE; }
/* * groupInitDisplay * */ static Bool groupInitDisplay (CompPlugin *p, CompDisplay *d) { GroupDisplay *gd; gd = malloc (sizeof (GroupDisplay)); if (!gd) return FALSE; gd->screenPrivateIndex = allocateScreenPrivateIndex (); if (gd->screenPrivateIndex < 0) { free (gd); return FALSE; } gd->glowTextureProperties = (GlowTextureProperties*) glowTextureProperties; gd->ignoreMode = FALSE; gd->lastRestackedGroup = NULL; gd->resizeInfo = NULL; gd->groupWinPropertyAtom = XInternAtom (d->display, "_COMPIZ_GROUP", 0); gd->resizeNotifyAtom = XInternAtom (d->display, "_COMPIZ_RESIZE_NOTIFY", 0); WRAP (gd, d, handleEvent, groupHandleEvent); const BananaValue * option_select_button = bananaGetOption (bananaIndex, "select_button", -1); registerButton (option_select_button->s, &gd->select_button); const BananaValue * option_select_single_key = bananaGetOption (bananaIndex, "select_single_key", -1); registerKey (option_select_single_key->s, &gd->select_single_key); const BananaValue * option_group_key = bananaGetOption (bananaIndex, "group_key", -1); registerKey (option_group_key->s, &gd->group_key); const BananaValue * option_ungroup_key = bananaGetOption (bananaIndex, "ungroup_key", -1); registerKey (option_ungroup_key->s, &gd->ungroup_key); const BananaValue * option_remove_key = bananaGetOption (bananaIndex, "remove_key", -1); registerKey (option_remove_key->s, &gd->remove_key); const BananaValue * option_close_key = bananaGetOption (bananaIndex, "close_key", -1); registerKey (option_close_key->s, &gd->close_key); const BananaValue * option_ignore_key = bananaGetOption (bananaIndex, "ignore_key", -1); registerKey (option_ignore_key->s, &gd->ignore_key); const BananaValue * option_tabmode_key = bananaGetOption (bananaIndex, "tabmode_key", -1); registerKey (option_tabmode_key->s, &gd->tabmode_key); const BananaValue * option_change_tab_left_key = bananaGetOption (bananaIndex, "change_tab_left_key", -1); registerKey (option_change_tab_left_key->s, &gd->change_tab_left_key); const BananaValue * option_change_tab_right_key = bananaGetOption (bananaIndex, "change_tab_right_key", -1); registerKey (option_change_tab_right_key->s, &gd->change_tab_right_key); const BananaValue * option_change_color_key = bananaGetOption (bananaIndex, "change_color_key", -1); registerKey (option_change_color_key->s, &gd->change_color_key); d->privates[displayPrivateIndex].ptr = gd; srand (time (NULL)); return TRUE; }