X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6b71411ac969df135878b40a4c16356f6af10cf0..6d7b547184bfdcdf67790755deb0122050b1d728:/src/gtk/win_gtk.c diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index 4f098ee8ea..4862d3b493 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -15,9 +15,6 @@ #include "wx/platform.h" #include "wx/gtk/win_gtk.h" -#include "gtk/gtksignal.h" -#include "gtk/gtkprivate.h" -#include "gdk/gdkx.h" #ifdef __cplusplus extern "C" { @@ -200,13 +197,9 @@ gtk_pizza_init (GtkPizza *pizza) pizza->xoffset = 0; pizza->yoffset = 0; - pizza->configure_serial = 0; pizza->scroll_x = 0; pizza->scroll_y = 0; - pizza->visibility = GDK_VISIBILITY_PARTIAL; - pizza->clear_on_draw = TRUE; - pizza->use_filter = TRUE; pizza->external_expose = FALSE; } @@ -215,7 +208,7 @@ gtk_pizza_new () { GtkPizza *pizza; - pizza = gtk_type_new (gtk_pizza_get_type ()); + pizza = g_object_new (gtk_pizza_get_type (), NULL); return GTK_WIDGET (pizza); } @@ -235,7 +228,7 @@ gtk_pizza_set_shadow_type (GtkPizza *pizza, g_return_if_fail (pizza != NULL); g_return_if_fail (GTK_IS_PIZZA (pizza)); - if ((GtkMyShadowType) pizza->shadow_type != type) + if (pizza->shadow_type != type) { pizza->shadow_type = type; @@ -247,26 +240,6 @@ gtk_pizza_set_shadow_type (GtkPizza *pizza, } } -void -gtk_pizza_set_clear (GtkPizza *pizza, - gboolean clear) -{ - g_return_if_fail (pizza != NULL); - g_return_if_fail (GTK_IS_PIZZA (pizza)); - - pizza->clear_on_draw = clear; -} - -void -gtk_pizza_set_filter (GtkPizza *pizza, - gboolean use) -{ - g_return_if_fail (pizza != NULL); - g_return_if_fail (GTK_IS_PIZZA (pizza)); - - pizza->use_filter = use; -} - void gtk_pizza_set_external (GtkPizza *pizza, gboolean expose) @@ -309,76 +282,6 @@ gtk_pizza_put (GtkPizza *pizza, gtk_widget_set_size_request (widget, width, height); } -void -gtk_pizza_move (GtkPizza *pizza, - GtkWidget *widget, - gint x, - gint y) -{ - GtkPizzaChild *child; - GList *children; - - g_return_if_fail (pizza != NULL); - g_return_if_fail (GTK_IS_PIZZA (pizza)); - g_return_if_fail (widget != NULL); - - children = pizza->children; - while (children) - { - child = children->data; - children = children->next; - - if (child->widget == widget) - { - if ((child->x == x) && (child->y == y)) - break; - - child->x = x; - child->y = y; - - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza)) - gtk_widget_queue_resize (widget); - break; - } - } -} - -void -gtk_pizza_resize (GtkPizza *pizza, - GtkWidget *widget, - gint width, - gint height) -{ - GtkPizzaChild *child; - GList *children; - - g_return_if_fail (pizza != NULL); - g_return_if_fail (GTK_IS_PIZZA (pizza)); - g_return_if_fail (widget != NULL); - - children = pizza->children; - while (children) - { - child = children->data; - children = children->next; - - if (child->widget == widget) - { - if ((child->width == width) && (child->height == height)) - break; - - child->width = width; - child->height = height; - - gtk_widget_set_size_request (widget, width, height); - - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza)) - gtk_widget_queue_resize (widget); - break; - } - } -} - void gtk_pizza_set_size (GtkPizza *pizza, GtkWidget *widget, @@ -394,13 +297,15 @@ gtk_pizza_set_size (GtkPizza *pizza, g_return_if_fail (GTK_IS_PIZZA (pizza)); g_return_if_fail (widget != NULL); +#ifndef WX_WARN_ILLEGAL_SETSIZE /* this really shouldn't happen -- but it does, a lot, right now and we - can't pass negative values to gtk_widget_set_size_request(), so filter - them out here */ + can't pass negative values to gtk_widget_set_size_request() without getting + a warning printed out, so filter them out here */ if ( width < 0 ) width = 0; if ( height < 0 ) height = 0; +#endif children = pizza->children; while (children) @@ -430,33 +335,6 @@ gtk_pizza_set_size (GtkPizza *pizza, } } -gint -gtk_pizza_child_resized (GtkPizza *pizza, - GtkWidget *widget) -{ - GtkPizzaChild *child; - GList *children; - - g_return_val_if_fail (pizza != NULL, FALSE); - g_return_val_if_fail (GTK_IS_PIZZA (pizza), FALSE); - g_return_val_if_fail (widget != NULL, FALSE); - - children = pizza->children; - while (children) - { - child = children->data; - children = children->next; - - if (child->widget == widget) - { - return ((child->width == widget->allocation.width) && - (child->height == widget->allocation.height)); - } - } - - return FALSE; -} - static void gtk_pizza_map (GtkWidget *widget) { @@ -477,8 +355,7 @@ gtk_pizza_map (GtkWidget *widget) children = children->next; if ( GTK_WIDGET_VISIBLE (child->widget) && - !GTK_WIDGET_MAPPED (child->widget) && - TRUE) + !GTK_WIDGET_MAPPED (child->widget) ) { gtk_widget_map (child->widget); } @@ -866,19 +743,6 @@ gtk_pizza_adjust_allocations (GtkPizza *pizza, } } - -/* This is the main routine to do the scrolling. Scrolling is - * done by "Guffaw" scrolling, as in the Mozilla XFE, with - * a few modifications. - * - * The main improvement is that we keep track of whether we - * are obscured or not. If not, we ignore the generated expose - * events and instead do the exposes ourself, without having - * to wait for a roundtrip to the server. This also provides - * a limited form of expose-event compression, since we do - * the affected area as one big chunk. - */ - void gtk_pizza_scroll (GtkPizza *pizza, gint dx, gint dy) {