Clean the APIs a little bit, add a mechanism for discovering if two
2002-06-04 Seth Nickell <snickell@stanford.edu> * gnome-window-manager.c: (gnome_window_manager_get_ditem): * gnome-window-manager.h: * gnome-wm-manager.c: (gnome_wm_manager_set_current), (gnome_wm_manager_get_current), (gnome_wm_manager_same_wm): * gnome-wm-manager.h: Clean the APIs a little bit, add a mechanism for discovering if two GnomeWindowManager *s are the same Window Manager underneath.
This commit is contained in:
parent
059bd84cef
commit
07624890ea
5 changed files with 54 additions and 10 deletions
|
@ -1,3 +1,14 @@
|
|||
2002-06-04 Seth Nickell <snickell@stanford.edu>
|
||||
|
||||
* gnome-window-manager.c: (gnome_window_manager_get_ditem):
|
||||
* gnome-window-manager.h:
|
||||
* gnome-wm-manager.c: (gnome_wm_manager_set_current),
|
||||
(gnome_wm_manager_get_current), (gnome_wm_manager_same_wm):
|
||||
* gnome-wm-manager.h:
|
||||
|
||||
Clean the APIs a little bit, add a mechanism for discovering if two GnomeWindowManager *s are
|
||||
the same Window Manager underneath.
|
||||
|
||||
2002-06-03 Kjartan Maraas <kmaraas@gnome.org>
|
||||
|
||||
* .cvsignore: Add newline
|
||||
|
|
|
@ -51,6 +51,13 @@ gnome_window_manager_get_name (GnomeWindowManager *wm)
|
|||
{
|
||||
return wm->p->window_manager_name;
|
||||
}
|
||||
|
||||
GnomeDesktopItem *
|
||||
gnome_window_manager_get_ditem (GnomeWindowManager *wm)
|
||||
{
|
||||
return gnome_desktop_item_ref (wm->p->ditem);
|
||||
}
|
||||
|
||||
void
|
||||
gnome_window_manager_set_theme (GnomeWindowManager *wm, const char *theme_name)
|
||||
{
|
||||
|
|
|
@ -39,15 +39,17 @@ struct _GnomeWindowManagerClass
|
|||
};
|
||||
|
||||
|
||||
GObject * gnome_window_manager_new (GnomeDesktopItem *item);
|
||||
GType gnome_window_manager_get_type (void);
|
||||
GObject * gnome_window_manager_new (GnomeDesktopItem *item);
|
||||
GType gnome_window_manager_get_type (void);
|
||||
|
||||
const char * gnome_window_manager_get_name (GnomeWindowManager *wm);
|
||||
void gnome_window_manager_set_theme (GnomeWindowManager *wm, const char *theme_name);
|
||||
GList * gnome_window_manager_get_theme_list (GnomeWindowManager *wm);
|
||||
void gnome_window_manager_set_font (GnomeWindowManager *wm, const char *font);
|
||||
gboolean gnome_window_manager_get_focus_follows_mouse (GnomeWindowManager *wm);
|
||||
void gnome_window_manager_set_focus_follows_mouse (GnomeWindowManager *wm, gboolean focus_follows_mouse);
|
||||
const char * gnome_window_manager_get_name (GnomeWindowManager *wm);
|
||||
GnomeDesktopItem *gnome_window_manager_get_ditem (GnomeWindowManager *wm);
|
||||
void gnome_window_manager_set_theme (GnomeWindowManager *wm, const char *theme_name);
|
||||
/* GList of char *'s */
|
||||
GList * gnome_window_manager_get_theme_list (GnomeWindowManager *wm);
|
||||
void gnome_window_manager_set_font (GnomeWindowManager *wm, const char *font);
|
||||
gboolean gnome_window_manager_get_focus_follows_mouse (GnomeWindowManager *wm);
|
||||
void gnome_window_manager_set_focus_follows_mouse (GnomeWindowManager *wm, gboolean focus_follows_mouse);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
@ -68,13 +68,14 @@ gnome_wm_manager_get_list (void)
|
|||
void
|
||||
gnome_wm_manager_set_current (GnomeWindowManager *wm)
|
||||
{
|
||||
/*selected_wm = wm->ditem;*/
|
||||
/* this line is bogus */
|
||||
/*selected_wm = gnome_window_manager_get_ditem (wm);*/
|
||||
}
|
||||
|
||||
GnomeWindowManager *
|
||||
gnome_wm_manager_get_current (void)
|
||||
{
|
||||
return gnome_window_manager_new (wm_list_get_current()->dentry);
|
||||
return GNOME_WINDOW_MANAGER (gnome_window_manager_new (wm_list_get_current()->dentry));
|
||||
}
|
||||
|
||||
void gnome_wm_manager_change_wm_to_settings (void)
|
||||
|
@ -86,6 +87,26 @@ void gnome_wm_manager_change_wm_to_settings (void)
|
|||
update_session ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnome_wm_manager_same_wm (GnomeWindowManager *wm1, GnomeWindowManager *wm2)
|
||||
{
|
||||
GnomeDesktopItem *item1, *item2;
|
||||
const char *location1, *location2;
|
||||
gboolean same;
|
||||
|
||||
item1 = gnome_window_manager_get_ditem (wm1);
|
||||
item2 = gnome_window_manager_get_ditem (wm2);
|
||||
|
||||
location1 = gnome_desktop_item_get_location (item1);
|
||||
location2 = gnome_desktop_item_get_location (item2);
|
||||
|
||||
same = (strcmp (location1, location2) == 0);
|
||||
|
||||
gnome_desktop_item_unref (item1);
|
||||
gnome_desktop_item_unref (item2);
|
||||
|
||||
return same;
|
||||
}
|
||||
|
||||
static GtkWidget *restart_dialog = NULL;
|
||||
static GtkWidget *restart_label = NULL;
|
||||
|
|
|
@ -19,4 +19,7 @@ GnomeWindowManager *gnome_wm_manager_get_current (void);
|
|||
/* change to the wm specified in GConf */
|
||||
void gnome_wm_manager_change_wm_to_settings (void);
|
||||
|
||||
/* return TRUE if wm1 and wm2 refer to the same window manager */
|
||||
gboolean gnome_wm_manager_same_wm (GnomeWindowManager *wm1, GnomeWindowManager *wm2);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue