summaryrefslogtreecommitdiffstats
path: root/gobject/pygflags.c
Commit message (Collapse)AuthorAgeFilesLines
* Changes to module init, and to compile under python3. Doesn't work thoughJohn Ehresman2010-04-151-22/+1
|
* Register enums and flags in PyGI if neededTomeu Vizoso2009-12-291-6/+13
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=603534
* Update the address of the FSF, by replacing old bits of the address withTobias Mueller2009-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-29 Tobias Mueller <tobiasmue@gnome.org> Update the address of the FSF, by replacing old bits of the address with new ones. Fixes bug 577134 * ltihooks.py: * pygtk.py: * COPYING: * gobject/pygparamspec.h: * gobject/pygpointer.c: * gobject/ffi-marshaller.h: * gobject/pygtype.c: * gobject/__init__.py: * gobject/pygpointer.h: * gobject/pygtype.h: * gobject/pygflags.c: * gobject/pyginterface.c: * gobject/pygflags.h: * gobject/pygboxed.c: * gobject/gobjectmodule.c: * gobject/pygenum.c: * gobject/pyginterface.h: * gobject/pygboxed.h: * gobject/pygobject.c: * gobject/constants.py.in: * gobject/pygenum.h: * gobject/propertyhelper.py: * gobject/pygparamspec.c: * gobject/ffi-marshaller.c: * glib/pygmainloop.c: * glib/pygoptioncontext.h: * glib/pygmainloop.h: * glib/pyglib-private.h: * glib/__init__.py: * glib/pygoptiongroup.c: * glib/pygspawn.c: * glib/pygmaincontext.c: * glib/pygoptiongroup.h: * glib/pygspawn.h: * glib/pygmaincontext.h: * glib/option.py: * glib/pygsource.c: * glib/glibmodule.c: * glib/pygiochannel.h: * glib/pygsource.h: * glib/pyglib.c: * glib/pyglib.h: * glib/pyglib-python-compat.h: * glib/pygoptioncontext.c: * gio/gfileinfo.override: * gio/gappinfo.override: * gio/__init__.py: * gio/gfileattribute.override: * gio/gvolume.override: * gio/gio.override: * gio/ginputstream.override: * gio/goutputstream.override: * gio/unix.override: * gio/gfile.override: * gio/gvolumemonitor.override: * gio/gapplaunchcontext.override: * gio/giomodule.c: * gio/gfileenumerator.override: * gio/pygio-utils.c: * gio/unixmodule.c: * gio/pygio-utils.h: * gio/gicon.override: svn path=/trunk/; revision=1038
* Remove unnecessary spacingJohan Dahlin2008-07-281-2/+2
| | | | svn path=/trunk/; revision=888
* Add a Py_TYPE macro for accessing ob_type.Johan Dahlin2008-07-271-11/+17
| | | | | | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * glib/pyglib-python-compat.h: Add a Py_TYPE macro for accessing ob_type. * glib/glibmodule.c (pyglib_register_constants): * gobject/gobjectmodule.c (pygobject__g_instance_init), (pyg_integer_richcompare): * gobject/pygenum.c (pyg_enum_repr), (pyg_enum_from_gtype), (pyg_enum_add), (pyg_enum_get_value_name), (pyg_enum_get_value_nick): * gobject/pygflags.c (pyg_flags_repr), (pyg_flags_from_gtype), (pyg_flags_add), (pyg_flags_and), (pyg_flags_or), (pyg_flags_xor), (pyg_flags_get_first_value_name), (pyg_flags_get_first_value_nick), (pyg_flags_get_value_names), (pyg_flags_get_value_nicks): Use Py_TYPE and PyLong macros to access struct fields svn path=/trunk/; revision=885
* Use _PyLong macros.Johan Dahlin2008-07-271-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-42/+9
| | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Split out quark and type registration to the respective implementationJohan Dahlin2008-07-271-0/+12
| | | | | | | | | | | | | | | | | | | | 2008-07-27 Johan Dahlin <johan@gnome.org> * gobject/Makefile.am: * gobject/gobjectmodule.c (init_gobject): * gobject/pygboxed.c (pygobject_boxed_register_types): * gobject/pygboxed.h: * gobject/pygenum.c (pygobject_enum_register_types): * gobject/pygenum.h: * gobject/pygflags.c (pygobject_flags_register_types): * gobject/pygflags.h: * gobject/pygpointer.c (pygobject_pointer_register_types): * gobject/pygpointer.h: Split out quark and type registration to the respective implementation source files, add headers. svn path=/trunk/; revision=880
* Move maincontext and mainloop over to glib. Update the threadstate api toJohan Dahlin2008-07-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix: raise warning as exception if asked by PyErr_Warn().Paul Pogonyshev2008-04-271-2/+6
| | | | | | | | | | | | | | 2008-04-27 Paul Pogonyshev <pogonyshev@gmx.net> * gobject/pygenum.c (pyg_enum_richcompare): Fix: raise warning as exception if asked by PyErr_Warn(). * gobject/pygflags.c (pyg_flags_richcompare): Don't return NULL after warning; more useful warning message. (#480424, borrowing code by Mark Doffman) svn path=/trunk/; revision=779
* Fix leak, patch by Daniel Berrange. Fixes #428726 (Phil Dumont)Johan Dahlin2007-04-301-3/+3
| | | | | | | | * gobject/pygflags.c: (pyg_flags_from_gtype): Fix leak, patch by Daniel Berrange. Fixes #428726 (Phil Dumont) svn path=/trunk/; revision=653
* better debug warningsGustavo J. A. M. Carneiro2006-07-291-1/+5
|
* gobject/pygflags.c (pyg_flags_add) Duplicate the string before sending itJohan Dahlin2006-07-251-5/+7
| | | | | | * gobject/pygflags.c (pyg_flags_add) * gobject/pygenum.c (pyg_enum_add): Duplicate the string before sending it to python. Fixes GCC warnings.
* Fix typo in Finlays commitJohan Dahlin2006-07-251-2/+2
|
* Avoid segfault when g_flags_get_first_value returns NULL.John Finlay2006-07-251-3/+12
| | | | | | * gobject/pygflags.c (pyg_flags_get_first_value_name) (pyg_flags_get_first_value_nick): Avoid segfault when g_flags_get_first_value returns NULL.
* reviewed by: Johan Dahlin <jdahlin@async.com.br>Johan Dahlin2006-03-091-6/+14
| | | | | | | | * gobject/pygenum.c: (pyg_enum_new), (pyg_enum_from_gtype), (pyg_enum_add): * gobject/pygflags.c: (pyg_flags_new), (pyg_flags_from_gtype), (pyg_flags_add): Plug a couple of leaks, fixes #334027.
* fix pygflags registration with module == NULLGustavo J. A. M. Carneiro2005-12-241-12/+15
|
* reviewed by: Johan Dahlin <jdahlin@async.com.br>Manish Singh2005-11-031-12/+13
| | | | | | | | | | | | 2005-11-03 Manish Singh <yosh@gimp.org> reviewed by: Johan Dahlin <jdahlin@async.com.br> * gobject/gobjectmodule.c: (pyg_integer_richcompare): * gobject/pygenum.c: (pyg_enum_richcompare): * gobject/pygflags.c: (pyg_flags_richcompare): * gobject/pygobject-private.h: Prepare for Python 2.5 richcompare changes, fixes #320455.
* Try to register unknown enums and flags on the fly. Fixes #308536, patchJohan Dahlin2005-06-211-1/+0
| | | | | | | | | 2005-06-21 Johan Dahlin <jdahlin@async.com.br> * gobject/pygparamspec.c: (pygenum_from_pspec), (pygflags_from_pspec): Try to register unknown enums and flags on the fly. Fixes #308536, patch by Edward Hervey * gobject/pygflags.c: (pyg_flags_add): Make module optional.
* gquark initialization cleanupGustavo J. A. M. Carneiro2005-05-281-6/+0
|
* Complain if ret is NULL, Fixes #303524.pygtk-2-6-anchorPYGTK_2_6_2Johan Dahlin2005-05-091-1/+1
| | | | | | | | * gobject/pygenum.c (pyg_enum_new): Complain if ret is NULL, Fixes #303524. * gobject/pygflags.c (pyg_flags_new): Change exception format to be consistent with the one in enum
* [Bug 154372] New: - Calling an enumeration type causes an assertion failurePYGTK_2_5_3Gustavo J. A. M. Carneiro2005-01-221-9/+13
|
* Print long int value if enum string not found. Fixes #158417. (modifedJohn Finlay2004-11-161-2/+6
| | | | | * gobject/pygflags.c (pyg_flags_repr): Print long int value if enum string not found. Fixes #158417. (modifed patch from Tim Evans)
* Filter out 0 valuesJohan Dahlin2004-09-171-1/+7
| | | | | | | * gobject/pygflags.c: Filter out 0 values * Makefile.am: * docs/Makefile.am: Revert documentation changes
* gobject/pygflags.c (pyg_flags_add) Return NULL when no stub.John Finlay2004-08-081-0/+1
| | | | * gobject/pygflags.c (pyg_flags_add) Return NULL when no stub.
* Don't comment out the fallback, it break the test. (Wow, the testsuitePYGTK_2_3_96Johan Dahlin2004-08-061-6/+1
| | | | | | | | | | | | * gobject/pygflags.c (pyg_flags_from_gtype): Don't comment out the fallback, it break the test. (Wow, the testsuite caught another bug!) * tests/enum.py: Additional tests. * gobject/pygenum.c (pyg_enum_repr): Don't use g_enum_get_value, use enum_class->values[n].value_name instead. Also check if the value is NULL or not. This makes gtk.icon_size_register work a little bit better.
* New test.Johan Dahlin2004-08-041-1/+5
| | | | | | | | * tests/enum.py (EnumTest.testOutofBounds): New test. * gobject/pygflags.c (pyg_flags_from_gtype): * gobject/pygenum.c (pyg_enum_from_gtype): Don't segfault on unknown values.
* make threading runtime optionalGustavo J. A. M. Carneiro2004-08-041-3/+3
|
* GdkModifierType is flags not an enum.Johan Dahlin2004-08-041-2/+6
| | | | | | | | | | | * gtk/gtk.override (_wrap_gtk_accel_map_lookup_entry): GdkModifierType is flags not an enum. * gobject/pygenum.c (pyg_enum_from_gtype): Don't crash if its not an enum * gobject/pygflags.c (pyg_flags_from_gtype): Don't crash if its not flags
* Call PyEval_InitThreads. Perhaps its something that always should bePYGTK_2_3_95Johan Dahlin2004-08-021-2/+7
| | | | | | | | | | | | | | | | * gobject/gobjectmodule.c (initgobject): Call PyEval_InitThreads. Perhaps its something that always should be called. * README (Author): Add a requirements section * configure.in: Require Python 2.3 * setup.py (version): Ditto * gobject/pygtype.c, gobject/pygobject.h: Remove 2.2 compat. * All over the place: Add support for PyGILState.
* Reverse operatorJohan Dahlin2004-07-281-1/+1
| | | | | | | | * gobject/pygenum.c (pyg_enum_compare): * gobject/pygflags.c (pyg_flags_compare): Reverse operator * tests/enum.py (FlagsTest.testComparision) (FlagsTest.testComparision): New tests
* Add, so Lorenzo can introspect flags properly tooPYGTK_2_3_94Johan Dahlin2004-07-211-4/+42
| | | | | | | | | | | * gobject/pygflags.c (pyg_flags_get_first_value_name) (pyg_flags_get_first_value_nick): Add, so Lorenzo can introspect flags properly too (pyg_flags_get_value_names, pyg_flags_get_value_nicks): Make this a little bit more useful. All values can still be fetch through __flags_values__ * tests/enum.py: Improve and extend to test most enum/flags operations
* Simplify, fix name in exceptions and remove warning.Johan Dahlin2004-07-201-1/+2
| | | | | | | | | | | | * gtk/gtk.override (_wrap_gtk_file_chooser_dialog_new): Simplify, fix name in exceptions and remove warning. * gobject/pygenum.c (pyg_enum_from_gtype): Fall back to int for unregistered enums. * gobject/pygflags.c (pyg_flags_from_gtype): Ditto * gobject/gobjectmodule.c (initgobject): Rename back to MainLoop, MainContext
* s/flag/flags in tp_reprPYGTK_2_3_93Johan Dahlin2004-07-191-1/+1
|
* Fix, a window is really WITHDRAWN if it's not SHOWN and not ICONIFIED...Johan Dahlin2004-07-191-5/+5
| | | | | | | | | | | | | | * tests/enum.py (EnumTest.testWindowGetState): Fix, a window is really WITHDRAWN if it's not SHOWN and not ICONIFIED... * tests/common.py: Add .. and ../gobject when distcheck isn't ran * gobject/pygenum.c: Use a dict instead of a tuple for __enum_values__, so we can handle negative enum values (eg: GDK_NOTHING) * gobject/pyflags.c: Ditto for __flag_values__ * gobject/pygparamspec.c (pyg_param_spec_getattr): reference count fixing
* Update, why do I even bother to update 3 different build systems?Johan Dahlin2004-07-191-1/+2
| | | | | | | | | | | * gobject/Makefile.am: * setup.py: * makefile.msc: Update, why do I even bother to update 3 different build systems? * gobject/: Split out GParamSpec, GMainLoop, GMainContext and GPointer to separate files. Also remove *.h files and go back to the old scheme (everything in pygobject.h)
* Remove references to &PyInt_Type from static type struct initializationJohn Ehresman2004-07-191-1/+1
| | | | | | | | | * gobject/pygflags.c, gobject/pygenum.c, gobject/gobjectmodule.c (initgobject): Remove references to &PyInt_Type from static type struct initialization and manually set it before PyType_Ready calls * makefile.msc, gtk/makefile.msc, gobject/makefile.msc: VC++ makefile changes for new directory layout
* New gettersJohan Dahlin2004-07-181-1/+45
| | | | | | | | | | | * gobject/pygflags.c (pyg_flags_get_value_nicks) (pyg_flags_get_value_names): New getters * gobject/pygenum.c (pyg_enum_get_value_nick) (pyg_enum_get_value_name): New getters * gobject/gobjectmodule.c (pyg_param_spec_getattr): add enum_class and flags_class properties.
* gtk/*.overrideJohan Dahlin2004-07-171-0/+367
* gtk/*.override * codegen/codegen.py: * codegen/argtypes.py: Update for enums * pygtype.c (pyg_value_as_pyobject): Use new enum/flag functions * pygenum.[ch]: Handle GFlag * pygflags.[ch]: Handle GFlag * atk-types.defs: Fix gtype-id for all enums * gobjectmodule.c (initgobject): Clean up and add convinience macros * tests/enum.py: New file * tests/common.py: New file, also stole from gst-python