Permalink
Switch branches/tags
Commits on Jan 28, 2002
  1. same code here, if __doc__ hasn't already been set. (initgobject): don't

    2002-01-28  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pyg_type_register): same code here, if __doc__
    	hasn't already been set.
    	(initgobject): don't bother setting __doc__ on GObject here, as
    	pygobject_register_class() does this for us.
    
    	* pygobject.c (pygobject_register_class): need to set the __doc__
    	descriptor on every class, otherwise it gets lost.
    James Henstridge committed with James Henstridge Jan 28, 2002
Commits on Jan 24, 2002
  1. use g_string_append_printf(). (add_property_docs): same here.

    2002-01-24  James Henstridge  <james@daa.com.au>
    
    	* pygtype.c (add_signal_docs): use g_string_append_printf().
    	(add_property_docs): same here.
    
    	* examples/simple/tooltip.py: updated version from Steve George.
    James Henstridge committed with James Henstridge Jan 24, 2002
Commits on Jan 23, 2002
  1. (add_signal_docs): only get the class for a type if it is a

    	classed type.
    James Henstridge committed Jan 23, 2002
  2. (add_property_docs): fix small bug.

    James Henstridge committed Jan 23, 2002
  3. fill in __doc__ descriptor

    2002-01-23  James Henstridge  <james@daa.com.au>
    
    	* pygtype.c (object_doc_descr_get): fill in __doc__ descriptor
    
    	* gobjectmodule.c (initgobject): add __doc__ descriptor to GObject
    	and GInterface.  Add __gdoc__ as a synonym because type.__doc__
    	masks our descriptor sometimes :(
    
    	* pygtype.c (object_doc_descr_get): skeleton of the __doc__
    	descriptor.
    	(PyGObjectDoc_Type): type definition.
    	(pyg_object_descr_doc_get): function to create and return the
    	__doc__ descriptor (we only need one for all classes).
    James Henstridge committed with James Henstridge Jan 23, 2002
Commits on Jan 22, 2002
  1. move GObject wrapper stuff here.

    2002-01-22  James Henstridge  <james@daa.com.au>
    
    	* pygobject.c: move GObject wrapper stuff here.
    James Henstridge committed with James Henstridge Jan 22, 2002
  2. and again :(

    James Henstridge committed Jan 22, 2002
  3. small patch to get things working again after last commit.

    James Henstridge committed Jan 22, 2002
  4. move closure stuff here.

    2002-01-22  James Henstridge  <james@daa.com.au>
    
    	* pygtype.c: move closure stuff here.
    James Henstridge committed with James Henstridge Jan 22, 2002
  5. don't create boxed_marshal hash table, and remove the type functions …

    …moved
    
    2002-01-22  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (initgobject): don't create boxed_marshal hash
    	table, and remove the type functions moved to pygtype.c.
    
    	* pygtype.c: move GType stuff here from gobjectmodule.c.
    	(pyg_register_boxed_custom): store the custom boxed marshal
    	functions as GType data, rather than in a separate hash table.
    James Henstridge committed with James Henstridge Jan 22, 2002
Commits on Jan 21, 2002
  1. list extra source files.

    2002-01-21  James Henstridge  <james@daa.com.au>
    
    	* Makefile.am (gobjectmodule_la_SOURCES): list extra source files.
    
    	* pygobject-private.h (pyg_boxed_new): new header for functions
    	shared between files in gobjectmodule.
    
    	* pygboxed.c (pyg_register_boxed): move GBoxed handling code here.
    James Henstridge committed with James Henstridge Jan 21, 2002
Commits on Jan 12, 2002
  1. convert None, int, long, float, str and object to GTypes.

    2002-01-12  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pyg_type_from_object): convert None, int, long,
    	float, str and object to GTypes.
    
    	* gtk/gtkmodule.c (init_gtk): only raise a runtime error if we
    	can't initialise gtk.
    James Henstridge committed with James Henstridge Jan 12, 2002
Commits on Jan 11, 2002
  1. removed debugging code I didn't mean to check in.

    2002-01-11  Matt Wilson  <msw@redhat.com>
    
    	* gtk/gtk.override (_wrap_gtk_toolbar_insert_stock): removed
    	debugging code I didn't mean to check in.
    
    	* gobjectmodule.c (pyg_closure_new): use PyTuple_SetItem to build
    	the tuple if extra_args isn't one.  It's faster than using
    	abstractions and clarifies ownership rules, so we always incref
    	extra_args even if we're about to wrap it in a tuple.  Fixes
    	crashes when passing callback functions into
    	GtkToolbar.{append_item,prepend_item,insert_item,insert_stock,
    	append_element}
    Matt Wilson committed with Matt Wilson Jan 11, 2002
Commits on Jan 7, 2002
  1. the F10 key is used to start navigating the menu -- not alt.

    2002-01-07  James Henstridge  <james@daa.com.au>
    
    	* examples/pygtk-demo/demos/itemfactory.py (main): the F10 key is
    	used to start navigating the menu -- not alt.
    
    	* gtk/gtk-types.c (PyGtkStyleHelper_Dealloc): use PyObject_DEL.
    	(PyGtkStyle_Dealloc): same here.
    	(PyGdkWindow_Dealloc): same here.
    	(PyGdkGC_Dealloc): same here.
    	(PyGdkColormap_Dealloc): same here.
    	(pygdk_atom_dealloc): same here.
    
    	* gobjectmodule.c (pyg_type_wrapper_dealloc): use PyObject_DEL to
    	prevent segfaults with pymalloc.
    	(pyg_param_spec_dealloc): same here.
    James Henstridge committed with James Henstridge Jan 7, 2002
  2. initialise GThread if threading is enabled at compile time (this doesn't

    2002-01-07  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (initgobject): initialise GThread if threading
    	is enabled at compile time (this doesn't initialise GDK threading
    	though -- you need to run gtk.gdk.threads_init for that).
    James Henstridge committed with James Henstridge Jan 7, 2002
  3. add overriden implementation that allows threads while waiting, so some

    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.
    James Henstridge committed with James Henstridge Jan 7, 2002
  4. handler for registering thread block/unblock funcs.

    2002-01-07  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pyg_set_thread_block_funcs): handler for
    	registering thread block/unblock funcs.
    	(pygobject_destroy_notify): block threads during DECREF call.
    	(pyg_closure_destroy): block threads during closure DECREF.
    	(pyg_closure_marshal): block threads when calling function.
    	(pyg_signal_class_closure_marshal): block threads.
    	(functions): add extra functions to vtable.
    
    	* pygobject.h (struct _PyGObject_Functions): add thread
    	block/unblock slots to the API table.
    James Henstridge committed with James Henstridge Jan 7, 2002
Commits on Dec 20, 2001
  1. fix for updated API. (pygobject_methods): just call the method "chain".

    2001-12-20  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pygobject_chain_from_overridden): fix for
    	updated API.
    	(pygobject_methods): just call the method "chain".
    James Henstridge committed with James Henstridge Dec 20, 2001
Commits on Dec 18, 2001
  1. forgot to add these types here :(

    James Henstridge committed Dec 18, 2001
  2. add support for int64/uint64. Fix up code for unsigned int/long to parse

    2001-12-18  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pyg_value_from_pyobject): add support for
    	int64/uint64.  Fix up code for unsigned int/long to parse long
    	ints if necessary.
    	(pyg_value_as_pyobject): add support for int64/uint64, and get
    	UINT/ULONG to return python long ints if necessary, rather than
    	wrapping around.
    James Henstridge committed with James Henstridge Dec 18, 2001
  3. add new example to dist.

    2001-12-18  James Henstridge  <james@daa.com.au>
    
    	* Makefile.am (EXTRA_DIST): add new example to dist.
    
    	* examples/gobject/properties.py: test program that implements a
    	few properties.
    
    	* gobjectmodule.c (add_properties): new function for parsing the
    	__gproperties__ class attribute.
    	(create_property): helper routine for creating and installing the
    	new pspecs.
    	(pyg_type_register): add code to call add_properties if a
    	__gproperties__ attribute is found.
    	(pyg_object_class_init): set set_property/get_property methods in
    	vtable, and get rid of debug message.
    	(initgobject): add G_PARAM_* constants.
    James Henstridge committed with James Henstridge Dec 18, 2001
Commits on Dec 17, 2001
  1. add chaining function. This will need to change when Tim makes the ch…

    …anges
    
    2001-12-17  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pygobject_chain_from_overridden): add chaining
    	function.  This will need to change when Tim makes the changes to
    	the chaining API.  This was just to test that things worked
    	correctly (and they do).  Possibly this should be renamed to just
    	GObject.chain() or GObject._chain().
    
    2001-12-15  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (add_signals): put the class ref/unref in here,
    	so it is only done once.  The ref/unref is really needed for
    	adding signals as well, so that we don't end up with dups.
    James Henstridge committed with James Henstridge Dec 17, 2001
Commits on Dec 14, 2001
  1. (override_signal): add g_type_class_ref() calls so that parent signal…

    …s are
    
    2001-12-14  James Henstridge  <james@daa.com.au>
    
    	(override_signal): add g_type_class_ref() calls so that parent
    	signals are registered.
    James Henstridge committed with James Henstridge Dec 14, 2001
  2. Add gobject.glib_version.

    2001-12-14  Johan Dahlin  <jdahlin@telia.com>
    
    	* gobjectmodule.c (initgobject): Add gobject.glib_version.
    Johan Dahlin committed with Johan Dahlin Dec 14, 2001
  3. another helper function for overriding existing signals. Haven't done

    2001-12-14  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (override_signal): another helper function for
    	overriding existing signals.  Haven't done chaining support yet.
    	(add_signals): if value in __gsignals__ dict is None or
    	'override', then call override_signal instead.
    James Henstridge committed with James Henstridge Dec 14, 2001
  4. use __gsignals__ notation here.

    2001-12-14  James Henstridge  <james@daa.com.au>
    
    	* examples/gobject/signal.py: use __gsignals__ notation here.
    
    	* gobjectmodule.c (create_signal, add_signals): helper routines
    	for handling __gsignals__ attribute of classes.
    	(pyg_type_register): add support for creating signals as part of
    	type registration.
    James Henstridge committed with James Henstridge Dec 14, 2001
Commits on Dec 13, 2001
  1. always print and clear the exceptions in callback marshalers. People who

    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.
    Matt Wilson committed with Matt Wilson Dec 13, 2001
Commits on Dec 2, 2001
  1. fix up format string, from bug #65636 (Skip again).

    2001-12-02  James Henstridge  <james@daa.com.au>
    
    	* gtk/gtk.override (_wrap_gtk_text_buffer_create_tag): fix up
    	format string, from bug #65636 (Skip again).
    
    	* gobjectmodule.c (pyg_type_wrapper_repr): fix up format string,
    	from bug #65640 (from Skip).
    James Henstridge committed with James Henstridge Dec 2, 2001
  2. use pyg_error_check to raise the exception. Now the domain and code

    2001-12-02  James Henstridge  <james@daa.com.au>
    
    	* codegen/argtypes.py (GTypeArg.write_return): use pyg_error_check
    	to raise the exception.  Now the domain and code elements of the
    	GError are available.
    	(GtkTreePathArg.write_param): add to codeafter in order to free
    	the tree path we created, fixing a leak.
    
    	* gobjectmodule.c (initgobject): create a gobject.GError
    	exception.
    	(pyg_error_check): function for converting a GError into a
    	gobject.GError python exception.
    James Henstridge committed with James Henstridge Dec 2, 2001
Commits on Nov 30, 2001
  1. get rid of class_hash, and store the pointer to the python class with

    2001-11-30  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (pygobject_register_class): get rid of
    	class_hash, and store the pointer to the python class with
    	g_type_set_qdata().
    	(pygobject_lookup_class): look up python class with
    	g_type_get_qdata.
    	(pyg_object_class_init): a class_init function for types defined
    	in python.  The python class is passed as the "class_data"
    	argument.  Currently empty, but will be used to install
    	eg. get_property and set_property members.
    	(pyg_type_register): store pointer to class like we do for types
    	defined in C.
    	(initgobject): move the quark initialisations above the
    	registration of GObject.
    James Henstridge committed with James Henstridge Nov 30, 2001
Commits on Nov 27, 2001
  1. added start of atk wrapper

    2001-11-27  Matt Wilson  <msw@redhat.com>
    
    	* atk.defs, atk.override, atkmodule.c: added start of atk wrapper
    
    	* gtk/Makefile.am (DISTCLEANFILES): remove generated files
    	($(srcdir)/gtk.c): modify targets to output generated files in the
    	builddir, not the srcdir.
    	($(srcdir)/gdk.c): likewise.
    	($(srcdir)/libglade.c): likewise.
    
    	* codegen/h2def.py (define_func): add check to workaround broken
    	string.replace semantics on python 1.5
    
    	* codegen/codegen.py (write_enums): if the enum or flag doesn't
    	have a GType, just add those enum values listed in the defs file
    	by hand.
    
    	* codegen/argtypes.py (ArgMatcher.register_enum): if defs file
    	doesn't specify a GType for the enum, use G_TYPE_NONE.
    	(ArgMatcher.register_flag): likewise.
    
    	* gobjectmodule.c (pyg_enum_get_value): allow enums to pass
    	G_TYPE_NONE in as the type, disabling the string to value
    	conversion.
    	(pyg_flags_get_value): likewise.
    	(pyg_constant_strip_prefix): new function to combine common
    	codepath.
    	(pyg_enum_add_constants): use pyg_constant_strip_prefix
    	(pyg_flags_add_constants): likewise.
    	(functions): make pyg_constant_strip_prefix available to users of
    	pygobject
    
    	* pygobject.h: added pyg_constant_strip_prefix wrapper
    
    	* configure.in: added ATK test, subst for ATK_CFLAGS and ATK_LIBS.
    
    	* Makefile.am (%.c): added generic codegen target for pango and
    	atk.  Added DISTCLEANFILES so that generated files will be
    	removed.  Added atk targets, cflags, ldflags.
    Matt Wilson committed with Matt Wilson Nov 27, 2001
Commits on Nov 19, 2001
  1. fixed think-o, don't store a pointer to the function pointer, just store

    2001-11-19  Matt Wilson  <msw@redhat.com>
    
    	* gobjectmodule.c (pyg_fatal_exceptions_notify_{add,remove}):
    	fixed think-o, don't store a pointer to the function pointer, just
    	store the function pointer.
    Matt Wilson committed with Matt Wilson Nov 19, 2001
Commits on Nov 16, 2001
  1. s/g_param_get_{name,nick,blurb}/g_param_spec_get_{name,nick,blurb}/g

    2001-11-16  Matt Wilson  <msw@redhat.com>
    
    	* gobjectmodule.c (pyg_param_spec_getattr, pyg_param_spec_repr):
    	s/g_param_get_{name,nick,blurb}/g_param_spec_get_{name,nick,blurb}/g
    	(pyg_fatal_exceptions_notify_remove): use the right type.
    Matt Wilson committed with Matt Wilson Nov 16, 2001
Commits on Nov 15, 2001
  1. added PyGFatalExceptionFunc typedef, API wrapper for

    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
    Matt Wilson committed with Matt Wilson Nov 15, 2001
Commits on Oct 25, 2001
  1. include the module name in the typename. (PyGInterface_Type): same here.

    2001-10-25  James Henstridge  <james@daa.com.au>
    
    	* gobjectmodule.c (PyGObject_Type): include the module name in the
    	typename.
    	(PyGInterface_Type): same here.
    	(PyGBoxed_Type): same here.
    	(pygobject_register_class): when working out what name to put into
    	the module dictionary, strip off everything before the last dot,
    	so the type name can include the module.
    
    	* configure.in (minver): require python 2.2b1
    
    	* gobjectmodule.c (initgobject): remove statements using
    	tp_defined (they are no longer needed).
    James Henstridge committed with James Henstridge Oct 25, 2001