[Xfce4-commits] r26151 - in xfce4-panel/trunk: . plugins/iconbox plugins/pager plugins/showdesktop plugins/tasklist plugins/windowlist
Nick Schermer
nick at xfce.org
Sat Oct 20 12:33:12 CEST 2007
Author: nick
Date: 2007-10-20 10:33:12 +0000 (Sat, 20 Oct 2007)
New Revision: 26151
Added:
xfce4-panel/trunk/plugins/pager/xfce-pager.c
xfce4-panel/trunk/plugins/pager/xfce-pager.h
Modified:
xfce4-panel/trunk/configure.in.in
xfce4-panel/trunk/plugins/iconbox/Makefile.am
xfce4-panel/trunk/plugins/iconbox/iconbox.c
xfce4-panel/trunk/plugins/pager/Makefile.am
xfce4-panel/trunk/plugins/pager/pager.c
xfce4-panel/trunk/plugins/showdesktop/Makefile.am
xfce4-panel/trunk/plugins/showdesktop/showdesktop.c
xfce4-panel/trunk/plugins/tasklist/Makefile.am
xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.c
xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.h
xfce4-panel/trunk/plugins/tasklist/tasklist.c
xfce4-panel/trunk/plugins/tasklist/tasklist.h
xfce4-panel/trunk/plugins/windowlist/Makefile.am
xfce4-panel/trunk/plugins/windowlist/windowlist.c
xfce4-panel/trunk/plugins/windowlist/windowlist.h
Log:
* Switch to libwnck.
Modified: xfce4-panel/trunk/configure.in.in
===================================================================
--- xfce4-panel/trunk/configure.in.in 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/configure.in.in 2007-10-20 10:33:12 UTC (rev 26151)
@@ -14,7 +14,7 @@
m4_define([xfce4_panel_version_major], [4])
m4_define([xfce4_panel_version_minor], [5])
m4_define([xfce4_panel_version_micro], [0])
-m4_define([xfce4_panel_version_nano], [2]) dnl leave this empty to have no nano version
+m4_define([xfce4_panel_version_nano], [3]) dnl leave this empty to have no nano version
m4_define([xfce4_panel_version_build], [r at REVISION@])
m4_define([xfce4_panel_version_tag], [svn])
m4_define([xfce4_panel_version], [xfce4_panel_version_major().xfce4_panel_version_minor().xfce4_panel_version_micro()ifelse(xfce4_panel_version_nano(), [], [], [.xfce4_panel_version_nano()])ifelse(xfce4_panel_version_tag(), [svn], [xfce4_panel_version_tag()-xfce4_panel_version_build()], [xfce4_panel_version_tag()])])
@@ -113,6 +113,7 @@
XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
XDT_CHECK_PACKAGE([LIBEXO], [exo-0.3], [0.3.1.11])
XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.0.0])
+XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-1.0], [2.12])
dnl ***********************************
dnl *** Check for optional packages ***
Modified: xfce4-panel/trunk/plugins/iconbox/Makefile.am
===================================================================
--- xfce4-panel/trunk/plugins/iconbox/Makefile.am 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/iconbox/Makefile.am 2007-10-20 10:33:12 UTC (rev 26151)
@@ -4,6 +4,7 @@
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libiconbox\" \
-DLOCALEDIR=\"$(localedir)\" \
+ -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(PLATFORM_CPPFLAGS)
plugindir = \
@@ -19,6 +20,7 @@
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \
+ $(LIBWNCK_CFLAGS) \
$(PLATFORM_CFLAGS)
libiconbox_la_LDFLAGS = \
@@ -35,7 +37,8 @@
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCEGUI4_LIBS)
+ $(LIBXFCEGUI4_LIBS) \
+ $(LIBWNCK_LIBS)
libiconbox_la_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel.la
Modified: xfce4-panel/trunk/plugins/iconbox/iconbox.c
===================================================================
--- xfce4-panel/trunk/plugins/iconbox/iconbox.c 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/iconbox/iconbox.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -24,9 +24,10 @@
#include <math.h>
#include <gtk/gtk.h>
+#include <libwnck/libwnck.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfcegui4/libxfcegui4.h>
-#include <libxfcegui4/netk-window-action-menu.h>
+#include <libwnck/window-action-menu.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/xfce-panel-convenience.h>
#include <libxfce4panel/xfce-hvbox.h>
@@ -39,7 +40,7 @@
{
XfcePanelPlugin *plugin;
- NetkScreen *netk_screen;
+ WnckScreen *wnck_screen;
int connections[N_ICONBOX_CONNECTIONS];
int screen_changed_id;
GtkWidget *box;
@@ -60,7 +61,7 @@
{
Iconbox *ib;
- NetkWindow *window;
+ WnckWindow *window;
int connections[N_ICON_CONNECTIONS];
GdkPixbuf *pb;
@@ -85,19 +86,19 @@
/* icons */
static void
-update_visibility (Icon *icon, NetkWorkspace *optional_active_ws)
+update_visibility (Icon *icon, WnckWorkspace *optional_active_ws)
{
- NetkWorkspace *ws;
+ WnckWorkspace *ws;
gdk_flush ();
- if (netk_window_is_skip_tasklist (icon->window))
+ if (wnck_window_is_skip_tasklist (icon->window))
{
gtk_widget_hide (icon->button);
return;
}
- if (icon->ib->only_hidden && !netk_window_is_minimized (icon->window))
+ if (icon->ib->only_hidden && !wnck_window_is_minimized (icon->window))
{
gtk_widget_hide (icon->button);
return;
@@ -109,14 +110,14 @@
}
else
{
- ws = netk_screen_get_active_workspace
- (netk_window_get_screen (icon->window));
+ ws = wnck_screen_get_active_workspace
+ (wnck_window_get_screen (icon->window));
}
if (icon->ib->all_workspaces
- || netk_window_is_sticky (icon->window)
- || ws == netk_window_get_workspace (icon->window)
- || netk_window_or_transient_demands_attention (icon->window))
+ || wnck_window_is_sticky (icon->window)
+ || ws == wnck_window_get_workspace (icon->window)
+ || wnck_window_or_transient_needs_attention (icon->window))
{
gtk_widget_show (icon->button);
}
@@ -133,11 +134,11 @@
g_return_if_fail (GDK_IS_PIXBUF (icon->pb));
- if (netk_window_is_minimized (icon->window))
+ if (wnck_window_is_minimized (icon->window))
{
if (!icon->was_minimized)
{
- /* copied from netk-tasklist.c: dimm_icon */
+ /* copied from wnck-tasklist.c: dimm_icon */
int x, y, w, h, pixel_stride, row_stride;
guchar *row, *pixels;
@@ -264,24 +265,24 @@
if (ev->button == 1)
{
- if (netk_window_is_active (icon->window))
+ if (wnck_window_is_active (icon->window))
{
- netk_window_minimize (icon->window);
+ wnck_window_minimize (icon->window);
}
else
{
- NetkScreen *scr;
- NetkWorkspace *aws, *ws;
+ WnckScreen *scr;
+ WnckWorkspace *aws, *ws;
- scr = netk_window_get_screen (icon->window);
- aws = netk_screen_get_active_workspace (scr);
- ws = netk_window_get_workspace (icon->window);
+ scr = wnck_window_get_screen (icon->window);
+ aws = wnck_screen_get_active_workspace (scr);
+ ws = wnck_window_get_workspace (icon->window);
if (aws != ws)
{
- netk_workspace_activate (ws);
+ wnck_workspace_activate (ws, ev->time);
}
- netk_window_activate (icon->window);
+ wnck_window_activate (icon->window, ev->time);
}
return TRUE;
@@ -290,7 +291,7 @@
{
GtkWidget *action_menu;
- action_menu = netk_create_window_action_menu(icon->window);
+ action_menu = wnck_create_window_action_menu(icon->window);
g_signal_connect(G_OBJECT(action_menu), "selection-done",
G_CALLBACK(gtk_widget_destroy), NULL);
@@ -305,24 +306,24 @@
}
static void
-icon_name_changed (NetkWindow *window, gpointer data)
+icon_name_changed (WnckWindow *window, gpointer data)
{
Icon *icon = (Icon *)data;
gtk_tooltips_set_tip (icon->ib->icon_tooltips, icon->button,
- netk_window_get_name (window), NULL);
+ wnck_window_get_name (window), NULL);
}
static void
-icon_state_changed (NetkWindow *window, NetkWindowState changed_mask,
- NetkWindowState new_state, gpointer data)
+icon_state_changed (WnckWindow *window, WnckWindowState changed_mask,
+ WnckWindowState new_state, gpointer data)
{
Icon *icon = (Icon *)data;
- if (changed_mask & NETK_WINDOW_STATE_DEMANDS_ATTENTION
- || changed_mask & NETK_WINDOW_STATE_URGENT)
+ if (changed_mask & WNCK_WINDOW_STATE_DEMANDS_ATTENTION
+ || changed_mask & WNCK_WINDOW_STATE_URGENT)
{
- if (netk_window_or_transient_demands_attention (window))
+ if (wnck_window_or_transient_needs_attention (window))
{
queue_urgent_timeout (icon);
}
@@ -332,8 +333,8 @@
}
}
- if (changed_mask & NETK_WINDOW_STATE_MINIMIZED
- || changed_mask & NETK_WINDOW_STATE_SKIP_TASKLIST)
+ if (changed_mask & WNCK_WINDOW_STATE_MINIMIZED
+ || changed_mask & WNCK_WINDOW_STATE_SKIP_TASKLIST)
{
update_visibility (icon, NULL);
@@ -342,7 +343,7 @@
}
static void
-icon_workspace_changed (NetkWindow *window, gpointer data)
+icon_workspace_changed (WnckWindow *window, gpointer data)
{
Icon *icon = (Icon *)data;
@@ -350,20 +351,20 @@
}
static void
-icon_icon_changed (NetkWindow *window, gpointer data)
+icon_icon_changed (WnckWindow *window, gpointer data)
{
Icon *icon = (Icon *)data;
if (icon->pb)
g_object_unref (G_OBJECT (icon->pb));
- icon->pb = netk_window_get_icon (icon->window);
+ icon->pb = wnck_window_get_icon (icon->window);
if (icon->pb)
g_object_ref (G_OBJECT (icon->pb));
/* make sure the icon is actually updated */
- icon->was_minimized = !netk_window_is_minimized (icon->window);
+ icon->was_minimized = !wnck_window_is_minimized (icon->window);
icon_update_image (icon);
}
@@ -389,7 +390,7 @@
}
static Icon *
-icon_new (NetkWindow *window, Iconbox *ib)
+icon_new (WnckWindow *window, Iconbox *ib)
{
Icon *icon = panel_slice_new0 (Icon);
int i = 0;
@@ -407,7 +408,7 @@
gtk_widget_show (icon->image);
gtk_container_add (GTK_CONTAINER (icon->button), icon->image);
- icon->pb = netk_window_get_icon (window);
+ icon->pb = wnck_window_get_icon (window);
if (icon->pb)
{
xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE (icon->image),
@@ -433,7 +434,7 @@
g_assert (i == N_ICON_CONNECTIONS);
- if (netk_window_is_skip_tasklist (window))
+ if (wnck_window_is_skip_tasklist (window))
{
return icon;
}
@@ -441,7 +442,7 @@
icon_update_image (icon);
gtk_tooltips_set_tip (ib->icon_tooltips, icon->button,
- netk_window_get_name (window), NULL);
+ wnck_window_get_name (window), NULL);
update_visibility (icon, NULL);
@@ -450,11 +451,11 @@
/* iconlist */
static void
-iconbox_active_window_changed (NetkScreen *screen, gpointer data)
+iconbox_active_window_changed (WnckScreen *screen, WnckScreen *previous, gpointer data)
{
Iconbox *ib = (Iconbox *)data;
GSList *l;
- NetkWindow *window = netk_screen_get_active_window (screen);
+ WnckWindow *window = wnck_screen_get_active_window (screen);
for (l = ib->iconlist; l != NULL; l = l->next)
{
@@ -466,11 +467,11 @@
}
static void
-iconbox_active_workspace_changed (NetkScreen *screen, gpointer data)
+iconbox_active_workspace_changed (WnckScreen *screen, WnckWorkspace *previous_workspace, gpointer data)
{
Iconbox *ib = (Iconbox *)data;
GSList *l;
- NetkWorkspace *ws = netk_screen_get_active_workspace (screen);
+ WnckWorkspace *ws = wnck_screen_get_active_workspace (screen);
for (l = ib->iconlist; l != NULL; l = l->next)
{
@@ -481,7 +482,7 @@
}
static void
-iconbox_window_opened (NetkScreen *screen, NetkWindow *window, gpointer data)
+iconbox_window_opened (WnckScreen *screen, WnckWindow *window, gpointer data)
{
Iconbox *ib = (Iconbox *)data;
Icon *icon;
@@ -492,14 +493,14 @@
gtk_box_pack_start (GTK_BOX (ib->iconbox), icon->button, FALSE, FALSE, 0);
- if (netk_window_or_transient_demands_attention (window))
+ if (wnck_window_or_transient_needs_attention (window))
{
queue_urgent_timeout (icon);
}
}
static void
-iconbox_window_closed (NetkScreen *screen, NetkWindow *window, gpointer data)
+iconbox_window_closed (WnckScreen *screen, WnckWindow *window, gpointer data)
{
Iconbox *ib = (Iconbox *)data;
GSList *l;
@@ -527,40 +528,40 @@
int i = 0;
GList *windows, *l;
- netk_screen_force_update (ib->netk_screen);
+ wnck_screen_force_update (ib->wnck_screen);
ib->connections[i++] =
- g_signal_connect (ib->netk_screen, "active_window_changed",
+ g_signal_connect (ib->wnck_screen, "active_window_changed",
G_CALLBACK (iconbox_active_window_changed),
ib);
ib->connections[i++] =
- g_signal_connect (ib->netk_screen, "active_workspace_changed",
+ g_signal_connect (ib->wnck_screen, "active_workspace_changed",
G_CALLBACK (iconbox_active_workspace_changed),
ib);
ib->connections[i++] =
- g_signal_connect (ib->netk_screen, "window_opened",
+ g_signal_connect (ib->wnck_screen, "window_opened",
G_CALLBACK (iconbox_window_opened),
ib);
ib->connections[i++] =
- g_signal_connect (ib->netk_screen, "window_closed",
+ g_signal_connect (ib->wnck_screen, "window_closed",
G_CALLBACK (iconbox_window_closed),
ib);
g_assert (i == N_ICONBOX_CONNECTIONS);
- windows = netk_screen_get_windows (ib->netk_screen);
+ windows = wnck_screen_get_windows (ib->wnck_screen);
for (l = windows; l != NULL; l = l->next)
{
- NetkWindow *w = l->data;
+ WnckWindow *w = l->data;
- iconbox_window_opened (ib->netk_screen, w, ib);
+ iconbox_window_opened (ib->wnck_screen, w, ib);
}
- iconbox_active_window_changed (ib->netk_screen, ib);
+ iconbox_active_window_changed (ib->wnck_screen, NULL, ib);
}
/* cleanup */
@@ -573,7 +574,7 @@
for (i = 0; i < N_ICONBOX_CONNECTIONS; i++)
{
if (ib->connections[i])
- g_signal_handler_disconnect (ib->netk_screen, ib->connections[i]);
+ g_signal_handler_disconnect (ib->wnck_screen, ib->connections[i]);
ib->connections[i] = 0;
}
@@ -766,7 +767,7 @@
(GtkCallback) gtk_widget_destroy, NULL);
cleanup_icons (ib);
- ib->netk_screen = netk_screen_get (gdk_screen_get_number (screen));
+ ib->wnck_screen = wnck_screen_get (gdk_screen_get_number (screen));
iconbox_init_icons (ib);
}
Modified: xfce4-panel/trunk/plugins/pager/Makefile.am
===================================================================
--- xfce4-panel/trunk/plugins/pager/Makefile.am 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/pager/Makefile.am 2007-10-20 10:33:12 UTC (rev 26151)
@@ -4,6 +4,7 @@
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libpager\" \
-DLOCALEDIR=\"$(localedir)\" \
+ -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(PLATFORM_CPPFLAGS)
plugindir = \
@@ -13,12 +14,15 @@
libpager.la
libpager_la_SOURCES = \
- pager.c
+ pager.c \
+ xfce-pager.c \
+ xfce-pager.h
libpager_la_CFLAGS = \
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \
+ $(LIBWNCK_CFLAGS) \
$(PLATFORM_CFLAGS)
libpager_la_LDFLAGS = \
@@ -35,7 +39,8 @@
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCEGUI4_LIBS)
+ $(LIBXFCEGUI4_LIBS) \
+ $(LIBWNCK_LIBS)
libpager_la_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel.la
Modified: xfce4-panel/trunk/plugins/pager/pager.c
===================================================================
--- xfce4-panel/trunk/plugins/pager/pager.c 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/pager/pager.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -26,25 +26,29 @@
#include <gtk/gtk.h>
#include <libxfce4util/libxfce4util.h>
+#include <libwnck/libwnck.h>
#include <libxfcegui4/libxfcegui4.h>
#include <libxfce4panel/xfce-panel-plugin.h>
+#include "xfce-pager.h"
+
typedef struct
{
XfcePanelPlugin *plugin;
- NetkScreen *screen;
- GdkScreen *gdk_screen;
- GtkWidget *pager;
+ WnckScreen *screen;
+ GdkScreen *gdk_screen;
+ GtkWidget *pager;
- int ws_created_id;
- int ws_destroyed_id;
- int screen_changed_id;
- int screen_size_changed_id;
+ gint ws_created_id;
+ gint ws_destroyed_id;
+ gint screen_changed_id;
+ gint screen_size_changed_id;
- int rows;
- guint scrolling:1;
+ gint rows;
+ guint scrolling : 1;
+ guint show_names : 1;
}
Pager;
@@ -69,7 +73,7 @@
GtkOrientation orientation,
Pager *pager)
{
- netk_pager_set_orientation (NETK_PAGER (pager->pager), orientation);
+ wnck_pager_set_orientation (WNCK_PAGER (pager->pager), orientation);
}
static gboolean
@@ -128,6 +132,7 @@
XfceRc *rc;
int rows = 1;
gboolean scrolling = TRUE;
+ gboolean show_names = FALSE;
if ((file = xfce_panel_plugin_lookup_rc_file (plugin)) != NULL)
{
@@ -138,11 +143,13 @@
{
rows = xfce_rc_read_int_entry (rc, "rows", 1);
scrolling = xfce_rc_read_bool_entry (rc, "scrolling", TRUE);
+ show_names = xfce_rc_read_bool_entry (rc, "show-names", FALSE);
}
}
pager->rows = rows;
pager->scrolling = scrolling;
+ pager->show_names = show_names;
}
static void
@@ -164,12 +171,14 @@
xfce_rc_write_bool_entry (rc, "scrolling", pager->scrolling);
+ xfce_rc_write_bool_entry (rc, "show-names", pager->show_names);
+
xfce_rc_close (rc);
}
/* create widgets and connect to signals */
static void
-pager_n_workspaces_changed (NetkScreen * screen, NetkWorkspace * ws,
+pager_n_workspaces_changed (WnckScreen * screen, WnckWorkspace * ws,
Pager * pager)
{
pager_set_size (pager->plugin,
@@ -203,9 +212,9 @@
}
pager->gdk_screen = screen;
- pager->screen = netk_screen_get (gdk_screen_get_number (screen));
+ pager->screen = wnck_screen_get (gdk_screen_get_number (screen));
- netk_pager_set_screen (NETK_PAGER (pager->pager), pager->screen);
+ wnck_pager_set_screen (WNCK_PAGER (pager->pager), pager->screen);
pager->ws_created_id =
g_signal_connect (pager->screen, "workspace-created",
@@ -254,15 +263,15 @@
pager->gdk_screen = screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
screen_idx = gdk_screen_get_number (screen);
- pager->screen = netk_screen_get (screen_idx);
+ pager->screen = wnck_screen_get (screen_idx);
pager_read_rc_file (plugin, pager);
- pager->pager = netk_pager_new (pager->screen);
- netk_pager_set_orientation (NETK_PAGER (pager->pager),
+ pager->pager = xfce_pager_new (pager->screen);
+ wnck_pager_set_orientation (WNCK_PAGER (pager->pager),
xfce_panel_plugin_get_orientation (plugin));
- netk_pager_set_n_rows (NETK_PAGER (pager->pager), pager->rows);
- netk_pager_set_workspace_scrolling (NETK_PAGER (pager->pager), pager->scrolling);
+ wnck_pager_set_n_rows (WNCK_PAGER (pager->pager), pager->rows);
+ xfce_pager_set_workspace_scrolling (XFCE_PAGER (pager->pager), pager->scrolling);
gtk_widget_show (pager->pager);
gtk_container_add (GTK_CONTAINER (plugin), pager->pager);
@@ -292,13 +301,13 @@
static void
rows_changed (GtkSpinButton * spin, Pager * pager)
{
- int rows = gtk_spin_button_get_value_as_int (spin);
+ gint rows = gtk_spin_button_get_value_as_int (spin);
if (rows != pager->rows)
{
pager->rows = rows;
- netk_pager_set_n_rows (NETK_PAGER (pager->pager), pager->rows);
+ wnck_pager_set_n_rows (WNCK_PAGER (pager->pager), pager->rows);
}
}
@@ -311,11 +320,25 @@
{
pager->scrolling = scrolling;
- netk_pager_set_workspace_scrolling (NETK_PAGER (pager->pager), scrolling);
+ xfce_pager_set_workspace_scrolling (XFCE_PAGER (pager->pager), scrolling);
}
}
static void
+workspace_show_names_toggled (GtkWidget *button, Pager *pager)
+{
+ gboolean show_names = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+
+ if (pager->show_names != show_names)
+ {
+ pager->show_names = show_names;
+
+ wnck_pager_set_display_mode (WNCK_PAGER (pager->pager),
+ show_names ? WNCK_PAGER_DISPLAY_NAME : WNCK_PAGER_DISPLAY_CONTENT);
+ }
+}
+
+static void
pager_dialog_response (GtkWidget *dlg, int reponse, Pager *pager)
{
g_object_set_data (G_OBJECT (pager->plugin), "dialog", NULL);
@@ -328,8 +351,8 @@
static void
pager_properties_dialog (XfcePanelPlugin *plugin, Pager *pager)
{
- GtkWidget *dlg, *vbox, *hbox, *label, *spin, *scrolling;
- int max;
+ GtkWidget *dlg, *vbox, *hbox, *label, *spin, *scrolling, *show_names;
+ gint max;
xfce_panel_plugin_block_menu (plugin);
@@ -373,7 +396,7 @@
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- max = netk_screen_get_workspace_count (pager->screen);
+ max = wnck_screen_get_workspace_count (pager->screen);
if (max > 1)
{
@@ -388,7 +411,7 @@
}
else
{
- GtkWidget *label = gtk_label_new ("1");
+ label = gtk_label_new ("1");
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -402,6 +425,14 @@
g_signal_connect (scrolling, "toggled",
G_CALLBACK (workspace_scrolling_toggled), pager);
+ show_names = gtk_check_button_new_with_mnemonic (_("Show workspace names"));
+ gtk_widget_show (show_names);
+ gtk_box_pack_start (GTK_BOX (vbox), show_names, FALSE, FALSE, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_names), pager->show_names);
+
+ g_signal_connect (show_names, "toggled",
+ G_CALLBACK (workspace_show_names_toggled), pager);
+
gtk_widget_show (dlg);
}
Added: xfce4-panel/trunk/plugins/pager/xfce-pager.c
===================================================================
--- xfce4-panel/trunk/plugins/pager/xfce-pager.c (rev 0)
+++ xfce4-panel/trunk/plugins/pager/xfce-pager.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -0,0 +1,183 @@
+/* vim: set expandtab ts=8 sw=4: */
+
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <libwnck/libwnck.h>
+#include <libxfce4panel/xfce-panel-macros.h>
+
+#include "xfce-pager.h"
+
+#define XFCE_PAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), XFCE_TYPE_PAGER, XfcePagerPrivate))
+
+
+
+struct _XfcePagerPrivate
+{
+ WnckScreen *screen;
+ guint workspace_scrolling : 1;
+};
+
+
+
+static void xfce_pager_init (XfcePager *pager);
+static void xfce_pager_class_init (XfcePagerClass *pager);
+static gboolean xfce_pager_scroll_event (GtkWidget *widget,
+ GdkEventScroll *event);
+static WnckScreen *xfce_pager_get_screen (XfcePager *pager);
+
+
+
+GType
+xfce_pager_get_type ()
+{
+ static GType xfce_pager_type = 0;
+
+ if (!xfce_pager_type)
+ {
+ static const GTypeInfo xfce_pager_info =
+ {
+ sizeof (XfcePagerClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) xfce_pager_class_init,
+ (GClassFinalizeFunc) NULL,
+ NULL,
+ sizeof (XfcePager),
+ 0,
+ (GInstanceInitFunc) xfce_pager_init,
+ NULL
+ };
+
+ xfce_pager_type = g_type_register_static (WNCK_TYPE_PAGER, I_("XfcePager"), &xfce_pager_info, 0);
+ }
+
+ return xfce_pager_type;
+}
+
+
+
+static void
+xfce_pager_class_init (XfcePagerClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (XfcePagerPrivate));
+
+ widget_class->scroll_event = xfce_pager_scroll_event;
+}
+
+
+
+static void
+xfce_pager_init(XfcePager *pager)
+{
+ pager->priv = XFCE_PAGER_GET_PRIVATE (pager);
+}
+
+
+
+GtkWidget *
+xfce_pager_new (WnckScreen *screen)
+{
+ GtkWidget *pager = g_object_new (XFCE_TYPE_PAGER, NULL);
+
+ XFCE_PAGER (pager)->priv->screen = screen;
+ wnck_pager_set_screen (WNCK_PAGER (pager), screen);
+
+ return pager;
+}
+
+
+
+void
+xfce_pager_set_workspace_scrolling (XfcePager *pager,
+ gboolean scrolling)
+{
+ pager->priv->workspace_scrolling = scrolling;
+}
+
+
+
+static gboolean
+xfce_pager_scroll_event (GtkWidget *widget,
+ GdkEventScroll *event)
+{
+ XfcePager *pager;
+ gint n, active;
+ WnckWorkspace *ws = NULL;
+ WnckScreen *screen;
+
+ g_return_val_if_fail (event != NULL, FALSE);
+ g_return_val_if_fail (widget != NULL, FALSE);
+
+ pager = XFCE_PAGER (widget);
+
+ if (!pager->priv->workspace_scrolling)
+ return FALSE;
+
+ screen = xfce_pager_get_screen (pager);
+ n = wnck_screen_get_workspace_count (screen);
+ active = wnck_workspace_get_number (wnck_screen_get_active_workspace(screen));
+
+ switch (event->direction)
+ {
+ case GDK_SCROLL_UP:
+ case GDK_SCROLL_LEFT:
+ if (active > 0)
+ {
+ ws = wnck_screen_get_workspace (screen, active - 1);
+ }
+ else
+ {
+ ws = wnck_screen_get_workspace (screen, n - 1);
+ }
+ wnck_workspace_activate (ws, 0);
+ break;
+
+ case GDK_SCROLL_DOWN:
+ case GDK_SCROLL_RIGHT:
+ if (active < n - 1)
+ {
+ ws = wnck_screen_get_workspace (screen, active + 1);
+ }
+ else
+ {
+ ws = wnck_screen_get_workspace (screen, 0);
+ }
+ wnck_workspace_activate (ws, 0);
+ break;
+
+ default:
+ break;
+ }
+
+ return TRUE;
+}
+
+
+
+static WnckScreen *
+xfce_pager_get_screen (XfcePager *pager)
+{
+ return pager->priv->screen;
+}
Added: xfce4-panel/trunk/plugins/pager/xfce-pager.h
===================================================================
--- xfce4-panel/trunk/plugins/pager/xfce-pager.h (rev 0)
+++ xfce4-panel/trunk/plugins/pager/xfce-pager.h 2007-10-20 10:33:12 UTC (rev 26151)
@@ -0,0 +1,51 @@
+/* vim: set expandtab ts=8 sw=4: */
+
+/* $Id$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+#ifndef __XFCE_PAGER_H__
+#define __XFCE_PAGER_H__
+
+#define XFCE_TYPE_PAGER xfce_pager_get_type()
+#define XFCE_PAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_PAGER, XfcePager))
+#define XFCE_IS_PAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_PAGER))
+#define XFCE_PAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_PAGER, XfcePagerClass))
+#define XFCE_IS_PAGER_CLASS(klass) ( G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_PAGER))
+
+typedef struct _XfcePagerPrivate XfcePagerPrivate;
+typedef struct _XfcePager XfcePager;
+typedef struct _XfcePagerClass XfcePagerClass;
+
+struct _XfcePager
+{
+ WnckPager __parent__;
+ XfcePagerPrivate *priv;
+};
+
+struct _XfcePagerClass
+{
+ WnckPagerClass __parent__;
+};
+
+GType xfce_pager_get_type();
+GtkWidget *xfce_pager_new (WnckScreen *screen);
+
+void xfce_pager_set_workspace_scrolling (XfcePager *pager,
+ gboolean scrolling);
+
+#endif /* __XFCE_PAGER_H__ */
Modified: xfce4-panel/trunk/plugins/showdesktop/Makefile.am
===================================================================
--- xfce4-panel/trunk/plugins/showdesktop/Makefile.am 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/showdesktop/Makefile.am 2007-10-20 10:33:12 UTC (rev 26151)
@@ -4,6 +4,7 @@
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libshowdesktop\" \
-DLOCALEDIR=\"$(localedir)\" \
+ -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(PLATFORM_CPPFLAGS)
plugindir = \
@@ -19,6 +20,7 @@
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \
+ $(LIBWNCK_CFLAGS) \
$(PLATFORM_CFLAGS)
libshowdesktop_la_LDFLAGS = \
@@ -35,7 +37,8 @@
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCEGUI4_LIBS)
+ $(LIBXFCEGUI4_LIBS) \
+ $(LIBWNCK_LIBS)
libshowdesktop_la_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel.la
Modified: xfce4-panel/trunk/plugins/showdesktop/showdesktop.c
===================================================================
--- xfce4-panel/trunk/plugins/showdesktop/showdesktop.c 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/showdesktop/showdesktop.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -24,6 +24,7 @@
#endif
#include <gtk/gtk.h>
+#include <libwnck/libwnck.h>
#include <libxfcegui4/libxfcegui4.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libxfce4panel/xfce-panel-convenience.h>
@@ -40,8 +41,8 @@
GtkWidget *image;
GtkTooltips *tooltips;
- NetkScreen *screen;
- int netk_id;
+ WnckScreen *screen;
+ int wnck_id;
int screen_id;
int style_id;
@@ -80,8 +81,8 @@
static void
showdesktop_free_data (XfcePanelPlugin * plugin, ShowDesktopData * sdd)
{
- if (sdd->netk_id)
- g_signal_handler_disconnect (sdd->screen, sdd->netk_id);
+ if (sdd->wnck_id)
+ g_signal_handler_disconnect (sdd->screen, sdd->wnck_id);
if (sdd->screen_id)
g_signal_handler_disconnect (plugin, sdd->screen_id);
@@ -89,7 +90,7 @@
if (sdd->style_id)
g_signal_handler_disconnect (plugin, sdd->style_id);
- sdd->netk_id = sdd->screen_id = sdd->style_id = 0;
+ sdd->wnck_id = sdd->screen_id = sdd->style_id = 0;
gtk_object_sink (GTK_OBJECT (sdd->tooltips));
panel_slice_free (ShowDesktopData, sdd);
}
@@ -127,16 +128,16 @@
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- netk_screen_toggle_showing_desktop (sdd->screen, active);
+ wnck_screen_toggle_showing_desktop (sdd->screen, active);
sdd->showing = active;
update_button_display (sdd);
}
static void
-showing_desktop_changed (NetkScreen * screen, ShowDesktopData * sdd)
+showing_desktop_changed (WnckScreen * screen, ShowDesktopData * sdd)
{
- sdd->showing = netk_screen_get_showing_desktop (screen);
+ sdd->showing = wnck_screen_get_showing_desktop (screen);
update_button (sdd);
}
@@ -144,23 +145,23 @@
showdesktop_screen_changed (XfcePanelPlugin *plugin, GdkScreen *screen,
ShowDesktopData *sdd)
{
- if (sdd->netk_id)
+ if (sdd->wnck_id)
{
- g_signal_handler_disconnect (sdd->screen, sdd->netk_id);
- sdd->netk_id = 0;
+ g_signal_handler_disconnect (sdd->screen, sdd->wnck_id);
+ sdd->wnck_id = 0;
}
screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
if (screen)
{
- sdd->screen = netk_screen_get (gdk_screen_get_number (screen));
+ sdd->screen = wnck_screen_get (gdk_screen_get_number (screen));
- sdd->netk_id =
+ sdd->wnck_id =
g_signal_connect (sdd->screen, "showing_desktop_changed",
G_CALLBACK (showing_desktop_changed), sdd);
- sdd->showing = netk_screen_get_showing_desktop (sdd->screen);
+ sdd->showing = wnck_screen_get_showing_desktop (sdd->screen);
update_button (sdd);
showdesktop_set_size (plugin, xfce_panel_plugin_get_size (plugin), sdd);
}
Modified: xfce4-panel/trunk/plugins/tasklist/Makefile.am
===================================================================
--- xfce4-panel/trunk/plugins/tasklist/Makefile.am 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/tasklist/Makefile.am 2007-10-20 10:33:12 UTC (rev 26151)
@@ -4,6 +4,7 @@
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libtasklist\" \
-DLOCALEDIR=\"$(localedir)\" \
+ -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(PLATFORM_CPPFLAGS)
plugindir = \
@@ -22,6 +23,7 @@
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \
+ $(LIBWNCK_CFLAGS) \
$(PLATFORM_CFLAGS)
libtasklist_la_LDFLAGS = \
@@ -38,7 +40,8 @@
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCEGUI4_LIBS)
+ $(LIBXFCEGUI4_LIBS) \
+ $(LIBWNCK_LIBS)
libtasklist_la_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel.la
Modified: xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.c
===================================================================
--- xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.c 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -28,79 +28,65 @@
/* prototypes */
static void tasklist_all_workspaces_toggled (GtkToggleButton *tb,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void tasklist_grouping_changed (GtkComboBox *cb,
- Tasklist *tasklist);
-static void tasklist_show_label_toggled (GtkToggleButton *tb,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void tasklist_expand_toggled (GtkToggleButton *tb,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void tasklist_flat_buttons_toggled (GtkToggleButton *tb,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void tasklist_show_handle_toggled (GtkToggleButton *tb,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void tasklist_width_changed (GtkSpinButton *sb,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void tasklist_dialog_response (GtkWidget *dlg,
gint reponse,
- Tasklist *tasklist);
+ TasklistPlugin *tasklist);
static void
tasklist_all_workspaces_toggled (GtkToggleButton *tb,
- Tasklist *tasklist)
+ TasklistPlugin *tasklist)
{
tasklist->all_workspaces = gtk_toggle_button_get_active (tb);
- netk_tasklist_set_include_all_workspaces (NETK_TASKLIST (tasklist->list),
+ wnck_tasklist_set_include_all_workspaces (WNCK_TASKLIST (tasklist->list),
tasklist->all_workspaces);
}
static void
-tasklist_grouping_changed (GtkComboBox *cb,
- Tasklist *tasklist)
+tasklist_grouping_changed (GtkComboBox *cb,
+ TasklistPlugin *tasklist)
{
tasklist->grouping = gtk_combo_box_get_active (cb);
- netk_tasklist_set_grouping (NETK_TASKLIST (tasklist->list),
+ wnck_tasklist_set_grouping (WNCK_TASKLIST (tasklist->list),
tasklist->grouping);
}
static void
-tasklist_show_label_toggled (GtkToggleButton *tb,
- Tasklist *tasklist)
-{
- tasklist->show_label = gtk_toggle_button_get_active (tb);
-
- netk_tasklist_set_show_label (NETK_TASKLIST (tasklist->list),
- tasklist->show_label);
-}
-
-
-
-static void
tasklist_expand_toggled (GtkToggleButton *tb,
- Tasklist *tasklist)
+ TasklistPlugin *tasklist)
{
tasklist->expand = gtk_toggle_button_get_active (tb);
- xfce_panel_plugin_set_expand (tasklist->plugin, tasklist->expand);
+ xfce_panel_plugin_set_expand (tasklist->panel_plugin, tasklist->expand);
}
static void
tasklist_flat_buttons_toggled (GtkToggleButton *tb,
- Tasklist *tasklist)
+ TasklistPlugin *tasklist)
{
tasklist->flat_buttons = gtk_toggle_button_get_active (tb);
- netk_tasklist_set_button_relief (NETK_TASKLIST (tasklist->list),
+ wnck_tasklist_set_button_relief (WNCK_TASKLIST (tasklist->list),
tasklist->flat_buttons ?
GTK_RELIEF_NONE : GTK_RELIEF_NORMAL);
}
@@ -109,7 +95,7 @@
static void
tasklist_show_handle_toggled (GtkToggleButton *tb,
- Tasklist *tasklist)
+ TasklistPlugin *tasklist)
{
tasklist->show_handles = gtk_toggle_button_get_active (tb);
@@ -122,47 +108,46 @@
static void
-tasklist_width_changed (GtkSpinButton *sb,
- Tasklist *tasklist)
+tasklist_width_changed (GtkSpinButton *sb,
+ TasklistPlugin *tasklist)
{
tasklist->width = gtk_spin_button_get_value_as_int (sb);
- tasklist_set_size (tasklist, xfce_panel_plugin_get_size (tasklist->plugin));
+ gtk_widget_queue_resize (GTK_WIDGET (tasklist->panel_plugin));
}
static void
-tasklist_dialog_response (GtkWidget *dlg,
- gint reponse,
- Tasklist *tasklist)
+tasklist_dialog_response (GtkWidget *dlg,
+ gint reponse,
+ TasklistPlugin *tasklist)
{
- g_object_set_data (G_OBJECT (tasklist->plugin), "dialog", NULL);
+ g_object_set_data (G_OBJECT (tasklist->panel_plugin), I_("dialog"), NULL);
gtk_widget_destroy (dlg);
- xfce_panel_plugin_unblock_menu (tasklist->plugin);
- tasklist_write_rc_file (tasklist);
+ xfce_panel_plugin_unblock_menu (tasklist->panel_plugin);
+ tasklist_plugin_write (tasklist);
}
void
-tasklist_properties_dialog (Tasklist *tasklist)
+tasklist_dialogs_configure (TasklistPlugin *tasklist)
{
GtkWidget *dlg, *mainvbox, *vbox, *frame, *cb,
*hbox, *label, *spin;
- xfce_panel_plugin_block_menu (tasklist->plugin);
+ xfce_panel_plugin_block_menu (tasklist->panel_plugin);
dlg = xfce_titled_dialog_new_with_buttons (_("Task List"), NULL,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
NULL);
- gtk_window_set_screen (GTK_WINDOW (dlg),
- gtk_widget_get_screen (GTK_WIDGET (tasklist->plugin)));
+ gtk_window_set_screen (GTK_WINDOW (dlg), gtk_widget_get_screen (GTK_WIDGET (tasklist->panel_plugin)));
- g_object_set_data (G_OBJECT (tasklist->plugin), "dialog", dlg);
+ g_object_set_data (G_OBJECT (tasklist->panel_plugin), I_("dialog"), dlg);
gtk_window_set_position (GTK_WINDOW (dlg), GTK_WIN_POS_CENTER);
gtk_window_set_icon_name (GTK_WINDOW (dlg), "xfce4-settings");
@@ -197,7 +182,7 @@
g_signal_connect (G_OBJECT (spin), "value-changed",
G_CALLBACK (tasklist_width_changed), tasklist);
- if (tasklist_using_xinerama (tasklist->plugin))
+ if (tasklist_using_xinerama (tasklist->panel_plugin))
{
cb = gtk_check_button_new_with_mnemonic (_("Use all available space"));
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
@@ -230,16 +215,10 @@
g_signal_connect (G_OBJECT (cb), "toggled",
G_CALLBACK (tasklist_all_workspaces_toggled), tasklist);
- cb = gtk_check_button_new_with_mnemonic (_("Show application _names"));
- gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->show_label);
- g_signal_connect (G_OBJECT (cb), "toggled",
- G_CALLBACK (tasklist_show_label_toggled), tasklist);
-
cb = gtk_combo_box_new_text ();
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
- /* keep order in sync with NetkTasklistGroupingType */
+ /* keep order in sync with WnckTasklistGroupingType */
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), _("Never group tasks"));
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), _("Automatically group tasks"));
gtk_combo_box_append_text (GTK_COMBO_BOX (cb), _("Always group tasks"));
Modified: xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.h
===================================================================
--- xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.h 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/tasklist/tasklist-dialogs.h 2007-10-20 10:33:12 UTC (rev 26151)
@@ -20,6 +20,6 @@
#ifndef __TASKLIST_DIALOGS_H__
#define __TASKLIST_DIALOGS_H__
-void tasklist_properties_dialog (Tasklist *tasklist) G_GNUC_INTERNAL;
+void tasklist_dialogs_configure (TasklistPlugin *tasklist) G_GNUC_INTERNAL;
#endif /* !__TASKLIST_DIALOGS_H__ */
Modified: xfce4-panel/trunk/plugins/tasklist/tasklist.c
===================================================================
--- xfce4-panel/trunk/plugins/tasklist/tasklist.c 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/tasklist/tasklist.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -1,139 +1,363 @@
-/* $Id$
+/* $Id$
*
- * Copyright (c) 2005-2007 Jasper Huijsmans <jasper at xfce.org>
+ * Copyright (c) 2005-2007 Jasper Huijsmans <jasper at xfce.org>
+ * Copyright (c) 2007 Nick Schermer <nick at xfce.org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
- * by the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Library General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libwnck/libwnck.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4panel/xfce-hvbox.h>
#include "tasklist.h"
#include "tasklist-dialogs.h"
+#define TASKLIST_HANDLE_SIZE (8)
+
/* prototypes */
-static void tasklist_orientation_changed (Tasklist *tasklist,
- GtkOrientation orientation);
-static void tasklist_free_data (Tasklist *tasklist);
-static void tasklist_read_rc_file (Tasklist *tasklist);
-static gboolean tasklist_handle_exposed (GtkWidget *widget,
- GdkEventExpose *ev,
- Tasklist *tasklist);
-static void tasklist_screen_changed (Tasklist *tasklist,
- GdkScreen *screen);
-static void tasklist_construct (XfcePanelPlugin *plugin);
+static gboolean tasklist_handle_exposed (GtkWidget *widget,
+ GdkEventExpose *event,
+ TasklistPlugin *tasklist);
+static GdkPixbuf *tasklist_icon_loader (const gchar *name,
+ gint size,
+ guint flags,
+ TasklistPlugin *tasklist);
+static TasklistPlugin *tasklist_plugin_new (XfcePanelPlugin *panel_plugin);
+static void tasklist_plugin_screen_changed (TasklistPlugin *tasklist,
+ GdkScreen *previous_screen);
+static void tasklist_plugin_orientation_changed (TasklistPlugin *tasklist,
+ GtkOrientation orientation);
+static gboolean tasklist_plugin_size_changed (TasklistPlugin *tasklist,
+ guint size);
+static void tasklist_plugin_size_request (TasklistPlugin *tasklist,
+ GtkRequisition *requisition);
+static void tasklist_plugin_read (TasklistPlugin *tasklist);
+static void tasklist_plugin_free (TasklistPlugin *tasklist);
+static void tasklist_plugin_construct (XfcePanelPlugin *panel_plugin);
/* register with the panel */
-XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (tasklist_construct);
+XFCE_PANEL_PLUGIN_REGISTER_INTERNAL (tasklist_plugin_construct);
-static void
-tasklist_orientation_changed (Tasklist *tasklist,
- GtkOrientation orientation)
+gboolean
+tasklist_using_xinerama (XfcePanelPlugin *panel_plugin)
{
+ return (gdk_screen_get_n_monitors (gtk_widget_get_screen (GTK_WIDGET (panel_plugin))) > 1);
+}
- xfce_hvbox_set_orientation (XFCE_HVBOX (tasklist->box), orientation);
- gtk_widget_queue_draw (tasklist->handle);
+
+static gboolean
+tasklist_handle_exposed (GtkWidget *widget,
+ GdkEventExpose *event,
+ TasklistPlugin *tasklist)
+{
+ GtkOrientation orientation;
+ gint x, y, w, h;
+
+ if (GTK_WIDGET_DRAWABLE (widget))
+ {
+ /* get the panel orientation */
+ orientation = xfce_panel_plugin_get_orientation (tasklist->panel_plugin);
+
+ /* set sizes */
+ x = widget->allocation.x;
+ y = widget->allocation.y;
+ w = widget->allocation.width;
+ h = widget->allocation.height;
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ y += widget->style->ythickness;
+ h -= 2 * widget->style->ythickness;
+ }
+ else
+ {
+ x += widget->style->xthickness;
+ w -= 2 * widget->style->xthickness;
+ }
+
+ gtk_paint_handle (widget->style, widget->window,
+ GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
+ &(event->area), widget, "handlebox",
+ x, y, w, h, orientation);
+
+ return TRUE;
+ }
+
+ return FALSE;
}
-gboolean
-tasklist_set_size (Tasklist *tasklist,
- gint size)
+static GdkPixbuf *
+tasklist_icon_loader (const gchar *name,
+ gint size,
+ guint flags,
+ TasklistPlugin *tasklist)
{
- GtkOrientation orientation;
+ GdkPixbuf *pixbuf = NULL;
+ gchar *base = NULL;
+ const gchar *p;
- orientation = xfce_panel_plugin_get_orientation (tasklist->plugin);
+ /* do nothing on invalid names */
+ if (G_UNLIKELY (name == NULL || *name == '\0'))
+ return NULL;
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (g_path_is_absolute (name))
{
- gtk_widget_set_size_request (GTK_WIDGET (tasklist->plugin),
- tasklist->width, size);
+ if (g_file_test (name, G_FILE_TEST_EXISTS))
+ {
+ /* directly load the file */
+ pixbuf = gdk_pixbuf_new_from_file_at_size (name, size, size, NULL);
+ }
+ else
+ {
+ /* get the base name */
+ base = g_path_get_basename (name);
+
+ /* use this function to try again */
+ pixbuf = tasklist_icon_loader (base, size, flags, tasklist);
+
+ /* cleanup */
+ g_free (base);
+ }
}
else
{
- gtk_widget_set_size_request (GTK_WIDGET (tasklist->plugin),
- size, tasklist->width);
+ /* strip prefix */
+ p = strrchr (name, '.');
+ if (G_UNLIKELY (p))
+ base = g_strndup (name, p - name);
+
+ /* load the icon */
+ pixbuf = gtk_icon_theme_load_icon (tasklist->icon_theme, base ? base : name, size, 0, NULL);
+
+ /* cleanup */
+ g_free (base);
}
- return TRUE;
+ return pixbuf;
}
+static TasklistPlugin *
+tasklist_plugin_new (XfcePanelPlugin *panel_plugin)
+{
+ TasklistPlugin *tasklist;
+ GtkWidget *alignment;
+ GdkScreen *screen;
+ gint screen_n;
+
+ /* allocate structure */
+ tasklist = panel_slice_new0 (TasklistPlugin);
+
+ /* init data */
+ tasklist->panel_plugin = panel_plugin;
+
+ /* read settings */
+ tasklist_plugin_read (tasklist);
+
+ /* create hvbox */
+ tasklist->box = xfce_hvbox_new (xfce_panel_plugin_get_orientation (panel_plugin), FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (panel_plugin), tasklist->box);
+ gtk_widget_show (tasklist->box);
+
+ /* create handle */
+ tasklist->handle = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
+ gtk_widget_set_size_request (tasklist->handle, TASKLIST_HANDLE_SIZE, TASKLIST_HANDLE_SIZE);
+ gtk_box_pack_start (GTK_BOX (tasklist->box), tasklist->handle, FALSE, FALSE, 0);
+ g_signal_connect (tasklist->handle, "expose-event", G_CALLBACK (tasklist_handle_exposed), tasklist);
+ if (tasklist->show_handles)
+ gtk_widget_show (tasklist->handle);
+
+ /* get the current screen number */
+ screen = gtk_widget_get_screen (GTK_WIDGET (panel_plugin));
+ screen_n = gdk_screen_get_number (screen);
+
+ /* set the icon theme */
+ tasklist->icon_theme = gtk_icon_theme_get_for_screen (screen);
+
+ /* alignment to avoid streched buttons */
+ alignment = gtk_alignment_new (0.00, 0.50, 0.00, 1.00);
+ gtk_box_pack_start (GTK_BOX (tasklist->box), alignment, TRUE, TRUE, 0);
+ gtk_widget_show (alignment);
+
+ /* create tasklist */
+ tasklist->list = wnck_tasklist_new (wnck_screen_get (screen_n));
+ gtk_container_add (GTK_CONTAINER (alignment), tasklist->list);
+ gtk_widget_show (tasklist->list);
+
+ /* set the tasklist settings */
+ wnck_tasklist_set_include_all_workspaces (WNCK_TASKLIST (tasklist->list), tasklist->all_workspaces);
+ wnck_tasklist_set_grouping (WNCK_TASKLIST (tasklist->list), tasklist->grouping);
+ wnck_tasklist_set_button_relief (WNCK_TASKLIST (tasklist->list), tasklist->flat_buttons ? GTK_RELIEF_NONE : GTK_RELIEF_NORMAL);
+ wnck_tasklist_set_icon_loader (WNCK_TASKLIST (tasklist->list), (WnckLoadIconFunction) tasklist_icon_loader, tasklist, NULL);
+
+ return tasklist;
+}
+
+
+
static void
-tasklist_free_data (Tasklist *tasklist)
+tasklist_plugin_screen_changed (TasklistPlugin *tasklist,
+ GdkScreen *previous_screen)
{
- GtkWidget *dlg = g_object_get_data (G_OBJECT (tasklist->plugin), "dialog");
+ GdkScreen *screen;
+ WnckScreen *wnck_screen;
- if (G_UNLIKELY (dlg))
- gtk_widget_destroy (dlg);
+ /* get the new screen */
+ screen = gtk_widget_get_screen (GTK_WIDGET (tasklist->panel_plugin));
+ if (G_UNLIKELY (screen == NULL))
+ screen = gdk_screen_get_default ();
- /* disconnect the screen changed signal */
- g_signal_handler_disconnect (G_OBJECT (tasklist->plugin),
- tasklist->screen_changed_id);
+ /* get the wnck screen */
+ wnck_screen = wnck_screen_get (gdk_screen_get_number (screen));
- panel_slice_free (Tasklist, tasklist);
+ /* set the new tasklist screen */
+ wnck_tasklist_set_screen (WNCK_TASKLIST (tasklist->list), wnck_screen);
+
+ /* set the icon theme */
+ tasklist->icon_theme = gtk_icon_theme_get_for_screen (screen);
}
static void
-tasklist_read_rc_file (Tasklist *tasklist)
+tasklist_plugin_orientation_changed (TasklistPlugin *tasklist,
+ GtkOrientation orientation)
{
+ /* set the new orientation of the hvbox */
+ xfce_hvbox_set_orientation (XFCE_HVBOX (tasklist->box), orientation);
+
+ /* redraw the handle */
+ gtk_widget_queue_draw (tasklist->handle);
+}
+
+
+
+gboolean
+tasklist_plugin_size_changed (TasklistPlugin *tasklist,
+ guint size)
+{
+ /* size is handled in the size_request function */
+ return TRUE;
+}
+
+
+
+static void
+tasklist_plugin_size_request (TasklistPlugin *tasklist,
+ GtkRequisition *requisition)
+{
+ const gint *size_hints;
+ gint length, i;
+ gint size = 0;
+ GtkOrientation orientation;
+
+ /* get the size hints */
+ size_hints = wnck_tasklist_get_size_hint_list (WNCK_TASKLIST (tasklist->list), &length);
+
+ /* check for pairs of 2 */
+ if (G_LIKELY (length % 2 == 0))
+ {
+ /* get the smallest possible size */
+ for (i = 0; i < length; i += 2)
+ {
+ if (i == 0)
+ size = size_hints[i];
+ else
+ size = MIN (size_hints[i], size);
+ }
+
+ /* add the handle size */
+ if (tasklist->show_handles)
+ size += TASKLIST_HANDLE_SIZE;
+
+ /* use the requested size when it is bigger then the prefered size */
+ if (tasklist->width > size)
+ size = tasklist->width;
+
+ /* get plugin orientation */
+ orientation = xfce_panel_plugin_get_orientation (tasklist->panel_plugin);
+
+ /* set the panel size */
+ requisition->width = requisition->height = xfce_panel_plugin_get_size (tasklist->panel_plugin);
+
+ /* set the requested plugin size */
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ requisition->width = size;
+ else
+ requisition->height = size;
+ }
+}
+
+
+static void
+tasklist_plugin_read (TasklistPlugin *tasklist)
+{
gchar *file;
XfceRc *rc;
- /* defaults */
- tasklist->grouping = NETK_TASKLIST_AUTO_GROUP;
+ /* set defaults */
+ tasklist->grouping = WNCK_TASKLIST_AUTO_GROUP;
tasklist->all_workspaces = FALSE;
- tasklist->show_label = TRUE;
tasklist->expand = TRUE;
tasklist->flat_buttons = TRUE;
tasklist->show_handles = TRUE;
tasklist->width = 300;
- if ((file = xfce_panel_plugin_lookup_rc_file (tasklist->plugin)) != NULL)
+ /* get rc file name */
+ file = xfce_panel_plugin_lookup_rc_file (tasklist->panel_plugin);
+
+ if (G_LIKELY (file))
{
+ /* open the file, readonly */
rc = xfce_rc_simple_open (file, TRUE);
+
+ /* cleanup */
g_free (file);
- if (G_UNLIKELY (rc != NULL))
+ if (G_LIKELY (rc))
{
- /* read user settings */
+ /* read settings */
tasklist->grouping = xfce_rc_read_int_entry (rc, "grouping", tasklist->grouping);
tasklist->all_workspaces = xfce_rc_read_bool_entry (rc, "all_workspaces", tasklist->all_workspaces);
- tasklist->show_label = xfce_rc_read_bool_entry (rc, "show_label", tasklist->show_label);
tasklist->flat_buttons = xfce_rc_read_bool_entry (rc, "flat_buttons", tasklist->flat_buttons);
tasklist->show_handles = xfce_rc_read_bool_entry (rc, "show_handles", tasklist->show_handles);
tasklist->width = xfce_rc_read_int_entry (rc, "width",tasklist->width);
-
- if (tasklist_using_xinerama (tasklist->plugin))
+ /* only set expand flag if xinerama is used */
+ if (tasklist_using_xinerama (tasklist->panel_plugin))
tasklist->expand = xfce_rc_read_bool_entry (rc, "expand", tasklist->expand);
+ /* close the rc file */
xfce_rc_close (rc);
}
}
@@ -142,173 +366,90 @@
void
-tasklist_write_rc_file (Tasklist *tasklist)
+tasklist_plugin_write (TasklistPlugin *tasklist)
{
gchar *file;
- XfceRc *rc = NULL;
+ XfceRc *rc;
- file = xfce_panel_plugin_save_location (tasklist->plugin, TRUE);
+ /* get rc file name, create it if needed */
+ file = xfce_panel_plugin_save_location (tasklist->panel_plugin, TRUE);
- if (G_UNLIKELY (file == NULL))
- return;
-
- rc = xfce_rc_simple_open (file, FALSE);
- g_free (file);
-
- if (G_LIKELY (rc != NULL))
+ if (G_LIKELY (file))
{
- xfce_rc_write_int_entry (rc, "grouping", tasklist->grouping);
- xfce_rc_write_int_entry (rc, "width", tasklist->width);
+ /* open the file, writable */
+ rc = xfce_rc_simple_open (file, FALSE);
- xfce_rc_write_bool_entry (rc, "all_workspaces", tasklist->all_workspaces);
- xfce_rc_write_bool_entry (rc, "show_label", tasklist->show_label);
- xfce_rc_write_bool_entry (rc, "expand", tasklist->expand);
- xfce_rc_write_bool_entry (rc, "flat_buttons", tasklist->flat_buttons);
- xfce_rc_write_bool_entry (rc, "show_handles", tasklist->show_handles);
+ /* cleanup */
+ g_free (file);
- xfce_rc_close (rc);
- }
-}
+ if (G_LIKELY (rc))
+ {
+ /* write settings */
+ xfce_rc_write_int_entry (rc, "grouping", tasklist->grouping);
+ xfce_rc_write_int_entry (rc, "width", tasklist->width);
+ xfce_rc_write_bool_entry (rc, "all_workspaces", tasklist->all_workspaces);
+ xfce_rc_write_bool_entry (rc, "expand", tasklist->expand);
+ xfce_rc_write_bool_entry (rc, "flat_buttons", tasklist->flat_buttons);
+ xfce_rc_write_bool_entry (rc, "show_handles", tasklist->show_handles);
-
-
-static gboolean
-tasklist_handle_exposed (GtkWidget *widget,
- GdkEventExpose *ev,
- Tasklist *tasklist)
-{
- GtkAllocation *allocation = &(widget->allocation);
- gint x, y, w, h;
- GtkOrientation orientation;
-
- if (GTK_WIDGET_DRAWABLE (widget))
- {
- orientation = xfce_panel_plugin_get_orientation (tasklist->plugin);
-
- x = allocation->x;
- y = allocation->y;
- w = allocation->width;
- h = allocation->height;
-
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- y += widget->style->ythickness;
- h -= 2 * widget->style->ythickness;
+ /* close the rc file */
+ xfce_rc_close (rc);
}
- else
- {
- x += widget->style->xthickness;
- w -= 2 * widget->style->xthickness;
- }
-
- gtk_paint_handle (widget->style, widget->window,
- GTK_WIDGET_STATE (widget), GTK_SHADOW_NONE,
- &(ev->area), widget, "handlebox",
- x, y, w, h,
- orientation);
-
- return TRUE;
}
-
- return FALSE;
}
-gboolean
-tasklist_using_xinerama (XfcePanelPlugin *plugin)
-{
- return (gdk_screen_get_n_monitors (gtk_widget_get_screen (GTK_WIDGET (plugin))) > 1);
-}
-
-
-
static void
-tasklist_screen_changed (Tasklist *tasklist,
- GdkScreen *screen)
+tasklist_plugin_free (TasklistPlugin *tasklist)
{
- NetkScreen *ns;
+ GtkWidget *dialog;
- /* get the new screen */
- screen = gtk_widget_get_screen (GTK_WIDGET (tasklist->plugin));
+ /* destroy the dialog */
+ dialog = g_object_get_data (G_OBJECT (tasklist->panel_plugin), I_("dialog"));
+ if (dialog)
+ gtk_widget_destroy (dialog);
- /* be secure */
- if (G_UNLIKELY (screen == NULL))
- screen = gdk_screen_get_default ();
+ /* disconnect screen changed signal */
+ g_signal_handler_disconnect (G_OBJECT (tasklist->panel_plugin), tasklist->screen_changed_id);
- ns = netk_screen_get (gdk_screen_get_number (screen));
-
- netk_tasklist_set_screen (NETK_TASKLIST (tasklist->list), ns);
+ /* free slice */
+ panel_slice_free (TasklistPlugin, tasklist);
}
static void
-tasklist_construct (XfcePanelPlugin *plugin)
+tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
{
- GdkScreen *screen;
- gint screen_idx;
- Tasklist *tasklist = panel_slice_new0 (Tasklist);
+ TasklistPlugin *tasklist;
- tasklist->plugin = plugin;
+ /* create the tray panel plugin */
+ tasklist = tasklist_plugin_new (panel_plugin);
- /* show the properties menu item in the right-click menu */
- xfce_panel_plugin_menu_show_configure (plugin);
+ /* set the action widgets and show configure */
+ xfce_panel_plugin_add_action_widget (panel_plugin, tasklist->handle);
+ xfce_panel_plugin_menu_show_configure (panel_plugin);
- /* connect panel signals */
- g_signal_connect_swapped (G_OBJECT (plugin), "orientation-changed",
- G_CALLBACK (tasklist_orientation_changed), tasklist);
- g_signal_connect_swapped (G_OBJECT (plugin), "size-changed",
- G_CALLBACK (tasklist_set_size), tasklist);
- g_signal_connect_swapped (G_OBJECT (plugin), "free-data",
- G_CALLBACK (tasklist_free_data), tasklist);
- g_signal_connect_swapped (G_OBJECT (plugin), "save",
- G_CALLBACK (tasklist_write_rc_file), tasklist);
- g_signal_connect_swapped (G_OBJECT (plugin), "configure-plugin",
- G_CALLBACK (tasklist_properties_dialog), tasklist);
-
- /* read user settings / defaults */
- tasklist_read_rc_file (tasklist);
-
/* whether to expand the plugin */
- xfce_panel_plugin_set_expand (plugin, tasklist->expand);
+ xfce_panel_plugin_set_expand (panel_plugin, tasklist->expand);
- /* create the main box */
- tasklist->box = xfce_hvbox_new (xfce_panel_plugin_get_orientation (plugin), FALSE, 0);
- gtk_widget_show (tasklist->box);
- gtk_container_add (GTK_CONTAINER (plugin), tasklist->box);
+ /* connect plugin signals */
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "orientation-changed",
+ G_CALLBACK (tasklist_plugin_orientation_changed), tasklist);
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-changed",
+ G_CALLBACK (tasklist_plugin_size_changed), tasklist);
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "size-request",
+ G_CALLBACK (tasklist_plugin_size_request), tasklist);
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "save",
+ G_CALLBACK (tasklist_plugin_write), tasklist);
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "free-data",
+ G_CALLBACK (tasklist_plugin_free), tasklist);
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "configure-plugin",
+ G_CALLBACK (tasklist_dialogs_configure), tasklist);
- /* create left handle */
- tasklist->handle = gtk_alignment_new (0, 0, 0, 0);
- gtk_widget_set_size_request (tasklist->handle, 8, 8);
- gtk_box_pack_start (GTK_BOX (tasklist->box), tasklist->handle, FALSE, FALSE, 0);
- xfce_panel_plugin_add_action_widget (plugin, tasklist->handle);
- g_signal_connect (tasklist->handle, "expose-event",
- G_CALLBACK (tasklist_handle_exposed), tasklist);
-
- /* create netk tasklist */
- screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
- screen_idx = gdk_screen_get_number (screen);
- tasklist->list = netk_tasklist_new (netk_screen_get (screen_idx));
- gtk_widget_show (tasklist->list);
- gtk_box_pack_start (GTK_BOX (tasklist->box), tasklist->list, TRUE, TRUE, 0);
-
- /* show the handles */
- if (tasklist->show_handles)
- gtk_widget_show (tasklist->handle);
-
- /* set netk tasklist settings */
- netk_tasklist_set_include_all_workspaces (NETK_TASKLIST (tasklist->list),
- tasklist->all_workspaces);
- netk_tasklist_set_grouping (NETK_TASKLIST (tasklist->list),
- tasklist->grouping);
- netk_tasklist_set_show_label (NETK_TASKLIST (tasklist->list),
- tasklist->show_label);
- netk_tasklist_set_button_relief (NETK_TASKLIST (tasklist->list),
- tasklist->flat_buttons ? GTK_RELIEF_NONE : GTK_RELIEF_NORMAL);
-
- /* connect screen changed signal */
+ /* screen changed signal */
tasklist->screen_changed_id =
- g_signal_connect_swapped (G_OBJECT (plugin), "screen-changed",
- G_CALLBACK (tasklist_screen_changed), tasklist);
+ g_signal_connect_swapped (G_OBJECT (panel_plugin), "screen-changed",
+ G_CALLBACK (tasklist_plugin_screen_changed), tasklist);
}
Modified: xfce4-panel/trunk/plugins/tasklist/tasklist.h
===================================================================
--- xfce4-panel/trunk/plugins/tasklist/tasklist.h 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/tasklist/tasklist.h 2007-10-20 10:33:12 UTC (rev 26151)
@@ -21,14 +21,16 @@
#define __TASKLIST_H__
#include <gtk/gtk.h>
+#include <libwnck/libwnck.h>
#include <libxfcegui4/libxfcegui4.h>
#include <libxfce4panel/xfce-panel-plugin.h>
-typedef struct _Tasklist Tasklist;
+typedef struct _TasklistPlugin TasklistPlugin;
-struct _Tasklist
+struct _TasklistPlugin
{
- XfcePanelPlugin *plugin;
+ /* the panel plugin */
+ XfcePanelPlugin *panel_plugin;
/* widgets */
GtkWidget *box;
@@ -38,9 +40,12 @@
/* signals */
gint screen_changed_id;
+ /* icon theme */
+ GtkIconTheme *icon_theme;
+
/* settings */
gint width;
- NetkTasklistGroupingType grouping;
+ WnckTasklistGroupingType grouping;
guint all_workspaces : 1;
guint show_label : 1;
guint expand : 1;
@@ -48,9 +53,8 @@
guint show_handles : 1;
};
-void tasklist_write_rc_file (Tasklist *tasklist) G_GNUC_INTERNAL;
-gboolean tasklist_set_size (Tasklist *tasklist,
- gint size) G_GNUC_INTERNAL;
-gboolean tasklist_using_xinerama (XfcePanelPlugin *plugin) G_GNUC_INTERNAL;
+void tasklist_plugin_write (TasklistPlugin *tasklist) G_GNUC_INTERNAL;
+gboolean tasklist_using_xinerama (XfcePanelPlugin *panel_plugin) G_GNUC_INTERNAL;
+
#endif /* !__TASKLIST_H__ */
Modified: xfce4-panel/trunk/plugins/windowlist/Makefile.am
===================================================================
--- xfce4-panel/trunk/plugins/windowlist/Makefile.am 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/windowlist/Makefile.am 2007-10-20 10:33:12 UTC (rev 26151)
@@ -4,6 +4,7 @@
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libwindowlist\" \
-DLOCALEDIR=\"$(localedir)\" \
+ -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(PLATFORM_CPPFLAGS)
bin_PROGRAMS = \
@@ -40,6 +41,7 @@
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \
+ $(LIBWNCK_CFLAGS) \
$(PLATFORM_CFLAGS)
libwindowlist_la_LDFLAGS = \
@@ -55,6 +57,7 @@
libwindowlist_la_LIBADD = \
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
+ $(LIBWNCK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBXFCEGUI4_LIBS)
Modified: xfce4-panel/trunk/plugins/windowlist/windowlist.c
===================================================================
--- xfce4-panel/trunk/plugins/windowlist/windowlist.c 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/windowlist/windowlist.c 2007-10-20 10:33:12 UTC (rev 26151)
@@ -4,12 +4,12 @@
*
* Copyright (c) 2003 Andre Lerche <a.lerche at gmx.net>
* Copyright (c) 2003 Benedikt Meurer <benedikt.meurer at unix-ag.uni-siegen.de>
- * Copyright (c) 2006 Jani Monoses <jani at ubuntu.com>
+ * Copyright (c) 2006 Jani Monoses <jani at ubuntu.com>
* Copyright (c) 2006 Jasper Huijsmans <jasper at xfce.org>
* Copyright (c) 2006 Nick Schermer <nick at xfce.org>
*
* This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as published
+ * it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@@ -40,9 +40,10 @@
#include <string.h>
#include <stdlib.h>
#include <gdk/gdkkeysyms.h>
-
+#include <gdk/gdkx.h>
#include <libxfce4panel/xfce-arrow-button.h>
-#include <libxfcegui4/netk-window-action-menu.h>
+#include <libwnck/libwnck.h>
+#include <libwnck/window-action-menu.h>
#include "windowlist.h"
#include "windowlist-dialog.h"
@@ -91,7 +92,7 @@
static gchar *
-menulist_workspace_name (NetkWorkspace *workspace,
+menulist_workspace_name (WnckWorkspace *workspace,
const gchar *num_title,
const gchar *name_title)
{
@@ -99,8 +100,8 @@
gchar *ws_title;
gint ws_num;
- ws_num = netk_workspace_get_number (workspace);
- ws_name = netk_workspace_get_name (workspace);
+ ws_num = wnck_workspace_get_number (workspace);
+ ws_name = wnck_workspace_get_name (workspace);
if (!ws_name || strtol((const char *)ws_name, NULL, 0) == ws_num + 1)
ws_title = g_strdup_printf (num_title, ws_num + 1);
@@ -121,7 +122,7 @@
{
DBG ("Destroy menu");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
FALSE);
if (menu)
gtk_widget_destroy (menu);
@@ -132,9 +133,9 @@
static gboolean
menulist_goto_workspace (GtkWidget *mi,
GdkEventButton *ev,
- NetkWorkspace *workspace)
+ WnckWorkspace *workspace)
{
- netk_workspace_activate (workspace);
+ wnck_workspace_activate (workspace, ev->time);
return FALSE;
}
@@ -180,14 +181,14 @@
static void
popup_action_menu (GtkWidget *widget,
- NetkWindow *window)
+ WnckWindow *window)
{
static GtkWidget *menu = NULL;
if (menu)
gtk_widget_destroy (menu);
- menu = netk_create_window_action_menu (window);
+ menu = wnck_create_window_action_menu (window);
g_signal_connect (menu, "deactivate",
G_CALLBACK (action_menu_deactivated), widget->parent);
@@ -201,22 +202,22 @@
static gboolean
menulist_goto_window (GtkWidget *mi,
GdkEventButton *ev,
- NetkWindow *window)
+ WnckWindow *window)
{
if (ev->button == 1) /* Goto workspace and show window */
{
gtk_menu_popdown (GTK_MENU (mi->parent));
- if (!netk_window_is_sticky (window))
+ if (!wnck_window_is_sticky (window))
{
- netk_workspace_activate(netk_window_get_workspace(window));
+ wnck_workspace_activate(wnck_window_get_workspace(window), ev->time);
}
- netk_window_activate (window);
+ wnck_window_activate (window, ev->time);
g_signal_emit_by_name (mi->parent, "deactivate", 0);
}
else if (ev->button == 2) /* Show window on current workspace */
{
gtk_menu_popdown (GTK_MENU (mi->parent));
- netk_window_activate (window);
+ wnck_window_activate (window, ev->time);
g_signal_emit_by_name (mi->parent, "deactivate", 0);
}
else if (ev->button == 3) /* Show the popup menu */
@@ -237,9 +238,9 @@
GdkEventButton *ev,
Windowlist *wl)
{
- gint num = netk_screen_get_workspace_count (wl->screen) + 1;
+ gint num = wnck_screen_get_workspace_count (wl->screen) + 1;
- netk_screen_change_workspace_count (netk_screen_get_default (), num);
+ wnck_screen_change_workspace_count (wnck_screen_get_default (), num);
return FALSE;
}
@@ -251,12 +252,12 @@
GdkEventButton *ev,
Windowlist *wl)
{
- NetkWorkspace *workspace;
+ WnckWorkspace *workspace;
gint ws_num;
char *text;
- ws_num = netk_screen_get_workspace_count (wl->screen) - 1;
- workspace = netk_screen_get_workspace (wl->screen, ws_num);
+ ws_num = wnck_screen_get_workspace_count (wl->screen) - 1;
+ workspace = wnck_screen_get_workspace (wl->screen, ws_num);
text = menulist_workspace_name (workspace,
_("Are you sure you want to remove workspace %d?"),
@@ -264,7 +265,7 @@
if (xfce_confirm (text, GTK_STOCK_REMOVE, NULL))
{
- netk_screen_change_workspace_count (netk_screen_get_default (),
+ wnck_screen_change_workspace_count (wnck_screen_get_default (),
ws_num);
}
@@ -276,15 +277,15 @@
static gboolean
-menulist_keypress (GtkWidget *menu,
+menulist_keypress (GtkWidget *menu,
GdkEventKey *ev,
Windowlist *wl)
{
GdkEventButton evb;
GList *l;
GtkWidget *mi = NULL;
- NetkWindow *window;
- NetkWorkspace *workspace;
+ WnckWindow *window;
+ WnckWorkspace *workspace;
gpointer ws_action;
guint state;
@@ -325,23 +326,23 @@
evb.button = 3;
}
- if((window = g_object_get_data (G_OBJECT (mi), "netk-window")) != NULL)
+ if((window = g_object_get_data (G_OBJECT (mi), "wnck-window")) != NULL)
{
- if (!NETK_IS_WINDOW (window))
+ if (!WNCK_IS_WINDOW (window))
return FALSE;
return menulist_goto_window (mi, &evb, window);
}
- else if (evb.button == 1 &&
- (workspace = g_object_get_data (G_OBJECT (mi), "netk-workspace"))
+ else if (evb.button == 1 &&
+ (workspace = g_object_get_data (G_OBJECT (mi), "wnck-workspace"))
!= NULL)
{
- if (!NETK_IS_WORKSPACE (workspace))
+ if (!WNCK_IS_WORKSPACE (workspace))
return FALSE;
return menulist_goto_workspace (mi, NULL, workspace);
}
- else if (evb.button == 1 &&
+ else if (evb.button == 1 &&
(ws_action = g_object_get_data (G_OBJECT (mi), "ws-action"))
!= NULL)
{
@@ -349,7 +350,7 @@
{
return menulist_remove_screen (mi, NULL, wl);
}
- else
+ else
{
return menulist_add_screen (mi, NULL, wl);
}
@@ -364,7 +365,7 @@
* Window List Menu functions
**/
static GtkWidget *
-menulist_menu_item (NetkWindow *window,
+menulist_menu_item (WnckWindow *window,
Windowlist *wl,
gint size)
{
@@ -374,10 +375,10 @@
GdkPixbuf *icon = NULL;
GdkPixbuf *tmp = NULL;
- window_name = menulist_utf8_string (netk_window_get_name (window));
+ window_name = menulist_utf8_string (wnck_window_get_name (window));
label = g_string_new (window_name);
- if (netk_window_is_minimized (window))
+ if (wnck_window_is_minimized (window))
{
g_string_prepend (label, "[");
g_string_append (label, "]");
@@ -387,7 +388,7 @@
g_string_append (label, " ");
if (wl->show_window_icons)
- icon = netk_window_get_icon (window);
+ icon = wnck_window_get_icon (window);
if (icon)
{
@@ -399,7 +400,7 @@
if (G_LIKELY (w > size || h > size))
{
- tmp = gdk_pixbuf_scale_simple (icon, size, size,
+ tmp = gdk_pixbuf_scale_simple (icon, size, size,
GDK_INTERP_BILINEAR);
icon = tmp;
}
@@ -417,7 +418,7 @@
mi = gtk_menu_item_new_with_label (label->str);
}
- gtk_label_set_ellipsize (GTK_LABEL (GTK_BIN (mi)->child),
+ gtk_label_set_ellipsize (GTK_LABEL (GTK_BIN (mi)->child),
PANGO_ELLIPSIZE_END);
gtk_label_set_max_width_chars (GTK_LABEL (GTK_BIN (mi)->child), 24);
@@ -437,10 +438,10 @@
gboolean at_pointer)
{
GtkWidget *menu, *mi, *icon;
- NetkWindow *window;
- NetkWorkspace *netk_workspace;
- NetkWorkspace *active_workspace;
- NetkWorkspace *window_workspace;
+ WnckWindow *window;
+ WnckWorkspace *wnck_workspace;
+ WnckWorkspace *active_workspace;
+ WnckWorkspace *window_workspace;
gchar *ws_label, *rm_label;
gint size, i, wscount;
GList *windows, *li;
@@ -454,11 +455,11 @@
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &size, NULL);
- windows = netk_screen_get_windows_stacked (wl->screen);
- active_workspace = netk_screen_get_active_workspace (wl->screen);
+ windows = wnck_screen_get_windows_stacked (wl->screen);
+ active_workspace = wnck_screen_get_active_workspace (wl->screen);
if (wl->show_all_workspaces)
- wscount = netk_screen_get_workspace_count (wl->screen);
+ wscount = wnck_screen_get_workspace_count (wl->screen);
else
wscount = 1;
@@ -467,29 +468,29 @@
{
/* Load workspace */
if (wl->show_all_workspaces)
- netk_workspace = netk_screen_get_workspace (wl->screen, i);
+ wnck_workspace = wnck_screen_get_workspace (wl->screen, i);
else
- netk_workspace = netk_screen_get_active_workspace (wl->screen);
+ wnck_workspace = wnck_screen_get_active_workspace (wl->screen);
/* Create workspace menu item */
- ws_label =
- menulist_workspace_name (netk_workspace, _("Workspace %d"), "%s");
+ ws_label =
+ menulist_workspace_name (wnck_workspace, _("Workspace %d"), "%s");
mi = gtk_menu_item_new_with_label (ws_label);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
g_free (ws_label);
- g_object_set_data (G_OBJECT (mi), "netk-workspace", netk_workspace);
+ g_object_set_data (G_OBJECT (mi), "wnck-workspace", wnck_workspace);
g_signal_connect (mi, "button-release-event",
- G_CALLBACK (menulist_goto_workspace),
- netk_workspace);
+ G_CALLBACK (menulist_goto_workspace),
+ wnck_workspace);
/* Apply layout */
- if (netk_workspace == active_workspace)
+ if (wnck_workspace == active_workspace)
gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (mi)), bold);
else
- gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (mi)), italic);
+ gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (mi)), italic);
mi = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
@@ -499,17 +500,17 @@
{
/* If window is not on current workspace; continue */
window = li->data;
- window_workspace = netk_window_get_workspace (window);
+ window_workspace = wnck_window_get_workspace (window);
- if (netk_workspace != window_workspace &&
- !(netk_window_is_sticky (window) &&
- netk_workspace == active_workspace))
+ if (wnck_workspace != window_workspace &&
+ !(wnck_window_is_sticky (window) &&
+ wnck_workspace == active_workspace))
{
continue;
}
- if (netk_window_is_skip_pager (window) ||
- netk_window_is_skip_tasklist (window))
+ if (wnck_window_is_skip_pager (window) ||
+ wnck_window_is_skip_tasklist (window))
{
continue;
}
@@ -522,17 +523,17 @@
gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
- if (netk_window_is_active (window))
+ if (wnck_window_is_active (window))
{
- gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (mi)),
+ gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (mi)),
italic);
}
- /* Apply some styles for windows on !current workspace and
+ /* Apply some styles for windows on !current workspace and
* if they are urgent */
- if (netk_window_or_transient_demands_attention (window))
+ if (wnck_window_or_transient_needs_attention (window))
{
- if (netk_workspace == active_workspace)
+ if (wnck_workspace == active_workspace)
{
gtk_widget_modify_font (gtk_bin_get_child (GTK_BIN (mi)),
bold);
@@ -546,15 +547,15 @@
bold);
}
}
- else if (netk_workspace != active_workspace &&
- !netk_window_is_sticky (window))
+ else if (wnck_workspace != active_workspace &&
+ !wnck_window_is_sticky (window))
{
gtk_widget_modify_fg (gtk_bin_get_child (GTK_BIN (mi)),
GTK_STATE_NORMAL,
&(menu->style->fg[GTK_STATE_INSENSITIVE]));
}
- g_object_set_data (G_OBJECT (mi), "netk-window", window);
+ g_object_set_data (G_OBJECT (mi), "wnck-window", window);
/* Connect some signals */
g_signal_connect (mi, "button-release-event",
@@ -606,20 +607,20 @@
G_CALLBACK (menulist_add_screen), wl);
/* Remove workspace */
- wscount = netk_screen_get_workspace_count (wl->screen);
+ wscount = wnck_screen_get_workspace_count (wl->screen);
if (wscount > 1)
{
- netk_workspace = netk_screen_get_workspace (wl->screen, wscount-1);
+ wnck_workspace = wnck_screen_get_workspace (wl->screen, wscount-1);
- rm_label = menulist_workspace_name (netk_workspace,
+ rm_label = menulist_workspace_name (wnck_workspace,
_("Remove Workspace %d"),
_("Remove Workspace '%s'"));
if (wl->show_window_icons)
{
mi = gtk_image_menu_item_new_with_label (rm_label);
- icon = gtk_image_new_from_stock (GTK_STOCK_REMOVE,
+ icon = gtk_image_new_from_stock (GTK_STOCK_REMOVE,
GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), icon);
}
@@ -642,7 +643,7 @@
/* key presses work on the menu, not the items */
g_signal_connect (menu, "key-press-event",
- G_CALLBACK (menulist_keypress),
+ G_CALLBACK (menulist_keypress),
wl);
/* Activate toggle button */
@@ -658,7 +659,7 @@
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
at_pointer ? NULL : xfce_panel_plugin_position_menu,
at_pointer ? NULL : wl->plugin,
- ev ? ev->button : 0,
+ ev ? ev->button : 0,
ev ? ev->time : gtk_get_current_event_time());
return TRUE;
@@ -668,7 +669,7 @@
static gboolean
menulist_toggle_menu (GtkToggleButton *button,
- GdkEventButton *ev,
+ GdkEventButton *ev,
Windowlist *wl)
{
if (ev->button != 1)
@@ -685,39 +686,39 @@
windowlist_search_urgent (gpointer data)
{
Windowlist *wl = (Windowlist *) data;
- NetkWindow *window;
- NetkWorkspace *active_workspace;
- NetkWorkspace *window_workspace;
+ WnckWindow *window;
+ WnckWorkspace *active_workspace;
+ WnckWorkspace *window_workspace;
gboolean blink = FALSE;
GList *windows, *li;
- windows = netk_screen_get_windows_stacked (wl->screen);
- active_workspace = netk_screen_get_active_workspace (wl->screen);
+ windows = wnck_screen_get_windows_stacked (wl->screen);
+ active_workspace = wnck_screen_get_active_workspace (wl->screen);
/* For Each Window (stop when we've found an urgent window) */
for (li = windows; li && !blink; li = li->next)
{
window = li->data;
- window_workspace = netk_window_get_workspace (window);
+ window_workspace = wnck_window_get_workspace (window);
/* Don't check for urgent windows on current workspace
if enabled in properties */
- if (window_workspace == active_workspace &&
+ if (window_workspace == active_workspace &&
wl->notify == OTHER_WORKSPACES)
{
continue;
}
- /* Skip windows that are not in the tasklist */
- if (netk_window_is_sticky (window) ||
- netk_window_is_skip_pager (window) ||
- netk_window_is_skip_tasklist (window))
+ /* Skip windows that are not in the tasklist */
+ if (wnck_window_is_sticky (window) ||
+ wnck_window_is_skip_pager (window) ||
+ wnck_window_is_skip_tasklist (window))
{
continue;
}
/* Check if window is urgent */
- if (netk_window_or_transient_demands_attention (window))
+ if (wnck_window_or_transient_needs_attention (window))
blink = TRUE;
}
@@ -725,7 +726,7 @@
if (G_UNLIKELY (blink && !wl->blink_timeout_id))
{
- wl->blink_timeout_id =
+ wl->blink_timeout_id =
g_timeout_add (FLASH_TIMEOUT, windowlist_blink, wl);
DBG ("New blink source started: %d", wl->blink_timeout_id);
@@ -856,7 +857,7 @@
if (GTK_WIDGET_STATE (button) == 0)
wl->block_blink = FALSE;
- else
+ else
{
wl->block_blink = TRUE;
windowlist_blink (wl);
@@ -869,21 +870,26 @@
*
**/
static void
-windowlist_active_window_changed (GtkWidget *w,
+windowlist_active_window_changed (WnckScreen *screen,
+ WnckWindow *previous_window,
Windowlist *wl)
{
- NetkWindow *win;
+ WnckWindow *window;
GdkPixbuf *pb;
- if ((win = netk_screen_get_active_window (wl->screen)) != NULL)
+ g_return_if_fail (screen == wl->screen);
+
+ window = wnck_screen_get_active_window (screen);
+
+ if (window != NULL)
{
- pb = netk_window_get_icon (win);
+ pb = wnck_window_get_icon (window);
if (pb)
{
- xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE (wl->icon),
- pb);
+ xfce_scaled_image_set_from_pixbuf (XFCE_SCALED_IMAGE (wl->icon), pb);
+
gtk_tooltips_set_tip (wl->tooltips, wl->button,
- netk_window_get_name (win), NULL);
+ wnck_window_get_name (window), NULL);
}
}
}
@@ -894,8 +900,8 @@
* Handle user messages
**/
static gboolean
-wl_message_received (GtkWidget *w,
- GdkEventClient *ev,
+wl_message_received (GtkWidget *w,
+ GdkEventClient *ev,
gpointer user_data)
{
Windowlist *wl = user_data;
@@ -928,7 +934,7 @@
xwin = GDK_WINDOW_XID (GTK_WIDGET (win)->window);
gscreen = gtk_widget_get_screen (win);
- g_snprintf (selection_name, sizeof (selection_name),
+ g_snprintf (selection_name, sizeof (selection_name),
XFCE_WINDOW_LIST_SELECTION"%d", gdk_screen_get_number (gscreen));
selection_atom = XInternAtom (GDK_DISPLAY (), selection_name, False);
@@ -984,7 +990,7 @@
g_signal_connect (wl->screen, "active-window-changed",
G_CALLBACK (windowlist_active_window_changed), wl);
- windowlist_active_window_changed (wl->button, wl);
+ windowlist_active_window_changed (wl->screen, NULL, wl);
break;
@@ -1047,18 +1053,18 @@
switch (xfce_rc_read_int_entry (rc, "button_layout", DEF_BUTTON_LAYOUT))
{
- case 0:
+ case 0:
wl->layout = ICON_BUTTON;
break;
- default:
+ default:
wl->layout = ARROW_BUTTON;
break;
}
switch (xfce_rc_read_int_entry (rc, "urgency_notify", DEF_NOTIFY))
{
- case 0:
+ case 0:
wl->notify = DISABLED;
break;
@@ -1066,19 +1072,19 @@
wl->notify = OTHER_WORKSPACES;
break;
- default:
+ default:
wl->notify = ALL_WORKSPACES;
break;
}
- wl->show_all_workspaces =
- xfce_rc_read_bool_entry (rc, "show_all_workspaces",
+ wl->show_all_workspaces =
+ xfce_rc_read_bool_entry (rc, "show_all_workspaces",
DEF_SHOW_ALL_WORKSPACES);
- wl->show_window_icons =
- xfce_rc_read_bool_entry (rc, "show_window_icons",
+ wl->show_window_icons =
+ xfce_rc_read_bool_entry (rc, "show_window_icons",
DEF_SHOW_WINDOW_ICONS);
- wl->show_workspace_actions =
- xfce_rc_read_bool_entry (rc, "show_workspace_actions",
+ wl->show_workspace_actions =
+ xfce_rc_read_bool_entry (rc, "show_workspace_actions",
DEF_SHOW_WORKSPACE_ACTIONS);
xfce_rc_close (rc);
@@ -1130,11 +1136,11 @@
break;
}
- xfce_rc_write_bool_entry (rc, "show_all_workspaces",
+ xfce_rc_write_bool_entry (rc, "show_all_workspaces",
wl->show_all_workspaces);
- xfce_rc_write_bool_entry (rc, "show_window_icons",
+ xfce_rc_write_bool_entry (rc, "show_window_icons",
wl->show_window_icons);
- xfce_rc_write_bool_entry (rc, "show_workspace_actions",
+ xfce_rc_write_bool_entry (rc, "show_workspace_actions",
wl->show_workspace_actions);
xfce_rc_close (rc);
@@ -1179,7 +1185,7 @@
screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
screen_idx = gdk_screen_get_number (screen);
- wl->screen = netk_screen_get (screen_idx);
+ wl->screen = wnck_screen_get (screen_idx);
/* Read user settings */
windowlist_read (wl);
@@ -1272,14 +1278,14 @@
static void
-windowlist_screen_position_changed (XfcePanelPlugin *plugin,
- XfceScreenPosition position,
+windowlist_screen_position_changed (XfcePanelPlugin *plugin,
+ XfceScreenPosition position,
Windowlist *wl)
{
DBG ("...");
wl->arrowtype = xfce_panel_plugin_arrow_type (plugin);
-
+
if (wl->layout == ARROW_BUTTON)
xfce_arrow_button_set_arrow_type (XFCE_ARROW_BUTTON (wl->button),
wl->arrowtype);
@@ -1301,10 +1307,10 @@
g_signal_connect (plugin, "save",
G_CALLBACK (windowlist_write), wl);
- g_signal_connect (plugin, "size-changed",
+ g_signal_connect (plugin, "size-changed",
G_CALLBACK (windowlist_set_size), wl);
- g_signal_connect (plugin, "screen-position-changed",
+ g_signal_connect (plugin, "screen-position-changed",
G_CALLBACK (windowlist_screen_position_changed), wl);
xfce_panel_plugin_menu_show_configure (plugin);
Modified: xfce4-panel/trunk/plugins/windowlist/windowlist.h
===================================================================
--- xfce4-panel/trunk/plugins/windowlist/windowlist.h 2007-10-20 10:32:12 UTC (rev 26150)
+++ xfce4-panel/trunk/plugins/windowlist/windowlist.h 2007-10-20 10:33:12 UTC (rev 26151)
@@ -28,6 +28,7 @@
#ifndef _WINDOWLIST_H
#define _WINDOWLIST_H
+#include <libwnck/libwnck.h>
#include <libxfcegui4/libxfcegui4.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <gtk/gtk.h>
@@ -57,7 +58,7 @@
GtkArrowType arrowtype;
GtkTooltips *tooltips;
- NetkScreen *screen;
+ WnckScreen *screen;
guint screen_callback_id;
/* Settings */
More information about the Xfce4-commits
mailing list