Install library, python module, and headers

master
Yevgen Muntyan 2006-08-01 06:36:16 -05:00
parent f22003ee34
commit a513128d76
22 changed files with 251 additions and 185 deletions

View File

@ -58,6 +58,7 @@ MOO_COMPONENTS
MOO_AC_RELOC MOO_AC_RELOC
MOO_AC_SET_DIRS(moo) MOO_AC_SET_DIRS(moo)
MOO_AC_FLAGS MOO_AC_FLAGS
AM_CONDITIONAL(MOO_INSTALL_LIB, true)
################################################################################ ################################################################################

View File

@ -6,7 +6,6 @@ EXTRA_DIST = \
moo-flags.m4 \ moo-flags.m4 \
moo-funcs.m4 \ moo-funcs.m4 \
moo-gtk.m4 \ moo-gtk.m4 \
moo-gtkhtml.m4 \
moo-os.m4 \ moo-os.m4 \
moo-pcre.m4 \ moo-pcre.m4 \
moo-progs.m4 \ moo-progs.m4 \

View File

@ -17,8 +17,6 @@ AC_DEFUN([MOO_AC_SET_DIRS],[
MOO_TEXT_LANG_FILES_DIR="${MOO_DATA_DIR}/syntax" MOO_TEXT_LANG_FILES_DIR="${MOO_DATA_DIR}/syntax"
AC_SUBST(MOO_TEXT_LANG_FILES_DIR) AC_SUBST(MOO_TEXT_LANG_FILES_DIR)
moo_libincludedir=${MOO_LIB_DIR}/include
moo_includedir=${includedir}/$1 moo_includedir=${includedir}/$1
AC_SUBST(moo_libincludedir)
AC_SUBST(moo_includedir) AC_SUBST(moo_includedir)
]) ])

View File

@ -5,7 +5,6 @@ AC_DEFUN([MOO_AC_FLAGS],[
AC_REQUIRE([MOO_AC_FAM]) AC_REQUIRE([MOO_AC_FAM])
AC_REQUIRE([MOO_PKG_CHECK_GTK_VERSIONS]) AC_REQUIRE([MOO_PKG_CHECK_GTK_VERSIONS])
AC_REQUIRE([MOO_AC_SET_DIRS]) AC_REQUIRE([MOO_AC_SET_DIRS])
AC_REQUIRE([MOO_AC_GTKHTML])
moo_top_src_dir=`cd $srcdir && pwd` moo_top_src_dir=`cd $srcdir && pwd`
MOO_CFLAGS="$MOO_CFLAGS -I$moo_top_src_dir/moo $GTK_CFLAGS $MOO_PCRE_CFLAGS -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\"" MOO_CFLAGS="$MOO_CFLAGS -I$moo_top_src_dir/moo $GTK_CFLAGS $MOO_PCRE_CFLAGS -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\""

View File

@ -1,39 +0,0 @@
##############################################################################
# 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")
# ])
AC_DEFUN([MOO_AC_GTKHTML],[
AM_CONDITIONAL(MOO_USE_GTKHTML, false)
MOO_GTKHTML_PACKAGE=
AC_SUBST(MOO_GTKHTML_PACKAGE)
])

View File

@ -38,7 +38,7 @@
<useconfiguration>debug</useconfiguration> <useconfiguration>debug</useconfiguration>
</general> </general>
<run> <run>
<mainprogram>./medit</mainprogram> <mainprogram>tests/medit</mainprogram>
<directoryradio>executable</directoryradio> <directoryradio>executable</directoryradio>
<customdirectory>/</customdirectory> <customdirectory>/</customdirectory>
<programargs>-n</programargs> <programargs>-n</programargs>
@ -48,7 +48,7 @@
</run> </run>
<configurations> <configurations>
<debug> <debug>
<configargs>--enable-debug --enable-all-gcc-warnings --enable-printing --disable-shared --without-system-pcre</configargs> <configargs>--enable-debug --enable-all-gcc-warnings --enable-printing --disable-static --without-system-pcre</configargs>
<builddir>build/debug</builddir> <builddir>build/debug</builddir>
<ccompiler>kdevgccoptions</ccompiler> <ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler> <cxxcompiler>kdevgppoptions</cxxcompiler>
@ -221,7 +221,7 @@
</kdevautoproject> </kdevautoproject>
<kdevdebugger> <kdevdebugger>
<general> <general>
<dbgshell></dbgshell> <dbgshell>libtool</dbgshell>
<programargs>--g-fatal-warnings -n</programargs> <programargs>--g-fatal-warnings -n</programargs>
<breakonloadinglibs>true</breakonloadinglibs> <breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty> <separatetty>false</separatetty>
@ -291,16 +291,16 @@
</kdevdoctreeview> </kdevdoctreeview>
<kdevfilecreate> <kdevfilecreate>
<filetypes> <filetypes>
<type icon="source" ext="g" name="GAP source" create="template" > <type icon="source" ext="g" create="template" name="GAP source" >
<descr>A new empty GAP source file</descr> <descr>A new empty GAP source file</descr>
</type> </type>
<type icon="source_cpp" ext="cpp" name="C++ Source" create="template" > <type icon="source_cpp" ext="cpp" create="template" name="C++ Source" >
<descr>A new empty C++ file.</descr> <descr>A new empty C++ file.</descr>
</type> </type>
<type icon="source_h" ext="h" name="C/C++ Header" create="template" > <type icon="source_h" ext="h" create="template" name="C/C++ Header" >
<descr>A new empty header file for C/C++.</descr> <descr>A new empty header file for C/C++.</descr>
</type> </type>
<type icon="source_c" ext="c" name="C Source" create="template" > <type icon="source_c" ext="c" create="template" name="C Source" >
<descr>A new empty C file.</descr> <descr>A new empty C file.</descr>
</type> </type>
</filetypes> </filetypes>

View File

@ -2,8 +2,18 @@ moo_include_headers = \
moo.h \ moo.h \
moo-version.h moo-version.h
# moo_libinclude_headers = \ if MOO_INSTALL_LIB
# $(moo_prefix)/moo-config.h moo_include_HEADERS = $(moo_include_headers)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = moo.pc
endif
# mooedit_includedir = $(moo_includedir)/mooedit
# mooedit_include_HEADERS = $(mooedit_include_headers)
# mooterm_includedir = $(moo_includedir)/mooterm
# mooterm_include_HEADERS = $(mooterm_include_headers)
# mooutils_includedir = $(moo_includedir)/mooutils
# mooutils_include_HEADERS = $(mooutils_include_headers)
EXTRA_DIST = \ EXTRA_DIST = \
TODO TODO
@ -38,9 +48,34 @@ endif
SUBDIRS = $(subdirs) . SUBDIRS = $(subdirs) .
DIST_SUBDIRS = mooutils mooterm mooedit mooapp moopython mooscript moofileview DIST_SUBDIRS = mooutils mooterm mooedit mooapp moopython mooscript moofileview
if MOO_INSTALL_LIB
lib_LTLIBRARIES = libmoo.la
else
noinst_LTLIBRARIES = libmoo.la noinst_LTLIBRARIES = libmoo.la
endif
#lib_LTLIBRARIES = libmoo.la #lib_LTLIBRARIES = libmoo.la
libmoo_la_LIBADD = $(libs) libmoo_la_LIBADD = $(libs) $(MOO_LIBS) $(PYTHON_LDFLAGS)
# libmoo_la_LDFLAGS = -no-undefined -export-symbols-regex "^(moo_|ms_|m_|egg_regex_).*" # libmoo_la_LDFLAGS = -no-undefined -export-symbols-regex "^(moo_|ms_|m_|egg_regex_).*"
libmoo_la_LDFLAGS = -no-undefined -export-symbols-regex ".*" libmoo_la_LDFLAGS = -no-undefined -export-symbols-regex ".*"
libmoo_la_SOURCES = $(moo_include_headers) libmoo_la_SOURCES = $(moo_include_headers)
if MOO_INSTALL_LIB
pyexec_LTLIBRARIES = moo.la
moo_la_SOURCES = \
moopython/moopython-utils.c \
moopython/moopython-utils.h \
moopython/mooplugin-python.c \
moopython/mooplugin-python.h
moo_la_LDFLAGS = -module -no-undefined -export-symbols-regex "initmoo"
moo_la_LIBADD = moopython/pygtk/libmoopygtk.la libmoo.la
moo_la_CFLAGS = \
-I.. \
-I$(top_builddir) \
$(MOO_CFLAGS) \
$(MOO_DEBUG_CFLAGS) \
$(PYTHON_INCLUDES) \
$(PYGTK_CFLAGS) \
-DMOO_PYTHON_MODULE
endif

View File

@ -44,8 +44,6 @@
#include <mooterm/mootermline.h> #include <mooterm/mootermline.h>
#include <mooterm/mootermtag.h> #include <mooterm/mootermtag.h>
#include <mooutils/eggregex.h>
#include <mooutils/mooaccel.h>
#include <mooutils/mooaccelbutton.h> #include <mooutils/mooaccelbutton.h>
#include <mooutils/mooaction.h> #include <mooutils/mooaction.h>
#include <mooutils/moobigpaned.h> #include <mooutils/moobigpaned.h>

View File

@ -1,6 +1,7 @@
prefix=@prefix@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
includedir=@includedir@ includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@ datadir=@datadir@
libdir=@libdir@ libdir=@libdir@
@ -9,7 +10,7 @@ pluginsdir=@MOO_LIB_DIR@/plugins
Name: moo Name: moo
Description: A text editor and terminal emulator library Description: A text editor and terminal emulator library
Requires: gtk+-2.0 @MOO_XML_PKG_NAME@ @MOO_GTKHTML_PACKAGE@ Requires: gtk+-2.0 @MOO_XML_PKG_NAME@
Version: @MOO_VERSION_UNQUOTED@ Version: @MOO_VERSION_UNQUOTED@
Cflags: -I@moo_includedir@ -I@moo_libincludedir@ Cflags: -I@moo_includedir@
Libs: -L${libdir} -lmoo @PYTHON_LDFLAGS@ Libs: -L${libdir} -lmoo @PYTHON_LDFLAGS@

View File

@ -4,6 +4,11 @@ BUILT_SOURCES = \
mooapp_include_headers = \ mooapp_include_headers = \
mooapp.h mooapp.h
if MOO_INSTALL_LIB
mooapp_includedir = $(moo_includedir)/mooapp
mooapp_include_HEADERS = $(mooapp_include_headers)
endif
mooapp_sources = \ mooapp_sources = \
$(mooapp_include_headers) \ $(mooapp_include_headers) \
mooappabout-glade.h \ mooappabout-glade.h \

View File

@ -54,6 +54,7 @@ mooedit_noinst_headers = \
mootextfind-glade.h \ mootextfind-glade.h \
mootextfind.h \ mootextfind.h \
mootextgotoline-glade.h \ mootextgotoline-glade.h \
mootextsearch-private.h \
mootextview-private.h \ mootextview-private.h \
quicksearch-glade.h \ quicksearch-glade.h \
statusbar-glade.h statusbar-glade.h
@ -170,3 +171,8 @@ AM_CFLAGS = \
-I$(top_builddir) \ -I$(top_builddir) \
$(MOO_CFLAGS) \ $(MOO_CFLAGS) \
$(MOO_DEBUG_CFLAGS) $(MOO_DEBUG_CFLAGS)
if MOO_INSTALL_LIB
mooedit_includedir = $(moo_includedir)/mooedit
mooedit_include_HEADERS = $(mooedit_include_headers)
endif

View File

@ -16,7 +16,7 @@
#include "mooedit/mootextgotoline-glade.h" #include "mooedit/mootextgotoline-glade.h"
#include "mooedit/mootextview.h" #include "mooedit/mootextview.h"
#include "mooedit/mooeditdialogs.h" #include "mooedit/mooeditdialogs.h"
#include "mooedit/mootextsearch.h" #include "mooedit/mootextsearch-private.h"
#include "mooedit/mooeditprefs.h" #include "mooedit/mooeditprefs.h"
#include "mooutils/moohistoryentry.h" #include "mooutils/moohistoryentry.h"
#include "mooutils/mooentry.h" #include "mooutils/mooentry.h"
@ -619,11 +619,11 @@ do_find (const GtkTextIter *start,
if (regex) if (regex)
{ {
if (flags & MOO_FIND_BACKWARDS) if (flags & MOO_FIND_BACKWARDS)
return moo_text_search_regex_backward (start, end, regex, match_start, return _moo_text_search_regex_backward (start, end, regex, match_start,
match_end, NULL, NULL, NULL); match_end, NULL, NULL, NULL);
else else
return moo_text_search_regex_forward (start, end, regex, match_start, return _moo_text_search_regex_forward (start, end, regex, match_start,
match_end, NULL, NULL, NULL); match_end, NULL, NULL, NULL);
} }
else else
{ {
@ -1045,8 +1045,8 @@ do_replace_silent (GtkTextIter *start,
search_flags |= MOO_TEXT_SEARCH_WHOLE_WORDS; search_flags |= MOO_TEXT_SEARCH_WHOLE_WORDS;
if (regex) if (regex)
return moo_text_replace_regex_all (start, end, regex, replacement, return _moo_text_replace_regex_all (start, end, regex, replacement,
flags & MOO_FIND_REPL_LITERAL); flags & MOO_FIND_REPL_LITERAL);
else else
return moo_text_replace_all (start, end, text, replacement, search_flags); return moo_text_replace_all (start, end, text, replacement, search_flags);
} }
@ -1164,12 +1164,12 @@ do_replace_interactive (GtkTextView *view,
search_flags |= MOO_TEXT_SEARCH_WHOLE_WORDS; search_flags |= MOO_TEXT_SEARCH_WHOLE_WORDS;
if (regex) if (regex)
*replaced = moo_text_replace_regex_all_interactive (start, end, regex, replacement, *replaced = _moo_text_replace_regex_all_interactive (start, end, regex, replacement,
flags & MOO_FIND_REPL_LITERAL, flags & MOO_FIND_REPL_LITERAL,
replace_func, &data); replace_func, &data);
else else
*replaced = moo_text_replace_all_interactive (start, end, text, replacement, *replaced = _moo_text_replace_all_interactive (start, end, text, replacement,
search_flags, replace_func, &data); search_flags, replace_func, &data);
if (data.dialog) if (data.dialog)
gtk_widget_destroy (data.dialog); gtk_widget_destroy (data.dialog);

View File

@ -0,0 +1,74 @@
/*
* mootextsearch-private.h
*
* Copyright (C) 2004-2006 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
#ifndef __MOO_TEXT_SEARCH_PRIVATE_H__
#define __MOO_TEXT_SEARCH_PRIVATE_H__
#include <mooedit/mootextsearch.h>
#include <mooutils/eggregex.h>
G_BEGIN_DECLS
/* replacement is evaluated in case of regex */
typedef MooTextReplaceResponse (*MooTextReplaceFunc) (const char *text,
EggRegex *regex,
const char *replacement,
const GtkTextIter *to_replace_start,
const GtkTextIter *to_replace_end,
gpointer user_data);
gboolean _moo_text_search_regex_forward (const GtkTextIter *start,
const GtkTextIter *end,
EggRegex *regex,
GtkTextIter *match_start,
GtkTextIter *match_end,
char **string,
int *match_offset,
int *match_len);
gboolean _moo_text_search_regex_backward (const GtkTextIter *start,
const GtkTextIter *end,
EggRegex *regex,
GtkTextIter *match_start,
GtkTextIter *match_end,
char **string,
int *match_offset,
int *match_len);
int _moo_text_replace_regex_all (GtkTextIter *start,
GtkTextIter *end,
EggRegex *regex,
const char *replacement,
gboolean replacement_literal);
int _moo_text_replace_regex_all_interactive
(GtkTextIter *start,
GtkTextIter *end,
EggRegex *regex,
const char *replacement,
gboolean replacement_literal,
MooTextReplaceFunc func,
gpointer func_data);
int _moo_text_replace_all_interactive (GtkTextIter *start,
GtkTextIter *end,
const char *text,
const char *replacement,
MooTextSearchFlags flags,
MooTextReplaceFunc func,
gpointer func_data);
G_END_DECLS
#endif /* __MOO_TEXT_SEARCH_PRIVATE_H__ */

View File

@ -11,20 +11,20 @@
* See COPYING file that comes with this distribution. * See COPYING file that comes with this distribution.
*/ */
#include "mooedit/mootextsearch.h" #include "mooedit/mootextsearch-private.h"
#include "mooedit/gtksourceiter.h" #include "mooedit/gtksourceiter.h"
#include <string.h> #include <string.h>
gboolean gboolean
moo_text_search_regex_forward (const GtkTextIter *search_start, _moo_text_search_regex_forward (const GtkTextIter *search_start,
const GtkTextIter *search_end, const GtkTextIter *search_end,
EggRegex *regex, EggRegex *regex,
GtkTextIter *match_start, GtkTextIter *match_start,
GtkTextIter *match_end, GtkTextIter *match_end,
char **string, char **string,
int *match_offset, int *match_offset,
int *match_len) int *match_len)
{ {
GtkTextIter start, end; GtkTextIter start, end;
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
@ -129,14 +129,14 @@ find_last_match (EggRegex *regex,
gboolean gboolean
moo_text_search_regex_backward (const GtkTextIter *search_start, _moo_text_search_regex_backward (const GtkTextIter *search_start,
const GtkTextIter *search_end, const GtkTextIter *search_end,
EggRegex *regex, EggRegex *regex,
GtkTextIter *match_start, GtkTextIter *match_start,
GtkTextIter *match_end, GtkTextIter *match_end,
char **string, char **string,
int *match_offset, int *match_offset,
int *match_len) int *match_len)
{ {
GtkTextIter slice_start, slice_end; GtkTextIter slice_start, slice_end;
GtkTextBuffer *buffer; GtkTextBuffer *buffer;
@ -337,9 +337,9 @@ moo_text_search_forward (const GtkTextIter *start,
if (!regex) if (!regex)
return FALSE; return FALSE;
return moo_text_search_regex_forward (start, end, regex, return _moo_text_search_regex_forward (start, end, regex,
match_start, match_end, match_start, match_end,
NULL, NULL, NULL); NULL, NULL, NULL);
} }
@ -394,9 +394,9 @@ moo_text_search_backward (const GtkTextIter *start,
if (!regex) if (!regex)
return FALSE; return FALSE;
return moo_text_search_regex_backward (start, end, regex, return _moo_text_search_regex_backward (start, end, regex,
match_start, match_end, match_start, match_end,
NULL, NULL, NULL); NULL, NULL, NULL);
} }
@ -485,8 +485,8 @@ moo_text_replace_regex_all_real (GtkTextIter *start,
GError *error = NULL; GError *error = NULL;
int match_len; int match_len;
if (!moo_text_search_regex_forward (start, end, regex, &match_start, &match_end, if (!_moo_text_search_regex_forward (start, end, regex, &match_start, &match_end,
&string, NULL, &match_len)) &string, NULL, &match_len))
goto out; goto out;
if (!match_len) if (!match_len)
@ -595,11 +595,11 @@ out:
int int
moo_text_replace_regex_all (GtkTextIter *start, _moo_text_replace_regex_all (GtkTextIter *start,
GtkTextIter *end, GtkTextIter *end,
EggRegex *regex, EggRegex *regex,
const char *replacement, const char *replacement,
gboolean replacement_literal) gboolean replacement_literal)
{ {
g_return_val_if_fail (start != NULL, 0); g_return_val_if_fail (start != NULL, 0);
g_return_val_if_fail (regex != NULL, 0); g_return_val_if_fail (regex != NULL, 0);
@ -611,13 +611,13 @@ moo_text_replace_regex_all (GtkTextIter *start,
int int
moo_text_replace_regex_all_interactive (GtkTextIter *start, _moo_text_replace_regex_all_interactive (GtkTextIter *start,
GtkTextIter *end, GtkTextIter *end,
EggRegex *regex, EggRegex *regex,
const char *replacement, const char *replacement,
gboolean replacement_literal, gboolean replacement_literal,
MooTextReplaceFunc func, MooTextReplaceFunc func,
gpointer func_data) gpointer func_data)
{ {
g_return_val_if_fail (start != NULL, 0); g_return_val_if_fail (start != NULL, 0);
g_return_val_if_fail (regex != NULL, 0); g_return_val_if_fail (regex != NULL, 0);
@ -660,8 +660,8 @@ moo_text_replace_all (GtkTextIter *start,
if (!regex) if (!regex)
return 0; return 0;
return moo_text_replace_regex_all (start, end, regex, replacement, return _moo_text_replace_regex_all (start, end, regex, replacement,
flags & MOO_TEXT_SEARCH_REPL_LITERAL); flags & MOO_TEXT_SEARCH_REPL_LITERAL);
} }
buffer = gtk_text_iter_get_buffer (start); buffer = gtk_text_iter_get_buffer (start);
@ -704,13 +704,13 @@ out:
int int
moo_text_replace_all_interactive (GtkTextIter *start, _moo_text_replace_all_interactive (GtkTextIter *start,
GtkTextIter *end, GtkTextIter *end,
const char *text, const char *text,
const char *replacement, const char *replacement,
MooTextSearchFlags flags, MooTextSearchFlags flags,
MooTextReplaceFunc func, MooTextReplaceFunc func,
gpointer func_data) gpointer func_data)
{ {
int count = 0; int count = 0;
GtkTextMark *end_mark; GtkTextMark *end_mark;
@ -738,9 +738,9 @@ moo_text_replace_all_interactive (GtkTextIter *start,
if (!regex) if (!regex)
return 0; return 0;
return moo_text_replace_regex_all_interactive (start, end, regex, replacement, return _moo_text_replace_regex_all_interactive (start, end, regex, replacement,
flags & MOO_TEXT_SEARCH_REPL_LITERAL, flags & MOO_TEXT_SEARCH_REPL_LITERAL,
func, func_data); func, func_data);
} }
buffer = gtk_text_iter_get_buffer (start); buffer = gtk_text_iter_get_buffer (start);

View File

@ -15,7 +15,6 @@
#define __MOO_TEXT_SEARCH_H__ #define __MOO_TEXT_SEARCH_H__
#include <mooedit/mootextiter.h> #include <mooedit/mootextiter.h>
#include <mooutils/eggregex.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -40,15 +39,6 @@ typedef enum {
MOO_TEXT_REPLACE_ALL = 3 MOO_TEXT_REPLACE_ALL = 3
} MooTextReplaceResponse; } MooTextReplaceResponse;
/* replacement is evaluated in case of regex */
typedef MooTextReplaceResponse (*MooTextReplaceFunc) (const char *text,
EggRegex *regex,
const char *replacement,
const GtkTextIter *to_replace_start,
const GtkTextIter *to_replace_end,
gpointer user_data);
gboolean moo_text_search_forward (const GtkTextIter *start, gboolean moo_text_search_forward (const GtkTextIter *start,
const char *str, const char *str,
MooTextSearchFlags flags, MooTextSearchFlags flags,
@ -62,50 +52,12 @@ gboolean moo_text_search_backward (const GtkTextIter *start,
GtkTextIter *match_end, GtkTextIter *match_end,
const GtkTextIter *end); const GtkTextIter *end);
gboolean moo_text_search_regex_forward (const GtkTextIter *start,
const GtkTextIter *end,
EggRegex *regex,
GtkTextIter *match_start,
GtkTextIter *match_end,
char **string,
int *match_offset,
int *match_len);
gboolean moo_text_search_regex_backward (const GtkTextIter *start,
const GtkTextIter *end,
EggRegex *regex,
GtkTextIter *match_start,
GtkTextIter *match_end,
char **string,
int *match_offset,
int *match_len);
int moo_text_replace_regex_all (GtkTextIter *start,
GtkTextIter *end,
EggRegex *regex,
const char *replacement,
gboolean replacement_literal);
int moo_text_replace_all (GtkTextIter *start, int moo_text_replace_all (GtkTextIter *start,
GtkTextIter *end, GtkTextIter *end,
const char *text, const char *text,
const char *replacement, const char *replacement,
MooTextSearchFlags flags); MooTextSearchFlags flags);
int moo_text_replace_regex_all_interactive
(GtkTextIter *start,
GtkTextIter *end,
EggRegex *regex,
const char *replacement,
gboolean replacement_literal,
MooTextReplaceFunc func,
gpointer func_data);
int moo_text_replace_all_interactive (GtkTextIter *start,
GtkTextIter *end,
const char *text,
const char *replacement,
MooTextSearchFlags flags,
MooTextReplaceFunc func,
gpointer func_data);
G_END_DECLS G_END_DECLS

View File

@ -15,15 +15,23 @@ moopython_sources += \
endif endif
noinst_LTLIBRARIES = libmoopython.la noinst_LTLIBRARIES = libmoopython.la
libmoopython_la_LIBADD = pygtk/libmoopygtk.la libmoopython_la_LIBADD =
libmoopython_la_SOURCES = $(moopython_sources) libmoopython_la_SOURCES = $(moopython_sources)
AM_CFLAGS = \
if MOO_INSTALL_LIB
lib_define = -DMOO_INSTALL_LIB
else
libmoopython_la_LIBADD += pygtk/libmoopygtk.la
endif
libmoopython_la_CFLAGS = \
-I.. \ -I.. \
-I$(top_builddir) \ -I$(top_builddir) \
$(MOO_CFLAGS) \ $(MOO_CFLAGS) \
$(MOO_DEBUG_CFLAGS) \ $(MOO_DEBUG_CFLAGS) \
$(PYTHON_INCLUDES) \ $(PYTHON_INCLUDES) \
$(PYGTK_CFLAGS) $(PYGTK_CFLAGS) \
$(lib_define)
EXTRA_DIST += \ EXTRA_DIST += \
codegen/__init__.py \ codegen/__init__.py \

View File

@ -12,7 +12,11 @@
*/ */
#include <Python.h> #include <Python.h>
#ifndef MOO_INSTALL_LIB
#define NO_IMPORT_PYGOBJECT #define NO_IMPORT_PYGOBJECT
#endif
#include "pygobject.h" #include "pygobject.h"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -353,6 +357,23 @@ moo_python_plugin_read_dirs (void)
} }
static gboolean
init_moo_pygtk (void)
{
#ifndef MOO_INSTALL_LIB
return _moo_pygtk_init ();
#else
PyObject *module = PyImport_ImportModule ((char*) "moo");
if (!module)
PyErr_SetString(PyExc_ImportError,
"could not import moo");
return module != NULL;
#endif
}
gboolean gboolean
_moo_python_plugin_init (void) _moo_python_plugin_init (void)
{ {
@ -361,7 +382,7 @@ _moo_python_plugin_init (void)
if (!moo_python_api_init ()) if (!moo_python_api_init ())
return FALSE; return FALSE;
if (!_moo_pygtk_init ()) if (!init_moo_pygtk ())
{ {
PyErr_Print (); PyErr_Print ();
moo_python_init (MOO_PY_API_VERSION, NULL); moo_python_init (MOO_PY_API_VERSION, NULL);
@ -405,7 +426,10 @@ MOO_PLUGIN_INIT_FUNC_DECL
void initmoo (void) void initmoo (void)
{ {
in_moo_module = TRUE; in_moo_module = TRUE;
moo_python_api_init ();
if (!moo_python_running())
moo_python_api_init ();
_moo_pygtk_init (); _moo_pygtk_init ();
} }
#endif #endif

View File

@ -38,3 +38,8 @@ AM_CFLAGS = \
-I$(top_builddir) \ -I$(top_builddir) \
$(MOO_CFLAGS) \ $(MOO_CFLAGS) \
$(MOO_DEBUG_CFLAGS) $(MOO_DEBUG_CFLAGS)
if MOO_INSTALL_LIB
mooscript_includedir = $(moo_includedir)/mooscript
mooscript_include_HEADERS = $(mooscript_headers)
endif

View File

@ -84,6 +84,11 @@ libmooterm_la_SOURCES += $(mooterm_win32_sources)
EXTRA_DIST += $(mooterm_unix_sources) EXTRA_DIST += $(mooterm_unix_sources)
endif endif
if MOO_INSTALL_LIB
mooterm_includedir = $(moo_includedir)/mooterm
mooterm_include_HEADERS = $(mooterm_include_headers)
endif
AM_CFLAGS = \ AM_CFLAGS = \
-I$(top_builddir) \ -I$(top_builddir) \
-I.. \ -I.. \

View File

@ -23,8 +23,8 @@ gtk_2_4_sources = \
newgtk/gtkfontbutton.h newgtk/gtkfontbutton.h
mooutils_include_headers = \ mooutils_include_headers = \
eggregex.h \
mooaccelbutton.h \ mooaccelbutton.h \
mooaction.h \
moobigpaned.h \ moobigpaned.h \
mooclosure.h \ mooclosure.h \
moocmd.h \ moocmd.h \
@ -57,13 +57,13 @@ mooutils_include_headers = \
mooutils_sources = \ mooutils_sources = \
$(mooutils_include_headers) \ $(mooutils_include_headers) \
eggregex.h \
eggregex.c \ eggregex.c \
mooaccel.h \ mooaccel.h \
mooaccel.c \ mooaccel.c \
mooaccelbutton-glade.h \ mooaccelbutton-glade.h \
mooaccelbutton.c \ mooaccelbutton.c \
mooaccelprefs-glade.h \ mooaccelprefs-glade.h \
mooaction.h \
mooaction.c \ mooaction.c \
mooactionfactory.h \ mooactionfactory.h \
mooactionfactory.c \ mooactionfactory.c \
@ -215,3 +215,8 @@ AM_CFLAGS = \
$(pcre_include) \ $(pcre_include) \
$(MOO_CFLAGS) \ $(MOO_CFLAGS) \
$(MOO_DEBUG_CFLAGS) $(MOO_DEBUG_CFLAGS)
if MOO_INSTALL_LIB
mooutils_includedir = $(moo_includedir)/mooutils
mooutils_include_HEADERS = $(mooutils_include_headers)
endif

View File

@ -14,12 +14,7 @@
#include "medit-ui.h" #include "medit-ui.h"
#include "THANKS.h" #include "THANKS.h"
#include <mooapp/mooapp.h> #include <moo.h>
#include <mooedit/mooplugin.h>
#include <mooutils/mooutils-fs.h>
#include <mooutils/mooutils-misc.h>
#include <mooutils/moostock.h>
#include <moo-version.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -13,12 +13,7 @@
#include "medit-ui.h" #include "medit-ui.h"
#include "THANKS.h" #include "THANKS.h"
#include <mooapp/mooapp.h> #include <moo.h>
#include <mooedit/mooplugin.h>
#include <mooutils/mooutils-fs.h>
#include <mooutils/mooutils-misc.h>
#include <mooutils/moostock.h>
#include <moo-version.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>