Logo Search packages:      
Sourcecode: mail-notification version File versions

mn-mail-icon.c

/* Generated by GOB (v2.0.11) on Sun Mar  6 22:34:27 2005
   (do not edit directly) */

/* End world hunger, donate to the World Food Programme, http://www.wfp.org */

#define GOB_VERSION_MAJOR 2
#define GOB_VERSION_MINOR 0
#define GOB_VERSION_PATCHLEVEL 11

#define selfp (self->_priv)

#include <string.h> /* memset() */

#include "mn-mail-icon.h"

#include "mn-mail-icon-private.h"

#ifdef G_LIKELY
#define ___GOB_LIKELY(expr) G_LIKELY(expr)
#define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
#else /* ! G_LIKELY */
#define ___GOB_LIKELY(expr) (expr)
#define ___GOB_UNLIKELY(expr) (expr)
#endif /* G_LIKELY */

#line 31 "mn-mail-icon.gob"

#include "config.h"
#include <gdk/gdkkeysyms.h>
#include <gnome.h>
#include "mn-stock.h"
#include "mn-util.h"

#line 35 "mn-mail-icon.c"
/* self casting macros */
#define SELF(x) MN_MAIL_ICON(x)
#define SELF_CONST(x) MN_MAIL_ICON_CONST(x)
#define IS_SELF(x) MN_IS_MAIL_ICON(x)
#define TYPE_SELF MN_TYPE_MAIL_ICON
#define SELF_CLASS(x) MN_MAIL_ICON_CLASS(x)

#define SELF_GET_CLASS(x) MN_MAIL_ICON_GET_CLASS(x)

/* self typedefs */
typedef MNMailIcon Self;
typedef MNMailIconClass SelfClass;

/* here are local prototypes */
static void mn_mail_icon_activate (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_main_window (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_mail_reader (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_update (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_properties (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_help (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_about (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_activate_remove (MNMailIcon * self) G_GNUC_UNUSED;
static void mn_mail_icon_class_init (MNMailIconClass * class) G_GNUC_UNUSED;
static void mn_mail_icon_init (MNMailIcon * self) G_GNUC_UNUSED;
static gboolean mn_mail_icon_show_help_h (GtkWidget * widget, GtkWidgetHelpType help_type, gpointer user_data) G_GNUC_UNUSED;
static gboolean mn_mail_icon_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data) G_GNUC_UNUSED;
static gboolean mn_mail_icon_button_release_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data) G_GNUC_UNUSED;
static gboolean mn_mail_icon_popup_menu_h (GtkWidget * widget, gpointer user_data) G_GNUC_UNUSED;
static void mn_mail_icon_popup_menu_position_cb (GtkMenu * menu, int * x, int * y, gboolean * push_in, gpointer user_data) G_GNUC_UNUSED;

/*
 * Signal connection wrapper macro shortcuts
 */
#define self_connect__activate(object,func,data)      mn_mail_icon_connect__activate((object),(func),(data))
#define self_connect_after__activate(object,func,data)      mn_mail_icon_connect_after__activate((object),(func),(data))
#define self_connect_data__activate(object,func,data,destroy_data,flags)      mn_mail_icon_connect_data__activate((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_main_window(object,func,data)      mn_mail_icon_connect__activate_main_window((object),(func),(data))
#define self_connect_after__activate_main_window(object,func,data)      mn_mail_icon_connect_after__activate_main_window((object),(func),(data))
#define self_connect_data__activate_main_window(object,func,data,destroy_data,flags)      mn_mail_icon_connect_data__activate_main_window((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_mail_reader(object,func,data)      mn_mail_icon_connect__activate_mail_reader((object),(func),(data))
#define self_connect_after__activate_mail_reader(object,func,data)      mn_mail_icon_connect_after__activate_mail_reader((object),(func),(data))
#define self_connect_data__activate_mail_reader(object,func,data,destroy_data,flags)      mn_mail_icon_connect_data__activate_mail_reader((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_update(object,func,data)     mn_mail_icon_connect__activate_update((object),(func),(data))
#define self_connect_after__activate_update(object,func,data)     mn_mail_icon_connect_after__activate_update((object),(func),(data))
#define self_connect_data__activate_update(object,func,data,destroy_data,flags)     mn_mail_icon_connect_data__activate_update((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_properties(object,func,data) mn_mail_icon_connect__activate_properties((object),(func),(data))
#define self_connect_after__activate_properties(object,func,data) mn_mail_icon_connect_after__activate_properties((object),(func),(data))
#define self_connect_data__activate_properties(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_properties((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_help(object,func,data) mn_mail_icon_connect__activate_help((object),(func),(data))
#define self_connect_after__activate_help(object,func,data) mn_mail_icon_connect_after__activate_help((object),(func),(data))
#define self_connect_data__activate_help(object,func,data,destroy_data,flags) mn_mail_icon_connect_data__activate_help((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_about(object,func,data)      mn_mail_icon_connect__activate_about((object),(func),(data))
#define self_connect_after__activate_about(object,func,data)      mn_mail_icon_connect_after__activate_about((object),(func),(data))
#define self_connect_data__activate_about(object,func,data,destroy_data,flags)      mn_mail_icon_connect_data__activate_about((object),(func),(data),(destroy_data),(flags))
#define self_connect__activate_remove(object,func,data)     mn_mail_icon_connect__activate_remove((object),(func),(data))
#define self_connect_after__activate_remove(object,func,data)     mn_mail_icon_connect_after__activate_remove((object),(func),(data))
#define self_connect_data__activate_remove(object,func,data,destroy_data,flags)     mn_mail_icon_connect_data__activate_remove((object),(func),(data),(destroy_data),(flags))

enum {
      ACTIVATE_SIGNAL,
      ACTIVATE_MAIN_WINDOW_SIGNAL,
      ACTIVATE_MAIL_READER_SIGNAL,
      ACTIVATE_UPDATE_SIGNAL,
      ACTIVATE_PROPERTIES_SIGNAL,
      ACTIVATE_HELP_SIGNAL,
      ACTIVATE_ABOUT_SIGNAL,
      ACTIVATE_REMOVE_SIGNAL,
      LAST_SIGNAL
};

static guint object_signals[LAST_SIGNAL] = {0};

/* pointer to the class of our parent */
static EggTrayIconClass *parent_class = NULL;

/* Short form macros */
#define self_activate mn_mail_icon_activate
#define self_activate_main_window mn_mail_icon_activate_main_window
#define self_activate_mail_reader mn_mail_icon_activate_mail_reader
#define self_activate_update mn_mail_icon_activate_update
#define self_activate_properties mn_mail_icon_activate_properties
#define self_activate_help mn_mail_icon_activate_help
#define self_activate_about mn_mail_icon_activate_about
#define self_activate_remove mn_mail_icon_activate_remove
#define self_show_help_h mn_mail_icon_show_help_h
#define self_button_press_event_h mn_mail_icon_button_press_event_h
#define self_button_release_event_h mn_mail_icon_button_release_event_h
#define self_popup_menu_h mn_mail_icon_popup_menu_h
#define self_popup_menu_position_cb mn_mail_icon_popup_menu_position_cb
#define self_set_tip_widget mn_mail_icon_set_tip_widget
#define self_new mn_mail_icon_new
GType
mn_mail_icon_get_type (void)
{
      static GType type = 0;

      if ___GOB_UNLIKELY(type == 0) {
            static const GTypeInfo info = {
                  sizeof (MNMailIconClass),
                  (GBaseInitFunc) NULL,
                  (GBaseFinalizeFunc) NULL,
                  (GClassInitFunc) mn_mail_icon_class_init,
                  (GClassFinalizeFunc) NULL,
                  NULL /* class_data */,
                  sizeof (MNMailIcon),
                  0 /* n_preallocs */,
                  (GInstanceInitFunc) mn_mail_icon_init,
                  NULL
            };

            type = g_type_register_static (EGG_TYPE_TRAY_ICON, "MNMailIcon", &info, (GTypeFlags)0);
      }

      return type;
}

/* a macro for creating a new object of our type */
#define GET_NEW ((MNMailIcon *)g_object_new(mn_mail_icon_get_type(), NULL))

/* a function for creating a new object of our type */
#include <stdarg.h>
static MNMailIcon * GET_NEW_VARG (const char *first, ...) G_GNUC_UNUSED;
static MNMailIcon *
GET_NEW_VARG (const char *first, ...)
{
      MNMailIcon *ret;
      va_list ap;
      va_start (ap, first);
      ret = (MNMailIcon *)g_object_new_valist (mn_mail_icon_get_type (), first, ap);
      va_end (ap);
      return ret;
}


static void
___dispose (GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::dispose"
      MNMailIcon *self G_GNUC_UNUSED = MN_MAIL_ICON (obj_self);
      if (G_OBJECT_CLASS (parent_class)->dispose) \
            (* G_OBJECT_CLASS (parent_class)->dispose) (obj_self);
#line 41 "mn-mail-icon.gob"
      if(self->_priv->tooltips) { g_object_unref ((gpointer) self->_priv->tooltips); self->_priv->tooltips = NULL; }
#line 179 "mn-mail-icon.c"
}
#undef __GOB_FUNCTION__


static void
___finalize(GObject *obj_self)
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::finalize"
      MNMailIcon *self G_GNUC_UNUSED = MN_MAIL_ICON (obj_self);
      gpointer priv G_GNUC_UNUSED = self->_priv;
      if(G_OBJECT_CLASS(parent_class)->finalize) \
            (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
#line 45 "mn-mail-icon.gob"
      if(self->_priv->menu) { gtk_widget_destroy ((gpointer) self->_priv->menu); self->_priv->menu = NULL; }
#line 194 "mn-mail-icon.c"
}
#undef __GOB_FUNCTION__

#line 66 "mn-mail-icon.gob"
static void 
mn_mail_icon_class_init (MNMailIconClass * class G_GNUC_UNUSED)
#line 201 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::class_init"
      GObjectClass *g_object_class G_GNUC_UNUSED = (GObjectClass*) class;

      g_type_class_add_private(class,sizeof(MNMailIconPrivate));

      parent_class = g_type_class_ref (EGG_TYPE_TRAY_ICON);

      object_signals[ACTIVATE_SIGNAL] =
            g_signal_new ("activate",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_MAIN_WINDOW_SIGNAL] =
            g_signal_new ("activate_main_window",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_main_window),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_MAIL_READER_SIGNAL] =
            g_signal_new ("activate_mail_reader",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_mail_reader),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_UPDATE_SIGNAL] =
            g_signal_new ("activate_update",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_update),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_PROPERTIES_SIGNAL] =
            g_signal_new ("activate_properties",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_properties),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_HELP_SIGNAL] =
            g_signal_new ("activate_help",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_help),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_ABOUT_SIGNAL] =
            g_signal_new ("activate_about",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_about),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
      object_signals[ACTIVATE_REMOVE_SIGNAL] =
            g_signal_new ("activate_remove",
                  G_TYPE_FROM_CLASS (g_object_class),
                  (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
                  G_STRUCT_OFFSET (MNMailIconClass, activate_remove),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);

      class->activate = NULL;
      class->activate_main_window = NULL;
      class->activate_mail_reader = NULL;
      class->activate_update = NULL;
      class->activate_properties = NULL;
      class->activate_help = NULL;
      class->activate_about = NULL;
      class->activate_remove = NULL;
      g_object_class->dispose = ___dispose;
      g_object_class->finalize = ___finalize;
 {
#line 67 "mn-mail-icon.gob"

    GtkBindingSet *binding_set;

    binding_set = gtk_binding_set_by_class(class);

    /* HIG 2.0 key bindings */

    gtk_binding_entry_add_signal(binding_set, GDK_space, 0, "activate", 0);

    gtk_binding_entry_add_signal(binding_set, GDK_Return, GDK_MOD1_MASK, "activate-properties", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_ISO_Enter, GDK_MOD1_MASK, "activate-properties", 0);
    gtk_binding_entry_add_signal(binding_set, GDK_KP_Enter, GDK_MOD1_MASK, "activate-properties", 0);
  
#line 300 "mn-mail-icon.c"
 }
}
#undef __GOB_FUNCTION__
#line 81 "mn-mail-icon.gob"
static void 
mn_mail_icon_init (MNMailIcon * self G_GNUC_UNUSED)
#line 307 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::init"
      self->_priv = G_TYPE_INSTANCE_GET_PRIVATE(self,TYPE_SELF,MNMailIconPrivate);
#line 41 "mn-mail-icon.gob"
      self->_priv->tooltips = mn_tooltips_new();
#line 313 "mn-mail-icon.c"
#line 43 "mn-mail-icon.gob"
      self->image = mn_blinking_image_new_from_stock(MN_STOCK_MAIL, GTK_ICON_SIZE_LARGE_TOOLBAR);
#line 316 "mn-mail-icon.c"
#line 45 "mn-mail-icon.gob"
      self->_priv->menu = gtk_menu_new();
#line 319 "mn-mail-icon.c"
 {
#line 82 "mn-mail-icon.gob"

    GtkMenuShell *shell;
    GtkWidget *main_window_item;
    GtkWidget *properties_item;
    GtkWidget *help_item;
    GtkWidget *about_item;
    GtkWidget *remove_item;
    
    shell = GTK_MENU_SHELL(selfp->menu);
    main_window_item = mn_menu_shell_append(shell, MN_STOCK_MAIN_WINDOW, _("Main _Window"));
    self->mail_reader_item = mn_menu_shell_append(shell, MN_STOCK_MAIL_READER, _("_Mail Reader"));
    self->update_item = mn_menu_shell_append(shell, GTK_STOCK_REFRESH, _("_Update"));
    mn_menu_shell_append(shell, NULL, NULL);
    properties_item = mn_menu_shell_append(shell, GTK_STOCK_PROPERTIES, NULL);
    help_item = mn_menu_shell_append(shell, GTK_STOCK_HELP, NULL);
    about_item = mn_menu_shell_append(shell, GNOME_STOCK_ABOUT, NULL);
    mn_menu_shell_append(shell, NULL, NULL);
    remove_item = mn_menu_shell_append(shell, GTK_STOCK_REMOVE, _("R_emove From Notification Area"));
    
    g_signal_connect_swapped(main_window_item, "activate", G_CALLBACK(self_activate_main_window), self);
    g_signal_connect_swapped(self->mail_reader_item, "activate", G_CALLBACK(self_activate_mail_reader), self);
    g_signal_connect_swapped(self->update_item, "activate", G_CALLBACK(self_activate_update), self);
    g_signal_connect_swapped(properties_item, "activate", G_CALLBACK(self_activate_properties), self);
    g_signal_connect_swapped(help_item, "activate", G_CALLBACK(self_activate_help), self);
    g_signal_connect_swapped(about_item, "activate", G_CALLBACK(self_activate_about), self);
    g_signal_connect_swapped(remove_item, "activate", G_CALLBACK(self_activate_remove), self);

    selfp->event_box = gtk_event_box_new();
    GTK_WIDGET_SET_FLAGS(selfp->event_box, GTK_CAN_FOCUS);
    gtk_event_box_set_visible_window(GTK_EVENT_BOX(selfp->event_box), FALSE);
    mn_setup_dnd(selfp->event_box);

    gtk_container_add(GTK_CONTAINER(selfp->event_box), self->image);
    gtk_container_add(GTK_CONTAINER(self), selfp->event_box);
  
    g_object_connect(selfp->event_box,
                 "signal::show-help", self_show_help_h, self,
                 "signal::button-press-event", self_button_press_event_h, self,
                 "signal::button-release-event", self_button_release_event_h, self,
                 "signal::popup-menu", self_popup_menu_h, self,
                 NULL);

    gtk_widget_show(self->image);
    gtk_widget_show(selfp->event_box);
  
#line 367 "mn-mail-icon.c"
 }
}
#undef __GOB_FUNCTION__

#line 49 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate (MNMailIcon * self)
#line 375 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 49 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 49 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 387 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 51 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_main_window (MNMailIcon * self)
#line 404 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 51 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 51 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 416 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_MAIN_WINDOW_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 53 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_mail_reader (MNMailIcon * self)
#line 433 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 53 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 53 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 445 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_MAIL_READER_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 55 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_update (MNMailIcon * self)
#line 462 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 55 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 55 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 474 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_UPDATE_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 57 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_properties (MNMailIcon * self)
#line 491 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 57 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 57 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 503 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_PROPERTIES_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 59 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_help (MNMailIcon * self)
#line 520 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 59 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 59 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 532 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_HELP_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 61 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_about (MNMailIcon * self)
#line 549 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 61 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 61 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 561 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_ABOUT_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}

#line 63 "mn-mail-icon.gob"
static void 
mn_mail_icon_activate_remove (MNMailIcon * self)
#line 578 "mn-mail-icon.c"
{
      GValue ___param_values[1];
      GValue ___return_val;

memset (&___return_val, 0, sizeof (___return_val));
memset (&___param_values, 0, sizeof (___param_values));

#line 63 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 63 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 590 "mn-mail-icon.c"

      ___param_values[0].g_type = 0;
      g_value_init (&___param_values[0], G_TYPE_FROM_INSTANCE (self));
      g_value_set_instance (&___param_values[0], (gpointer) self);

      g_signal_emitv (___param_values,
            object_signals[ACTIVATE_REMOVE_SIGNAL],
            0 /* detail */,
            &___return_val);

      g_value_unset (&___param_values[0]);
}



#line 128 "mn-mail-icon.gob"
static gboolean 
mn_mail_icon_show_help_h (GtkWidget * widget, GtkWidgetHelpType help_type, gpointer user_data)
#line 609 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::show_help_h"
#line 128 "mn-mail-icon.gob"
      g_return_val_if_fail (widget != NULL, (gboolean )0);
#line 128 "mn-mail-icon.gob"
      g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
#line 616 "mn-mail-icon.c"
{
#line 132 "mn-mail-icon.gob"
      
    if (help_type == GTK_WIDGET_HELP_TOOLTIP)
      {
      mn_tooltips_toggle_keyboard_mode(widget);
      return TRUE;
      }
    else
      return FALSE;
  }}
#line 628 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

#line 142 "mn-mail-icon.gob"
static gboolean 
mn_mail_icon_button_press_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
#line 634 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::button_press_event_h"
#line 142 "mn-mail-icon.gob"
      g_return_val_if_fail (widget != NULL, (gboolean )0);
#line 142 "mn-mail-icon.gob"
      g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
#line 142 "mn-mail-icon.gob"
      g_return_val_if_fail (event != NULL, (gboolean )0);
#line 142 "mn-mail-icon.gob"
      g_return_val_if_fail (user_data != NULL, (gboolean )0);
#line 645 "mn-mail-icon.c"
{
#line 146 "mn-mail-icon.gob"
      
    Self *self = user_data;

    if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
      self_activate(self);
    else if (event->button == 3)
      {
      gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, self_popup_menu_position_cb, self, event->button, event->time);
      return TRUE;            /* do not propagate event */
      }

    return FALSE;       /* propagate event */
  }}
#line 661 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

#line 160 "mn-mail-icon.gob"
static gboolean 
mn_mail_icon_button_release_event_h (GtkWidget * widget, GdkEventButton * event, gpointer user_data)
#line 667 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::button_release_event_h"
#line 160 "mn-mail-icon.gob"
      g_return_val_if_fail (widget != NULL, (gboolean )0);
#line 160 "mn-mail-icon.gob"
      g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
#line 160 "mn-mail-icon.gob"
      g_return_val_if_fail (event != NULL, (gboolean )0);
#line 160 "mn-mail-icon.gob"
      g_return_val_if_fail (user_data != NULL, (gboolean )0);
#line 678 "mn-mail-icon.c"
{
#line 164 "mn-mail-icon.gob"
      
    Self *self = user_data;

    if (event->button == 3)
      {
      gtk_menu_popdown(GTK_MENU(selfp->menu));
      return TRUE;            /* do not propagate event */
      }
    
    return FALSE;       /* propagate event */
  }}
#line 692 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

#line 176 "mn-mail-icon.gob"
static gboolean 
mn_mail_icon_popup_menu_h (GtkWidget * widget, gpointer user_data)
#line 698 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::popup_menu_h"
#line 176 "mn-mail-icon.gob"
      g_return_val_if_fail (widget != NULL, (gboolean )0);
#line 176 "mn-mail-icon.gob"
      g_return_val_if_fail (GTK_IS_WIDGET (widget), (gboolean )0);
#line 176 "mn-mail-icon.gob"
      g_return_val_if_fail (user_data != NULL, (gboolean )0);
#line 707 "mn-mail-icon.c"
{
#line 179 "mn-mail-icon.gob"
      
    Self *self = user_data;

    gtk_menu_popup(GTK_MENU(selfp->menu), NULL, NULL, self_popup_menu_position_cb, self, 0, gtk_get_current_event_time());
    gtk_menu_shell_select_first(GTK_MENU_SHELL(selfp->menu), FALSE);

    return TRUE;        /* a menu was activated */
  }}
#line 718 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

#line 188 "mn-mail-icon.gob"
static void 
mn_mail_icon_popup_menu_position_cb (GtkMenu * menu, int * x, int * y, gboolean * push_in, gpointer user_data)
#line 724 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::popup_menu_position_cb"
#line 188 "mn-mail-icon.gob"
      g_return_if_fail (menu != NULL);
#line 188 "mn-mail-icon.gob"
      g_return_if_fail (GTK_IS_MENU (menu));
#line 188 "mn-mail-icon.gob"
      g_return_if_fail (x != NULL);
#line 188 "mn-mail-icon.gob"
      g_return_if_fail (y != NULL);
#line 188 "mn-mail-icon.gob"
      g_return_if_fail (push_in != NULL);
#line 188 "mn-mail-icon.gob"
      g_return_if_fail (user_data != NULL);
#line 739 "mn-mail-icon.c"
{
#line 194 "mn-mail-icon.gob"
      
    GtkWidget *widget = user_data;

    gdk_window_get_origin(widget->window, x, y);

    *x += widget->allocation.x;
    *y += widget->allocation.y;

    if (*y > gdk_screen_get_height(gtk_widget_get_screen(widget)) / 2)
      {
      GtkRequisition req;
      
      gtk_widget_size_request(GTK_WIDGET(menu), &req);
      *y -= req.height;
      }
    else
      *y += widget->allocation.height;

    *push_in = TRUE;
  }}
#line 762 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

#line 215 "mn-mail-icon.gob"
void 
mn_mail_icon_set_tip_widget (MNMailIcon * self, GtkWidget * tip_widget)
#line 768 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::set_tip_widget"
#line 215 "mn-mail-icon.gob"
      g_return_if_fail (self != NULL);
#line 215 "mn-mail-icon.gob"
      g_return_if_fail (MN_IS_MAIL_ICON (self));
#line 775 "mn-mail-icon.c"
{
#line 217 "mn-mail-icon.gob"
      
    mn_tooltips_set_tip_widget(selfp->tooltips, selfp->event_box, tip_widget);
  }}
#line 781 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

#line 221 "mn-mail-icon.gob"
GtkWidget * 
mn_mail_icon_new (void)
#line 787 "mn-mail-icon.c"
{
#define __GOB_FUNCTION__ "MN:Mail:Icon::new"
{
#line 223 "mn-mail-icon.gob"
      
    return GTK_WIDGET(GET_NEW_VARG("title", _("Mail Notification"), NULL));
  }}
#line 795 "mn-mail-icon.c"
#undef __GOB_FUNCTION__

Generated by  Doxygen 1.6.0   Back to index