From: Thomas Debesse Date: Tue, 21 Jun 2022 21:54:24 +0000 (+0200) Subject: radiant: less deprecated GTK2 stuff, they are even not supported in GTK3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=19a8ba91339bf0b7d08b1e65a44858481694fd86;p=xonotic%2Fnetradiant.git radiant: less deprecated GTK2 stuff, they are even not supported in GTK3 --- diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index c9f71329..945eac95 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -2067,7 +2067,7 @@ void CameraSpeed_decrease(){ /// \brief Initialisation for things that have the same lifespan as this module. void CamWnd_Construct(){ GlobalCommands_insert( "CenterView", makeCallbackF(GlobalCamera_ResetAngles), Accelerator( GDK_KEY_End ) ); - GlobalCommands_insert( "CameraFocusOnSelected", makeCallbackF( GlobalCamera_FocusOnSelected ), Accelerator( GDK_Tab ) ); + GlobalCommands_insert( "CameraFocusOnSelected", makeCallbackF( GlobalCamera_FocusOnSelected ), Accelerator( GDK_KEY_Tab ) ); 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 ) ); @@ -2115,7 +2115,7 @@ void CamWnd_Construct(){ GlobalShortcuts_insert( "CameraFreeMoveUp", accelerator_null() ); GlobalShortcuts_insert( "CameraFreeMoveDown", accelerator_null() ); - GlobalShortcuts_insert( "CameraFreeFocus", Accelerator( GDK_Tab ) ); + GlobalShortcuts_insert( "CameraFreeFocus", Accelerator( GDK_KEY_Tab ) ); GlobalToggles_insert( "ShowStats", makeCallbackF(ShowStatsToggle), ToggleItem::AddCallbackCaller( g_show_stats ) ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 60e68c18..deb76800 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -35,8 +35,6 @@ #include #include #include -#include - #include "os/path.h" #include "eclasslib.h" @@ -1237,7 +1235,7 @@ void EntityInspector_clearKeyValue(){ } static gint EntityInspector_clearKeyValueKB( GtkEntry* widget, GdkEventKey* event, gpointer data ){ - if ( event->keyval == GDK_Delete ) { + if ( event->keyval == GDK_KEY_Delete ) { EntityInspector_clearKeyValue(); return TRUE; } @@ -1360,7 +1358,7 @@ static gint EntityEntry_keypress( ui::Entry widget, GdkEventKey* event, gpointer } return TRUE; } - if ( event->keyval == GDK_Tab ) { + if ( event->keyval == GDK_KEY_Tab ) { if ( widget._handle == g_entityKeyEntry._handle ) { gtk_window_set_focus( widget.window(), g_entityValueEntry ); } @@ -1370,7 +1368,7 @@ static gint EntityEntry_keypress( ui::Entry widget, GdkEventKey* event, gpointer } return TRUE; } - if ( event->keyval == GDK_Escape ) { + if ( event->keyval == GDK_KEY_Escape ) { // gtk_window_set_focus( widget.window(), NULL ); return TRUE; } @@ -1387,14 +1385,14 @@ void EntityInspector_destroyWindow( ui::Widget widget, gpointer data ){ } static gint EntityInspector_hideWindowKB( GtkWidget* widget, GdkEventKey* event, gpointer data ){ - //if ( event->keyval == GDK_Escape && GTK_WIDGET_VISIBLE( GTK_WIDGET( widget ) ) ) { - if ( event->keyval == GDK_Escape ) { + //if ( event->keyval == GDK_KEY_Escape && GTK_WIDGET_VISIBLE( GTK_WIDGET( widget ) ) ) { + if ( event->keyval == GDK_KEY_Escape ) { //GroupDialog_showPage( g_page_entity ); gtk_widget_hide( GTK_WIDGET( GroupDialog_getWindow() ) ); return TRUE; } /* this doesn't work, if tab is bound (func is not called then) */ - if ( event->keyval == GDK_Tab ) { + if ( event->keyval == GDK_KEY_Tab ) { gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), GTK_WIDGET( g_entityKeyEntry ) ); return TRUE; } diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 6c2d0889..6dc57fc9 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include "string/string.h" #include "scenelib.h" diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 5bd04772..d93a7dc7 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3779,7 +3779,7 @@ void MainFrame_Construct(){ GlobalCommands_insert( "ArbitraryScale", makeCallbackF(DoScaleDlg), Accelerator( 'S', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "BuildMenuCustomize", makeCallbackF(DoBuildMenu) ); - GlobalCommands_insert( "Build_runRecentExecutedBuild", makeCallbackF(Build_runRecentExecutedBuild), Accelerator( GDK_F5 ) ); + GlobalCommands_insert( "Build_runRecentExecutedBuild", makeCallbackF(Build_runRecentExecutedBuild), Accelerator( GDK_KEY_F5 ) ); GlobalCommands_insert( "FindBrush", makeCallbackF(DoFind) ); @@ -3816,8 +3816,8 @@ void MainFrame_Construct(){ GlobalCommands_insert( "ChooseClipperColor", makeCallback( g_ColoursMenu.m_clipper ) ); GlobalCommands_insert( "ChooseOrthoViewNameColor", makeCallback( g_ColoursMenu.m_viewname ) ); - GlobalCommands_insert( "Fullscreen", makeCallbackF( MainFrame_toggleFullscreen ), Accelerator( GDK_F11 ) ); - GlobalCommands_insert( "MaximizeView", makeCallbackF( Maximize_View ), Accelerator( GDK_F12 ) ); + GlobalCommands_insert( "Fullscreen", makeCallbackF( MainFrame_toggleFullscreen ), Accelerator( GDK_KEY_F11 ) ); + GlobalCommands_insert( "MaximizeView", makeCallbackF( Maximize_View ), Accelerator( GDK_KEY_F12 ) ); GlobalCommands_insert( "CSGSubtract", makeCallbackF(CSG_Subtract), Accelerator( 'U', (GdkModifierType)GDK_SHIFT_MASK ) ); diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 173611ad..5dc313b4 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -795,12 +795,12 @@ void Patch_registerCommands(){ GlobalCommands_insert( "PatchCone", makeCallbackF(Patch_Cone) ); GlobalCommands_insert( "PatchSphere", makeCallbackF(Patch_Sphere) ); GlobalCommands_insert( "SimplePatchMesh", makeCallbackF(Patch_Plane), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "PatchInsertFirstColumn", makeCallbackF(Patch_InsertFirstColumn), Accelerator( GDK_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PatchInsertFirstColumn", makeCallbackF(Patch_InsertFirstColumn), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "PatchInsertLastColumn", makeCallbackF(Patch_InsertLastColumn) ); - GlobalCommands_insert( "PatchInsertFirstRow", makeCallbackF(Patch_InsertFirstRow), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "PatchInsertFirstRow", makeCallbackF(Patch_InsertFirstRow), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "PatchInsertLastRow", makeCallbackF(Patch_InsertLastRow) ); GlobalCommands_insert( "PatchDeleteFirstColumn", makeCallbackF(Patch_DeleteFirstColumn) ); - GlobalCommands_insert( "PatchDeleteLastColumn", makeCallbackF(Patch_DeleteLastColumn), Accelerator( GDK_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "PatchDeleteLastColumn", makeCallbackF(Patch_DeleteLastColumn), Accelerator( GDK_KEY_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "PatchDeleteFirstRow", makeCallbackF(Patch_DeleteFirstRow) ); GlobalCommands_insert( "PatchDeleteLastRow", makeCallbackF(Patch_DeleteLastRow) ); GlobalCommands_insert( "InvertCurve", makeCallbackF(Patch_Invert), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) ); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 742e3326..c06994c4 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -3247,8 +3247,8 @@ void XYWindow_Construct(){ GlobalCommands_insert( "ViewSide", makeCallbackF(XY_Side), Accelerator( GDK_KEY_KP_Page_Down ) ); GlobalCommands_insert( "ViewFront", makeCallbackF(XY_Front), Accelerator( GDK_KEY_KP_End ) ); GlobalCommands_insert( "Zoom100", makeCallbackF(XY_Zoom100) ); - GlobalCommands_insert( "CenterXYView", makeCallbackF(XY_Centralize), Accelerator( GDK_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); - GlobalCommands_insert( "XYFocusOnSelected", makeCallbackF(XY_Focus), Accelerator( GDK_grave ) ); + GlobalCommands_insert( "CenterXYView", makeCallbackF(XY_Centralize), Accelerator( GDK_KEY_Tab, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); + GlobalCommands_insert( "XYFocusOnSelected", makeCallbackF(XY_Focus), Accelerator( GDK_KEY_grave ) ); GlobalPreferenceSystem().registerPreference( "ClipCaulk", make_property_string( g_clip_useCaulk ) );