Ignore gladep (grrr) files.
2002-05-11 Seth Nickell <snickell@stanford.edu> * .cvsignore: Ignore gladep (grrr) files. * Makefile.am: * gnome-window-manager.c: (gnome_window_manager_new): * gnome-window-manager.h: * metacity-window-manager.c: (window_manager_new), (metacity_set_theme), (metacity_get_theme_list), (metacity_set_font), (metacity_get_focus_follows_mouse), (metacity_set_focus_follows_mouse), (finalize), (class_init), (init), (metacity_window_manager_get_type): * metacity-window-manager.h: First pass at adding settings modules. * window-capplet.png: Use the wm-properties icon. * wm-list.c: (wm_list_find), (wm_list_find_exec): Nix some warnings caused by non-use of const. * gnome-window-properties.c: (setup_dialog): * gnome-window-properties.glade: Tweak appearance some more.
This commit is contained in:
parent
7c22259a61
commit
0b6fd7d726
11 changed files with 301 additions and 7 deletions
|
@ -8,3 +8,4 @@ Makefile.in
|
|||
gnome-window-properties
|
||||
window-properties.desktop
|
||||
*.oaf
|
||||
*.gladep
|
|
@ -1,3 +1,34 @@
|
|||
2002-05-11 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* .cvsignore:
|
||||
|
||||
Ignore gladep (grrr) files.
|
||||
|
||||
* Makefile.am:
|
||||
* gnome-window-manager.c: (gnome_window_manager_new):
|
||||
* gnome-window-manager.h:
|
||||
* metacity-window-manager.c: (window_manager_new),
|
||||
(metacity_set_theme), (metacity_get_theme_list),
|
||||
(metacity_set_font), (metacity_get_focus_follows_mouse),
|
||||
(metacity_set_focus_follows_mouse), (finalize), (class_init),
|
||||
(init), (metacity_window_manager_get_type):
|
||||
* metacity-window-manager.h:
|
||||
|
||||
First pass at adding settings modules.
|
||||
|
||||
* window-capplet.png:
|
||||
|
||||
Use the wm-properties icon.
|
||||
|
||||
* wm-list.c: (wm_list_find), (wm_list_find_exec):
|
||||
|
||||
Nix some warnings caused by non-use of const.
|
||||
|
||||
* gnome-window-properties.c: (setup_dialog):
|
||||
* gnome-window-properties.glade:
|
||||
|
||||
Tweak appearance some more.
|
||||
|
||||
2002-05-10 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gnome-window-properties.c: (setup_dialog), (main):
|
||||
|
|
|
@ -2,11 +2,29 @@ bin_PROGRAMS = gnome-window-properties
|
|||
|
||||
gnome_window_properties_LDADD = $(GNOMECC_CAPPLETS_LIBS)
|
||||
gnome_window_properties_SOURCES = \
|
||||
gnome-window-manager.h \
|
||||
gnome-window-manager.c \
|
||||
gnome-window-properties.c \
|
||||
wm-properties.h \
|
||||
wm-exec.c \
|
||||
wm-list.c
|
||||
|
||||
wms_flags = -export_dynamic -avoid-version
|
||||
wmsdir = $(libdir)/window-manager-settings/
|
||||
|
||||
wms_LTLIBRARIES = \
|
||||
libmetacity.la
|
||||
|
||||
libmetacity_la_SOURCES = \
|
||||
gnome-window-manager.h \
|
||||
metacity-window-manager.c \
|
||||
metacity-window-manager.h
|
||||
|
||||
|
||||
libmetacity_la_LDFLAGS = $(wms_flags)
|
||||
libmetacity_la_LIBADD =
|
||||
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
pixmapdir = $(GNOMECC_PIXMAPS_DIR)
|
||||
|
@ -25,7 +43,8 @@ desktopdir = $(GNOMECC_DESKTOP_DIR)
|
|||
Desktop_in_files = window-properties.desktop.in
|
||||
desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
|
||||
|
||||
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) $(DESKTOP_ITEM_CFLAGS)
|
||||
INCLUDES = $(GNOMECC_CAPPLETS_CFLAGS) $(DESKTOP_ITEM_CFLAGS) \
|
||||
-DGNOME_WINDOW_MANAGER_MODULE_PATH=\""$(libdir)/window-manager-settings"\"
|
||||
CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES)
|
||||
EXTRA_DIST = $(Glade_DATA) $(icons_DATA) $(Desktop_in_files) $(pixmap_DATA)
|
||||
|
||||
|
|
37
capplets/windows/gnome-window-manager.c
Normal file
37
capplets/windows/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
capplets/windows/gnome-window-manager.h
Normal file
53
capplets/windows/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 */
|
|
@ -19,7 +19,9 @@
|
|||
|
||||
//#include "gnome-startup.h"
|
||||
|
||||
#define THEME_KEY "/desktop/gnome/applications/window_manager/theme"
|
||||
#define TITLEBAR_FONT_KEY "/desktop/gnome/applications/window_manager/titlebar_font"
|
||||
#define FOCUS_FOLLOWS_MOUSE_KEY "/desktop/gnome/applications/window_manager/focus_follows_mouse"
|
||||
|
||||
/* prototypes */
|
||||
static void restart (gboolean force);
|
||||
|
@ -758,6 +760,10 @@ setup_dialog (GladeXML *dialog)
|
|||
peditor = gconf_peditor_new_font (NULL, TITLEBAR_FONT_KEY,
|
||||
WID ("titlebar_font"),
|
||||
PEDITOR_FONT_COMBINED, NULL);
|
||||
|
||||
peditor = gconf_peditor_new_boolean (NULL, FOCUS_FOLLOWS_MOUSE_KEY,
|
||||
WID ("focus_follows_mouse"),
|
||||
NULL);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -197,7 +197,7 @@
|
|||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GnomeFontPicker" id="fontpicker1">
|
||||
<widget class="GnomeFontPicker" id="titlebar_font">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="mode">GNOME_FONT_PICKER_MODE_FONT_INFO</property>
|
||||
|
@ -233,7 +233,7 @@
|
|||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="checkbutton1">
|
||||
<widget class="GtkCheckButton" id="focus_follows_mouse">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Select windows when the mouse moves over them</property>
|
||||
|
|
110
capplets/windows/metacity-window-manager.c
Normal file
110
capplets/windows/metacity-window-manager.c
Normal file
|
@ -0,0 +1,110 @@
|
|||
#include "metacity-window-manager.h"
|
||||
|
||||
static GnomeWindowManagerClass *parent_class = NULL;
|
||||
|
||||
struct _MetacityWindowManagerPrivate {
|
||||
};
|
||||
|
||||
/* this function is called when the shared lib is loaded */
|
||||
GObject *
|
||||
window_manager_new (void)
|
||||
{
|
||||
GObject *wm;
|
||||
|
||||
wm = g_object_new (metacity_window_manager_get_type (), NULL);
|
||||
|
||||
return wm;
|
||||
}
|
||||
|
||||
static void
|
||||
metacity_set_theme (const char *theme_name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static GList *
|
||||
metacity_get_theme_list (void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
metacity_set_font (const char *font)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static gboolean
|
||||
metacity_get_focus_follows_mouse (void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
metacity_set_focus_follows_mouse (gboolean focus_follows_mouse)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
finalize (GObject *object)
|
||||
{
|
||||
MetacityWindowManager *wm;
|
||||
|
||||
wm = METACITY_WINDOW_MANAGER (object);
|
||||
if (wm->private == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (wm->private);
|
||||
wm->private = NULL;
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
class_init (MetacityWindowManagerClass *klass)
|
||||
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
GnomeWindowManagerClass *wm_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
wm_class = GNOME_WINDOW_MANAGER_CLASS (klass);
|
||||
|
||||
object_class->finalize = finalize;
|
||||
|
||||
wm_class->set_theme = metacity_set_theme;
|
||||
wm_class->get_theme_list = metacity_get_theme_list;
|
||||
wm_class->set_font = metacity_set_font;
|
||||
wm_class->get_focus_follows_mouse = metacity_get_focus_follows_mouse;
|
||||
wm_class->set_focus_follows_mouse = metacity_set_focus_follows_mouse;
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
}
|
||||
|
||||
static void
|
||||
init (MetacityWindowManager *wm)
|
||||
{
|
||||
wm->private = g_new (MetacityWindowManagerPrivate, 1);
|
||||
}
|
||||
|
||||
/* API */
|
||||
GType
|
||||
metacity_window_manager_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (type == 0) {
|
||||
GTypeInfo info = {
|
||||
sizeof (MetacityWindowManagerClass),
|
||||
NULL, NULL, (GClassInitFunc) class_init, NULL, NULL,
|
||||
sizeof (MetacityWindowManager), 0, (GInstanceInitFunc) init,
|
||||
};
|
||||
|
||||
type = g_type_register_static (METACITY_WINDOW_MANAGER_TYPE, "MetacityWindowManager", &info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
37
capplets/windows/metacity-window-manager.h
Normal file
37
capplets/windows/metacity-window-manager.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef METACITY_WINDOW_MANAGER_H
|
||||
#define METACITY_WINDOW_MANAGER_H
|
||||
|
||||
#include <glib/gerror.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "gnome-window-manager.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define METACITY_WINDOW_MANAGER_TYPE (metacity_window_manager_get_type ())
|
||||
#define METACITY_WINDOW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), METACITY_WINDOW_MANAGER_TYPE, MetacityWindowManager))
|
||||
#define METACITY_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), METACITY_WINDOW_MANAGER_TYPE, MetacityWindowManagerClass))
|
||||
#define IS_METACITY_WINDOW_MANAGER(obj) (GTK_TYPE_CHECK_INSTANCE_TYPE ((obj), METACITY_WINDOW_MANAGER_TYPE))
|
||||
#define IS_METACITY_WINDOW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), METACITY_WINDOW_MANAGER_TYPE))
|
||||
#define METACITY_WINDOW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), METACITY_WINDOW_MANAGER_TYPE, MetacityWindowManagerClass))
|
||||
|
||||
typedef struct _MetacityWindowManager MetacityWindowManager;
|
||||
typedef struct _MetacityWindowManagerClass MetacityWindowManagerClass;
|
||||
typedef struct _MetacityWindowManagerPrivate MetacityWindowManagerPrivate;
|
||||
|
||||
struct _MetacityWindowManager
|
||||
{
|
||||
GnomeWindowManager parent_instance;
|
||||
MetacityWindowManagerPrivate *private;
|
||||
};
|
||||
|
||||
struct _MetacityWindowManagerClass
|
||||
{
|
||||
GnomeWindowManagerClass parent_class;
|
||||
};
|
||||
|
||||
GType metacity_window_manager_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* METACITY_WINDOW_MANAGER_H */
|
Binary file not shown.
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
@ -112,7 +112,7 @@ wm_copy (WindowManager *wm)
|
|||
|
||||
|
||||
static WindowManager *
|
||||
wm_list_find (GList *list, gchar *name)
|
||||
wm_list_find (GList *list, const char *name)
|
||||
{
|
||||
GList *tmp_list = list;
|
||||
while (tmp_list) {
|
||||
|
@ -127,7 +127,7 @@ wm_list_find (GList *list, gchar *name)
|
|||
}
|
||||
|
||||
static WindowManager *
|
||||
wm_list_find_exec (GList *list, gchar *name)
|
||||
wm_list_find_exec (GList *list, const char *name)
|
||||
{
|
||||
GList *tmp_list = list;
|
||||
while (tmp_list) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue