Backed out changeset e72e5fd13712

This commit is contained in:
Yevgen Muntyan 2017-05-25 12:49:14 -07:00
parent b8a85e221d
commit 8116a47e51
25 changed files with 39 additions and 298 deletions

View File

@ -47,8 +47,8 @@ SET(source_files
../moo/mooedit/mooeditaction-factory.c ../moo/mooedit/mooeditaction-factory.c
../moo/mooedit/mooeditaction-factory.h ../moo/mooedit/mooeditaction-factory.h
../moo/mooedit/mooeditaction.h ../moo/mooedit/mooeditaction.h
../moo/mooedit/native/mooeditbookmark.cpp ../moo/mooedit/mooeditbookmark.c
../moo/mooedit/native/mooeditbookmark.h ../moo/mooedit/mooeditbookmark.h
../moo/mooedit/mooedit.cpp ../moo/mooedit/mooedit.cpp
../moo/mooedit/mooeditconfig.c ../moo/mooedit/mooeditconfig.c
../moo/mooedit/mooeditconfig.h ../moo/mooedit/mooeditconfig.h

View File

@ -57,7 +57,6 @@ void _moo_edit_class_init_actions (MooEditClass *klass);
void _moo_edit_status_changed (MooEdit *edit); void _moo_edit_status_changed (MooEdit *edit);
#ifndef MOO_USE_SCI
gboolean _moo_edit_has_comments (MooEdit *edit, gboolean _moo_edit_has_comments (MooEdit *edit,
gboolean *single_line, gboolean *single_line,
gboolean *multi_line); gboolean *multi_line);
@ -72,15 +71,12 @@ void _moo_edit_line_mark_deleted (MooEdit *edit,
gboolean _moo_edit_line_mark_clicked (MooTextView *view, gboolean _moo_edit_line_mark_clicked (MooTextView *view,
int line); int line);
void _moo_edit_update_bookmarks_style (MooEdit *edit); void _moo_edit_update_bookmarks_style (MooEdit *edit);
#endif // !MOO_USE_SCI
/***********************************************************************/ /***********************************************************************/
/* Preferences /* Preferences
*/ */
enum { enum {
#ifndef MOO_USE_SCI
MOO_EDIT_SETTING_LANG, MOO_EDIT_SETTING_LANG,
#endif
MOO_EDIT_SETTING_INDENT, MOO_EDIT_SETTING_INDENT,
MOO_EDIT_SETTING_STRIP, MOO_EDIT_SETTING_STRIP,
MOO_EDIT_SETTING_ADD_NEWLINE, MOO_EDIT_SETTING_ADD_NEWLINE,

View File

@ -58,14 +58,12 @@ struct MooEditPrivate
MooEditState state; MooEditState state;
MooEditProgress *progress; MooEditProgress *progress;
#ifndef MOO_USE_SCI
/***********************************************************************/ /***********************************************************************/
/* Bookmarks /* Bookmarks
*/ */
bool enable_bookmarks; bool enable_bookmarks;
GSList *bookmarks; /* sorted by line number */ GSList *bookmarks; /* sorted by line number */
guint update_bookmarks_idle; guint update_bookmarks_idle;
#endif
/***********************************************************************/ /***********************************************************************/
/* Actions /* Actions

View File

@ -1,8 +1,6 @@
LIST(APPEND moo_edit_enum_headers mooedit/mooedit-enums.h) LIST(APPEND moo_edit_enum_headers mooedit/mooedit-enums.h)
SET(mooedit_gtksourceview_sources SET(mooedit_gtksourceview_sources
mooedit/native/mooeditbookmark.cpp
mooedit/native/mooeditbookmark.h
mooedit/native/moolang-private.h mooedit/native/moolang-private.h
mooedit/native/moolang.cpp mooedit/native/moolang.cpp
mooedit/native/moolang.h mooedit/native/moolang.h
@ -35,6 +33,8 @@ SET(mooedit_sources
mooedit/mooeditaction-factory.h mooedit/mooeditaction-factory.h
mooedit/mooeditaction.cpp mooedit/mooeditaction.cpp
mooedit/mooeditaction.h mooedit/mooeditaction.h
mooedit/mooeditbookmark.cpp
mooedit/mooeditbookmark.h
mooedit/mooeditconfig.cpp mooedit/mooeditconfig.cpp
mooedit/mooeditconfig.h mooedit/mooeditconfig.h
mooedit/mooeditdialogs.cpp mooedit/mooeditdialogs.cpp

View File

@ -38,9 +38,7 @@
#include "mooedit/mooeditaction-factory.h" #include "mooedit/mooeditaction-factory.h"
#include "mooedit/mooedit-private.h" #include "mooedit/mooedit-private.h"
#include "mooedit/mooeditview-impl.h" #include "mooedit/mooeditview-impl.h"
#ifndef MOO_USE_SCI #include "mooedit/mooeditbookmark.h"
#include "mooedit/native/mooeditbookmark.h"
#endif
#include "mooedit/mooeditdialogs.h" #include "mooedit/mooeditdialogs.h"
#include "mooedit/mooeditprefs.h" #include "mooedit/mooeditprefs.h"
#include "mooedit/mootextbuffer.h" #include "mooedit/mootextbuffer.h"
@ -97,9 +95,7 @@ static void changed_cb (GtkTextBuffer *buffer,
static void modified_changed_cb (GtkTextBuffer *buffer, static void modified_changed_cb (GtkTextBuffer *buffer,
MooEdit *edit); MooEdit *edit);
#ifndef MOO_USE_SCI
static MooLang *moo_edit_get_lang (MooEdit *doc); static MooLang *moo_edit_get_lang (MooEdit *doc);
#endif
static void moo_edit_apply_prefs (MooEdit *doc); static void moo_edit_apply_prefs (MooEdit *doc);
static void moo_edit_freeze_notify (MooEdit *doc); static void moo_edit_freeze_notify (MooEdit *doc);
@ -121,14 +117,10 @@ static guint signals[LAST_SIGNAL];
enum { enum {
PROP_0, PROP_0,
PROP_EDITOR, PROP_EDITOR,
#ifndef MOO_USE_SCI
PROP_ENABLE_BOOKMARKS, PROP_ENABLE_BOOKMARKS,
#endif
PROP_HAS_COMMENTS, PROP_HAS_COMMENTS,
PROP_LINE_END_TYPE, PROP_LINE_END_TYPE,
#ifndef MOO_USE_SCI
PROP_LANG, PROP_LANG,
#endif
PROP_ENCODING PROP_ENCODING
}; };
@ -154,11 +146,9 @@ moo_edit_class_init (MooEditClass *klass)
g_param_spec_object ("editor", "editor", "editor", g_param_spec_object ("editor", "editor", "editor",
MOO_TYPE_EDITOR, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); MOO_TYPE_EDITOR, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)));
#ifndef MOO_USE_SCI
g_object_class_install_property (gobject_class, PROP_ENABLE_BOOKMARKS, g_object_class_install_property (gobject_class, PROP_ENABLE_BOOKMARKS,
g_param_spec_boolean ("enable-bookmarks", "enable-bookmarks", "enable-bookmarks", g_param_spec_boolean ("enable-bookmarks", "enable-bookmarks", "enable-bookmarks",
TRUE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT))); TRUE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT)));
#endif
g_object_class_install_property (gobject_class, PROP_HAS_COMMENTS, g_object_class_install_property (gobject_class, PROP_HAS_COMMENTS,
g_param_spec_boolean ("has-comments", "has-comments", "has-comments", g_param_spec_boolean ("has-comments", "has-comments", "has-comments",
@ -173,11 +163,9 @@ moo_edit_class_init (MooEditClass *klass)
g_param_spec_string ("encoding", "encoding", "encoding", g_param_spec_string ("encoding", "encoding", "encoding",
NULL, (GParamFlags) G_PARAM_READWRITE)); NULL, (GParamFlags) G_PARAM_READWRITE));
#ifndef MOO_USE_SCI
g_object_class_install_property (gobject_class, PROP_LANG, g_object_class_install_property (gobject_class, PROP_LANG,
g_param_spec_object ("lang", "lang", "lang", g_param_spec_object ("lang", "lang", "lang",
MOO_TYPE_LANG, G_PARAM_READABLE)); MOO_TYPE_LANG, G_PARAM_READABLE));
#endif
signals[DOC_STATUS_CHANGED] = signals[DOC_STATUS_CHANGED] =
g_signal_new ("doc-status-changed", g_signal_new ("doc-status-changed",
@ -307,11 +295,9 @@ MooEditPrivate::MooEditPrivate()
, sync_timeout_id(0) , sync_timeout_id(0)
, state(MOO_EDIT_STATE_NORMAL) , state(MOO_EDIT_STATE_NORMAL)
, progress(nullptr) , progress(nullptr)
#ifndef MOO_USE_SCI
, enable_bookmarks(false) , enable_bookmarks(false)
, bookmarks(nullptr) , bookmarks(nullptr)
, update_bookmarks_idle(0) , update_bookmarks_idle(0)
#endif
, actions(nullptr) , actions(nullptr)
{ {
} }
@ -374,14 +360,12 @@ moo_edit_constructor (GType type,
_moo_edit_set_file (doc, NULL, NULL); _moo_edit_set_file (doc, NULL, NULL);
#ifndef MOO_USE_SCI
g_signal_connect_swapped (doc->priv->buffer, "line-mark-moved", g_signal_connect_swapped (doc->priv->buffer, "line-mark-moved",
G_CALLBACK (_moo_edit_line_mark_moved), G_CALLBACK (_moo_edit_line_mark_moved),
doc); doc);
g_signal_connect_swapped (doc->priv->buffer, "line-mark-deleted", g_signal_connect_swapped (doc->priv->buffer, "line-mark-deleted",
G_CALLBACK (_moo_edit_line_mark_deleted), G_CALLBACK (_moo_edit_line_mark_deleted),
doc); doc);
#endif
return object; return object;
} }
@ -446,7 +430,6 @@ _moo_edit_closed (MooEdit *doc)
doc->priv->sync_timeout_id = 0; doc->priv->sync_timeout_id = 0;
} }
#ifndef MOO_USE_SCI
if (doc->priv->update_bookmarks_idle) if (doc->priv->update_bookmarks_idle)
{ {
g_source_remove (doc->priv->update_bookmarks_idle); g_source_remove (doc->priv->update_bookmarks_idle);
@ -454,7 +437,6 @@ _moo_edit_closed (MooEdit *doc)
} }
_moo_edit_delete_bookmarks (doc, TRUE); _moo_edit_delete_bookmarks (doc, TRUE);
#endif
if (doc->priv->actions) if (doc->priv->actions)
{ {
@ -767,11 +749,9 @@ moo_edit_set_property (GObject *object,
edit->priv->editor = (MooEditor*) g_value_get_object (value); edit->priv->editor = (MooEditor*) g_value_get_object (value);
break; break;
#ifndef MOO_USE_SCI
case PROP_ENABLE_BOOKMARKS: case PROP_ENABLE_BOOKMARKS:
moo_edit_set_enable_bookmarks (edit, g_value_get_boolean (value)); moo_edit_set_enable_bookmarks (edit, g_value_get_boolean (value));
break; break;
#endif
case PROP_ENCODING: case PROP_ENCODING:
moo_edit_set_encoding (edit, g_value_get_string (value)); moo_edit_set_encoding (edit, g_value_get_string (value));
@ -802,7 +782,6 @@ moo_edit_get_property (GObject *object,
g_value_set_object (value, edit->priv->editor); g_value_set_object (value, edit->priv->editor);
break; break;
#ifndef MOO_USE_SCI
case PROP_ENABLE_BOOKMARKS: case PROP_ENABLE_BOOKMARKS:
g_value_set_boolean (value, edit->priv->enable_bookmarks); g_value_set_boolean (value, edit->priv->enable_bookmarks);
break; break;
@ -810,17 +789,14 @@ moo_edit_get_property (GObject *object,
case PROP_HAS_COMMENTS: case PROP_HAS_COMMENTS:
g_value_set_boolean (value, _moo_edit_has_comments (edit, NULL, NULL)); g_value_set_boolean (value, _moo_edit_has_comments (edit, NULL, NULL));
break; break;
#endif
case PROP_ENCODING: case PROP_ENCODING:
g_value_set_string (value, edit->priv->encoding); g_value_set_string (value, edit->priv->encoding);
break; break;
#ifndef MOO_USE_SCI
case PROP_LANG: case PROP_LANG:
g_value_set_object (value, moo_edit_get_lang (edit)); g_value_set_object (value, moo_edit_get_lang (edit));
break; break;
#endif
case PROP_LINE_END_TYPE: case PROP_LINE_END_TYPE:
g_value_set_enum (value, edit->priv->line_end_type); g_value_set_enum (value, edit->priv->line_end_type);
@ -1141,7 +1117,6 @@ set_emacs_var (MooEdit *edit,
} }
} }
#ifndef MOO_USE_SCI
static void static void
parse_emacs_mode_string (MooEdit *edit, parse_emacs_mode_string (MooEdit *edit,
char *string) char *string)
@ -1157,7 +1132,7 @@ parse_emacs_mode_string (MooEdit *edit,
else else
parse_mode_string (edit, string, ":", set_emacs_var); parse_mode_string (edit, string, ":", set_emacs_var);
} }
#endif
static void static void
parse_moo_mode_string (MooEdit *edit, parse_moo_mode_string (MooEdit *edit,
@ -1184,7 +1159,6 @@ try_mode_string (MooEdit *edit,
return; return;
} }
#ifndef MOO_USE_SCI
if ((start = strstr (string, EMACS_MODE_STRING))) if ((start = strstr (string, EMACS_MODE_STRING)))
{ {
start += strlen (EMACS_MODE_STRING); start += strlen (EMACS_MODE_STRING);
@ -1196,7 +1170,6 @@ try_mode_string (MooEdit *edit,
return; return;
} }
} }
#endif
if ((start = strstr (string, MOO_MODE_STRING))) if ((start = strstr (string, MOO_MODE_STRING)))
{ {
@ -1268,7 +1241,6 @@ update_config_from_mode_lines (MooEdit *edit)
} }
#ifndef MOO_USE_SCI
static MooLang * static MooLang *
moo_edit_get_lang (MooEdit *doc) moo_edit_get_lang (MooEdit *doc)
{ {
@ -1277,12 +1249,12 @@ moo_edit_get_lang (MooEdit *doc)
return moo_text_buffer_get_lang (MOO_TEXT_BUFFER (doc->priv->buffer)); return moo_text_buffer_get_lang (MOO_TEXT_BUFFER (doc->priv->buffer));
} }
//** /**
/* moo_edit_get_lang_id: * moo_edit_get_lang_id:
/* *
/* Returns: (type utf8): id of language currently used in the document. If no language * Returns: (type utf8): id of language currently used in the document. If no language
/* is used, then string "none" is returned. * is used, then string "none" is returned.
/*/ */
char * char *
moo_edit_get_lang_id (MooEdit *doc) moo_edit_get_lang_id (MooEdit *doc)
{ {
@ -1302,7 +1274,6 @@ moo_edit_get_lang_id (MooEdit *doc)
return g_strdup (_moo_lang_id (lang)); return g_strdup (_moo_lang_id (lang));
} }
#endif // !MOO_USE_SCI
static gboolean static gboolean
moo_edit_apply_config_all_in_idle (void) moo_edit_apply_config_all_in_idle (void)
@ -1326,7 +1297,6 @@ _moo_edit_queue_recheck_config_all (void)
} }
#ifndef MOO_USE_SCI
static void static void
update_lang_config_from_lang_globs (MooEdit *doc) update_lang_config_from_lang_globs (MooEdit *doc)
{ {
@ -1342,7 +1312,6 @@ update_lang_config_from_lang_globs (MooEdit *doc)
moo_edit_config_set (doc->config, MOO_EDIT_CONFIG_SOURCE_FILENAME, moo_edit_config_set (doc->config, MOO_EDIT_CONFIG_SOURCE_FILENAME,
"lang", lang_id, (char*) NULL); "lang", lang_id, (char*) NULL);
} }
#endif
static void static void
update_config_from_filter_settings (MooEdit *doc) update_config_from_filter_settings (MooEdit *doc)
@ -1358,7 +1327,6 @@ update_config_from_filter_settings (MooEdit *doc)
g_free (filter_config); g_free (filter_config);
} }
#ifndef MOO_USE_SCI
static void static void
update_config_from_lang (MooEdit *doc) update_config_from_lang (MooEdit *doc)
{ {
@ -1366,13 +1334,11 @@ update_config_from_lang (MooEdit *doc)
_moo_lang_mgr_update_config (moo_lang_mgr_default (), doc->config, lang_id); _moo_lang_mgr_update_config (moo_lang_mgr_default (), doc->config, lang_id);
g_free (lang_id); g_free (lang_id);
} }
#endif
static void static void
moo_edit_apply_config (MooEdit *doc) moo_edit_apply_config (MooEdit *doc)
{ {
guint i; guint i;
#ifndef MOO_USE_SCI
const char *lang_id = moo_edit_config_get_string (doc->config, "lang"); const char *lang_id = moo_edit_config_get_string (doc->config, "lang");
MooLangMgr *mgr = moo_lang_mgr_default (); MooLangMgr *mgr = moo_lang_mgr_default ();
MooLang *lang = lang_id ? _moo_lang_mgr_find_lang (mgr, lang_id) : NULL; MooLang *lang = lang_id ? _moo_lang_mgr_find_lang (mgr, lang_id) : NULL;
@ -1381,7 +1347,6 @@ moo_edit_apply_config (MooEdit *doc)
g_object_notify (G_OBJECT (doc), "has-comments"); g_object_notify (G_OBJECT (doc), "has-comments");
g_object_notify (G_OBJECT (doc), "lang"); g_object_notify (G_OBJECT (doc), "lang");
#endif
for (i = 0; i < doc->priv->views->n_elms; ++i) for (i = 0; i < doc->priv->views->n_elms; ++i)
_moo_edit_view_apply_config (doc->priv->views->elms[i]); _moo_edit_view_apply_config (doc->priv->views->elms[i]);
@ -1407,10 +1372,8 @@ moo_edit_recheck_config (MooEdit *doc)
// First global settings // First global settings
moo_edit_apply_prefs (doc); moo_edit_apply_prefs (doc);
#ifndef MOO_USE_SCI
// then language from globs // then language from globs
update_lang_config_from_lang_globs (doc); update_lang_config_from_lang_globs (doc);
#endif
// then settings from mode lines, these may change lang // then settings from mode lines, these may change lang
update_config_from_mode_lines (doc); update_config_from_mode_lines (doc);
@ -1418,10 +1381,8 @@ moo_edit_recheck_config (MooEdit *doc)
// then filter settings, these also may change lang // then filter settings, these also may change lang
update_config_from_filter_settings (doc); update_config_from_filter_settings (doc);
#ifndef MOO_USE_SCI
// update config for lang // update config for lang
update_config_from_lang (doc); update_config_from_lang (doc);
#endif
// finally apply config // finally apply config
moo_edit_apply_config (doc); moo_edit_apply_config (doc);
@ -1650,8 +1611,6 @@ _moo_edit_set_state (MooEdit *doc,
} }
#ifndef MOO_USE_SCI
/*****************************************************************************/ /*****************************************************************************/
/* Comment/uncomment /* Comment/uncomment
*/ */
@ -1957,8 +1916,6 @@ moo_edit_uncomment_selection (MooEdit *edit)
gtk_text_buffer_end_user_action (buffer); gtk_text_buffer_end_user_action (buffer);
} }
#endif // !MOO_USE_SCI
void void
_moo_edit_ensure_newline (MooEdit *edit) _moo_edit_ensure_newline (MooEdit *edit)

View File

@ -13,7 +13,11 @@
* License along with medit. If not, see <http://www.gnu.org/licenses/>. * License along with medit. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "mooedit/native/mooeditbookmark.h" /**
* class:MooEditBookmark: (parent MooLineMark) (moo.private 1)
**/
#include "mooedit/mooeditbookmark.h"
#include "mooedit/mooedit-private.h" #include "mooedit/mooedit-private.h"
#include "mooedit/mootextbuffer.h" #include "mooedit/mootextbuffer.h"
#include "mooutils/moostock.h" #include "mooutils/moostock.h"

View File

@ -35,9 +35,7 @@ MOO_DEBUG_INIT(filters, FALSE)
#define PROP_CONFIG "config" #define PROP_CONFIG "config"
typedef enum { typedef enum {
#ifndef MOO_USE_SCI
MOO_EDIT_FILTER_LANGS, MOO_EDIT_FILTER_LANGS,
#endif
MOO_EDIT_FILTER_GLOBS, MOO_EDIT_FILTER_GLOBS,
MOO_EDIT_FILTER_REGEX, MOO_EDIT_FILTER_REGEX,
MOO_EDIT_FILTER_INVALID MOO_EDIT_FILTER_INVALID
@ -46,9 +44,7 @@ typedef enum {
struct MooEditFilter { struct MooEditFilter {
MooEditFilterType type; MooEditFilterType type;
union { union {
#ifndef MOO_USE_SCI
GSList *langs; GSList *langs;
#endif
GSList *globs; GSList *globs;
GRegex *regex; GRegex *regex;
char *string; char *string;
@ -70,10 +66,8 @@ static FilterSettingsStore *settings_store;
static char *filter_settings_store_get_setting (FilterSettingsStore *store, static char *filter_settings_store_get_setting (FilterSettingsStore *store,
MooEdit *doc); MooEdit *doc);
#ifndef MOO_USE_SCI
static MooEditFilter *moo_edit_filter_new_langs (const char *string, static MooEditFilter *moo_edit_filter_new_langs (const char *string,
GError **error); GError **error);
#endif // !MOO_USE_SCI
static MooEditFilter *moo_edit_filter_new_regex (const char *string, static MooEditFilter *moo_edit_filter_new_regex (const char *string,
GError **error); GError **error);
static MooEditFilter *moo_edit_filter_new_globs (const char *string, static MooEditFilter *moo_edit_filter_new_globs (const char *string,
@ -84,6 +78,7 @@ moo_edit_filter_get_string (MooEditFilter *filter,
MooEditFilterType default_type) MooEditFilterType default_type)
{ {
GString *str; GString *str;
GSList *l;
g_return_val_if_fail (filter != NULL, NULL); g_return_val_if_fail (filter != NULL, NULL);
@ -93,11 +88,9 @@ moo_edit_filter_get_string (MooEditFilter *filter,
{ {
switch (filter->type) switch (filter->type)
{ {
#ifndef MOO_USE_SCI
case MOO_EDIT_FILTER_LANGS: case MOO_EDIT_FILTER_LANGS:
g_string_append (str, "langs:"); g_string_append (str, "langs:");
break; break;
#endif
case MOO_EDIT_FILTER_GLOBS: case MOO_EDIT_FILTER_GLOBS:
g_string_append (str, "globs:"); g_string_append (str, "globs:");
break; break;
@ -111,17 +104,15 @@ moo_edit_filter_get_string (MooEditFilter *filter,
switch (filter->type) switch (filter->type)
{ {
#ifndef MOO_USE_SCI
case MOO_EDIT_FILTER_LANGS: case MOO_EDIT_FILTER_LANGS:
case MOO_EDIT_FILTER_GLOBS: case MOO_EDIT_FILTER_GLOBS:
for (GSList* l = filter->u.langs; l != NULL; l = l->next) for (l = filter->u.langs; l != NULL; l = l->next)
{ {
if (l != filter->u.langs) if (l != filter->u.langs)
g_string_append (str, ";"); g_string_append (str, ";");
g_string_append (str, (const char*) l->data); g_string_append (str, (const char*) l->data);
} }
break; break;
#endif
case MOO_EDIT_FILTER_REGEX: case MOO_EDIT_FILTER_REGEX:
g_string_append (str, g_regex_get_pattern (filter->u.regex)); g_string_append (str, g_regex_get_pattern (filter->u.regex));
break; break;
@ -140,10 +131,8 @@ _moo_edit_filter_new_full (const char *string,
{ {
g_return_val_if_fail (string && string[0], NULL); g_return_val_if_fail (string && string[0], NULL);
#ifndef MOO_USE_SCI
if (!strncmp (string, "langs:", strlen ("langs:"))) if (!strncmp (string, "langs:", strlen ("langs:")))
return moo_edit_filter_new_langs (string + strlen ("langs:"), error); return moo_edit_filter_new_langs (string + strlen ("langs:"), error);
#endif
if (!strncmp (string, "globs:", strlen ("globs:"))) if (!strncmp (string, "globs:", strlen ("globs:")))
return moo_edit_filter_new_globs (string + strlen ("globs:"), error); return moo_edit_filter_new_globs (string + strlen ("globs:"), error);
if (!strncmp (string, "regex:", strlen ("regex:"))) if (!strncmp (string, "regex:", strlen ("regex:")))
@ -180,8 +169,6 @@ _moo_edit_filter_new (const char *string,
return filter; return filter;
} }
#ifndef MOO_USE_SCI
static GSList * static GSList *
_moo_edit_parse_langs (const char *string) _moo_edit_parse_langs (const char *string)
{ {
@ -223,8 +210,6 @@ moo_edit_filter_new_langs (const char *string,
return filt; return filt;
} }
#endif // !MOO_USE_SCI
static MooEditFilter * static MooEditFilter *
moo_edit_regex_new_invalid (const char *string, moo_edit_regex_new_invalid (const char *string,
GError **error) GError **error)
@ -320,13 +305,11 @@ _moo_edit_filter_free (MooEditFilter *filter)
{ {
switch (filter->type) switch (filter->type)
{ {
#ifndef MOO_USE_SCI
case MOO_EDIT_FILTER_GLOBS: case MOO_EDIT_FILTER_GLOBS:
case MOO_EDIT_FILTER_LANGS: case MOO_EDIT_FILTER_LANGS:
g_slist_foreach (filter->u.langs, (GFunc) g_free, NULL); g_slist_foreach (filter->u.langs, (GFunc) g_free, NULL);
g_slist_free (filter->u.langs); g_slist_free (filter->u.langs);
break; break;
#endif
case MOO_EDIT_FILTER_REGEX: case MOO_EDIT_FILTER_REGEX:
if (filter->u.regex) if (filter->u.regex)
g_regex_unref (filter->u.regex); g_regex_unref (filter->u.regex);
@ -363,8 +346,6 @@ moo_edit_filter_check_globs (GSList *globs,
return FALSE; return FALSE;
} }
#ifndef MOO_USE_SCI
static gboolean static gboolean
moo_edit_filter_check_langs (GSList *langs, moo_edit_filter_check_langs (GSList *langs,
MooEdit *doc) MooEdit *doc)
@ -386,8 +367,6 @@ moo_edit_filter_check_langs (GSList *langs,
return FALSE; return FALSE;
} }
#endif // !MOO_USE_SCI
static gboolean static gboolean
moo_edit_filter_check_regex (GRegex *regex, moo_edit_filter_check_regex (GRegex *regex,
MooEdit *doc) MooEdit *doc)
@ -408,10 +387,8 @@ _moo_edit_filter_match (MooEditFilter *filter,
{ {
case MOO_EDIT_FILTER_GLOBS: case MOO_EDIT_FILTER_GLOBS:
return moo_edit_filter_check_globs (filter->u.globs, doc); return moo_edit_filter_check_globs (filter->u.globs, doc);
#ifndef MOO_USE_SCI
case MOO_EDIT_FILTER_LANGS: case MOO_EDIT_FILTER_LANGS:
return moo_edit_filter_check_langs (filter->u.langs, doc); return moo_edit_filter_check_langs (filter->u.langs, doc);
#endif
case MOO_EDIT_FILTER_REGEX: case MOO_EDIT_FILTER_REGEX:
return moo_edit_filter_check_regex (filter->u.regex, doc); return moo_edit_filter_check_regex (filter->u.regex, doc);
case MOO_EDIT_FILTER_INVALID: case MOO_EDIT_FILTER_INVALID:

View File

@ -44,9 +44,7 @@ struct MooEditorPrivate {
GType window_type; GType window_type;
GType doc_type; GType doc_type;
#ifndef MOO_USE_SCI
MooLangMgr *lang_mgr; MooLangMgr *lang_mgr;
#endif
}; };
G_END_DECLS G_END_DECLS

View File

@ -366,12 +366,10 @@ moo_editor_constructor (GType type,
moo_ui_xml_add_ui_from_string (editor->priv->doc_ui_xml, moo_ui_xml_add_ui_from_string (editor->priv->doc_ui_xml,
mooedit_ui_xml, -1); mooedit_ui_xml, -1);
#ifndef MOO_USE_SCI
editor->priv->lang_mgr = g::object_ref (moo_lang_mgr_default ()); editor->priv->lang_mgr = g::object_ref (moo_lang_mgr_default ());
g_signal_connect_swapped (editor->priv->lang_mgr, "loaded", g_signal_connect_swapped (editor->priv->lang_mgr, "loaded",
G_CALLBACK (_moo_editor_apply_prefs), G_CALLBACK (_moo_editor_apply_prefs),
editor); editor);
#endif
editor->priv->history = NULL; editor->priv->history = NULL;
if (!is_embedded (editor)) if (!is_embedded (editor))
@ -479,9 +477,7 @@ moo_editor_finalize (GObject *object)
g_object_unref (editor->priv->ui_xml); g_object_unref (editor->priv->ui_xml);
if (editor->priv->history) if (editor->priv->history)
g_object_unref (editor->priv->history); g_object_unref (editor->priv->history);
#ifndef MOO_USE_SCI
g_object_unref (editor->priv->lang_mgr); g_object_unref (editor->priv->lang_mgr);
#endif
g_object_unref (editor->priv->doc_ui_xml); g_object_unref (editor->priv->doc_ui_xml);
if (editor->priv->file_watch) if (editor->priv->file_watch)
@ -2984,6 +2980,7 @@ void
_moo_editor_apply_prefs (MooEditor *editor) _moo_editor_apply_prefs (MooEditor *editor)
{ {
gboolean backups; gboolean backups;
const char *color_scheme;
_moo_edit_window_update_title (); _moo_edit_window_update_title ();
_moo_edit_window_set_use_tabs (); _moo_edit_window_set_use_tabs ();
@ -2991,12 +2988,10 @@ _moo_editor_apply_prefs (MooEditor *editor)
_moo_edit_update_global_config (); _moo_edit_update_global_config ();
_moo_edit_queue_recheck_config_all (); _moo_edit_queue_recheck_config_all ();
#ifndef MOO_USE_SCI color_scheme = moo_prefs_get_string (moo_edit_setting (MOO_EDIT_PREFS_COLOR_SCHEME));
const char *color_scheme = moo_prefs_get_string (moo_edit_setting (MOO_EDIT_PREFS_COLOR_SCHEME));
if (color_scheme) if (color_scheme)
_moo_lang_mgr_set_active_scheme (editor->priv->lang_mgr, color_scheme); _moo_lang_mgr_set_active_scheme (editor->priv->lang_mgr, color_scheme);
#endif
backups = moo_prefs_get_bool (moo_edit_setting (MOO_EDIT_PREFS_MAKE_BACKUPS)); backups = moo_prefs_get_bool (moo_edit_setting (MOO_EDIT_PREFS_MAKE_BACKUPS));

View File

@ -79,12 +79,10 @@ _moo_edit_init_config (void)
_moo_edit_init_prefs (); _moo_edit_init_prefs ();
#ifndef MOO_USE_SCI
_moo_edit_settings[MOO_EDIT_SETTING_LANG] = _moo_edit_settings[MOO_EDIT_SETTING_LANG] =
moo_edit_config_install_setting (g_param_spec_string ("lang", "lang", "lang", moo_edit_config_install_setting (g_param_spec_string ("lang", "lang", "lang",
NULL, NULL,
(GParamFlags) G_PARAM_READWRITE)); (GParamFlags) G_PARAM_READWRITE));
#endif
_moo_edit_settings[MOO_EDIT_SETTING_INDENT] = _moo_edit_settings[MOO_EDIT_SETTING_INDENT] =
moo_edit_config_install_setting (g_param_spec_string ("indent", "indent", "indent", moo_edit_config_install_setting (g_param_spec_string ("indent", "indent", "indent",
NULL, NULL,
@ -222,20 +220,16 @@ _moo_edit_update_global_config (void)
void void
_moo_edit_view_apply_prefs (MooEditView *view) _moo_edit_view_apply_prefs (MooEditView *view)
{ {
#ifndef MOO_USE_SCI
MooLangMgr *mgr; MooLangMgr *mgr;
MooTextStyleScheme *scheme; MooTextStyleScheme *scheme;
#endif
MooDrawWsFlags ws_flags = MOO_DRAW_WS_NONE; MooDrawWsFlags ws_flags = MOO_DRAW_WS_NONE;
g_return_if_fail (MOO_IS_EDIT_VIEW (view)); g_return_if_fail (MOO_IS_EDIT_VIEW (view));
g_object_freeze_notify (G_OBJECT (view)); g_object_freeze_notify (G_OBJECT (view));
#ifndef MOO_USE_SCI
mgr = moo_lang_mgr_default (); mgr = moo_lang_mgr_default ();
scheme = moo_lang_mgr_get_active_scheme (mgr); scheme = moo_lang_mgr_get_active_scheme (mgr);
#endif
if (get_bool (MOO_EDIT_PREFS_SHOW_TABS)) if (get_bool (MOO_EDIT_PREFS_SHOW_TABS))
ws_flags |= MOO_DRAW_WS_TABS; ws_flags |= MOO_DRAW_WS_TABS;
@ -246,12 +240,10 @@ _moo_edit_view_apply_prefs (MooEditView *view)
g_object_set (view, g_object_set (view,
"smart-home-end", get_bool (MOO_EDIT_PREFS_SMART_HOME_END), "smart-home-end", get_bool (MOO_EDIT_PREFS_SMART_HOME_END),
#ifndef MOO_USE_SCI
"enable-highlight", get_bool (MOO_EDIT_PREFS_ENABLE_HIGHLIGHTING), "enable-highlight", get_bool (MOO_EDIT_PREFS_ENABLE_HIGHLIGHTING),
"highlight-matching-brackets", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_MATCHING), "highlight-matching-brackets", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_MATCHING),
"highlight-mismatching-brackets", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_MISMATCHING), "highlight-mismatching-brackets", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_MISMATCHING),
"highlight-current-line", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_CURRENT_LINE), "highlight-current-line", get_bool (MOO_EDIT_PREFS_HIGHLIGHT_CURRENT_LINE),
#endif
"draw-right-margin", get_bool (MOO_EDIT_PREFS_DRAW_RIGHT_MARGIN), "draw-right-margin", get_bool (MOO_EDIT_PREFS_DRAW_RIGHT_MARGIN),
"right-margin-offset", get_int (MOO_EDIT_PREFS_RIGHT_MARGIN_OFFSET), "right-margin-offset", get_int (MOO_EDIT_PREFS_RIGHT_MARGIN_OFFSET),
"quick-search-flags", get_int (MOO_EDIT_PREFS_QUICK_SEARCH_FLAGS), "quick-search-flags", get_int (MOO_EDIT_PREFS_QUICK_SEARCH_FLAGS),
@ -267,10 +259,8 @@ _moo_edit_view_apply_prefs (MooEditView *view)
_moo_text_view_set_line_numbers_font (MOO_TEXT_VIEW (view), _moo_text_view_set_line_numbers_font (MOO_TEXT_VIEW (view),
get_string (MOO_EDIT_PREFS_LINE_NUMBERS_FONT)); get_string (MOO_EDIT_PREFS_LINE_NUMBERS_FONT));
#ifndef MOO_USE_SCI
if (scheme) if (scheme)
moo_text_view_set_style_scheme (MOO_TEXT_VIEW (view), scheme); moo_text_view_set_style_scheme (MOO_TEXT_VIEW (view), scheme);
#endif
g_object_thaw_notify (G_OBJECT (view)); g_object_thaw_notify (G_OBJECT (view));
} }

View File

@ -46,7 +46,6 @@ typedef struct PrefsPage PrefsPage;
static void prefs_page_apply_lang_prefs (MooPrefsPage *page); static void prefs_page_apply_lang_prefs (MooPrefsPage *page);
static void apply_filter_settings (PrefsFiltersXml *gxml); static void apply_filter_settings (PrefsFiltersXml *gxml);
#ifndef MOO_USE_SCI
static void scheme_combo_init (GtkComboBox *combo); static void scheme_combo_init (GtkComboBox *combo);
static void scheme_combo_data_func (GtkCellLayout *layout, static void scheme_combo_data_func (GtkCellLayout *layout,
GtkCellRenderer *cell, GtkCellRenderer *cell,
@ -58,21 +57,16 @@ static void scheme_combo_set_scheme (GtkComboBox *combo,
static void lang_combo_init (GtkComboBox *combo, static void lang_combo_init (GtkComboBox *combo,
MooPrefsPage *page, MooPrefsPage *page,
PrefsLangsXml *gxml); PrefsLangsXml *gxml);
#endif
static void filter_treeview_init (PrefsFiltersXml *gxml); static void filter_treeview_init (PrefsFiltersXml *gxml);
#ifndef MOO_USE_SCI
static GtkTreeModel *create_lang_model (void); static GtkTreeModel *create_lang_model (void);
#endif
static void save_encoding_combo_init (PrefsFileXml *gxml); static void save_encoding_combo_init (PrefsFileXml *gxml);
static void save_encoding_combo_apply (PrefsFileXml *gxml); static void save_encoding_combo_apply (PrefsFileXml *gxml);
#ifndef MOO_USE_SCI
static GtkTreeModel *page_get_lang_model (MooPrefsPage *page); static GtkTreeModel *page_get_lang_model (MooPrefsPage *page);
static MooTextStyleScheme *page_get_scheme (PrefsGeneralXml *gxml); static MooTextStyleScheme *page_get_scheme (PrefsGeneralXml *gxml);
#endif
static GtkWidget * static GtkWidget *
@ -146,26 +140,21 @@ page_general_init (MooPrefsPage *page)
gxml->indent_width); gxml->indent_width);
{ {
#ifndef MOO_USE_SCI
MooTextStyleScheme *scheme; MooTextStyleScheme *scheme;
#endif
g_object_set (gxml->fontbutton, "monospace", TRUE, NULL); g_object_set (gxml->fontbutton, "monospace", TRUE, NULL);
#ifndef MOO_USE_SCI
scheme = moo_lang_mgr_get_active_scheme (moo_lang_mgr_default ()); scheme = moo_lang_mgr_get_active_scheme (moo_lang_mgr_default ());
g_return_if_fail (scheme != NULL); g_return_if_fail (scheme != NULL);
scheme_combo_init (gxml->color_scheme_combo); scheme_combo_init (gxml->color_scheme_combo);
scheme_combo_set_scheme (gxml->color_scheme_combo, scheme); scheme_combo_set_scheme (gxml->color_scheme_combo, scheme);
#endif // !MOO_USE_SCI
} }
} }
static void static void
page_general_apply (MooPrefsPage *page) page_general_apply (MooPrefsPage *page)
{ {
#ifndef MOO_USE_SCI
PrefsGeneralXml *gxml = (PrefsGeneralXml*) g_object_get_data (G_OBJECT (page), "moo-edit-prefs-page-xml"); PrefsGeneralXml *gxml = (PrefsGeneralXml*) g_object_get_data (G_OBJECT (page), "moo-edit-prefs-page-xml");
MooTextStyleScheme *scheme = page_get_scheme (gxml); MooTextStyleScheme *scheme = page_get_scheme (gxml);
@ -175,7 +164,6 @@ page_general_apply (MooPrefsPage *page)
moo_text_style_scheme_get_id (scheme)); moo_text_style_scheme_get_id (scheme));
g_object_unref (scheme); g_object_unref (scheme);
} }
#endif // !MOO_USE_SCI
} }
GtkWidget * GtkWidget *
@ -334,8 +322,6 @@ moo_edit_prefs_page_new_3 (MooEditor *editor)
} }
#ifndef MOO_USE_SCI
static void static void
page_langs_init_ui (MooPrefsPage *page) page_langs_init_ui (MooPrefsPage *page)
{ {
@ -825,8 +811,6 @@ prefs_page_apply_lang_prefs (MooPrefsPage *page)
_moo_edit_queue_recheck_config_all (); _moo_edit_queue_recheck_config_all ();
} }
#endif // !MOO_USE_SCI
/*********************************************************************/ /*********************************************************************/
/* Filters /* Filters

View File

@ -7,9 +7,7 @@
#include "mooedit/mooeditwindow-impl.h" #include "mooedit/mooeditwindow-impl.h"
#include "mooedit/mooedittab-impl.h" #include "mooedit/mooedittab-impl.h"
#include "mooedit/mooeditor-impl.h" #include "mooedit/mooeditor-impl.h"
#ifndef MOO_USE_SCI #include "mooedit/mooeditbookmark.h"
#include "mooedit/native/mooeditbookmark.h"
#endif
#include "mooedit/mooeditprefs.h" #include "mooedit/mooeditprefs.h"
#include "mooutils/mooutils.h" #include "mooutils/mooutils.h"
#include "mooutils/moocompat.h" #include "mooutils/moocompat.h"
@ -31,12 +29,10 @@ static gboolean moo_edit_view_drag_drop (GtkWidget *widget,
gint x, gint x,
gint y, gint y,
guint time); guint time);
#ifndef MOO_USE_SCI
static void moo_edit_view_apply_style_scheme (MooTextView *view, static void moo_edit_view_apply_style_scheme (MooTextView *view,
MooTextStyleScheme *scheme); MooTextStyleScheme *scheme);
static gboolean moo_edit_view_line_mark_clicked (MooTextView *view, static gboolean moo_edit_view_line_mark_clicked (MooTextView *view,
int line); int line);
#endif
G_DEFINE_TYPE (MooEditView, moo_edit_view, MOO_TYPE_TEXT_VIEW) G_DEFINE_TYPE (MooEditView, moo_edit_view, MOO_TYPE_TEXT_VIEW)
@ -45,6 +41,7 @@ moo_edit_view_class_init (MooEditViewClass *klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
MooTextViewClass *textview_class = MOO_TEXT_VIEW_CLASS (klass);
gobject_class->dispose = moo_edit_view_dispose; gobject_class->dispose = moo_edit_view_dispose;
@ -53,11 +50,8 @@ moo_edit_view_class_init (MooEditViewClass *klass)
widget_class->drag_drop = moo_edit_view_drag_drop; widget_class->drag_drop = moo_edit_view_drag_drop;
widget_class->focus_in_event = moo_edit_view_focus_in; widget_class->focus_in_event = moo_edit_view_focus_in;
#ifndef MOO_USE_SCI
MooTextViewClass *textview_class = MOO_TEXT_VIEW_CLASS (klass);
textview_class->line_mark_clicked = moo_edit_view_line_mark_clicked; textview_class->line_mark_clicked = moo_edit_view_line_mark_clicked;
textview_class->apply_style_scheme = moo_edit_view_apply_style_scheme; textview_class->apply_style_scheme = moo_edit_view_apply_style_scheme;
#endif
g_type_class_add_private (klass, sizeof (MooEditViewPrivate)); g_type_class_add_private (klass, sizeof (MooEditViewPrivate));
} }
@ -123,8 +117,6 @@ _moo_edit_view_new (MooEdit *doc)
} }
#ifndef MOO_USE_SCI
static gboolean static gboolean
moo_edit_view_line_mark_clicked (MooTextView *view, moo_edit_view_line_mark_clicked (MooTextView *view,
int line) int line)
@ -141,8 +133,6 @@ moo_edit_view_apply_style_scheme (MooTextView *view,
_moo_edit_update_bookmarks_style (moo_edit_view_get_doc (MOO_EDIT_VIEW (view))); _moo_edit_update_bookmarks_style (moo_edit_view_get_doc (MOO_EDIT_VIEW (view)));
} }
#endif // !MOO_USE_SCI
static gboolean static gboolean
moo_edit_view_focus_in (GtkWidget *widget, moo_edit_view_focus_in (GtkWidget *widget,

View File

@ -36,9 +36,7 @@
#include "mooedit/mooeditprefs.h" #include "mooedit/mooeditprefs.h"
#include "mooedit/mooplugin.h" #include "mooedit/mooplugin.h"
#include "mooedit/mooeditaction.h" #include "mooedit/mooeditaction.h"
#ifndef MOO_USE_SCI #include "mooedit/mooeditbookmark.h"
#include "mooedit/native/mooeditbookmark.h"
#endif
#include "mooutils/moonotebook.h" #include "mooutils/moonotebook.h"
#include "mooutils/moostock.h" #include "mooutils/moostock.h"
#include "marshals.h" #include "marshals.h"
@ -197,11 +195,9 @@ static void edit_encoding_changed (MooEditWindow *win
static void edit_line_end_changed (MooEditWindow *window, static void edit_line_end_changed (MooEditWindow *window,
GParamSpec *pspec, GParamSpec *pspec,
MooEdit *doc); MooEdit *doc);
#ifndef MOO_USE_SCI
static void edit_lang_changed (MooEditWindow *window, static void edit_lang_changed (MooEditWindow *window,
GParamSpec *pspec, GParamSpec *pspec,
MooEdit *doc); MooEdit *doc);
#endif
static void view_overwrite_changed (MooEditWindow *window, static void view_overwrite_changed (MooEditWindow *window,
GParamSpec *pspec, GParamSpec *pspec,
MooEditView *view); MooEditView *view);
@ -219,9 +215,7 @@ static void update_tab_labels (MooEditWindow *win
static void view_cursor_moved (MooEditWindow *window, static void view_cursor_moved (MooEditWindow *window,
GtkTextIter *iter, GtkTextIter *iter,
MooEditView *view); MooEditView *view);
#ifndef MOO_USE_SCI
static void update_lang_menu (MooEditWindow *window); static void update_lang_menu (MooEditWindow *window);
#endif
static void update_doc_view_actions (MooEditWindow *window); static void update_doc_view_actions (MooEditWindow *window);
static void update_split_view_actions (MooEditWindow *window); static void update_split_view_actions (MooEditWindow *window);
@ -232,9 +226,7 @@ static MooEditTab *get_nth_tab (MooNotebook &not
static MooEdit *get_nth_doc (MooNotebook *notebook, static MooEdit *get_nth_doc (MooNotebook *notebook,
guint n); guint n);
#ifndef MOO_USE_SCI
static GtkAction *create_lang_action (MooEditWindow *window); static GtkAction *create_lang_action (MooEditWindow *window);
#endif
static void create_paned (MooEditWindow *window); static void create_paned (MooEditWindow *window);
static void save_paned_config (MooEditWindow *window); static void save_paned_config (MooEditWindow *window);
@ -284,13 +276,11 @@ static void action_next_tab_in_view (MooEditWindow *window);
static void action_switch_to_tab (MooEditWindow *window, static void action_switch_to_tab (MooEditWindow *window,
guint n); guint n);
#ifndef MOO_USE_SCI
static void action_toggle_bookmark (MooEditWindow *window); static void action_toggle_bookmark (MooEditWindow *window);
static void action_next_bookmark (MooEditWindow *window); static void action_next_bookmark (MooEditWindow *window);
static void action_prev_bookmark (MooEditWindow *window); static void action_prev_bookmark (MooEditWindow *window);
static GtkAction *create_goto_bookmark_action (MooWindow *window, static GtkAction *create_goto_bookmark_action (MooWindow *window,
gpointer data); gpointer data);
#endif
static void action_find_now_f (MooEditWindow *window); static void action_find_now_f (MooEditWindow *window);
static void action_find_now_b (MooEditWindow *window); static void action_find_now_b (MooEditWindow *window);
@ -329,9 +319,7 @@ enum {
/* aux properties */ /* aux properties */
PROP_CAN_RELOAD, PROP_CAN_RELOAD,
PROP_HAS_OPEN_DOCUMENT, PROP_HAS_OPEN_DOCUMENT,
#ifndef MOO_USE_SCI
PROP_HAS_COMMENTS, PROP_HAS_COMMENTS,
#endif
PROP_HAS_JOBS_RUNNING, PROP_HAS_JOBS_RUNNING,
PROP_HAS_STOP_CLIENTS, PROP_HAS_STOP_CLIENTS,
PROP_CAN_MOVE_TO_SPLIT_NOTEBOOK PROP_CAN_MOVE_TO_SPLIT_NOTEBOOK
@ -431,9 +419,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
INSTALL_PROP (PROP_CAN_RELOAD, "can-reload"); INSTALL_PROP (PROP_CAN_RELOAD, "can-reload");
INSTALL_PROP (PROP_HAS_OPEN_DOCUMENT, "has-open-document"); INSTALL_PROP (PROP_HAS_OPEN_DOCUMENT, "has-open-document");
#ifndef MOO_USE_SCI
INSTALL_PROP (PROP_HAS_COMMENTS, "has-comments"); INSTALL_PROP (PROP_HAS_COMMENTS, "has-comments");
#endif
INSTALL_PROP (PROP_HAS_JOBS_RUNNING, "has-jobs-running"); INSTALL_PROP (PROP_HAS_JOBS_RUNNING, "has-jobs-running");
INSTALL_PROP (PROP_HAS_STOP_CLIENTS, "has-stop-clients"); INSTALL_PROP (PROP_HAS_STOP_CLIENTS, "has-stop-clients");
INSTALL_PROP (PROP_CAN_MOVE_TO_SPLIT_NOTEBOOK, "can-move-to-split-notebook"); INSTALL_PROP (PROP_CAN_MOVE_TO_SPLIT_NOTEBOOK, "can-move-to-split-notebook");
@ -720,7 +706,6 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
g_free (action_id); g_free (action_id);
} }
#ifndef MOO_USE_SCI
for (i = 1; i < 10; ++i) for (i = 1; i < 10; ++i)
{ {
char *action_id = g_strdup_printf (MOO_EDIT_GOTO_BOOKMARK_ACTION "%u", i); char *action_id = g_strdup_printf (MOO_EDIT_GOTO_BOOKMARK_ACTION "%u", i);
@ -755,9 +740,7 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"connect-accel", TRUE, "connect-accel", TRUE,
"closure-callback", action_prev_bookmark, "closure-callback", action_prev_bookmark,
NULL); NULL);
#endif // !MOO_USE_SCI
#ifndef MOO_USE_SCI
moo_window_class_new_action (window_class, "Comment", NULL, moo_window_class_new_action (window_class, "Comment", NULL,
/* action */ /* action */
"display-name", _("Comment"), "display-name", _("Comment"),
@ -777,7 +760,6 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
"closure-proxy-func", moo_edit_window_get_active_doc, "closure-proxy-func", moo_edit_window_get_active_doc,
"condition::sensitive", "has-comments", "condition::sensitive", "has-comments",
NULL); NULL);
#endif // !MOO_USE_SCI
moo_window_class_new_action (window_class, "Indent", NULL, moo_window_class_new_action (window_class, "Indent", NULL,
"display-name", GTK_STOCK_INDENT, "display-name", GTK_STOCK_INDENT,
@ -845,11 +827,9 @@ moo_edit_window_class_init (MooEditWindowClass *klass)
NULL); NULL);
#endif #endif
#ifndef MOO_USE_SCI
moo_window_class_new_action_custom (window_class, LANG_ACTION_ID, NULL, moo_window_class_new_action_custom (window_class, LANG_ACTION_ID, NULL,
(MooWindowActionFunc) create_lang_action, (MooWindowActionFunc) create_lang_action,
NULL, NULL); NULL, NULL);
#endif
{ {
GValue val = { 0 }; GValue val = { 0 };
@ -996,12 +976,10 @@ static void moo_edit_window_get_property(GObject *object,
case PROP_CAN_MOVE_TO_SPLIT_NOTEBOOK: case PROP_CAN_MOVE_TO_SPLIT_NOTEBOOK:
g_value_set_boolean (value, can_move_to_split_notebook (window)); g_value_set_boolean (value, can_move_to_split_notebook (window));
break; break;
#ifndef MOO_USE_SCI
case PROP_HAS_COMMENTS: case PROP_HAS_COMMENTS:
doc = ACTIVE_DOC (window); doc = ACTIVE_DOC (window);
g_value_set_boolean (value, doc && _moo_edit_has_comments (doc, NULL, NULL)); g_value_set_boolean (value, doc && _moo_edit_has_comments (doc, NULL, NULL));
break; break;
#endif
case PROP_HAS_JOBS_RUNNING: case PROP_HAS_JOBS_RUNNING:
g_value_set_boolean (value, window->priv->jobs != NULL); g_value_set_boolean (value, window->priv->jobs != NULL);
break; break;
@ -1743,8 +1721,6 @@ action_abort_jobs (MooEditWindow *window)
} }
#ifndef MOO_USE_SCI
static void static void
action_toggle_bookmark (MooEditWindow *window) action_toggle_bookmark (MooEditWindow *window)
{ {
@ -1842,22 +1818,16 @@ create_goto_bookmark_action (MooWindow *window,
return action; return action;
} }
#endif // !MOO_USE_SCI
namespace { namespace {
#ifndef MOO_USE_SCI
const ObjectDataAccessor<GtkWidget, MooEditBookmark*> widget_bookmark("moo-bookmark"); const ObjectDataAccessor<GtkWidget, MooEditBookmark*> widget_bookmark("moo-bookmark");
#endif
const ObjectDataAccessor<GtkWidget, MooEdit*> widget_doc("moo-edit"); const ObjectDataAccessor<GtkWidget, MooEdit*> widget_doc("moo-edit");
const ObjectDataAccessor<GtkWidget, MooEditView*> widget_view("moo-edit-view"); const ObjectDataAccessor<GtkWidget, MooEditView*> widget_view("moo-edit-view");
const ObjectDataAccessor<GtkWidget, MooEditTab*> data_moo_edit_tab("moo-edit-tab"); const ObjectDataAccessor<GtkWidget, MooEditTab*> data_moo_edit_tab("moo-edit-tab");
} // anonymous namespace } // anonymous namespace
#ifndef MOO_USE_SCI
static void static void
bookmark_item_activated (GtkWidget *item) bookmark_item_activated (GtkWidget *item)
{ {
@ -1984,19 +1954,16 @@ doc_item_selected (MooWindow *window,
populate_bookmark_menu (MOO_EDIT_WINDOW (window), menu, next_bk_item); populate_bookmark_menu (MOO_EDIT_WINDOW (window), menu, next_bk_item);
} }
#endif // !MOO_USE_SCI
static void static void
moo_edit_window_connect_menubar (MooWindow *window) moo_edit_window_connect_menubar (MooWindow *window)
{ {
GtkWidget *doc_item;
GtkWidget *win_item; GtkWidget *win_item;
if (!window->menubar) if (!window->menubar)
return; return;
#ifndef MOO_USE_SCI
GtkWidget *doc_item;
doc_item = moo_ui_xml_get_widget (moo_window_get_ui_xml (window), doc_item = moo_ui_xml_get_widget (moo_window_get_ui_xml (window),
window->menubar, window->menubar,
"Editor/Menubar/Document"); "Editor/Menubar/Document");
@ -2004,7 +1971,6 @@ moo_edit_window_connect_menubar (MooWindow *window)
g_signal_connect_swapped (doc_item, "select", g_signal_connect_swapped (doc_item, "select",
G_CALLBACK (doc_item_selected), G_CALLBACK (doc_item_selected),
window); window);
#endif
win_item = moo_ui_xml_get_widget (moo_window_get_ui_xml (window), win_item = moo_ui_xml_get_widget (moo_window_get_ui_xml (window),
window->menubar, window->menubar,
@ -2579,20 +2545,16 @@ edit_changed (MooEditWindow *window,
g_object_freeze_notify (G_OBJECT (window)); g_object_freeze_notify (G_OBJECT (window));
g_object_notify (G_OBJECT (window), "can-reload"); g_object_notify (G_OBJECT (window), "can-reload");
g_object_notify (G_OBJECT (window), "has-open-document"); g_object_notify (G_OBJECT (window), "has-open-document");
#ifndef MOO_USE_SCI
g_object_notify (G_OBJECT (window), "has-comments"); g_object_notify (G_OBJECT (window), "has-comments");
#endif
g_object_thaw_notify (G_OBJECT (window)); g_object_thaw_notify (G_OBJECT (window));
update_split_view_actions (window); update_split_view_actions (window);
update_window_title (window); update_window_title (window);
update_statusbar (window); update_statusbar (window);
#ifndef MOO_USE_SCI
update_lang_menu (window); update_lang_menu (window);
#endif
update_doc_view_actions (window); update_doc_view_actions (window);
update_doc_encoding_item (window); update_doc_encoding_item (window);
update_doc_line_end_item (window); update_doc_line_end_item (window);
} }
if (doc) if (doc)
@ -3146,12 +3108,10 @@ _moo_edit_window_insert_tab (MooEditWindow *window,
G_CALLBACK (edit_line_end_changed), window); G_CALLBACK (edit_line_end_changed), window);
g_signal_connect_swapped (doc, "filename_changed", g_signal_connect_swapped (doc, "filename_changed",
G_CALLBACK (edit_filename_changed), window); G_CALLBACK (edit_filename_changed), window);
#ifndef MOO_USE_SCI
g_signal_connect_swapped (doc, "notify::has-comments", g_signal_connect_swapped (doc, "notify::has-comments",
G_CALLBACK (proxy_boolean_property), window); G_CALLBACK (proxy_boolean_property), window);
g_signal_connect_swapped (doc, "notify::lang", g_signal_connect_swapped (doc, "notify::lang",
G_CALLBACK (edit_lang_changed), window); G_CALLBACK (edit_lang_changed), window);
#endif
for (i = 0; i < moo_edit_view_array_get_size (views); ++i) for (i = 0; i < moo_edit_view_array_get_size (views); ++i)
connect_view (window, views->elms[i]); connect_view (window, views->elms[i]);
@ -3212,9 +3172,7 @@ _moo_edit_window_remove_doc (MooEditWindow *window,
g_signal_handlers_disconnect_by_func (doc, (gpointer) edit_changed, window); g_signal_handlers_disconnect_by_func (doc, (gpointer) edit_changed, window);
g_signal_handlers_disconnect_by_func (doc, (gpointer) edit_filename_changed, window); g_signal_handlers_disconnect_by_func (doc, (gpointer) edit_filename_changed, window);
g_signal_handlers_disconnect_by_func (doc, (gpointer) proxy_boolean_property, window); g_signal_handlers_disconnect_by_func (doc, (gpointer) proxy_boolean_property, window);
#ifndef MOO_USE_SCI
g_signal_handlers_disconnect_by_func (doc, (gpointer) edit_lang_changed, window); g_signal_handlers_disconnect_by_func (doc, (gpointer) edit_lang_changed, window);
#endif
for (i = 0; i < views->n_elms; ++i) for (i = 0; i < views->n_elms; ++i)
disconnect_view (window, views->elms[i]); disconnect_view (window, views->elms[i]);
@ -4018,8 +3976,6 @@ create_statusbar (MooEditWindow *window)
} }
#ifndef MOO_USE_SCI
/*****************************************************************************/ /*****************************************************************************/
/* Language menu /* Language menu
*/ */
@ -4145,8 +4101,6 @@ edit_lang_changed (MooEditWindow *window,
} }
} }
#endif // !MOO_USE_SCI
/*****************************************************************************/ /*****************************************************************************/
/* Action properties checks /* Action properties checks

View File

@ -56,10 +56,9 @@ void _moo_text_buffer_update_highlight (MooTextBuffer *buffer,
gpointer _moo_text_buffer_get_undo_stack (MooTextBuffer *buffer); gpointer _moo_text_buffer_get_undo_stack (MooTextBuffer *buffer);
gboolean _moo_text_buffer_is_bracket_tag (MooTextBuffer *buffer, gboolean _moo_text_buffer_is_bracket_tag (MooTextBuffer *buffer,
GtkTextTag *tag); GtkTextTag *tag);
#ifndef MOO_USE_SCI
void _moo_text_buffer_set_style_scheme (MooTextBuffer *buffer, void _moo_text_buffer_set_style_scheme (MooTextBuffer *buffer,
MooTextStyleScheme *scheme); MooTextStyleScheme *scheme);
#endif
G_END_DECLS G_END_DECLS

View File

@ -33,7 +33,6 @@ struct MooTextBufferPrivate {
gboolean has_selection; gboolean has_selection;
gboolean has_text; gboolean has_text;
#ifndef MOO_USE_SCI
MooTextStyleScheme *style_scheme; MooTextStyleScheme *style_scheme;
GtkSourceEngine *engine; GtkSourceEngine *engine;
MooLang *lang; MooLang *lang;
@ -48,7 +47,6 @@ struct MooTextBufferPrivate {
GtkTextTag *incorrect_match_tag; GtkTextTag *incorrect_match_tag;
GtkTextMark *bracket_mark[4]; GtkTextMark *bracket_mark[4];
MooBracketMatchType bracket_found; MooBracketMatchType bracket_found;
#endif
LineBuffer *line_buf; LineBuffer *line_buf;
MooFoldTree *fold_tree; MooFoldTree *fold_tree;
@ -92,7 +90,6 @@ static void moo_text_buffer_begin_user_action (GtkTextBuffer *buffer)
static void moo_text_buffer_end_user_action (GtkTextBuffer *buffer); static void moo_text_buffer_end_user_action (GtkTextBuffer *buffer);
static void moo_text_buffer_modified_changed (GtkTextBuffer *buffer); static void moo_text_buffer_modified_changed (GtkTextBuffer *buffer);
#ifndef MOO_USE_SCI
static void moo_text_buffer_highlight_brackets (MooTextBuffer *buffer, static void moo_text_buffer_highlight_brackets (MooTextBuffer *buffer,
const GtkTextIter *insert); const GtkTextIter *insert);
static void moo_text_buffer_unhighlight_brackets(MooTextBuffer *buffer); static void moo_text_buffer_unhighlight_brackets(MooTextBuffer *buffer);
@ -105,7 +102,6 @@ static void emit_cursor_moved (MooTextBuffer *buffer,
const GtkTextIter *iter); const GtkTextIter *iter);
static void freeze_cursor_moved (MooTextBuffer *buffer); static void freeze_cursor_moved (MooTextBuffer *buffer);
static void thaw_cursor_moved (MooTextBuffer *buffer); static void thaw_cursor_moved (MooTextBuffer *buffer);
#endif // !MOO_USE_SCI
static guint INSERT_ACTION_TYPE; static guint INSERT_ACTION_TYPE;
@ -132,10 +128,8 @@ static void line_mark_deleted (MooTextBuffer *buffer,
enum { enum {
#ifndef MOO_USE_SCI
HIGHLIGHT_UPDATED, /* GtkSourceBuffer's */ HIGHLIGHT_UPDATED, /* GtkSourceBuffer's */
CURSOR_MOVED, CURSOR_MOVED,
#endif
SELECTION_CHANGED, SELECTION_CHANGED,
LINE_MARK_ADDED, LINE_MARK_ADDED,
LINE_MARK_MOVED, LINE_MARK_MOVED,
@ -151,18 +145,14 @@ static guint signals[LAST_SIGNAL];
enum { enum {
PROP_0, PROP_0,
#ifndef MOO_USE_SCI
PROP_HIGHLIGHT_SYNTAX, /* mimic GtkSourceBuffer */ PROP_HIGHLIGHT_SYNTAX, /* mimic GtkSourceBuffer */
PROP_HIGHLIGHT_MATCHING_BRACKETS, PROP_HIGHLIGHT_MATCHING_BRACKETS,
PROP_HIGHLIGHT_MISMATCHING_BRACKETS, PROP_HIGHLIGHT_MISMATCHING_BRACKETS,
PROP_BRACKET_MATCH_STYLE, PROP_BRACKET_MATCH_STYLE,
PROP_BRACKET_MISMATCH_STYLE, PROP_BRACKET_MISMATCH_STYLE,
#endif
PROP_HAS_TEXT, PROP_HAS_TEXT,
PROP_HAS_SELECTION, PROP_HAS_SELECTION,
#ifndef MOO_USE_SCI
PROP_LANG, PROP_LANG,
#endif
PROP_CAN_UNDO, PROP_CAN_UNDO,
PROP_CAN_REDO PROP_CAN_REDO
}; };
@ -191,13 +181,10 @@ moo_text_buffer_class_init (MooTextBufferClass *klass)
buffer_class->end_user_action = moo_text_buffer_end_user_action; buffer_class->end_user_action = moo_text_buffer_end_user_action;
buffer_class->modified_changed = moo_text_buffer_modified_changed; buffer_class->modified_changed = moo_text_buffer_modified_changed;
#ifndef MOO_USE_SCI
klass->cursor_moved = moo_text_buffer_cursor_moved; klass->cursor_moved = moo_text_buffer_cursor_moved;
#endif
g_type_class_add_private (klass, sizeof (MooTextBufferPrivate)); g_type_class_add_private (klass, sizeof (MooTextBufferPrivate));
#ifndef MOO_USE_SCI
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_HIGHLIGHT_SYNTAX, PROP_HIGHLIGHT_SYNTAX,
g_param_spec_boolean ("highlight-syntax", g_param_spec_boolean ("highlight-syntax",
@ -237,7 +224,6 @@ moo_text_buffer_class_init (MooTextBufferClass *klass)
"bracket-mismatch-style", "bracket-mismatch-style",
MOO_TYPE_TEXT_STYLE, MOO_TYPE_TEXT_STYLE,
(GParamFlags) (G_PARAM_CONSTRUCT | G_PARAM_WRITABLE))); (GParamFlags) (G_PARAM_CONSTRUCT | G_PARAM_WRITABLE)));
#endif
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_HAS_TEXT, PROP_HAS_TEXT,
@ -255,7 +241,6 @@ moo_text_buffer_class_init (MooTextBufferClass *klass)
FALSE, FALSE,
G_PARAM_READABLE)); G_PARAM_READABLE));
#ifndef MOO_USE_SCI
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_LANG, PROP_LANG,
g_param_spec_object ("lang", g_param_spec_object ("lang",
@ -263,7 +248,6 @@ moo_text_buffer_class_init (MooTextBufferClass *klass)
"lang", "lang",
MOO_TYPE_LANG, MOO_TYPE_LANG,
(GParamFlags) G_PARAM_READWRITE)); (GParamFlags) G_PARAM_READWRITE));
#endif
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_CAN_UNDO, PROP_CAN_UNDO,
@ -281,7 +265,6 @@ moo_text_buffer_class_init (MooTextBufferClass *klass)
FALSE, FALSE,
G_PARAM_READABLE)); G_PARAM_READABLE));
#ifndef MOO_USE_SCI
signals[HIGHLIGHT_UPDATED] = signals[HIGHLIGHT_UPDATED] =
g_signal_new ("highlight_updated", g_signal_new ("highlight_updated",
G_OBJECT_CLASS_TYPE (klass), G_OBJECT_CLASS_TYPE (klass),
@ -301,7 +284,6 @@ moo_text_buffer_class_init (MooTextBufferClass *klass)
_moo_marshal_VOID__BOXED, _moo_marshal_VOID__BOXED,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
GTK_TYPE_TEXT_ITER); GTK_TYPE_TEXT_ITER);
#endif
signals[SELECTION_CHANGED] = signals[SELECTION_CHANGED] =
g_signal_new ("selection-changed", g_signal_new ("selection-changed",
@ -380,10 +362,8 @@ moo_text_buffer_init (MooTextBuffer *buffer)
buffer->priv = G_TYPE_INSTANCE_GET_PRIVATE (buffer, MOO_TYPE_TEXT_BUFFER, MooTextBufferPrivate); buffer->priv = G_TYPE_INSTANCE_GET_PRIVATE (buffer, MOO_TYPE_TEXT_BUFFER, MooTextBufferPrivate);
buffer->priv->line_buf = _moo_line_buffer_new (); buffer->priv->line_buf = _moo_line_buffer_new ();
#ifndef MOO_USE_SCI
buffer->priv->do_highlight = TRUE; buffer->priv->do_highlight = TRUE;
buffer->priv->bracket_found = MOO_BRACKET_MATCH_NONE; buffer->priv->bracket_found = MOO_BRACKET_MATCH_NONE;
#endif
buffer->priv->fold_tree = _moo_fold_tree_new (buffer); buffer->priv->fold_tree = _moo_fold_tree_new (buffer);
@ -411,9 +391,7 @@ moo_text_buffer_init (MooTextBuffer *buffer)
g_signal_connect_swapped (buffer->priv->undo_stack, "notify::can-redo", g_signal_connect_swapped (buffer->priv->undo_stack, "notify::can-redo",
G_CALLBACK (proxy_notify_can_undo_redo), buffer); G_CALLBACK (proxy_notify_can_undo_redo), buffer);
#ifndef MOO_USE_SCI
moo_text_buffer_set_brackets (buffer, NULL); moo_text_buffer_set_brackets (buffer, NULL);
#endif
} }
@ -429,7 +407,6 @@ moo_text_buffer_dispose (GObject *object)
buffer->priv->fold_tree = NULL; buffer->priv->fold_tree = NULL;
} }
#ifndef MOO_USE_SCI
if (buffer->priv->engine) if (buffer->priv->engine)
{ {
_gtk_source_engine_attach_buffer (buffer->priv->engine, NULL); _gtk_source_engine_attach_buffer (buffer->priv->engine, NULL);
@ -448,7 +425,6 @@ moo_text_buffer_dispose (GObject *object)
g_object_unref (buffer->priv->lang); g_object_unref (buffer->priv->lang);
buffer->priv->engine = NULL; buffer->priv->engine = NULL;
} }
#endif
if (buffer->priv->line_buf) if (buffer->priv->line_buf)
{ {
@ -456,12 +432,10 @@ moo_text_buffer_dispose (GObject *object)
buffer->priv->line_buf = NULL; buffer->priv->line_buf = NULL;
} }
#ifndef MOO_USE_SCI
g_free (buffer->priv->left_brackets); g_free (buffer->priv->left_brackets);
g_free (buffer->priv->right_brackets); g_free (buffer->priv->right_brackets);
buffer->priv->left_brackets = NULL; buffer->priv->left_brackets = NULL;
buffer->priv->right_brackets = NULL; buffer->priv->right_brackets = NULL;
#endif
#if 0 #if 0
g_signal_handlers_disconnect_by_func (buffer->priv->undo_stack, g_signal_handlers_disconnect_by_func (buffer->priv->undo_stack,
@ -578,10 +552,8 @@ moo_text_buffer_mark_set (GtkTextBuffer *text_buffer,
if (mark == insert) if (mark == insert)
{ {
#ifndef MOO_USE_SCI
moo_text_buffer_unhighlight_brackets (buffer); moo_text_buffer_unhighlight_brackets (buffer);
emit_cursor_moved (buffer, iter); emit_cursor_moved (buffer, iter);
#endif
} }
} }
@ -603,7 +575,7 @@ moo_text_buffer_insert_text (GtkTextBuffer *text_buffer,
MooTextBuffer *buffer = MOO_TEXT_BUFFER (text_buffer); MooTextBuffer *buffer = MOO_TEXT_BUFFER (text_buffer);
GtkTextTag *tag; GtkTextTag *tag;
int first_line, last_line; int first_line, last_line;
int start_offset; int start_offset, end_offset;
gboolean starts_line, ins_line; gboolean starts_line, ins_line;
if (!text[0]) if (!text[0])
@ -635,9 +607,7 @@ moo_text_buffer_insert_text (GtkTextBuffer *text_buffer,
moo_undo_stack_add_action (buffer->priv->undo_stack, INSERT_ACTION_TYPE, action); moo_undo_stack_add_action (buffer->priv->undo_stack, INSERT_ACTION_TYPE, action);
} }
#ifndef MOO_USE_SCI
moo_text_buffer_unhighlight_brackets (buffer); moo_text_buffer_unhighlight_brackets (buffer);
#endif
GTK_TEXT_BUFFER_CLASS(moo_text_buffer_parent_class)->insert_text (text_buffer, pos, text, length); GTK_TEXT_BUFFER_CLASS(moo_text_buffer_parent_class)->insert_text (text_buffer, pos, text, length);
@ -657,14 +627,12 @@ moo_text_buffer_insert_text (GtkTextBuffer *text_buffer,
g_slist_free (marks); g_slist_free (marks);
} }
#ifndef MOO_USE_SCI
emit_cursor_moved (buffer, pos); emit_cursor_moved (buffer, pos);
int end_offset = gtk_text_iter_get_offset (pos); end_offset = gtk_text_iter_get_offset (pos);
if (buffer->priv->engine) if (buffer->priv->engine)
_gtk_source_engine_text_inserted (buffer->priv->engine, start_offset, end_offset); _gtk_source_engine_text_inserted (buffer->priv->engine, start_offset, end_offset);
#endif
if (!buffer->priv->has_text) if (!buffer->priv->has_text)
{ {
@ -742,7 +710,6 @@ moo_text_buffer_delete_range (GtkTextBuffer *text_buffer,
gtk_text_buffer_remove_tag (text_buffer, tag, &tag_start, &tag_end); gtk_text_buffer_remove_tag (text_buffer, tag, &tag_start, &tag_end);
} }
#ifndef MOO_USE_SCI
moo_text_buffer_unhighlight_brackets (buffer); moo_text_buffer_unhighlight_brackets (buffer);
#define MANY_LINES 1000 #define MANY_LINES 1000
@ -752,7 +719,6 @@ moo_text_buffer_delete_range (GtkTextBuffer *text_buffer,
gtk_text_buffer_remove_all_tags (text_buffer, start, end); gtk_text_buffer_remove_all_tags (text_buffer, start, end);
} }
#undef MANY_LINES #undef MANY_LINES
#endif
if (!moo_undo_stack_frozen (buffer->priv->undo_stack)) if (!moo_undo_stack_frozen (buffer->priv->undo_stack))
{ {
@ -788,9 +754,7 @@ moo_text_buffer_delete_range (GtkTextBuffer *text_buffer,
g_slist_free (moved_marks); g_slist_free (moved_marks);
update_selection (buffer); update_selection (buffer);
#ifndef MOO_USE_SCI
emit_cursor_moved (buffer, start); emit_cursor_moved (buffer, start);
#endif
if (buffer->priv->has_text) if (buffer->priv->has_text)
{ {
@ -799,10 +763,8 @@ moo_text_buffer_delete_range (GtkTextBuffer *text_buffer,
g_object_notify (G_OBJECT (buffer), "has-text"); g_object_notify (G_OBJECT (buffer), "has-text");
} }
#ifndef MOO_USE_SCI
if (buffer->priv->engine != NULL) if (buffer->priv->engine != NULL)
_gtk_source_engine_text_deleted (buffer->priv->engine, offset, length); _gtk_source_engine_text_deleted (buffer->priv->engine, offset, length);
#endif
} }
@ -850,7 +812,6 @@ proxy_notify_can_undo_redo (MooTextBuffer *buffer,
} }
#ifndef MOO_USE_SCI
void void
moo_text_buffer_set_lang (MooTextBuffer *buffer, moo_text_buffer_set_lang (MooTextBuffer *buffer,
MooLang *lang) MooLang *lang)
@ -923,7 +884,6 @@ moo_text_buffer_get_highlight (MooTextBuffer *buffer)
g_return_val_if_fail (MOO_IS_TEXT_BUFFER (buffer), FALSE); g_return_val_if_fail (MOO_IS_TEXT_BUFFER (buffer), FALSE);
return buffer->priv->do_highlight; return buffer->priv->do_highlight;
} }
#endif // !MOO_USE_SCI
static void static void
@ -932,13 +892,10 @@ moo_text_buffer_set_property (GObject *object,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
#ifndef MOO_USE_SCI
MooTextBuffer *buffer = MOO_TEXT_BUFFER (object); MooTextBuffer *buffer = MOO_TEXT_BUFFER (object);
#endif
switch (prop_id) switch (prop_id)
{ {
#ifndef MOO_USE_SCI
case PROP_HIGHLIGHT_SYNTAX: case PROP_HIGHLIGHT_SYNTAX:
moo_text_buffer_set_highlight (buffer, g_value_get_boolean (value)); moo_text_buffer_set_highlight (buffer, g_value_get_boolean (value));
break; break;
@ -964,7 +921,6 @@ moo_text_buffer_set_property (GObject *object,
case PROP_LANG: case PROP_LANG:
moo_text_buffer_set_lang (buffer, g_value_get_object (value)); moo_text_buffer_set_lang (buffer, g_value_get_object (value));
break; break;
#endif // MOO_USE_SCI
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -983,7 +939,6 @@ moo_text_buffer_get_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
#ifndef MOO_USE_SCI
case PROP_HIGHLIGHT_SYNTAX: case PROP_HIGHLIGHT_SYNTAX:
g_value_set_boolean (value, buffer->priv->do_highlight); g_value_set_boolean (value, buffer->priv->do_highlight);
break; break;
@ -999,7 +954,6 @@ moo_text_buffer_get_property (GObject *object,
case PROP_LANG: case PROP_LANG:
g_value_set_object (value, buffer->priv->lang); g_value_set_object (value, buffer->priv->lang);
break; break;
#endif // !MOO_USE_SCI
case PROP_HAS_TEXT: case PROP_HAS_TEXT:
g_value_set_boolean (value, moo_text_buffer_has_text (buffer)); g_value_set_boolean (value, moo_text_buffer_has_text (buffer));
@ -1036,7 +990,6 @@ moo_text_buffer_has_selection (MooTextBuffer *buffer)
} }
#ifndef MOO_USE_SCI
void void
_moo_text_buffer_update_highlight (MooTextBuffer *buffer, _moo_text_buffer_update_highlight (MooTextBuffer *buffer,
const GtkTextIter *start, const GtkTextIter *start,
@ -1092,16 +1045,13 @@ _moo_text_buffer_set_style_scheme (MooTextBuffer *buffer,
_gtk_source_engine_set_style_scheme (buffer->priv->engine, _gtk_source_engine_set_style_scheme (buffer->priv->engine,
GTK_SOURCE_STYLE_SCHEME (scheme)); GTK_SOURCE_STYLE_SCHEME (scheme));
} }
#endif // !MOO_USE_SCI
void void
moo_text_buffer_freeze (MooTextBuffer *buffer) moo_text_buffer_freeze (MooTextBuffer *buffer)
{ {
g_return_if_fail (MOO_IS_TEXT_BUFFER (buffer)); g_return_if_fail (MOO_IS_TEXT_BUFFER (buffer));
#ifndef MOO_USE_SCI
freeze_cursor_moved (buffer); freeze_cursor_moved (buffer);
#endif
} }
@ -1109,9 +1059,7 @@ void
moo_text_buffer_thaw (MooTextBuffer *buffer) moo_text_buffer_thaw (MooTextBuffer *buffer)
{ {
g_return_if_fail (MOO_IS_TEXT_BUFFER (buffer)); g_return_if_fail (MOO_IS_TEXT_BUFFER (buffer));
#ifndef MOO_USE_SCI
thaw_cursor_moved (buffer); thaw_cursor_moved (buffer);
#endif
} }
@ -1210,8 +1158,6 @@ moo_text_iter_set_visual_line_offset (GtkTextIter *iter,
/* Matching brackets /* Matching brackets
*/ */
#ifndef MOO_USE_SCI
#define FIND_BRACKETS_LIMIT 3000 #define FIND_BRACKETS_LIMIT 3000
static void static void
@ -1606,8 +1552,6 @@ moo_text_iter_find_matching_bracket (GtkTextIter *iter,
return MOO_BRACKET_MATCH_NONE; return MOO_BRACKET_MATCH_NONE;
} }
#endif // !MOO_USE_SCI
/*****************************************************************************/ /*****************************************************************************/
/* Undo/redo /* Undo/redo

View File

@ -50,11 +50,8 @@ struct MooTextBufferClass
gboolean (* undo) (MooTextBuffer *buffer); gboolean (* undo) (MooTextBuffer *buffer);
gboolean (* redo) (MooTextBuffer *buffer); gboolean (* redo) (MooTextBuffer *buffer);
#ifndef MOO_USE_SCI
void (*cursor_moved) (MooTextBuffer *buffer, void (*cursor_moved) (MooTextBuffer *buffer,
const GtkTextIter *iter); const GtkTextIter *iter);
#endif
void (*selection_changed) (MooTextBuffer *buffer); void (*selection_changed) (MooTextBuffer *buffer);
void (*line_mark_added) (MooTextBuffer *buffer, void (*line_mark_added) (MooTextBuffer *buffer,
@ -77,7 +74,6 @@ GType moo_text_buffer_get_type (void) G_GNUC_CONST;
GtkTextBuffer *moo_text_buffer_new (GtkTextTagTable *table); GtkTextBuffer *moo_text_buffer_new (GtkTextTagTable *table);
#ifndef MOO_USE_SCI
void moo_text_buffer_set_lang (MooTextBuffer *buffer, void moo_text_buffer_set_lang (MooTextBuffer *buffer,
MooLang *lang); MooLang *lang);
MooLang *moo_text_buffer_get_lang (MooTextBuffer *buffer); MooLang *moo_text_buffer_get_lang (MooTextBuffer *buffer);
@ -88,7 +84,6 @@ gboolean moo_text_buffer_get_highlight (MooTextBuffer *buf
void moo_text_buffer_set_brackets (MooTextBuffer *buffer, void moo_text_buffer_set_brackets (MooTextBuffer *buffer,
const char *brackets); const char *brackets);
#endif
gboolean moo_text_buffer_can_redo (MooTextBuffer *buffer); gboolean moo_text_buffer_can_redo (MooTextBuffer *buffer);
gboolean moo_text_buffer_can_undo (MooTextBuffer *buffer); gboolean moo_text_buffer_can_undo (MooTextBuffer *buffer);

View File

@ -106,9 +106,7 @@ struct MooTextViewPrivate {
/***********************************************************************/ /***********************************************************************/
/* Drawing /* Drawing
*/ */
#ifndef MOO_USE_SCI
MooTextStyleScheme *style_scheme; MooTextStyleScheme *style_scheme;
#endif
guint tab_width; guint tab_width;
gboolean color_settings[MOO_TEXT_VIEW_N_COLORS]; gboolean color_settings[MOO_TEXT_VIEW_N_COLORS];
char *colors[MOO_TEXT_VIEW_N_COLORS]; char *colors[MOO_TEXT_VIEW_N_COLORS];

View File

@ -100,10 +100,8 @@ static void moo_text_view_paste_clipboard (GtkTextView *text_view);
static void moo_text_view_populate_popup(GtkTextView *text_view, static void moo_text_view_populate_popup(GtkTextView *text_view,
GtkMenu *menu); GtkMenu *menu);
#ifndef MOO_USE_SCI
static void moo_text_view_apply_style_scheme (MooTextView *view, static void moo_text_view_apply_style_scheme (MooTextView *view,
MooTextStyleScheme *scheme); MooTextStyleScheme *scheme);
#endif
static void invalidate_gcs (MooTextView *view); static void invalidate_gcs (MooTextView *view);
static void update_gcs (MooTextView *view); static void update_gcs (MooTextView *view);
@ -239,9 +237,7 @@ enum {
PROP_CAN_REDO, PROP_CAN_REDO,
PROP_MANAGE_CLIPBOARD, PROP_MANAGE_CLIPBOARD,
PROP_SMART_HOME_END, PROP_SMART_HOME_END,
#ifndef MOO_USE_SCI
PROP_ENABLE_HIGHLIGHT, PROP_ENABLE_HIGHLIGHT,
#endif
PROP_SHOW_LINE_NUMBERS, PROP_SHOW_LINE_NUMBERS,
PROP_SHOW_LINE_MARKS, PROP_SHOW_LINE_MARKS,
PROP_ENABLE_FOLDING, PROP_ENABLE_FOLDING,
@ -302,9 +298,7 @@ static void moo_text_view_class_init (MooTextViewClass *klass)
klass->replace_interactive = replace_interactive; klass->replace_interactive = replace_interactive;
klass->goto_line_interactive = goto_line_interactive; klass->goto_line_interactive = goto_line_interactive;
klass->char_inserted = moo_text_view_char_inserted; klass->char_inserted = moo_text_view_char_inserted;
#ifndef MOO_USE_SCI
klass->apply_style_scheme = moo_text_view_apply_style_scheme; klass->apply_style_scheme = moo_text_view_apply_style_scheme;
#endif
klass->get_text_cursor = moo_text_view_get_text_cursor; klass->get_text_cursor = moo_text_view_get_text_cursor;
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
@ -452,7 +446,6 @@ static void moo_text_view_class_init (MooTextViewClass *klass)
TRUE, TRUE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT))); (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT)));
#ifndef MOO_USE_SCI
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_ENABLE_HIGHLIGHT, PROP_ENABLE_HIGHLIGHT,
g_param_spec_boolean ("enable-highlight", g_param_spec_boolean ("enable-highlight",
@ -460,7 +453,6 @@ static void moo_text_view_class_init (MooTextViewClass *klass)
"enable-highlight", "enable-highlight",
TRUE, TRUE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT))); (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT)));
#endif
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_SHOW_LINE_NUMBERS, PROP_SHOW_LINE_NUMBERS,
@ -851,13 +843,11 @@ moo_text_view_dispose (GObject *object)
while (view->priv->line_marks) while (view->priv->line_marks)
remove_line_mark (view, view->priv->line_marks->data); remove_line_mark (view, view->priv->line_marks->data);
#ifndef MOO_USE_SCI
if (view->priv->style_scheme) if (view->priv->style_scheme)
{ {
g_object_unref (view->priv->style_scheme); g_object_unref (view->priv->style_scheme);
view->priv->style_scheme = NULL; view->priv->style_scheme = NULL;
} }
#endif
if (view->priv->move_cursor_idle) if (view->priv->move_cursor_idle)
{ {
@ -1160,13 +1150,11 @@ moo_text_view_set_property (GObject *object,
g_object_notify (object, "smart-home-end"); g_object_notify (object, "smart-home-end");
break; break;
#ifndef MOO_USE_SCI
case PROP_ENABLE_HIGHLIGHT: case PROP_ENABLE_HIGHLIGHT:
moo_text_buffer_set_highlight (get_moo_buffer (view), moo_text_buffer_set_highlight (get_moo_buffer (view),
g_value_get_boolean (value)); g_value_get_boolean (value));
g_object_notify (object, "enable-highlight"); g_object_notify (object, "enable-highlight");
break; break;
#endif
case PROP_SHOW_LINE_NUMBERS: case PROP_SHOW_LINE_NUMBERS:
moo_text_view_set_show_line_numbers (view, g_value_get_boolean (value)); moo_text_view_set_show_line_numbers (view, g_value_get_boolean (value));
@ -1278,11 +1266,9 @@ moo_text_view_get_property (GObject *object,
case PROP_SMART_HOME_END: case PROP_SMART_HOME_END:
g_value_set_boolean (value, view->priv->smart_home_end != 0); g_value_set_boolean (value, view->priv->smart_home_end != 0);
break; break;
#ifndef MOO_USE_SCI
case PROP_ENABLE_HIGHLIGHT: case PROP_ENABLE_HIGHLIGHT:
g_value_set_boolean (value, moo_text_buffer_get_highlight (get_moo_buffer (view))); g_value_set_boolean (value, moo_text_buffer_get_highlight (get_moo_buffer (view)));
break; break;
#endif
case PROP_SHOW_LINE_NUMBERS: case PROP_SHOW_LINE_NUMBERS:
g_value_set_boolean (value, view->priv->lm.show_numbers); g_value_set_boolean (value, view->priv->lm.show_numbers);
break; break;
@ -2611,7 +2597,6 @@ moo_text_tag_get_cursor (GtkTextTag *tag)
#endif #endif
#ifndef MOO_USE_SCI
void void
moo_text_view_set_lang (MooTextView *view, moo_text_view_set_lang (MooTextView *view,
MooLang *lang) MooLang *lang)
@ -2622,12 +2607,12 @@ moo_text_view_set_lang (MooTextView *view,
} }
//** /**
/* moo_text_view_set_lang_by_id: (moo.private 1) * moo_text_view_set_lang_by_id: (moo.private 1)
/* *
/* @view: * @view:
/* @lang_id: (type const-utf8) * @lang_id: (type const-utf8)
/*/ */
void void
moo_text_view_set_lang_by_id (MooTextView *view, moo_text_view_set_lang_by_id (MooTextView *view,
const char *lang_id) const char *lang_id)
@ -2685,7 +2670,6 @@ moo_text_view_get_style_scheme (MooTextView *view)
g_return_val_if_fail (MOO_IS_TEXT_VIEW (view), NULL); g_return_val_if_fail (MOO_IS_TEXT_VIEW (view), NULL);
return view->priv->style_scheme; return view->priv->style_scheme;
} }
#endif // !MOO_USE_SCI
static void static void

View File

@ -75,10 +75,8 @@ struct MooTextViewClass
GtkTextIter *insert, GtkTextIter *insert,
GtkTextIter *selection_bound); GtkTextIter *selection_bound);
#ifndef MOO_USE_SCI
void (*apply_style_scheme) (MooTextView *view, void (*apply_style_scheme) (MooTextView *view,
MooTextStyleScheme *scheme); MooTextStyleScheme *scheme);
#endif
MooTextCursor (*get_text_cursor)(MooTextView *view, MooTextCursor (*get_text_cursor)(MooTextView *view,
int x, /* buffer coordinates */ int x, /* buffer coordinates */
@ -133,11 +131,9 @@ void moo_text_view_set_right_margin_color (MooTextView *view,
const char *color); const char *color);
void moo_text_view_set_right_margin_offset (MooTextView *view, void moo_text_view_set_right_margin_offset (MooTextView *view,
guint offset); guint offset);
#ifndef MOO_USE_SCI
MooTextStyleScheme *moo_text_view_get_style_scheme (MooTextView *view); MooTextStyleScheme *moo_text_view_get_style_scheme (MooTextView *view);
void moo_text_view_set_style_scheme (MooTextView *view, void moo_text_view_set_style_scheme (MooTextView *view,
MooTextStyleScheme *scheme); MooTextStyleScheme *scheme);
#endif
void moo_text_view_set_show_line_numbers (MooTextView *view, void moo_text_view_set_show_line_numbers (MooTextView *view,
gboolean show); gboolean show);
@ -147,13 +143,11 @@ void moo_text_view_set_tab_width (MooTextView *view,
GtkTextTag *moo_text_view_lookup_tag (MooTextView *view, GtkTextTag *moo_text_view_lookup_tag (MooTextView *view,
const char *name); const char *name);
#ifndef MOO_USE_SCI
MooLang *moo_text_view_get_lang (MooTextView *view); MooLang *moo_text_view_get_lang (MooTextView *view);
void moo_text_view_set_lang (MooTextView *view, void moo_text_view_set_lang (MooTextView *view,
MooLang *lang); MooLang *lang);
void moo_text_view_set_lang_by_id (MooTextView *view, void moo_text_view_set_lang_by_id (MooTextView *view,
const char *id); const char *id);
#endif
void moo_text_view_set_word_chars (MooTextView *view, void moo_text_view_set_word_chars (MooTextView *view,
const char *word_chars); const char *word_chars);

View File

@ -28,9 +28,7 @@
#include "mooedit/mooedit.h" #include "mooedit/mooedit.h"
#include "mooedit/mooeditor.h" #include "mooedit/mooeditor.h"
#include "mooedit/mooeditwindow.h" #include "mooedit/mooeditwindow.h"
#ifndef MOO_USE_SCI #include "mooedit/mooeditbookmark.h"
#include "mooedit/native/mooeditbookmark.h"
#endif
#include "mooedit/mooplugin.h" #include "mooedit/mooplugin.h"
#include "mooedit/mooedit-enums.h" #include "mooedit/mooedit-enums.h"
#include "mooedit/mooeditprefs.h" #include "mooedit/mooeditprefs.h"

View File

@ -55,16 +55,14 @@ G_END_DECLS
#include "mooedit/mooedit.h" #include "mooedit/mooedit.h"
#include "mooedit/mooeditor.h" #include "mooedit/mooeditor.h"
#include "mooedit/mooeditwindow.h" #include "mooedit/mooeditwindow.h"
#ifndef MOO_USE_SCI #include "mooedit/mooeditbookmark.h"
#include "mooedit/native/mooeditbookmark.h"
#include "mooedit/native/moolangmgr.h"
#endif
#include "mooedit/mooplugin.h" #include "mooedit/mooplugin.h"
#include "mooedit/mooedit-enums.h" #include "mooedit/mooedit-enums.h"
#include "mooedit/mooeditprefs.h" #include "mooedit/mooeditprefs.h"
#include "mooedit/mooeditaction.h" #include "mooedit/mooeditaction.h"
#include "mooedit/mooeditaction-factory.h" #include "mooedit/mooeditaction-factory.h"
#include "mooedit/mootextbuffer.h" #include "mooedit/mootextbuffer.h"
#include "mooedit/moolangmgr.h"
#include "mooedit/mooeditfileinfo.h" #include "mooedit/mooeditfileinfo.h"
#include "mooedit/mooedit-script.h" #include "mooedit/mooedit-script.h"
#include "mooedit/mooedittab.h" #include "mooedit/mooedittab.h"

View File

@ -1078,12 +1078,10 @@ unx_factory_create_widget (G_GNUC_UNUSED MooCommandFactory *factory)
xml = exe_page_xml_new (); xml = exe_page_xml_new ();
moo_text_view_set_font_from_string (xml->textview, "Monospace"); moo_text_view_set_font_from_string (xml->textview, "Monospace");
#ifndef MOO_USE_SCI
#ifndef __WIN32__ #ifndef __WIN32__
moo_text_view_set_lang_by_id (xml->textview, "sh"); moo_text_view_set_lang_by_id (xml->textview, "sh");
#else #else
moo_text_view_set_lang_by_id (xml->textview, "dosbatch"); moo_text_view_set_lang_by_id (xml->textview, "dosbatch");
#endif
#endif #endif
init_combo (xml->input, input_names, G_N_ELEMENTS (input_names)); init_combo (xml->input, input_names, G_N_ELEMENTS (input_names));

View File

@ -186,17 +186,13 @@ script_factory_create_command (MooCommandFactory *factory_base,
static GtkWidget * static GtkWidget *
script_factory_create_widget (MooCommandFactory *factory_base) script_factory_create_widget (MooCommandFactory *factory_base)
{ {
#ifndef MOO_USE_SCI
MooCommandFactoryScript *factory = (MooCommandFactoryScript*) factory_base; MooCommandFactoryScript *factory = (MooCommandFactoryScript*) factory_base;
#endif
ScriptPageXml *xml; ScriptPageXml *xml;
xml = script_page_xml_new (); xml = script_page_xml_new ();
moo_text_view_set_font_from_string (xml->textview, "Monospace"); moo_text_view_set_font_from_string (xml->textview, "Monospace");
#ifndef MOO_USE_SCI
switch (factory->type) switch (factory->type)
{ {
case MOO_SCRIPT_LUA: case MOO_SCRIPT_LUA:
@ -206,7 +202,6 @@ script_factory_create_widget (MooCommandFactory *factory_base)
moo_text_view_set_lang_by_id (xml->textview, "python"); moo_text_view_set_lang_by_id (xml->textview, "python");
break; break;
} }
#endif // !MOO_USE_SCI
return GTK_WIDGET (xml->ScriptPage); return GTK_WIDGET (xml->ScriptPage);
} }

View File

@ -388,14 +388,11 @@ get_tag (MooLineView *view,
if (!tag) if (!tag)
{ {
#ifndef MOO_USE_SCI
MooLangMgr *lang_mgr; MooLangMgr *lang_mgr;
MooTextStyleScheme *scheme; MooTextStyleScheme *scheme;
MooTextStyle *style = NULL; MooTextStyle *style = NULL;
#endif
tag = moo_line_view_create_tag (view, name, NULL); tag = moo_line_view_create_tag (view, name, NULL);
#ifndef MOO_USE_SCI
lang_mgr = moo_lang_mgr_default (); lang_mgr = moo_lang_mgr_default ();
scheme = moo_lang_mgr_get_active_scheme (lang_mgr); scheme = moo_lang_mgr_get_active_scheme (lang_mgr);
@ -404,9 +401,7 @@ get_tag (MooLineView *view,
if (style) if (style)
_moo_text_style_apply_to_tag (style, tag); _moo_text_style_apply_to_tag (style, tag);
else else if (type == OUTPUT_STDERR || !strcmp (name, "output-error") ||
#endif // !MOO_USE_SCI
if (type == OUTPUT_STDERR || !strcmp (name, "output-error") ||
!strcmp (name, "output-stderr")) !strcmp (name, "output-stderr"))
g_object_set (tag, "foreground", "red", NULL); g_object_set (tag, "foreground", "red", NULL);
} }