From 2dee4f6997f9b0255398d3150fee5352ebc68045 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 25 Jul 2001 02:22:05 +0000 Subject: [PATCH] HACKING updated, mention pkg-config. 2001-07-25 Michael Natterer * HACKING * INSTALL: updated, mention pkg-config. * app/gdisplay_ops.c * app/gui/resize-dialog.c * app/gui/toolbox.c: more GObject porting and const stuff. --- ChangeLog | 9 ++++++ HACKING | 26 ++++++++------- INSTALL | 4 +-- app/dialogs/resize-dialog.c | 2 +- app/display/gimpdisplay-ops.c | 14 ++++---- app/gdisplay_ops.c | 14 ++++---- app/gui/resize-dialog.c | 2 +- app/gui/toolbox.c | 60 +++++++++++++++++------------------ app/widgets/gimptoolbox.c | 60 +++++++++++++++++------------------ 9 files changed, 102 insertions(+), 89 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5db145e0aa..0fe1a1df35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-07-25 Michael Natterer + + * HACKING + * INSTALL: updated, mention pkg-config. + + * app/gdisplay_ops.c + * app/gui/resize-dialog.c + * app/gui/toolbox.c: more GObject porting and const stuff. + 2001-07-25 Sven Neumann * configure.in: check for pkg-config (>= 0.7) diff --git a/HACKING b/HACKING index 180f31f286..b8c6840de4 100644 --- a/HACKING +++ b/HACKING @@ -9,10 +9,12 @@ to have the following packages installed: - GNU gettext 10.35 Available in ftp://alpha.gnu.org/gnu - These should be available by ftp from prep.ai.mit.edu or any of the fine GNU mirrors. Beta software can be found at alpha.gnu.org. + - pkg-config 0.7.0 or better + Available from http://www.freedesktop.org/software/pkgconfig + Compilation ----------- @@ -30,30 +32,30 @@ Basically this does the following for you: can run the configure script in cvsroot/gimp to create all the Makefiles. -Before running autogen.sh or configure, make sure you have libtool -in your path. Also make sure gtk.m4 is in the same --prefix relative +Before running autogen.sh or configure, make sure you have libtool in +your path. Also make sure gtk-2.0.m4 is in the same --prefix relative to your automake installation. Note that autogen.sh runs configure for you. If you wish to pass -options like --prefix=/usr to configure you can give those options -to autogen.sh and they will be passed on to configure. +options like --prefix=/usr to configure you can give those options to +autogen.sh and they will be passed on to configure. CVS --- -If at all possible, please use CVS to get the latest development version of -gimp, as well as the CVS version of gtk+. You can do the following to get -gimp and gtk+ from cvs: +If at all possible, please use CVS to get the latest development +version of gimp, as well as the CVS version of gtk-doc, glib, pango, +atk and gtk+. You can do the following to get them all from cvs: $ export CVSROOT=':pserver:anonymous@anoncvs.gimp.org:/cvs/gnome' $ cvs login (there is no password, just hit return) - $ cvs -z3 checkout gtk+ gimp + $ cvs -z3 checkout gtk-doc glib pango atk gtk+ gimp Patches ------- -Please submit patches to the gimp-developer@scam.xcf.berkeley.edu mailing +Please submit patches to the gimp-developer@lists.xcf.berkeley.edu mailing list. All kinds of contributions are accepted. Patches that you wish to go into the distribution should also be uploaded to ftp://ftp.gimp.org/incoming. Follow the rules there for naming your patches. @@ -91,13 +93,15 @@ The GIMP coding style is defined as follows: in the first column of the following line. All parameters are prototyped and there's a new line for each. -Try to make use of GTK's object system as much as possible. Do not create +Try to make use of GLib's object system as much as possible. Do not create wrappers around functions of parent classes. If you end up duplicating code, try to create a common parent class and implement the common methods there. Don't include headers in headers except where unavoidable (e.g. for deriving objects). Opaque typedefs go to app/apptypes.h +Don't use the GTK wrappers around the GLib object and signal system. + One goal of the 1.3 development branch is to make the GIMP code more readable and understandable. Please help us to achieve this goal by cleaning up the present code and make sure that all new code follows the coding guidelines. diff --git a/INSTALL b/INSTALL index 296a6a24db..c6cd6a247f 100644 --- a/INSTALL +++ b/INSTALL @@ -4,8 +4,8 @@ STABLE VERSION 1.2 INSTEAD !! YOU HAVE BEEN WARNED! There are six basic steps to building and installing the GIMP: - 1. You need to have installed GTK version 1.2.8 or better. Do not try - to use the unstable GTK+ versions 1.3.x, it will not work. + 1. You need to have installed GTK version 1.3.7 or better. Do not try + to use the stable GTK+ versions 1.2.x, it will not work. 2. You may want to install other third party libraries or programs that are needed for some of the available plugins: TIFF, PNG, JPEG, MPEG, perl, etc. diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 119dabc2fe..dc5f9dff7a 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -208,7 +208,7 @@ resize_widget_new (ResizeType type, _("Reset"), reset_callback, resize, NULL, NULL, FALSE, FALSE, - _("Cancel"), cancel_cb ? cancel_cb : gtk_widget_destroy, + _("Cancel"), cancel_cb ? cancel_cb : G_CALLBACK (gtk_widget_destroy), cancel_cb ? user_data : NULL, cancel_cb ? NULL : (gpointer) 1, NULL, FALSE, TRUE, diff --git a/app/display/gimpdisplay-ops.c b/app/display/gimpdisplay-ops.c index 3321566647..2bcd893a5e 100644 --- a/app/display/gimpdisplay-ops.c +++ b/app/display/gimpdisplay-ops.c @@ -34,11 +34,11 @@ #include "libgimp/gimpintl.h" -static void gdisplay_close_warning_callback (GtkWidget *widget, - gboolean close, - gpointer data); -static void gdisplay_close_warning_dialog (gchar *image_name, - GDisplay *gdisp); +static void gdisplay_close_warning_callback (GtkWidget *widget, + gboolean close, + gpointer data); +static void gdisplay_close_warning_dialog (const gchar *image_name, + GDisplay *gdisp); /* * This file is for operations on the gdisplay object @@ -284,8 +284,8 @@ gdisplay_close_warning_callback (GtkWidget *widget, } static void -gdisplay_close_warning_dialog (gchar *image_name, - GDisplay *gdisp) +gdisplay_close_warning_dialog (const gchar *image_name, + GDisplay *gdisp) { GtkWidget *mbox; gchar *warning_buf; diff --git a/app/gdisplay_ops.c b/app/gdisplay_ops.c index 3321566647..2bcd893a5e 100644 --- a/app/gdisplay_ops.c +++ b/app/gdisplay_ops.c @@ -34,11 +34,11 @@ #include "libgimp/gimpintl.h" -static void gdisplay_close_warning_callback (GtkWidget *widget, - gboolean close, - gpointer data); -static void gdisplay_close_warning_dialog (gchar *image_name, - GDisplay *gdisp); +static void gdisplay_close_warning_callback (GtkWidget *widget, + gboolean close, + gpointer data); +static void gdisplay_close_warning_dialog (const gchar *image_name, + GDisplay *gdisp); /* * This file is for operations on the gdisplay object @@ -284,8 +284,8 @@ gdisplay_close_warning_callback (GtkWidget *widget, } static void -gdisplay_close_warning_dialog (gchar *image_name, - GDisplay *gdisp) +gdisplay_close_warning_dialog (const gchar *image_name, + GDisplay *gdisp) { GtkWidget *mbox; gchar *warning_buf; diff --git a/app/gui/resize-dialog.c b/app/gui/resize-dialog.c index 119dabc2fe..dc5f9dff7a 100644 --- a/app/gui/resize-dialog.c +++ b/app/gui/resize-dialog.c @@ -208,7 +208,7 @@ resize_widget_new (ResizeType type, _("Reset"), reset_callback, resize, NULL, NULL, FALSE, FALSE, - _("Cancel"), cancel_cb ? cancel_cb : gtk_widget_destroy, + _("Cancel"), cancel_cb ? cancel_cb : G_CALLBACK (gtk_widget_destroy), cancel_cb ? user_data : NULL, cancel_cb ? NULL : (gpointer) 1, NULL, FALSE, TRUE, diff --git a/app/gui/toolbox.c b/app/gui/toolbox.c index 66ecc341db..a3ad0916ed 100644 --- a/app/gui/toolbox.c +++ b/app/gui/toolbox.c @@ -259,15 +259,15 @@ toolbox_tool_changed (GimpContext *context, if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active) { - gtk_signal_handler_block_by_func (GTK_OBJECT (toolbox_button), - toolbox_tool_button_toggled, - tool_info); + g_signal_handlers_block_by_func (G_OBJECT (toolbox_button), + toolbox_tool_button_toggled, + tool_info); gtk_widget_activate (toolbox_button); - gtk_signal_handler_unblock_by_func (GTK_OBJECT (toolbox_button), - toolbox_tool_button_toggled, - tool_info); + g_signal_handlers_unblock_by_func (G_OBJECT (toolbox_button), + toolbox_tool_button_toggled, + tool_info); } } } @@ -292,7 +292,7 @@ create_tools (GtkWidget *wbox, button = gtk_radio_button_new (group); - gtk_object_set_data (GTK_OBJECT (tool_info), "toolbox_button", button); + g_object_set_data (G_OBJECT (tool_info), "toolbox_button", button); gtk_container_set_border_width (GTK_CONTAINER (button), 0); group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); @@ -309,13 +309,13 @@ create_tools (GtkWidget *wbox, gtk_container_add (GTK_CONTAINER (alignment), preview); gtk_widget_show (preview); - gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (toolbox_tool_button_toggled), - tool_info); + g_signal_connect (G_OBJECT (button), "toggled", + G_CALLBACK (toolbox_tool_button_toggled), + tool_info); - gtk_signal_connect (GTK_OBJECT (button), "button_press_event", - GTK_SIGNAL_FUNC (toolbox_tool_button_press), - tool_info); + g_signal_connect (G_OBJECT (button), "button_press_event", + G_CALLBACK (toolbox_tool_button_press), + tool_info); gimp_help_set_help_data (button, tool_info->help, @@ -343,17 +343,17 @@ toolbox_create (void) gtk_window_set_title (GTK_WINDOW (window), _("The GIMP")); gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE); - gtk_signal_connect (GTK_OBJECT (window), "delete_event", - GTK_SIGNAL_FUNC (toolbox_delete), - NULL); + g_signal_connect (G_OBJECT (window), "delete_event", + G_CALLBACK (toolbox_delete), + NULL); - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (toolbox_destroy), - NULL); + g_signal_connect (G_OBJECT (window), "destroy", + G_CALLBACK (toolbox_destroy), + NULL); - gtk_signal_connect (GTK_OBJECT (window), "style_set", - GTK_SIGNAL_FUNC (toolbox_style_set_callback), - NULL); + g_signal_connect (G_OBJECT (window), "style_set", + G_CALLBACK (toolbox_style_set_callback), + NULL); /* We need to know when the current device changes, so we can update * the correct tool - to do this we connect to motion events. @@ -370,9 +370,9 @@ toolbox_create (void) if (! list) /* all devices have cursor */ { - gtk_signal_connect (GTK_OBJECT (window), "motion_notify_event", - GTK_SIGNAL_FUNC (toolbox_check_device), - NULL); + g_signal_connect (G_OBJECT (window), "motion_notify_event", + G_CALLBACK (toolbox_check_device), + NULL); gtk_widget_set_events (window, GDK_POINTER_MOTION_MASK); gtk_widget_set_extension_events (window, GDK_EXTENSION_EVENTS_CURSOR); @@ -406,11 +406,11 @@ toolbox_create (void) create_tools (wbox, gimp_get_user_context (the_gimp)); - gtk_signal_connect_while_alive (GTK_OBJECT (gimp_get_user_context (the_gimp)), - "tool_changed", - GTK_SIGNAL_FUNC (toolbox_tool_changed), - NULL, - GTK_OBJECT (wbox)); + g_signal_connect_object (G_OBJECT (gimp_get_user_context (the_gimp)), + "tool_changed", + G_CALLBACK (toolbox_tool_changed), + G_OBJECT (wbox), + 0); create_color_area (wbox); diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c index 66ecc341db..a3ad0916ed 100644 --- a/app/widgets/gimptoolbox.c +++ b/app/widgets/gimptoolbox.c @@ -259,15 +259,15 @@ toolbox_tool_changed (GimpContext *context, if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active) { - gtk_signal_handler_block_by_func (GTK_OBJECT (toolbox_button), - toolbox_tool_button_toggled, - tool_info); + g_signal_handlers_block_by_func (G_OBJECT (toolbox_button), + toolbox_tool_button_toggled, + tool_info); gtk_widget_activate (toolbox_button); - gtk_signal_handler_unblock_by_func (GTK_OBJECT (toolbox_button), - toolbox_tool_button_toggled, - tool_info); + g_signal_handlers_unblock_by_func (G_OBJECT (toolbox_button), + toolbox_tool_button_toggled, + tool_info); } } } @@ -292,7 +292,7 @@ create_tools (GtkWidget *wbox, button = gtk_radio_button_new (group); - gtk_object_set_data (GTK_OBJECT (tool_info), "toolbox_button", button); + g_object_set_data (G_OBJECT (tool_info), "toolbox_button", button); gtk_container_set_border_width (GTK_CONTAINER (button), 0); group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); @@ -309,13 +309,13 @@ create_tools (GtkWidget *wbox, gtk_container_add (GTK_CONTAINER (alignment), preview); gtk_widget_show (preview); - gtk_signal_connect (GTK_OBJECT (button), "toggled", - GTK_SIGNAL_FUNC (toolbox_tool_button_toggled), - tool_info); + g_signal_connect (G_OBJECT (button), "toggled", + G_CALLBACK (toolbox_tool_button_toggled), + tool_info); - gtk_signal_connect (GTK_OBJECT (button), "button_press_event", - GTK_SIGNAL_FUNC (toolbox_tool_button_press), - tool_info); + g_signal_connect (G_OBJECT (button), "button_press_event", + G_CALLBACK (toolbox_tool_button_press), + tool_info); gimp_help_set_help_data (button, tool_info->help, @@ -343,17 +343,17 @@ toolbox_create (void) gtk_window_set_title (GTK_WINDOW (window), _("The GIMP")); gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE); - gtk_signal_connect (GTK_OBJECT (window), "delete_event", - GTK_SIGNAL_FUNC (toolbox_delete), - NULL); + g_signal_connect (G_OBJECT (window), "delete_event", + G_CALLBACK (toolbox_delete), + NULL); - gtk_signal_connect (GTK_OBJECT (window), "destroy", - GTK_SIGNAL_FUNC (toolbox_destroy), - NULL); + g_signal_connect (G_OBJECT (window), "destroy", + G_CALLBACK (toolbox_destroy), + NULL); - gtk_signal_connect (GTK_OBJECT (window), "style_set", - GTK_SIGNAL_FUNC (toolbox_style_set_callback), - NULL); + g_signal_connect (G_OBJECT (window), "style_set", + G_CALLBACK (toolbox_style_set_callback), + NULL); /* We need to know when the current device changes, so we can update * the correct tool - to do this we connect to motion events. @@ -370,9 +370,9 @@ toolbox_create (void) if (! list) /* all devices have cursor */ { - gtk_signal_connect (GTK_OBJECT (window), "motion_notify_event", - GTK_SIGNAL_FUNC (toolbox_check_device), - NULL); + g_signal_connect (G_OBJECT (window), "motion_notify_event", + G_CALLBACK (toolbox_check_device), + NULL); gtk_widget_set_events (window, GDK_POINTER_MOTION_MASK); gtk_widget_set_extension_events (window, GDK_EXTENSION_EVENTS_CURSOR); @@ -406,11 +406,11 @@ toolbox_create (void) create_tools (wbox, gimp_get_user_context (the_gimp)); - gtk_signal_connect_while_alive (GTK_OBJECT (gimp_get_user_context (the_gimp)), - "tool_changed", - GTK_SIGNAL_FUNC (toolbox_tool_changed), - NULL, - GTK_OBJECT (wbox)); + g_signal_connect_object (G_OBJECT (gimp_get_user_context (the_gimp)), + "tool_changed", + G_CALLBACK (toolbox_tool_changed), + G_OBJECT (wbox), + 0); create_color_area (wbox);