From: Thomas Debesse Date: Mon, 25 May 2020 23:43:55 +0000 (+0200) Subject: Merge commit 'de5fcea3362fe1e6cb68ccfab792469a993da215' into garux-merge X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a0075a3f03af095ee32ded7f101cac79267f906;p=xonotic%2Fnetradiant.git Merge commit 'de5fcea3362fe1e6cb68ccfab792469a993da215' into garux-merge --- 1a0075a3f03af095ee32ded7f101cac79267f906 diff --cc radiant/camwindow.cpp index cc907200,1b36589b..358d1b51 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@@ -1915,32 -1910,32 +1911,32 @@@ void CameraSpeed_decrease() /// \brief Initialisation for things that have the same lifespan as this module. void CamWnd_Construct(){ - GlobalCommands_insert( "CenterView", FreeCaller(), Accelerator( GDK_End ) ); + GlobalCommands_insert( "CenterView", makeCallbackF(GlobalCamera_ResetAngles), Accelerator( GDK_KEY_End ) ); - GlobalToggles_insert( "ToggleCubicClip", FreeCaller(), ToggleItem::AddCallbackCaller( g_getfarclip_item ), Accelerator( '\\', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "CubicClipZoomIn", FreeCaller(), Accelerator( '[', (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "CubicClipZoomOut", FreeCaller(), 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(), Accelerator( GDK_Prior ) ); - GlobalCommands_insert( "DownFloor", FreeCaller(), 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() ); -// GlobalCommands_insert( "LookThroughCamera", FreeCaller() ); ++// GlobalCommands_insert( "LookThroughSelected", makeCallbackF(GlobalCamera_LookThroughSelected) ); ++// GlobalCommands_insert( "LookThroughCamera", makeCallbackF(GlobalCamera_LookThroughCamera) ); if ( g_pGameDescription->mGameType == "doom3" ) { - GlobalCommands_insert( "TogglePreview", FreeCaller(), Accelerator( GDK_F3 ) ); + GlobalCommands_insert( "TogglePreview", makeCallbackF(CamWnd_TogglePreview), Accelerator( GDK_KEY_F3 ) ); } - GlobalCommands_insert( "CameraSpeedInc", FreeCaller(), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "CameraSpeedDec", FreeCaller(), 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() ); diff --cc radiant/camwindow.h index ded8aefc,c40c8fb0..a838e18a --- a/radiant/camwindow.h +++ b/radiant/camwindow.h @@@ -39,8 -41,8 +39,7 @@@ void CamWnd_setParent( CamWnd& camwnd, void GlobalCamera_setCamWnd( CamWnd& camwnd ); - void fill_view_camera_menu( ui::Menu menu ); -typedef struct _GtkToolbar GtkToolbar; -void CamWnd_constructToolbar( GtkToolbar* toolbar ); +void CamWnd_constructToolbar( ui::Toolbar toolbar ); void CamWnd_registerShortcuts(); void GlobalCamera_Benchmark(); diff --cc radiant/mainframe.cpp index 7860a5b9,233a9133..c2efdc3a --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@@ -2046,30 -1897,16 +2046,16 @@@ ui::MenuItem create_edit_menu() 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 ); }