void   
awn_applet_simple_set_icon_info (AwnAppletSimple  *applet,
                                 GStrv            states,
                                 GStrv            icon_names)
{
  gchar *applet_name=NULL;
  
  g_return_if_fail (AWN_IS_APPLET_SIMPLE (applet));
  g_return_if_fail (states);
  g_return_if_fail (icon_names);

  g_object_get (applet,
                "canonical-name",&applet_name,
                NULL);  
  g_return_if_fail (applet_name);
  applet->priv->last_set_icon = ICON_THEMED_MANY;
  awn_themed_icon_set_size (AWN_THEMED_ICON (applet->priv->icon),
                            awn_applet_get_size (AWN_APPLET (applet)));
  awn_themed_icon_set_info (AWN_THEMED_ICON (applet->priv->icon),
                            applet_name,
                            awn_applet_get_uid (AWN_APPLET (applet)),
                            states,
                            icon_names);
  g_free (applet_name);
}
Пример #2
0
static void
cairo_main_icon_constructed (GObject *object)
{
  CairoMainIconPrivate * priv = GET_PRIVATE (object);
  GdkPixbuf * pbuf;
  gint size = awn_applet_get_size (priv->applet);
  G_OBJECT_CLASS (cairo_main_icon_parent_class)->constructed (object);

  awn_themed_icon_set_info_simple (AWN_THEMED_ICON(object),"cairo-menu",awn_applet_get_uid (priv->applet),"gnome-main-menu");
  awn_themed_icon_set_size (AWN_THEMED_ICON (object),size);

  gtk_drag_dest_set (GTK_WIDGET (object),
                       GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
                       drop_types, n_drop_types,
                       GDK_ACTION_COPY | GDK_ACTION_ASK);
  /* call our function in the module */

  priv->menu_instance = get_menu_instance (priv->applet,
                                          (GetRunCmdFunc)cairo_menu_applet_get_run_cmd,
                                          (GetSearchCmdFunc)cairo_menu_applet_get_search_cmd,
                                          (AddIconFunc) cairo_menu_applet_add_icon,
                                          (CheckMenuHiddenFunc) cairo_menu_applet_check_hidden_menu,
                                          NULL,
                                          0);

  g_idle_add ( (GSourceFunc)queue_menu_build, object);
  awn_icon_set_tooltip_text (AWN_ICON (object), _("Main Menu"));
}
void
awn_applet_simple_set_icon_name (AwnAppletSimple  *applet,
                                 const gchar      *icon_name)
{
  gchar *applet_name;  
  
  g_return_if_fail (AWN_IS_APPLET_SIMPLE (applet));
  g_return_if_fail (icon_name);

  g_object_get (applet,
                "canonical-name",&applet_name,
                NULL);

  g_return_if_fail (applet_name);

  applet->priv->last_set_icon = ICON_THEMED_SIMPLE;
  awn_themed_icon_set_size (AWN_THEMED_ICON (applet->priv->icon),
                            awn_applet_get_size (AWN_APPLET (applet)));  
  awn_themed_icon_set_info_simple (AWN_THEMED_ICON (applet->priv->icon),
                                   applet_name,
                                   awn_applet_get_uid (AWN_APPLET (applet)),
                                   icon_name);
  g_free (applet_name);
}