[MPlayer-cvslog] r36118 - in trunk/gui/dialog: dialog.c dialog.h skinbrowser.c tools.c tools.h
ib
subversion at mplayerhq.hu
Sun Mar 31 20:30:30 CEST 2013
Author: ib
Date: Sun Mar 31 20:30:30 2013
New Revision: 36118
Log:
Move gtkFindCList() to tools.c.
Additionally, rename it gtkFindInCList().
Modified:
trunk/gui/dialog/dialog.c
trunk/gui/dialog/dialog.h
trunk/gui/dialog/skinbrowser.c
trunk/gui/dialog/tools.c
trunk/gui/dialog/tools.h
Modified: trunk/gui/dialog/dialog.c
==============================================================================
--- trunk/gui/dialog/dialog.c Sun Mar 31 20:08:37 2013 (r36117)
+++ trunk/gui/dialog/dialog.c Sun Mar 31 20:30:30 2013 (r36118)
@@ -66,6 +66,7 @@ static int gtkInitialized;
#include "menu.h"
#include "url.h"
#include "equalizer.h"
+#include "tools.h"
static const char gui_icon_name[] = "mplayer";
@@ -188,21 +189,6 @@ void gtkAddIcon(GtkWidget *window)
wsWindowIcon(gdk_display, GDK_WINDOW_XWINDOW(window->window), &guiIcon);
}
-int gtkFindCList(GtkWidget *list, char *item)
-{
- gint j;
- gchar *tmpstr;
-
- for (j = 0; j < GTK_CLIST(list)->rows; j++) {
- gtk_clist_get_text(GTK_CLIST(list), j, 0, &tmpstr);
-
- if (!strcmp(tmpstr, item))
- return j;
- }
-
- return -1;
-}
-
void gtkEventHandling(void)
{
int i;
@@ -281,7 +267,7 @@ static void gtkSelectInCList(GtkWidget *
{
gint i;
- if ((i = gtkFindCList(list, item)) > -1)
+ if ((i = gtkFindInCList(list, item)) > -1)
gtk_clist_select_row(GTK_CLIST(list), i, 0);
}
Modified: trunk/gui/dialog/dialog.h
==============================================================================
--- trunk/gui/dialog/dialog.h Sun Mar 31 20:08:37 2013 (r36117)
+++ trunk/gui/dialog/dialog.h Sun Mar 31 20:30:30 2013 (r36118)
@@ -67,7 +67,6 @@ void gtkInit(char *display_name);
void gtkAddIcon(GtkWidget *window);
int gtkFillSkinList(gchar *dir);
-int gtkFindCList(GtkWidget *list, char *item);
void gtkEventHandling(void);
Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c Sun Mar 31 20:08:37 2013 (r36117)
+++ trunk/gui/dialog/skinbrowser.c Sun Mar 31 20:30:30 2013 (r36118)
@@ -183,7 +183,7 @@ int gtkFillSkinList( gchar * mdir )
str[0]="default";
str[1]="";
- if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
+ if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
glob( mdir,GLOB_NOSORT,NULL,&gg );
for( i=0;i<(int)gg.gl_pathc;i++ )
@@ -196,7 +196,7 @@ int gtkFillSkinList( gchar * mdir )
else tmp = gg.gl_pathv[i];
if ( !strcmp( tmp,"default" ) ) continue;
str[0]=tmp;
- if ( gtkFindCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
+ if ( gtkFindInCList( SkinList,str[0] ) == -1 ) gtk_clist_append( GTK_CLIST( SkinList ),str );
}
}
globfree( &gg );
Modified: trunk/gui/dialog/tools.c
==============================================================================
--- trunk/gui/dialog/tools.c Sun Mar 31 20:08:37 2013 (r36117)
+++ trunk/gui/dialog/tools.c Sun Mar 31 20:30:30 2013 (r36118)
@@ -18,6 +18,7 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include <string.h>
#include "tools.h"
@@ -187,3 +188,18 @@ GtkWidget * gtkAddCombo( GtkWidget * par
if ( parent ) gtk_box_pack_start( GTK_BOX( parent ),CB,TRUE,TRUE,0 );
return CB;
}
+
+int gtkFindInCList (GtkWidget *list, char *item)
+{
+ gint j;
+ gchar *tmpstr;
+
+ for (j = 0; j < GTK_CLIST(list)->rows; j++)
+ {
+ gtk_clist_get_text(GTK_CLIST(list), j, 0, &tmpstr);
+
+ if (!strcmp(tmpstr, item)) return j;
+ }
+
+ return -1;
+}
Modified: trunk/gui/dialog/tools.h
==============================================================================
--- trunk/gui/dialog/tools.h Sun Mar 31 20:08:37 2013 (r36117)
+++ trunk/gui/dialog/tools.h Sun Mar 31 20:30:30 2013 (r36118)
@@ -36,5 +36,6 @@ GtkWidget * gtkAddHButtonBox( GtkWidget
GtkWidget * gtkAddHScale( GtkAdjustment * adj, GtkWidget * parent, int digit );
GtkWidget * gtkAddVScale( GtkAdjustment * adj, GtkWidget * parent, int digit );
GtkWidget * gtkAddCombo( GtkWidget * parent );
+int gtkFindInCList(GtkWidget *list, char *item);
#endif /* MPLAYER_GUI_TOOLS_H */
More information about the MPlayer-cvslog
mailing list