2005-08-20 11:11:46 +04:00
|
|
|
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2005-08-20 11:11:46 +04:00
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2005-08-20 11:11:46 +04:00
|
|
|
#ifndef _GTK_DRAWING_H_
|
|
|
|
#define _GTK_DRAWING_H_
|
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
2009-01-03 10:37:52 +03:00
|
|
|
#include <gtk/gtk.h>
|
2005-08-20 11:11:46 +04:00
|
|
|
|
2016-03-23 05:49:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 2)
|
2005-08-20 11:12:11 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
2016-03-23 05:49:00 +03:00
|
|
|
#endif
|
2005-08-20 11:12:11 +04:00
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/*** type definitions ***/
|
2005-08-20 11:11:46 +04:00
|
|
|
typedef struct {
|
2005-08-20 11:13:04 +04:00
|
|
|
guint8 active;
|
|
|
|
guint8 focused;
|
|
|
|
guint8 inHover;
|
|
|
|
guint8 disabled;
|
|
|
|
guint8 isDefault;
|
|
|
|
guint8 canDefault;
|
2007-12-03 12:14:18 +03:00
|
|
|
/* The depressed state is for buttons which remain active for a longer period:
|
|
|
|
* activated toggle buttons or buttons showing a popup menu. */
|
|
|
|
guint8 depressed;
|
2005-08-20 11:13:14 +04:00
|
|
|
gint32 curpos; /* curpos and maxpos are used for scrollbars */
|
|
|
|
gint32 maxpos;
|
2005-08-20 11:11:46 +04:00
|
|
|
} GtkWidgetState;
|
|
|
|
|
2005-08-20 11:14:00 +04:00
|
|
|
typedef struct {
|
|
|
|
gint slider_width;
|
|
|
|
gint trough_border;
|
|
|
|
gint stepper_size;
|
|
|
|
gint stepper_spacing;
|
|
|
|
gint min_slider_size;
|
|
|
|
} MozGtkScrollbarMetrics;
|
|
|
|
|
2008-01-13 07:13:50 +03:00
|
|
|
typedef enum {
|
|
|
|
MOZ_GTK_STEPPER_DOWN = 1 << 0,
|
|
|
|
MOZ_GTK_STEPPER_BOTTOM = 1 << 1,
|
|
|
|
MOZ_GTK_STEPPER_VERTICAL = 1 << 2
|
|
|
|
} GtkScrollbarButtonFlags;
|
|
|
|
|
2015-07-14 14:35:00 +03:00
|
|
|
typedef enum {
|
|
|
|
MOZ_GTK_TRACK_OPAQUE = 1 << 0
|
|
|
|
} GtkScrollbarTrackFlags;
|
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/** flags for tab state **/
|
|
|
|
typedef enum {
|
2007-12-21 14:51:48 +03:00
|
|
|
/* first eight bits are used to pass a margin */
|
|
|
|
MOZ_GTK_TAB_MARGIN_MASK = 0xFF,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* the first tab in the group */
|
2007-12-21 14:51:48 +03:00
|
|
|
MOZ_GTK_TAB_FIRST = 1 << 9,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* the selected tab */
|
2007-12-21 14:51:48 +03:00
|
|
|
MOZ_GTK_TAB_SELECTED = 1 << 10
|
2005-08-20 11:13:04 +04:00
|
|
|
} GtkTabFlags;
|
|
|
|
|
|
|
|
/* function type for moz_gtk_enable_style_props */
|
|
|
|
typedef gint (*style_prop_t)(GtkStyle*, const gchar*, gint);
|
|
|
|
|
|
|
|
/*** result/error codes ***/
|
|
|
|
#define MOZ_GTK_SUCCESS 0
|
|
|
|
#define MOZ_GTK_UNKNOWN_WIDGET -1
|
|
|
|
#define MOZ_GTK_UNSAFE_THEME -2
|
|
|
|
|
2009-01-22 03:07:44 +03:00
|
|
|
/*** checkbox/radio flags ***/
|
|
|
|
#define MOZ_GTK_WIDGET_CHECKED 1
|
|
|
|
#define MOZ_GTK_WIDGET_INCONSISTENT (1 << 1)
|
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/*** widget type constants ***/
|
|
|
|
typedef enum {
|
|
|
|
/* Paints a GtkButton. flags is a GtkReliefStyle. */
|
|
|
|
MOZ_GTK_BUTTON,
|
2015-08-07 08:09:00 +03:00
|
|
|
/* Paints a button with image and no text */
|
|
|
|
MOZ_GTK_TOOLBAR_BUTTON,
|
2016-07-20 02:57:00 +03:00
|
|
|
/* Paints a toggle button */
|
|
|
|
MOZ_GTK_TOGGLE_BUTTON,
|
|
|
|
/* Paints a button arrow */
|
|
|
|
MOZ_GTK_BUTTON_ARROW,
|
2016-05-13 02:59:17 +03:00
|
|
|
|
|
|
|
/* Paints the container part of a GtkCheckButton. */
|
|
|
|
MOZ_GTK_CHECKBUTTON_CONTAINER,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a GtkCheckButton. flags is a boolean, 1=checked, 0=not checked. */
|
|
|
|
MOZ_GTK_CHECKBUTTON,
|
2016-05-13 02:59:17 +03:00
|
|
|
/* Paints the label of a GtkCheckButton (focus outline) */
|
|
|
|
MOZ_GTK_CHECKBUTTON_LABEL,
|
|
|
|
|
|
|
|
/* Paints the container part of a GtkRadioButton. */
|
|
|
|
MOZ_GTK_RADIOBUTTON_CONTAINER,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a GtkRadioButton. flags is a boolean, 1=checked, 0=not checked. */
|
|
|
|
MOZ_GTK_RADIOBUTTON,
|
2016-05-13 02:59:17 +03:00
|
|
|
/* Paints the label of a GtkRadioButton (focus outline) */
|
|
|
|
MOZ_GTK_RADIOBUTTON_LABEL,
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* Paints the button of a GtkScrollbar. flags is a GtkArrowType giving
|
|
|
|
* the arrow direction.
|
|
|
|
*/
|
|
|
|
MOZ_GTK_SCROLLBAR_BUTTON,
|
2016-05-09 02:08:26 +03:00
|
|
|
|
|
|
|
/* Horizontal GtkScrollbar counterparts */
|
2015-12-22 07:05:00 +03:00
|
|
|
MOZ_GTK_SCROLLBAR_HORIZONTAL,
|
2016-06-13 05:35:00 +03:00
|
|
|
MOZ_GTK_SCROLLBAR_CONTENTS_HORIZONTAL,
|
2016-05-09 02:08:26 +03:00
|
|
|
/* Paints the trough (track) of a GtkScrollbar. */
|
|
|
|
MOZ_GTK_SCROLLBAR_TROUGH_HORIZONTAL,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints the slider (thumb) of a GtkScrollbar. */
|
2005-08-20 11:13:14 +04:00
|
|
|
MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL,
|
2016-05-09 02:08:26 +03:00
|
|
|
|
|
|
|
/* Vertical GtkScrollbar counterparts */
|
|
|
|
MOZ_GTK_SCROLLBAR_VERTICAL,
|
2016-06-13 05:35:00 +03:00
|
|
|
MOZ_GTK_SCROLLBAR_CONTENTS_VERTICAL,
|
2016-05-09 02:08:26 +03:00
|
|
|
MOZ_GTK_SCROLLBAR_TROUGH_VERTICAL,
|
2005-08-20 11:13:14 +04:00
|
|
|
MOZ_GTK_SCROLLBAR_THUMB_VERTICAL,
|
2016-05-09 02:08:26 +03:00
|
|
|
|
2006-05-30 17:50:48 +04:00
|
|
|
/* Paints a GtkScale. */
|
|
|
|
MOZ_GTK_SCALE_HORIZONTAL,
|
|
|
|
MOZ_GTK_SCALE_VERTICAL,
|
2016-08-19 12:20:00 +03:00
|
|
|
/* Paints a GtkScale trough. */
|
|
|
|
MOZ_GTK_SCALE_CONTENTS_HORIZONTAL,
|
|
|
|
MOZ_GTK_SCALE_CONTENTS_VERTICAL,
|
|
|
|
MOZ_GTK_SCALE_TROUGH_HORIZONTAL,
|
|
|
|
MOZ_GTK_SCALE_TROUGH_VERTICAL,
|
2006-05-30 17:50:48 +04:00
|
|
|
/* Paints a GtkScale thumb. */
|
|
|
|
MOZ_GTK_SCALE_THUMB_HORIZONTAL,
|
|
|
|
MOZ_GTK_SCALE_THUMB_VERTICAL,
|
2006-07-13 21:40:49 +04:00
|
|
|
/* Paints a GtkSpinButton */
|
2007-12-21 14:30:00 +03:00
|
|
|
MOZ_GTK_SPINBUTTON,
|
2006-07-13 21:40:49 +04:00
|
|
|
MOZ_GTK_SPINBUTTON_UP,
|
|
|
|
MOZ_GTK_SPINBUTTON_DOWN,
|
2007-12-21 14:30:00 +03:00
|
|
|
MOZ_GTK_SPINBUTTON_ENTRY,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints the gripper of a GtkHandleBox. */
|
|
|
|
MOZ_GTK_GRIPPER,
|
|
|
|
/* Paints a GtkEntry. */
|
|
|
|
MOZ_GTK_ENTRY,
|
2016-07-18 05:27:00 +03:00
|
|
|
/* Paints a GtkExpander. */
|
|
|
|
MOZ_GTK_EXPANDER,
|
2016-04-27 02:07:00 +03:00
|
|
|
/* Paints a GtkTextView. */
|
|
|
|
MOZ_GTK_TEXT_VIEW,
|
2005-08-20 11:14:05 +04:00
|
|
|
/* Paints a GtkOptionMenu. */
|
|
|
|
MOZ_GTK_DROPDOWN,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a dropdown arrow (a GtkButton containing a down GtkArrow). */
|
|
|
|
MOZ_GTK_DROPDOWN_ARROW,
|
2008-01-14 14:12:29 +03:00
|
|
|
/* Paints an entry in an editable option menu */
|
|
|
|
MOZ_GTK_DROPDOWN_ENTRY,
|
2016-05-13 02:59:17 +03:00
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints the background of a GtkHandleBox. */
|
|
|
|
MOZ_GTK_TOOLBAR,
|
2007-12-03 12:13:29 +03:00
|
|
|
/* Paints a toolbar separator */
|
|
|
|
MOZ_GTK_TOOLBAR_SEPARATOR,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a GtkToolTip */
|
|
|
|
MOZ_GTK_TOOLTIP,
|
|
|
|
/* Paints a GtkFrame (e.g. a status bar panel). */
|
|
|
|
MOZ_GTK_FRAME,
|
2016-07-25 17:32:12 +03:00
|
|
|
/* Paints the border of a GtkFrame */
|
|
|
|
MOZ_GTK_FRAME_BORDER,
|
2007-11-09 10:32:54 +03:00
|
|
|
/* Paints a resize grip for a GtkWindow */
|
|
|
|
MOZ_GTK_RESIZER,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a GtkProgressBar. */
|
|
|
|
MOZ_GTK_PROGRESSBAR,
|
2016-05-24 14:43:00 +03:00
|
|
|
/* Paints a trough (track) of a GtkProgressBar */
|
|
|
|
MOZ_GTK_PROGRESS_TROUGH,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a progress chunk of a GtkProgressBar. */
|
|
|
|
MOZ_GTK_PROGRESS_CHUNK,
|
2011-05-05 17:11:35 +04:00
|
|
|
/* Paints a progress chunk of an indeterminated GtkProgressBar. */
|
|
|
|
MOZ_GTK_PROGRESS_CHUNK_INDETERMINATE,
|
2011-05-16 14:59:10 +04:00
|
|
|
/* Paints a progress chunk of a vertical indeterminated GtkProgressBar. */
|
|
|
|
MOZ_GTK_PROGRESS_CHUNK_VERTICAL_INDETERMINATE,
|
2016-08-22 06:13:00 +03:00
|
|
|
/* Used as root style of whole GtkNotebook widget */
|
|
|
|
MOZ_GTK_NOTEBOOK,
|
|
|
|
/* Used as root style of active GtkNotebook area which contains tabs and arrows. */
|
|
|
|
MOZ_GTK_NOTEBOOK_HEADER,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints a tab of a GtkNotebook. flags is a GtkTabFlags, defined above. */
|
2016-08-22 06:13:00 +03:00
|
|
|
MOZ_GTK_TAB_TOP,
|
|
|
|
/* Paints a tab of a GtkNotebook. flags is a GtkTabFlags, defined above. */
|
|
|
|
MOZ_GTK_TAB_BOTTOM,
|
2005-08-20 11:13:04 +04:00
|
|
|
/* Paints the background and border of a GtkNotebook. */
|
2005-08-20 11:13:45 +04:00
|
|
|
MOZ_GTK_TABPANELS,
|
2008-02-15 08:28:44 +03:00
|
|
|
/* Paints a GtkArrow for a GtkNotebook. flags is a GtkArrowType. */
|
|
|
|
MOZ_GTK_TAB_SCROLLARROW,
|
2016-07-29 06:15:00 +03:00
|
|
|
/* Paints the expander and border of a GtkTreeView */
|
2007-11-07 12:14:58 +03:00
|
|
|
MOZ_GTK_TREEVIEW,
|
2016-07-29 06:15:00 +03:00
|
|
|
/* Paints the border of a GtkTreeView */
|
|
|
|
MOZ_GTK_TREEVIEW_VIEW,
|
2007-11-07 12:14:58 +03:00
|
|
|
/* Paints treeheader cells */
|
|
|
|
MOZ_GTK_TREE_HEADER_CELL,
|
2007-11-13 11:43:03 +03:00
|
|
|
/* Paints sort arrows in treeheader cells */
|
|
|
|
MOZ_GTK_TREE_HEADER_SORTARROW,
|
2008-01-03 10:07:32 +03:00
|
|
|
/* Paints an expander for a GtkTreeView */
|
|
|
|
MOZ_GTK_TREEVIEW_EXPANDER,
|
2005-08-20 11:13:48 +04:00
|
|
|
/* Paints the background of the menu bar. */
|
|
|
|
MOZ_GTK_MENUBAR,
|
|
|
|
/* Paints the background of menus, context menus. */
|
|
|
|
MOZ_GTK_MENUPOPUP,
|
2007-11-29 01:45:21 +03:00
|
|
|
/* Paints the arrow of menuitems that contain submenus */
|
|
|
|
MOZ_GTK_MENUARROW,
|
2010-07-27 18:57:47 +04:00
|
|
|
/* Paints an arrow in a toolbar button. flags is a GtkArrowType. */
|
2008-01-17 13:24:31 +03:00
|
|
|
MOZ_GTK_TOOLBARBUTTON_ARROW,
|
2016-05-19 07:55:04 +03:00
|
|
|
/* Paints items of menubar. */
|
|
|
|
MOZ_GTK_MENUBARITEM,
|
|
|
|
/* Paints items of popup menus. */
|
2005-08-20 11:13:48 +04:00
|
|
|
MOZ_GTK_MENUITEM,
|
2016-07-28 04:54:00 +03:00
|
|
|
MOZ_GTK_IMAGEMENUITEM,
|
|
|
|
MOZ_GTK_CHECKMENUITEM_CONTAINER,
|
|
|
|
MOZ_GTK_RADIOMENUITEM_CONTAINER,
|
2005-08-20 11:14:21 +04:00
|
|
|
MOZ_GTK_CHECKMENUITEM,
|
|
|
|
MOZ_GTK_RADIOMENUITEM,
|
2007-12-11 12:09:09 +03:00
|
|
|
MOZ_GTK_MENUSEPARATOR,
|
2016-07-29 06:30:00 +03:00
|
|
|
/* GtkVPaned base class */
|
2007-12-21 14:17:01 +03:00
|
|
|
MOZ_GTK_SPLITTER_HORIZONTAL,
|
2016-07-29 06:30:00 +03:00
|
|
|
/* GtkHPaned base class */
|
2007-12-21 14:17:01 +03:00
|
|
|
MOZ_GTK_SPLITTER_VERTICAL,
|
2016-07-29 06:30:00 +03:00
|
|
|
/* Paints a GtkVPaned separator */
|
|
|
|
MOZ_GTK_SPLITTER_SEPARATOR_HORIZONTAL,
|
|
|
|
/* Paints a GtkHPaned separator */
|
|
|
|
MOZ_GTK_SPLITTER_SEPARATOR_VERTICAL,
|
2005-08-20 11:13:45 +04:00
|
|
|
/* Paints the background of a window, dialog or page. */
|
2015-08-19 22:42:17 +03:00
|
|
|
MOZ_GTK_WINDOW,
|
2016-05-09 02:08:26 +03:00
|
|
|
/* Window container for all widgets */
|
|
|
|
MOZ_GTK_WINDOW_CONTAINER,
|
2015-08-19 22:42:17 +03:00
|
|
|
/* Paints a GtkInfoBar, for notifications. */
|
2016-05-09 02:08:26 +03:00
|
|
|
MOZ_GTK_INFO_BAR,
|
2016-10-19 05:13:25 +03:00
|
|
|
/* Used for widget tree construction. */
|
|
|
|
MOZ_GTK_COMBOBOX,
|
|
|
|
/* Paints a GtkComboBox button widget. */
|
|
|
|
MOZ_GTK_COMBOBOX_BUTTON,
|
|
|
|
/* Paints a GtkComboBox arrow widget. */
|
|
|
|
MOZ_GTK_COMBOBOX_ARROW,
|
|
|
|
/* Paints a GtkComboBox separator widget. */
|
|
|
|
MOZ_GTK_COMBOBOX_SEPARATOR,
|
|
|
|
/* Used for widget tree construction. */
|
|
|
|
MOZ_GTK_COMBOBOX_ENTRY,
|
|
|
|
/* Paints a GtkComboBox entry widget. */
|
|
|
|
MOZ_GTK_COMBOBOX_ENTRY_TEXTAREA,
|
|
|
|
/* Paints a GtkComboBox entry button widget. */
|
|
|
|
MOZ_GTK_COMBOBOX_ENTRY_BUTTON,
|
|
|
|
/* Paints a GtkComboBox entry arrow widget. */
|
|
|
|
MOZ_GTK_COMBOBOX_ENTRY_ARROW,
|
2016-07-25 07:46:00 +03:00
|
|
|
/* Used for scrolled window shell. */
|
|
|
|
MOZ_GTK_SCROLLED_WINDOW,
|
2016-05-09 02:08:26 +03:00
|
|
|
|
|
|
|
MOZ_GTK_WIDGET_NODE_COUNT
|
2016-04-14 08:47:20 +03:00
|
|
|
} WidgetNodeType;
|
2005-08-20 11:13:04 +04:00
|
|
|
|
|
|
|
/*** General library functions ***/
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
gint moz_gtk_init();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
gint moz_gtk_enable_style_props(style_prop_t styleGetProp);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
gint moz_gtk_shutdown();
|
|
|
|
|
2013-09-23 17:21:35 +04:00
|
|
|
#if (MOZ_WIDGET_GTK == 2)
|
2010-07-02 08:04:09 +04:00
|
|
|
/**
|
|
|
|
* Retrieves the colormap to use for drawables passed to moz_gtk_widget_paint.
|
|
|
|
*/
|
|
|
|
GdkColormap* moz_gtk_widget_get_colormap();
|
2012-02-10 17:15:28 +04:00
|
|
|
#endif
|
2005-08-20 11:13:04 +04:00
|
|
|
|
|
|
|
/*** Widget drawing ***/
|
2013-09-23 17:21:35 +04:00
|
|
|
#if (MOZ_WIDGET_GTK == 2)
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* Paint a widget in the current theme.
|
2007-12-14 10:26:03 +03:00
|
|
|
* widget: a constant giving the widget to paint
|
2010-07-02 08:04:09 +04:00
|
|
|
* drawable: the drawable to paint to;
|
|
|
|
* it's colormap must be moz_gtk_widget_get_colormap().
|
2007-12-14 10:26:03 +03:00
|
|
|
* 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.
|
2016-04-14 08:47:20 +03:00
|
|
|
* flags: widget-dependant flags; see the WidgetNodeType definition.
|
2007-12-14 10:26:03 +03:00
|
|
|
* direction: the text direction, to draw the widget correctly LTR and RTL.
|
2005-08-20 11:13:04 +04:00
|
|
|
*/
|
|
|
|
gint
|
2016-04-14 08:47:20 +03:00
|
|
|
moz_gtk_widget_paint(WidgetNodeType widget, GdkDrawable* drawable,
|
2005-08-20 11:13:04 +04:00
|
|
|
GdkRectangle* rect, GdkRectangle* cliprect,
|
2007-12-14 10:26:03 +03:00
|
|
|
GtkWidgetState* state, gint flags,
|
|
|
|
GtkTextDirection direction);
|
2012-02-10 17:15:28 +04:00
|
|
|
#else
|
|
|
|
gint
|
2016-04-14 08:47:20 +03:00
|
|
|
moz_gtk_widget_paint(WidgetNodeType widget, cairo_t *cr,
|
2013-02-20 17:50:51 +04:00
|
|
|
GdkRectangle* rect,
|
2012-02-10 17:15:28 +04:00
|
|
|
GtkWidgetState* state, gint flags,
|
|
|
|
GtkTextDirection direction);
|
|
|
|
#endif
|
2005-08-20 11:13:04 +04:00
|
|
|
|
|
|
|
|
|
|
|
/*** Widget metrics ***/
|
|
|
|
/**
|
|
|
|
* Get the border size of a widget
|
2007-06-05 07:26:43 +04:00
|
|
|
* left/right: [OUT] the widget's left/right border
|
|
|
|
* top/bottom: [OUT] the widget's top/bottom border
|
2007-12-14 10:26:03 +03:00
|
|
|
* direction: the text direction for the widget
|
2007-06-05 07:26:43 +04:00
|
|
|
* inhtml: boolean indicating whether this widget will be drawn as a HTML form control,
|
|
|
|
* in order to workaround a size issue (MOZ_GTK_BUTTON only, ignored otherwise)
|
2005-08-20 11:13:04 +04:00
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
2016-04-14 08:47:20 +03:00
|
|
|
gint moz_gtk_get_widget_border(WidgetNodeType widget, gint* left, gint* top,
|
2007-12-14 10:26:03 +03:00
|
|
|
gint* right, gint* bottom, GtkTextDirection direction,
|
|
|
|
gboolean inhtml);
|
2005-08-20 11:13:04 +04:00
|
|
|
|
2014-09-04 07:17:00 +04:00
|
|
|
/**
|
|
|
|
* Get the border size of a notebook tab
|
|
|
|
* left/right: [OUT] the tab's left/right border
|
|
|
|
* top/bottom: [OUT] the tab's top/bottom border
|
|
|
|
* direction: the text direction for the widget
|
|
|
|
* flags: tab-dependant flags; see the GtkTabFlags definition.
|
2016-08-22 06:13:00 +03:00
|
|
|
* widget: tab widget
|
2014-09-04 07:17:00 +04:00
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom,
|
2016-08-22 06:13:00 +03:00
|
|
|
GtkTextDirection direction, GtkTabFlags flags,
|
|
|
|
WidgetNodeType widget);
|
2014-09-04 07:17:00 +04:00
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
gint
|
2005-08-20 11:12:34 +04:00
|
|
|
moz_gtk_checkbox_get_metrics(gint* indicator_size, gint* indicator_spacing);
|
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2005-08-20 11:14:00 +04:00
|
|
|
gint
|
|
|
|
moz_gtk_radio_get_metrics(gint* indicator_size, gint* indicator_spacing);
|
|
|
|
|
2014-06-14 16:48:08 +04:00
|
|
|
/** Get the extra size for the focus ring for outline:auto.
|
|
|
|
* widget: [IN] the widget to get the focus metrics for
|
|
|
|
* focus_h_width: [OUT] the horizontal width
|
|
|
|
* focus_v_width: [OUT] the vertical width
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
moz_gtk_get_focus_outline_size(gint* focus_h_width, gint* focus_v_width);
|
|
|
|
|
2011-06-25 01:00:46 +04:00
|
|
|
/** Get the horizontal padding for the menuitem widget or checkmenuitem widget.
|
|
|
|
* horizontal_padding: [OUT] The left and right padding of the menuitem or checkmenuitem
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
moz_gtk_menuitem_get_horizontal_padding(gint* horizontal_padding);
|
|
|
|
|
|
|
|
gint
|
|
|
|
moz_gtk_checkmenuitem_get_horizontal_padding(gint* horizontal_padding);
|
|
|
|
|
2009-06-15 01:56:37 +04:00
|
|
|
/**
|
|
|
|
* Some GTK themes draw their indication for the default button outside
|
|
|
|
* the button (e.g. the glow in New Wave). This gets the extra space necessary.
|
|
|
|
*
|
|
|
|
* border_top: [OUT] extra space to add above
|
|
|
|
* border_left: [OUT] extra space to add to the left
|
|
|
|
* border_bottom: [OUT] extra space to add underneath
|
|
|
|
* border_right: [OUT] extra space to add to the right
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint
|
2009-07-04 14:01:16 +04:00
|
|
|
moz_gtk_button_get_default_overflow(gint* border_top, gint* border_left,
|
|
|
|
gint* border_bottom, gint* border_right);
|
2009-06-15 01:56:37 +04:00
|
|
|
|
2015-07-30 12:29:00 +03:00
|
|
|
/**
|
|
|
|
* Gets the minimum size of a GtkScale.
|
|
|
|
* orient: [IN] the scale orientation
|
|
|
|
* scale_width: [OUT] the width of the scale
|
|
|
|
* scale_height: [OUT] the height of the scale
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width,
|
|
|
|
gint* scale_height);
|
|
|
|
|
2006-05-30 17:50:48 +04:00
|
|
|
/**
|
|
|
|
* Get the desired size of a GtkScale thumb
|
|
|
|
* orient: [IN] the scale orientation
|
|
|
|
* thumb_length: [OUT] the length of the thumb
|
|
|
|
* thumb_height: [OUT] the height of the thumb
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
moz_gtk_get_scalethumb_metrics(GtkOrientation orient, gint* thumb_length, gint* thumb_height);
|
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* Get the desired metrics for a GtkScrollbar
|
2005-08-20 11:14:00 +04:00
|
|
|
* metrics: [IN] struct which will contain the metrics
|
2005-08-20 11:13:04 +04:00
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint
|
2005-08-20 11:14:00 +04:00
|
|
|
moz_gtk_get_scrollbar_metrics(MozGtkScrollbarMetrics* metrics);
|
2005-08-20 11:12:11 +04:00
|
|
|
|
2005-08-20 11:13:04 +04:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2008-03-12 13:54:22 +03:00
|
|
|
gint moz_gtk_get_combo_box_entry_button_size(gint* width, gint* height);
|
2005-08-20 11:12:58 +04:00
|
|
|
|
2008-02-15 08:28:44 +03:00
|
|
|
/**
|
|
|
|
* Get the desired size of a scroll arrow widget
|
|
|
|
* width: [OUT] the desired width
|
|
|
|
* height: [OUT] the desired height
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height);
|
|
|
|
|
2008-03-12 20:27:03 +03:00
|
|
|
/**
|
2010-07-27 18:57:47 +04:00
|
|
|
* Get the desired size of an arrow in a button
|
2008-03-12 20:27:03 +03:00
|
|
|
*
|
2016-03-01 03:12:03 +03:00
|
|
|
* widgetType: [IN] the widget for which to get the arrow size
|
|
|
|
* width: [OUT] the desired width
|
|
|
|
* height: [OUT] the desired height
|
2008-03-12 20:27:03 +03:00
|
|
|
*/
|
2016-03-01 03:12:03 +03:00
|
|
|
void
|
2016-04-14 08:47:20 +03:00
|
|
|
moz_gtk_get_arrow_size(WidgetNodeType widgetType,
|
2016-03-01 03:12:03 +03:00
|
|
|
gint* width, gint* height);
|
2008-03-12 20:27:03 +03:00
|
|
|
|
2016-04-01 05:43:00 +03:00
|
|
|
/**
|
|
|
|
* Get the minimum height of a entry widget
|
|
|
|
* size: [OUT] the minimum height
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void moz_gtk_get_entry_min_height(gint* height);
|
|
|
|
|
2007-12-03 12:13:29 +03:00
|
|
|
/**
|
|
|
|
* Get the desired size of a toolbar separator
|
|
|
|
* size: [OUT] the desired width
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint moz_gtk_get_toolbar_separator_width(gint* size);
|
|
|
|
|
2007-11-15 06:47:16 +03:00
|
|
|
/**
|
2008-01-03 10:07:32 +03:00
|
|
|
* Get the size of a regular GTK expander that shows/hides content
|
2007-11-15 06:47:16 +03:00
|
|
|
* size: [OUT] the size of the GTK expander, size = width = height.
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint moz_gtk_get_expander_size(gint* size);
|
|
|
|
|
2008-01-03 10:07:32 +03:00
|
|
|
/**
|
|
|
|
* Get the size of a treeview's expander (we call them twisties)
|
|
|
|
* size: [OUT] the size of the GTK expander, size = width = height.
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint moz_gtk_get_treeview_expander_size(gint* size);
|
|
|
|
|
2007-12-11 12:09:09 +03:00
|
|
|
/**
|
|
|
|
* Get the desired height of a menu separator
|
|
|
|
* size: [OUT] the desired height
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint moz_gtk_get_menu_separator_height(gint* size);
|
|
|
|
|
2007-12-21 14:17:01 +03:00
|
|
|
/**
|
|
|
|
* Get the desired size of a splitter
|
|
|
|
* orientation: [IN] GTK_ORIENTATION_HORIZONTAL or GTK_ORIENTATION_VERTICAL
|
|
|
|
* size: [OUT] width or height of the splitter handle
|
|
|
|
*
|
|
|
|
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
|
|
|
|
*/
|
|
|
|
gint moz_gtk_splitter_get_metrics(gint orientation, gint* size);
|
|
|
|
|
2006-05-02 03:23:33 +04:00
|
|
|
/**
|
|
|
|
* Retrieve an actual GTK scrollbar widget for style analysis. It will not
|
|
|
|
* be modified.
|
|
|
|
*/
|
|
|
|
GtkWidget* moz_gtk_get_scrollbar_widget(void);
|
|
|
|
|
2007-12-21 14:51:48 +03:00
|
|
|
/**
|
|
|
|
* Get the YTHICKNESS of a tab (notebook extension).
|
|
|
|
*/
|
2016-08-22 06:13:00 +03:00
|
|
|
gint
|
|
|
|
moz_gtk_get_tab_thickness(WidgetNodeType aNodeType);
|
2007-12-21 14:51:48 +03:00
|
|
|
|
2015-06-17 14:27:00 +03:00
|
|
|
/**
|
|
|
|
* Get a boolean which indicates whether the theme draws scrollbar buttons.
|
|
|
|
* If TRUE, draw scrollbar buttons.
|
|
|
|
*/
|
|
|
|
gboolean moz_gtk_has_scrollbar_buttons(void);
|
|
|
|
|
Bug 1289148 - Fixing scrollbar metrics for GTK >= 3.20 r=karlt
The Gtk 3.20 scrollbars has moved towards usual box model. The scrollbar,
trough,thumb and scrollbar button can now have margin, padding and border set,
different for each direction (ie. left, right, bottom, top). The scrollbar
metrics become ignored in Gtk 3.20 and later.
* Draw scrollbar element [for GTK 3.20+]
* The border for scrollbar, trough, thumb and scrollbar buttons is newly
calculated as margin+padding+border [for GTK 3.20+].
* The margin is subtracted for scrollbar, trough and sb buttons during paint
function [for GTK 3.6+]
* All scrollbar widget's borders transfered from
nsNativeThemeGTK::GetWidgetBorder to the moz_gtk_get_widget_border.
* Added helper function NativeThemeToGtkTheme for mapping mozilla's widget type
to the gtk widget type.
* Scrollbar troughs are now drawn even when there is not enough room for
the thumb [GTK 3.20+]
MozReview-Commit-ID: jd2q67gKM1
--HG--
extra : rebase_source : ecc8b85401845113d84c6c5a48219a0c3d4f8de3
2016-10-17 01:37:13 +03:00
|
|
|
/**
|
|
|
|
* Get minimum widget size as sum of margin, padding, border and min-width,
|
|
|
|
* min-height.
|
|
|
|
*/
|
|
|
|
void moz_gtk_get_widget_min_size(WidgetNodeType aGtkWidgetType, int* width,
|
|
|
|
int* height);
|
|
|
|
|
2016-03-23 05:49:00 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 2)
|
2005-08-20 11:12:11 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
2016-03-23 05:49:00 +03:00
|
|
|
#endif
|
2005-08-20 11:12:11 +04:00
|
|
|
|
2005-08-20 11:11:46 +04:00
|
|
|
#endif
|