[PHP-GTK-DEV] [patch] GtkSourceView2 support
[email protected] (enygmata)
| Newsgroups | php.gtk.dev |
|---|---|
| Message-ID | <[email protected]> |
Hello, i have been working the last 4 days to get gtksourceview2 working with
php-gtk2, and today i finaly finished it, so i'm posting the patch for the
config.m4,
config.w32 and Makefile.frag files and also a url to the rest of files...
PATCH + Sources = http://enygmata.site88.net/gtksourceview2/
gtksourceview2 support still NEEDS TESTING.
have fun..
Index: Makefile.frag
===================================================================
RCS file: /repository/php-gtk/ext/sourceview/Makefile.frag,v
retrieving revision 1.3
diff -u -r1.3 Makefile.frag
--- Makefile.frag 14 Apr 2006 22:49:08 -0000 1.3
+++ Makefile.frag 30 Jul 2008 18:14:09 -0000
@@ -12,3 +12,19 @@
-f $@ ext/sourceview/sourceview.defs \
&& grep -h "^PHP_GTK_EXPORT_CE" $@ | sed -e "s!^!extern !" >
$(@D)/$(*F).h \
)
+
+
+$(builddir)/gen_sourceview2.c: $(srcdir)/sourceview2.defs
$(srcdir)/sourceview2.overrides
+ ( \
+ $(PHP) $(top_srcdir)/generator/generator.php \
+ -l $(@D)/$(*F).log \
+ -r ext/gtk+/atk-types.defs \
+ -r ext/gtk+/pango-types.defs \
+ -r ext/gtk+/gdk-types.defs \
+ -r ext/gtk+/gtk-types.defs \
+ -o ext/sourceview/sourceview2.overrides \
+ -p GtkSourceView \
+ -f $@ ext/sourceview/sourceview2.defs \
+ && grep -h "^PHP_GTK_EXPORT_CE" $@ | sed -e "s!^!extern !" >
$(@D)/$(*F).h \
+ )
+
Index: config.m4
===================================================================
RCS file: /repository/php-gtk/ext/sourceview/config.m4,v
retrieving revision 1.4
diff -u -r1.4 config.m4
--- config.m4 28 May 2007 23:53:33 -0000 1.4
+++ config.m4 30 Jul 2008 18:14:10 -0000
@@ -1,11 +1,15 @@
dnl $Id: config.m4,v 1.4 2007/05/28 23:53:33 anant Exp $
-dnl config.m4 for sourceview module
+dnl config.m4 for sourceview and sourceview2 modules
define(sourceview_required_version, 1.2.0)
+define(sourceview2_required_version, 2.0.0)
PHP_GTK_ARG_WITH(sourceview,for sourceview support,
[ --with-sourceview Enable SourceView support],no)
+PHP_GTK_ARG_WITH(sourceview2,for sourceview2 support,
+[ --with-sourceview2 Enable SourceView2 support],no)
+
if test "$PHP_GTK_SOURCEVIEW" != "no"; then
PKG_CHECK_MODULES(SOURCEVIEW, [gtksourceview-1.0 >=
sourceview_required_version],
have_sourceview=yes, have_sourceview=no)
@@ -22,4 +26,22 @@
fi
PHP_GTK_EXTENSION(sourceview, $php_gtk_ext_shared, php_sourceview.c,
gen_sourceview.c)
fi
+else
+ if test "$PHP_GTK_SOURCEVIEW2" != "no"; then
+ PKG_CHECK_MODULES(SOURCEVIEW2, [gtksourceview-2.0 >=
sourceview2_required_version],
+ have_sourceview2=yes, have_sourceview2=no)
+ if test "$have_sourceview2" != "yes"; then
+ AC_MSG_RESULT([Unable to locate sourceview2 version
sourceview2_required_version or higher: not building])
+ else
+ AC_DEFINE(HAVE_SOURCEVIEW2, 1, [sourceview2 support])
+ PHP_EVAL_INCLINE($SOURCEVIEW2_CFLAGS)
+ if test "$php_gtk_ext_shared" = "yes"; then
+ PHP_EVAL_LIBLINE($SOURCEVIEW2_LIBS, SOURCEVIEW2_SHARED_LIBADD)
+ PHP_SUBST(SOURCEVIEW2_SHARED_LIBADD)
+ else
+ PHP_EVAL_LIBLINE($SOURCEVIEW2_LIBS, PHP_GTK2_SHARED_LIBADD)
+ fi
+ PHP_GTK_EXTENSION(sourceview, $php_gtk_ext_shared, php_sourceview2.c,
gen_sourceview2.c)
+ fi
+ fi
fi
Index: config.w32
===================================================================
RCS file: /repository/php-gtk/ext/sourceview/config.w32,v
retrieving revision 1.1
diff -u -r1.1 config.w32
--- config.w32 28 Feb 2007 18:03:25 -0000 1.1
+++ config.w32 30 Jul 2008 18:14:10 -0000
@@ -1,5 +1,6 @@
ARG_WITH("sourceview", "for sourceview support", "no");
+ARG_WITH("sourceview2", "for sourceview2 support", "no");
if (PHP_GTK_SOURCEVIEW != "no" || PHP_GTK_ALL != "no") {
if (CHECK_HEADER("gtksourceview\\gtksourceview.h") &&
CHECK_LIB("gtksourceview-1.0.lib", "sourceview"))
@@ -21,3 +22,27 @@
WARNING("gtksourceview not enabled; libraries and headers not found");
}
}
+else
+{
+ if (PHP_GTK_SOURCEVIEW2 != "no" || PHP_GTK_ALL != "no") {
+ if (CHECK_HEADER("gtksourceview\\gtksourceview.h") &&
CHECK_LIB("gtksourceview-2.0.lib", "sourceview"))
+ {
+ if (FSO.FileExists("win32\\temp.bat")) {
+
+ var temp = FSO.OpenTextFile("win32\\temp.bat", 8);
+ temp.WriteLine("php -q generator\\generator.php -l
win32\\logs\\config_sourceview2.log -o
ext\\sourceview\\sourceview2.overrides -p gtksourceview2 -r
ext\\gtk+\\gtk.defs ext\\sourceview\\sourceview2.defs >
ext\\sourceview\\gen_sourceview2.c");
+ temp.WriteLine('grep -h "^PHP_GTK_EXPORT_CE"
ext\\sourceview\\gen_sourceview2.c | sed -e "s/^/PHP_GTK_API extern /" >
ext\\sourceview\\gen_sourceview2.h');
+ temp.Close();
+ }
+
+ ADD_FLAG("CFLAGS_SOURCEVIEW2", "/I ext\\sourceview /I
..\\ext\\sourceview /D HAVE_SOURCEVIEW2=1");
+ EXTENSION("sourceview", "php_sourceview2.c gen_sourceview2.c", true); //
always shared
+ AC_DEFINE("HAVE_SOURCEVIEW2", 1, "sourceview2 enabled");
+
+ } else {
+
+ WARNING("gtksourceview2 not enabled; libraries and headers not found");
+ }
+ }
+
+}
--
View this message in context: http://www.nabble.com/-patch--GtkSourceView2-support-tp18741182p18741182.html
Sent from the Php - GTK - Dev mailing list archive at Nabble.com.