[gnome-flashback] workarounds: initial version



commit f0ec5b40f5f0cfc23e6d101428fb7d85ed5892b7
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jun 2 23:19:18 2015 +0300

    workarounds: initial version

 configure.ac                                       |    5 ++
 data/org.gnome.gnome-flashback.gschema.xml.in.in   |    9 +++
 gnome-flashback/Makefile.am                        |   10 +++-
 gnome-flashback/flashback-application.c            |    4 ++
 gnome-flashback/libworkarounds/Makefile.am         |   21 ++++++++
 .../libworkarounds/flashback-workarounds.c         |   54 ++++++++++++++++++++
 .../libworkarounds/flashback-workarounds.h         |   33 ++++++++++++
 7 files changed, 134 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index b799bb7..8f37f0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,10 @@ PKG_CHECK_MODULES(SOUND_APPLET, gtk+-3.0 >= $GTK_REQUIRED libcanberra-gtk3 >= $C
 AC_SUBST(SOUND_APPLET_CFLAGS)
 AC_SUBST(SOUND_APPLET_LIBS)
 
+PKG_CHECK_MODULES(WORKAROUNDS, glib-2.0 >= $GLIB_REQUIRED)
+AC_SUBST(WORKAROUNDS_CFLAGS)
+AC_SUBST(WORKAROUNDS_LIBS)
+
 AC_CONFIG_FILES([
 Makefile
 data/Makefile
@@ -90,6 +94,7 @@ gnome-flashback/libscreenshot/Makefile
 gnome-flashback/libshell/Makefile
 gnome-flashback/libsound-applet/Makefile
 gnome-flashback/libsound-applet/gvc/Makefile
+gnome-flashback/libworkarounds/Makefile
 po/Makefile.in
 ])
 
diff --git a/data/org.gnome.gnome-flashback.gschema.xml.in.in 
b/data/org.gnome.gnome-flashback.gschema.xml.in.in
index 09fb265..23b13e9 100644
--- a/data/org.gnome.gnome-flashback.gschema.xml.in.in
+++ b/data/org.gnome.gnome-flashback.gschema.xml.in.in
@@ -45,8 +45,14 @@
                        <_summary>Sound applet</_summary>
                        <_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="workarounds" type="b">
+                       <default>true</default>
+                       <_summary>Workarounds</_summary>
+                       <_description>If set to true, then GNOME Flashback application will use workarounds 
to fix bugs.</_description>
+               </key>
 
                <child name="desktop-background" schema="org.gnome.gnome-flashback.desktop-background"/>
+               <child name="workarounds" schema="org.gnome.gnome-flashback.workarounds"/>
        </schema>
 
        <schema id="org.gnome.gnome-flashback.desktop-background" 
path="/org/gnome/gnome-flashback/desktop-background/">
@@ -56,4 +62,7 @@
                        <_description>If set to true, then fade effect will be used to change the desktop 
background.</_description>
                </key>
        </schema>
+
+       <schema id="org.gnome.gnome-flashback.workarounds" path="/org/gnome/gnome-flashback/workarounds/">
+       </schema>
 </schemalist>
diff --git a/gnome-flashback/Makefile.am b/gnome-flashback/Makefile.am
index de87a1b..18a77bd 100644
--- a/gnome-flashback/Makefile.am
+++ b/gnome-flashback/Makefile.am
@@ -1,3 +1,5 @@
+NULL =
+
 SUBDIRS = \
        libautomount-manager \
        libdesktop-background \
@@ -7,7 +9,9 @@ SUBDIRS = \
        libscreencast \
        libscreenshot \
        libshell \
-       libsound-applet
+       libsound-applet \
+       libworkarounds \
+       $(NULL)
 
 bin_PROGRAMS = \
        gnome-flashback
@@ -35,7 +39,9 @@ gnome_flashback_LDADD = \
        $(top_builddir)/gnome-flashback/libscreencast/libscreencast.la \
        $(top_builddir)/gnome-flashback/libscreenshot/libscreenshot.la \
        $(top_builddir)/gnome-flashback/libshell/libshell.la \
-       $(top_builddir)/gnome-flashback/libsound-applet/libsound-applet.la
+       $(top_builddir)/gnome-flashback/libsound-applet/libsound-applet.la \
+       $(top_builddir)/gnome-flashback/libworkarounds/libworkarounds.la \
+       $(NULL)
 
 flashback-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 flashback 
$<
diff --git a/gnome-flashback/flashback-application.c b/gnome-flashback/flashback-application.c
index c5732a6..55440ca 100644
--- a/gnome-flashback/flashback-application.c
+++ b/gnome-flashback/flashback-application.c
@@ -28,6 +28,7 @@
 #include "libscreenshot/flashback-screenshot.h"
 #include "libshell/flashback-shell.h"
 #include "libsound-applet/gvc-applet.h"
+#include "libworkarounds/flashback-workarounds.h"
 
 struct _FlashbackApplication
 {
@@ -48,6 +49,7 @@ struct _FlashbackApplication
   FlashbackScreenshot       *screenshot;
   FlashbackShell            *shell;
   GvcApplet                 *applet;
+  FlashbackWorkarounds      *workarounds;
 };
 
 G_DEFINE_TYPE (FlashbackApplication, flashback_application, G_TYPE_OBJECT)
@@ -135,6 +137,7 @@ settings_changed (GSettings   *settings,
   SETTING_CHANGED (screenshot, "screenshot", flashback_screenshot_new)
   SETTING_CHANGED (shell, "shell", flashback_shell_new)
   SETTING_CHANGED (applet, "sound-applet", gvc_applet_new)
+  SETTING_CHANGED (workarounds, "workarounds", flashback_workarounds_new)
 
 #undef SETTING_CHANGED
 
@@ -168,6 +171,7 @@ flashback_application_finalize (GObject *object)
   g_clear_object (&application->screenshot);
   g_clear_object (&application->shell);
   g_clear_object (&application->applet);
+  g_clear_object (&application->workarounds);
 
   G_OBJECT_CLASS (flashback_application_parent_class)->finalize (object);
 }
diff --git a/gnome-flashback/libworkarounds/Makefile.am b/gnome-flashback/libworkarounds/Makefile.am
new file mode 100644
index 0000000..f71736e
--- /dev/null
+++ b/gnome-flashback/libworkarounds/Makefile.am
@@ -0,0 +1,21 @@
+NULL =
+
+noinst_LTLIBRARIES = \
+       libworkarounds.la \
+       $(NULL)
+
+AM_CPPFLAGS = \
+       $(IDLE_MONITOR_CFLAGS) \
+       -I$(top_builddir)/gnome-flashback/libworkarounds \
+       $(NULL)
+
+libworkarounds_la_SOURCES = \
+       flashback-workarounds.c \
+       flashback-workarounds.h \
+       $(NULL)
+
+libworkarounds_la_LIBADD = \
+       $(IDLE_MONITOR_LIBS) \
+       $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/gnome-flashback/libworkarounds/flashback-workarounds.c 
b/gnome-flashback/libworkarounds/flashback-workarounds.c
new file mode 100644
index 0000000..a388391
--- /dev/null
+++ b/gnome-flashback/libworkarounds/flashback-workarounds.c
@@ -0,0 +1,54 @@
+/*
+ * 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 "flashback-workarounds.h"
+
+struct _FlashbackWorkarounds
+{
+  GObject parent;
+};
+
+G_DEFINE_TYPE (FlashbackWorkarounds, flashback_workarounds, G_TYPE_OBJECT)
+
+static void
+flashback_workarounds_dispose (GObject *object)
+{
+  G_OBJECT_CLASS (flashback_workarounds_parent_class)->dispose (object);
+}
+
+static void
+flashback_workarounds_class_init (FlashbackWorkaroundsClass *workarounds_class)
+{
+  GObjectClass *object_class;
+
+  object_class = G_OBJECT_CLASS (workarounds_class);
+
+  object_class->dispose = flashback_workarounds_dispose;
+}
+
+static void
+flashback_workarounds_init (FlashbackWorkarounds *workarounds)
+{
+}
+
+FlashbackWorkarounds *
+flashback_workarounds_new (void)
+{
+       return g_object_new (FLASHBACK_TYPE_WORKAROUNDS, NULL);
+}
diff --git a/gnome-flashback/libworkarounds/flashback-workarounds.h 
b/gnome-flashback/libworkarounds/flashback-workarounds.h
new file mode 100644
index 0000000..fba2969
--- /dev/null
+++ b/gnome-flashback/libworkarounds/flashback-workarounds.h
@@ -0,0 +1,33 @@
+/*
+ * 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 FLASHBACK_WORKAROUNDS_H
+#define FLASHBACK_WORKAROUNDS_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define FLASHBACK_TYPE_WORKAROUNDS flashback_workarounds_get_type ()
+G_DECLARE_FINAL_TYPE (FlashbackWorkarounds, flashback_workarounds,
+                      FLASHBACK, WORKAROUNDS, GObject)
+
+FlashbackWorkarounds *flashback_workarounds_new (void);
+
+G_END_DECLS
+
+#endif


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