[MPlayer-cvslog] r38489 - in trunk/gui: dialog/about.c dialog/equalizer.c dialog/fileselect.c dialog/msgbox.c dialog/playlist.c dialog/preferences.c dialog/skinbrowser.c dialog/url.c gtk-compat.h

ib subversion at mplayerhq.hu
Wed May 1 15:49:44 EEST 2024


Author: ib
Date: Wed May  1 15:49:43 2024
New Revision: 38489

Log:
If available, replace old symbolic key names with new ones.

The GUI should preferably use a more recent GTK+ 2 style.

Modified:
   trunk/gui/dialog/about.c
   trunk/gui/dialog/equalizer.c
   trunk/gui/dialog/fileselect.c
   trunk/gui/dialog/msgbox.c
   trunk/gui/dialog/playlist.c
   trunk/gui/dialog/preferences.c
   trunk/gui/dialog/skinbrowser.c
   trunk/gui/dialog/url.c
   trunk/gui/gtk-compat.h

Modified: trunk/gui/dialog/about.c
==============================================================================
--- trunk/gui/dialog/about.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/about.c	Wed May  1 15:49:43 2024	(r38489)
@@ -19,6 +19,7 @@
 #include <stdio.h>
 
 #include "config.h"
+#include "gui/gtk-compat.h"
 #include "gui/app/app.h"
 #include "gui/app/gui.h"
 #include "help_mp.h"
@@ -337,8 +338,8 @@ static GtkWidget * CreateAbout( void )
   g_signal_connect( G_OBJECT( About ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&About );
   g_signal_connect( G_OBJECT( Ok ),"clicked",G_CALLBACK( abWidgetDestroy ),NULL );
 
-  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
-  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
   gtk_window_add_accel_group( GTK_WINDOW( About ),accel_group );
 
   return About;

Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/equalizer.c	Wed May  1 15:49:43 2024	(r38489)
@@ -26,6 +26,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
+#include "gui/gtk-compat.h"
 #include "gui/app/app.h"
 #include "gui/app/cfg.h"
 #include "gui/app/gui.h"
@@ -431,8 +432,8 @@ static GtkWidget * CreateEqualizer( void
   Clear=gtkAddButton( _(MSGTR_GUI_Clear),hbuttonbox1 );
   Ok=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox1 );
 
-  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
-  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
 
   g_signal_connect( G_OBJECT( Equalizer ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&Equalizer );
   g_signal_connect( G_OBJECT( Equalizer ),"focus-in-event",G_CALLBACK( eqFocus ),GINT_TO_POINTER(2) );
@@ -675,8 +676,8 @@ GtkWidget * CreateEquConfig( void )
   ecOk=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox1 );
   ecCancel=gtkAddButton( _(MSGTR_GUI_Cancel),hbuttonbox1 );
 
-  gtk_widget_add_accelerator( ecOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
-  gtk_widget_add_accelerator( ecCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( ecOk,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( ecCancel,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
 
   g_signal_connect( G_OBJECT( EquConfig ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&EquConfig );
 

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/fileselect.c	Wed May  1 15:49:43 2024	(r38489)
@@ -708,7 +708,7 @@ static gboolean fs_key_release_event(Gtk
     (void)user_data;
 
     switch (event->key.keyval) {
-    case GDK_Return:
+    case GDK_KEY_Return:
 
         if (GTK_IS_SCROLLED_WINDOW(widget))
             gtk_button_clicked(GTK_BUTTON(fsOk));
@@ -717,7 +717,7 @@ static gboolean fs_key_release_event(Gtk
 
         break;
 
-    case GDK_BackSpace:
+    case GDK_KEY_BackSpace:
 
         if (GTK_IS_SCROLLED_WINDOW(widget)) {
             gtk_button_clicked(GTK_BUTTON(fsUp));
@@ -837,7 +837,7 @@ static GtkWidget *CreateFileSelect(void)
     fsOk     = gtkAddButton(MSGTR_GUI_Ok, hbuttonbox3);
     fsCancel = gtkAddButton(MSGTR_GUI_Cancel, hbuttonbox3);
 
-    gtk_widget_add_accelerator(fsCancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE);
+    gtk_widget_add_accelerator(fsCancel, "clicked", accel_group, GDK_KEY_Escape, 0, GTK_ACCEL_VISIBLE);
 
     g_signal_connect(G_OBJECT(FileSelector), "destroy", G_CALLBACK(fs_Destroy), NULL);
     g_signal_connect(G_OBJECT(fsFNameListWindow), "key-release-event", G_CALLBACK(fs_key_release_event), NULL);

Modified: trunk/gui/dialog/msgbox.c
==============================================================================
--- trunk/gui/dialog/msgbox.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/msgbox.c	Wed May  1 15:49:43 2024	(r38489)
@@ -18,6 +18,7 @@
 
 #include <string.h>
 
+#include "gui/gtk-compat.h"
 #include "gui/app/app.h"
 #include "gui/app/gui.h"
 #include "help_mp.h"
@@ -97,8 +98,8 @@ static GtkWidget * CreateMessageBox( voi
  hbuttonbox1=gtkAddHButtonBox( vbox1 );
  Ok=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox1 );
 
- gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
- gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
 
  g_signal_connect( G_OBJECT( MessageBox ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&MessageBox );
  g_signal_connect( G_OBJECT( Ok ),"clicked",G_CALLBACK( on_Ok_released ),NULL );

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/playlist.c	Wed May  1 15:49:43 2024	(r38489)
@@ -31,6 +31,7 @@
 #include "help_mp.h"
 #include "stream/stream.h"
 
+#include "gui/gtk-compat.h"
 #include "gui/app/cfg.h"
 #include "gui/app/gui.h"
 #include "gui/interface.h"
@@ -264,7 +265,7 @@ static gboolean plKeyReleased( GtkWidget
                                GdkEventKey * event,
                                gpointer user_data )
 {
- if (event->keyval == GDK_Return)
+ if (event->keyval == GDK_KEY_Return)
   {
    if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_CLIST )
     {
@@ -564,7 +565,7 @@ static GtkWidget * CreatePlaylist( void
   Ok=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox1 );
   Cancel=gtkAddButton( _(MSGTR_GUI_Cancel),hbuttonbox1 );
 
-  gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
 
   g_signal_connect( G_OBJECT( Playlist ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&Playlist );
 

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/preferences.c	Wed May  1 15:49:43 2024	(r38489)
@@ -41,6 +41,7 @@
 #include "libmpcodecs/dec_video.h"
 #include "sub/font_load.h"
 
+#include "gui/gtk-compat.h"
 #include "gui/app/app.h"
 #include "gui/app/cfg.h"
 #include "gui/app/gui.h"
@@ -1141,8 +1142,8 @@ static GtkWidget * CreatePreferences( vo
   BOk=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox1 );
   BCancel=gtkAddButton( _(MSGTR_GUI_Cancel),hbuttonbox1 );
 
-  gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
-  gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
+  gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
 
   g_signal_connect( G_OBJECT( Preferences ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&Preferences );
 
@@ -1780,8 +1781,8 @@ static GtkWidget *CreateAudioConfig( voi
   g_signal_connect(G_OBJECT(BAudioCancel), "clicked", G_CALLBACK(audioButton), GINT_TO_POINTER(0));
 
   accel_group = gtk_accel_group_new();
-  gtk_widget_add_accelerator(BAudioOk, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE);
-  gtk_widget_add_accelerator(BAudioCancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE);
+  gtk_widget_add_accelerator(BAudioOk, "clicked", accel_group, GDK_KEY_Return, 0, GTK_ACCEL_VISIBLE);
+  gtk_widget_add_accelerator(BAudioCancel, "clicked", accel_group, GDK_KEY_Escape, 0, GTK_ACCEL_VISIBLE);
   gtk_window_add_accel_group(GTK_WINDOW(AudioConfig), accel_group);
 
   return AudioConfig;
@@ -1918,8 +1919,8 @@ GtkWidget * CreateDXR3Config( void )
  dxr3BOk=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox1 );
  dxr3BCancel=gtkAddButton( _(MSGTR_GUI_Cancel),hbuttonbox1 );
 
- gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
- gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
 
  g_signal_connect( G_OBJECT( DXR3Config ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&DXR3Config );
 

Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/skinbrowser.c	Wed May  1 15:49:43 2024	(r38489)
@@ -26,6 +26,7 @@
 #include "skinbrowser.h"
 #include "tools.h"
 
+#include "gui/gtk-compat.h"
 #include "gui/app/app.h"
 #include "gui/app/cfg.h"
 #include "gui/app/gui.h"
@@ -139,8 +140,8 @@ void ShowSkinBrowser( void )
  Ok=gtkAddButton( _(MSGTR_GUI_Ok),hbuttonbox4 );
  Cancel=gtkAddButton( _(MSGTR_GUI_Cancel),hbuttonbox4 );
 
- gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
- gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_KEY_Return,0,GTK_ACCEL_VISIBLE );
+ gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_KEY_Escape,0,GTK_ACCEL_VISIBLE );
 
  g_signal_connect( G_OBJECT( SkinBrowser ),"destroy",G_CALLBACK( gtk_widget_destroyed ),&SkinBrowser );
  g_signal_connect( G_OBJECT( SkinList ),"select-row",G_CALLBACK( on_SkinList_select_row ),NULL );

Modified: trunk/gui/dialog/url.c
==============================================================================
--- trunk/gui/dialog/url.c	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/dialog/url.c	Wed May  1 15:49:43 2024	(r38489)
@@ -23,6 +23,7 @@
 #include "url.h"
 #include "dialog.h"
 #include "tools.h"
+#include "gui/gtk-compat.h"
 #include "gui/interface.h"
 #include "gui/app/app.h"
 #include "gui/app/gui.h"
@@ -137,8 +138,8 @@ static GtkWidget *CreateURLDialog(void)
     geometry.max_height = -1;
     gtk_window_set_geometry_hints(GTK_WINDOW(URLDialog), NULL, &geometry, GDK_HINT_MAX_SIZE);
 
-    gtk_widget_add_accelerator(Ok, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE);
-    gtk_widget_add_accelerator(Cancel, "clicked", accel_group, GDK_Escape, 0, GTK_ACCEL_VISIBLE);
+    gtk_widget_add_accelerator(Ok, "clicked", accel_group, GDK_KEY_Return, 0, GTK_ACCEL_VISIBLE);
+    gtk_widget_add_accelerator(Cancel, "clicked", accel_group, GDK_KEY_Escape, 0, GTK_ACCEL_VISIBLE);
 
     g_signal_connect(G_OBJECT(URLDialog), "destroy", G_CALLBACK(gtk_widget_destroyed), &URLDialog);
     g_signal_connect(G_OBJECT(Ok), "clicked", G_CALLBACK(button_clicked), Ok);

Modified: trunk/gui/gtk-compat.h
==============================================================================
--- trunk/gui/gtk-compat.h	Tue Apr 30 11:44:46 2024	(r38488)
+++ trunk/gui/gtk-compat.h	Wed May  1 15:49:43 2024	(r38489)
@@ -30,4 +30,10 @@
 #define gtk_button_set_image(button, image) gtk_button_set_label(button, MSGTR_GUI_ ## image)
 #endif
 
+#if !GTK_CHECK_VERSION(2,22,0)
+#define GDK_KEY_BackSpace GDK_BackSpace
+#define GDK_KEY_Escape GDK_Escape
+#define GDK_KEY_Return GDK_Return
+#endif
+
 #endif


More information about the MPlayer-cvslog mailing list