From 980ee7fd1f5bd8c1625f05cc21a32bf3a9eca6fc Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 23 Jul 2017 16:32:43 +1000 Subject: [PATCH] Use non-deprecated GDK key constants --- libs/gtkutil/accelerator.cpp | 6 ++--- libs/gtkutil/messagebox.cpp | 8 +++--- libs/gtkutil/nonmodal.cpp | 8 +++--- radiant/build.cpp | 4 +-- radiant/camwindow.cpp | 52 ++++++++++++++++++------------------ radiant/commands.cpp | 4 +-- radiant/entityinspector.cpp | 6 ++--- radiant/gtkdlgs.cpp | 18 ++++++------- radiant/mainframe.cpp | 46 +++++++++++++++---------------- radiant/patchdialog.cpp | 4 +-- radiant/patchmanip.cpp | 8 +++--- radiant/select.cpp | 8 +++--- radiant/windowobservers.cpp | 24 ++++++++--------- 13 files changed, 98 insertions(+), 98 deletions(-) diff --git a/libs/gtkutil/accelerator.cpp b/libs/gtkutil/accelerator.cpp index e55ff5fc..606f505e 100644 --- a/libs/gtkutil/accelerator.cpp +++ b/libs/gtkutil/accelerator.cpp @@ -56,7 +56,7 @@ unsigned int global_keys_find( const char* name ){ return 0; } k = gdk_keyval_from_name( name ); - if ( k == GDK_VoidSymbol ) { + if ( k == GDK_KEY_VoidSymbol ) { return 0; } return k; @@ -109,8 +109,8 @@ bool accelerator_map_erase( AcceleratorMap& acceleratorMap, Accelerator accelera Accelerator accelerator_for_event_key( guint keyval, guint state ){ keyval = gdk_keyval_to_upper( keyval ); - if ( keyval == GDK_ISO_Left_Tab ) { - keyval = GDK_Tab; + if ( keyval == GDK_KEY_ISO_Left_Tab ) { + keyval = GDK_KEY_Tab; } return Accelerator( keyval, (GdkModifierType)( state & gtk_accelerator_get_default_mod_mask() ) ); } diff --git a/libs/gtkutil/messagebox.cpp b/libs/gtkutil/messagebox.cpp index ca3fb321..97c77ee8 100644 --- a/libs/gtkutil/messagebox.cpp +++ b/libs/gtkutil/messagebox.cpp @@ -110,8 +110,8 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha if ( type == eMB_OK ) { auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); widget_make_default( button ); button.show(); @@ -121,7 +121,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha { auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); widget_make_default( button ); button.show(); } @@ -129,7 +129,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha { GtkButton* button = create_modal_dialog_button( "OK", cancel_button ); gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); gtk_widget_show( GTK_WIDGET( button ) ); } diff --git a/libs/gtkutil/nonmodal.cpp b/libs/gtkutil/nonmodal.cpp index ef05f26e..97c4bce2 100644 --- a/libs/gtkutil/nonmodal.cpp +++ b/libs/gtkutil/nonmodal.cpp @@ -40,7 +40,7 @@ gboolean NonModalEntry::changed(ui::Entry entry, NonModalEntry *self) gboolean NonModalEntry::enter(ui::Entry entry, GdkEventKey *event, NonModalEntry *self) { - if (event->keyval == GDK_Return) { + if (event->keyval == GDK_KEY_Return) { self->m_apply(); self->m_editing = false; gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL); @@ -51,7 +51,7 @@ gboolean NonModalEntry::enter(ui::Entry entry, GdkEventKey *event, NonModalEntry gboolean NonModalEntry::escape(ui::Entry entry, GdkEventKey *event, NonModalEntry *self) { - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { self->m_cancel(); self->m_editing = false; gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL); @@ -77,7 +77,7 @@ gboolean NonModalSpinner::changed(ui::SpinButton spin, NonModalSpinner *self) gboolean NonModalSpinner::enter(ui::SpinButton spin, GdkEventKey *event, NonModalSpinner *self) { - if (event->keyval == GDK_Return) { + if (event->keyval == GDK_KEY_Return) { gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL); return TRUE; } @@ -86,7 +86,7 @@ gboolean NonModalSpinner::enter(ui::SpinButton spin, GdkEventKey *event, NonModa gboolean NonModalSpinner::escape(ui::SpinButton spin, GdkEventKey *event, NonModalSpinner *self) { - if (event->keyval == GDK_Escape) { + if (event->keyval == GDK_KEY_Escape) { self->m_cancel(); gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL); return TRUE; diff --git a/radiant/build.cpp b/radiant/build.cpp index 9b24958b..1a2efe25 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -711,7 +711,7 @@ gboolean project_cell_edited( GtkCellRendererText* cell, gchar* path_string, gch gboolean project_key_press( ui::Widget widget, GdkEventKey* event, ProjectList* projectList ){ Project& project = projectList->m_project; - if ( event->keyval == GDK_Delete ) { + if ( event->keyval == GDK_KEY_Delete ) { GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) ); GtkTreeIter iter; GtkTreeModel* model; @@ -816,7 +816,7 @@ gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, ui::ListStor } Build& build = *g_current_build; - if ( event->keyval == GDK_Delete ) { + if ( event->keyval == GDK_KEY_Delete ) { GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) ); GtkTreeIter iter; GtkTreeModel* model; diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index df3bf3c8..7916f81c 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -959,19 +959,19 @@ void CamWnd_registerCommands( CamWnd& camwnd ){ ReferenceCaller( camwnd.getCamera() ) ); - GlobalKeyEvents_insert( "CameraFreeMoveForward", Accelerator( GDK_Up ), + GlobalKeyEvents_insert( "CameraFreeMoveForward", Accelerator( GDK_KEY_Up ), FreeMoveCameraMoveForwardKeyDownCaller( camwnd.getCamera() ), FreeMoveCameraMoveForwardKeyUpCaller( camwnd.getCamera() ) ); - GlobalKeyEvents_insert( "CameraFreeMoveBack", Accelerator( GDK_Down ), + GlobalKeyEvents_insert( "CameraFreeMoveBack", Accelerator( GDK_KEY_Down ), FreeMoveCameraMoveBackKeyDownCaller( camwnd.getCamera() ), FreeMoveCameraMoveBackKeyUpCaller( camwnd.getCamera() ) ); - GlobalKeyEvents_insert( "CameraFreeMoveLeft", Accelerator( GDK_Left ), + GlobalKeyEvents_insert( "CameraFreeMoveLeft", Accelerator( GDK_KEY_Left ), FreeMoveCameraMoveLeftKeyDownCaller( camwnd.getCamera() ), FreeMoveCameraMoveLeftKeyUpCaller( camwnd.getCamera() ) ); - GlobalKeyEvents_insert( "CameraFreeMoveRight", Accelerator( GDK_Right ), + GlobalKeyEvents_insert( "CameraFreeMoveRight", Accelerator( GDK_KEY_Right ), FreeMoveCameraMoveRightKeyDownCaller( camwnd.getCamera() ), FreeMoveCameraMoveRightKeyUpCaller( camwnd.getCamera() ) ); @@ -984,12 +984,12 @@ void CamWnd_registerCommands( CamWnd& camwnd ){ FreeMoveCameraMoveDownKeyUpCaller( camwnd.getCamera() ) ); - GlobalCommands_insert( "CameraForward", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_Up ) ); - GlobalCommands_insert( "CameraBack", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_Down ) ); - GlobalCommands_insert( "CameraLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_Left ) ); - GlobalCommands_insert( "CameraRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_Right ) ); - GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_period ) ); - GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_comma ) ); + GlobalCommands_insert( "CameraForward", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Up ) ); + GlobalCommands_insert( "CameraBack", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Down ) ); + GlobalCommands_insert( "CameraLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Left ) ); + GlobalCommands_insert( "CameraRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_Right ) ); + GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_period ) ); + GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller( camwnd.getCamera() ), Accelerator( GDK_KEY_comma ) ); GlobalCommands_insert( "CameraUp", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'D' ) ); GlobalCommands_insert( "CameraDown", ReferenceCaller( camwnd.getCamera() ), Accelerator( 'C' ) ); @@ -1878,42 +1878,42 @@ 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", FreeCaller(), 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 ) ); - GlobalCommands_insert( "UpFloor", FreeCaller(), Accelerator( GDK_Prior ) ); - GlobalCommands_insert( "DownFloor", FreeCaller(), Accelerator( GDK_Next ) ); + GlobalCommands_insert( "UpFloor", FreeCaller(), Accelerator( GDK_KEY_Prior ) ); + GlobalCommands_insert( "DownFloor", FreeCaller(), 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", FreeCaller() ); GlobalCommands_insert( "LookThroughCamera", FreeCaller() ); if ( g_pGameDescription->mGameType == "doom3" ) { - GlobalCommands_insert( "TogglePreview", FreeCaller(), Accelerator( GDK_F3 ) ); + GlobalCommands_insert( "TogglePreview", FreeCaller(), 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", FreeCaller(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "CameraSpeedDec", FreeCaller(), 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( GDK_period ) ); - GlobalShortcuts_insert( "CameraStrafeLeft", Accelerator( GDK_comma ) ); + 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( 'D' ) ); GlobalShortcuts_insert( "CameraDown", Accelerator( 'C' ) ); GlobalShortcuts_insert( "CameraAngleUp", Accelerator( 'A' ) ); GlobalShortcuts_insert( "CameraAngleDown", Accelerator( 'Z' ) ); - GlobalShortcuts_insert( "CameraFreeMoveForward", Accelerator( GDK_Up ) ); - GlobalShortcuts_insert( "CameraFreeMoveBack", Accelerator( GDK_Down ) ); - GlobalShortcuts_insert( "CameraFreeMoveLeft", Accelerator( GDK_Left ) ); - GlobalShortcuts_insert( "CameraFreeMoveRight", Accelerator( GDK_Right ) ); + GlobalShortcuts_insert( "CameraFreeMoveForward", Accelerator( GDK_KEY_Up ) ); + GlobalShortcuts_insert( "CameraFreeMoveBack", Accelerator( GDK_KEY_Down ) ); + GlobalShortcuts_insert( "CameraFreeMoveLeft", Accelerator( GDK_KEY_Left ) ); + GlobalShortcuts_insert( "CameraFreeMoveRight", Accelerator( GDK_KEY_Right ) ); GlobalToggles_insert( "ShowStats", ShowStatsToggleCaller(), ToggleItem::AddCallbackCaller( g_show_stats ) ); diff --git a/radiant/commands.cpp b/radiant/commands.cpp index 6b2fe8ee..027b0dc3 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -481,8 +481,8 @@ public: gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_grab_default( GTK_WIDGET( button ) ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } modal_dialog_show( window, dialog ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 1e8aaa7e..701a77ba 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1195,7 +1195,7 @@ static gint EntityClassList_button_press( ui::Widget widget, GdkEventButton *eve static gint EntityClassList_keypress( ui::Widget widget, GdkEventKey* event, gpointer data ){ unsigned int code = gdk_keyval_to_upper( event->keyval ); - if ( event->keyval == GDK_Return ) { + if ( event->keyval == GDK_KEY_Return ) { EntityClassList_createEntity(); return TRUE; } @@ -1261,7 +1261,7 @@ static void SpawnflagCheck_toggled( ui::Widget widget, gpointer data ){ } static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer data ){ - if ( event->keyval == GDK_Return ) { + if ( event->keyval == GDK_KEY_Return ) { if ( widget == g_entityKeyEntry ) { gtk_entry_set_text( g_entityValueEntry, "" ); gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), GTK_WIDGET( g_entityValueEntry ) ); @@ -1272,7 +1272,7 @@ static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer } return TRUE; } - if ( event->keyval == GDK_Escape ) { + if ( event->keyval == GDK_KEY_Escape ) { gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), NULL ); return TRUE; } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index c3ebca2e..53def76d 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -397,12 +397,12 @@ void DoSides( int type, int axis ){ auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } } @@ -665,12 +665,12 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){ auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } } @@ -892,12 +892,12 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){ auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } { GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } } @@ -960,12 +960,12 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, char* title ){ auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } { GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } } @@ -1019,7 +1019,7 @@ EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char* auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } } diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 27364c08..3dbad8f2 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3169,7 +3169,7 @@ void Layout_registerPreferencesPage(){ #include "stringio.h" void MainFrame_Construct(){ - GlobalCommands_insert( "OpenManual", FreeCaller(), Accelerator( GDK_F1 ) ); + GlobalCommands_insert( "OpenManual", FreeCaller(), Accelerator( GDK_KEY_F1 ) ); GlobalCommands_insert( "Sleep", FreeCaller(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) ); GlobalCommands_insert( "NewMap", FreeCaller() ); @@ -3188,11 +3188,11 @@ void MainFrame_Construct(){ GlobalCommands_insert( "Copy", FreeCaller(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "Paste", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "PasteToCamera", FreeCaller(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "CloneSelection", FreeCaller(), Accelerator( GDK_space ) ); - GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller(), Accelerator( GDK_space, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "DeleteSelection", FreeCaller(), Accelerator( GDK_BackSpace ) ); + GlobalCommands_insert( "CloneSelection", FreeCaller(), Accelerator( GDK_KEY_space ) ); + GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "DeleteSelection", FreeCaller(), Accelerator( GDK_KEY_BackSpace ) ); GlobalCommands_insert( "ParentSelection", FreeCaller() ); - GlobalCommands_insert( "UnSelectSelection", FreeCaller(), Accelerator( GDK_Escape ) ); + GlobalCommands_insert( "UnSelectSelection", FreeCaller(), Accelerator( GDK_KEY_Escape ) ); GlobalCommands_insert( "InvertSelection", FreeCaller(), Accelerator( 'I' ) ); GlobalCommands_insert( "SelectInside", FreeCaller() ); GlobalCommands_insert( "SelectTouching", FreeCaller() ); @@ -3264,24 +3264,24 @@ void MainFrame_Construct(){ GlobalCommands_insert( "SelectAllOfType", FreeCaller(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexRotateClock", FreeCaller(), Accelerator( GDK_Next, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexRotateCounter", FreeCaller(), Accelerator( GDK_Prior, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexScaleUp", FreeCaller(), Accelerator( GDK_Up, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexScaleDown", FreeCaller(), Accelerator( GDK_Down, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexScaleLeft", FreeCaller(), Accelerator( GDK_Left, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexScaleRight", FreeCaller(), Accelerator( GDK_Right, (GdkModifierType)GDK_CONTROL_MASK ) ); - GlobalCommands_insert( "TexShiftUp", FreeCaller(), Accelerator( GDK_Up, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexShiftDown", FreeCaller(), Accelerator( GDK_Down, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexShiftLeft", FreeCaller(), Accelerator( GDK_Left, (GdkModifierType)GDK_SHIFT_MASK ) ); - GlobalCommands_insert( "TexShiftRight", FreeCaller(), Accelerator( GDK_Right, (GdkModifierType)GDK_SHIFT_MASK ) ); - - GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller(), Accelerator( GDK_KP_Subtract ) ); - GlobalCommands_insert( "MoveSelectionUP", FreeCaller(), Accelerator( GDK_KP_Add ) ); - - GlobalCommands_insert( "SelectNudgeLeft", FreeCaller(), Accelerator( GDK_Left, (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "SelectNudgeRight", FreeCaller(), Accelerator( GDK_Right, (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "SelectNudgeUp", FreeCaller(), Accelerator( GDK_Up, (GdkModifierType)GDK_MOD1_MASK ) ); - GlobalCommands_insert( "SelectNudgeDown", FreeCaller(), Accelerator( GDK_Down, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "TexRotateClock", FreeCaller(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexRotateCounter", FreeCaller(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexScaleUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexScaleDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexScaleLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexScaleRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) ); + GlobalCommands_insert( "TexShiftUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexShiftDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexShiftLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) ); + GlobalCommands_insert( "TexShiftRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) ); + + GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller(), Accelerator( GDK_KEY_KP_Subtract ) ); + GlobalCommands_insert( "MoveSelectionUP", FreeCaller(), Accelerator( GDK_KEY_KP_Add ) ); + + GlobalCommands_insert( "SelectNudgeLeft", FreeCaller(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeRight", FreeCaller(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeUp", FreeCaller(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) ); + GlobalCommands_insert( "SelectNudgeDown", FreeCaller(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) ); Patch_registerCommands(); XYShow_registerCommands(); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 9432187c..70cf3f8c 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -539,11 +539,11 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){ } static gint OnDialogKey( ui::Widget widget, GdkEventKey* event, gpointer data ){ - if ( event->keyval == GDK_Return ) { + if ( event->keyval == GDK_KEY_Return ) { OnApply( ui::root, 0 ); return TRUE; } - else if ( event->keyval == GDK_Escape ) { + else if ( event->keyval == GDK_KEY_Escape ) { g_PatchInspector.GetPatchInfo(); return TRUE; } diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 8b9123b1..6d6a5c4d 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -938,12 +938,12 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); gtk_widget_grab_focus( GTK_WIDGET( button ) ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } } } @@ -1093,12 +1093,12 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ auto button = create_modal_dialog_button( "OK", ok_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } { GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE ); } } } diff --git a/radiant/select.cpp b/radiant/select.cpp index 0f2fae1c..eff55f51 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -988,12 +988,12 @@ void DoRotateDlg(){ auto button = create_dialog_button( "OK", G_CALLBACK( rotatedlg_ok ), &g_rotate_dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( rotatedlg_cancel ), &g_rotate_dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_dialog_button( "Apply", G_CALLBACK( rotatedlg_apply ), &g_rotate_dialog ); @@ -1133,12 +1133,12 @@ void DoScaleDlg(){ auto button = create_dialog_button( "OK", G_CALLBACK( scaledlg_ok ), &g_scale_dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); widget_make_default( button ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( scaledlg_cancel ), &g_scale_dialog ); gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 ); - gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); + gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 ); } { GtkButton* button = create_dialog_button( "Apply", G_CALLBACK( scaledlg_apply ), &g_scale_dialog ); diff --git a/radiant/windowobservers.cpp b/radiant/windowobservers.cpp index eafd725b..4d5c2897 100644 --- a/radiant/windowobservers.cpp +++ b/radiant/windowobservers.cpp @@ -53,18 +53,18 @@ inline void WindowObservers_OnModifierUp( WindowObservers& observers, ModifierFl gboolean selection_modifier_key_press( ui::Widget widget, GdkEventKey* event, WindowObservers& observers ){ switch ( event->keyval ) { - case GDK_Alt_L: - case GDK_Alt_R: + case GDK_KEY_Alt_L: + case GDK_KEY_Alt_R: //globalOutputStream() << "Alt PRESSED\n"; WindowObservers_OnModifierDown( observers, c_modifierAlt ); break; - case GDK_Shift_L: - case GDK_Shift_R: + case GDK_KEY_Shift_L: + case GDK_KEY_Shift_R: //globalOutputStream() << "Shift PRESSED\n"; WindowObservers_OnModifierDown( observers, c_modifierShift ); break; - case GDK_Control_L: - case GDK_Control_R: + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: //globalOutputStream() << "Control PRESSED\n"; WindowObservers_OnModifierDown( observers, c_modifierControl ); break; @@ -75,18 +75,18 @@ gboolean selection_modifier_key_press( ui::Widget widget, GdkEventKey* event, Wi gboolean selection_modifier_key_release( ui::Widget widget, GdkEventKey* event, WindowObservers& observers ){ switch ( event->keyval ) { - case GDK_Alt_L: - case GDK_Alt_R: + case GDK_KEY_Alt_L: + case GDK_KEY_Alt_R: //globalOutputStream() << "Alt RELEASED\n"; WindowObservers_OnModifierUp( observers, c_modifierAlt ); break; - case GDK_Shift_L: - case GDK_Shift_R: + case GDK_KEY_Shift_L: + case GDK_KEY_Shift_R: //globalOutputStream() << "Shift RELEASED\n"; WindowObservers_OnModifierUp( observers, c_modifierShift ); break; - case GDK_Control_L: - case GDK_Control_R: + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: //globalOutputStream() << "Control RELEASED\n"; WindowObservers_OnModifierUp( observers, c_modifierControl ); break; -- 2.39.2