app/core/gimpcontext.c app/core/gimpimage.c app/paint-funcs/paint-funcs.c

2006-04-06  Sven Neumann  <sven@gimp.org>

	* app/core/gimpcontext.c
	* app/core/gimpimage.c
	* app/paint-funcs/paint-funcs.c
	* app/widgets/gimpcontrollerkeyboard.c
	* app/widgets/gimpcontrollerwheel.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdockbook.c
	* app/widgets/gimpdockseparator.c
	* libgimp/gimpbrushselect.c
	* libgimp/gimpfontselect.c
	* libgimp/gimpgradientselect.c
	* libgimp/gimppaletteselect.c
	* libgimp/gimppatternselect.c
	* libgimpwidgets/gimpchainbutton.c
	* libgimpwidgets/gimpcolorscales.c
	* libgimpwidgets/gimpcolorselect.c
	* libgimpwidgets/gimppickbutton.c
	* libgimpwidgets/gimpstock.c: sprinkled some const qualifiers.
This commit is contained in:
Sven Neumann 2006-04-06 12:43:58 +00:00 committed by Sven Neumann
parent 6f8f925c69
commit 37da566934
20 changed files with 70 additions and 45 deletions

View File

@ -1,3 +1,25 @@
2006-04-06 Sven Neumann <sven@gimp.org>
* app/core/gimpcontext.c
* app/core/gimpimage.c
* app/paint-funcs/paint-funcs.c
* app/widgets/gimpcontrollerkeyboard.c
* app/widgets/gimpcontrollerwheel.c
* app/widgets/gimpcursor.c
* app/widgets/gimpdockable.c
* app/widgets/gimpdockbook.c
* app/widgets/gimpdockseparator.c
* libgimp/gimpbrushselect.c
* libgimp/gimpfontselect.c
* libgimp/gimpgradientselect.c
* libgimp/gimppaletteselect.c
* libgimp/gimppatternselect.c
* libgimpwidgets/gimpchainbutton.c
* libgimpwidgets/gimpcolorscales.c
* libgimpwidgets/gimpcolorselect.c
* libgimpwidgets/gimppickbutton.c
* libgimpwidgets/gimpstock.c: sprinkled some const qualifiers.
2006-04-06 Sven Neumann <sven@gimp.org> 2006-04-06 Sven Neumann <sven@gimp.org>
* app/core/gimpdata.c (gimp_data_error_quark) * app/core/gimpdata.c (gimp_data_error_quark)

View File

@ -279,7 +279,7 @@ enum
LAST_SIGNAL LAST_SIGNAL
}; };
static gchar *gimp_context_prop_names[] = static const gchar *gimp_context_prop_names[] =
{ {
NULL, /* PROP_0 */ NULL, /* PROP_0 */
"gimp", "gimp",

View File

@ -179,7 +179,7 @@ static void gimp_image_channel_color_changed (GimpChannel *channel,
GimpImage *image); GimpImage *image);
static gint valid_combinations[][MAX_CHANNELS + 1] = static const gint valid_combinations[][MAX_CHANNELS + 1] =
{ {
/* GIMP_RGB_IMAGE */ /* GIMP_RGB_IMAGE */
{ -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A },

View File

@ -47,9 +47,10 @@
typedef struct _LayerMode LayerMode; typedef struct _LayerMode LayerMode;
struct _LayerMode struct _LayerMode
{ {
guint affect_alpha : 1; /* does the layer mode affect the alpha channel */ const guint affect_alpha : 1; /* does the layer mode affect the
guint increase_opacity : 1; /* layer mode can increase opacity */ alpha channel */
guint decrease_opacity : 1; /* layer mode can decrease opacity */ const guint increase_opacity : 1; /* layer mode can increase opacity */
const guint decrease_opacity : 1; /* layer mode can decrease opacity */
}; };
static const LayerMode layer_modes[] = static const LayerMode layer_modes[] =
@ -86,8 +87,10 @@ static const LayerMode layer_modes[] =
{ TRUE, TRUE, FALSE, } /* GIMP_ANTI_ERASE_MODE */ { TRUE, TRUE, FALSE, } /* GIMP_ANTI_ERASE_MODE */
}; };
typedef void (* LayerModeFunc) (struct apply_layer_mode_struct *); typedef void (* LayerModeFunc) (struct apply_layer_mode_struct *);
static LayerModeFunc layer_mode_funcs[] =
static const LayerModeFunc layer_mode_funcs[] =
{ {
layer_normal_mode, layer_normal_mode,
layer_dissolve_mode, layer_dissolve_mode,

View File

@ -40,10 +40,10 @@ typedef struct _KeyboardEvent KeyboardEvent;
struct _KeyboardEvent struct _KeyboardEvent
{ {
guint keyval; const guint keyval;
GdkModifierType modifiers; const GdkModifierType modifiers;
const gchar *name; const gchar *name;
gchar *blurb; gchar *blurb;
}; };

View File

@ -39,10 +39,10 @@ typedef struct _WheelEvent WheelEvent;
struct _WheelEvent struct _WheelEvent
{ {
GdkScrollDirection direction; const GdkScrollDirection direction;
GdkModifierType modifiers; const GdkModifierType modifiers;
const gchar *name; const gchar *name;
gchar *blurb; gchar *blurb;
}; };

View File

@ -140,10 +140,10 @@ typedef struct _GimpCursor GimpCursor;
struct _GimpCursor struct _GimpCursor
{ {
guchar *bits; const guchar *bits;
guchar *mask_bits; const guchar *mask_bits;
gint width, height; const gint width, height;
gint x_hot, y_hot; const gint x_hot, y_hot;
const guint8 *pixbuf_data; const guint8 *pixbuf_data;
GdkBitmap *bitmap; GdkBitmap *bitmap;
@ -166,7 +166,7 @@ static GimpCursor gimp_cursors[] =
cursor_mouse_bits, cursor_mouse_mask_bits, cursor_mouse_bits, cursor_mouse_mask_bits,
cursor_mouse_width, cursor_mouse_height, cursor_mouse_width, cursor_mouse_height,
cursor_mouse_x_hot, cursor_mouse_y_hot, cursor_mouse_x_hot, cursor_mouse_y_hot,
cursor_mouse, cursor_mouse, NULL, NULL, NULL
}, },
{ {
cursor_crosshair_bits, cursor_crosshair_mask_bits, cursor_crosshair_bits, cursor_crosshair_mask_bits,

View File

@ -94,7 +94,7 @@ G_DEFINE_TYPE (GimpDockable, gimp_dockable, GTK_TYPE_BIN);
#define parent_class gimp_dockable_parent_class #define parent_class gimp_dockable_parent_class
static GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; static const GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG };
static void static void

View File

@ -101,10 +101,7 @@ G_DEFINE_TYPE (GimpDockbook, gimp_dockbook, GTK_TYPE_NOTEBOOK);
static guint dockbook_signals[LAST_SIGNAL] = { 0 }; static guint dockbook_signals[LAST_SIGNAL] = { 0 };
static GtkTargetEntry dialog_target_table[] = static const GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG };
{
GIMP_TARGET_DIALOG
};
static void static void

View File

@ -67,7 +67,7 @@ G_DEFINE_TYPE (GimpDockSeparator, gimp_dock_separator, GTK_TYPE_EVENT_BOX);
#define parent_class gimp_dock_separator_parent_class #define parent_class gimp_dock_separator_parent_class
static GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; static const GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG };
static void static void

View File

@ -69,7 +69,7 @@ gimp_brush_select_new (const gchar *title,
GimpRunBrushCallback callback, GimpRunBrushCallback callback,
gpointer data) gpointer data)
{ {
static GimpParamDef args[] = static const GimpParamDef args[] =
{ {
{ GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_STRING, "str", "String" },
{ GIMP_PDB_FLOAT, "opacity", "Opacity" }, { GIMP_PDB_FLOAT, "opacity", "Opacity" },

View File

@ -60,7 +60,7 @@ gimp_font_select_new (const gchar *title,
GimpRunFontCallback callback, GimpRunFontCallback callback,
gpointer data) gpointer data)
{ {
static GimpParamDef args[] = static const GimpParamDef args[] =
{ {
{ GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_STRING, "str", "String" },
{ GIMP_PDB_INT32, "dialog status", "If the dialog was closing " { GIMP_PDB_INT32, "dialog status", "If the dialog was closing "

View File

@ -63,7 +63,7 @@ gimp_gradient_select_new (const gchar *title,
GimpRunGradientCallback callback, GimpRunGradientCallback callback,
gpointer data) gpointer data)
{ {
static GimpParamDef args[] = static const GimpParamDef args[] =
{ {
{ GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_STRING, "str", "String" },
{ GIMP_PDB_INT32, "grad width", "Gradient width" }, { GIMP_PDB_INT32, "grad width", "Gradient width" },

View File

@ -60,7 +60,7 @@ gimp_palette_select_new (const gchar *title,
GimpRunPaletteCallback callback, GimpRunPaletteCallback callback,
gpointer data) gpointer data)
{ {
static GimpParamDef args[] = static const GimpParamDef args[] =
{ {
{ GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_STRING, "str", "String" },
{ GIMP_PDB_INT32, "dialog status", "If the dialog was closing " { GIMP_PDB_INT32, "dialog status", "If the dialog was closing "

View File

@ -64,7 +64,7 @@ gimp_pattern_select_new (const gchar *title,
GimpRunPatternCallback callback, GimpRunPatternCallback callback,
gpointer data) gpointer data)
{ {
static GimpParamDef args[] = static const GimpParamDef args[] =
{ {
{ GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_STRING, "str", "String" },
{ GIMP_PDB_INT32, "mask width", "Pattern width" }, { GIMP_PDB_INT32, "mask width", "Pattern width" },

View File

@ -48,7 +48,7 @@ G_DEFINE_TYPE (GimpChainButton, gimp_chain_button, GTK_TYPE_TABLE);
static guint gimp_chain_button_signals[LAST_SIGNAL] = { 0 }; static guint gimp_chain_button_signals[LAST_SIGNAL] = { 0 };
static const gchar *gimp_chain_stock_items[] = static const gchar * const gimp_chain_stock_items[] =
{ {
GIMP_STOCK_HCHAIN, GIMP_STOCK_HCHAIN,
GIMP_STOCK_HCHAIN_BROKEN, GIMP_STOCK_HCHAIN_BROKEN,

View File

@ -114,9 +114,12 @@ gimp_color_scales_init (GimpColorScales *scales)
GSList *group; GSList *group;
gint i; gint i;
static gdouble slider_initial_vals[] = { 0, 0, 0, 0, 0, 0, 0 }; static const gdouble slider_initial_vals[] =
static gdouble slider_max_vals[] = { 360, 100, 100, 255, 255, 255, 100 }; { 0, 0, 0, 0, 0, 0, 0 };
static gdouble slider_incs[] = { 30, 10, 10, 16, 16, 16, 10 }; static const gdouble slider_max_vals[] =
{ 360, 100, 100, 255, 255, 255, 100 };
static const gdouble slider_incs[] =
{ 30, 10, 10, 16, 16, 16, 10 };
/* don't needs the toggles for our own operation */ /* don't needs the toggles for our own operation */
selector->toggles_visible = FALSE; selector->toggles_visible = FALSE;

View File

@ -197,7 +197,7 @@ G_DEFINE_TYPE (GimpColorSelect, gimp_color_select, GIMP_TYPE_COLOR_SELECTOR);
#define parent_class gimp_color_select_parent_class #define parent_class gimp_color_select_parent_class
static ColorSelectFillUpdateProc update_procs[] = static const ColorSelectFillUpdateProc update_procs[] =
{ {
color_select_update_hue, color_select_update_hue,
color_select_update_saturation, color_select_update_saturation,

View File

@ -157,7 +157,7 @@ gimp_pick_button_new (void)
#define DROPPER_X_HOT 2 #define DROPPER_X_HOT 2
#define DROPPER_Y_HOT 16 #define DROPPER_Y_HOT 16
static guchar dropper_bits[] = static const guchar dropper_bits[] =
{ {
0xff, 0x8f, 0x01, 0xff, 0x77, 0x01, 0xff, 0xfb, 0x00, 0xff, 0xf8, 0x00, 0xff, 0x8f, 0x01, 0xff, 0x77, 0x01, 0xff, 0xfb, 0x00, 0xff, 0xf8, 0x00,
0x7f, 0xff, 0x00, 0xff, 0x7e, 0x01, 0xff, 0x9d, 0x01, 0xff, 0xd8, 0x01, 0x7f, 0xff, 0x00, 0xff, 0x7e, 0x01, 0xff, 0x9d, 0x01, 0xff, 0xd8, 0x01,
@ -166,7 +166,7 @@ static guchar dropper_bits[] =
0xff, 0xff, 0x01 0xff, 0xff, 0x01
}; };
static guchar dropper_mask[] = static const guchar dropper_mask[] =
{ {
0x00, 0x70, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xff, 0x01, 0x00, 0x70, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xff, 0x01,
0x80, 0xff, 0x01, 0x00, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0x3f, 0x00, 0x80, 0xff, 0x01, 0x00, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0x3f, 0x00,
@ -178,9 +178,9 @@ static guchar dropper_mask[] =
static GdkCursor * static GdkCursor *
make_cursor (void) make_cursor (void)
{ {
GdkCursor *cursor; GdkCursor *cursor;
GdkColor bg = { 0, 0xffff, 0xffff, 0xffff }; const GdkColor bg = { 0, 0xffff, 0xffff, 0xffff };
GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 }; const GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 };
GdkPixmap *pixmap = GdkPixmap *pixmap =
gdk_bitmap_create_from_data (NULL, gdk_bitmap_create_from_data (NULL,

View File

@ -108,7 +108,7 @@ add_sized_with_same_fallback (GtkIconFactory *factory,
} }
static GtkStockItem gimp_stock_items[] = static const GtkStockItem gimp_stock_items[] =
{ {
{ GIMP_STOCK_ANCHOR, N_("Anchor"), 0, 0, LIBGIMP_DOMAIN }, { GIMP_STOCK_ANCHOR, N_("Anchor"), 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_CENTER, N_("C_enter"), 0, 0, LIBGIMP_DOMAIN }, { GIMP_STOCK_CENTER, N_("C_enter"), 0, 0, LIBGIMP_DOMAIN },
@ -445,7 +445,7 @@ gimp_stock_button_pixbufs[] =
{ GIMP_STOCK_VIDEO, stock_video_24 } { GIMP_STOCK_VIDEO, stock_video_24 }
}; };
static struct static const struct
{ {
const gchar *stock_id; const gchar *stock_id;
gconstpointer inline_data; gconstpointer inline_data;
@ -600,7 +600,7 @@ gimp_stock_menu_pixbufs[] =
{ GIMP_STOCK_JOIN_BEVEL, stock_join_bevel_16 } { GIMP_STOCK_JOIN_BEVEL, stock_join_bevel_16 }
}; };
static struct static const struct
{ {
const gchar *stock_id; const gchar *stock_id;
gconstpointer inline_data; gconstpointer inline_data;
@ -621,7 +621,7 @@ gimp_stock_dnd_pixbufs[] =
{ GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_32 } { GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_32 }
}; };
static struct static const struct
{ {
const gchar *stock_id; const gchar *stock_id;
gconstpointer inline_data; gconstpointer inline_data;
@ -652,7 +652,7 @@ gimp_stock_dialog_pixbufs[] =
{ GIMP_STOCK_TEXTURE, stock_texture_64 } { GIMP_STOCK_TEXTURE, stock_texture_64 }
}; };
static struct static const struct
{ {
const gchar *stock_id; const gchar *stock_id;
gconstpointer inline_data_ltr; gconstpointer inline_data_ltr;