changeset 34466:a650895d50a5

Use correct data types and common variable names in GTK callback functions. Don't use (void) user_data.
author ib
date Fri, 13 Jan 2012 14:06:55 +0000
parents 3c1a1038bfc7
children 5c5024ea2529
files gui/ui/gtk/about.c gui/ui/gtk/equalizer.c gui/ui/gtk/fileselect.c gui/ui/gtk/playlist.c gui/ui/gtk/preferences.c gui/ui/gtk/skinbrowser.c
diffstat 6 files changed, 29 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/about.c	Thu Jan 12 18:21:56 2012 +0000
+++ b/gui/ui/gtk/about.c	Fri Jan 13 14:06:55 2012 +0000
@@ -35,7 +35,7 @@
  gtk_widget_show( About );
 }
 
-static void abWidgetDestroy( GtkWidget * widget, GtkWidget ** widget_pointer )
+static void abWidgetDestroy( GtkButton * button, gpointer user_data )
 { WidgetDestroy( NULL,&About ); }
 
 GtkWidget * create_About( void )
--- a/gui/ui/gtk/equalizer.c	Thu Jan 12 18:21:56 2012 +0000
+++ b/gui/ui/gtk/equalizer.c	Fri Jan 13 14:06:55 2012 +0000
@@ -249,8 +249,11 @@
   }
 }
 
-static void eqFocus( GtkWindow * window,GtkWidget * widget,gpointer user_data )
-{ eqSetBands( Channel ); }
+static gboolean eqFocus( GtkWidget * widget,GdkEvent * event,gpointer user_data )
+{
+ eqSetBands( Channel );
+ return FALSE;
+}
 
 static void eqSelectChannelsListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
 {
@@ -265,8 +268,8 @@
   }
 }
 
-static void eqNotebook( GtkNotebook * notebook, GtkNotebookPage * page,
-                        gint page_num, gpointer user_data )
+static void eqNotebook( GtkNotebook * notebook, gpointer page,
+                        guint page_num, gpointer user_data )
 {
  if ( page_num ) gtk_widget_hide( Config );
    else gtk_widget_show( Config );
--- a/gui/ui/gtk/fileselect.c	Thu Jan 12 18:21:56 2012 +0000
+++ b/gui/ui/gtk/fileselect.c	Fri Jan 13 14:06:55 2012 +0000
@@ -397,7 +397,7 @@
 }
 //-----------------------------------------------
 
-static void fs_fsFilterCombo_activate( GtkEditable * editable,
+static void fs_fsFilterCombo_activate( GtkEntry * entry,
                                        gpointer user_data )
 {
  fsFilter=gtk_entry_get_text( GTK_ENTRY( user_data ) );
@@ -444,7 +444,7 @@
  CheckDir( fsFNameList );
 }
 
-static void fs_fsPathCombo_activate( GtkEditable * editable,
+static void fs_fsPathCombo_activate( GtkEntry * entry,
                                      gpointer user_data )
 {
  const unsigned char * str;
@@ -538,28 +538,28 @@
  fs_PersistantHistory( get_current_dir_name_utf8() );      //totem, write into history file
 }
 
-static void fs_fsFNameList_select_row( GtkWidget * widget, gint row, gint column,
-                                       GdkEventButton *bevent, gpointer user_data)
+static void fs_fsFNameList_select_row( GtkCList * clist, gint row, gint column,
+                                       GdkEvent * event, gpointer user_data)
 {
  fsCurrFNameListSelected = row;
- gtk_clist_get_text( GTK_CLIST(widget ),row,1,&fsSelectedFile );
+ gtk_clist_get_text( clist,row,1,&fsSelectedFile );
  g_free( fsSelectedFileUtf8 );
  fsSelectedFileUtf8 = g_filename_from_utf8( fsSelectedFile, -1, NULL, NULL, NULL );
  if ( fsSelectedFileUtf8 ) fsSelectedFile = fsSelectedFileUtf8;
- if( bevent && bevent->type == GDK_BUTTON_PRESS )  gtk_button_released( GTK_BUTTON( fsOk ) );
+ if( event && event->type == GDK_BUTTON_PRESS )  gtk_button_released( GTK_BUTTON( fsOk ) );
 }
 
 static gboolean on_FileSelect_key_release_event( GtkWidget * widget,
-                                                 GdkEventKey * event,
+                                                 GdkEvent * event,
                                                  gpointer user_data )
 {
  if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON )
  {
-  if (event->keyval == GDK_Return) gtk_button_released( GTK_BUTTON( widget ) );
+  if (event->key.keyval == GDK_Return) gtk_button_released( GTK_BUTTON( widget ) );
  }
  else
  {
-  switch ( event->keyval )
+  switch ( event->key.keyval )
    {
     case GDK_Escape:
          gtk_button_released( GTK_BUTTON( fsCancel ) );
@@ -583,8 +583,6 @@
   GdkEventButton *bevent;
   gint row, col;
 
-  (void) user_data;
-
   bevent = (GdkEventButton *) event;
 
   if ( event->type == GDK_BUTTON_RELEASE && bevent->button == 2 )
--- a/gui/ui/gtk/playlist.c	Thu Jan 12 18:21:56 2012 +0000
+++ b/gui/ui/gtk/playlist.c	Fri Jan 13 14:06:55 2012 +0000
@@ -305,8 +305,6 @@
   GdkEventButton *bevent;
   gint row, col;
 
-  (void) user_data;
-
   bevent = (GdkEventButton *) event;
 
   if ( event->type == GDK_BUTTON_RELEASE && bevent->button == 2 )
@@ -439,14 +437,14 @@
   }
 }
 
-static void plCTRow(GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer data)
+static void plCTRow(GtkCList * clist, gint row, gint column, GdkEvent * event, gpointer user_data)
 {
  DirNodeType  * DirNode;
  GtkCTreeNode * node;
- node=gtk_ctree_node_nth( GTK_CTREE( widget ),row );
- DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( widget ),node );
+ node=gtk_ctree_node_nth( GTK_CTREE( clist ),row );
+ DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( clist ),node );
  current_path=DirNode->path;
- gtk_ctree_expand( GTK_CTREE( widget ),node );
+ gtk_ctree_expand( GTK_CTREE( clist ),node );
  scan_dir( DirNode->path );
  free( CLFileSelected );
  CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
--- a/gui/ui/gtk/preferences.c	Thu Jan 12 18:21:56 2012 +0000
+++ b/gui/ui/gtk/preferences.c	Fri Jan 13 14:06:55 2012 +0000
@@ -189,11 +189,11 @@
  void ShowAudioConfig( void );
  void HideAudioConfig( void );
 
-static gboolean prHScaler( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data );
+static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data );
 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data );
 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data );
 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV)
-static void prEntry( GtkContainer * container,gpointer user_data );
+static void prEntry( GtkEditable * editable,gpointer user_data );
 #endif
 
 void ShowPreferences( void )
@@ -489,7 +489,7 @@
 }
 
 #if defined(CONFIG_FREETYPE) || defined(CONFIG_ICONV)
-static void prEntry( GtkContainer * container,gpointer user_data )
+static void prEntry( GtkEditable * editable,gpointer user_data )
 {
  const char * comment;
  int    i;
@@ -661,7 +661,7 @@
   }
 }
 
-static gboolean prHScaler( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
+static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data )
 {
  switch ( (int)user_data )
   {
--- a/gui/ui/gtk/skinbrowser.c	Thu Jan 12 18:21:56 2012 +0000
+++ b/gui/ui/gtk/skinbrowser.c	Fri Jan 13 14:06:55 2012 +0000
@@ -90,7 +90,7 @@
  return 1;
 }
 
-static void prButton( GtkObject * object,gpointer user_data )
+static void prButton( GtkButton * button,gpointer user_data )
 {
  if ( sbSelectedSkin )
  {
@@ -109,7 +109,7 @@
  HideSkinBrowser();
 }
 
-static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * bevent,gpointer user_data )
+static void on_SkinList_select_row( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data )
 {
  gtk_clist_get_text( clist,row,0,&sbSelectedSkin );
  if ( strcmp( prev,sbSelectedSkin ) )
@@ -118,8 +118,8 @@
    uiChangeSkin( sbSelectedSkin );
    gtkActive( SkinBrowser );
   }
- if( !bevent ) return;
- if( bevent->type == GDK_2BUTTON_PRESS )
+ if( !event ) return;
+ if( event->type == GDK_2BUTTON_PRESS )
   {
    free( skinName );
    skinName=strdup( sbSelectedSkin );