Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Enumerations | Functions
gtkdrawing.h File Reference
#include <gdk/gdk.h>
#include <gtk/gtkstyle.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GtkWidgetState
 gtkdrawing.h: GTK widget rendering utilities More...
struct  MozGtkScrollbarMetrics

Defines

#define MOZ_GTK_SUCCESS   0
#define MOZ_GTK_UNKNOWN_WIDGET   -1
#define MOZ_GTK_UNSAFE_THEME   -2

Typedefs

typedef gint(* style_prop_t )(GtkStyle *, const gchar *, gint)

Enumerations

enum  GtkTabFlags { MOZ_GTK_TAB_FIRST = 1 << 0, MOZ_GTK_TAB_BEFORE_SELECTED = 1 << 1, MOZ_GTK_TAB_SELECTED = 1 << 2 }
 flags for tab state More...
enum  GtkThemeWidgetType {
  MOZ_GTK_BUTTON, MOZ_GTK_CHECKBUTTON, MOZ_GTK_RADIOBUTTON, MOZ_GTK_SCROLLBAR_BUTTON,
  MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL, MOZ_GTK_SCROLLBAR_TRACK_VERTICAL, MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL, MOZ_GTK_SCROLLBAR_THUMB_VERTICAL,
  MOZ_GTK_GRIPPER, MOZ_GTK_ENTRY, MOZ_GTK_DROPDOWN, MOZ_GTK_DROPDOWN_ARROW,
  MOZ_GTK_CHECKBUTTON_CONTAINER, MOZ_GTK_RADIOBUTTON_CONTAINER, MOZ_GTK_CHECKBUTTON_LABEL, MOZ_GTK_RADIOBUTTON_LABEL,
  MOZ_GTK_TOOLBAR, MOZ_GTK_TOOLTIP, MOZ_GTK_FRAME, MOZ_GTK_PROGRESSBAR,
  MOZ_GTK_PROGRESS_CHUNK, MOZ_GTK_TAB, MOZ_GTK_TABPANELS, MOZ_GTK_MENUBAR,
  MOZ_GTK_MENUPOPUP, MOZ_GTK_MENUITEM, MOZ_GTK_CHECKMENUITEM, MOZ_GTK_RADIOMENUITEM,
  MOZ_GTK_WINDOW
}

Functions

gint moz_gtk_init ()
 Initializes the drawing library.
gint moz_gtk_enable_style_props (style_prop_t styleGetProp)
 Enable GTK+ 1.2.9+ theme enhancements.
gint moz_gtk_shutdown ()
 Perform cleanup of the drawing library.
gint moz_gtk_widget_paint (GtkThemeWidgetType widget, GdkDrawable *drawable, GdkRectangle *rect, GdkRectangle *cliprect, GtkWidgetState *state, gint flags)
 Paint a widget in the current theme.
gint moz_gtk_get_widget_border (GtkThemeWidgetType widget, gint *xthickness, gint *ythickness)
 Get the border size of a widget xthickness: [OUT] the widget's left/right border ythickness: [OUT] the widget's top/bottom border.
gint moz_gtk_checkbox_get_metrics (gint *indicator_size, gint *indicator_spacing)
 Get the desired size of a GtkCheckButton indicator_size: [OUT] the indicator size indicator_spacing: [OUT] the spacing between the indicator and its container.
gint moz_gtk_radio_get_metrics (gint *indicator_size, gint *indicator_spacing)
 Get the desired size of a GtkRadioButton indicator_size: [OUT] the indicator size indicator_spacing: [OUT] the spacing between the indicator and its container.
gint moz_gtk_button_get_focus (gboolean *interior_focus, gint *focus_width, gint *focus_pad)
 Get the focus metrics for a button, checkbox, or radio button.
gint moz_gtk_checkbox_get_focus (gboolean *interior_focus, gint *focus_width, gint *focus_pad)
gint moz_gtk_radio_get_focus (gboolean *interior_focus, gint *focus_width, gint *focus_pad)
gint moz_gtk_get_scrollbar_metrics (MozGtkScrollbarMetrics *metrics)
 Get the desired metrics for a GtkScrollbar metrics: [IN] struct which will contain the metrics.
gint moz_gtk_get_dropdown_arrow_size (gint *width, gint *height)
 Get the desired size of a dropdown arrow button width: [OUT] the desired width height: [OUT] the desired height.

Class Documentation

struct GtkWidgetState

gtkdrawing.h: GTK widget rendering utilities

gtkdrawing provides an API for rendering GTK widgets in the current theme to a pixmap or window, without requiring an actual widget instantiation, similar to the Macintosh Appearance Manager or Windows XP's DrawThemeBackground() API.

Definition at line 59 of file gtkdrawing.h.

Class Members
guint8 active
guint8 canDefault
gint32 curpos
guint8 disabled
guint8 focused
guint8 inHover
guint8 isDefault
gint32 maxpos
struct MozGtkScrollbarMetrics

Definition at line 70 of file gtkdrawing.h.

Class Members
gint min_slider_size
gint slider_width
gint stepper_size
gint stepper_spacing
gint trough_border

Define Documentation

Definition at line 92 of file gtkdrawing.h.

Definition at line 93 of file gtkdrawing.h.

Definition at line 94 of file gtkdrawing.h.


Typedef Documentation

typedef gint(* style_prop_t)(GtkStyle *, const gchar *, gint)

Definition at line 89 of file gtkdrawing.h.


Enumeration Type Documentation

flags for tab state

Enumerator:
MOZ_GTK_TAB_FIRST 
MOZ_GTK_TAB_BEFORE_SELECTED 
MOZ_GTK_TAB_SELECTED 

Definition at line 79 of file gtkdrawing.h.

             {
  /* the first tab in the group */
  MOZ_GTK_TAB_FIRST           = 1 << 0,
  /* the tab just before the selected tab */
  MOZ_GTK_TAB_BEFORE_SELECTED = 1 << 1,
  /* the selected tab */
  MOZ_GTK_TAB_SELECTED        = 1 << 2
} GtkTabFlags;
Enumerator:
MOZ_GTK_BUTTON 
MOZ_GTK_CHECKBUTTON 
MOZ_GTK_RADIOBUTTON 
MOZ_GTK_SCROLLBAR_BUTTON 

Paints the button of a GtkScrollbar.

flags is a GtkArrowType giving the arrow direction.

MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL 
MOZ_GTK_SCROLLBAR_TRACK_VERTICAL 
MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL 
MOZ_GTK_SCROLLBAR_THUMB_VERTICAL 
MOZ_GTK_GRIPPER 
MOZ_GTK_ENTRY 
MOZ_GTK_DROPDOWN 
MOZ_GTK_DROPDOWN_ARROW 
MOZ_GTK_CHECKBUTTON_CONTAINER 
MOZ_GTK_RADIOBUTTON_CONTAINER 
MOZ_GTK_CHECKBUTTON_LABEL 
MOZ_GTK_RADIOBUTTON_LABEL 
MOZ_GTK_TOOLBAR 
MOZ_GTK_TOOLTIP 
MOZ_GTK_FRAME 
MOZ_GTK_PROGRESSBAR 
MOZ_GTK_PROGRESS_CHUNK 
MOZ_GTK_TAB 
MOZ_GTK_TABPANELS 
MOZ_GTK_MENUBAR 
MOZ_GTK_MENUPOPUP 
MOZ_GTK_MENUITEM 
MOZ_GTK_CHECKMENUITEM 
MOZ_GTK_RADIOMENUITEM 
MOZ_GTK_WINDOW 

Definition at line 97 of file gtkdrawing.h.

             {
  /* Paints a GtkButton. flags is a GtkReliefStyle. */
  MOZ_GTK_BUTTON,
  /* Paints a GtkCheckButton. flags is a boolean, 1=checked, 0=not checked. */
  MOZ_GTK_CHECKBUTTON,
  /* Paints a GtkRadioButton. flags is a boolean, 1=checked, 0=not checked. */
  MOZ_GTK_RADIOBUTTON,
  MOZ_GTK_SCROLLBAR_BUTTON,
  /* Paints the trough (track) of a GtkScrollbar. */
  MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL,
  MOZ_GTK_SCROLLBAR_TRACK_VERTICAL,
  /* Paints the slider (thumb) of a GtkScrollbar. */
  MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL,
  MOZ_GTK_SCROLLBAR_THUMB_VERTICAL,
  /* Paints the gripper of a GtkHandleBox. */
  MOZ_GTK_GRIPPER,
  /* Paints a GtkEntry. */
  MOZ_GTK_ENTRY,
  /* Paints a GtkOptionMenu. */
  MOZ_GTK_DROPDOWN,
  /* Paints a dropdown arrow (a GtkButton containing a down GtkArrow). */
  MOZ_GTK_DROPDOWN_ARROW,
  /* Paints the container part of a GtkCheckButton. */
  MOZ_GTK_CHECKBUTTON_CONTAINER,
  /* Paints the container part of a GtkRadioButton. */
  MOZ_GTK_RADIOBUTTON_CONTAINER,
  /* Paints the label of a GtkCheckButton (focus outline) */
  MOZ_GTK_CHECKBUTTON_LABEL,
  /* Paints the label of a GtkRadioButton (focus outline) */
  MOZ_GTK_RADIOBUTTON_LABEL,
  /* Paints the background of a GtkHandleBox. */
  MOZ_GTK_TOOLBAR,
  /* Paints a GtkToolTip */
  MOZ_GTK_TOOLTIP,
  /* Paints a GtkFrame (e.g. a status bar panel). */
  MOZ_GTK_FRAME,
  /* Paints a GtkProgressBar. */
  MOZ_GTK_PROGRESSBAR,
  /* Paints a progress chunk of a GtkProgressBar. */
  MOZ_GTK_PROGRESS_CHUNK,
  /* Paints a tab of a GtkNotebook. flags is a GtkTabFlags, defined above. */
  MOZ_GTK_TAB,
  /* Paints the background and border of a GtkNotebook. */
  MOZ_GTK_TABPANELS,
  /* Paints the background of the menu bar. */
  MOZ_GTK_MENUBAR,
  /* Paints the background of menus, context menus. */
  MOZ_GTK_MENUPOPUP,
  /* Paints items of menubar and popups. */
  MOZ_GTK_MENUITEM,
  MOZ_GTK_CHECKMENUITEM,
  MOZ_GTK_RADIOMENUITEM,
  /* Paints the background of a window, dialog or page. */
  MOZ_GTK_WINDOW
} GtkThemeWidgetType;

Function Documentation

gint moz_gtk_button_get_focus ( gboolean *  interior_focus,
gint *  focus_width,
gint *  focus_pad 
)

Get the focus metrics for a button, checkbox, or radio button.

interior_focus: [OUT] whether the focus is drawn around the label (TRUE) or around the whole container (FALSE) focus_width: [OUT] the width of the focus line focus_pad: [OUT] the padding between the focus line and children

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 507 of file gtk2drawing.c.

{
    ensure_button_widget();

    gtk_widget_style_get (gButtonWidget,
                          "interior-focus", interior_focus,
                          "focus-line-width", focus_width,
                          "focus-padding", focus_pad,
                          NULL);

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_checkbox_get_focus ( gboolean *  interior_focus,
gint *  focus_width,
gint *  focus_pad 
)

Definition at line 477 of file gtk2drawing.c.

{
    ensure_checkbox_widget();

    gtk_widget_style_get (gCheckboxWidget,
                          "interior-focus", interior_focus,
                          "focus-line-width", focus_width,
                          "focus-padding", focus_pad,
                          NULL);

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_checkbox_get_metrics ( gint *  indicator_size,
gint *  indicator_spacing 
)

Get the desired size of a GtkCheckButton indicator_size: [OUT] the indicator size indicator_spacing: [OUT] the spacing between the indicator and its container.

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 451 of file gtk2drawing.c.

{
    ensure_checkbox_widget();

    gtk_widget_style_get (gCheckboxWidget,
                          "indicator_size", indicator_size,
                          "indicator_spacing", indicator_spacing,
                          NULL);

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_enable_style_props ( style_prop_t  styleGetProp)

Enable GTK+ 1.2.9+ theme enhancements.

You must provide a pointer to the GTK+ 1.2.9+ function "gtk_style_get_prop_experimental". styleGetProp: pointer to gtk_style_get_prop_experimental

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 85 of file gtk2drawing.c.

{
    style_prop_func = styleGetProp;
    return MOZ_GTK_SUCCESS;
}

Here is the caller graph for this function:

gint moz_gtk_get_dropdown_arrow_size ( gint *  width,
gint *  height 
)

Get the desired size of a dropdown arrow button width: [OUT] the desired width height: [OUT] the desired height.

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 1529 of file gtk2drawing.c.

{
    ensure_arrow_widget();

    /*
     * First get the border of the dropdown arrow, then add in the requested
     * size of the arrow.  Note that the minimum arrow size is fixed at
     * 11 pixels.
     */

    *width = 2 * (1 + XTHICKNESS(gDropdownButtonWidget->style));
    *width += 11 + GTK_MISC(gArrowWidget)->xpad * 2;

    *height = 2 * (1 + YTHICKNESS(gDropdownButtonWidget->style));
    *height += 11 + GTK_MISC(gArrowWidget)->ypad * 2;

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Get the desired metrics for a GtkScrollbar metrics: [IN] struct which will contain the metrics.

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 1549 of file gtk2drawing.c.

{
    ensure_scrollbar_widget();

    gtk_widget_style_get (gHorizScrollbarWidget,
                          "slider_width", &metrics->slider_width,
                          "trough_border", &metrics->trough_border,
                          "stepper_size", &metrics->stepper_size,
                          "stepper_spacing", &metrics->stepper_spacing,
                          NULL);

    metrics->min_slider_size =
        GTK_RANGE(gHorizScrollbarWidget)->min_slider_size;

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_get_widget_border ( GtkThemeWidgetType  widget,
gint *  xthickness,
gint *  ythickness 
)

Get the border size of a widget xthickness: [OUT] the widget's left/right border ythickness: [OUT] the widget's top/bottom border.

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 1378 of file gtk2drawing.c.

{
    GtkWidget* w;

    switch (widget) {
    case MOZ_GTK_BUTTON:
        {
            /* Constant in gtkbutton.c */
            static const gint child_spacing = 1;
            gboolean interior_focus;
            gint focus_width, focus_pad;

            ensure_button_widget();

            moz_gtk_button_get_focus(&interior_focus,
                                     &focus_width, &focus_pad);

            *xthickness = *ythickness =
                GTK_CONTAINER(gButtonWidget)->border_width + child_spacing
                + focus_width + focus_pad;

            *xthickness += gButtonWidget->style->xthickness;
            *ythickness += gButtonWidget->style->ythickness;
            return MOZ_GTK_SUCCESS;
        }

    case MOZ_GTK_TOOLBAR:
        ensure_toolbar_widget();
        w = gToolbarWidget;
        break;
    case MOZ_GTK_ENTRY:
        ensure_entry_widget();
        w = gEntryWidget;
        break;
    case MOZ_GTK_DROPDOWN_ARROW:
        ensure_arrow_widget();
        w = gDropdownButtonWidget;
        break;
    case MOZ_GTK_DROPDOWN:
        ensure_option_menu_widget();
        w = gOptionMenuWidget;
        break;
    case MOZ_GTK_TABPANELS:
        ensure_tab_widget();
        w = gTabWidget;
        break;
    case MOZ_GTK_PROGRESSBAR:
        ensure_progress_widget();
        w = gProgressWidget;
        break;
    case MOZ_GTK_FRAME:
        ensure_frame_widget();
        w = gFrameWidget;
        break;
    case MOZ_GTK_CHECKBUTTON_LABEL:
    case MOZ_GTK_RADIOBUTTON_LABEL:
        {
            gboolean interior_focus;
            gint focus_width, focus_pad;

            /* If the focus is interior, then the label has a border of
               (focus_width + focus_pad). */
            if (widget == MOZ_GTK_CHECKBUTTON_LABEL)
                moz_gtk_checkbox_get_focus(&interior_focus,
                                           &focus_width, &focus_pad);
            else
                moz_gtk_radio_get_focus(&interior_focus,
                                        &focus_width, &focus_pad);

            if (interior_focus)
                *xthickness = *ythickness = (focus_width + focus_pad);
            else
                *xthickness = *ythickness = 0;

            return MOZ_GTK_SUCCESS;
        }

    case MOZ_GTK_CHECKBUTTON_CONTAINER:
    case MOZ_GTK_RADIOBUTTON_CONTAINER:
        {
            gboolean interior_focus;
            gint focus_width, focus_pad;

            /* If the focus is _not_ interior, then the container has a border
               of (focus_width + focus_pad). */
            if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) {
                moz_gtk_checkbox_get_focus(&interior_focus,
                                           &focus_width, &focus_pad);
                w = gCheckboxWidget;
            } else {
                moz_gtk_radio_get_focus(&interior_focus,
                                        &focus_width, &focus_pad);
                w = gRadiobuttonWidget;
            }

            *xthickness = *ythickness = GTK_CONTAINER(w)->border_width;

            if (!interior_focus) {
                *xthickness += (focus_width + focus_pad);
                *ythickness += (focus_width + focus_pad);
            }

            return MOZ_GTK_SUCCESS;
        }

    case MOZ_GTK_MENUBAR:
        ensure_menu_bar_widget();
        w = gMenuBarWidget;
        break;
    case MOZ_GTK_MENUPOPUP:
        ensure_menu_popup_widget();
        w = gMenuPopupWidget;
        break;
    case MOZ_GTK_MENUITEM:
        ensure_menu_item_widget();
        w = gMenuItemWidget;
        break;
    case MOZ_GTK_CHECKMENUITEM:
    case MOZ_GTK_RADIOMENUITEM:
        ensure_check_menu_item_widget();
        w = gCheckMenuItemWidget;
        break;
    /* These widgets have no borders, since they are not containers. */
    case MOZ_GTK_CHECKBUTTON:
    case MOZ_GTK_RADIOBUTTON:
    case MOZ_GTK_SCROLLBAR_BUTTON:
    case MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL:
    case MOZ_GTK_SCROLLBAR_TRACK_VERTICAL:
    case MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL:
    case MOZ_GTK_SCROLLBAR_THUMB_VERTICAL:
    case MOZ_GTK_GRIPPER:
    case MOZ_GTK_PROGRESS_CHUNK:
    case MOZ_GTK_TAB:
    /* These widgets have no borders.*/
    case MOZ_GTK_TOOLTIP:
    case MOZ_GTK_WINDOW:
        *xthickness = *ythickness = 0;
        return MOZ_GTK_SUCCESS;
    default:
        g_warning("Unsupported widget type: %d", widget);
        return MOZ_GTK_UNKNOWN_WIDGET;
    }

    *xthickness = XTHICKNESS(w->style);
    *ythickness = YTHICKNESS(w->style);

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_init ( )

Initializes the drawing library.

You must call this function prior to using any other functionality. returns: MOZ_GTK_SUCCESS if there were no errors MOZ_GTK_UNSAFE_THEME if the current theme engine is known to crash with gtkdrawing.

Definition at line 441 of file gtk2drawing.c.

{
    have_menu_shadow_type =
        (gtk_major_version > 2 ||
         (gtk_major_version == 2 && gtk_minor_version >= 1));

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_radio_get_focus ( gboolean *  interior_focus,
gint *  focus_width,
gint *  focus_pad 
)

Definition at line 492 of file gtk2drawing.c.

{
    ensure_radiobutton_widget();

    gtk_widget_style_get (gRadiobuttonWidget,
                          "interior-focus", interior_focus,
                          "focus-line-width", focus_width,
                          "focus-padding", focus_pad,
                          NULL);

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_radio_get_metrics ( gint *  indicator_size,
gint *  indicator_spacing 
)

Get the desired size of a GtkRadioButton indicator_size: [OUT] the indicator size indicator_spacing: [OUT] the spacing between the indicator and its container.

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 464 of file gtk2drawing.c.

{
    ensure_radiobutton_widget();

    gtk_widget_style_get (gRadiobuttonWidget,
                          "indicator_size", indicator_size,
                          "indicator_spacing", indicator_spacing,
                          NULL);

    return MOZ_GTK_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint moz_gtk_shutdown ( )

Perform cleanup of the drawing library.

You should call this function when your program exits, or you no longer need the library.

returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise

Definition at line 1666 of file gtk2drawing.c.

gint moz_gtk_widget_paint ( GtkThemeWidgetType  widget,
GdkDrawable *  drawable,
GdkRectangle *  rect,
GdkRectangle *  cliprect,
GtkWidgetState state,
gint  flags 
)

Paint a widget in the current theme.

widget: a constant giving the widget to paint rect: the bounding rectangle for the widget cliprect: a clipprect rectangle for this painting operation state: the state of the widget. ignored for some widgets. flags: widget-dependant flags; see the GtkThemeWidgetType definition.

Definition at line 1567 of file gtk2drawing.c.

{
    switch (widget) {
    case MOZ_GTK_BUTTON:
        ensure_button_widget();
        return moz_gtk_button_paint(drawable, rect, cliprect, state,
                                    (GtkReliefStyle) flags, gButtonWidget);
        break;
    case MOZ_GTK_CHECKBUTTON:
    case MOZ_GTK_RADIOBUTTON:
        return moz_gtk_toggle_paint(drawable, rect, cliprect, state,
                                    (gboolean) flags,
                                    (widget == MOZ_GTK_RADIOBUTTON));
        break;
    case MOZ_GTK_SCROLLBAR_BUTTON:
        return moz_gtk_scrollbar_button_paint(drawable, rect, cliprect,
                                              state, (GtkArrowType) flags);
        break;
    case MOZ_GTK_SCROLLBAR_TRACK_HORIZONTAL:
    case MOZ_GTK_SCROLLBAR_TRACK_VERTICAL:
        return moz_gtk_scrollbar_trough_paint(widget, drawable, rect,
                                              cliprect, state);
        break;
    case MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL:
    case MOZ_GTK_SCROLLBAR_THUMB_VERTICAL:
        return moz_gtk_scrollbar_thumb_paint(widget, drawable, rect,
                                             cliprect, state);
        break;
    case MOZ_GTK_GRIPPER:
        return moz_gtk_gripper_paint(drawable, rect, cliprect, state);
        break;
    case MOZ_GTK_ENTRY:
        return moz_gtk_entry_paint(drawable, rect, cliprect, state);
        break;
    case MOZ_GTK_DROPDOWN:
        return moz_gtk_option_menu_paint(drawable, rect, cliprect, state);
        break;
    case MOZ_GTK_DROPDOWN_ARROW:
        return moz_gtk_dropdown_arrow_paint(drawable, rect, cliprect, state);
        break;
    case MOZ_GTK_CHECKBUTTON_CONTAINER:
    case MOZ_GTK_RADIOBUTTON_CONTAINER:
        return moz_gtk_container_paint(drawable, rect, cliprect, state,
                                       (widget == MOZ_GTK_RADIOBUTTON_CONTAINER));
        break;
    case MOZ_GTK_CHECKBUTTON_LABEL:
    case MOZ_GTK_RADIOBUTTON_LABEL:
        return moz_gtk_toggle_label_paint(drawable, rect, cliprect, state,
                                          (widget == MOZ_GTK_RADIOBUTTON_LABEL));
        break;
    case MOZ_GTK_TOOLBAR:
        return moz_gtk_toolbar_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_TOOLTIP:
        return moz_gtk_tooltip_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_FRAME:
        return moz_gtk_frame_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_PROGRESSBAR:
        return moz_gtk_progressbar_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_PROGRESS_CHUNK:
        return moz_gtk_progress_chunk_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_TAB:
        return moz_gtk_tab_paint(drawable, rect, cliprect, flags);
        break;
    case MOZ_GTK_TABPANELS:
        return moz_gtk_tabpanels_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_MENUBAR:
        return moz_gtk_menu_bar_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_MENUPOPUP:
        return moz_gtk_menu_popup_paint(drawable, rect, cliprect);
        break;
    case MOZ_GTK_MENUITEM:
        return moz_gtk_menu_item_paint(drawable, rect, cliprect, state);
        break;
    case MOZ_GTK_CHECKMENUITEM:
    case MOZ_GTK_RADIOMENUITEM:
        return moz_gtk_check_menu_item_paint(drawable, rect, cliprect, state,
                                             (gboolean) flags,
                                             (widget == MOZ_GTK_RADIOMENUITEM));
        break;
    case MOZ_GTK_WINDOW:
        return moz_gtk_window_paint(drawable, rect, cliprect);
        break;
    default:
        g_warning("Unknown widget type: %d", widget);
    }

    return MOZ_GTK_UNKNOWN_WIDGET;
}

Here is the call graph for this function:

Here is the caller graph for this function: