]> git.draconx.ca Git - aspectbin.git/commitdiff
Add support for libglade.
authorNick Bowler <nbowler@draconx.ca>
Sun, 22 Mar 2009 21:23:15 +0000 (17:23 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sun, 22 Mar 2009 21:23:15 +0000 (17:23 -0400)
Makefile.am
aspectbin-libglade.c [new file with mode: 0644]
configure.ac

index 3ac950834ffcb1f0e22cee9289ef49f75c0615e7..ee9fcf4b7bc8c7fd6183226035ecb86d7177bd0a 100644 (file)
@@ -14,6 +14,12 @@ libaspectbin_la_CFLAGS  = $(GTK_CFLAGS)
 libaspectbin_la_LDFLAGS = $(GTK_LIBS)
 include_HEADERS = aspectbin.h
 
+if BUILD_LIBGLADE
+libaspectbin_la_SOURCES += aspectbin-libglade.c
+libaspectbin_la_CFLAGS  += $(LIBGLADE_CFLAGS)
+libaspectbin_la_LDFLAGS += $(LIBGLADE_LIBS)
+endif
+
 if BUILD_GLADEUI
 libaspectbin_la_SOURCES += aspectbin-gladeui.c
 libaspectbin_la_CFLAGS  += $(GLADEUI_CFLAGS)
diff --git a/aspectbin-libglade.c b/aspectbin-libglade.c
new file mode 100644 (file)
index 0000000..726c6e6
--- /dev/null
@@ -0,0 +1,30 @@
+/* AspectBin - A GTK+ container for packing with consrained aspect ratio.
+ * Copyright (C) 2009 Nick Bowler
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glade/glade.h>
+#include <glade/glade-build.h>
+#include "aspectbin.h"
+
+void glade_module_register_widgets(void)
+{
+       glade_register_widget(ASPECT_BIN_TYPE, glade_standard_build_widget,
+                                              glade_standard_build_children,
+                                               NULL);
+       glade_provide("aspectbin");
+}
index becbe7d547bbedf54a46978399a8bf4e230eaa42..69a3eeb879125493a677344794ee4503210aa022 100644 (file)
@@ -14,6 +14,13 @@ PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.12.0])
 AC_SUBST(GTK_LIBS)
 AC_SUBST(GTK_CFLAGS)
 
+AC_ARG_WITH([libglade],
+       [AS_HELP_STRING([--with-libglade],
+               [build support for libglade [default=yes]]
+       )],
+       [],
+       [with_libglade=yes])
+
 AC_ARG_WITH([gladeui],
        [AS_HELP_STRING([--with-gladeui],
                [build support for Glade UI [default=yes]]
@@ -21,6 +28,14 @@ AC_ARG_WITH([gladeui],
        [],
        [with_gladeui=yes])
 
+have_libglade=no
+if test x"$with_libglade" != x"no"; then
+PKG_CHECK_MODULES(LIBGLADE, [libglade-2.0 >= 2.6],
+       [have_libglade=yes], [have_libglade=no])
+AC_SUBST(LIBGLADE_LIBS)
+AC_SUBST(LIBGLADE_CFLAGS)
+fi
+
 have_gladeui=no
 if test x"$with_gladeui" != x"no"; then
 PKG_CHECK_MODULES(GLADEUI, [gladeui-1.0 >= 3],
@@ -49,6 +64,7 @@ if test x"$have_gladeui" = x"yes" -a x"$have_gladeui_dirs" = x"no"; then
 AC_MSG_WARN([Glade UI support will be built, but not installed.])
 fi
 
+AM_CONDITIONAL([BUILD_LIBGLADE], [test x"$have_libglade" = x"yes"])
 AM_CONDITIONAL([BUILD_GLADEUI],  [test x"$have_gladeui" = x"yes"])
 AM_CONDITIONAL([INST_GLADEUI],   [test x"$have_gladeui_dirs" = x"yes"])