diff options
-rw-r--r-- | mate-window-picker-applet/applet.c | 34 | ||||
-rw-r--r-- | mate-window-picker-applet/task-list.c | 21 | ||||
-rw-r--r-- | mate-window-picker-applet/task-title.c | 64 | ||||
-rw-r--r-- | mate-window-picker-applet/task-title.h | 7 | ||||
-rw-r--r-- | maximus/main.c | 24 | ||||
-rw-r--r-- | maximus/maximus-bind.c | 40 |
6 files changed, 94 insertions, 96 deletions
diff --git a/mate-window-picker-applet/applet.c b/mate-window-picker-applet/applet.c index e9018aa..37fabeb 100644 --- a/mate-window-picker-applet/applet.c +++ b/mate-window-picker-applet/applet.c @@ -2,7 +2,7 @@ * Copyright (C) 2008 Canonical Ltd * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as + * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -41,13 +41,13 @@ #define APPLET_SCHEMA "org.mate.panel.applet.mate-window-picker-applet" #define SHOW_WIN_KEY "show-all-windows" -typedef struct +typedef struct { GtkWidget *tasks; GtkWidget *applet; GtkWidget *title; GSettings *settings; - + } WinPickerApp; static WinPickerApp *mainapp; @@ -119,8 +119,8 @@ cw_applet_finalize (GObject *object) } static gboolean -cw_applet_fill (MatePanelApplet *applet, - const gchar *iid, +cw_applet_fill (MatePanelApplet *applet, + const gchar *iid, gpointer data) { WnckScreen *screen; @@ -129,10 +129,10 @@ cw_applet_fill (MatePanelApplet *applet, gchar *ui_path; GtkActionGroup *action_group; GObjectClass *object_class; - + if (strcmp (iid, "MateWindowPicker") != 0) return FALSE; - + bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); @@ -141,7 +141,7 @@ cw_applet_fill (MatePanelApplet *applet, mate_panel_applet_set_background_widget (MATE_PANEL_APPLET (applet), GTK_WIDGET (applet)); wnck_set_client_type (WNCK_CLIENT_TYPE_PAGER); - + app = g_slice_new0 (WinPickerApp); mainapp = app; screen = wnck_screen_get_default (); @@ -170,7 +170,7 @@ cw_applet_fill (MatePanelApplet *applet, gtk_box_pack_start (GTK_BOX (eb), title, TRUE, TRUE, 0); gtk_widget_show_all (GTK_WIDGET (applet)); - + on_show_all_windows_changed (app->settings, SHOW_WIN_KEY, app); action_group = gtk_action_group_new ("MateWindowPicker Applet Actions"); @@ -185,11 +185,11 @@ cw_applet_fill (MatePanelApplet *applet, g_free (ui_path); g_object_unref (action_group); - mate_panel_applet_set_flags (MATE_PANEL_APPLET (applet), + mate_panel_applet_set_flags (MATE_PANEL_APPLET (applet), MATE_PANEL_APPLET_EXPAND_MAJOR | MATE_PANEL_APPLET_EXPAND_MINOR | MATE_PANEL_APPLET_HAS_HANDLE); - + return TRUE; } @@ -204,7 +204,7 @@ display_about_dialog (GtkAction *action, WinPickerApp *applet) { GtkWidget *panel_about_dialog; - + panel_about_dialog = gtk_about_dialog_new (); g_object_set (panel_about_dialog, @@ -231,7 +231,7 @@ static void on_checkbox_toggled (GtkToggleButton *check, gpointer null) { gboolean is_active; - + is_active = gtk_toggle_button_get_active (check); g_settings_set_boolean (mainapp->settings, SHOW_WIN_KEY, is_active); @@ -272,16 +272,16 @@ display_prefs_dialog (GtkAction *action, gtk_box_pack_start (GTK_BOX (vbox), check, TRUE, TRUE, 0); gtk_widget_set_size_request (nb, -1, 100); - + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0); - + label = gtk_label_new (" "); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); - + gtk_widget_show_all (window); g_signal_connect (window, "delete-event", @@ -291,6 +291,6 @@ display_prefs_dialog (GtkAction *action, G_CALLBACK (gtk_widget_destroy), window); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); - + gtk_window_present (GTK_WINDOW (window)); } diff --git a/mate-window-picker-applet/task-list.c b/mate-window-picker-applet/task-list.c index 459ad5a..613d03d 100644 --- a/mate-window-picker-applet/task-list.c +++ b/mate-window-picker-applet/task-list.c @@ -2,7 +2,7 @@ * Copyright (C) 2008 Canonical Ltd * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as + * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -39,7 +39,7 @@ struct _TaskListPrivate enum { PROP_0, - + PROP_SHOW_ALL_WINDOWS }; @@ -78,9 +78,9 @@ on_window_opened (WnckScreen *screen, || type == WNCK_WINDOW_SPLASHSCREEN || type == WNCK_WINDOW_MENU) return; - + GtkWidget *item = task_item_new (window); - + if (item) { gtk_box_pack_start (GTK_BOX (list), item, FALSE, FALSE, 0); @@ -183,11 +183,11 @@ task_list_new (void) { GtkWidget *list = NULL; - list = g_object_new (TASK_TYPE_LIST, - "homogeneous", FALSE, - "spacing", 0, + list = g_object_new (TASK_TYPE_LIST, + "homogeneous", FALSE, + "spacing", 0, NULL); - + return list; } @@ -202,7 +202,7 @@ task_list_get_default (void) return list; } -gboolean +gboolean task_list_get_desktop_visible (TaskList *list) { GList *windows, *w; @@ -214,7 +214,7 @@ task_list_get_desktop_visible (TaskList *list) for (w = windows; w; w = w->next) { WnckWindow *window; - + window = w->data; if (WNCK_IS_WINDOW (window) && !wnck_window_is_minimized (window)) @@ -229,4 +229,3 @@ task_list_get_show_all_windows (TaskList *list) { return list->priv->show_all_windows; } - diff --git a/mate-window-picker-applet/task-title.c b/mate-window-picker-applet/task-title.c index 8e52532..8a8660e 100644 --- a/mate-window-picker-applet/task-title.c +++ b/mate-window-picker-applet/task-title.c @@ -2,7 +2,7 @@ * Copyright (C) 2008 Canonical Ltd * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as + * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -54,8 +54,8 @@ struct _TaskTitlePrivate static void disconnect_window (TaskTitle *title); static gboolean -on_close_clicked (GtkButton *button, - GdkEventButton *event, +on_close_clicked (GtkButton *button, + GdkEventButton *event, TaskTitle *title) { TaskTitlePrivate *priv; @@ -87,10 +87,10 @@ on_enter_notify (GtkWidget *widget, TaskTitle *title) { g_return_val_if_fail (TASK_IS_TITLE (title), FALSE); - + title->priv->mouse_in_close_button = TRUE; gtk_widget_queue_draw (widget); - + return FALSE; } @@ -100,7 +100,7 @@ on_leave_notify (GtkWidget *widget, TaskTitle *title) { g_return_val_if_fail (TASK_IS_TITLE (title), FALSE); - + title->priv->mouse_in_close_button = FALSE; gtk_widget_queue_draw (widget); @@ -108,7 +108,7 @@ on_leave_notify (GtkWidget *widget, } static gboolean -on_button_draw (GtkWidget *widget, +on_button_draw (GtkWidget *widget, cairo_t *cr, TaskTitle *title) { @@ -116,7 +116,7 @@ on_button_draw (GtkWidget *widget, TaskTitlePrivate *priv; priv = title->priv; - + if (priv->mouse_in_close_button) { GtkStyle *style = gtk_widget_get_style (widget); @@ -201,7 +201,7 @@ on_state_changed (WnckWindow *window, { gtk_widget_set_state (GTK_WIDGET (title), GTK_STATE_NORMAL); gtk_widget_hide (priv->box); - } + } } static void @@ -224,7 +224,7 @@ on_active_window_changed (WnckScreen *screen, TaskTitlePrivate *priv; WnckWindow *act_window; WnckWindowType type = WNCK_WINDOW_NORMAL; - + g_return_if_fail (TASK_IS_TITLE (title)); priv = title->priv; @@ -241,16 +241,16 @@ on_active_window_changed (WnckScreen *screen, || type == WNCK_WINDOW_SPLASHSCREEN || type == WNCK_WINDOW_MENU) return; - + disconnect_window (title); if (!WNCK_IS_WINDOW (act_window) || wnck_window_get_window_type (act_window) == WNCK_WINDOW_DESKTOP) - { + { if (priv->show_home_title) { gtk_label_set_text (GTK_LABEL (priv->label), _("Home")); - gtk_image_set_from_pixbuf (GTK_IMAGE (priv->button_image), + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->button_image), priv->quit_icon); gtk_widget_set_tooltip_text (priv->button, _("Log off, switch user, lock screen or power " @@ -268,7 +268,7 @@ on_active_window_changed (WnckScreen *screen, } else { - gtk_label_set_text (GTK_LABEL (priv->label), + gtk_label_set_text (GTK_LABEL (priv->label), wnck_window_get_name (act_window)); gtk_image_set_from_icon_name (GTK_IMAGE (priv->button_image), "window-close", GTK_ICON_SIZE_MENU); @@ -283,7 +283,7 @@ on_active_window_changed (WnckScreen *screen, G_CALLBACK (on_icon_changed), title); g_signal_connect_after (act_window, "state-changed", G_CALLBACK (on_state_changed), title); - gtk_widget_show (priv->box); + gtk_widget_show (priv->box); priv->window = act_window; } @@ -300,17 +300,17 @@ on_active_window_changed (WnckScreen *screen, && priv->show_home_title) { gtk_label_set_text (GTK_LABEL (priv->label), _("Home")); - gtk_image_set_from_pixbuf (GTK_IMAGE (priv->button_image), + gtk_image_set_from_pixbuf (GTK_IMAGE (priv->button_image), priv->quit_icon); gtk_widget_set_tooltip_text (priv->button, _("Log off, switch user, lock screen or power " "down the computer")); gtk_widget_set_tooltip_text (GTK_WIDGET (title), - _("Home")); + _("Home")); gtk_widget_show (priv->box); } else - { + { gtk_widget_set_state (GTK_WIDGET (title), GTK_STATE_NORMAL); gtk_widget_set_tooltip_text (priv->button, NULL); gtk_widget_set_tooltip_text (GTK_WIDGET (title), NULL); @@ -342,7 +342,7 @@ on_button_release (GtkWidget *title, GdkEventButton *event) if (wnck_window_get_window_type (window) != WNCK_WINDOW_DESKTOP) { menu = wnck_action_menu_new (window); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time); return TRUE; } @@ -354,7 +354,7 @@ on_button_release (GtkWidget *title, GdkEventButton *event) wnck_window_unmaximize (window); } } - + return FALSE; } @@ -411,7 +411,7 @@ task_title_init (TaskTitle *title) GdkPixbuf *pixbuf; AtkObject *atk; int width, height; - + priv = title->priv = TASK_TITLE_GET_PRIVATE (title); priv->screen = wnck_screen_get_default (); @@ -424,7 +424,7 @@ task_title_init (TaskTitle *title) gtk_widget_add_events (GTK_WIDGET (title), GDK_ALL_EVENTS_MASK); priv->align = gtk_alignment_new (0.0, 0.5, 1.0, 1.0); - gtk_alignment_set_padding (GTK_ALIGNMENT (priv->align), + gtk_alignment_set_padding (GTK_ALIGNMENT (priv->align), 0, 0, 6, 6); gtk_container_add (GTK_CONTAINER (title), priv->align); @@ -446,19 +446,19 @@ task_title_init (TaskTitle *title) gtk_box_pack_start (GTK_BOX (priv->box), priv->label, TRUE, TRUE, 0); gtk_widget_show (priv->label); - priv->button = g_object_new (GTK_TYPE_EVENT_BOX, + priv->button = g_object_new (GTK_TYPE_EVENT_BOX, "visible-window", FALSE, "above-child", TRUE, NULL); gtk_box_pack_start (GTK_BOX (priv->box), priv->button, FALSE, FALSE, 0); gtk_widget_show (priv->button); - + atk = gtk_widget_get_accessible (priv->button); atk_object_set_name (atk, _("Close")); atk_object_set_description (atk, _("Close current window.")); atk_object_set_role (atk, ATK_ROLE_PUSH_BUTTON); - - g_signal_connect (priv->button, "button-release-event", + + g_signal_connect (priv->button, "button-release-event", G_CALLBACK (on_close_clicked), title); g_signal_connect (priv->button, "enter-notify-event", G_CALLBACK (on_enter_notify), title); @@ -481,16 +481,16 @@ task_title_init (TaskTitle *title) gtk_widget_set_tooltip_text (priv->button, _("Log off, switch user, lock screen or power " "down the computer")); - gtk_widget_set_tooltip_text (GTK_WIDGET (title), _("Home")); + gtk_widget_set_tooltip_text (GTK_WIDGET (title), _("Home")); if (priv->show_home_title) gtk_widget_set_state (GTK_WIDGET (title), GTK_STATE_ACTIVE); else gtk_widget_hide (priv->box); - + gtk_widget_add_events (GTK_WIDGET (title), GDK_ALL_EVENTS_MASK); - + g_signal_connect (priv->screen, "active-window-changed", G_CALLBACK (on_active_window_changed), title); g_signal_connect (title, "button-press-event", @@ -503,10 +503,10 @@ task_title_new (void) { GtkWidget *title = NULL; - title = g_object_new (TASK_TYPE_TITLE, - "border-width", 0, + title = g_object_new (TASK_TYPE_TITLE, + "border-width", 0, "name", "tasklist-button", - "visible-window", FALSE, + "visible-window", FALSE, NULL); return title; diff --git a/mate-window-picker-applet/task-title.h b/mate-window-picker-applet/task-title.h index 0a1d7ec..5161a9d 100644 --- a/mate-window-picker-applet/task-title.h +++ b/mate-window-picker-applet/task-title.h @@ -2,7 +2,7 @@ * Copyright (C) 2008 Canonical Ltd * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as + * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -44,10 +44,10 @@ typedef struct _TaskTitle TaskTitle; typedef struct _TaskTitleClass TaskTitleClass; typedef struct _TaskTitlePrivate TaskTitlePrivate; - + struct _TaskTitle { - GtkEventBox parent; + GtkEventBox parent; TaskTitlePrivate *priv; }; @@ -63,4 +63,3 @@ GtkWidget * task_title_new (void); #endif /* _TASK_TITLE_H_ */ - diff --git a/maximus/main.c b/maximus/main.c index a508367..3470795 100644 --- a/maximus/main.c +++ b/maximus/main.c @@ -2,7 +2,7 @@ * Copyright (C) 2008 Canonical Ltd * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as + * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -39,13 +39,13 @@ static gboolean version = FALSE; gboolean no_maximize = FALSE; -GOptionEntry entries[] = +GOptionEntry entries[] = { { - "version", 'v', - 0, G_OPTION_ARG_NONE, - &version, - "Prints the version number", NULL + "version", 'v', + 0, G_OPTION_ARG_NONE, + &version, + "Prints the version number", NULL }, { "no-maximize", 'm', @@ -53,8 +53,8 @@ GOptionEntry entries[] = &no_maximize, "Do not automatically maximize every window", NULL }, - { - NULL + { + NULL } }; @@ -67,9 +67,9 @@ gint main (gint argc, gchar *argv[]) GdkDisplay *gdk_display; g_set_application_name ("Maximus"); - + gtk_init (&argc, &argv); - + application = g_application_new ("com.canonical.Maximus", G_APPLICATION_FLAGS_NONE); if (!g_application_register (application, NULL, &error)) @@ -78,7 +78,7 @@ gint main (gint argc, gchar *argv[]) g_error_free (error); return 1; } - + if (g_application_get_is_remote(application)) { return 0; @@ -88,7 +88,7 @@ gint main (gint argc, gchar *argv[]) g_option_context_add_main_entries (context, entries, "maximus"); g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_parse (context, &argc, &argv, NULL); - g_option_context_free(context); + g_option_context_free(context); gdk_display = gdk_display_get_default (); gdk_x11_display_error_trap_push (gdk_display); diff --git a/maximus/maximus-bind.c b/maximus/maximus-bind.c index e52e0a8..2eadcea 100644 --- a/maximus/maximus-bind.c +++ b/maximus/maximus-bind.c @@ -2,7 +2,7 @@ * Copyright (C) 2008 Canonical Ltd * * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3 as + * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, @@ -76,7 +76,7 @@ struct _MaximusBindPrivate GList *rules; }; -typedef struct +typedef struct { gchar *wm_class; gchar *fullscreen; @@ -94,7 +94,7 @@ get_fullscreen_keystroke (GList *rules, WnckWindow *window) class_name = wnck_class_group_get_name (group); g_debug ("Searching rules for %s:\n", wnck_window_get_name (window)); - + for (r = rules; r; r = r->next) { MaximusRule *rule = r->data; @@ -152,7 +152,7 @@ real_fullscreen (MaximusBind *bind) return FALSE; keystroke = get_fullscreen_keystroke (priv->rules, active); - + if (keystroke) { guint keysym = 0; @@ -171,7 +171,7 @@ real_fullscreen (MaximusBind *bind) if (modifiers & EGG_VIRTUAL_META_MASK) mods |= FAKEKEYMOD_META; - g_debug ("Sending fullscreen special event: %s = %d %d", + g_debug ("Sending fullscreen special event: %s = %d %d", keystroke, keysym, mods); fakekey_press_keysym (priv->fk, keysym, mods); fakekey_release (priv->fk); @@ -223,7 +223,7 @@ real_unfullscreen (MaximusBind *bind) if (!WNCK_IS_WINDOW (active) || wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL) - return FALSE; + return FALSE; keystroke = get_unfullscreen_keystroke (priv->rules, active); @@ -245,14 +245,14 @@ real_unfullscreen (MaximusBind *bind) if (modifiers & EGG_VIRTUAL_META_MASK) mods |= FAKEKEYMOD_META; - g_debug ("Sending fullscreen special event: %s = %d %d", + g_debug ("Sending fullscreen special event: %s = %d %d", keystroke, keysym, mods); fakekey_press_keysym (priv->fk, keysym, mods); fakekey_release (priv->fk); return FALSE; } - } + } if (wnck_window_is_fullscreen (active)) { g_debug ("Sending un-fullscreen F11 event"); @@ -267,7 +267,7 @@ real_unfullscreen (MaximusBind *bind) g_debug ("Forcing un-fullscreen wnck event"); wnck_window_set_fullscreen (active, FALSE); } - + return FALSE; } @@ -287,7 +287,7 @@ on_binding_activated (gchar *keystring, MaximusBind *bind) { MaximusBindPrivate *priv; WnckWindow *active; - + g_return_if_fail (MAXIMUS_IS_BIND (bind)); priv = bind->priv; @@ -324,19 +324,19 @@ on_binding_changed (GSettings *settings, MaximusBind *bind) { MaximusBindPrivate *priv; - + g_return_if_fail (MAXIMUS_IS_BIND (bind)); priv = bind->priv; if (binding_is_valid (priv->binding)) - tomboy_keybinder_unbind (priv->binding, + tomboy_keybinder_unbind (priv->binding, (TomboyBindkeyHandler)on_binding_changed); g_free (priv->binding); priv->binding = g_settings_get_string (settings, BIND_EXCLUDE_CLASS); if (binding_is_valid (priv->binding)) - tomboy_keybinder_bind (priv->binding, + tomboy_keybinder_bind (priv->binding, (TomboyBindkeyHandler)on_binding_activated, bind); @@ -369,15 +369,15 @@ create_rule (MaximusBind *bind, const gchar *filename) return; } - rule = g_slice_new0 (MaximusRule); + rule = g_slice_new0 (MaximusRule); - rule->wm_class = g_key_file_get_string (file, + rule->wm_class = g_key_file_get_string (file, RULE_GROUP, RULE_WMCLASS, NULL); - rule->fullscreen = g_key_file_get_string (file, + rule->fullscreen = g_key_file_get_string (file, RULE_GROUP, RULE_FULLSCREEN, NULL); - rule->unfullscreen = g_key_file_get_string (file, + rule->unfullscreen = g_key_file_get_string (file, RULE_GROUP, RULE_UNFULLSCREEN, NULL); if (!rule->wm_class || !rule->fullscreen || !rule->unfullscreen) @@ -412,7 +412,7 @@ load_rules (MaximusBind *bind, const gchar *path) while ((name = g_dir_read_name (dir))) { gchar *filename; - + filename= g_build_filename (path, name, NULL); create_rule (bind, filename); @@ -465,7 +465,7 @@ maximus_bind_init (MaximusBind *bind) MaximusBindPrivate *priv; GdkDisplay *display = gdk_display_get_default (); WnckScreen *screen; - + priv = bind->priv = MAXIMUS_BIND_GET_PRIVATE (bind); priv->fk = fakekey_init (GDK_DISPLAY_XDISPLAY (display)); @@ -495,7 +495,7 @@ maximus_bind_get_default (void) static MaximusBind *bind = NULL; if (!bind) - bind = g_object_new (MAXIMUS_TYPE_BIND, + bind = g_object_new (MAXIMUS_TYPE_BIND, NULL); return bind; |