示例#1
0
文件: code.c 项目: jetlive/xynth
void code_generate_object_frame (s_hashtable_t *htable, s_xml_node_t *node)
{
	w_frame_t *frame;
	s_xml_node_t *tmp;
	code_priv_t *priv;
	w_object_t *pobject;
	w_object_t *wobject;
	s_xml_node_t *window = s_xml_node_get_parent(node, "window");
	wobject = (w_object_t *) s_hashtable_get_data(htable, s_xml_node_get_attr_value(window, "id"));
	pobject = (w_object_t *) s_hashtable_get_data(htable, s_xml_node_get_attr_value(node->parent, "id"));
	w_frame_init(wobject->window, &frame, 0, pobject);
	s_hashtable_add(htable, s_xml_node_get_attr_value(node, "id"), frame->object);
	while ((tmp = s_xml_node_get_path(node, "style")) != NULL) {
		FRAME_SHAPE fshape;
		FRAME_SHADOW fshadow;
		code_get_style(htable, tmp, &fshape, &fshadow);
		w_frame_set_style(frame->object, fshape, fshadow); 
		tmp->dontparse = 1;
	}
	while ((tmp = s_xml_node_get_path(node, "image")) != NULL) {
		char **var;
		unsigned int count;
		unsigned int style;
		unsigned int rotate;
		code_get_image(htable, tmp, &style, &rotate, &count, &var);
		if (var != NULL) {
			w_frame_set_image(frame->object, style, rotate, count, var);
			while (count--) s_free(var[count]);
			s_free(var);
		}
		tmp->dontparse = 1;
	}
	priv = (code_priv_t *) s_malloc(sizeof(code_priv_t));
	memset(priv, 0, sizeof(code_priv_t));
	if ((tmp = s_xml_node_get_path(node, "effect")) != NULL) {
		EFFECT effect;
		code_get_effect(htable, tmp, &effect);
		frame->object->effect->effect = effect;
		tmp->dontparse = 1;
	}
	if ((tmp = s_xml_node_get_path(node, "draw")) != NULL) {
		priv->draw = strdup(tmp->value);
		if (g_engine) frame->object->draw = g_engine->object_draw;
		tmp->dontparse = 1;
	}
	frame->object->priv = priv;
}
示例#2
0
文件: clistbox.c 项目: d33tah/whitix
int w_clistbox_item_init (w_object_t *listbox, w_clistbox_item_t **listbox_item)
{
	int pos;
	w_clistbox_t *lb;
	w_clistbox_item_t *li;
	w_clistbox_item_image_t *ii;
	lb = listbox->data[OBJECT_CLISTBOX];
	li = (w_clistbox_item_t *) s_malloc(sizeof(w_clistbox_item_t));
	memset(li, 0, sizeof(w_clistbox_item_t));
	w_frame_init(listbox->window, &(li->frame), lb->inactiveshape | lb->inactiveshadow, listbox);
	for (pos = 0; !s_list_eol(lb->item_images, pos); pos++) {
		ii = (w_clistbox_item_image_t *) s_list_get(lb->item_images, pos);
		w_frame_set_image(li->frame->object, ii->style, ii->rotation, ii->nimages, ii->images);
	}
	w_object_show(li->frame->object);
	*listbox_item = li;
	return 0;
}
示例#3
0
int w_scrollbuffer_set_boximage (w_object_t *object, unsigned int style, unsigned int rotation, unsigned int nimgs, char **imgs)
{
	w_scrollbuffer_t *sb;
	sb = object->data[OBJECT_SCROLLBUFFER];
	return w_frame_set_image(sb->vertical->box->object, style, rotation, nimgs, imgs);
}
示例#4
0
int w_scrollbuffer_set_image (w_object_t *object, unsigned int style, unsigned int rotation, unsigned int nimgs, char **imgs)
{
	return w_frame_set_image(object, style, rotation, nimgs, imgs);
}