コード例 #1
0
ファイル: multimon.cpp プロジェクト: ChunHungLiu/GtkRadiant
void MultiMon_Construct()
{
  // detect multiple monitors

  GdkScreen* screen = gdk_display_get_default_screen(gdk_display_get_default());
  gint m = gdk_screen_get_n_monitors(screen);
  globalOutputStream() << "default screen has " << m << " monitors\n";
  for(int j = 0; j != m; ++j)
  {
    GdkRectangle geom;
    gdk_screen_get_monitor_geometry(screen, j, &geom);
    globalOutputStream() << "monitor " << j << " geometry: " << geom.x << ", " << geom.y << ", " << geom.width << ", " << geom.height << "\n";
    if(j == 0)
    {
      // I am making the assumption that monitor 0 is always the primary monitor on win32. Tested on WinXP with gtk+-2.4.
      primaryMonitor = geom;
    }
  }

  if(m > 1)
  {
    g_multimon_globals.m_bStartOnPrimMon = true;
  }

  GlobalPreferenceSystem().registerPreference("StartOnPrimMon", BoolImportStringCaller(g_multimon_globals.m_bStartOnPrimMon), BoolExportStringCaller(g_multimon_globals.m_bStartOnPrimMon));
  GlobalPreferenceSystem().registerPreference("NoSysMenuPopups", BoolImportStringCaller(g_Multimon_enableSysMenuPopups.m_latched), BoolExportStringCaller(g_Multimon_enableSysMenuPopups.m_latched));

  g_Multimon_enableSysMenuPopups.useLatched();

  PreferencesDialog_addInterfacePreferences(FreeCaller1<PreferencesPage&, MultiMonitor_constructPreferences>());
}
コード例 #2
0
ファイル: brushmodule.cpp プロジェクト: raynorpat/cake
void Brush_Construct(EBrushType type)
{
  if(type == eBrushTypeQuake3)
  {
    g_showAlternativeTextureProjectionOption = true;

    GlobalPreferenceSystem().registerPreference(
      "AlternativeTextureProjection",
      BoolImportStringCaller(g_useAlternativeTextureProjection.m_latched),
      BoolExportStringCaller(g_useAlternativeTextureProjection.m_latched)
    );
    g_useAlternativeTextureProjection.useLatched();

    if(g_useAlternativeTextureProjection.m_value)
    {
      type = eBrushTypeQuake3BP;
    }
    
    // d1223m
    GlobalPreferenceSystem().registerPreference(
      "BrushAlwaysCaulk", 
      BoolImportStringCaller(g_brush_always_caulk), 
      BoolExportStringCaller(g_brush_always_caulk));
  }

  Brush_registerCommands();
  Brush_registerPreferencesPage();

  BrushFilters_construct();

  BrushClipPlane::constructStatic();
  BrushInstance::constructStatic();
  Brush::constructStatic(type);

  Brush::m_maxWorldCoord = g_MaxWorldCoord;
  BrushInstance::m_counter = &g_brushCount;

  g_texdef_default_scale = 0.5f;
  const char* value = g_pGameDescription->getKeyValue("default_scale");
  if(!string_empty(value))
  {
    float scale = static_cast<float>(atof(value));
    if(scale != 0)
    {
      g_texdef_default_scale = scale;
    }
    else
    {
      globalErrorStream() << "error parsing \"default_scale\" attribute\n";
    }
  }

  GlobalPreferenceSystem().registerPreference("TextureLock", BoolImportStringCaller(g_brush_texturelock_enabled), BoolExportStringCaller(g_brush_texturelock_enabled));
  GlobalPreferenceSystem().registerPreference("BrushSnapPlanes", makeBoolStringImportCallback(FaceImportSnapPlanesCaller()), makeBoolStringExportCallback(FaceExportSnapPlanesCaller()));
  GlobalPreferenceSystem().registerPreference("TexdefDefaultScale", FloatImportStringCaller(g_texdef_default_scale), FloatExportStringCaller(g_texdef_default_scale));

  GridStatus_getTextureLockEnabled = getTextureLockEnabled;
  g_texture_lock_status_changed = FreeCaller<GridStatus_onTextureLockEnabledChanged>();
}
コード例 #3
0
ファイル: entity.cpp プロジェクト: ChunHungLiu/GtkRadiant
void Entity_Construct()
{
  GlobalCommands_insert("EntityColor", FreeCaller<Entity_setColour>(), Accelerator('K'));
  GlobalCommands_insert("ConnectSelection", FreeCaller<Entity_connectSelected>(), Accelerator('K', (GdkModifierType)GDK_CONTROL_MASK));
  GlobalCommands_insert("UngroupSelection", FreeCaller<Entity_ungroupSelected>());

  GlobalPreferenceSystem().registerPreference("SI_Colors5", Vector3ImportStringCaller(g_entity_globals.color_entity), Vector3ExportStringCaller(g_entity_globals.color_entity));
  GlobalPreferenceSystem().registerPreference("LastLightIntensity", IntImportStringCaller(g_iLastLightIntensity), IntExportStringCaller(g_iLastLightIntensity));

  Entity_registerPreferencesPage();
}
コード例 #4
0
ファイル: mru.cpp プロジェクト: clbr/netradiant
void MRU_Construct()
{
  GlobalPreferenceSystem().registerPreference("Count", SizeImportStringCaller(MRU_used), SizeExportStringCaller(MRU_used));
  
  for(std::size_t i = 0; i != MRU_MAX; ++i)
  {
    GlobalPreferenceSystem().registerPreference(MRU_keys[i], CopiedStringImportStringCaller(MRU_filenames[i]), CopiedStringExportStringCaller(MRU_filenames[i]));
  }

  MRU_Init();
}
コード例 #5
0
ファイル: entity.cpp プロジェクト: xonotic/netradient
void Entity_Construct(){
	GlobalCommands_insert( "EntityColor", makeCallbackF(Entity_setColour), Accelerator( 'K' ) );
	GlobalCommands_insert( "NormalizeColor", makeCallbackF(Entity_normalizeColor) );
	GlobalCommands_insert( "ConnectSelection", makeCallbackF(Entity_connectSelected), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) );
	GlobalCommands_insert( "KillConnectSelection", makeCallbackF(Entity_killconnectSelected), Accelerator( 'K', (GdkModifierType)( GDK_SHIFT_MASK ) ) );
	GlobalCommands_insert( "GroupSelection", makeCallbackF(Entity_groupSelected) );
	GlobalCommands_insert( "UngroupSelection", makeCallbackF(Entity_ungroupSelected) );

	GlobalPreferenceSystem().registerPreference( "SI_Colors5", make_property_string( g_entity_globals.color_entity ) );
	GlobalPreferenceSystem().registerPreference( "LastLightIntensity", make_property_string( g_iLastLightIntensity ) );

	Entity_registerPreferencesPage();
}
コード例 #6
0
ファイル: MRU.cpp プロジェクト: codereader/DarkRadiant
// Construct the MRU preference page and add it to the given group
void MRU::constructPreferences()
{
	IPreferencePage& page = GlobalPreferenceSystem().getPage(_("Settings/Map Files"));

	page.appendEntry(_("Number of most recently used files"), RKEY_MRU_LENGTH);
	page.appendCheckBox(_("Open last map on startup"), RKEY_LOAD_LAST_MAP);
}
コード例 #7
0
ファイル: GlobalXYWnd.cpp プロジェクト: chrisglass/ufoai
// Constructor
XYWndManager::XYWndManager() :
	_activeXY(NULL), _globalParentWindow(NULL)
{
	// Connect self to the according registry keys
	GlobalRegistry().addKeyObserver(this, RKEY_CHASE_MOUSE);
	GlobalRegistry().addKeyObserver(this, RKEY_CAMERA_XY_UPDATE);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_CROSSHAIRS);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_GRID);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_SIZE_INFO);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_ENTITY_ANGLES);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_ENTITY_NAMES);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_BLOCKS);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_COORDINATES);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_OUTLINE);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_AXES);
	GlobalRegistry().addKeyObserver(this, RKEY_SHOW_WORKZONE);
	GlobalRegistry().addKeyObserver(this, RKEY_DEFAULT_BLOCKSIZE);
	GlobalRegistry().addKeyObserver(this, RKEY_ALWAYS_CAULK_FOR_NEW_BRUSHES);
	GlobalRegistry().addKeyObserver(this, RKEY_CAULK_TEXTURE);

	// Trigger loading the values of the observed registry keys
	keyChanged("", "");

	// greebo: Register this class in the preference system so that the constructPreferencePage() gets called.
	GlobalPreferenceSystem().addConstructor(this);

	// Add the commands to the EventManager
	registerCommands();
}
コード例 #8
0
void MediaBrowser::registerCommandsAndPreferences()
{
	// Add a page to the given group
	PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Media Browser"));
	page->appendCheckBox("", _("Load media tree at startup"), RKEY_MEDIA_BROWSER_PRELOAD);

	GlobalCommandSystem().addCommand("ToggleMediaBrowser", toggle);
	GlobalEventManager().addCommand("ToggleMediaBrowser", "ToggleMediaBrowser");
}
コード例 #9
0
ファイル: entity.cpp プロジェクト: Garux/netradiant-custom
void Entity_Construct(){
	GlobalCommands_insert( "EntityColorSet", FreeCaller<Entity_setColour>(), Accelerator( 'K' ) );
	GlobalCommands_insert( "EntityColorNormalize", FreeCaller<Entity_normalizeColor>() );
	GlobalCommands_insert( "EntitiesConnect", FreeCaller<Entity_connectSelected>(), Accelerator( 'K', (GdkModifierType)GDK_CONTROL_MASK ) );
	if ( g_pGameDescription->mGameType == "nexuiz" || g_pGameDescription->mGameType == "q1" )
		GlobalCommands_insert( "EntitiesKillConnect", FreeCaller<Entity_killconnectSelected>(), Accelerator( 'K', (GdkModifierType)GDK_SHIFT_MASK ) );
	GlobalCommands_insert( "EntityMovePrimitivesToLast", FreeCaller<Entity_moveSelectedPrimitivesToLast>(), Accelerator( 'M', (GdkModifierType)GDK_CONTROL_MASK ) );
	GlobalCommands_insert( "EntityMovePrimitivesToFirst", FreeCaller<Entity_moveSelectedPrimitivesToFirst>() );
	GlobalCommands_insert( "EntityUngroup", FreeCaller<Entity_ungroup>() );
	GlobalCommands_insert( "EntityUngroupPrimitives", FreeCaller<Entity_ungroupSelectedPrimitives>() );

	GlobalToggles_insert( "ShowLightRadiuses", FreeCaller<ToggleShowLightRadii>(), ToggleItem::AddCallbackCaller( g_show_lightradii_item ) );

	GlobalPreferenceSystem().registerPreference( "SI_Colors5", Vector3ImportStringCaller( g_entity_globals.color_entity ), Vector3ExportStringCaller( g_entity_globals.color_entity ) );
	GlobalPreferenceSystem().registerPreference( "LastLightIntensity", IntImportStringCaller( g_iLastLightIntensity ), IntExportStringCaller( g_iLastLightIntensity ) );

	Entity_registerPreferencesPage();
}
コード例 #10
0
void Doom3PatchCreator::initialiseModule(const ApplicationContext& ctx)
{
	rMessage() << getName() << "::initialiseModule called." << std::endl;

	registerPatchCommands();

	// Construct and Register the patch-related preferences
	PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Patch"));
	page->appendEntry(_("Patch Subdivide Threshold"), RKEY_PATCH_SUBDIVIDE_THRESHOLD);
}
コード例 #11
0
ファイル: BrushModule.cpp プロジェクト: ameyp/DarkRadiant
void BrushModuleClass::constructPreferences() {
    // Add a page to the given group
    PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Primitives"));

    // Add the default texture scale preference and connect it to the according registryKey
    // Note: this should be moved somewhere else, I think
    page->appendEntry(_("Default texture scale"), "user/ui/textures/defaultTextureScale");

    // The checkbox to enable/disable the texture lock option
    page->appendCheckBox("", _("Enable Texture Lock (for Brushes)"), "user/ui/brush/textureLock");
}
コード例 #12
0
ファイル: entity.cpp プロジェクト: clbr/netradiant
void Entity_Construct(EGameType gameType)
{
  g_gameType = gameType;
  if(g_gameType == eGameTypeDoom3)
  {
    g_targetable_nameKey = "name";

    Static<KeyIsName>::instance().m_keyIsName = keyIsNameDoom3;
    Static<KeyIsName>::instance().m_nameKey = "name";
  }
  else
  {
    Static<KeyIsName>::instance().m_keyIsName = keyIsNameQuake3;
    Static<KeyIsName>::instance().m_nameKey = "targetname";
  }

  GlobalPreferenceSystem().registerPreference("SI_ShowNames", BoolImportStringCaller(g_showNames), BoolExportStringCaller(g_showNames));
  GlobalPreferenceSystem().registerPreference("SI_ShowAngles", BoolImportStringCaller(g_showAngles), BoolExportStringCaller(g_showAngles));
  GlobalPreferenceSystem().registerPreference("NewLightStyle", BoolImportStringCaller(g_newLightDraw), BoolExportStringCaller(g_newLightDraw));
  GlobalPreferenceSystem().registerPreference("LightRadiuses", BoolImportStringCaller(g_lightRadii), BoolExportStringCaller(g_lightRadii));

  Entity_InitFilters();
  LightType lightType = LIGHTTYPE_DEFAULT;
  if(g_gameType == eGameTypeRTCW)
  {
    lightType = LIGHTTYPE_RTCW;
  }
  else if(g_gameType == eGameTypeDoom3)
  {
    lightType = LIGHTTYPE_DOOM3;
  }
  Light_Construct(lightType);
  MiscModel_construct();
  Doom3Group_construct();

  RenderablePivot::StaticShader::instance() = GlobalShaderCache().capture("$PIVOT");

  GlobalShaderCache().attachRenderable(StaticRenderableConnectionLines::instance());
}
コード例 #13
0
ファイル: MapCompiler.cpp プロジェクト: ibrahimmusba/ufoai
MapCompiler::MapCompiler ()
{
	GlobalRegistry().addKeyObserver(this, RKEY_ERROR_CHECK_PARAMETERS);
	GlobalRegistry().addKeyObserver(this, RKEY_ERROR_FIX_PARAMETERS);
	GlobalRegistry().addKeyObserver(this, RKEY_COMPILER_BINARY);
	GlobalRegistry().addKeyObserver(this, RKEY_COMPILE_PARAMETERS);
	GlobalRegistry().addKeyObserver(this, RKEY_MATERIAL_PARAMETERS);

	// greebo: Register this class in the preference system so that the constructPreferencePage() gets called.
	GlobalPreferenceSystem().addConstructor(this);

	keyChanged("", "");
}
コード例 #14
0
ファイル: entitylist.cpp プロジェクト: clbr/netradiant
void EntityList_Construct()
{
  graph_tree_model_insert(scene_graph_get_tree_model(), StaticNullSelectedInstance::instance());

  g_EntityList = new EntityList;

  getEntityList().m_positionTracker.setPosition(c_default_window_pos);

  GlobalPreferenceSystem().registerPreference("EntityInfoDlg", WindowPositionTrackerImportStringCaller(getEntityList().m_positionTracker), WindowPositionTrackerExportStringCaller(getEntityList().m_positionTracker));

  typedef FreeCaller1<const Selectable&, EntityList_SelectionChanged> EntityListSelectionChangedCaller;
  GlobalSelectionSystem().addSelectionChangeCallback(EntityListSelectionChangedCaller());
}
コード例 #15
0
ファイル: AutoSaver.cpp プロジェクト: BielBdeLuna/DarkRadiant
void AutoMapSaver::constructPreferences()
{
	// Add a page to the given group
	PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Autosave"));

	// Add the checkboxes and connect them with the registry key and the according observer
	page->appendCheckBox("", _("Enable Autosave"), RKEY_AUTOSAVE_ENABLED);
	page->appendSlider(_("Autosave Interval (in minutes)"), RKEY_AUTOSAVE_INTERVAL, TRUE, 5, 1, 61, 1, 1, 1);

	page->appendCheckBox("", _("Save Snapshots"), RKEY_AUTOSAVE_SNAPSHOTS_ENABLED);
	page->appendEntry(_("Snapshot folder (relative to map folder)"), RKEY_AUTOSAVE_SNAPSHOTS_FOLDER);
	page->appendEntry(_("Max Snapshot Folder size (MB)"), RKEY_AUTOSAVE_MAX_SNAPSHOT_FOLDER_SIZE);
}
コード例 #16
0
ファイル: mainframe.cpp プロジェクト: AresAndy/ufoai
MainFrame::MainFrame () :
	m_window(0), g_currentToolMode(0), g_defaultToolMode(0), m_idleRedrawStatusText(RedrawStatusTextCaller(*this))
{
	m_pCamWnd = 0;

	for (int n = 0; n < c_count_status; n++) {
		m_pStatusLabel[n] = 0;
	}

	// Register this class in the preference system so that the constructPreferencePage() gets called.
	GlobalPreferenceSystem().addConstructor(this);

	Create();
}
コード例 #17
0
ファイル: entity.cpp プロジェクト: xonotic/netradient
const char *getLastModelFolderPath(){
	if ( g_strLastModelFolder.empty() ) {
		GlobalPreferenceSystem().registerPreference( "LastModelFolder", make_property_string( g_strLastModelFolder ) );
		if ( g_strLastModelFolder.empty() ) {
			StringOutputStream buffer( 1024 );
			buffer << g_qeglobals.m_userGamePath.c_str() << "models/";
			if ( !file_readable( buffer.c_str() ) ) {
				// just go to fsmain
				buffer.clear();
				buffer << g_qeglobals.m_userGamePath.c_str() << "/";
			}
			g_strLastModelFolder = buffer.c_str();
		}
	}
	return g_strLastModelFolder.c_str();
}
コード例 #18
0
ファイル: GameManager.cpp プロジェクト: AresAndy/ufoai
GameManager::GameManager () :
	_currentGameDescription(0), _enginePath(GlobalRegistry().get(RKEY_ENGINE_PATH)), _cleanedEnginePath(
			DirectoryCleaned(_enginePath)), _emptyString("")
{
	GlobalRegistry().addKeyObserver(this, RKEY_ENGINE_PATH);

	// greebo: Register this class in the preference system so that the constructPreferencePage() gets called.
	GlobalPreferenceSystem().addConstructor(this);

	// TODO Remove this and read the game.xml data from the xmlregistry, too
	std::string strGameFilename = Environment::Instance().getAppPath() + "game.xml";

	xmlDocPtr pDoc = xmlParseFile(strGameFilename.c_str());
	if (pDoc) {
		_currentGameDescription = new GameDescription(pDoc, strGameFilename);
		// Import this information into the registry
		//GlobalRegistry().importFromFile(strGameFilename, "");
		xmlFreeDoc(pDoc);
	} else {
		gtkutil::errorDialog(_("XML parser failed to parse game.xml"));
	}

	initialise();
}
コード例 #19
0
ファイル: Clipper.cpp プロジェクト: DerSaidin/DarkRadiant
void Clipper::constructPreferences() {
	PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Clipper"));

	page->appendCheckBox("", _("Clipper tool uses caulk texture"), RKEY_CLIPPER_USE_CAULK);
	page->appendEntry(_("Caulk shader name"), RKEY_CLIPPER_CAULK_SHADER);
}
コード例 #20
0
void GroupDialog_Construct()
{
  GlobalPreferenceSystem().registerPreference("EntityWnd", WindowPositionTrackerImportStringCaller(g_GroupDlg.m_position_tracker), WindowPositionTrackerExportStringCaller(g_GroupDlg.m_position_tracker));

  GlobalCommands_insert("ViewEntityInfo", FreeCaller<GroupDialog_ToggleShow>(), Accelerator('N'));
}
コード例 #21
0
ファイル: UndoSystem.cpp プロジェクト: stiffsen/DarkRadiant
 // Gets called by the PreferenceSystem as request to create the according settings page
 void constructPreferences() {
     PreferencesPagePtr page = GlobalPreferenceSystem().getPage(_("Settings/Undo System"));
     page->appendSpinner(_("Undo Queue Size"), RKEY_UNDO_QUEUE_SIZE, 0, 1024, 1);
 }
コード例 #22
0
ファイル: build.cpp プロジェクト: raynorpat/cake
void BuildMenu_Construct()
{
  GlobalPreferenceSystem().registerPreference("BuildMenu", CopiedStringImportStringCaller(g_buildMenu), CopiedStringExportStringCaller(g_buildMenu));
  LoadBuildMenu();
}