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

vtgsourceoutlinerview.c

/* vtgsourceoutlinerview.c generated by valac 0.10.0, the Vala compiler
 * generated from vtgsourceoutlinerview.vala, do not modify */

/*
 *  vtgprojectmanagerview.vala - Vala developer toys for GEdit
 *  
 *  Copyright (C) 2008 - Andrea Del Signore <sejerpz@tin.it>
 *  
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *   
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330,
 *  Boston, MA 02111-1307, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <gedit/gedit-window.h>
#include <gedit/gedit-panel.h>
#include <afrodite.h>
#include <valagee.h>
#include <gdk/gdk.h>
#include <gedit/gedit-plugin.h>
#include <gdk-pixbuf/gdk-pixdata.h>
#include <float.h>
#include <math.h>
#include <config.h>


#define VTG_TYPE_COLUMNS (vtg_columns_get_type ())

#define VTG_TYPE_SOURCE_OUTLINER_VIEW (vtg_source_outliner_view_get_type ())
#define VTG_SOURCE_OUTLINER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_SOURCE_OUTLINER_VIEW, VtgSourceOutlinerView))
#define VTG_SOURCE_OUTLINER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_SOURCE_OUTLINER_VIEW, VtgSourceOutlinerViewClass))
#define VTG_IS_SOURCE_OUTLINER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_SOURCE_OUTLINER_VIEW))
#define VTG_IS_SOURCE_OUTLINER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_SOURCE_OUTLINER_VIEW))
#define VTG_SOURCE_OUTLINER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_SOURCE_OUTLINER_VIEW, VtgSourceOutlinerViewClass))

typedef struct _VtgSourceOutlinerView VtgSourceOutlinerView;
typedef struct _VtgSourceOutlinerViewClass VtgSourceOutlinerViewClass;
typedef struct _VtgSourceOutlinerViewPrivate VtgSourceOutlinerViewPrivate;

#define VTG_TYPE_PLUGIN_INSTANCE (vtg_plugin_instance_get_type ())
#define VTG_PLUGIN_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_PLUGIN_INSTANCE, VtgPluginInstance))
#define VTG_PLUGIN_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_PLUGIN_INSTANCE, VtgPluginInstanceClass))
#define VTG_IS_PLUGIN_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_PLUGIN_INSTANCE))
#define VTG_IS_PLUGIN_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_PLUGIN_INSTANCE))
#define VTG_PLUGIN_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_PLUGIN_INSTANCE, VtgPluginInstanceClass))

typedef struct _VtgPluginInstance VtgPluginInstance;
typedef struct _VtgPluginInstanceClass VtgPluginInstanceClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _afrodite_result_item_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_result_item_unref (var), NULL)))
#define _afrodite_source_reference_unref0(var) ((var == NULL) ? NULL : (var = (afrodite_source_reference_unref (var), NULL)))

#define VTG_TYPE_PLUGIN (vtg_plugin_get_type ())
#define VTG_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_PLUGIN, VtgPlugin))
#define VTG_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_PLUGIN, VtgPluginClass))
#define VTG_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_PLUGIN))
#define VTG_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_PLUGIN))
#define VTG_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_PLUGIN, VtgPluginClass))

typedef struct _VtgPlugin VtgPlugin;
typedef struct _VtgPluginClass VtgPluginClass;

#define VTG_TYPE_CONFIGURATION (vtg_configuration_get_type ())
#define VTG_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VTG_TYPE_CONFIGURATION, VtgConfiguration))
#define VTG_CONFIGURATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VTG_TYPE_CONFIGURATION, VtgConfigurationClass))
#define VTG_IS_CONFIGURATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VTG_TYPE_CONFIGURATION))
#define VTG_IS_CONFIGURATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VTG_TYPE_CONFIGURATION))
#define VTG_CONFIGURATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VTG_TYPE_CONFIGURATION, VtgConfigurationClass))

typedef struct _VtgConfiguration VtgConfiguration;
typedef struct _VtgConfigurationClass VtgConfigurationClass;
#define _gdk_event_free0(var) ((var == NULL) ? NULL : (var = (gdk_event_free (var), NULL)))
#define __g_list_free_gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (_g_list_free_gtk_tree_path_free (var), NULL)))
#define _vala_collection_object_unref0(var) ((var == NULL) ? NULL : (var = (vala_collection_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

typedef enum  {
      VTG_COLUMNS_NAME = 0,
      VTG_COLUMNS_ICON,
      VTG_COLUMNS_SYMBOL,
      VTG_COLUMNS_COLUMNS_COUNT
} VtgColumns;

00101 struct _VtgSourceOutlinerView {
      GObject parent_instance;
      VtgSourceOutlinerViewPrivate * priv;
};

00106 struct _VtgSourceOutlinerViewClass {
      GObjectClass parent_class;
};

00110 struct _VtgSourceOutlinerViewPrivate {
      char** qualifiers;
      gint qualifiers_length1;
      gint _qualifiers_size_;
      VtgPluginInstance* _plugin_instance;
      GtkTreeView* _src_view;
      GtkTreeModelSort* _sorted;
      GtkToggleButton* _check_show_private_symbols;
      GtkToggleButton* _check_show_public_symbols;
      GtkToggleButton* _check_show_protected_symbols;
      GtkToggleButton* _check_show_internal_symbols;
      GtkTreeStore* _model;
      GtkMenu* _popup_symbols;
      gboolean _on_show_symbol_scope_toggled_flag;
      guint _popup_symbols_ui_id;
      char* _popup_symbols_ui_def;
      GtkActionGroup* _actions;
      GtkVBox* _side_panel;
};


extern VtgPlugin* vtg_plugin_main_instance;
static gpointer vtg_source_outliner_view_parent_class = NULL;
static GType vtg_source_outliner_view_type_id = 0;

GType vtg_columns_get_type (void) G_GNUC_CONST;
GType vtg_source_outliner_view_get_type (void) G_GNUC_CONST;
GType vtg_source_outliner_view_register_type (GTypeModule * module);
GType vtg_plugin_instance_get_type (void) G_GNUC_CONST;
GType vtg_plugin_instance_register_type (GTypeModule * module);
#define VTG_SOURCE_OUTLINER_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VTG_TYPE_SOURCE_OUTLINER_VIEW, VtgSourceOutlinerViewPrivate))
enum  {
      VTG_SOURCE_OUTLINER_VIEW_DUMMY_PROPERTY,
      VTG_SOURCE_OUTLINER_VIEW_PLUGIN_INSTANCE,
      VTG_SOURCE_OUTLINER_VIEW_SHOW_PRIVATE_SYMBOLS
};
static void vtg_source_outliner_view_on_source_outliner_goto (VtgSourceOutlinerView* self, GtkAction* action);
static void _vtg_source_outliner_view_on_source_outliner_goto_gtk_action_callback (GtkAction* action, gpointer self);
VtgSourceOutlinerView* vtg_source_outliner_view_new (VtgPluginInstance* plugin_instance);
VtgSourceOutlinerView* vtg_source_outliner_view_construct (GType object_type, VtgPluginInstance* plugin_instance);
void vtg_source_outliner_view_deactivate (VtgSourceOutlinerView* self);
GeditWindow* vtg_plugin_instance_get_window (VtgPluginInstance* self);
void vtg_source_outliner_view_clear_view (VtgSourceOutlinerView* self);
void vtg_source_outliner_view_update_view (VtgSourceOutlinerView* self, AfroditeQueryResult* _result_);
static void vtg_source_outliner_view_rebuild_model (VtgSourceOutlinerView* self, ValaList* items, GtkTreeIter* parent_iter);
static void vtg_source_outliner_view_goto_line (VtgSourceOutlinerView* self, AfroditeSymbol* symbol);
static void vtg_source_outliner_view_on_show_symbol_scope_toggled (VtgSourceOutlinerView* self, GtkWidget* sender);
GType vtg_plugin_get_type (void) G_GNUC_CONST;
GType vtg_plugin_register_type (GTypeModule * module);
GType vtg_configuration_get_type (void) G_GNUC_CONST;
GType vtg_configuration_register_type (GTypeModule * module);
VtgConfiguration* vtg_plugin_get_config (VtgPlugin* self);
void vtg_configuration_set_outliner_show_private_symbols (VtgConfiguration* self, gboolean value);
void vtg_configuration_set_outliner_show_public_symbols (VtgConfiguration* self, gboolean value);
void vtg_configuration_set_outliner_show_protected_symbols (VtgConfiguration* self, gboolean value);
void vtg_configuration_set_outliner_show_internal_symbols (VtgConfiguration* self, gboolean value);
static void vtg_source_outliner_view_on_source_outliner_view_row_activated (VtgSourceOutlinerView* self, GtkWidget* sender, GtkTreePath* path, GtkTreeViewColumn* column);
static gboolean vtg_source_outliner_view_on_source_outliner_view_button_press (VtgSourceOutlinerView* self, GtkWidget* sender, GdkEventButton* event);
static void _g_list_free_gtk_tree_path_free (GList* self);
static AfroditeSymbolAccessibility vtg_source_outliner_view_get_symbol_accessibility (VtgSourceOutlinerView* self, AfroditeSymbol* symbol);
GdkPixbuf* vtg_utils_get_icon_for_type_name (const char* type_name);
static gint vtg_source_outliner_view_sort_model (VtgSourceOutlinerView* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b);
gint vtg_utils_symbol_type_compare (AfroditeSymbol* vala, AfroditeSymbol* valb);
static void vtg_source_outliner_view_set_plugin_instance (VtgSourceOutlinerView* self, VtgPluginInstance* value);
gboolean vtg_source_outliner_view_get_show_private_symbols (VtgSourceOutlinerView* self);
static void _vtg_source_outliner_view_on_source_outliner_view_row_activated_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
static gboolean _vtg_source_outliner_view_on_source_outliner_view_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self);
char* vtg_utils_get_image_path (const char* id);
gboolean vtg_configuration_get_outliner_show_public_symbols (VtgConfiguration* self);
static void _vtg_source_outliner_view_on_show_symbol_scope_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self);
gboolean vtg_configuration_get_outliner_show_internal_symbols (VtgConfiguration* self);
gboolean vtg_configuration_get_outliner_show_protected_symbols (VtgConfiguration* self);
gboolean vtg_configuration_get_outliner_show_private_symbols (VtgConfiguration* self);
static gint _vtg_source_outliner_view_sort_model_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self);
static GObject * vtg_source_outliner_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static void vtg_source_outliner_view_finalize (GObject* obj);
static void vtg_source_outliner_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void vtg_source_outliner_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static int _vala_strcmp0 (const char * str1, const char * str2);

static const GtkActionEntry VTG_SOURCE_OUTLINER_VIEW__action_entries[1] = {{"source-outliner-goto", GTK_STOCK_OPEN, N_ ("Goto definition..."), NULL, N_ ("Goto symbol definition"), (GCallback) _vtg_source_outliner_view_on_source_outliner_goto_gtk_action_callback}};

static void g_cclosure_user_marshal_VOID__INT_INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);

GType vtg_columns_get_type (void) {
      static volatile gsize vtg_columns_type_id__volatile = 0;
      if (g_once_init_enter (&vtg_columns_type_id__volatile)) {
            static const GEnumValue values[] = {{VTG_COLUMNS_NAME, "VTG_COLUMNS_NAME", "name"}, {VTG_COLUMNS_ICON, "VTG_COLUMNS_ICON", "icon"}, {VTG_COLUMNS_SYMBOL, "VTG_COLUMNS_SYMBOL", "symbol"}, {VTG_COLUMNS_COLUMNS_COUNT, "VTG_COLUMNS_COLUMNS_COUNT", "columns-count"}, {0, NULL, NULL}};
            GType vtg_columns_type_id;
            vtg_columns_type_id = g_enum_register_static ("VtgColumns", values);
            g_once_init_leave (&vtg_columns_type_id__volatile, vtg_columns_type_id);
      }
      return vtg_columns_type_id__volatile;
}


static void _vtg_source_outliner_view_on_source_outliner_goto_gtk_action_callback (GtkAction* action, gpointer self) {
      vtg_source_outliner_view_on_source_outliner_goto (self, action);
}


VtgSourceOutlinerView* vtg_source_outliner_view_construct (GType object_type, VtgPluginInstance* plugin_instance) {
      VtgSourceOutlinerView * self;
      g_return_val_if_fail (plugin_instance != NULL, NULL);
      self = (VtgSourceOutlinerView*) g_object_new (object_type, "plugin-instance", plugin_instance, NULL);
      return self;
}


VtgSourceOutlinerView* vtg_source_outliner_view_new (VtgPluginInstance* plugin_instance) {
      return vtg_source_outliner_view_construct (VTG_TYPE_SOURCE_OUTLINER_VIEW, plugin_instance);
}


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


void vtg_source_outliner_view_deactivate (VtgSourceOutlinerView* self) {
      GtkUIManager* manager;
      GeditPanel* panel;
      g_return_if_fail (self != NULL);
      manager = _g_object_ref0 (gedit_window_get_ui_manager (vtg_plugin_instance_get_window (self->priv->_plugin_instance)));
      gtk_ui_manager_remove_action_group (manager, self->priv->_actions);
      panel = _g_object_ref0 (gedit_window_get_side_panel (vtg_plugin_instance_get_window (self->priv->_plugin_instance)));
      gedit_panel_remove_item (panel, (GtkWidget*) self->priv->_side_panel);
      _g_object_unref0 (panel);
      _g_object_unref0 (manager);
}


void vtg_source_outliner_view_clear_view (VtgSourceOutlinerView* self) {
      g_return_if_fail (self != NULL);
      gtk_tree_store_clear (self->priv->_model);
}


void vtg_source_outliner_view_update_view (VtgSourceOutlinerView* self, AfroditeQueryResult* _result_) {
      gboolean _tmp0_ = FALSE;
      g_return_if_fail (self != NULL);
      gtk_tree_view_set_model (self->priv->_src_view, NULL);
      vtg_source_outliner_view_clear_view (self);
      if (_result_ != NULL) {
            _tmp0_ = !afrodite_query_result_get_is_empty (_result_);
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            AfroditeResultItem* first;
            first = (AfroditeResultItem*) vala_list_get (afrodite_query_result_get_children (_result_), 0);
            vtg_source_outliner_view_rebuild_model (self, afrodite_result_item_get_children (first), NULL);
            _afrodite_result_item_unref0 (first);
      }
      gtk_tree_view_set_model (self->priv->_src_view, (GtkTreeModel*) self->priv->_sorted);
      gtk_tree_view_expand_all (self->priv->_src_view);
}


static void vtg_source_outliner_view_goto_line (VtgSourceOutlinerView* self, AfroditeSymbol* symbol) {
      g_return_if_fail (self != NULL);
      g_return_if_fail (symbol != NULL);
      if (afrodite_symbol_get_has_source_references (symbol)) {
            AfroditeSourceReference* sr;
            gint line;
            gint start_col;
            gint end_col;
            sr = (AfroditeSourceReference*) vala_list_get (afrodite_symbol_get_source_references (symbol), 0);
            line = afrodite_source_reference_get_first_line (sr);
            start_col = afrodite_source_reference_get_first_column (sr);
            end_col = afrodite_source_reference_get_last_column (sr);
            g_signal_emit_by_name (self, "goto-source", line, start_col, end_col);
            _afrodite_source_reference_unref0 (sr);
      }
}


static void vtg_source_outliner_view_on_show_symbol_scope_toggled (VtgSourceOutlinerView* self, GtkWidget* sender) {
      GdkEvent* event;
      g_return_if_fail (self != NULL);
      g_return_if_fail (sender != NULL);
      if (self->priv->_on_show_symbol_scope_toggled_flag) {
            return;
      }
      event = gtk_get_current_event ();
      if ((event->button.state & GDK_SHIFT_MASK) != 0) {
            gboolean active;
            active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sender));
            self->priv->_on_show_symbol_scope_toggled_flag = TRUE;
            if (GTK_WIDGET (self->priv->_check_show_internal_symbols) != sender) {
                  gtk_toggle_button_set_active (self->priv->_check_show_internal_symbols, !active);
            }
            if (GTK_WIDGET (self->priv->_check_show_private_symbols) != sender) {
                  gtk_toggle_button_set_active (self->priv->_check_show_private_symbols, !active);
            }
            if (GTK_WIDGET (self->priv->_check_show_protected_symbols) != sender) {
                  gtk_toggle_button_set_active (self->priv->_check_show_protected_symbols, !active);
            }
            if (GTK_WIDGET (self->priv->_check_show_public_symbols) != sender) {
                  gtk_toggle_button_set_active (self->priv->_check_show_public_symbols, !active);
            }
            self->priv->_on_show_symbol_scope_toggled_flag = FALSE;
      }
      vtg_configuration_set_outliner_show_private_symbols (vtg_plugin_get_config (vtg_plugin_main_instance), gtk_toggle_button_get_active (self->priv->_check_show_private_symbols));
      vtg_configuration_set_outliner_show_public_symbols (vtg_plugin_get_config (vtg_plugin_main_instance), gtk_toggle_button_get_active (self->priv->_check_show_public_symbols));
      vtg_configuration_set_outliner_show_protected_symbols (vtg_plugin_get_config (vtg_plugin_main_instance), gtk_toggle_button_get_active (self->priv->_check_show_protected_symbols));
      vtg_configuration_set_outliner_show_internal_symbols (vtg_plugin_get_config (vtg_plugin_main_instance), gtk_toggle_button_get_active (self->priv->_check_show_internal_symbols));
      g_signal_emit_by_name (self, "filter-changed");
      _gdk_event_free0 (event);
}


static void vtg_source_outliner_view_on_source_outliner_view_row_activated (VtgSourceOutlinerView* self, GtkWidget* sender, GtkTreePath* path, GtkTreeViewColumn* column) {
      GtkTreeView* tw;
      GtkTreeModelSort* model;
      GtkTreeIter iter = {0};
      g_return_if_fail (self != NULL);
      g_return_if_fail (sender != NULL);
      g_return_if_fail (path != NULL);
      g_return_if_fail (column != NULL);
      tw = _g_object_ref0 (GTK_TREE_VIEW (sender));
      model = _g_object_ref0 (GTK_TREE_MODEL_SORT (gtk_tree_view_get_model (tw)));
      if (gtk_tree_model_get_iter ((GtkTreeModel*) model, &iter, path)) {
            AfroditeSymbol* symbol;
            symbol = NULL;
            gtk_tree_model_get ((GtkTreeModel*) model, &iter, VTG_COLUMNS_SYMBOL, &symbol, -1);
            vtg_source_outliner_view_goto_line (self, symbol);
            _g_object_unref0 (symbol);
      }
      _g_object_unref0 (model);
      _g_object_unref0 (tw);
}


static void vtg_source_outliner_view_on_source_outliner_goto (VtgSourceOutlinerView* self, GtkAction* action) {
      GtkTreeIter iter = {0};
      GtkTreeModel* model;
      GtkTreeModel* _tmp0_ = NULL;
      gboolean _tmp1_;
      GtkTreeModel* _tmp2_;
      g_return_if_fail (self != NULL);
      g_return_if_fail (action != NULL);
      model = NULL;
      if ((_tmp1_ = gtk_tree_selection_get_selected (gtk_tree_view_get_selection (self->priv->_src_view), &_tmp0_, &iter), model = (_tmp2_ = _g_object_ref0 (_tmp0_), _g_object_unref0 (model), _tmp2_), _tmp1_)) {
            AfroditeSymbol* symbol;
            symbol = NULL;
            gtk_tree_model_get (model, &iter, VTG_COLUMNS_SYMBOL, &symbol, -1);
            vtg_source_outliner_view_goto_line (self, symbol);
            _g_object_unref0 (symbol);
      }
      _g_object_unref0 (model);
}


static void _g_list_free_gtk_tree_path_free (GList* self) {
      g_list_foreach (self, (GFunc) gtk_tree_path_free, NULL);
      g_list_free (self);
}


static gboolean vtg_source_outliner_view_on_source_outliner_view_button_press (VtgSourceOutlinerView* self, GtkWidget* sender, GdkEventButton* event) {
      gboolean result = FALSE;
      g_return_val_if_fail (self != NULL, FALSE);
      g_return_val_if_fail (sender != NULL, FALSE);
      if ((*event).button == 3) {
            GtkTreeModel* model;
            GList* rows;
            model = NULL;
            rows = gtk_tree_selection_get_selected_rows (gtk_tree_view_get_selection (self->priv->_src_view), &model);
            if (g_list_length (rows) == 1) {
                  GtkTreeIter iter = {0};
                  GObject* obj;
                  GtkTreePath* path;
                  obj = NULL;
                  path = (GtkTreePath*) g_list_nth_data (rows, (guint) 0);
                  gtk_tree_model_get_iter (model, &iter, path);
                  gtk_tree_model_get (model, &iter, VTG_COLUMNS_SYMBOL, &obj, -1);
                  if (AFRODITE_IS_SYMBOL (obj)) {
                        gtk_menu_popup (self->priv->_popup_symbols, NULL, NULL, NULL, NULL, (*event).button, (*event).time);
                  }
                  _g_object_unref0 (obj);
            }
            __g_list_free_gtk_tree_path_free0 (rows);
      }
      result = FALSE;
      return result;
}


static AfroditeSymbolAccessibility vtg_source_outliner_view_get_symbol_accessibility (VtgSourceOutlinerView* self, AfroditeSymbol* symbol) {
      AfroditeSymbolAccessibility result = 0;
      AfroditeSymbolAccessibility sym_access = 0;
      gboolean _tmp0_ = FALSE;
      gboolean _tmp1_ = FALSE;
      g_return_val_if_fail (self != NULL, 0);
      g_return_val_if_fail (symbol != NULL, 0);
      if (afrodite_symbol_get_has_children (symbol)) {
            _tmp1_ = !g_str_has_prefix (afrodite_symbol_get_name (symbol), "!");
      } else {
            _tmp1_ = FALSE;
      }
      if (_tmp1_) {
            gboolean _tmp2_ = FALSE;
            gboolean _tmp3_ = FALSE;
            if (_vala_strcmp0 (afrodite_symbol_get_type_name (symbol), "Class") == 0) {
                  _tmp3_ = TRUE;
            } else {
                  _tmp3_ = _vala_strcmp0 (afrodite_symbol_get_type_name (symbol), "Struct") == 0;
            }
            if (_tmp3_) {
                  _tmp2_ = TRUE;
            } else {
                  _tmp2_ = _vala_strcmp0 (afrodite_symbol_get_type_name (symbol), "Namespace") == 0;
            }
            _tmp0_ = _tmp2_;
      } else {
            _tmp0_ = FALSE;
      }
      if (_tmp0_) {
            sym_access = afrodite_symbol_get_access (symbol);
            {
                  ValaIterator* _child_it;
                  _child_it = vala_iterable_iterator ((ValaIterable*) afrodite_symbol_get_children (symbol));
                  while (TRUE) {
                        AfroditeSymbol* child;
                        if (!vala_iterator_next (_child_it)) {
                              break;
                        }
                        child = (AfroditeSymbol*) vala_iterator_get (_child_it);
                        sym_access = sym_access | vtg_source_outliner_view_get_symbol_accessibility (self, child);
                        if (sym_access == AFRODITE_SYMBOL_ACCESSIBILITY_ANY) {
                              _g_object_unref0 (child);
                              break;
                        }
                        _g_object_unref0 (child);
                  }
                  _vala_collection_object_unref0 (_child_it);
            }
      } else {
            sym_access = afrodite_symbol_get_access (symbol);
      }
      result = sym_access;
      return result;
}


static glong string_get_length (const char* self) {
      glong result;
      g_return_val_if_fail (self != NULL, 0L);
      result = g_utf8_strlen (self, (gssize) (-1));
      return result;
}


static char* string_substring (const char* self, glong offset, glong len) {
      char* result = NULL;
      glong string_length;
      const char* start;
      g_return_val_if_fail (self != NULL, NULL);
      string_length = string_get_length (self);
      if (offset < 0) {
            offset = string_length + offset;
            g_return_val_if_fail (offset >= 0, NULL);
      } else {
            g_return_val_if_fail (offset <= string_length, NULL);
      }
      if (len < 0) {
            len = string_length - offset;
      }
      g_return_val_if_fail ((offset + len) <= string_length, NULL);
      start = g_utf8_offset_to_pointer (self, offset);
      result = g_strndup (start, ((gchar*) g_utf8_offset_to_pointer (start, len)) - ((gchar*) start));
      return result;
}


static void vtg_source_outliner_view_rebuild_model (VtgSourceOutlinerView* self, ValaList* items, GtkTreeIter* parent_iter) {
      gboolean _tmp0_ = FALSE;
      AfroditeSymbolAccessibility accessibility;
      g_return_if_fail (self != NULL);
      if (items == NULL) {
            _tmp0_ = TRUE;
      } else {
            _tmp0_ = vala_collection_get_size ((ValaCollection*) items) == 0;
      }
      if (_tmp0_) {
            return;
      }
      accessibility = 0;
      if (gtk_toggle_button_get_active (self->priv->_check_show_private_symbols)) {
            accessibility = AFRODITE_SYMBOL_ACCESSIBILITY_PRIVATE;
      }
      if (gtk_toggle_button_get_active (self->priv->_check_show_public_symbols)) {
            accessibility = accessibility | AFRODITE_SYMBOL_ACCESSIBILITY_PUBLIC;
      }
      if (gtk_toggle_button_get_active (self->priv->_check_show_protected_symbols)) {
            accessibility = accessibility | AFRODITE_SYMBOL_ACCESSIBILITY_PROTECTED;
      }
      if (gtk_toggle_button_get_active (self->priv->_check_show_internal_symbols)) {
            accessibility = accessibility | AFRODITE_SYMBOL_ACCESSIBILITY_INTERNAL;
      }
      {
            ValaIterator* _item_it;
            _item_it = vala_iterable_iterator ((ValaIterable*) items);
            while (TRUE) {
                  AfroditeResultItem* item;
                  GtkTreeIter iter = {0};
                  AfroditeSymbol* symbol;
                  AfroditeSymbolAccessibility sym_access;
                  gboolean _tmp1_ = FALSE;
                  if (!vala_iterator_next (_item_it)) {
                        break;
                  }
                  item = (AfroditeResultItem*) vala_iterator_get (_item_it);
                  symbol = _g_object_ref0 (afrodite_result_item_get_symbol (item));
                  sym_access = vtg_source_outliner_view_get_symbol_accessibility (self, symbol);
                  if (!g_str_has_prefix (afrodite_symbol_get_name (symbol), "!")) {
                        _tmp1_ = (sym_access & accessibility) != 0;
                  } else {
                        _tmp1_ = FALSE;
                  }
                  if (_tmp1_) {
                        char* des;
                        GdkPixbuf* _tmp3_;
                        des = g_strdup (afrodite_symbol_get_markup_description (symbol));
                        {
                              char** qualifier_collection;
                              int qualifier_collection_length1;
                              int qualifier_it;
                              qualifier_collection = self->priv->qualifiers;
                              qualifier_collection_length1 = self->priv->qualifiers_length1;
                              for (qualifier_it = 0; qualifier_it < self->priv->qualifiers_length1; qualifier_it = qualifier_it + 1) {
                                    char* qualifier;
                                    qualifier = g_strdup (qualifier_collection[qualifier_it]);
                                    {
                                          if (g_str_has_prefix (des, qualifier)) {
                                                char* _tmp2_;
                                                des = (_tmp2_ = string_substring (des, string_get_length (qualifier), -1), _g_free0 (des), _tmp2_);
                                                _g_free0 (qualifier);
                                                break;
                                          }
                                          _g_free0 (qualifier);
                                    }
                              }
                        }
                        gtk_tree_store_append (self->priv->_model, &iter, parent_iter);
                        gtk_tree_store_set (self->priv->_model, &iter, VTG_COLUMNS_NAME, des, VTG_COLUMNS_ICON, _tmp3_ = vtg_utils_get_icon_for_type_name (afrodite_symbol_get_type_name (symbol)), VTG_COLUMNS_SYMBOL, symbol, -1);
                        _g_object_unref0 (_tmp3_);
                        if (vala_collection_get_size ((ValaCollection*) afrodite_result_item_get_children (item)) > 0) {
                              vtg_source_outliner_view_rebuild_model (self, afrodite_result_item_get_children (item), &iter);
                        }
                        _g_free0 (des);
                  }
                  _g_object_unref0 (symbol);
                  _afrodite_result_item_unref0 (item);
            }
            _vala_collection_object_unref0 (_item_it);
      }
}


static gint vtg_source_outliner_view_sort_model (VtgSourceOutlinerView* self, GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b) {
      gint result = 0;
      AfroditeSymbol* vala;
      AfroditeSymbol* valb;
      gint _result_;
      g_return_val_if_fail (self != NULL, 0);
      g_return_val_if_fail (model != NULL, 0);
      vala = NULL;
      valb = NULL;
      gtk_tree_model_get (model, a, VTG_COLUMNS_SYMBOL, &vala, -1);
      gtk_tree_model_get (model, b, VTG_COLUMNS_SYMBOL, &valb, -1);
      _result_ = vtg_utils_symbol_type_compare (vala, valb);
      result = _result_;
      _g_object_unref0 (valb);
      _g_object_unref0 (vala);
      return result;
}


static void vtg_source_outliner_view_set_plugin_instance (VtgSourceOutlinerView* self, VtgPluginInstance* value) {
      g_return_if_fail (self != NULL);
      self->priv->_plugin_instance = value;
      g_object_notify ((GObject *) self, "plugin-instance");
}


gboolean vtg_source_outliner_view_get_show_private_symbols (VtgSourceOutlinerView* self) {
      gboolean result;
      g_return_val_if_fail (self != NULL, FALSE);
      result = gtk_toggle_button_get_active (self->priv->_check_show_private_symbols);
      return result;
}


static void _vtg_source_outliner_view_on_source_outliner_view_row_activated_gtk_tree_view_row_activated (GtkTreeView* _sender, GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
      vtg_source_outliner_view_on_source_outliner_view_row_activated (self, _sender, path, column);
}


static gboolean _vtg_source_outliner_view_on_source_outliner_view_button_press_gtk_widget_button_press_event (GtkWidget* _sender, GdkEventButton* event, gpointer self) {
      gboolean result;
      result = vtg_source_outliner_view_on_source_outliner_view_button_press (self, _sender, event);
      return result;
}


static void _vtg_source_outliner_view_on_show_symbol_scope_toggled_gtk_toggle_button_toggled (GtkToggleButton* _sender, gpointer self) {
      vtg_source_outliner_view_on_show_symbol_scope_toggled (self, _sender);
}


static gint _vtg_source_outliner_view_sort_model_gtk_tree_iter_compare_func (GtkTreeModel* model, GtkTreeIter* a, GtkTreeIter* b, gpointer self) {
      gint result;
      result = vtg_source_outliner_view_sort_model (self, model, a, b);
      return result;
}


static GObject * vtg_source_outliner_view_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
      GObject * obj;
      GObjectClass * parent_class;
      VtgSourceOutlinerView * self;
      GError * _inner_error_;
      parent_class = G_OBJECT_CLASS (vtg_source_outliner_view_parent_class);
      obj = parent_class->constructor (type, n_construct_properties, construct_properties);
      self = VTG_SOURCE_OUTLINER_VIEW (obj);
      _inner_error_ = NULL;
      {
            GeditPanel* panel;
            GtkVBox* _tmp1_;
            GtkTreeView* _tmp2_;
            GtkTreeViewColumn* column;
            GtkCellRenderer* renderer;
            GtkCellRenderer* _tmp3_;
            GtkScrolledWindow* scroll;
            GtkHBox* hbox;
            GtkLabel* label;
            GtkToggleButton* _tmp4_;
            char* _tmp5_;
            GtkImage* _tmp6_;
            GtkImage* image;
            GtkToggleButton* _tmp7_;
            char* _tmp8_;
            GtkImage* _tmp9_;
            GtkToggleButton* _tmp10_;
            char* _tmp11_;
            GtkImage* _tmp12_;
            GtkToggleButton* _tmp13_;
            char* _tmp14_;
            GtkImage* _tmp15_;
            GdkPixbuf* _tmp16_;
            GtkImage* _tmp17_;
            GtkImage* icon;
            GtkActionGroup* _tmp18_;
            GtkUIManager* manager;
            GtkTreeStore* _tmp21_;
            GtkTreeModelSort* _tmp22_;
            panel = _g_object_ref0 (gedit_window_get_side_panel (vtg_plugin_instance_get_window (self->priv->_plugin_instance)));
            self->priv->_side_panel = (_tmp1_ = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 8)), _g_object_unref0 (self->priv->_side_panel), _tmp1_);
            self->priv->_src_view = (_tmp2_ = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ()), _g_object_unref0 (self->priv->_src_view), _tmp2_);
            column = g_object_ref_sink (gtk_tree_view_column_new ());
            renderer = (GtkCellRenderer*) g_object_ref_sink ((GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ());
            gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, FALSE);
            gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "pixbuf", (gint) VTG_COLUMNS_ICON);
            renderer = (_tmp3_ = (GtkCellRenderer*) g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ()), _g_object_unref0 (renderer), _tmp3_);
            gtk_cell_layout_pack_start ((GtkCellLayout*) column, renderer, TRUE);
            gtk_cell_layout_add_attribute ((GtkCellLayout*) column, renderer, "markup", (gint) VTG_COLUMNS_NAME);
            gtk_tree_view_append_column (self->priv->_src_view, column);
            gtk_tree_view_set_headers_visible (self->priv->_src_view, FALSE);
            g_signal_connect_object (self->priv->_src_view, "row-activated", (GCallback) _vtg_source_outliner_view_on_source_outliner_view_row_activated_gtk_tree_view_row_activated, self, 0);
            g_signal_connect_object ((GtkWidget*) self->priv->_src_view, "button-press-event", (GCallback) _vtg_source_outliner_view_on_source_outliner_view_button_press_gtk_widget_button_press_event, self, 0);
            scroll = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
            gtk_container_add ((GtkContainer*) scroll, (GtkWidget*) self->priv->_src_view);
            gtk_box_pack_start ((GtkBox*) self->priv->_side_panel, (GtkWidget*) scroll, TRUE, TRUE, (guint) 4);
            hbox = g_object_ref_sink ((GtkHBox*) gtk_hbox_new (FALSE, 0));
            gtk_box_pack_start ((GtkBox*) self->priv->_side_panel, (GtkWidget*) hbox, FALSE, FALSE, (guint) 4);
            label = g_object_ref_sink ((GtkLabel*) gtk_label_new (_ ("Filter by scope:")));
            g_object_set ((GtkMisc*) label, "xalign", (float) 0, NULL);
            gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) label, FALSE, FALSE, (guint) 4);
            self->priv->_check_show_public_symbols = (_tmp4_ = g_object_ref_sink ((GtkToggleButton*) gtk_toggle_button_new ()), _g_object_unref0 (self->priv->_check_show_public_symbols), _tmp4_);
            image = (_tmp6_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_file (_tmp5_ = vtg_utils_get_image_path ("public-symbols-22.png"))), _g_free0 (_tmp5_), _tmp6_);
            gtk_button_set_image ((GtkButton*) self->priv->_check_show_public_symbols, (GtkWidget*) image);
            gtk_widget_set_tooltip_text ((GtkWidget*) self->priv->_check_show_public_symbols, _ ("Show public symbols"));
            gtk_toggle_button_set_active (self->priv->_check_show_public_symbols, vtg_configuration_get_outliner_show_public_symbols (vtg_plugin_get_config (vtg_plugin_main_instance)));
            g_signal_connect_object (self->priv->_check_show_public_symbols, "toggled", (GCallback) _vtg_source_outliner_view_on_show_symbol_scope_toggled_gtk_toggle_button_toggled, self, 0);
            gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->_check_show_public_symbols, FALSE, TRUE, (guint) 4);
            self->priv->_check_show_internal_symbols = (_tmp7_ = g_object_ref_sink ((GtkToggleButton*) gtk_toggle_button_new ()), _g_object_unref0 (self->priv->_check_show_internal_symbols), _tmp7_);
            image = (_tmp9_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_file (_tmp8_ = vtg_utils_get_image_path ("internal-symbols-22.png"))), _g_object_unref0 (image), _tmp9_);
            _g_free0 (_tmp8_);
            gtk_button_set_image ((GtkButton*) self->priv->_check_show_internal_symbols, (GtkWidget*) image);
            gtk_widget_set_tooltip_text ((GtkWidget*) self->priv->_check_show_internal_symbols, _ ("Show internal symbols"));
            gtk_toggle_button_set_active (self->priv->_check_show_internal_symbols, vtg_configuration_get_outliner_show_internal_symbols (vtg_plugin_get_config (vtg_plugin_main_instance)));
            g_signal_connect_object (self->priv->_check_show_internal_symbols, "toggled", (GCallback) _vtg_source_outliner_view_on_show_symbol_scope_toggled_gtk_toggle_button_toggled, self, 0);
            gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->_check_show_internal_symbols, FALSE, TRUE, (guint) 4);
            self->priv->_check_show_protected_symbols = (_tmp10_ = g_object_ref_sink ((GtkToggleButton*) gtk_toggle_button_new ()), _g_object_unref0 (self->priv->_check_show_protected_symbols), _tmp10_);
            image = (_tmp12_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_file (_tmp11_ = vtg_utils_get_image_path ("protected-symbols-22.png"))), _g_object_unref0 (image), _tmp12_);
            _g_free0 (_tmp11_);
            gtk_button_set_image ((GtkButton*) self->priv->_check_show_protected_symbols, (GtkWidget*) image);
            gtk_widget_set_tooltip_text ((GtkWidget*) self->priv->_check_show_protected_symbols, _ ("Show protected symbols"));
            gtk_toggle_button_set_active (self->priv->_check_show_protected_symbols, vtg_configuration_get_outliner_show_protected_symbols (vtg_plugin_get_config (vtg_plugin_main_instance)));
            g_signal_connect_object (self->priv->_check_show_protected_symbols, "toggled", (GCallback) _vtg_source_outliner_view_on_show_symbol_scope_toggled_gtk_toggle_button_toggled, self, 0);
            gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->_check_show_protected_symbols, FALSE, TRUE, (guint) 4);
            self->priv->_check_show_private_symbols = (_tmp13_ = g_object_ref_sink ((GtkToggleButton*) gtk_toggle_button_new ()), _g_object_unref0 (self->priv->_check_show_private_symbols), _tmp13_);
            image = (_tmp15_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_file (_tmp14_ = vtg_utils_get_image_path ("private-symbols-22.png"))), _g_object_unref0 (image), _tmp15_);
            _g_free0 (_tmp14_);
            gtk_button_set_image ((GtkButton*) self->priv->_check_show_private_symbols, (GtkWidget*) image);
            gtk_widget_set_tooltip_text ((GtkWidget*) self->priv->_check_show_private_symbols, _ ("Show private symbols"));
            gtk_toggle_button_set_active (self->priv->_check_show_private_symbols, vtg_configuration_get_outliner_show_private_symbols (vtg_plugin_get_config (vtg_plugin_main_instance)));
            g_signal_connect_object (self->priv->_check_show_private_symbols, "toggled", (GCallback) _vtg_source_outliner_view_on_show_symbol_scope_toggled_gtk_toggle_button_toggled, self, 0);
            gtk_box_pack_start ((GtkBox*) hbox, (GtkWidget*) self->priv->_check_show_private_symbols, FALSE, TRUE, (guint) 4);
            gtk_widget_show_all ((GtkWidget*) self->priv->_side_panel);
            icon = (_tmp17_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_pixbuf (_tmp16_ = vtg_utils_get_icon_for_type_name ("Class"))), _g_object_unref0 (_tmp16_), _tmp17_);
            gedit_panel_add_item (panel, (GtkWidget*) self->priv->_side_panel, _ ("Source"), (GtkWidget*) icon);
            gedit_panel_activate_item (panel, (GtkWidget*) self->priv->_side_panel);
            self->priv->_actions = (_tmp18_ = gtk_action_group_new ("SourceOutlinerActionGroup"), _g_object_unref0 (self->priv->_actions), _tmp18_);
            gtk_action_group_set_translation_domain (self->priv->_actions, GETTEXT_PACKAGE);
            gtk_action_group_add_actions (self->priv->_actions, VTG_SOURCE_OUTLINER_VIEW__action_entries, G_N_ELEMENTS (VTG_SOURCE_OUTLINER_VIEW__action_entries), self);
            manager = _g_object_ref0 (gedit_window_get_ui_manager (vtg_plugin_instance_get_window (self->priv->_plugin_instance)));
            gtk_ui_manager_insert_action_group (manager, self->priv->_actions, -1);
            {
                  guint _tmp19_;
                  GtkMenu* _tmp20_;
                  _tmp19_ = gtk_ui_manager_add_ui_from_string (manager, self->priv->_popup_symbols_ui_def, (gssize) (-1), &_inner_error_);
                  if (_inner_error_ != NULL) {
                        goto __catch55_g_error;
                  }
                  self->priv->_popup_symbols_ui_id = _tmp19_;
                  self->priv->_popup_symbols = (_tmp20_ = _g_object_ref0 (GTK_MENU (gtk_ui_manager_get_widget (manager, "/SourceOutlinerPopupGoto"))), _g_object_unref0 (self->priv->_popup_symbols), _tmp20_);
                  g_assert (self->priv->_popup_symbols != NULL);
            }
            goto __finally55;
            __catch55_g_error:
            {
                  GError * err;
                  err = _inner_error_;
                  _inner_error_ = NULL;
                  {
                        g_warning ("vtgsourceoutlinerview.vala:183: Error %s", err->message);
                        _g_error_free0 (err);
                  }
            }
            __finally55:
            if (_inner_error_ != NULL) {
                  _g_object_unref0 (manager);
                  _g_object_unref0 (icon);
                  _g_object_unref0 (image);
                  _g_object_unref0 (label);
                  _g_object_unref0 (hbox);
                  _g_object_unref0 (scroll);
                  _g_object_unref0 (renderer);
                  _g_object_unref0 (column);
                  _g_object_unref0 (panel);
                  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_);
            }
            self->priv->_model = (_tmp21_ = gtk_tree_store_new ((gint) VTG_COLUMNS_COLUMNS_COUNT, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_OBJECT), _g_object_unref0 (self->priv->_model), _tmp21_);
            self->priv->_sorted = (_tmp22_ = (GtkTreeModelSort*) gtk_tree_model_sort_new_with_model ((GtkTreeModel*) self->priv->_model), _g_object_unref0 (self->priv->_sorted), _tmp22_);
            gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) self->priv->_sorted, 0, GTK_SORT_ASCENDING);
            gtk_tree_sortable_set_sort_func ((GtkTreeSortable*) self->priv->_sorted, 0, _vtg_source_outliner_view_sort_model_gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
            gtk_tree_sortable_set_default_sort_func ((GtkTreeSortable*) self->priv->_sorted, _vtg_source_outliner_view_sort_model_gtk_tree_iter_compare_func, g_object_ref (self), g_object_unref);
            gtk_tree_view_set_model (self->priv->_src_view, (GtkTreeModel*) self->priv->_sorted);
            _g_object_unref0 (manager);
            _g_object_unref0 (icon);
            _g_object_unref0 (image);
            _g_object_unref0 (label);
            _g_object_unref0 (hbox);
            _g_object_unref0 (scroll);
            _g_object_unref0 (renderer);
            _g_object_unref0 (column);
            _g_object_unref0 (panel);
      }
      return obj;
}


static void vtg_source_outliner_view_class_init (VtgSourceOutlinerViewClass * klass) {
      vtg_source_outliner_view_parent_class = g_type_class_peek_parent (klass);
      g_type_class_add_private (klass, sizeof (VtgSourceOutlinerViewPrivate));
      G_OBJECT_CLASS (klass)->get_property = vtg_source_outliner_view_get_property;
      G_OBJECT_CLASS (klass)->set_property = vtg_source_outliner_view_set_property;
      G_OBJECT_CLASS (klass)->constructor = vtg_source_outliner_view_constructor;
      G_OBJECT_CLASS (klass)->finalize = vtg_source_outliner_view_finalize;
      g_object_class_install_property (G_OBJECT_CLASS (klass), VTG_SOURCE_OUTLINER_VIEW_PLUGIN_INSTANCE, g_param_spec_object ("plugin-instance", "plugin-instance", "plugin-instance", VTG_TYPE_PLUGIN_INSTANCE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
      g_object_class_install_property (G_OBJECT_CLASS (klass), VTG_SOURCE_OUTLINER_VIEW_SHOW_PRIVATE_SYMBOLS, g_param_spec_boolean ("show-private-symbols", "show-private-symbols", "show-private-symbols", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
      g_signal_new ("goto_source", VTG_TYPE_SOURCE_OUTLINER_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_INT_INT, G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
      g_signal_new ("filter_changed", VTG_TYPE_SOURCE_OUTLINER_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void vtg_source_outliner_view_instance_init (VtgSourceOutlinerView * self) {
      char** _tmp0_ = NULL;
      self->priv = VTG_SOURCE_OUTLINER_VIEW_GET_PRIVATE (self);
      self->priv->qualifiers = (_tmp0_ = g_new0 (char*, 4 + 1), _tmp0_[0] = g_strdup ("public "), _tmp0_[1] = g_strdup ("private "), _tmp0_[2] = g_strdup ("internal "), _tmp0_[3] = g_strdup ("protected "), _tmp0_);
      self->priv->qualifiers_length1 = 4;
      self->priv->_qualifiers_size_ = self->priv->qualifiers_length1;
      self->priv->_plugin_instance = NULL;
      self->priv->_model = NULL;
      self->priv->_on_show_symbol_scope_toggled_flag = FALSE;
      self->priv->_popup_symbols_ui_def = g_strdup ("\n" \
"                                        <ui>\n" \
"                                        <popup name='SourceOutlinerPop" \
"upGoto'>\n" \
"                                            <menuitem action='source-o" \
"utliner-goto'/>\n" \
"                                        </popup>\n" \
"                                        </ui>");
}


static void vtg_source_outliner_view_finalize (GObject* obj) {
      VtgSourceOutlinerView * self;
      self = VTG_SOURCE_OUTLINER_VIEW (obj);
      {
            gtk_tree_view_set_model (self->priv->_src_view, NULL);
            vtg_source_outliner_view_deactivate (self);
      }
      self->priv->qualifiers = (_vala_array_free (self->priv->qualifiers, self->priv->qualifiers_length1, (GDestroyNotify) g_free), NULL);
      _g_object_unref0 (self->priv->_src_view);
      _g_object_unref0 (self->priv->_sorted);
      _g_object_unref0 (self->priv->_check_show_private_symbols);
      _g_object_unref0 (self->priv->_check_show_public_symbols);
      _g_object_unref0 (self->priv->_check_show_protected_symbols);
      _g_object_unref0 (self->priv->_check_show_internal_symbols);
      _g_object_unref0 (self->priv->_model);
      _g_object_unref0 (self->priv->_popup_symbols);
      _g_free0 (self->priv->_popup_symbols_ui_def);
      _g_object_unref0 (self->priv->_actions);
      _g_object_unref0 (self->priv->_side_panel);
      G_OBJECT_CLASS (vtg_source_outliner_view_parent_class)->finalize (obj);
}


GType vtg_source_outliner_view_get_type (void) {
      return vtg_source_outliner_view_type_id;
}


GType vtg_source_outliner_view_register_type (GTypeModule * module) {
      static const GTypeInfo g_define_type_info = { sizeof (VtgSourceOutlinerViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vtg_source_outliner_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VtgSourceOutlinerView), 0, (GInstanceInitFunc) vtg_source_outliner_view_instance_init, NULL };
      vtg_source_outliner_view_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "VtgSourceOutlinerView", &g_define_type_info, 0);
      return vtg_source_outliner_view_type_id;
}


static void vtg_source_outliner_view_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
      VtgSourceOutlinerView * self;
      self = VTG_SOURCE_OUTLINER_VIEW (object);
      switch (property_id) {
            case VTG_SOURCE_OUTLINER_VIEW_SHOW_PRIVATE_SYMBOLS:
            g_value_set_boolean (value, vtg_source_outliner_view_get_show_private_symbols (self));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void vtg_source_outliner_view_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
      VtgSourceOutlinerView * self;
      self = VTG_SOURCE_OUTLINER_VIEW (object);
      switch (property_id) {
            case VTG_SOURCE_OUTLINER_VIEW_PLUGIN_INSTANCE:
            vtg_source_outliner_view_set_plugin_instance (self, g_value_get_object (value));
            break;
            default:
            G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
            break;
      }
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      if ((array != NULL) && (destroy_func != NULL)) {
            int i;
            for (i = 0; i < array_length; i = i + 1) {
                  if (((gpointer*) array)[i] != NULL) {
                        destroy_func (((gpointer*) array)[i]);
                  }
            }
      }
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
      _vala_array_destroy (array, array_length, destroy_func);
      g_free (array);
}


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);
}



static void g_cclosure_user_marshal_VOID__INT_INT_INT (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
      typedef void (*GMarshalFunc_VOID__INT_INT_INT) (gpointer data1, gint arg_1, gint arg_2, gint arg_3, gpointer data2);
      register GMarshalFunc_VOID__INT_INT_INT callback;
      register GCClosure * cc;
      register gpointer data1, data2;
      cc = (GCClosure *) closure;
      g_return_if_fail (n_param_values == 4);
      if (G_CCLOSURE_SWAP_DATA (closure)) {
            data1 = closure->data;
            data2 = param_values->data[0].v_pointer;
      } else {
            data1 = param_values->data[0].v_pointer;
            data2 = closure->data;
      }
      callback = (GMarshalFunc_VOID__INT_INT_INT) (marshal_data ? marshal_data : cc->callback);
      callback (data1, g_value_get_int (param_values + 1), g_value_get_int (param_values + 2), g_value_get_int (param_values + 3), data2);
}




Generated by  Doxygen 1.6.0   Back to index