Beispiel #1
0
GtkMateGrammar* gtk_mate_grammar_find_by_scope_name (const char* scope) {
	g_return_val_if_fail (scope != NULL, NULL);
	{
		GeeIterator* _bundle_it;
		_bundle_it = gee_iterable_iterator ((GeeIterable*) gtk_mate_buffer_bundles);
		while (gee_iterator_next (_bundle_it)) {
			GtkMateBundle* bundle;
			bundle = (GtkMateBundle*) gee_iterator_get (_bundle_it);
			{
				GeeIterator* _gr_it;
				_gr_it = gee_iterable_iterator ((GeeIterable*) bundle->grammars);
				while (gee_iterator_next (_gr_it)) {
					GtkMateGrammar* gr;
					gr = (GtkMateGrammar*) gee_iterator_get (_gr_it);
					if (_vala_strcmp0 (gr->scope_name, scope) == 0) {
						GtkMateGrammar* _tmp0;
						_tmp0 = NULL;
						return (_tmp0 = gr, (_gr_it == NULL) ? NULL : (_gr_it = (g_object_unref (_gr_it), NULL)), (bundle == NULL) ? NULL : (bundle = (g_object_unref (bundle), NULL)), (_bundle_it == NULL) ? NULL : (_bundle_it = (g_object_unref (_bundle_it), NULL)), _tmp0);
					}
					(gr == NULL) ? NULL : (gr = (g_object_unref (gr), NULL));
				}
				(_gr_it == NULL) ? NULL : (_gr_it = (g_object_unref (_gr_it), NULL));
			}
			(bundle == NULL) ? NULL : (bundle = (g_object_unref (bundle), NULL));
		}
		(_bundle_it == NULL) ? NULL : (_bundle_it = (g_object_unref (_bundle_it), NULL));
	}
	return NULL;
}
static RygelTrackerCategory* rygel_tracker_root_container_get_item_category (RygelTrackerRootContainer* self, const char* item_id) {
	RygelTrackerCategory* category;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (item_id != NULL, NULL);
	category = NULL;
	{
		GeeIterator* _tmp_it;
		_tmp_it = gee_iterable_iterator ((GeeIterable*) self->priv->categories);
		while (gee_iterator_next (_tmp_it)) {
			RygelTrackerCategory* tmp;
			tmp = (RygelTrackerCategory*) gee_iterator_get (_tmp_it);
			if (rygel_tracker_category_is_thy_child (tmp, item_id)) {
				RygelTrackerCategory* _tmp1_;
				RygelTrackerCategory* _tmp0_;
				_tmp1_ = NULL;
				_tmp0_ = NULL;
				category = (_tmp1_ = (_tmp0_ = tmp, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (category == NULL) ? NULL : (category = (g_object_unref (category), NULL)), _tmp1_);
				(tmp == NULL) ? NULL : (tmp = (g_object_unref (tmp), NULL));
				break;
			}
			(tmp == NULL) ? NULL : (tmp = (g_object_unref (tmp), NULL));
		}
		(_tmp_it == NULL) ? NULL : (_tmp_it = (g_object_unref (_tmp_it), NULL));
	}
	return category;
}
/* Private methods */
static RygelTrackerCategory* rygel_tracker_root_container_find_category_by_id (RygelTrackerRootContainer* self, const char* category_id) {
	RygelTrackerCategory* category;
	RygelTrackerCategory* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (category_id != NULL, NULL);
	category = NULL;
	_tmp0_ = NULL;
	category = (_tmp0_ = NULL, (category == NULL) ? NULL : (category = (g_object_unref (category), NULL)), _tmp0_);
	{
		GeeIterator* _tmp_it;
		_tmp_it = gee_iterable_iterator ((GeeIterable*) self->priv->categories);
		while (gee_iterator_next (_tmp_it)) {
			RygelTrackerCategory* tmp;
			tmp = (RygelTrackerCategory*) gee_iterator_get (_tmp_it);
			if (_vala_strcmp0 (category_id, ((RygelMediaObject*) tmp)->id) == 0) {
				RygelTrackerCategory* _tmp2_;
				RygelTrackerCategory* _tmp1_;
				_tmp2_ = NULL;
				_tmp1_ = NULL;
				category = (_tmp2_ = (_tmp1_ = tmp, (_tmp1_ == NULL) ? NULL : g_object_ref (_tmp1_)), (category == NULL) ? NULL : (category = (g_object_unref (category), NULL)), _tmp2_);
				(tmp == NULL) ? NULL : (tmp = (g_object_unref (tmp), NULL));
				break;
			}
			(tmp == NULL) ? NULL : (tmp = (g_object_unref (tmp), NULL));
		}
		(_tmp_it == NULL) ? NULL : (_tmp_it = (g_object_unref (_tmp_it), NULL));
	}
	return category;
}
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;
}
Beispiel #5
0
gboolean gtk_mate_theme_setting_match (GtkMateThemeSetting* self, const char* scope, OnigMatch** match) {
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (scope != NULL, FALSE);
	*match = NULL;
	if (self->matchers == NULL) {
		gtk_mate_theme_setting_compile_scope_matchers (self);
	}
	{
		GeeIterator* _matcher_it;
		_matcher_it = gee_iterable_iterator ((GeeIterable*) self->matchers);
		while (gee_iterator_next (_matcher_it)) {
			GtkMateMatcher* matcher;
			OnigMatch* _tmp2;
			gboolean _tmp1;
			OnigMatch* _tmp0;
			matcher = (GtkMateMatcher*) gee_iterator_get (_matcher_it);
			_tmp2 = NULL;
			_tmp0 = NULL;
			if ((_tmp1 = gtk_mate_matcher_test_match_re (matcher->pos_rx, matcher->neg_rxs, scope, &_tmp0), (*match) = (_tmp2 = _tmp0, ((*match) == NULL) ? NULL : ((*match) = (g_object_unref ((*match)), NULL)), _tmp2), _tmp1)) {
				gboolean _tmp3;
				return (_tmp3 = TRUE, (matcher == NULL) ? NULL : (matcher = (g_object_unref (matcher), NULL)), (_matcher_it == NULL) ? NULL : (_matcher_it = (g_object_unref (_matcher_it), NULL)), _tmp3);
			}
			(matcher == NULL) ? NULL : (matcher = (g_object_unref (matcher), NULL));
		}
		(_matcher_it == NULL) ? NULL : (_matcher_it = (g_object_unref (_matcher_it), NULL));
	}
	return FALSE;
}
Beispiel #6
0
static void _lambda62_ (void) {
#line 324 "ease-main.vala"
	gtk_object_destroy ((GtkObject*) ease_main_player);
#line 959 "ease-main.c"
	{
		GeeIterator* _info_it;
#line 325 "ease-main.vala"
		_info_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) ease_main_windows);
#line 325 "ease-main.vala"
		while (TRUE) {
#line 966 "ease-main.c"
			EaseMainEditorWindowInfo* info;
#line 325 "ease-main.vala"
			if (!gee_iterator_next (_info_it)) {
#line 325 "ease-main.vala"
				break;
#line 972 "ease-main.c"
			}
#line 325 "ease-main.vala"
			info = (EaseMainEditorWindowInfo*) gee_iterator_get (_info_it);
#line 327 "ease-main.vala"
			gtk_widget_show ((GtkWidget*) info->window);
#line 328 "ease-main.vala"
			gtk_window_move ((GtkWindow*) info->window, info->x, info->y);
#line 980 "ease-main.c"
			_ease_main_editor_window_info_unref0 (info);
		}
		_g_object_unref0 (_info_it);
	}
}
Beispiel #7
0
gboolean gtk_mate_view_set_theme_by_name (GtkMateView* self, const char* name) {
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (name != NULL, FALSE);
	{
		GeeArrayList* _tmp0_;
		GeeIterator* _tmp1_;
		GeeIterator* _theme_it;
		_tmp0_ = NULL;
		_tmp1_ = NULL;
		_theme_it = (_tmp1_ = gee_iterable_iterator ((GeeIterable*) (_tmp0_ = gtk_mate_theme_themes ())), (_tmp0_ == NULL) ? NULL : (_tmp0_ = (g_object_unref (_tmp0_), NULL)), _tmp1_);
		while (gee_iterator_next (_theme_it)) {
			GtkMateTheme* theme;
			theme = (GtkMateTheme*) gee_iterator_get (_theme_it);
			if (_vala_strcmp0 (theme->name, name) == 0) {
				gboolean _tmp2_;
				gtk_mate_theme_init_for_use (theme);
				gtk_mate_parser_change_theme (GTK_MATE_BUFFER (gtk_text_view_get_buffer ((GtkTextView*) self))->parser, theme);
				gtk_mate_view_set_global_theme_settings (self);
				return (_tmp2_ = TRUE, (theme == NULL) ? NULL : (theme = (g_object_unref (theme), NULL)), (_theme_it == NULL) ? NULL : (_theme_it = (g_object_unref (_theme_it), NULL)), _tmp2_);
			}
			(theme == NULL) ? NULL : (theme = (g_object_unref (theme), NULL));
		}
		(_theme_it == NULL) ? NULL : (_theme_it = (g_object_unref (_theme_it), NULL));
	}
	return FALSE;
}
Beispiel #8
0
gboolean gtk_mate_matcher_match (const char* selector_string, const char* scope_string, OnigMatch** match) {
	GeeArrayList* matchers;
	gboolean _tmp4;
	g_return_val_if_fail (selector_string != NULL, FALSE);
	g_return_val_if_fail (scope_string != NULL, FALSE);
	*match = NULL;
	matchers = gtk_mate_matcher_compile (selector_string);
	{
		GeeIterator* _matcher_it;
		_matcher_it = gee_iterable_iterator ((GeeIterable*) matchers);
		while (gee_iterator_next (_matcher_it)) {
			GtkMateMatcher* matcher;
			OnigMatch* _tmp2;
			gboolean _tmp1;
			OnigMatch* _tmp0;
			matcher = (GtkMateMatcher*) gee_iterator_get (_matcher_it);
			_tmp2 = NULL;
			_tmp0 = NULL;
			if ((_tmp1 = gtk_mate_matcher_test_match_re (matcher->pos_rx, matcher->neg_rxs, scope_string, &_tmp0), (*match) = (_tmp2 = _tmp0, ((*match) == NULL) ? NULL : ((*match) = (g_object_unref ((*match)), NULL)), _tmp2), _tmp1)) {
				gboolean _tmp3;
				return (_tmp3 = TRUE, (matcher == NULL) ? NULL : (matcher = (g_object_unref (matcher), NULL)), (_matcher_it == NULL) ? NULL : (_matcher_it = (g_object_unref (_matcher_it), NULL)), (matchers == NULL) ? NULL : (matchers = (g_object_unref (matchers), NULL)), _tmp3);
			}
			(matcher == NULL) ? NULL : (matcher = (g_object_unref (matcher), NULL));
		}
		(_matcher_it == NULL) ? NULL : (_matcher_it = (g_object_unref (_matcher_it), NULL));
	}
	return (_tmp4 = FALSE, (matchers == NULL) ? NULL : (matchers = (g_object_unref (matchers), NULL)), _tmp4);
}
Beispiel #9
0
/* Returns TRUE if the given Individual contains a TpContact */
gboolean
empathy_folks_individual_contains_contact (FolksIndividual *individual)
{
  GeeSet *personas;
  GeeIterator *iter;
  gboolean retval = FALSE;

  g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), FALSE);

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (!retval && gee_iterator_next (iter))
    {
      FolksPersona *persona = gee_iterator_get (iter);
      TpContact *contact = NULL;

      if (empathy_folks_persona_is_interesting (persona))
        contact = tpf_persona_get_contact (TPF_PERSONA (persona));

      g_clear_object (&persona);

      if (contact != NULL)
        retval = TRUE;
    }
  g_clear_object (&iter);

  return retval;
}
static gboolean
individual_has_contact (FolksIndividual *individual,
    TpContact *contact)
{
  GeeSet *personas;
  GeeIterator *iter;
  gboolean found = FALSE;

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));

  while (!found && gee_iterator_next (iter))
    {
      TpfPersona *persona = gee_iterator_get (iter);

      if (TPF_IS_PERSONA (persona))
        {
          TpContact *c = tpf_persona_get_contact (persona);

          if (c == contact)
            found = TRUE;
        }

      g_clear_object (&persona);
    }

  g_clear_object (&iter);

  return found;
}
Beispiel #11
0
/* Return the TpContact on @conn associated with @individual, if any */
TpContact *
empathy_get_tp_contact_for_individual (FolksIndividual *individual,
    TpConnection *conn)
{
  TpContact *contact = NULL;
  GeeSet *personas;
  GeeIterator *iter;

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (contact == NULL && gee_iterator_next (iter))
    {
      TpfPersona *persona = gee_iterator_get (iter);
      TpConnection *contact_conn;
      TpContact *contact_cur = NULL;

      if (TPF_IS_PERSONA (persona))
        {
          contact_cur = tpf_persona_get_contact (persona);
          if (contact_cur != NULL)
            {
              contact_conn = tp_contact_get_connection (contact_cur);

              if (!tp_strdiff (tp_proxy_get_object_path (contact_conn),
                    tp_proxy_get_object_path (conn)))
                contact = contact_cur;
            }
        }

      g_clear_object (&persona);
    }
  g_clear_object (&iter);

  return contact;
}
Beispiel #12
0
/* @words = tpaw_live_search_strip_utf8_string (@text);
 *
 * User has to pass both so we don't have to compute @words ourself each time
 * this function is called. */
gboolean
empathy_individual_match_string (FolksIndividual *individual,
    const char *text,
    GPtrArray *words)
{
  const gchar *str;
  GeeSet *personas;
  GeeIterator *iter;
  gboolean retval = FALSE;

  /* check alias name */
  str = folks_alias_details_get_alias (FOLKS_ALIAS_DETAILS (individual));

  if (tpaw_live_search_match_words (str, words))
    return TRUE;

  personas = folks_individual_get_personas (individual);

  /* check contact id, remove the @server.com part */
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (retval == FALSE && gee_iterator_next (iter))
    {
      FolksPersona *persona = gee_iterator_get (iter);
      const gchar *p;

      if (empathy_folks_persona_is_interesting (persona))
        {
          str = folks_persona_get_display_id (persona);

          /* Accept the persona if @text is a full prefix of his ID; that allows
           * user to find, say, a jabber contact by typing his JID. */
          if (g_str_has_prefix (str, text))
            {
              retval = TRUE;
            }
          else
            {
              gchar *dup_str = NULL;
              gboolean visible;

              p = strstr (str, "@");
              if (p != NULL)
                str = dup_str = g_strndup (str, p - str);

              visible = tpaw_live_search_match_words (str, words);
              g_free (dup_str);
              if (visible)
                retval = TRUE;
            }
        }
      g_clear_object (&persona);
    }
  g_clear_object (&iter);

  /* FIXME: Add more rules here, we could check phone numbers in
   * contact's vCard for example. */
  return retval;
}
static GeeList* rygel_folder_container_real_get_children_finish (RygelMediaContainer* base, GAsyncResult* res, GError** error) {
#line 158 "rygel-folder-container.c"
	RygelFolderContainer * self;
	self = (RygelFolderContainer*) base;
#line 85 "rygel-folder-container.vala"
	g_return_val_if_fail (res != NULL, NULL);
#line 88 "rygel-folder-container.vala"
	if (RYGEL_IS_FOLDER_DIRECTORY_SEARCH_RESULT (res)) {
#line 165 "rygel-folder-container.c"
		RygelFolderDirectorySearchResult* _tmp0_;
		RygelFolderDirectorySearchResult* dsr;
		GeeList* _tmp1_;
#line 89 "rygel-folder-container.vala"
		_tmp0_ = NULL;
#line 171 "rygel-folder-container.c"
		dsr = (_tmp0_ = RYGEL_FOLDER_DIRECTORY_SEARCH_RESULT (res), (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
		{
			GeeIterator* _item_it;
			_item_it = gee_iterable_iterator ((GeeIterable*) ((GeeList*) ((RygelSimpleAsyncResult*) dsr)->data));
#line 91 "rygel-folder-container.vala"
			while (gee_iterator_next (_item_it)) {
#line 178 "rygel-folder-container.c"
				RygelMediaObject* item;
				item = (RygelMediaObject*) gee_iterator_get (_item_it);
#line 92 "rygel-folder-container.vala"
				gee_collection_add ((GeeCollection*) self->priv->items, item);
#line 183 "rygel-folder-container.c"
				(item == NULL) ? NULL : (item = (g_object_unref (item), NULL));
			}
			(_item_it == NULL) ? NULL : (_item_it = (g_object_unref (_item_it), NULL));
		}
#line 95 "rygel-folder-container.vala"
		((RygelMediaContainer*) self)->child_count = (guint) gee_collection_get_size ((GeeCollection*) self->priv->items);
#line 96 "rygel-folder-container.vala"
		gee_collection_remove ((GeeCollection*) self->priv->results, res);
#line 97 "rygel-folder-container.vala"
		_tmp1_ = NULL;
#line 97 "rygel-folder-container.vala"
		return (_tmp1_ = rygel_folder_directory_search_result_get_children (dsr), (dsr == NULL) ? NULL : (dsr = (g_object_unref (dsr), NULL)), _tmp1_);
#line 196 "rygel-folder-container.c"
	} else {
		RygelSimpleAsyncResult* _tmp2_;
		RygelSimpleAsyncResult* simple_res;
		GeeList* _tmp3_;
		GeeList* _tmp4_;
#line 99 "rygel-folder-container.vala"
		_tmp2_ = NULL;
#line 204 "rygel-folder-container.c"
		simple_res = (_tmp2_ = RYGEL_SIMPLE_ASYNC_RESULT (res), (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_));
#line 101 "rygel-folder-container.vala"
		_tmp3_ = NULL;
#line 101 "rygel-folder-container.vala"
		_tmp4_ = NULL;
#line 101 "rygel-folder-container.vala"
		return (_tmp4_ = (_tmp3_ = (GeeList*) simple_res->data, (_tmp3_ == NULL) ? NULL : g_object_ref (_tmp3_)), (simple_res == NULL) ? NULL : (simple_res = (g_object_unref (simple_res), NULL)), _tmp4_);
#line 212 "rygel-folder-container.c"
	}
}
Beispiel #14
0
/* Calculate whether the Individual can do audio or video calls.
 * FIXME: We can remove this once libfolks has grown capabilities support
 * again: bgo#626179. */
void
empathy_individual_can_audio_video_call (FolksIndividual *individual,
    gboolean *can_audio_call,
    gboolean *can_video_call,
    EmpathyContact **out_contact)
{
  GeeSet *personas;
  GeeIterator *iter;
  gboolean can_audio = FALSE, can_video = FALSE;

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (gee_iterator_next (iter))
    {
      FolksPersona *persona = gee_iterator_get (iter);
      TpContact *tp_contact;

      if (!empathy_folks_persona_is_interesting (persona))
        goto while_finish;

      tp_contact = tpf_persona_get_contact (TPF_PERSONA (persona));
      if (tp_contact != NULL)
        {
          EmpathyContact *contact;

          contact = empathy_contact_dup_from_tp_contact (tp_contact);
          empathy_contact_set_persona (contact, persona);

          can_audio = can_audio || empathy_contact_get_capabilities (contact) &
              EMPATHY_CAPABILITIES_AUDIO;
          can_video = can_video || empathy_contact_get_capabilities (contact) &
              EMPATHY_CAPABILITIES_VIDEO;

          if (out_contact != NULL)
            *out_contact = g_object_ref (contact);

          g_object_unref (contact);
        }

while_finish:
      g_clear_object (&persona);

      if (can_audio && can_video)
        break;
    }

  g_clear_object (&iter);

  if (can_audio_call != NULL)
    *can_audio_call = can_audio;

  if (can_video_call != NULL)
    *can_video_call = can_video;
}
Beispiel #15
0
GtkMateThemeSetting* gtk_mate_theme_setting_create_from_plist (PListDict* dict) {
	GtkMateThemeSetting* tsetting;
	PListNode* nm;
	PListNode* _tmp2;
	GeeHashMap* _tmp5;
	PListDict* pd;
	GtkMateThemeSetting* _tmp9;
	g_return_val_if_fail (dict != NULL, NULL);
	tsetting = g_object_ref_sink (gtk_mate_theme_setting_new ());
	nm = plist_dict_get (dict, "name");
	if (nm != NULL) {
		char* _tmp1;
		const char* _tmp0;
		_tmp1 = NULL;
		_tmp0 = NULL;
		tsetting->name = (_tmp1 = (_tmp0 = PLIST_STRING (nm)->str, (_tmp0 == NULL) ? NULL : g_strdup (_tmp0)), tsetting->name = (g_free (tsetting->name), NULL), _tmp1);
	}
	_tmp2 = NULL;
	nm = (_tmp2 = plist_dict_get (dict, "scope"), (nm == NULL) ? NULL : (nm = (g_object_unref (nm), NULL)), _tmp2);
	if (nm != NULL) {
		char* _tmp4;
		const char* _tmp3;
		_tmp4 = NULL;
		_tmp3 = NULL;
		tsetting->selector = (_tmp4 = (_tmp3 = PLIST_STRING (nm)->str, (_tmp3 == NULL) ? NULL : g_strdup (_tmp3)), tsetting->selector = (g_free (tsetting->selector), NULL), _tmp4);
	}
	_tmp5 = NULL;
	tsetting->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), (tsetting->settings == NULL) ? NULL : (tsetting->settings = (g_object_unref (tsetting->settings), NULL)), _tmp5);
	pd = PLIST_DICT (plist_dict_get (dict, "settings"));
	{
		GeeSet* _tmp6;
		GeeIterator* _tmp7;
		GeeIterator* _key_it;
		_tmp6 = NULL;
		_tmp7 = NULL;
		_key_it = (_tmp7 = gee_iterable_iterator ((GeeIterable*) (_tmp6 = gee_map_get_keys ((GeeMap*) pd->map))), (_tmp6 == NULL) ? NULL : (_tmp6 = (g_object_unref (_tmp6), NULL)), _tmp7);
		while (gee_iterator_next (_key_it)) {
			char* key;
			PListString* _tmp8;
			key = (char*) gee_iterator_get (_key_it);
			_tmp8 = NULL;
			gee_map_set ((GeeMap*) tsetting->settings, key, (_tmp8 = PLIST_STRING ((PListNode*) gee_map_get ((GeeMap*) pd->map, key)))->str);
			(_tmp8 == NULL) ? NULL : (_tmp8 = (g_object_unref (_tmp8), NULL));
			key = (g_free (key), NULL);
		}
		(_key_it == NULL) ? NULL : (_key_it = (g_object_unref (_key_it), NULL));
	}
	_tmp9 = NULL;
	return (_tmp9 = tsetting, (nm == NULL) ? NULL : (nm = (g_object_unref (nm), NULL)), (pd == NULL) ? NULL : (pd = (g_object_unref (pd), NULL)), _tmp9);
}
static gboolean rygel_external_container_is_direct_child (RygelExternalContainer* self, const char* id) {
#line 741 "rygel-external-container.c"
	gboolean result = FALSE;
#line 156 "rygel-external-container.vala"
	g_return_val_if_fail (self != NULL, FALSE);
#line 156 "rygel-external-container.vala"
	g_return_val_if_fail (id != NULL, FALSE);
#line 157 "rygel-external-container.vala"
	if (rygel_external_item_factory_id_valid (id)) {
#line 749 "rygel-external-container.c"
		result = TRUE;
#line 158 "rygel-external-container.vala"
		return result;
#line 753 "rygel-external-container.c"
	} else {
		{
			GeeIterator* _container_it;
			_container_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->priv->containers);
#line 160 "rygel-external-container.vala"
			while (TRUE) {
#line 760 "rygel-external-container.c"
				RygelExternalContainer* container;
#line 160 "rygel-external-container.vala"
				if (!gee_iterator_next (_container_it)) {
#line 160 "rygel-external-container.vala"
					break;
#line 766 "rygel-external-container.c"
				}
#line 160 "rygel-external-container.vala"
				container = (RygelExternalContainer*) gee_iterator_get (_container_it);
#line 161 "rygel-external-container.vala"
				if (_vala_strcmp0 (((RygelMediaObject*) container)->id, id) == 0) {
#line 772 "rygel-external-container.c"
					result = TRUE;
					_g_object_unref0 (container);
					_g_object_unref0 (_container_it);
#line 162 "rygel-external-container.vala"
					return result;
#line 778 "rygel-external-container.c"
				}
				_g_object_unref0 (container);
			}
			_g_object_unref0 (_container_it);
		}
		result = FALSE;
#line 166 "rygel-external-container.vala"
		return result;
#line 787 "rygel-external-container.c"
	}
}
Beispiel #17
0
static void gtk_mate_pattern_add_patterns (GeeArrayList* patlist, GeeArrayList* ps) {
	g_return_if_fail (patlist != NULL);
	g_return_if_fail (ps != NULL);
	{
		GeeIterator* _p_it;
		_p_it = gee_iterable_iterator ((GeeIterable*) ps);
		while (gee_iterator_next (_p_it)) {
			GtkMatePattern* p;
			p = (GtkMatePattern*) gee_iterator_get (_p_it);
			gee_collection_add ((GeeCollection*) patlist, p);
			(p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
		}
		(_p_it == NULL) ? NULL : (_p_it = (g_object_unref (_p_it), NULL));
	}
}
Beispiel #18
0
static gboolean
check_writeable_property (TpConnection *connection,
			  FolksIndividual *individual,
			  gchar *property)
{
  gchar **properties;
  gint prop_len;
  gboolean retval = FALSE;
  GeeSet *personas;
  GeeIterator *iter;
  FolksPersonaStore *persona_store;

  persona_store = FOLKS_PERSONA_STORE (
      empathy_dup_persona_store_for_connection (connection));

  properties =
    folks_persona_store_get_always_writeable_properties (persona_store,
							 &prop_len);
  retval = properties_contains (properties, prop_len, property);
  if (retval == TRUE)
    goto out;

  /* Lets see if the Individual contains a Persona with the given property */
  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (!retval && gee_iterator_next (iter))
    {
      FolksPersona *persona = gee_iterator_get (iter);

      properties =
	folks_persona_get_writeable_properties (persona, &prop_len);
      retval = properties_contains (properties, prop_len, property);

      g_clear_object (&persona);

      if (retval == TRUE)
	break;
    }
  g_clear_object (&iter);

out:
  g_clear_object (&persona_store);
  return retval;
}
RygelFolderPrefSection* rygel_folder_pref_section_construct (GType object_type, GtkBuilder* builder, RygelConfiguration* config) {
	RygelFolderPrefSection * self;
	GtkTextView* _tmp1_;
	GtkTextView* _tmp0_;
	GtkTextBuffer* _tmp3_;
	GtkTextBuffer* _tmp2_;
	GeeArrayList* folders;
	char* text;
	g_return_val_if_fail (builder != NULL, NULL);
	g_return_val_if_fail (config != NULL, NULL);
	self = (RygelFolderPrefSection*) rygel_plugin_pref_section_construct (object_type, builder, config, RYGEL_FOLDER_PREF_SECTION_NAME);
	_tmp1_ = NULL;
	_tmp0_ = NULL;
	self->priv->text_view = (_tmp1_ = (_tmp0_ = GTK_TEXT_VIEW (gtk_builder_get_object (builder, RYGEL_FOLDER_PREF_SECTION_FOLDERS_TEXTVIEW)), (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (self->priv->text_view == NULL) ? NULL : (self->priv->text_view = (g_object_unref (self->priv->text_view), NULL)), _tmp1_);
	g_assert (self->priv->text_view != NULL);
	_tmp3_ = NULL;
	_tmp2_ = NULL;
	self->priv->text_buffer = (_tmp3_ = (_tmp2_ = GTK_TEXT_BUFFER (gtk_builder_get_object (builder, RYGEL_FOLDER_PREF_SECTION_FOLDERS_TEXTBUFFER)), (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_)), (self->priv->text_buffer == NULL) ? NULL : (self->priv->text_buffer = (g_object_unref (self->priv->text_buffer), NULL)), _tmp3_);
	g_assert (self->priv->text_buffer != NULL);
	folders = rygel_configuration_get_string_list (config, ((RygelPreferencesSection*) self)->name, RYGEL_FOLDER_PREF_SECTION_FOLDERS_KEY);
	text = g_strdup ("");
	{
		GeeIterator* _folder_it;
		_folder_it = gee_iterable_iterator ((GeeIterable*) folders);
		while (gee_iterator_next (_folder_it)) {
			char* folder;
			char* _tmp5_;
			char* _tmp4_;
			folder = (char*) gee_iterator_get (_folder_it);
			_tmp5_ = NULL;
			_tmp4_ = NULL;
			text = (_tmp5_ = g_strconcat (text, _tmp4_ = g_strconcat (folder, "\n", NULL), NULL), text = (g_free (text), NULL), _tmp5_);
			_tmp4_ = (g_free (_tmp4_), NULL);
			folder = (g_free (folder), NULL);
		}
		(_folder_it == NULL) ? NULL : (_folder_it = (g_object_unref (_folder_it), NULL));
	}
	gtk_text_buffer_set_text (self->priv->text_buffer, text, -1);
	(folders == NULL) ? NULL : (folders = (g_object_unref (folders), NULL));
	text = (g_free (text), NULL);
	return self;
}
void
empathy_individual_manager_set_blocked (EmpathyIndividualManager *self,
    FolksIndividual *individual,
    gboolean blocked,
    gboolean abusive)
{
  GeeSet *personas;
  GeeIterator *iter;

  g_return_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self));

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (gee_iterator_next (iter))
    {
      TpfPersona *persona = gee_iterator_get (iter);

      if (TPF_IS_PERSONA (persona))
        {
          TpContact *tp_contact;
          TpConnection *conn;

          tp_contact = tpf_persona_get_contact (persona);
          if (tp_contact == NULL)
            continue;

          conn = tp_contact_get_connection (tp_contact);

          if (!tp_proxy_has_interface_by_id (conn,
                TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING))
            continue;

          if (blocked)
            tp_contact_block_async (tp_contact, abusive, NULL, NULL);
          else
            tp_contact_unblock_async (tp_contact, NULL, NULL);
        }
      g_clear_object (&persona);
    }
  g_clear_object (&iter);
}
Beispiel #21
0
void gtk_mate_theme_init_for_use (GtkMateTheme* self) {
	GeeHashMap* _tmp0;
	g_return_if_fail (self != NULL);
	if (self->is_initialized) {
		return;
	}
	self->is_initialized = TRUE;
	/* stdout.printf("initializing theme for use: %s\n", name);*/
	_tmp0 = NULL;
	self->cached_setting_for_scopes = (_tmp0 = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, GTK_MATE_TYPE_THEME_SETTING, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_str_hash, g_str_equal, g_direct_equal), (self->cached_setting_for_scopes == NULL) ? NULL : (self->cached_setting_for_scopes = (g_object_unref (self->cached_setting_for_scopes), NULL)), _tmp0);
	{
		GeeIterator* _setting_it;
		_setting_it = gee_iterable_iterator ((GeeIterable*) self->settings);
		while (gee_iterator_next (_setting_it)) {
			GtkMateThemeSetting* setting;
			setting = (GtkMateThemeSetting*) gee_iterator_get (_setting_it);
			gtk_mate_theme_setting_compile_scope_matchers (setting);
			(setting == NULL) ? NULL : (setting = (g_object_unref (setting), NULL));
		}
		(_setting_it == NULL) ? NULL : (_setting_it = (g_object_unref (_setting_it), NULL));
	}
}
Beispiel #22
0
/* Retrieve the EmpathyContact corresponding to the first TpContact contained
 * within the given Individual. Note that this is a temporary convenience. See
 * the TODO above. */
EmpathyContact *
empathy_contact_dup_from_folks_individual (FolksIndividual *individual)
{
  GeeSet *personas;
  GeeIterator *iter;
  EmpathyContact *contact = NULL;

  g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (gee_iterator_next (iter) && (contact == NULL))
    {
      TpfPersona *persona = gee_iterator_get (iter);

      if (empathy_folks_persona_is_interesting (FOLKS_PERSONA (persona)))
        {
          TpContact *tp_contact;

          tp_contact = tpf_persona_get_contact (persona);
          if (tp_contact != NULL)
            {
              contact = empathy_contact_dup_from_tp_contact (tp_contact);
              empathy_contact_set_persona (contact, FOLKS_PERSONA (persona));
            }
        }
      g_clear_object (&persona);
    }
  g_clear_object (&iter);

  if (contact == NULL)
    {
      DEBUG ("Can't create an EmpathyContact for Individual %s",
          folks_individual_get_id (individual));
    }

  return contact;
}
Beispiel #23
0
gboolean gtk_mate_matcher_test_match_re (OnigRx* positive_selector_regex, GeeArrayList* negative_selector_regex, const char* scope_string, OnigMatch** match) {
	OnigMatch* m;
	g_return_val_if_fail (positive_selector_regex != NULL, FALSE);
	g_return_val_if_fail (negative_selector_regex != NULL, FALSE);
	g_return_val_if_fail (scope_string != NULL, FALSE);
	*match = NULL;
	m = onig_rx_search (positive_selector_regex, scope_string, 0, (gint) strlen (scope_string));
	if (m != NULL) {
		OnigMatch* _tmp2;
		OnigMatch* _tmp1;
		gboolean _tmp3;
		{
			GeeIterator* _neg_rx_it;
			_neg_rx_it = gee_iterable_iterator ((GeeIterable*) negative_selector_regex);
			while (gee_iterator_next (_neg_rx_it)) {
				OnigRx* neg_rx;
				OnigMatch* m1;
				neg_rx = (OnigRx*) gee_iterator_get (_neg_rx_it);
				m1 = onig_rx_search (neg_rx, scope_string, 0, (gint) strlen (scope_string));
				if (m1 != NULL) {
					gboolean _tmp0;
					return (_tmp0 = FALSE, (neg_rx == NULL) ? NULL : (neg_rx = (g_object_unref (neg_rx), NULL)), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (_neg_rx_it == NULL) ? NULL : (_neg_rx_it = (g_object_unref (_neg_rx_it), NULL)), (m == NULL) ? NULL : (m = (g_object_unref (m), NULL)), _tmp0);
				}
				(neg_rx == NULL) ? NULL : (neg_rx = (g_object_unref (neg_rx), NULL));
				(m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL));
			}
			(_neg_rx_it == NULL) ? NULL : (_neg_rx_it = (g_object_unref (_neg_rx_it), NULL));
		}
		_tmp2 = NULL;
		_tmp1 = NULL;
		(*match) = (_tmp2 = (_tmp1 = m, (_tmp1 == NULL) ? NULL : g_object_ref (_tmp1)), ((*match) == NULL) ? NULL : ((*match) = (g_object_unref ((*match)), NULL)), _tmp2);
		return (_tmp3 = TRUE, (m == NULL) ? NULL : (m = (g_object_unref (m), NULL)), _tmp3);
	} else {
		gboolean _tmp4;
		return (_tmp4 = FALSE, (m == NULL) ? NULL : (m = (g_object_unref (m), NULL)), _tmp4);
	}
	(m == NULL) ? NULL : (m = (g_object_unref (m), NULL));
}
Beispiel #24
0
static void ease_main_on_play (EaseDocument* document) {
#line 997 "ease-main.c"
	EasePlayer* _tmp0_;
#line 318 "ease-main.vala"
	g_return_if_fail (document != NULL);
#line 320 "ease-main.vala"
	ease_main_player = (_tmp0_ = g_object_ref_sink (ease_player_new (document)), _g_object_unref0 (ease_main_player), _tmp0_);
#line 321 "ease-main.vala"
	gtk_window_present ((GtkWindow*) ease_main_player);
#line 323 "ease-main.vala"
	g_signal_connect (ease_main_player, "complete", (GCallback) __lambda62__ease_player_complete, NULL);
#line 1007 "ease-main.c"
	{
		GeeIterator* _info_it;
#line 332 "ease-main.vala"
		_info_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) ease_main_windows);
#line 332 "ease-main.vala"
		while (TRUE) {
#line 1014 "ease-main.c"
			EaseMainEditorWindowInfo* info;
#line 332 "ease-main.vala"
			if (!gee_iterator_next (_info_it)) {
#line 332 "ease-main.vala"
				break;
#line 1020 "ease-main.c"
			}
#line 332 "ease-main.vala"
			info = (EaseMainEditorWindowInfo*) gee_iterator_get (_info_it);
#line 334 "ease-main.vala"
			gtk_window_get_position ((GtkWindow*) info->window, &info->x, &info->y);
#line 335 "ease-main.vala"
			gtk_widget_hide ((GtkWidget*) info->window);
#line 1028 "ease-main.c"
			_ease_main_editor_window_info_unref0 (info);
		}
		_g_object_unref0 (_info_it);
	}
}
/**
 * empathy_individual_manager_supports_blocking
 * @self: the #EmpathyIndividualManager
 * @individual: an individual to check
 *
 * Indicates whether any personas of an @individual can be blocked.
 *
 * Returns: %TRUE if any persona supports contact blocking
 */
gboolean
empathy_individual_manager_supports_blocking (EmpathyIndividualManager *self,
    FolksIndividual *individual)
{
  GeeSet *personas;
  GeeIterator *iter;
  gboolean retval = FALSE;

  g_return_val_if_fail (EMPATHY_IS_INDIVIDUAL_MANAGER (self), FALSE);

  personas = folks_individual_get_personas (individual);
  iter = gee_iterable_iterator (GEE_ITERABLE (personas));
  while (!retval && gee_iterator_next (iter))
    {
      TpfPersona *persona = gee_iterator_get (iter);
      TpConnection *conn;

      if (TPF_IS_PERSONA (persona))
        {
          TpContact *tp_contact;

          tp_contact = tpf_persona_get_contact (persona);
          if (tp_contact != NULL)
            {
              conn = tp_contact_get_connection (tp_contact);

              if (tp_proxy_has_interface_by_id (conn,
                    TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING))
                retval = TRUE;
            }
        }
      g_clear_object (&persona);
    }
  g_clear_object (&iter);

  return retval;
}
Beispiel #26
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));
}
Beispiel #27
0
/* TODO make this return multiple themes if they are identical
 (see 13.5 of Textmate manual)*/
GtkMateThemeSetting* gtk_mate_theme_settings_for_scope (GtkMateTheme* self, GtkMateScope* scope, gboolean inner, GtkMateThemeSetting* exclude_setting) {
	char* scope_name;
	GtkMateThemeSetting* cached;
	OnigMatch* current_m;
	OnigMatch* m;
	GtkMateThemeSetting* current;
	GtkMateThemeSetting* _tmp14;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (scope != NULL, NULL);
	scope_name = gtk_mate_scope_hierarchy_names (scope, inner);
	/*stdout.printf("  finding settings for '%s'\n", scope_name);*/
	cached = NULL;
	if (gee_map_contains ((GeeMap*) self->cached_setting_for_scopes, scope_name)) {
		GtkMateThemeSetting* _tmp0;
		GtkMateThemeSetting* _tmp1;
		_tmp0 = NULL;
		cached = (_tmp0 = (GtkMateThemeSetting*) gee_map_get ((GeeMap*) self->cached_setting_for_scopes, scope_name), (cached == NULL) ? NULL : (cached = (g_object_unref (cached), NULL)), _tmp0);
		_tmp1 = NULL;
		return (_tmp1 = cached, scope_name = (g_free (scope_name), NULL), _tmp1);
	}
	current_m = NULL;
	m = NULL;
	current = NULL;
	{
		GeeIterator* _setting_it;
		_setting_it = gee_iterable_iterator ((GeeIterable*) self->settings);
		while (gee_iterator_next (_setting_it)) {
			GtkMateThemeSetting* setting;
			gboolean _tmp2;
			setting = (GtkMateThemeSetting*) gee_iterator_get (_setting_it);
			_tmp2 = FALSE;
			if (setting == exclude_setting) {
				_tmp2 = exclude_setting != NULL;
			} else {
				_tmp2 = FALSE;
			}
			if (_tmp2) {
			} else {
				OnigMatch* _tmp5;
				gboolean _tmp4;
				OnigMatch* _tmp3;
				/*stdout.printf("    setting '%s' excluded due to parent\n", exclude_setting.name);*/
				_tmp5 = NULL;
				_tmp3 = NULL;
				if ((_tmp4 = gtk_mate_theme_setting_match (setting, scope_name, &_tmp3), m = (_tmp5 = _tmp3, (m == NULL) ? NULL : (m = (g_object_unref (m), NULL)), _tmp5), _tmp4)) {
					/*stdout.printf("    setting '%s' matches selector '%s'\n", setting.name, setting.selector); */
					if (current == NULL) {
						GtkMateThemeSetting* _tmp7;
						GtkMateThemeSetting* _tmp6;
						OnigMatch* _tmp9;
						OnigMatch* _tmp8;
						_tmp7 = NULL;
						_tmp6 = NULL;
						current = (_tmp7 = (_tmp6 = setting, (_tmp6 == NULL) ? NULL : g_object_ref (_tmp6)), (current == NULL) ? NULL : (current = (g_object_unref (current), NULL)), _tmp7);
						_tmp9 = NULL;
						_tmp8 = NULL;
						current_m = (_tmp9 = (_tmp8 = m, (_tmp8 == NULL) ? NULL : g_object_ref (_tmp8)), (current_m == NULL) ? NULL : (current_m = (g_object_unref (current_m), NULL)), _tmp9);
					} else {
						if (gtk_mate_matcher_compare_match (scope_name, current_m, m) < 0) {
							GtkMateThemeSetting* _tmp11;
							GtkMateThemeSetting* _tmp10;
							OnigMatch* _tmp13;
							OnigMatch* _tmp12;
							_tmp11 = NULL;
							_tmp10 = NULL;
							current = (_tmp11 = (_tmp10 = setting, (_tmp10 == NULL) ? NULL : g_object_ref (_tmp10)), (current == NULL) ? NULL : (current = (g_object_unref (current), NULL)), _tmp11);
							_tmp13 = NULL;
							_tmp12 = NULL;
							current_m = (_tmp13 = (_tmp12 = m, (_tmp12 == NULL) ? NULL : g_object_ref (_tmp12)), (current_m == NULL) ? NULL : (current_m = (g_object_unref (current_m), NULL)), _tmp13);
						}
					}
				}
			}
			(setting == NULL) ? NULL : (setting = (g_object_unref (setting), NULL));
		}
		(_setting_it == NULL) ? NULL : (_setting_it = (g_object_unref (_setting_it), NULL));
	}
	/*if (current == null) {
	stdout.printf("none match\n");
	}
	else {
	stdout.printf("    best: '%s'\n", current.name);
	}*/
	gee_map_set ((GeeMap*) self->cached_setting_for_scopes, scope_name, current);
	_tmp14 = NULL;
	return (_tmp14 = current, scope_name = (g_free (scope_name), NULL), (cached == NULL) ? NULL : (cached = (g_object_unref (cached), NULL)), (current_m == NULL) ? NULL : (current_m = (g_object_unref (current_m), NULL)), (m == NULL) ? NULL : (m = (g_object_unref (m), NULL)), _tmp14);
}
Beispiel #28
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);
}
Beispiel #29
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);
}
Beispiel #30
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));
}