[Gimp-developer] Patch for gimp HEAD

2001-08-31 Thread Thomas Canty

Firstly a couple of questions about the coding standard,

1. The coding standard specfies that tabs are not to be used, however
tabs are used throughout the source code. Why is this?

2. I have tried using 'indent' to indent the code according to the
coding standards, however this does not produce satisfactory results. (i
have tried various options including the standard GNU style)

What's the best way to make the code comply with the coding standards? 

Here is a patch which replaces some depreciated GDK functions,

Okay to commit?,

thanks,

Thomas



Index: gimp/ChangeLog
===
RCS file: /cvs/gnome/gimp/ChangeLog,v
retrieving revision 1.3738
diff -u -r1.3738 ChangeLog
--- gimp/ChangeLog  2001/08/30 01:09:54 1.3738
+++ gimp/ChangeLog  2001/08/31 04:11:31
@@ -1,3 +1,32 @@
+2001-08-31  Thomas Canty  [EMAIL PROTECTED]
+   * app/colormaps.c
+   * app/gdisplay.c
+   * app/nav_window.c
+   * app/scroll.c
+   * app/selection.c
+   * app/undo.c
+   * app/gui/about-dialog.c
+   * app/gui/color-area.c
+   * app/gui/color-select.c
+   * app/gui/gradient-editor.c
+   * app/gui/gui.c
+   * app/gui/splash.c
+   * app/tools/gimpcurvestool.c
+   * plug-ins/Lighting/lighting_preview.c
+   * plug-ins/Lighting/lighting_ui.c
+   * plug-ins/MapObject/mapobject_preview.c
+   * plug-ins/MapObject/mapobject_ui.c
+   * plug-ins/common/animationplay.c
+   * plug-ins/common/curve_bend.c
+   * plug-ins/gap/gap_navigator_dialog.c
+   * plug-ins/gfig/gfig.c
+   * plug-ins/gimpressionist/gimpressionist.c
+   * plug-ins/ifscompose/ifscompose.c
+   * plug-ins/imagemap/imap_main.c
+   * plug-ins/imagemap/imap_preferences.c
+   * plug-ins/imagemap/imap_preview.c: replaced some deprecated GDK 
+   functions
+
 2001-08-30  Michael Natterer  [EMAIL PROTECTED]
 
* app/plug_in.c
Index: gimp/app/colormaps.c
===
RCS file: /cvs/gnome/gimp/app/colormaps.c,v
retrieving revision 1.21
diff -u -r1.21 colormaps.c
--- gimp/app/colormaps.c2001/07/24 21:26:46 1.21
+++ gimp/app/colormaps.c2001/08/31 04:11:33
@@ -72,7 +72,7 @@
   gdk_rgb_set_install (gimprc.install_cmap);
 
   g_visual = gdk_rgb_get_visual ();
-  g_cmap   = gdk_rgb_get_cmap ();
+  g_cmap   = gdk_rgb_get_colormap ();
 
   gtk_widget_set_default_colormap (g_cmap);
 
Index: gimp/app/gdisplay.c
===
RCS file: /cvs/gnome/gimp/app/gdisplay.c,v
retrieving revision 1.199
diff -u -r1.199 gdisplay.c
--- gimp/app/gdisplay.c 2001/08/29 17:48:13 1.199
+++ gimp/app/gdisplay.c 2001/08/31 04:11:47
@@ -462,7 +462,7 @@
   g_signal_handlers_disconnect_by_data (G_OBJECT (gdisp-gimage), gdisp);
 
   if (gdisp-scroll_gc)
-gdk_gc_destroy (gdisp-scroll_gc);
+gdk_gc_unref (gdisp-scroll_gc);
 
   /*  free the area lists  */
   gdisplay_free_area_list (gdisp-update_areas);
@@ -879,7 +879,7 @@
 
   icongc = gdk_gc_new (gdisp-icon);
   iconmaskgc = gdk_gc_new (gdisp-iconmask);
-  colormap = gdk_colormap_get_system ();   /* or gdk_rgb_get_cmap ()  */
+  colormap = gdk_colormap_get_system ();   /* or gdk_rgb_get_colormap ()  */
 
   gdk_color_white (colormap, white);
   gdk_color_black (colormap, black);
@@ -1148,7 +1148,7 @@
   gdisplay_transform_coords (gdisp,
 gdisp-gimage-width, gdisp-gimage-height,
 x2, y2, FALSE);
-  gdk_window_get_size (gdisp-canvas-window, w, h);
+  gdk_drawable_get_size (gdisp-canvas-window, w, h);
 
   if (x1  0) x1 = 0;
   if (y1  0) y1 = 0;
@@ -1933,7 +1933,7 @@
tool_cursor,
modifier);
   gdk_window_set_cursor (gdisp-canvas-window, cursor);
-  gdk_cursor_destroy (cursor);
+  gdk_cursor_unref (cursor);
 }
 }
 
@@ -1968,7 +1968,7 @@
GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE);
   gdk_window_set_cursor (gdisp-canvas-window, cursor);
-  gdk_cursor_destroy (cursor);
+  gdk_cursor_unref(cursor);
 }
 }
 
Index: gimp/app/nav_window.c
===
RCS file: /cvs/gnome/gimp/app/nav_window.c,v
retrieving revision 1.73
diff -u -r1.73 nav_window.c
--- gimp/app/nav_window.c   2001/08/29 17:48:14 1.73
+++ gimp/app/nav_window.c   2001/08/31 04:12:09
@@ -1252,7 +1252,7 @@
GDK_EXTENSION_EVENTS_ALL,
widget-window, cursor, 0);
 
-  gdk_cursor_destroy (cursor); 
+  gdk_cursor_unref (cursor); 
 }
 
 static gboolean
Index: gimp/app/scroll.c
===
RCS file: /cvs/gnome/gimp/app/scroll.c,v
retrieving revision 1.26
diff -u -r1.26 scroll.c
--- gimp/app/scroll.c   2001/07/24 21:26:46 1.26

Re: [Gimp-developer] Patch for gimp HEAD

2001-08-31 Thread Sven Neumann

Hi,

Thomas Canty [EMAIL PROTECTED] writes:

 1. The coding standard specfies that tabs are not to be used, however
 tabs are used throughout the source code. Why is this?

because we haven't yet eliminated them all? The coding standard describes
how we would like new code to look like and we appreciate any effort to
convert existing code to this standard.

 2. I have tried using 'indent' to indent the code according to the
 coding standards, however this does not produce satisfactory results. (i
 have tried various options including the standard GNU style)

it would be very nice if indent would create satisfactory results, but
it seems it doesn't. Sometimes 'indent --gnu' is a good start but the 
code needs a lot of finetuning by hand afterwards.

 What's the best way to make the code comply with the coding standards? 

use the standard emacs settings and add the following line to your 
.emacs to suppress insertion of tabs:

  (setq c-mode-common-hook '(lambda () (setq indent-tabs-mode nil)))

 Here is a patch which replaces some depreciated GDK functions,
 
 Okay to commit?,

looks good to me, go ahead.


Salut, Sven
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer