]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Use non-deprecated GDK key constants
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 23 Jul 2017 06:32:43 +0000 (16:32 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 31 Jul 2017 12:35:48 +0000 (22:35 +1000)
13 files changed:
libs/gtkutil/accelerator.cpp
libs/gtkutil/messagebox.cpp
libs/gtkutil/nonmodal.cpp
radiant/build.cpp
radiant/camwindow.cpp
radiant/commands.cpp
radiant/entityinspector.cpp
radiant/gtkdlgs.cpp
radiant/mainframe.cpp
radiant/patchdialog.cpp
radiant/patchmanip.cpp
radiant/select.cpp
radiant/windowobservers.cpp

index e55ff5fc88a9ec06b17a7cd609bfe53850789c11..606f505ed6b5c7472d9696145342a69e65320f9e 100644 (file)
@@ -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() ) );
 }
index ca3fb321cc852b19f398001a58e3f1aaa0025990..97c77ee8b9d0694b04306ac29a47bf70e7e8baaa 100644 (file)
@@ -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 ) );
                }
 
index ef05f26e64b4ea23eddbdcf87004c0501d9b433d..97c4bce299ceeb2fe60d94de17f8d04490450c4e 100644 (file)
@@ -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;
index 9b24958b443847c2ce201e5f5cc822323e94a722..1a2efe25d9f07bbdf38a3695abfb9ef4fee9650b 100644 (file)
@@ -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;
index df3bf3c8b76dc08a76c9d2fa061611b04dc3157f..7916f81c759834faf543613bc1f5395a1d84897b 100644 (file)
@@ -959,19 +959,19 @@ void CamWnd_registerCommands( CamWnd& camwnd ){
                                                        ReferenceCaller<camera_t, Camera_PitchUp_KeyUp>( 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<camera_t, Camera_MoveForward_Discrete>( camwnd.getCamera() ), Accelerator( GDK_Up ) );
-       GlobalCommands_insert( "CameraBack", ReferenceCaller<camera_t, Camera_MoveBack_Discrete>( camwnd.getCamera() ), Accelerator( GDK_Down ) );
-       GlobalCommands_insert( "CameraLeft", ReferenceCaller<camera_t, Camera_RotateLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_Left ) );
-       GlobalCommands_insert( "CameraRight", ReferenceCaller<camera_t, Camera_RotateRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_Right ) );
-       GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller<camera_t, Camera_MoveRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_period ) );
-       GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller<camera_t, Camera_MoveLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_comma ) );
+       GlobalCommands_insert( "CameraForward", ReferenceCaller<camera_t, Camera_MoveForward_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Up ) );
+       GlobalCommands_insert( "CameraBack", ReferenceCaller<camera_t, Camera_MoveBack_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Down ) );
+       GlobalCommands_insert( "CameraLeft", ReferenceCaller<camera_t, Camera_RotateLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Left ) );
+       GlobalCommands_insert( "CameraRight", ReferenceCaller<camera_t, Camera_RotateRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_Right ) );
+       GlobalCommands_insert( "CameraStrafeRight", ReferenceCaller<camera_t, Camera_MoveRight_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_period ) );
+       GlobalCommands_insert( "CameraStrafeLeft", ReferenceCaller<camera_t, Camera_MoveLeft_Discrete>( camwnd.getCamera() ), Accelerator( GDK_KEY_comma ) );
 
        GlobalCommands_insert( "CameraUp", ReferenceCaller<camera_t, Camera_MoveUp_Discrete>( camwnd.getCamera() ), Accelerator( 'D' ) );
        GlobalCommands_insert( "CameraDown", ReferenceCaller<camera_t, Camera_MoveDown_Discrete>( 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<GlobalCamera_ResetAngles>(), Accelerator( GDK_End ) );
+       GlobalCommands_insert( "CenterView", FreeCaller<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 ) );
 
-       GlobalCommands_insert( "UpFloor", FreeCaller<Camera_ChangeFloorUp>(), Accelerator( GDK_Prior ) );
-       GlobalCommands_insert( "DownFloor", FreeCaller<Camera_ChangeFloorDown>(), Accelerator( GDK_Next ) );
+       GlobalCommands_insert( "UpFloor", FreeCaller<Camera_ChangeFloorUp>(), Accelerator( GDK_KEY_Prior ) );
+       GlobalCommands_insert( "DownFloor", FreeCaller<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", FreeCaller<GlobalCamera_LookThroughSelected>() );
        GlobalCommands_insert( "LookThroughCamera", FreeCaller<GlobalCamera_LookThroughCamera>() );
 
        if ( g_pGameDescription->mGameType == "doom3" ) {
-               GlobalCommands_insert( "TogglePreview", FreeCaller<CamWnd_TogglePreview>(), Accelerator( GDK_F3 ) );
+               GlobalCommands_insert( "TogglePreview", FreeCaller<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", FreeCaller<CameraSpeed_increase>(), Accelerator( GDK_KEY_KP_Add, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "CameraSpeedDec", FreeCaller<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( 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 ) );
 
index 6b2fe8ee88c968a7972f6ae65dc9134595d2edf0..027b0dc32cbd080eeeb29e3127351a3a872c4068 100644 (file)
@@ -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 );
index 1e8aaa7e826095d324cfe8cb7eb61d8bfbcdaefb..701a77baccc66738eaeaaf188679cbd6d6bbecdc 100644 (file)
@@ -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;
        }
index c3ebca2e7806a705da74195bab46f1ee7ed60938..53def76d021223e80c513faa8e32745694187fe2 100644 (file)
@@ -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 );
                        }
                }
        }
index 27364c082db62493b576ffcebe7cd74166fa3b53..3dbad8f23bb098756fe2b34c21624806bf44fd40 100644 (file)
@@ -3169,7 +3169,7 @@ void Layout_registerPreferencesPage(){
 #include "stringio.h"
 
 void MainFrame_Construct(){
-       GlobalCommands_insert( "OpenManual", FreeCaller<OpenHelpURL>(), Accelerator( GDK_F1 ) );
+       GlobalCommands_insert( "OpenManual", FreeCaller<OpenHelpURL>(), Accelerator( GDK_KEY_F1 ) );
 
        GlobalCommands_insert( "Sleep", FreeCaller<thunk_OnSleep>(), Accelerator( 'P', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
        GlobalCommands_insert( "NewMap", FreeCaller<NewMap>() );
@@ -3188,11 +3188,11 @@ void MainFrame_Construct(){
        GlobalCommands_insert( "Copy", FreeCaller<Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
        GlobalCommands_insert( "Paste", FreeCaller<Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
        GlobalCommands_insert( "PasteToCamera", FreeCaller<PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) );
-       GlobalCommands_insert( "CloneSelection", FreeCaller<Selection_Clone>(), Accelerator( GDK_space ) );
-       GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<Selection_Clone_MakeUnique>(), Accelerator( GDK_space, (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( GDK_BackSpace ) );
+       GlobalCommands_insert( "CloneSelection", FreeCaller<Selection_Clone>(), Accelerator( GDK_KEY_space ) );
+       GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<Selection_Clone_MakeUnique>(), Accelerator( GDK_KEY_space, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( GDK_KEY_BackSpace ) );
        GlobalCommands_insert( "ParentSelection", FreeCaller<Scene_parentSelected>() );
-       GlobalCommands_insert( "UnSelectSelection", FreeCaller<Selection_Deselect>(), Accelerator( GDK_Escape ) );
+       GlobalCommands_insert( "UnSelectSelection", FreeCaller<Selection_Deselect>(), Accelerator( GDK_KEY_Escape ) );
        GlobalCommands_insert( "InvertSelection", FreeCaller<Select_Invert>(), Accelerator( 'I' ) );
        GlobalCommands_insert( "SelectInside", FreeCaller<Select_Inside>() );
        GlobalCommands_insert( "SelectTouching", FreeCaller<Select_Touching>() );
@@ -3264,24 +3264,24 @@ void MainFrame_Construct(){
 
        GlobalCommands_insert( "SelectAllOfType", FreeCaller<Select_AllOfType>(), Accelerator( 'A', (GdkModifierType)GDK_SHIFT_MASK ) );
 
-       GlobalCommands_insert( "TexRotateClock", FreeCaller<Texdef_RotateClockwise>(), Accelerator( GDK_Next, (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalCommands_insert( "TexRotateCounter", FreeCaller<Texdef_RotateAntiClockwise>(), Accelerator( GDK_Prior, (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalCommands_insert( "TexScaleUp", FreeCaller<Texdef_ScaleUp>(), Accelerator( GDK_Up, (GdkModifierType)GDK_CONTROL_MASK ) );
-       GlobalCommands_insert( "TexScaleDown", FreeCaller<Texdef_ScaleDown>(), Accelerator( GDK_Down, (GdkModifierType)GDK_CONTROL_MASK ) );
-       GlobalCommands_insert( "TexScaleLeft", FreeCaller<Texdef_ScaleLeft>(), Accelerator( GDK_Left, (GdkModifierType)GDK_CONTROL_MASK ) );
-       GlobalCommands_insert( "TexScaleRight", FreeCaller<Texdef_ScaleRight>(), Accelerator( GDK_Right, (GdkModifierType)GDK_CONTROL_MASK ) );
-       GlobalCommands_insert( "TexShiftUp", FreeCaller<Texdef_ShiftUp>(), Accelerator( GDK_Up, (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalCommands_insert( "TexShiftDown", FreeCaller<Texdef_ShiftDown>(), Accelerator( GDK_Down, (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalCommands_insert( "TexShiftLeft", FreeCaller<Texdef_ShiftLeft>(), Accelerator( GDK_Left, (GdkModifierType)GDK_SHIFT_MASK ) );
-       GlobalCommands_insert( "TexShiftRight", FreeCaller<Texdef_ShiftRight>(), Accelerator( GDK_Right, (GdkModifierType)GDK_SHIFT_MASK ) );
-
-       GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller<Selection_MoveDown>(), Accelerator( GDK_KP_Subtract ) );
-       GlobalCommands_insert( "MoveSelectionUP", FreeCaller<Selection_MoveUp>(), Accelerator( GDK_KP_Add ) );
-
-       GlobalCommands_insert( "SelectNudgeLeft", FreeCaller<Selection_NudgeLeft>(), Accelerator( GDK_Left, (GdkModifierType)GDK_MOD1_MASK ) );
-       GlobalCommands_insert( "SelectNudgeRight", FreeCaller<Selection_NudgeRight>(), Accelerator( GDK_Right, (GdkModifierType)GDK_MOD1_MASK ) );
-       GlobalCommands_insert( "SelectNudgeUp", FreeCaller<Selection_NudgeUp>(), Accelerator( GDK_Up, (GdkModifierType)GDK_MOD1_MASK ) );
-       GlobalCommands_insert( "SelectNudgeDown", FreeCaller<Selection_NudgeDown>(), Accelerator( GDK_Down, (GdkModifierType)GDK_MOD1_MASK ) );
+       GlobalCommands_insert( "TexRotateClock", FreeCaller<Texdef_RotateClockwise>(), Accelerator( GDK_KEY_Next, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "TexRotateCounter", FreeCaller<Texdef_RotateAntiClockwise>(), Accelerator( GDK_KEY_Prior, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "TexScaleUp", FreeCaller<Texdef_ScaleUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_CONTROL_MASK ) );
+       GlobalCommands_insert( "TexScaleDown", FreeCaller<Texdef_ScaleDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_CONTROL_MASK ) );
+       GlobalCommands_insert( "TexScaleLeft", FreeCaller<Texdef_ScaleLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_CONTROL_MASK ) );
+       GlobalCommands_insert( "TexScaleRight", FreeCaller<Texdef_ScaleRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_CONTROL_MASK ) );
+       GlobalCommands_insert( "TexShiftUp", FreeCaller<Texdef_ShiftUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "TexShiftDown", FreeCaller<Texdef_ShiftDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "TexShiftLeft", FreeCaller<Texdef_ShiftLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_SHIFT_MASK ) );
+       GlobalCommands_insert( "TexShiftRight", FreeCaller<Texdef_ShiftRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_SHIFT_MASK ) );
+
+       GlobalCommands_insert( "MoveSelectionDOWN", FreeCaller<Selection_MoveDown>(), Accelerator( GDK_KEY_KP_Subtract ) );
+       GlobalCommands_insert( "MoveSelectionUP", FreeCaller<Selection_MoveUp>(), Accelerator( GDK_KEY_KP_Add ) );
+
+       GlobalCommands_insert( "SelectNudgeLeft", FreeCaller<Selection_NudgeLeft>(), Accelerator( GDK_KEY_Left, (GdkModifierType)GDK_MOD1_MASK ) );
+       GlobalCommands_insert( "SelectNudgeRight", FreeCaller<Selection_NudgeRight>(), Accelerator( GDK_KEY_Right, (GdkModifierType)GDK_MOD1_MASK ) );
+       GlobalCommands_insert( "SelectNudgeUp", FreeCaller<Selection_NudgeUp>(), Accelerator( GDK_KEY_Up, (GdkModifierType)GDK_MOD1_MASK ) );
+       GlobalCommands_insert( "SelectNudgeDown", FreeCaller<Selection_NudgeDown>(), Accelerator( GDK_KEY_Down, (GdkModifierType)GDK_MOD1_MASK ) );
 
        Patch_registerCommands();
        XYShow_registerCommands();
index 9432187ce39d403d5f88d9799ef4ef27f43919e3..70cf3f8c6b4904ec7fab6e7bb6ea1cd739482011 100644 (file)
@@ -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;
        }
index 8b9123b1c3feec1ccbe93a6c59dbfad3ed279a16..6d6a5c4d30e50195a6c77955098ce8106793f037 100644 (file)
@@ -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 );
                        }
                }
        }
index 0f2fae1c3709e317051bc185d71277e95de65aff..eff55f515ebd1566e4b5b6ae6ab8bd2312c7b8bc 100644 (file)
@@ -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 );
index eafd725b60565fbea44689eebc6576007e669180..4d5c2897be4f8e335055812ba8f635b2b02b7317 100644 (file)
@@ -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;