#include "gtkmenu.h"
#include "gtkmenuitem.h"
#include "gtklabel.h"
-#include "gtksizerequest.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkbindings.h"
gboolean *fill,
GtkPackType *pack_type);
-/*** GtkObject Methods ***/
-static void gtk_notebook_destroy (GtkObject *object);
+/*** GObject Methods ***/
static void gtk_notebook_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
/*** GtkWidget Methods ***/
+static void gtk_notebook_destroy (GtkWidget *widget);
static void gtk_notebook_map (GtkWidget *widget);
static void gtk_notebook_unmap (GtkWidget *widget);
static void gtk_notebook_realize (GtkWidget *widget);
gtk_notebook_class_init (GtkNotebookClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class);
GtkBindingSet *binding_set;
gobject_class->set_property = gtk_notebook_set_property;
gobject_class->get_property = gtk_notebook_get_property;
- object_class->destroy = gtk_notebook_destroy;
+ widget_class->destroy = gtk_notebook_destroy;
widget_class->map = gtk_notebook_map;
widget_class->unmap = gtk_notebook_unmap;
widget_class->realize = gtk_notebook_realize;
return g_object_new (GTK_TYPE_NOTEBOOK, NULL);
}
-/* Private GtkObject Methods :
- *
- * gtk_notebook_destroy
- * gtk_notebook_set_arg
- * gtk_notebook_get_arg
+/* Private GObject Methods :
+ *
+ * gtk_notebook_set_property
+ * gtk_notebook_get_property
*/
-static void
-gtk_notebook_destroy (GtkObject *object)
-{
- GtkNotebook *notebook = GTK_NOTEBOOK (object);
- GtkNotebookPrivate *priv = notebook->priv;
-
- if (priv->menu)
- gtk_notebook_popup_disable (notebook);
-
- if (priv->source_targets)
- {
- gtk_target_list_unref (priv->source_targets);
- priv->source_targets = NULL;
- }
-
- if (priv->switch_tab_timer)
- {
- g_source_remove (priv->switch_tab_timer);
- priv->switch_tab_timer = 0;
- }
-
- GTK_OBJECT_CLASS (gtk_notebook_parent_class)->destroy (object);
-}
-
static void
gtk_notebook_set_property (GObject *object,
guint prop_id,
}
/* Private GtkWidget Methods :
- *
+ *
+ * gtk_notebook_destroy
* gtk_notebook_map
* gtk_notebook_unmap
* gtk_notebook_realize
* gtk_notebook_drag_data_get
* gtk_notebook_drag_data_received
*/
+static void
+gtk_notebook_destroy (GtkWidget *widget)
+{
+ GtkNotebook *notebook = GTK_NOTEBOOK (widget);
+ GtkNotebookPrivate *priv = notebook->priv;
+
+ if (priv->menu)
+ gtk_notebook_popup_disable (notebook);
+
+ if (priv->source_targets)
+ {
+ gtk_target_list_unref (priv->source_targets);
+ priv->source_targets = NULL;
+ }
+
+ if (priv->switch_tab_timer)
+ {
+ g_source_remove (priv->switch_tab_timer);
+ priv->switch_tab_timer = 0;
+ }
+
+ GTK_WIDGET_CLASS (gtk_notebook_parent_class)->destroy (widget);
+}
+
static gboolean
gtk_notebook_get_event_window_position (GtkNotebook *notebook,
GdkRectangle *rectangle)
{
if (priv->action_widget[i] &&
gtk_widget_get_visible (priv->action_widget[i]) &&
- GTK_WIDGET_CHILD_VISIBLE (priv->action_widget[i]) &&
+ gtk_widget_get_child_visible (priv->action_widget[i]) &&
!gtk_widget_get_mapped (priv->action_widget[i]))
gtk_widget_map (priv->action_widget[i]);
}
if (gtk_widget_get_visible (page->child))
{
vis_pages++;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (page->child),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (page->child,
+ &child_requisition, NULL);
requisition->width = MAX (requisition->width,
child_requisition.width);
if (!gtk_widget_get_visible (page->tab_label))
gtk_widget_show (page->tab_label);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (page->tab_label),
- &child_requisition, NULL);
+ gtk_widget_get_preferred_size (page->tab_label,
+ &child_requisition, NULL);
page->requisition.width = child_requisition.width + 2 * style->xthickness;
page->requisition.height = child_requisition.height + 2 * style->ythickness;
{
if (priv->action_widget[i])
{
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
- &action_widget_requisition[i], NULL);
+ gtk_widget_get_preferred_size (priv->action_widget[i],
+ &action_widget_requisition[i], NULL);
action_widget_requisition[i].width += style->xthickness;
action_widget_requisition[i].height += style->ythickness;
}
widget_allocation.y = allocation->y + border_width;
is_rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (priv->action_widget[i]),
- &requisition, NULL);
+ gtk_widget_get_preferred_size (priv->action_widget[i],
+ &requisition, NULL);
switch (tab_pos)
{
if (priv->operation == DRAG_OPERATION_REORDER &&
gtk_cairo_should_draw_window (cr, priv->drag_window))
{
- int x, y;
+ cairo_save (cr);
+ gtk_cairo_transform_to_window (cr, widget, priv->drag_window);
/* FIXME: This is a workaround to make tabs reordering work better
* with engines with rounded tabs. If the drag window background
* Ideally, these corners should be made transparent, Either by using
* ARGB visuals or shape windows.
*/
- cairo_save (cr);
- gdk_window_get_position (priv->drag_window, &x, &y);
- cairo_translate (cr, x - allocation.x, y - allocation.y);
-
gdk_cairo_set_source_color (cr, >k_widget_get_style (widget)->bg [GTK_STATE_NORMAL]);
cairo_paint (cr);
gdk_window_get_origin (gtk_widget_get_window (w), x, y);
gtk_widget_get_allocation (w, &allocation);
- gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
- &requisition, NULL);
+ gtk_widget_get_preferred_size (GTK_WIDGET (menu),
+ &requisition, NULL);
if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)
*x += allocation.x + allocation.width - requisition.width;
notebook = GTK_WIDGET (data);
child = gtk_bin_get_child (GTK_BIN (widget));
- gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
- &requisition, NULL);
+ gtk_widget_get_preferred_size (widget,
+ &requisition, NULL);
gap_pos = get_tab_gap_pos (GTK_NOTEBOOK (notebook));
gtk_paint_extension (gtk_widget_get_style (notebook),
GList * next_list;
gint need_resize = FALSE;
GtkWidget *tab_label;
-
gboolean destroying;
- destroying = GTK_OBJECT_FLAGS (notebook) & GTK_IN_DESTRUCTION;
+ destroying = gtk_widget_in_destruction (notebook);
next_list = gtk_notebook_search_page (notebook, list, STEP_NEXT, TRUE);
if (!next_list)
xthickness = style->xthickness;
ythickness = style->ythickness;
- gtk_size_request_get_size (GTK_SIZE_REQUEST (page->tab_label),
- &tab_requisition, NULL);
+ gtk_widget_get_preferred_size (page->tab_label, &tab_requisition, NULL);
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"tab-curvature", &tab_curvature,