2 * Copyright (C) 1998-2000 Red Hat, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Written by Owen Taylor <otaylor@redhat.com>, based on code by
20 * Carsten Haitzler <raster@rasterman.com>
26 #undef GDK_DISABLE_DEPRECATED
29 #include "pixbuf-rc-style.h"
30 #include "pixbuf-style.h"
32 static void pixbuf_style_init (PixbufStyle *style);
33 static void pixbuf_style_class_init (PixbufStyleClass *klass);
35 static GtkStyleClass *parent_class = NULL;
38 match_theme_image (GtkStyle *style,
39 ThemeMatchData *match_data)
43 tmp_list = PIXBUF_RC_STYLE (style->rc_style)->img_list;
48 ThemeImage *image = tmp_list->data;
49 tmp_list = tmp_list->next;
51 if (match_data->function != image->match_data.function)
54 flags = match_data->flags & image->match_data.flags;
56 if (flags != image->match_data.flags) /* Required components not present */
59 if ((flags & THEME_MATCH_STATE) &&
60 match_data->state != image->match_data.state)
63 if ((flags & THEME_MATCH_SHADOW) &&
64 match_data->shadow != image->match_data.shadow)
67 if ((flags & THEME_MATCH_ARROW_DIRECTION) &&
68 match_data->arrow_direction != image->match_data.arrow_direction)
71 if ((flags & THEME_MATCH_ORIENTATION) &&
72 match_data->orientation != image->match_data.orientation)
75 if ((flags & THEME_MATCH_GAP_SIDE) &&
76 match_data->gap_side != image->match_data.gap_side)
79 if ((flags & THEME_MATCH_EXPANDER_STYLE) &&
80 match_data->expander_style != image->match_data.expander_style)
83 if ((flags & THEME_MATCH_WINDOW_EDGE) &&
84 match_data->window_edge != image->match_data.window_edge)
87 if (image->match_data.detail &&
88 (!match_data->detail ||
89 strcmp (match_data->detail, image->match_data.detail) != 0))
99 draw_simple_image(GtkStyle *style,
103 ThemeMatchData *match_data,
104 gboolean draw_center,
105 gboolean allow_setbg,
112 gboolean setbg = FALSE;
114 if ((width == -1) && (height == -1))
116 gdk_drawable_get_size(window, &width, &height);
120 else if (width == -1)
121 gdk_drawable_get_size(window, &width, NULL);
122 else if (height == -1)
123 gdk_drawable_get_size(window, NULL, &height);
125 if (!(match_data->flags & THEME_MATCH_ORIENTATION))
127 match_data->flags |= THEME_MATCH_ORIENTATION;
130 match_data->orientation = GTK_ORIENTATION_VERTICAL;
132 match_data->orientation = GTK_ORIENTATION_HORIZONTAL;
135 image = match_theme_image (style, match_data);
138 if (image->background)
140 theme_pixbuf_render (image->background,
142 draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER,
144 x, y, width, height);
147 if (image->overlay && draw_center)
148 theme_pixbuf_render (image->overlay,
149 window, NULL, area, COMPONENT_ALL,
151 x, y, width, height);
160 draw_gap_image(GtkStyle *style,
164 ThemeMatchData *match_data,
165 gboolean draw_center,
170 GtkPositionType gap_side,
175 gboolean setbg = FALSE;
177 if ((width == -1) && (height == -1))
179 gdk_drawable_get_size(window, &width, &height);
182 else if (width == -1)
183 gdk_drawable_get_size(window, &width, NULL);
184 else if (height == -1)
185 gdk_drawable_get_size(window, NULL, &height);
187 if (!(match_data->flags & THEME_MATCH_ORIENTATION))
189 match_data->flags |= THEME_MATCH_ORIENTATION;
192 match_data->orientation = GTK_ORIENTATION_VERTICAL;
194 match_data->orientation = GTK_ORIENTATION_HORIZONTAL;
197 match_data->flags |= THEME_MATCH_GAP_SIDE;
198 match_data->gap_side = gap_side;
200 image = match_theme_image (style, match_data);
204 GdkRectangle r1, r2, r3;
205 GdkPixbuf *pixbuf = NULL;
206 guint components = COMPONENT_ALL;
209 components |= COMPONENT_CENTER;
211 if (image->gap_start)
212 pixbuf = theme_pixbuf_get_pixbuf (image->gap_start);
218 thickness = gdk_pixbuf_get_height (pixbuf);
220 thickness = style->ythickness;
223 components |= COMPONENT_NORTH_WEST | COMPONENT_NORTH | COMPONENT_NORTH_EAST;
228 r1.height = thickness;
231 r2.width = gap_width;
232 r2.height = thickness;
233 r3.x = x + gap_x + gap_width;
235 r3.width = width - (gap_x + gap_width);
236 r3.height = thickness;
241 thickness = gdk_pixbuf_get_height (pixbuf);
243 thickness = style->ythickness;
246 components |= COMPONENT_SOUTH_WEST | COMPONENT_SOUTH | COMPONENT_SOUTH_EAST;
249 r1.y = y + height - thickness;
251 r1.height = thickness;
253 r2.y = y + height - thickness;
254 r2.width = gap_width;
255 r2.height = thickness;
256 r3.x = x + gap_x + gap_width;
257 r3.y = y + height - thickness;
258 r3.width = width - (gap_x + gap_width);
259 r3.height = thickness;
264 thickness = gdk_pixbuf_get_width (pixbuf);
266 thickness = style->xthickness;
269 components |= COMPONENT_NORTH_WEST | COMPONENT_WEST | COMPONENT_SOUTH_WEST;
273 r1.width = thickness;
277 r2.width = thickness;
278 r2.height = gap_width;
280 r3.y = y + gap_x + gap_width;
281 r3.width = thickness;
282 r3.height = height - (gap_x + gap_width);
287 thickness = gdk_pixbuf_get_width (pixbuf);
289 thickness = style->xthickness;
292 components |= COMPONENT_NORTH_EAST | COMPONENT_EAST | COMPONENT_SOUTH_EAST;
294 r1.x = x + width - thickness;
296 r1.width = thickness;
298 r2.x = x + width - thickness;
300 r2.width = thickness;
301 r2.height = gap_width;
302 r3.x = x + width - thickness;
303 r3.y = y + gap_x + gap_width;
304 r3.width = thickness;
305 r3.height = height - (gap_x + gap_width);
309 g_assert_not_reached ();
312 if (image->background)
313 theme_pixbuf_render (image->background,
314 window, NULL, area, components, FALSE,
315 x, y, width, height);
316 if (image->gap_start)
317 theme_pixbuf_render (image->gap_start,
318 window, NULL, area, COMPONENT_ALL, FALSE,
319 r1.x, r1.y, r1.width, r1.height);
321 theme_pixbuf_render (image->gap,
322 window, NULL, area, COMPONENT_ALL, FALSE,
323 r2.x, r2.y, r2.width, r2.height);
325 theme_pixbuf_render (image->gap_end,
326 window, NULL, area, COMPONENT_ALL, FALSE,
327 r3.x, r3.y, r3.width, r3.height);
336 draw_hline (GtkStyle *style,
347 ThemeMatchData match_data;
349 g_return_if_fail(style != NULL);
350 g_return_if_fail(window != NULL);
352 match_data.function = TOKEN_D_HLINE;
353 match_data.detail = (gchar *)detail;
354 match_data.flags = THEME_MATCH_ORIENTATION | THEME_MATCH_STATE;
355 match_data.state = state;
356 match_data.orientation = GTK_ORIENTATION_HORIZONTAL;
358 image = match_theme_image (style, &match_data);
361 if (image->background)
362 theme_pixbuf_render (image->background,
363 window, NULL, area, COMPONENT_ALL, FALSE,
364 x1, y, (x2 - x1) + 1, 2);
367 parent_class->draw_hline (style, window, state, area, widget, detail,
372 draw_vline (GtkStyle *style,
383 ThemeMatchData match_data;
385 g_return_if_fail (style != NULL);
386 g_return_if_fail (window != NULL);
388 match_data.function = TOKEN_D_VLINE;
389 match_data.detail = (gchar *)detail;
390 match_data.flags = THEME_MATCH_ORIENTATION | THEME_MATCH_STATE;
391 match_data.state = state;
392 match_data.orientation = GTK_ORIENTATION_VERTICAL;
394 image = match_theme_image (style, &match_data);
397 if (image->background)
398 theme_pixbuf_render (image->background,
399 window, NULL, area, COMPONENT_ALL, FALSE,
400 x, y1, 2, (y2 - y1) + 1);
403 parent_class->draw_vline (style, window, state, area, widget, detail,
408 draw_shadow(GtkStyle *style,
411 GtkShadowType shadow,
420 ThemeMatchData match_data;
422 g_return_if_fail(style != NULL);
423 g_return_if_fail(window != NULL);
425 match_data.function = TOKEN_D_SHADOW;
426 match_data.detail = (gchar *)detail;
427 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
428 match_data.shadow = shadow;
429 match_data.state = state;
431 if (!draw_simple_image (style, window, area, widget, &match_data, FALSE, FALSE,
432 x, y, width, height))
433 parent_class->draw_shadow (style, window, state, shadow, area, widget, detail,
434 x, y, width, height);
437 /* This function makes up for some brokeness in gtkrange.c
438 * where we never get the full arrow of the stepper button
439 * and the type of button in a single drawing function.
441 * It doesn't work correctly when the scrollbar is squished
442 * to the point we don't have room for full-sized steppers.
445 reverse_engineer_stepper_box (GtkWidget *range,
446 GtkArrowType arrow_type,
452 gint slider_width = 14, stepper_size = 14;
456 if (range && GTK_IS_RANGE (range))
458 gtk_widget_style_get (range,
459 "slider_width", &slider_width,
460 "stepper_size", &stepper_size,
464 if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN)
466 box_width = slider_width;
467 box_height = stepper_size;
471 box_width = stepper_size;
472 box_height = slider_width;
475 *x = *x - (box_width - *width) / 2;
476 *y = *y - (box_height - *height) / 2;
478 *height = box_height;
482 draw_arrow (GtkStyle *style,
485 GtkShadowType shadow,
489 GtkArrowType arrow_direction,
496 ThemeMatchData match_data;
498 g_return_if_fail(style != NULL);
499 g_return_if_fail(window != NULL);
502 (strcmp (detail, "hscrollbar") == 0 || strcmp (detail, "vscrollbar") == 0))
504 /* This is a hack to work around the fact that scrollbar steppers are drawn
505 * as a box + arrow, so we never have
507 * The full bounding box of the scrollbar
508 * The arrow direction
510 * At the same time. We simulate an extra paint function, "STEPPER", by doing
511 * nothing for the box, and then here, reverse engineering the box that
512 * was passed to draw box and using that
516 gint box_width = width;
517 gint box_height = height;
519 reverse_engineer_stepper_box (widget, arrow_direction,
520 &box_x, &box_y, &box_width, &box_height);
522 match_data.function = TOKEN_D_STEPPER;
523 match_data.detail = (gchar *)detail;
524 match_data.flags = (THEME_MATCH_SHADOW |
526 THEME_MATCH_ARROW_DIRECTION);
527 match_data.shadow = shadow;
528 match_data.state = state;
529 match_data.arrow_direction = arrow_direction;
531 if (draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
532 box_x, box_y, box_width, box_height))
534 /* The theme included stepper images, we're done */
538 /* Otherwise, draw the full box, and fall through to draw the arrow
540 match_data.function = TOKEN_D_BOX;
541 match_data.detail = (gchar *)detail;
542 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
543 match_data.shadow = shadow;
544 match_data.state = state;
546 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
547 box_x, box_y, box_width, box_height))
548 parent_class->draw_box (style, window, state, shadow, area, widget, detail,
549 box_x, box_y, box_width, box_height);
553 match_data.function = TOKEN_D_ARROW;
554 match_data.detail = (gchar *)detail;
555 match_data.flags = (THEME_MATCH_SHADOW |
557 THEME_MATCH_ARROW_DIRECTION);
558 match_data.shadow = shadow;
559 match_data.state = state;
560 match_data.arrow_direction = arrow_direction;
562 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
563 x, y, width, height))
564 parent_class->draw_arrow (style, window, state, shadow, area, widget, detail,
565 arrow_direction, fill, x, y, width, height);
569 draw_diamond (GtkStyle *style,
572 GtkShadowType shadow,
581 ThemeMatchData match_data;
583 g_return_if_fail(style != NULL);
584 g_return_if_fail(window != NULL);
586 match_data.function = TOKEN_D_DIAMOND;
587 match_data.detail = (gchar *)detail;
588 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
589 match_data.shadow = shadow;
590 match_data.state = state;
592 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
593 x, y, width, height))
594 parent_class->draw_diamond (style, window, state, shadow, area, widget, detail,
595 x, y, width, height);
599 draw_string (GtkStyle * style,
607 const gchar * string)
609 g_return_if_fail(style != NULL);
610 g_return_if_fail(window != NULL);
612 if (state == GTK_STATE_INSENSITIVE)
616 gdk_gc_set_clip_rectangle(style->white_gc, area);
617 gdk_gc_set_clip_rectangle(style->fg_gc[state], area);
620 gdk_draw_string(window, gtk_style_get_font (style), style->fg_gc[state], x, y, string);
624 gdk_gc_set_clip_rectangle(style->white_gc, NULL);
625 gdk_gc_set_clip_rectangle(style->fg_gc[state], NULL);
630 gdk_gc_set_clip_rectangle(style->fg_gc[state], area);
631 gdk_draw_string(window, gtk_style_get_font (style), style->fg_gc[state], x, y, string);
632 gdk_gc_set_clip_rectangle(style->fg_gc[state], NULL);
637 draw_box (GtkStyle *style,
640 GtkShadowType shadow,
649 ThemeMatchData match_data;
651 g_return_if_fail(style != NULL);
652 g_return_if_fail(window != NULL);
655 (strcmp (detail, "hscrollbar") == 0 || strcmp (detail, "vscrollbar") == 0))
657 /* We handle this in draw_arrow */
661 match_data.function = TOKEN_D_BOX;
662 match_data.detail = (gchar *)detail;
663 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
664 match_data.shadow = shadow;
665 match_data.state = state;
667 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
668 x, y, width, height)) {
669 parent_class->draw_box (style, window, state, shadow, area, widget, detail,
670 x, y, width, height);
675 draw_flat_box (GtkStyle *style,
678 GtkShadowType shadow,
687 ThemeMatchData match_data;
689 g_return_if_fail(style != NULL);
690 g_return_if_fail(window != NULL);
692 match_data.function = TOKEN_D_FLAT_BOX;
693 match_data.detail = (gchar *)detail;
694 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
695 match_data.shadow = shadow;
696 match_data.state = state;
698 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
699 x, y, width, height))
700 parent_class->draw_flat_box (style, window, state, shadow, area, widget, detail,
701 x, y, width, height);
705 draw_check (GtkStyle *style,
708 GtkShadowType shadow,
717 ThemeMatchData match_data;
719 g_return_if_fail(style != NULL);
720 g_return_if_fail(window != NULL);
722 match_data.function = TOKEN_D_CHECK;
723 match_data.detail = (gchar *)detail;
724 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
725 match_data.shadow = shadow;
726 match_data.state = state;
728 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
729 x, y, width, height))
730 parent_class->draw_check (style, window, state, shadow, area, widget, detail,
731 x, y, width, height);
735 draw_option (GtkStyle *style,
738 GtkShadowType shadow,
747 ThemeMatchData match_data;
749 g_return_if_fail(style != NULL);
750 g_return_if_fail(window != NULL);
752 match_data.function = TOKEN_D_OPTION;
753 match_data.detail = (gchar *)detail;
754 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
755 match_data.shadow = shadow;
756 match_data.state = state;
758 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
759 x, y, width, height))
760 parent_class->draw_option (style, window, state, shadow, area, widget, detail,
761 x, y, width, height);
765 draw_tab (GtkStyle *style,
768 GtkShadowType shadow,
777 ThemeMatchData match_data;
779 g_return_if_fail(style != NULL);
780 g_return_if_fail(window != NULL);
782 match_data.function = TOKEN_D_TAB;
783 match_data.detail = (gchar *)detail;
784 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
785 match_data.shadow = shadow;
786 match_data.state = state;
788 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
789 x, y, width, height))
790 parent_class->draw_tab (style, window, state, shadow, area, widget, detail,
791 x, y, width, height);
795 draw_shadow_gap (GtkStyle *style,
798 GtkShadowType shadow,
806 GtkPositionType gap_side,
810 ThemeMatchData match_data;
812 match_data.function = TOKEN_D_SHADOW_GAP;
813 match_data.detail = (gchar *)detail;
814 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
815 match_data.flags = (THEME_MATCH_SHADOW |
817 THEME_MATCH_ORIENTATION);
818 match_data.shadow = shadow;
819 match_data.state = state;
821 if (!draw_gap_image (style, window, area, widget, &match_data, FALSE,
822 x, y, width, height, gap_side, gap_x, gap_width))
823 parent_class->draw_shadow_gap (style, window, state, shadow, area, widget, detail,
824 x, y, width, height, gap_side, gap_x, gap_width);
828 draw_box_gap (GtkStyle *style,
831 GtkShadowType shadow,
839 GtkPositionType gap_side,
843 ThemeMatchData match_data;
845 match_data.function = TOKEN_D_BOX_GAP;
846 match_data.detail = (gchar *)detail;
847 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
848 match_data.flags = (THEME_MATCH_SHADOW |
850 THEME_MATCH_ORIENTATION);
851 match_data.shadow = shadow;
852 match_data.state = state;
854 if (!draw_gap_image (style, window, area, widget, &match_data, TRUE,
855 x, y, width, height, gap_side, gap_x, gap_width))
856 parent_class->draw_box_gap (style, window, state, shadow, area, widget, detail,
857 x, y, width, height, gap_side, gap_x, gap_width);
861 draw_extension (GtkStyle *style,
864 GtkShadowType shadow,
872 GtkPositionType gap_side)
874 ThemeMatchData match_data;
876 g_return_if_fail (style != NULL);
877 g_return_if_fail (window != NULL);
879 match_data.function = TOKEN_D_EXTENSION;
880 match_data.detail = (gchar *)detail;
881 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_GAP_SIDE;
882 match_data.shadow = shadow;
883 match_data.state = state;
884 match_data.gap_side = gap_side;
886 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
887 x, y, width, height))
888 parent_class->draw_extension (style, window, state, shadow, area, widget, detail,
889 x, y, width, height, gap_side);
893 draw_focus (GtkStyle *style,
895 GtkStateType state_type,
904 ThemeMatchData match_data;
906 g_return_if_fail (style != NULL);
907 g_return_if_fail (window != NULL);
909 match_data.function = TOKEN_D_FOCUS;
910 match_data.detail = (gchar *)detail;
911 match_data.flags = 0;
913 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, FALSE,
914 x, y, width, height))
915 parent_class->draw_focus (style, window, state_type, area, widget, detail,
916 x, y, width, height);
920 draw_slider (GtkStyle *style,
923 GtkShadowType shadow,
931 GtkOrientation orientation)
933 ThemeMatchData match_data;
935 g_return_if_fail(style != NULL);
936 g_return_if_fail(window != NULL);
938 match_data.function = TOKEN_D_SLIDER;
939 match_data.detail = (gchar *)detail;
940 match_data.flags = (THEME_MATCH_SHADOW |
942 THEME_MATCH_ORIENTATION);
943 match_data.shadow = shadow;
944 match_data.state = state;
945 match_data.orientation = orientation;
947 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
948 x, y, width, height))
949 parent_class->draw_slider (style, window, state, shadow, area, widget, detail,
950 x, y, width, height, orientation);
955 draw_handle (GtkStyle *style,
958 GtkShadowType shadow,
966 GtkOrientation orientation)
968 ThemeMatchData match_data;
970 g_return_if_fail (style != NULL);
971 g_return_if_fail (window != NULL);
973 match_data.function = TOKEN_D_HANDLE;
974 match_data.detail = (gchar *)detail;
975 match_data.flags = (THEME_MATCH_SHADOW |
977 THEME_MATCH_ORIENTATION);
978 match_data.shadow = shadow;
979 match_data.state = state;
980 match_data.orientation = orientation;
982 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
983 x, y, width, height))
984 parent_class->draw_handle (style, window, state, shadow, area, widget, detail,
985 x, y, width, height, orientation);
989 draw_expander (GtkStyle *style,
997 GtkExpanderStyle expander_style)
999 #define DEFAULT_EXPANDER_SIZE 12
1001 ThemeMatchData match_data;
1005 g_return_if_fail (style != NULL);
1006 g_return_if_fail (window != NULL);
1009 gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget),
1012 gtk_widget_style_get (widget,
1013 "expander-size", &expander_size,
1017 expander_size = DEFAULT_EXPANDER_SIZE;
1019 radius = expander_size/2;
1021 match_data.function = TOKEN_D_EXPANDER;
1022 match_data.detail = (gchar *)detail;
1023 match_data.flags = (THEME_MATCH_STATE |
1024 THEME_MATCH_EXPANDER_STYLE);
1025 match_data.state = state;
1026 match_data.expander_style = expander_style;
1028 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
1029 x - radius, y - radius, expander_size, expander_size))
1030 parent_class->draw_expander (style, window, state, area, widget, detail,
1031 x, y, expander_style);
1035 draw_resize_grip (GtkStyle *style,
1040 const gchar *detail,
1047 ThemeMatchData match_data;
1049 g_return_if_fail (style != NULL);
1050 g_return_if_fail (window != NULL);
1052 match_data.function = TOKEN_D_RESIZE_GRIP;
1053 match_data.detail = (gchar *)detail;
1054 match_data.flags = (THEME_MATCH_STATE |
1055 THEME_MATCH_WINDOW_EDGE);
1056 match_data.state = state;
1057 match_data.window_edge = edge;
1059 if (!draw_simple_image (style, window, area, widget, &match_data, TRUE, TRUE,
1060 x, y, width, height))
1061 parent_class->draw_resize_grip (style, window, state, area, widget, detail,
1062 edge, x, y, width, height);
1065 GType pixbuf_type_style = 0;
1068 pixbuf_style_register_type (GTypeModule *module)
1070 static const GTypeInfo object_info =
1072 sizeof (PixbufStyleClass),
1073 (GBaseInitFunc) NULL,
1074 (GBaseFinalizeFunc) NULL,
1075 (GClassInitFunc) pixbuf_style_class_init,
1076 NULL, /* class_finalize */
1077 NULL, /* class_data */
1078 sizeof (PixbufStyle),
1079 0, /* n_preallocs */
1080 (GInstanceInitFunc) pixbuf_style_init,
1083 pixbuf_type_style = g_type_module_register_type (module,
1090 pixbuf_style_init (PixbufStyle *style)
1095 pixbuf_style_class_init (PixbufStyleClass *klass)
1097 GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
1099 parent_class = g_type_class_peek_parent (klass);
1101 style_class->draw_hline = draw_hline;
1102 style_class->draw_vline = draw_vline;
1103 style_class->draw_shadow = draw_shadow;
1104 style_class->draw_arrow = draw_arrow;
1105 style_class->draw_diamond = draw_diamond;
1106 style_class->draw_string = draw_string;
1107 style_class->draw_box = draw_box;
1108 style_class->draw_flat_box = draw_flat_box;
1109 style_class->draw_check = draw_check;
1110 style_class->draw_option = draw_option;
1111 style_class->draw_tab = draw_tab;
1112 style_class->draw_shadow_gap = draw_shadow_gap;
1113 style_class->draw_box_gap = draw_box_gap;
1114 style_class->draw_extension = draw_extension;
1115 style_class->draw_focus = draw_focus;
1116 style_class->draw_slider = draw_slider;
1117 style_class->draw_handle = draw_handle;
1118 style_class->draw_expander = draw_expander;
1119 style_class->draw_resize_grip = draw_resize_grip;