Browse Source
* Improved windowlist plugin from Nick Schermer. This adds some strings to translate. * Add mcs plugin that runs 'xfce4panel -c' for convenience. (Old svn revision: 21173)upstream/xfce4-panel-4.10.1

58 changed files with 5478 additions and 1092 deletions
@ -0,0 +1,42 @@ |
|||
plugindir = $(libdir)/xfce4/mcs-plugins |
|||
|
|||
plugin_LTLIBRARIES = libxfce4settings.la |
|||
|
|||
libxfce4settings_la_LDFLAGS = \
|
|||
-avoid-version \
|
|||
-module |
|||
|
|||
if HAVE_CYGWIN |
|||
libxfce4settings_la_LDFLAGS += \
|
|||
-no-undefined \
|
|||
-export-symbols $(datadir)/xfce4/devel/mcs-manager.def |
|||
endif |
|||
|
|||
libxfce4settings_la_SOURCES = \
|
|||
plugin.c |
|||
|
|||
libxfce4settings_la_CFLAGS = \
|
|||
-I$(top_srcdir) \
|
|||
-DLOCALEDIR=\"$(localedir)\" \
|
|||
@LIBXFCEGUI4_CFLAGS@ \
|
|||
@XFCE_MCS_MANAGER_CFLAGS@ |
|||
|
|||
libxfce4settings_la_LIBADD = \
|
|||
@XFCE_MCS_MANAGER_LIBS@ |
|||
|
|||
# .desktop file
|
|||
#
|
|||
desktop_in_files = xfce4-panel-manager.desktop.in |
|||
desktop_files = $(desktop_in_files:.desktop.in=.desktop) |
|||
|
|||
appsdir = $(datadir)/applications |
|||
apps_DATA = xfce4-panel-manager.desktop |
|||
|
|||
@INTLTOOL_DESKTOP_RULE@ |
|||
|
|||
EXTRA_DIST = \
|
|||
$(desktop_in_files) |
|||
|
|||
DISTCLEANFILES = \
|
|||
$(desktop_DATA) $(desktop_files) |
|||
|
@ -0,0 +1,59 @@ |
|||
/* vim: set expandtab ts=8 sw=4: */ |
|||
|
|||
/* $Id$
|
|||
* |
|||
* Copyright © 2006 Jasper Huijsmans <jasper@xfce.org> |
|||
* |
|||
* This program is free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU 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 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 <glib.h> |
|||
#include <xfce-mcs-manager/manager-plugin.h> |
|||
#include <libxfcegui4/libxfcegui4.h> |
|||
#include <libxfce4mcs/mcs-common.h> |
|||
#include <libxfce4mcs/mcs-manager.h> |
|||
|
|||
static void run_dialog (McsPlugin * mcs_plugin); |
|||
|
|||
/* plugin init */ |
|||
McsPluginInitResult |
|||
mcs_plugin_init (McsPlugin * mcs_plugin) |
|||
{ |
|||
/*
|
|||
This is required for UTF-8 at least - Please don't remove it |
|||
And it needs to be done here for the label to be properly |
|||
localized.... |
|||
*/ |
|||
xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); |
|||
|
|||
mcs_plugin->plugin_name = g_strdup ("xfce4panel"); |
|||
mcs_plugin->caption = g_strdup (_("Panel")); |
|||
mcs_plugin->run_dialog = run_dialog; |
|||
mcs_plugin->icon = xfce_themed_icon_load ("xfce4-panel", 48); |
|||
|
|||
return (MCS_PLUGIN_INIT_OK); |
|||
} |
|||
|
|||
/* settings dialog */ |
|||
static void |
|||
run_dialog (McsPlugin * mcs_plugin) |
|||
{ |
|||
g_spawn_command_line_async("xfce4-panel -c", NULL); |
|||
} |
|||
|
@ -0,0 +1,12 @@ |
|||
[Desktop Entry] |
|||
Type=Application |
|||
Encoding=UTF-8 |
|||
_Name=Xfce 4 Panel Manager |
|||
_GenericName=Panel Manager |
|||
_Comment=Customize Panel |
|||
Exec=xfce4-panel -c |
|||
Icon=xfce4-panel |
|||
Terminal=false |
|||
Categories=X-XFCE;Settings;DesktopSettings; |
|||
OnlyShowIn=XFCE; |
|||
|
@ -0,0 +1,255 @@ |
|||
/* vim: set expandtab ts=8 sw=4: */ |
|||
|
|||
/* $Id$
|
|||
* |
|||
* Copyright (c) 2003 Andre Lerche <a.lerche@gmx.net> |
|||
* Copyright (c) 2003 Benedikt Meurer <benedikt.meurer@unix-ag.uni-siegen.de> |
|||
* Copyright (c) 2006 Jani Monoses <jani@ubuntu.com> |
|||
* Copyright (c) 2006 Jasper Huijsmans <jasper@xfce.org> |
|||
* Copyright (c) 2006 Nick Schermer <nick@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 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 "windowlist.h" |
|||
#include "windowlist-dialog.h" |
|||
|
|||
typedef struct |
|||
{ |
|||
Windowlist *wl; |
|||
|
|||
GtkWidget *button_layout; |
|||
|
|||
GtkWidget *show_all_workspaces; |
|||
GtkWidget *show_window_icons; |
|||
GtkWidget *show_workspace_actions; |
|||
|
|||
GtkWidget *notify_disabled; |
|||
GtkWidget *notify_other; |
|||
GtkWidget *notify_all; |
|||
} |
|||
WindowlistDialog; |
|||
|
|||
static void |
|||
windowlist_notify_toggled (GtkWidget *button, |
|||
WindowlistDialog *wd) |
|||
{ |
|||
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) |
|||
return; |
|||
|
|||
if (button == wd->notify_disabled) |
|||
wd->wl->notify = DISABLED; |
|||
|
|||
else if (button == wd->notify_other) |
|||
wd->wl->notify = OTHER_WORKSPACES; |
|||
|
|||
else if (button == wd->notify_all) |
|||
wd->wl->notify = ALL_WORKSPACES; |
|||
|
|||
windowlist_start_blink (wd->wl); |
|||
} |
|||
|
|||
static void |
|||
windowlist_button_toggled (GtkWidget *button, |
|||
WindowlistDialog *wd) |
|||
{ |
|||
if (button == wd->button_layout) |
|||
{ |
|||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) |
|||
wd->wl->layout = ARROW_BUTTON; |
|||
else |
|||
wd->wl->layout = ICON_BUTTON; |
|||
|
|||
windowlist_create_button (wd->wl); |
|||
} |
|||
else if (button == wd->show_all_workspaces) |
|||
wd->wl->show_all_workspaces = |
|||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)); |
|||
|
|||
else if (button == wd->show_window_icons) |
|||
wd->wl->show_window_icons = |
|||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)); |
|||
|
|||
else if (button == wd->show_workspace_actions) |
|||
wd->wl->show_workspace_actions = |
|||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)); |
|||
} |
|||
|
|||
static void |
|||
windowlist_properties_response (GtkWidget *dialog, |
|||
int response, |
|||
WindowlistDialog *wd) |
|||
{ |
|||
gtk_widget_destroy (dialog); |
|||
|
|||
xfce_panel_plugin_unblock_menu (wd->wl->plugin); |
|||
|
|||
g_free (wd); |
|||
} |
|||
|
|||
void |
|||
windowlist_properties (XfcePanelPlugin *plugin, |
|||
Windowlist * wl) |
|||
{ |
|||
WindowlistDialog *wd; |
|||
|
|||
GtkWidget *dialog, *header, *vbox, *vbox2, *frame, *hbox, |
|||
*alignment, *label, *button, *image; |
|||
|
|||
wd = g_new0 (WindowlistDialog, 1); |
|||
|
|||
wd->wl = wl; |
|||
|
|||
xfce_panel_plugin_block_menu (wd->wl->plugin); |
|||
|
|||
dialog = gtk_dialog_new_with_buttons (_("Properties"), |
|||
GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), |
|||
GTK_DIALOG_DESTROY_WITH_PARENT | |
|||
GTK_DIALOG_NO_SEPARATOR, |
|||
GTK_STOCK_CLOSE, GTK_RESPONSE_OK, |
|||
NULL); |
|||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER); |
|||
gtk_container_set_border_width (GTK_CONTAINER (dialog), 2); |
|||
gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES); |
|||
|
|||
header = xfce_create_header (NULL, _("Window List")); |
|||
gtk_widget_set_size_request (GTK_BIN (header)->child, -1, 32); |
|||
gtk_container_set_border_width (GTK_CONTAINER (header), BORDER - 2); |
|||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), header, |
|||
FALSE, TRUE, 0); |
|||
|
|||
vbox = gtk_vbox_new (FALSE, BORDER); |
|||
gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER - 2); |
|||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, |
|||
TRUE, TRUE, 0); |
|||
|
|||
/* Urgency help */ |
|||
hbox = gtk_hbox_new (FALSE, 6); |
|||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); |
|||
|
|||
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, |
|||
GTK_ICON_SIZE_DND); |
|||
gtk_misc_set_alignment (GTK_MISC (image), 0, 0); |
|||
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); |
|||
|
|||
label = gtk_label_new (NULL); |
|||
gtk_label_set_markup (GTK_LABEL (label), |
|||
_("<i>Urgency notification</i> will blink the button when " |
|||
"an application needs attention.")); |
|||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
|||
gtk_widget_set_size_request (label, 230, -1); |
|||
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); |
|||
|
|||
/* Button Urgency Notification */ |
|||
frame = xfce_create_framebox (_("Urgency Notification"), &alignment); |
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); |
|||
|
|||
vbox2 = gtk_vbox_new (FALSE, 6); |
|||
gtk_container_add (GTK_CONTAINER (alignment), vbox2); |
|||
|
|||
button = wd->notify_disabled = |
|||
gtk_radio_button_new_with_mnemonic (NULL, _("_Disabled")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
(wd->wl->notify == DISABLED)); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_notify_toggled), wd); |
|||
|
|||
button = wd->notify_other = |
|||
gtk_radio_button_new_with_mnemonic_from_widget ( |
|||
GTK_RADIO_BUTTON (button), _("For _other workspaces")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
(wd->wl->notify == OTHER_WORKSPACES)); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_notify_toggled), wd); |
|||
|
|||
button = wd->notify_all = |
|||
gtk_radio_button_new_with_mnemonic_from_widget ( |
|||
GTK_RADIO_BUTTON (button), _("For _all workspaces")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
(wd->wl->notify == ALL_WORKSPACES)); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_notify_toggled), wd); |
|||
|
|||
/* Button Layout */ |
|||
frame = xfce_create_framebox (_("Appearance"), &alignment); |
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); |
|||
|
|||
vbox2 = gtk_vbox_new (FALSE, 6); |
|||
gtk_container_add (GTK_CONTAINER (alignment), vbox2); |
|||
|
|||
button = gtk_radio_button_new_with_mnemonic (NULL, _("_Icon button")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
(wd->wl->layout == ICON_BUTTON)); |
|||
|
|||
button = wd->button_layout = |
|||
gtk_radio_button_new_with_mnemonic_from_widget ( |
|||
GTK_RADIO_BUTTON (button), _("A_rrow button")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
|
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
(wd->wl->layout == ARROW_BUTTON)); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_button_toggled), wd); |
|||
|
|||
/* Windowlist Settings */ |
|||
frame = xfce_create_framebox (_("Window List"), &alignment); |
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); |
|||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); |
|||
|
|||
vbox2 = gtk_vbox_new (FALSE, 4); |
|||
gtk_container_add (GTK_CONTAINER (alignment), vbox2); |
|||
|
|||
button = wd->show_all_workspaces = |
|||
gtk_check_button_new_with_mnemonic ( |
|||
_("Show _windows from all workspaces")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
|
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
wd->wl->show_all_workspaces); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_button_toggled), wd); |
|||
|
|||
button = wd->show_window_icons = |
|||
gtk_check_button_new_with_mnemonic (_("Show a_pplication icons")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
|
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
wd->wl->show_window_icons); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_button_toggled), wd); |
|||
|
|||
button = wd->show_workspace_actions = |
|||
gtk_check_button_new_with_mnemonic (_("Show wor_kspace actions")); |
|||
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); |
|||
|
|||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), |
|||
wd->wl->show_workspace_actions); |
|||
g_signal_connect (button, "toggled", |
|||
G_CALLBACK (windowlist_button_toggled), wd); |
|||
|
|||
/* Show Dialog */ |
|||
g_signal_connect (dialog, "response", |
|||
G_CALLBACK (windowlist_properties_response), wd); |
|||
|
|||
gtk_widget_show_all (dialog); |
|||
} |
@ -0,0 +1,33 @@ |
|||
/* vim: set expandtab ts=8 sw=4: */ |
|||
|
|||
/* $Id$
|
|||
* |
|||
* Copyright (c) 2003 Andre Lerche <a.lerche@gmx.net> |
|||
* Copyright (c) 2003 Benedikt Meurer <benedikt.meurer@unix-ag.uni-siegen.de> |
|||
* Copyright (c) 2006 Jani Monoses <jani@ubuntu.com> |
|||
* Copyright (c) 2006 Jasper Huijsmans <jasper@xfce.org> |
|||
* Copyright (c) 2006 Nick Schermer <nick@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 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 _WINDOWLIST_DIALOG_H |
|||
#define _WINDOWLIST_DIALOG_H |
|||
|
|||
void |
|||
windowlist_properties (XfcePanelPlugin *plugin, |
|||
Windowlist * wl); |
|||
|
|||
#endif /* _WINDOWLIST_DIALOG_H */ |
File diff suppressed because it is too large
@ -0,0 +1,86 @@ |
|||
/* vim: set expandtab ts=8 sw=4: */ |
|||
|
|||
/* $Id$
|
|||
* |
|||
* Copyright (c) 2003 Andre Lerche <a.lerche@gmx.net> |
|||
* Copyright (c) 2003 Benedikt Meurer <benedikt.meurer@unix-ag.uni-siegen.de> |
|||
* Copyright (c) 2006 Jani Monoses <jani@ubuntu.com> |
|||
* Copyright (c) 2006 Jasper Huijsmans <jasper@xfce.org> |
|||
* Copyright (c) 2006 Nick Schermer <nick@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 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. |
|||
*/ |
|||
|
|||
#define BORDER 8 |
|||
|
|||
#ifndef _WINDOWLIST_H |
|||
#define _WINDOWLIST_H |
|||
|
|||
#include <libxfcegui4/libxfcegui4.h> |
|||
#include <libxfce4panel/xfce-panel-plugin.h> |
|||
#include <gtk/gtk.h> |
|||
|
|||
typedef enum |
|||
{ |
|||
ICON_BUTTON, |
|||
ARROW_BUTTON, |
|||
} |
|||
ButtonLayout; |
|||
|
|||
typedef enum |
|||
{ |
|||
DISABLED, |
|||
OTHER_WORKSPACES, |
|||
ALL_WORKSPACES, |
|||
} |
|||
UrgencyNotify; |
|||
|
|||
typedef struct |
|||
{ |
|||
XfcePanelPlugin *plugin; |
|||
|
|||
/* Widget stuff */ |
|||
GtkWidget *button; |
|||
GtkWidget *icon; |
|||
GtkArrowType arrowtype; |
|||
GtkTooltips *tooltips; |
|||
|
|||
NetkScreen *screen; |
|||
guint screen_callback_id; |
|||
|
|||
/* Settings */ |
|||
ButtonLayout layout; |
|||
|
|||
gboolean show_all_workspaces; |
|||
gboolean show_window_icons; |
|||
gboolean show_workspace_actions; |
|||
|
|||
UrgencyNotify notify; |
|||
|
|||
/* Blink button stuff */ |
|||
guint search_timeout_id; |
|||
guint blink_timeout_id; |
|||
gboolean blink; |
|||
gboolean block_blink; |
|||
} |
|||
Windowlist; |
|||
|
|||
void |
|||
windowlist_start_blink (Windowlist * wl); |
|||
|
|||
void |
|||
windowlist_create_button (Windowlist * wl); |
|||
|
|||
#endif /* _WINDOWLIST_H */ |