示例#1
0
void
gl_view_ellipse_create_button_press_event   (glView *view,
                                             gdouble x,
                                             gdouble y)
{
	GObject             *object;

        gl_label_unselect_all (view->label);

        object = gl_label_ellipse_new (view->label, TRUE);

        gl_label_object_set_position (GL_LABEL_OBJECT(object), x, y, FALSE);
        gl_label_object_set_size (GL_LABEL_OBJECT(object), 0.0, 0.0, FALSE);

        view->create_object = GL_LABEL_OBJECT (object);
        view->create_x0 = x;
        view->create_y0 = y;
}
示例#2
0
glLabel      *gl_xml_label_04_parse      (xmlNodePtr       root,
					  glXMLLabelStatus *status)
{
	glLabel       *label;
	xmlNodePtr    node;
	GObject       *object;
	gboolean      rotate_flag;

	gl_debug (DEBUG_XML, "START");

	*status = XML_LABEL_OK;

	if (!xmlStrEqual (root->name, (xmlChar *)"Label")) {
		g_message (_("Bad root node = \"%s\""), root->name);
		*status = XML_LABEL_ERROR_OPEN_PARSE;
		return NULL;
	}

	label = GL_LABEL (gl_label_new ());

	rotate_flag = lgl_xml_get_prop_boolean (root, "rotate", FALSE);
	gl_label_set_rotate_flag (label, rotate_flag, FALSE);

	for (node = root->xmlChildrenNode; node != NULL; node = node->next) {

		gl_debug (DEBUG_XML, "node name = \"%s\"", node->name);

		if (!xmlNodeIsText (node)) {
			if (xmlStrEqual (node->name, (xmlChar *)"Media_Type")) {
				if (!xml04_parse_media_description (node, label)) {
					*status = XML_LABEL_UNKNOWN_MEDIA;
				}
			} else if (xmlStrEqual (node->name, (xmlChar *)"Text")) {
				object = gl_label_text_new (label, FALSE);
				xml04_parse_object (node, GL_LABEL_OBJECT(object));
				xml04_parse_text_props (node, GL_LABEL_TEXT(object));
			} else if (xmlStrEqual (node->name, (xmlChar *)"Box")) {
				object = gl_label_box_new (label, FALSE);
				xml04_parse_object (node, GL_LABEL_OBJECT(object));
				xml04_parse_box_props (node, GL_LABEL_BOX(object));
			} else if (xmlStrEqual (node->name, (xmlChar *)"Line")) {
				object = gl_label_line_new (label, FALSE);
				xml04_parse_object (node, GL_LABEL_OBJECT(object));
				xml04_parse_line_props (node, GL_LABEL_LINE(object));
			} else if (xmlStrEqual (node->name, (xmlChar *)"Ellipse")) {
				object = gl_label_ellipse_new (label, FALSE);
				xml04_parse_object (node, GL_LABEL_OBJECT(object));
				xml04_parse_ellipse_props (node,
							   GL_LABEL_ELLIPSE(object));
			} else if (xmlStrEqual (node->name, (xmlChar *)"Image")) {
				object = gl_label_image_new (label, FALSE);
				xml04_parse_object (node, GL_LABEL_OBJECT(object));
				xml04_parse_image_props (node, GL_LABEL_IMAGE(object));
			} else if (xmlStrEqual (node->name, (xmlChar *)"Barcode")) {
				object = gl_label_barcode_new (label, FALSE);
				xml04_parse_object (node, GL_LABEL_OBJECT(object));
				xml04_parse_barcode_props (node,
							   GL_LABEL_BARCODE(object));
			} else if (xmlStrEqual (node->name, (xmlChar *)"Merge_Properties")) {
				xml04_parse_merge_properties (node, label);
			} else {
				g_message (_("bad node =  \"%s\""), node->name);
			}
		}
	}

	gl_debug (DEBUG_XML, "END");

	return label;
}