Commit eb56b62b authored by Xavier Ordoquy's avatar Xavier Ordoquy Committed by Xavier Ordoquy

We do need to include ../src headers and PLANNER FLAGS

2004-07-30  Xavier Ordoquy  <xordoquy@linovia.com>

	* python/Makefile.am:
	We do need to include ../src headers and PLANNER FLAGS

	* python/planner-types.defs:
	* python/planner.defs:
	* python/planner.override:
	Added PlannerApplication and PlannerWindow to binding.

	* src/planner-python-plugin.c:
	Do more imports as bonobo is required for
	PlannerWindow.
	Replaced the project by window.
parent 3663b43a
2004-07-30 Xavier Ordoquy <xordoquy@linovia.com>
* python/Makefile.am:
We do need to include ../src headers and PLANNER FLAGS
* python/planner-types.defs:
* python/planner.defs:
* python/planner.override:
Added PlannerApplication and PlannerWindow to binding.
* src/planner-python-plugin.c:
Do more imports as bonobo is required for
PlannerWindow.
Replaced the project by window.
2004-07-30 Xavier Ordoquy <xordoquy@linovia.com>
* data/ui/Makefile.am:
......
NULL =
INCLUDES = \
-I../src/ \
-I$(top_srcdir) \
$(PYTHON_INCLUDES) \
$(PYGTK_CFLAGS) \
$(LIBPLANNER_CFLAGS) \
$(PLANNER_CFLAGS) \
$(NULL)
pkgpythondir = $(pythondir)/gtk-2.0
......@@ -36,4 +37,3 @@ EXTRA_DIST = \
--prefix $* $*.defs) > gen-$*.c \
&& cp gen-$*.c $*.c \
&& rm -f gen-$*.c
......@@ -70,6 +70,21 @@
(gtype-id "MRP_TYPE_TASK")
)
(define-object Application
(in-module "Planner")
(parent "MrpApplication")
(c-name "PlannerApplication")
(gtype-id "PLANNER_TYPE_APPLICATION")
)
(define-object Window
(in-module "Planner")
(parent "BonoboWindow")
(c-name "PlannerWindow")
(gtype-id "PLANNER_TYPE_MAIN_WINDOW")
)
;; Enumerations and flags ...
(define-enum Error
......
......@@ -1422,3 +1422,116 @@
)
;; From ../src/planner-window.h
(define-function planner_window_get_type
(c-name "planner_window_get_type")
(return-type "GType")
)
(define-function planner_window_new
(c-name "planner_window_new")
(is-constructor-of "PlannerWindow")
(return-type "GtkWidget*")
(parameters
'("PlannerApplication*" "app")
)
)
(define-method open
(of-object "PlannerWindow")
(c-name "planner_window_open")
(return-type "gboolean")
(parameters
'("const-gchar*" "uri")
)
)
(define-method get_ui_container
(of-object "PlannerWindow")
(c-name "planner_window_get_ui_container")
(return-type "BonoboUIContainer*")
)
(define-method get_project
(of-object "PlannerWindow")
(c-name "planner_window_get_project")
(return-type "MrpProject*")
)
(define-method get_application
(of-object "PlannerWindow")
(c-name "planner_window_get_application")
(return-type "PlannerApplication*")
)
(define-method check_version
(of-object "PlannerWindow")
(c-name "planner_window_check_version")
(return-type "none")
)
(define-method close
(of-object "PlannerWindow")
(c-name "planner_window_close")
(return-type "none")
)
(define-method show_day_type_dialog
(of-object "PlannerWindow")
(c-name "planner_window_show_day_type_dialog")
(return-type "none")
)
(define-method show_calendar_dialog
(of-object "PlannerWindow")
(c-name "planner_window_show_calendar_dialog")
(return-type "none")
)
(define-method get_cmd_manager
(of-object "PlannerWindow")
(c-name "planner_window_get_cmd_manager")
(return-type "PlannerCmdManager*")
)
;; From ../src/planner-application.h
(define-function planner_application_get_type
(c-name "planner_application_get_type")
(return-type "GType")
)
(define-function planner_application_new
(c-name "planner_application_new")
(is-constructor-of "PlannerApplication")
(return-type "PlannerApplication*")
)
(define-method new_window
(of-object "PlannerApplication")
(c-name "planner_application_new_window")
(return-type "GtkWidget*")
)
(define-method exit
(of-object "PlannerApplication")
(c-name "planner_application_exit")
(return-type "none")
)
(define-method get_recent_model
(of-object "PlannerApplication")
(c-name "planner_application_get_recent_model")
(return-type "EggRecentModel*")
)
(define-function planner_application_get_gconf_client
(c-name "planner_application_get_gconf_client")
(return-type "GConfClient*")
)
......@@ -7,12 +7,19 @@ headers
#include <libplanner/planner.h>
#include <libplanner/mrp-storage-module.h>
#include <bonobo.h>
#include "planner-application.h"
#include "planner-window.h"
#define PLANNER_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANNER_TYPE_MAIN_WINDOW, PlannerWindow))
%%
init
%%
modulename planner
%%
import gobject.GObject as PyGObject_Type
import bonobo.ui.Window as PyBonoboWindow_Type
%%
ignore-glob
*_get_type
......
......@@ -99,7 +99,7 @@ python_plugin_execute (const gchar *filename,
GHashTable *scripts)
{
PlannerPythonEnv *env;
MrpProject *project;
/* MrpProject *project; */
FILE *fp;
PyObject *pModule;
......@@ -110,7 +110,10 @@ python_plugin_execute (const gchar *filename,
/* Import pygtk */
pModule = PyRun_String ("import pygtk\n"
"pygtk.require('2.0')\n"
"import gtk\n",
"import gtk\n"
"import gnome\n"
"import bonobo\n"
"import bonobo.ui\n",
Py_file_input, env->globals, env->globals);
if (pModule == NULL) {
PyErr_Print ();
......@@ -127,9 +130,8 @@ python_plugin_execute (const gchar *filename,
return;
}
project = planner_window_get_project (window);
py_widget = pygobject_new ((GObject *) project);
PyDict_SetItemString (env->globals, "project", py_widget);
py_widget = pygobject_new ((GObject *) window);
PyDict_SetItemString (env->globals, "window", py_widget);
Py_DECREF (py_widget);
fp = fopen (filename,"r");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment