Commit 8dcb33ff authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Add a greeter panel bar with an embedded notification area.

2007-09-05  William Jon McCann  <mccann@jhu.edu>

	* configure.ac:
	* daemon/gdm-greeter-server.c: (handle_get_display_id):
	* gui/simple-greeter/Makefile.am:
	* gui/simple-greeter/cutnpaste/Makefile.am:
	* gui/simple-greeter/cutnpaste/fixedtip.c: (button_press_handler),
	(expose_handler), (na_fixed_tip_class_init), (na_fixed_tip_init),
	(na_fixed_tip_position), (na_fixed_tip_parent_size_allocated),
	(na_fixed_tip_parent_screen_changed), (na_fixed_tip_new),
	(na_fixed_tip_set_markup), (na_fixed_tip_set_orientation):
	* gui/simple-greeter/cutnpaste/fixedtip.h:
	* gui/simple-greeter/cutnpaste/na-marshal.list:
	* gui/simple-greeter/cutnpaste/na-tray-manager.c:
	(na_tray_manager_init), (na_tray_manager_class_init),
	(na_tray_manager_finalize), (na_tray_manager_set_property),
	(na_tray_manager_get_property), (na_tray_manager_new),
	(na_tray_manager_plug_removed),
	(na_tray_manager_make_socket_transparent),
	(na_tray_manager_socket_exposed),
	(na_tray_manager_socket_style_set),
	(na_tray_manager_handle_dock_request), (pending_message_free),
	(na_tray_manager_handle_client_message_message_data),
	(na_tray_manager_handle_begin_message),
	(na_tray_manager_handle_cancel_message),
	(na_tray_manager_handle_client_message_opcode),
	(na_tray_manager_window_filter),
	(na_tray_manager_selection_clear_event),
	(na_tray_manager_unmanage),
	(na_tray_manager_set_orientation_property),
	(na_tray_manager_manage_screen_x11),
	(na_tray_manager_manage_screen),
	(na_tray_manager_check_running_screen_x11),
	(na_tray_manager_check_running), (na_tray_manager_get_child_title),
	(na_tray_manager_set_orientation),
	(na_tray_manager_get_orientation):
	* gui/simple-greeter/cutnpaste/na-tray-manager.h:
	* gui/simple-greeter/cutnpaste/na-tray.c: (get_tray), (tray_added),
	(tray_removed), (icon_tip_buffer_free), (icon_tip_free),
	(icon_tip_buffer_compare), (icon_tip_show_next_clicked),
	(icon_tip_show_next_timeout), (icon_tip_show_next), (message_sent),
	(message_cancelled), (update_orientation_for_messages),
	(update_size_and_orientation), (na_tray_init),
	(na_tray_constructor), (na_tray_dispose), (na_tray_set_property),
	(na_tray_size_request), (na_tray_size_allocate),
	(na_tray_class_init), (na_tray_new_for_screen),
	(na_tray_set_orientation), (na_tray_get_orientation),
	(idle_redraw_cb), (na_tray_force_redraw):
	* gui/simple-greeter/cutnpaste/na-tray.h:
	* gui/simple-greeter/cutnpaste/obox.c: (na_obox_class_init),
	(na_obox_init), (na_obox_new), (get_class), (na_obox_size_request),
	(na_obox_size_allocate), (na_obox_set_orientation):
	* gui/simple-greeter/cutnpaste/obox.h:
	* gui/simple-greeter/cutnpaste/testtray.c: (do_add),
	(update_child_count), (tray_added_cb), (tray_removed_cb),
	(orientation_changed_cb), (maybe_quit),
	(warning_dialog_response_cb), (add_tray_cb),
	(create_tray_on_screen), (main):
	* gui/simple-greeter/gdm-greeter-panel.c:
	(gdm_greeter_panel_set_property), (gdm_greeter_panel_get_property),
	(gdm_greeter_panel_constructor), (gdm_greeter_panel_dispose),
	(gdm_greeter_panel_move_resize_window), (on_screen_size_changed),
	(gdm_greeter_panel_real_realize),
	(gdm_greeter_panel_real_unrealize), (get_outside_region),
	(get_monitor_geometry), (set_struts), (update_struts),
	(update_geometry), (gdm_greeter_panel_real_size_request),
	(gdm_greeter_panel_class_init), (gdm_greeter_panel_init),
	(gdm_greeter_panel_finalize), (gdm_greeter_panel_new):
	* gui/simple-greeter/gdm-greeter-panel.h:
	* gui/simple-greeter/gdm-simple-greeter.c: (set_sensitive),
	(set_message), (create_greeter), (create_panel),
	(gdm_simple_greeter_constructor):
	* gui/simple-greeter/gdm-simple-greeter.glade:
	* gui/simple-greeter/greeter-main.c: (get_display_id):
	* gui/simple-greeter/test-greeter-panel.c: (main):
	Add a greeter panel bar with an embedded notification area.


svn path=/branches/mccann-gobject/; revision=5229
parent 4aa2a587
2007-09-05 William Jon McCann <mccann@jhu.edu>
* configure.ac:
* daemon/gdm-greeter-server.c: (handle_get_display_id):
* gui/simple-greeter/Makefile.am:
* gui/simple-greeter/cutnpaste/Makefile.am:
* gui/simple-greeter/cutnpaste/fixedtip.c: (button_press_handler),
(expose_handler), (na_fixed_tip_class_init), (na_fixed_tip_init),
(na_fixed_tip_position), (na_fixed_tip_parent_size_allocated),
(na_fixed_tip_parent_screen_changed), (na_fixed_tip_new),
(na_fixed_tip_set_markup), (na_fixed_tip_set_orientation):
* gui/simple-greeter/cutnpaste/fixedtip.h:
* gui/simple-greeter/cutnpaste/na-marshal.list:
* gui/simple-greeter/cutnpaste/na-tray-manager.c:
(na_tray_manager_init), (na_tray_manager_class_init),
(na_tray_manager_finalize), (na_tray_manager_set_property),
(na_tray_manager_get_property), (na_tray_manager_new),
(na_tray_manager_plug_removed),
(na_tray_manager_make_socket_transparent),
(na_tray_manager_socket_exposed),
(na_tray_manager_socket_style_set),
(na_tray_manager_handle_dock_request), (pending_message_free),
(na_tray_manager_handle_client_message_message_data),
(na_tray_manager_handle_begin_message),
(na_tray_manager_handle_cancel_message),
(na_tray_manager_handle_client_message_opcode),
(na_tray_manager_window_filter),
(na_tray_manager_selection_clear_event),
(na_tray_manager_unmanage),
(na_tray_manager_set_orientation_property),
(na_tray_manager_manage_screen_x11),
(na_tray_manager_manage_screen),
(na_tray_manager_check_running_screen_x11),
(na_tray_manager_check_running), (na_tray_manager_get_child_title),
(na_tray_manager_set_orientation),
(na_tray_manager_get_orientation):
* gui/simple-greeter/cutnpaste/na-tray-manager.h:
* gui/simple-greeter/cutnpaste/na-tray.c: (get_tray), (tray_added),
(tray_removed), (icon_tip_buffer_free), (icon_tip_free),
(icon_tip_buffer_compare), (icon_tip_show_next_clicked),
(icon_tip_show_next_timeout), (icon_tip_show_next), (message_sent),
(message_cancelled), (update_orientation_for_messages),
(update_size_and_orientation), (na_tray_init),
(na_tray_constructor), (na_tray_dispose), (na_tray_set_property),
(na_tray_size_request), (na_tray_size_allocate),
(na_tray_class_init), (na_tray_new_for_screen),
(na_tray_set_orientation), (na_tray_get_orientation),
(idle_redraw_cb), (na_tray_force_redraw):
* gui/simple-greeter/cutnpaste/na-tray.h:
* gui/simple-greeter/cutnpaste/obox.c: (na_obox_class_init),
(na_obox_init), (na_obox_new), (get_class), (na_obox_size_request),
(na_obox_size_allocate), (na_obox_set_orientation):
* gui/simple-greeter/cutnpaste/obox.h:
* gui/simple-greeter/cutnpaste/testtray.c: (do_add),
(update_child_count), (tray_added_cb), (tray_removed_cb),
(orientation_changed_cb), (maybe_quit),
(warning_dialog_response_cb), (add_tray_cb),
(create_tray_on_screen), (main):
* gui/simple-greeter/gdm-greeter-panel.c:
(gdm_greeter_panel_set_property), (gdm_greeter_panel_get_property),
(gdm_greeter_panel_constructor), (gdm_greeter_panel_dispose),
(gdm_greeter_panel_move_resize_window), (on_screen_size_changed),
(gdm_greeter_panel_real_realize),
(gdm_greeter_panel_real_unrealize), (get_outside_region),
(get_monitor_geometry), (set_struts), (update_struts),
(update_geometry), (gdm_greeter_panel_real_size_request),
(gdm_greeter_panel_class_init), (gdm_greeter_panel_init),
(gdm_greeter_panel_finalize), (gdm_greeter_panel_new):
* gui/simple-greeter/gdm-greeter-panel.h:
* gui/simple-greeter/gdm-simple-greeter.c: (set_sensitive),
(set_message), (create_greeter), (create_panel),
(gdm_simple_greeter_constructor):
* gui/simple-greeter/gdm-simple-greeter.glade:
* gui/simple-greeter/greeter-main.c: (get_display_id):
* gui/simple-greeter/test-greeter-panel.c: (main):
Add a greeter panel bar with an embedded notification area.
2007-09-05 William Jon McCann <mccann@jhu.edu>
* daemon/gdm-factory-slave.c: (run_greeter):
......
......@@ -100,7 +100,7 @@ test_log_SOURCES = \
$(NULL)
test_log_LDADD = \
libgdmcommon.la \
libgdmcommon.la \
$(GLIB_LIBS) \
$(NULL)
......
......@@ -1306,6 +1306,7 @@ libgreeter/Makefile
gui/Makefile
gui/modules/Makefile
gui/simple-greeter/Makefile
gui/simple-greeter/cutnpaste/Makefile
gui/simple-chooser/Makefile
utils/Makefile
data/Makefile
......
......@@ -404,7 +404,7 @@ handle_get_display_id (GdmGreeterServer *greeter_server,
reply = dbus_message_new_method_return (message);
dbus_message_iter_init_append (reply, &iter);
dbus_message_iter_append_basic (&iter, DBUS_TYPE_G_OBJECT_PATH, &greeter_server->priv->display_id);
dbus_message_iter_append_basic (&iter, DBUS_TYPE_OBJECT_PATH, &greeter_server->priv->display_id);
dbus_connection_send (connection, reply, NULL);
dbus_message_unref (reply);
......
NULL =
SUBDIRS = \
cutnpaste \
$(NULL)
INCLUDES = \
-I$(top_srcdir)/common \
-I$(top_srcdir)/libgreeter \
-I$(top_srcdir)/gui/simple-greeter/cutnpaste \
-DAUTHDIR=\""$(authdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DGDMCONFDIR=\"$(gdmconfdir)\" \
......@@ -19,6 +24,21 @@ INCLUDES = \
$(GREETER_CFLAGS) \
$(NULL)
noinst_PROGRAMS = \
test-greeter-panel \
$(NULL)
test_greeter_panel_SOURCES = \
test-greeter-panel.c \
gdm-greeter-panel.h \
gdm-greeter-panel.c \
$(NULL)
test_greeter_panel_LDADD = \
$(top_builddir)/gui/simple-greeter/cutnpaste/libnotificationarea.la \
$(GUI_LIBS) \
$(NULL)
libexec_PROGRAMS = \
gdm-simple-greeter
......@@ -26,12 +46,15 @@ gdm_simple_greeter_SOURCES = \
greeter-main.c \
gdm-simple-greeter.c \
gdm-simple-greeter.h \
gdm-greeter-panel.h \
gdm-greeter-panel.c \
$(NULL)
gdm_simple_greeter_LDADD = \
$(EXTRA_GREETER_LIBS) \
-L$(top_builddir)/libgreeter \
-lgreeter \
$(top_builddir)/gui/simple-greeter/cutnpaste/libnotificationarea.la \
$(GLIB_LIBS) \
$(DBUS_LIBS) \
$(GOBJECT_LIBS) \
......
NULL =
INCLUDES = \
-I. \
-I.. \
-DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
-DLIBDIR=\"$(libdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DLOGDIR=\"$(logdir)\" \
-DPIXMAPDIR=\"$(pixmapdir)\" \
-DSBINDIR=\"$(sbindir)\" \
$(GUI_CFLAGS) \
$(NULL)
noinst_LTLIBRARIES = \
libnotificationarea.la \
$(NULL)
BUILT_SOURCES = \
na-marshal.c \
na-marshal.h \
$(NULL)
libnotificationarea_la_SOURCES = \
fixedtip.h \
fixedtip.c \
obox.c \
obox.h \
na-tray.c \
na-tray.h \
na-tray-manager.c \
na-tray-manager.h \
na-marshal.c \
na-marshal.h \
$(NULL)
libnotificationarea_la_LIBADD = \
$(GUI_LIBS) \
$(NULL)
libnotification_area_la_LDFLAGS = \
-export-dynamic \
$(NULL)
EXTRA_DIST = \
na-marshal.list \
$(NULL)
na-marshal.h: na-marshal.list $(GLIB_GENMARSHAL)
$(GLIB_GENMARSHAL) $< --header --prefix=_na_marshal > $@
na-marshal.c: na-marshal.list $(GLIB_GENMARSHAL)
echo "#include \"na-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) $< --body --prefix=_na_marshal >> $@
noinst_PROGRAMS = testtray
testtray_SOURCES = \
testtray.c \
$(NULL)
testtray_LDADD = \
libnotificationarea.la \
$(GUI_LIBS) \
$(NULL)
/* Metacity fixed tooltip routine */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003-2006 Vincent Untz
*
* 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
* 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.
*/
#include "fixedtip.h"
/* Signals */
enum
{
CLICKED,
LAST_SIGNAL
};
static guint fixedtip_signals[LAST_SIGNAL] = { 0 };
struct _NaFixedTipPrivate
{
GtkWidget *parent;
GtkWidget *label;
GtkOrientation orientation;
};
G_DEFINE_TYPE (NaFixedTip, na_fixed_tip, GTK_TYPE_WINDOW)
static gboolean
button_press_handler (GtkWidget *fixedtip,
GdkEventButton *event,
gpointer data)
{
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
g_signal_emit (fixedtip, fixedtip_signals[CLICKED], 0);
return FALSE;
}
static gboolean
expose_handler (GtkWidget *fixedtip)
{
GtkRequisition req;
gtk_widget_size_request (fixedtip, &req);
gtk_paint_flat_box (fixedtip->style, fixedtip->window,
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
NULL, fixedtip, "tooltip",
0, 0, req.width, req.height);
return FALSE;
}
static void
na_fixed_tip_class_init (NaFixedTipClass *class)
{
fixedtip_signals[CLICKED] =
g_signal_new ("clicked",
G_OBJECT_CLASS_TYPE (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NaFixedTipClass, clicked),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
g_type_class_add_private (class, sizeof (NaFixedTipPrivate));
}
/* Did you already see this code? Yes, it's gtk_tooltips_force_window() ;-) */
static void
na_fixed_tip_init (NaFixedTip *fixedtip)
{
GtkWidget *label;
fixedtip->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixedtip, NA_TYPE_FIXED_TIP,
NaFixedTipPrivate);
gtk_window_set_type_hint (GTK_WINDOW (fixedtip),
GDK_WINDOW_TYPE_HINT_TOOLTIP);
gtk_widget_set_app_paintable (GTK_WIDGET (fixedtip), TRUE);
gtk_window_set_resizable (GTK_WINDOW (fixedtip), FALSE);
gtk_widget_set_name (GTK_WIDGET (fixedtip), "gtk-tooltips");
gtk_container_set_border_width (GTK_CONTAINER (fixedtip), 4);
label = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (fixedtip), label);
fixedtip->priv->label = label;
g_signal_connect (fixedtip, "expose_event",
G_CALLBACK (expose_handler), NULL);
gtk_widget_add_events (GTK_WIDGET (fixedtip), GDK_BUTTON_PRESS_MASK);
g_signal_connect (fixedtip, "button_press_event",
G_CALLBACK (button_press_handler), NULL);
fixedtip->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
}
static void
na_fixed_tip_position (NaFixedTip *fixedtip)
{
GdkScreen *screen;
GtkRequisition req;
int root_x;
int root_y;
int parent_width;
int parent_height;
int screen_width;
int screen_height;
screen = gtk_widget_get_screen (fixedtip->priv->parent);
gtk_window_set_screen (GTK_WINDOW (fixedtip), screen);
gtk_widget_size_request (GTK_WIDGET (fixedtip), &req);
gdk_window_get_origin (fixedtip->priv->parent->window, &root_x, &root_y);
gdk_drawable_get_size (GDK_DRAWABLE (fixedtip->priv->parent->window),
&parent_width, &parent_height);
screen_width = gdk_screen_get_width (screen);
screen_height = gdk_screen_get_height (screen);
/* pad between panel and message window */
#define PAD 5
if (fixedtip->priv->orientation == GTK_ORIENTATION_VERTICAL)
{
if (root_x <= screen_width / 2)
root_x += parent_width + PAD;
else
root_x -= req.width + PAD;
}
else
{
if (root_y <= screen_height / 2)
root_y += parent_height + PAD;
else
root_y -= req.height + PAD;
}
/* Push onscreen */
if ((root_x + req.width) > screen_width)
root_x = screen_width - req.width;
if ((root_y + req.height) > screen_height)
root_y = screen_height - req.height;
gtk_window_move (GTK_WINDOW (fixedtip), root_x, root_y);
}
static void
na_fixed_tip_parent_size_allocated (GtkWidget *parent,
GtkAllocation *allocation,
NaFixedTip *fixedtip)
{
na_fixed_tip_position (fixedtip);
}
static void
na_fixed_tip_parent_screen_changed (GtkWidget *parent,
GdkScreen *new_screen,
NaFixedTip *fixedtip)
{
na_fixed_tip_position (fixedtip);
}
GtkWidget *
na_fixed_tip_new (GtkWidget *parent,
GtkOrientation orientation)
{
NaFixedTip *fixedtip;
g_return_val_if_fail (parent != NULL, NULL);
fixedtip = g_object_new (NA_TYPE_FIXED_TIP, NULL);
/* It doesn't work if we do this in na_fixed_tip_init(), so do it here */
GTK_WINDOW (fixedtip)->type = GTK_WINDOW_POPUP;
fixedtip->priv->parent = parent;
#if 0
//FIXME: would be nice to be able to get the toplevel for the tip, but this
//doesn't work
GtkWidget *toplevel;
toplevel = gtk_widget_get_toplevel (parent);
/*
if (toplevel && GTK_WIDGET_TOPLEVEL (toplevel) && GTK_IS_WINDOW (toplevel))
gtk_window_set_transient_for (GTK_WINDOW (fixedtip), GTK_WINDOW (toplevel));
*/
#endif
fixedtip->priv->orientation = orientation;
//FIXME: would be nice to move the tip when the notification area moves
g_signal_connect_object (parent, "size-allocate",
G_CALLBACK (na_fixed_tip_parent_size_allocated),
fixedtip, 0);
g_signal_connect_object (parent, "screen-changed",
G_CALLBACK (na_fixed_tip_parent_screen_changed),
fixedtip, 0);
na_fixed_tip_position (fixedtip);
return GTK_WIDGET (fixedtip);
}
void
na_fixed_tip_set_markup (GtkWidget *widget,
const char *markup_text)
{
NaFixedTip *fixedtip;
g_return_if_fail (NA_IS_FIXED_TIP (widget));
fixedtip = NA_FIXED_TIP (widget);
gtk_label_set_markup (GTK_LABEL (fixedtip->priv->label),
markup_text);
na_fixed_tip_position (fixedtip);
}
void
na_fixed_tip_set_orientation (GtkWidget *widget,
GtkOrientation orientation)
{
NaFixedTip *fixedtip;
g_return_if_fail (NA_IS_FIXED_TIP (widget));
fixedtip = NA_FIXED_TIP (widget);
if (orientation == fixedtip->priv->orientation)
return;
fixedtip->priv->orientation = orientation;
na_fixed_tip_position (fixedtip);
}
/* Fixed tooltip routine */
/*
* Copyright (C) 2001 Havoc Pennington, 2002 Red Hat Inc.
* Copyright (C) 2003-2006 Vincent Untz
*
* 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
* 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.
*/
#ifndef FIXED_TIP_H
#define FIXED_TIP_H
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define NA_TYPE_FIXED_TIP (na_fixed_tip_get_type ())
#define NA_FIXED_TIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_FIXED_TIP, NaFixedTip))
#define NA_FIXED_TIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_FIXED_TIP, NaFixedTipClass))
#define NA_IS_FIXED_TIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_FIXED_TIP))
#define NA_IS_FIXED_TIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_FIXED_TIP))
#define NA_FIXED_TIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_FIXED_TIP, NaFixedTipClass))
typedef struct _NaFixedTip NaFixedTip;
typedef struct _NaFixedTipPrivate NaFixedTipPrivate;
typedef struct _NaFixedTipClass NaFixedTipClass;
struct _NaFixedTip
{
GtkWindow parent_instance;
NaFixedTipPrivate *priv;
};
struct _NaFixedTipClass
{
GtkWindowClass parent_class;
void (* clicked) (NaFixedTip *fixedtip);
};
GType na_fixed_tip_get_type (void);
GtkWidget *na_fixed_tip_new (GtkWidget *parent,
GtkOrientation orientation);
void na_fixed_tip_set_markup (GtkWidget *widget,
const char *markup_text);
void na_fixed_tip_set_orientation (GtkWidget *widget,
GtkOrientation orientation);
G_END_DECLS
#endif /* FIXED_TIP_H */
VOID:OBJECT,OBJECT
VOID:OBJECT,STRING,LONG,LONG
VOID:OBJECT,LONG
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* na-tray-manager.h
* Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
* Copyright (C) 2003-2006 Vincent Untz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*
* Used to be: eggtraymanager.h
*/
#ifndef __NA_TRAY_MANAGER_H__
#define __NA_TRAY_MANAGER_H__
#include <gtk/gtkwidget.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
G_BEGIN_DECLS
#define NA_TYPE_TRAY_MANAGER (na_tray_manager_get_type ())
#define NA_TRAY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_TRAY_MANAGER, NaTrayManager))
#define NA_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_TRAY_MANAGER, NaTrayManagerClass))
#define NA_IS_TRAY_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_TRAY_MANAGER))
#define NA_IS_TRAY_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_TRAY_MANAGER))
#define NA_TRAY_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_TRAY_MANAGER, NaTrayManagerClass))
typedef struct _NaTrayManager NaTrayManager;
typedef struct _NaTrayManagerClass NaTrayManagerClass;
typedef struct _NaTrayManagerChild NaTrayManagerChild;
struct _NaTrayManager
{
GObject parent_instance;
#ifdef GDK_WINDOWING_X11
GdkAtom selection_atom;
Atom opcode_atom;
#endif
GtkWidget *invisible;
GdkScreen *screen;
GtkOrientation orientation;
GList *messages;
GHashTable *socket_table;
};
struct _NaTrayManagerClass
{
GObjectClass parent_class;
void (* tray_icon_added) (NaTrayManager *manager,
NaTrayManagerChild *child);
void (* tray_icon_removed) (NaTrayManager *manager,
NaTrayManagerChild *child);
void (* message_sent) (NaTrayManager *manager,
NaTrayManagerChild *child,
const gchar *message,
glong id,
glong timeout);
void (* message_cancelled) (NaTrayManager *manager,
NaTrayManagerChild *child,
glong id);
void (* lost_selection) (NaTrayManager *manager);
};
GType na_tray_manager_get_type (void);
gboolean na_tray_manager_check_running (GdkScreen *screen);
NaTrayManager *na_tray_manager_new (void);
gboolean na_tray_manager_manage_screen (NaTrayManager *manager,
GdkScreen *screen);
char *na_tray_manager_get_child_title (NaTrayManager *manager,
NaTrayManagerChild *child);
void na_tray_manager_set_orientation (NaTrayManager *manager,
GtkOrientation orientation);
GtkOrientation na_tray_manager_get_orientation (NaTrayManager *manager);
G_END_DECLS
#endif /* __NA_TRAY_MANAGER_H__ */
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* na-tray-tray.h
* Copyright (C) 2002 Anders Carlsson <andersca@gnu.org>
* Copyright (C) 2003-2006 Vincent Untz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*
* Used to be: eggtraytray.h
*/
#ifndef __NA_TRAY_H__
#define __NA_TRAY_H__
#include <gtk/gtkwidget.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
G_BEGIN_DECLS
#define NA_TYPE_TRAY (na_tray_get_type ())
#define NA_TRAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NA_TYPE_TRAY, NaTray))
#define NA_TRAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NA_TYPE_TRAY, NaTrayClass))
#define NA_IS_TRAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NA_TYPE_TRAY))
#define NA_IS_TRAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NA_TYPE_TRAY))
#define NA_TRAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NA_TYPE_TRAY, NaTrayClass))
typedef struct _NaTray NaTray;
typedef struct _NaTrayPrivate NaTrayPrivate;
typedef struct _NaTrayClass NaTrayClass;
typedef struct _NaTrayChild NaTrayChild;
struct _NaTray
{
GtkBin parent_instance;
NaTrayPrivate *priv;
};
struct _NaTrayClass
{
GtkBinClass parent_class;
};
GType na_tray_get_type (void);
NaTray *na_tray_new_for_screen (GdkScreen *screen,
GtkOrientation orientation);
void na_tray_set_orientation (NaTray *tray,
GtkOrientation orientation);
GtkOrientation na_tray_get_orientation (NaTray *tray);
void na_tray_force_redraw (NaTray *tray);
G_END_DECLS
#endif /* __NA_TRAY_H__ */
/* OBox Copyright (C) 2002 Red Hat Inc. based on GtkHBox */
/* GTK - The GIMP Toolkit