Browse Source

Import new tasklist, not fully working yet.

upstream/xfce4-panel-4.10.1
Nick Schermer 13 years ago
parent
commit
233c51a972
  1. 5
      plugins/launcher/launcher-dialog.c
  2. 6
      plugins/launcher/launcher.c
  3. 85
      plugins/tasklist/Makefile.am
  4. 210
      plugins/tasklist/plugin.c
  5. 47
      plugins/tasklist/tasklist-dialog.glade
  6. 232
      plugins/tasklist/tasklist-dialogs.c
  7. 25
      plugins/tasklist/tasklist-dialogs.h
  8. 1412
      plugins/tasklist/tasklist.c
  9. 2
      plugins/tasklist/tasklist.desktop.in.in
  10. 86
      plugins/tasklist/tasklist.h

5
plugins/launcher/launcher-dialog.c

@ -80,4 +80,9 @@ launcher_dialog_show (LauncherPlugin *plugin)
gtk_widget_show (GTK_WIDGET (dialog));
}
else
{
/* release the builder */
g_object_unref (G_OBJECT (builder));
}
}

6
plugins/launcher/launcher.c

@ -112,6 +112,9 @@ static void
launcher_plugin_init (LauncherPlugin *plugin)
{
GdkScreen *screen;
/* initialize xfconf */
xfconf_init (NULL);
/* initialize variables */
plugin->entries = NULL;
@ -311,6 +314,9 @@ launcher_plugin_free_data (XfcePanelPlugin *panel_plugin)
/* release the xfconf channel */
g_object_unref (G_OBJECT (plugin->channel));
/* shutdown xfconf */
xfconf_shutdown ();
/* stop popup timeout */
if (G_UNLIKELY (plugin->popup_timeout_id))

85
plugins/tasklist/Makefile.am

@ -1,61 +1,69 @@
# $Id$
INCLUDES = \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libtasklist\" \
-DLOCALEDIR=\"$(localedir)\" \
-DWNCK_I_KNOW_THIS_IS_UNSTABLE \
INCLUDES = \
-I$(top_srcdir) \
-DG_LOG_DOMAIN=\"libtasklist\" \
-DLOCALEDIR=\"$(localedir)\" \
-DWNCK_I_KNOW_THIS_IS_UNSTABLE \
$(PLATFORM_CPPFLAGS)
plugindir = \
plugindir = \
$(libdir)/xfce4/panel-plugins
plugin_LTLIBRARIES = \
plugin_LTLIBRARIES = \
libtasklist.la
libtasklist_la_SOURCES = \
tasklist.c \
tasklist.h \
tasklist-dialogs.c \
tasklist-dialogs.h
libtasklist_la_CFLAGS = \
$(GTK_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCE4UI_CFLAGS) \
$(LIBWNCK_CFLAGS) \
libtasklist_la_SOURCES = \
plugin.c \
tasklist.c \
tasklist.h \
tasklist-dialog_glade.h
libtasklist_la_CFLAGS = \
$(GTK_CFLAGS) \
$(EXO_CFLAGS) \
$(XFCONF_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(LIBXFCE4UI_CFLAGS) \
$(LIBWNCK_CFLAGS) \
$(PLATFORM_CFLAGS)
libtasklist_la_LDFLAGS = \
-avoid-version \
-module \
libtasklist_la_LDFLAGS = \
-avoid-version \
-module \
-no-undefined \
$(PLATFORM_LDFLAGS)
if HAVE_CYGWIN
libtasklist_la_LDFLAGS += \
-no-undefined
endif
libtasklist_la_LIBADD = \
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(GTK_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBXFCE4UI_LIBS) \
libtasklist_la_LIBADD = \
$(top_builddir)/libxfce4panel/libxfce4panel.la \
$(EXO_LIBS) \
$(GTK_LIBS) \
$(XFCONF_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(LIBXFCE4UI_LIBS) \
$(LIBWNCK_LIBS)
libtasklist_la_DEPENDENCIES = \
libtasklist_la_DEPENDENCIES = \
$(top_builddir)/libxfce4panel/libxfce4panel.la
if MAINTAINER_MODE
BUILT_SOURCES = \
tasklist-dialog_glade.h
tasklist-dialog_glade.h: tasklist-dialog.glade
exo-csource --static --strip-comments --strip-content --name=tasklist_dialog_glade $< >$@
endif
#
# .desktop file
#
desktopdir = \
desktopdir = \
$(datadir)/xfce4/panel-plugins
desktop_in_in_files = \
desktop_in_in_files = \
tasklist.desktop.in.in
desktop_in_files = \
desktop_in_files = \
$(desktop_in_in_files:.desktop.in.in=.desktop.in)
%.desktop.in: %.desktop.in.in
@ -64,11 +72,12 @@ desktop_in_files = \
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
EXTRA_DIST = \
EXTRA_DIST = \
tasklist-dialog.glade \
$(desktop_in_in_files)
DISTCLEANFILES = \
$(desktop_DATA) \
DISTCLEANFILES = \
$(desktop_DATA) \
$(desktop_in_files)
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:

210
plugins/tasklist/plugin.c

@ -0,0 +1,210 @@
/* $Id$ */
/*
* This library 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 library 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 General Public License for
* more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; 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 <xfconf/xfconf.h>
#include <exo/exo.h>
#include <libxfce4ui/libxfce4ui.h>
#include <libxfce4panel/libxfce4panel.h>
#include "tasklist.h"
#include "tasklist-dialog_glade.h"
#define XFCE_TYPE_TASKLIST_PLUGIN (tasklist_plugin_get_type ())
#define XFCE_TASKLIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_TASKLIST_PLUGIN, TasklistPlugin))
#define XFCE_TASKLIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_TASKLIST_PLUGIN, TasklistPluginClass))
#define XFCE_IS_TASKLIST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_TASKLIST_PLUGIN))
#define XFCE_IS_TASKLIST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_TASKLIST_PLUGIN))
#define XFCE_TASKLIST_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_TASKLIST_PLUGIN, TasklistPluginClass))
typedef struct _TasklistPluginClass TasklistPluginClass;
struct _TasklistPluginClass
{
XfcePanelPluginClass __parent__;
};
typedef struct _TasklistPlugin TasklistPlugin;
struct _TasklistPlugin
{
XfcePanelPlugin __parent__;
/* the xfconf channel */
XfconfChannel *channel;
/* the tasklist widget */
GtkWidget *tasklist;
};
static void tasklist_plugin_class_init (TasklistPluginClass *klass);
static void tasklist_plugin_init (TasklistPlugin *plugin);
static void tasklist_plugin_construct (XfcePanelPlugin *panel_plugin);
static void tasklist_plugin_free_data (XfcePanelPlugin *panel_plugin);
static void tasklist_plugin_orientation_changed (XfcePanelPlugin *panel_plugin, GtkOrientation orientation);
static void tasklist_plugin_configure_plugin (XfcePanelPlugin *panel_plugin);
G_DEFINE_TYPE (TasklistPlugin, tasklist_plugin, XFCE_TYPE_PANEL_PLUGIN);
/* register the panel plugin */
XFCE_PANEL_PLUGIN_REGISTER_OBJECT (XFCE_TYPE_TASKLIST_PLUGIN);
static void
tasklist_plugin_class_init (TasklistPluginClass *klass)
{
XfcePanelPluginClass *plugin_class;
plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass);
plugin_class->construct = tasklist_plugin_construct;
plugin_class->free_data = tasklist_plugin_free_data;
plugin_class->orientation_changed = tasklist_plugin_orientation_changed;
plugin_class->configure_plugin = tasklist_plugin_configure_plugin;
}
static void
tasklist_plugin_init (TasklistPlugin *plugin)
{
/* initialize xfconf */
xfconf_init (NULL);
plugin->tasklist = g_object_new (XFCE_TYPE_TASKLIST, NULL);
gtk_container_add (GTK_CONTAINER (plugin), plugin->tasklist);
}
static void
tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
{
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
/* expand the plugin */
xfce_panel_plugin_set_expand (XFCE_PANEL_PLUGIN (plugin), TRUE);
xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
/* open the xfconf channel */
plugin->channel = xfce_panel_plugin_xfconf_channel_new (panel_plugin);
/* create bindings */
xfconf_g_property_bind (plugin->channel, "/style", G_TYPE_UINT,
plugin->tasklist, "style");
xfconf_g_property_bind (plugin->channel, "/include-all-workspaces", G_TYPE_BOOLEAN,
plugin->tasklist, "include-all-workspaces");
xfconf_g_property_bind (plugin->channel, "/flat-buttons", G_TYPE_BOOLEAN,
plugin->tasklist, "flat-buttons");
xfconf_g_property_bind (plugin->channel, "/switch-workspace-on-unminimize", G_TYPE_BOOLEAN,
plugin->tasklist, "switch-workspace-on-unminimize");
xfconf_g_property_bind (plugin->channel, "/show-only-minimized", G_TYPE_BOOLEAN,
plugin->tasklist, "show-only-minimized");
/* show the tasklist */
gtk_widget_show (plugin->tasklist);
}
static void
tasklist_plugin_free_data (XfcePanelPlugin *panel_plugin)
{
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
/* release the xfconf channel */
if (G_LIKELY (plugin->channel))
g_object_unref (G_OBJECT (plugin->channel));
/* shutdown xfconf */
xfconf_shutdown ();
}
static void
tasklist_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
GtkOrientation orientation)
{
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
/* set the new tasklist orientation */
xfce_tasklist_set_orientation (XFCE_TASKLIST (plugin->tasklist), orientation);
}
static void
tasklist_plugin_configure_plugin (XfcePanelPlugin *panel_plugin)
{
TasklistPlugin *plugin = XFCE_TASKLIST_PLUGIN (panel_plugin);
GtkBuilder *builder;
GObject *dialog;
GObject *object;
GError *error = NULL;
builder = gtk_builder_new ();
if (gtk_builder_add_from_string (builder, tasklist_dialog_glade, tasklist_dialog_glade_length, &error))
{
dialog = gtk_builder_get_object (builder, "dialog");
g_object_weak_ref (G_OBJECT (dialog), (GWeakNotify) g_object_unref, builder);
object = gtk_builder_get_object (builder, "close-button");
g_signal_connect_swapped (G_OBJECT (object), "clicked", G_CALLBACK (gtk_widget_destroy), dialog);
object = gtk_builder_get_object (builder, "style");
exo_mutual_binding_new (G_OBJECT (plugin->tasklist), "style", object, "active");
object = gtk_builder_get_object (builder, "include-all-workspaces");
exo_mutual_binding_new (G_OBJECT (plugin->tasklist), "include-all-workspaces", object, "active");
object = gtk_builder_get_object (builder, "flat-buttons");
exo_mutual_binding_new (G_OBJECT (plugin->tasklist), "flat-buttons", object, "active");
object = gtk_builder_get_object (builder, "switch-workspace-on-unminimize");
exo_mutual_binding_new_with_negation (G_OBJECT (plugin->tasklist), "switch-workspace-on-unminimize", object, "active");
object = gtk_builder_get_object (builder, "show-only-minimized");
exo_mutual_binding_new (G_OBJECT (plugin->tasklist), "show-only-minimized", object, "active");
/* TODO remove when implemented by glade */
GtkCellRenderer *cell1 = gtk_cell_renderer_text_new ();
object = gtk_builder_get_object (builder, "style");
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (object), cell1, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell1, "text", 0, NULL);
gtk_widget_show (GTK_WIDGET (dialog));
}
else
{
/* release the builder */
g_object_unref (G_OBJECT (builder));
g_message ("%s", error->message);
g_error_free (error);
}
}

47
plugins/tasklist/tasklist-dialog.glade

@ -1,14 +1,29 @@
<?xml version="1.0"?>
<interface>
<!--interface-requires gtk+ 2.12-->
<object class="GtkDialog" id="xfce-tasklist-dialog">
<property name="title" translatable="yes">Tasklist Preferences</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="icon_name">gtk-preferences</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<requires lib="gtk+" version="2.14"/>
<!-- interface-requires xfce4 0.0 -->
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkListStore" id="style-model">
<columns>
<!-- column-name title -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">Tasklist</col>
</row>
<row>
<col id="0" translatable="yes">Iconbox</col>
</row>
</data>
</object>
<object class="XfceTitledDialog" id="dialog">
<property name="title" translatable="yes">Tasklist Properties</property>
<property name="icon_name">gtk-properties</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
@ -48,8 +63,9 @@
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox1">
<object class="GtkComboBox" id="style">
<property name="visible">True</property>
<property name="model">style-model</property>
</object>
<packing>
<property name="expand">False</property>
@ -63,7 +79,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton1">
<object class="GtkCheckButton" id="flat-buttons">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show _flat buttons</property>
@ -75,7 +91,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton2">
<object class="GtkCheckButton" id="show-handle">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show _handle</property>
@ -148,7 +164,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton3">
<object class="GtkCheckButton" id="include-all-workspaces">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show windows from _all workspaces</property>
@ -160,7 +176,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton4">
<object class="GtkCheckButton" id="show-only-minimized">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show only _minimized windows</property>
@ -172,7 +188,7 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton5">
<object class="GtkCheckButton" id="switch-workspace-on-unminimize">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Restore minimized windows to current _workspace</property>
@ -207,17 +223,16 @@
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<object class="GtkButton" id="button1">
<object class="GtkButton" id="close-button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="label" translatable="yes">gtk-close</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
</object>
<packing>
<property name="position">0</property>

232
plugins/tasklist/tasklist-dialogs.c

@ -1,232 +0,0 @@
/* $Id: tasklist-dialogs.c 26151 2007-10-20 10:33:12Z nick $
*
* Copyright (c) 2005-2007 Jasper Huijsmans <jasper@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 "tasklist.h"
#include "tasklist-dialogs.h"
/* prototypes */
static void tasklist_all_workspaces_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist);
static void tasklist_grouping_changed (GtkComboBox *cb,
TasklistPlugin *tasklist);
static void tasklist_expand_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist);
static void tasklist_flat_buttons_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist);
static void tasklist_show_handle_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist);
static void tasklist_width_changed (GtkSpinButton *sb,
TasklistPlugin *tasklist);
static void tasklist_dialog_response (GtkWidget *dlg,
gint reponse,
TasklistPlugin *tasklist);
static void
tasklist_all_workspaces_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist)
{
tasklist->all_workspaces = gtk_toggle_button_get_active (tb);
wnck_tasklist_set_include_all_workspaces (WNCK_TASKLIST (tasklist->list),
tasklist->all_workspaces);
}
static void
tasklist_grouping_changed (GtkComboBox *cb,
TasklistPlugin *tasklist)
{
tasklist->grouping = gtk_combo_box_get_active (cb);
wnck_tasklist_set_grouping (WNCK_TASKLIST (tasklist->list),
tasklist->grouping);
}
static void
tasklist_expand_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist)
{
tasklist->expand = gtk_toggle_button_get_active (tb);
xfce_panel_plugin_set_expand (tasklist->panel_plugin, tasklist->expand);
}
static void
tasklist_flat_buttons_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist)
{
tasklist->flat_buttons = gtk_toggle_button_get_active (tb);
wnck_tasklist_set_button_relief (WNCK_TASKLIST (tasklist->list),
tasklist->flat_buttons ?
GTK_RELIEF_NONE : GTK_RELIEF_NORMAL);
}
static void
tasklist_show_handle_toggled (GtkToggleButton *tb,
TasklistPlugin *tasklist)
{
tasklist->show_handles = gtk_toggle_button_get_active (tb);
if (tasklist->show_handles)
gtk_widget_show (tasklist->handle);
else
gtk_widget_hide (tasklist->handle);
}
static void
tasklist_width_changed (GtkSpinButton *sb,
TasklistPlugin *tasklist)
{
tasklist->width = gtk_spin_button_get_value_as_int (sb);
gtk_widget_queue_resize (GTK_WIDGET (tasklist->panel_plugin));
}
static void
tasklist_dialog_response (GtkWidget *dlg,
gint reponse,
TasklistPlugin *tasklist)
{
g_object_set_data (G_OBJECT (tasklist->panel_plugin), I_("dialog"), NULL);
gtk_widget_destroy (dlg);
xfce_panel_plugin_unblock_menu (tasklist->panel_plugin);
tasklist_plugin_write (tasklist);
}
void
tasklist_dialogs_configure (TasklistPlugin *tasklist)
{
GtkWidget *dlg, *mainvbox, *vbox, *frame, *cb,
*hbox, *label, *spin;
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->panel_plugin)));
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");
g_signal_connect (G_OBJECT (dlg), "response",
G_CALLBACK (tasklist_dialog_response), tasklist);
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
mainvbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (mainvbox), 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), mainvbox,
TRUE, TRUE, 0);
/* Size */
vbox = gtk_vbox_new (FALSE, 8);
frame = xfce_gtk_frame_box_new_with_content (_("Appearance"), vbox);
gtk_box_pack_start (GTK_BOX (mainvbox), frame, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new (_("Minimum Width:"));
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
/* an arbitrary max of 4000 should be future proof, right? */
spin = gtk_spin_button_new_with_range (100, 4000, 10);
gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, FALSE, 0);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), tasklist->width);
g_signal_connect (G_OBJECT (spin), "value-changed",
G_CALLBACK (tasklist_width_changed), tasklist);
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);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->expand);
g_signal_connect (G_OBJECT (cb), "toggled",
G_CALLBACK (tasklist_expand_toggled), tasklist);
}
cb = gtk_check_button_new_with_mnemonic (_("Use flat buttons"));
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->flat_buttons);
g_signal_connect (G_OBJECT (cb), "toggled",
G_CALLBACK (tasklist_flat_buttons_toggled), tasklist);
cb = gtk_check_button_new_with_mnemonic (_("Show handle"));
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->show_handles);
g_signal_connect (G_OBJECT (cb), "toggled",
G_CALLBACK (tasklist_show_handle_toggled), tasklist);
/* Tasks */
vbox = gtk_vbox_new (FALSE, 8);
frame = xfce_gtk_frame_box_new_with_content (_("Task List"), vbox);
gtk_box_pack_start (GTK_BOX (mainvbox), frame, FALSE, FALSE, 0);
cb = gtk_check_button_new_with_mnemonic (_("Show tasks from _all workspaces"));
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cb), tasklist->all_workspaces);
g_signal_connect (G_OBJECT (cb), "toggled",
G_CALLBACK (tasklist_all_workspaces_toggled), tasklist);
cb = gtk_combo_box_new_text ();
gtk_box_pack_start (GTK_BOX (vbox), cb, FALSE, FALSE, 0);
/* 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"));
gtk_combo_box_set_active (GTK_COMBO_BOX (cb), tasklist->grouping);
g_signal_connect (G_OBJECT (cb), "changed",
G_CALLBACK (tasklist_grouping_changed), tasklist);
gtk_widget_show_all (dlg);
}

25
plugins/tasklist/tasklist-dialogs.h

@ -1,25 +0,0 @@
/* $Id: tasklist-dialogs.h 26151 2007-10-20 10:33:12Z nick $
*
* Copyright (c) 2005-2007 Jasper Huijsmans <jasper@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 __TASKLIST_DIALOGS_H__
#define __TASKLIST_DIALOGS_H__
void tasklist_dialogs_configure (TasklistPlugin *tasklist);
#endif /* !__TASKLIST_DIALOGS_H__ */

1412
plugins/tasklist/tasklist.c

File diff suppressed because it is too large

2
plugins/tasklist/tasklist.desktop.in.in

@ -6,4 +6,4 @@ _Comment=Show all running applications
Icon=xfwm4
X-XFCE-Module=tasklist
X-XFCE-Module-Path=@libdir@/xfce4/panel-plugins
X-XFCE-External=TRUE
X-XFCE-External=FALSE

86
plugins/tasklist/tasklist.h

@ -1,64 +1,54 @@
/* $Id: tasklist.h 26196 2007-10-25 18:23:36Z nick $
/* $Id$ */
/*
* 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.
*
* Copyright (c) 2005-2007 Jasper Huijsmans <jasper@xfce.org>
* 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 General Public License for
* more details.
*
* 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.
* 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
*/
#ifndef __TASKLIST_H__
#define __TASKLIST_H__
#ifndef __XFCE_TASKLIST_H__
#define __XFCE_TASKLIST_H__
#include <gtk/gtk.h>
#include <libwnck/libwnck.h>
#include <libxfce4ui/libxfce4ui.h>
#include <libxfce4util/libxfce4util.h>
#include <libxfce4panel/libxfce4panel.h>
typedef struct _TasklistPlugin TasklistPlugin;
struct _TasklistPlugin
{
/* the panel plugin */
XfcePanelPlugin *panel_plugin;
G_BEGIN_DECLS
/* widgets */
GtkWidget *box;
GtkWidget *handle;
GtkWidget *list;
typedef struct _XfceTasklistClass XfceTasklistClass;
typedef struct _XfceTasklist XfceTasklist;
typedef struct _XfceTasklistChild XfceTasklistChild;
typedef enum _XfceTasklistStyle XfceTasklistStyle;
/* signals */
gint screen_changed_id;
#define XFCE_TYPE_TASKLIST (xfce_tasklist_get_type ())
#define XFCE_TASKLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), XFCE_TYPE_TASKLIST, XfceTasklist))
#define XFCE_TASKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), XFCE_TYPE_TASKLIST, XfceTasklistClass))
#define XFCE_IS_TASKLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XFCE_TYPE_TASKLIST))
#define XFCE_IS_TASKLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), XFCE_TYPE_TASKLIST))
#define XFCE_TASKLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), XFCE_TYPE_TASKLIST, XfceTasklistClass))
/* icon theme */
GtkIconTheme *icon_theme;
/* requested width */
gint req_size;
/* settings */
gint width;
WnckTasklistGroupingType grouping;
guint all_workspaces : 1;
guint show_label : 1;
guint expand : 1;
guint flat_buttons : 1;
guint show_handles : 1;
enum _XfceTasklistStyle
{
XFCE_TASKLIST_STYLE_NORMAL,
XFCE_TASKLIST_STYLE_ICONBOX
};
void tasklist_plugin_write (TasklistPlugin *tasklist);
gboolean tasklist_using_xinerama (XfcePanelPlugin *panel_plugin);
#endif /* !__TASKLIST_H__ */
GType xfce_tasklist_get_type (void) G_GNUC_CONST;
void xfce_tasklist_set_orientation (XfceTasklist *tasklist,
GtkOrientation orientation);
G_END_DECLS
#endif /* !__XFCE_TASKLIST_H__ */

Loading…
Cancel
Save