From 5bc042ba6f83752b899039234220bbaec403f1b1 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 2 Feb 2012 12:17:13 +0000 Subject: [PATCH] Remove override of map/unmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clutter, since version 1.8, does The Right Thing™ inside the default implementation of ClutterActor::map and ClutterActor::unmap, even for non-container actors: it will iterate over the list of children and map, or unmap, each one of them, respectively. This means that the requirement to override map and unmap for composite actors to map and unmap the internal children has been dropped. https://bugzilla.gnome.org/show_bug.cgi?id=669239 --- src/st/st-entry.c | 34 ---------------------------------- src/st/st-label.c | 22 ---------------------- src/st/st-scroll-bar.c | 23 ----------------------- 3 files changed, 79 deletions(-) diff --git a/src/st/st-entry.c b/src/st/st-entry.c index 28f1b1c57..e267c706d 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -547,38 +547,6 @@ st_entry_pick (ClutterActor *actor, clutter_actor_paint (priv->secondary_icon); } -static void -st_entry_map (ClutterActor *actor) -{ - StEntryPrivate *priv = ST_ENTRY (actor)->priv; - - CLUTTER_ACTOR_CLASS (st_entry_parent_class)->map (actor); - - clutter_actor_map (priv->entry); - - if (priv->primary_icon) - clutter_actor_map (priv->primary_icon); - - if (priv->secondary_icon) - clutter_actor_map (priv->secondary_icon); -} - -static void -st_entry_unmap (ClutterActor *actor) -{ - StEntryPrivate *priv = ST_ENTRY (actor)->priv; - - CLUTTER_ACTOR_CLASS (st_entry_parent_class)->unmap (actor); - - clutter_actor_unmap (priv->entry); - - if (priv->primary_icon) - clutter_actor_unmap (priv->primary_icon); - - if (priv->secondary_icon) - clutter_actor_unmap (priv->secondary_icon); -} - static void st_entry_clipboard_callback (StClipboard *clipboard, const gchar *text, @@ -694,8 +662,6 @@ st_entry_class_init (StEntryClass *klass) actor_class->allocate = st_entry_allocate; actor_class->paint = st_entry_paint; actor_class->pick = st_entry_pick; - actor_class->map = st_entry_map; - actor_class->unmap = st_entry_unmap; actor_class->key_press_event = st_entry_key_press_event; actor_class->key_focus_in = st_entry_key_focus_in; diff --git a/src/st/st-label.c b/src/st/st-label.c index 485c5b337..7cbb45da8 100644 --- a/src/st/st-label.c +++ b/src/st/st-label.c @@ -253,26 +253,6 @@ st_label_paint (ClutterActor *actor) clutter_actor_paint (priv->label); } -static void -st_label_map (ClutterActor *actor) -{ - StLabelPrivate *priv = ST_LABEL (actor)->priv; - - CLUTTER_ACTOR_CLASS (st_label_parent_class)->map (actor); - - clutter_actor_map (priv->label); -} - -static void -st_label_unmap (ClutterActor *actor) -{ - StLabelPrivate *priv = ST_LABEL (actor)->priv; - - CLUTTER_ACTOR_CLASS (st_label_parent_class)->unmap (actor); - - clutter_actor_unmap (priv->label); -} - static void st_label_class_init (StLabelClass *klass) { @@ -291,8 +271,6 @@ st_label_class_init (StLabelClass *klass) actor_class->allocate = st_label_allocate; actor_class->get_preferred_width = st_label_get_preferred_width; actor_class->get_preferred_height = st_label_get_preferred_height; - actor_class->map = st_label_map; - actor_class->unmap = st_label_unmap; widget_class->style_changed = st_label_style_changed; widget_class->get_accessible_type = st_label_accessible_get_type; diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c index ce0c3c5a2..354be2a85 100644 --- a/src/st/st-scroll-bar.c +++ b/src/st/st-scroll-bar.c @@ -242,21 +242,6 @@ st_scroll_bar_pick (ClutterActor *actor, clutter_actor_paint (priv->handle); } -static void -st_scroll_bar_map (ClutterActor *actor) -{ - StScrollBarPrivate *priv = ST_SCROLL_BAR (actor)->priv; - - CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->map (actor); - - clutter_actor_map (priv->bw_stepper); - clutter_actor_map (priv->fw_stepper); - clutter_actor_map (priv->trough); - - if (priv->handle) - clutter_actor_map (priv->handle); -} - static void st_scroll_bar_unmap (ClutterActor *actor) { @@ -265,13 +250,6 @@ st_scroll_bar_unmap (ClutterActor *actor) CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->unmap (actor); stop_scrolling (ST_SCROLL_BAR (actor)); - - clutter_actor_unmap (priv->bw_stepper); - clutter_actor_unmap (priv->fw_stepper); - clutter_actor_unmap (priv->trough); - - if (priv->handle) - clutter_actor_unmap (priv->handle); } static void @@ -687,7 +665,6 @@ st_scroll_bar_class_init (StScrollBarClass *klass) actor_class->paint = st_scroll_bar_paint; actor_class->pick = st_scroll_bar_pick; actor_class->scroll_event = st_scroll_bar_scroll_event; - actor_class->map = st_scroll_bar_map; actor_class->unmap = st_scroll_bar_unmap; widget_class->style_changed = st_scroll_bar_style_changed;