[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:18:39 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 0879f660a88d19b3b9d0d3bd69497a686f5d9fa3
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 6 17:04:39 2010 +0000
2010-10-06 Carlos Garcia Campos <cgarcia at igalia.com>
Reviewed by Martin Robinson.
[GTK] Remove unused code from gtk2drawing.c
https://bugs.webkit.org/show_bug.cgi?id=47086
gtk2drawing.c was copied from mozilla and contains a lot of code that is not
used by WebKit. Most of that unused code is uncompatible with gtk3, so
removing it will make easier porting to gtk3.
* platform/gtk/gtk2drawing.c:
(moz_gtk_get_widget_border):
(moz_gtk_widget_paint):
(moz_gtk_destroy_theme_parts_widgets):
* platform/gtk/gtkdrawing.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ebe05bf..8c8c110 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,22 @@
2010-10-06 Carlos Garcia Campos <cgarcia at igalia.com>
+ Reviewed by Martin Robinson.
+
+ [GTK] Remove unused code from gtk2drawing.c
+ https://bugs.webkit.org/show_bug.cgi?id=47086
+
+ gtk2drawing.c was copied from mozilla and contains a lot of code that is not
+ used by WebKit. Most of that unused code is uncompatible with gtk3, so
+ removing it will make easier porting to gtk3.
+
+ * platform/gtk/gtk2drawing.c:
+ (moz_gtk_get_widget_border):
+ (moz_gtk_widget_paint):
+ (moz_gtk_destroy_theme_parts_widgets):
+ * platform/gtk/gtkdrawing.h:
+
+2010-10-06 Carlos Garcia Campos <cgarcia at igalia.com>
+
Reviewed by Xan Lopez.
[GTK] Use pixbufs instead of pixmaps when creating platform cursors
diff --git a/WebCore/platform/gtk/gtk2drawing.c b/WebCore/platform/gtk/gtk2drawing.c
index dfc5924..246eeb5 100644
--- a/WebCore/platform/gtk/gtk2drawing.c
+++ b/WebCore/platform/gtk/gtk2drawing.c
@@ -122,26 +122,6 @@ ensure_button_widget()
}
static gint
-ensure_hpaned_widget()
-{
- if (!gParts->hpanedWidget) {
- gParts->hpanedWidget = gtk_hpaned_new();
- setup_widget_prototype(gParts->hpanedWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_vpaned_widget()
-{
- if (!gParts->vpanedWidget) {
- gParts->vpanedWidget = gtk_vpaned_new();
- setup_widget_prototype(gParts->vpanedWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
ensure_toggle_button_widget()
{
if (!gParts->toggleButtonWidget) {
@@ -201,16 +181,6 @@ ensure_scrollbar_widget()
}
static gint
-ensure_spin_widget()
-{
- if (!gParts->spinWidget) {
- gParts->spinWidget = gtk_spin_button_new(NULL, 1, 0);
- setup_widget_prototype(gParts->spinWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
ensure_scale_widget()
{
if (!gParts->hScaleWidget) {
@@ -337,171 +307,6 @@ ensure_combo_box_widgets()
return MOZ_GTK_SUCCESS;
}
-/* We need to have pointers to the inner widgets (entry, button, arrow) of
- * the ComboBoxEntry to get the correct rendering from theme engines which
- * special cases their look. Since the inner layout can change, we ask GTK
- * to NULL our pointers when they are about to become invalid because the
- * corresponding widgets don't exist anymore. It's the role of
- * g_object_add_weak_pointer().
- * Note that if we don't find the inner widgets (which shouldn't happen), we
- * fallback to use generic "non-inner" widgets, and they don't need that kind
- * of weak pointer since they are explicit children of gParts->protoWindow and as
- * such GTK holds a strong reference to them. */
-static void
-moz_gtk_get_combo_box_entry_inner_widgets(GtkWidget *widget,
- gpointer client_data)
-{
- if (GTK_IS_TOGGLE_BUTTON(widget)) {
- gParts->comboBoxEntryButtonWidget = widget;
- g_object_add_weak_pointer(G_OBJECT(widget),
- (gpointer) &gParts->comboBoxEntryButtonWidget);
- } else if (GTK_IS_ENTRY(widget)) {
- gParts->comboBoxEntryTextareaWidget = widget;
- g_object_add_weak_pointer(G_OBJECT(widget),
- (gpointer) &gParts->comboBoxEntryTextareaWidget);
- } else
- return;
- gtk_widget_realize(widget);
- g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
-}
-
-static void
-moz_gtk_get_combo_box_entry_arrow(GtkWidget *widget, gpointer client_data)
-{
- if (GTK_IS_ARROW(widget)) {
- gParts->comboBoxEntryArrowWidget = widget;
- g_object_add_weak_pointer(G_OBJECT(widget),
- (gpointer) &gParts->comboBoxEntryArrowWidget);
- gtk_widget_realize(widget);
- g_object_set_data(G_OBJECT(widget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
-}
-
-static gint
-ensure_combo_box_entry_widgets()
-{
- GtkWidget* buttonChild;
-
- if (gParts->comboBoxEntryTextareaWidget &&
- gParts->comboBoxEntryButtonWidget &&
- gParts->comboBoxEntryArrowWidget)
- return MOZ_GTK_SUCCESS;
-
- /* Create a ComboBoxEntry if needed */
- if (!gParts->comboBoxEntryWidget) {
- gParts->comboBoxEntryWidget = gtk_combo_box_entry_new();
- setup_widget_prototype(gParts->comboBoxEntryWidget);
- }
-
- /* Get its inner Entry and Button */
- gtk_container_forall(GTK_CONTAINER(gParts->comboBoxEntryWidget),
- moz_gtk_get_combo_box_entry_inner_widgets,
- NULL);
-
- if (!gParts->comboBoxEntryTextareaWidget) {
- ensure_entry_widget();
- gParts->comboBoxEntryTextareaWidget = gParts->entryWidget;
- }
-
- if (gParts->comboBoxEntryButtonWidget) {
- /* Get the Arrow inside the Button */
- buttonChild = gtk_bin_get_child(GTK_BIN(gParts->comboBoxEntryButtonWidget));
- if (GTK_IS_HBOX(buttonChild)) {
- /* appears-as-list = FALSE, cell-view = TRUE; the button
- * contains an hbox. This hbox is there because ComboBoxEntry
- * inherits from ComboBox which needs to place a cell renderer,
- * a separator, and an arrow in the button when appears-as-list
- * is FALSE. Here the hbox should only contain an arrow, since
- * a ComboBoxEntry doesn't need all those widgets in the
- * button. */
- gtk_container_forall(GTK_CONTAINER(buttonChild),
- moz_gtk_get_combo_box_entry_arrow,
- NULL);
- } else if(GTK_IS_ARROW(buttonChild)) {
- /* appears-as-list = TRUE, or cell-view = FALSE;
- * the button only contains an arrow */
- gParts->comboBoxEntryArrowWidget = buttonChild;
- g_object_add_weak_pointer(G_OBJECT(buttonChild), (gpointer)
- &gParts->comboBoxEntryArrowWidget);
- gtk_widget_realize(gParts->comboBoxEntryArrowWidget);
- g_object_set_data(G_OBJECT(gParts->comboBoxEntryArrowWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- } else {
- /* Shouldn't be reached with current internal gtk implementation;
- * we use a generic toggle button as last resort fallback to avoid
- * crashing. */
- ensure_toggle_button_widget();
- gParts->comboBoxEntryButtonWidget = gParts->toggleButtonWidget;
- }
-
- if (!gParts->comboBoxEntryArrowWidget) {
- /* Shouldn't be reached with current internal gtk implementation;
- * we gParts->buttonArrowWidget as last resort fallback to avoid
- * crashing. */
- ensure_button_arrow_widget();
- gParts->comboBoxEntryArrowWidget = gParts->buttonArrowWidget;
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-
-static gint
-ensure_handlebox_widget()
-{
- if (!gParts->handleBoxWidget) {
- gParts->handleBoxWidget = gtk_handle_box_new();
- setup_widget_prototype(gParts->handleBoxWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_toolbar_widget()
-{
- if (!gParts->toolbarWidget) {
- ensure_handlebox_widget();
- gParts->toolbarWidget = gtk_toolbar_new();
- gtk_container_add(GTK_CONTAINER(gParts->handleBoxWidget), gParts->toolbarWidget);
- gtk_widget_realize(gParts->toolbarWidget);
- g_object_set_data(G_OBJECT(gParts->toolbarWidget), "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_toolbar_separator_widget()
-{
- if (!gParts->toolbarSeparatorWidget) {
- ensure_toolbar_widget();
- gParts->toolbarSeparatorWidget = GTK_WIDGET(gtk_separator_tool_item_new());
- setup_widget_prototype(gParts->toolbarSeparatorWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_tooltip_widget()
-{
- if (!gParts->tooltipWidget) {
- gParts->tooltipWidget = gtk_window_new(GTK_WINDOW_POPUP);
- gtk_widget_realize(gParts->tooltipWidget);
- moz_gtk_set_widget_name(gParts->tooltipWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_tab_widget()
-{
- if (!gParts->tabWidget) {
- gParts->tabWidget = gtk_notebook_new();
- setup_widget_prototype(gParts->tabWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
static gint
ensure_progress_widget()
{
@@ -513,200 +318,6 @@ ensure_progress_widget()
}
static gint
-ensure_statusbar_widget()
-{
- if (!gParts->statusbarWidget) {
- gParts->statusbarWidget = gtk_statusbar_new();
- setup_widget_prototype(gParts->statusbarWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_frame_widget()
-{
- if (!gParts->frameWidget) {
- ensure_statusbar_widget();
- gParts->frameWidget = gtk_frame_new(NULL);
- gtk_container_add(GTK_CONTAINER(gParts->statusbarWidget), gParts->frameWidget);
- gtk_widget_realize(gParts->frameWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_menu_bar_widget()
-{
- if (!gParts->menuBarWidget) {
- gParts->menuBarWidget = gtk_menu_bar_new();
- setup_widget_prototype(gParts->menuBarWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_menu_bar_item_widget()
-{
- if (!gParts->menuBarItemWidget) {
- ensure_menu_bar_widget();
- gParts->menuBarItemWidget = gtk_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(gParts->menuBarWidget),
- gParts->menuBarItemWidget);
- gtk_widget_realize(gParts->menuBarItemWidget);
- g_object_set_data(G_OBJECT(gParts->menuBarItemWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_menu_popup_widget()
-{
- if (!gParts->menuPopupWidget) {
- ensure_menu_bar_item_widget();
- gParts->menuPopupWidget = gtk_menu_new();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(gParts->menuBarItemWidget),
- gParts->menuPopupWidget);
- gtk_widget_realize(gParts->menuPopupWidget);
- g_object_set_data(G_OBJECT(gParts->menuPopupWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_menu_item_widget()
-{
- if (!gParts->menuItemWidget) {
- ensure_menu_popup_widget();
- gParts->menuItemWidget = gtk_menu_item_new_with_label("M");
- gtk_menu_shell_append(GTK_MENU_SHELL(gParts->menuPopupWidget),
- gParts->menuItemWidget);
- gtk_widget_realize(gParts->menuItemWidget);
- g_object_set_data(G_OBJECT(gParts->menuItemWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_image_menu_item_widget()
-{
- if (!gParts->imageMenuItemWidget) {
- ensure_menu_popup_widget();
- gParts->imageMenuItemWidget = gtk_image_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(gParts->menuPopupWidget),
- gParts->imageMenuItemWidget);
- gtk_widget_realize(gParts->imageMenuItemWidget);
- g_object_set_data(G_OBJECT(gParts->imageMenuItemWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_menu_separator_widget()
-{
- if (!gParts->menuSeparatorWidget) {
- ensure_menu_popup_widget();
- gParts->menuSeparatorWidget = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(gParts->menuPopupWidget),
- gParts->menuSeparatorWidget);
- gtk_widget_realize(gParts->menuSeparatorWidget);
- g_object_set_data(G_OBJECT(gParts->menuSeparatorWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_check_menu_item_widget()
-{
- if (!gParts->checkMenuItemWidget) {
- ensure_menu_popup_widget();
- gParts->checkMenuItemWidget = gtk_check_menu_item_new_with_label("M");
- gtk_menu_shell_append(GTK_MENU_SHELL(gParts->menuPopupWidget),
- gParts->checkMenuItemWidget);
- gtk_widget_realize(gParts->checkMenuItemWidget);
- g_object_set_data(G_OBJECT(gParts->checkMenuItemWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_tree_view_widget()
-{
- if (!gParts->treeViewWidget) {
- gParts->treeViewWidget = gtk_tree_view_new();
- setup_widget_prototype(gParts->treeViewWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_tree_header_cell_widget()
-{
- if(!gParts->treeHeaderCellWidget) {
- /*
- * Some GTK engines paint the first and last cell
- * of a TreeView header with a highlight.
- * Since we do not know where our widget will be relative
- * to the other buttons in the TreeView header, we must
- * paint it as a button that is between two others,
- * thus ensuring it is neither the first or last button
- * in the header.
- * GTK doesn't give us a way to do this explicitly,
- * so we must paint with a button that is between two
- * others.
- */
-
- GtkTreeViewColumn* firstTreeViewColumn;
- GtkTreeViewColumn* lastTreeViewColumn;
-
- ensure_tree_view_widget();
-
- /* Create and append our three columns */
- firstTreeViewColumn = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(firstTreeViewColumn, "M");
- gtk_tree_view_append_column(GTK_TREE_VIEW(gParts->treeViewWidget), firstTreeViewColumn);
-
- gParts->middleTreeViewColumn = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(gParts->middleTreeViewColumn, "M");
- gtk_tree_view_append_column(GTK_TREE_VIEW(gParts->treeViewWidget),
- gParts->middleTreeViewColumn);
-
- lastTreeViewColumn = gtk_tree_view_column_new();
- gtk_tree_view_column_set_title(lastTreeViewColumn, "M");
- gtk_tree_view_append_column(GTK_TREE_VIEW(gParts->treeViewWidget), lastTreeViewColumn);
-
-#ifdef GTK_API_VERSION_2
- /* Use the middle column's header for our button */
- gParts->treeHeaderCellWidget = gParts->middleTreeViewColumn->button;
- gParts->treeHeaderSortArrowWidget = gParts->middleTreeViewColumn->arrow;
-#else
- gParts->treeHeaderCellWidget = gtk_button_new();
- gParts->treeHeaderSortArrowWidget = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
-#endif
- g_object_set_data(G_OBJECT(gParts->treeHeaderCellWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- g_object_set_data(G_OBJECT(gParts->treeHeaderSortArrowWidget),
- "transparent-bg-hint", GINT_TO_POINTER(TRUE));
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-ensure_expander_widget()
-{
- if (!gParts->expanderWidget) {
- gParts->expanderWidget = gtk_expander_new("M");
- setup_widget_prototype(gParts->expanderWidget);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
ensure_scrolled_window_widget()
{
if (!gParts->scrolledWindowWidget) {
@@ -912,19 +523,6 @@ moz_gtk_widget_get_focus(GtkWidget* widget, gboolean* interior_focus,
}
gint
-moz_gtk_splitter_get_metrics(gint orientation, gint* size)
-{
- if (orientation == GTK_ORIENTATION_HORIZONTAL) {
- ensure_hpaned_widget();
- gtk_widget_style_get(gParts->hpanedWidget, "handle_size", size, NULL);
- } else {
- ensure_vpaned_widget();
- gtk_widget_style_get(gParts->vpanedWidget, "handle_size", size, NULL);
- }
- return MOZ_GTK_SUCCESS;
-}
-
-gint
moz_gtk_button_get_inner_border(GtkWidget* widget, GtkBorder* inner_border)
{
static const GtkBorder default_inner_border = { 1, 1, 1, 1 };
@@ -1339,59 +937,6 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget,
}
static gint
-moz_gtk_spin_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GtkTextDirection direction)
-{
- GtkStyle* style;
-
- ensure_spin_widget();
- gtk_widget_set_direction(gParts->spinWidget, direction);
- style = gtk_widget_get_style(gParts->spinWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, NULL,
- gParts->spinWidget, "spinbutton",
- rect->x, rect->y, rect->width, rect->height);
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_spin_updown_paint(GdkDrawable* drawable, GdkRectangle* rect,
- gboolean isDown, GtkWidgetState* state,
- GtkTextDirection direction)
-{
- GdkRectangle arrow_rect;
- GtkStateType state_type = ConvertGtkState(state);
- GtkShadowType shadow_type = state_type == GTK_STATE_ACTIVE ?
- GTK_SHADOW_IN : GTK_SHADOW_OUT;
- GtkStyle* style;
-
- ensure_spin_widget();
- style = gtk_widget_get_style(gParts->spinWidget);
- gtk_widget_set_direction(gParts->spinWidget, direction);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_box(style, drawable, state_type, shadow_type, NULL, gParts->spinWidget,
- isDown ? "spinbutton_down" : "spinbutton_up",
- rect->x, rect->y, rect->width, rect->height);
-
- /* hard code these values */
- arrow_rect.width = 6;
- arrow_rect.height = 6;
- arrow_rect.x = rect->x + (rect->width - arrow_rect.width) / 2;
- arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2;
- arrow_rect.y += isDown ? -1 : 1;
-
- gtk_paint_arrow(style, drawable, state_type, shadow_type, NULL,
- gParts->spinWidget, "spinbutton",
- isDown ? GTK_ARROW_DOWN : GTK_ARROW_UP, TRUE,
- arrow_rect.x, arrow_rect.y,
- arrow_rect.width, arrow_rect.height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
moz_gtk_scale_paint(GdkDrawable* drawable, GdkRectangle* rect,
GdkRectangle* cliprect, GtkWidgetState* state,
GtkOrientation flags, GtkTextDirection direction)
@@ -1469,76 +1014,6 @@ moz_gtk_scale_thumb_paint(GdkDrawable* drawable, GdkRectangle* rect,
}
static gint
-moz_gtk_gripper_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkTextDirection direction)
-{
- GtkStateType state_type = ConvertGtkState(state);
- GtkShadowType shadow_type;
- GtkStyle* style;
-
- ensure_handlebox_widget();
- gtk_widget_set_direction(gParts->handleBoxWidget, direction);
-
- style = gtk_widget_get_style(gParts->handleBoxWidget);
- shadow_type = gtk_handle_box_get_shadow_type(GTK_HANDLE_BOX(gParts->handleBoxWidget));
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_box(style, drawable, state_type, shadow_type, cliprect,
- gParts->handleBoxWidget, "handlebox_bin", rect->x, rect->y,
- rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_hpaned_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state)
-{
- GtkStateType hpaned_state = ConvertGtkState(state);
-
- ensure_hpaned_widget();
- gtk_paint_handle(gtk_widget_get_style(gParts->hpanedWidget), drawable, hpaned_state,
- GTK_SHADOW_NONE, cliprect, gParts->hpanedWidget, "paned",
- rect->x, rect->y, rect->width, rect->height,
- GTK_ORIENTATION_VERTICAL);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_vpaned_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state)
-{
- GtkStateType vpaned_state = ConvertGtkState(state);
-
- ensure_vpaned_widget();
- gtk_paint_handle(gtk_widget_get_style(gParts->vpanedWidget), drawable, vpaned_state,
- GTK_SHADOW_NONE, cliprect, gParts->vpanedWidget, "paned",
- rect->x, rect->y, rect->width, rect->height,
- GTK_ORIENTATION_HORIZONTAL);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_caret_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GdkRectangle location = *rect;
- if (direction == GTK_TEXT_DIR_RTL) {
- /* gtk_draw_insertion_cursor ignores location.width */
- location.x = rect->x + rect->width;
- }
-
- ensure_entry_widget();
- gtk_draw_insertion_cursor(gParts->entryWidget, drawable, cliprect,
- &location, TRUE, direction, FALSE);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
moz_gtk_entry_paint(GdkDrawable* drawable, GdkRectangle* rect,
GdkRectangle* cliprect, GtkWidgetState* state,
GtkWidget* widget, GtkTextDirection direction)
@@ -1652,144 +1127,6 @@ moz_gtk_entry_paint(GdkDrawable* drawable, GdkRectangle* rect,
return MOZ_GTK_SUCCESS;
}
-static gint
-moz_gtk_treeview_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkTextDirection direction)
-{
- gint xthickness, ythickness;
-
- GtkStyle *style, *treeview_style;
- GtkStateType state_type;
-
- ensure_tree_view_widget();
- ensure_scrolled_window_widget();
-
- gtk_widget_set_direction(gParts->treeViewWidget, direction);
- gtk_widget_set_direction(gParts->scrolledWindowWidget, direction);
-
- /* only handle disabled and normal states, otherwise the whole background
- * area will be painted differently with other states */
- state_type = state->disabled ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL;
-
- /* In GTK the treeview sets the background of the window
- * which contains the cells to the treeview base color.
- * If we don't set it here the background color will not be correct.*/
- gtk_widget_modify_bg(gParts->treeViewWidget, state_type,
- >k_widget_get_style(gParts->treeViewWidget)->base[state_type]);
-
- style = gtk_widget_get_style(gParts->scrolledWindowWidget);
- xthickness = XTHICKNESS(style);
- ythickness = YTHICKNESS(style);
-
- treeview_style = gtk_widget_get_style(gParts->treeViewWidget);
- TSOffsetStyleGCs(treeview_style, rect->x, rect->y);
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- gtk_paint_flat_box(treeview_style, drawable, state_type,
- GTK_SHADOW_NONE, cliprect, gParts->treeViewWidget, "treeview",
- rect->x + xthickness, rect->y + ythickness,
- rect->width - 2 * xthickness,
- rect->height - 2 * ythickness);
-
- gtk_paint_shadow(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN,
- cliprect, gParts->scrolledWindowWidget, "scrolled_window",
- rect->x, rect->y, rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_tree_header_cell_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- gboolean isSorted, GtkTextDirection direction)
-{
- gtk_tree_view_column_set_sort_indicator(gParts->middleTreeViewColumn,
- isSorted);
-
- moz_gtk_button_paint(drawable, rect, cliprect, state, GTK_RELIEF_NORMAL,
- gParts->treeHeaderCellWidget, direction);
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_tree_header_sort_arrow_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect,
- GtkWidgetState* state, GtkArrowType flags,
- GtkTextDirection direction)
-{
- GdkRectangle arrow_rect;
- GtkStateType state_type = ConvertGtkState(state);
- GtkShadowType shadow_type = GTK_SHADOW_IN;
- GtkArrowType arrow_type = flags;
- GtkStyle* style;
-
- ensure_tree_header_cell_widget();
- gtk_widget_set_direction(gParts->treeHeaderSortArrowWidget, direction);
-
- /* hard code these values */
- arrow_rect.width = 11;
- arrow_rect.height = 11;
- arrow_rect.x = rect->x + (rect->width - arrow_rect.width) / 2;
- arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2;
-
- style = gtk_widget_get_style(gParts->treeHeaderSortArrowWidget);
- TSOffsetStyleGCs(style, arrow_rect.x, arrow_rect.y);
-
- gtk_paint_arrow(style, drawable, state_type, shadow_type, cliprect,
- gParts->treeHeaderSortArrowWidget, "arrow", arrow_type, TRUE,
- arrow_rect.x, arrow_rect.y,
- arrow_rect.width, arrow_rect.height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_treeview_expander_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkExpanderStyle expander_state,
- GtkTextDirection direction)
-{
- GtkStyle *style;
- GtkStateType state_type;
-
- ensure_tree_view_widget();
- gtk_widget_set_direction(gParts->treeViewWidget, direction);
-
- style = gtk_widget_get_style(gParts->treeViewWidget);
-
- /* Because the frame we get is of the entire treeview, we can't get the precise
- * event state of one expander, thus rendering hover and active feedback useless. */
- state_type = state->disabled ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL;
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_expander(style, drawable, state_type, cliprect, gParts->treeViewWidget, "treeview",
- rect->x + rect->width / 2, rect->y + rect->height / 2, expander_state);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_expander_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkExpanderStyle expander_state,
- GtkTextDirection direction)
-{
- GtkStyle *style;
- GtkStateType state_type = ConvertGtkState(state);
-
- ensure_expander_widget();
- gtk_widget_set_direction(gParts->expanderWidget, direction);
-
- style = gtk_widget_get_style(gParts->expanderWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_expander(style, drawable, state_type, cliprect, gParts->expanderWidget, "expander",
- rect->x + rect->width / 2, rect->y + rect->height / 2, expander_state);
-
- return MOZ_GTK_SUCCESS;
-}
-
static gint
moz_gtk_combo_box_paint(GdkDrawable* drawable, GdkRectangle* rect,
GdkRectangle* cliprect, GtkWidgetState* state,
@@ -1876,323 +1213,6 @@ moz_gtk_combo_box_paint(GdkDrawable* drawable, GdkRectangle* rect,
}
static gint
-moz_gtk_downarrow_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state)
-{
- GtkStyle* style;
- GtkStateType state_type = ConvertGtkState(state);
- GtkShadowType shadow_type = state->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
- GdkRectangle arrow_rect;
-
- ensure_button_arrow_widget();
- style = gtk_widget_get_style(gParts->buttonArrowWidget);
-
- calculate_arrow_rect(gParts->buttonArrowWidget, rect, &arrow_rect,
- GTK_TEXT_DIR_LTR);
-
- TSOffsetStyleGCs(style, arrow_rect.x, arrow_rect.y);
- gtk_paint_arrow(style, drawable, state_type, shadow_type, cliprect,
- gParts->buttonArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
- arrow_rect.x, arrow_rect.y, arrow_rect.width, arrow_rect.height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_combo_box_entry_button_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect,
- GtkWidgetState* state,
- gboolean input_focus,
- GtkTextDirection direction)
-{
- gint x_displacement, y_displacement;
- GdkRectangle arrow_rect, real_arrow_rect;
- GtkStateType state_type = ConvertGtkState(state);
- GtkShadowType shadow_type = state->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
- GtkStyle* style;
-
- ensure_combo_box_entry_widgets();
-
- if (input_focus) {
- /* Some themes draw a complementary focus ring for the dropdown button
- * when the dropdown entry has focus */
-#ifdef GTK_API_VERSION_2
- GTK_WIDGET_SET_FLAGS(gParts->comboBoxEntryTextareaWidget, GTK_HAS_FOCUS);
-#endif
- }
-
- moz_gtk_button_paint(drawable, rect, cliprect, state, GTK_RELIEF_NORMAL,
- gParts->comboBoxEntryButtonWidget, direction);
-
-#ifdef GTK_API_VERSION_2
- if (input_focus)
- GTK_WIDGET_UNSET_FLAGS(gParts->comboBoxEntryTextareaWidget, GTK_HAS_FOCUS);
-#endif
-
- calculate_button_inner_rect(gParts->comboBoxEntryButtonWidget,
- rect, &arrow_rect, direction, FALSE);
- if (state_type == GTK_STATE_ACTIVE) {
- gtk_widget_style_get(gParts->comboBoxEntryButtonWidget,
- "child-displacement-x", &x_displacement,
- "child-displacement-y", &y_displacement,
- NULL);
- arrow_rect.x += x_displacement;
- arrow_rect.y += y_displacement;
- }
-
- calculate_arrow_rect(gParts->comboBoxEntryArrowWidget,
- &arrow_rect, &real_arrow_rect, direction);
-
- style = gtk_widget_get_style(gParts->comboBoxEntryArrowWidget);
- TSOffsetStyleGCs(style, real_arrow_rect.x, real_arrow_rect.y);
-
- gtk_paint_arrow(style, drawable, state_type, shadow_type, cliprect,
- gParts->comboBoxEntryArrowWidget, "arrow", GTK_ARROW_DOWN, TRUE,
- real_arrow_rect.x, real_arrow_rect.y,
- real_arrow_rect.width, real_arrow_rect.height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_container_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- gboolean isradio, GtkTextDirection direction)
-{
- GtkStateType state_type = ConvertGtkState(state);
- GtkStyle* style;
- GtkWidget *widget;
- gboolean interior_focus;
- gint focus_width, focus_pad;
-
- if (isradio) {
- ensure_radiobutton_widget();
- widget = gParts->radiobuttonWidget;
- } else {
- ensure_checkbox_widget();
- widget = gParts->checkboxWidget;
- }
- gtk_widget_set_direction(widget, direction);
-
- style = gtk_widget_get_style(widget);
- moz_gtk_widget_get_focus(widget, &interior_focus, &focus_width,
- &focus_pad);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- /* The detail argument for the gtk_paint_* calls below are "checkbutton"
- even for radio buttons, to match what gtk does. */
-
- /* this is for drawing a prelight box */
- if (state_type == GTK_STATE_PRELIGHT || state_type == GTK_STATE_ACTIVE) {
- gtk_paint_flat_box(style, drawable, GTK_STATE_PRELIGHT,
- GTK_SHADOW_ETCHED_OUT, cliprect, widget,
- "checkbutton",
- rect->x, rect->y, rect->width, rect->height);
- }
-
- if (state_type != GTK_STATE_NORMAL && state_type != GTK_STATE_PRELIGHT)
- state_type = GTK_STATE_NORMAL;
-
- if (state->focused && !interior_focus) {
- gtk_paint_focus(style, drawable, state_type, cliprect, widget,
- "checkbutton",
- rect->x, rect->y, rect->width, rect->height);
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_toggle_label_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- gboolean isradio, GtkTextDirection direction)
-{
- GtkStateType state_type;
- GtkStyle *style;
- GtkWidget *widget;
- gboolean interior_focus;
-
- if (!state->focused)
- return MOZ_GTK_SUCCESS;
-
- if (isradio) {
- ensure_radiobutton_widget();
- widget = gParts->radiobuttonWidget;
- } else {
- ensure_checkbox_widget();
- widget = gParts->checkboxWidget;
- }
- gtk_widget_set_direction(widget, direction);
-
- gtk_widget_style_get(widget, "interior-focus", &interior_focus, NULL);
- if (!interior_focus)
- return MOZ_GTK_SUCCESS;
-
- state_type = ConvertGtkState(state);
-
- style = gtk_widget_get_style(widget);
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- /* Always "checkbutton" to match gtkcheckbutton.c */
- gtk_paint_focus(style, drawable, state_type, cliprect, widget,
- "checkbutton",
- rect->x, rect->y, rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_toolbar_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
- GtkShadowType shadow_type;
-
- ensure_toolbar_widget();
- gtk_widget_set_direction(gParts->toolbarWidget, direction);
-
- style = gtk_widget_get_style(gParts->toolbarWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- gtk_style_apply_default_background(style, drawable, TRUE,
- GTK_STATE_NORMAL,
- cliprect, rect->x, rect->y,
- rect->width, rect->height);
-
- gtk_widget_style_get(gParts->toolbarWidget, "shadow-type", &shadow_type, NULL);
-
- gtk_paint_box (style, drawable, GTK_STATE_NORMAL, shadow_type,
- cliprect, gParts->toolbarWidget, "toolbar",
- rect->x, rect->y, rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_toolbar_separator_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect,
- GtkTextDirection direction)
-{
- GtkStyle* style;
- gint separator_width;
- gint paint_width;
- gboolean wide_separators;
-
- /* Defined as constants in GTK+ 2.10.14 */
- const double start_fraction = 0.2;
- const double end_fraction = 0.8;
-
- ensure_toolbar_separator_widget();
- gtk_widget_set_direction(gParts->toolbarSeparatorWidget, direction);
-
- style = gtk_widget_get_style(gParts->toolbarSeparatorWidget);
-
- gtk_widget_style_get(gParts->toolbarWidget,
- "wide-separators", &wide_separators,
- "separator-width", &separator_width,
- NULL);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- if (wide_separators) {
- if (separator_width > rect->width)
- separator_width = rect->width;
-
- gtk_paint_box(style, drawable,
- GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT,
- cliprect, gParts->toolbarWidget, "vseparator",
- rect->x + (rect->width - separator_width) / 2,
- rect->y + rect->height * start_fraction,
- separator_width,
- rect->height * (end_fraction - start_fraction));
-
- } else {
- paint_width = style->xthickness;
-
- if (paint_width > rect->width)
- paint_width = rect->width;
-
- gtk_paint_vline(style, drawable,
- GTK_STATE_NORMAL, cliprect, gParts->toolbarSeparatorWidget,
- "toolbar",
- rect->y + rect->height * start_fraction,
- rect->y + rect->height * end_fraction,
- rect->x + (rect->width - paint_width) / 2);
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_tooltip_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
-
- ensure_tooltip_widget();
- gtk_widget_set_direction(gParts->tooltipWidget, direction);
-
- style = gtk_rc_get_style_by_paths(gtk_settings_get_default(),
- "gtk-tooltips", "GtkWindow",
- GTK_TYPE_WINDOW);
-
- style = gtk_style_attach(style, gtk_widget_get_window(gParts->tooltipWidget));
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_flat_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- cliprect, gParts->tooltipWidget, "tooltip",
- rect->x, rect->y, rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_resizer_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkTextDirection direction)
-{
- GtkStyle* style;
- GtkStateType state_type = ConvertGtkState(state);
-
- ensure_window_widget();
- gtk_widget_set_direction(gParts->protoWindow, direction);
-
- style = gtk_widget_get_style(gParts->protoWindow);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- gtk_paint_resize_grip(style, drawable, state_type, cliprect, gParts->protoWindow,
- NULL, (direction == GTK_TEXT_DIR_LTR) ?
- GDK_WINDOW_EDGE_SOUTH_EAST :
- GDK_WINDOW_EDGE_SOUTH_WEST,
- rect->x, rect->y, rect->width, rect->height);
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_frame_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
- GtkShadowType shadow_type;
-
- ensure_frame_widget();
- gtk_widget_set_direction(gParts->frameWidget, direction);
-
- style = gtk_widget_get_style(gParts->frameWidget);
-
- gtk_widget_style_get(gParts->statusbarWidget, "shadow-type", &shadow_type, NULL);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_shadow(style, drawable, GTK_STATE_NORMAL, shadow_type,
- cliprect, gParts->frameWidget, "frame", rect->x, rect->y,
- rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
moz_gtk_progressbar_paint(GdkDrawable* drawable, GdkRectangle* rect,
GdkRectangle* cliprect, GtkTextDirection direction)
{
@@ -2231,438 +1251,6 @@ moz_gtk_progress_chunk_paint(GdkDrawable* drawable, GdkRectangle* rect,
}
gint
-moz_gtk_get_tab_thickness(void)
-{
- GtkStyle* style;
-
- ensure_tab_widget();
- style = gtk_widget_get_style(gParts->tabWidget);
- if (YTHICKNESS(style) < 2)
- return 2; /* some themes don't set ythickness correctly */
-
- return YTHICKNESS(style);
-}
-
-static gint
-moz_gtk_tab_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTabFlags flags,
- GtkTextDirection direction)
-{
- /* When the tab isn't selected, we just draw a notebook extension.
- * When it is selected, we overwrite the adjacent border of the tabpanel
- * touching the tab with a pierced border (called "the gap") to make the
- * tab appear physically attached to the tabpanel; see details below. */
-
- GtkStyle* style;
-
- ensure_tab_widget();
- gtk_widget_set_direction(gParts->tabWidget, direction);
-
- style = gtk_widget_get_style(gParts->tabWidget);
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- if ((flags & MOZ_GTK_TAB_SELECTED) == 0) {
- /* Only draw the tab */
- gtk_paint_extension(style, drawable, GTK_STATE_ACTIVE, GTK_SHADOW_OUT,
- cliprect, gParts->tabWidget, "tab",
- rect->x, rect->y, rect->width, rect->height,
- (flags & MOZ_GTK_TAB_BOTTOM) ?
- GTK_POS_TOP : GTK_POS_BOTTOM );
- } else {
- /* Draw the tab and the gap
- * We want the gap to be positionned exactly on the tabpanel top
- * border; since tabbox.css may set a negative margin so that the tab
- * frame rect already overlaps the tabpanel frame rect, we need to take
- * that into account when drawing. To that effect, nsNativeThemeGTK
- * passes us this negative margin (bmargin in the graphic below) in the
- * lowest bits of |flags|. We use it to set gap_voffset, the distance
- * between the top of the gap and the bottom of the tab (resp. the
- * bottom of the gap and the top of the tab when we draw a bottom tab),
- * while ensuring that the gap always touches the border of the tab,
- * i.e. 0 <= gap_voffset <= gap_height, to avoid surprinsing results
- * with big negative or positive margins.
- * Here is a graphical explanation in the case of top tabs:
- * ___________________________
- * / \
- * | T A B |
- * ----------|. . . . . . . . . . . . . . .|----- top of tabpanel
- * : ^ bmargin : ^
- * : | (-negative margin, : |
- * bottom : v passed in flags) : | gap_height
- * of -> :.............................: | (the size of the
- * the tab . part of the gap . | tabpanel top border)
- * . outside of the tab . v
- * ----------------------------------------------
- *
- * To draw the gap, we use gtk_paint_box_gap(), see comment in
- * moz_gtk_tabpanels_paint(). This box_gap is made 3 * gap_height tall,
- * which should suffice to ensure that the only visible border is the
- * pierced one. If the tab is in the middle, we make the box_gap begin
- * a bit to the left of the tab and end a bit to the right, adjusting
- * the gap position so it still is under the tab, because we want the
- * rendering of a gap in the middle of a tabpanel. This is the role of
- * the gints gap_{l,r}_offset. On the contrary, if the tab is the
- * first, we align the start border of the box_gap with the start
- * border of the tab (left if LTR, right if RTL), by setting the
- * appropriate offset to 0.*/
- gint gap_loffset, gap_roffset, gap_voffset, gap_height;
-
- /* Get height needed by the gap */
- gap_height = moz_gtk_get_tab_thickness();
-
- /* Extract gap_voffset from the first bits of flags */
- gap_voffset = flags & MOZ_GTK_TAB_MARGIN_MASK;
- if (gap_voffset > gap_height)
- gap_voffset = gap_height;
-
- /* Set gap_{l,r}_offset to appropriate values */
- gap_loffset = gap_roffset = 20; /* should be enough */
- if (flags & MOZ_GTK_TAB_FIRST) {
- if (direction == GTK_TEXT_DIR_RTL)
- gap_roffset = 0;
- else
- gap_loffset = 0;
- }
-
- if (flags & MOZ_GTK_TAB_BOTTOM) {
- /* Enlarge the cliprect to have room for the full gap height */
- cliprect->height += gap_height - gap_voffset;
- cliprect->y -= gap_height - gap_voffset;
-
- /* Draw the tab */
- gtk_paint_extension(style, drawable, GTK_STATE_NORMAL,
- GTK_SHADOW_OUT, cliprect, gParts->tabWidget, "tab",
- rect->x, rect->y + gap_voffset, rect->width,
- rect->height - gap_voffset, GTK_POS_TOP);
-
- /* Draw the gap; erase with background color before painting in
- * case theme does not */
- gtk_style_apply_default_background(style, drawable, TRUE,
- GTK_STATE_NORMAL, cliprect,
- rect->x,
- rect->y + gap_voffset
- - gap_height,
- rect->width, gap_height);
- gtk_paint_box_gap(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- cliprect, gParts->tabWidget, "notebook",
- rect->x - gap_loffset,
- rect->y + gap_voffset - 3 * gap_height,
- rect->width + gap_loffset + gap_roffset,
- 3 * gap_height, GTK_POS_BOTTOM,
- gap_loffset, rect->width);
- } else {
- /* Enlarge the cliprect to have room for the full gap height */
- cliprect->height += gap_height - gap_voffset;
-
- /* Draw the tab */
- gtk_paint_extension(style, drawable, GTK_STATE_NORMAL,
- GTK_SHADOW_OUT, cliprect, gParts->tabWidget, "tab",
- rect->x, rect->y, rect->width,
- rect->height - gap_voffset, GTK_POS_BOTTOM);
-
- /* Draw the gap; erase with background color before painting in
- * case theme does not */
- gtk_style_apply_default_background(style, drawable, TRUE,
- GTK_STATE_NORMAL, cliprect,
- rect->x,
- rect->y + rect->height
- - gap_voffset,
- rect->width, gap_height);
- gtk_paint_box_gap(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- cliprect, gParts->tabWidget, "notebook",
- rect->x - gap_loffset,
- rect->y + rect->height - gap_voffset,
- rect->width + gap_loffset + gap_roffset,
- 3 * gap_height, GTK_POS_TOP,
- gap_loffset, rect->width);
- }
-
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_tabpanels_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- /* We use gtk_paint_box_gap() to draw the tabpanels widget. gtk_paint_box()
- * draws an all-purpose box, which a lot of themes render differently.
- * A zero-width gap is still visible in most themes, so we hide it to the
- * left (10px should be enough) */
- GtkStyle* style;
-
- ensure_tab_widget();
- gtk_widget_set_direction(gParts->tabWidget, direction);
-
- style = gtk_widget_get_style(gParts->tabWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_box_gap(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- cliprect, gParts->tabWidget, "notebook", rect->x, rect->y,
- rect->width, rect->height,
- GTK_POS_TOP, -10, 0);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_tab_scroll_arrow_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkArrowType arrow_type,
- GtkTextDirection direction)
-{
- GtkStateType state_type = ConvertGtkState(state);
- GtkShadowType shadow_type = state->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
- GtkStyle* style;
- gint arrow_size = MIN(rect->width, rect->height);
- gint x = rect->x + (rect->width - arrow_size) / 2;
- gint y = rect->y + (rect->height - arrow_size) / 2;
-
- ensure_tab_widget();
-
- style = gtk_widget_get_style(gParts->tabWidget);
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- if (direction == GTK_TEXT_DIR_RTL) {
- arrow_type = (arrow_type == GTK_ARROW_LEFT) ?
- GTK_ARROW_RIGHT : GTK_ARROW_LEFT;
- }
-
- gtk_paint_arrow(style, drawable, state_type, shadow_type, NULL,
- gParts->tabWidget, "notebook", arrow_type, TRUE,
- x, y, arrow_size, arrow_size);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_menu_bar_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
- GtkShadowType shadow_type;
- ensure_menu_bar_widget();
- gtk_widget_set_direction(gParts->menuBarWidget, direction);
-
- gtk_widget_style_get(gParts->menuBarWidget, "shadow-type", &shadow_type, NULL);
-
- style = gtk_widget_get_style(gParts->menuBarWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_style_apply_default_background(style, drawable, TRUE, GTK_STATE_NORMAL,
- cliprect, rect->x, rect->y,
- rect->width, rect->height);
-
- gtk_paint_box(style, drawable, GTK_STATE_NORMAL, shadow_type,
- cliprect, gParts->menuBarWidget, "menubar", rect->x, rect->y,
- rect->width, rect->height);
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_menu_popup_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
- ensure_menu_popup_widget();
- gtk_widget_set_direction(gParts->menuPopupWidget, direction);
-
- style = gtk_widget_get_style(gParts->menuPopupWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_style_apply_default_background(style, drawable, TRUE, GTK_STATE_NORMAL,
- cliprect, rect->x, rect->y,
- rect->width, rect->height);
- gtk_paint_box(style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_OUT,
- cliprect, gParts->menuPopupWidget, "menu",
- rect->x, rect->y, rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_menu_separator_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
- gboolean wide_separators;
- gint separator_height;
- guint horizontal_padding;
- gint paint_height;
-
- ensure_menu_separator_widget();
- gtk_widget_set_direction(gParts->menuSeparatorWidget, direction);
-
- style = gtk_widget_get_style(gParts->menuSeparatorWidget);
-
- gtk_widget_style_get(gParts->menuSeparatorWidget,
- "wide-separators", &wide_separators,
- "separator-height", &separator_height,
- "horizontal-padding", &horizontal_padding,
- NULL);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- if (wide_separators) {
- if (separator_height > rect->height)
- separator_height = rect->height;
-
- gtk_paint_box(style, drawable,
- GTK_STATE_NORMAL, GTK_SHADOW_ETCHED_OUT,
- cliprect, gParts->menuSeparatorWidget, "hseparator",
- rect->x + horizontal_padding + style->xthickness,
- rect->y + (rect->height - separator_height - style->ythickness) / 2,
- rect->width - 2 * (horizontal_padding + style->xthickness),
- separator_height);
- } else {
- paint_height = style->ythickness;
- if (paint_height > rect->height)
- paint_height = rect->height;
-
- gtk_paint_hline(style, drawable,
- GTK_STATE_NORMAL, cliprect, gParts->menuSeparatorWidget,
- "menuitem",
- rect->x + horizontal_padding + style->xthickness,
- rect->x + rect->width - horizontal_padding - style->xthickness - 1,
- rect->y + (rect->height - style->ythickness) / 2);
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_menu_item_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- gint flags, GtkTextDirection direction)
-{
- GtkStyle* style;
- GtkShadowType shadow_type;
- GtkWidget* item_widget;
-
- if (state->inHover && !state->disabled) {
- if (flags & MOZ_TOPLEVEL_MENU_ITEM) {
- ensure_menu_bar_item_widget();
- item_widget = gParts->menuBarItemWidget;
- } else {
- ensure_menu_item_widget();
- item_widget = gParts->menuItemWidget;
- }
- gtk_widget_set_direction(item_widget, direction);
-
- style = gtk_widget_get_style(item_widget);
- TSOffsetStyleGCs(style, rect->x, rect->y);
-
- gtk_widget_style_get(item_widget, "selected-shadow-type",
- &shadow_type, NULL);
-
- gtk_paint_box(style, drawable, GTK_STATE_PRELIGHT, shadow_type,
- cliprect, item_widget, "menuitem", rect->x, rect->y,
- rect->width, rect->height);
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_menu_arrow_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- GtkTextDirection direction)
-{
- GtkStyle* style;
- GtkStateType state_type = ConvertGtkState(state);
-
- ensure_menu_item_widget();
- gtk_widget_set_direction(gParts->menuItemWidget, direction);
-
- style = gtk_widget_get_style(gParts->menuItemWidget);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_paint_arrow(style, drawable, state_type,
- (state_type == GTK_STATE_PRELIGHT) ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
- cliprect, gParts->menuItemWidget, "menuitem",
- (direction == GTK_TEXT_DIR_LTR) ? GTK_ARROW_RIGHT : GTK_ARROW_LEFT,
- TRUE, rect->x, rect->y, rect->width, rect->height);
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_check_menu_item_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkWidgetState* state,
- gboolean checked, gboolean isradio,
- GtkTextDirection direction)
-{
- GtkStateType state_type = ConvertGtkState(state);
- GtkStyle* style;
- GtkShadowType shadow_type = (checked)?GTK_SHADOW_IN:GTK_SHADOW_OUT;
- gint offset;
- gint indicator_size;
- gint x, y;
-
- moz_gtk_menu_item_paint(drawable, rect, cliprect, state, FALSE, direction);
-
- ensure_check_menu_item_widget();
- gtk_widget_set_direction(gParts->checkMenuItemWidget, direction);
-
- gtk_widget_style_get (gParts->checkMenuItemWidget,
- "indicator-size", &indicator_size,
- NULL);
-
-#ifdef GTK_API_VERSION_2
- if (checked || GTK_CHECK_MENU_ITEM(gParts->checkMenuItemWidget)->always_show_toggle) {
-#else
- if (checked || FALSE) {
-#endif
- style = gtk_widget_get_style(gParts->checkMenuItemWidget);
-
- offset = gtk_container_get_border_width(GTK_CONTAINER(gParts->checkMenuItemWidget)) + style->xthickness + 2;
-
- /* while normally this "3" would be the horizontal-padding style value, passing it to Gecko
- as the value of menuitem padding causes problems with dropdowns (bug 406129), so in the menu.css
- file this is hardcoded as 3px. Yes it sucks, but we don't really have a choice. */
- x = (direction == GTK_TEXT_DIR_RTL) ?
- rect->width - indicator_size - offset - 3: rect->x + offset + 3;
- y = rect->y + (rect->height - indicator_size) / 2;
-
- TSOffsetStyleGCs(style, x, y);
- gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(gParts->checkMenuItemWidget),
- checked);
-
- if (isradio) {
- gtk_paint_option(style, drawable, state_type, shadow_type, cliprect,
- gParts->checkMenuItemWidget, "option",
- x, y, indicator_size, indicator_size);
- } else {
- gtk_paint_check(style, drawable, state_type, shadow_type, cliprect,
- gParts->checkMenuItemWidget, "check",
- x, y, indicator_size, indicator_size);
- }
- }
-
- return MOZ_GTK_SUCCESS;
-}
-
-static gint
-moz_gtk_window_paint(GdkDrawable* drawable, GdkRectangle* rect,
- GdkRectangle* cliprect, GtkTextDirection direction)
-{
- GtkStyle* style;
-
- ensure_window_widget();
- gtk_widget_set_direction(gParts->protoWindow, direction);
-
- style = gtk_widget_get_style(gParts->protoWindow);
-
- TSOffsetStyleGCs(style, rect->x, rect->y);
- gtk_style_apply_default_background(style, drawable, TRUE,
- GTK_STATE_NORMAL,
- cliprect, rect->x, rect->y,
- rect->width, rect->height);
- return MOZ_GTK_SUCCESS;
-}
-
-gint
moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
gint* right, gint* bottom, GtkTextDirection direction,
gboolean inhtml)
@@ -2703,52 +1291,6 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
ensure_entry_widget();
w = gParts->entryWidget;
break;
- case MOZ_GTK_TREEVIEW:
- ensure_tree_view_widget();
- w = gParts->treeViewWidget;
- break;
- case MOZ_GTK_TREE_HEADER_CELL:
- {
- /* A Tree Header in GTK is just a different styled button
- * It must be placed in a TreeView for getting the correct style
- * assigned.
- * That is why the following code is the same as for MOZ_GTK_BUTTON.
- * */
-
- GtkBorder inner_border;
- gboolean interior_focus;
- gint focus_width, focus_pad;
- GtkStyle* style;
-
- ensure_tree_header_cell_widget();
- *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gParts->treeHeaderCellWidget));
-
- moz_gtk_widget_get_focus(gParts->treeHeaderCellWidget, &interior_focus, &focus_width, &focus_pad);
- moz_gtk_button_get_inner_border(gParts->treeHeaderCellWidget, &inner_border);
- *left += focus_width + focus_pad + inner_border.left;
- *right += focus_width + focus_pad + inner_border.right;
- *top += focus_width + focus_pad + inner_border.top;
- *bottom += focus_width + focus_pad + inner_border.bottom;
-
- style = gtk_widget_get_style(gParts->treeHeaderCellWidget);
- *left += style->xthickness;
- *right += style->xthickness;
- *top += style->ythickness;
- *bottom += style->ythickness;
- return MOZ_GTK_SUCCESS;
- }
- case MOZ_GTK_TREE_HEADER_SORTARROW:
- ensure_tree_header_cell_widget();
- w = gParts->treeHeaderSortArrowWidget;
- break;
- case MOZ_GTK_DROPDOWN_ENTRY:
- ensure_combo_box_entry_widgets();
- w = gParts->comboBoxEntryTextareaWidget;
- break;
- case MOZ_GTK_DROPDOWN_ARROW:
- ensure_combo_box_entry_widgets();
- w = gParts->comboBoxEntryButtonWidget;
- break;
case MOZ_GTK_DROPDOWN:
{
/* We need to account for the arrow on the dropdown, so text
@@ -2801,20 +1343,10 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
return MOZ_GTK_SUCCESS;
}
- case MOZ_GTK_TABPANELS:
- ensure_tab_widget();
- w = gParts->tabWidget;
- break;
case MOZ_GTK_PROGRESSBAR:
ensure_progress_widget();
w = gParts->progresWidget;
break;
- case MOZ_GTK_SPINBUTTON_ENTRY:
- case MOZ_GTK_SPINBUTTON_UP:
- case MOZ_GTK_SPINBUTTON_DOWN:
- ensure_spin_widget();
- w = gParts->spinWidget;
- break;
case MOZ_GTK_SCALE_HORIZONTAL:
ensure_scale_widget();
w = gParts->hScaleWidget;
@@ -2823,89 +1355,7 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
ensure_scale_widget();
w = gParts->vScaleWidget;
break;
- case MOZ_GTK_FRAME:
- ensure_frame_widget();
- w = gParts->frameWidget;
- 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) {
- ensure_checkbox_widget();
- moz_gtk_widget_get_focus(gParts->checkboxWidget, &interior_focus,
- &focus_width, &focus_pad);
- }
- else {
- ensure_radiobutton_widget();
- moz_gtk_widget_get_focus(gParts->radiobuttonWidget, &interior_focus,
- &focus_width, &focus_pad);
- }
-
- if (interior_focus)
- *left = *top = *right = *bottom = (focus_width + focus_pad);
- else
- *left = *top = *right = *bottom = 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) {
- ensure_checkbox_widget();
- moz_gtk_widget_get_focus(gParts->checkboxWidget, &interior_focus,
- &focus_width, &focus_pad);
- w = gParts->checkboxWidget;
- } else {
- ensure_radiobutton_widget();
- moz_gtk_widget_get_focus(gParts->radiobuttonWidget, &interior_focus,
- &focus_width, &focus_pad);
- w = gParts->radiobuttonWidget;
- }
-
- *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w));
-
- if (!interior_focus) {
- *left += (focus_width + focus_pad);
- *right += (focus_width + focus_pad);
- *top += (focus_width + focus_pad);
- *bottom += (focus_width + focus_pad);
- }
-
- return MOZ_GTK_SUCCESS;
- }
- case MOZ_GTK_MENUPOPUP:
- ensure_menu_popup_widget();
- w = gParts->menuPopupWidget;
- break;
- case MOZ_GTK_MENUITEM:
- ensure_menu_item_widget();
- ensure_menu_bar_item_widget();
- w = gParts->menuItemWidget;
- break;
- case MOZ_GTK_CHECKMENUITEM:
- case MOZ_GTK_RADIOMENUITEM:
- ensure_check_menu_item_widget();
- w = gParts->checkMenuItemWidget;
- break;
- case MOZ_GTK_TAB:
- ensure_tab_widget();
- w = gParts->tabWidget;
- break;
/* These widgets have no borders, since they are not containers. */
- case MOZ_GTK_SPLITTER_HORIZONTAL:
- case MOZ_GTK_SPLITTER_VERTICAL:
case MOZ_GTK_CHECKBUTTON:
case MOZ_GTK_RADIOBUTTON:
case MOZ_GTK_SCROLLBAR_BUTTON:
@@ -2915,23 +1365,7 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
case MOZ_GTK_SCROLLBAR_THUMB_VERTICAL:
case MOZ_GTK_SCALE_THUMB_HORIZONTAL:
case MOZ_GTK_SCALE_THUMB_VERTICAL:
- case MOZ_GTK_GRIPPER:
case MOZ_GTK_PROGRESS_CHUNK:
- case MOZ_GTK_EXPANDER:
- case MOZ_GTK_TREEVIEW_EXPANDER:
- case MOZ_GTK_TOOLBAR_SEPARATOR:
- case MOZ_GTK_MENUSEPARATOR:
- /* These widgets have no borders.*/
- case MOZ_GTK_SPINBUTTON:
- case MOZ_GTK_TOOLTIP:
- case MOZ_GTK_WINDOW:
- case MOZ_GTK_RESIZER:
- case MOZ_GTK_MENUARROW:
- case MOZ_GTK_TOOLBARBUTTON_ARROW:
- case MOZ_GTK_TOOLBAR:
- case MOZ_GTK_MENUBAR:
- case MOZ_GTK_TAB_SCROLLARROW:
- case MOZ_GTK_ENTRY_CARET:
*left = *top = *right = *bottom = 0;
return MOZ_GTK_SUCCESS;
default:
@@ -2947,131 +1381,6 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
}
gint
-moz_gtk_get_combo_box_entry_button_size(gint* width, gint* height)
-{
- /*
- * We get the requisition of the drop down button, which includes
- * all padding, border and focus line widths the button uses,
- * as well as the minimum arrow size and its padding
- * */
- GtkRequisition requisition;
- ensure_combo_box_entry_widgets();
-
-#ifdef GTK_API_VERSION_2
- gtk_widget_size_request(gParts->comboBoxEntryButtonWidget, &requisition);
-#else
- gtk_size_request_get_size(GTK_SIZE_REQUEST(gParts->comboBoxEntryButtonWidget), &requisition, NULL);
-#endif
-
- *width = requisition.width;
- *height = requisition.height;
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
-moz_gtk_get_tab_scroll_arrow_size(gint* width, gint* height)
-{
- gint arrow_size;
-
- ensure_tab_widget();
- gtk_widget_style_get(gParts->tabWidget,
- "scroll-arrow-hlength", &arrow_size,
- NULL);
-
- *height = *width = arrow_size;
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
-moz_gtk_get_downarrow_size(gint* width, gint* height)
-{
- GtkRequisition requisition;
- ensure_button_arrow_widget();
-
-#ifdef GTK_API_VERSION_2
- gtk_widget_size_request(gParts->buttonArrowWidget, &requisition);
-#else
- gtk_size_request_get_size(GTK_SIZE_REQUEST(gParts->buttonArrowWidget), &requisition, NULL);
-#endif
-
- *width = requisition.width;
- *height = requisition.height;
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
-moz_gtk_get_toolbar_separator_width(gint* size)
-{
- gboolean wide_separators;
- gint separator_width;
- GtkStyle* style;
-
- ensure_toolbar_widget();
-
- style = gtk_widget_get_style(gParts->toolbarWidget);
-
- gtk_widget_style_get(gParts->toolbarWidget,
- "space-size", size,
- "wide-separators", &wide_separators,
- "separator-width", &separator_width,
- NULL);
-
- /* Just in case... */
- *size = MAX(*size, (wide_separators ? separator_width : style->xthickness));
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
-moz_gtk_get_expander_size(gint* size)
-{
- ensure_expander_widget();
- gtk_widget_style_get(gParts->expanderWidget,
- "expander-size", size,
- NULL);
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
-moz_gtk_get_treeview_expander_size(gint* size)
-{
- ensure_tree_view_widget();
- gtk_widget_style_get(gParts->treeViewWidget,
- "expander-size", size,
- NULL);
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
-moz_gtk_get_menu_separator_height(gint *size)
-{
- gboolean wide_separators;
- gint separator_height;
- GtkStyle *style;
-
- ensure_menu_separator_widget();
-
- gtk_widget_style_get(gParts->menuSeparatorWidget,
- "wide-separators", &wide_separators,
- "separator-height", &separator_height,
- NULL);
-
- style = gtk_widget_get_style(gParts->menuSeparatorWidget);
-
- if (wide_separators)
- *size = separator_height + style->ythickness;
- else
- *size = style->ythickness * 2;
-
- return MOZ_GTK_SUCCESS;
-}
-
-gint
moz_gtk_get_scalethumb_metrics(GtkOrientation orient, gint* thumb_length, gint* thumb_height)
{
GtkWidget* widget;
@@ -3107,19 +1416,6 @@ moz_gtk_get_scrollbar_metrics(MozGtkScrollbarMetrics *metrics)
return MOZ_GTK_SUCCESS;
}
-gboolean
-moz_gtk_images_in_menus()
-{
- gboolean result;
- GtkSettings* settings;
-
- ensure_image_menu_item_widget();
- settings = gtk_widget_get_settings(gParts->imageMenuItemWidget);
-
- g_object_get(settings, "gtk-menu-images", &result, NULL);
- return result;
-}
-
gint
moz_gtk_widget_paint(GtkThemeWidgetType widget, GdkDrawable* drawable,
GdkRectangle* rect, GdkRectangle* cliprect,
@@ -3175,96 +1471,15 @@ moz_gtk_widget_paint(GtkThemeWidgetType widget, GdkDrawable* drawable,
return moz_gtk_scale_thumb_paint(drawable, rect, cliprect, state,
(GtkOrientation) flags, direction);
break;
- case MOZ_GTK_SPINBUTTON:
- return moz_gtk_spin_paint(drawable, rect, direction);
- break;
- case MOZ_GTK_SPINBUTTON_UP:
- case MOZ_GTK_SPINBUTTON_DOWN:
- return moz_gtk_spin_updown_paint(drawable, rect,
- (widget == MOZ_GTK_SPINBUTTON_DOWN),
- state, direction);
- break;
- case MOZ_GTK_SPINBUTTON_ENTRY:
- ensure_spin_widget();
- return moz_gtk_entry_paint(drawable, rect, cliprect, state,
- gParts->spinWidget, direction);
- break;
- case MOZ_GTK_GRIPPER:
- return moz_gtk_gripper_paint(drawable, rect, cliprect, state,
- direction);
- break;
- case MOZ_GTK_TREEVIEW:
- return moz_gtk_treeview_paint(drawable, rect, cliprect, state,
- direction);
- break;
- case MOZ_GTK_TREE_HEADER_CELL:
- return moz_gtk_tree_header_cell_paint(drawable, rect, cliprect, state,
- flags, direction);
- break;
- case MOZ_GTK_TREE_HEADER_SORTARROW:
- return moz_gtk_tree_header_sort_arrow_paint(drawable, rect, cliprect,
- state,
- (GtkArrowType) flags,
- direction);
- break;
- case MOZ_GTK_TREEVIEW_EXPANDER:
- return moz_gtk_treeview_expander_paint(drawable, rect, cliprect, state,
- (GtkExpanderStyle) flags, direction);
- break;
- case MOZ_GTK_EXPANDER:
- return moz_gtk_expander_paint(drawable, rect, cliprect, state,
- (GtkExpanderStyle) flags, direction);
- break;
case MOZ_GTK_ENTRY:
ensure_entry_widget();
return moz_gtk_entry_paint(drawable, rect, cliprect, state,
gParts->entryWidget, direction);
break;
- case MOZ_GTK_ENTRY_CARET:
- return moz_gtk_caret_paint(drawable, rect, cliprect, direction);
- break;
case MOZ_GTK_DROPDOWN:
return moz_gtk_combo_box_paint(drawable, rect, cliprect, state,
(gboolean) flags, direction);
break;
- case MOZ_GTK_DROPDOWN_ARROW:
- return moz_gtk_combo_box_entry_button_paint(drawable, rect, cliprect,
- state, flags, direction);
- break;
- case MOZ_GTK_DROPDOWN_ENTRY:
- ensure_combo_box_entry_widgets();
- return moz_gtk_entry_paint(drawable, rect, cliprect, state,
- gParts->comboBoxEntryTextareaWidget, direction);
- 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),
- direction);
- 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),
- direction);
- break;
- case MOZ_GTK_TOOLBAR:
- return moz_gtk_toolbar_paint(drawable, rect, cliprect, direction);
- break;
- case MOZ_GTK_TOOLBAR_SEPARATOR:
- return moz_gtk_toolbar_separator_paint(drawable, rect, cliprect,
- direction);
- break;
- case MOZ_GTK_TOOLTIP:
- return moz_gtk_tooltip_paint(drawable, rect, cliprect, direction);
- break;
- case MOZ_GTK_FRAME:
- return moz_gtk_frame_paint(drawable, rect, cliprect, direction);
- break;
- case MOZ_GTK_RESIZER:
- return moz_gtk_resizer_paint(drawable, rect, cliprect, state,
- direction);
- break;
case MOZ_GTK_PROGRESSBAR:
return moz_gtk_progressbar_paint(drawable, rect, cliprect, direction);
break;
@@ -3272,54 +1487,6 @@ moz_gtk_widget_paint(GtkThemeWidgetType widget, GdkDrawable* drawable,
return moz_gtk_progress_chunk_paint(drawable, rect, cliprect,
direction);
break;
- case MOZ_GTK_TAB:
- return moz_gtk_tab_paint(drawable, rect, cliprect,
- (GtkTabFlags) flags, direction);
- break;
- case MOZ_GTK_TABPANELS:
- return moz_gtk_tabpanels_paint(drawable, rect, cliprect, direction);
- break;
- case MOZ_GTK_TAB_SCROLLARROW:
- return moz_gtk_tab_scroll_arrow_paint(drawable, rect, cliprect, state,
- (GtkArrowType) flags, direction);
- break;
- case MOZ_GTK_MENUBAR:
- return moz_gtk_menu_bar_paint(drawable, rect, cliprect, direction);
- break;
- case MOZ_GTK_MENUPOPUP:
- return moz_gtk_menu_popup_paint(drawable, rect, cliprect, direction);
- break;
- case MOZ_GTK_MENUSEPARATOR:
- return moz_gtk_menu_separator_paint(drawable, rect, cliprect,
- direction);
- break;
- case MOZ_GTK_MENUITEM:
- return moz_gtk_menu_item_paint(drawable, rect, cliprect, state, flags,
- direction);
- break;
- case MOZ_GTK_MENUARROW:
- return moz_gtk_menu_arrow_paint(drawable, rect, cliprect, state,
- direction);
- break;
- case MOZ_GTK_TOOLBARBUTTON_ARROW:
- return moz_gtk_downarrow_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),
- direction);
- break;
- case MOZ_GTK_SPLITTER_HORIZONTAL:
- return moz_gtk_vpaned_paint(drawable, rect, cliprect, state);
- break;
- case MOZ_GTK_SPLITTER_VERTICAL:
- return moz_gtk_hpaned_paint(drawable, rect, cliprect, state);
- break;
- case MOZ_GTK_WINDOW:
- return moz_gtk_window_paint(drawable, rect, cliprect, direction);
- break;
default:
g_warning("Unknown widget type: %d", widget);
}
@@ -3352,11 +1519,6 @@ void moz_gtk_destroy_theme_parts_widgets(GtkThemeParts* parts)
if (!parts)
return;
- if (parts->tooltipWidget) {
- gtk_widget_destroy(parts->tooltipWidget);
- parts->tooltipWidget = NULL;
- }
-
if (parts->protoWindow) {
gtk_widget_destroy(parts->protoWindow);
parts->protoWindow = NULL;
diff --git a/WebCore/platform/gtk/gtkdrawing.h b/WebCore/platform/gtk/gtkdrawing.h
index c00da97..fd3e8f3 100644
--- a/WebCore/platform/gtk/gtkdrawing.h
+++ b/WebCore/platform/gtk/gtkdrawing.h
@@ -91,7 +91,6 @@ typedef struct _GtkThemeParts {
GtkWidget* radiobuttonWidget;
GtkWidget* horizScrollbarWidget;
GtkWidget* vertScrollbarWidget;
- GtkWidget* spinWidget;
GtkWidget* hScaleWidget;
GtkWidget* vScaleWidget;
GtkWidget* entryWidget;
@@ -103,28 +102,7 @@ typedef struct _GtkThemeParts {
GtkWidget* comboBoxEntryTextareaWidget;
GtkWidget* comboBoxEntryButtonWidget;
GtkWidget* comboBoxEntryArrowWidget;
- GtkWidget* handleBoxWidget;
- GtkWidget* toolbarWidget;
- GtkWidget* frameWidget;
- GtkWidget* statusbarWidget;
GtkWidget* progresWidget;
- GtkWidget* tabWidget;
- GtkWidget* tooltipWidget;
- GtkWidget* menuBarWidget;
- GtkWidget* menuBarItemWidget;
- GtkWidget* menuPopupWidget;
- GtkWidget* menuItemWidget;
- GtkWidget* imageMenuItemWidget;
- GtkWidget* checkMenuItemWidget;
- GtkWidget* treeViewWidget;
- GtkTreeViewColumn* middleTreeViewColumn;
- GtkWidget* treeHeaderCellWidget;
- GtkWidget* treeHeaderSortArrowWidget;
- GtkWidget* expanderWidget;
- GtkWidget* toolbarSeparatorWidget;
- GtkWidget* menuSeparatorWidget;
- GtkWidget* hpanedWidget;
- GtkWidget* vpanedWidget;
GtkWidget* scrolledWindowWidget;
} GtkThemeParts;
@@ -134,24 +112,6 @@ typedef enum {
MOZ_GTK_STEPPER_VERTICAL = 1 << 2
} GtkScrollbarButtonFlags;
-/** flags for tab state **/
-typedef enum {
- /* first eight bits are used to pass a margin */
- MOZ_GTK_TAB_MARGIN_MASK = 0xFF,
- /* bottom tabs */
- MOZ_GTK_TAB_BOTTOM = 1 << 8,
- /* the first tab in the group */
- MOZ_GTK_TAB_FIRST = 1 << 9,
- /* the selected tab */
- MOZ_GTK_TAB_SELECTED = 1 << 10
-} GtkTabFlags;
-
-/** flags for menuitems **/
-typedef enum {
- /* menuitem is part of the menubar */
- MOZ_TOPLEVEL_MENU_ITEM = 1 << 0
-} GtkMenuItemFlags;
-
/* function type for moz_gtk_enable_style_props */
typedef gint (*style_prop_t)(GtkStyle*, const gchar*, gint);
@@ -191,80 +151,13 @@ typedef enum {
/* Paints a GtkScale thumb. */
MOZ_GTK_SCALE_THUMB_HORIZONTAL,
MOZ_GTK_SCALE_THUMB_VERTICAL,
- /* Paints a GtkSpinButton */
- MOZ_GTK_SPINBUTTON,
- MOZ_GTK_SPINBUTTON_UP,
- MOZ_GTK_SPINBUTTON_DOWN,
- MOZ_GTK_SPINBUTTON_ENTRY,
- /* Paints the gripper of a GtkHandleBox. */
- MOZ_GTK_GRIPPER,
- /* Paints a GtkEntry. */
MOZ_GTK_ENTRY,
- /* Paints the native caret (or in GTK-speak: insertion cursor) */
- MOZ_GTK_ENTRY_CARET,
/* Paints a GtkOptionMenu. */
MOZ_GTK_DROPDOWN,
- /* Paints a dropdown arrow (a GtkButton containing a down GtkArrow). */
- MOZ_GTK_DROPDOWN_ARROW,
- /* Paints an entry in an editable option menu */
- MOZ_GTK_DROPDOWN_ENTRY,
- /* 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 toolbar separator */
- MOZ_GTK_TOOLBAR_SEPARATOR,
- /* Paints a GtkToolTip */
- MOZ_GTK_TOOLTIP,
- /* Paints a GtkFrame (e.g. a status bar panel). */
- MOZ_GTK_FRAME,
- /* Paints a resize grip for a GtkWindow */
- MOZ_GTK_RESIZER,
/* 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 a GtkArrow for a GtkNotebook. flags is a GtkArrowType. */
- MOZ_GTK_TAB_SCROLLARROW,
- /* Paints the background and border of a GtkTreeView */
- MOZ_GTK_TREEVIEW,
- /* Paints treeheader cells */
- MOZ_GTK_TREE_HEADER_CELL,
- /* Paints sort arrows in treeheader cells */
- MOZ_GTK_TREE_HEADER_SORTARROW,
- /* Paints an expander for a GtkTreeView */
- MOZ_GTK_TREEVIEW_EXPANDER,
- /* Paints a GtkExpander */
- MOZ_GTK_EXPANDER,
- /* Paints the background of the menu bar. */
- MOZ_GTK_MENUBAR,
- /* Paints the background of menus, context menus. */
- MOZ_GTK_MENUPOPUP,
- /* Paints the arrow of menuitems that contain submenus */
- MOZ_GTK_MENUARROW,
- /* Paints an arrow that points down */
- MOZ_GTK_TOOLBARBUTTON_ARROW,
- /* Paints items of menubar and popups. */
- MOZ_GTK_MENUITEM,
- MOZ_GTK_CHECKMENUITEM,
- MOZ_GTK_RADIOMENUITEM,
- MOZ_GTK_MENUSEPARATOR,
- /* Paints a GtkVPaned separator */
- MOZ_GTK_SPLITTER_HORIZONTAL,
- /* Paints a GtkHPaned separator */
- MOZ_GTK_SPLITTER_VERTICAL,
- /* Paints the background of a window, dialog or page. */
- MOZ_GTK_WINDOW
+ MOZ_GTK_PROGRESS_CHUNK
} GtkThemeWidgetType;
/*** General library functions ***/
@@ -362,16 +255,6 @@ moz_gtk_checkbox_get_metrics(gint* indicator_size, gint* indicator_spacing);
gint
moz_gtk_radio_get_metrics(gint* indicator_size, gint* indicator_spacing);
-/**
- * Get the inner-border value for a GtkButton widget (button or tree header)
- * widget: [IN] the widget to get the border value for
- * inner_border: [OUT] the inner border
- *
- * returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
- */
-gint
-moz_gtk_button_get_inner_border(GtkWidget* widget, GtkBorder* inner_border);
-
/** Get the focus metrics for a treeheadercell, button, checkbox, or radio button.
* widget: [IN] the widget to get the focus metrics for
* interior_focus: [OUT] whether the focus is drawn around the
@@ -406,91 +289,12 @@ gint
moz_gtk_get_scrollbar_metrics(MozGtkScrollbarMetrics* metrics);
/**
- * 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
- */
-gint moz_gtk_get_combo_box_entry_button_size(gint* width, gint* height);
-
-/**
- * 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);
-
-/**
- * Get the desired size of a toolbar button dropdown arrow
- * 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_downarrow_size(gint* width, gint* height);
-
-/**
- * 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);
-
-/**
- * Get the size of a regular GTK expander that shows/hides content
- * 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);
-
-/**
- * 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);
-
-/**
- * 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);
-
-/**
- * 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);
-
-/**
* Retrieve an actual GTK scrollbar widget for style analysis. It will not
* be modified.
*/
GtkWidget* moz_gtk_get_scrollbar_widget(void);
/**
- * Get the YTHICKNESS of a tab (notebook extension).
- */
-gint moz_gtk_get_tab_thickness(void);
-
-/**
- * Get a boolean which indicates whether or not to use images in menus.
- * If TRUE, use images in menus.
- */
-gboolean moz_gtk_images_in_menus(void);
-
-/**
* Retrieve an actual GTK progress bar widget for style analysis. It will not
* be modified.
*/
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list