Commit a362eecc authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

gtk/gtkbutton.h gtk/gtkcellrenderer.h gtk/gtkimcontext.h gtk/gtkstyle.h

2008-01-25  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkbutton.h
	* gtk/gtkcellrenderer.h
	* gtk/gtkimcontext.h
	* gtk/gtkstyle.h
	* gtk/gtktoolbar.h
	* gtk/gtktooltip.h
	* gtk/gtktreeprivate.h
	* gtk/gtktreeviewcolumn.h
	* gtk/gtkwidget.h: add const to constant structs which are passed
	into GTK+. Also add some forgotten const for const strings.

	* gtk/gtkbutton.c
	* gtk/gtkcellrenderer.c
	* gtk/gtkimcontext.c
	* gtk/gtkstyle.c
	* gtk/gtktoolbar.c
	* gtk/gtktooltip.c
	* gtk/gtktreeview.c
	* gtk/gtktreeviewcolumn.c
	* gtk/gtkwidget.c: changed accordingly.


svn path=/trunk/; revision=19399
parent 594b7102
2008-01-25 Michael Natterer <mitch@imendio.com>
* gtk/gtkbutton.h
* gtk/gtkcellrenderer.h
* gtk/gtkimcontext.h
* gtk/gtkstyle.h
* gtk/gtktoolbar.h
* gtk/gtktooltip.h
* gtk/gtktreeprivate.h
* gtk/gtktreeviewcolumn.h
* gtk/gtkwidget.h: add const to constant structs which are passed
into GTK+. Also add some forgotten const for const strings.
* gtk/gtkbutton.c
* gtk/gtkcellrenderer.c
* gtk/gtkimcontext.c
* gtk/gtkstyle.c
* gtk/gtktoolbar.c
* gtk/gtktooltip.c
* gtk/gtktreeview.c
* gtk/gtktreeviewcolumn.c
* gtk/gtkwidget.c: changed accordingly.
2008-01-25 Sven Herzberg <sven@imendio.com>
Reviewed by Johan Dahlin.
......
......@@ -1217,12 +1217,12 @@ gtk_button_size_allocate (GtkWidget *widget,
}
void
_gtk_button_paint (GtkButton *button,
GdkRectangle *area,
GtkStateType state_type,
GtkShadowType shadow_type,
const gchar *main_detail,
const gchar *default_detail)
_gtk_button_paint (GtkButton *button,
const GdkRectangle *area,
GtkStateType state_type,
GtkShadowType shadow_type,
const gchar *main_detail,
const gchar *default_detail)
{
GtkWidget *widget;
gint width, height;
......
......@@ -125,14 +125,14 @@ void gtk_button_set_image_position (GtkButton *button,
GtkPositionType position);
GtkPositionType gtk_button_get_image_position (GtkButton *button);
void _gtk_button_set_depressed (GtkButton *button,
gboolean depressed);
void _gtk_button_paint (GtkButton *button,
GdkRectangle *area,
GtkStateType state_type,
GtkShadowType shadow_type,
const gchar *main_detail,
const gchar *default_detail);
void _gtk_button_set_depressed (GtkButton *button,
gboolean depressed);
void _gtk_button_paint (GtkButton *button,
const GdkRectangle *area,
GtkStateType state_type,
GtkShadowType shadow_type,
const gchar *main_detail,
const gchar *default_detail);
G_END_DECLS
......
......@@ -479,13 +479,13 @@ set_cell_bg_color (GtkCellRenderer *cell,
* in @x_offset and @y_offset are inclusive of the xpad and ypad properties.
**/
void
gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height)
gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height)
{
gint *real_width = width;
gint *real_height = height;
......@@ -506,7 +506,7 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GTK_CELL_RENDERER_GET_CLASS (cell)->get_size (cell,
widget,
cell_area,
(GdkRectangle *) cell_area,
x_offset,
y_offset,
real_width,
......@@ -533,13 +533,13 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
* @window. @expose_area is a clip rectangle.
**/
void
gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
GtkCellRendererState flags)
gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
const GdkRectangle *expose_area,
GtkCellRendererState flags)
{
gboolean selected = FALSE;
GtkCellRendererPrivate *priv = GTK_CELL_RENDERER_GET_PRIVATE (cell);
......@@ -563,9 +563,9 @@ gtk_cell_renderer_render (GtkCellRenderer *cell,
GTK_CELL_RENDERER_GET_CLASS (cell)->render (cell,
window,
widget,
background_area,
cell_area,
expose_area,
(GdkRectangle *) background_area,
(GdkRectangle *) cell_area,
(GdkRectangle *) expose_area,
flags);
}
......@@ -591,8 +591,8 @@ gtk_cell_renderer_activate (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
GtkCellRendererState flags)
{
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE);
......@@ -607,8 +607,8 @@ gtk_cell_renderer_activate (GtkCellRenderer *cell,
event,
widget,
path,
background_area,
cell_area,
(GdkRectangle *) background_area,
(GdkRectangle *) cell_area,
flags);
}
......@@ -632,8 +632,8 @@ gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
GtkCellRendererState flags)
{
......@@ -651,8 +651,8 @@ gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
event,
widget,
path,
background_area,
cell_area,
(GdkRectangle *) background_area,
(GdkRectangle *) cell_area,
flags);
g_signal_emit (cell,
......
......@@ -124,7 +124,7 @@ GType gtk_cell_renderer_get_type (void) G_GNUC_CONST;
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
const GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
......@@ -132,23 +132,23 @@ void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
void gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
const GdkRectangle *expose_area,
GtkCellRendererState flags);
gboolean gtk_cell_renderer_activate (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
GtkCellRendererState flags);
GtkCellEditable *gtk_cell_renderer_start_editing (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
const gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
const GdkRectangle *background_area,
const GdkRectangle *cell_area,
GtkCellRendererState flags);
void gtk_cell_renderer_set_fixed_size (GtkCellRenderer *cell,
gint width,
......
......@@ -361,8 +361,8 @@ gtk_im_context_reset (GtkIMContext *context)
* window.
**/
void
gtk_im_context_set_cursor_location (GtkIMContext *context,
GdkRectangle *area)
gtk_im_context_set_cursor_location (GtkIMContext *context,
const GdkRectangle *area)
{
GtkIMContextClass *klass;
......@@ -370,7 +370,7 @@ gtk_im_context_set_cursor_location (GtkIMContext *context,
klass = GTK_IM_CONTEXT_GET_CLASS (context);
if (klass->set_cursor_location)
klass->set_cursor_location (context, area);
klass->set_cursor_location (context, (GdkRectangle *) area);
}
/**
......
......@@ -94,31 +94,31 @@ struct _GtkIMContextClass
GType gtk_im_context_get_type (void) G_GNUC_CONST;
void gtk_im_context_set_client_window (GtkIMContext *context,
GdkWindow *window);
void gtk_im_context_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs,
gint *cursor_pos);
gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
GdkEventKey *event);
void gtk_im_context_focus_in (GtkIMContext *context);
void gtk_im_context_focus_out (GtkIMContext *context);
void gtk_im_context_reset (GtkIMContext *context);
void gtk_im_context_set_cursor_location (GtkIMContext *context,
GdkRectangle *area);
void gtk_im_context_set_use_preedit (GtkIMContext *context,
gboolean use_preedit);
void gtk_im_context_set_surrounding (GtkIMContext *context,
const gchar *text,
gint len,
gint cursor_index);
gboolean gtk_im_context_get_surrounding (GtkIMContext *context,
gchar **text,
gint *cursor_index);
gboolean gtk_im_context_delete_surrounding (GtkIMContext *context,
gint offset,
gint n_chars);
void gtk_im_context_set_client_window (GtkIMContext *context,
GdkWindow *window);
void gtk_im_context_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs,
gint *cursor_pos);
gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
GdkEventKey *event);
void gtk_im_context_focus_in (GtkIMContext *context);
void gtk_im_context_focus_out (GtkIMContext *context);
void gtk_im_context_reset (GtkIMContext *context);
void gtk_im_context_set_cursor_location (GtkIMContext *context,
const GdkRectangle *area);
void gtk_im_context_set_use_preedit (GtkIMContext *context,
gboolean use_preedit);
void gtk_im_context_set_surrounding (GtkIMContext *context,
const gchar *text,
gint len,
gint cursor_index);
gboolean gtk_im_context_get_surrounding (GtkIMContext *context,
gchar **text,
gint *cursor_index);
gboolean gtk_im_context_delete_surrounding (GtkIMContext *context,
gint offset,
gint n_chars);
G_END_DECLS
......
......@@ -1993,15 +1993,15 @@ gtk_style_render_icon (GtkStyle *style,
/* Default functions */
void
gtk_style_apply_default_background (GtkStyle *style,
GdkWindow *window,
gboolean set_bg,
GtkStateType state_type,
GdkRectangle *area,
gint x,
gint y,
gint width,
gint height)
gtk_style_apply_default_background (GtkStyle *style,
GdkWindow *window,
gboolean set_bg,
GtkStateType state_type,
const GdkRectangle *area,
gint x,
gint y,
gint width,
gint height)
{
GdkRectangle new_rect, old_rect;
......@@ -2056,10 +2056,10 @@ gtk_style_apply_default_background (GtkStyle *style,
}
}
static GdkPixbuf*
static GdkPixbuf *
scale_or_ref (GdkPixbuf *src,
gint width,
gint height)
gint width,
gint height)
{
if (width == gdk_pixbuf_get_width (src) &&
height == gdk_pixbuf_get_height (src))
......@@ -3383,10 +3383,10 @@ gtk_default_draw_box (GtkStyle *style,
}
}
static GdkGC*
get_darkened_gc (GdkWindow *window,
GdkColor *color,
gint darken_count)
static GdkGC *
get_darkened_gc (GdkWindow *window,
const GdkColor *color,
gint darken_count)
{
GdkColor src = *color;
GdkColor shaded = *color;
......@@ -5404,9 +5404,9 @@ gtk_default_draw_resize_grip (GtkStyle *style,
}
void
_gtk_style_shade (GdkColor *a,
GdkColor *b,
gdouble k)
_gtk_style_shade (const GdkColor *a,
GdkColor *b,
gdouble k)
{
gdouble red;
gdouble green;
......@@ -5605,21 +5605,23 @@ hls_to_rgb (gdouble *h,
* using the given style and state.
**/
void
gtk_paint_hline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x1,
gint x2,
gint y)
gtk_paint_hline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x1,
gint x2,
gint y)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type, area, widget, detail, x1, x2, y);
GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type,
(GdkRectangle *) area, widget, detail,
x1, x2, y);
}
/**
......@@ -5639,21 +5641,23 @@ gtk_paint_hline (GtkStyle *style,
* using the given style and state.
*/
void
gtk_paint_vline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint y1_,
gint y2_,
gint x)
gtk_paint_vline (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint y1_,
gint y2_,
gint x)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type, area, widget, detail, y1_, y2_, x);
GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type,
(GdkRectangle *) area, widget, detail,
y1_, y2_, x);
}
/**
......@@ -5675,23 +5679,25 @@ gtk_paint_vline (GtkStyle *style,
* using the given style and state and shadow type.
*/
void
gtk_paint_shadow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
gtk_paint_shadow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type,
(GdkRectangle *) area, widget, detail,
x, y, width, height);
}
/**
......@@ -5711,22 +5717,24 @@ gtk_paint_shadow (GtkStyle *style,
* Draws a polygon on @window with the given parameters.
*/
void
gtk_paint_polygon (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
GdkPoint *points,
gint npoints,
gboolean fill)
gtk_paint_polygon (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
const GdkPoint *points,
gint n_points,
gboolean fill)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_polygon != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type, area, widget, detail, points, npoints, fill);
GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type,
(GdkRectangle *) area, widget, detail,
(GdkPoint *) points, n_points, fill);
}
/**
......@@ -5750,25 +5758,27 @@ gtk_paint_polygon (GtkStyle *style,
* parameters. @arrow_type determines the direction of the arrow.
*/
void
gtk_paint_arrow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
GtkArrowType arrow_type,
gboolean fill,
gint x,
gint y,
gint width,
gint height)
gtk_paint_arrow (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
GtkArrowType arrow_type,
gboolean fill,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type, area, widget, detail, arrow_type, fill, x, y, width, height);
GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type,
(GdkRectangle *) area, widget, detail,
arrow_type, fill, x, y, width, height);
}
/**
......@@ -5790,23 +5800,25 @@ gtk_paint_arrow (GtkStyle *style,
* parameters.
*/
void
gtk_paint_diamond (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
gtk_paint_diamond (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type,
(GdkRectangle *) area, widget, detail,
x, y, width, height);
}
/**
......@@ -5827,21 +5839,23 @@ gtk_paint_diamond (GtkStyle *style,
* Deprecated: Use gtk_paint_layout() instead.
*/
void
gtk_paint_string (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
const gchar *string)
gtk_paint_string (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
const gchar *string)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, area, widget, detail, x, y, string);
GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type,
(GdkRectangle *) area, widget, detail,
x, y, string);
}
/**
......@@ -5862,23 +5876,25 @@ gtk_paint_string (GtkStyle *style,
* Draws a box on @window with the given parameters.
*/
void
gtk_paint_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
gtk_paint_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type,
(GdkRectangle *) area, widget, detail,
x, y, width, height);
}
/**
......@@ -5899,23 +5915,25 @@ gtk_paint_box (GtkStyle *style,
* Draws a flat box on @window with the given parameters.
*/
void
gtk_paint_flat_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
gtk_paint_flat_box (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);
GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type,
(GdkRectangle *) area, widget, detail,
x, y, width, height);
}
/**
......@@ -5937,23 +5955,25 @@ gtk_paint_flat_box (GtkStyle *style,
* the given parameters.
*/
void
gtk_paint_check (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
gtk_paint_check (GtkStyle *style,
GdkWindow *window,
GtkStateType state_type,
GtkShadowType shadow_type,
const GdkRectangle *area,
GtkWidget *widget,
const gchar *detail,
gint x,
gint y,
gint width,
gint height)
{
g_return_if_fail (GTK_IS_STYLE (style));
g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL);
g_return_if_fail (style->depth == gdk_drawable_get_depth (window));
GTK_STYLE_GET_CLASS (style)->draw_check (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height);