[Easytag-mailing] [Patch] GTK2 support for EasyTAG 0.30



Hi,

Here's a patch to port EasyTAG 0.30 to GTK+-2

This is an early patch, I basically just told it to compile with GTK+-2 and then worked through as many compile errors/warnings as I could. In its current state, it actually breaks some of easytags functionality, so this is still early stages. Plus, its a bit of a mess, I haven't paid much attention to indentation style. Additionally, the conversion from gtk+-1.2 means that we are relying on a lot of deprecated gtk functions - more work is needed if this is to become a 'clean' gtk2 implementation. I've marked some (but not all) of the areas I plan to come back to with FIXME's.

Jerome, does this patch interest you? If you would accept GTK2 support into the official releases, how would it work? We could add the gtk2 interface as an extra configure option and seperate the bits of code that have changed with ifdefs, or even add a second source tree for a GTK2 version? This would be messy but would be good for compatibility with older system installations. Or, we could port the software to GTK2, dropping the GTK1.2 interface. This would perhaps allow for cleaner code, but not as good compatibility...
(my personal opinion would be the 2nd option - drop gtk1 interface)

A couple of screenshots for anyone interested in what a GTK2 port would bring visually:
http://www.reactivated.net/patches/easytag-0.30/before.jpg
http://www.reactivated.net/patches/easytag-0.30/after.jpg

Patch attached.
Don't forget to run "autoreconf" and "autoconf" before configuring and compiling.

Feedback is welcome - comments please.

-Daniel
diff -u easytag-0.30/src/about.c easytag-dsd/src/about.c
--- easytag-0.30/src/about.c	2003-08-31 13:33:05.000000000 +0100
+++ easytag-dsd/src/about.c	2003-12-12 19:02:16.662205376 +0000
@@ -93,6 +93,8 @@
     GtkWidget *VBox, *hbox;
     GtkWidget *ScrollWindow;
     GtkWidget *Text;
+		GtkTextBuffer *TextBuffer;
+		GtkTextIter *TextIter;
     GtkWidget *Button;
     GtkWidget *Logo;
     GdkPixmap *pixmap;
@@ -284,21 +286,39 @@
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ScrollWindow),
                                    GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
 
-    Text = gtk_text_new(NULL,NULL);
+    //Text = gtk_text_new(NULL,NULL);
+		Text = gtk_text_view_new();
     gtk_container_add(GTK_CONTAINER(ScrollWindow),Text);
-    gtk_text_set_editable(GTK_TEXT(Text),FALSE);
-    gtk_text_set_word_wrap(GTK_TEXT(Text),TRUE);
-    gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,_("Translations:\n"),-1);
+    gtk_text_view_set_editable(GTK_TEXT_VIEW(Text),FALSE);
+		//gtk_text__set_editable(GTK_TEXT(Text),FALSE);
+    gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(Text),GTK_WRAP_WORD);
+		//gtk_text_set_word_wrap(GTK_TEXT(Text),TRUE);
+
+		TextBuffer = gtk_text_buffer_new(NULL);
+		
+		gtk_text_buffer_set_text(TextBuffer, "Translations:\n",-1);
+    //gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,_("Translations:\n"),-1);
+
+		//FIXME: Does this work?
     for (i=0; translations_thanks_text[i][0]!=NULL; i++)
     {
         gchar *tmp = g_strconcat(translations_thanks_text[i][0],translations_thanks_text[i][1],NULL);
-        gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,tmp,-1);
+				gtk_text_buffer_get_end_iter(TextBuffer, TextIter);
+				gtk_text_buffer_insert (TextBuffer, TextIter, tmp, -1);
+        //gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,tmp,-1);
         g_free(tmp);
     }
-    gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,"\n",-1);
-    gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,_("General:\n"),-1);
-    gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,general_thanks_text,-1);
+		gtk_text_buffer_get_end_iter(TextBuffer, TextIter);
+		gtk_text_buffer_insert(TextBuffer, TextIter, "\nGeneral:\n", -1);
+
+		gtk_text_buffer_get_end_iter(TextBuffer, TextIter);
+		gtk_text_buffer_insert(TextBuffer, TextIter, general_thanks_text, -1);
+		
+    //gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,"\n",-1);
+    //gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,_("General:\n"),-1);
+    //gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,general_thanks_text,-1);
 
+		gtk_text_view_set_buffer(GTK_TEXT_VIEW(Text), TextBuffer);
 
     /*
      * Tab for ChangeLog
@@ -315,18 +335,24 @@
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(ScrollWindow),
                                    GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
 
-    Text = gtk_text_new(NULL,NULL);
+		Text = gtk_text_view_new();
+		//Text = gtk_text_new(NULL,NULL);
     gtk_container_add(GTK_CONTAINER(ScrollWindow),Text);
-    gtk_text_set_editable(GTK_TEXT(Text),FALSE);
-    gtk_text_set_word_wrap(GTK_TEXT(Text),TRUE);
+		gtk_text_view_set_editable(GTK_TEXT_VIEW(Text),FALSE);
+    //gtk_text_set_editable(GTK_TEXT(Text),FALSE);
+		gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(Text),GTK_WRAP_WORD);
+    //gtk_text_set_word_wrap(GTK_TEXT(Text),TRUE);
     font = gdk_fontset_load("-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-*-*");
 
+		TextBuffer = gtk_text_buffer_new(NULL);
 
     // The file 'ChangeLog' to read
     if ( (file=fopen(PACKAGE_DATA_DIR"/ChangeLog","r"))==0 )
     {
         gchar *msg = g_strdup_printf(_("Can't open file '%s' (%s)\n"),PACKAGE_DATA_DIR"/ChangeLog",g_strerror(errno));
-        gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,msg,-1);
+				//gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,msg,-1);
+				gtk_text_buffer_get_end_iter(TextBuffer, TextIter);
+				gtk_text_buffer_insert(TextBuffer, TextIter, msg, -1);
         g_free(msg);
     }else
     {
@@ -336,11 +362,19 @@
                 temp[strlen(temp)-1]='\0';
             if (temp[strlen(temp)-1]=='\r')
                 temp[strlen(temp)-1]='\0';
-            gtk_text_insert(GTK_TEXT(Text),font,NULL,NULL,temp,-1);
-            gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,"\n",-1);
+
+						gtk_text_buffer_get_end_iter(TextBuffer, TextIter);
+						gtk_text_buffer_insert(TextBuffer, TextIter, temp, -1);
+						gtk_text_buffer_get_end_iter(TextBuffer, TextIter);
+						gtk_text_buffer_insert(TextBuffer, TextIter, "\n", -1);
+
+            //gtk_text_insert(GTK_TEXT(Text),font,NULL,NULL,temp,-1);
+            //gtk_text_insert(GTK_TEXT(Text),NULL,NULL,NULL,"\n",-1);
         }
         fclose(file);
     }
+
+		gtk_text_view_set_buffer(GTK_TEXT_VIEW(Text), TextBuffer);
 #endif
 
 
diff -u easytag-0.30/src/bar.c easytag-dsd/src/bar.c
--- easytag-0.30/src/bar.c	2003-07-13 11:56:41.000000000 +0100
+++ easytag-dsd/src/bar.c	2003-12-12 19:29:13.243447672 +0000
@@ -279,7 +279,8 @@
 
     /* Menu item creation */
     gtk_item_factory_create_items(ItemFactory,NbrMenuItems,MenuItems,NULL);
-    gtk_accel_group_attach (accel_group,GTK_OBJECT(MainWindow));
+		gtk_window_add_accel_group (GTK_WINDOW(MainWindow), accel_group);
+    //gtk_accel_group_attach (accel_group,GTK_OBJECT(MainWindow));
 
     /* Get menu bar from factory */
     MenuBar = gtk_item_factory_get_widget (ItemFactory,"<Main>");
@@ -442,11 +443,16 @@
     GtkWidget *HandleBar;
     GtkWidget *Icon;
 
-    ToolBar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,GTK_TOOLBAR_ICONS);
+		//FIXME
+    //ToolBar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,GTK_TOOLBAR_ICONS);
+		ToolBar = gtk_toolbar_new();
+		/* gtk_toolbar_new() no longer has arguments. This function was broken because the default GtkToolbarStyle (icons, text, both) is now a user preference, which is overridden when you call gtk_toolbar_set_style(). The constructor forced everyone to override the preference, which was undesirable. So to port your app, decide if you want to force the toolbar style or conform to the user's global defaults; if you want to force it, call gtk_toolbar_set_style().*/
+		
     gtk_container_set_border_width(GTK_CONTAINER(ToolBar),2);
-    gtk_toolbar_set_space_size(GTK_TOOLBAR(ToolBar),15);
-    gtk_toolbar_set_space_style(GTK_TOOLBAR(ToolBar),GTK_TOOLBAR_SPACE_LINE);
-    gtk_toolbar_set_button_relief(GTK_TOOLBAR(ToolBar),GTK_RELIEF_NONE);
+		//FIXME
+    //gtk_toolbar_set_space_size(GTK_TOOLBAR(ToolBar),15);
+    //gtk_toolbar_set_space_style(GTK_TOOLBAR(ToolBar),GTK_TOOLBAR_SPACE_LINE);
+    //gtk_toolbar_set_button_relief(GTK_TOOLBAR(ToolBar),GTK_RELIEF_NONE);
 
     Set_Tips_Color(GTK_TOOLBAR(ToolBar)->tooltips);
 
diff -u easytag-0.30/src/browser.c easytag-dsd/src/browser.c
--- easytag-0.30/src/browser.c	2003-09-06 22:03:48.000000000 +0100
+++ easytag-dsd/src/browser.c	2003-12-12 20:07:18.485038144 +0000
@@ -369,7 +369,8 @@
 }
 static gint Browser_List_Key_Press (GtkWidget *clist, GdkEvent *event)
 {
-    gchar *string, *current_filename;
+    gchar *string;
+		const gchar *current_filename;
     static gchar *key_string = NULL;
     static guint BrowserListTimerId = 0;
     static gboolean timer_is_running = FALSE;
@@ -799,7 +800,7 @@
 {
     FileRow *filerow;
     guint row;
-    gchar *current_filename;
+    const gchar *current_filename;
 
     if (!ETFileList || !BrowserList || GTK_CLIST(BrowserList)->rows==0)
         return;
@@ -833,7 +834,7 @@
     FileRow *filerow = NULL;
     gboolean row_found = FALSE;
     guint    row = 0;
-    gchar   *current_filename;
+    const gchar   *current_filename;
     
     if (!ETFileList || !BrowserList || GTK_CLIST(BrowserList)->rows==0)
         return;
@@ -1505,7 +1506,7 @@
 {
     GtkCTreeNode *node, *child_node;
     DirNode *dirnode;
-    gchar *node_text = NULL;
+    const gchar *node_text = NULL;
     guint8 spacing;
     GdkPixmap *pixmap;
     GdkBitmap *mask;
@@ -1890,7 +1891,8 @@
      */
     BrowserHPaned = gtk_hpaned_new();
     gtk_box_pack_start(GTK_BOX(VerticalBox),BrowserHPaned,TRUE,TRUE,0);
-    gtk_paned_set_handle_size(GTK_PANED(BrowserHPaned),8);
+		//FIXME
+		//gtk_paned_set_handle_size(GTK_PANED(BrowserHPaned),8);
     gtk_paned_set_gutter_size(GTK_PANED(BrowserHPaned),6);                       
     gtk_paned_pack1(GTK_PANED(BrowserHPaned),ScrollWindowCTree,TRUE,TRUE); // Left side
     gtk_paned_pack2(GTK_PANED(BrowserHPaned),ScrollWindowCList,TRUE,TRUE); // Right side
@@ -2015,7 +2017,8 @@
      * The window is centered over the Browser Area */
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
     gdk_window_get_position(BrowseArea->window,&ba_x,&ba_y);
-    gtk_window_reposition(GTK_WINDOW(RenameDirectoryWindow),
+		//FIXME: Does this work as expected?
+    gtk_widget_set_uposition(RenameDirectoryWindow,
         mw_x + ba_x + (BrowseArea->allocation.width/2)  - (RenameDirectoryWindow->allocation.width)/2,
         mw_y + ba_y + (BrowseArea->allocation.height/2) - (RenameDirectoryWindow->allocation.height)/2);
 
@@ -2242,7 +2245,7 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(RunProgramCombo),History_List);
     gtk_object_set_data(GTK_OBJECT(RunProgramCombo),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(RunProgramCombo)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
+				(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
 
     /* We attach usefull data to the combobox (into Run_Program_With_Directory) */
     gtk_object_set_data(GTK_OBJECT(RunProgramCombo),"Current_Directory",current_directory);
@@ -2261,7 +2264,7 @@
     gtk_container_add(GTK_CONTAINER(ButtonBox),Button);
     GTK_WIDGET_SET_FLAGS(Button,GTK_CAN_DEFAULT);
     gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Run_Program_With_Directory,GTK_OBJECT(RunProgramCombo));
-    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
+    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
     gtk_signal_connect_object(GTK_OBJECT(GTK_COMBO(RunProgramCombo)->entry),"changed",(GtkSignalFunc)Entry_Changed_Disable_Object,GTK_OBJECT(Button));
     gtk_signal_emit_by_name(GTK_OBJECT(GTK_COMBO(RunProgramCombo)->entry),"changed",NULL);
 
@@ -2278,7 +2281,8 @@
      * The window is centered over the Browser Area */
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
     gdk_window_get_position(BrowseArea->window,&ba_x,&ba_y);
-    gtk_window_reposition(GTK_WINDOW(RunProgramTreeWindow),
+		//FIXME: Does this work as expected?
+    gtk_widget_set_uposition(RunProgramTreeWindow,
         mw_x + ba_x + (BrowseArea->allocation.width/2)  - (RunProgramTreeWindow->allocation.width)/2,
         mw_y + ba_y + (BrowseArea->allocation.height/2) - (RunProgramTreeWindow->allocation.height)/2);
     
@@ -2397,7 +2401,7 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(RunProgramCombo),History_List);
     gtk_object_set_data(GTK_OBJECT(RunProgramCombo),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(RunProgramCombo)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
 
     /* We attach usefull data to the combobox (into Run_Program_With_Directory) */
     //gtk_object_set_data(GTK_OBJECT(Combo),"Current_File",current_file);
@@ -2416,7 +2420,7 @@
     gtk_container_add(GTK_CONTAINER(ButtonBox),Button);
     GTK_WIDGET_SET_FLAGS(Button,GTK_CAN_DEFAULT);
     gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Run_Program_With_Selected_Files,GTK_OBJECT(RunProgramCombo));
-    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
+    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(RunProgramCombo));
     gtk_signal_connect_object(GTK_OBJECT(GTK_COMBO(RunProgramCombo)->entry),"changed",(GtkSignalFunc)Entry_Changed_Disable_Object,GTK_OBJECT(Button));
     gtk_signal_emit_by_name(GTK_OBJECT(GTK_COMBO(RunProgramCombo)->entry),"changed",NULL);
 
@@ -2433,7 +2437,7 @@
      * The window is centered over the Browser Area */
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
     gdk_window_get_position(BrowseArea->window,&ba_x,&ba_y);
-    gtk_window_reposition(GTK_WINDOW(RunProgramListWindow),
+    gtk_widget_set_uposition(RunProgramListWindow,
         mw_x + ba_x + (BrowseArea->allocation.width/2)  - (RunProgramListWindow->allocation.width)/2,
         mw_y + ba_y + (BrowseArea->allocation.height/2) - (RunProgramListWindow->allocation.height)/2);
     
diff -u easytag-0.30/src/cddb.c easytag-dsd/src/cddb.c
--- easytag-0.30/src/cddb.c	2003-09-07 00:01:10.000000000 +0100
+++ easytag-dsd/src/cddb.c	2003-12-12 20:10:03.406966200 +0000
@@ -223,7 +223,7 @@
 
     // Set content of the clipboard if available
     gtk_editable_paste_clipboard(GTK_EDITABLE(GTK_COMBO(CddbSearchStringEntry)->entry));
-    gtk_signal_connect(GTK_OBJECT(GTK_COMBO(CddbSearchStringEntry)->entry),"grab-focus",Focus_Select_Text_In_Editable,NULL);
+    gtk_signal_connect(GTK_OBJECT(GTK_COMBO(CddbSearchStringEntry)->entry),"grab-focus",(GtkSignalFunc)Focus_Select_Text_In_Editable,NULL);
     
     CddbStopSearchButton = Create_Button_With_Icon_And_Label(stop_xpm,NULL);
     gtk_box_pack_start(GTK_BOX(hbox),CddbStopSearchButton,FALSE,FALSE,0);
@@ -424,8 +424,9 @@
      */
     CddbWindowHPaned = gtk_hpaned_new();
     gtk_box_pack_start(GTK_BOX(VBox),CddbWindowHPaned,TRUE,TRUE,0);
-    gtk_paned_set_handle_size(GTK_PANED(CddbWindowHPaned),8);
-    gtk_paned_set_gutter_size(GTK_PANED(CddbWindowHPaned),6);                       
+		//FIXME
+    //gtk_paned_set_handle_size(GTK_PANED(CddbWindowHPaned),8);
+    //gtk_paned_set_gutter_size(GTK_PANED(CddbWindowHPaned),6);                       
     if (SET_CDDB_PANE_HANDLE_POSITION)
         gtk_paned_set_position(GTK_PANED(CddbWindowHPaned),CDDB_PANE_HANDLE_POSITION);
 
diff -u easytag-0.30/src/easytag.c easytag-dsd/src/easytag.c
--- easytag-0.30/src/easytag.c	2003-09-07 00:02:34.000000000 +0100
+++ easytag-dsd/src/easytag.c	2003-12-12 20:11:26.503333632 +0000
@@ -228,8 +228,9 @@
     /* The two panes: BrowserArea on the left, FileArea+TagArea on the right */
     MainWindowHPaned = gtk_hpaned_new();
     gtk_box_pack_start(GTK_BOX(MainVBox),MainWindowHPaned,TRUE,TRUE,0);
-    gtk_paned_set_handle_size(GTK_PANED(MainWindowHPaned),8);
-    gtk_paned_set_gutter_size(GTK_PANED(MainWindowHPaned),6);                       
+		//FIXME
+		//gtk_paned_set_handle_size(GTK_PANED(MainWindowHPaned),8);
+    //gtk_paned_set_gutter_size(GTK_PANED(MainWindowHPaned),6);                       
     if (SET_PANE_HANDLE_POSITION1)
         gtk_paned_set_position(GTK_PANED(MainWindowHPaned),PANE_HANDLE_POSITION1);
     gtk_widget_show(MainWindowHPaned);
@@ -2099,7 +2100,7 @@
     /* Note : the window must be shown before to move it */
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
     gdk_window_get_position(BrowseArea->window,&ba_x,&ba_y);
-    gtk_window_reposition(GTK_WINDOW(QuitRecursionWindow),
+    gtk_widget_set_uposition(QuitRecursionWindow,
         mw_x + ba_x + (BrowseArea->allocation.width/2)  - (QuitRecursionWindow->allocation.width)/2,
         mw_y + ba_y + (BrowseArea->allocation.height/2) - (QuitRecursionWindow->allocation.height)/2);
 }
diff -u easytag-0.30/src/et_core.c easytag-dsd/src/et_core.c
--- easytag-0.30/src/et_core.c	2003-09-06 23:57:02.000000000 +0100
+++ easytag-dsd/src/et_core.c	2003-12-12 20:12:50.150617312 +0000
@@ -1354,6 +1354,7 @@
         other = other->next;
     }
     g_list_free(FileTag->other);
+		return TRUE;
 }
 
 
Common subdirectories: easytag-0.30/src/libFLAC and easytag-dsd/src/libFLAC
Common subdirectories: easytag-0.30/src/libapetag and easytag-dsd/src/libapetag
Common subdirectories: easytag-0.30/src/libmpg123 and easytag-dsd/src/libmpg123
diff -u easytag-0.30/src/misc.c easytag-dsd/src/misc.c
--- easytag-0.30/src/misc.c	2003-09-07 00:05:55.000000000 +0100
+++ easytag-dsd/src/misc.c	2003-12-12 20:25:54.732342760 +0000
@@ -618,7 +618,7 @@
 #include <math.h>
 void Parse_Date (void)
 {
-    gchar *year;
+    const gchar *year;
     gchar *tmp, *tmp1;
     gchar current_year[5];
     time_t t;
@@ -941,10 +941,10 @@
 {
     if (GTK_IS_COMBO(widget))
     {
-        return gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(widget)->entry));
+        return (gchar*)gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(widget)->entry));
     }else if (GTK_IS_ENTRY(widget))
     {
-        return gtk_entry_get_text(GTK_ENTRY(widget));
+        return (gchar*)gtk_entry_get_text(GTK_ENTRY(widget));
     }else
     {
         return NULL;
@@ -1043,7 +1043,7 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(PlayListNameEntry),History_List);
     gtk_object_set_data(GTK_OBJECT(PlayListNameEntry),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(PlayListNameEntry)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(PlayListNameEntry));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(PlayListNameEntry));
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_use_mask_name),PLAYLIST_USE_MASK_NAME);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_use_dir_name),PLAYLIST_USE_DIR_NAME);
 
@@ -1126,7 +1126,7 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(PlayListContentMaskEntry),History_List);
     gtk_object_set_data(GTK_OBJECT(PlayListContentMaskEntry),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(PlayListContentMaskEntry)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(PlayListContentMaskEntry));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(PlayListContentMaskEntry));
 
     // Mask status icon
     MaskStatusIconBox1 = Create_Pixmap_Icon_With_Event_Box(forbidden_xpm);
@@ -1167,8 +1167,8 @@
     gtk_container_add(GTK_CONTAINER(ButtonBox),Button);
     GTK_WIDGET_SET_FLAGS(Button,GTK_CAN_DEFAULT);
     gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Playlist_Write_Button_Pressed,NULL);
-    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",Add_To_Combo_Box_History,GTK_OBJECT(PlayListNameEntry));
-    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",Add_To_Combo_Box_History,GTK_OBJECT(PlayListContentMaskEntry));
+    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(PlayListNameEntry));
+    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(PlayListContentMaskEntry));
 
     /* Button to cancel */
     Button = Create_Button_With_Pixmap(BUTTON_CLOSE);
@@ -1180,7 +1180,8 @@
     gtk_widget_show_all(WritePlaylistWindow);
 
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
-    gtk_window_reposition(GTK_WINDOW(WritePlaylistWindow),
+		//FIXME: Does this work?
+		gtk_widget_set_uposition(WritePlaylistWindow,
         mw_x + (MainWindow->allocation.width/2)  - (WritePlaylistWindow->allocation.width)/2,
         mw_y + (MainWindow->allocation.height/2) - (WritePlaylistWindow->allocation.height)/2);
 
@@ -1586,12 +1587,12 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(SearchStringEntry),History_List);
     gtk_object_set_data(GTK_OBJECT(SearchStringEntry),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(SearchStringEntry)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(SearchStringEntry));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(SearchStringEntry));
     gtk_entry_set_text_1(SearchStringEntry,"");
 
     // Set content of the clipboard if available
     gtk_editable_paste_clipboard(GTK_EDITABLE(GTK_COMBO(SearchStringEntry)->entry));
-    gtk_signal_connect(GTK_OBJECT(GTK_COMBO(SearchStringEntry)->entry),"grab-focus",Focus_Select_Text_In_Editable,NULL);
+    gtk_signal_connect(GTK_OBJECT(GTK_COMBO(SearchStringEntry)->entry),"grab-focus",(GtkSignalFunc)Focus_Select_Text_In_Editable,NULL);
 
     // Where...
     Label = gtk_label_new(_("In :"));
@@ -1642,7 +1643,7 @@
     gtk_widget_grab_default(Button);
     gtk_signal_connect(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Search_File,NULL);
     gtk_signal_connect(GTK_OBJECT(GTK_COMBO(SearchStringEntry)->entry),"activate",(GtkSignalFunc)Search_File,NULL);
-    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",Add_To_Combo_Box_History,GTK_OBJECT(SearchStringEntry));
+    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(SearchStringEntry));
 
     // Button to cancel
     Button = Create_Button_With_Pixmap(BUTTON_CLOSE);
@@ -1660,7 +1661,8 @@
     gtk_widget_show_all(SearchFileWindow);
 
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
-    gtk_window_reposition(GTK_WINDOW(SearchFileWindow),
+		//FIXME: Does this work?
+    gtk_widget_set_uposition(SearchFileWindow,
         mw_x + (MainWindow->allocation.width/2)  - (SearchFileWindow->allocation.width)/2,
         mw_y + (MainWindow->allocation.height/2) - (SearchFileWindow->allocation.height)/2);
 
@@ -1815,7 +1817,7 @@
 void Add_Row_To_Search_Result_List(ET_File *ETFile,gchar *string_to_search)
 {
     gchar *SearchResultList_Text[8];
-    gchar *track, *track_total;
+		gchar *track, *track_total;
     gboolean case_sensitive;
     gint new_row;
     gint column;
@@ -1826,7 +1828,7 @@
     case_sensitive = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(SearchCaseSensitive));
     
     // Filename
-    SearchResultList_Text[0] = g_basename( ((File_Name *)ETFile->FileNameNew->data)->value );
+    SearchResultList_Text[0] = (gchar*) g_basename( ((File_Name *)ETFile->FileNameNew->data)->value );
     // Title
     SearchResultList_Text[1] = ((File_Tag *)ETFile->FileTag->data)->title;
     // Artist
@@ -1899,7 +1901,7 @@
     }
 
     // Frees allocated data
-    if (SearchResultList_Text[5]) g_free(SearchResultList_Text[5]);
+    if (SearchResultList_Text[5]) g_free((gchar*)SearchResultList_Text[5]);
 }
 
 /*
@@ -2003,7 +2005,7 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(FileToLoad),History_List);
     gtk_object_set_data(GTK_OBJECT(FileToLoad),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(FileToLoad)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(FileToLoad));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(FileToLoad));
     // Initial value
     if ((path=Browser_Get_Current_Path())!=NULL)
         gtk_entry_set_text_1(FileToLoad,path);
@@ -2108,7 +2110,7 @@
     gtk_container_add(GTK_CONTAINER(ButtonBox),Button);
     GTK_WIDGET_SET_FLAGS(Button,GTK_CAN_DEFAULT);
     gtk_signal_connect(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Load_Filename_Set_Filenames,NULL);
-    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",Add_To_Combo_Box_History,GTK_OBJECT(FileToLoad));
+    gtk_signal_connect_object(GTK_OBJECT(Button),"clicked",(GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(FileToLoad));
 
     // Button to cancel
     Button = Create_Button_With_Pixmap(BUTTON_CLOSE);
@@ -2124,7 +2126,8 @@
     gtk_widget_show_all(LoadFilenameWindow);
 
     gdk_window_get_position(MainWindow->window,&mw_x,&mw_y);
-    gtk_window_reposition(GTK_WINDOW(LoadFilenameWindow),
+		//FIXME: Does this work?
+    gtk_widget_set_uposition(LoadFilenameWindow,
         mw_x + (MainWindow->allocation.width/2)  - (LoadFilenameWindow->allocation.width)/2,
         mw_y + (MainWindow->allocation.height/2) - (LoadFilenameWindow->allocation.height)/2);
 
diff -u easytag-0.30/src/prefs.c easytag-dsd/src/prefs.c
--- easytag-0.30/src/prefs.c	2003-09-07 00:08:01.000000000 +0100
+++ easytag-dsd/src/prefs.c	2003-12-12 20:31:16.323453480 +0000
@@ -129,7 +129,9 @@
     }
 
     /* The window */
-    OptionsWindow = gtk_window_new(GTK_WINDOW_DIALOG);
+		//FIXME
+    OptionsWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    //OptionsWindow = gtk_window_new(GTK_WINDOW_DIALOG);
     /* Config */
     gtk_window_set_position(GTK_WINDOW(OptionsWindow),GTK_WIN_POS_CENTER);
     gtk_window_set_policy(GTK_WINDOW(OptionsWindow),FALSE,FALSE,FALSE);
@@ -212,9 +214,9 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(DefaultPathToMp3),History_List);
     gtk_object_set_data(GTK_OBJECT(DefaultPathToMp3),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(DefaultPathToMp3)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(DefaultPathToMp3));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(DefaultPathToMp3));
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(DefaultPathToMp3)->entry)),"focus_out_event",
-        Add_To_Combo_Box_History,GTK_OBJECT(DefaultPathToMp3));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(DefaultPathToMp3));
 
     // Button browse
     Button = Create_Button_With_Pixmap(BUTTON_BROWSE);
@@ -773,9 +775,9 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(FilePlayerEntry),History_List);
     gtk_object_set_data(GTK_OBJECT(FilePlayerEntry),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(FilePlayerEntry)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(FilePlayerEntry));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(FilePlayerEntry));
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(FilePlayerEntry)->entry)),"focus_out_event",
-        Add_To_Combo_Box_History,GTK_OBJECT(FilePlayerEntry));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(FilePlayerEntry));
 
     // Button browse
     Button = Create_Button_With_Pixmap(BUTTON_BROWSE);
@@ -814,9 +816,9 @@
     gtk_box_pack_start(GTK_BOX(vbox),ConvertUnderscoreAndP20IntoSpace,FALSE,FALSE,0);
     gtk_box_pack_start(GTK_BOX(vbox),ConvertSpaceIntoUnderscore,      FALSE,FALSE,0);
     gtk_signal_connect_object(GTK_OBJECT(ConvertUnderscoreAndP20IntoSpace),"toggled",
-        Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(ConvertSpaceIntoUnderscore));
+        (GtkSignalFunc)Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(ConvertSpaceIntoUnderscore));
     gtk_signal_connect_object(GTK_OBJECT(ConvertSpaceIntoUnderscore),"toggled",
-        Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(ConvertUnderscoreAndP20IntoSpace));
+        (GtkSignalFunc)Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(ConvertUnderscoreAndP20IntoSpace));
 
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ConvertUnderscoreAndP20IntoSpace),
         CONVERT_UNDERSCORE_AND_P20_INTO_SPACE);
@@ -926,9 +928,9 @@
         gtk_combo_set_popdown_strings(GTK_COMBO(DefaultComment),History_List);
     gtk_object_set_data(GTK_OBJECT(DefaultComment),"History",History_List);
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(DefaultComment)->entry)),"activate",
-        Add_To_Combo_Box_History,GTK_OBJECT(DefaultComment));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(DefaultComment));
     gtk_signal_connect_object(GTK_OBJECT(GTK_ENTRY(GTK_COMBO(DefaultComment)->entry)),"focus_out_event",
-        Add_To_Combo_Box_History,GTK_OBJECT(DefaultComment));
+        (GtkSignalFunc)Add_To_Combo_Box_History,GTK_OBJECT(DefaultComment));
     // CRC32 comment
     Crc32Comment = gtk_check_button_new_with_label(_("Use CRC32 as the default "
         "comment (for files with ID3 tags only)."));
@@ -937,9 +939,9 @@
     gtk_tooltips_set_tip(Tips,Crc32Comment,_("Calculates the CRC-32 value of the file "
         "and writes it into the comment field when using the 'Fill Tag' scanner."),NULL);
     gtk_signal_connect_object(GTK_OBJECT(SetDefaultComment), "toggled",
-        Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(Crc32Comment));
+        (GtkSignalFunc)Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(Crc32Comment));
     gtk_signal_connect_object(GTK_OBJECT(Crc32Comment), "toggled",
-        Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(SetDefaultComment));
+        (GtkSignalFunc)Scanner_Convert_Check_Button_Toggled_1,GTK_OBJECT(SetDefaultComment));
 
 
     /*
@@ -1493,8 +1495,9 @@
     if ( (parent_window=gtk_object_get_data(GTK_OBJECT(combo),"Parent_Window")) != NULL )
         gtk_window_set_transient_for(GTK_WINDOW(FileSelectionWindow),GTK_WINDOW(parent_window));
     gtk_window_set_modal(GTK_WINDOW(FileSelectionWindow),TRUE);
-    gtk_signal_connect(GTK_OBJECT(&(GTK_FILE_SELECTION(FileSelectionWindow)->window)),
-                       "delete_event",(GtkSignalFunc)File_Selection_Window_Destroy,FileSelectionWindow);
+		//FIXME
+		//    gtk_signal_connect(GTK_OBJECT(&(GTK_FILE_SELECTION(FileSelectionWindow)->window)),
+		//                       "delete_event",(GtkSignalFunc)File_Selection_Window_Destroy,FileSelectionWindow);
 
     // Callbacks of the buttons
     gtk_signal_connect_object(GTK_OBJECT(GTK_FILE_SELECTION(FileSelectionWindow)->ok_button),
@@ -1510,7 +1513,7 @@
 {
     gchar *tmp;
 
-    tmp = gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSelectionWindow));
+    tmp = (gchar*) gtk_file_selection_get_filename(GTK_FILE_SELECTION(FileSelectionWindow));
     gtk_entry_set_text_1(GTK_WIDGET(widget),tmp);
 
     gtk_widget_destroy(FileSelectionWindow);
diff -u easytag-0.30/src/scan.c easytag-dsd/src/scan.c
--- easytag-0.30/src/scan.c	2003-09-06 21:14:57.000000000 +0100
+++ easytag-dsd/src/scan.c	2003-12-12 20:33:57.344974488 +0000
@@ -1550,9 +1550,9 @@
     pf_cb_group1 = g_list_append (pf_cb_group1,ProcessFieldsConvertSpace);
     /* Toggled signals */
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsConvertIntoSpace),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group1);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group1);
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsConvertSpace),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group1);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group1);
     /* Set check buttons to init value */
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertIntoSpace),PF_CONVERT_INTO_SPACE);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsConvertSpace),PF_CONVERT_SPACE);
@@ -1584,13 +1584,13 @@
     pf_cb_group2 = g_list_append(pf_cb_group2,ProcessFieldsFirstLettersUppercase);
     /* Toggled signals */
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsAllUppercase),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group2);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group2);
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsAllDowncase),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group2);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group2);
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsFirstLetterUppercase),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group2);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group2);
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsFirstLettersUppercase),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group2);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group2);
     /* Set check buttons to init value */
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsAllUppercase),PF_CONVERT_ALL_UPPERCASE);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsAllDowncase),PF_CONVERT_ALL_DOWNCASE);
@@ -1627,11 +1627,11 @@
     pf_cb_group3 = g_list_append (pf_cb_group3,ProcessFieldsOnlyOneSpace);
     /* Toggled signals */
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsRemoveSpace),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group3);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group3);
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsInsertSpace),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group3);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group3);
     gtk_signal_connect(GTK_OBJECT(ProcessFieldsOnlyOneSpace),"toggled",
-        Process_Fields_Check_Button_Toggled,pf_cb_group3);
+        (GtkSignalFunc)Process_Fields_Check_Button_Toggled,pf_cb_group3);
     /* Set check buttons to init value */
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsRemoveSpace),PF_REMOVE_SPACE);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ProcessFieldsInsertSpace),PF_INSERT_SPACE);
--- easytag-0.30/configure.in	2003-09-07 10:30:52.000000000 +0100
+++ easytag-dsd/configure.in	2003-12-12 17:09:51.157677936 +0000
@@ -50,9 +50,9 @@
 AM_PATH_GTK(1.2.7)
 
 dnl GTK+-2.0 librairies
-dnl AM_PATH_GLIB_2_0(2.0.3,, AC_MSG_ERROR([*** GLIB >= 2.0.3 not installed! ***]))
-dnl AM_PATH_GTK_2_0(2.0.3,, AC_MSG_ERROR([*** GTK >= 2.0.3 not installed! ***]))
-dnl PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.3 glib-2.0 >= 2.0.3)
+AM_PATH_GLIB_2_0(2.0.3,, AC_MSG_ERROR([*** GLIB >= 2.0.3 not installed! ***]))
+AM_PATH_GTK_2_0(2.0.3,, AC_MSG_ERROR([*** GTK >= 2.0.3 not installed! ***]))
+PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.0.3 glib-2.0 >= 2.0.3)
 
 
 dnl Get rid of unnecessary and even erroneous compiler options
@@ -247,7 +247,7 @@
  Preprocessor ............: $CC $CPPFLAGS
  Compiler ................: $CC $CFLAGS $LIBFLAC_CFLAGS
  Linker ..................: $CC $LDFLAGS $LIBS $LIBFLAC_LIBS
- GTK+ version ............: `gtk-config --version`
+ GTK+ version ............: `pkg-config --modversion gtk+-2.0`
  Id3lib version ..........: $ID3LIB_MAJOR.$ID3LIB_MINOR.$ID3LIB_PATCH
  NLS/gettext .............: $USE_NLS
  Ogg Vorbis file support .: $enable_ogg


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]