comparison src/evdev-plug/ed_ui.c @ 2185:145966acb0c4

fixed some compilation warnings (was the original programmer on drugs when he wrote that??)
author mf0102 <0102@gmx.at>
date Sun, 25 Nov 2007 17:27:39 +0100
parents 78861d8b86f2
children d45b4beadf6c
comparison
equal deleted inserted replaced
2184:f2590691d4b7 2185:145966acb0c4
23 #include "ed_internals.h" 23 #include "ed_internals.h"
24 #include "ed_actions.h" 24 #include "ed_actions.h"
25 #include "ed_bindings_store.h" 25 #include "ed_bindings_store.h"
26 #include "ed_common.h" 26 #include "ed_common.h"
27 #include <stdlib.h> 27 #include <stdlib.h>
28 #include <string.h>
28 #include <linux/input.h> 29 #include <linux/input.h>
29 30
30 #include <audacious/i18n.h> 31 #include <audacious/i18n.h>
31 #include <gtk/gtk.h> 32 #include <gtk/gtk.h>
32 33
534 535
535 static void 536 static void
536 cfg_config_cb_commit ( gpointer cfg_device_lv ) 537 cfg_config_cb_commit ( gpointer cfg_device_lv )
537 { 538 {
538 GList *config_device_list = NULL; 539 GList *config_device_list = NULL;
539 GList *list_iter;
540 GtkTreeModel *model; 540 GtkTreeModel *model;
541 541
542 model = gtk_tree_view_get_model( GTK_TREE_VIEW(cfg_device_lv) ); 542 model = gtk_tree_view_get_model( GTK_TREE_VIEW(cfg_device_lv) );
543 /* fill config_device_list with information from the treeview */ 543 /* fill config_device_list with information from the treeview */
544 gtk_tree_model_foreach( model , cfg_config_cb_bindings_commit_foreach , &config_device_list ); 544 gtk_tree_model_foreach( model , cfg_config_cb_bindings_commit_foreach , &config_device_list );
755 switch ( cond ) 755 switch ( cond )
756 { 756 {
757 case G_IO_IN: 757 case G_IO_IN:
758 { 758 {
759 gsize rb = 0; 759 gsize rb = 0;
760 GError *gerr = NULL;
761 struct input_event inputev; 760 struct input_event inputev;
762 g_io_channel_read_chars( iochan , (gchar*)&inputev , 761 g_io_channel_read_chars( iochan , (gchar*)&inputev ,
763 sizeof(struct input_event) , &rb , NULL ); 762 sizeof(struct input_event) , &rb , NULL );
764 if ( rb == sizeof(struct input_event) ) 763 if ( rb == sizeof(struct input_event) )
765 { 764 {
790 } 789 }
791 } 790 }
792 } 791 }
793 } 792 }
794 } 793 }
794
795 default:
796 ;
795 } 797 }
796 return TRUE; 798 return TRUE;
797 } 799 }
798 800
799 801
800 static gboolean 802 static gboolean
801 cfg_bindbox_assign_binding_checkdups( GtkWidget * table , ed_inputevent_t * inputev ) 803 cfg_bindbox_assign_binding_checkdups( GtkWidget * table , ed_inputevent_t * inputev )
802 { 804 {
803 /* check if inputev is already assigned in table */ 805 /* check if inputev is already assigned in table */
804 GList *children = GTK_TABLE(table)->children; 806 GList *children = GTK_TABLE(table)->children;
805 for ( children ; children != NULL ; children = g_list_next(children) ) 807 for ( ; children != NULL ; children = g_list_next(children) )
806 { 808 {
807 GtkTableChild *child = children->data; 809 GtkTableChild *child = children->data;
808 810
809 if ( child->top_attach + 1 == GTK_TABLE(table)->nrows ) 811 if ( child->top_attach + 1 == GTK_TABLE(table)->nrows )
810 continue; /* skip last empty row */ 812 continue; /* skip last empty row */
1068 1070
1069 /* attach to table each popul_binding */ 1071 /* attach to table each popul_binding */
1070 for ( i = 0 ; i < bindings_num ; i++ ) 1072 for ( i = 0 ; i < bindings_num ; i++ )
1071 { 1073 {
1072 GList *children = GTK_TABLE(bind_table)->children; 1074 GList *children = GTK_TABLE(bind_table)->children;
1073 for ( children ; children != NULL ; children = g_list_next(children) ) 1075 for ( ; children != NULL ; children = g_list_next(children) )
1074 { 1076 {
1075 GtkTableChild *child = children->data; 1077 GtkTableChild *child = children->data;
1076 if ( ( (child->top_attach + 1) == GTK_TABLE(bind_table)->nrows ) && 1078 if ( ( (child->top_attach + 1) == GTK_TABLE(bind_table)->nrows ) &&
1077 ( child->left_attach == BINDLIST_COL_BT_ASSIGN ) && 1079 ( child->left_attach == BINDLIST_COL_BT_ASSIGN ) &&
1078 ( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(child->widget),"last")) == 1 ) ) 1080 ( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(child->widget),"last")) == 1 ) )
1080 /* ok, this child->widget is the last assign button */ 1082 /* ok, this child->widget is the last assign button */
1081 GtkWidget *combobox = g_object_get_data(G_OBJECT(child->widget),"combobox"); 1083 GtkWidget *combobox = g_object_get_data(G_OBJECT(child->widget),"combobox");
1082 GtkWidget *label = g_object_get_data(G_OBJECT(child->widget),"label"); 1084 GtkWidget *label = g_object_get_data(G_OBJECT(child->widget),"label");
1083 GtkWidget *delbt = g_object_get_data(G_OBJECT(child->widget),"delbt"); 1085 GtkWidget *delbt = g_object_get_data(G_OBJECT(child->widget),"delbt");
1084 GtkTreeModel *combomodel; 1086 GtkTreeModel *combomodel;
1085 GtkTreeIter comboiter;
1086 combosas_helper_t *combosas_helper; 1087 combosas_helper_t *combosas_helper;
1087 gchar *input_str; 1088 gchar *input_str;
1088 1089
1089 combomodel = gtk_combo_box_get_model( GTK_COMBO_BOX(combobox) ); 1090 combomodel = gtk_combo_box_get_model( GTK_COMBO_BOX(combobox) );
1090 combosas_helper = g_malloc(sizeof(combosas_helper_t)); 1091 combosas_helper = g_malloc(sizeof(combosas_helper_t));
1233 gint i = 0; 1234 gint i = 0;
1234 1235
1235 array_actioncode = calloc( table->nrows - 1 , sizeof(gint) ); 1236 array_actioncode = calloc( table->nrows - 1 , sizeof(gint) );
1236 array_inputevent = calloc( table->nrows - 1 , sizeof(ed_inputevent_t*) ); 1237 array_inputevent = calloc( table->nrows - 1 , sizeof(ed_inputevent_t*) );
1237 1238
1238 for ( children ; children != NULL ; children = g_list_next( children ) ) 1239 for ( ; children != NULL ; children = g_list_next( children ) )
1239 { 1240 {
1240 /* pick information from relevant table cells and put them in arrays */ 1241 /* pick information from relevant table cells and put them in arrays */
1241 GtkTableChild *child = children->data; 1242 GtkTableChild *child = children->data;
1242 1243
1243 if ( ( child->top_attach + 1 ) == table->nrows ) 1244 if ( ( child->top_attach + 1 ) == table->nrows )