Install library, python module, and headers
parent
f22003ee34
commit
a513128d76
|
@ -58,6 +58,7 @@ MOO_COMPONENTS
|
|||
MOO_AC_RELOC
|
||||
MOO_AC_SET_DIRS(moo)
|
||||
MOO_AC_FLAGS
|
||||
AM_CONDITIONAL(MOO_INSTALL_LIB, true)
|
||||
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -6,7 +6,6 @@ EXTRA_DIST = \
|
|||
moo-flags.m4 \
|
||||
moo-funcs.m4 \
|
||||
moo-gtk.m4 \
|
||||
moo-gtkhtml.m4 \
|
||||
moo-os.m4 \
|
||||
moo-pcre.m4 \
|
||||
moo-progs.m4 \
|
||||
|
|
|
@ -17,8 +17,6 @@ AC_DEFUN([MOO_AC_SET_DIRS],[
|
|||
MOO_TEXT_LANG_FILES_DIR="${MOO_DATA_DIR}/syntax"
|
||||
AC_SUBST(MOO_TEXT_LANG_FILES_DIR)
|
||||
|
||||
moo_libincludedir=${MOO_LIB_DIR}/include
|
||||
moo_includedir=${includedir}/$1
|
||||
AC_SUBST(moo_libincludedir)
|
||||
AC_SUBST(moo_includedir)
|
||||
])
|
||||
|
|
|
@ -5,7 +5,6 @@ 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_CFLAGS="$MOO_CFLAGS -I$moo_top_src_dir/moo $GTK_CFLAGS $MOO_PCRE_CFLAGS -DXDG_PREFIX=_moo_edit_xdg -DG_LOG_DOMAIN=\\\"Moo\\\""
|
||||
|
|
|
@ -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)
|
||||
])
|
14
moo.kdevelop
14
moo.kdevelop
|
@ -38,7 +38,7 @@
|
|||
<useconfiguration>debug</useconfiguration>
|
||||
</general>
|
||||
<run>
|
||||
<mainprogram>./medit</mainprogram>
|
||||
<mainprogram>tests/medit</mainprogram>
|
||||
<directoryradio>executable</directoryradio>
|
||||
<customdirectory>/</customdirectory>
|
||||
<programargs>-n</programargs>
|
||||
|
@ -48,7 +48,7 @@
|
|||
</run>
|
||||
<configurations>
|
||||
<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>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
|
@ -221,7 +221,7 @@
|
|||
</kdevautoproject>
|
||||
<kdevdebugger>
|
||||
<general>
|
||||
<dbgshell></dbgshell>
|
||||
<dbgshell>libtool</dbgshell>
|
||||
<programargs>--g-fatal-warnings -n</programargs>
|
||||
<breakonloadinglibs>true</breakonloadinglibs>
|
||||
<separatetty>false</separatetty>
|
||||
|
@ -291,16 +291,16 @@
|
|||
</kdevdoctreeview>
|
||||
<kdevfilecreate>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</type>
|
||||
</filetypes>
|
||||
|
|
|
@ -2,8 +2,18 @@ moo_include_headers = \
|
|||
moo.h \
|
||||
moo-version.h
|
||||
|
||||
# moo_libinclude_headers = \
|
||||
# $(moo_prefix)/moo-config.h
|
||||
if MOO_INSTALL_LIB
|
||||
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 = \
|
||||
TODO
|
||||
|
@ -38,9 +48,34 @@ endif
|
|||
SUBDIRS = $(subdirs) .
|
||||
DIST_SUBDIRS = mooutils mooterm mooedit mooapp moopython mooscript moofileview
|
||||
|
||||
if MOO_INSTALL_LIB
|
||||
lib_LTLIBRARIES = libmoo.la
|
||||
else
|
||||
noinst_LTLIBRARIES = libmoo.la
|
||||
endif
|
||||
|
||||
#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 ".*"
|
||||
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
|
||||
|
|
|
@ -44,8 +44,6 @@
|
|||
#include <mooterm/mootermline.h>
|
||||
#include <mooterm/mootermtag.h>
|
||||
|
||||
#include <mooutils/eggregex.h>
|
||||
#include <mooutils/mooaccel.h>
|
||||
#include <mooutils/mooaccelbutton.h>
|
||||
#include <mooutils/mooaction.h>
|
||||
#include <mooutils/moobigpaned.h>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
includedir=@includedir@
|
||||
datarootdir=@datarootdir@
|
||||
datadir=@datadir@
|
||||
libdir=@libdir@
|
||||
|
||||
|
@ -9,7 +10,7 @@ pluginsdir=@MOO_LIB_DIR@/plugins
|
|||
|
||||
Name: moo
|
||||
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@
|
||||
Cflags: -I@moo_includedir@ -I@moo_libincludedir@
|
||||
Cflags: -I@moo_includedir@
|
||||
Libs: -L${libdir} -lmoo @PYTHON_LDFLAGS@
|
||||
|
|
|
@ -4,6 +4,11 @@ BUILT_SOURCES = \
|
|||
mooapp_include_headers = \
|
||||
mooapp.h
|
||||
|
||||
if MOO_INSTALL_LIB
|
||||
mooapp_includedir = $(moo_includedir)/mooapp
|
||||
mooapp_include_HEADERS = $(mooapp_include_headers)
|
||||
endif
|
||||
|
||||
mooapp_sources = \
|
||||
$(mooapp_include_headers) \
|
||||
mooappabout-glade.h \
|
||||
|
|
|
@ -54,6 +54,7 @@ mooedit_noinst_headers = \
|
|||
mootextfind-glade.h \
|
||||
mootextfind.h \
|
||||
mootextgotoline-glade.h \
|
||||
mootextsearch-private.h \
|
||||
mootextview-private.h \
|
||||
quicksearch-glade.h \
|
||||
statusbar-glade.h
|
||||
|
@ -170,3 +171,8 @@ AM_CFLAGS = \
|
|||
-I$(top_builddir) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS)
|
||||
|
||||
if MOO_INSTALL_LIB
|
||||
mooedit_includedir = $(moo_includedir)/mooedit
|
||||
mooedit_include_HEADERS = $(mooedit_include_headers)
|
||||
endif
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "mooedit/mootextgotoline-glade.h"
|
||||
#include "mooedit/mootextview.h"
|
||||
#include "mooedit/mooeditdialogs.h"
|
||||
#include "mooedit/mootextsearch.h"
|
||||
#include "mooedit/mootextsearch-private.h"
|
||||
#include "mooedit/mooeditprefs.h"
|
||||
#include "mooutils/moohistoryentry.h"
|
||||
#include "mooutils/mooentry.h"
|
||||
|
@ -619,11 +619,11 @@ do_find (const GtkTextIter *start,
|
|||
if (regex)
|
||||
{
|
||||
if (flags & MOO_FIND_BACKWARDS)
|
||||
return moo_text_search_regex_backward (start, end, regex, match_start,
|
||||
match_end, NULL, NULL, NULL);
|
||||
return _moo_text_search_regex_backward (start, end, regex, match_start,
|
||||
match_end, NULL, NULL, NULL);
|
||||
else
|
||||
return moo_text_search_regex_forward (start, end, regex, match_start,
|
||||
match_end, NULL, NULL, NULL);
|
||||
return _moo_text_search_regex_forward (start, end, regex, match_start,
|
||||
match_end, NULL, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1045,8 +1045,8 @@ do_replace_silent (GtkTextIter *start,
|
|||
search_flags |= MOO_TEXT_SEARCH_WHOLE_WORDS;
|
||||
|
||||
if (regex)
|
||||
return moo_text_replace_regex_all (start, end, regex, replacement,
|
||||
flags & MOO_FIND_REPL_LITERAL);
|
||||
return _moo_text_replace_regex_all (start, end, regex, replacement,
|
||||
flags & MOO_FIND_REPL_LITERAL);
|
||||
else
|
||||
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;
|
||||
|
||||
if (regex)
|
||||
*replaced = moo_text_replace_regex_all_interactive (start, end, regex, replacement,
|
||||
flags & MOO_FIND_REPL_LITERAL,
|
||||
replace_func, &data);
|
||||
*replaced = _moo_text_replace_regex_all_interactive (start, end, regex, replacement,
|
||||
flags & MOO_FIND_REPL_LITERAL,
|
||||
replace_func, &data);
|
||||
else
|
||||
*replaced = moo_text_replace_all_interactive (start, end, text, replacement,
|
||||
search_flags, replace_func, &data);
|
||||
*replaced = _moo_text_replace_all_interactive (start, end, text, replacement,
|
||||
search_flags, replace_func, &data);
|
||||
|
||||
if (data.dialog)
|
||||
gtk_widget_destroy (data.dialog);
|
||||
|
|
|
@ -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__ */
|
|
@ -11,20 +11,20 @@
|
|||
* See COPYING file that comes with this distribution.
|
||||
*/
|
||||
|
||||
#include "mooedit/mootextsearch.h"
|
||||
#include "mooedit/mootextsearch-private.h"
|
||||
#include "mooedit/gtksourceiter.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
gboolean
|
||||
moo_text_search_regex_forward (const GtkTextIter *search_start,
|
||||
const GtkTextIter *search_end,
|
||||
EggRegex *regex,
|
||||
GtkTextIter *match_start,
|
||||
GtkTextIter *match_end,
|
||||
char **string,
|
||||
int *match_offset,
|
||||
int *match_len)
|
||||
_moo_text_search_regex_forward (const GtkTextIter *search_start,
|
||||
const GtkTextIter *search_end,
|
||||
EggRegex *regex,
|
||||
GtkTextIter *match_start,
|
||||
GtkTextIter *match_end,
|
||||
char **string,
|
||||
int *match_offset,
|
||||
int *match_len)
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
GtkTextBuffer *buffer;
|
||||
|
@ -129,14 +129,14 @@ find_last_match (EggRegex *regex,
|
|||
|
||||
|
||||
gboolean
|
||||
moo_text_search_regex_backward (const GtkTextIter *search_start,
|
||||
const GtkTextIter *search_end,
|
||||
EggRegex *regex,
|
||||
GtkTextIter *match_start,
|
||||
GtkTextIter *match_end,
|
||||
char **string,
|
||||
int *match_offset,
|
||||
int *match_len)
|
||||
_moo_text_search_regex_backward (const GtkTextIter *search_start,
|
||||
const GtkTextIter *search_end,
|
||||
EggRegex *regex,
|
||||
GtkTextIter *match_start,
|
||||
GtkTextIter *match_end,
|
||||
char **string,
|
||||
int *match_offset,
|
||||
int *match_len)
|
||||
{
|
||||
GtkTextIter slice_start, slice_end;
|
||||
GtkTextBuffer *buffer;
|
||||
|
@ -337,9 +337,9 @@ moo_text_search_forward (const GtkTextIter *start,
|
|||
if (!regex)
|
||||
return FALSE;
|
||||
|
||||
return moo_text_search_regex_forward (start, end, regex,
|
||||
match_start, match_end,
|
||||
NULL, NULL, NULL);
|
||||
return _moo_text_search_regex_forward (start, end, regex,
|
||||
match_start, match_end,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -394,9 +394,9 @@ moo_text_search_backward (const GtkTextIter *start,
|
|||
if (!regex)
|
||||
return FALSE;
|
||||
|
||||
return moo_text_search_regex_backward (start, end, regex,
|
||||
match_start, match_end,
|
||||
NULL, NULL, NULL);
|
||||
return _moo_text_search_regex_backward (start, end, regex,
|
||||
match_start, match_end,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -485,8 +485,8 @@ moo_text_replace_regex_all_real (GtkTextIter *start,
|
|||
GError *error = NULL;
|
||||
int match_len;
|
||||
|
||||
if (!moo_text_search_regex_forward (start, end, regex, &match_start, &match_end,
|
||||
&string, NULL, &match_len))
|
||||
if (!_moo_text_search_regex_forward (start, end, regex, &match_start, &match_end,
|
||||
&string, NULL, &match_len))
|
||||
goto out;
|
||||
|
||||
if (!match_len)
|
||||
|
@ -595,11 +595,11 @@ out:
|
|||
|
||||
|
||||
int
|
||||
moo_text_replace_regex_all (GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
EggRegex *regex,
|
||||
const char *replacement,
|
||||
gboolean replacement_literal)
|
||||
_moo_text_replace_regex_all (GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
EggRegex *regex,
|
||||
const char *replacement,
|
||||
gboolean replacement_literal)
|
||||
{
|
||||
g_return_val_if_fail (start != NULL, 0);
|
||||
g_return_val_if_fail (regex != NULL, 0);
|
||||
|
@ -611,13 +611,13 @@ moo_text_replace_regex_all (GtkTextIter *start,
|
|||
|
||||
|
||||
int
|
||||
moo_text_replace_regex_all_interactive (GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
EggRegex *regex,
|
||||
const char *replacement,
|
||||
gboolean replacement_literal,
|
||||
MooTextReplaceFunc func,
|
||||
gpointer func_data)
|
||||
_moo_text_replace_regex_all_interactive (GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
EggRegex *regex,
|
||||
const char *replacement,
|
||||
gboolean replacement_literal,
|
||||
MooTextReplaceFunc func,
|
||||
gpointer func_data)
|
||||
{
|
||||
g_return_val_if_fail (start != NULL, 0);
|
||||
g_return_val_if_fail (regex != NULL, 0);
|
||||
|
@ -660,8 +660,8 @@ moo_text_replace_all (GtkTextIter *start,
|
|||
if (!regex)
|
||||
return 0;
|
||||
|
||||
return moo_text_replace_regex_all (start, end, regex, replacement,
|
||||
flags & MOO_TEXT_SEARCH_REPL_LITERAL);
|
||||
return _moo_text_replace_regex_all (start, end, regex, replacement,
|
||||
flags & MOO_TEXT_SEARCH_REPL_LITERAL);
|
||||
}
|
||||
|
||||
buffer = gtk_text_iter_get_buffer (start);
|
||||
|
@ -704,13 +704,13 @@ out:
|
|||
|
||||
|
||||
int
|
||||
moo_text_replace_all_interactive (GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
const char *text,
|
||||
const char *replacement,
|
||||
MooTextSearchFlags flags,
|
||||
MooTextReplaceFunc func,
|
||||
gpointer func_data)
|
||||
_moo_text_replace_all_interactive (GtkTextIter *start,
|
||||
GtkTextIter *end,
|
||||
const char *text,
|
||||
const char *replacement,
|
||||
MooTextSearchFlags flags,
|
||||
MooTextReplaceFunc func,
|
||||
gpointer func_data)
|
||||
{
|
||||
int count = 0;
|
||||
GtkTextMark *end_mark;
|
||||
|
@ -738,9 +738,9 @@ moo_text_replace_all_interactive (GtkTextIter *start,
|
|||
if (!regex)
|
||||
return 0;
|
||||
|
||||
return moo_text_replace_regex_all_interactive (start, end, regex, replacement,
|
||||
flags & MOO_TEXT_SEARCH_REPL_LITERAL,
|
||||
func, func_data);
|
||||
return _moo_text_replace_regex_all_interactive (start, end, regex, replacement,
|
||||
flags & MOO_TEXT_SEARCH_REPL_LITERAL,
|
||||
func, func_data);
|
||||
}
|
||||
|
||||
buffer = gtk_text_iter_get_buffer (start);
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#define __MOO_TEXT_SEARCH_H__
|
||||
|
||||
#include <mooedit/mootextiter.h>
|
||||
#include <mooutils/eggregex.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -40,15 +39,6 @@ typedef enum {
|
|||
MOO_TEXT_REPLACE_ALL = 3
|
||||
} 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,
|
||||
const char *str,
|
||||
MooTextSearchFlags flags,
|
||||
|
@ -62,50 +52,12 @@ gboolean moo_text_search_backward (const GtkTextIter *start,
|
|||
GtkTextIter *match_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,
|
||||
GtkTextIter *end,
|
||||
const char *text,
|
||||
const char *replacement,
|
||||
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
|
||||
|
||||
|
|
|
@ -15,15 +15,23 @@ moopython_sources += \
|
|||
endif
|
||||
|
||||
noinst_LTLIBRARIES = libmoopython.la
|
||||
libmoopython_la_LIBADD = pygtk/libmoopygtk.la
|
||||
libmoopython_la_LIBADD =
|
||||
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$(top_builddir) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS) \
|
||||
$(PYTHON_INCLUDES) \
|
||||
$(PYGTK_CFLAGS)
|
||||
$(PYGTK_CFLAGS) \
|
||||
$(lib_define)
|
||||
|
||||
EXTRA_DIST += \
|
||||
codegen/__init__.py \
|
||||
|
|
|
@ -12,7 +12,11 @@
|
|||
*/
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#ifndef MOO_INSTALL_LIB
|
||||
#define NO_IMPORT_PYGOBJECT
|
||||
#endif
|
||||
|
||||
#include "pygobject.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
|
||||
_moo_python_plugin_init (void)
|
||||
{
|
||||
|
@ -361,7 +382,7 @@ _moo_python_plugin_init (void)
|
|||
if (!moo_python_api_init ())
|
||||
return FALSE;
|
||||
|
||||
if (!_moo_pygtk_init ())
|
||||
if (!init_moo_pygtk ())
|
||||
{
|
||||
PyErr_Print ();
|
||||
moo_python_init (MOO_PY_API_VERSION, NULL);
|
||||
|
@ -405,7 +426,10 @@ MOO_PLUGIN_INIT_FUNC_DECL
|
|||
void initmoo (void)
|
||||
{
|
||||
in_moo_module = TRUE;
|
||||
moo_python_api_init ();
|
||||
|
||||
if (!moo_python_running())
|
||||
moo_python_api_init ();
|
||||
|
||||
_moo_pygtk_init ();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -38,3 +38,8 @@ AM_CFLAGS = \
|
|||
-I$(top_builddir) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS)
|
||||
|
||||
if MOO_INSTALL_LIB
|
||||
mooscript_includedir = $(moo_includedir)/mooscript
|
||||
mooscript_include_HEADERS = $(mooscript_headers)
|
||||
endif
|
||||
|
|
|
@ -84,6 +84,11 @@ libmooterm_la_SOURCES += $(mooterm_win32_sources)
|
|||
EXTRA_DIST += $(mooterm_unix_sources)
|
||||
endif
|
||||
|
||||
if MOO_INSTALL_LIB
|
||||
mooterm_includedir = $(moo_includedir)/mooterm
|
||||
mooterm_include_HEADERS = $(mooterm_include_headers)
|
||||
endif
|
||||
|
||||
AM_CFLAGS = \
|
||||
-I$(top_builddir) \
|
||||
-I.. \
|
||||
|
|
|
@ -23,8 +23,8 @@ gtk_2_4_sources = \
|
|||
newgtk/gtkfontbutton.h
|
||||
|
||||
mooutils_include_headers = \
|
||||
eggregex.h \
|
||||
mooaccelbutton.h \
|
||||
mooaction.h \
|
||||
moobigpaned.h \
|
||||
mooclosure.h \
|
||||
moocmd.h \
|
||||
|
@ -57,13 +57,13 @@ mooutils_include_headers = \
|
|||
|
||||
mooutils_sources = \
|
||||
$(mooutils_include_headers) \
|
||||
eggregex.h \
|
||||
eggregex.c \
|
||||
mooaccel.h \
|
||||
mooaccel.c \
|
||||
mooaccelbutton-glade.h \
|
||||
mooaccelbutton.c \
|
||||
mooaccelprefs-glade.h \
|
||||
mooaction.h \
|
||||
mooaction.c \
|
||||
mooactionfactory.h \
|
||||
mooactionfactory.c \
|
||||
|
@ -215,3 +215,8 @@ AM_CFLAGS = \
|
|||
$(pcre_include) \
|
||||
$(MOO_CFLAGS) \
|
||||
$(MOO_DEBUG_CFLAGS)
|
||||
|
||||
if MOO_INSTALL_LIB
|
||||
mooutils_includedir = $(moo_includedir)/mooutils
|
||||
mooutils_include_HEADERS = $(mooutils_include_headers)
|
||||
endif
|
||||
|
|
|
@ -14,12 +14,7 @@
|
|||
|
||||
#include "medit-ui.h"
|
||||
#include "THANKS.h"
|
||||
#include <mooapp/mooapp.h>
|
||||
#include <mooedit/mooplugin.h>
|
||||
#include <mooutils/mooutils-fs.h>
|
||||
#include <mooutils/mooutils-misc.h>
|
||||
#include <mooutils/moostock.h>
|
||||
#include <moo-version.h>
|
||||
#include <moo.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -13,12 +13,7 @@
|
|||
|
||||
#include "medit-ui.h"
|
||||
#include "THANKS.h"
|
||||
#include <mooapp/mooapp.h>
|
||||
#include <mooedit/mooplugin.h>
|
||||
#include <mooutils/mooutils-fs.h>
|
||||
#include <mooutils/mooutils-misc.h>
|
||||
#include <mooutils/moostock.h>
|
||||
#include <moo-version.h>
|
||||
#include <moo.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
Loading…
Reference in New Issue