Logo Search packages:      
Sourcecode: unity version File versions  Download package

panel-indicators.c

/* panel-indicators.c generated by valac, the Vala compiler
 * generated from panel-indicators.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
 * Copyright (C) 2010 Canonical Ltd
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
 *
 */

#include <glib.h>
#include <glib-object.h>
#include <clutk/clutk.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>
#include <libindicator/indicator-object.h>
#include <clutter/clutter.h>
#include <libindicator/indicator.h>
#include <libindicator/indicator-service.h>
#include <libindicator/indicator-service-manager.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixdata.h>


#define UNITY_PANEL_INDICATORS_TYPE_VIEW (unity_panel_indicators_view_get_type ())
#define UNITY_PANEL_INDICATORS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PANEL_INDICATORS_TYPE_VIEW, UnityPanelIndicatorsView))
#define UNITY_PANEL_INDICATORS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PANEL_INDICATORS_TYPE_VIEW, UnityPanelIndicatorsViewClass))
#define UNITY_PANEL_INDICATORS_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PANEL_INDICATORS_TYPE_VIEW))
#define UNITY_PANEL_INDICATORS_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PANEL_INDICATORS_TYPE_VIEW))
#define UNITY_PANEL_INDICATORS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PANEL_INDICATORS_TYPE_VIEW, UnityPanelIndicatorsViewClass))

typedef struct _UnityPanelIndicatorsView UnityPanelIndicatorsView;
typedef struct _UnityPanelIndicatorsViewClass UnityPanelIndicatorsViewClass;
typedef struct _UnityPanelIndicatorsViewPrivate UnityPanelIndicatorsViewPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define UNITY_TESTING_TYPE_OBJECT_REGISTRY (unity_testing_object_registry_get_type ())
#define UNITY_TESTING_OBJECT_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TESTING_TYPE_OBJECT_REGISTRY, UnityTestingObjectRegistry))
#define UNITY_TESTING_OBJECT_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TESTING_TYPE_OBJECT_REGISTRY, UnityTestingObjectRegistryClass))
#define UNITY_TESTING_IS_OBJECT_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TESTING_TYPE_OBJECT_REGISTRY))
#define UNITY_TESTING_IS_OBJECT_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TESTING_TYPE_OBJECT_REGISTRY))
#define UNITY_TESTING_OBJECT_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TESTING_TYPE_OBJECT_REGISTRY, UnityTestingObjectRegistryClass))

typedef struct _UnityTestingObjectRegistry UnityTestingObjectRegistry;
typedef struct _UnityTestingObjectRegistryClass UnityTestingObjectRegistryClass;
#define _unity_testing_object_registry_unref0(var) ((var == NULL) ? NULL : (var = (unity_testing_object_registry_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM (unity_panel_indicators_indicator_item_get_type ())
#define UNITY_PANEL_INDICATORS_INDICATOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM, UnityPanelIndicatorsIndicatorItem))
#define UNITY_PANEL_INDICATORS_INDICATOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM, UnityPanelIndicatorsIndicatorItemClass))
#define UNITY_PANEL_INDICATORS_IS_INDICATOR_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM))
#define UNITY_PANEL_INDICATORS_IS_INDICATOR_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM))
#define UNITY_PANEL_INDICATORS_INDICATOR_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM, UnityPanelIndicatorsIndicatorItemClass))

typedef struct _UnityPanelIndicatorsIndicatorItem UnityPanelIndicatorsIndicatorItem;
typedef struct _UnityPanelIndicatorsIndicatorItemClass UnityPanelIndicatorsIndicatorItemClass;
typedef struct _UnityPanelIndicatorsIndicatorItemPrivate UnityPanelIndicatorsIndicatorItemPrivate;

#define UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY (unity_panel_indicators_indicator_entry_get_type ())
#define UNITY_PANEL_INDICATORS_INDICATOR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY, UnityPanelIndicatorsIndicatorEntry))
#define UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY, UnityPanelIndicatorsIndicatorEntryClass))
#define UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY))
#define UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY))
#define UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY, UnityPanelIndicatorsIndicatorEntryClass))

typedef struct _UnityPanelIndicatorsIndicatorEntry UnityPanelIndicatorsIndicatorEntry;
typedef struct _UnityPanelIndicatorsIndicatorEntryClass UnityPanelIndicatorsIndicatorEntryClass;
typedef struct _UnityPanelIndicatorsIndicatorEntryPrivate UnityPanelIndicatorsIndicatorEntryPrivate;
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_pattern_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_pattern_destroy (var), NULL)))

struct _UnityPanelIndicatorsView {
      CtkBox parent_instance;
      UnityPanelIndicatorsViewPrivate * priv;
};

struct _UnityPanelIndicatorsViewClass {
      CtkBoxClass parent_class;
};

struct _UnityPanelIndicatorsViewPrivate {
      GeeHashMap* indicator_order;
      GtkMenu* popped;
      guint32 click_time;
      float last_found_entry_x;
};

struct _UnityPanelIndicatorsIndicatorItem {
      CtkBox parent_instance;
      UnityPanelIndicatorsIndicatorItemPrivate * priv;
      gint position;
};

struct _UnityPanelIndicatorsIndicatorItemClass {
      CtkBoxClass parent_class;
};

struct _UnityPanelIndicatorsIndicatorItemPrivate {
      IndicatorObject* object;
};

struct _UnityPanelIndicatorsIndicatorEntry {
      CtkBox parent_instance;
      UnityPanelIndicatorsIndicatorEntryPrivate * priv;
};

struct _UnityPanelIndicatorsIndicatorEntryClass {
      CtkBoxClass parent_class;
};

struct _UnityPanelIndicatorsIndicatorEntryPrivate {
      IndicatorObjectEntry* _entry;
      ClutterCairoTexture* bg;
      CtkImage* image;
      CtkText* text;
};


static gpointer unity_panel_indicators_view_parent_class = NULL;
static gpointer unity_panel_indicators_indicator_item_parent_class = NULL;
static gpointer unity_panel_indicators_indicator_entry_parent_class = NULL;

GType unity_panel_indicators_view_get_type (void);
#define UNITY_PANEL_INDICATORS_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_PANEL_INDICATORS_TYPE_VIEW, UnityPanelIndicatorsViewPrivate))
enum  {
      UNITY_PANEL_INDICATORS_VIEW_DUMMY_PROPERTY
};
gpointer unity_testing_object_registry_ref (gpointer instance);
void unity_testing_object_registry_unref (gpointer instance);
GParamSpec* unity_testing_param_spec_object_registry (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void unity_testing_value_set_object_registry (GValue* value, gpointer v_object);
void unity_testing_value_take_object_registry (GValue* value, gpointer v_object);
gpointer unity_testing_value_get_object_registry (const GValue* value);
GType unity_testing_object_registry_get_type (void);
UnityTestingObjectRegistry* unity_testing_object_registry_get_default (void);
void unity_testing_object_registry_register (UnityTestingObjectRegistry* self, const char* name, GObject* object);
UnityPanelIndicatorsView* unity_panel_indicators_view_new (void);
UnityPanelIndicatorsView* unity_panel_indicators_view_construct (GType object_type);
static void unity_panel_indicators_view_load_indicator (UnityPanelIndicatorsView* self, const char* filename, const char* leaf);
GType unity_panel_indicators_indicator_item_get_type (void);
gint unity_panel_indicators_view_reorder_icons (UnityPanelIndicatorsIndicatorItem* a, UnityPanelIndicatorsIndicatorItem* b);
static gboolean unity_panel_indicators_view_load_indicators (UnityPanelIndicatorsView* self);
UnityPanelIndicatorsIndicatorItem* unity_panel_indicators_indicator_item_new (void);
UnityPanelIndicatorsIndicatorItem* unity_panel_indicators_indicator_item_construct (GType object_type);
void unity_panel_indicators_indicator_item_set_object (UnityPanelIndicatorsIndicatorItem* self, IndicatorObject* object);
static void unity_panel_indicators_view_on_menu_moved (UnityPanelIndicatorsView* self, UnityPanelIndicatorsIndicatorItem* item, GtkMenuDirectionType type);
static void _unity_panel_indicators_view_on_menu_moved_unity_panel_indicators_indicator_item_menu_moved (UnityPanelIndicatorsIndicatorItem* _sender, GtkMenuDirectionType type, gpointer self);
static void unity_panel_indicators_view_position_menu (UnityPanelIndicatorsView* self, GtkMenu* menu, gint* x, gint* y, gboolean* push_in);
GType unity_panel_indicators_indicator_entry_get_type (void);
static UnityPanelIndicatorsIndicatorEntry* unity_panel_indicators_view_entry_for_event (UnityPanelIndicatorsView* self, float root_x);
GtkMenu* unity_panel_indicators_indicator_entry_get_menu (UnityPanelIndicatorsIndicatorEntry* self);
static void _unity_panel_indicators_view_position_menu_gtk_menu_position_func (GtkMenu* menu, gint* x, gint* y, gboolean* push_in, gpointer self);
void unity_panel_indicators_indicator_entry_menu_shown (UnityPanelIndicatorsIndicatorEntry* self);
void unity_panel_indicators_view_show_entry (UnityPanelIndicatorsView* self, UnityPanelIndicatorsIndicatorEntry* entry);
static gboolean unity_panel_indicators_view_on_button_press_event (UnityPanelIndicatorsView* self, ClutterEvent* e);
static gboolean unity_panel_indicators_view_on_button_release_event (UnityPanelIndicatorsView* self, ClutterEvent* e);
static gboolean unity_panel_indicators_view_on_motion_event (UnityPanelIndicatorsView* self, ClutterEvent* e);
static gboolean unity_panel_indicators_view_on_scroll_event (UnityPanelIndicatorsView* self, ClutterEvent* e);
static gboolean _unity_panel_indicators_view_on_button_press_event_clutter_actor_button_press_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
static gboolean _unity_panel_indicators_view_on_button_release_event_clutter_actor_button_release_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
static gboolean _unity_panel_indicators_view_on_motion_event_clutter_actor_motion_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
static gboolean _unity_panel_indicators_view_on_scroll_event_clutter_actor_scroll_event (ClutterActor* _sender, ClutterEvent* event, gpointer self);
static gboolean _unity_panel_indicators_view_load_indicators_gsource_func (gpointer self);
static GObject * unity_panel_indicators_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_panel_indicators_view_finalize (GObject* obj);
#define UNITY_PANEL_INDICATORS_INDICATOR_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM, UnityPanelIndicatorsIndicatorItemPrivate))
enum  {
      UNITY_PANEL_INDICATORS_INDICATOR_ITEM_DUMMY_PROPERTY
};
IndicatorObjectEntry* unity_panel_indicators_indicator_entry_get_entry (UnityPanelIndicatorsIndicatorEntry* self);
static void unity_panel_indicators_indicator_item_remove_entry (UnityPanelIndicatorsIndicatorItem* self, IndicatorObjectEntry* entry);
UnityPanelIndicatorsIndicatorEntry* unity_panel_indicators_indicator_entry_new (IndicatorObjectEntry* entry);
UnityPanelIndicatorsIndicatorEntry* unity_panel_indicators_indicator_entry_construct (GType object_type, IndicatorObjectEntry* entry);
static void unity_panel_indicators_indicator_item_on_menu_moved (UnityPanelIndicatorsIndicatorItem* self, UnityPanelIndicatorsIndicatorEntry* entry, GtkMenuDirectionType type);
static void _unity_panel_indicators_indicator_item_on_menu_moved_unity_panel_indicators_indicator_entry_menu_moved (UnityPanelIndicatorsIndicatorEntry* _sender, GtkMenuDirectionType type, gpointer self);
static void unity_panel_indicators_indicator_item_create_entry (UnityPanelIndicatorsIndicatorItem* self, IndicatorObjectEntry* entry, IndicatorObject* object);
static void unity_panel_indicators_indicator_item_on_entry_added (UnityPanelIndicatorsIndicatorItem* self, IndicatorObject* object, IndicatorObjectEntry* entry);
static void _unity_panel_indicators_indicator_item_on_entry_added_indicator_object_entry_added (IndicatorObject* _sender, IndicatorObjectEntry* entry, gpointer self);
static void _unity_panel_indicators_indicator_item_remove_entry_indicator_object_entry_removed (IndicatorObject* _sender, IndicatorObjectEntry* entry, gpointer self);
IndicatorObject* unity_panel_indicators_indicator_item_get_object (UnityPanelIndicatorsIndicatorItem* self);
static GObject * unity_panel_indicators_indicator_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_panel_indicators_indicator_item_finalize (GObject* obj);
#define UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY, UnityPanelIndicatorsIndicatorEntryPrivate))
enum  {
      UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_DUMMY_PROPERTY,
      UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_ENTRY,
      UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_MENU
};
void unity_panel_indicators_indicator_entry_menu_key_moved (UnityPanelIndicatorsIndicatorEntry* self, GtkMenuDirectionType type);
static void _unity_panel_indicators_indicator_entry_menu_key_moved_gtk_menu_shell_move_current (GtkMenuShell* _sender, GtkMenuDirectionType direction, gpointer self);
void unity_panel_indicators_indicator_entry_menu_vis_changed (UnityPanelIndicatorsIndicatorEntry* self);
static void _unity_panel_indicators_indicator_entry_menu_vis_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void unity_panel_indicators_indicator_entry_update_bg (UnityPanelIndicatorsIndicatorEntry* self, gint width, gint height);
static void unity_panel_indicators_indicator_entry_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags);
static void unity_panel_indicators_indicator_entry_real_paint (ClutterActor* base);
static void unity_panel_indicators_indicator_entry_real_map (ClutterActor* base);
static void unity_panel_indicators_indicator_entry_real_unmap (ClutterActor* base);
static void unity_panel_indicators_indicator_entry_set_entry (UnityPanelIndicatorsIndicatorEntry* self, IndicatorObjectEntry* value);
static void _lambda4_ (UnityPanelIndicatorsIndicatorEntry* self);
static void __lambda4__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _lambda5_ (UnityPanelIndicatorsIndicatorEntry* self);
static void __lambda5__gtk_icon_theme_changed (GtkIconTheme* _sender, gpointer self);
static void _lambda6_ (UnityPanelIndicatorsIndicatorEntry* self);
static void __lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _lambda7_ (UnityPanelIndicatorsIndicatorEntry* self);
static void __lambda7__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static GObject * unity_panel_indicators_indicator_entry_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void unity_panel_indicators_indicator_entry_finalize (GObject* obj);
static void unity_panel_indicators_indicator_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void unity_panel_indicators_indicator_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static int _vala_strcmp0 (const char * str1, const char * str2);



UnityPanelIndicatorsView* unity_panel_indicators_view_construct (GType object_type) {
      UnityPanelIndicatorsView * self;
      UnityTestingObjectRegistry* _tmp0_;
      self = (UnityPanelIndicatorsView*) g_object_new (object_type, "orientation", CTK_ORIENTATION_HORIZONTAL, "spacing", 0, "homogeneous", FALSE, "reactive", TRUE, NULL);
      unity_testing_object_registry_register (_tmp0_ = unity_testing_object_registry_get_default (), "PanelIndicators", (GObject*) self);
      _unity_testing_object_registry_unref0 (_tmp0_);
      return self;
}


UnityPanelIndicatorsView* unity_panel_indicators_view_new (void) {
      return unity_panel_indicators_view_construct (UNITY_PANEL_INDICATORS_TYPE_VIEW);
}


static gboolean string_contains (const char* self, const char* needle) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (needle != NULL, FALSE);
      result = strstr (self, needle) != NULL;
      return result;
}


static char* string_slice (const char* self, glong start, glong end) {
      char* result = NULL;
      glong string_length;
      gboolean _tmp0_ = FALSE;
      gboolean _tmp1_ = FALSE;
      const char* start_string;
      g_return_val_if_fail (self != NULL, NULL);
      string_length = g_utf8_strlen (self, -1);
      if (start < 0) {
            start = string_length + start;
      }
      if (end < 0) {
            end = string_length + end;
      }
      if (start >= 0) {
            _tmp0_ = start <= string_length;
      } else {
            _tmp0_ = FALSE;
      }
      g_return_val_if_fail (_tmp0_, NULL);
      if (end >= 0) {
            _tmp1_ = end <= string_length;
      } else {
            _tmp1_ = FALSE;
      }
      g_return_val_if_fail (_tmp1_, NULL);
      g_return_val_if_fail (start <= end, NULL);
      start_string = g_utf8_offset_to_pointer (self, start);
      result = g_strndup (start_string, ((gchar*) g_utf8_offset_to_pointer (start_string, end - start)) - ((gchar*) start_string));
      return result;
}


static gboolean unity_panel_indicators_view_load_indicators (UnityPanelIndicatorsView* self) {
      gboolean result = FALSE;
      GError * _inner_error_;
      char* skip_list;
      char* _tmp0_;
      GFile* dir;
      g_return_val_if_fail (self != NULL, FALSE);
      _inner_error_ = NULL;
      skip_list = NULL;
      gee_abstract_map_set ((GeeAbstractMap*) self->priv->indicator_order, "libapplication.so", GINT_TO_POINTER (1));
      gee_abstract_map_set ((GeeAbstractMap*) self->priv->indicator_order, "libsoundmenu.so", GINT_TO_POINTER (2));
      gee_abstract_map_set ((GeeAbstractMap*) self->priv->indicator_order, "libmessaging.so", GINT_TO_POINTER (3));
      gee_abstract_map_set ((GeeAbstractMap*) self->priv->indicator_order, "libdatetime.so", GINT_TO_POINTER (4));
      gee_abstract_map_set ((GeeAbstractMap*) self->priv->indicator_order, "libme.so", GINT_TO_POINTER (5));
      gee_abstract_map_set ((GeeAbstractMap*) self->priv->indicator_order, "libsession.so", GINT_TO_POINTER (6));
      skip_list = (_tmp0_ = g_strdup (g_getenv ("UNITY_PANEL_INDICATORS_SKIP")), _g_free0 (skip_list), _tmp0_);
      if (skip_list == NULL) {
            char* _tmp1_;
            skip_list = (_tmp1_ = g_strdup (""), _g_free0 (skip_list), _tmp1_);
      }
      if (_vala_strcmp0 (skip_list, "all") == 0) {
            result = FALSE;
            _g_free0 (skip_list);
            return result;
      }
      gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), INDICATORICONSDIR);
      dir = g_file_new_for_path (INDICATORDIR);
      {
            GFileEnumerator* e;
            GFileInfo* file_info;
            e = g_file_enumerate_children (dir, G_FILE_ATTRIBUTE_STANDARD_NAME, 0, NULL, &_inner_error_);
            if (_inner_error_ != NULL) {
                  goto __catch5_g_error;
            }
            file_info = NULL;
            while (TRUE) {
                  GFileInfo* _tmp2_;
                  GFileInfo* _tmp3_;
                  char* leaf;
                  gboolean _tmp4_ = FALSE;
                  char* _tmp5_;
                  gboolean _tmp6_;
                  _tmp2_ = g_file_enumerator_next_file (e, NULL, &_inner_error_);
                  if (_inner_error_ != NULL) {
                        _g_object_unref0 (e);
                        _g_object_unref0 (file_info);
                        goto __catch5_g_error;
                  }
                  if (!((file_info = (_tmp3_ = _tmp2_, _g_object_unref0 (file_info), _tmp3_)) != NULL)) {
                        break;
                  }
                  leaf = g_strdup (g_file_info_get_name (file_info));
                  if (string_contains (skip_list, leaf)) {
                        _tmp4_ = TRUE;
                  } else {
                        _tmp4_ = _vala_strcmp0 (skip_list, "all") == 0;
                  }
                  if (_tmp4_) {
                        _g_free0 (leaf);
                        continue;
                  }
                  if ((_tmp6_ = _vala_strcmp0 (_tmp5_ = string_slice (leaf, g_utf8_strlen (leaf, -1) - 2, g_utf8_strlen (leaf, -1)), "so") == 0, _g_free0 (_tmp5_), _tmp6_)) {
                        char* _tmp7_;
                        unity_panel_indicators_view_load_indicator (self, _tmp7_ = g_strconcat (INDICATORDIR, g_file_info_get_name (file_info), NULL), g_file_info_get_name (file_info));
                        _g_free0 (_tmp7_);
                  }
                  _g_free0 (leaf);
            }
            _g_object_unref0 (e);
            _g_object_unref0 (file_info);
      }
      goto __finally5;
      __catch5_g_error:
      {
            GError * _error_;
            _error_ = _inner_error_;
            _inner_error_ = NULL;
            {
                  g_print ("Unable to read indicators: %s\n", _error_->message);
                  _g_error_free0 (_error_);
            }
      }
      __finally5:
      if (_inner_error_ != NULL) {
            _g_free0 (skip_list);
            _g_object_unref0 (dir);
            g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
            g_clear_error (&_inner_error_);
            return FALSE;
      }
      ctk_box_sort_children ((CtkBox*) self, (GCompareFunc) unity_panel_indicators_view_reorder_icons);
      result = FALSE;
      _g_free0 (skip_list);
      _g_object_unref0 (dir);
      return result;
}


gint unity_panel_indicators_view_reorder_icons (UnityPanelIndicatorsIndicatorItem* a, UnityPanelIndicatorsIndicatorItem* b) {
      gint result = 0;
      g_return_val_if_fail (a != NULL, 0);
      g_return_val_if_fail (b != NULL, 0);
      result = a->position - b->position;
      return result;
}


static void _unity_panel_indicators_view_on_menu_moved_unity_panel_indicators_indicator_item_menu_moved (UnityPanelIndicatorsIndicatorItem* _sender, GtkMenuDirectionType type, gpointer self) {
      unity_panel_indicators_view_on_menu_moved (self, _sender, type);
}


static void unity_panel_indicators_view_load_indicator (UnityPanelIndicatorsView* self, const char* filename, const char* leaf) {
      IndicatorObject* o;
      IndicatorObject* _tmp0_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (filename != NULL);
      g_return_if_fail (leaf != NULL);
      o = NULL;
      o = (_tmp0_ = indicator_object_new_from_file (filename), _g_object_unref0 (o), _tmp0_);
      if (INDICATOR_IS_OBJECT (o)) {
            UnityPanelIndicatorsIndicatorItem* i;
            i = g_object_ref_sink (unity_panel_indicators_indicator_item_new ());
            unity_panel_indicators_indicator_item_set_object (i, o);
            clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) i);
            clutter_actor_show ((ClutterActor*) i);
            g_signal_connect_object (i, "menu-moved", (GCallback) _unity_panel_indicators_view_on_menu_moved_unity_panel_indicators_indicator_item_menu_moved, self, 0);
            i->position = (gint) GPOINTER_TO_INT (gee_abstract_map_get ((GeeAbstractMap*) self->priv->indicator_order, leaf));
            _g_object_unref0 (i);
      } else {
            g_warning ("panel-indicators.vala:137: Unable to load %s\n", filename);
      }
      _g_object_unref0 (o);
}


static void unity_panel_indicators_view_position_menu (UnityPanelIndicatorsView* self, GtkMenu* menu, gint* x, gint* y, gboolean* push_in) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (menu != NULL);
      *y = (gint) clutter_actor_get_height ((ClutterActor*) self);
      *x = (gint) self->priv->last_found_entry_x;
}


static UnityPanelIndicatorsIndicatorEntry* unity_panel_indicators_view_entry_for_event (UnityPanelIndicatorsView* self, float root_x) {
      UnityPanelIndicatorsIndicatorEntry* result = NULL;
      UnityPanelIndicatorsIndicatorItem* item;
      UnityPanelIndicatorsIndicatorEntry* entry;
      float x;
      GList* list;
      g_return_val_if_fail (self != NULL, NULL);
      item = NULL;
      entry = NULL;
      x = root_x - clutter_actor_get_x ((ClutterActor*) self);
      list = clutter_container_get_children ((ClutterContainer*) self);
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp0_;
                  _tmp0_ = TRUE;
                  while (TRUE) {
                        UnityPanelIndicatorsIndicatorItem* it;
                        gboolean _tmp1_ = FALSE;
                        if (!_tmp0_) {
                              i++;
                        }
                        _tmp0_ = FALSE;
                        if (!(i < g_list_length (list))) {
                              break;
                        }
                        it = UNITY_PANEL_INDICATORS_INDICATOR_ITEM ((UnityPanelIndicatorsIndicatorItem*) g_list_nth_data (list, (guint) i));
                        if (clutter_actor_get_x ((ClutterActor*) it) < x) {
                              _tmp1_ = x < (clutter_actor_get_x ((ClutterActor*) it) + clutter_actor_get_width ((ClutterActor*) it));
                        } else {
                              _tmp1_ = FALSE;
                        }
                        if (_tmp1_) {
                              item = it;
                              break;
                        }
                  }
            }
      }
      if (item == NULL) {
            result = NULL;
            return result;
      }
      x = x - clutter_actor_get_x ((ClutterActor*) item);
      list = clutter_container_get_children ((ClutterContainer*) item);
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp2_;
                  _tmp2_ = TRUE;
                  while (TRUE) {
                        UnityPanelIndicatorsIndicatorEntry* ent;
                        gboolean _tmp3_ = FALSE;
                        if (!_tmp2_) {
                              i++;
                        }
                        _tmp2_ = FALSE;
                        if (!(i < g_list_length (list))) {
                              break;
                        }
                        ent = UNITY_PANEL_INDICATORS_INDICATOR_ENTRY ((UnityPanelIndicatorsIndicatorItem*) g_list_nth_data (list, (guint) i));
                        if (clutter_actor_get_x ((ClutterActor*) ent) < x) {
                              _tmp3_ = x < (clutter_actor_get_x ((ClutterActor*) ent) + clutter_actor_get_width ((ClutterActor*) ent));
                        } else {
                              _tmp3_ = FALSE;
                        }
                        if (_tmp3_) {
                              self->priv->last_found_entry_x = (clutter_actor_get_x ((ClutterActor*) ent) + clutter_actor_get_x ((ClutterActor*) item)) + clutter_actor_get_x ((ClutterActor*) self);
                              entry = ent;
                        }
                  }
            }
      }
      result = entry;
      return result;
}


static void _unity_panel_indicators_view_position_menu_gtk_menu_position_func (GtkMenu* menu, gint* x, gint* y, gboolean* push_in, gpointer self) {
      unity_panel_indicators_view_position_menu (self, menu, x, y, push_in);
}


static gpointer _g_object_ref0 (gpointer self) {
      return self ? g_object_ref (self) : NULL;
}


void unity_panel_indicators_view_show_entry (UnityPanelIndicatorsView* self, UnityPanelIndicatorsIndicatorEntry* entry) {
      gboolean _tmp0_ = FALSE;
      GtkMenu* _tmp2_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (entry != NULL);
      if (GTK_IS_MENU (self->priv->popped)) {
            _tmp0_ = (GTK_WIDGET_FLAGS ((GtkWidget*) self->priv->popped) & GTK_VISIBLE) != 0;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            GtkMenu* _tmp1_;
            gtk_menu_popdown (self->priv->popped);
            self->priv->popped = (_tmp1_ = NULL, _g_object_unref0 (self->priv->popped), _tmp1_);
      }
      self->priv->last_found_entry_x = (clutter_actor_get_x ((ClutterActor*) entry) + clutter_actor_get_x (clutter_actor_get_parent ((ClutterActor*) entry))) + clutter_actor_get_x ((ClutterActor*) self);
      gtk_menu_popup (unity_panel_indicators_indicator_entry_get_menu (entry), NULL, NULL, _unity_panel_indicators_view_position_menu_gtk_menu_position_func, self, (guint) 1, clutter_get_current_event_time ());
      self->priv->click_time = clutter_get_current_event_time ();
      self->priv->popped = (_tmp2_ = _g_object_ref0 (unity_panel_indicators_indicator_entry_get_menu (entry)), _g_object_unref0 (self->priv->popped), _tmp2_);
      unity_panel_indicators_indicator_entry_menu_shown (entry);
}


static gboolean unity_panel_indicators_view_on_button_press_event (UnityPanelIndicatorsView* self, ClutterEvent* e) {
      gboolean result = FALSE;
      gboolean _tmp0_ = FALSE;
      UnityPanelIndicatorsIndicatorEntry* entry;
      g_return_val_if_fail (self != NULL, FALSE);
      if (GTK_IS_MENU (self->priv->popped)) {
            _tmp0_ = (GTK_WIDGET_FLAGS ((GtkWidget*) self->priv->popped) & GTK_VISIBLE) != 0;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            GtkMenu* _tmp1_;
            gtk_menu_popdown (self->priv->popped);
            self->priv->popped = (_tmp1_ = NULL, _g_object_unref0 (self->priv->popped), _tmp1_);
      }
      entry = unity_panel_indicators_view_entry_for_event (self, (*e).button.x);
      if (UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY (entry)) {
            GtkMenu* _tmp2_;
            gtk_menu_popup (unity_panel_indicators_indicator_entry_get_menu (entry), NULL, NULL, _unity_panel_indicators_view_position_menu_gtk_menu_position_func, self, (guint) (*e).button.button, (*e).button.time);
            self->priv->click_time = (*e).button.time;
            self->priv->popped = (_tmp2_ = _g_object_ref0 (unity_panel_indicators_indicator_entry_get_menu (entry)), _g_object_unref0 (self->priv->popped), _tmp2_);
            unity_panel_indicators_indicator_entry_menu_shown (entry);
      }
      result = TRUE;
      return result;
}


static gboolean unity_panel_indicators_view_on_button_release_event (UnityPanelIndicatorsView* self, ClutterEvent* e) {
      gboolean result = FALSE;
      gboolean _tmp0_ = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      if (((*e).button.time - self->priv->click_time) < 300) {
            result = TRUE;
            return result;
      }
      if (GTK_IS_MENU (self->priv->popped)) {
            _tmp0_ = (GTK_WIDGET_FLAGS ((GtkWidget*) self->priv->popped) & GTK_VISIBLE) != 0;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            GtkMenu* _tmp1_;
            gtk_menu_popdown (self->priv->popped);
            self->priv->popped = (_tmp1_ = NULL, _g_object_unref0 (self->priv->popped), _tmp1_);
      }
      result = TRUE;
      return result;
}


static gboolean unity_panel_indicators_view_on_motion_event (UnityPanelIndicatorsView* self, ClutterEvent* e) {
      gboolean result = FALSE;
      gboolean _tmp0_ = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      if (GTK_IS_MENU (self->priv->popped)) {
            _tmp0_ = (GTK_WIDGET_FLAGS ((GtkWidget*) self->priv->popped) & GTK_VISIBLE) != 0;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            UnityPanelIndicatorsIndicatorEntry* entry;
            entry = NULL;
            entry = unity_panel_indicators_view_entry_for_event (self, (*e).motion.x);
            if (entry == NULL) {
                  result = TRUE;
                  return result;
            }
            if (unity_panel_indicators_indicator_entry_get_menu (entry) != self->priv->popped) {
                  GtkMenu* _tmp1_;
                  gtk_menu_popdown (self->priv->popped);
                  self->priv->popped = (_tmp1_ = _g_object_ref0 (unity_panel_indicators_indicator_entry_get_menu (entry)), _g_object_unref0 (self->priv->popped), _tmp1_);
                  gtk_menu_popup (self->priv->popped, NULL, NULL, _unity_panel_indicators_view_position_menu_gtk_menu_position_func, self, (guint) (*e).button.button, (*e).button.time);
                  unity_panel_indicators_indicator_entry_menu_shown (entry);
            }
      }
      result = TRUE;
      return result;
}


static gboolean unity_panel_indicators_view_on_scroll_event (UnityPanelIndicatorsView* self, ClutterEvent* e) {
      gboolean result = FALSE;
      ClutterScrollEvent event;
      UnityPanelIndicatorsIndicatorEntry* entry;
      g_return_val_if_fail (self != NULL, FALSE);
      event = (*e).scroll;
      entry = unity_panel_indicators_view_entry_for_event (self, (*e).scroll.x);
      if (UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY (entry)) {
            IndicatorObject* object;
            object = (IndicatorObject*) g_object_get_data ((GObject*) entry, "Indicator.Object");
            g_signal_emit_by_name (object, "scroll", 1, event.direction, NULL);
      }
      result = TRUE;
      return result;
}


static void unity_panel_indicators_view_on_menu_moved (UnityPanelIndicatorsView* self, UnityPanelIndicatorsIndicatorItem* item, GtkMenuDirectionType type) {
      GList* list;
      gint pos;
      UnityPanelIndicatorsIndicatorItem* _tmp0_;
      UnityPanelIndicatorsIndicatorItem* new_item;
      GList* l;
      gint _tmp1_ = 0;
      gint p;
      UnityPanelIndicatorsIndicatorEntry* _tmp2_;
      UnityPanelIndicatorsIndicatorEntry* new_entry;
      g_return_if_fail (self != NULL);
      g_return_if_fail (item != NULL);
      list = clutter_container_get_children ((ClutterContainer*) self);
      pos = g_list_index (list, item);
      if (pos == (-1)) {
            return;
      }
      if (type == GTK_MENU_DIR_PARENT) {
            if (pos == 0) {
                  return;
            }
            pos = pos - 1;
      } else {
            if (type == GTK_MENU_DIR_CHILD) {
                  if (pos == (g_list_length (list) - 1)) {
                        return;
                  }
                  pos = pos + 1;
            }
      }
      new_item = _g_object_ref0 ((_tmp0_ = (UnityPanelIndicatorsIndicatorItem*) g_list_nth_data (list, (guint) pos), UNITY_PANEL_INDICATORS_IS_INDICATOR_ITEM (_tmp0_) ? ((UnityPanelIndicatorsIndicatorItem*) _tmp0_) : NULL));
      l = clutter_container_get_children ((ClutterContainer*) new_item);
      if (type == GTK_MENU_DIR_PARENT) {
            _tmp1_ = ((gint) g_list_length (l)) - 1;
      } else {
            _tmp1_ = 0;
      }
      p = _tmp1_;
      new_entry = _g_object_ref0 ((_tmp2_ = (UnityPanelIndicatorsIndicatorEntry*) g_list_nth_data (l, (guint) p), UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY (_tmp2_) ? ((UnityPanelIndicatorsIndicatorEntry*) _tmp2_) : NULL));
      if (UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY (new_entry)) {
            unity_panel_indicators_view_show_entry (self, new_entry);
      }
      _g_object_unref0 (new_item);
      _g_object_unref0 (new_entry);
}


static gboolean _unity_panel_indicators_view_on_button_press_event_clutter_actor_button_press_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = unity_panel_indicators_view_on_button_press_event (self, event);
      return result;
}


static gboolean _unity_panel_indicators_view_on_button_release_event_clutter_actor_button_release_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = unity_panel_indicators_view_on_button_release_event (self, event);
      return result;
}


static gboolean _unity_panel_indicators_view_on_motion_event_clutter_actor_motion_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = unity_panel_indicators_view_on_motion_event (self, event);
      return result;
}


static gboolean _unity_panel_indicators_view_on_scroll_event_clutter_actor_scroll_event (ClutterActor* _sender, ClutterEvent* event, gpointer self) {
      gboolean result;
      result = unity_panel_indicators_view_on_scroll_event (self, event);
      return result;
}


static gboolean _unity_panel_indicators_view_load_indicators_gsource_func (gpointer self) {
      gboolean result;
      result = unity_panel_indicators_view_load_indicators (self);
      return result;
}


static GObject * unity_panel_indicators_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPanelIndicatorsView * self;
      parent_class = G_OBJECT_CLASS (unity_panel_indicators_view_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PANEL_INDICATORS_VIEW (obj);
      {
            GeeHashMap* _tmp0_;
            self->priv->indicator_order = (_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_INT, NULL, NULL, NULL, NULL, NULL), _g_object_unref0 (self->priv->indicator_order), _tmp0_);
            g_signal_connect_object ((ClutterActor*) self, "button-press-event", (GCallback) _unity_panel_indicators_view_on_button_press_event_clutter_actor_button_press_event, self, 0);
            g_signal_connect_object ((ClutterActor*) self, "button-release-event", (GCallback) _unity_panel_indicators_view_on_button_release_event_clutter_actor_button_release_event, self, 0);
            g_signal_connect_object ((ClutterActor*) self, "motion-event", (GCallback) _unity_panel_indicators_view_on_motion_event_clutter_actor_motion_event, self, 0);
            g_signal_connect_object ((ClutterActor*) self, "scroll-event", (GCallback) _unity_panel_indicators_view_on_scroll_event_clutter_actor_scroll_event, self, 0);
            if (g_getenv ("UNITY_DISABLE_IDLES") != NULL) {
                  unity_panel_indicators_view_load_indicators (self);
            } else {
                  g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _unity_panel_indicators_view_load_indicators_gsource_func, g_object_ref (self), g_object_unref);
            }
      }
      return obj;
}


static void unity_panel_indicators_view_class_init (UnityPanelIndicatorsViewClass * klass) {
      unity_panel_indicators_view_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityPanelIndicatorsViewPrivate));
      G_OBJECT_CLASS (klass)->constructor = unity_panel_indicators_view_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_panel_indicators_view_finalize;
}


static void unity_panel_indicators_view_instance_init (UnityPanelIndicatorsView * self) {
      self->priv = UNITY_PANEL_INDICATORS_VIEW_GET_PRIVATE (self);
      self->priv->last_found_entry_x = 0.0f;
}


static void unity_panel_indicators_view_finalize (GObject* obj) {
      UnityPanelIndicatorsView * self;
      self = UNITY_PANEL_INDICATORS_VIEW (obj);
      _g_object_unref0 (self->priv->indicator_order);
      _g_object_unref0 (self->priv->popped);
      G_OBJECT_CLASS (unity_panel_indicators_view_parent_class)->finalize (obj);
}


GType unity_panel_indicators_view_get_type (void) {
      static volatile gsize unity_panel_indicators_view_type_id__volatile = 0;
      if (g_once_init_enter (&unity_panel_indicators_view_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPanelIndicatorsViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_panel_indicators_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPanelIndicatorsView), 0, (GInstanceInitFunc) unity_panel_indicators_view_instance_init, NULL };
            GType unity_panel_indicators_view_type_id;
            unity_panel_indicators_view_type_id = g_type_register_static (CTK_TYPE_BOX, "UnityPanelIndicatorsView", &g_define_type_info, 0);
            g_once_init_leave (&unity_panel_indicators_view_type_id__volatile, unity_panel_indicators_view_type_id);
      }
      return unity_panel_indicators_view_type_id__volatile;
}


UnityPanelIndicatorsIndicatorItem* unity_panel_indicators_indicator_item_construct (GType object_type) {
      UnityPanelIndicatorsIndicatorItem * self;
      self = (UnityPanelIndicatorsIndicatorItem*) g_object_new (object_type, "orientation", CTK_ORIENTATION_HORIZONTAL, "spacing", 0, "homogeneous", FALSE, NULL);
      return self;
}


UnityPanelIndicatorsIndicatorItem* unity_panel_indicators_indicator_item_new (void) {
      return unity_panel_indicators_indicator_item_construct (UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM);
}


static void unity_panel_indicators_indicator_item_remove_entry (UnityPanelIndicatorsIndicatorItem* self, IndicatorObjectEntry* entry) {
      GList* list;
      g_return_if_fail (self != NULL);
      g_return_if_fail (entry != NULL);
      list = clutter_container_get_children ((ClutterContainer*) self);
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp0_;
                  _tmp0_ = TRUE;
                  while (TRUE) {
                        UnityPanelIndicatorsIndicatorEntry* e;
                        UnityPanelIndicatorsIndicatorEntry* _tmp1_;
                        if (!_tmp0_) {
                              i++;
                        }
                        _tmp0_ = FALSE;
                        if (!(i < g_list_length (list))) {
                              break;
                        }
                        e = NULL;
                        e = (_tmp1_ = _g_object_ref0 (UNITY_PANEL_INDICATORS_INDICATOR_ENTRY ((UnityPanelIndicatorsIndicatorEntry*) g_list_nth_data (list, (guint) i))), _g_object_unref0 (e), _tmp1_);
                        if (unity_panel_indicators_indicator_entry_get_entry (e) == entry) {
                              clutter_container_remove_actor ((ClutterContainer*) self, (ClutterActor*) e);
                        }
                        _g_object_unref0 (e);
                  }
            }
      }
}


static void _unity_panel_indicators_indicator_item_on_menu_moved_unity_panel_indicators_indicator_entry_menu_moved (UnityPanelIndicatorsIndicatorEntry* _sender, GtkMenuDirectionType type, gpointer self) {
      unity_panel_indicators_indicator_item_on_menu_moved (self, _sender, type);
}


static void unity_panel_indicators_indicator_item_create_entry (UnityPanelIndicatorsIndicatorItem* self, IndicatorObjectEntry* entry, IndicatorObject* object) {
      UnityPanelIndicatorsIndicatorEntry* e;
      g_return_if_fail (self != NULL);
      g_return_if_fail (entry != NULL);
      g_return_if_fail (object != NULL);
      e = g_object_ref_sink (unity_panel_indicators_indicator_entry_new (entry));
      g_object_set_data_full ((GObject*) e, "Indicator.Object", _g_object_ref0 (object), g_object_unref);
      clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) e);
      clutter_actor_show ((ClutterActor*) self);
      g_signal_connect_object (e, "menu-moved", (GCallback) _unity_panel_indicators_indicator_item_on_menu_moved_unity_panel_indicators_indicator_entry_menu_moved, self, 0);
      _g_object_unref0 (e);
}


static void unity_panel_indicators_indicator_item_on_menu_moved (UnityPanelIndicatorsIndicatorItem* self, UnityPanelIndicatorsIndicatorEntry* entry, GtkMenuDirectionType type) {
      GList* list;
      gint pos;
      UnityPanelIndicatorsIndicatorEntry* _tmp0_;
      UnityPanelIndicatorsIndicatorEntry* new_entry;
      ClutterActor* _tmp1_;
      UnityPanelIndicatorsView* parent;
      g_return_if_fail (self != NULL);
      g_return_if_fail (entry != NULL);
      list = clutter_container_get_children ((ClutterContainer*) self);
      pos = g_list_index (list, entry);
      if (pos == (-1)) {
            g_signal_emit_by_name (self, "menu-moved", type);
            return;
      }
      if (type == GTK_MENU_DIR_PARENT) {
            if (pos == 0) {
                  g_signal_emit_by_name (self, "menu-moved", type);
                  return;
            }
            pos = pos - 1;
      } else {
            if (type == GTK_MENU_DIR_CHILD) {
                  if (pos == (g_list_length (list) - 1)) {
                        g_signal_emit_by_name (self, "menu-moved", type);
                        return;
                  }
                  pos = pos + 1;
            }
      }
      new_entry = _g_object_ref0 ((_tmp0_ = (UnityPanelIndicatorsIndicatorEntry*) g_list_nth_data (list, (guint) pos), UNITY_PANEL_INDICATORS_IS_INDICATOR_ENTRY (_tmp0_) ? ((UnityPanelIndicatorsIndicatorEntry*) _tmp0_) : NULL));
      parent = _g_object_ref0 ((_tmp1_ = clutter_actor_get_parent ((ClutterActor*) self), UNITY_PANEL_INDICATORS_IS_VIEW (_tmp1_) ? ((UnityPanelIndicatorsView*) _tmp1_) : NULL));
      unity_panel_indicators_view_show_entry (parent, new_entry);
      _g_object_unref0 (new_entry);
      _g_object_unref0 (parent);
}


static void unity_panel_indicators_indicator_item_on_entry_added (UnityPanelIndicatorsIndicatorItem* self, IndicatorObject* object, IndicatorObjectEntry* entry) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (object != NULL);
      g_return_if_fail (entry != NULL);
      unity_panel_indicators_indicator_item_create_entry (self, entry, object);
}


static void _unity_panel_indicators_indicator_item_on_entry_added_indicator_object_entry_added (IndicatorObject* _sender, IndicatorObjectEntry* entry, gpointer self) {
      unity_panel_indicators_indicator_item_on_entry_added (self, _sender, entry);
}


static void _unity_panel_indicators_indicator_item_remove_entry_indicator_object_entry_removed (IndicatorObject* _sender, IndicatorObjectEntry* entry, gpointer self) {
      unity_panel_indicators_indicator_item_remove_entry (self, entry);
}


void unity_panel_indicators_indicator_item_set_object (UnityPanelIndicatorsIndicatorItem* self, IndicatorObject* object) {
      IndicatorObject* _tmp0_;
      GList* list;
      g_return_if_fail (self != NULL);
      g_return_if_fail (object != NULL);
      self->priv->object = (_tmp0_ = _g_object_ref0 (object), _g_object_unref0 (self->priv->object), _tmp0_);
      g_signal_connect_object (object, "entry-added", (GCallback) _unity_panel_indicators_indicator_item_on_entry_added_indicator_object_entry_added, self, 0);
      g_signal_connect_object (object, "entry-removed", (GCallback) _unity_panel_indicators_indicator_item_remove_entry_indicator_object_entry_removed, self, 0);
      list = indicator_object_get_entries (object);
      {
            gint i;
            i = 0;
            {
                  gboolean _tmp1_;
                  _tmp1_ = TRUE;
                  while (TRUE) {
                        IndicatorObjectEntry* entry;
                        if (!_tmp1_) {
                              i++;
                        }
                        _tmp1_ = FALSE;
                        if (!(i < g_list_length (list))) {
                              break;
                        }
                        entry = NULL;
                        entry = (IndicatorObjectEntry*) ((IndicatorObjectEntry*) g_list_nth_data (list, (guint) i));
                        unity_panel_indicators_indicator_item_create_entry (self, entry, object);
                  }
            }
      }
}


IndicatorObject* unity_panel_indicators_indicator_item_get_object (UnityPanelIndicatorsIndicatorItem* self) {
      IndicatorObject* result = NULL;
      g_return_val_if_fail (self != NULL, NULL);
      result = _g_object_ref0 (self->priv->object);
      return result;
}


static GObject * unity_panel_indicators_indicator_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPanelIndicatorsIndicatorItem * self;
      parent_class = G_OBJECT_CLASS (unity_panel_indicators_indicator_item_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PANEL_INDICATORS_INDICATOR_ITEM (obj);
      {
      }
      return obj;
}


static void unity_panel_indicators_indicator_item_class_init (UnityPanelIndicatorsIndicatorItemClass * klass) {
      unity_panel_indicators_indicator_item_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityPanelIndicatorsIndicatorItemPrivate));
      G_OBJECT_CLASS (klass)->constructor = unity_panel_indicators_indicator_item_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_panel_indicators_indicator_item_finalize;
      g_signal_new ("menu_moved", UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, GTK_TYPE_MENU_DIRECTION_TYPE);
}


static void unity_panel_indicators_indicator_item_instance_init (UnityPanelIndicatorsIndicatorItem * self) {
      self->priv = UNITY_PANEL_INDICATORS_INDICATOR_ITEM_GET_PRIVATE (self);
}


static void unity_panel_indicators_indicator_item_finalize (GObject* obj) {
      UnityPanelIndicatorsIndicatorItem * self;
      self = UNITY_PANEL_INDICATORS_INDICATOR_ITEM (obj);
      _g_object_unref0 (self->priv->object);
      G_OBJECT_CLASS (unity_panel_indicators_indicator_item_parent_class)->finalize (obj);
}


GType unity_panel_indicators_indicator_item_get_type (void) {
      static volatile gsize unity_panel_indicators_indicator_item_type_id__volatile = 0;
      if (g_once_init_enter (&unity_panel_indicators_indicator_item_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPanelIndicatorsIndicatorItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_panel_indicators_indicator_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPanelIndicatorsIndicatorItem), 0, (GInstanceInitFunc) unity_panel_indicators_indicator_item_instance_init, NULL };
            GType unity_panel_indicators_indicator_item_type_id;
            unity_panel_indicators_indicator_item_type_id = g_type_register_static (CTK_TYPE_BOX, "UnityPanelIndicatorsIndicatorItem", &g_define_type_info, 0);
            g_once_init_leave (&unity_panel_indicators_indicator_item_type_id__volatile, unity_panel_indicators_indicator_item_type_id);
      }
      return unity_panel_indicators_indicator_item_type_id__volatile;
}


UnityPanelIndicatorsIndicatorEntry* unity_panel_indicators_indicator_entry_construct (GType object_type, IndicatorObjectEntry* entry) {
      UnityPanelIndicatorsIndicatorEntry * self;
      g_return_val_if_fail (entry != NULL, NULL);
      self = (UnityPanelIndicatorsIndicatorEntry*) g_object_new (object_type, "entry", entry, "orientation", CTK_ORIENTATION_HORIZONTAL, "spacing", 4, "reactive", FALSE, NULL);
      return self;
}


UnityPanelIndicatorsIndicatorEntry* unity_panel_indicators_indicator_entry_new (IndicatorObjectEntry* entry) {
      return unity_panel_indicators_indicator_entry_construct (UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY, entry);
}


static void _unity_panel_indicators_indicator_entry_menu_key_moved_gtk_menu_shell_move_current (GtkMenuShell* _sender, GtkMenuDirectionType direction, gpointer self) {
      unity_panel_indicators_indicator_entry_menu_key_moved (self, direction);
}


static void _unity_panel_indicators_indicator_entry_menu_vis_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      unity_panel_indicators_indicator_entry_menu_vis_changed (self);
}


void unity_panel_indicators_indicator_entry_menu_shown (UnityPanelIndicatorsIndicatorEntry* self) {
      g_return_if_fail (self != NULL);
      if (GTK_IS_MENU (self->priv->_entry->menu)) {
            ClutterColor _tmp0_ = {0};
            ClutterColor col;
            g_signal_connect_object ((GtkMenuShell*) self->priv->_entry->menu, "move-current", (GCallback) _unity_panel_indicators_indicator_entry_menu_key_moved_gtk_menu_shell_move_current, self, 0);
            g_signal_connect_object ((GObject*) self->priv->_entry->menu, "notify::visible", (GCallback) _unity_panel_indicators_indicator_entry_menu_vis_changed_g_object_notify, self, 0);
            clutter_actor_animate ((ClutterActor*) self->priv->bg, (gulong) CLUTTER_EASE_OUT_QUAD, (guint) 200, "opacity", 255, NULL);
            col = (_tmp0_.red = (guint8) 255, _tmp0_.green = (guint8) 249, _tmp0_.blue = (guint8) 233, _tmp0_.alpha = (guint8) 255, _tmp0_);
            clutter_actor_animate ((ClutterActor*) self->priv->text, (gulong) CLUTTER_EASE_OUT_QUAD, (guint) 200, "color", &col, NULL);
      }
}


void unity_panel_indicators_indicator_entry_menu_vis_changed (UnityPanelIndicatorsIndicatorEntry* self) {
      gboolean vis;
      g_return_if_fail (self != NULL);
      vis = (GTK_WIDGET_FLAGS ((GtkWidget*) self->priv->_entry->menu) & GTK_VISIBLE) != 0;
      if (vis == FALSE) {
            ClutterColor _tmp0_ = {0};
            ClutterColor col;
            guint _tmp1_;
            GQuark _tmp3_;
            guint _tmp2_;
            clutter_actor_animate ((ClutterActor*) self->priv->bg, (gulong) CLUTTER_EASE_OUT_QUAD, (guint) 200, "opacity", 0, NULL);
            col = (_tmp0_.red = (guint8) 233, _tmp0_.green = (guint8) 216, _tmp0_.blue = (guint8) 200, _tmp0_.alpha = (guint8) 255, _tmp0_);
            clutter_actor_animate ((ClutterActor*) self->priv->text, (gulong) CLUTTER_EASE_OUT_QUAD, (guint) 200, "color", &col, NULL);
            g_signal_parse_name ("move-current", GTK_TYPE_MENU_SHELL, &_tmp1_, NULL, FALSE);
            g_signal_handlers_disconnect_matched ((GtkMenuShell*) self->priv->_entry->menu, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _unity_panel_indicators_indicator_entry_menu_key_moved_gtk_menu_shell_move_current, self);
            g_signal_parse_name ("notify::visible", G_TYPE_OBJECT, &_tmp2_, &_tmp3_, TRUE);
            g_signal_handlers_disconnect_matched ((GObject*) self->priv->_entry->menu, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DETAIL | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, _tmp3_, NULL, (GCallback) _unity_panel_indicators_indicator_entry_menu_vis_changed_g_object_notify, self);
      }
}


void unity_panel_indicators_indicator_entry_menu_key_moved (UnityPanelIndicatorsIndicatorEntry* self, GtkMenuDirectionType type) {
      gboolean _tmp0_ = FALSE;
      g_return_if_fail (self != NULL);
      if (type != GTK_MENU_DIR_PARENT) {
            _tmp0_ = type != GTK_MENU_DIR_CHILD;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            return;
      }
      g_signal_emit_by_name (self, "menu-moved", type);
}


static void unity_panel_indicators_indicator_entry_update_bg (UnityPanelIndicatorsIndicatorEntry* self, gint width, gint height) {
      cairo_t* cr;
      cairo_t* _tmp0_;
      cairo_pattern_t* pat;
      g_return_if_fail (self != NULL);
      cr = NULL;
      clutter_cairo_texture_set_surface_size (self->priv->bg, (guint) width, (guint) height);
      cr = (_tmp0_ = clutter_cairo_texture_create (self->priv->bg), _cairo_destroy0 (cr), _tmp0_);
      cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
      cairo_paint (cr);
      cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
      cairo_set_line_width (cr, 1.0);
      cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.2);
      cairo_move_to (cr, (double) 1, (double) height);
      cairo_line_to (cr, (double) 1, (double) 7);
      cairo_curve_to (cr, (double) 1, (double) 2, (double) 1, (double) 2, (double) 10, (double) 2);
      cairo_line_to (cr, (double) (width - 10), (double) 2);
      cairo_curve_to (cr, (double) width, (double) 2, (double) width, (double) 2, (double) width, (double) 7);
      cairo_line_to (cr, (double) width, (double) height);
      cairo_line_to (cr, (double) 1, (double) height);
      pat = cairo_pattern_create_linear ((double) 1, (double) 0, (double) 1, (double) height);
      cairo_pattern_add_color_stop_rgba (pat, 0.0, (double) 0.8509f, (double) 0.8196f, (double) 0.7294f, (double) 1.0f);
      cairo_pattern_add_color_stop_rgba (pat, 1.0, (double) 0.7019f, (double) 0.6509f, (double) 0.5137f, (double) 1.0f);
      cairo_set_source (cr, pat);
      cairo_fill (cr);
      _cairo_destroy0 (cr);
      _cairo_pattern_destroy0 (pat);
}


static void unity_panel_indicators_indicator_entry_real_allocate (ClutterActor* base, const ClutterActorBox* box, ClutterAllocationFlags flags) {
      UnityPanelIndicatorsIndicatorEntry * self;
      float width = 0.0F;
      float height = 0.0F;
      ClutterActorBox _tmp0_ = {0};
      ClutterActorBox child_box;
      gboolean _tmp1_ = FALSE;
      self = (UnityPanelIndicatorsIndicatorEntry*) base;
      CLUTTER_ACTOR_CLASS (unity_panel_indicators_indicator_entry_parent_class)->allocate ((ClutterActor*) CTK_BOX (self), box, flags);
      width = floorf ((*box).x2 - (*box).x1);
      height = floorf ((*box).y2 - (*box).y1) - 1;
      child_box = (_tmp0_.x1 = (float) 0, _tmp0_);
      child_box.x1 = (float) 0;
      child_box.x2 = width;
      child_box.y1 = (float) 0;
      child_box.y2 = height;
      if (width != clutter_actor_get_width ((ClutterActor*) self->priv->bg)) {
            _tmp1_ = TRUE;
      } else {
            _tmp1_ = height != clutter_actor_get_height ((ClutterActor*) self->priv->bg);
      }
      if (_tmp1_) {
            unity_panel_indicators_indicator_entry_update_bg (self, (gint) width, (gint) height);
      }
      clutter_actor_allocate ((ClutterActor*) self->priv->bg, &child_box, flags);
}


static void unity_panel_indicators_indicator_entry_real_paint (ClutterActor* base) {
      UnityPanelIndicatorsIndicatorEntry * self;
      self = (UnityPanelIndicatorsIndicatorEntry*) base;
      clutter_actor_paint ((ClutterActor*) self->priv->bg);
      CLUTTER_ACTOR_CLASS (unity_panel_indicators_indicator_entry_parent_class)->paint ((ClutterActor*) CTK_BOX (self));
}


static void unity_panel_indicators_indicator_entry_real_map (ClutterActor* base) {
      UnityPanelIndicatorsIndicatorEntry * self;
      self = (UnityPanelIndicatorsIndicatorEntry*) base;
      CLUTTER_ACTOR_CLASS (unity_panel_indicators_indicator_entry_parent_class)->map ((ClutterActor*) CTK_BOX (self));
      clutter_actor_map ((ClutterActor*) self->priv->bg);
}


static void unity_panel_indicators_indicator_entry_real_unmap (ClutterActor* base) {
      UnityPanelIndicatorsIndicatorEntry * self;
      self = (UnityPanelIndicatorsIndicatorEntry*) base;
      CLUTTER_ACTOR_CLASS (unity_panel_indicators_indicator_entry_parent_class)->unmap ((ClutterActor*) CTK_BOX (self));
      clutter_actor_unmap ((ClutterActor*) self->priv->bg);
}


IndicatorObjectEntry* unity_panel_indicators_indicator_entry_get_entry (UnityPanelIndicatorsIndicatorEntry* self) {
      IndicatorObjectEntry* result;
      g_return_val_if_fail (self != NULL, NULL);
      result = self->priv->_entry;
      return result;
}


static void unity_panel_indicators_indicator_entry_set_entry (UnityPanelIndicatorsIndicatorEntry* self, IndicatorObjectEntry* value) {
      g_return_if_fail (self != NULL);
      self->priv->_entry = value;
      g_object_notify ((GObject *) self, "entry");
}


GtkMenu* unity_panel_indicators_indicator_entry_get_menu (UnityPanelIndicatorsIndicatorEntry* self) {
      GtkMenu* result;
      g_return_val_if_fail (self != NULL, NULL);
      result = self->priv->_entry->menu;
      return result;
}


static void _lambda4_ (UnityPanelIndicatorsIndicatorEntry* self) {
      char* _tmp1_;
      char* _tmp0_ = NULL;
      g_object_set (self->priv->image, "stock-id", _tmp1_ = (g_object_get (self->priv->_entry->image, "icon-name", &_tmp0_, NULL), _tmp0_), NULL);
      _g_free0 (_tmp1_);
}


static void __lambda4__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      _lambda4_ (self);
}


static void _lambda5_ (UnityPanelIndicatorsIndicatorEntry* self) {
      char* _tmp1_;
      char* _tmp0_ = NULL;
      g_object_set (self->priv->image, "stock-id", _tmp1_ = (g_object_get (self->priv->_entry->image, "icon-name", &_tmp0_, NULL), _tmp0_), NULL);
      _g_free0 (_tmp1_);
}


static void __lambda5__gtk_icon_theme_changed (GtkIconTheme* _sender, gpointer self) {
      _lambda5_ (self);
}


static void _lambda6_ (UnityPanelIndicatorsIndicatorEntry* self) {
      GdkPixbuf* _tmp1_;
      GdkPixbuf* _tmp0_ = NULL;
      GdkPixbuf* _tmp3_;
      GdkPixbuf* _tmp2_ = NULL;
      g_object_set (self->priv->image, "pixbuf", _tmp1_ = (g_object_get (self->priv->_entry->image, "pixbuf", &_tmp0_, NULL), _tmp0_), NULL);
      _g_object_unref0 (_tmp1_);
      ctk_image_set_size (self->priv->image, gdk_pixbuf_get_width (_tmp3_ = (g_object_get (self->priv->_entry->image, "pixbuf", &_tmp2_, NULL), _tmp2_)));
      _g_object_unref0 (_tmp3_);
}


static void __lambda6__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      _lambda6_ (self);
}


static void _lambda7_ (UnityPanelIndicatorsIndicatorEntry* self) {
      clutter_text_set_text ((ClutterText*) self->priv->text, gtk_label_get_label (self->priv->_entry->label));
}


static void __lambda7__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
      _lambda7_ (self);
}


static GObject * unity_panel_indicators_indicator_entry_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      UnityPanelIndicatorsIndicatorEntry * self;
      parent_class = G_OBJECT_CLASS (unity_panel_indicators_indicator_entry_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = UNITY_PANEL_INDICATORS_INDICATOR_ENTRY (obj);
      {
            CtkPadding _tmp1_ = {0};
            CtkPadding _tmp2_;
            ClutterCairoTexture* _tmp3_;
            ctk_actor_set_padding ((CtkActor*) self, (_tmp2_ = (_tmp1_.top = (float) 0, _tmp1_.right = 3.0f, _tmp1_.bottom = (float) 0, _tmp1_.left = 3.0f, _tmp1_), &_tmp2_));
            self->priv->bg = (_tmp3_ = g_object_ref_sink ((ClutterCairoTexture*) clutter_cairo_texture_new ((guint) 10, (guint) 10)), _g_object_unref0 (self->priv->bg), _tmp3_);
            clutter_actor_set_parent ((ClutterActor*) self->priv->bg, (ClutterActor*) self);
            clutter_actor_set_opacity ((ClutterActor*) self->priv->bg, (guint8) 0);
            clutter_actor_show ((ClutterActor*) self->priv->bg);
            if (GTK_IS_IMAGE (self->priv->_entry->image)) {
                  CtkImage* _tmp4_;
                  char* _tmp6_;
                  char* _tmp5_ = NULL;
                  gboolean _tmp7_;
                  GdkPixbuf* _tmp11_;
                  GdkPixbuf* _tmp10_ = NULL;
                  gboolean _tmp12_;
                  self->priv->image = (_tmp4_ = g_object_ref_sink ((CtkImage*) ctk_image_new ((guint) 22)), _g_object_unref0 (self->priv->image), _tmp4_);
                  clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->image);
                  clutter_actor_show ((ClutterActor*) self->priv->image);
                  if ((_tmp7_ = (_tmp6_ = (g_object_get (self->priv->_entry->image, "icon-name", &_tmp5_, NULL), _tmp5_)) != NULL, _g_free0 (_tmp6_), _tmp7_)) {
                        char* _tmp9_;
                        char* _tmp8_ = NULL;
                        GtkIconTheme* theme;
                        g_object_set (self->priv->image, "stock-id", _tmp9_ = (g_object_get (self->priv->_entry->image, "icon-name", &_tmp8_, NULL), _tmp8_), NULL);
                        _g_free0 (_tmp9_);
                        g_signal_connect_object ((GObject*) self->priv->_entry->image, "notify::icon-name", (GCallback) __lambda4__g_object_notify, self, 0);
                        theme = gtk_icon_theme_get_default ();
                        g_signal_connect_object (theme, "changed", (GCallback) __lambda5__gtk_icon_theme_changed, self, 0);
                  }
                  if ((_tmp12_ = (_tmp11_ = (g_object_get (self->priv->_entry->image, "pixbuf", &_tmp10_, NULL), _tmp10_)) != NULL, _g_object_unref0 (_tmp11_), _tmp12_)) {
                        GdkPixbuf* _tmp14_;
                        GdkPixbuf* _tmp13_ = NULL;
                        GdkPixbuf* _tmp16_;
                        GdkPixbuf* _tmp15_ = NULL;
                        g_object_set (self->priv->image, "pixbuf", _tmp14_ = (g_object_get (self->priv->_entry->image, "pixbuf", &_tmp13_, NULL), _tmp13_), NULL);
                        _g_object_unref0 (_tmp14_);
                        ctk_image_set_size (self->priv->image, gdk_pixbuf_get_width (_tmp16_ = (g_object_get (self->priv->_entry->image, "pixbuf", &_tmp15_, NULL), _tmp15_)));
                        _g_object_unref0 (_tmp16_);
                        g_signal_connect_object ((GObject*) self->priv->_entry->image, "notify::pixbuf", (GCallback) __lambda6__g_object_notify, self, 0);
                  }
            }
            if (GTK_IS_LABEL (self->priv->_entry->label)) {
                  CtkText* _tmp17_;
                  ClutterColor _tmp18_ = {0};
                  ClutterColor _tmp19_;
                  self->priv->text = (_tmp17_ = g_object_ref_sink ((CtkText*) ctk_text_new ("")), _g_object_unref0 (self->priv->text), _tmp17_);
                  clutter_text_set_color ((ClutterText*) self->priv->text, (_tmp19_ = (_tmp18_.red = (guint8) 233, _tmp18_.green = (guint8) 216, _tmp18_.blue = (guint8) 200, _tmp18_.alpha = (guint8) 255, _tmp18_), &_tmp19_));
                  clutter_container_add_actor ((ClutterContainer*) self, (ClutterActor*) self->priv->text);
                  clutter_actor_show ((ClutterActor*) self->priv->text);
                  clutter_text_set_text ((ClutterText*) self->priv->text, gtk_label_get_label (self->priv->_entry->label));
                  g_signal_connect_object ((GObject*) self->priv->_entry->label, "notify::label", (GCallback) __lambda7__g_object_notify, self, 0);
            }
      }
      return obj;
}


static void unity_panel_indicators_indicator_entry_class_init (UnityPanelIndicatorsIndicatorEntryClass * klass) {
      unity_panel_indicators_indicator_entry_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (UnityPanelIndicatorsIndicatorEntryPrivate));
      CLUTTER_ACTOR_CLASS (klass)->allocate = unity_panel_indicators_indicator_entry_real_allocate;
      CLUTTER_ACTOR_CLASS (klass)->paint = unity_panel_indicators_indicator_entry_real_paint;
      CLUTTER_ACTOR_CLASS (klass)->map = unity_panel_indicators_indicator_entry_real_map;
      CLUTTER_ACTOR_CLASS (klass)->unmap = unity_panel_indicators_indicator_entry_real_unmap;
      G_OBJECT_CLASS (klass)->get_property = unity_panel_indicators_indicator_entry_get_property;
      G_OBJECT_CLASS (klass)->set_property = unity_panel_indicators_indicator_entry_set_property;
      G_OBJECT_CLASS (klass)->constructor = unity_panel_indicators_indicator_entry_constructor;
      G_OBJECT_CLASS (klass)->finalize = unity_panel_indicators_indicator_entry_finalize;
      g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_ENTRY, g_param_spec_pointer ("entry", "entry", "entry", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
      g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_MENU, g_param_spec_object ("menu", "menu", "menu", GTK_TYPE_MENU, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
      g_signal_new ("menu_moved", UNITY_PANEL_INDICATORS_TYPE_INDICATOR_ENTRY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__ENUM, G_TYPE_NONE, 1, GTK_TYPE_MENU_DIRECTION_TYPE);
}


static void unity_panel_indicators_indicator_entry_instance_init (UnityPanelIndicatorsIndicatorEntry * self) {
      self->priv = UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_GET_PRIVATE (self);
}


static void unity_panel_indicators_indicator_entry_finalize (GObject* obj) {
      UnityPanelIndicatorsIndicatorEntry * self;
      self = UNITY_PANEL_INDICATORS_INDICATOR_ENTRY (obj);
      _g_object_unref0 (self->priv->bg);
      _g_object_unref0 (self->priv->image);
      _g_object_unref0 (self->priv->text);
      G_OBJECT_CLASS (unity_panel_indicators_indicator_entry_parent_class)->finalize (obj);
}


GType unity_panel_indicators_indicator_entry_get_type (void) {
      static volatile gsize unity_panel_indicators_indicator_entry_type_id__volatile = 0;
      if (g_once_init_enter (&unity_panel_indicators_indicator_entry_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (UnityPanelIndicatorsIndicatorEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_panel_indicators_indicator_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityPanelIndicatorsIndicatorEntry), 0, (GInstanceInitFunc) unity_panel_indicators_indicator_entry_instance_init, NULL };
            GType unity_panel_indicators_indicator_entry_type_id;
            unity_panel_indicators_indicator_entry_type_id = g_type_register_static (CTK_TYPE_BOX, "UnityPanelIndicatorsIndicatorEntry", &g_define_type_info, 0);
            g_once_init_leave (&unity_panel_indicators_indicator_entry_type_id__volatile, unity_panel_indicators_indicator_entry_type_id);
      }
      return unity_panel_indicators_indicator_entry_type_id__volatile;
}


static void unity_panel_indicators_indicator_entry_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
      UnityPanelIndicatorsIndicatorEntry * self;
      self = UNITY_PANEL_INDICATORS_INDICATOR_ENTRY (object);
      switch (property_id) {
            case UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_ENTRY:
            g_value_set_pointer (value, unity_panel_indicators_indicator_entry_get_entry (self));
            break;
            case UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_MENU:
            g_value_set_object (value, unity_panel_indicators_indicator_entry_get_menu (self));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void unity_panel_indicators_indicator_entry_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
      UnityPanelIndicatorsIndicatorEntry * self;
      self = UNITY_PANEL_INDICATORS_INDICATOR_ENTRY (object);
      switch (property_id) {
            case UNITY_PANEL_INDICATORS_INDICATOR_ENTRY_ENTRY:
            unity_panel_indicators_indicator_entry_set_entry (self, g_value_get_pointer (value));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static int _vala_strcmp0 (const char * str1, const char * str2) {
      if (str1 == NULL) {
            return -(str1 != str2);
      }
      if (str2 == NULL) {
            return str1 != str2;
      }
      return strcmp (str1, str2);
}





Generated by  Doxygen 1.6.0   Back to index