X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=doc%2Fgobject.ref.texi;h=457450c28b7eb6a364e2874385127331e5889f2e;hb=41ccc9c9f275b2f571b45ca2e64e7bd68a5d1eb4;hp=c1a6c0759fb2bae2748a7bd13aa6befe1b0b8a57;hpb=971862eaab360c9a6644959993ff07f3ad52972f;p=cl-gtk2.git diff --git a/doc/gobject.ref.texi b/doc/gobject.ref.texi index c1a6c07..457450c 100644 --- a/doc/gobject.ref.texi +++ b/doc/gobject.ref.texi @@ -1263,6 +1263,7 @@ Example: @chapter GObject high-level @menu * g-object:: +* g-initially-unowned:: * GObject metaclass:: * Using objects:: * Signals:: @@ -1309,6 +1310,15 @@ A base class for all GObject classes. An accessor that accesses the foreign pointer to object. +@node g-initially-unowned +@section g-initially-unowned + +@Class g-initially-unowned + +Superclass: @ref{g-object} + +A base class for all GObject classes whose initial reference is floating. + @node GObject metaclass @section GObject metaclass @@ -1520,9 +1530,9 @@ Example: To enable passing GObject instance between Lisp code and foreign code, @code{g-object} foreign type is introduced. This type has the following syntax: -@code{(g-object &optional type)} or @code{g-object}. +@code{(g-object [type] [:already-referenced])} or @code{g-object}. (Brackets indicate optional arguments) -When the @code{g-object} foreign type is specified as a return type of a function, the value is converted to instance of corresponding CLOS class. If @code{type} is specified then it is checked that object is of this type. +When the @code{g-object} foreign type is specified as a return type of a function, the value is converted to instance of corresponding CLOS class. If @code{type} is specified then it is checked that object is of this type. If @code{:already-referenced} is included then it is assumed that the function returns already referenced object (so that it is not needed to call @code{g-object-ref} on returned object). When the @code{g-object} foreign type is specified as a type of function's argument, the value is converted to pointer to GObject. If @code{type} is specified then it is checked that the object is of this type. @@ -1551,6 +1561,16 @@ This defines the function that returns an instance of GObject class: # @end lisp +This example shows the use of @code{:already-referenced} option: +@lisp +(defcfun (widget-create-pango-layout "gtk_widget_create_pango_layout") (g-object gdk::pango-layout :already-referenced) + (widget (g-object widget)) + (text :string)) + +(defcfun gdk-gc-new (g-object graphics-context :already-referenced) + (drawable (g-object drawable))) +@end lisp + @node Creating GObjects classes and implementing GInterfaces @chapter Creating GObjects classes and implementing GInterfaces