/// \brief Initialisation for things that have the same lifespan as this module.
void CamWnd_Construct(){
- GlobalCommands_insert( "CenterView", FreeCaller<GlobalCamera_ResetAngles>(), Accelerator( GDK_End ) );
+ GlobalCommands_insert( "CenterView", makeCallbackF(GlobalCamera_ResetAngles), Accelerator( GDK_KEY_End ) );
- GlobalToggles_insert( "ToggleCubicClip", FreeCaller<Camera_ToggleFarClip>(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CubicClipZoomIn", FreeCaller<Camera_CubeIn>(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "CubicClipZoomOut", FreeCaller<Camera_CubeOut>(), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalToggles_insert( "ToggleCubicClip", makeCallbackF(Camera_ToggleFarClip), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CubicClipZoomIn", makeCallbackF(Camera_CubeIn), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) );
+ GlobalCommands_insert( "CubicClipZoomOut", makeCallbackF(Camera_CubeOut), Accelerator( ']', (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "UpFloor", FreeCaller<Camera_ChangeFloorUp>(), Accelerator( GDK_Prior ) );
- GlobalCommands_insert( "DownFloor", FreeCaller<Camera_ChangeFloorDown>(), Accelerator( GDK_Next ) );
+ GlobalCommands_insert( "UpFloor", makeCallbackF(Camera_ChangeFloorUp), Accelerator( GDK_KEY_Prior ) );
+ GlobalCommands_insert( "DownFloor", makeCallbackF(Camera_ChangeFloorDown), Accelerator( GDK_KEY_Next ) );
GlobalToggles_insert( "ToggleCamera", ToggleShown::ToggleCaller( g_camera_shown ), ToggleItem::AddCallbackCaller( g_camera_shown.m_item ), Accelerator( 'C', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "LookThroughSelected", makeCallbackF(GlobalCamera_LookThroughSelected) );
- GlobalCommands_insert( "LookThroughCamera", makeCallbackF(GlobalCamera_LookThroughCamera) );
-// GlobalCommands_insert( "LookThroughSelected", FreeCaller<GlobalCamera_LookThroughSelected>() );
-// GlobalCommands_insert( "LookThroughCamera", FreeCaller<GlobalCamera_LookThroughCamera>() );
++// GlobalCommands_insert( "LookThroughSelected", makeCallbackF(GlobalCamera_LookThroughSelected) );
++// GlobalCommands_insert( "LookThroughCamera", makeCallbackF(GlobalCamera_LookThroughCamera) );
if ( g_pGameDescription->mGameType == "doom3" ) {
- GlobalCommands_insert( "TogglePreview", FreeCaller<CamWnd_TogglePreview>(), Accelerator( GDK_F3 ) );
+ GlobalCommands_insert( "TogglePreview", makeCallbackF(CamWnd_TogglePreview), Accelerator( GDK_KEY_F3 ) );
}
- GlobalCommands_insert( "CameraSpeedInc", FreeCaller<CameraSpeed_increase>(), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "CameraSpeedDec", FreeCaller<CameraSpeed_decrease>(), Accelerator( GDK_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CameraSpeedInc", makeCallbackF(CameraSpeed_increase), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "CameraSpeedDec", makeCallbackF(CameraSpeed_decrease), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalShortcuts_insert( "CameraForward", Accelerator( GDK_Up ) );
- GlobalShortcuts_insert( "CameraBack", Accelerator( GDK_Down ) );
- GlobalShortcuts_insert( "CameraLeft", Accelerator( GDK_Left ) );
- GlobalShortcuts_insert( "CameraRight", Accelerator( GDK_Right ) );
- GlobalShortcuts_insert( "CameraStrafeRight", Accelerator( 'D' ) );
- GlobalShortcuts_insert( "CameraStrafeLeft", Accelerator( 'A' ) );
+ GlobalShortcuts_insert( "CameraForward", Accelerator( GDK_KEY_Up ) );
+ GlobalShortcuts_insert( "CameraBack", Accelerator( GDK_KEY_Down ) );
+ GlobalShortcuts_insert( "CameraLeft", Accelerator( GDK_KEY_Left ) );
+ GlobalShortcuts_insert( "CameraRight", Accelerator( GDK_KEY_Right ) );
+ GlobalShortcuts_insert( "CameraStrafeRight", Accelerator( GDK_KEY_period ) );
+ GlobalShortcuts_insert( "CameraStrafeLeft", Accelerator( GDK_KEY_comma ) );
GlobalShortcuts_insert( "CameraUp", accelerator_null() );
GlobalShortcuts_insert( "CameraDown", accelerator_null() );
return edit_menu_item;
}
- void fill_view_xy_top_menu( ui::Menu menu ){
- create_check_menu_item_with_mnemonic( menu, "XY (Top) View", "ToggleView" );
- }
-
-
- void fill_view_yz_side_menu( ui::Menu menu ){
- create_check_menu_item_with_mnemonic( menu, "YZ (Side) View", "ToggleSideView" );
- }
-
-
- void fill_view_xz_front_menu( ui::Menu menu ){
- create_check_menu_item_with_mnemonic( menu, "XZ (Front) View", "ToggleFrontView" );
- }
-
-GtkWidget* g_toggle_z_item = 0;
-GtkWidget* g_toggle_console_item = 0;
-GtkWidget* g_toggle_entity_item = 0;
-GtkWidget* g_toggle_entitylist_item = 0;
+ui::Widget g_toggle_z_item{ui::null};
+ui::Widget g_toggle_console_item{ui::null};
+ui::Widget g_toggle_entity_item{ui::null};
+ui::Widget g_toggle_entitylist_item{ui::null};
-GtkMenuItem* create_view_menu( MainFrame::EViewStyle style ){
+ui::MenuItem create_view_menu( MainFrame::EViewStyle style ){
// View menu
- GtkMenuItem* view_menu_item = new_sub_menu_item_with_mnemonic( "Vie_w" );
- GtkMenu* menu = GTK_MENU( gtk_menu_item_get_submenu( view_menu_item ) );
+ auto view_menu_item = new_sub_menu_item_with_mnemonic( "Vie_w" );
+ auto menu = ui::Menu::from( gtk_menu_item_get_submenu( view_menu_item ) );
if ( g_Layout_enableDetachableMenus.m_value ) {
menu_tearoff( menu );
}