[gnome-panel] libgnome-panel: add GpMainMenu interface
- From: Alberts MuktupÄvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libgnome-panel: add GpMainMenu interface
- Date: Thu, 11 Jan 2018 17:41:06 +0000 (UTC)
commit 2c5c5da45108be3122ac441ee5932d0619b05085
Author: Alberts MuktupÄvels <alberts muktupavels gmail com>
Date: Thu Jan 11 18:37:38 2018 +0200
libgnome-panel: add GpMainMenu interface
libgnome-panel/Makefile.am | 11 +++++---
libgnome-panel/gp-main-menu-private.h | 30 +++++++++++++++++++++++
libgnome-panel/gp-main-menu.c | 42 +++++++++++++++++++++++++++++++++
libgnome-panel/gp-main-menu.h | 38 +++++++++++++++++++++++++++++
4 files changed, 117 insertions(+), 4 deletions(-)
---
diff --git a/libgnome-panel/Makefile.am b/libgnome-panel/Makefile.am
index 7eef6d0..29b7af1 100644
--- a/libgnome-panel/Makefile.am
+++ b/libgnome-panel/Makefile.am
@@ -3,15 +3,18 @@ NULL =
noinst_LTLIBRARIES = libgnome-panel.la
libgnome_panel_la_SOURCES = \
- gp-applet.c \
- gp-applet.h \
+ gp-applet-info-private.h \
gp-applet-info.c \
gp-applet-info.h \
- gp-applet-info-private.h \
gp-applet-private.h \
+ gp-applet.c \
+ gp-applet.h \
+ gp-main-menu-private.h \
+ gp-main-menu.c \
+ gp-main-menu.h \
+ gp-module-private.h \
gp-module.c \
gp-module.h \
- gp-module-private.h \
$(BUILT_SOURCES) \
$(NULL)
diff --git a/libgnome-panel/gp-main-menu-private.h b/libgnome-panel/gp-main-menu-private.h
new file mode 100644
index 0000000..be544ee
--- /dev/null
+++ b/libgnome-panel/gp-main-menu-private.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 Alberts MuktupÄvels
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef GP_MAIN_MENU_PRIVATE_H
+#define GP_MAIN_MENU_PRIVATE_H
+
+#include <libgnome-panel/gp-main-menu.h>
+
+G_BEGIN_DECLS
+
+gboolean gp_main_menu_activate (GpMainMenu *main_menu,
+ guint32 time);
+
+G_END_DECLS
+
+#endif
diff --git a/libgnome-panel/gp-main-menu.c b/libgnome-panel/gp-main-menu.c
new file mode 100644
index 0000000..b3e022c
--- /dev/null
+++ b/libgnome-panel/gp-main-menu.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2018 Alberts MuktupÄvels
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+#include "gp-main-menu-private.h"
+
+G_DEFINE_INTERFACE (GpMainMenu, gp_main_menu, G_TYPE_OBJECT)
+
+static void
+gp_main_menu_default_init (GpMainMenuInterface *iface)
+{
+}
+
+gboolean
+gp_main_menu_activate (GpMainMenu *main_menu,
+ guint32 time)
+{
+ GpMainMenuInterface *iface;
+
+ iface = GP_MAIN_MENU_GET_IFACE (main_menu);
+
+ if (iface->activate == NULL)
+ return FALSE;
+
+ iface->activate (main_menu, time);
+
+ return TRUE;
+}
diff --git a/libgnome-panel/gp-main-menu.h b/libgnome-panel/gp-main-menu.h
new file mode 100644
index 0000000..a756043
--- /dev/null
+++ b/libgnome-panel/gp-main-menu.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 Alberts MuktupÄvels
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef GP_MAIN_MENU_H
+#define GP_MAIN_MENU_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)
+
+struct _GpMainMenuInterface
+{
+ GTypeInterface parent;
+
+ void (* activate) (GpMainMenu *main_menu,
+ guint32 time);
+};
+
+G_END_DECLS
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]