Updated some constructors, added some virtuals

This commit is contained in:
Yevgen Muntyan 2006-04-29 11:51:32 -05:00
parent b934ad8c18
commit ea47d2323f
4 changed files with 68 additions and 12 deletions

View File

@ -36,7 +36,7 @@
<kdevautoproject>
<general>
<activetarget>moo/libmoo.la</activetarget>
<useconfiguration>optimized</useconfiguration>
<useconfiguration>debug</useconfiguration>
</general>
<run>
<mainprogram>./medit</mainprogram>

View File

@ -24,10 +24,10 @@ class CodeSink(object):
if l[-1]:
l.append('')
return '\n'.join(l)
def writeln(self, line=''):
raise NotImplementedError
def indent(self, level=4):
'''Add a certain ammount of indentation to all lines written
from now on and until unindent() is called'''
@ -75,10 +75,10 @@ class ReverseWrapper(object):
assert isinstance(cname, str)
self.cname = cname
## function object we will call, or object whose method we will call
## function object we will call, or object whose method we will call
self.called_pyobj = None
## name of method of self.called_pyobj we will call
self.method_name = None
self.method_name = None
self.is_static = is_static
self.parameters = []
@ -209,7 +209,7 @@ class ReverseWrapper(object):
argc = None
self.body.writeln()
if py_args != "NULL":
self.write_code("py_args = PyTuple_New(%s);" % argc,
cleanup="Py_DECREF(py_args);")
@ -243,7 +243,7 @@ class ReverseWrapper(object):
failure_expression="!py_retval")
else:
self.add_declaration("PyObject *py_method;")
self.write_code("py_method = PyObject_GetAttrString(%s, \"%s\");"
self.write_code("py_method = PyObject_GetAttrString(%s, (char*) \"%s\");"
% (self.called_pyobj, self.method_name),
cleanup="Py_DECREF(py_method);",
failure_expression="!py_method")
@ -251,7 +251,7 @@ class ReverseWrapper(object):
% (py_args,),
cleanup="Py_DECREF(py_retval);",
failure_expression="!py_retval")
self.return_type.write_conversion()
sink.indent()

View File

@ -1398,6 +1398,11 @@
;; From moo/mooedit/mooedit-actions.h
(define-virtual check_state
(of-object "MooEditAction")
(return-type "gboolean")
)
(define-function moo_edit_action_new
(c-name "moo_edit_action_new")
(is-constructor-of "MooEditAction")

View File

@ -1266,7 +1266,7 @@
(c-name "moo_prefs_dialog_page_new")
(is-constructor-of "MooPrefsDialogPage")
(return-type "GtkWidget*")
(parameters
(properties
'("const-char*" "label")
'("const-char*" "icon_stock_id")
)
@ -1360,6 +1360,12 @@
;; From ../mooutils/moowindow.h
(define-function moo_window_new
(c-name "moo_window_new")
(is-constructor-of "MooWindow")
(return-type "GtkWidget*")
)
(define-method close
(of-object "MooWindow")
(c-name "moo_window_close")
@ -1753,7 +1759,7 @@
(c-name "moo_paned_new")
(is-constructor-of "MooPaned")
(return-type "GtkWidget*")
(parameters
(properties
'("MooPanePosition" "pane_position")
)
)
@ -1970,7 +1976,7 @@
(c-name "moo_undo_mgr_new")
(is-constructor-of "MooUndoMgr")
(return-type "MooUndoMgr*")
(parameters
(properties
'("GObject*" "document")
)
)
@ -2290,6 +2296,51 @@
)
(define-virtual create_menu_item
(of-object "MooAction")
(return-type "GtkWidget*")
)
(define-virtual create_tool_item
(of-object "MooAction")
(return-type "GtkWidget*")
(parameters
'("GtkWidget*" "toolbar")
'("int" "position")
'("MooToolItemFlags" "flags")
)
)
(define-virtual add_proxy
(of-object "MooAction")
(return-type "none")
(parameters
'("GtkWidget*" "proxy")
)
)
(define-virtual activate
(of-object "MooAction")
(return-type "none")
)
(define-virtual set_sensitive
(of-object "MooAction")
(return-type "none")
(parameters
'("gboolean" "sensitive")
)
)
(define-virtual set_visible
(of-object "MooAction")
(return-type "none")
(parameters
'("gboolean" "visible")
)
)
;; From ../mooutils/mooprefs.h
(define-function prefs_load
@ -2632,7 +2683,7 @@
(c-name "moo_file_dialog_new")
(is-constructor-of "MooFileDialog")
(return-type "MooFileDialog*")
(parameters
(properties
'("MooFileDialogType" "type")
'("GtkWidget*" "parent" (null-ok) (default "NULL"))
'("gboolean" "multiple" (null-ok) (default "FALSE"))