From 401cf06fb65e0e61370488c8c24fd610e89cb201 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Thu, 6 Apr 2006 12:10:21 -0500 Subject: [PATCH] Added gtkhtml dependency --- m4/Makefile.am | 1 + m4/moo-flags.m4 | 6 ++++++ m4/moo-gtkhtml.m4 | 33 +++++++++++++++++++++++++++++++++ moo.kdevelop | 8 ++++---- moo/moo.pc.in | 2 +- moo/mooapp/Makefile.incl | 20 ++++++++++++++------ moo/mooapp/moohelp.h | 25 ++++++++++++++++++++++++- 7 files changed, 83 insertions(+), 12 deletions(-) create mode 100644 m4/moo-gtkhtml.m4 diff --git a/m4/Makefile.am b/m4/Makefile.am index c8c47800..1e341173 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -6,6 +6,7 @@ EXTRA_DIST = \ moo-flags.m4 \ moo-funcs.m4 \ moo-gtk.m4 \ + moo-gtkhtml.m4 \ moo-os.m4 \ moo-pcre.m4 \ moo-pygtk.m4 \ diff --git a/m4/moo-flags.m4 b/m4/moo-flags.m4 index f70609c2..671639d7 100644 --- a/m4/moo-flags.m4 +++ b/m4/moo-flags.m4 @@ -5,6 +5,7 @@ AC_DEFUN([MOO_AC_FLAGS],[ AC_REQUIRE([MOO_AC_FAM]) AC_REQUIRE([MOO_PKG_CHECK_GTK_VERSIONS]) AC_REQUIRE([MOO_AC_SET_DIRS]) + AC_REQUIRE([MOO_AC_GTKHTML]) moo_top_src_dir=`cd $srcdir && pwd` moo_top_build_dir=`cd ./$ac_top_builddir && pwd` @@ -17,6 +18,11 @@ AC_DEFUN([MOO_AC_FLAGS],[ MOO_CFLAGS="$MOO_CFLAGS -DMOO_DATA_DIR=\\\"${MOO_DATA_DIR}\\\" -DMOO_LIB_DIR=\\\"${MOO_LIB_DIR}\\\"" + if test x$MOO_USE_GTKHTML = xyes; then + MOO_CFLAGS="$MOO_CFLAGS $GTKHTML_CFLAGS" + MOO_LIBS="$MOO_LIBS $GTKHTML_LIBS" + fi + ################################################################################ # MooEdit stuff # diff --git a/m4/moo-gtkhtml.m4 b/m4/moo-gtkhtml.m4 new file mode 100644 index 00000000..f2c4b3a6 --- /dev/null +++ b/m4/moo-gtkhtml.m4 @@ -0,0 +1,33 @@ +############################################################################## +# MOO_AC_GTKHTML() +# +AC_DEFUN([MOO_AC_GTKHTML],[ + MOO_USE_GTKHTML=auto + + AC_ARG_WITH([gtkhtml], + AC_HELP_STRING([--with-gtkhtml], [whether to use gtkhtml (default = AUTO)]),[ + if test x$with_gtkhtml = "xyes"; then + MOO_USE_GTKHTML="yes" + else + MOO_USE_GTKHTML="no" + fi + ]) + + if test x$MOO_USE_GTKHTML != xno; then + PKG_CHECK_MODULES(GTKHTML, [libgtkhtml-2.0], [ + MOO_USE_GTKHTML=yes + MOO_GTKHTML_PACKAGE=libgtkhtml-2.0 + AC_DEFINE(MOO_USE_GTKHTML, 1, [use libgtkhtml-2.0]) + ],[ + if test x$MOO_USE_GTKHTML = xyes; then + AC_MSG_ERROR([libgtkhtml-2 not found.]) + else + MOO_USE_GTKHTML=no + fi + ]) + fi + + AC_SUBST(MOO_USE_GTKHTML) + AC_SUBST(MOO_GTKHTML_PACKAGE) + AM_CONDITIONAL(MOO_USE_GTKHTML, test x$MOO_USE_GTKHTML = "xyes") +]) diff --git a/moo.kdevelop b/moo.kdevelop index 2d8c34ed..88b05087 100644 --- a/moo.kdevelop +++ b/moo.kdevelop @@ -286,16 +286,16 @@ - + A new empty GAP source file - + A new empty C++ file. - + A new empty header file for C/C++. - + A new empty C file. diff --git a/moo/moo.pc.in b/moo/moo.pc.in index 2cb11059..10739005 100644 --- a/moo/moo.pc.in +++ b/moo/moo.pc.in @@ -9,7 +9,7 @@ pluginsdir=@MOO_LIB_DIR@/plugins Name: moo Description: A text editor and terminal emulator library -Requires: gtk+-2.0 @MOO_XML_PKG_NAME@ +Requires: gtk+-2.0 @MOO_XML_PKG_NAME@ @MOO_GTKHTML_PACKAGE@ Version: @MOO_VERSION_UNQUOTED@ Cflags: -I@moo_includedir@ -I@moo_libincludedir@ Libs: -L${libdir} -lmoo @MOO_FAM_LIBS@ @PYTHON_LDFLAGS@ diff --git a/moo/mooapp/Makefile.incl b/moo/mooapp/Makefile.incl index 40384ec5..f6ddc5e7 100644 --- a/moo/mooapp/Makefile.incl +++ b/moo/mooapp/Makefile.incl @@ -22,9 +22,22 @@ mooapp_sources = \ $(mooapp)/mooappinput.c \ $(mooapp)/mooappinput.h \ $(mooapp)/mooappoutput.c \ - $(mooapp)/mooappoutput.h \ + $(mooapp)/mooappoutput.h + +mooapp_extra_dist = \ + $(mooapp)/gpl \ + $(mooapp)/moohtml.c \ + $(mooapp)/moohtml.h + +if MOO_USE_GTKHTML +mooapp_sources += \ $(mooapp)/moohelp.c \ $(mooapp)/moohelp.h +else +mooapp_extra_dist += \ + $(mooapp)/moohelp.c \ + $(mooapp)/moohelp.h +endif if MOO_USE_XML mooapp_sources += \ @@ -32,11 +45,6 @@ mooapp_sources += \ $(mooapp)/moohtml.h endif -mooapp_extra_dist = \ - $(mooapp)/gpl \ - $(mooapp)/moohtml.c \ - $(mooapp)/moohtml.h - $(mooapp)/mooappabout-glade.h: $(mooapp_srcdir)/glade/mooappabout.glade $(XML2H) mkdir -p $(mooapp) sh $(XML2H) MOO_APP_ABOUT_GLADE_UI $(mooapp_srcdir)/glade/mooappabout.glade > $(mooapp)/mooappabout-glade.h diff --git a/moo/mooapp/moohelp.h b/moo/mooapp/moohelp.h index 2e62eb1f..017465f0 100644 --- a/moo/mooapp/moohelp.h +++ b/moo/mooapp/moohelp.h @@ -14,12 +14,35 @@ #ifndef __MOO_HELP_H__ #define __MOO_HELP_H__ -#include "mooapp/moohtml.h" +#include G_BEGIN_DECLS +#define MOO_TYPE_HELP (moo_help_get_type ()) +#define MOO_HELP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_HELP, MooHelp)) +#define MOO_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_HELP, MooHelpClass)) +#define MOO_IS_HELP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_HELP)) +#define MOO_IS_HELP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_HELP)) +#define MOO_HELP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_HELP, MooHelpClass)) +typedef struct _MooHelp MooHelp; +typedef struct _MooHelpPrivate MooHelpPrivate; +typedef struct _MooHelpClass MooHelpClass; + +struct _MooHelp +{ + HtmlView parent; +}; + +struct _MooHelpClass +{ + HtmlViewClass parent_class; +}; + + +GType moo_help_get_type (void) G_GNUC_CONST; +GtkWidget *moo_help_new (void); G_END_DECLS