Esempio n. 1
0
RygelPlugin* rygel_plugin_construct (GType object_type, const char* name, const char* title) {
	RygelPlugin * self;
	char* _tmp1_;
	const char* _tmp0_;
	char* _tmp3_;
	const char* _tmp2_;
	GeeArrayList* _tmp6_;
	GeeArrayList* _tmp7_;
	RygelResourceInfo* resource_info;
	g_return_val_if_fail (name != NULL, NULL);
	self = g_object_newv (object_type, 0, NULL);
	_tmp1_ = NULL;
	_tmp0_ = NULL;
	self->name = (_tmp1_ = (_tmp0_ = name, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->name = (g_free (self->name), NULL), _tmp1_);
	_tmp3_ = NULL;
	_tmp2_ = NULL;
	self->title = (_tmp3_ = (_tmp2_ = title, (_tmp2_ == NULL) ? NULL : g_strdup (_tmp2_)), self->title = (g_free (self->title), NULL), _tmp3_);
	rygel_plugin_set_available (self, TRUE);
	if (title == NULL) {
		char* _tmp5_;
		const char* _tmp4_;
		_tmp5_ = NULL;
		_tmp4_ = NULL;
		self->title = (_tmp5_ = (_tmp4_ = name, (_tmp4_ == NULL) ? NULL : g_strdup (_tmp4_)), self->title = (g_free (self->title), NULL), _tmp5_);
	}
	_tmp6_ = NULL;
	self->resource_infos = (_tmp6_ = gee_array_list_new (RYGEL_TYPE_RESOURCE_INFO, (GBoxedCopyFunc) rygel_resource_info_ref, rygel_resource_info_unref, g_direct_equal), (self->resource_infos == NULL) ? NULL : (self->resource_infos = (g_object_unref (self->resource_infos), NULL)), _tmp6_);
	_tmp7_ = NULL;
	self->icon_infos = (_tmp7_ = gee_array_list_new (RYGEL_TYPE_ICON_INFO, (GBoxedCopyFunc) rygel_icon_info_ref, rygel_icon_info_unref, g_direct_equal), (self->icon_infos == NULL) ? NULL : (self->icon_infos = (g_object_unref (self->icon_infos), NULL)), _tmp7_);
	resource_info = rygel_resource_info_new (RYGEL_CONNECTION_MANAGER_UPNP_ID, RYGEL_CONNECTION_MANAGER_UPNP_TYPE, RYGEL_CONNECTION_MANAGER_DESCRIPTION_PATH, RYGEL_TYPE_CONNECTION_MANAGER);
	rygel_plugin_add_resource (self, resource_info);
	(resource_info == NULL) ? NULL : (resource_info = (rygel_resource_info_unref (resource_info), NULL));
	return self;
}
static GeeArrayList* rygel_didl_lite_writer_get_original_resources (RygelDIDLLiteWriter* self, RygelMediaItem* item, GError** error) {
	GError * _inner_error_;
	GeeArrayList* resources;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item != NULL, NULL);
	_inner_error_ = NULL;
	resources = gee_array_list_new (GUPNP_TYPE_DIDL_LITE_RESOURCE, (GBoxedCopyFunc) _gupnp_didl_lite_resource_dup, g_free, g_direct_equal);
	{
		GeeIterator* _uri_it;
		_uri_it = gee_iterable_iterator ((GeeIterable*) item->uris);
		while (gee_iterator_next (_uri_it)) {
			char* uri;
			GUPnPDIDLLiteResource res;
			uri = (char*) gee_iterator_get (_uri_it);
			res = rygel_media_item_create_res (item, uri, &_inner_error_);
			if (_inner_error_ != NULL) {
				g_propagate_error (error, _inner_error_);
				uri = (g_free (uri), NULL);
				(_uri_it == NULL) ? NULL : (_uri_it = (g_object_unref (_uri_it), NULL));
				(resources == NULL) ? NULL : (resources = (g_object_unref (resources), NULL));
				return NULL;
			}
			gee_collection_add ((GeeCollection*) resources, &res);
			uri = (g_free (uri), NULL);
			gupnp_didl_lite_resource_destroy (&res);
		}
		(_uri_it == NULL) ? NULL : (_uri_it = (g_object_unref (_uri_it), NULL));
	}
	return resources;
}
Esempio n. 3
0
static gboolean rygel_null_container_real_get_children_co (RygelNullContainerGetChildrenData* data) {
	switch (data->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		data->result = (GeeList*) gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
		{
			if (data->_state_ == 0) {
				g_simple_async_result_complete_in_idle (data->_async_result);
			} else {
				g_simple_async_result_complete (data->_async_result);
			}
			g_object_unref (data->_async_result);
			return FALSE;
		}
	}
	{
		if (data->_state_ == 0) {
			g_simple_async_result_complete_in_idle (data->_async_result);
		} else {
			g_simple_async_result_complete (data->_async_result);
		}
		g_object_unref (data->_async_result);
		return FALSE;
	}
}
Esempio n. 4
0
GeeArrayList *
FcListFiles(void)
{
    int          i;
    FcPattern    * pattern;
    FcFontSet    * fontset;
    FcObjectSet  * objectset = 0;
    GeeArrayList * filelist = gee_array_list_new(G_TYPE_STRING,
                                                (GBoxedCopyFunc) g_strdup,
                                                (GDestroyNotify) g_free0,
                                                NULL,
                                                NULL,
                                                NULL);
    g_assert(FcInit());
    pattern = FcNameParse((FcChar8 *) ":");
    objectset = FcObjectSetBuild (FC_FILE, NULL);
    fontset = FcFontList(NULL, pattern, objectset);

    for (i = 0; i < fontset->nfont; i++) {
        FcChar8 * file;
        if (FcPatternGetString(fontset->fonts[i], FC_FILE, 0, &file) == FcResultMatch)
            gee_abstract_collection_add((GeeAbstractCollection *) filelist, file);
    }

    if (objectset)
        FcObjectSetDestroy(objectset);
    if (pattern)
        FcPatternDestroy(pattern);
    if (fontset)
        FcFontSetDestroy(fontset);

    return filelist;
}
Esempio n. 5
0
GeeArrayList* slingshot_backend_gmenu_entries_get_applications_for_category (GMenuTreeDirectory* category) {
    GeeArrayList* result = NULL;
    GeeArrayList* _tmp0_;
    GeeArrayList* entries;
    GMenuTreeDirectory* _tmp1_;
    GSList* _tmp2_ = NULL;
    g_return_val_if_fail (category != NULL, NULL);
    _tmp0_ = gee_array_list_new (G_TYPE_POINTER, (GBoxedCopyFunc) gmenu_tree_item_ref, gmenu_tree_item_unref, NULL);
    entries = _tmp0_;
    _tmp1_ = category;
    _tmp2_ = gmenu_tree_directory_get_contents (_tmp1_);
    {
        GSList* item_collection = NULL;
        GSList* item_it = NULL;
        item_collection = _tmp2_;
        for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
            GMenuTreeItem* _tmp3_;
            GMenuTreeItem* item = NULL;
            _tmp3_ = _gmenu_tree_item_ref0 ((GMenuTreeItem*) item_it->data);
            item = _tmp3_;
            {
                GMenuTreeItem* _tmp4_;
                GMenuTreeItemType _tmp5_ = 0;
                _tmp4_ = item;
                _tmp5_ = gmenu_tree_item_get_type (_tmp4_);
                switch (_tmp5_) {
                case GMENU_TREE_ITEM_DIRECTORY:
                {
                    GeeArrayList* _tmp6_;
                    GMenuTreeItem* _tmp7_;
                    GeeArrayList* _tmp8_ = NULL;
                    GeeArrayList* _tmp9_;
                    _tmp6_ = entries;
                    _tmp7_ = item;
                    _tmp8_ = slingshot_backend_gmenu_entries_get_applications_for_category ((GMenuTreeDirectory*) _tmp7_);
                    _tmp9_ = _tmp8_;
                    gee_abstract_collection_add_all ((GeeAbstractCollection*) _tmp6_, (GeeCollection*) _tmp9_);
                    _g_object_unref0 (_tmp9_);
                    break;
                }
                case GMENU_TREE_ITEM_ENTRY:
                {
                    GeeArrayList* _tmp10_;
                    GMenuTreeItem* _tmp11_;
                    _tmp10_ = entries;
                    _tmp11_ = item;
                    gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, (GMenuTreeEntry*) _tmp11_);
                    break;
                }
                default:
                    break;
                }
                _gmenu_tree_item_unref0 (item);
            }
        }
    }
    result = entries;
    return result;
}
RygelFolderContainer* rygel_folder_container_construct (GType object_type, RygelMediaContainer* parent, GFile* file) {
#line 362 "rygel-folder-container.c"
	RygelFolderContainer * self;
	char* _tmp0_;
	char* _tmp1_;
	char* id;
	char* _tmp2_;
	GFile* _tmp4_;
	GFile* _tmp3_;
	GeeArrayList* _tmp5_;
	GeeList* _tmp6_;
#line 156 "rygel-folder-container.vala"
	g_return_val_if_fail (parent != NULL, NULL);
#line 156 "rygel-folder-container.vala"
	g_return_val_if_fail (file != NULL, NULL);
#line 720 "gio-2.0.vapi"
	_tmp0_ = NULL;
#line 157 "rygel-folder-container.vala"
	_tmp1_ = NULL;
#line 380 "rygel-folder-container.c"
	id = (_tmp1_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp0_ = g_file_get_uri (file), -1), _tmp0_ = (g_free (_tmp0_), NULL), _tmp1_);
#line 713 "gio-2.0.vapi"
	_tmp2_ = NULL;
#line 160 "rygel-folder-container.vala"
	self = (RygelFolderContainer*) rygel_media_container_construct (object_type, id, parent, _tmp2_ = g_file_get_basename (file), (guint) 0);
#line 386 "rygel-folder-container.c"
	_tmp2_ = (g_free (_tmp2_), NULL);
	_tmp4_ = NULL;
#line 161 "rygel-folder-container.vala"
	_tmp3_ = NULL;
#line 161 "rygel-folder-container.vala"
	self->priv->root_dir = (_tmp4_ = (_tmp3_ = file, (_tmp3_ == NULL) ? NULL : g_object_ref (_tmp3_)), (self->priv->root_dir == NULL) ? NULL : (self->priv->root_dir = (g_object_unref (self->priv->root_dir), NULL)), _tmp4_);
#line 393 "rygel-folder-container.c"
	_tmp5_ = NULL;
#line 163 "rygel-folder-container.vala"
	self->priv->items = (_tmp5_ = gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->priv->items == NULL) ? NULL : (self->priv->items = (g_object_unref (self->priv->items), NULL)), _tmp5_);
#line 164 "rygel-folder-container.vala"
	((RygelMediaContainer*) self)->child_count = (guint) 0;
#line 399 "rygel-folder-container.c"
	_tmp6_ = NULL;
#line 165 "rygel-folder-container.vala"
	self->priv->results = (_tmp6_ = (GeeList*) gee_array_list_new (G_TYPE_ASYNC_RESULT, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->priv->results == NULL) ? NULL : (self->priv->results = (g_object_unref (self->priv->results), NULL)), _tmp6_);
#line 403 "rygel-folder-container.c"
	id = (g_free (id), NULL);
	return self;
}
RygelTrackerSearchResult* rygel_tracker_search_result_construct (GType object_type, RygelTrackerCategory* category, GAsyncReadyCallback callback, void* callback_target) {
	RygelTrackerSearchResult * self;
	GeeList* _tmp0_;
	g_return_val_if_fail (category != NULL, NULL);
	self = (RygelTrackerSearchResult*) rygel_simple_async_result_construct (object_type, GEE_TYPE_LIST, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GObject*) category, callback, callback_target);
	_tmp0_ = NULL;
	((RygelSimpleAsyncResult*) self)->data = (_tmp0_ = (GeeList*) gee_array_list_new (RYGEL_TYPE_MEDIA_OBJECT, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (((RygelSimpleAsyncResult*) self)->data == NULL) ? NULL : (((RygelSimpleAsyncResult*) self)->data = (g_object_unref (((RygelSimpleAsyncResult*) self)->data), NULL)), _tmp0_);
	return self;
}
Esempio n. 8
0
GeeArrayList* slingshot_backend_gmenu_entries_get_categories (void) {
    GeeArrayList* result = NULL;
    GMenuTree* _tmp0_ = NULL;
    GMenuTree* _tmp1_;
    GMenuTree* tree;
    GMenuTree* _tmp2_;
    GMenuTreeDirectory* _tmp3_ = NULL;
    GMenuTreeDirectory* _tmp4_;
    GMenuTreeDirectory* root;
    GeeArrayList* _tmp5_;
    GeeArrayList* main_directory_entries;
    GMenuTreeDirectory* _tmp6_;
    GSList* _tmp7_ = NULL;
    _tmp0_ = gmenu_tree_lookup ("applications.menu", GMENU_TREE_FLAGS_INCLUDE_EXCLUDED);
    _tmp1_ = _gmenu_tree_ref0 (_tmp0_);
    tree = _tmp1_;
    _tmp2_ = tree;
    _tmp3_ = gmenu_tree_get_root_directory (_tmp2_);
    _tmp4_ = _gmenu_tree_item_ref0 (_tmp3_);
    root = _tmp4_;
    _tmp5_ = gee_array_list_new (G_TYPE_POINTER, (GBoxedCopyFunc) gmenu_tree_item_ref, gmenu_tree_item_unref, NULL);
    main_directory_entries = _tmp5_;
    _tmp6_ = root;
    _tmp7_ = gmenu_tree_directory_get_contents (_tmp6_);
    {
        GSList* item_collection = NULL;
        GSList* item_it = NULL;
        item_collection = _tmp7_;
        for (item_it = item_collection; item_it != NULL; item_it = item_it->next) {
            GMenuTreeItem* _tmp8_;
            GMenuTreeItem* item = NULL;
            _tmp8_ = _gmenu_tree_item_ref0 ((GMenuTreeItem*) item_it->data);
            item = _tmp8_;
            {
                GMenuTreeItem* _tmp9_;
                GMenuTreeItemType _tmp10_ = 0;
                _tmp9_ = item;
                _tmp10_ = gmenu_tree_item_get_type (_tmp9_);
                if (_tmp10_ == GMENU_TREE_ITEM_DIRECTORY) {
                    GeeArrayList* _tmp11_;
                    GMenuTreeItem* _tmp12_;
                    _tmp11_ = main_directory_entries;
                    _tmp12_ = item;
                    gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, (GMenuTreeDirectory*) _tmp12_);
                }
                _gmenu_tree_item_unref0 (item);
            }
        }
    }
    result = main_directory_entries;
    _gmenu_tree_item_unref0 (root);
    _gmenu_tree_unref0 (tree);
    return result;
}
GeeList* steadyflow_file_list_controller_get_selected_files (SteadyflowFileListController* self) {
	GeeList* result = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* list;
	GtkTreeView* _tmp1_;
	GtkTreeSelection* _tmp2_ = NULL;
	GList* _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_array_list_new (STEADYFLOW_CORE_TYPE_IDOWNLOAD_FILE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
	list = _tmp0_;
	_tmp1_ = self->priv->tree;
	_tmp2_ = gtk_tree_view_get_selection (_tmp1_);
	_tmp3_ = gtk_tree_selection_get_selected_rows (_tmp2_, NULL);
	{
		GList* path_collection = NULL;
		GList* path_it = NULL;
		path_collection = _tmp3_;
		for (path_it = path_collection; path_it != NULL; path_it = path_it->next) {
			GtkTreePath* _tmp4_;
			GtkTreePath* path = NULL;
			_tmp4_ = _gtk_tree_path_copy0 ((GtkTreePath*) path_it->data);
			path = _tmp4_;
			{
				GtkTreeIter iter = {0};
				GtkListStore* _tmp5_;
				GtkTreePath* _tmp6_;
				GtkTreeIter _tmp7_ = {0};
				gboolean _tmp8_ = FALSE;
				_tmp5_ = self->priv->model;
				_tmp6_ = path;
				_tmp8_ = gtk_tree_model_get_iter ((GtkTreeModel*) _tmp5_, &_tmp7_, _tmp6_);
				iter = _tmp7_;
				if (_tmp8_) {
					GeeArrayList* _tmp9_;
					GtkTreeIter _tmp10_;
					SteadyflowCoreIDownloadFile* _tmp11_ = NULL;
					SteadyflowCoreIDownloadFile* _tmp12_;
					_tmp9_ = list;
					_tmp10_ = iter;
					_tmp11_ = steadyflow_file_list_controller_file_from_iter (self, &_tmp10_);
					_tmp12_ = _tmp11_;
					gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp12_);
					_g_object_unref0 (_tmp12_);
				}
				_gtk_tree_path_free0 (path);
			}
		}
		__g_list_free__gtk_tree_path_free0_0 (path_collection);
	}
	result = (GeeList*) list;
	return result;
}
Esempio n. 10
0
static GObject * soy_fields_monopole_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	soyfieldsMonopole * self;
	GeeArrayList* _tmp0_;
	parent_class = G_OBJECT_CLASS (soy_fields_monopole_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SOY_FIELDS_TYPE_MONOPOLE, soyfieldsMonopole);
	_tmp0_ = gee_array_list_new (SOY_BODIES_TYPE_BODY, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
	_g_object_unref0 (self->priv->_affected);
	self->priv->_affected = _tmp0_;
	soy_fields_monopole_set_multiplier (self, (gfloat) 0);
	return obj;
}
static GObject * specific_items_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	SpecificItemsManager * self;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	parent_class = G_OBJECT_CLASS (specific_items_manager_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = SPECIFIC_ITEMS_MANAGER (obj);
	_tmp0_ = gee_array_list_new (dbusmenu_menuitem_proxy_get_type (), (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
	_tmp1_ = _tmp0_;
	specific_items_manager_set_proxy_items (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	return obj;
}
Esempio n. 12
0
static GObject * gtk_mate_bundle_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GtkMateBundleClass * klass;
	GObjectClass * parent_class;
	GtkMateBundle * self;
	klass = GTK_MATE_BUNDLE_CLASS (g_type_class_peek (GTK_MATE_TYPE_BUNDLE));
	parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = GTK_MATE_BUNDLE (obj);
	{
		GeeArrayList* _tmp0_;
		_tmp0_ = NULL;
		self->grammars = (_tmp0_ = gee_array_list_new (GTK_MATE_TYPE_GRAMMAR, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->grammars == NULL) ? NULL : (self->grammars = (g_object_unref (self->grammars), NULL)), _tmp0_);
	}
	return obj;
}
Esempio n. 13
0
GeeArrayList *
FcListFonts(gchar * family_name)
{
    int          i;
    FcPattern    * pattern;
    FcFontSet    * fontset;
    FcObjectSet  * objectset = 0;
    GeeArrayList * fontlist = gee_array_list_new(G_TYPE_OBJECT,
                                                        NULL,
                                                        NULL,
                                                        NULL,
                                                        NULL,
                                                        NULL);
    g_assert(FcInit());
    if (family_name)
        pattern = FcPatternBuild (NULL, FC_FAMILY, FcTypeString, family_name, NULL);
    else
        pattern = FcNameParse((FcChar8 *) ":");

    objectset = FcObjectSetBuild (FC_FILE,
                                  FC_INDEX,
                                  FC_FAMILY,
                                  FC_STYLE,
                                  FC_SLANT,
                                  FC_WEIGHT,
                                  FC_WIDTH,
                                  FC_SPACING,
                                  NULL);
    fontset = FcFontList(NULL, pattern, objectset);

    for (i = 0; i < fontset->nfont; i++) {
        FontConfigFont * font = font_config_font_new();
        get_font_details_from_pattern(font, fontset->fonts[i]);
        gee_abstract_collection_add((GeeAbstractCollection *) fontlist, font);
    }

    if (objectset)
        FcObjectSetDestroy(objectset);
    if (pattern)
        FcPatternDestroy(pattern);
    if (fontset)
        FcFontSetDestroy(fontset);

    return fontlist;
}
Esempio n. 14
0
void plank_services_logger_initialize (const gchar* app_name) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	GeeArrayList* _tmp3_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (app_name != NULL);
	_tmp0_ = plank_services_logger_get_AppName ();
	_tmp1_ = _tmp0_;
	_tmp2_ = app_name;
	plank_services_logger_set_AppName (_tmp2_);
	plank_services_logger_is_writing = FALSE;
	_tmp3_ = gee_array_list_new (PLANK_SERVICES_LOGGER_TYPE_LOG_MESSAGE, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
	_g_object_unref0 (plank_services_logger_log_queue);
	plank_services_logger_log_queue = _tmp3_;
	{
		GRegex* _tmp4_ = NULL;
		GRegex* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		_tmp5_ = g_regex_new ("[(]?.*?([^/]*?)(\\.2)?\\.vala(:\\d+)[)]?:\\s*(.*)", 0, 0, &_inner_error_);
		_tmp4_ = _tmp5_;
		if (_inner_error_ != NULL) {
			goto __catch31_g_error;
		}
		_tmp6_ = _tmp4_;
		_tmp4_ = NULL;
		_g_regex_unref0 (plank_services_logger_re);
		plank_services_logger_re = _tmp6_;
		_g_regex_unref0 (_tmp4_);
	}
	goto __finally31;
	__catch31_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally31:
	if (_inner_error_ != NULL) {
		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;
	}
	g_log_set_default_handler (_plank_services_logger_glib_log_func_glog_func, NULL);
}
static void rygel_folder_pref_section_real_save (RygelPreferencesSection* base) {
	RygelFolderPrefSection * self;
	GtkTextIter start = {0};
	GtkTextIter end = {0};
	const char* _tmp0_;
	char* text;
	char** _tmp2_;
	gint folders_size;
	gint folders_length1;
	char** _tmp1_;
	char** folders;
	GeeArrayList* folder_list;
	self = (RygelFolderPrefSection*) base;
	gtk_text_buffer_get_start_iter (self->priv->text_buffer, &start);
	gtk_text_buffer_get_end_iter (self->priv->text_buffer, &end);
	_tmp0_ = NULL;
	text = (_tmp0_ = gtk_text_buffer_get_text (self->priv->text_buffer, &start, &end, FALSE), (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_));
	_tmp2_ = NULL;
	_tmp1_ = NULL;
	folders = (_tmp2_ = _tmp1_ = g_strsplit (text, "\n", -1), folders_length1 = _vala_array_length (_tmp1_), folders_size = folders_length1, _tmp2_);
	folder_list = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_direct_equal);
	{
		char** folder_collection;
		int folder_collection_length1;
		int folder_it;
		folder_collection = folders;
		folder_collection_length1 = folders_length1;
		for (folder_it = 0; folder_it < folders_length1; folder_it = folder_it + 1) {
			const char* _tmp3_;
			char* folder;
			_tmp3_ = NULL;
			folder = (_tmp3_ = folder_collection[folder_it], (_tmp3_ == NULL) ? NULL : g_strdup (_tmp3_));
			{
				gee_collection_add ((GeeCollection*) folder_list, folder);
				folder = (g_free (folder), NULL);
			}
		}
	}
	rygel_configuration_set_string_list (((RygelPreferencesSection*) self)->config, ((RygelPreferencesSection*) self)->name, RYGEL_FOLDER_PREF_SECTION_FOLDERS_KEY, folder_list);
	text = (g_free (text), NULL);
	folders = (_vala_array_free (folders, folders_length1, (GDestroyNotify) g_free), NULL);
	(folder_list == NULL) ? NULL : (folder_list = (g_object_unref (folder_list), NULL));
}
Esempio n. 16
0
GeeArrayList *
FcListUserDirs(void)
{
    FcChar8      * directory;
    FcStrList    * fdlist;
    GeeArrayList * dirlist = gee_array_list_new(G_TYPE_STRING,
                                              (GBoxedCopyFunc) g_strdup,
                                              (GDestroyNotify) g_free0,
                                              NULL,
                                              NULL,
                                              NULL);
    g_assert(FcInit());
    fdlist = FcConfigGetConfigDirs(NULL);
    while ((directory = FcStrListNext(fdlist)))
        if (get_file_owner((const gchar *) directory) == 0)
            gee_abstract_collection_add((GeeAbstractCollection *) dirlist, directory);
    FcStrListDone(fdlist);
    return dirlist;
}
Esempio n. 17
0
int main (void)
{
    GeeArrayList* list;
    gint i;
    gpointer p;

    list = gee_array_list_new (G_TYPE_INT, NULL, NULL, NULL, NULL, NULL);
    gee_abstract_collection_add ((GeeAbstractCollection*) list, (gpointer) ((gintptr) 1));
    gee_abstract_collection_add ((GeeAbstractCollection*) list, (gpointer) ((gintptr) 2));
    gee_abstract_collection_add ((GeeAbstractCollection*) list, (gpointer) ((gintptr) 5));
    gee_abstract_collection_add ((GeeAbstractCollection*) list, (gpointer) ((gintptr) 4));
    gee_abstract_list_insert ((GeeAbstractList*) list, 2, (gpointer) ((gintptr) 3));
    gee_abstract_list_remove_at ((GeeAbstractList*) list, 3);
    gee_abstract_list_set ((GeeAbstractList*) list, 2, (gpointer) ((gintptr) 10));
    p = gee_abstract_list_get ((GeeAbstractList*) list, 2);
    i = (gint) ((gintptr) p);
    assert (10 == i);
    g_object_unref (list);
    return 0;
}
Esempio n. 18
0
soySGK2PNGConverter* soy_sg_k2_png_converter_construct (GType object_type) {
	soySGK2PNGConverter* self = NULL;
	GeeArrayList* _tmp0_ = NULL;
	GeeArrayList* _tmp1_ = NULL;
#line 25 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	self = (soySGK2PNGConverter*) g_type_create_instance (object_type);
#line 26 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	_tmp0_ = gee_array_list_new (G_TYPE_UCHAR, NULL, NULL, NULL, NULL, NULL);
#line 26 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	_tmp1_ = _tmp0_;
#line 26 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	soy_sg_k2_png_converter_set_png_data (self, _tmp1_);
#line 26 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	_g_object_unref0 (_tmp1_);
#line 27 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	return self;
#line 25 "/home/jeff/Documents/libraries/libsoy/src/sgk2png.gs"
	return self;
#line 111 "sgk2png.c"
}
Esempio n. 19
0
GeeArrayList *
FcListDirs(gboolean recursive)
{
    FcChar8      * directory;
    FcStrList    * fdlist;
    GeeArrayList * dirlist = gee_array_list_new(G_TYPE_STRING,
                                              (GBoxedCopyFunc) g_strdup,
                                              (GDestroyNotify) g_free0,
                                              NULL,
                                              NULL,
                                              NULL);
    g_assert(FcInit());
    if (recursive)
        fdlist = FcConfigGetFontDirs(NULL);
    else
        fdlist = FcConfigGetConfigDirs(NULL);
    while ((directory = FcStrListNext(fdlist)))
        gee_abstract_collection_add((GeeAbstractCollection *) dirlist, directory);
    FcStrListDone(fdlist);
    return dirlist;
}
RygelTrackerRootContainer* rygel_tracker_root_container_construct (GType object_type, const char* title) {
	RygelTrackerRootContainer * self;
	GeeArrayList* _tmp0_;
	RygelTrackerImageCategory* _tmp1_;
	RygelTrackerMusicCategory* _tmp2_;
	RygelTrackerVideoCategory* _tmp3_;
	g_return_val_if_fail (title != NULL, NULL);
	self = (RygelTrackerRootContainer*) rygel_media_container_construct_root (object_type, title, (guint) 0);
	_tmp0_ = NULL;
	self->priv->categories = (_tmp0_ = gee_array_list_new (RYGEL_TYPE_TRACKER_CATEGORY, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (self->priv->categories == NULL) ? NULL : (self->priv->categories = (g_object_unref (self->priv->categories), NULL)), _tmp0_);
	_tmp1_ = NULL;
	gee_collection_add ((GeeCollection*) self->priv->categories, (RygelTrackerCategory*) (_tmp1_ = rygel_tracker_image_category_new ("16", (RygelMediaContainer*) self, "All Images")));
	(_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_object_unref (_tmp1_), NULL));
	_tmp2_ = NULL;
	gee_collection_add ((GeeCollection*) self->priv->categories, (RygelTrackerCategory*) (_tmp2_ = rygel_tracker_music_category_new ("14", (RygelMediaContainer*) self, "All Music")));
	(_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_object_unref (_tmp2_), NULL));
	_tmp3_ = NULL;
	gee_collection_add ((GeeCollection*) self->priv->categories, (RygelTrackerCategory*) (_tmp3_ = rygel_tracker_video_category_new ("15", (RygelMediaContainer*) self, "All Videos")));
	(_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_object_unref (_tmp3_), NULL));
	((RygelMediaContainer*) self)->child_count = (guint) gee_collection_get_size ((GeeCollection*) self->priv->categories);
	return self;
}
Esempio n. 21
0
static GObject * soy_fields_monopole_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	soyfieldsMonopole * self;
	GeeArrayList* _tmp0_ = NULL;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	parent_class = G_OBJECT_CLASS (soy_fields_monopole_parent_class);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SOY_FIELDS_TYPE_MONOPOLE, soyfieldsMonopole);
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	_tmp0_ = gee_array_list_new (SOY_BODIES_TYPE_BODY, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL);
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	_g_object_unref0 (self->priv->_affected);
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	self->priv->_affected = _tmp0_;
#line 44 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	soy_fields_monopole_set_multiplier (self, (gfloat) 0);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	return obj;
#line 658 "Monopole.c"
}
Esempio n. 22
0
void slingshot_backend_gmenu_entries_enumerate_apps (GeeArrayList* source, GeeHashMap* icons, gint icon_size, GeeArrayList** list) {
    GeeArrayList* _vala_list = NULL;
    GtkIconTheme* _tmp0_ = NULL;
    GtkIconTheme* _tmp1_;
    GtkIconTheme* icon_theme;
    GeeArrayList* _tmp2_;
    GError * _inner_error_ = NULL;
    g_return_if_fail (source != NULL);
    g_return_if_fail (icons != NULL);
    _tmp0_ = gtk_icon_theme_get_default ();
    _tmp1_ = _g_object_ref0 (_tmp0_);
    icon_theme = _tmp1_;
    _tmp2_ = gee_array_list_new (GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
    _g_object_unref0 (_vala_list);
    _vala_list = _tmp2_;
    {
        GeeArrayList* _tmp3_;
        GeeArrayList* _tmp4_;
        GeeArrayList* _app_list;
        GeeArrayList* _tmp5_;
        gint _tmp6_;
        gint _tmp7_;
        gint _app_size;
        gint _app_index;
        _tmp3_ = source;
        _tmp4_ = _g_object_ref0 (_tmp3_);
        _app_list = _tmp4_;
        _tmp5_ = _app_list;
        _tmp6_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp5_);
        _tmp7_ = _tmp6_;
        _app_size = _tmp7_;
        _app_index = -1;
        while (TRUE) {
            gint _tmp8_;
            gint _tmp9_;
            gint _tmp10_;
            GeeArrayList* _tmp11_;
            gint _tmp12_;
            gpointer _tmp13_ = NULL;
            GMenuTreeEntry* app;
            gboolean _tmp14_ = FALSE;
            gboolean _tmp15_ = FALSE;
            GMenuTreeEntry* _tmp16_;
            gboolean _tmp17_ = FALSE;
            gboolean _tmp20_;
            gboolean _tmp23_;
            _tmp8_ = _app_index;
            _app_index = _tmp8_ + 1;
            _tmp9_ = _app_index;
            _tmp10_ = _app_size;
            if (!(_tmp9_ < _tmp10_)) {
                break;
            }
            _tmp11_ = _app_list;
            _tmp12_ = _app_index;
            _tmp13_ = gee_abstract_list_get ((GeeAbstractList*) _tmp11_, _tmp12_);
            app = (GMenuTreeEntry*) _tmp13_;
            _tmp16_ = app;
            _tmp17_ = gmenu_tree_entry_get_is_nodisplay (_tmp16_);
            if (_tmp17_ == FALSE) {
                GMenuTreeEntry* _tmp18_;
                gboolean _tmp19_ = FALSE;
                _tmp18_ = app;
                _tmp19_ = gmenu_tree_entry_get_is_excluded (_tmp18_);
                _tmp15_ = _tmp19_ == FALSE;
            } else {
                _tmp15_ = FALSE;
            }
            _tmp20_ = _tmp15_;
            if (_tmp20_) {
                GMenuTreeEntry* _tmp21_;
                const gchar* _tmp22_ = NULL;
                _tmp21_ = app;
                _tmp22_ = gmenu_tree_entry_get_icon (_tmp21_);
                _tmp14_ = _tmp22_ != NULL;
            } else {
                _tmp14_ = FALSE;
            }
            _tmp23_ = _tmp14_;
            if (_tmp23_) {
                GeeHashMap* _tmp24_;
                GeeHashMap* app_to_add;
                GeeHashMap* _tmp25_;
                GMenuTreeEntry* _tmp26_;
                const gchar* _tmp27_ = NULL;
                GeeHashMap* _tmp28_;
                GMenuTreeEntry* _tmp29_;
                const gchar* _tmp30_ = NULL;
                GeeHashMap* _tmp31_;
                GMenuTreeEntry* _tmp32_;
                const gchar* _tmp33_ = NULL;
                GeeHashMap* _tmp34_;
                GMenuTreeEntry* _tmp35_;
                const gchar* _tmp36_ = NULL;
                GeeHashMap* _tmp37_;
                GeeHashMap* _tmp38_;
                gpointer _tmp39_ = NULL;
                gchar* _tmp40_;
                gboolean _tmp41_ = FALSE;
                gboolean _tmp42_;
                GeeArrayList* _tmp102_;
                GeeHashMap* _tmp103_;
                _tmp24_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL);
                app_to_add = _tmp24_;
                _tmp25_ = app_to_add;
                _tmp26_ = app;
                _tmp27_ = gmenu_tree_entry_get_comment (_tmp26_);
                gee_abstract_map_set ((GeeAbstractMap*) _tmp25_, "description", _tmp27_);
                _tmp28_ = app_to_add;
                _tmp29_ = app;
                _tmp30_ = gmenu_tree_entry_get_name (_tmp29_);
                gee_abstract_map_set ((GeeAbstractMap*) _tmp28_, "name", _tmp30_);
                _tmp31_ = app_to_add;
                _tmp32_ = app;
                _tmp33_ = gmenu_tree_entry_get_exec (_tmp32_);
                gee_abstract_map_set ((GeeAbstractMap*) _tmp31_, "command", _tmp33_);
                _tmp34_ = app_to_add;
                _tmp35_ = app;
                _tmp36_ = gmenu_tree_entry_get_desktop_file_path (_tmp35_);
                gee_abstract_map_set ((GeeAbstractMap*) _tmp34_, "desktop_file", _tmp36_);
                _tmp37_ = icons;
                _tmp38_ = app_to_add;
                _tmp39_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp38_, "command");
                _tmp40_ = (gchar*) _tmp39_;
                _tmp41_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp37_, _tmp40_);
                _tmp42_ = !_tmp41_;
                _g_free0 (_tmp40_);
                if (_tmp42_) {
                    GMenuTreeEntry* _tmp43_;
                    const gchar* _tmp44_ = NULL;
                    gchar* _tmp45_;
                    gchar* app_icon;
                    GtkIconTheme* _tmp46_;
                    const gchar* _tmp47_;
                    gboolean _tmp48_ = FALSE;
                    _tmp43_ = app;
                    _tmp44_ = gmenu_tree_entry_get_icon (_tmp43_);
                    _tmp45_ = g_strdup (_tmp44_);
                    app_icon = _tmp45_;
                    _tmp46_ = icon_theme;
                    _tmp47_ = app_icon;
                    _tmp48_ = gtk_icon_theme_has_icon (_tmp46_, _tmp47_);
                    if (_tmp48_) {
                        GtkIconTheme* _tmp49_;
                        const gchar* _tmp50_;
                        gint _tmp51_;
                        GtkIconInfo* _tmp52_ = NULL;
                        GtkIconInfo* _tmp53_;
                        GdkPixbuf* _tmp54_ = NULL;
                        GdkPixbuf* _tmp55_;
                        GdkPixbuf* _tmp56_;
                        GeeHashMap* _tmp57_;
                        GeeHashMap* _tmp58_;
                        gpointer _tmp59_ = NULL;
                        gchar* _tmp60_;
                        GdkPixbuf* _tmp61_;
                        _tmp49_ = icon_theme;
                        _tmp50_ = app_icon;
                        _tmp51_ = icon_size;
                        _tmp52_ = gtk_icon_theme_lookup_icon (_tmp49_, _tmp50_, _tmp51_, 0);
                        _tmp53_ = _tmp52_;
                        _tmp54_ = gtk_icon_info_load_icon (_tmp53_, &_inner_error_);
                        _tmp55_ = _tmp54_;
                        _gtk_icon_info_free0 (_tmp53_);
                        _tmp56_ = _tmp55_;
                        if (_inner_error_ != NULL) {
                            _g_free0 (app_icon);
                            _g_object_unref0 (app_to_add);
                            _gmenu_tree_item_unref0 (app);
                            _g_object_unref0 (_app_list);
                            _g_object_unref0 (icon_theme);
                            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;
                        }
                        _tmp57_ = icons;
                        _tmp58_ = app_to_add;
                        _tmp59_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp58_, "command");
                        _tmp60_ = (gchar*) _tmp59_;
                        _tmp61_ = _tmp56_;
                        gee_abstract_map_set ((GeeAbstractMap*) _tmp57_, _tmp60_, _tmp61_);
                        _g_object_unref0 (_tmp61_);
                        _g_free0 (_tmp60_);
                    } else {
                        const gchar* _tmp62_;
                        GFile* _tmp63_ = NULL;
                        GFile* _tmp64_;
                        gboolean _tmp65_ = FALSE;
                        gboolean _tmp66_;
                        _tmp62_ = app_icon;
                        _tmp63_ = g_file_new_for_path (_tmp62_);
                        _tmp64_ = _tmp63_;
                        _tmp65_ = g_file_query_exists (_tmp64_, NULL);
                        _tmp66_ = _tmp65_;
                        _g_object_unref0 (_tmp64_);
                        if (_tmp66_) {
                            {
                                const gchar* _tmp67_;
                                const gchar* _tmp68_ = NULL;
                                gint _tmp69_;
                                GdkPixbuf* _tmp70_;
                                GdkPixbuf* _tmp71_;
                                GeeHashMap* _tmp72_;
                                GeeHashMap* _tmp73_;
                                gpointer _tmp74_ = NULL;
                                gchar* _tmp75_;
                                GdkPixbuf* _tmp76_;
                                _tmp67_ = app_icon;
                                _tmp68_ = string_to_string (_tmp67_);
                                _tmp69_ = icon_size;
                                _tmp70_ = gdk_pixbuf_new_from_file_at_scale (_tmp68_, -1, _tmp69_, TRUE, &_inner_error_);
                                _tmp71_ = _tmp70_;
                                if (_inner_error_ != NULL) {
                                    goto __catch1_g_error;
                                }
                                _tmp72_ = icons;
                                _tmp73_ = app_to_add;
                                _tmp74_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp73_, "command");
                                _tmp75_ = (gchar*) _tmp74_;
                                _tmp76_ = _tmp71_;
                                gee_abstract_map_set ((GeeAbstractMap*) _tmp72_, _tmp75_, _tmp76_);
                                _g_object_unref0 (_tmp76_);
                                _g_free0 (_tmp75_);
                            }
                            goto __finally1;
__catch1_g_error:
                            {
                                GtkIconTheme* _tmp77_;
                                gint _tmp78_;
                                GtkIconInfo* _tmp79_ = NULL;
                                GtkIconInfo* _tmp80_;
                                GdkPixbuf* _tmp81_ = NULL;
                                GdkPixbuf* _tmp82_;
                                GdkPixbuf* _tmp83_;
                                GeeHashMap* _tmp84_;
                                GeeHashMap* _tmp85_;
                                gpointer _tmp86_ = NULL;
                                gchar* _tmp87_;
                                GdkPixbuf* _tmp88_;
                                FILE* _tmp89_;
                                g_clear_error (&_inner_error_);
                                _inner_error_ = NULL;
                                _tmp77_ = icon_theme;
                                _tmp78_ = icon_size;
                                _tmp79_ = gtk_icon_theme_lookup_icon (_tmp77_, "application-default-icon", _tmp78_, 0);
                                _tmp80_ = _tmp79_;
                                _tmp81_ = gtk_icon_info_load_icon (_tmp80_, &_inner_error_);
                                _tmp82_ = _tmp81_;
                                _gtk_icon_info_free0 (_tmp80_);
                                _tmp83_ = _tmp82_;
                                if (_inner_error_ != NULL) {
                                    goto __finally1;
                                }
                                _tmp84_ = icons;
                                _tmp85_ = app_to_add;
                                _tmp86_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp85_, "command");
                                _tmp87_ = (gchar*) _tmp86_;
                                _tmp88_ = _tmp83_;
                                gee_abstract_map_set ((GeeAbstractMap*) _tmp84_, _tmp87_, _tmp88_);
                                _g_object_unref0 (_tmp88_);
                                _g_free0 (_tmp87_);
                                _tmp89_ = stdout;
                                fprintf (_tmp89_, "Failed to load icon from file.\n");
                            }
__finally1:
                            if (_inner_error_ != NULL) {
                                _g_free0 (app_icon);
                                _g_object_unref0 (app_to_add);
                                _gmenu_tree_item_unref0 (app);
                                _g_object_unref0 (_app_list);
                                _g_object_unref0 (icon_theme);
                                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;
                            }
                        } else {
                            GtkIconTheme* _tmp90_;
                            gint _tmp91_;
                            GtkIconInfo* _tmp92_ = NULL;
                            GtkIconInfo* _tmp93_;
                            GdkPixbuf* _tmp94_ = NULL;
                            GdkPixbuf* _tmp95_;
                            GdkPixbuf* _tmp96_;
                            GeeHashMap* _tmp97_;
                            GeeHashMap* _tmp98_;
                            gpointer _tmp99_ = NULL;
                            gchar* _tmp100_;
                            GdkPixbuf* _tmp101_;
                            _tmp90_ = icon_theme;
                            _tmp91_ = icon_size;
                            _tmp92_ = gtk_icon_theme_lookup_icon (_tmp90_, "application-default-icon", _tmp91_, 0);
                            _tmp93_ = _tmp92_;
                            _tmp94_ = gtk_icon_info_load_icon (_tmp93_, &_inner_error_);
                            _tmp95_ = _tmp94_;
                            _gtk_icon_info_free0 (_tmp93_);
                            _tmp96_ = _tmp95_;
                            if (_inner_error_ != NULL) {
                                _g_free0 (app_icon);
                                _g_object_unref0 (app_to_add);
                                _gmenu_tree_item_unref0 (app);
                                _g_object_unref0 (_app_list);
                                _g_object_unref0 (icon_theme);
                                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;
                            }
                            _tmp97_ = icons;
                            _tmp98_ = app_to_add;
                            _tmp99_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp98_, "command");
                            _tmp100_ = (gchar*) _tmp99_;
                            _tmp101_ = _tmp96_;
                            gee_abstract_map_set ((GeeAbstractMap*) _tmp97_, _tmp100_, _tmp101_);
                            _g_object_unref0 (_tmp101_);
                            _g_free0 (_tmp100_);
                        }
                    }
                    _g_free0 (app_icon);
                }
                _tmp102_ = _vala_list;
                _tmp103_ = app_to_add;
                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp102_, _tmp103_);
                _g_object_unref0 (app_to_add);
            }
            _gmenu_tree_item_unref0 (app);
        }
        _g_object_unref0 (_app_list);
    }
    _g_object_unref0 (icon_theme);
    if (list) {
        *list = _vala_list;
    } else {
        _g_object_unref0 (_vala_list);
    }
}
static void vala_dmap_container_db_instance_init (ValaDMAPContainerDb * self) {
	GeeArrayList* _tmp0_;
	self->priv = VALA_DMAP_CONTAINER_DB_GET_PRIVATE (self);
	_tmp0_ = gee_array_list_new (DMAP_TYPE_RECORD, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL);
	self->priv->db = _tmp0_;
}
Esempio n. 24
0
GtkMateTheme* gtk_mate_theme_create_from_plist (PListDict* dict) {
	GtkMateTheme* theme;
	PListNode* nm;
	PListNode* _tmp2;
	GeeHashMap* _tmp5;
	GeeArrayList* _tmp6;
	PListArray* na;
	GtkMateTheme* _tmp14;
	g_return_val_if_fail (dict != NULL, NULL);
	theme = g_object_ref_sink (gtk_mate_theme_new ());
	theme->is_initialized = FALSE;
	nm = plist_dict_get (dict, "name");
	if (nm != NULL) {
		char* _tmp1;
		const char* _tmp0;
		_tmp1 = NULL;
		_tmp0 = NULL;
		theme->name = (_tmp1 = (_tmp0 = PLIST_STRING (nm)->str, (_tmp0 == NULL) ? NULL : g_strdup (_tmp0)), theme->name = (g_free (theme->name), NULL), _tmp1);
	}
	_tmp2 = NULL;
	nm = (_tmp2 = plist_dict_get (dict, "author"), (nm == NULL) ? NULL : (nm = (g_object_unref (nm), NULL)), _tmp2);
	if (nm != NULL) {
		char* _tmp4;
		const char* _tmp3;
		_tmp4 = NULL;
		_tmp3 = NULL;
		theme->author = (_tmp4 = (_tmp3 = PLIST_STRING (nm)->str, (_tmp3 == NULL) ? NULL : g_strdup (_tmp3)), theme->author = (g_free (theme->author), NULL), _tmp4);
	}
	_tmp5 = NULL;
	theme->global_settings = (_tmp5 = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_str_hash, g_str_equal, g_direct_equal), (theme->global_settings == NULL) ? NULL : (theme->global_settings = (g_object_unref (theme->global_settings), NULL)), _tmp5);
	_tmp6 = NULL;
	theme->settings = (_tmp6 = gee_array_list_new (GTK_MATE_TYPE_THEME_SETTING, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (theme->settings == NULL) ? NULL : (theme->settings = (g_object_unref (theme->settings), NULL)), _tmp6);
	na = PLIST_ARRAY (plist_dict_get (dict, "settings"));
	{
		GeeIterator* _nn_it;
		_nn_it = gee_iterable_iterator ((GeeIterable*) na->array);
		while (gee_iterator_next (_nn_it)) {
			PListNode* nn;
			PListDict* _tmp7;
			PListDict* nd;
			PListNode* _tmp8;
			gboolean _tmp9;
			nn = (PListNode*) gee_iterator_get (_nn_it);
			_tmp7 = NULL;
			nd = (_tmp7 = PLIST_DICT (nn), (_tmp7 == NULL) ? NULL : g_object_ref (_tmp7));
			_tmp8 = NULL;
			if ((_tmp9 = (_tmp8 = plist_dict_get (nd, "scope")) == NULL, (_tmp8 == NULL) ? NULL : (_tmp8 = (g_object_unref (_tmp8), NULL)), _tmp9)) {
				PListDict* gsd;
				gsd = PLIST_DICT (plist_dict_get (nd, "settings"));
				{
					gint _tmp10;
					char** key_collection;
					int key_collection_length1;
					int key_it;
					key_collection = plist_dict_keys (gsd, &_tmp10);
					key_collection_length1 = _tmp10;
					for (key_it = 0; key_it < _tmp10; key_it = key_it + 1) {
						const char* _tmp12;
						char* key;
						_tmp12 = NULL;
						key = (_tmp12 = key_collection[key_it], (_tmp12 == NULL) ? NULL : g_strdup (_tmp12));
						{
							PListString* _tmp11;
							_tmp11 = NULL;
							gee_map_set ((GeeMap*) theme->global_settings, key, (_tmp11 = PLIST_STRING (plist_dict_get (gsd, key)))->str);
							(_tmp11 == NULL) ? NULL : (_tmp11 = (g_object_unref (_tmp11), NULL));
							key = (g_free (key), NULL);
						}
					}
					key_collection = (_vala_array_free (key_collection, key_collection_length1, (GDestroyNotify) g_free), NULL);
				}
				(gsd == NULL) ? NULL : (gsd = (g_object_unref (gsd), NULL));
			} else {
				GtkMateThemeSetting* _tmp13;
				_tmp13 = NULL;
				gee_collection_add ((GeeCollection*) theme->settings, _tmp13 = gtk_mate_theme_setting_create_from_plist (nd));
				(_tmp13 == NULL) ? NULL : (_tmp13 = (g_object_unref (_tmp13), NULL));
			}
			(nn == NULL) ? NULL : (nn = (g_object_unref (nn), NULL));
			(nd == NULL) ? NULL : (nd = (g_object_unref (nd), NULL));
		}
		(_nn_it == NULL) ? NULL : (_nn_it = (g_object_unref (_nn_it), NULL));
	}
	_tmp14 = NULL;
	return (_tmp14 = theme, (nm == NULL) ? NULL : (nm = (g_object_unref (nm), NULL)), (na == NULL) ? NULL : (na = (g_object_unref (na), NULL)), _tmp14);
}
Esempio n. 25
0
GeeArrayList* gtk_mate_theme_theme_filenames (void) {
	GError * inner_error;
	GeeArrayList* names;
	char* share_dir;
	char* name;
	GeeArrayList* _tmp8;
	inner_error = NULL;
	names = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, g_direct_equal);
	share_dir = gtk_mate_textmate_share_dir ();
	name = NULL;
	{
		char* _tmp0;
		GDir* _tmp1;
		GDir* d;
		char* _tmp3;
		const char* _tmp2;
		GeeArrayList* _tmp6;
		_tmp0 = NULL;
		_tmp1 = NULL;
		d = (_tmp1 = g_dir_open (_tmp0 = g_strconcat (share_dir, "/Themes", NULL), 0, &inner_error), _tmp0 = (g_free (_tmp0), NULL), _tmp1);
		if (inner_error != NULL) {
			if (inner_error->domain == G_FILE_ERROR) {
				goto __catch6_g_file_error;
			}
			goto __finally6;
		}
		_tmp3 = NULL;
		_tmp2 = NULL;
		while ((name = (_tmp3 = (_tmp2 = g_dir_read_name (d), (_tmp2 == NULL) ? NULL : g_strdup (_tmp2)), name = (g_free (name), NULL), _tmp3)) != NULL) {
			if (g_str_has_suffix (name, ".tmTheme")) {
				char* _tmp5;
				char* _tmp4;
				_tmp5 = NULL;
				_tmp4 = NULL;
				gee_collection_add ((GeeCollection*) names, _tmp5 = g_strconcat (_tmp4 = g_strconcat (share_dir, "/Themes/", NULL), name, NULL));
				_tmp5 = (g_free (_tmp5), NULL);
				_tmp4 = (g_free (_tmp4), NULL);
			}
		}
		_tmp6 = NULL;
		return (_tmp6 = names, (d == NULL) ? NULL : (d = (g_dir_close (d), NULL)), share_dir = (g_free (share_dir), NULL), name = (g_free (name), NULL), _tmp6);
	}
	goto __finally6;
	__catch6_g_file_error:
	{
		GError * e;
		e = inner_error;
		inner_error = NULL;
		{
			char* _tmp7;
			_tmp7 = NULL;
			fprintf (stdout, "couldn't open: %s\n", _tmp7 = g_strconcat (share_dir, "/Bundles", NULL));
			_tmp7 = (g_free (_tmp7), NULL);
			(e == NULL) ? NULL : (e = (g_error_free (e), NULL));
		}
	}
	__finally6:
	if (inner_error != NULL) {
		(names == NULL) ? NULL : (names = (g_object_unref (names), NULL));
		share_dir = (g_free (share_dir), NULL);
		name = (g_free (name), NULL);
		g_critical ("file %s: line %d: uncaught error: %s", __FILE__, __LINE__, inner_error->message);
		g_clear_error (&inner_error);
		return NULL;
	}
	_tmp8 = NULL;
	return (_tmp8 = NULL, (names == NULL) ? NULL : (names = (g_object_unref (names), NULL)), share_dir = (g_free (share_dir), NULL), name = (g_free (name), NULL), _tmp8);
}
Esempio n. 26
0
GeeArrayList* string_helper_occurrences (const char* s, const char* t) {
	GError * _inner_error_;
	GRegex* grx;
	GeeArrayList* poss;
	GMatchInfo* m;
	GeeArrayList* _tmp7_;
	g_return_val_if_fail (s != NULL, NULL);
	g_return_val_if_fail (t != NULL, NULL);
	_inner_error_ = NULL;
	grx = NULL;
	poss = gee_array_list_new (G_TYPE_INT, NULL, NULL, g_direct_equal);
	m = NULL;
	{
		GRegex* _tmp1_;
		char* _tmp0_;
		GMatchInfo* _tmp4_;
		gboolean _tmp3_;
		GMatchInfo* _tmp2_;
		_tmp1_ = NULL;
		_tmp0_ = NULL;
		grx = (_tmp1_ = g_regex_new (_tmp0_ = g_regex_escape_string (t, -1), 0, 0, &_inner_error_), (grx == NULL) ? NULL : (grx = (g_regex_unref (grx), NULL)), _tmp1_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch5_g_regex_error;
			}
			goto __finally5;
		}
		_tmp0_ = (g_free (_tmp0_), NULL);
		_tmp4_ = NULL;
		_tmp2_ = NULL;
		if ((_tmp3_ = g_regex_match (grx, s, 0, &_tmp2_), m = (_tmp4_ = _tmp2_, (m == NULL) ? NULL : (m = (g_match_info_free (m), NULL)), _tmp4_), _tmp3_)) {
			gint spos;
			gint epos;
			spos = 0;
			epos = 0;
			g_match_info_fetch_pos (m, 0, &spos, &epos);
			gee_collection_add ((GeeCollection*) poss, GINT_TO_POINTER (spos));
			while (TRUE) {
				gboolean _tmp5_;
				gint mspos;
				gint mepos;
				_tmp5_ = g_match_info_next (m, &_inner_error_);
				if (_inner_error_ != NULL) {
					if (_inner_error_->domain == G_REGEX_ERROR) {
						goto __catch5_g_regex_error;
					}
					goto __finally5;
				}
				if (!_tmp5_) {
					break;
				}
				mspos = 0;
				mepos = 0;
				g_match_info_fetch_pos (m, 0, &mspos, &mepos);
				gee_collection_add ((GeeCollection*) poss, GINT_TO_POINTER (mspos));
			}
		}
	}
	goto __finally5;
	__catch5_g_regex_error:
	{
		GError * e;
		e = _inner_error_;
		_inner_error_ = NULL;
		{
			GeeArrayList* _tmp6_;
			_tmp6_ = NULL;
			return (_tmp6_ = gee_array_list_new (G_TYPE_INT, NULL, NULL, g_direct_equal), (e == NULL) ? NULL : (e = (g_error_free (e), NULL)), (grx == NULL) ? NULL : (grx = (g_regex_unref (grx), NULL)), (poss == NULL) ? NULL : (poss = (g_object_unref (poss), NULL)), (m == NULL) ? NULL : (m = (g_match_info_free (m), NULL)), _tmp6_);
		}
	}
	__finally5:
	if (_inner_error_ != NULL) {
		(grx == NULL) ? NULL : (grx = (g_regex_unref (grx), NULL));
		(poss == NULL) ? NULL : (poss = (g_object_unref (poss), NULL));
		(m == NULL) ? NULL : (m = (g_match_info_free (m), NULL));
		g_critical ("file %s: line %d: uncaught error: %s", __FILE__, __LINE__, _inner_error_->message);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp7_ = NULL;
	return (_tmp7_ = poss, (grx == NULL) ? NULL : (grx = (g_regex_unref (grx), NULL)), (m == NULL) ? NULL : (m = (g_match_info_free (m), NULL)), _tmp7_);
}
Esempio n. 27
0
GtkMateDoublePattern* gtk_mate_double_pattern_create_from_plist (GeeArrayList* all_patterns, PListDict* pd) {
	PListString* ns;
	GtkMateDoublePattern* pattern;
	PListString* _tmp0;
	PListString* _tmp3;
	char* _tmp5;
	const char* _tmp4;
	OnigRx* _tmp6;
	PListString* _tmp7;
	char* _tmp9;
	const char* _tmp8;
	PListString* _tmp10;
	PListNode* n;
	PListNode* _tmp14;
	PListNode* _tmp16;
	GeeHashMap* _tmp17;
	GeeArrayList* _tmp18;
	PListNode* ps;
	GtkMatePattern* subpattern;
	PListNode* _tmp20;
	gboolean _tmp21;
	gboolean _tmp22;
	GtkMateDoublePattern* _tmp25;
	g_return_val_if_fail (all_patterns != NULL, NULL);
	g_return_val_if_fail (pd != NULL, NULL);
	ns = NULL;
	pattern = g_object_ref_sink (gtk_mate_double_pattern_new ());
	_tmp0 = NULL;
	ns = (_tmp0 = PLIST_STRING (plist_dict_get (pd, "name")), (ns == NULL) ? NULL : (ns = (g_object_unref (ns), NULL)), _tmp0);
	if (ns != NULL) {
		char* _tmp2;
		const char* _tmp1;
		_tmp2 = NULL;
		_tmp1 = NULL;
		((GtkMatePattern*) pattern)->name = (_tmp2 = (_tmp1 = ns->str, (_tmp1 == NULL) ? NULL : g_strdup (_tmp1)), ((GtkMatePattern*) pattern)->name = (g_free (((GtkMatePattern*) pattern)->name), NULL), _tmp2);
	}
	_tmp3 = NULL;
	ns = (_tmp3 = PLIST_STRING (plist_dict_get (pd, "begin")), (ns == NULL) ? NULL : (ns = (g_object_unref (ns), NULL)), _tmp3);
	_tmp5 = NULL;
	_tmp4 = NULL;
	pattern->begin_string = (_tmp5 = (_tmp4 = ns->str, (_tmp4 == NULL) ? NULL : g_strdup (_tmp4)), pattern->begin_string = (g_free (pattern->begin_string), NULL), _tmp5);
	_tmp6 = NULL;
	pattern->begin = (_tmp6 = onig_rx_make1 (ns->str), (pattern->begin == NULL) ? NULL : (pattern->begin = (g_object_unref (pattern->begin), NULL)), _tmp6);
	_tmp7 = NULL;
	ns = (_tmp7 = PLIST_STRING (plist_dict_get (pd, "end")), (ns == NULL) ? NULL : (ns = (g_object_unref (ns), NULL)), _tmp7);
	_tmp9 = NULL;
	_tmp8 = NULL;
	pattern->end_string = (_tmp9 = (_tmp8 = ns->str, (_tmp8 == NULL) ? NULL : g_strdup (_tmp8)), pattern->end_string = (g_free (pattern->end_string), NULL), _tmp9);
	_tmp10 = NULL;
	ns = (_tmp10 = PLIST_STRING (plist_dict_get (pd, "contentName")), (ns == NULL) ? NULL : (ns = (g_object_unref (ns), NULL)), _tmp10);
	if (ns != NULL) {
		char* _tmp12;
		const char* _tmp11;
		_tmp12 = NULL;
		_tmp11 = NULL;
		pattern->content_name = (_tmp12 = (_tmp11 = ns->str, (_tmp11 == NULL) ? NULL : g_strdup (_tmp11)), pattern->content_name = (g_free (pattern->content_name), NULL), _tmp12);
	}
	n = plist_dict_get (pd, "beginCaptures");
	if (n != NULL) {
		GeeHashMap* _tmp13;
		_tmp13 = NULL;
		pattern->begin_captures = (_tmp13 = gtk_mate_pattern_make_captures_from_plist (PLIST_DICT (n)), (pattern->begin_captures == NULL) ? NULL : (pattern->begin_captures = (g_object_unref (pattern->begin_captures), NULL)), _tmp13);
	}
	_tmp14 = NULL;
	n = (_tmp14 = plist_dict_get (pd, "captures"), (n == NULL) ? NULL : (n = (g_object_unref (n), NULL)), _tmp14);
	if (n != NULL) {
		GeeHashMap* _tmp15;
		_tmp15 = NULL;
		pattern->both_captures = (_tmp15 = gtk_mate_pattern_make_captures_from_plist (PLIST_DICT (n)), (pattern->both_captures == NULL) ? NULL : (pattern->both_captures = (g_object_unref (pattern->both_captures), NULL)), _tmp15);
	}
	_tmp16 = NULL;
	n = (_tmp16 = plist_dict_get (pd, "endCaptures"), (n == NULL) ? NULL : (n = (g_object_unref (n), NULL)), _tmp16);
	_tmp17 = NULL;
	pattern->end_captures = (_tmp17 = gtk_mate_pattern_make_captures_from_plist (PLIST_DICT (n)), (pattern->end_captures == NULL) ? NULL : (pattern->end_captures = (g_object_unref (pattern->end_captures), NULL)), _tmp17);
	_tmp18 = NULL;
	pattern->patterns = (_tmp18 = gee_array_list_new (GTK_MATE_TYPE_PATTERN, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal), (pattern->patterns == NULL) ? NULL : (pattern->patterns = (g_object_unref (pattern->patterns), NULL)), _tmp18);
	ps = plist_dict_get (pd, "patterns");
	subpattern = NULL;
	if (ps != NULL) {
		{
			GeeIterator* _p_it;
			_p_it = gee_iterable_iterator ((GeeIterable*) PLIST_ARRAY (ps)->array);
			while (gee_iterator_next (_p_it)) {
				PListNode* p;
				GtkMatePattern* _tmp19;
				p = (PListNode*) gee_iterator_get (_p_it);
				_tmp19 = NULL;
				subpattern = (_tmp19 = gtk_mate_pattern_create_from_plist (all_patterns, PLIST_DICT (p)), (subpattern == NULL) ? NULL : (subpattern = (g_object_unref (subpattern), NULL)), _tmp19);
				if (subpattern != NULL) {
					gee_collection_add ((GeeCollection*) pattern->patterns, subpattern);
				}
				(p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
			}
			(_p_it == NULL) ? NULL : (_p_it = (g_object_unref (_p_it), NULL));
		}
	}
	_tmp20 = NULL;
	n = (_tmp20 = plist_dict_get (pd, "disabled"), (n == NULL) ? NULL : (n = (g_object_unref (n), NULL)), _tmp20);
	_tmp21 = FALSE;
	_tmp22 = FALSE;
	if (n != NULL) {
		_tmp22 = PLIST_IS_INTEGER (n);
	} else {
		_tmp22 = FALSE;
	}
	if (_tmp22) {
		_tmp21 = PLIST_INTEGER (n)->value == 1;
	} else {
		_tmp21 = FALSE;
	}
	if (_tmp21) {
		((GtkMatePattern*) pattern)->disabled = TRUE;
	} else {
		gboolean _tmp23;
		gboolean _tmp24;
		_tmp23 = FALSE;
		_tmp24 = FALSE;
		if (n != NULL) {
			_tmp24 = PLIST_IS_STRING (n);
		} else {
			_tmp24 = FALSE;
		}
		if (_tmp24) {
			_tmp23 = _vala_strcmp0 (PLIST_STRING (n)->str, "1") == 0;
		} else {
			_tmp23 = FALSE;
		}
		if (_tmp23) {
			((GtkMatePattern*) pattern)->disabled = TRUE;
		} else {
			((GtkMatePattern*) pattern)->disabled = FALSE;
		}
	}
	gee_collection_add ((GeeCollection*) all_patterns, (GtkMatePattern*) pattern);
	_tmp25 = NULL;
	return (_tmp25 = pattern, (ns == NULL) ? NULL : (ns = (g_object_unref (ns), NULL)), (n == NULL) ? NULL : (n = (g_object_unref (n), NULL)), (ps == NULL) ? NULL : (ps = (g_object_unref (ps), NULL)), (subpattern == NULL) ? NULL : (subpattern = (g_object_unref (subpattern), NULL)), _tmp25);
}
Esempio n. 28
0
void gtk_mate_pattern_replace_base_and_self_includes (GeeArrayList* patlist, GtkMateGrammar* g) {
	GeeArrayList* include_patterns;
	GeeArrayList* patterns_to_include;
	gboolean already_self;
	GtkMateGrammar* ng;
	g_return_if_fail (patlist != NULL);
	g_return_if_fail (g != NULL);
	include_patterns = gee_array_list_new (GTK_MATE_TYPE_PATTERN, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal);
	patterns_to_include = gee_array_list_new (GTK_MATE_TYPE_PATTERN, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal);
	already_self = FALSE;
	/* some patterns have $self twice*/
	ng = NULL;
	{
		GeeIterator* _p_it;
		_p_it = gee_iterable_iterator ((GeeIterable*) patlist);
		while (gee_iterator_next (_p_it)) {
			GtkMatePattern* p;
			p = (GtkMatePattern*) gee_iterator_get (_p_it);
			if (GTK_MATE_IS_INCLUDE_PATTERN (p)) {
				if (g_str_has_prefix (p->name, "$")) {
					gboolean _tmp0;
					gboolean _tmp1;
					gee_collection_add ((GeeCollection*) include_patterns, p);
					_tmp0 = FALSE;
					_tmp1 = FALSE;
					if (_vala_strcmp0 (p->name, "$self") == 0) {
						_tmp1 = TRUE;
					} else {
						_tmp1 = _vala_strcmp0 (p->name, "$base") == 0;
					}
					if (_tmp1) {
						_tmp0 = !already_self;
					} else {
						_tmp0 = FALSE;
					}
					if (_tmp0) {
						already_self = TRUE;
						{
							GeeIterator* _pat_it;
							_pat_it = gee_iterable_iterator ((GeeIterable*) g->patterns);
							while (gee_iterator_next (_pat_it)) {
								GtkMatePattern* pat;
								pat = (GtkMatePattern*) gee_iterator_get (_pat_it);
								gee_collection_add ((GeeCollection*) patterns_to_include, pat);
								(pat == NULL) ? NULL : (pat = (g_object_unref (pat), NULL));
							}
							(_pat_it == NULL) ? NULL : (_pat_it = (g_object_unref (_pat_it), NULL));
						}
					}
				} else {
					GtkMateGrammar* _tmp2;
					_tmp2 = NULL;
					if ((ng = (_tmp2 = gtk_mate_grammar_find_by_scope_name (p->name), (ng == NULL) ? NULL : (ng = (g_object_unref (ng), NULL)), _tmp2)) != NULL) {
						gtk_mate_grammar_init_for_use (ng);
						gee_collection_add ((GeeCollection*) include_patterns, p);
						{
							GeeIterator* _pat_it;
							_pat_it = gee_iterable_iterator ((GeeIterable*) ng->patterns);
							while (gee_iterator_next (_pat_it)) {
								GtkMatePattern* pat;
								pat = (GtkMatePattern*) gee_iterator_get (_pat_it);
								gee_collection_add ((GeeCollection*) patterns_to_include, pat);
								(pat == NULL) ? NULL : (pat = (g_object_unref (pat), NULL));
							}
							(_pat_it == NULL) ? NULL : (_pat_it = (g_object_unref (_pat_it), NULL));
						}
					} else {
					}
				}
			}
			(p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
		}
		(_p_it == NULL) ? NULL : (_p_it = (g_object_unref (_p_it), NULL));
	}
	/*stdout.printf("unknown include pattern: %s\n", p.name);*/
	gtk_mate_pattern_remove_patterns (patlist, include_patterns);
	gtk_mate_pattern_add_patterns (patlist, patterns_to_include);
	(include_patterns == NULL) ? NULL : (include_patterns = (g_object_unref (include_patterns), NULL));
	(patterns_to_include == NULL) ? NULL : (patterns_to_include = (g_object_unref (patterns_to_include), NULL));
	(ng == NULL) ? NULL : (ng = (g_object_unref (ng), NULL));
}
Esempio n. 29
0
void gtk_mate_pattern_replace_repository_includes (GeeArrayList* patlist, GtkMateGrammar* g) {
	GeeArrayList* include_patterns;
	GeeArrayList* patterns_to_include;
	gboolean any_included;
	g_return_if_fail (patlist != NULL);
	g_return_if_fail (g != NULL);
	include_patterns = gee_array_list_new (GTK_MATE_TYPE_PATTERN, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal);
	patterns_to_include = gee_array_list_new (GTK_MATE_TYPE_PATTERN, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_equal);
	any_included = TRUE;
	while (any_included) {
		/* stdout.printf("repo replacement pass\n");*/
		any_included = FALSE;
		{
			GeeIterator* _p_it;
			_p_it = gee_iterable_iterator ((GeeIterable*) patlist);
			while (gee_iterator_next (_p_it)) {
				GtkMatePattern* p;
				gboolean _tmp0;
				p = (GtkMatePattern*) gee_iterator_get (_p_it);
				_tmp0 = FALSE;
				if (GTK_MATE_IS_INCLUDE_PATTERN (p)) {
					_tmp0 = g_str_has_prefix (p->name, "#");
				} else {
					_tmp0 = FALSE;
				}
				if (_tmp0) {
					char* reponame;
					GeeArrayList* ps;
					gee_collection_add ((GeeCollection*) include_patterns, p);
					reponame = string_substring (p->name, (glong) 1, (glong) (((gint) strlen (p->name)) - 1));
					ps = (GeeArrayList*) gee_map_get ((GeeMap*) g->repository, reponame);
					/* stdout.printf("(%s) getting reponame: %s (%d)\n", this.name, reponame, ps.size);*/
					if (ps != NULL) {
						{
							GeeIterator* _p1_it;
							_p1_it = gee_iterable_iterator ((GeeIterable*) ps);
							while (gee_iterator_next (_p1_it)) {
								GtkMatePattern* p1;
								p1 = (GtkMatePattern*) gee_iterator_get (_p1_it);
								any_included = TRUE;
								gee_collection_add ((GeeCollection*) patterns_to_include, p1);
								(p1 == NULL) ? NULL : (p1 = (g_object_unref (p1), NULL));
							}
							(_p1_it == NULL) ? NULL : (_p1_it = (g_object_unref (_p1_it), NULL));
						}
					} else {
						fprintf (stdout, "warning: couldn't find repository key '%s' in grammar '%s'\n", reponame, gtk_mate_grammar_get_name (g));
					}
					reponame = (g_free (reponame), NULL);
					(ps == NULL) ? NULL : (ps = (g_object_unref (ps), NULL));
				}
				(p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
			}
			(_p_it == NULL) ? NULL : (_p_it = (g_object_unref (_p_it), NULL));
		}
		gtk_mate_pattern_remove_patterns (patlist, include_patterns);
		gtk_mate_pattern_add_patterns (patlist, patterns_to_include);
		gee_collection_clear ((GeeCollection*) include_patterns);
		gee_collection_clear ((GeeCollection*) patterns_to_include);
	}
	(include_patterns == NULL) ? NULL : (include_patterns = (g_object_unref (include_patterns), NULL));
	(patterns_to_include == NULL) ? NULL : (patterns_to_include = (g_object_unref (patterns_to_include), NULL));
}
Esempio n. 30
0
GeeArrayList* slingshot_backend_gmenu_entries_get_all (void) {
    GeeArrayList* result = NULL;
    GeeArrayList* _tmp0_;
    GeeArrayList* the_apps;
    GeeArrayList* _tmp1_ = NULL;
    GeeArrayList* all_categories;
    _tmp0_ = gee_array_list_new (G_TYPE_POINTER, (GBoxedCopyFunc) gmenu_tree_item_ref, gmenu_tree_item_unref, NULL);
    the_apps = _tmp0_;
    _tmp1_ = slingshot_backend_gmenu_entries_get_categories ();
    all_categories = _tmp1_;
    {
        GeeArrayList* _tmp2_;
        GeeArrayList* _tmp3_;
        GeeArrayList* _directory_list;
        GeeArrayList* _tmp4_;
        gint _tmp5_;
        gint _tmp6_;
        gint _directory_size;
        gint _directory_index;
        _tmp2_ = all_categories;
        _tmp3_ = _g_object_ref0 (_tmp2_);
        _directory_list = _tmp3_;
        _tmp4_ = _directory_list;
        _tmp5_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp4_);
        _tmp6_ = _tmp5_;
        _directory_size = _tmp6_;
        _directory_index = -1;
        while (TRUE) {
            gint _tmp7_;
            gint _tmp8_;
            gint _tmp9_;
            GeeArrayList* _tmp10_;
            gint _tmp11_;
            gpointer _tmp12_ = NULL;
            GMenuTreeDirectory* directory;
            GMenuTreeDirectory* _tmp13_;
            GeeArrayList* _tmp14_ = NULL;
            GeeArrayList* this_category_apps;
            _tmp7_ = _directory_index;
            _directory_index = _tmp7_ + 1;
            _tmp8_ = _directory_index;
            _tmp9_ = _directory_size;
            if (!(_tmp8_ < _tmp9_)) {
                break;
            }
            _tmp10_ = _directory_list;
            _tmp11_ = _directory_index;
            _tmp12_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _tmp11_);
            directory = (GMenuTreeDirectory*) _tmp12_;
            _tmp13_ = directory;
            _tmp14_ = slingshot_backend_gmenu_entries_get_applications_for_category (_tmp13_);
            this_category_apps = _tmp14_;
            {
                GeeArrayList* _tmp15_;
                GeeArrayList* _tmp16_;
                GeeArrayList* _this_app_list;
                GeeArrayList* _tmp17_;
                gint _tmp18_;
                gint _tmp19_;
                gint _this_app_size;
                gint _this_app_index;
                _tmp15_ = this_category_apps;
                _tmp16_ = _g_object_ref0 (_tmp15_);
                _this_app_list = _tmp16_;
                _tmp17_ = _this_app_list;
                _tmp18_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp17_);
                _tmp19_ = _tmp18_;
                _this_app_size = _tmp19_;
                _this_app_index = -1;
                while (TRUE) {
                    gint _tmp20_;
                    gint _tmp21_;
                    gint _tmp22_;
                    GeeArrayList* _tmp23_;
                    gint _tmp24_;
                    gpointer _tmp25_ = NULL;
                    GMenuTreeEntry* this_app;
                    GeeArrayList* _tmp26_;
                    GMenuTreeEntry* _tmp27_;
                    _tmp20_ = _this_app_index;
                    _this_app_index = _tmp20_ + 1;
                    _tmp21_ = _this_app_index;
                    _tmp22_ = _this_app_size;
                    if (!(_tmp21_ < _tmp22_)) {
                        break;
                    }
                    _tmp23_ = _this_app_list;
                    _tmp24_ = _this_app_index;
                    _tmp25_ = gee_abstract_list_get ((GeeAbstractList*) _tmp23_, _tmp24_);
                    this_app = (GMenuTreeEntry*) _tmp25_;
                    _tmp26_ = the_apps;
                    _tmp27_ = this_app;
                    gee_abstract_collection_add ((GeeAbstractCollection*) _tmp26_, _tmp27_);
                    _gmenu_tree_item_unref0 (this_app);
                }
                _g_object_unref0 (_this_app_list);
            }
            _g_object_unref0 (this_category_apps);
            _gmenu_tree_item_unref0 (directory);
        }
        _g_object_unref0 (_directory_list);
    }
    result = the_apps;
    _g_object_unref0 (all_categories);
    return result;
}