mirror of https://github.com/GNOME/gimp.git
removed trailing whitespace.
2004-02-05 Michael Natterer <mitch@gimp.org> * app/core/gimpimage-crop.c: removed trailing whitespace. * app/gui/debug-commands.[ch] * app/gui/toolbox-menu.c: renamed ENABLE_DEBUG_ENTRIES to ENABLE_DEBUG_MENU and #define it to be equal to GIMP_UNSTABLE.
This commit is contained in:
parent
b48b110e3e
commit
be6b23d68a
|
@ -1,3 +1,11 @@
|
||||||
|
2004-02-05 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/core/gimpimage-crop.c: removed trailing whitespace.
|
||||||
|
|
||||||
|
* app/gui/debug-commands.[ch]
|
||||||
|
* app/gui/toolbox-menu.c: renamed ENABLE_DEBUG_ENTRIES to
|
||||||
|
ENABLE_DEBUG_MENU and #define it to be equal to GIMP_UNSTABLE.
|
||||||
|
|
||||||
2004-02-05 Michael Natterer <mitch@gimp.org>
|
2004-02-05 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/tools/gimprectselecttool.c
|
* app/tools/gimprectselecttool.c
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_ENTRIES
|
#ifdef ENABLE_DEBUG_MENU
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
|
@ -145,4 +145,4 @@ debug_dump_menus_recurse_menu (GtkWidget *menu,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ENABLE_DEBUG_ENTRIES */
|
#endif /* ENABLE_DEBUG_MENU */
|
||||||
|
|
|
@ -20,17 +20,17 @@
|
||||||
#define __DEBUG_COMMANDS_H__
|
#define __DEBUG_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
#define ENABLE_DEBUG_ENTRIES 1
|
#define ENABLE_DEBUG_MENU GIMP_UNSTABLE
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_ENTRIES
|
#ifdef ENABLE_DEBUG_MENU
|
||||||
void debug_dump_menus_cmd_callback (GtkWidget *widget,
|
void debug_dump_menus_cmd_callback (GtkWidget *widget,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
guint action);
|
guint action);
|
||||||
void debug_mem_profile_cmd_callback (GtkWidget *widget,
|
void debug_mem_profile_cmd_callback (GtkWidget *widget,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
guint action);
|
guint action);
|
||||||
#endif /* ENABLE_DEBUG_ENTRIES */
|
#endif /* ENABLE_DEBUG_MENU */
|
||||||
|
|
||||||
|
|
||||||
#endif /* __DEBUG_COMMANDS_H__ */
|
#endif /* __DEBUG_COMMANDS_H__ */
|
||||||
|
|
|
@ -63,9 +63,9 @@ static AutoCropType gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
|
||||||
gint bytes,
|
gint bytes,
|
||||||
gboolean has_alpha,
|
gboolean has_alpha,
|
||||||
guchar *color,
|
guchar *color,
|
||||||
gint x1,
|
gint x1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint y2);
|
gint y2);
|
||||||
static gint gimp_image_crop_colors_equal (guchar *col1,
|
static gint gimp_image_crop_colors_equal (guchar *col1,
|
||||||
guchar *col2,
|
guchar *col2,
|
||||||
|
@ -287,7 +287,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
|
||||||
gint bytes;
|
gint bytes;
|
||||||
gint x, y, abort;
|
gint x, y, abort;
|
||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
|
|
||||||
g_return_val_if_fail (gimage != NULL, FALSE);
|
g_return_val_if_fail (gimage != NULL, FALSE);
|
||||||
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
|
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
|
||||||
g_return_val_if_fail (shrunk_x1 != NULL, FALSE);
|
g_return_val_if_fail (shrunk_x1 != NULL, FALSE);
|
||||||
|
@ -296,10 +296,10 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
|
||||||
g_return_val_if_fail (shrunk_y2 != NULL, FALSE);
|
g_return_val_if_fail (shrunk_y2 != NULL, FALSE);
|
||||||
|
|
||||||
gimp_set_busy (gimage->gimp);
|
gimp_set_busy (gimage->gimp);
|
||||||
|
|
||||||
/* You should always keep in mind that crop->tx2 and crop->ty2 are the NOT the
|
/* You should always keep in mind that crop->tx2 and crop->ty2 are the NOT the
|
||||||
coordinates of the bottomright corner of the area to be cropped. They point
|
coordinates of the bottomright corner of the area to be cropped. They point
|
||||||
at the pixel located one to the right and one to the bottom.
|
at the pixel located one to the right and one to the bottom.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (active_drawable_only)
|
if (active_drawable_only)
|
||||||
|
@ -316,7 +316,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
has_alpha = TRUE;
|
has_alpha = TRUE;
|
||||||
bytes = gimp_image_projection_bytes (gimage);
|
bytes = gimp_image_projection_bytes (gimage);
|
||||||
get_color_obj = G_OBJECT (gimage);
|
get_color_obj = G_OBJECT (gimage);
|
||||||
get_color_func = (GetColorFunc) gimp_image_projection_get_color_at;
|
get_color_func = (GetColorFunc) gimp_image_projection_get_color_at;
|
||||||
|
@ -341,10 +341,10 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
|
||||||
height = y2 - y1;
|
height = y2 - y1;
|
||||||
|
|
||||||
if (active_drawable_only)
|
if (active_drawable_only)
|
||||||
pixel_region_init (&PR, gimp_drawable_data (active_drawable),
|
pixel_region_init (&PR, gimp_drawable_data (active_drawable),
|
||||||
x1, y1, width, height, FALSE);
|
x1, y1, width, height, FALSE);
|
||||||
else
|
else
|
||||||
pixel_region_init (&PR, gimp_image_projection (gimage),
|
pixel_region_init (&PR, gimp_image_projection (gimage),
|
||||||
x1, y1, width, height, FALSE);
|
x1, y1, width, height, FALSE);
|
||||||
|
|
||||||
/* The following could be optimized further by processing
|
/* The following could be optimized further by processing
|
||||||
|
@ -387,7 +387,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage,
|
||||||
abort = !(colors_equal_func) (bgcolor, buffer + y * bytes, bytes);
|
abort = !(colors_equal_func) (bgcolor, buffer + y * bytes, bytes);
|
||||||
}
|
}
|
||||||
x1 = x - 1;
|
x1 = x - 1;
|
||||||
|
|
||||||
/* Check how many of the right lines are uniform/transparent. */
|
/* Check how many of the right lines are uniform/transparent. */
|
||||||
abort = FALSE;
|
abort = FALSE;
|
||||||
for (x = x2; x > x1 && !abort; x--)
|
for (x = x2; x > x1 && !abort; x--)
|
||||||
|
@ -421,10 +421,10 @@ gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
|
||||||
gint bytes,
|
gint bytes,
|
||||||
gboolean has_alpha,
|
gboolean has_alpha,
|
||||||
guchar *color,
|
guchar *color,
|
||||||
gint x1,
|
gint x1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint y2)
|
gint y2)
|
||||||
{
|
{
|
||||||
guchar *tl = NULL;
|
guchar *tl = NULL;
|
||||||
guchar *tr = NULL;
|
guchar *tr = NULL;
|
||||||
|
@ -433,19 +433,19 @@ gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
|
||||||
gint i, alpha;
|
gint i, alpha;
|
||||||
|
|
||||||
for (i = 0; i < bytes; i++)
|
for (i = 0; i < bytes; i++)
|
||||||
color[i] = 0;
|
color[i] = 0;
|
||||||
|
|
||||||
/* First check if there's transparency to crop. If not, guess the
|
/* First check if there's transparency to crop. If not, guess the
|
||||||
* background-color to see if at least 2 corners are equal.
|
* background-color to see if at least 2 corners are equal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!(tl = (*get_color_func) (get_color_obj, x1, y1)))
|
if (!(tl = (*get_color_func) (get_color_obj, x1, y1)))
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
if (!(tr = (*get_color_func) (get_color_obj, x1, y2)))
|
if (!(tr = (*get_color_func) (get_color_obj, x1, y2)))
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
if (!(bl = (*get_color_func) (get_color_obj, x2, y1)))
|
if (!(bl = (*get_color_func) (get_color_obj, x2, y1)))
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
if (!(br = (*get_color_func) (get_color_obj, x2, y2)))
|
if (!(br = (*get_color_func) (get_color_obj, x2, y2)))
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
|
|
||||||
if (has_alpha)
|
if (has_alpha)
|
||||||
|
@ -463,7 +463,7 @@ gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
|
||||||
return AUTO_CROP_ALPHA;
|
return AUTO_CROP_ALPHA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gimp_image_crop_colors_equal (tl, tr, bytes) ||
|
if (gimp_image_crop_colors_equal (tl, tr, bytes) ||
|
||||||
gimp_image_crop_colors_equal (tl, bl, bytes))
|
gimp_image_crop_colors_equal (tl, bl, bytes))
|
||||||
{
|
{
|
||||||
|
@ -479,28 +479,28 @@ gimp_image_crop_guess_bgcolor (GObject *get_color_obj,
|
||||||
goto ERROR;
|
goto ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (tl);
|
g_free (tl);
|
||||||
g_free (tr);
|
g_free (tr);
|
||||||
g_free (bl);
|
g_free (bl);
|
||||||
g_free (br);
|
g_free (br);
|
||||||
return AUTO_CROP_COLOR;
|
return AUTO_CROP_COLOR;
|
||||||
|
|
||||||
ERROR:
|
ERROR:
|
||||||
g_free (tl);
|
g_free (tl);
|
||||||
g_free (tr);
|
g_free (tr);
|
||||||
g_free (bl);
|
g_free (bl);
|
||||||
g_free (br);
|
g_free (br);
|
||||||
return AUTO_CROP_NOTHING;
|
return AUTO_CROP_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gimp_image_crop_colors_equal (guchar *col1,
|
gimp_image_crop_colors_equal (guchar *col1,
|
||||||
guchar *col2,
|
guchar *col2,
|
||||||
gint bytes)
|
gint bytes)
|
||||||
{
|
{
|
||||||
gboolean equal = TRUE;
|
gboolean equal = TRUE;
|
||||||
gint b;
|
gint b;
|
||||||
|
|
||||||
for (b = 0; b < bytes; b++)
|
for (b = 0; b < bytes; b++)
|
||||||
{
|
{
|
||||||
if (col1[b] != col2[b])
|
if (col1[b] != col2[b])
|
||||||
|
@ -514,9 +514,9 @@ gimp_image_crop_colors_equal (guchar *col1,
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_image_crop_colors_alpha (guchar *dummy,
|
gimp_image_crop_colors_alpha (guchar *dummy,
|
||||||
guchar *col,
|
guchar *col,
|
||||||
gint bytes)
|
gint bytes)
|
||||||
{
|
{
|
||||||
if (col[bytes-1] == 0)
|
if (col[bytes-1] == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "menus.h"
|
#include "menus.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_ENTRIES
|
#ifdef ENABLE_DEBUG_MENU
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
|
@ -145,4 +145,4 @@ debug_dump_menus_recurse_menu (GtkWidget *menu,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ENABLE_DEBUG_ENTRIES */
|
#endif /* ENABLE_DEBUG_MENU */
|
||||||
|
|
|
@ -20,17 +20,17 @@
|
||||||
#define __DEBUG_COMMANDS_H__
|
#define __DEBUG_COMMANDS_H__
|
||||||
|
|
||||||
|
|
||||||
#define ENABLE_DEBUG_ENTRIES 1
|
#define ENABLE_DEBUG_MENU GIMP_UNSTABLE
|
||||||
|
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_ENTRIES
|
#ifdef ENABLE_DEBUG_MENU
|
||||||
void debug_dump_menus_cmd_callback (GtkWidget *widget,
|
void debug_dump_menus_cmd_callback (GtkWidget *widget,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
guint action);
|
guint action);
|
||||||
void debug_mem_profile_cmd_callback (GtkWidget *widget,
|
void debug_mem_profile_cmd_callback (GtkWidget *widget,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
guint action);
|
guint action);
|
||||||
#endif /* ENABLE_DEBUG_ENTRIES */
|
#endif /* ENABLE_DEBUG_MENU */
|
||||||
|
|
||||||
|
|
||||||
#endif /* __DEBUG_COMMANDS_H__ */
|
#endif /* __DEBUG_COMMANDS_H__ */
|
||||||
|
|
|
@ -225,7 +225,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
|
||||||
"gimp-error-console",
|
"gimp-error-console",
|
||||||
GIMP_HELP_ERRORS_DIALOG, NULL },
|
GIMP_HELP_ERRORS_DIALOG, NULL },
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_ENTRIES
|
#ifdef ENABLE_DEBUG_MENU
|
||||||
MENU_BRANCH (N_("/File/D_ebug")),
|
MENU_BRANCH (N_("/File/D_ebug")),
|
||||||
|
|
||||||
{ { "/File/Debug/_Mem Profile", NULL,
|
{ { "/File/Debug/_Mem Profile", NULL,
|
||||||
|
@ -234,7 +234,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
|
||||||
{ { "/File/Debug/_Dump Items", NULL,
|
{ { "/File/Debug/_Dump Items", NULL,
|
||||||
debug_dump_menus_cmd_callback, 0 },
|
debug_dump_menus_cmd_callback, 0 },
|
||||||
NULL, NULL, NULL },
|
NULL, NULL, NULL },
|
||||||
#endif
|
#endif /* ENABLE_DEBUG_MENU */
|
||||||
|
|
||||||
MENU_SEPARATOR ("/File/---"),
|
MENU_SEPARATOR ("/File/---"),
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
|
||||||
"gimp-error-console",
|
"gimp-error-console",
|
||||||
GIMP_HELP_ERRORS_DIALOG, NULL },
|
GIMP_HELP_ERRORS_DIALOG, NULL },
|
||||||
|
|
||||||
#ifdef ENABLE_DEBUG_ENTRIES
|
#ifdef ENABLE_DEBUG_MENU
|
||||||
MENU_BRANCH (N_("/File/D_ebug")),
|
MENU_BRANCH (N_("/File/D_ebug")),
|
||||||
|
|
||||||
{ { "/File/Debug/_Mem Profile", NULL,
|
{ { "/File/Debug/_Mem Profile", NULL,
|
||||||
|
@ -234,7 +234,7 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
|
||||||
{ { "/File/Debug/_Dump Items", NULL,
|
{ { "/File/Debug/_Dump Items", NULL,
|
||||||
debug_dump_menus_cmd_callback, 0 },
|
debug_dump_menus_cmd_callback, 0 },
|
||||||
NULL, NULL, NULL },
|
NULL, NULL, NULL },
|
||||||
#endif
|
#endif /* ENABLE_DEBUG_MENU */
|
||||||
|
|
||||||
MENU_SEPARATOR ("/File/---"),
|
MENU_SEPARATOR ("/File/---"),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue