示例#1
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);
}
示例#2
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_);
}