From 8b3a31761ef7f331fd76b991e292a3f50cc8475d Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sun, 22 Mar 2009 17:23:15 -0400 Subject: [PATCH] Add support for libglade. --- Makefile.am | 6 ++++++ aspectbin-libglade.c | 30 ++++++++++++++++++++++++++++++ configure.ac | 16 ++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 aspectbin-libglade.c diff --git a/Makefile.am b/Makefile.am index 3ac9508..ee9fcf4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 0000000..726c6e6 --- /dev/null +++ b/aspectbin-libglade.c @@ -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 +#include +#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"); +} diff --git a/configure.ac b/configure.ac index becbe7d..69a3eeb 100644 --- a/configure.ac +++ b/configure.ac @@ -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"]) -- 2.43.0