Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/Makefile.am,v
retrieving revision 1.20
diff -u -r1.20 Makefile.am
--- Makefile.am	17 Feb 2004 11:16:28 -0000	1.20
+++ Makefile.am	13 Jan 2005 22:25:40 -0000
@@ -12,11 +12,11 @@
 	application.h		\
 	class-group.h		\
 	screen.h		\
+	selector.h		\
 	tasklist.h		\
 	util.h			\
 	window.h 		\
 	window-action-menu.h	\
-	window-menu.h		\
 	workspace.h
 
 wnck_built_installed_headers=wnck-enum-types.h
@@ -45,11 +45,11 @@
 	pager.c			\
 	private.h		\
 	screen.c		\
+	selector.c		\
 	tasklist.c		\
 	util.c			\
 	window.c		\
 	window-action-menu.c	\
-	window-menu.c		\
 	workspace.c		\
 	xutils.c		\
 	xutils.h		\
Index: libwnck.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/libwnck.h,v
retrieving revision 1.4
diff -u -r1.4 libwnck.h
--- libwnck.h	24 Oct 2001 23:14:17 -0000	1.4
+++ libwnck.h	13 Jan 2005 22:25:40 -0000
@@ -31,7 +31,7 @@
 
 #include <libwnck/pager.h>
 #include <libwnck/tasklist.h>
-#include <libwnck/window-menu.h>
+#include <libwnck/selector.h>
 
 #endif /* WNCK_LIB_H */
 
--- /dev/null	Fri Mar 23 23:37:44 2001
+++ selector.c	Thu Jan 13 17:23:07 2005
@@ -0,0 +1,715 @@
+/* selector */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This library 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 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
+ * Library 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.
+ */
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include "selector.h"
+#include "inlinepixbufs.h"
+#include "libwnck.h"
+#include "screen.h"
+
+typedef struct {
+	GtkWidget *item;
+	GtkWidget *label;
+} window_hash_item;
+
+static void wnck_selector_init         (WnckSelector      *tasklist);
+static void wnck_selector_class_init   (WnckSelectorClass *klass);
+static void wnck_selector_finalize     (GObject        *object);
+static void selector_connect_to_window (WnckSelector *selector, WnckWindow *window);
+
+static gpointer selector_parent_class;
+
+static void
+selector_destroy (GtkWidget  *widget,
+		  WnckSelector *selector)
+{
+	if (selector->menu)
+		gtk_widget_destroy (selector->menu);
+	selector->menu = NULL;
+	selector->no_windows_item = NULL;
+
+	if (selector->icon_pixbuf)
+		g_object_unref (selector->icon_pixbuf);
+	selector->icon_pixbuf = NULL;
+}
+
+static WnckScreen *
+selector_get_screen (WnckSelector *selector)
+{
+	GdkScreen *screen;
+
+	if (!gtk_widget_has_screen (GTK_WIDGET(selector))){
+		return selector->screen;
+	}
+	screen = gtk_widget_get_screen (GTK_WIDGET(selector));
+
+	return wnck_screen_get (gdk_screen_get_number (screen));
+}
+
+static GdkPixbuf *
+selector_get_default_window_icon (void) 
+{
+	static GdkPixbuf *retval = NULL;
+
+	if (retval)
+		return retval;
+
+	retval = gdk_pixbuf_new_from_inline (
+			-1, default_icon_data, FALSE, NULL);
+ 
+	g_assert (retval);
+
+	return retval;
+}
+
+static void
+selector_dimm_icon (GdkPixbuf *pixbuf)
+{
+	int x, y, pixel_stride, row_stride;
+	guchar *row, *pixels;
+	int w, h;
+
+	w = gdk_pixbuf_get_width (pixbuf);
+	h = gdk_pixbuf_get_height (pixbuf);
+	
+	g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
+	
+	pixel_stride = 4;
+	
+	row = gdk_pixbuf_get_pixels (pixbuf);
+	row_stride = gdk_pixbuf_get_rowstride (pixbuf);
+	
+	for (y = 0; y < h; y++) {
+			pixels = row;			
+			for (x = 0; x < w; x++) {
+				pixels[3] /= 2;				
+				pixels += pixel_stride;
+			}			
+			row += row_stride;
+	}
+}
+
+static void
+selector_set_window_icon (WnckSelector *selector,
+			  GtkWidget  *image,
+			  WnckWindow *window,
+			  gboolean    use_icon_size)
+{
+	GdkPixbuf *pixbuf, *freeme;
+	int        width, height;
+	int        icon_size = -1;
+
+	pixbuf = NULL;
+	freeme = NULL;
+	
+	if (window)
+		pixbuf = wnck_window_get_icon (window);
+
+	if (!pixbuf)
+		pixbuf = selector_get_default_window_icon ();
+
+	if (!use_icon_size && selector->size > 1)
+		icon_size = selector->size;
+
+	if (icon_size == -1)
+		gtk_icon_size_lookup (
+			GTK_ICON_SIZE_MENU, NULL, &icon_size);
+
+	width  = gdk_pixbuf_get_width  (pixbuf);
+	height = gdk_pixbuf_get_height (pixbuf);
+
+	if (icon_size != -1 &&
+	    (width > icon_size || height > icon_size)) {
+		double scale;
+
+		scale = ((double) icon_size) / MAX (width, height);
+
+		pixbuf = gdk_pixbuf_scale_simple (
+				pixbuf, width * scale, height * scale, GDK_INTERP_BILINEAR);
+		freeme = pixbuf;
+	}
+
+	if (window && wnck_window_is_minimized (window))
+		selector_dimm_icon (pixbuf);
+	
+	gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
+
+	if (freeme)
+		g_object_unref (freeme);
+}
+
+static void
+selector_set_active_window (WnckSelector *selector,
+			    WnckWindow *window)
+{
+	selector_set_window_icon (
+		selector, selector->image, window, FALSE);
+	selector->icon_window = window;
+}
+
+/* The results of this function will need to be freed. */
+static char *
+selector_get_window_name (WnckWindow *window)
+{
+	const char *const_name;
+	char *return_value;
+	char *name;
+
+	const_name = wnck_window_get_name (window);
+	if (!const_name)
+		name = g_strdup (_("Unknown Window"));
+	else
+		name = g_strdup (const_name);
+
+	if (wnck_window_demands_attention (window)) {
+		return_value = g_strdup_printf ("<b>%s</b>", name);
+		g_free (name);
+		name = return_value;
+	}
+
+	if (wnck_window_is_shaded (window)) {
+		return_value = g_strdup_printf ("=%s=", name);
+		g_free (name);
+	} else if (wnck_window_is_minimized (window)) {
+		return_value = g_strdup_printf ("[%s]", name);
+		g_free (name);
+	} else
+		return_value = name;
+
+	return return_value;
+}
+
+static void
+selector_window_icon_changed (WnckWindow *window,
+			      WnckSelector *selector)
+{
+	window_hash_item *item;
+	GtkWidget        *image;
+
+	if (selector->icon_window == window)
+		selector_set_active_window (selector, window);
+
+	item = NULL;
+
+	item = g_hash_table_lookup (selector->window_hash, window);
+	if (item != NULL) {
+		image = gtk_image_new ();
+		selector_set_window_icon (selector, image, window, TRUE);		    
+		gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item->item),
+					       GTK_WIDGET (image));
+		gtk_widget_show (image);
+	}
+}
+
+static void
+selector_window_name_changed (WnckWindow *window,
+			      WnckSelector *selector)
+{
+	window_hash_item *item;
+	char *window_name;
+
+	item = NULL;
+	window_name = NULL;
+
+	item = g_hash_table_lookup (selector->window_hash, window);
+	if (item != NULL) {
+		window_name = selector_get_window_name (window);
+		gtk_label_set_text (GTK_LABEL (item->label), window_name);
+		if (window_name != NULL)
+			g_free (window_name);
+	}
+}
+
+static void
+selector_window_state_changed (WnckWindow *window,
+			       WnckWindowState changed_mask,
+			       WnckWindowState new_state,
+			       WnckSelector *selector)
+{
+	window_hash_item *item;
+	char *window_name;
+
+	if (!(changed_mask & (WNCK_WINDOW_STATE_MINIMIZED|WNCK_WINDOW_STATE_SHADED|WNCK_WINDOW_STATE_SKIP_TASKLIST|WNCK_WINDOW_STATE_DEMANDS_ATTENTION)))
+			return;
+
+	item = NULL;
+	window_name = NULL;
+
+	item = g_hash_table_lookup (selector->window_hash, window);
+	if (item == NULL)
+		return;
+
+	if (changed_mask & WNCK_WINDOW_STATE_SKIP_TASKLIST) {
+		if (wnck_window_is_skip_tasklist (window)) {
+			gtk_widget_hide (item->item);
+		} else {
+			gtk_widget_show (item->item);
+		}
+	}
+
+	if (changed_mask & (WNCK_WINDOW_STATE_MINIMIZED|WNCK_WINDOW_STATE_SHADED|WNCK_WINDOW_STATE_DEMANDS_ATTENTION)) {
+		window_name = selector_get_window_name (window);
+		gtk_label_set_text (GTK_LABEL (item->label), window_name);
+		if (window_name != NULL)
+			g_free (window_name);
+	}
+}
+
+static void
+selector_active_window_changed (WnckScreen *screen,
+				WnckSelector *selector)
+{
+	WnckWindow *window;
+	
+	window = wnck_screen_get_active_window (screen);
+
+	if (selector->icon_window != window)
+		selector_set_active_window (selector, window);
+}
+
+static void
+selector_activate_window (WnckWindow *window)
+{
+	WnckWorkspace *workspace;
+
+	workspace = wnck_window_get_workspace (window);
+	wnck_workspace_activate (workspace);
+
+	if (wnck_window_is_minimized (window))
+		wnck_window_unminimize (window);
+	
+	wnck_window_activate (window);
+}
+
+#define SELECTOR_MAX_WIDTH 50	/* maximum width in characters */
+
+static gint
+get_width (GtkWidget *widget, const char *text)
+{
+	PangoContext *context;
+	PangoFontMetrics *metrics;
+	gint char_width;
+	PangoLayout *layout;
+	PangoRectangle natural;
+	gint max_width;
+	gint screen_width;
+	gint width;
+
+	gtk_widget_ensure_style (widget);
+
+	context = gtk_widget_get_pango_context (widget);
+	metrics = pango_context_get_metrics (
+		context, widget->style->font_desc,
+		pango_context_get_language (context));
+	char_width = pango_font_metrics_get_approximate_char_width (metrics);
+	pango_font_metrics_unref (metrics);
+	max_width = PANGO_PIXELS (SELECTOR_MAX_WIDTH * char_width);
+
+	layout = gtk_widget_create_pango_layout (widget, text);
+	pango_layout_get_pixel_extents (layout, NULL, &natural);
+	g_object_unref (G_OBJECT (layout));
+
+	screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget));
+
+	width = MIN (natural.width, max_width);
+	width = MIN (width, 3 * (screen_width / 4));
+	
+	return width;
+}
+
+static GtkWidget*
+selector_item_new (WnckSelector  *selector,
+		   const gchar *label,
+		   WnckWindow  *window)
+{
+	GtkWidget *item;
+	GtkWidget *ellipsizing_label;
+	window_hash_item *hash_item;
+
+	item = gtk_image_menu_item_new ();
+	
+	ellipsizing_label = gtk_label_new (label);
+	gtk_misc_set_alignment (GTK_MISC (ellipsizing_label), 0.0, 0.5);
+	gtk_label_set_ellipsize (GTK_LABEL (ellipsizing_label),
+				 PANGO_ELLIPSIZE_END);
+	/* if window demands attention, we need markup */
+	if (window != NULL)
+		gtk_label_set_use_markup (GTK_LABEL (ellipsizing_label), TRUE);
+
+	if (window != NULL) {
+		hash_item = g_new0 (window_hash_item, 1);
+		hash_item->item = item;
+		hash_item->label = ellipsizing_label;
+		g_hash_table_insert (selector->window_hash, window, hash_item);
+	}
+
+	gtk_container_add (GTK_CONTAINER (item), ellipsizing_label);
+
+	gtk_widget_show (ellipsizing_label);
+
+	gtk_widget_set_size_request (ellipsizing_label, 
+				     get_width (GTK_WIDGET(selector), label), -1);
+	return item;
+}
+
+static void
+selector_add_window (WnckSelector *selector,
+		     WnckWindow *window)
+{
+	WnckWorkspace *workspace; 
+	GtkWidget     *item;
+	GtkWidget     *image;
+	char          *name;
+
+	if (wnck_window_is_skip_tasklist (window))
+		return;
+
+	name = selector_get_window_name (window);
+
+	item = selector_item_new (selector,
+				     name,
+				     window);
+
+	if (name != NULL)
+		g_free (name);
+
+	image = gtk_image_new ();
+
+	selector_set_window_icon (selector, image, window, TRUE);
+
+	gtk_image_menu_item_set_image (
+			GTK_IMAGE_MENU_ITEM (item), GTK_WIDGET (image));
+	gtk_widget_show (image);
+
+	workspace = wnck_screen_get_active_workspace (
+				selector_get_screen (selector));
+
+	if (wnck_window_get_workspace (window) == workspace)
+		gtk_menu_shell_prepend (GTK_MENU_SHELL (selector->menu), item);
+	else
+		gtk_menu_shell_append (GTK_MENU_SHELL (selector->menu), item);
+
+
+	g_signal_connect_swapped (item, "activate",
+				  G_CALLBACK (selector_activate_window),
+				  window);
+
+	gtk_widget_show (item);
+}
+
+static void
+selector_window_opened (WnckScreen *screen,
+			WnckWindow *window,
+			WnckSelector *selector)
+{
+	if (selector->menu && GTK_WIDGET_VISIBLE (selector->menu)) {
+		if (selector->no_windows_item
+		    && GTK_WIDGET_VISIBLE (selector->no_windows_item))
+			gtk_widget_hide (selector->no_windows_item);
+		selector_add_window (selector, window);
+		gtk_menu_reposition (GTK_MENU (selector->menu));
+	}
+
+	selector_connect_to_window (selector, window);
+}
+
+static void
+selector_window_closed (WnckScreen *screen,
+			WnckWindow *window,
+			WnckSelector *selector)
+{
+	window_hash_item *item;
+
+	if (window == selector->icon_window)
+		selector_set_active_window (selector, NULL);
+
+	if (!selector->menu || !GTK_WIDGET_VISIBLE (selector->menu))
+		return;
+	
+	item = g_hash_table_lookup (selector->window_hash, window);
+	if (!item)
+		return;
+
+	gtk_widget_hide (item->item);
+	gtk_menu_reposition (GTK_MENU (selector->menu));
+}
+
+static void
+wncklet_connect_while_alive (gpointer    object,
+			     const char *signal,
+			     GCallback   func,
+			     gpointer    func_data,
+			     gpointer    alive_object)
+{
+	GClosure *closure;
+
+	closure = g_cclosure_new (func, func_data, NULL);
+	g_object_watch_closure (G_OBJECT (alive_object), closure);
+	g_signal_connect_closure_by_id (
+			object,
+			g_signal_lookup (signal, G_OBJECT_TYPE (object)), 0,
+			closure,
+			FALSE);
+}
+
+static void
+selector_connect_to_window (WnckSelector *selector,
+			    WnckWindow *window)
+{
+	wncklet_connect_while_alive (window, "icon_changed",
+				     G_CALLBACK (selector_window_icon_changed),
+				     selector,
+				     selector);
+	wncklet_connect_while_alive (window, "name_changed",
+				     G_CALLBACK (selector_window_name_changed),
+				     selector,
+				     selector);
+	wncklet_connect_while_alive (window, "state_changed",
+				     G_CALLBACK (selector_window_state_changed),
+				     selector,
+				     selector);
+}
+
+static void
+selector_connect_to_screen (WnckSelector *selector,
+			    WnckScreen *screen)
+{
+	wncklet_connect_while_alive (screen, "active_window_changed",
+				     G_CALLBACK (selector_active_window_changed),
+				     selector,
+				     selector);
+
+	wncklet_connect_while_alive (screen, "window_opened",
+				     G_CALLBACK (selector_window_opened),
+				     selector,
+				     selector);
+
+	wncklet_connect_while_alive (screen, "window_closed",
+				     G_CALLBACK (selector_window_closed),
+				     selector,
+				     selector);
+}
+
+static void
+selector_destroy_menu (GtkWidget  *widget,
+		       WnckSelector *selector)
+{
+	selector->menu = NULL;
+
+	if (selector->window_hash)
+		g_hash_table_destroy (selector->window_hash);
+	selector->window_hash = NULL;
+	selector->no_windows_item = NULL;
+}
+
+static void
+selector_menu_hidden (GtkWidget  *menu,
+		      WnckSelector *selector)
+{
+	gtk_widget_set_state (GTK_WIDGET (selector), GTK_STATE_NORMAL);
+}
+
+static void
+selector_on_show (GtkWidget  *widget,
+		  WnckSelector *selector)
+{
+	GtkWidget  *separator;
+	WnckScreen *screen;
+	GList      *windows;
+	GList      *l, *children;
+
+	/* Remove existing items */
+	children = gtk_container_get_children (GTK_CONTAINER (selector->menu));
+	for (l = children; l; l = l->next)
+		gtk_container_remove (GTK_CONTAINER (selector->menu), l->data);
+	g_list_free (children);
+	
+	selector->no_windows_item = NULL;
+
+	/* Add separator */
+	separator = gtk_separator_menu_item_new ();
+	gtk_widget_show (separator);
+	gtk_menu_shell_append (GTK_MENU_SHELL (selector->menu), separator);
+
+
+	/* Add windows */
+	screen = selector_get_screen (selector);
+	windows = wnck_screen_get_windows (screen);
+
+	if (selector->window_hash)
+		g_hash_table_destroy (selector->window_hash);
+	selector->window_hash = g_hash_table_new_full (g_direct_hash,
+							  g_direct_equal,
+							  NULL,
+							  g_free);
+
+	for (l = windows; l; l = l->next)
+		selector_add_window (selector, l->data);
+
+	/* Remove separator if it is at the start or the end of the menu */
+	l = GTK_MENU_SHELL (selector->menu)->children;
+
+	if ((separator == l->data) || separator == g_list_last (l)->data)
+		gtk_widget_destroy (separator);
+
+	/* Check if a no-windows item is needed */
+	if (!GTK_MENU_SHELL (selector->menu)->children) {
+		selector->no_windows_item =
+			selector_item_new (selector,
+					      _("No Windows Open"),
+					      NULL);
+
+		gtk_widget_set_sensitive (selector->no_windows_item, FALSE);
+		gtk_widget_show (selector->no_windows_item);	
+		gtk_menu_shell_append (GTK_MENU_SHELL (selector->menu),
+				       selector->no_windows_item);
+	}
+}
+
+static void
+selector_setup_menu (WnckSelector *selector)
+{
+	WnckScreen *screen;
+	GList      *windows, *l;
+
+	screen = selector_get_screen (selector);
+	windows = wnck_screen_get_windows (screen);
+
+	for (l = windows; l; l = l->next)
+		if (wnck_window_is_active (l->data))
+			break;
+
+	selector_set_active_window (selector, l ? l->data : NULL);
+
+	for (l = windows; l; l = l->next)
+		selector_connect_to_window (selector, l->data);
+
+	selector_connect_to_screen (selector, screen);
+}
+
+static void
+selector_fill (WnckSelector *selector)
+{
+	g_signal_connect (selector, "destroy",
+			  G_CALLBACK (selector_destroy), selector);
+
+	selector->menu_item = gtk_menu_item_new ();	
+	gtk_widget_show (selector->menu_item);
+	gtk_menu_shell_append (GTK_MENU_SHELL (selector), selector->menu_item);
+	
+	selector->image = gtk_image_new ();
+	gtk_widget_show (selector->image);
+	gtk_container_add (GTK_CONTAINER (selector->menu_item), selector->image);
+
+	selector->menu = gtk_menu_new ();
+	gtk_menu_item_set_submenu (GTK_MENU_ITEM (selector->menu_item), selector->menu);
+	g_signal_connect (selector->menu, "hide",
+			  G_CALLBACK (selector_menu_hidden), selector);
+	g_signal_connect (selector->menu, "destroy",
+			  G_CALLBACK (selector_destroy_menu), selector);
+	g_signal_connect (selector->menu, 
+			  "show", G_CALLBACK (selector_on_show), selector);
+
+	gtk_widget_set_name (GTK_WIDGET(selector), "gnome-panel-window-menu-menu-bar-style");
+	
+	gtk_rc_parse_string (
+			     "style \"gnome-panel-window-menu-menu-bar-style\" {\n"
+			     "        GtkMenuBar::shadow-type = none\n"
+			     "        GtkMenuBar::internal-padding = 0\n"
+			     "}\n"
+			     "widget \"*gnome-panel-window-menu-menu-bar*\" style : highest \"gnome-panel-window-menu-menu-bar-style\"");
+	
+	selector_setup_menu (selector);
+    	gtk_widget_show (GTK_WIDGET (selector));
+}
+
+GType
+wnck_selector_get_type (void)
+{
+	static GType object_type = 0;
+	
+	g_type_init ();
+	
+	if (!object_type) {
+		static const GTypeInfo object_info = {
+			sizeof (WnckSelectorClass),
+			(GBaseInitFunc) NULL,
+			(GBaseFinalizeFunc) NULL,
+			(GClassInitFunc) wnck_selector_class_init,
+			NULL,           /* class_finalize */
+			NULL,           /* class_data */
+			sizeof (WnckSelector),
+			0,              /* n_preallocs */
+			(GInstanceInitFunc) wnck_selector_init,
+		};
+		
+		object_type = g_type_register_static (GTK_TYPE_MENU_BAR,
+						      "WnckSelector",
+						      &object_info, 0);
+	}
+	
+	return object_type;
+}
+
+static void
+wnck_selector_init (WnckSelector *selector)
+{
+	AtkObject *atk_obj;
+	
+	atk_obj = gtk_widget_get_accessible (GTK_WIDGET(selector));
+	atk_object_set_name (atk_obj, _("Window Selector"));
+	atk_object_set_description (atk_obj, _("Tool to switch between windows"));
+}
+
+static void
+wnck_selector_class_init (WnckSelectorClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	
+	selector_parent_class = g_type_class_peek_parent (klass);
+	object_class->finalize = wnck_selector_finalize;
+}
+
+static void
+wnck_selector_finalize (GObject *object)
+{
+	WnckSelector *selector;
+	
+	selector = WNCK_SELECTOR (object);
+	
+	if (selector->window_hash)
+		g_hash_table_destroy (selector->window_hash);
+	selector->window_hash = NULL;
+	
+	G_OBJECT_CLASS (selector_parent_class)->finalize (object);
+}
+
+GtkWidget*
+wnck_selector_new (WnckScreen *screen)
+{
+	WnckSelector *selector;
+	selector = g_object_new (WNCK_TYPE_SELECTOR, NULL);
+	selector->screen = screen;
+	selector_fill (selector);
+	return GTK_WIDGET (selector);
+}
--- /dev/null	Fri Mar 23 23:37:44 2001
+++ selector.h	Thu Jan 13 16:47:36 2005
@@ -0,0 +1,69 @@
+/* selector */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This library 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 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
+ * Library 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.
+ */
+
+#ifndef WNCK_SELECTOR_H
+#define WNCK_SELECTOR_H
+
+#include <gtk/gtk.h>
+#include "screen.h"
+
+G_BEGIN_DECLS
+
+#define WNCK_TYPE_SELECTOR              (wnck_selector_get_type ())
+#define WNCK_SELECTOR(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), WNCK_TYPE_SELECTOR, WnckSelector))
+#define WNCK_SELECTOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), WNCK_TYPE_SELECTOR, WnckSelectorClass))
+#define WNCK_IS_SELECTOR(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), WNCK_TYPE_SELECTOR))
+#define WNCK_IS_SELECTOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), WNCK_TYPE_SELECTOR))
+#define WNCK_SELECTOR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), WNCK_TYPE_SELECTOR, WnckSelectorClass))
+
+typedef struct _WnckSelector        WnckSelector;
+typedef struct _WnckSelectorClass   WnckSelectorClass;
+typedef struct _WnckSelectorPrivate WnckSelectorPrivate;
+
+struct _WnckSelector
+{
+	GtkMenuBar parent_instance;
+	GtkWidget    *image;
+	GtkWidget    *menu;
+	GtkWidget    *menu_bar;
+	GtkWidget    *menu_item;
+	GtkWidget    *no_windows_item;
+
+	GdkPixbuf    *icon_pixbuf;
+	WnckWindow   *icon_window;
+	GHashTable   *window_hash;
+
+	int           size;
+	WnckScreen    *screen;
+};
+
+struct _WnckSelectorClass
+{
+  GtkMenuBarClass parent_class;
+};
+
+GtkWidget *wnck_selector_new (WnckScreen *screen);
+GType wnck_selector_get_type (void);
+
+
+G_END_DECLS
+
+#endif /* WNCK_SELECTOR_H */
