[gnome-panel] libgnome-panel: rename GpMainMenu interface to GpAction
- From: Alberts MuktupÄvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libgnome-panel: rename GpMainMenu interface to GpAction
- Date: Mon, 22 Jan 2018 18:55:48 +0000 (UTC)
commit f443a2f2c2a175c23ecfa7b8c083b18d81da4bca
Author: Alberts MuktupÄvels <alberts muktupavels gmail com>
Date: Mon Jan 22 20:48:22 2018 +0200
libgnome-panel: rename GpMainMenu interface to GpAction
gnome-panel/applet.c | 6 +++---
libgnome-panel/Makefile.am | 6 +++---
...{gp-main-menu-private.h => gp-action-private.h} | 10 +++++-----
libgnome-panel/{gp-main-menu.c => gp-action.c} | 20 +++++++++-----------
libgnome-panel/{gp-main-menu.h => gp-action.h} | 17 ++++++++++-------
5 files changed, 30 insertions(+), 29 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index 67ef19f..fd3567b 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -14,7 +14,7 @@
#include <glib/gi18n.h>
#include <gdk/gdkx.h>
-#include <libgnome-panel/gp-main-menu-private.h>
+#include <libgnome-panel/gp-action-private.h>
#include <libpanel-util/panel-glib.h>
#include <libpanel-util/panel-show.h>
@@ -908,10 +908,10 @@ panel_applet_activate_main_menu (guint32 activate_time)
if (applet == NULL)
continue;
- if (!g_type_is_a (G_TYPE_FROM_INSTANCE (applet), GP_TYPE_MAIN_MENU))
+ if (!g_type_is_a (G_TYPE_FROM_INSTANCE (applet), GP_TYPE_ACTION))
continue;
- if (gp_main_menu_activate (GP_MAIN_MENU (applet), activate_time))
+ if (gp_action_main_menu (GP_ACTION (applet), activate_time))
return TRUE;
}
diff --git a/libgnome-panel/Makefile.am b/libgnome-panel/Makefile.am
index efb1db3..27c127c 100644
--- a/libgnome-panel/Makefile.am
+++ b/libgnome-panel/Makefile.am
@@ -3,6 +3,9 @@ NULL =
noinst_LTLIBRARIES = libgnome-panel.la
libgnome_panel_la_SOURCES = \
+ gp-action-private.h \
+ gp-action.c \
+ gp-action.h \
gp-applet-info-private.h \
gp-applet-info.c \
gp-applet-info.h \
@@ -11,9 +14,6 @@ libgnome_panel_la_SOURCES = \
gp-applet.h \
gp-image-menu-item.c \
gp-image-menu-item.h \
- gp-main-menu-private.h \
- gp-main-menu.c \
- gp-main-menu.h \
gp-module-private.h \
gp-module.c \
gp-module.h \
diff --git a/libgnome-panel/gp-main-menu-private.h b/libgnome-panel/gp-action-private.h
similarity index 78%
rename from libgnome-panel/gp-main-menu-private.h
rename to libgnome-panel/gp-action-private.h
index be544ee..19bf7b1 100644
--- a/libgnome-panel/gp-main-menu-private.h
+++ b/libgnome-panel/gp-action-private.h
@@ -15,15 +15,15 @@
* along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#ifndef GP_MAIN_MENU_PRIVATE_H
-#define GP_MAIN_MENU_PRIVATE_H
+#ifndef GP_ACTION_PRIVATE_H
+#define GP_ACTION_PRIVATE_H
-#include <libgnome-panel/gp-main-menu.h>
+#include <libgnome-panel/gp-action.h>
G_BEGIN_DECLS
-gboolean gp_main_menu_activate (GpMainMenu *main_menu,
- guint32 time);
+gboolean gp_action_main_menu (GpAction *action,
+ guint32 time);
G_END_DECLS
diff --git a/libgnome-panel/gp-main-menu.c b/libgnome-panel/gp-action.c
similarity index 69%
rename from libgnome-panel/gp-main-menu.c
rename to libgnome-panel/gp-action.c
index b3e022c..4f2e90b 100644
--- a/libgnome-panel/gp-main-menu.c
+++ b/libgnome-panel/gp-action.c
@@ -16,27 +16,25 @@
*/
#include "config.h"
-#include "gp-main-menu-private.h"
+#include "gp-action-private.h"
-G_DEFINE_INTERFACE (GpMainMenu, gp_main_menu, G_TYPE_OBJECT)
+G_DEFINE_INTERFACE (GpAction, gp_action, G_TYPE_OBJECT)
static void
-gp_main_menu_default_init (GpMainMenuInterface *iface)
+gp_action_default_init (GpActionInterface *iface)
{
}
gboolean
-gp_main_menu_activate (GpMainMenu *main_menu,
- guint32 time)
+gp_action_main_menu (GpAction *action,
+ guint32 time)
{
- GpMainMenuInterface *iface;
+ GpActionInterface *iface;
- iface = GP_MAIN_MENU_GET_IFACE (main_menu);
+ iface = GP_ACTION_GET_IFACE (action);
- if (iface->activate == NULL)
+ if (iface->main_menu == NULL)
return FALSE;
- iface->activate (main_menu, time);
-
- return TRUE;
+ return iface->main_menu (action, time);
}
diff --git a/libgnome-panel/gp-main-menu.h b/libgnome-panel/gp-action.h
similarity index 72%
rename from libgnome-panel/gp-main-menu.h
rename to libgnome-panel/gp-action.h
index a756043..6ce2be6 100644
--- a/libgnome-panel/gp-main-menu.h
+++ b/libgnome-panel/gp-action.h
@@ -15,22 +15,25 @@
* along with this library; if not, see <https://www.gnu.org/licenses/>.
*/
-#ifndef GP_MAIN_MENU_H
-#define GP_MAIN_MENU_H
+#ifndef GP_ACTION_H
+#define GP_ACTION_H
#include <glib-object.h>
G_BEGIN_DECLS
-#define GP_TYPE_MAIN_MENU (gp_main_menu_get_type ())
-G_DECLARE_INTERFACE (GpMainMenu, gp_main_menu, GP, MAIN_MENU, GObject)
+#define GP_TYPE_ACTION (gp_action_get_type ())
+G_DECLARE_INTERFACE (GpAction, gp_action, GP, ACTION, GObject)
-struct _GpMainMenuInterface
+struct _GpActionInterface
{
GTypeInterface parent;
- void (* activate) (GpMainMenu *main_menu,
- guint32 time);
+ gboolean (* main_menu) (GpAction *action,
+ guint32 time);
+
+ /*< private >*/
+ gpointer padding[10];
};
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]