Commit 993a8717 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

use G_TYPE_POINTER for not registered classes, add has_type_id attribute

2007-08-31  Juerg Billeter  <j@bitron.ch>

	* vala/valaclass.vala, vala/valastruct.vala: use G_TYPE_POINTER for
	  not registered classes, add has_type_id attribute

	* vapigen/valagidlparser.vala: use GLib.Boxed as base type of boxed
	  types

	* vapi/glib-2.0.vala: use has_type_id attribute and GLib.Boxed

	* vapi/gconf-2.0.vala, vapi/gdk-2.0.vala, vapi/gnome-desktop-2.0.vala,
	  vapi/gnome-vfs-2.0.vala, vapi/gstreamer-0.10.vala, vapi/gtk+-2.0.vala,
	  vapi/libglade-2.0.vala, vapi/libgnome-2.0.vala, vapi/libsoup-2.2.vala,
	  vapi/pango.vala, vapi/poppler-glib.vala: regenerated

svn path=/trunk/; revision=550
parent 6804a07c
2007-08-31 Jürg Billeter <j@bitron.ch>
* vala/valaclass.vala, vala/valastruct.vala: use G_TYPE_POINTER for
not registered classes, add has_type_id attribute
* vapigen/valagidlparser.vala: use GLib.Boxed as base type of boxed
types
* vapi/glib-2.0.vala: use has_type_id attribute and GLib.Boxed
* vapi/gconf-2.0.vala, vapi/gdk-2.0.vala, vapi/gnome-desktop-2.0.vala,
vapi/gnome-vfs-2.0.vala, vapi/gstreamer-0.10.vala, vapi/gtk+-2.0.vala,
vapi/libglade-2.0.vala, vapi/libgnome-2.0.vala, vapi/libsoup-2.2.vala,
vapi/pango.vala, vapi/poppler-glib.vala: regenerated
2007-08-30 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* vapi/packages/gtksourceview-2.0/gtksourceview-2.0.metadata:
......
......@@ -57,6 +57,7 @@ public class Vala.Class : DataType {
private string const_cname;
private string lower_case_cprefix;
private string lower_case_csuffix;
private bool has_type_id;
private string type_id;
private string ref_function;
private string unref_function;
......@@ -397,6 +398,9 @@ public class Vala.Class : DataType {
if (a.has_argument ("free_function")) {
set_free_function (a.get_string ("free_function"));
}
if (a.has_argument ("has_type_id")) {
has_type_id = a.get_bool ("has_type_id");
}
if (a.has_argument ("type_id")) {
type_id = a.get_string ("type_id");
}
......@@ -441,9 +445,17 @@ public class Vala.Class : DataType {
}
}
private bool get_has_type_id () {
return has_type_id || (base_class != null && base_class.get_has_type_id ());
}
public override string get_type_id () {
if (type_id == null) {
type_id = get_upper_case_cname ("TYPE_");
if (get_has_type_id ()) {
type_id = get_upper_case_cname ("TYPE_");
} else {
type_id = "G_TYPE_POINTER";
}
}
return type_id;
......
......@@ -291,11 +291,7 @@ public class Vala.Struct : DataType {
public override string get_type_id () {
if (type_id == null) {
if (is_reference_type ()) {
type_id = "G_TYPE_POINTER";
} else {
Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (get_full_name ()));
}
Report.error (source_reference, "The type `%s` doesn't declare a type id".printf (get_full_name ()));
}
return type_id;
}
......
......@@ -121,7 +121,7 @@ namespace GConf {
public ulong vtable_size;
}
[CCode (ref_function = "gconf_change_set_ref", unref_function = "gconf_change_set_unref", cheader_filename = "gconf/gconf.h")]
public class ChangeSet {
public class ChangeSet : GLib.Boxed {
public bool check_value (string key, GConf.Value value_retloc);
public void clear ();
public void @foreach (GConf.ChangeSetForeachFunc func, pointer user_data);
......@@ -247,7 +247,7 @@ namespace GConf {
public void set_mod_user (string mod_user);
public void set_schema (string schema_name);
}
[CCode (cheader_filename = "gconf/gconf.h")]
[CCode (copy_function = "gconf_schema_copy", cheader_filename = "gconf/gconf.h")]
public class Schema {
public weak GConf.Schema copy ();
public GConf.ValueType get_car_type ();
......@@ -305,7 +305,7 @@ namespace GConf {
public weak GConf.Sources modified_sources;
public weak string key;
}
[CCode (cheader_filename = "gconf/gconf.h")]
[CCode (copy_function = "gconf_value_copy", cheader_filename = "gconf/gconf.h")]
public class Value {
public GConf.ValueType type;
public int compare (GConf.Value value_b);
......
......@@ -1163,7 +1163,7 @@ namespace Gdk {
public static weak Gdk.Bitmap create_from_data (Gdk.Drawable drawable, string data, int width, int height);
}
[CCode (ref_function = "gdk_cursor_ref", unref_function = "gdk_cursor_unref", cheader_filename = "gdk/gdk.h")]
public class Cursor {
public class Cursor : GLib.Boxed {
public Gdk.CursorType type;
public weak Gdk.Display get_display ();
public weak Gdk.Pixbuf get_image ();
......@@ -1391,7 +1391,7 @@ namespace Gdk {
public Gdk.WindowState new_window_state;
}
[CCode (ref_function = "gdk_font_ref", unref_function = "gdk_font_unref", cheader_filename = "gdk/gdk.h")]
public class Font {
public class Font : GLib.Boxed {
public Gdk.FontType type;
public int ascent;
public int descent;
......@@ -1517,14 +1517,13 @@ namespace Gdk {
[CCode (cheader_filename = "gdk/gdk.h")]
public class PointerHooks {
}
[CCode (cheader_filename = "gdk/gdk.h")]
[CCode (copy_function = "gdk_region_copy", free_function = "gdk_region_destroy", cheader_filename = "gdk/gdk.h")]
public class Region {
public long size;
public long numRects;
public weak Gdk.RegionBox rects;
public weak Gdk.RegionBox extents;
public weak Gdk.Region copy ();
public void destroy ();
public bool empty ();
public bool equal (Gdk.Region region2);
public void get_clipbox (out Gdk.Rectangle rectangle);
......@@ -1665,7 +1664,7 @@ namespace Gdk {
public static int trap_pop ();
public static void trap_push ();
}
[CCode (cheader_filename = "gdk/gdk.h")]
[CCode (copy_function = "gdk_event_copy", cheader_filename = "gdk/gdk.h")]
public class Event {
public weak Gdk.Event copy ();
public static weak Gdk.Event get ();
......
......@@ -575,6 +575,7 @@ namespace GLib {
}
[CCode (has_type_id = true)]
public class TypeInstance {
}
......@@ -652,9 +653,8 @@ namespace GLib {
public class InitiallyUnowned : Object {
}
public /* static */ interface Boxed<G> {
public abstract G copy ();
public abstract void free ();
[CCode (cname = "gpointer", has_type_id = true, type_id = "G_TYPE_BOXED", marshaller_type_name = "BOXED", get_value_function = "g_value_get_boxed", set_value_function = "g_value_set_boxed")]
public abstract class Boxed {
}
[CCode (free_function = "g_free", type_id = "G_TYPE_VALUE")]
......@@ -739,8 +739,7 @@ namespace GLib {
public static delegate void Callback ();
[CCode (type_id = "G_TYPE_CLOSURE")]
public class Closure {
public class Closure : Boxed {
}
public static delegate void ClosureNotify (pointer data, Closure closure);
......@@ -1175,8 +1174,8 @@ namespace GLib {
/* IO Channels */
[CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref", type_id = "G_TYPE_IO_CHANNEL")]
public class IOChannel {
[CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref")]
public class IOChannel : Boxed {
public IOChannel.file (string! filename, string! mode) throws FileError;
[CCode (cname = "g_io_channel_unix_new")]
public IOChannel.unix_new (int fd);
......@@ -1398,8 +1397,8 @@ namespace GLib {
public bool valid ();
}
[CCode (free_function = "g_date_free", type_id = "G_TYPE_DATE")]
public class Date {
[CCode (free_function = "g_date_free")]
public class Date : Boxed {
public Date ();
public Date.dmy (DateDay day, DateMonth month, DateYear year);
public Date.julian (uint julian_day);
......@@ -1862,8 +1861,8 @@ namespace GLib {
NEWLINE_ANY
}
[CCode (ref_function = "g_regex_ref", unref_function = "g_regex_unref", type_id = "G_TYPE_REGEX")]
public class Regex {
[CCode (ref_function = "g_regex_ref", unref_function = "g_regex_unref")]
public class Regex : Boxed {
public Regex (string! pattern, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0) throws RegexError;
public string! get_pattern ();
public int get_max_backref ();
......@@ -2155,8 +2154,8 @@ namespace GLib {
/* Hash Tables */
[CCode (ref_function = "g_hash_table_ref", unref_function = "g_hash_table_unref", type_id = "G_TYPE_HASH_TABLE")]
public class HashTable<K,V> {
[CCode (ref_function = "g_hash_table_ref", unref_function = "g_hash_table_unref")]
public class HashTable<K,V> : Boxed {
public HashTable (HashFunc hash_func, EqualFunc key_equal_func);
public HashTable.full (HashFunc hash_func, EqualFunc key_equal_func, DestroyNotify key_destroy_func, DestroyNotify value_destroy_func);
public void insert (K# key, V# value);
......@@ -2193,7 +2192,7 @@ namespace GLib {
/* Strings */
[CCode (free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]
public class String {
public class String : Boxed {
public String (string init = "");
[CCode (cname = "g_string_sized_new")]
public String.sized (ulong dfl_size);
......
......@@ -57,7 +57,7 @@ namespace Gnome {
public class Hint : Gtk.Dialog {
}
[CCode (ref_function = "gnome_desktop_item_ref", unref_function = "gnome_desktop_item_unref", cheader_filename = "libgnome/gnome-desktop-item.h")]
public class DesktopItem {
public class DesktopItem : GLib.Boxed {
public bool attr_exists (string attr);
public void clear_localestring (string attr);
public void clear_section (string section);
......
......@@ -466,7 +466,7 @@ namespace GnomeVFS {
public signal void drive_disconnected (GnomeVFS.Drive drive);
}
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class Address {
public class Address : GLib.Boxed {
public weak GnomeVFS.Address dup ();
public bool equal (GnomeVFS.Address b);
public int get_family_type ();
......@@ -480,12 +480,11 @@ namespace GnomeVFS {
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class AsyncHandle {
}
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
[CCode (free_function = "gnome_vfs_cancellation_destroy", cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class Cancellation {
public void ack ();
public void cancel ();
public bool check ();
public void destroy ();
public int get_fd ();
public Cancellation ();
}
......@@ -651,7 +650,6 @@ namespace GnomeVFS {
public class InetConnection {
public GnomeVFS.Result create (string host_name, uint host_port, GnomeVFS.Cancellation cancellation);
public GnomeVFS.Result create_from_address (GnomeVFS.Address address, uint host_port, GnomeVFS.Cancellation cancellation);
public void destroy (GnomeVFS.Cancellation cancellation);
public weak GnomeVFS.Address get_address ();
public int get_fd ();
public weak string get_ip ();
......@@ -676,7 +674,7 @@ namespace GnomeVFS {
public weak GLib.List list;
public uint entries_read;
}
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
[CCode (copy_function = "gnome_vfs_mime_application_copy", cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class MimeApplication {
public weak string id;
public weak string name;
......@@ -911,11 +909,10 @@ namespace GnomeVFS {
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class ResolveHandle {
}
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
[CCode (free_function = "gnome_vfs_ssl_destroy", cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class SSL {
public GnomeVFS.Result create (string host, uint port, GnomeVFS.Cancellation cancellation);
public GnomeVFS.Result create_from_fd (int fd, GnomeVFS.Cancellation cancellation);
public void destroy (GnomeVFS.Cancellation cancellation);
public static bool enabled ();
public GnomeVFS.Result read (pointer buffer, GnomeVFS.FileSize bytes, out GnomeVFS.FileSize bytes_read, GnomeVFS.Cancellation cancellation);
public GnomeVFS.Result set_timeout (out GLib.TimeVal timeout, GnomeVFS.Cancellation cancellation);
......@@ -955,9 +952,8 @@ namespace GnomeVFS {
public GnomeVFS.Result read (pointer buffer, GnomeVFS.FileSize bytes, out GnomeVFS.FileSize bytes_read, GnomeVFS.Cancellation cancellation);
public GnomeVFS.Result write (pointer buffer, int bytes, out GnomeVFS.FileSize bytes_written, GnomeVFS.Cancellation cancellation);
}
[CCode (cheader_filename = "libgnomevfs/gnome-vfs.h")]
[CCode (free_function = "gnome_vfs_socket_buffer_destroy", cheader_filename = "libgnomevfs/gnome-vfs.h")]
public class SocketBuffer {
public GnomeVFS.Result destroy (bool close_socket, GnomeVFS.Cancellation cancellation);
public GnomeVFS.Result flush (GnomeVFS.Cancellation cancellation);
public SocketBuffer (GnomeVFS.Socket socket);
public GnomeVFS.Result peekc (string character, GnomeVFS.Cancellation cancellation);
......
......@@ -1209,7 +1209,7 @@ namespace Gst {
public class BinaryTypeFindFactory {
}
[CCode (ref_function = "gst_caps_ref", unref_function = "gst_caps_unref", cheader_filename = "gst/gst.h")]
public class Caps {
public class Caps : GLib.Boxed {
public GLib.Type type;
public int refcount;
public Gst.CapsFlags flags;
......@@ -1286,8 +1286,8 @@ namespace Gst {
public Gst.Format format;
public int64 value;
}
[CCode (cheader_filename = "gst/gst.h")]
public class IndexEntry {
[CCode (copy_function = "gst_index_entry_copy", cheader_filename = "gst/gst.h")]
public class IndexEntry : GLib.Boxed {
public bool assoc_map (Gst.Format format, int64 value);
public weak Gst.IndexEntry copy ();
public static GLib.Type get_type ();
......@@ -1336,7 +1336,7 @@ namespace Gst {
public GLib.Quark quark;
}
[CCode (cheader_filename = "gst/gst.h")]
public class Segment {
public class Segment : GLib.Boxed {
public double rate;
public double abs_rate;
public Gst.Format format;
......@@ -1377,8 +1377,8 @@ namespace Gst {
public weak Gst.Caps get_caps ();
public static GLib.Type get_type ();
}
[CCode (cheader_filename = "gst/gst.h")]
public class Structure {
[CCode (copy_function = "gst_structure_copy", cheader_filename = "gst/gst.h")]
public class Structure : GLib.Boxed {
public GLib.Type type;
public weak Gst.Structure copy ();
public static weak Gst.Structure empty_new (string name);
......@@ -1426,8 +1426,8 @@ namespace Gst {
public void set_value (string fieldname, GLib.Value value);
public weak string to_string ();
}
[CCode (cheader_filename = "gst/gst.h")]
public class TagList {
[CCode (copy_function = "gst_tag_list_copy", cheader_filename = "gst/gst.h")]
public class TagList : GLib.Boxed {
public GLib.Type type;
public void add (Gst.TagMergeMode mode, string tag);
public void add_valist (Gst.TagMergeMode mode, string tag, pointer var_args);
......@@ -1475,9 +1475,8 @@ namespace Gst {
public TagList ();
public void remove_tag (string tag);
}
[CCode (cheader_filename = "gst/gst.h")]
[CCode (free_function = "gst_trace_destroy", cheader_filename = "gst/gst.h")]
public class Trace {
public void destroy ();
public void flush ();
public Trace (string filename, int size);
public static void read_tsc (int64 dst);
......
......@@ -5058,8 +5058,8 @@ namespace Gtk {
public weak string domain_dirname;
public weak string default_locales;
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class IconInfo {
[CCode (copy_function = "gtk_icon_info_copy", cheader_filename = "gtk/gtk.h")]
public class IconInfo : GLib.Boxed {
public weak Gtk.IconInfo copy ();
[NoArrayLength]
public bool get_attach_points (Gdk.Point[] points, int n_points);
......@@ -5073,7 +5073,7 @@ namespace Gtk {
public void set_raw_coordinates (bool raw_coordinates);
}
[CCode (ref_function = "gtk_icon_set_ref", unref_function = "gtk_icon_set_unref", cheader_filename = "gtk/gtk.h")]
public class IconSet {
public class IconSet : GLib.Boxed {
public void add_source (Gtk.IconSource source);
public weak Gtk.IconSet copy ();
[NoArrayLength]
......@@ -5083,8 +5083,8 @@ namespace Gtk {
public IconSet.from_pixbuf (Gdk.Pixbuf pixbuf);
public weak Gdk.Pixbuf render_icon (Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail);
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class IconSource {
[CCode (copy_function = "gtk_icon_source_copy", cheader_filename = "gtk/gtk.h")]
public class IconSource : GLib.Boxed {
public weak Gtk.IconSource copy ();
public Gtk.TextDirection get_direction ();
public bool get_direction_wildcarded ();
......@@ -5165,8 +5165,8 @@ namespace Gtk {
public int start;
public int end;
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class PaperSize {
[CCode (copy_function = "gtk_paper_size_copy", cheader_filename = "gtk/gtk.h")]
public class PaperSize : GLib.Boxed {
public weak Gtk.PaperSize copy ();
public static weak string get_default ();
public double get_default_bottom_margin (Gtk.Unit unit);
......@@ -5241,7 +5241,7 @@ namespace Gtk {
public int age;
}
[CCode (ref_function = "gtk_recent_info_ref", unref_function = "gtk_recent_info_unref", cheader_filename = "gtk/gtk.h")]
public class RecentInfo {
public class RecentInfo : GLib.Boxed {
public bool exists ();
public ulong get_added ();
public int get_age ();
......@@ -5273,8 +5273,8 @@ namespace Gtk {
public double ruler_scale;
public int subdivide;
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class SelectionData {
[CCode (copy_function = "gtk_selection_data_copy", cheader_filename = "gtk/gtk.h")]
public class SelectionData : GLib.Boxed {
public Gdk.Atom selection;
public Gdk.Atom target;
public Gdk.Atom type;
......@@ -5307,7 +5307,7 @@ namespace Gtk {
public weak string origin;
public weak GLib.Value value;
}
[CCode (cheader_filename = "gtk/gtk.h")]
[CCode (copy_function = "gtk_stock_item_copy", cheader_filename = "gtk/gtk.h")]
public class StockItem {
public weak string stock_id;
public weak string label;
......@@ -5350,7 +5350,7 @@ namespace Gtk {
public uint info;
}
[CCode (ref_function = "gtk_target_list_ref", unref_function = "gtk_target_list_unref", cheader_filename = "gtk/gtk.h")]
public class TargetList {
public class TargetList : GLib.Boxed {
public weak GLib.List list;
public uint ref_count;
public void add (Gdk.Atom target, uint flags, uint info);
......@@ -5384,7 +5384,7 @@ namespace Gtk {
public uint is_text;
}
[CCode (ref_function = "gtk_text_attributes_ref", unref_function = "gtk_text_attributes_unref", cheader_filename = "gtk/gtk.h")]
public class TextAttributes {
public class TextAttributes : GLib.Boxed {
public weak Gtk.TextAppearance appearance;
public Gtk.Justification justification;
public Gtk.TextDirection direction;
......@@ -5423,8 +5423,8 @@ namespace Gtk {
[CCode (cheader_filename = "gtk/gtk.h")]
public class ThemeEngine {
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class TreePath {
[CCode (copy_function = "gtk_tree_path_copy", cheader_filename = "gtk/gtk.h")]
public class TreePath : GLib.Boxed {
public void append_index (int index_);
public int compare (Gtk.TreePath b);
public weak Gtk.TreePath copy ();
......@@ -5446,8 +5446,8 @@ namespace Gtk {
public weak string to_string ();
public bool up ();
}
[CCode (cheader_filename = "gtk/gtk.h")]
public class TreeRowReference {
[CCode (copy_function = "gtk_tree_row_reference_copy", cheader_filename = "gtk/gtk.h")]
public class TreeRowReference : GLib.Boxed {
public weak Gtk.TreeRowReference copy ();
public static void deleted (GLib.Object proxy, Gtk.TreePath path);
public weak Gtk.TreeModel get_model ();
......
......@@ -49,7 +49,7 @@ namespace Glade {
public weak Glade.WidgetInfo child;
public weak string internal_child;
}
[CCode (cheader_filename = "glade/glade.h")]
[CCode (free_function = "glade_interface_destroy", cheader_filename = "glade/glade.h")]
public class Interface {
public weak string requires;
public uint n_requires;
......@@ -57,7 +57,6 @@ namespace Glade {
public uint n_toplevels;
public weak GLib.HashTable names;
public weak GLib.HashTable strings;
public void destroy ();
public void dump (string filename);
}
[CCode (cheader_filename = "glade/glade.h")]
......
......@@ -96,7 +96,7 @@ namespace Gnome {
public weak string espeaker { get; set; }
}
[CCode (cheader_filename = "libgnome/libgnome.h")]
public class ModuleInfo {
public class ModuleInfo : GLib.Boxed {
public weak string name;
public weak string version;
public weak string description;
......
......@@ -461,10 +461,9 @@ namespace Soup {
public uchar @in;
public bool doByteReverse;
}
[CCode (cheader_filename = "libsoup/soup.h")]
[CCode (free_function = "soup_message_queue_destroy", cheader_filename = "libsoup/soup.h")]
public class MessageQueue {
public void append (Soup.Message msg);
public void destroy ();
public weak Soup.Message first (Soup.MessageQueueIter iter);
public void free_iter (Soup.MessageQueueIter iter);
public MessageQueue ();
......@@ -526,7 +525,7 @@ namespace Soup {
public Soup.ServerUnregisterFn unregister;
public pointer user_data;
}
[CCode (cheader_filename = "libsoup/soup.h")]
[CCode (copy_function = "soup_uri_copy", cheader_filename = "libsoup/soup.h")]
public class Uri {
public GLib.Quark protocol;
public weak string user;
......
......@@ -212,7 +212,7 @@ namespace Pango {
WORD_CHAR,
}
[CCode (cheader_filename = "pango/pango.h")]
public class Language {
public class Language : GLib.Boxed {
public weak string! to_string ();
public static weak Pango.Language from_string (string language);
public static weak Pango.Language get_default ();
......@@ -421,10 +421,9 @@ namespace Pango {
public weak Pango.Attribute attr;
public int value;
}
[CCode (cheader_filename = "pango/pango.h")]
[CCode (copy_function = "pango_attr_iterator_copy", free_function = "pango_attr_iterator_destroy", cheader_filename = "pango/pango.h")]
public class AttrIterator {
public weak Pango.AttrIterator copy ();
public void destroy ();
public weak Pango.Attribute get (Pango.AttrType type);
public weak GLib.SList get_attrs ();
public void get_font (Pango.FontDescription desc, Pango.Language language, GLib.SList extra_attrs);
......@@ -438,7 +437,7 @@ namespace Pango {
public AttrLanguage (Pango.Language language);
}
[CCode (ref_function = "pango_attr_list_ref", unref_function = "pango_attr_list_unref", cheader_filename = "pango/pango.h")]
public class AttrList {
public class AttrList : GLib.Boxed {
public void change (Pango.Attribute attr);
public weak Pango.AttrList copy ();
public weak Pango.AttrList filter (Pango.AttrFilterFunc func, pointer data);
......@@ -472,13 +471,12 @@ namespace Pango {
public weak Pango.Attribute attr;
public weak string value;
}
[CCode (cheader_filename = "pango/pango.h")]
[CCode (copy_function = "pango_attribute_copy", free_function = "pango_attribute_destroy", cheader_filename = "pango/pango.h")]
public class Attribute {
public pointer klass;
public uint start_index;
public uint end_index;
public weak Pango.Attribute copy ();
public void destroy ();
public bool equal (Pango.Attribute attr2);
}
[CCode (ref_function = "pango_coverage_ref", unref_function = "pango_coverage_unref", cheader_filename = "pango/pango.h")]
......@@ -499,8 +497,8 @@ namespace Pango {
[CCode (cheader_filename = "pango/pango.h")]
public class EngineShape {
}
[CCode (cheader_filename = "pango/pango.h")]
public class FontDescription {
[CCode (copy_function = "pango_font_description_copy", cheader_filename = "pango/pango.h")]
public class FontDescription : GLib.Boxed {
public bool better_match (Pango.FontDescription old_match, Pango.FontDescription new_match);
public weak Pango.FontDescription copy ();
public weak Pango.FontDescription copy_static ();
......@@ -534,7 +532,7 @@ namespace Pango {
public void unset_fields (Pango.FontMask to_unset);
}
[CCode (ref_function = "pango_font_metrics_ref", unref_function = "pango_font_metrics_unref", cheader_filename = "pango/pango.h")]
public class FontMetrics {
public class FontMetrics : GLib.Boxed {
public int get_approximate_char_width ();
public int get_approximate_digit_width ();
public int get_ascent ();
......@@ -565,8 +563,8 @@ namespace Pango {
public void letter_space (string text, Pango.LogAttr log_attrs, int letter_spacing);
public weak Pango.GlyphItem split (string text, int split_index);
}
[CCode (cheader_filename = "pango/pango.h")]
public class GlyphString {
[CCode (copy_function = "pango_glyph_string_copy", cheader_filename = "pango/pango.h")]
public class GlyphString : GLib.Boxed {
public int num_glyphs;
public weak Pango.GlyphInfo glyphs;
public int log_clusters;
......@@ -585,8 +583,8 @@ namespace Pango {
public class GlyphVisAttr {
public uint is_cluster_start;
}
[CCode (cheader_filename = "pango/pango.h")]
public class Item {
[CCode (copy_function = "pango_item_copy", cheader_filename = "pango/pango.h")]
public class Item : GLib.Boxed {
public int offset;
public int length;
public int num_chars;
......@@ -597,7 +595,7 @@ namespace Pango {
public weak Pango.Item split (int split_index, int split_offset);
}
[CCode (cheader_filename = "pango/pango.h")]
public class LayoutIter {
public class LayoutIter : GLib.Boxed {
public bool at_last_line ();
public int get_baseline ();
public void get_char_extents (out Pango.Rectangle logical_rect);
......@@ -618,7 +616,7 @@ namespace Pango {
public bool next_run ();
}
[CCode (ref_function = "pango_layout_line_ref", unref_function = "pango_layout_line_unref", cheader_filename = "pango/pango.h")]
public class LayoutLine {
public class LayoutLine : GLib.Boxed {