gtk_editable_get_chars (GTK_EDITABLE (media_select->template_entry),
0, -1);
gl_debug (DEBUG_MEDIA_SELECT, "name = \"%s\"", name);
- gl_wdgt_mini_preview_set_label (GL_WDGT_MINI_PREVIEW (media_select->mini_preview),
- name);
+ gl_wdgt_mini_preview_set_label_by_name (GL_WDGT_MINI_PREVIEW (media_select->mini_preview),
+ name);
details_update (media_select, name);
g_free (name);
name = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
if ( strlen(name) ) {
gl_debug (DEBUG_MEDIA_SELECT, "name = \"%s\"", name);
- gl_wdgt_mini_preview_set_label (GL_WDGT_MINI_PREVIEW (media_select->mini_preview),
- name);
+ gl_wdgt_mini_preview_set_label_by_name (GL_WDGT_MINI_PREVIEW (media_select->mini_preview),
+ name);
gl_debug (DEBUG_MEDIA_SELECT, "m1");
details_update (media_select, name);
gl_debug (DEBUG_MEDIA_SELECT, "m2");
static void gl_wdgt_mini_preview_construct (glWdgtMiniPreview * preview,
gint height, gint width);
-static GList *mini_outline_list_new (GnomeCanvas *canvas,
- glTemplate *template);
+static GList *mini_outline_list_new (GnomeCanvas *canvas,
+ const glTemplate *template);
static void mini_outline_list_free (GList ** list);
static gint canvas_event_cb (GnomeCanvas * canvas,
static GnomeCanvasItem *cdbc_item (GnomeCanvasGroup *group,
gdouble x1,
gdouble y1,
- glTemplate *template);
+ const glTemplate *template);
static void style_set_cb (GtkWidget *widget,
GtkStyle *previous_style,
/****************************************************************************/
/* Set label for mini-preview to determine geometry. */
/****************************************************************************/
-void gl_wdgt_mini_preview_set_label (glWdgtMiniPreview *preview,
- gchar *name)
+void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview,
+ const gchar *name)
{
glTemplate *template;
+
+ gl_debug (DEBUG_MINI_PREVIEW, "START");
+
+ /* Fetch template */
+ template = gl_template_from_name (name);
+
+ gl_wdgt_mini_preview_set_template (preview, template);
+
+ gl_template_free( &template );
+
+ gl_debug (DEBUG_MINI_PREVIEW, "END");
+}
+
+/****************************************************************************/
+/* Set label for mini-preview to determine geometry. */
+/****************************************************************************/
+void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview,
+ const glTemplate *template)
+{
gchar *page_size;
gdouble canvas_scale;
gdouble w, h;
gl_debug (DEBUG_MINI_PREVIEW, "START");
- /* Fetch template */
- template = gl_template_from_name (name);
-
gl_debug (DEBUG_MINI_PREVIEW, "page_size = %s, page_width = %g, page_height = %g",
template->page_size, template->page_width, template->page_height);
mini_outline_list_new (GNOME_CANVAS(preview->canvas),
template);
- gl_template_free( &template );
-
gl_debug (DEBUG_MINI_PREVIEW, "END");
}
/* PRIVATE. Draw label outlines and return canvas item list. */
/*--------------------------------------------------------------------------*/
static GList *
-mini_outline_list_new (GnomeCanvas *canvas,
- glTemplate *template)
+mini_outline_list_new (GnomeCanvas *canvas,
+ const glTemplate *template)
{
GnomeCanvasGroup *group = NULL;
GnomeCanvasItem *item = NULL;
cdbc_item (GnomeCanvasGroup *group,
gdouble x1,
gdouble y1,
- glTemplate *template)
+ const glTemplate *template)
{
GnomeCanvasPoints *points;
gint i_coords, i_theta;
gpointer user_data);
};
-guint gl_wdgt_mini_preview_get_type (void);
+guint gl_wdgt_mini_preview_get_type (void);
-GtkWidget *gl_wdgt_mini_preview_new (gint height,
- gint width);
+GtkWidget *gl_wdgt_mini_preview_new (gint height,
+ gint width);
-void gl_wdgt_mini_preview_set_label (glWdgtMiniPreview *preview,
- gchar *name);
+void gl_wdgt_mini_preview_set_label_by_name (glWdgtMiniPreview *preview,
+ const gchar *name);
-void gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview,
- gint first_label,
- gint last_label);
+void gl_wdgt_mini_preview_set_template (glWdgtMiniPreview *preview,
+ const glTemplate *template);
+
+void gl_wdgt_mini_preview_highlight_range (glWdgtMiniPreview *preview,
+ gint first_label,
+ gint last_label);
G_END_DECLS
#endif