Commit aa49527f authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Enforce the widget/child realization/mapping invariants.

Sat Jul  7 02:50:14 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
	the widget/child realization/mapping invariants.

	* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
	gtk_widget_[get/set]_child_visible() to control
	whether visible children of a mapped window are
	mapped.

	* docs/widget_system.txt: Updated for changes in
	container contract, and addition of GTK_CHILD_VISIBLE.

	* gtk/gtkcontainer.c: Add generic map()/unmap()
	functions that work for almost all containers.

	* gtk/gtknotebook.c gtk/gtkpacker.c: Use
	gtk_widget_set_child_visible() where necessary.

	* gtk/*.c: Remove excess map(), unmap(), and
	realization/mapping invariant enforcing code
	from many containers.
parent 8f2bf797
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
Sat Jul 7 02:50:14 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_parent): Enforce
the widget/child realization/mapping invariants.
* gtk/gtkwidget.[ch] gtk/gtkprivate.h: Add functions
gtk_widget_[get/set]_child_visible() to control
whether visible children of a mapped window are
mapped.
* docs/widget_system.txt: Updated for changes in
container contract, and addition of GTK_CHILD_VISIBLE.
* gtk/gtkcontainer.c: Add generic map()/unmap()
functions that work for almost all containers.
* gtk/gtknotebook.c gtk/gtkpacker.c: Use
gtk_widget_set_child_visible() where necessary.
* gtk/*.c: Remove excess map(), unmap(), and
realization/mapping invariant enforcing code
from many containers.
Wed Jul 18 19:51:45 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktextview.c (gtk_text_view_set_attributes_from_style):
Get the foreground color from 'text', nor 'base'. (#57568)
Get the foreground color from 'text', nor 'fg'. (#57568)
Wed Jul 18 19:28:46 2001 Owen Taylor <otaylor@redhat.com>
......
......@@ -396,3 +396,33 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0:
undefined contents for the offscreen areas. In most cases, code
using gdk_image_get() should really be ported to
gdk_pixbuf_get_from_drawable().
* The core GTK+ now takes care of handling mapping, unmapping and
realizing the child widgets of containers in
gtk_widget_set_parent(). In most cases, this allows container
implementations to be simplifid by removing the code in add()
methods to map and realize children. However, there are
a couple of things to watch out for here:
- If the parent is realized before the add() happens,
gtk_widget_set_parent_window() must be called before
gtk_widget_set_parent(), since gtk_widget_set_parent()
will realize the child.
- If a container depended on its children not being mapped
unless it did so itself (for example, GtkNotebook only
mapped the current page), then the new function
gtk_widget_set_child_visible() must be called to keep
widgets that should not be mapped not mapped.
As part of this change, most containers also will no longer need
custom implementations of the map() and unmap() virtual
functions. The only cases where this is necessary are:
- For !NO_WINDOW widgets, if you create children of widget->window
and don't map them in realize() then you must map them
in map(). [ In almost all cases, you can simply map the
windows in realize() ]
- For NO_WINDOW widgets, if you create windows in your realize()
method, you must map then in map() and unmap them in unmap().
......@@ -495,7 +495,6 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
......
......@@ -88,6 +88,14 @@ GTK_VISIBLE:
Set by gtk_widget_hide.
Implies that a widget is not onscreen, therefore !GTK_MAPPED.
GTK_CHILD_VISIBLE
Set by gtk_widget_set_child_visible, and if FALSE indicates that
the widget should not be mapped even if the parent is mapped
and visible. Containers like GtkNotebook use this flag.
A private flag, not a public flag, so if you need to check
this flag, you should call gtk_widget_get_child_visible().
(Should be very rarely necesary.)
GTK_SENSITIVE:
Set and unset by gtk_widget_set_sensitive.
The sensitivity of a widget determines whether it will receive
......@@ -228,10 +236,12 @@ In the following
5) if !GTK_WIDGET_TOPLEVEL (widget):
GTK_WIDGET_MAPPED (widget) => GTK_WIDGET_VISIBLE (widget)
=> GTK_WIDGET_CHILD_VISIBLE (widget)
=> GTK_WIDGET_REALIZED (widget)
widget->parent && GTK_WIDGET_MAPPED (widget->parent) &&
GTK_WIDGET_VISIBLE (widget) => GTK_WIDGET_MAPPED (widget)
GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_CHILD_VISIBLE
=> GTK_WIDGET_MAPPED (widget)
Note:, the definition
......@@ -305,18 +315,9 @@ Adding to a container
When a widget is added to a container, the container:
1) calls gtk_widget_set_parent (widget, container)
2) calls gtk_widget_set_parent_window (widget, window) if
1) calls gtk_widget_set_parent_window (widget, window) if
the widget is being added to something other than container->window
3) if container is realized, and not widget, realizes widget
4) if container is mapped, and not widget and widget is GTK_VISIBLE,
maps widget
5) Queues a resize if the widget is mapped
Note: It would be nice to remove 3) and 4) out of widget specific code
since they are of the invariant-enforcing nature, but it is
a bit hard, since they can't be done until after 2)
2) calls gtk_widget_set_parent (widget, container)
Removing from a container
-------------------------
......@@ -369,7 +370,9 @@ The Map signal
1) Set the MAPPED flag
2) If the widget has any windows, gdk_window_show those windows
3) call gtk_widget_map for all child widgets that are
VISIBLE and !MAPPED.
VISIBLE, CHILD_VISIBLE and !MAPPED. (A widget will only
be !CHILD_VISIBLE if the container set it that way, so
most containers will not have to check this.)
3) Do any other functions related to putting the widget onscreen.
(for instance, showing extra popup windows...)
......
......@@ -29,8 +29,6 @@
static void gtk_bin_class_init (GtkBinClass *klass);
static void gtk_bin_init (GtkBin *bin);
static void gtk_bin_map (GtkWidget *widget);
static void gtk_bin_unmap (GtkWidget *widget);
static void gtk_bin_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_bin_remove (GtkContainer *container,
......@@ -83,9 +81,6 @@ gtk_bin_class_init (GtkBinClass *class)
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
widget_class->map = gtk_bin_map;
widget_class->unmap = gtk_bin_unmap;
container_class->add = gtk_bin_add;
container_class->remove = gtk_bin_remove;
container_class->forall = gtk_bin_forall;
......@@ -110,42 +105,6 @@ gtk_bin_child_type (GtkContainer *container)
return GTK_TYPE_NONE;
}
static void
gtk_bin_map (GtkWidget *widget)
{
GtkBin *bin;
g_return_if_fail (GTK_IS_BIN (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
bin = GTK_BIN (widget);
if (bin->child &&
GTK_WIDGET_VISIBLE (bin->child) &&
!GTK_WIDGET_MAPPED (bin->child))
gtk_widget_map (bin->child);
if (!GTK_WIDGET_NO_WINDOW (widget))
gdk_window_show (widget->window);
}
static void
gtk_bin_unmap (GtkWidget *widget)
{
GtkBin *bin;
g_return_if_fail (GTK_IS_BIN (widget));
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
bin = GTK_BIN (widget);
if (!GTK_WIDGET_NO_WINDOW (widget))
gdk_window_hide (widget->window);
if (bin->child && GTK_WIDGET_MAPPED (bin->child))
gtk_widget_unmap (bin->child);
}
static void
gtk_bin_add (GtkContainer *container,
GtkWidget *child)
......@@ -171,17 +130,6 @@ gtk_bin_add (GtkContainer *container,
gtk_widget_set_parent (child, GTK_WIDGET (bin));
bin->child = child;
if (GTK_WIDGET_REALIZED (child->parent))
gtk_widget_realize (child);
if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
{
if (GTK_WIDGET_MAPPED (child->parent))
gtk_widget_map (child);
gtk_widget_queue_resize (child);
}
}
static void
......
......@@ -52,8 +52,6 @@ static void gtk_box_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_box_map (GtkWidget *widget);
static void gtk_box_unmap (GtkWidget *widget);
static void gtk_box_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_box_remove (GtkContainer *container,
......@@ -115,9 +113,6 @@ gtk_box_class_init (GtkBoxClass *class)
gobject_class->set_property = gtk_box_set_property;
gobject_class->get_property = gtk_box_get_property;
widget_class->map = gtk_box_map;
widget_class->unmap = gtk_box_unmap;
container_class->add = gtk_box_add;
container_class->remove = gtk_box_remove;
container_class->forall = gtk_box_forall;
......@@ -378,16 +373,6 @@ gtk_box_pack_start (GtkBox *box,
gtk_widget_set_parent (child, GTK_WIDGET (box));
if (GTK_WIDGET_REALIZED (box))
gtk_widget_realize (child);
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
{
if (GTK_WIDGET_MAPPED (box))
gtk_widget_map (child);
gtk_widget_queue_resize (child);
}
gtk_widget_child_notify (child, "expand");
gtk_widget_child_notify (child, "fill");
gtk_widget_child_notify (child, "padding");
......@@ -423,16 +408,6 @@ gtk_box_pack_end (GtkBox *box,
gtk_widget_set_parent (child, GTK_WIDGET (box));
if (GTK_WIDGET_REALIZED (box))
gtk_widget_realize (child);
if (GTK_WIDGET_VISIBLE (box) && GTK_WIDGET_VISIBLE (child))
{
if (GTK_WIDGET_MAPPED (box))
gtk_widget_map (child);
gtk_widget_queue_resize (child);
}
gtk_widget_child_notify (child, "expand");
gtk_widget_child_notify (child, "fill");
gtk_widget_child_notify (child, "padding");
......@@ -667,54 +642,6 @@ gtk_box_set_child_packing (GtkBox *box,
gtk_widget_thaw_child_notify (child);
}
static void
gtk_box_map (GtkWidget *widget)
{
GtkBox *box;
GtkBoxChild *child;
GList *children;
g_return_if_fail (GTK_IS_BOX (widget));
box = GTK_BOX (widget);
GTK_WIDGET_SET_FLAGS (box, GTK_MAPPED);
children = box->children;
while (children)
{
child = children->data;
children = children->next;
if (GTK_WIDGET_VISIBLE (child->widget) &&
!GTK_WIDGET_MAPPED (child->widget))
gtk_widget_map (child->widget);
}
}
static void
gtk_box_unmap (GtkWidget *widget)
{
GtkBox *box;
GtkBoxChild *child;
GList *children;
g_return_if_fail (GTK_IS_BOX (widget));
box = GTK_BOX (widget);
GTK_WIDGET_UNSET_FLAGS (box, GTK_MAPPED);
children = box->children;
while (children)
{
child = children->data;
children = children->next;
if (GTK_WIDGET_VISIBLE (child->widget) &&
GTK_WIDGET_MAPPED (child->widget))
gtk_widget_unmap (child->widget);
}
}
static void
gtk_box_add (GtkContainer *container,
GtkWidget *widget)
......
......@@ -98,6 +98,9 @@ static void gtk_container_show_all (GtkWidget *widget);
static void gtk_container_hide_all (GtkWidget *widget);
static gint gtk_container_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_container_map (GtkWidget *widget);
static void gtk_container_unmap (GtkWidget *widget);
static gchar* gtk_container_child_default_composite_name (GtkContainer *container,
GtkWidget *child);
......@@ -186,6 +189,8 @@ gtk_container_class_init (GtkContainerClass *class)
widget_class->show_all = gtk_container_show_all;
widget_class->hide_all = gtk_container_hide_all;
widget_class->expose_event = gtk_container_expose;
widget_class->map = gtk_container_map;
widget_class->unmap = gtk_container_unmap;
widget_class->focus = gtk_container_focus;
class->add = gtk_container_add_unimplemented;
......@@ -2314,6 +2319,41 @@ gtk_container_expose (GtkWidget *widget,
return TRUE;
}
static void
gtk_container_map_child (GtkWidget *child,
gpointer client_data)
{
if (GTK_WIDGET_VISIBLE (child) &&
GTK_WIDGET_CHILD_VISIBLE (child) &&
!GTK_WIDGET_MAPPED (child))
gtk_widget_map (child);
}
static void
gtk_container_map (GtkWidget *widget)
{
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
gtk_container_forall (GTK_CONTAINER (widget),
gtk_container_map_child,
NULL);
if (!GTK_WIDGET_NO_WINDOW (widget))
gdk_window_show (widget->window);
}
static void
gtk_container_unmap (GtkWidget *widget)
{
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
if (!GTK_WIDGET_NO_WINDOW (widget))
gdk_window_hide (widget->window);
else
gtk_container_forall (GTK_CONTAINER (widget),
(GtkCallback)gtk_widget_unmap,
NULL);
}
/**
* gtk_container_propagate_expose:
......
......@@ -191,7 +191,6 @@ void gtk_container_child_get_property (GtkContainer *container,
GtkWidget *child,
const gchar *property_name,
GValue *value);
#define GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID(object, property_id, pspec) \
G_OBJECT_WARN_INVALID_PSPEC ((object), "child property id", (property_id), (pspec))
......
......@@ -29,7 +29,6 @@
static void gtk_fixed_class_init (GtkFixedClass *klass);
static void gtk_fixed_init (GtkFixed *fixed);
static void gtk_fixed_map (GtkWidget *widget);
static void gtk_fixed_realize (GtkWidget *widget);
static void gtk_fixed_size_request (GtkWidget *widget,
GtkRequisition *requisition);
......@@ -87,7 +86,6 @@ gtk_fixed_class_init (GtkFixedClass *class)
parent_class = gtk_type_class (GTK_TYPE_CONTAINER);
widget_class->map = gtk_fixed_map;
widget_class->realize = gtk_fixed_realize;
widget_class->size_request = gtk_fixed_size_request;
widget_class->size_allocate = gtk_fixed_size_allocate;
......@@ -140,17 +138,6 @@ gtk_fixed_put (GtkFixed *fixed,
gtk_widget_set_parent (widget, GTK_WIDGET (fixed));
fixed->children = g_list_append (fixed->children, child_info);
if (GTK_WIDGET_REALIZED (fixed))
gtk_widget_realize (widget);
if (GTK_WIDGET_VISIBLE (fixed) && GTK_WIDGET_VISIBLE (widget))
{
if (GTK_WIDGET_MAPPED (fixed))
gtk_widget_map (widget);
gtk_widget_queue_resize (GTK_WIDGET (fixed));
}
}
void
......@@ -184,32 +171,6 @@ gtk_fixed_move (GtkFixed *fixed,
}
}
static void
gtk_fixed_map (GtkWidget *widget)
{
GtkFixed *fixed;
GtkFixedChild *child;
GList *children;
g_return_if_fail (GTK_IS_FIXED (widget));
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
fixed = GTK_FIXED (widget);
children = fixed->children;
while (children)
{
child = children->data;
children = children->next;
if (GTK_WIDGET_VISIBLE (child->widget) &&
!GTK_WIDGET_MAPPED (child->widget))
gtk_widget_map (child->widget);
}
gdk_window_show (widget->window);
}
static void
gtk_fixed_realize (GtkWidget *widget)
{
......
......@@ -60,8 +60,6 @@ static void gtk_frame_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_frame_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_frame_map (GtkWidget *widget);
static void gtk_frame_unmap (GtkWidget *widget);
static void gtk_frame_remove (GtkContainer *container,
GtkWidget *child);
static void gtk_frame_forall (GtkContainer *container,
......@@ -168,8 +166,6 @@ gtk_frame_class_init (GtkFrameClass *class)
widget_class->expose_event = gtk_frame_expose;
widget_class->size_request = gtk_frame_size_request;
widget_class->size_allocate = gtk_frame_size_allocate;
widget_class->map = gtk_frame_map;
widget_class->unmap = gtk_frame_unmap;
container_class->remove = gtk_frame_remove;
container_class->forall = gtk_frame_forall;
......@@ -638,32 +634,6 @@ gtk_frame_size_allocate (GtkWidget *widget,
}
}
static void
gtk_frame_map (GtkWidget *widget)
{
GtkFrame *frame = GTK_FRAME (widget);
if (frame->label_widget &&
GTK_WIDGET_VISIBLE (frame->label_widget) &&
!GTK_WIDGET_MAPPED (frame->label_widget))
gtk_widget_map (frame->label_widget);
if (GTK_WIDGET_CLASS (parent_class)->map)
(* GTK_WIDGET_CLASS (parent_class)->map) (widget);
}
static void
gtk_frame_unmap (GtkWidget *widget)
{
GtkFrame *frame = GTK_FRAME (widget);
if (GTK_WIDGET_CLASS (parent_class)->unmap)
(* GTK_WIDGET_CLASS (parent_class)->unmap) (widget);
if (frame->label_widget && GTK_WIDGET_MAPPED (frame->label_widget))
gtk_widget_unmap (frame->label_widget);
}
static void
gtk_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *child_allocation)
......
......@@ -87,8 +87,6 @@ enum {
static void gtk_hsv_class_init (GtkHSVClass *class);
static void gtk_hsv_init (GtkHSV *hsv);
static void gtk_hsv_destroy (GtkObject *object);
static void gtk_hsv_map (GtkWidget *widget);
static void gtk_hsv_unmap (GtkWidget *widget);
static void gtk_hsv_realize (GtkWidget *widget);
static void gtk_hsv_unrealize (GtkWidget *widget);
static void gtk_hsv_size_request (GtkWidget *widget,
......@@ -162,8 +160,6 @@ gtk_hsv_class_init (GtkHSVClass *class)
object_class->destroy = gtk_hsv_destroy;
widget_class->map = gtk_hsv_map;
widget_class->unmap = gtk_hsv_unmap;
widget_class->realize = gtk_hsv_realize;
widget_class->unrealize = gtk_hsv_unrealize;
widget_class->size_request = gtk_hsv_size_request;
......@@ -265,42 +261,6 @@ gtk_hsv_destroy (GtkObject *object)
/* Default signal handlers */
/* Map handler for the HSV color selector */
static void
gtk_hsv_map (GtkWidget *widget)
{
GtkHSV *hsv;
HSVPrivate *priv;
hsv = GTK_HSV (widget);
priv = hsv->priv;
if (GTK_WIDGET_MAPPED (widget))
return;
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
gdk_window_show (priv->window);
}
/* Unmap handler for the HSV color selector */
static void
gtk_hsv_unmap (GtkWidget *widget)
{
GtkHSV *hsv;
HSVPrivate *priv;
hsv = GTK_HSV (widget);
priv = hsv->priv;
if (!GTK_WIDGET_MAPPED (widget))
return;
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
gdk_window_hide (priv->window);
}
/* Realize handler for the HSV color selector */