Re: Third draft (was Re: defs files)



On 20 Jan 2000, Havoc Pennington wrote:

> ===
> (method method-name
>   (of-object object-name module-name)
>   ;; retval/arg attributes as for (function), but with first parameter
>   ;; omitted for non-constructors
>    )
>  
> Ex:
>   (method set_text
>      (of-object Label (Gtk))
>      (parameter (type-and-name const-gchar* str)))
> 
> ===
> (object-argument arg-name
>    (of-object object-we-are-an-argument-of optional-objects-module)
>    (type argument-type)       ;; not sure what to put for type

all object arguments have a type system id, so you could simply
put that here.

>    ;; flags all default to #f
>    (readable bool-value)
>    (writeable bool-value)
>    (run-action bool-value)         
      ^^^^^^^^^^

what is this for?
      
>    (construct-only bool-value))
> 
> Ex:
>   (object-argument label
>      (of-object Label (Gtk))
>      (type gchar*) ;; ????
>      (readable #t)
>      (writeable #t))
> 
> === 
> (signal signal-name
>   (of-object object-we-are-a-signal-of optional-objects-module)
>   ;; return value and parameters as for a function, omitting the object
>   ;; and user data parameters
> 
>   ;; what other properties matter for a signal?

GTK_RUN_ACTION ? ;)

> )
> 
> Ex:
>   (signal select_row
>      (of-object CList (Gtk))
>      ;; return type defaults to void
>      (parameter in (type-and-name gint row))
>      (parameter in (type-and-name gint column))
>      (parameter in (type-and-name GdkEvent* event)))
> 
> === 
> (enum enum-name
>   (in-module modname)
>   (c-name name-in-c)
>   (value (name value-name-noprefixes-hyphen-lowercase) (c-name value-c-name)))
> 
> Ex:
> 
>   (enum DirectionType
>     (in-module Gtk)
>     (c-name GtkDirectionType)
>     (value (name tab-forward) (c-name GTK_DIR_TAB_FORWARD))
>     (value (name tab-backward) (c-name GTK_DIR_TAB_BACKWARD))
>     (value (name up) (c-name GTK_DIR_UP))
>     (value (name down) (c-name GTK_DIR_DOWN))
>     (value (name left) (c-name GTK_DIR_LEFT))
>     (value (name right) (c-name GTK_DIR_RIGHT)))

do s/name/nick/, that's how we call the abbreviations, and it won't change.

>   (enum Pos
>     (in-module (Gtk CTree))
>     (c-name GtkCTreePos)
>     (value (name before) (c-name GTK_CTREE_POS_BEFORE))
>     (value (name as-child) (c-name GTK_CTREE_POS_AS_CHILD))
>     (value (name after) (c-name GTK_CTREE_POS_AFTER)))
> 
> ===
> (flags) is just like enum, but some bindings may wrap enums and flags differently.
>     
> ===
> 
> (boxed boxed-name
>   (in-module modname)
>   (c-name c-name)
>   (ref-func func-to-increase-refcount)
>   (copy-func func-to-copy)
>   (release-func func-to-destroy-or-decrement-refcount)
>   (field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
> 
> It is never OK to use memcpy() to copy a boxed type, or use
> malloc()/free() to alloc/free one.
> 
> Ex:
> 
>  (boxed Pixmap
>    (in-module (Gdk))
>    (c-name GdkPixmap)
>    (ref-func pixmap_ref)
>    (unref-func pixmap_unref))

do you mean s/unref-func/release-func/ here?

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]