summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* add doc comments.PYGTK_1_99_16James Henstridge2003-03-133-0/+197
| | | | | | | | | | 2003-03-13 James Henstridge <james@daa.com.au> * gobjectmodule.c: add doc comments. * pygobject.c: add doc comments. * pygboxed.c: add doc comments.
* add some documentation.James Henstridge2003-03-121-0/+100
| | | | | | 2003-03-12 James Henstridge <james@daa.com.au> * pygtype.c: add some documentation.
* the GObject should own a ref to the wrapper. (pygobject_new): get rid ofJames Henstridge2003-03-072-69/+49
| | | | | | | | | | | | | | | | | | | | 2003-03-06 James Henstridge <james@daa.com.au> * pygobject.c (pygobject_register_wrapper): the GObject should own a ref to the wrapper. (pygobject_new): get rid of the hasref code, and make sure that the GObject owns a ref to the wrapper if we create it. (pygobject_dealloc): get rid of the hasref code. If we get this far, the wrapper is dead. (pygobject_traverse): if the GObject's refcount == 1, then traverse to self. (pygobject_clear): clear self->obj and self->inst_dict. (pygobject_register_class): set tp_clear() so that things actually work. Without this, there was no tp_clear method for subclasses of GObject. * pygobject.h: remove hasref member, hopefully not needed if relying on cycle GC.
* Unblock threads before invalidating our closures, since this might triggerJon Trowbridge2003-03-043-7/+34
| | | | | | | | | | | | | | | | | | | 2003-03-04 Jon Trowbridge <trow@ximian.com> * pygobject.c (pygobject_dealloc): Unblock threads before invalidating our closures, since this might trigger a destructor that needs to execute python code. (pygobject_clear): Ditto. * pygboxed.c (pyg_boxed_dealloc): Unblock threads before freeing the boxed type, since the destructor may need to execute python code. (pyg_boxed_new): Block threads while we make our Py* calls. (pyg_pointer_new): Block threads while we make our Py* calls. * gobjectmodule.c (pyg_object_set_property): We need to block threads before our call to pygobject_new. (pyg_object_get_property): Ditto.
* Fix function name in exception.Johan Dahlin2003-03-021-1/+1
| | | | * gobjectmodule.c (pyg_io_add_watch): Fix function name in exception.
* Small typo.Johan Dahlin2003-02-271-1/+1
| | | | | | * dsextras.py (getstatusoutput): Small typo. * setup.py: Cut the doclines, to make the windows installer happy
* Added win32 support and some rearrangements. Largely based upon patch byJohan Dahlin2003-02-271-49/+72
| | | | | * setup.py, dsextras.py: Added win32 support and some rearrangements. Largely based upon patch by Cedric Gustin.
* Added.Johan Dahlin2003-02-081-6/+36
| | | | | | | | * pygtk-2.0.pc.in (codegendir): Added. * setup.py: Added Numeric and gtkgl support (gtkgl untested). * dsextras.py: Updated.
* Fix template bustage.Johan Dahlin2003-01-241-1/+1
| | | | * dsextras.py (InstallLib.add_template_option): Fix template bustage.
* Import codegen here instead, needs to be fixed in the future though.Johan Dahlin2003-01-211-4/+14
| | | | | | | * dsextras.py (Template.generate): Import codegen here instead, needs to be fixed in the future though. * Makefile.am (EXTRA_DIST): Added dsextras.py
* Add GMainContext bindings and complete the GMainLoop bindings. FixesJohan Dahlin2003-01-212-12/+173
| | | | | * gobjectmodule.c: Add GMainContext bindings and complete the GMainLoop bindings. Fixes #102362.
* Splitted out from setup.py. It should be reusable for gnome-python andJohan Dahlin2003-01-211-0/+213
| | | | | | * dsextras.py: Splitted out from setup.py. It should be reusable for gnome-python and other extensions that uses pygtk. Fixes #103615
* Check if a directory is empty before adding it to the path. Also added aJohan Dahlin2003-01-191-2/+10
| | | | | | * pygtk.py (_get_available_versions): Check if a directory is empty before adding it to the path. Also added a few comments. Fixes #103876 (Ross Burton).
* use os.path.join in a few more placesJohan Dahlin2003-01-182-6/+113
| | | | | | | | | | | * setup.py: use os.path.join in a few more places * pygobject-private.h: Add PyGMainLoop struct and type * gobjectmodule.c (_wrap_g_main_loop_new, _wrap_g_main_loop_quit) (_wrap_g_main_loop_is_running, _wrap_g_main_loop_run): Added GMainLoop wrapper. (initgobject): Register wrapper in gobject.MainLoop
* In my fix for bug #102756 on 2003-01-08, I should have used calls toJon Trowbridge2003-01-171-5/+5
| | | | | | | | | | | | | | | | | 2003-01-17 Jon Trowbridge <trow@ximian.com> * pygobject.c (pygobject_dealloc): In my fix for bug #102756 on 2003-01-08, I should have used calls to pyg_unblock_threads()/ pyg_block_threads() instead of directly calling the Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS macros. The macros don't update our local thread lock counts, causing problems in cases where the finalization of one object triggers the finalization of another. (When I say "problems", I of course mean "horrible crashes and mysterious race conditions".) * gtk/gtk-types.c (pygtk_style_helper_dealloc, pygtk_style_helper_setitem, pygtk_tree_model_row_dealloc, pygtk_tree_model_row_iter_dealloc): See above.
* Wrap Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS around the call toJon Trowbridge2003-01-081-1/+7
| | | | | | | | | | | | | | | | | | | | | 2003-01-08 Jon Trowbridge <trow@ximian.com> * pygobject.c (pygobject_dealloc): Wrap Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS around the call to g_object_unref. We need to do this because the object finalizers might trigger other code that has to acquire the interpreter lock, causing a deadlock. Fixes #102756. * gtk/gtk-types.c (pygtk_style_helper_dealloc): Wrap the call to g_object_unref in Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS. This should let us avoid other instances of bug #102756. (pygtk_style_helper_setitem): Ditto. (pygtk_tree_model_row_dealloc): Ditto. (pygtk_tree_model_row_iter_dealloc): Ditto. * gtk/gdk.override (pygdk_unblock_threads, pygdk_unblock_threads): Restored David I Lehn's patch (#98380). His patch was fine --- it just caused bug #102756 to emerge.
* Doh! Paper bagJohan Dahlin2003-01-081-3/+5
|
* Rewrite using glob.glob, with python2.2 glob uses fnmatch.filter with isJohan Dahlin2003-01-071-10/+15
| | | | | | | * pygtk.py (_get_available_versions): Rewrite using glob.glob, with python2.2 glob uses fnmatch.filter with is an optimized version of what we did before. _get_available_versions is now roughly 5 times faster.
* FixelifixJohan Dahlin2003-01-011-3/+3
|
* Add default values.Johan Dahlin2003-01-011-0/+11
| | | | | | | | | | | | | | 2003-01-01 Johan Dahlin <jdahlin@async.com.br> * gtk/gtk.defs (GtkTreeView.scroll_to_cell): Add default values. * gtk/gtk.override (_wrap_gtk_tree_selection_get_selected): Check the mode before calling gtk_tree_selection_get_selected, this avoids an abort() in gtk+. * pygtk.py: Updated to fix #102180, so .require() can be called twice and won't do anything the second time (eg, not raise an error) based upon patch by warner-gnome.bugzilla@lothar.com
* Improve threading support by adding pyg_thread_block/unblock around allJohan Dahlin2002-12-281-1/+17
| | | | | | | | * gobjectmodule.c, gtk/gtk.override, gtk/pygtkcellrenderer.c, gtk/pygtktreemodel: Improve threading support by adding pyg_thread_block/unblock around all PyObject_Call* and g_object_refs. Based upon patch by Jon Trowbridge. Fixes #99102.
* (pygobject_chain_from_overridden): check ifPYGTK_1_99_14James Henstridge2002-12-241-0/+6
| | | | g_signal_get_invocation_hint() returns NULL.
* add abstract type check here too. (pygobject_init): make this code moreJames Henstridge2002-12-242-92/+84
| | | | | | | | | | | | 2002-12-24 James Henstridge <james@daa.com.au> * pygobject.c (pygobject_init): add abstract type check here too. (pygobject_init): make this code more similar to pyg_object_new, so that it is easier to fix bugs in the future. * gobjectmodule.c (pyg_object_new): handle case of no keyword arguments. (pyg_object_new): refuse to instantiate an abstract type.
* ChangeLogJohan Dahlin2002-12-051-1/+1
|
* If the directory doesn't exist skip it. If not, it breaks when doingJohan Dahlin2002-11-281-0/+1
| | | | | * pygtk.py (_get_available_versions): If the directory doesn't exist skip it. If not, it breaks when doing os.listdir.
* get rid of pyg_handler_marshal and pyg_input_marshal, which were the lastJames Henstridge2002-11-191-24/+85
| | | | | | | | | | | | | | | | | | | | | | | | 2002-11-19 James Henstridge <james@daa.com.au> * gtk/gtkobject-support.c: get rid of pyg_handler_marshal and pyg_input_marshal, which were the last bits of code using the old GtkArg APIs in gtk. * gtk/gtk.override: remove wrappers for gtk_idle_add, gtk_timeout_add and gtk_input_add. (_wrap_gtk_quit_add): change so that it doesn't use pyg_handler_marshal. * gtk/__init__.py: set the TRUE and FALSE constants to True and False if possible. Fall back to 0/1 otherwise. (*): bind idle, timeout and input functions to gobject equivalents. * gobjectmodule.c (get_handler_priority): helper function to get priority value as a keyword argument. (pyg_idle_add): convert priority arg to an optional keyword argument. (pyg_timeout_add): and here. (pyg_io_add_watch): and here.
* add a wrapper for g_idle_add. (pyg_timeout_add): and a wrapper forJames Henstridge2002-11-181-0/+189
| | | | | | | | | 2002-11-18 James Henstridge <james@daa.com.au> * gobjectmodule.c (pyg_idle_add): add a wrapper for g_idle_add. (pyg_timeout_add): and a wrapper for g_timeout_add. (pyg_io_add_watch): and a wrapper for g_io_add_watch. (initgobject): add constants.
* set up closure correctly. Fix from bug #96922.James Henstridge2002-11-161-2/+2
| | | | | | | | 2002-11-16 James Henstridge <james@daa.com.au> * pygobject.c (pygobject_connect_object): set up closure correctly. Fix from bug #96922. (pygobject_connect_object_after): and here.
* (pyg_value_as_pyobject): when converting G_TYPE_BOOLEAN values toJames Henstridge2002-11-161-12/+13
| | | | | python objects, return one of Py_True or Py_False, so that Python 2.3 will return an instance of bool.
* if python object is None, set GValue to NULL for boxed, pointer andJames Henstridge2002-11-161-47/+53
| | | | | | | | | 2002-11-16 James Henstridge <james@daa.com.au> * pygtype.c (pyg_value_from_pyobject): if python object is None, set GValue to NULL for boxed, pointer and GObject types. (pyg_value_as_pyobject): convert G_TYPE_POINTER values to gobject.GPointer python objects.
* fix up misspelling.James Henstridge2002-08-261-3/+3
| | | | | | | | | | 2002-08-26 James Henstridge <james@daa.com.au> * codegen/docgen.py (DocWriter.write_full_hierarchy): fix up misspelling. * pygtype.c (pyg_value_from_pyobject): fix typo from when I was applying Thomas's patch.
* han Dahlin <jdahlin@telia.com>PYGTK_1_99_13Johan Dahlin2002-08-201-2/+2
| | | | | | | | han Dahlin <jdahlin@telia.com> Patch from Arjan J. Molenaar: * gobjectmodule.c (pyg_type_register): Don't unref borrowed references.
* same here.James Henstridge2002-08-181-0/+57
| | | | | | | | | | 2002-08-18 James Henstridge <james@daa.com.au> * gtk/Makefile.am: same here. * Makefile.am: install in a gtk-2.0 subdir of site-packages. * pygtk.py: new file to help with pygtk version parallel install.
* unref object_wrapper. (pyg_object_get_property): unref object_wrapper.James Henstridge2002-08-181-1/+3
| | | | | | | | 2002-08-18 James Henstridge <james@daa.com.au> * gobjectmodule.c (pyg_object_set_property): unref object_wrapper. (pyg_object_get_property): unref object_wrapper. (from patch by Arjan Molenaar on bug #71021).
* don't need to manually sink. (_wrap_gtk_tree_view_column_new): same here.James Henstridge2002-08-184-29/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-08-18 James Henstridge <james@daa.com.au> * gtk/gtk.override (_wrap_gtk_clist_new_with_titles): don't need to manually sink. (_wrap_gtk_tree_view_column_new): same here. (_wrap_gtk_button_new): same here. (_wrap_gtk_toggle_button_new): same here. (_wrap_gtk_check_button_new): same here. (_wrap_gtk_radio_button_new): same here. (_wrap_gtk_list_item_new): same here. (_wrap_gtk_menu_item_new): same here. (_wrap_gtk_check_menu_item_new): same here. (_wrap_gtk_radio_menu_item_new): same here. (_wrap_gtk_image_menu_item_new): same here. (_wrap_gtk_ctree_new_with_titles): same here. (_wrap_gtk_dialog_new_with_buttons): same here. (_wrap_gtk_message_dialog_new): same here. (_wrap_gtk_progress_bar_new_with_adjustment): same here. * gtk/gtkmodule.c (sink_gtkobject): function to sink a GtkObject if it is floating. (init_gtk): register sink_gtkobject for sinking GtkObjects. * codegen/codegen.py (GObjectWrapper.get_initial_constructor_substdict): get rid of gtkobjectsink bit of code. * pygobject.c (pygobject_register_sinkfunc): new function to register a function to get rid of the floating reference from an object. (sink_object): run a sinkfunc for an object if it has been registered. (pygobject_new): call sink_object (pygobject_register_wrapper): call sink_object.
* allow None when converting to string GValue (bug picked up by ThomasJames Henstridge2002-08-171-1/+3
| | | | | | | | | 2002-08-17 James Henstridge <james@daa.com.au> * pygtype.c (pyg_value_from_pyobject): allow None when converting to string GValue (bug picked up by Thomas Leonard. * gtk/gtk.defs (scroll_to_cell): allow column to be None (bug #90398).
* These changes help with win32 compat.PYGTK_1_99_12James Henstridge2002-07-123-8/+16
| | | | | | | | | | | | | | | 2002-07-12 James Henstridge <james@daa.com.au> These changes help with win32 compat. * pygboxed.c (PyGBoxed_Type): set tp_alloc and tp_new to NULL. (PyGPointer_Type): same here. * gobjectmodule.c (PyGInterface_Type): set tp_alloc and tp_new to NULL. (initgobject): set tp_new and tp_alloc for various types. * pygobject.c (PyGObject_Type): set tp_alloc and tp_new to NULL.
* Reworking of Arjan Molenaar's (arjanmolenaar@hetnet.nl) patch from bugPYGTK_1_99_11James Henstridge2002-07-095-19/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-07-09 James Henstridge <james@daa.com.au> Reworking of Arjan Molenaar's (arjanmolenaar@hetnet.nl) patch from bug 71435. * gtk/libglade.override (connect_one): watch the closure. (connect_many): watch the closure. * gtk/gtk.override (_wrap_gtk_toolbar_append_item): watch closure for signal. (_wrap_gtk_toolbar_prepend_item): same here. (_wrap_gtk_toolbar_insert_item): same here. (_wrap_gtk_toolbar_insert_stock): same here. (_wrap_gtk_toolbar_append_element): same here. (_wrap_gtk_toolbar_prepend_element): same here. (_wrap_gtk_toolbar_insert_element): same here. * pygobject.h (_PyGObject_Functions): add pygobject_watch_closure to the list of exported functions. * pygobject.c (pygobject_watch_closure): new function to watch a closure. We perform cyclic garbage collection on watched closures. The closure will automatically be unwatched when it gets invalidated. (pygobject_traverse): traverse watched closures as well. (pygobject_clear): invalidate all watched closures (pygobject_dealloc): invalidate watched closures on dealloc too. (PyGObject_Type): register the invalidate handler. (pygobject_connect): watch the closure we connect here. (pygobject_connect_after): same here.. (pygobject_connect_object): same here. (pygobject_connect_object_after): same here. * pygtype.c (pyg_closure_new): clean up closure on invalidate, rather than finalize (on invalidate, we break references). * pygobject.h (PyGObject): add closures member to store references to PyGClosures.
* apply another memory leak fix from Arjan (from bug #87413).James Henstridge2002-07-081-0/+4
| | | | | | | | | | 2002-07-08 James Henstridge <james@daa.com.au> * pygobject.c (pygobject_connect): apply another memory leak fix from Arjan (from bug #87413). (pygobject_connect_after): equivalent fix here. (pygobject_connect_object): and here. (pygobject_connect_object_after): and here.
* add __grefcount__ property.James Henstridge2002-07-071-1/+8
| | | | | | 2002-07-07 James Henstridge <james@daa.com.au> * pygobject.c (pygobject_get_refcount): add __grefcount__ property.
* update to use this function. (ArgMatcher.register_boxed): short circuit ifJames Henstridge2002-07-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-07-07 James Henstridge <james@daa.com.au> * codegen/argtypes.py (GtkTreePathArg.write_return): update to use this function. (ArgMatcher.register_boxed): short circuit if there is already a handler for the boxed type (helps with setting custom handlers for boxed types). * gtk/gtk-types.c (pygdk_rectangle_from_pyobject): new function to parse a GdkRectangle from a PyObject. * gtk/pygtktreemodel.c (pygtk_generic_tree_model_get_path): print a warning if the return value could not be converted to a GtkTreePath. * gtk/gtk.override (_wrap_gtk_tree_model_get_value): don't assume tree paths are tuples. * codegen/argtypes.py (GtkTreePathArg.write_param): fix up code generator to get rid of assumption that tree paths are tuples, and catch case where pygtk_tree_path_from_pyobject() returns NULL. * gtk/gtk-types.c (pygtk_tree_path_from_pyobject): change so that we treat an integer PyObject as a tree path with a single index. * pygtype.c (pyg_closure_marshal): apply patch from Arjan Molenaar <arjanmolenaar@hetnet.nl> that fixes a reference leak for the argument tuple passed to the callback. (pyg_signal_class_closure_marshal): apply similar fix here.
* Add GBoxed::copyJonathan Blandford2002-06-242-2/+83
| | | | | | | | | Sun Jun 23 11:10:30 2002 Jonathan Blandford <jrb@gnome.org> * pygboxed.c: Add GBoxed::copy * pygobject.c (pygobject_init): take kwargs so we can pass construct-only arguments to our initialization function.
* copy boxed arguments.James Henstridge2002-06-235-13/+28
| | | | | | | | | | | | | | | | | | | | 2002-06-23 James Henstridge <james@daa.com.au> * gtk/gtk.override (_wrap_gtk_tree_sortable_get_sort_column_id): copy boxed arguments. * pygobject.h: fix up prototypes. * gobjectmodule.c (pyg_object_set_property): copy boxed arguments. * pygobject.c (pygobject_get_property): copy boxed arguments here. (pygobject_emit): same here. (pygobject_chain_from_overridden): same here. * pygtype.c (pyg_value_as_pyobject): add "copy_boxed" argument to this function. (pyg_closure_marshal): pass FALSE for copy_boxed argument. (pyg_signal_class_closure_marshal): same here.
* if a value holds a PyObject*, the code that is getting the value isMatt Wilson2002-06-171-3/+9
| | | | | | | | 2002-06-17 Matt Wilson <msw@redhat.com> * pygtype.c (pyg_value_as_pyobject): if a value holds a PyObject*, the code that is getting the value is expecting a valid object. Translate NULL pointers to Py_None.
* decref the exception instance after raising the error.James Henstridge2002-06-161-0/+1
| | | | | | | 2002-06-15 James Henstridge <james@daa.com.au> * gobjectmodule.c (pyg_error_check): decref the exception instance after raising the error.
* the path argument must be a tuple. Ints are not automatically converted toMatt Wilson2002-05-311-6/+9
| | | | | | | | | | | | 2002-05-31 Matt Wilson <msw@redhat.com> * examples/pygtk-demo/demos/list_store.py (fixed_toggled): the path argument must be a tuple. Ints are not automatically converted to tuples any more. * pygtype.c (pyg_value_as_pyobject): change the behavior of G_TYPE_UINT to match the code generator's output on 32 bit systems.
* add support for G_TYPE_INTERFACE, provided the interface has a prereq onJames Henstridge2002-05-151-6/+27
| | | | | | | | | 2002-05-16 James Henstridge <james@daa.com.au> * pygtype.c (pyg_value_from_pyobject): add support for G_TYPE_INTERFACE, provided the interface has a prereq on G_TYPE_OBJECT. (pyg_value_as_pyobject): same here.
* add handler for G_TYPE_PARAM (fix bug #81695). (pyg_value_as_pyobject):James Henstridge2002-05-143-41/+54
| | | | | | | | 2002-05-14 James Henstridge <james@daa.com.au> * pygtype.c (pyg_value_from_pyobject): add handler for G_TYPE_PARAM (fix bug #81695). (pyg_value_as_pyobject): same in this function.
* allow override of autoconf and autoheaderPYGTK_1_99_9PYGTK_1_99_10Matt Wilson2002-03-191-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-03-19 Matt Wilson <msw@redhat.com> * autogen.sh: allow override of autoconf and autoheader * gtk/gtk.defs (GtkTreeModel.get_iter_root): use the gtk_tree_model_get_iter_first code, get_iter_root is going to be deprecated. (GtkTreeModel.get_iter_first): added * gtk/gtk.override (_wrap_gtk_tree_model_get_iter_root): check the return value of gtk_tree_model_get_iter_root and return None if it failed. Rename to _wrap_gtk_tree_model_get_iter_first. * codegen/codegen.py (write_class, write_interface, write_boxed write_pointer): use overrides.is_already_included to prevent from having the same override code included twice in one file. This allows two methods to point to the same function. * codegen/override.py (Overrides.is_already_included): added a function that returns true if the override code has been emitted already. 2002-03-11 Matt Wilson <msw@redhat.com> * gobjectmodule.c: remove pygobject_exception_notifiers and pyg_fatal_exceptions_notify.
* fix up property listing.PYGTK_1_99_8James Henstridge2002-03-161-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | 2002-03-16 James Henstridge <james@daa.com.au> * pygtype.c (add_property_docs): fix up property listing. * gtk/libglade.override: add modulename directive. * gtk/gdk.override: add modulename directive. * gtk/gtk.override: add modulename directive. * atk.override: add modulename directive. * pango.override: add modulename directive. * codegen/codegen.py (write_class): if override.modulename is set, put it into the classname. (write_interface): same here. (write_boxed): same here. (write_pointer): same here. * codegen/override.py (Overrides.__parse_override): add support for a "modulename" directive for overrides files.