diff --git a/moo.kdevelop b/moo.kdevelop index b23add95..b7da93c7 100644 --- a/moo.kdevelop +++ b/moo.kdevelop @@ -46,7 +46,7 @@ - --enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode --without-python + --enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode build/debug kdevgccoptions kdevgppoptions @@ -54,13 +54,13 @@ -O0 -g3 -pg -O0 -g3 -pg - - - - - - - + + + + + + + --enable-all-gcc-warnings=fatal --enable-developer-mode diff --git a/moo/mooapp/Makefile.am b/moo/mooapp/Makefile.am index e926dff6..d04e1c3f 100644 --- a/moo/mooapp/Makefile.am +++ b/moo/mooapp/Makefile.am @@ -25,6 +25,7 @@ libmooapp_la_SOURCES = \ if USE_PYTHON libmooapp_la_SOURCES += \ + mooapp-python.h \ mooappinput.c \ mooappinput.h \ moopythonconsole.c \ diff --git a/moo/mooapp/mooapp-pygtk.override b/moo/mooapp/mooapp-pygtk.override index ead969b9..f77be030 100644 --- a/moo/mooapp/mooapp-pygtk.override +++ b/moo/mooapp/mooapp-pygtk.override @@ -4,6 +4,7 @@ headers #define NO_IMPORT_PYGOBJECT #include "pygobject.h" #include "mooapp/mooapp.h" +#include "mooapp/mooapp-python.h" %% modulename moo %% diff --git a/moo/mooapp/mooapp-python.h b/moo/mooapp/mooapp-python.h new file mode 100644 index 00000000..37fb0fb6 --- /dev/null +++ b/moo/mooapp/mooapp-python.h @@ -0,0 +1,35 @@ +/* + * mooapp/mooapp-python.h + * + * Copyright (C) 2004-2005 by Yevgen Muntyan + * + * 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 MOOAPP_MOOAPP_PYTHON_H +#define MOOAPP_MOOAPP_PYTHON_H + +#include "mooapp/mooapp.h" + +G_BEGIN_DECLS + + +void moo_app_python_execute_file (GtkWindow *parent); +gboolean moo_app_python_run_string (MooApp *app, + const char *string); +gboolean moo_app_python_run_file (MooApp *app, + const char *filename); + +GtkWidget *moo_app_get_python_console (MooApp *app); +void moo_app_show_python_console (MooApp *app); +void moo_app_hide_python_console (MooApp *app); + + +G_END_DECLS + +#endif /* MOOAPP_MOOAPP_PYTHON_H */ diff --git a/moo/mooapp/mooapp.c b/moo/mooapp/mooapp.c index 9e38ae4d..45ee56b1 100644 --- a/moo/mooapp/mooapp.c +++ b/moo/mooapp/mooapp.c @@ -18,11 +18,12 @@ #ifdef USE_PYTHON #include #include "mooapp/moopythonconsole.h" +#include "mooapp/mooapp-python.h" +#include "mooapp/moopython.h" +#include "mooapp/mooappinput.h" #endif #include "mooapp/mooapp-private.h" -#include "mooapp/moopython.h" -#include "mooapp/mooappinput.h" #include "mooedit/mooeditprefs.h" #include "mooedit/mooeditor.h" #include "mooui/moouiobject.h" @@ -485,9 +486,9 @@ const char *moo_app_get_rc_file_name (MooApp *app) } +#ifdef USE_PYTHON void moo_app_python_execute_file (G_GNUC_UNUSED GtkWindow *parent_window) { -#ifdef USE_PYTHON GtkWidget *parent; const char *filename = NULL; FILE *file; @@ -517,16 +518,12 @@ void moo_app_python_execute_file (G_GNUC_UNUSED GtkWindow *parent_ else PyErr_Print (); } -#else /* !USE_PYTHON */ - g_warning ("%s: python support is not compiled in", G_STRLOC); -#endif /* !USE_PYTHON */ } gboolean moo_app_python_run_file (G_GNUC_UNUSED MooApp *app, G_GNUC_UNUSED const char *filename) { -#ifdef USE_PYTHON FILE *file; PyObject *res; @@ -546,16 +543,12 @@ gboolean moo_app_python_run_file (G_GNUC_UNUSED MooApp *app, PyErr_Print (); return FALSE; } -#else /* !USE_PYTHON */ - g_warning ("%s: python support is not compiled in", G_STRLOC); - return FALSE; -#endif /* !USE_PYTHON */ } + gboolean moo_app_python_run_string (G_GNUC_UNUSED MooApp *app, G_GNUC_UNUSED const char *string) { -#ifdef USE_PYTHON PyObject *res; g_return_val_if_fail (string != NULL, FALSE); g_return_val_if_fail (moo_app_python != NULL, FALSE); @@ -568,59 +561,30 @@ gboolean moo_app_python_run_string (G_GNUC_UNUSED MooApp *app, PyErr_Print (); return FALSE; } -#else /* !USE_PYTHON */ - g_warning ("%s: python support is not compiled in", G_STRLOC); - return FALSE; -#endif /* !USE_PYTHON */ } GtkWidget *moo_app_get_python_console (G_GNUC_UNUSED MooApp *app) { -#ifdef USE_PYTHON g_return_val_if_fail (MOO_IS_APP (app), NULL); g_return_val_if_fail (moo_app_python != NULL, NULL); return GTK_WIDGET (moo_app_python->console); -#else /* !USE_PYTHON */ - g_warning ("%s: python support is not compiled in", G_STRLOC); - return NULL; -#endif /* !USE_PYTHON */ } + void moo_app_show_python_console (G_GNUC_UNUSED MooApp *app) { -#ifdef USE_PYTHON g_return_if_fail (MOO_IS_APP (app)); g_return_if_fail (moo_app_python != NULL); gtk_window_present (GTK_WINDOW (moo_app_python->console)); -#else /* !USE_PYTHON */ - g_warning ("%s: python support is not compiled in", G_STRLOC); -#endif /* !USE_PYTHON */ } + void moo_app_hide_python_console (G_GNUC_UNUSED MooApp *app) { -#ifdef USE_PYTHON g_return_if_fail (MOO_IS_APP (app)); g_return_if_fail (moo_app_python != NULL); gtk_widget_hide (GTK_WIDGET (moo_app_python->console)); -#else /* !USE_PYTHON */ - g_warning ("%s: python support is not compiled in", G_STRLOC); -#endif /* !USE_PYTHON */ -} - - -MooEditor *moo_app_get_editor (MooApp *app) -{ - g_return_val_if_fail (MOO_IS_APP (app), NULL); - return app->priv->editor; -} - - -const MooAppInfo*moo_app_get_info (MooApp *app) -{ - g_return_val_if_fail (MOO_IS_APP (app), NULL); - return app->priv->info; } @@ -637,6 +601,21 @@ static guint strv_length (char **argv) return len; } +#endif /* !USE_PYTHON */ + + +MooEditor *moo_app_get_editor (MooApp *app) +{ + g_return_val_if_fail (MOO_IS_APP (app), NULL); + return app->priv->editor; +} + + +const MooAppInfo*moo_app_get_info (MooApp *app) +{ + g_return_val_if_fail (MOO_IS_APP (app), NULL); + return app->priv->info; +} static gboolean moo_app_init_real (MooApp *app) @@ -906,14 +885,7 @@ static void install_actions (MooApp *app, GType type) "visible", TRUE, "no-accel", TRUE, NULL); -#else /* !USE_PYTHON */ - moo_ui_object_class_new_action (klass, - "id", "PythonMenu", - "dead", TRUE, - NULL); -#endif /* !USE_PYTHON */ - /* this one can be compiled in since it defined and does nothing when !USE_PYTHON */ moo_ui_object_class_new_action (klass, "id", "ExecuteScript", "name", "Execute Script", @@ -923,7 +895,6 @@ static void install_actions (MooApp *app, GType type) "closure::callback", moo_app_python_execute_file, NULL); -#ifdef USE_PYTHON moo_ui_object_class_new_action (klass, "id", "ShowConsole", "name", "Show Console", @@ -933,6 +904,11 @@ static void install_actions (MooApp *app, GType type) "closure::callback", moo_app_show_python_console, "closure::proxy-func", moo_app_get_instance, NULL); +#else /* !USE_PYTHON */ + moo_ui_object_class_new_action (klass, + "id", "PythonMenu", + "dead", TRUE, + NULL); #endif /* USE_PYTHON */ g_type_class_unref (klass); diff --git a/moo/mooapp/mooapp.h b/moo/mooapp/mooapp.h index c23d1986..6b28eef5 100644 --- a/moo/mooapp/mooapp.h +++ b/moo/mooapp/mooapp.h @@ -102,16 +102,6 @@ const char *moo_app_get_rc_file_name (MooApp *app); const char *moo_app_get_input_pipe_name (MooApp *app); const char *moo_app_get_application_dir (MooApp *app); -void moo_app_python_execute_file (GtkWindow *parent); -gboolean moo_app_python_run_string (MooApp *app, - const char *string); -gboolean moo_app_python_run_file (MooApp *app, - const char *filename); - -GtkWidget *moo_app_get_python_console (MooApp *app); -void moo_app_show_python_console (MooApp *app); -void moo_app_hide_python_console (MooApp *app); - MooEditor *moo_app_get_editor (MooApp *app); void moo_app_prefs_dialog (GtkWidget *parent); diff --git a/moo/mooedit/mooedit-pygtk.override b/moo/mooedit/mooedit-pygtk.override index 38d27c7f..9909864b 100644 --- a/moo/mooedit/mooedit-pygtk.override +++ b/moo/mooedit/mooedit-pygtk.override @@ -8,6 +8,7 @@ headers #include #include #include "mooedit/mooeditor.h" +#include "mooedit/mooeditdialogs.h" #include "mooedit/mooeditsearch.h" %% modulename moo diff --git a/moo/mooui/mooui-pygtk.defs b/moo/mooui/mooui-pygtk.defs index af5cdd4a..4135fc8e 100644 --- a/moo/mooui/mooui-pygtk.defs +++ b/moo/mooui/mooui-pygtk.defs @@ -204,12 +204,6 @@ (return-type "const-char*") ) -(define-method get_path - (of-object "MooAction") - (c-name "moo_action_get_path") - (return-type "const-char*") -) - (define-method get_accel_path (of-object "MooAction") (c-name "moo_action_get_accel_path")