Moved MooApp python methods declarations to mooapp-python.h
This commit is contained in:
parent
aa7243eb99
commit
3bac86e8ca
16
moo.kdevelop
16
moo.kdevelop
@ -46,7 +46,7 @@
|
||||
</run>
|
||||
<configurations>
|
||||
<debug>
|
||||
<configargs>--enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode --without-python</configargs>
|
||||
<configargs>--enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode</configargs>
|
||||
<builddir>build/debug</builddir>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
@ -54,13 +54,13 @@
|
||||
<cflags>-O0 -g3 -pg</cflags>
|
||||
<cxxflags>-O0 -g3 -pg</cxxflags>
|
||||
<envvars/>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<f77flags/>
|
||||
<topsourcedir></topsourcedir>
|
||||
<cppflags></cppflags>
|
||||
<ldflags></ldflags>
|
||||
<ccompilerbinary></ccompilerbinary>
|
||||
<cxxcompilerbinary></cxxcompilerbinary>
|
||||
<f77compilerbinary></f77compilerbinary>
|
||||
<f77flags></f77flags>
|
||||
</debug>
|
||||
<optimized>
|
||||
<configargs>--enable-all-gcc-warnings=fatal --enable-developer-mode</configargs>
|
||||
|
@ -25,6 +25,7 @@ libmooapp_la_SOURCES = \
|
||||
|
||||
if USE_PYTHON
|
||||
libmooapp_la_SOURCES += \
|
||||
mooapp-python.h \
|
||||
mooappinput.c \
|
||||
mooappinput.h \
|
||||
moopythonconsole.c \
|
||||
|
@ -4,6 +4,7 @@ headers
|
||||
#define NO_IMPORT_PYGOBJECT
|
||||
#include "pygobject.h"
|
||||
#include "mooapp/mooapp.h"
|
||||
#include "mooapp/mooapp-python.h"
|
||||
%%
|
||||
modulename moo
|
||||
%%
|
||||
|
35
moo/mooapp/mooapp-python.h
Normal file
35
moo/mooapp/mooapp-python.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* mooapp/mooapp-python.h
|
||||
*
|
||||
* Copyright (C) 2004-2005 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 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 */
|
@ -18,11 +18,12 @@
|
||||
#ifdef USE_PYTHON
|
||||
#include <Python.h>
|
||||
#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);
|
||||
|
@ -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);
|
||||
|
@ -8,6 +8,7 @@ headers
|
||||
#include <gtksourceview/gtksourceundomanager.h>
|
||||
#include <gtksourceview/gtksourceview-typebuiltins.h>
|
||||
#include "mooedit/mooeditor.h"
|
||||
#include "mooedit/mooeditdialogs.h"
|
||||
#include "mooedit/mooeditsearch.h"
|
||||
%%
|
||||
modulename moo
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user