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>
27 #include "pixbuf-rc-style.h"
28 #include "pixbuf-style.h"
30 static void pixbuf_style_init (PixbufStyle *style);
31 static void pixbuf_style_class_init (PixbufStyleClass *klass);
33 static GtkStyleClass *parent_class = NULL;
36 match_theme_image (GtkStyle *style,
37 ThemeMatchData *match_data)
41 tmp_list = PIXBUF_RC_STYLE (style->rc_style)->img_list;
46 ThemeImage *image = tmp_list->data;
47 tmp_list = tmp_list->next;
49 if (match_data->function != image->match_data.function)
52 flags = match_data->flags & image->match_data.flags;
54 if (flags != image->match_data.flags) /* Required components not present */
57 if ((flags & THEME_MATCH_STATE) &&
58 match_data->state != image->match_data.state)
61 if ((flags & THEME_MATCH_SHADOW) &&
62 match_data->shadow != image->match_data.shadow)
65 if ((flags & THEME_MATCH_ARROW_DIRECTION) &&
66 match_data->arrow_direction != image->match_data.arrow_direction)
69 if ((flags & THEME_MATCH_ORIENTATION) &&
70 match_data->orientation != image->match_data.orientation)
73 if ((flags & THEME_MATCH_GAP_SIDE) &&
74 match_data->gap_side != image->match_data.gap_side)
77 if ((flags & THEME_MATCH_EXPANDER_STYLE) &&
78 match_data->expander_style != image->match_data.expander_style)
81 if ((flags & THEME_MATCH_WINDOW_EDGE) &&
82 match_data->window_edge != image->match_data.window_edge)
85 if (image->match_data.detail &&
86 (!match_data->detail ||
87 strcmp (match_data->detail, image->match_data.detail) != 0))
97 draw_simple_image(GtkStyle *style,
100 ThemeMatchData *match_data,
101 gboolean draw_center,
102 gboolean allow_setbg,
111 if (!(match_data->flags & THEME_MATCH_ORIENTATION))
113 match_data->flags |= THEME_MATCH_ORIENTATION;
116 match_data->orientation = GTK_ORIENTATION_VERTICAL;
118 match_data->orientation = GTK_ORIENTATION_HORIZONTAL;
121 image = match_theme_image (style, match_data);
124 if (image->background)
126 theme_pixbuf_render (image->background, cr,
127 draw_center ? COMPONENT_ALL : COMPONENT_ALL | COMPONENT_CENTER,
129 x, y, width, height);
132 if (image->overlay && draw_center)
133 theme_pixbuf_render (image->overlay, cr, COMPONENT_ALL,
135 x, y, width, height);
144 draw_simple_image_no_cairo(GtkStyle *style,
148 ThemeMatchData *match_data,
149 gboolean draw_center,
150 gboolean allow_setbg,
159 if ((width == -1) && (height == -1))
160 gdk_drawable_get_size(window, &width, &height);
161 else if (width == -1)
162 gdk_drawable_get_size(window, &width, NULL);
163 else if (height == -1)
164 gdk_drawable_get_size(window, NULL, &height);
166 cr = gdk_cairo_create (window);
169 gdk_cairo_rectangle (cr, area);
173 result = draw_simple_image (style, cr, widget, match_data,
174 draw_center, allow_setbg,
175 x, y, width, height);
183 draw_gap_image(GtkStyle *style,
186 ThemeMatchData *match_data,
187 gboolean draw_center,
192 GtkPositionType gap_side,
198 if (!(match_data->flags & THEME_MATCH_ORIENTATION))
200 match_data->flags |= THEME_MATCH_ORIENTATION;
203 match_data->orientation = GTK_ORIENTATION_VERTICAL;
205 match_data->orientation = GTK_ORIENTATION_HORIZONTAL;
208 match_data->flags |= THEME_MATCH_GAP_SIDE;
209 match_data->gap_side = gap_side;
211 image = match_theme_image (style, match_data);
215 GdkRectangle r1, r2, r3;
216 GdkPixbuf *pixbuf = NULL;
217 guint components = COMPONENT_ALL;
220 components |= COMPONENT_CENTER;
222 if (image->gap_start)
223 pixbuf = theme_pixbuf_get_pixbuf (image->gap_start);
229 thickness = gdk_pixbuf_get_height (pixbuf);
231 thickness = style->ythickness;
234 components |= COMPONENT_NORTH_WEST | COMPONENT_NORTH | COMPONENT_NORTH_EAST;
239 r1.height = thickness;
242 r2.width = gap_width;
243 r2.height = thickness;
244 r3.x = x + gap_x + gap_width;
246 r3.width = width - (gap_x + gap_width);
247 r3.height = thickness;
252 thickness = gdk_pixbuf_get_height (pixbuf);
254 thickness = style->ythickness;
257 components |= COMPONENT_SOUTH_WEST | COMPONENT_SOUTH | COMPONENT_SOUTH_EAST;
260 r1.y = y + height - thickness;
262 r1.height = thickness;
264 r2.y = y + height - thickness;
265 r2.width = gap_width;
266 r2.height = thickness;
267 r3.x = x + gap_x + gap_width;
268 r3.y = y + height - thickness;
269 r3.width = width - (gap_x + gap_width);
270 r3.height = thickness;
275 thickness = gdk_pixbuf_get_width (pixbuf);
277 thickness = style->xthickness;
280 components |= COMPONENT_NORTH_WEST | COMPONENT_WEST | COMPONENT_SOUTH_WEST;
284 r1.width = thickness;
288 r2.width = thickness;
289 r2.height = gap_width;
291 r3.y = y + gap_x + gap_width;
292 r3.width = thickness;
293 r3.height = height - (gap_x + gap_width);
298 thickness = gdk_pixbuf_get_width (pixbuf);
300 thickness = style->xthickness;
303 components |= COMPONENT_NORTH_EAST | COMPONENT_EAST | COMPONENT_SOUTH_EAST;
305 r1.x = x + width - thickness;
307 r1.width = thickness;
309 r2.x = x + width - thickness;
311 r2.width = thickness;
312 r2.height = gap_width;
313 r3.x = x + width - thickness;
314 r3.y = y + gap_x + gap_width;
315 r3.width = thickness;
316 r3.height = height - (gap_x + gap_width);
320 g_assert_not_reached ();
323 if (image->background)
324 theme_pixbuf_render (image->background,
325 cr, components, FALSE,
326 x, y, width, height);
327 if (image->gap_start)
328 theme_pixbuf_render (image->gap_start,
329 cr, COMPONENT_ALL, FALSE,
330 r1.x, r1.y, r1.width, r1.height);
332 theme_pixbuf_render (image->gap,
333 cr, COMPONENT_ALL, FALSE,
334 r2.x, r2.y, r2.width, r2.height);
336 theme_pixbuf_render (image->gap_end,
337 cr, COMPONENT_ALL, FALSE,
338 r3.x, r3.y, r3.width, r3.height);
347 draw_gap_image_no_cairo(GtkStyle *style,
351 ThemeMatchData *match_data,
352 gboolean draw_center,
357 GtkPositionType gap_side,
364 if ((width == -1) && (height == -1))
365 gdk_drawable_get_size(window, &width, &height);
366 else if (width == -1)
367 gdk_drawable_get_size(window, &width, NULL);
368 else if (height == -1)
369 gdk_drawable_get_size(window, NULL, &height);
371 cr = gdk_cairo_create (window);
374 gdk_cairo_rectangle (cr, area);
378 result = draw_gap_image (style, cr, widget, match_data,
379 draw_center, x, y, width, height,
380 gap_side, gap_x, gap_width);
388 draw_hline (GtkStyle *style,
398 ThemeMatchData match_data;
400 match_data.function = TOKEN_D_HLINE;
401 match_data.detail = (gchar *)detail;
402 match_data.flags = THEME_MATCH_ORIENTATION | THEME_MATCH_STATE;
403 match_data.state = state;
404 match_data.orientation = GTK_ORIENTATION_HORIZONTAL;
406 image = match_theme_image (style, &match_data);
409 if (image->background)
410 theme_pixbuf_render (image->background,
411 cr, COMPONENT_ALL, FALSE,
412 x1, y, (x2 - x1) + 1, 2);
415 parent_class->draw_hline (style, cr, state, widget, detail,
420 draw_vline (GtkStyle *style,
431 ThemeMatchData match_data;
433 g_return_if_fail (style != NULL);
434 g_return_if_fail (window != NULL);
436 match_data.function = TOKEN_D_VLINE;
437 match_data.detail = (gchar *)detail;
438 match_data.flags = THEME_MATCH_ORIENTATION | THEME_MATCH_STATE;
439 match_data.state = state;
440 match_data.orientation = GTK_ORIENTATION_VERTICAL;
442 image = match_theme_image (style, &match_data);
445 if (image->background)
446 theme_pixbuf_render_no_cairo (image->background,
447 window, area, COMPONENT_ALL, FALSE,
448 x, y1, 2, (y2 - y1) + 1);
451 parent_class->draw_vline (style, window, state, area, widget, detail,
456 draw_shadow(GtkStyle *style,
459 GtkShadowType shadow,
468 ThemeMatchData match_data;
470 g_return_if_fail(style != NULL);
471 g_return_if_fail(window != NULL);
473 match_data.function = TOKEN_D_SHADOW;
474 match_data.detail = (gchar *)detail;
475 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
476 match_data.shadow = shadow;
477 match_data.state = state;
479 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, FALSE, FALSE,
480 x, y, width, height))
481 parent_class->draw_shadow (style, window, state, shadow, area, widget, detail,
482 x, y, width, height);
485 /* This function makes up for some brokeness in gtkrange.c
486 * where we never get the full arrow of the stepper button
487 * and the type of button in a single drawing function.
489 * It doesn't work correctly when the scrollbar is squished
490 * to the point we don't have room for full-sized steppers.
493 reverse_engineer_stepper_box (GtkWidget *range,
494 GtkArrowType arrow_type,
500 gint slider_width = 14, stepper_size = 14;
504 if (range && GTK_IS_RANGE (range))
506 gtk_widget_style_get (range,
507 "slider_width", &slider_width,
508 "stepper_size", &stepper_size,
512 if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN)
514 box_width = slider_width;
515 box_height = stepper_size;
519 box_width = stepper_size;
520 box_height = slider_width;
523 *x = *x - (box_width - *width) / 2;
524 *y = *y - (box_height - *height) / 2;
526 *height = box_height;
530 draw_arrow (GtkStyle *style,
533 GtkShadowType shadow,
537 GtkArrowType arrow_direction,
544 ThemeMatchData match_data;
546 g_return_if_fail(style != NULL);
547 g_return_if_fail(window != NULL);
550 (strcmp (detail, "hscrollbar") == 0 || strcmp (detail, "vscrollbar") == 0))
552 /* This is a hack to work around the fact that scrollbar steppers are drawn
553 * as a box + arrow, so we never have
555 * The full bounding box of the scrollbar
556 * The arrow direction
558 * At the same time. We simulate an extra paint function, "STEPPER", by doing
559 * nothing for the box, and then here, reverse engineering the box that
560 * was passed to draw box and using that
564 gint box_width = width;
565 gint box_height = height;
567 reverse_engineer_stepper_box (widget, arrow_direction,
568 &box_x, &box_y, &box_width, &box_height);
570 match_data.function = TOKEN_D_STEPPER;
571 match_data.detail = (gchar *)detail;
572 match_data.flags = (THEME_MATCH_SHADOW |
574 THEME_MATCH_ARROW_DIRECTION);
575 match_data.shadow = shadow;
576 match_data.state = state;
577 match_data.arrow_direction = arrow_direction;
579 if (draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
580 box_x, box_y, box_width, box_height))
582 /* The theme included stepper images, we're done */
586 /* Otherwise, draw the full box, and fall through to draw the arrow
588 match_data.function = TOKEN_D_BOX;
589 match_data.detail = (gchar *)detail;
590 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
591 match_data.shadow = shadow;
592 match_data.state = state;
594 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
595 box_x, box_y, box_width, box_height))
596 parent_class->draw_box (style, window, state, shadow, area, widget, detail,
597 box_x, box_y, box_width, box_height);
601 match_data.function = TOKEN_D_ARROW;
602 match_data.detail = (gchar *)detail;
603 match_data.flags = (THEME_MATCH_SHADOW |
605 THEME_MATCH_ARROW_DIRECTION);
606 match_data.shadow = shadow;
607 match_data.state = state;
608 match_data.arrow_direction = arrow_direction;
610 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
611 x, y, width, height))
612 parent_class->draw_arrow (style, window, state, shadow, area, widget, detail,
613 arrow_direction, fill, x, y, width, height);
617 draw_diamond (GtkStyle *style,
620 GtkShadowType shadow,
629 ThemeMatchData match_data;
631 g_return_if_fail(style != NULL);
632 g_return_if_fail(window != NULL);
634 match_data.function = TOKEN_D_DIAMOND;
635 match_data.detail = (gchar *)detail;
636 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
637 match_data.shadow = shadow;
638 match_data.state = state;
640 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
641 x, y, width, height))
642 parent_class->draw_diamond (style, window, state, shadow, area, widget, detail,
643 x, y, width, height);
647 draw_box (GtkStyle *style,
650 GtkShadowType shadow,
659 ThemeMatchData match_data;
661 g_return_if_fail(style != NULL);
662 g_return_if_fail(window != NULL);
665 (strcmp (detail, "hscrollbar") == 0 || strcmp (detail, "vscrollbar") == 0))
667 /* We handle this in draw_arrow */
671 match_data.function = TOKEN_D_BOX;
672 match_data.detail = (gchar *)detail;
673 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
674 match_data.shadow = shadow;
675 match_data.state = state;
677 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
678 x, y, width, height)) {
679 parent_class->draw_box (style, window, state, shadow, area, widget, detail,
680 x, y, width, height);
685 draw_flat_box (GtkStyle *style,
688 GtkShadowType shadow,
697 ThemeMatchData match_data;
699 g_return_if_fail(style != NULL);
700 g_return_if_fail(window != NULL);
702 match_data.function = TOKEN_D_FLAT_BOX;
703 match_data.detail = (gchar *)detail;
704 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
705 match_data.shadow = shadow;
706 match_data.state = state;
708 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
709 x, y, width, height))
710 parent_class->draw_flat_box (style, window, state, shadow, area, widget, detail,
711 x, y, width, height);
715 draw_check (GtkStyle *style,
718 GtkShadowType shadow,
727 ThemeMatchData match_data;
729 g_return_if_fail(style != NULL);
730 g_return_if_fail(window != NULL);
732 match_data.function = TOKEN_D_CHECK;
733 match_data.detail = (gchar *)detail;
734 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
735 match_data.shadow = shadow;
736 match_data.state = state;
738 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
739 x, y, width, height))
740 parent_class->draw_check (style, window, state, shadow, area, widget, detail,
741 x, y, width, height);
745 draw_option (GtkStyle *style,
748 GtkShadowType shadow,
757 ThemeMatchData match_data;
759 g_return_if_fail(style != NULL);
760 g_return_if_fail(window != NULL);
762 match_data.function = TOKEN_D_OPTION;
763 match_data.detail = (gchar *)detail;
764 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
765 match_data.shadow = shadow;
766 match_data.state = state;
768 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
769 x, y, width, height))
770 parent_class->draw_option (style, window, state, shadow, area, widget, detail,
771 x, y, width, height);
775 draw_tab (GtkStyle *style,
778 GtkShadowType shadow,
787 ThemeMatchData match_data;
789 g_return_if_fail(style != NULL);
790 g_return_if_fail(window != NULL);
792 match_data.function = TOKEN_D_TAB;
793 match_data.detail = (gchar *)detail;
794 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
795 match_data.shadow = shadow;
796 match_data.state = state;
798 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
799 x, y, width, height))
800 parent_class->draw_tab (style, window, state, shadow, area, widget, detail,
801 x, y, width, height);
805 draw_shadow_gap (GtkStyle *style,
808 GtkShadowType shadow,
816 GtkPositionType gap_side,
820 ThemeMatchData match_data;
822 match_data.function = TOKEN_D_SHADOW_GAP;
823 match_data.detail = (gchar *)detail;
824 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
825 match_data.flags = (THEME_MATCH_SHADOW |
827 THEME_MATCH_ORIENTATION);
828 match_data.shadow = shadow;
829 match_data.state = state;
831 if (!draw_gap_image_no_cairo (style, window, area, widget, &match_data, FALSE,
832 x, y, width, height, gap_side, gap_x, gap_width))
833 parent_class->draw_shadow_gap (style, window, state, shadow, area, widget, detail,
834 x, y, width, height, gap_side, gap_x, gap_width);
838 draw_box_gap (GtkStyle *style,
841 GtkShadowType shadow,
849 GtkPositionType gap_side,
853 ThemeMatchData match_data;
855 match_data.function = TOKEN_D_BOX_GAP;
856 match_data.detail = (gchar *)detail;
857 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE;
858 match_data.flags = (THEME_MATCH_SHADOW |
860 THEME_MATCH_ORIENTATION);
861 match_data.shadow = shadow;
862 match_data.state = state;
864 if (!draw_gap_image_no_cairo (style, window, area, widget, &match_data, TRUE,
865 x, y, width, height, gap_side, gap_x, gap_width))
866 parent_class->draw_box_gap (style, window, state, shadow, area, widget, detail,
867 x, y, width, height, gap_side, gap_x, gap_width);
871 draw_extension (GtkStyle *style,
874 GtkShadowType shadow,
882 GtkPositionType gap_side)
884 ThemeMatchData match_data;
886 g_return_if_fail (style != NULL);
887 g_return_if_fail (window != NULL);
889 match_data.function = TOKEN_D_EXTENSION;
890 match_data.detail = (gchar *)detail;
891 match_data.flags = THEME_MATCH_SHADOW | THEME_MATCH_STATE | THEME_MATCH_GAP_SIDE;
892 match_data.shadow = shadow;
893 match_data.state = state;
894 match_data.gap_side = gap_side;
896 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
897 x, y, width, height))
898 parent_class->draw_extension (style, window, state, shadow, area, widget, detail,
899 x, y, width, height, gap_side);
903 draw_focus (GtkStyle *style,
905 GtkStateType state_type,
914 ThemeMatchData match_data;
916 g_return_if_fail (style != NULL);
917 g_return_if_fail (window != NULL);
919 match_data.function = TOKEN_D_FOCUS;
920 match_data.detail = (gchar *)detail;
921 match_data.flags = 0;
923 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, FALSE,
924 x, y, width, height))
925 parent_class->draw_focus (style, window, state_type, area, widget, detail,
926 x, y, width, height);
930 draw_slider (GtkStyle *style,
933 GtkShadowType shadow,
941 GtkOrientation orientation)
943 ThemeMatchData match_data;
945 g_return_if_fail(style != NULL);
946 g_return_if_fail(window != NULL);
948 match_data.function = TOKEN_D_SLIDER;
949 match_data.detail = (gchar *)detail;
950 match_data.flags = (THEME_MATCH_SHADOW |
952 THEME_MATCH_ORIENTATION);
953 match_data.shadow = shadow;
954 match_data.state = state;
955 match_data.orientation = orientation;
957 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
958 x, y, width, height))
959 parent_class->draw_slider (style, window, state, shadow, area, widget, detail,
960 x, y, width, height, orientation);
965 draw_handle (GtkStyle *style,
968 GtkShadowType shadow,
976 GtkOrientation orientation)
978 ThemeMatchData match_data;
980 g_return_if_fail (style != NULL);
981 g_return_if_fail (window != NULL);
983 match_data.function = TOKEN_D_HANDLE;
984 match_data.detail = (gchar *)detail;
985 match_data.flags = (THEME_MATCH_SHADOW |
987 THEME_MATCH_ORIENTATION);
988 match_data.shadow = shadow;
989 match_data.state = state;
990 match_data.orientation = orientation;
992 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
993 x, y, width, height))
994 parent_class->draw_handle (style, window, state, shadow, area, widget, detail,
995 x, y, width, height, orientation);
999 draw_expander (GtkStyle *style,
1004 const gchar *detail,
1007 GtkExpanderStyle expander_style)
1009 #define DEFAULT_EXPANDER_SIZE 12
1011 ThemeMatchData match_data;
1015 g_return_if_fail (style != NULL);
1016 g_return_if_fail (window != NULL);
1019 gtk_widget_class_find_style_property (GTK_WIDGET_GET_CLASS (widget),
1022 gtk_widget_style_get (widget,
1023 "expander-size", &expander_size,
1027 expander_size = DEFAULT_EXPANDER_SIZE;
1029 radius = expander_size/2;
1031 match_data.function = TOKEN_D_EXPANDER;
1032 match_data.detail = (gchar *)detail;
1033 match_data.flags = (THEME_MATCH_STATE |
1034 THEME_MATCH_EXPANDER_STYLE);
1035 match_data.state = state;
1036 match_data.expander_style = expander_style;
1038 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
1039 x - radius, y - radius, expander_size, expander_size))
1040 parent_class->draw_expander (style, window, state, area, widget, detail,
1041 x, y, expander_style);
1045 draw_resize_grip (GtkStyle *style,
1050 const gchar *detail,
1057 ThemeMatchData match_data;
1059 g_return_if_fail (style != NULL);
1060 g_return_if_fail (window != NULL);
1062 match_data.function = TOKEN_D_RESIZE_GRIP;
1063 match_data.detail = (gchar *)detail;
1064 match_data.flags = (THEME_MATCH_STATE |
1065 THEME_MATCH_WINDOW_EDGE);
1066 match_data.state = state;
1067 match_data.window_edge = edge;
1069 if (!draw_simple_image_no_cairo (style, window, area, widget, &match_data, TRUE, TRUE,
1070 x, y, width, height))
1071 parent_class->draw_resize_grip (style, window, state, area, widget, detail,
1072 edge, x, y, width, height);
1075 GType pixbuf_type_style = 0;
1078 pixbuf_style_register_type (GTypeModule *module)
1080 const GTypeInfo object_info =
1082 sizeof (PixbufStyleClass),
1083 (GBaseInitFunc) NULL,
1084 (GBaseFinalizeFunc) NULL,
1085 (GClassInitFunc) pixbuf_style_class_init,
1086 NULL, /* class_finalize */
1087 NULL, /* class_data */
1088 sizeof (PixbufStyle),
1089 0, /* n_preallocs */
1090 (GInstanceInitFunc) pixbuf_style_init,
1093 pixbuf_type_style = g_type_module_register_type (module,
1100 pixbuf_style_init (PixbufStyle *style)
1105 pixbuf_style_class_init (PixbufStyleClass *klass)
1107 GtkStyleClass *style_class = GTK_STYLE_CLASS (klass);
1109 parent_class = g_type_class_peek_parent (klass);
1111 style_class->draw_hline = draw_hline;
1112 style_class->draw_vline = draw_vline;
1113 style_class->draw_shadow = draw_shadow;
1114 style_class->draw_arrow = draw_arrow;
1115 style_class->draw_diamond = draw_diamond;
1116 style_class->draw_box = draw_box;
1117 style_class->draw_flat_box = draw_flat_box;
1118 style_class->draw_check = draw_check;
1119 style_class->draw_option = draw_option;
1120 style_class->draw_tab = draw_tab;
1121 style_class->draw_shadow_gap = draw_shadow_gap;
1122 style_class->draw_box_gap = draw_box_gap;
1123 style_class->draw_extension = draw_extension;
1124 style_class->draw_focus = draw_focus;
1125 style_class->draw_slider = draw_slider;
1126 style_class->draw_handle = draw_handle;
1127 style_class->draw_expander = draw_expander;
1128 style_class->draw_resize_grip = draw_resize_grip;