~aacid/compiz/do_not_change_viewport_on_resize

« back to all changes in this revision

Viewing changes to gtk/window-decorator/gwd-settings.h

Transitions gtk-window-decorator over to use GSettings.

Add a testing framework for the options code.

1) Introduced three new interfaces (GWDSettingsNotifiedInterface, GWDSettingsWritableInterface, GWDSettingsInterface, GWDSettingsStorageInterface
2) GWDSettingsStorageInterface represents the actual method for settings to be read from a configuration backend, eg GSettings or GConf
3) GWDSettingsWritableInterface is injected into GWDSettingsStorageGConf and GWDSettingsStorageGSettings, and its methods are called when changes occur on the backend
4) GWDSettings is the main object for storing all settings in memory and provides an interface for them being written into
5) GWDSettingsNotifiedInterface provides a callback mechanism for GWDSettings to update the main program state whenever a setting changes.

Fixes (LP: #1042323). Fixes: https://bugs.launchpad.net/bugs/1042323. Approved by Daniel van Vugt, jenkins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2012 Canonical Ltd
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software Foundation,
 
16
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
#ifndef _COMPIZ_GWD_SETTINGS_H
 
20
#define _COMPIZ_GWD_SETTINGS_H
 
21
 
 
22
#include <glib-object.h>
 
23
 
 
24
typedef struct _GWDSettings GWDSettings;
 
25
typedef struct _GWDSettingsNotified GWDSettingsNotified;
 
26
 
 
27
G_BEGIN_DECLS
 
28
 
 
29
#define GWD_TYPE_SETTINGS_IMPL (gwd_settings_impl_get_type ())
 
30
GType gwd_settings_impl_get_type ();
 
31
 
 
32
GWDSettings *
 
33
gwd_settings_impl_new (gint *blur,
 
34
                       const gchar **metacity_theme,
 
35
                       GWDSettingsNotified *notified);
 
36
 
 
37
extern const guint GWD_SETTINGS_IMPL_N_CONSTRUCTION_PARAMS;
 
38
 
 
39
G_END_DECLS
 
40
 
 
41
#endif