lgl_db_print_known_categories
lgl_db_print_known_templates
lgl_db_print_known_vendors
-lgl_db_print_aliases
</SECTION>
<SECTION>
<FILE>template</FILE>
<INCLUDE>libglabels/template.h</INCLUDE>
lglTemplate
-<SUBSECTION Alias Structure>
-lglTemplateAlias
<SUBSECTION Frame Structure>
lglTemplateFrameShape
lglTemplateFrame
lgl_template_free
lgl_template_add_category
lgl_template_add_frame
-lgl_template_add_alias
<SUBSECTION Template Query Functions>
lgl_template_get_name
lgl_template_do_templates_match
lgl_template_does_page_size_match
lgl_template_does_category_match
lgl_template_are_templates_identical
-<SUBSECTION Alias Functions>
-lgl_template_alias_new
-lgl_template_alias_dup
-lgl_template_alias_free
<SUBSECTION Frame Functions>
lgl_template_frame_rect_new
lgl_template_frame_ellipse_new
@void:
-<!-- ##### FUNCTION lgl_db_print_aliases ##### -->
-<para>
-
-</para>
-
-@template:
-
-
@page_height:
@categories:
@frames:
-@aliases:
<!-- ##### UNION glTemplateFrame ##### -->
<para>
</para>
-<!-- ##### FUNCTION gl_template_add_alias ##### -->
-<para>
-
-</para>
-
-@template:
-@alias:
-
<!-- ##### FUNCTION gl_template_add_category ##### -->
<para>
@page_height:
@Returns:
-<!-- ##### FUNCTION gl_template_print_aliases ##### -->
-<para>
-
-</para>
-
-@template:
-
<!-- ##### FUNCTION gl_template_print_known_templates ##### -->
<para>
</para>
-<!-- ##### FUNCTION lgl_template_print_aliases ##### -->
-<para>
-
-</para>
-
-@template:
-
<!-- ##### FUNCTION lgl_template_print_known_templates ##### -->
<para>
@category_ids: A list of category IDs that this template belongs to.
@frames: A list of (#lglTemplateFrame *) structures. GLabels currently only supports one frame
per template -- future versions may support multiple frames per template.
-@aliases: A list of alternate names for this template. Often a single template can be used for
-multiple products.
-
-<!-- ##### STRUCT lglTemplateAlias ##### -->
-<para>
-This structure defines an alias for the parent template structure. An alias is used for
-different products that can use the same template.
-</para>
-
-@brand: Brand name of label or card. E.g. "Avery."
-@part: Part name or number of label or card. E.g. "8160."
<!-- ##### ENUM lglTemplateFrameShape ##### -->
<para>
@frame:
-<!-- ##### FUNCTION lgl_template_add_alias ##### -->
-<para>
-
-</para>
-
-@template:
-@alias:
-
-
<!-- ##### FUNCTION lgl_template_get_name ##### -->
<para>
@Returns:
-<!-- ##### FUNCTION lgl_template_alias_new ##### -->
-<para>
-
-</para>
-
-@brand:
-@part:
-@Returns:
-
-
-<!-- ##### FUNCTION lgl_template_alias_dup ##### -->
-<para>
-
-</para>
-
-@orig_alias:
-@Returns:
-
-
-<!-- ##### FUNCTION lgl_template_alias_free ##### -->
-<para>
-
-</para>
-
-@alias:
-
-
<!-- ##### FUNCTION lgl_template_frame_rect_new ##### -->
<para>
<Markup-margin size="5pt"/>
<Layout nx="3" ny="10" x0="11.25pt" y0="36pt" dx="200pt" dy="72pt"/>
</Label-rectangle>
- <Alias brand="Avery" part="5160"/>
- <Alias brand="Avery" part="6233"/>
</Template>
</code>
</section>
<p>A <em>Template</em> node describes a single stationary
product. It must contain one instance of any type of Label node
(<em>Label-rectangle</em>,
- <em>Label-round</em>, or <em>Label-cd</em>).
- This node can be followed by zero or more
- <em>Alias</em> nodes.</p>
+ <em>Label-round</em>, or <em>Label-cd</em>).</p>
<table frame="all" rules="rows">
<tr>
<tr>
<td><p>height</p></td> <td><p>Page height. Only valid if size="Other"</p></td>
</tr>
+ <tr>
+ <td><p>equiv</p></td> <td><p>Equivalent part number. If this property is present, the template is a clone of another template of the same brand. The template will inheret all properties, except brand and name from the other template. This equiv property must refer to a previously defined template -- libglabels does not currently support forward references.</p></td>
+ </tr>
</table>
</section>
<!-- ==== End of Figure ==== -->
</section>
- <section id="template-alias-node">
- <title>Alias Node</title>
-
- <p>An <em>Alias</em> node provides the name of a
- product with the same size and layout characteristics as the
- parent template.</p>
-
-<table frame="all" rules="rows">
- <tr>
- <td><p>Property</p></td> <td><p>Description</p></td>
- </tr>
- <tr>
- <td><p></p></td> <td><p></p></td>
- </tr>
- <tr>
- <td><p>brand</p></td> <td><p>The brand or manufacturer of the equivalent product.</p></td>
- </tr>
- <tr>
- <td><p>part</p></td> <td><p>The part number of the equivalent product.</p></td>
- </tr>
-</table>
-
- </section>
-
</page>
lgl_db_get_brand_list (const gchar *paper_id,
const gchar *category_id)
{
- GList *p_tmplt, *p_alias;
+ GList *p_tmplt;
lglTemplate *template;
- lglTemplateAlias *alias;
GList *brands = NULL;
if (!model)
if (lgl_template_does_page_size_match (template, paper_id) &&
lgl_template_does_category_match (template, category_id))
{
- for (p_alias = template->aliases; p_alias != NULL;
- p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
- if ( !g_list_find_custom (brands, alias->brand,
- (GCompareFunc)lgl_str_utf8_casecmp) )
- {
- brands = g_list_insert_sorted (brands,
- g_strdup (alias->brand),
- (GCompareFunc)lgl_str_utf8_casecmp);
- }
- }
+ if ( !g_list_find_custom (brands, template->brand,
+ (GCompareFunc)lgl_str_utf8_casecmp) )
+ {
+ brands = g_list_insert_sorted (brands,
+ g_strdup (template->brand),
+ (GCompareFunc)lgl_str_utf8_casecmp);
+ }
}
}
lgl_db_does_template_exist (const gchar *brand,
const gchar *part)
{
- GList *p_tmplt, *p_alias;
+ GList *p_tmplt;
lglTemplate *template;
- lglTemplateAlias *alias;
if (!model)
{
for (p_tmplt = model->templates; p_tmplt != NULL; p_tmplt = p_tmplt->next)
{
template = (lglTemplate *) p_tmplt->data;
- for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
- if ( UTF8_EQUAL (brand, alias->brand) &&
- UTF8_EQUAL (part, alias->part) )
- {
- return TRUE;
- }
- }
+ if ( UTF8_EQUAL (brand, template->brand) &&
+ UTF8_EQUAL (part, template->part) )
+ {
+ return TRUE;
+ }
}
return FALSE;
gboolean
lgl_db_does_template_name_exist (const gchar *name)
{
- GList *p_tmplt, *p_alias;
+ GList *p_tmplt;
lglTemplate *template;
- lglTemplateAlias *alias;
gchar *candidate_name;
if (!model)
for (p_tmplt = model->templates; p_tmplt != NULL; p_tmplt = p_tmplt->next)
{
template = (lglTemplate *) p_tmplt->data;
- for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
- candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part);
+ candidate_name = g_strdup_printf ("%s %s", template->brand, template->part);
- if ( UTF8_EQUAL (candidate_name, name) ) {
- g_free (candidate_name);
- return TRUE;
- }
+ if ( UTF8_EQUAL (candidate_name, name) )
+ {
g_free (candidate_name);
- }
+ return TRUE;
+ }
+ g_free (candidate_name);
}
return FALSE;
* @paper_id: If non NULL, limit results to given page size.
* @category_id: If non NULL, limit results to given template category.
*
- * Get a list of all valid names and aliases of templates in the template database.
+ * Get a list of all valid names of templates in the template database.
* Results can be filtered by page size and/or template category. A list of valid page
* sizes can be obtained using lgl_db_get_paper_id_list(). A list of valid template
* categories can be obtained using lgl_db_get_category_id_list().
* This function differs from lgl_db_get_template_name_list_unique(), because it will
* return multiple names for the same template.
*
- * Returns: a list of template names and aliases.
+ * Returns: a list of template names.
*/
GList *
lgl_db_get_template_name_list_all (const gchar *brand,
const gchar *paper_id,
const gchar *category_id)
{
- GList *p_tmplt, *p_alias;
+ GList *p_tmplt;
lglTemplate *template;
- lglTemplateAlias *alias;
gchar *name;
GList *names = NULL;
if (lgl_template_does_page_size_match (template, paper_id) &&
lgl_template_does_category_match (template, category_id))
{
- for (p_alias = template->aliases; p_alias != NULL;
- p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
- if ( !brand || UTF8_EQUAL( alias->brand, brand) )
- {
- name = g_strdup_printf ("%s %s", alias->brand, alias->part);
- names = g_list_insert_sorted (names, name,
- (GCompareFunc)lgl_str_part_name_cmp);
- }
+ if ( !brand || UTF8_EQUAL( template->brand, brand) )
+ {
+ name = g_strdup_printf ("%s %s", template->brand, template->part);
+ names = g_list_insert_sorted (names, name,
+ (GCompareFunc)lgl_str_part_name_cmp);
}
}
}
* lgl_db_get_similar_template_name_list:
* @name: Name of template under test.
*
- * Get a list of all valid names and aliases of templates in the template database that
+ * Get a list of all valid names of templates in the template database that
* have the same size and layout characteristics as the given template.
*
- * Returns: a list of template names and aliases.
+ * Returns: a list of template names.
*/
GList *
lgl_db_get_similar_template_name_list (const gchar *name)
{
- GList *p_tmplt, *p_alias;
+ GList *p_tmplt;
lglTemplate *template1;
lglTemplate *template2;
- lglTemplateAlias *alias;
gchar *name2;
GList *names = NULL;
return NULL;
}
- for (p_alias = template1->aliases; p_alias != NULL; p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
-
- name2 = g_strdup_printf ("%s %s", alias->brand, alias->part);
- if ( !UTF8_EQUAL (name2, name) )
- {
- names = g_list_insert_sorted (names, name2,
- (GCompareFunc)lgl_str_part_name_cmp);
- }
- }
-
for (p_tmplt = model->templates; p_tmplt != NULL; p_tmplt = p_tmplt->next)
{
template2 = (lglTemplate *) p_tmplt->data;
if ( lgl_template_are_templates_identical (template1, template2) )
{
- for (p_alias = template2->aliases; p_alias != NULL; p_alias = p_alias->next)
+
+ name2 = g_strdup_printf ("%s %s", template2->brand, template2->part);
+ if ( !UTF8_EQUAL (name2, name) )
{
- alias = (lglTemplateAlias *)p_alias->data;
+ names = g_list_insert_sorted (names, name2,
+ (GCompareFunc)lgl_str_part_name_cmp);
+ }
- name2 = g_strdup_printf ("%s %s", alias->brand, alias->part);
- if ( !UTF8_EQUAL (name2, name) )
- {
- names = g_list_insert_sorted (names, name2,
- (GCompareFunc)lgl_str_part_name_cmp);
- }
- }
}
}
lglTemplate *
lgl_db_lookup_template_from_name (const gchar *name)
{
- GList *p_alias;
lglTemplate *template;
- lglTemplateAlias *alias;
- gchar *candidate_name;
lglTemplate *new_template;
if (!model)
if (template)
{
- for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
- candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part);
-
- if ( UTF8_EQUAL (candidate_name, name) )
- {
- g_free (candidate_name);
- new_template = lgl_template_dup (template);
- g_free (new_template->brand);
- new_template->brand = g_strdup (alias->brand);
- g_free (new_template->part);
- new_template->part = g_strdup (alias->part);
- return new_template;
- }
-
- g_free (candidate_name);
- }
+ new_template = lgl_template_dup (template);
+ return new_template;
}
/* No matching template has been found so return the first template */
const gchar *part)
{
gchar *name;
- GList *p_alias;
lglTemplate *template;
- lglTemplateAlias *alias;
- gchar *candidate_name;
lglTemplate *new_template;
if (!model)
if (template)
{
- for (p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next)
- {
- alias = (lglTemplateAlias *)p_alias->data;
- candidate_name = g_strdup_printf ("%s %s", alias->brand, alias->part);
-
- if ( UTF8_EQUAL (candidate_name, name) )
- {
- g_free (candidate_name);
- new_template = lgl_template_dup (template);
- g_free (new_template->brand);
- new_template->brand = g_strdup (alias->brand);
- g_free (new_template->part);
- new_template->part = g_strdup (alias->part);
- g_free (name);
- return new_template;
- }
-
- g_free (candidate_name);
- }
+ new_template = lgl_template_dup (template);
+ return new_template;
}
/* No matching template has been found so return the first template */
static void
add_to_template_cache (lglTemplate *template)
{
- GList *p_alias;
- lglTemplateAlias *alias;
gchar *name;
- for ( p_alias=template->aliases; p_alias != NULL; p_alias=p_alias->next )
- {
- alias = (lglTemplateAlias *)p_alias->data;
- name = g_strdup_printf ("%s %s", alias->brand, alias->part);
+ name = g_strdup_printf ("%s %s", template->brand, template->part);
- g_hash_table_insert (model->template_cache, name, template);
- }
+ g_hash_table_insert (model->template_cache, name, template);
}
}
-/**
- * lgl_db_print_aliases:
- * @template: template
- *
- * Print all aliases of a template (for debugging purposes).
- *
- */
-void
-lgl_db_print_aliases (const lglTemplate *template)
-{
- GList *p;
- lglTemplateAlias *alias;
-
- if (!model)
- {
- lgl_db_init ();
- }
-
- g_print ("%s():\n", __FUNCTION__);
- for (p=template->aliases; p!=NULL; p=p->next)
- {
- alias = (lglTemplateAlias *)p->data;
-
- g_print("Alias: brand=\"%s\", part=\"%s\"\n", alias->brand, alias->part);
-
- }
- g_print ("\n");
-
-}
-
/*
* @page_height: Page height in points, set to zero unless paper_id="Other"
*
* Create a new template structure, with the given top-level attributes. The
- * created template will have no initial aliases, categories, or frames
- * associated with it. See lgl_template_add_alias(), lgl_template_add_category(),
- * and lgl_template_add_frame() to add these.
+ * created template will have no initial categories, or frames associated with
+ * it. See lgl_template_add_category() and lgl_template_add_frame() to add
+ * these.
*
* Returns: pointer to a newly allocated #lglTemplate structure.
*
gdouble page_height)
{
lglTemplate *template;
- lglTemplateAlias *alias;
template = g_new0 (lglTemplate,1);
template->page_width = page_width;
template->page_height = page_height;
- /* Always include primary name in alias list. */
- template->aliases = NULL;
- alias = lgl_template_alias_new (brand, part);
- lgl_template_add_alias (template, alias);
-
return template;
}
const gchar *equiv_part)
{
lglTemplate *template;
- GList *p_alias;
- lglTemplateAlias *alias;
template = lgl_db_lookup_template_from_brand_part (brand, equiv_part);
if (template)
template->part = g_strdup (part);
template->equiv_part = g_strdup (equiv_part);
-
- for ( p_alias = template->aliases; p_alias != NULL; p_alias = p_alias->next )
- {
- alias = (lglTemplateAlias *)p_alias->data;
- lgl_template_alias_free (alias);
- }
- g_list_free (template->aliases);
- template->aliases = NULL;
-
- alias = lgl_template_alias_new (brand, part);
- lgl_template_add_alias (template, alias);
}
else
{
}
-/**
- * lgl_template_alias_new:
- * @brand: Alias brand
- * @part: Alias part name/number
- *
- * Create a new template alias structure, with the given brand and part number.
- *
- * Returns: pointer to a newly allocated #lglTemplateAlias structure.
- *
- */
-lglTemplateAlias *
-lgl_template_alias_new (const gchar *brand,
- const gchar *part)
-{
- lglTemplateAlias *alias;
-
- alias = g_new0 (lglTemplateAlias,1);
-
- alias->brand = g_strdup (brand);
- alias->part = g_strdup (part);
-
- return alias;
-}
-
-
-/**
- * lgl_template_add_alias:
- * @template: Pointer to template structure
- * @alias: Alias string
- *
- * This function adds the given alias to a templates list of aliases.
- *
- */
-void
-lgl_template_add_alias (lglTemplate *template,
- lglTemplateAlias *alias)
-{
- g_return_if_fail (template);
- g_return_if_fail (alias);
-
- template->aliases = g_list_append (template->aliases, alias);
-}
-
-
/**
* lgl_template_add_frame:
* @template: Pointer to template structure
lgl_template_dup (const lglTemplate *orig_template)
{
lglTemplate *template;
- lglTemplateAlias *alias;
GList *p;
lglTemplateFrame *frame;
template->equiv_part = g_strdup (orig_template->equiv_part);
template->product_url = g_strdup (orig_template->product_url);
- for ( p=orig_template->aliases; p != NULL; p=p->next )
- {
- alias = (lglTemplateAlias *)p->data;
-
- if ( !(UTF8_EQUAL (template->brand, alias->brand) &&
- UTF8_EQUAL (template->part, alias->part)) )
- {
- lgl_template_add_alias (template, lgl_template_alias_dup (alias));
- }
-
- }
for ( p=orig_template->category_ids; p != NULL; p=p->next )
{
g_free (template->paper_id);
template->paper_id = NULL;
- for ( p=template->aliases; p != NULL; p=p->next ) {
-
- lgl_template_alias_free (p->data);
- p->data = NULL;
-
- }
- g_list_free (template->aliases);
- template->aliases = NULL;
-
for ( p=template->category_ids; p != NULL; p=p->next ) {
g_free (p->data);
}
-/**
- * lgl_template_alias_dup:
- * @orig_alias: Alias to duplicate.
- *
- * This function duplicates a template alias structure.
- *
- * Returns: a newly allocated #lglTemplateAlias structure.
- *
- */
-lglTemplateAlias *
-lgl_template_alias_dup (const lglTemplateAlias *orig_alias)
-{
- g_return_val_if_fail (orig_alias, NULL);
-
- return lgl_template_alias_new (orig_alias->brand, orig_alias->part);
-}
-
-
-/**
- * lgl_template_alias_free:
- * @alias: Alias to free.
- *
- * This function frees all memory associated with given template alias structure.
- *
- */
-void
-lgl_template_alias_free (lglTemplateAlias *alias)
-{
-
- if ( alias != NULL )
- {
- g_free (alias->brand);
- alias->brand = NULL;
-
- g_free (alias->part);
- alias->part = NULL;
-
- g_free (alias);
- }
-}
-
-
/**
* lgl_template_frame_dup:
* @orig_frame: Frame to duplicate.
void
lgl_template_print (const lglTemplate *template)
{
- GList *p;
- lglTemplateAlias *alias;
-
g_print ("---- %s( TEMPLATE=%p ) ----\n", __FUNCTION__, template);
g_print("brand=\"%s\", part=\"%s\", description=\"%s\"\n",
g_print("paper_id=\"%s\", page_width=%g, page_height=%g\n",
template->paper_id, template->page_width, template->page_height);
- for (p=template->aliases; p!=NULL; p=p->next)
- {
- alias = (lglTemplateAlias *)p->data;
- g_print("Alias: brand=\"%s\", part=\"%s\"\n", alias->brand, alias->part);
-
- }
-
g_print ("\n");
}
typedef struct _lglTemplate lglTemplate;
-typedef struct _lglTemplateAlias lglTemplateAlias;
-
typedef union _lglTemplateFrame lglTemplateFrame;
typedef struct _lglTemplateFrameAll lglTemplateFrameAll;
typedef struct _lglTemplateFrameRect lglTemplateFrameRect;
* template. */
GList *frames;
- /* Deprecated: List of (lglTemplateAlias *) alias structures. */
- GList *aliases;
-
};
-/*
- * Top-level Template Structure
- */
-struct _lglTemplateAlias {
-
- gchar *brand;
- gchar *part;
-
-};
-
/*
* Possible Frame Shapes
*/
const gchar *part,
const gchar *equiv_part);
-void lgl_template_add_alias (lglTemplate *template,
- lglTemplateAlias *alias);
-
void lgl_template_add_category (lglTemplate *template,
const gchar *category_id);
void lgl_template_add_frame (lglTemplate *template,
lglTemplateFrame *frame);
-lglTemplateAlias *lgl_template_alias_new (const gchar *brand,
- const gchar *part);
-
lglTemplateFrame *lgl_template_frame_rect_new (const gchar *id,
gdouble w,
gdouble h,
void lgl_template_free (lglTemplate *template);
-lglTemplateAlias *lgl_template_alias_dup (const lglTemplateAlias *orig_alias);
-void lgl_template_alias_free (lglTemplateAlias *alias);
-
lglTemplateFrame *lgl_template_frame_dup (const lglTemplateFrame *orig_frame);
void lgl_template_frame_free (lglTemplateFrame *frame);
static void xml_create_markup_ellipse_node (const lglTemplateMarkup *circle,
xmlNodePtr root,
const xmlNsPtr ns);
-static void xml_create_alias_node (const lglTemplateAlias *alias,
- xmlNodePtr root,
- const xmlNsPtr ns);
/**
/*--------------------------------------------------------------------------*/
-/* PRIVATE. Parse XML Template->Alias Node. */
+/* PRIVATE. Parse deprecated XML Template->Alias Node. */
/*--------------------------------------------------------------------------*/
static void
xml_parse_alias_node (xmlNodePtr alias_node,
lglTemplate *template)
{
- gchar *brand;
- gchar *part;
- gchar *name;
- gchar **v;
-
- brand = lgl_xml_get_prop_string (alias_node, "brand", NULL);
- part = lgl_xml_get_prop_string (alias_node, "part", NULL);
- if (!brand || !part)
- {
- name = lgl_xml_get_prop_string (alias_node, "name", NULL);
- if (name)
- {
- g_message (_("Missing required \"brand\" or \"part\" attribute, trying deprecated name."));
- v = g_strsplit (name, " ", 2);
- brand = g_strdup (v[0]);
- part = g_strdup (v[1]);
- g_free (name);
- g_strfreev (v);
-
- }
- else
- {
- g_message (_("Name attribute also missing."));
- }
- }
-
- lgl_template_add_alias (template, lgl_template_alias_new (brand, part));
-
- g_free (brand);
- g_free (part);
+ g_message (_("Skipping deprecated \"Alias\" node."));
}
+
/**
* lgl_xml_template_write_templates_to_file:
* @templates: List of #lglTemplate structures
{
xmlNodePtr node;
GList *p;
- lglTemplateAlias *alias;
lglTemplateFrame *frame;
node = xmlNewChild (root, ns, (xmlChar *)"Template", NULL);
lgl_xml_set_prop_string (node, "description", template->description);
- for ( p=template->aliases; p != NULL; p=p->next ) {
- alias = (lglTemplateAlias *)p->data;
- if ( !(xmlStrEqual ((xmlChar *)template->brand, (xmlChar *)alias->brand) &&
- xmlStrEqual ((xmlChar *)template->part, (xmlChar *)alias->part)) )
- {
- xml_create_alias_node ( alias, node, ns );
- }
- }
xml_create_meta_node ("product_url", template->product_url, node, ns );
for ( p=template->category_ids; p != NULL; p=p->next )
{
}
-/*--------------------------------------------------------------------------*/
-/* PRIVATE. Add XML Template->Alias Node. */
-/*--------------------------------------------------------------------------*/
-static void
-xml_create_alias_node (const lglTemplateAlias *alias,
- xmlNodePtr root,
- const xmlNsPtr ns)
-{
- xmlNodePtr node;
-
- node = xmlNewChild (root, ns, (xmlChar *)"Alias", NULL);
-
- lgl_xml_set_prop_string (node, "brand", alias->brand);
- lgl_xml_set_prop_string (node, "part", alias->part);
-
-}
-
-
/*
* Local Variables: -- emacs
gl_mini_preview_pixbuf_cache_add_by_template (lglTemplate *template)
{
GdkPixbuf *pixbuf;
- GList *p;
- lglTemplateAlias *alias;
gchar *name;
gl_debug (DEBUG_PIXBUF_CACHE, "START");
pixbuf = gl_mini_preview_pixbuf_new (template, 72, 72);
- for ( p=template->aliases; p != NULL; p=p->next )
- {
- alias = (lglTemplateAlias *)p->data;
-
- name = g_strdup_printf ("%s %s", alias->brand, alias->part);
- g_hash_table_insert (mini_preview_pixbuf_cache, name, g_object_ref (pixbuf));
- }
+ name = g_strdup_printf ("%s %s", template->brand, template->part);
+ g_hash_table_insert (mini_preview_pixbuf_cache, name, g_object_ref (pixbuf));
g_object_unref (pixbuf);
<!ENTITY % label_element "Label-rectangle | Label-round | Label-ellipse | Label-cd">
<!ENTITY % markup_element "Markup-margin | Markup-line | Markup-circle | Markup-rect | Markup-ellipse">
-<!ELEMENT Template (Meta*, (%label_element;)*, Alias*)>
+<!ELEMENT Template (Meta*, (%label_element;)*)>
<!ATTLIST Template
brand %STRING_TYPE; #REQUIRED
part %STRING_TYPE; #REQUIRED
dy %LENGTH_TYPE; "0 pt"
>
-<!ELEMENT Alias EMPTY>
-<!ATTLIST Alias
- brand %STRING_TYPE; #REQUIRED
- part %STRING_TYPE; #REQUIRED
- name %STRING_TYPE; #IMPLIED
->
<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- Objects Section -->