AC_PATH_PROG(UPDATE_MIME_DATABASE, update-mime-database)
AC_PATH_PROG(UPDATE_DESKTOP_DATABASE, update-desktop-database)
+dnl ---------------------------------------------------------------------------
+dnl - GLABELS branch
+dnl ---------------------------------------------------------------------------
+GLABELS_BRANCH=glabels-3.0
+AC_SUBST(GLABELS_BRANCH)
+
dnl ---------------------------------------------------------------------------
dnl - LIBGLABELS branch
dnl ---------------------------------------------------------------------------
-LIBGLABELS=libglabels-3.0
-AC_SUBST(LIBGLABELS)
+LIBGLABELS_BRANCH=libglabels-3.0
+AC_SUBST(LIBGLABELS_BRANCH)
dnl ---------------------------------------------------------------------------
dnl - LIBGLABELS API versioning
AC_CONFIG_FILES([
Makefile
libglabels/Makefile
-libglabels/${LIBGLABELS}.pc
+libglabels/${LIBGLABELS_BRANCH}.pc
src/Makefile
src/pixmaps/Makefile
src/stock-pixmaps/Makefile
## Process this file with automake to produce Makefile.in
-builderdir = $(datadir)/glabels/builder/
+builderdir = $(datadir)/$(GLABELS_BRANCH)/builder/
builder_DATA = \
property-bar.builder \
## Process this file with automake to produce Makefile.in
-glabels_pixmapsdir = $(datadir)/pixmaps/glabels
+glabels_pixmapsdir = $(datadir)/$(GLABELS_BRANCH)/pixmaps
glabels_pixmaps_DATA = \
glabels-splash.png \
-templatesdir = $(datadir)/$(LIBGLABELS)/templates
+templatesdir = $(datadir)/$(LIBGLABELS_BRANCH)/templates
INCLUDES = \
$(LIBGLABELS_CFLAGS) \
str.h \
str.c
-libglabels_3_0includedir=$(includedir)/$(LIBGLABELS)
+libglabels_3_0includedir=$(includedir)/$(LIBGLABELS_BRANCH)
libglabels_3_0include_HEADERS = \
libglabels.h
-libglabels_3_0subincludedir=$(includedir)/$(LIBGLABELS)/libglabels
+libglabels_3_0subincludedir=$(includedir)/$(LIBGLABELS_BRANCH)/libglabels
libglabels_3_0subinclude_HEADERS = \
db.h \
str.h
EXTRA_DIST = \
- $(LIBGLABELS).pc.in
+ $(LIBGLABELS_BRANCH).pc.in
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(LIBGLABELS).pc
+pkgconfig_DATA = $(LIBGLABELS_BRANCH).pc
Requires: glib-2.0 libxml-2.0
Version: @VERSION@
Libs: -L${libdir} -lglabels-3.0
-Cflags: -I${includedir}/libglabels-3.0
+Cflags: -I${includedir}/@LIBGLABELS_BRANCH@
$(LIBIEC16022_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DGLABELS_LOCALEDIR=\""$(datadir)/locale"\" \
- -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps/"\" \
- -DGLABELS_BUILDER_DIR=\""$(datadir)/glabels/builder/"\" \
- -DGLABELS_PIXMAP_DIR=\""$(datadir)/pixmaps/glabels/"\" \
+ -DGLABELS_ICON_DIR=\""$(datadir)/pixmaps"\" \
+ -DGLABELS_DATA_DIR=\""$(datadir)/$(GLABELS_BRANCH)"\" \
-DG_LOG_DOMAIN=\""glabels\""
glabels_LDFLAGS = -export-dynamic
glabels_LDADD = \
$(GLABELS_LIBS) \
- ../libglabels/$(LIBGLABELS).la \
+ ../libglabels/$(LIBGLABELS_BRANCH).la \
$(LIBEBOOK_LIBS) \
$(LIBBARCODE_LIBS) \
$(LIBQRENCODE_LIBS) \
glabels_batch_LDADD = \
$(GLABELS_LIBS) \
- ../libglabels/$(LIBGLABELS).la \
+ ../libglabels/$(LIBGLABELS_BRANCH).la \
$(LIBEBOOK_LIBS) \
$(LIBBARCODE_LIBS) \
$(LIBQRENCODE_LIBS) \
CLEANFILES = $(BUILT_SOURCES)
-$(bin_PROGRAMS): ../libglabels/$(LIBGLABELS).la
+$(bin_PROGRAMS): ../libglabels/$(LIBGLABELS_BRANCH).la
-../libglabels/$(LIBGLABELS).la:
+../libglabels/$(LIBGLABELS_BRANCH).la:
cd ../libglabels; $(MAKE)
gl_warning_handler_init();
/* Set default icon */
- icon_file = GLABELS_ICON_DIR "glabels.png";
+ icon_file = g_build_filename (GLABELS_ICON_DIR, "glabels.png", NULL);
if (!g_file_test (icon_file, G_FILE_TEST_EXISTS))
{
g_message ("Could not find %s", icon_file);
{
gtk_window_set_default_icon_from_file (icon_file, NULL);
}
+ g_free (icon_file);
/* Initialize subsystems */
static void
gl_media_select_construct (glMediaSelect *this)
{
+ gchar *builder_filename;
GtkBuilder *builder;
static gchar *object_ids[] = { "media_select_hbox", NULL };
GError *error = NULL;
g_return_if_fail (this->priv != NULL);
builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (builder,
- GLABELS_BUILDER_DIR "media-select.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "media-select.builder", NULL);
+ gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
static void
gl_merge_properties_dialog_init (glMergePropertiesDialog *dialog)
{
+ gchar *builder_filename;
GtkBuilder *builder;
static gchar *object_ids[] = { "merge_properties_vbox", NULL };
GError *error = NULL;
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (builder,
- GLABELS_BUILDER_DIR "merge-properties-dialog.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "merge-properties-dialog.builder", NULL);
+ gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
static void
gl_object_editor_init (glObjectEditor *editor)
{
+ gchar *builder_filename;
static gchar *object_ids[] = { "editor_vbox",
"adjustment1", "adjustment2", "adjustment3",
"adjustment4", "adjustment5", "adjustment6",
editor->priv->builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (editor->priv->builder,
- GLABELS_BUILDER_DIR "object-editor.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "object-editor.builder", NULL);
+ gtk_builder_add_objects_from_file (editor->priv->builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
static void
gl_prefs_dialog_init (glPrefsDialog *dialog)
{
+ gchar *builder_filename;
static gchar *object_ids[] = { "prefs_notebook",
"adjustment1", "adjustment2", "adjustment3",
NULL };
dialog->priv = g_new0 (glPrefsDialogPrivate, 1);
dialog->priv->builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (dialog->priv->builder,
- GLABELS_BUILDER_DIR "prefs-dialog.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "prefs-dialog.builder", NULL);
+ gtk_builder_add_objects_from_file (dialog->priv->builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
create_custom_widget_cb (GtkPrintOperation *operation,
glLabel *label)
{
+ gchar *builder_filename;
GtkBuilder *builder;
static gchar *object_ids[] = { "print_custom_widget_hbox",
"adjustment1", "adjustment2",
op->priv->labels_per_sheet = lgl_template_frame_get_n_labels (frame);
builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (builder,
- GLABELS_BUILDER_DIR "print-op-dialog-custom-widget.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "print-op-dialog-custom-widget.builder", NULL);
+ gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
/*========================================================*/
/* Private macros and constants. */
/*========================================================*/
-#define ICON_PIXMAP (GLABELS_ICON_DIR "glabels.png")
-
-#define EX_RECT_IMAGE (GLABELS_PIXMAP_DIR "ex-rect-size.png")
-#define EX_ROUND_IMAGE (GLABELS_PIXMAP_DIR "ex-round-size.png")
-#define EX_CD_IMAGE (GLABELS_PIXMAP_DIR "ex-cd-size.png")
-#define EX_NLAYOUTS_IMAGE1 (GLABELS_PIXMAP_DIR "ex-1layout.png")
-#define EX_NLAYOUTS_IMAGE2 (GLABELS_PIXMAP_DIR "ex-2layouts.png")
-
#define DEFAULT_MARGIN 9.0
#define DEFAULT_RECT_W 252.0
static void
gl_template_designer_init (glTemplateDesigner *dialog)
{
+ gchar *builder_filename;
static gchar *object_ids[] = { "start_page",
"name_page",
"pg_size_page",
dialog->priv = g_new0 (glTemplateDesignerPrivate, 1);
dialog->priv->builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (dialog->priv->builder,
- GLABELS_BUILDER_DIR "template-designer.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "template-designer.builder", NULL);
+ gtk_builder_add_objects_from_file (dialog->priv->builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
gl_template_designer_construct (glTemplateDesigner *dialog)
{
lglUnits units;
+ gchar *logo_filename;
GdkPixbuf *logo;
gl_debug (DEBUG_TEMPLATE, "START");
gtk_window_set_title (GTK_WINDOW(dialog), _("gLabels Template Designer"));
- logo = gdk_pixbuf_new_from_file (ICON_PIXMAP, NULL);
+ logo_filename = g_build_filename (GLABELS_ICON_DIR, "glabels.png", NULL);
+ logo = gdk_pixbuf_new_from_file (logo_filename, NULL);
+ g_free (logo_filename);
/* Costruct and append pages (must be same order as PAGE_NUM enums. */
construct_start_page (dialog, logo);
construct_rect_size_page (glTemplateDesigner *dialog,
GdkPixbuf *logo)
{
+ gchar *pixbuf_filename;
GdkPixbuf *pixbuf;
gl_debug (DEBUG_TEMPLATE, "START");
TRUE);
/* Initialize illustration. */
- pixbuf = gdk_pixbuf_new_from_file (EX_RECT_IMAGE, NULL);
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-rect-size.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->rect_image), pixbuf);
/* Apply units to spinbuttons and units labels. */
construct_round_size_page (glTemplateDesigner *dialog,
GdkPixbuf *logo)
{
+ gchar *pixbuf_filename;
GdkPixbuf *pixbuf;
gl_debug (DEBUG_TEMPLATE, "START");
TRUE);
/* Initialize illustration. */
- pixbuf = gdk_pixbuf_new_from_file (EX_ROUND_IMAGE, NULL);
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-round-size.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->round_image), pixbuf);
/* Apply units to spinbuttons and units labels. */
construct_cd_size_page (glTemplateDesigner *dialog,
GdkPixbuf *logo)
{
+ gchar *pixbuf_filename;
GdkPixbuf *pixbuf;
gl_debug (DEBUG_TEMPLATE, "START");
TRUE);
/* Initialize illustration. */
- pixbuf = gdk_pixbuf_new_from_file (EX_CD_IMAGE, NULL);
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-cd-size.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->cd_image), pixbuf);
/* Apply units to spinbuttons and units labels. */
construct_nlayouts_page (glTemplateDesigner *dialog,
GdkPixbuf *logo)
{
+ gchar *pixbuf_filename;
GdkPixbuf *pixbuf;
gl_debug (DEBUG_TEMPLATE, "START");
/* Initialize illustrations. */
- pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE1, NULL);
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-1layout.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image1), pixbuf);
- pixbuf = gdk_pixbuf_new_from_file (EX_NLAYOUTS_IMAGE2, NULL);
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "ex-2layouts.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
gtk_image_set_from_pixbuf (GTK_IMAGE(dialog->priv->nlayouts_image2), pixbuf);
gl_debug (DEBUG_TEMPLATE, "END");
{
static GtkWidget *about = NULL;
+ gchar *pixbuf_filename;
GdkPixbuf *pixbuf = NULL;
const gchar *authors[] = {
} else {
- pixbuf = gdk_pixbuf_new_from_file (GLABELS_PIXMAP_DIR "glabels-splash.png", NULL);
+ pixbuf_filename = g_build_filename (GLABELS_DATA_DIR, "pixmaps", "glabels-splash.png", NULL);
+ pixbuf = gdk_pixbuf_new_from_file (pixbuf_filename, NULL);
+ g_free (pixbuf_filename);
about = gtk_about_dialog_new ();
gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG(about), _("glabels"));
static void
gl_ui_property_bar_construct (glUIPropertyBar *this)
{
+ gchar *builder_filename;
GtkBuilder *builder;
static gchar *object_ids[] = { "property_toolbar",
"adjustment1", "adjustment2",
this->priv->stop_signals = TRUE;
builder = gtk_builder_new ();
- gtk_builder_add_objects_from_file (builder,
- GLABELS_BUILDER_DIR "property-bar.builder",
- object_ids,
- &error);
+ builder_filename = g_build_filename (GLABELS_DATA_DIR, "builder", "property-bar.builder", NULL);
+ gtk_builder_add_objects_from_file (builder, builder_filename, object_ids, &error);
+ g_free (builder_filename);
if (error) {
g_critical ("%s\n\ngLabels may not be installed correctly!", error->message);
g_error_free (error);
## Process this file with automake to produce Makefile.in
-dtddir = $(datadir)/$(LIBGLABELS)/dtd
+dtddir = $(datadir)/$(LIBGLABELS_BRANCH)/dtd
dtd_DATA = \
glabels-2.3.dtd
-templatesdir = $(datadir)/$(LIBGLABELS)/templates
+templatesdir = $(datadir)/$(LIBGLABELS_BRANCH)/templates
templates_DATA = \
paper-sizes.xml \