summaryrefslogtreecommitdiff
path: root/gtk/gtkobject-support.c
Commit message (Collapse)AuthorAgeFilesLines
* Make pygtk_boxed_unref_shared() also handle Py_NonePaul Pogonyshev2009-05-081-0/+4
| | | | Fixes bug #523001.
* Update the address of the FSF by replacing old bits with new ones. FixesTobias Mueller2009-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-30 Tobias Mueller <tobiasmue@gnome.org> Update the address of the FSF by replacing old bits with new ones. Fixes bug 577154. * pango.override: * atkrectangle.override: * ltihooks.py: * gtk/libglade.override: * gtk/gdkcolor.override: * gtk/gdk.override: * gtk/deprecation.py: * gtk/__init__.py: * gtk/_lazyutils.py: * gtk/gdkdraw.override: * gtk/gtk.override: * gtk/gtkcontainer.override: * gtk/gtkwidget.override: * gtk/gtkobject-support.c: * gtk/gtkiconview.override: * gtk/gtk-types.c: * gtk/gtkbuilder.override: * gtk/gdkwindow.override: * gtk/gtktreeview.override: * gtk/pygtktreemodel.c: * gtk/gtkunixprint.override: * gtk/gtkstyle.override: * gtk/gdkevent.override: * gtk/pygtktreemodel.h: * gtk/gtkctree.override: * gtk/libglademodule.c: * gtk/gtkwindow.override: * gtk/keysyms.py: * gtk/gdkgc.override: * gtk/gtkunixprintmodule.c: * gtk/gdkpixbuf.override: * gtk/gdkcairo.override: * gtk/gtkclist.override: * gtk/gtktextview.override: * gtk/pygtkcellrenderer.c: * gtk/gdkrectangle.override: * gtk/compat.py: * gtk/pygtkcellrenderer.h: * gtk/gtkmodule.c: * pangomodule.c: * atk.override: * COPYING: * pangocairomodule.c: * atkmodule.c: svn path=/trunk/; revision=3120
* Fix problems introduced in fix of #347273 and relatedGustavo J. A. M. Carneiro2006-09-161-0/+16
|
* Use pygtk_target_list_from_sequence and pygtk_target_list_to_list.John Finlay2006-06-141-1/+52
| | | | | | | | | | | | | | | | | | * gtk/gtktextview.override (_wrap_gtk_text_buffer_get_copy_target_list): * gtk/gtk.override (_wrap_gtk_drag_dest_find_target) (_wrap_gtk_drag_dest_get_target_list) (_wrap_gtk_drag_dest_set_target_list, _wrap_gtk_drag_begin) (_wrap_gtk_drag_source_get_target_list) (_wrap_gtk_drag_source_set_target_list) (_wrap_gtk_target_list_add_text_targets) (_wrap_gtk_target_list_add_image_targets) (_wrap_gtk_target_list_add_uri_targets) (_wrap_gtk_target_list_add_rich_text_targets): Use pygtk_target_list_from_sequence and pygtk_target_list_to_list. * gtk/gtkobject-support.c (pygtk_target_list_from_sequence) (pygtk_target_list_to_list): Add.
* Add. pygdk_atom_vector_from_sequenceJohn Finlay2006-06-131-0/+27
| | | | | | | | | | * gtk/pygtk-private.h: Add. pygdk_atom_vector_from_sequence * gtk/gtkobject-support.c (pygdk_atom_vector_from_sequence): Add. * gtk/gtk.override (_wrap_gtk_targets_include_rich_text) (_wrap_gtk_targets_include_uri, _wrap_gtk_targets_include_text) (_wrap_gtk_targets_include_image): Add.
* catch user_data == NULL in pygtk_custom_destroy_notifyGustavo J. A. M. Carneiro2005-10-151-0/+1
|
* make threading runtime optionalGustavo J. A. M. Carneiro2004-08-041-2/+2
|
* Clean up most functions here to have only one return path.Johan Dahlin2004-08-031-2/+4
| | | | | | | | | | | | | | | | | | * gtk/pygtktreemodel.c: Clean up most functions here to have only one return path. * gobject/pygobject.c (pygobject_emit): Protect g_value_unset by UNBLOCK/BLOCK_THREADS since it might call pygobject_free which will result in a deadlock. * gobject/gobjectmodule.c (pyg_thread_init): New function, move thread initalization stuff in here. * All over the place: Kill pyg_block/unblock_threads and use PyGILState and Py_BEGIN/END_ALLOW_THREADS. unblock [code] block calls are replaced by Py_BEGIN/END and block [code] unblock calls are replaced by PyGILState.
* add copyright notices, and update to LGPL 2.1.James Henstridge2003-06-261-1/+21
| | | | | | 2003-06-26 James Henstridge <james@daa.com.au> * (lots of stuff): add copyright notices, and update to LGPL 2.1.
* get rid of pyg_handler_marshal and pyg_input_marshal, which were the lastJames Henstridge2002-11-191-48/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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 overriden implementation that allows threads while waiting, so someJames Henstridge2002-01-071-143/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-01-07 James Henstridge <james@daa.com.au> * gtk/gdk.override (_wrap_gdk_threads_enter): add overriden implementation that allows threads while waiting, so some other thread has a chance to give up the gdk lock. * gtk/gtkmodule.c (functions): remove stuff. * gtk/pygtk-private.h: remove definitions here as well. * gtk/pygtk.h (_PyGtk_FunctionStruct): remove destroy notify and thread block stuff. * gtk/gtkobject-support.c: remove pygtk_destroy_notify. * gtk/gtk.override (pygtk_tree_foreach_marshal): move this function here from gtkobject-support.c, and don't bother blocking threads. (_wrap_gtk_tree_selection_selected_foreach): same here -- don't need to unblock threads. (pygtk_tree_selection_marshal): move this function here from gtkobject-support.c. Convert to use pyg_block_threads. (_wrap_gtk_dialog_run): add overriden implementation that unblocks threads. (_wrap_gtk_main): use pyg_block_threads (_wrap_gtk_main_iteration): same. (_wrap_gtk_item_factory_create_items): same here. (_wrap_gtk_menu_popup): same here. (_wrap_gtk_clist_set_row_data): use pyg_destroy_notify (_wrap_gtk_timeout_add): same here. (_wrap_gtk_idle_add): same here. (_wrap_gtk_quit_add): same here. (_wrap_gtk_input_add_full): same here. (_wrap_gtk_ctree_node_set_row_data): same here. * gtk/gtkobject-support.c: remove PyGTK_BLOCK_THREADS and PyGTK_UNBLOCK_THREADS macros. (pygtk_destroy_notify): use pyg_block_threads. (pygtk_custom_destroy_notify): same. (pygtk_handler_marshal): same. (pygtk_input_marshal): same. * gtk/gdk.override (_wrap_gdk_threads_init): register gdk lock based recursive threads block/unblock functions. If threading was disabled at compile time, then this function will error out. * gtk/gdk.defs (threads_enter, threads_leave, threads_leave): add functions. * gobjectmodule.c (functions): add destroy_notify here as well. * pygobject.h: add destroy_notify to the PyGObject_Functions vtable.
* always print and clear the exceptions in callback marshalers. People whoMatt Wilson2001-12-131-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | 2001-12-12 Matt Wilson <msw@redhat.com> * gobjectmodule.c (pyg_closure_marshal, pyg_signal_class_closure_marshal): always print and clear the exceptions in callback marshalers. People who want to catch these exceptions and make them fatal should use sys.excepthook. (pyg_fatal_exceptions_notify, pyg_fatal_exceptions_notify_add, pyg_fatal_exceptions_remove): remove now unused functions. Also remove them from the PyGObject_API. * gtk/pygtk.h (PyGtk_FatalExceptions): remove. * gtk/pygtk-private.h (PyGtk_FatalExceptions): remove. * gtk/gtkmodule.c (init_gtk): don't bother with PYGTK_FATAL_EXCEPTIONS. (pygtk_main_quit): remove unused code. * gtk/gtk.override (_wrap_gtk_item_factory_create_items, _wrap_gtk_menu_popup): likewise, always print and clear the exception.
* added PyGFatalExceptionFunc typedef, API wrapper forMatt Wilson2001-11-151-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2001-11-15 Matt Wilson <msw@redhat.com> * pygobject.h: added PyGFatalExceptionFunc typedef, API wrapper for pyg_fatal_exceptions_{add,remove}. * gobjectmodule.c (pyg_boxed_new): return NULL on assertion failures, #62814 (pyg_closure_new): actually assign swap_data to the closure. (pyg_fatal_exceptions_notify, pyg_fatal_exceptions_notify_add, pyg_fatal_exceptions_remove): added mechanism for gobjectmodule using modules to get a function called when a fatal exception happens in closures, etc. (pyg_closure_marshal, pyg_signal_class_closure_marshal): return NULL if a gobjectmodule using module registered a fatal exception function. * gtk/pygtk-private.h: added declarations for pygtk_custom_destroy_notify, pygtk_tree_selection_marshal, pygtk_tree_foreach_marshal. Added typedef for PyGtkCustomNotify. #62814 * gtk/gtkmodule.c (init_gtk): register stock items, #62814. Set up fatal exception stuff if PYGTK_FATAL_EXCEPTIONS is set. This isn't 100% done yet, gtk mainloop specific functions still need work. * gtk/gtkobject-support.c (pygtk_tree_selection_marshal): added, #62814 (pygtk_tree_foreach_marshal): added, #62814 (pygtk_custom_destroy_notify): added, #62814 * gtk/gtk.override (_wrap_gtk_tree_selection_set_select_function): added, #62814 (_wrap_gtk_tree_selection_selected_foreach): added, #62814
* remove dead code for GtkArg handling, etc. (also tidied up references toJames Henstridge2001-06-251-693/+0
| | | | | | | | | | | | | 2001-06-25 James Henstridge <james@daa.com.au> * gtk/gtkobject-support.c: remove dead code for GtkArg handling, etc. (also tidied up references to it in other files). 2001-06-24 James Henstridge <james@daa.com.au> * gtk/gtk-types.c: removed all traces of GdkFont. * gtk/gdk.defs (Font): add boxed type for font.
* removed all traces of GdkVisual.James Henstridge2001-06-241-16/+0
| | | | | | | | 2001-06-24 James Henstridge <james@daa.com.au> * gtk/gtk-types.c: removed all traces of GdkVisual. * gtk/gdk.defs (Visual): add boxed type for visual.
* more fixups to use pyg_type_from_object.James Henstridge2001-06-231-18/+4
| | | | | | | | | | | | | | | | | | | | | | 2001-06-23 James Henstridge <james@daa.com.au> * gobjectmodule.c (pyg_signal_new): more fixups to use pyg_type_from_object. * gtk/gtk.override (_wrap_gtk_accel_group_new): don't use PyGtkAccelGroup_New (not sure why I am fixing this -- will change soon anyway). (_wrap_gtk_tree_store_set_value): use pyg_type_from_object here. (_wrap_gtk_list_store_set_value): same here. * codegen/argtypes.py (CustomBoxedArg): rename from BoxedArg. (BoxedArg): new code for standardised PyGBoxed handling. (ArgMatcher.register_custom_boxed): rename from register_boxed (ArgMatcher.register_boxed): new function for PyGBoxed types. (arg): use ArgMatcher.register_boxed to register GtkAccelGroup. * pygobject.h (pyg_boxed_check): change macro to check against the typecode, rather than python wrapper type.
* comment out, as container args have been switched to properties now.James Henstridge2001-06-211-1/+1
| | | | | | | | | | | | | | | | | | 2001-06-21 James Henstridge <james@daa.com.au> * gtk/gtkobject-support.c (pygtk_dict_as_container_args): comment out, as container args have been switched to properties now. 2001-06-19 James Henstridge <james@daa.com.au> * gobjectmodule.c (pyg_value_from_pyobject): handle PyGBoxed types. (pyg_value_as_pyobject): pass out PyGBoxed types if no custom handler is found, rather than straight CObjects. Will need to do something about cases where we want mutable values (ie. don't copy the boxed type). * configure.in: require glib/gtk+ 1.3.6
* same here.James Henstridge2001-04-081-16/+16
| | | | | | | | | | | | | | | | | | | | | 2001-04-08 James Henstridge <james@daa.com.au> * gtk/gtk.override: same here. * gtk/gtk-types.c (_pygtk_register_boxed_types): more fixups * gtk/gtkobject-support.c: lots of similar fixups. * codegen/argtypes.py (_enum_name): gdk type codes now seem to be named GDK_TYPE_... and not GTK_TYPE_GDK_... 2001-04-07 James Henstridge <james@daa.com.au> * gtk/gtk.defs: lots of defs file updates. 2001-04-06 James Henstridge <james@daa.com.au> * codegen/h2def.py: add --onlyobjdefs flag to script.
* Still broken. Needs more updatingJames Henstridge2001-03-181-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 2001-03-18 James Henstridge <james@daa.com.au> * gtk/pygtktreemodel.c (pygtk_tree_model_class_init): signals are now created in the gtktreemodel.c, so we don't need to. * gtk/gtk.defs (Adjustment): make parent GtkObject, as GtkData is gone. (GtkText): remove from binding. * codegen/codegen.py (write_source): pass in the get_type function when registering classes. (gettypetmpl): remove template. (write_class): remove get_type method generator. Handled by __gtype__ * gobjectmodule.c (initgobject): add argument to g_type_init call. (pyg_value_from_pyobject): use G_VALUE_HOLDS_* rather than G_IS_VALUE_*. (pyg_value_as_pyobject): same here. (pygobject_register_class): add an argument that takes the get_type function for the GObject. This is used to add a __gtype__ attribute to the class (the get_type function is not actually called until __gtype__ is accessed).
* destroy window on button's clicked signal rather than destroy signal.PYGTK_0_6_7GNOME_PYTHON_1_4_0James Henstridge2000-12-141-0/+2
| | | | | | | | | | | | | | | | | | | | | 2000-12-14 James Henstridge <james@daa.com.au> * examples/testgtk/demos/menu.py (main): destroy window on button's clicked signal rather than destroy signal. * gtk/gtk.defs: remove gtk_object_default_construct and gtk_object_constructed. * gobjectmodule.c: change over to new notification functions. * gtk/gtk-types.c: rename functions. * gobjectmodule.c (pygobject_get_property): (pygobject_set_property): change function names to match changes in glib. (...connect|emit): use g_signal_parse_name instead of g_signal_lookup, so we can parse the detail out of the signal name string.
* init as module gtk._gtk. Using just _gtk doesn't seem to work with pythonJames Henstridge2000-10-301-429/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-30 James Henstridge <james@daa.com.au> * gtk/gtkmodule.c (init_gtk): init as module gtk._gtk. Using just _gtk doesn't seem to work with python 2.0 2000-10-29 James Henstridge <james@james.daa.com.au> * examples/ide/gtkcons.py: small changes to make example run. * gtk/gtk-types.c: add GtkTextIter.forward_search implementation. * gtk/gtk.override: more override functions. * gtk/gtkobject-support.c: remove some of the unused functions from this file. 2000-10-28 James Henstridge <james@james.daa.com.au> * gtk/gtk.override: override the functions used to initialise GtkTextIter objects so that they return the iterator rather than setting up an static GtkTextIter structure. * gtk/gtk.defs (TextMark): add missing GtkTextMark object. Don't know why h2defs missed it. ("gtk-extrafuncs.defs"): include gtk-extrafuncs.defs. * codegen/argtypes.py: add GdkDevice and GtkTextIter to list of recognised boxed types. * gtk/gtk-types.c: add skeleton implementation of GtkTextIter. * gtk/pygtk.h, gtk/pygtk-private.h: add prototypes for GtkTextIter wrapper. * gtk/gtk.override: ref and sink GtkObjects which have their constructors listed in the overrides file. This should get rid of the last few warnings on exit related to reference counting. * codegen/codegen.py: use the keyword module to check for method and argument names that conflict with the python keywords. By using this module, we shouldn't have problems with new keywords in future versions of python. 2000-10-27 James Henstridge <james@james.daa.com.au> * gobjectmodule.c (pygobject_emit): support for emiting signals on GObjects from python. * codegen/codegen.py (write_constructor): sink GtkObjects. This prevents us losing our reference to the object if it is sunk. * codegen/argtypes.py (ArgMatcher.object_is_a): function to check if one object type is another type. * codegen/codegen.py (register_types): pass the parent type when registering a new GObject type. * gtk/gtk-types.c (_pygtk_register_boxed_types): register marshalers for the various boxed types, so that they work as expected inside the signal handlers. * gobjectmodule.c (pygobject_repr): small change to match style of other repr functions in python. * gtk/gtkmodule.c (init_gtk): only call g_thread_init() if pygtk threading support is enabled. * configure.in (enable_thread): add configure checks so that threading support can be disabled even if python was compiled with it. It defaults to off for now because GSignal has some mutex deadlocks at the moment.
* remove gtk_signal_set_funcs call.James Henstridge2000-10-261-24/+2
| | | | | | | | | | | 2000-10-26 James Henstridge <james@daa.com.au> * gtk/gtkmodule.c (init_gtk): remove gtk_signal_set_funcs call. * gobjectmodule.c (pyg_value_from_pyobject): default to using CObject for unknown boxed values and pointer values. (pyg_value_as_pyobject): same here. (pygobject_connect*): Add signal connection functions.
* handle the null constructor better.James Henstridge2000-07-031-336/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-07-03 James Henstridge <james@daa.com.au> * codegen/codegen.py (noconstructor): handle the null constructor better. * gtk/gtk-types.c (_pygtk_register_boxed_types): commented out the object implementations for types that have been converted to GObjects. * gtk/gtkobject-support.c: commented out some of this code to get it to compile again. Also converted some functions over to GObject. * codegen/argtypes.py (EnumArg,FlagsArg): use the version from gobject. * gtk/gtkmodule.c: update * gtk/gtk.override: fix up the overrides for the new gdk.defs stuff. (GTK_TYPE_GDK_*): add some dummy defines to make things compile until the gdk-pixbuf enums are added to * codegen/argtypes.py (ObjectArg.write_param): use PyGObject rather than PyGtk_Object. * pygobject.h (pygobject_check): add check function. Just a wrapper around ExtensionClassSubclassInstance. * codegen/codegen.py: updated to use PyGObject rather than PyGtk_Object. * gtk/gtk.defs: removed most of the stuff here so I can test out the gdk stuff.
* pull more stuff from extension-class-branchJames Henstridge2000-06-261-0/+1639