summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-02-18 23:35:54 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-02-18 23:35:54 +0800
commite0bf309cbb81e1797d26cc29246fdbd1d9713e78 (patch)
treebfc561c9f7a9409a2dd7101906828ce7eb94421b
parent6e84b89fbcd93997dd6e80cdc9b318c3c8e07059 (diff)
downloadcompiz-with-glib-mainloop-e0bf309cbb81e1797d26cc29246fdbd1d9713e78.tar.gz
compiz-with-glib-mainloop-e0bf309cbb81e1797d26cc29246fdbd1d9713e78.tar.bz2
Cleanup.
Move things to where they should be, remove dead code
-rw-r--r--gtk/window-decorator/frames.c129
-rw-r--r--gtk/window-decorator/gtk-window-decorator.c5
-rw-r--r--gtk/window-decorator/gtk-window-decorator.h158
3 files changed, 143 insertions, 149 deletions
diff --git a/gtk/window-decorator/frames.c b/gtk/window-decorator/frames.c
index 40f5e3f..dc93b8c 100644
--- a/gtk/window-decorator/frames.c
+++ b/gtk/window-decorator/frames.c
@@ -10,6 +10,70 @@ decor_frame_t decor_frames[NUM_DECOR_FRAMES];
GHashTable *frame_info_table;
GHashTable *frames_table;
+void
+decor_frame_refresh (decor_frame_t *frame)
+{
+ decor_shadow_options_t opt_shadow;
+ decor_shadow_options_t opt_no_shadow;
+ decor_shadow_info_t *info;
+
+ update_style (frame->style_window_rgba);
+ update_style (frame->style_window_rgb);
+
+ /* Should really read gconf for that */
+
+ gchar *str = NULL;
+
+#ifdef USE_GCONF
+
+ GConfClient *client = gconf_client_get_default ();
+
+ str = gconf_client_get_string (client,
+ COMPIZ_TITLEBAR_FONT_KEY,
+ NULL);
+#endif
+ if (!str)
+ str = g_strdup ("Sans Bold 12");
+
+ set_frame_scale (frame, str);
+
+ str = NULL;
+
+ frame_update_titlebar_font (frame);
+
+ /* FIXME */
+ if (strcmp (frame->type, "bare") &&
+ strcmp (frame->type, "switcher"))
+ (*theme_update_border_extents) (frame);
+
+ opt_shadow.shadow_radius = shadow_radius;
+ opt_shadow.shadow_opacity = shadow_opacity;
+
+ memcpy (opt_shadow.shadow_color, shadow_color, sizeof (shadow_color));
+
+ opt_shadow.shadow_offset_x = shadow_offset_x;
+ opt_shadow.shadow_offset_y = shadow_offset_y;
+
+ opt_no_shadow.shadow_radius = 0;
+ opt_no_shadow.shadow_opacity = 0;
+
+ opt_no_shadow.shadow_offset_x = 0;
+ opt_no_shadow.shadow_offset_y = 0;
+
+ info = malloc (sizeof (decor_shadow_info_t));
+
+ if (!info)
+ return;
+
+ info->frame = frame;
+ info->state = 0;
+
+ frame_update_shadow (frame, info, &opt_shadow, &opt_no_shadow);
+
+ free (info);
+ info = NULL;
+}
+
decor_frame_t *
gwd_get_decor_frame (const gchar *frame_name)
{
@@ -57,7 +121,6 @@ gwd_decor_frame_unref (decor_frame_t *frame)
if (frame->refcount == 0)
{
decor_frame_type_info_t *info = g_hash_table_lookup (frame_info_table, frame->type);
- GList *list;
if (!info)
g_critical ("Couldn't find %s in frame info table", frame->type);
@@ -134,70 +197,6 @@ destroy_frame_type (gpointer data)
free (info);
}
-void
-decor_frame_refresh (decor_frame_t *frame)
-{
- decor_shadow_options_t opt_shadow;
- decor_shadow_options_t opt_no_shadow;
- decor_shadow_info_t *info;
-
- update_style (frame->style_window_rgba);
- update_style (frame->style_window_rgb);
-
- /* Should really read gconf for that */
-
- gchar *str = NULL;
-
-#ifdef USE_GCONF
-
- GConfClient *client = gconf_client_get_default ();
-
- str = gconf_client_get_string (client,
- COMPIZ_TITLEBAR_FONT_KEY,
- NULL);
-#endif
- if (!str)
- str = g_strdup ("Sans Bold 12");
-
- set_frame_scale (frame, str);
-
- str = NULL;
-
- frame_update_titlebar_font (frame);
-
- /* FIXME */
- if (strcmp (frame->type, "bare") &&
- strcmp (frame->type, "switcher"))
- (*theme_update_border_extents) (frame);
-
- opt_shadow.shadow_radius = shadow_radius;
- opt_shadow.shadow_opacity = shadow_opacity;
-
- memcpy (opt_shadow.shadow_color, shadow_color, sizeof (shadow_color));
-
- opt_shadow.shadow_offset_x = shadow_offset_x;
- opt_shadow.shadow_offset_y = shadow_offset_y;
-
- opt_no_shadow.shadow_radius = 0;
- opt_no_shadow.shadow_opacity = 0;
-
- opt_no_shadow.shadow_offset_x = 0;
- opt_no_shadow.shadow_offset_y = 0;
-
- info = malloc (sizeof (decor_shadow_info_t));
-
- if (!info)
- return;
-
- info->frame = frame;
- info->state = 0;
-
- frame_update_shadow (frame, info, &opt_shadow, &opt_no_shadow);
-
- free (info);
- info = NULL;
-}
-
decor_frame_t *
decor_frame_new (const gchar *type)
{
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 8152277..af69a74 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -55,10 +55,8 @@ Atom restack_window_atom;
Atom select_window_atom;
Atom mwm_hints_atom;
Atom switcher_fg_atom;
-
Atom compiz_shadow_info_atom;
Atom compiz_shadow_color_atom;
-
Atom toolkit_action_atom;
Atom toolkit_action_window_menu_atom;
Atom toolkit_action_force_quit_dialog_atom;
@@ -98,15 +96,12 @@ const gchar * window_type_frames[WINDOW_TYPE_FRAMES_NUM] = {
char *program_name;
-GtkWidget *switcher_style_window_rgba;
-GtkWidget *switcher_style_window_rgb;
GtkWidget *switcher_label;
GHashTable *frame_table;
GtkWidget *action_menu = NULL;
gboolean action_menu_mapped = FALSE;
decor_color_t _title_color[2];
-PangoContext *switcher_pango_context;
gint double_click_timeout = 250;
GtkWidget *tip_window;
diff --git a/gtk/window-decorator/gtk-window-decorator.h b/gtk/window-decorator/gtk-window-decorator.h
index 1244688..903052d 100644
--- a/gtk/window-decorator/gtk-window-decorator.h
+++ b/gtk/window-decorator/gtk-window-decorator.h
@@ -225,9 +225,6 @@ extern double decoration_alpha;
#define SWITCHER_SPACE 40
-extern decor_extents_t _shadow_extents;
-extern decor_context_t shadow_context;
-
extern gdouble shadow_radius;
extern gdouble shadow_opacity;
extern gushort shadow_color[3];
@@ -246,8 +243,7 @@ extern MetaButtonLayout meta_button_layout;
extern guint cmdline_options;
-extern decor_shadow_t *no_border_shadow;
-
+/* default pixmaps FIXME: remove */
extern GdkPixmap *decor_normal_pixmap;
extern GdkPixmap *decor_active_pixmap;
@@ -260,7 +256,8 @@ extern Atom restack_window_atom;
extern Atom select_window_atom;
extern Atom mwm_hints_atom;
extern Atom switcher_fg_atom;
-
+extern Atom compiz_shadow_info_atom;
+extern Atom compiz_shadow_color_atom;
extern Atom toolkit_action_atom;
extern Atom toolkit_action_window_menu_atom;
extern Atom toolkit_action_force_quit_dialog_atom;
@@ -355,30 +352,6 @@ struct _decor_shadow_info
unsigned int state;
};
-void
-switcher_frame_update_shadow (Display *xdisplay,
- Screen *screen,
- decor_frame_t *frame,
- decor_shadow_info_t *info,
- decor_shadow_options_t *opt_shadow,
- decor_shadow_options_t *opt_no_shadow);
-
-void
-bare_frame_update_shadow (Display *xdisplay,
- Screen *screen,
- decor_frame_t *frame,
- decor_shadow_info_t *info,
- decor_shadow_options_t *opt_shadow,
- decor_shadow_options_t *opt_no_shadow);
-
-void
-decor_frame_update_shadow (Display *xdisplay,
- Screen *screen,
- decor_frame_t *frame,
- decor_shadow_info_t *info,
- decor_shadow_options_t *opt_shadow,
- decor_shadow_options_t *opt_no_shadow);
-
typedef void (*frame_update_shadow_proc) (Display *display,
Screen *screen,
decor_frame_t *frame,
@@ -389,52 +362,6 @@ typedef void (*frame_update_shadow_proc) (Display *display,
typedef decor_frame_t * (*create_frame_proc) (const gchar *);
typedef void (*destroy_frame_proc) (decor_frame_t *);
-#define WINDOW_TYPE_FRAMES_NUM 4
-const gchar * window_type_frames[WINDOW_TYPE_FRAMES_NUM];
-
-void
-frame_update_titlebar_font (decor_frame_t *frame);
-
-void
-set_frame_scale (decor_frame_t *frame,
- gchar *font_str);
-
-void
-frame_update_shadow (decor_frame_t *frame,
- decor_shadow_info_t *info,
- decor_shadow_options_t *opt_shadow,
- decor_shadow_options_t *opt_no_shadow);
-
-void
-update_frames_border_extents (gpointer key,
- gpointer value,
- gpointer user_data);
-
-decor_frame_t *
-gwd_get_decor_frame (const gchar *);
-
-decor_frame_t *
-gwd_decor_frame_ref (decor_frame_t *);
-
-decor_frame_t *
-gwd_decor_frame_unref (decor_frame_t *);
-
-void
-gwd_frames_foreach (GHFunc foreach_func,
- gpointer user_data);
-
-void
-gwd_process_frames (GHFunc foreach_func,
- const gchar *frame_keys[],
- gint frame_keys_num,
- gpointer user_data);
-
-decor_frame_t *
-decor_frame_new (const gchar *type);
-
-void
-decor_frame_destroy (decor_frame_t *);
-
struct _decor_frame {
decor_extents_t win_extents;
decor_extents_t max_win_extents;
@@ -526,12 +453,20 @@ gfloat (*theme_get_title_scale) (decor_frame_t *frame);
extern char *program_name;
+/* list of all decorations */
extern GHashTable *frame_table;
+
+#define WINDOW_TYPE_FRAMES_NUM 4
+const gchar * window_type_frames[WINDOW_TYPE_FRAMES_NUM];
+
+/* action menu */
extern GtkWidget *action_menu;
extern gboolean action_menu_mapped;
extern decor_color_t _title_color[2];
extern gint double_click_timeout;
+
+/* tooltip */
extern GtkWidget *tip_window;
extern GtkWidget *tip_label;
extern GTimeVal tooltip_last_popdown;
@@ -548,6 +483,7 @@ extern gboolean use_system_font;
extern gint blur_type;
+/* switcher */
extern Window switcher_selected_window;
extern GtkWidget *switcher_label;
extern decor_t *switcher_window;
@@ -555,9 +491,6 @@ extern decor_t *switcher_window;
extern XRenderPictFormat *xformat_rgba;
extern XRenderPictFormat *xformat_rgb;
-extern Atom compiz_shadow_info_atom;
-extern Atom compiz_shadow_color_atom;
-
/* gtk-window-decorator.c */
double
@@ -569,8 +502,63 @@ dist (double x1, double y1,
void
initialize_decorations ();
+void
+update_frames_border_extents (gpointer key,
+ gpointer value,
+ gpointer user_data);
+
+decor_frame_t *
+gwd_get_decor_frame (const gchar *);
+
+decor_frame_t *
+gwd_decor_frame_ref (decor_frame_t *);
+
+decor_frame_t *
+gwd_decor_frame_unref (decor_frame_t *);
+
+void
+gwd_frames_foreach (GHFunc foreach_func,
+ gpointer user_data);
+
+void
+gwd_process_frames (GHFunc foreach_func,
+ const gchar *frame_keys[],
+ gint frame_keys_num,
+ gpointer user_data);
+
+decor_frame_t *
+decor_frame_new (const gchar *type);
+
+void
+decor_frame_destroy (decor_frame_t *);
+
/* decorator.c */
+void
+frame_update_shadow (decor_frame_t *frame,
+ decor_shadow_info_t *info,
+ decor_shadow_options_t *opt_shadow,
+ decor_shadow_options_t *opt_no_shadow);
+
+void
+frame_update_titlebar_font (decor_frame_t *frame);
+
+void
+bare_frame_update_shadow (Display *xdisplay,
+ Screen *screen,
+ decor_frame_t *frame,
+ decor_shadow_info_t *info,
+ decor_shadow_options_t *opt_shadow,
+ decor_shadow_options_t *opt_no_shadow);
+
+void
+decor_frame_update_shadow (Display *xdisplay,
+ Screen *screen,
+ decor_frame_t *frame,
+ decor_shadow_info_t *info,
+ decor_shadow_options_t *opt_shadow,
+ decor_shadow_options_t *opt_no_shadow);
+
decor_frame_t *
create_normal_frame (const gchar *type);
@@ -848,6 +836,14 @@ meta_update_button_layout (const char *value);
#define SWITCHER_ALPHA 0xa0a0
+void
+switcher_frame_update_shadow (Display *xdisplay,
+ Screen *screen,
+ decor_frame_t *frame,
+ decor_shadow_info_t *info,
+ decor_shadow_options_t *opt_shadow,
+ decor_shadow_options_t *opt_no_shadow);
+
decor_frame_t *
create_switcher_frame (const gchar *);
@@ -1090,6 +1086,10 @@ style_changed (GtkWidget *widget, void *user_data /* PangoContext */);
/* settings.c */
+void
+set_frame_scale (decor_frame_t *frame,
+ gchar *font_str);
+
gboolean
init_settings (WnckScreen *screen);