summaryrefslogtreecommitdiffstats
path: root/gobject/pygobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Use the Py_TYPE macro everywhere.Johan Dahlin2008-07-271-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * glib/pyglib-python-compat.h: * gobject/gobjectmodule.c (pyg_object_new), (pyg__install_metaclass): * gobject/pygboxed.c (pyg_boxed_dealloc), (pyg_boxed_init), (pyg_register_boxed): * gobject/pygenum.c (pyg_enum_reduce): * gobject/pyginterface.c (pyg_interface_init), (pyg_register_interface): * gobject/pygobject.c (pygobject_get_inst_data), (pygobject_register_class), (pygobject_new_with_interfaces), (pygobject_dealloc), (pygobject_repr), (pygobject_emit), (pygobject_chain_from_overridden), (pygobject_weak_ref_notify): * gobject/pygparamspec.c (pygobject_paramspec_register_types): * gobject/pygpointer.c (pyg_pointer_dealloc), (pyg_pointer_init), (pyg_register_pointer): * gobject/pygtype.c (pyg_type_from_object), (pyg_value_array_from_pyobject), (pyg_value_from_pyobject), (pyg_object_descr_doc_get): Use the Py_TYPE macro everywhere. svn path=/trunk/; revision=886
* Use _PyLong macros.Johan Dahlin2008-07-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * gobject/gobjectmodule.c (pyg_param_spec_from_object), (add_properties), (pyg_signal_new), (pyg_signal_list_ids), (pyg_signal_lookup), (pyg_signal_query): * gobject/pygenum.c (pyg_enum_richcompare), (pyg_enum_new), (pyg_enum_from_gtype), (pyg_enum_add), (pyg_enum_reduce), (pygobject_enum_register_types): * gobject/pygflags.c (pyg_flags_richcompare), (pyg_flags_new), (pyg_flags_from_gtype), (pyg_flags_add), (pyg_flags_and), (pyg_flags_or), (pyg_flags_xor), (pygobject_flags_register_types): * gobject/pygobject-private.h: * gobject/pygobject.c (pygobject_disconnect_by_func), (pygobject_handler_block_by_func), (pygobject_handler_unblock_by_func), (pygobject_get_refcount): * gobject/pygparamspec.c (pyg_param_spec_getattr): * gobject/pygtype.c (_wrap_g_type_wrapper__get_depth), (pyg_type_from_object), (pyg_enum_get_value), (pyg_flags_get_value), (pyg_value_from_pyobject), (pyg_value_as_pyobject): Use _PyLong macros. svn path=/trunk/; revision=884
* Use PYGLIB_DEFINE_TYPE macro and move struct field initialization to theJohan Dahlin2008-07-271-217/+65
| | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * gobject/pygboxed.c (pygobject_boxed_register_types): * gobject/pygenum.c (pygobject_enum_register_types): * gobject/pygflags.c (pygobject_flags_register_types): * gobject/pygobject.c (pygobject_object_register_types): * gobject/pygparamspec.c (pygobject_paramspec_register_types): * gobject/pygpointer.c (pygobject_pointer_register_types): * gobject/pygtype.c (pygobject_type_register_types): Use PYGLIB_DEFINE_TYPE macro and move struct field initialization to the registration methods. svn path=/trunk/; revision=883
* Add _PyUnicode_Type macroJohan Dahlin2008-07-271-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * glib/pyglib-python-compat.h: Add _PyUnicode_Type macro * gobject/gobjectmodule.c (pyg_type_name), (pyg_type_from_name), (_pyg_signal_accumulator), (add_signals), (add_properties), (get_type_name_for_class), (pyg_signal_list_names), (pyg_signal_name), (pyg_signal_query), (pyg_object_new), (pyg_add_emission_hook), (pyg_remove_emission_hook): * gobject/pygboxed.c (pyg_boxed_repr): * gobject/pygenum.c (pyg_enum_repr), (pyg_enum_add), (pyg_enum_get_value_name), (pyg_enum_get_value_nick): * gobject/pygflags.c (pyg_flags_repr), (pyg_flags_add), (pyg_flags_get_first_value_name), (pyg_flags_get_first_value_nick), (pyg_flags_get_value_names), (pyg_flags_get_value_nicks): * gobject/pygobject.c (build_parameter_list), (PyGProps_getattro), (PyGProps_setattro), (pygobject_register_class), (pygobject_repr), (pygobject_init), (pygobject_get_properties), (pygobject_set_properties), (pygobject_connect), (pygobject_connect_after), (pygobject_connect_object), (pygobject_connect_object_after), (pygobject_emit), (pygobject_stop_emission), (pygobject_disconnect_by_func), (pygobject_handler_block_by_func), (pygobject_handler_unblock_by_func), (pygobject_object_register_types): * gobject/pygparamspec.c (pyg_param_spec_repr), (pyg_param_spec_getattr): * gobject/pygpointer.c (pyg_pointer_repr): * gobject/pygtype.c (pyg_type_wrapper_repr), (_wrap_g_type_wrapper__get_name), (pyg_type_from_object), (pyg_enum_get_value), (pyg_flags_get_value), (pyg_value_from_pyobject), (pyg_value_as_pyobject), (object_doc_descr_get), (_pyg_strv_from_gvalue), (_pyg_strv_to_gvalue): Use _PyUnicode_* macros in the gobject module svn path=/trunk/; revision=882
* Move off a bit more to separate functions, cleaning up the init_glib a bitJohan Dahlin2008-07-261-0/+71
| | | | | | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * gobject/Makefile.am: * gobject/gobjectmodule.c (pygobject_register_api), (pygobject_register_constants), (pygobject_register_features), (pygobject_register_version_tuples), (pygobject_register_warnings), (init_gobject): * gobject/pygobject-private.h: * gobject/pygobject.c (pyobject_copy), (pyobject_free), (pygobject_object_register_types): * gobject/pygtype.c (_pyg_strv_from_gvalue), (_pyg_strv_to_gvalue), (pygobject_type_register_types): * gobject/pygtype.h: Move off a bit more to separate functions, cleaning up the init_glib a bit more. svn path=/trunk/; revision=879
* Move paramspec registration to a separate file, add a header for theJohan Dahlin2008-07-261-0/+6
| | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * gobject/Makefile.am: * gobject/gobjectmodule.c (init_gobject): * gobject/pygobject-private.h: * gobject/pygobject.c: * gobject/pygparamspec.c (pygobject_paramspec_register_types): * gobject/pygparamspec.h: * gobject/pygtype.c: Move paramspec registration to a separate file, add a header for the internal API. svn path=/trunk/; revision=878
* reviewed by: <delete if not using a buddy>Johan Dahlin2008-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 2008-07-26 Johan Dahlin <johan@gnome.org> reviewed by: <delete if not using a buddy> * glib/pyglib-python-compat.h: * glib/pyglib.h: Make a few macros public * gobject/Makefile.am: * gobject/gobjectmodule.c (init_gobject): * gobject/pyginterface.c (pyg_interface_init), (pyg_interface_free), (pyg_register_interface), (pyg_register_interface_info), (pyg_lookup_interface_info), (pygobject_interface_register_types): * gobject/pyginterface.h: * gobject/pygobject-private.h: * gobject/pygobject.c: Move GInterface wrapper into its own file svn path=/trunk/; revision=875
* Move maincontext and mainloop over to glib. Update the threadstate api toJohan Dahlin2008-07-201-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-07-20 Johan Dahlin <johan@gnome.org> * glib/Makefile.am: * glib/glibmodule.c (pyglib_main_context_default), (init_glib): * glib/pyglib.c (pyglib_init), (pyglib_threads_enabled), (pyglib_main_context_new): * glib/pyglib.h: * glib/pygmaincontext.c (_wrap_g_main_context_iteration), (pyglib_maincontext_register_types): * glib/pygmaincontext.h: * glib/pygmainloop.c (pyg_signal_watch_prepare), (pyg_signal_watch_check), (pyg_main_loop_new), (_wrap_g_main_loop_get_context), (_wrap_g_main_loop_run), (pyglib_mainloop_register_types): * glib/pygmainloop.h: * gobject/Makefile.am: * gobject/__init__.py: * gobject/gobjectmodule.c (pyg_destroy_notify), (pyobject_free), (pyg_object_set_property), (pyg_object_get_property), (_pyg_signal_accumulator), (pygobject__g_instance_init), (pyg_handler_marshal), (pygobject_gil_state_ensure), (pygobject_gil_state_release), (marshal_emission_hook), (_log_func), (init_gobject): * gobject/pygboxed.c (pyg_boxed_dealloc), (pyg_boxed_new): * gobject/pygenum.c (pyg_enum_add): * gobject/pygflags.c (pyg_flags_add): * gobject/pygiochannel.c (pyg_iowatch_marshal): * gobject/pygmaincontext.c: * gobject/pygmainloop.c: * gobject/pygobject-private.h: * gobject/pygobject.c (pygobject_data_free), (pyg_toggle_notify), (pygobject_new_with_interfaces), (pygobject_weak_ref_notify): * gobject/pygobject.h: * gobject/pygoptiongroup.c (destroy_g_group), (arg_func): * gobject/pygpointer.c (pyg_pointer_new): * gobject/pygsource.c (pyg_source_get_context), (pyg_source_prepare), (pyg_source_check), (pyg_source_dispatch), (pyg_source_finalize): * gobject/pygtype.c (pyg_closure_invalidate), (pyg_closure_marshal), (pyg_signal_class_closure_marshal): * tests/common.py: Move maincontext and mainloop over to glib. Update the threadstate api to use the variant in glib. svn path=/trunk/; revision=843
* New functions, unconditionally raise TypeError. (pygobject_methods): HookPaul Pogonyshev2008-06-091-0/+20
| | | | | | | | | | 2008-06-09 Paul Pogonyshev <pogonyshev@gmx.net> * gobject/pygobject.c (pygobject_copy, pygobject_deepcopy): New functions, unconditionally raise TypeError. (pygobject_methods): Hook them up. (bug #482370) svn path=/trunk/; revision=787
* Bug 466082 – pygobject_new_full not fully initialising PyGObject, chaos ↵Gustavo J. A. M. Carneiro2007-08-141-2/+6
| | | | | | results svn path=/trunk/; revision=694
* revert last change (g_object_run_dispose)Gustavo J. A. M. Carneiro2007-07-071-11/+0
| | | | svn path=/trunk/; revision=684
* Bug 398696 – Wrap g_object_run_disposeGustavo J. A. M. Carneiro2007-07-071-0/+11
| | | | svn path=/trunk/; revision=683
* Rename the private struct field to private_flags, because private is a C++Murray Cumming2007-07-041-2/+2
| | | | | | | | | | | 2007-07-04 Murray Cumming <murrayc@murrayc.com> * gobject/pygobject.c: (pygobject_switch_to_toggle_ref): * gobject/pygobject.h: Rename the private struct field to private_flags, because private is a C++ keyword, so this broke builds of some C++ applications, such as Glom. svn path=/trunk/; revision=679
* Bug 447271 – gobject has a weird bug on mac. Involves python, property and ↵Gustavo J. A. M. Carneiro2007-06-171-0/+4
| | | | | | subclassing svn path=/trunk/; revision=677
* fix descriptor / toggle_ref interaction bugGustavo J. A. M. Carneiro2007-04-301-3/+4
| | | | svn path=/trunk/; revision=658
* new pygobject_set_properties and pygobject_get_properties methodsGian Mario Tagliaretti2007-04-231-0/+107
| | | | svn path=/trunk/; revision=646
* Bug 320428 – Break PyGObject<->GObject reference cycleGustavo J. A. M. Carneiro2007-04-141-98/+374
| | | | svn path=/trunk/; revision=642
* Fix a couple of compiler warnings.Gustavo J. A. M. Carneiro2007-03-171-2/+2
| | | | svn path=/trunk/; revision=640
* Release the GIL when calling g_object_set_property, since setting aEdward Hervey2007-03-031-0/+3
| | | | | | | | | * gobject/pygobject.c: (set_property_from_pspec): Release the GIL when calling g_object_set_property, since setting a property might trigger some code that might come back in python land. Fixes #395048 svn path=/trunk/; revision=638
* set __module__ on gobject derived types, fixes #376099Johan Dahlin2006-11-181-2/+12
| | | | | * gobject/pygobject.c (pygobject_register_class): set __module__ on gobject derived types, fixes #376099
* Revert accidentally commited changesJohan Dahlin2006-11-181-1/+1
|
* Add a test for #375589Johan Dahlin2006-11-181-1/+1
|
* Python 2.5, int vs ssize_tGustavo J. A. M. Carneiro2006-10-031-30/+39
|
* Add infrastructure for lazy type registration, fixes #Johan Dahlin2006-07-131-2/+9
| | | | | | | | | | | | | * gobject/gobjectmodule.c: (pyg_type_from_name), (get_type_name_for_class): * gobject/pygobject-private.h: * gobject/pygobject.c: (pygobject_new_with_interfaces), (pygobject_lookup_class), (pygobject_emit): * gobject/pygobject.h: * gobject/pygtype.c: (_wrap_g_type_from_name), (pyg_type_from_object), (pyg_type_register_custom_callback), (pyg_type_get_custom), (_pyg_type_from_name): Add infrastructure for lazy type registration, fixes #
* gobject.new fix for 'subsubtype' caseGustavo J. A. M. Carneiro2006-05-281-4/+10
|
* Bug 341174 – Be more specific in set/get_property error messagesGustavo J. A. M. Carneiro2006-05-201-5/+7
|
* Fix #154845, add tests and a private method.Johan Dahlin2006-04-291-0/+99
| | | | | | | | | | | | * gobject/pygtype.c (gclosure_from_pyfunc): * gobject/pygobject.c (pygobject_disconnect_by_func) (pygobject_handler_block_by_func) (pygobject_handler_unblock_by_func): * tests/test_signal.py (TestEmissionHook._callback): Fix #154845, add tests and a private method.
* Move GObjectMeta from C to python-landGustavo J. A. M. Carneiro2006-04-111-89/+3
|
* update a commentGustavo J. A. M. Carneiro2006-03-191-2/+1
|
* pygobject_register_class api compat. fixGustavo J. A. M. Carneiro2006-01-131-7/+33
|
* ignore interfaces from .defs, discover them at runtimeGustavo J. A. M. Carneiro2006-01-131-40/+60
|
* We always need to free interfaces since its a null terminated array.Johan Dahlin2005-11-151-1/+1
| | | | | * gobject/pygobject.c (pygobject_new_with_interfaces): We always need to free interfaces since its a null terminated array.
* plug leak; add glade test; fix warning messageGustavo J. A. M. Carneiro2005-11-091-2/+2
|
* Fix gcc 4.0 warnings.PYGTK_2_8_1Johan Dahlin2005-10-031-2/+2
| | | | | | | | | * gobject/pygobject.c: (PyGProps_length): * gtk/gdk.defs: * gtk/gdk.override: * gtk/gtk.defs: * gtk/gtk.override: Fix gcc 4.0 warnings.
* Check if the gobject is initialized, partly fixes #96658Johan Dahlin2005-10-031-1/+59
| | | | | | | | | | | | | * gobject/pygobject.c: (pygobject_get_property), (pygobject_set_property), (pygobject_freeze_notify), (pygobject_notify), (pygobject_thaw_notify), (pygobject_get_data), (pygobject_set_data), (pygobject_connect), (pygobject_connect_after), (pygobject_connect_object), (pygobject_connect_object_after), (pygobject_disconnect), (pygobject_handler_is_connected), (pygobject_handler_block), (pygobject_emit), (pygobject_stop_emission), (pygobject_chain_from_overridden): Check if the gobject is initialized, partly fixes #96658
* Include the object and the name of the signal in TypeErrorsJohan Dahlin2005-09-221-6/+18
| | | | | | | | | * gobject/gobjectmodule.c: (pyg_type_from_name): * gobject/pygobject.c: (pygobject_connect), (pygobject_connect_after), (pygobject_connect_object), (pygobject_connect_object_after), (pygobject_emit), (pygobject_stop_emission): Include the object and the name of the signal in TypeErrors
* Remove unneeded g_strdup.PYGTK_2_8_0John Ehresman2005-08-291-3/+2
| | | | | * gobject/pygobject.c (pygobjectmeta_register): Remove unneeded g_strdup.
* some memory fixes in type registrationGustavo J. A. M. Carneiro2005-08-251-4/+9
|
* In the meta-class __init__ method, register a class as a gtype iffJohn Ehresman2005-08-241-15/+11
| | | | | | * gobject/pygobject.c: In the meta-class __init__ method, register a class as a gtype iff __gsignals__, __gproperties__, or __gtype_name__ is defined in the leaf class's tp_dict.
* Added sources so gobject module will compile, fixed enable/disable threadPYGTK_2_7_4John Ehresman2005-08-241-1/+1
| | | | | | | | | | * setup.py: Added sources so gobject module will compile, fixed enable/disable thread support, and changed default so thread support is enabled unless --disable-threading is specified * gobject/gobjectmodule.c, gobject/pygobject.c: Set PyGObject_MetaType.tp_base in module initialization to keep VC++ happy
* Use the generic setattr protocol instead of getting the module'sPYGTK_2_7_3Andy Wingo2005-08-091-3/+2
| | | | | | | | 2005-08-09 Andy Wingo <wingo@pobox.com> * gobject/pygobject.c (pygobject_new_with_interfaces): Use the generic setattr protocol instead of getting the module's dictionary and using setitem. Fixes bug #312999.
* Fix reference count of gtk.Window's from gobject.newGustavo J. A. M. Carneiro2005-07-311-4/+13
|
* Bug 311226: Metaclass registration causes breakage with old constructorsGustavo J. A. M. Carneiro2005-07-221-0/+6
|
* We have atomic ref counting in glib now, remove block/unblocking aroundJohan Dahlin2005-07-171-6/+0
| | | | | | | | | | | | | | * gobject/pygobject.c: (pygobject_new_full), (pygobject_dealloc), (pygobject_clear): * gtk/gdk.override: * gtk/gtk-types.c: (_pygtk_style_helper_new), (pygtk_style_helper_dealloc), (pygtk_style_helper_setitem), (pygtk_tree_model_row_dealloc), (pygtk_tree_model_row_iter_dealloc): * gtk/gtk.override: * gtk/gtkwidget.override: We have atomic ref counting in glib now, remove block/unblocking around reference counting.
* Raise an exception if a construct only property is set after constructionJohan Dahlin2005-07-101-29/+40
| | | | | | | | | * gobject/pygobject.c: (PyGProps_setattro), (pygobject_set_property): * tests/test_properties.py: Raise an exception if a construct only property is set after construction time. Refactor property setting code and add some more tests.
* Bug 161177: Allow creation of python classes from g_object_newGustavo J. A. M. Carneiro2005-07-091-7/+11
|
* correct PyGProps[Iter] sizesGustavo J. A. M. Carneiro2005-07-091-3/+3
|
* Add GObject support, patch mostly based on Iñaki and Gustavos work.Johan Dahlin2005-07-081-0/+345
| | | | | | | | | | | | | * gobject/gobjectmodule.c: (initgobject): * gobject/pygobject-private.h: * gobject/pygobject.c: (pyg_props_iter_dealloc), (pygobject_props_iter_next), (PyGProps_dealloc), (build_parameter_list), (PyGProps_getattro), (PyGProps_setattro), (pygobject_props_traverse), (pygobject_props_get_iter), (PyGProps_length), (pyg_props_descr_descr_get): * tests/Makefile.am: Add GObject support, patch mostly based on Iñaki and Gustavos work. Unittests added, fixes #81879
* Add support for specifying name for a GObject subclass, usingJohan Dahlin2005-07-051-7/+28
| | | | | | | | | | | * gobject/gobjectmodule.c: (_wrap_pyg_type_register), (get_type_name_for_class), (pyg_type_register): * gobject/pygobject-private.h: * gobject/pygobject.c: (pygobjectmeta_register), (pygobjectmeta_init): * tests/test_gtype.py: Add support for specifying name for a GObject subclass, using __gtype_name__. Add a unittest. Fixes #169498
* fix docstring typoJohan Dahlin2005-07-041-1/+1
|