Commit 59ebbbbc authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

watcher: initial version

parent da955790
......@@ -82,7 +82,7 @@ dnl **************************************************************************
GLIB_GSETTINGS
dnl **************************************************************************
dnl Check forrequired packages
dnl Check for required packages
dnl **************************************************************************
GTK_REQUIRED=3.15.2
......@@ -196,6 +196,25 @@ PKG_CHECK_MODULES([WORKAROUNDS], [
x11
])
dnl **************************************************************************
dnl Build with libstatus-notifier (experimental)
dnl **************************************************************************
AC_ARG_WITH([libstatus-notifier],
[AS_HELP_STRING([--with-libstatus-notifier],
[Build with libstatus-notifier (experimental)])],
[with_libstatus_notifier="$withval"],
[with_libstatus_notifier=no])
AS_IF([test "x$with_libstatus_notifier" = "xyes"], [
PKG_CHECK_MODULES([WATCHER], [libstatus-notifier-3.0])
AC_DEFINE([WITH_LIBSTATUS_NOTIFIER], [1],
[Define to 1 if libstatus-notifier is available])
])
AM_CONDITIONAL([WITH_LIBSTATUS_NOTIFIER],
[test "x$with_libstatus_notifier" = "xyes"])
dnl **************************************************************************
dnl Define XKB base directory
dnl **************************************************************************
......@@ -250,6 +269,7 @@ AC_CONFIG_FILES([
gnome-flashback/libshell/Makefile
gnome-flashback/libsound-applet/Makefile
gnome-flashback/libsound-applet/gvc/Makefile
gnome-flashback/libwatcher/Makefile
gnome-flashback/libworkarounds/Makefile
po/Makefile.in
......@@ -276,3 +296,5 @@ echo " libdir ......................: ${libdir}"
echo " sysconfdir ..................: ${sysconfdir}"
echo " libexecdir ..................: ${libexecdir}"
echo ""
echo " with libstatus-notifier .....: ${with_libstatus_notifier}"
echo ""
......@@ -79,6 +79,12 @@
<description>If set to true, then GNOME Flashback application will be used to show a sound applet. This is the same sound applet that used to be a part of GNOME Control Center.</description>
</key>
<key name="watcher" type="b">
<default>true</default>
<summary>Status Notifier Watcher</summary>
<description>If set to true, then GNOME Flashback application will be used as Status Notifier Watcher.</description>
</key>
<key name="workarounds" type="b">
<default>true</default>
<summary>Workarounds</summary>
......
......@@ -18,6 +18,10 @@ SUBDIRS = \
libworkarounds \
$(NULL)
if WITH_LIBSTATUS_NOTIFIER
SUBDIRS += libwatcher
endif
bin_PROGRAMS = \
gnome-flashback \
$(NULL)
......@@ -62,6 +66,10 @@ gnome_flashback_LDADD = \
$(top_builddir)/gnome-flashback/libworkarounds/libworkarounds.la \
$(NULL)
if WITH_LIBSTATUS_NOTIFIER
gnome_flashback_LDADD += $(top_builddir)/gnome-flashback/libwatcher/libwatcher.la
endif
gf-resources.c: flashback.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/flashback.gresource.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate --c-name gf $<
......
......@@ -36,6 +36,10 @@
#include "libsound-applet/gf-sound-applet.h"
#include "libworkarounds/gf-workarounds.h"
#ifdef WITH_LIBSTATUS_NOTIFIER
#include "libwatcher/gf-watcher.h"
#endif
struct _GfApplication
{
GObject parent;
......@@ -60,6 +64,10 @@ struct _GfApplication
GfScreenshot *screenshot;
GfSoundApplet *sound;
GfWorkarounds *workarounds;
#ifdef WITH_LIBSTATUS_NOTIFIER
GfWatcher *watcher;
#endif
};
G_DEFINE_TYPE (GfApplication, gf_application, G_TYPE_OBJECT)
......@@ -153,6 +161,10 @@ settings_changed (GSettings *settings,
SETTING_CHANGED (sound, "sound-applet", gf_sound_applet_new)
SETTING_CHANGED (workarounds, "workarounds", gf_workarounds_new)
#ifdef WITH_LIBSTATUS_NOTIFIER
SETTING_CHANGED (watcher, "watcher", gf_watcher_new)
#endif
#undef SETTING_CHANGED
if (application->shell)
......@@ -193,6 +205,10 @@ gf_application_dispose (GObject *object)
g_clear_object (&application->sound);
g_clear_object (&application->workarounds);
#ifdef WITH_LIBSTATUS_NOTIFIER
g_clear_object (&application->watcher);
#endif
G_OBJECT_CLASS (gf_application_parent_class)->dispose (object);
}
......
NULL =
noinst_LTLIBRARIES = \
libwatcher.la \
$(NULL)
libwatcher_la_CPPFLAGS = \
-I$(top_builddir)/gnome-flashback/libwatcher \
$(NULL)
libwatcher_la_CFLAGS = \
$(WATCHER_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS) \
$(NULL)
libwatcher_la_SOURCES = \
gf-watcher.c \
gf-watcher.h \
$(NULL)
libwatcher_la_LDFLAGS = \
$(WARN_LDFLAGS) \
$(AM_LDFLAGS) \
$(NULL)
libwatcher_la_LIBADD = \
$(WATCHER_LIBS) \
$(NULL)
-include $(top_srcdir)/git.mk
/*
* Copyright (C) 2015 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 3 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/>.
*/
#include "config.h"
#include <libstatus-notifier/sn.h>
#include "gf-watcher.h"
struct _GfWatcher
{
GObject parent;
SnWatcher *watcher;
};
G_DEFINE_TYPE (GfWatcher, gf_watcher, G_TYPE_OBJECT)
static void
gf_watcher_finalize (GObject *object)
{
GfWatcher *watcher;
watcher = GF_WATCHER (object);
g_clear_object (&watcher->watcher);
G_OBJECT_CLASS (gf_watcher_parent_class)->finalize (object);
}
static void
gf_watcher_class_init (GfWatcherClass *watcher_class)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (watcher_class);
object_class->finalize = gf_watcher_finalize;
}
static void
gf_watcher_init (GfWatcher *watcher)
{
watcher->watcher = sn_watcher_new ();
}
GfWatcher *
gf_watcher_new (void)
{
return g_object_new (GF_TYPE_WATCHER, NULL);
}
/*
* Copyright (C) 2015 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 3 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 GF_WATCHER_H
#define GF_WATCHER_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GF_TYPE_WATCHER gf_watcher_get_type ()
G_DECLARE_FINAL_TYPE (GfWatcher, gf_watcher, GF, WATCHER, GObject)
GfWatcher *gf_watcher_new (void);
G_END_DECLS
#endif
......@@ -77,12 +77,13 @@
</after>
</autotools>
<autotools id="gnome-flashback">
<autotools id="gnome-flashback" autogenargs="--with-libstatus-notifier=yes">
<branch />
<dependencies>
<dep package="intltool" />
<dep package="gnome-desktop" />
<dep package="gtk+" />
<dep package="libstatus-notifier" />
<dep package="m4-common" />
</dependencies>
</autotools>
......@@ -112,6 +113,7 @@
<dependencies>
<dep package="glib" />
<dep package="gtk-doc" />
<dep package="gtk+" />
<dep package="m4-common" />
</dependencies>
</autotools>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment