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
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue