[gnome-panel/wip/muktupavels/launcher: 2/4] libgnome-panel: add gp_applet_remove_from_panel



commit 2137ce618ab97779285ba360cc899b1aa7a7328b
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Apr 12 13:13:29 2020 +0300

    libgnome-panel: add gp_applet_remove_from_panel

 libgnome-panel/gp-applet-private.h | 22 ++++++++++++----------
 libgnome-panel/gp-applet.c         |  9 +++++++++
 libgnome-panel/gp-applet.h         |  6 +++++-
 3 files changed, 26 insertions(+), 11 deletions(-)
---
diff --git a/libgnome-panel/gp-applet-private.h b/libgnome-panel/gp-applet-private.h
index b2fb0328d..a597facdb 100644
--- a/libgnome-panel/gp-applet-private.h
+++ b/libgnome-panel/gp-applet-private.h
@@ -27,21 +27,23 @@
 
 G_BEGIN_DECLS
 
-void           gp_applet_set_locked_down (GpApplet        *applet,
-                                          gboolean         locked_down);
+void           gp_applet_set_locked_down   (GpApplet        *applet,
+                                            gboolean         locked_down);
 
-void           gp_applet_set_orientation (GpApplet        *applet,
-                                          GtkOrientation   orientation);
+void           gp_applet_set_orientation   (GpApplet        *applet,
+                                            GtkOrientation   orientation);
 
-void           gp_applet_set_position    (GpApplet        *applet,
-                                          GtkPositionType  position);
+void           gp_applet_set_position      (GpApplet        *applet,
+                                            GtkPositionType  position);
 
-GpAppletFlags  gp_applet_get_flags       (GpApplet        *applet);
+GpAppletFlags  gp_applet_get_flags         (GpApplet        *applet);
 
-gint          *gp_applet_get_size_hints  (GpApplet        *applet,
-                                          guint           *n_elements);
+gint          *gp_applet_get_size_hints    (GpApplet        *applet,
+                                            guint           *n_elements);
 
-GtkWidget     *gp_applet_get_menu        (GpApplet        *applet);
+GtkWidget     *gp_applet_get_menu          (GpApplet        *applet);
+
+void           gp_applet_remove_from_panel (GpApplet        *self);
 
 G_END_DECLS
 
diff --git a/libgnome-panel/gp-applet.c b/libgnome-panel/gp-applet.c
index bebd44c95..3d1c2bf95 100644
--- a/libgnome-panel/gp-applet.c
+++ b/libgnome-panel/gp-applet.c
@@ -1328,6 +1328,15 @@ gp_applet_get_menu (GpApplet *applet)
   return gtk_menu_new_from_model (G_MENU_MODEL (object));
 }
 
+void
+gp_applet_remove_from_panel (GpApplet *self)
+{
+  if (GP_APPLET_GET_CLASS (self)->remove_from_panel == NULL)
+    return;
+
+  GP_APPLET_GET_CLASS (self)->remove_from_panel (self);
+}
+
 /**
  * gp_applet_get_prefer_symbolic_icons:
  * @applet: a #GpApplet
diff --git a/libgnome-panel/gp-applet.h b/libgnome-panel/gp-applet.h
index 1b2498aa7..005411419 100644
--- a/libgnome-panel/gp-applet.h
+++ b/libgnome-panel/gp-applet.h
@@ -62,6 +62,8 @@ typedef enum
  * @initial_setup: virtual method called when applet has initial settings
  * @placement_changed: Signal is emitted when the orientation or position
  *     properties of applet has changed.
+ * @remove_from_panel: virtual method called when applet is removed from
+ *     panel.
  *
  * The class structure for the #GpApplet class.
  */
@@ -76,8 +78,10 @@ struct _GpAppletClass
                                 GtkOrientation   orientation,
                                 GtkPositionType  position);
 
+  void (* remove_from_panel)   (GpApplet        *self);
+
   /*< private >*/
-  gpointer padding[10];
+  gpointer padding[9];
 };
 
 gboolean         gp_applet_get_locked_down           (GpApplet           *applet);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]