/* * Public API */ StatusIcon * status_icon_new (Ekiga::ServiceCore & core) { StatusIcon *self = NULL; if (!statusicon_should_run ()) return self; boost::signals::connection conn; self = STATUSICON (g_object_new (STATUSICON_TYPE, NULL)); self->priv = new StatusIconPrivate; self->priv->popup_menu = statusicon_build_menu (); g_object_ref_sink (self->priv->popup_menu); self->priv->has_message = FALSE; self->priv->blink_id = -1; self->priv->blinking = false; self->priv->blink_image = NULL; self->priv->unread_messages = false; boost::shared_ptr<Ekiga::PersonalDetails> details = core.get<Ekiga::PersonalDetails> ("personal-details"); boost::shared_ptr<Ekiga::CallCore> call_core = core.get<Ekiga::CallCore> ("call-core"); boost::shared_ptr<Ekiga::NotificationCore> notification_core = core.get<Ekiga::NotificationCore> ("notification-core"); boost::shared_ptr<GtkFrontend> frontend = core.get<GtkFrontend> ("gtk-frontend"); self->priv->frontend = frontend; GtkWidget *chat_window = GTK_WIDGET (frontend->get_chat_window ()); statusicon_set_status (self, details->get_presence ()); notification_core->notification_added.connect (boost::bind (statusicon_on_notification_added, _1, (gpointer) self)); conn = details->updated.connect (boost::bind (&personal_details_updated_cb, self, details)); self->priv->connections.add (conn); conn = call_core->established_call.connect (boost::bind (&established_call_cb, _1, _2, (gpointer) self)); self->priv->connections.add (conn); conn = call_core->cleared_call.connect (boost::bind (&cleared_call_cb, _1, _2, _3, (gpointer) self)); self->priv->connections.add (conn); g_signal_connect (self, "popup-menu", G_CALLBACK (show_popup_menu_cb), self->priv->popup_menu); g_signal_connect (self, "activate", G_CALLBACK (statusicon_activated_cb), self); g_signal_connect (chat_window, "unread-count", G_CALLBACK (unread_count_cb), self); return self; }
/* * Public API */ StatusIcon * status_icon_new (GmApplication *app) { StatusIcon *self = NULL; g_return_val_if_fail (GM_IS_APPLICATION (app), NULL); if (!statusicon_should_run ()) return self; Ekiga::ServiceCore& core = gm_application_get_core (app); boost::signals2::connection conn; self = STATUSICON (g_object_new (STATUSICON_TYPE, NULL)); self->priv = new StatusIconPrivate; self->priv->has_message = FALSE; self->priv->blink_id = -1; self->priv->blinking = false; self->priv->blink_image = NULL; self->priv->unread_messages = false; self->priv->app = app; boost::shared_ptr<Ekiga::PersonalDetails> details = core.get<Ekiga::PersonalDetails> ("personal-details"); boost::shared_ptr<Ekiga::CallCore> call_core = core.get<Ekiga::CallCore> ("call-core"); boost::shared_ptr<Ekiga::NotificationCore> notification_core = core.get<Ekiga::NotificationCore> ("notification-core"); self->priv->chat_window = gm_application_get_chat_window (app); statusicon_set_status (self, details->get_presence ()); notification_core->notification_added.connect (boost::bind (statusicon_on_notification_added, _1, (gpointer) self)); conn = details->updated.connect (boost::bind (&personal_details_updated_cb, self, details)); self->priv->connections.add (conn); conn = call_core->established_call.connect (boost::bind (&established_call_cb, _1, (gpointer) self)); self->priv->connections.add (conn); conn = call_core->cleared_call.connect (boost::bind (&cleared_call_cb, _1, _2, (gpointer) self)); self->priv->connections.add (conn); g_signal_connect (self, "activate", G_CALLBACK (statusicon_activated_cb), self); if (self->priv->chat_window) g_signal_connect (self->priv->chat_window, "unread-count", G_CALLBACK (unread_count_cb), self); g_signal_connect (self, "clicked", G_CALLBACK (status_icon_clicked_cb), self); return self; }