[gnome-panel] fish: add fish-applet.h
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] fish: add fish-applet.h
- Date: Mon, 17 Oct 2016 17:42:10 +0000 (UTC)
commit e4fcbf7e03a8e29d20a2789de3772dd9a0fa3130
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Oct 17 20:41:58 2016 +0300
fish: add fish-applet.h
applets/fish/Makefile.am | 3 ++-
applets/fish/fish-applet.c | 17 ++++-------------
applets/fish/fish-applet.h | 30 ++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 14 deletions(-)
---
diff --git a/applets/fish/Makefile.am b/applets/fish/Makefile.am
index b7b2d92..2817ba4 100644
--- a/applets/fish/Makefile.am
+++ b/applets/fish/Makefile.am
@@ -13,7 +13,8 @@ libfish_applet_la_CFLAGS = \
$(NULL)
libfish_applet_la_SOURCES = \
- fish.c \
+ fish-applet.c \
+ fish-applet.h \
$(BUILT_SOURCES)
libfish_applet_la_LIBADD = \
diff --git a/applets/fish/fish-applet.c b/applets/fish/fish-applet.c
index bf7c991..ccb963e 100644
--- a/applets/fish/fish-applet.c
+++ b/applets/fish/fish-applet.c
@@ -36,11 +36,7 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#include <panel-applet.h>
-
-#define FISH_APPLET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
- fish_applet_get_type(), \
- FishApplet))
+#include "fish-applet.h"
#define FISH_ICON "gnome-panel-fish"
#define FISH_RESOURCE_PATH "/org/gnome/panel/applet/fish/"
@@ -58,7 +54,8 @@
#define LOCKDOWN_SCHEMA "org.gnome.desktop.lockdown"
#define LOCKDOWN_COMMANDLINE_KEY "disable-command-line"
-typedef struct {
+struct _FishApplet
+{
PanelApplet applet;
GSettings *settings;
@@ -96,11 +93,7 @@ typedef struct {
GIOChannel *io_channel;
gboolean april_fools;
-} FishApplet;
-
-typedef struct {
- PanelAppletClass klass;
-} FishAppletClass;
+};
static gboolean load_fish_image (FishApplet *fish);
static void update_surface (FishApplet *fish);
@@ -109,8 +102,6 @@ static void something_fishy_going_on (FishApplet *fish,
static void display_fortune_dialog (FishApplet *fish);
static void set_tooltip (FishApplet *fish);
-static GType fish_applet_get_type (void);
-
G_DEFINE_TYPE (FishApplet, fish_applet, PANEL_TYPE_APPLET)
static int fools_day = 0;
diff --git a/applets/fish/fish-applet.h b/applets/fish/fish-applet.h
new file mode 100644
index 0000000..c79142a
--- /dev/null
+++ b/applets/fish/fish-applet.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2016 Alberts Muktupāvels
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef FISH_APPLET_H
+#define FISH_APPLET_H
+
+#include <panel-applet.h>
+
+G_BEGIN_DECLS
+
+#define FISH_TYPE_APPLET fish_applet_get_type ()
+G_DECLARE_FINAL_TYPE (FishApplet, fish_applet, FISH, APPLET, PanelApplet)
+
+G_END_DECLS
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]