Move code out of window capplet into a seperate library so the settings
2002-05-14 Seth Nickell <snickell@stanford.edu> * .cvsignore: * Makefile.am: * gnome-window-manager.c: (gnome_window_manager_new): * gnome-window-manager.h: Move code out of window capplet into a seperate library so the settings daemon can avail of it.
This commit is contained in:
parent
957afeae78
commit
9ad97b920e
5 changed files with 127 additions and 0 deletions
11
libwindow-settings/.cvsignore
Normal file
11
libwindow-settings/.cvsignore
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
.deps
|
||||||
|
.libs
|
||||||
|
*.o
|
||||||
|
*.lo
|
||||||
|
*.la
|
||||||
|
gnome-window-properties
|
||||||
|
window-properties.desktop
|
||||||
|
*.oaf
|
||||||
|
*.gladep
|
9
libwindow-settings/ChangeLog
Normal file
9
libwindow-settings/ChangeLog
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
2002-05-14 Seth Nickell <snickell@stanford.edu>
|
||||||
|
|
||||||
|
* .cvsignore:
|
||||||
|
* Makefile.am:
|
||||||
|
* gnome-window-manager.c: (gnome_window_manager_new):
|
||||||
|
* gnome-window-manager.h:
|
||||||
|
|
||||||
|
Move code out of window capplet into a seperate library so the settings
|
||||||
|
daemon can avail of it.
|
17
libwindow-settings/Makefile.am
Normal file
17
libwindow-settings/Makefile.am
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
EXTRA_DIST = ChangeLog
|
||||||
|
|
||||||
|
INCLUDES = \
|
||||||
|
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
|
||||||
|
-DGNOME_ICONDIR=\""${prefix}/share/pixmaps"\" \
|
||||||
|
-DG_LOG_DOMAIN=\"capplet-common\" \
|
||||||
|
-DGNOME_WINDOW_MANAGER_MODULE_PATH=\""$(libdir)/window-manager-settings"\" \
|
||||||
|
-I$(top_srcdir)/ \
|
||||||
|
@CAPPLET_CFLAGS@
|
||||||
|
|
||||||
|
noinst_LTLIBRARIES = libwindow-settings.la
|
||||||
|
|
||||||
|
libwindow_settings_la_SOURCES = \
|
||||||
|
gnome-window-manager.c \
|
||||||
|
gnome-window-manager.h
|
||||||
|
|
||||||
|
libwindow_settings_la_LIBADD = $(GNOMECC_CAPPLETS_LIBS)
|
37
libwindow-settings/gnome-window-manager.c
Normal file
37
libwindow-settings/gnome-window-manager.c
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#include "gnome-window-manager.h"
|
||||||
|
|
||||||
|
#include <gmodule.h>
|
||||||
|
|
||||||
|
GObject *
|
||||||
|
gnome_window_manager_new (GnomeDesktopItem *item)
|
||||||
|
{
|
||||||
|
const char *settings_lib;
|
||||||
|
char *module_name;
|
||||||
|
GnomeWindowManagerNewFunc wm_new_func = NULL;
|
||||||
|
GObject *wm;
|
||||||
|
GModule *module;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
|
settings_lib = gnome_desktop_item_get_string (item, "GnomeSettingsLibrary");
|
||||||
|
|
||||||
|
module_name = g_module_build_path (GNOME_WINDOW_MANAGER_MODULE_PATH,
|
||||||
|
settings_lib);
|
||||||
|
|
||||||
|
module = g_module_open (module_name, G_MODULE_BIND_LAZY);
|
||||||
|
if (module == NULL) {
|
||||||
|
g_warning ("Couldn't load window manager settings module `%s' (%s)", module_name, g_module_error ());
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
success = g_module_symbol (module, "window_manager_new",
|
||||||
|
(gpointer *) &wm_new_func);
|
||||||
|
|
||||||
|
if ((!success) || wm_new_func == NULL) {
|
||||||
|
g_warning ("Couldn't load window manager settings module `%s`, couldn't find symbol \'window_manager_new\'", module_name);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wm = (wm_new_func) ();
|
||||||
|
|
||||||
|
return (wm);
|
||||||
|
}
|
53
libwindow-settings/gnome-window-manager.h
Normal file
53
libwindow-settings/gnome-window-manager.h
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
#ifndef GNOME_WINDOW_MANAGER_H
|
||||||
|
#define GNOME_WINDOW_MANAGER_H
|
||||||
|
|
||||||
|
#include <glib/gerror.h>
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
|
#include <libgnome/gnome-desktop-item.h>
|
||||||
|
|
||||||
|
typedef GObject * (* GnomeWindowManagerNewFunc) (void);
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GNOME_WINDOW_MANAGER_TYPE (gnome_window_manager_get_type ())
|
||||||
|
#define GNOME_WINDOW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_WINDOW_MANAGER_TYPE, GnomeWindowManager))
|
||||||
|
#define GNOME_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_WINDOW_MANAGER_TYPE, GnomeWindowManagerClass))
|
||||||
|
#define IS_GNOME_WINDOW_MANAGER(obj) (GTK_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_WINDOW_MANAGER_TYPE))
|
||||||
|
#define IS_GNOME_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_WINDOW_MANAGER_TYPE))
|
||||||
|
#define GNOME_WINDOW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_WINDOW_MANAGER_TYPE, GnomeWindowManagerClass))
|
||||||
|
|
||||||
|
#define GNOME_WINDOW_MANAGER_ERROR gnome_window_manager_error_quark ()
|
||||||
|
|
||||||
|
typedef struct _GnomeWindowManager GnomeWindowManager;
|
||||||
|
typedef struct _GnomeWindowManagerClass GnomeWindowManagerClass;
|
||||||
|
typedef struct _GnomeWindowManagerPrivate GnomeWindowManagerPrivate;
|
||||||
|
|
||||||
|
struct _GnomeWindowManager
|
||||||
|
{
|
||||||
|
GObject parent_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _GnomeWindowManagerClass
|
||||||
|
{
|
||||||
|
GObjectClass parent_class;
|
||||||
|
|
||||||
|
void (*set_theme) (const char *theme_name);
|
||||||
|
GList * (*get_theme_list) (void);
|
||||||
|
void (*set_font) (const char *font);
|
||||||
|
gboolean (*get_focus_follows_mouse) (void);
|
||||||
|
void (*set_focus_follows_mouse) (gboolean focus_follows_mouse);
|
||||||
|
};
|
||||||
|
|
||||||
|
GObject *gnome_window_manager_new (GnomeDesktopItem *item);
|
||||||
|
|
||||||
|
GType gnome_window_manager_get_type (void);
|
||||||
|
void gnome_window_manager_set_theme (const char *theme_name);
|
||||||
|
GList * gnome_window_manager_get_theme_list (void);
|
||||||
|
void gnome_window_manager_set_font (const char *font);
|
||||||
|
gboolean gnome_window_manager_get_focus_follows_mouse (void);
|
||||||
|
void gnome_window_manager_set_focus_follows_mouse (gboolean focus_follows_mouse);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* GNOME_WINDOW_MANAGER_H */
|
Loading…
Add table
Add a link
Reference in a new issue