vala r1425 - in trunk: . gee gobject gobject-introspection tests vala vapi
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r1425 - in trunk: . gee gobject gobject-introspection tests vala vapi
- Date: Sun, 25 May 2008 13:29:25 +0000 (UTC)
Author: juergbi
Date: Sun May 25 13:29:24 2008
New Revision: 1425
URL: http://svn.gnome.org/viewvc/vala?rev=1425&view=rev
Log:
2008-05-25 Juerg Billeter <j bitron ch>
* vala/valaclass.vala:
* vala/valainterfacewriter.vala:
* gobject/valaccodeclassbinding.vala:
* gobject/valaccodegenerator.vala:
* gobject/valaccodememberaccessbinding.vala:
* gobject/valaccodemethodbinding.vala:
* gobject/valatyperegisterfunction.vala:
Add support for [Compact] class attribute, register non-compact
classes with GType, fixes bug 532518
* gee/hashmap.vala:
* gee/hashset.vala:
* gobject-introspection/gidl.vapi:
* tests/classes.exp:
* tests/classes.vala:
* vapi/glib-2.0.vapi:
Update to use compact classes where appropriate
Modified:
trunk/ChangeLog
trunk/gee/hashmap.vala
trunk/gee/hashset.vala
trunk/gobject-introspection/gidl.vapi
trunk/gobject/valaccodeclassbinding.vala
trunk/gobject/valaccodegenerator.vala
trunk/gobject/valaccodememberaccessbinding.vala
trunk/gobject/valaccodemethodbinding.vala
trunk/gobject/valatyperegisterfunction.vala
trunk/tests/classes.exp
trunk/tests/classes.vala
trunk/vala/valaclass.vala
trunk/vala/valainterfacewriter.vala
trunk/vapi/glib-2.0.vapi
Modified: trunk/gee/hashmap.vala
==============================================================================
--- trunk/gee/hashmap.vala (original)
+++ trunk/gee/hashmap.vala Sun May 25 13:29:24 2008
@@ -168,6 +168,7 @@
clear ();
}
+ [Compact]
private class Node<K,V> {
public K key;
public V value;
Modified: trunk/gee/hashset.vala
==============================================================================
--- trunk/gee/hashset.vala (original)
+++ trunk/gee/hashset.vala Sun May 25 13:29:24 2008
@@ -152,6 +152,7 @@
clear ();
}
+ [Compact]
private class Node<G> {
public G key;
public Node<G> next;
Modified: trunk/gobject-introspection/gidl.vapi
==============================================================================
--- trunk/gobject-introspection/gidl.vapi (original)
+++ trunk/gobject-introspection/gidl.vapi Sun May 25 13:29:24 2008
@@ -26,7 +26,8 @@
namespace Idl {
public List<IdlModule> parse_file (string filename) throws MarkupError;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_module_free", cheader_filename = "gidlmodule.h")]
public class IdlModule {
public string name;
@@ -56,13 +57,15 @@
FIELD,
XREF
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNode {
public IdlNodeTypeId type;
public string name;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeFunction {
public bool deprecated;
@@ -79,6 +82,7 @@
public List<IdlNodeParam> parameters;
}
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeVFunc
{
@@ -91,7 +95,8 @@
public IdlNodeParam result;
public int offset;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeSignal {
public bool deprecated;
@@ -112,7 +117,8 @@
public List<IdlNodeParam> parameters;
public IdlNodeParam result;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeBoxed {
public bool deprecated;
@@ -122,7 +128,8 @@
public List<IdlNode> members;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeEnum {
public bool deprecated;
@@ -132,7 +139,8 @@
public List<IdlNode> values;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeField {
public bool readable;
@@ -142,7 +150,8 @@
public IdlNodeType type;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeConstant {
public bool deprecated;
@@ -151,7 +160,8 @@
public string value;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeInterface {
public bool deprecated;
@@ -166,7 +176,8 @@
public List<IdlNode> members;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeParam {
public bool @in;
@@ -180,7 +191,8 @@
public IdlNodeType type;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeProperty {
public bool deprecated;
@@ -194,21 +206,24 @@
public IdlNodeType type;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeStruct {
public bool deprecated;
public List<IdlNode> members;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeUnion {
public bool deprecated;
public List<IdlNode> members;
}
-
+
+ [Compact]
[CCode (free_function = "g_idl_node_free", cheader_filename = "gidlnode.h")]
public class IdlNodeType {
public bool is_pointer;
Modified: trunk/gobject/valaccodeclassbinding.vala
==============================================================================
--- trunk/gobject/valaccodeclassbinding.vala (original)
+++ trunk/gobject/valaccodeclassbinding.vala Sun May 25 13:29:24 2008
@@ -46,9 +46,9 @@
codegen.current_type_symbol = cl;
codegen.current_class = cl;
- bool is_gtypeinstance = cl.is_subtype_of (codegen.gtypeinstance_type);
+ bool is_gtypeinstance = !cl.is_compact;
bool is_gobject = cl.is_subtype_of (codegen.gobject_type);
- bool is_fundamental = (cl.base_class == codegen.gtypeinstance_type);
+ bool is_fundamental = is_gtypeinstance && cl.base_class == null;
if (cl.get_cname().len () < 3) {
cl.error = true;
@@ -106,9 +106,9 @@
if (cl.base_class != null) {
codegen.instance_struct.add_field (cl.base_class.get_cname (), "parent_instance");
- if (is_fundamental) {
- codegen.instance_struct.add_field ("volatile int", "ref_count");
- }
+ } else if (is_fundamental) {
+ codegen.instance_struct.add_field ("GTypeInstance", "parent_instance");
+ codegen.instance_struct.add_field ("volatile int", "ref_count");
}
if (is_gtypeinstance) {
Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala (original)
+++ trunk/gobject/valaccodegenerator.vala Sun May 25 13:29:24 2008
@@ -101,7 +101,6 @@
public DataType float_type;
public DataType double_type;
public Typesymbol gtype_type;
- public Typesymbol gtypeinstance_type;
public Typesymbol gobject_type;
public ErrorType gerror_type;
public Class glist_type;
@@ -228,7 +227,6 @@
var glib_ns = root_symbol.scope.lookup ("GLib");
gtype_type = (Typesymbol) glib_ns.scope.lookup ("Type");
- gtypeinstance_type = (Typesymbol) glib_ns.scope.lookup ("TypeInstance");
gobject_type = (Typesymbol) glib_ns.scope.lookup ("Object");
gerror_type = new ErrorType (null, null);
glist_type = (Class) glib_ns.scope.lookup ("List");
@@ -508,7 +506,7 @@
f.accept_children (this);
var cl = f.parent_symbol as Class;
- bool is_gtypeinstance = (cl != null && cl.is_subtype_of (gtypeinstance_type));
+ bool is_gtypeinstance = (cl != null && !cl.is_compact);
CCodeExpression lhs = null;
CCodeStruct st = null;
@@ -2991,7 +2989,7 @@
creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance));
} else if (expr.type_reference.data_type is Class) {
var cl = (Class) expr.type_reference.data_type;
- if (cl.base_class == gtypeinstance_type) {
+ if (!cl.is_compact && cl.base_class == null) {
creation_call.add_argument (new CCodeIdentifier (cl.get_type_id ()));
}
}
@@ -3190,9 +3188,9 @@
}
public override void visit_cast_expression (CastExpression expr) {
- if (expr.type_reference.data_type != null
- && expr.type_reference.data_type.is_subtype_of (gtypeinstance_type)
- && expr.type_reference.data_type != gtypeinstance_type) {
+ var cl = expr.type_reference.data_type as Class;
+ var iface = expr.type_reference.data_type as Interface;
+ if (iface != null || (cl != null && !cl.is_compact)) {
// checked cast for strict subtypes of GTypeInstance
if (expr.is_silent_cast) {
var ccomma = new CCodeCommaExpression ();
@@ -3436,9 +3434,9 @@
return cexpr;
}
- if (context.checking && target_type.data_type != null
- && target_type.data_type.is_subtype_of (gtypeinstance_type)
- && target_type.data_type != gtypeinstance_type) {
+ var cl = target_type.data_type as Class;
+ var iface = target_type.data_type as Interface;
+ if (context.checking && (iface != null || (cl != null && !cl.is_compact))) {
// checked cast for strict subtypes of GTypeInstance
return new InstanceCast (cexpr, target_type.data_type);
} else if (target_type.data_type != null && expression_type.get_cname () != target_type.get_cname ()) {
Modified: trunk/gobject/valaccodememberaccessbinding.vala
==============================================================================
--- trunk/gobject/valaccodememberaccessbinding.vala (original)
+++ trunk/gobject/valaccodememberaccessbinding.vala Sun May 25 13:29:24 2008
@@ -86,7 +86,8 @@
var instance_target_type = codegen.get_data_type_for_symbol ((Typesymbol) f.parent_symbol);
CCodeExpression typed_inst = codegen.get_implicit_cast_expression (pub_inst, instance_expression_type, instance_target_type);
- bool is_gtypeinstance = (instance_target_type.data_type.is_subtype_of (codegen.gtypeinstance_type));
+ var cl = instance_target_type.data_type as Class;
+ bool is_gtypeinstance = (cl == null || !cl.is_compact);
CCodeExpression inst;
if (is_gtypeinstance && f.access == SymbolAccessibility.PRIVATE) {
Modified: trunk/gobject/valaccodemethodbinding.vala
==============================================================================
--- trunk/gobject/valaccodemethodbinding.vala (original)
+++ trunk/gobject/valaccodemethodbinding.vala Sun May 25 13:29:24 2008
@@ -60,9 +60,9 @@
if (m is CreationMethod) {
codegen.in_creation_method = true;
var cl = codegen.current_type_symbol as Class;
- if (cl != null && cl.is_subtype_of (codegen.gtypeinstance_type)) {
+ if (cl != null && !cl.is_compact) {
in_gtypeinstance_creation_method = true;
- if (cl.base_class == codegen.gtypeinstance_type) {
+ if (cl.base_class == null) {
in_fundamental_creation_method = true;
} else if (cl.is_subtype_of (codegen.gobject_type)) {
in_gobject_creation_method = true;
@@ -785,7 +785,7 @@
private Class find_fundamental_class (Class cl) {
var fundamental_class = cl;
- while (fundamental_class != null && fundamental_class.base_class != codegen.gtypeinstance_type) {
+ while (fundamental_class != null && fundamental_class.base_class != null) {
fundamental_class = fundamental_class.base_class;
}
return fundamental_class;
Modified: trunk/gobject/valatyperegisterfunction.vala
==============================================================================
--- trunk/gobject/valatyperegisterfunction.vala (original)
+++ trunk/gobject/valatyperegisterfunction.vala Sun May 25 13:29:24 2008
@@ -36,7 +36,7 @@
public void init_from_type (bool plugin = false) {
bool fundamental = false;
Class cl = get_type_declaration () as Class;
- if (cl != null && cl.base_class != null && cl.base_class.name == "TypeInstance" && cl.base_class.parent_symbol.name == "GLib") {
+ if (cl != null && !cl.is_compact && cl.base_class == null) {
fundamental = true;
}
Modified: trunk/tests/classes.exp
==============================================================================
--- trunk/tests/classes.exp (original)
+++ trunk/tests/classes.exp Sun May 25 13:29:24 2008
@@ -1,13 +1,13 @@
Classes Test:
-new SimpleClass ()
+new CompactClass ()
new DerivedClass ()
new PublicClass ()
new ClassWithCreationMethod ()
ClassWithCreationMethod
new ClassWithNamedCreationMethod ()
ClassWithNamedCreationMethod
-new ClassWithDestructor ()
-~ClassWithDestructor
+new CompactClassWithDestructor ()
+~CompactClassWithDestructor
new SimpleGTypeInstanceClass ()
new DerivedGTypeInstanceClass ()
new PublicGTypeInstanceClass ()
@@ -20,6 +20,6 @@
new PublicGObjectClass ()
new GObjectClassWithCreationMethod ()
new GObjectClassWithNamedCreationMethod ()
-new SimpleClass () { field = 1 }
-simple_class.field = 1
+new CompactClass () { field = 1 }
+compact_class.field = 1
.
Modified: trunk/tests/classes.vala
==============================================================================
--- trunk/tests/classes.vala (original)
+++ trunk/tests/classes.vala Sun May 25 13:29:24 2008
@@ -1,29 +1,34 @@
using GLib;
-class SimpleClass {
+[Compact]
+class CompactClass {
public int field;
}
-class ClassWithDestructor {
- ~ClassWithDestructor () {
- stdout.printf ("~ClassWithDestructor\n");
+[Compact]
+class CompactClassWithDestructor {
+ ~CompactClassWithDestructor () {
+ stdout.printf ("~CompactClassWithDestructor\n");
}
/* FIXME bug 533977 */
public char dummy;
}
-class DerivedClass : SimpleClass {
+class DerivedClass : CompactClass {
}
+[Compact]
public class PublicClass {
public int field;
}
+[Compact]
abstract class AbstractClass {
public int field;
}
+[Compact]
class ClassWithCreationMethod {
public ClassWithCreationMethod () {
stdout.printf ("ClassWithCreationMethod\n");
@@ -32,6 +37,7 @@
public int field;
}
+[Compact]
class ClassWithNamedCreationMethod {
public ClassWithNamedCreationMethod.named () {
stdout.printf ("ClassWithNamedCreationMethod\n");
@@ -40,22 +46,22 @@
public int field;
}
-class SimpleGTypeInstanceClass : TypeInstance {
+class SimpleGTypeInstanceClass {
}
class DerivedGTypeInstanceClass : SimpleGTypeInstanceClass {
}
-public class PublicGTypeInstanceClass : TypeInstance {
+public class PublicGTypeInstanceClass {
}
-class GTypeInstanceClassWithCreationMethod : TypeInstance {
+class GTypeInstanceClassWithCreationMethod {
public GTypeInstanceClassWithCreationMethod () {
stdout.printf ("GTypeInstanceClassWithCreationMethod\n");
}
}
-class GTypeInstanceClassWithNamedCreationMethod : TypeInstance {
+class GTypeInstanceClassWithNamedCreationMethod {
public GTypeInstanceClassWithNamedCreationMethod.named () {
stdout.printf ("GTypeInstanceClassWithNamedCreationMethod\n");
}
@@ -86,8 +92,8 @@
void main () {
stdout.printf ("Classes Test:\n");
- stdout.printf ("new SimpleClass ()\n");
- var simple_class = new SimpleClass ();
+ stdout.printf ("new CompactClass ()\n");
+ var compact_class = new CompactClass ();
stdout.printf ("new DerivedClass ()\n");
var derived_class = new DerivedClass ();
stdout.printf ("new PublicClass ()\n");
@@ -96,9 +102,9 @@
var class_with_creation_method = new ClassWithCreationMethod ();
stdout.printf ("new ClassWithNamedCreationMethod ()\n");
var class_with_named_creation_method = new ClassWithNamedCreationMethod.named ();
- stdout.printf ("new ClassWithDestructor ()\n");
- var class_with_destructor = new ClassWithDestructor ();
- class_with_destructor = null;
+ stdout.printf ("new CompactClassWithDestructor ()\n");
+ var compact_class_with_destructor = new CompactClassWithDestructor ();
+ compact_class_with_destructor = null;
stdout.printf ("new SimpleGTypeInstanceClass ()\n");
var simple_gtypeinstance_class = new SimpleGTypeInstanceClass ();
@@ -122,9 +128,9 @@
stdout.printf ("new GObjectClassWithNamedCreationMethod ()\n");
var gobject_class_with_named_creation_method = new GObjectClassWithNamedCreationMethod.named ();
- stdout.printf ("new SimpleClass () { field = 1 }\n");
- simple_class = new SimpleClass () { field = 1 };
- stdout.printf ("simple_class.field = %d\n", simple_class.field);
+ stdout.printf ("new CompactClass () { field = 1 }\n");
+ compact_class = new CompactClass () { field = 1 };
+ stdout.printf ("compact_class.field = %d\n", compact_class.field);
stdout.printf (".\n");
}
Modified: trunk/vala/valaclass.vala
==============================================================================
--- trunk/vala/valaclass.vala (original)
+++ trunk/vala/valaclass.vala Sun May 25 13:29:24 2008
@@ -45,6 +45,23 @@
public bool is_static { get; set; }
/**
+ * Instances of compact classes are fast to create and have a
+ * compact memory layout. Compact classes don't support runtime
+ * type information or virtual methods.
+ */
+ public bool is_compact {
+ get {
+ if (base_class != null) {
+ return base_class.is_compact;
+ }
+ return _is_compact;
+ }
+ set {
+ _is_compact = value;
+ }
+ }
+
+ /**
* Specifies whether this class has private fields.
*/
public bool has_private_fields { get; private set; }
@@ -53,7 +70,6 @@
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;
@@ -63,6 +79,7 @@
private string get_value_function;
private string set_value_function;
private string? type_signature;
+ private bool _is_compact;
private Gee.List<TypeParameter> type_parameters = new ArrayList<TypeParameter> ();
@@ -498,9 +515,6 @@
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");
}
@@ -546,17 +560,15 @@
process_ccode_attribute (a);
} else if (a.name == "ErrorBase") {
is_error_base = true;
+ } else if (a.name == "Compact") {
+ is_compact = true;
}
}
}
- 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) {
- if (get_has_type_id ()) {
+ if (!is_compact) {
type_id = get_upper_case_cname ("TYPE_");
} else {
type_id = "G_TYPE_POINTER";
@@ -611,9 +623,7 @@
}
bool is_fundamental () {
- if (base_class != null
- && base_class.name == "TypeInstance"
- && base_class.parent_symbol.name == "GLib") {
+ if (!is_compact && base_class == null) {
return true;
}
return false;
Modified: trunk/vala/valainterfacewriter.vala
==============================================================================
--- trunk/vala/valainterfacewriter.vala (original)
+++ trunk/vala/valainterfacewriter.vala Sun May 25 13:29:24 2008
@@ -92,7 +92,13 @@
if (!check_accessibility (cl)) {
return;
}
-
+
+ if (cl.is_compact) {
+ write_indent ();
+ write_string ("[Compact]");
+ write_newline ();
+ }
+
write_indent ();
write_string ("[CCode (");
Modified: trunk/vapi/glib-2.0.vapi
==============================================================================
--- trunk/vapi/glib-2.0.vapi (original)
+++ trunk/vapi/glib-2.0.vapi Sun May 25 13:29:24 2008
@@ -544,6 +544,7 @@
HANGUL_LVT_SYLLABLE
}
+[Compact]
[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string", type_signature = "s")]
public class string {
[CCode (cname = "strstr")]
@@ -692,12 +693,12 @@
public uint instance_size;
}
+ // deprecated
[CCode (has_type_id = true)]
public class TypeInstance {
- [CCode (cname = "G_TYPE_FROM_INSTANCE")]
- public Type get_type ();
}
+ [Compact]
[CCode (ref_function = "g_type_class_ref", unref_function = "g_type_class_unref")]
public class TypeClass {
[CCode (cname = "G_TYPE_FROM_CLASS")]
@@ -715,6 +716,7 @@
public interface TypePlugin {
}
+ [Compact]
public class TypeModule : TypePlugin {
public bool use ();
public void unuse ();
@@ -722,8 +724,7 @@
}
[CCode (ref_function = "g_param_spec_ref", unref_function = "g_param_spec_unref")]
- public class ParamSpec : TypeInstance {
- public TypeInstance g_type_instance;
+ public class ParamSpec {
public string name;
public ParamFlags flags;
public Type value_type;
@@ -798,6 +799,7 @@
public weak EnumValue? get_value_by_nick (string name);
}
+ [Compact]
public class EnumValue {
public int value;
public weak string value_name;
@@ -811,12 +813,14 @@
public weak FlagsValue? get_value_by_nick (string name);
}
+ [Compact]
public class FlagsValue {
public int value;
public weak string value_name;
public weak string value_nick;
}
+ [Compact]
[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 {
}
@@ -917,6 +921,7 @@
public static delegate void Callback ();
+ [Compact]
public class Closure : Boxed {
}
@@ -1104,7 +1109,8 @@
}
/* The Main Event Loop */
-
+
+ [Compact]
[CCode (ref_function = "g_main_loop_ref", unref_function = "g_main_loop_unref")]
public class MainLoop {
public MainLoop (MainContext? context, bool is_running);
@@ -1121,7 +1127,8 @@
DEFAULT_IDLE,
LOW
}
-
+
+ [Compact]
[CCode (ref_function = "g_main_context_ref", unref_function = "g_main_context_unref")]
public class MainContext {
public MainContext ();
@@ -1195,7 +1202,8 @@
public IOCondition events;
public IOCondition revents;
}
-
+
+ [Compact]
[CCode (ref_function = "g_source_ref", unref_function = "g_source_unref")]
public class Source {
public Source (SourceFuncs source_funcs, uint struct_size /* = sizeof (Source) */);
@@ -1226,6 +1234,7 @@
public static delegate bool SourceDispatchFunc (Source source, SourceFunc _callback);
public static delegate void SourceFinalizeFunc (Source source);
+ [Compact]
public class SourceFuncs {
public SourcePrepareFunc prepare;
public SourceCheckFunc check;
@@ -1237,6 +1246,7 @@
public static delegate void SourceCallbackUnrefFunc (void* cb_data);
public static delegate void SourceCallbackGetFunc (void* cb_data, Source source, SourceFunc func);
+ [Compact]
public class SourceCallbackFuncs {
public SourceCallbackRefFunc @ref;
public SourceCallbackUnrefFunc unref;
@@ -1250,6 +1260,7 @@
}
/* Thread support */
+ [Compact]
public class ThreadFunctions {
}
@@ -1263,6 +1274,7 @@
URGENT
}
+ [Compact]
public class Thread {
public static void init (ThreadFunctions? vtable = null);
public static bool supported ();
@@ -1279,6 +1291,7 @@
public static void usleep (ulong microseconds);
}
+ [Compact]
[CCode (free_function = "g_mutex_free")]
public class Mutex {
public Mutex ();
@@ -1296,6 +1309,7 @@
public void lock_full ();
}
+ [Compact]
[CCode (free_function = "g_cond_free")]
public class Cond {
public Cond ();
@@ -1306,7 +1320,8 @@
}
/* Thread Pools */
-
+
+ [Compact]
[CCode (free_function = "g_thread_pool_free")]
public class ThreadPool {
public ThreadPool (Func func, void* user_data, int max_threads, bool exclusive) throws ThreadError;
@@ -1325,7 +1340,8 @@
}
/* Asynchronous Queues */
-
+
+ [Compact]
[CCode (ref_function = "g_async_queue_ref", unref_function = "g_async_queue_unref")]
public class AsyncQueue {
public AsyncQueue ();
@@ -1374,7 +1390,8 @@
}
/* IO Channels */
-
+
+ [Compact]
[CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref")]
public class IOChannel : Boxed {
[CCode (cname = "g_io_channel_unix_new")]
@@ -1465,6 +1482,7 @@
/* Error Reporting */
+ [Compact]
[ErrorBase]
[CCode (copy_function = "g_error_copy", free_function = "g_error_free")]
public class Error {
@@ -1602,6 +1620,7 @@
public ssize_t get_length ();
}
+ [Compact]
[CCode (free_function = "g_checksum_free")]
public class Checksum {
public Checksum (ChecksumType checksum_type);
@@ -1769,7 +1788,8 @@
}
/* Random Numbers */
-
+
+ [Compact]
[CCode (copy_function = "g_rand_copy", free_function = "g_rand_free")]
public class Rand {
public Rand.with_seed (uint32 seed);
@@ -1884,6 +1904,7 @@
/* Lexical Scanner */
+ [Compact]
[CCode (free_function = "g_scanner_destroy")]
public class Scanner {
public Scanner (ScannerConfig config_templ);
@@ -2012,6 +2033,7 @@
/* Timers */
+ [Compact]
[CCode (free_function = "g_timer_destroy")]
public class Timer {
public Timer ();
@@ -2155,6 +2177,7 @@
EXISTS
}
+ [Compact]
[CCode (cname = "FILE", free_function = "fclose", cheader_filename = "stdio.h")]
public class FileStream {
[CCode (cname = "fopen")]
@@ -2205,6 +2228,7 @@
public struct Stat {
}
+ [Compact]
[CCode (free_function = "g_dir_close")]
public class Dir {
public static Dir open (string filename, uint _flags = 0) throws FileError;
@@ -2220,7 +2244,8 @@
[CCode (cname = "mkdtemp")]
public static weak string mkdtemp (string template);
}
-
+
+ [Compact]
[CCode (free_function = "g_mapped_file_free")]
public class MappedFile {
public MappedFile (string filename, bool writable) throws FileError;
@@ -2275,6 +2300,7 @@
FAILED
}
+ [Compact]
[CCode (free_function = "g_option_context_free")]
public class OptionContext {
public OptionContext (string parameter_string);
@@ -2335,6 +2361,7 @@
public weak string arg_description;
}
+ [Compact]
[CCode (free_function = "g_option_group_free")]
public class OptionGroup {
public OptionGroup (string name, string description, string help_description, void* user_data, DestroyNotify? destroy);
@@ -2389,6 +2416,7 @@
NEWLINE_ANY
}
+ [Compact]
[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;
@@ -2416,6 +2444,7 @@
public static delegate bool RegexEvalCallback (MatchInfo match_info, StringBuilder result, void* user_data);
+ [Compact]
[CCode (free_function = "g_match_info_free")]
public class MatchInfo {
public weak Regex get_regex ();
@@ -2448,7 +2477,8 @@
public enum MarkupParseFlags {
TREAT_CDATA_AS_TEXT
}
-
+
+ [Compact]
[CCode (free_function = "g_markup_parse_context_free")]
public class MarkupParseContext {
public MarkupParseContext (MarkupParser parser, MarkupParseFlags _flags, void* user_data, DestroyNotify? user_data_dnotify);
@@ -2493,6 +2523,7 @@
INVALID_VALUE
}
+ [Compact]
[CCode (free_function = "g_key_file_free")]
public class KeyFile {
public KeyFile ();
@@ -2551,6 +2582,7 @@
/* Bookmark file parser */
+ [Compact]
[CCode (free_function = "g_bookmark_file_free")]
public class BookmarkFile {
public BookmarkFile ();
@@ -2652,7 +2684,8 @@
}
/* Doubly-Linked Lists */
-
+
+ [Compact]
[CCode (dup_function = "g_list_copy", free_function = "g_list_free")]
public class List<G> {
[ReturnsModifiedPointer ()]
@@ -2705,7 +2738,8 @@
}
/* Singly-Linked Lists */
-
+
+ [Compact]
[CCode (dup_function = "g_slist_copy", free_function = "g_slist_free")]
public class SList<G> {
[ReturnsModifiedPointer ()]
@@ -2762,7 +2796,8 @@
public static GLib.CompareFunc strcmp;
/* Double-ended Queues */
-
+
+ [Compact]
[CCode (dup_function = "g_queue_copy", free_function = "g_queue_free")]
public class Queue<G> {
public weak List<G> head;
@@ -2797,6 +2832,7 @@
/* Sequences */
+ [Compact]
[CCode (free_function = "g_sequence_free")]
public class Sequence<G> {
public Sequence (DestroyNotify? data_destroy);
@@ -2827,6 +2863,7 @@
public static weak SequenceIter<G> range_get_midpoint (SequenceIter<G> begin, SequenceIter<G> end);
}
+ [Compact]
[CCode (ref_function = "", unref_function = "")]
public class SequenceIter<G> {
public bool is_begin ();
@@ -2842,7 +2879,8 @@
public delegate int SequenceIterCompareFunc<G> (SequenceIter<G> a, SequenceIter<G> b);
/* Hash Tables */
-
+
+ [Compact]
[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);
@@ -2886,6 +2924,7 @@
/* Strings */
+ [Compact]
[CCode (cname = "GString", cprefix = "g_string_", free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]
public class StringBuilder : Boxed {
public StringBuilder (string init = "");
@@ -2914,19 +2953,22 @@
}
/* Pointer Arrays */
-
+
+ [Compact]
[CCode (free_function = "g_ptr_array_free")]
public class PtrArray {
}
/* Byte Arrays */
+ [Compact]
[CCode (free_function = "g_byte_array_free")]
public class ByteArray {
}
/* N-ary Trees */
+ [Compact]
[CCode (free_function = "g_node_destroy")]
public class Node<G> {
public G data;
@@ -2965,7 +3007,8 @@
public delegate void DataForeachFunc<G> (Quark key_id, G data);
/* GArray */
-
+
+ [Compact]
public class Array<G> {
public Array (bool zero_terminated, bool clear, uint element_size);
[CCode (cname = "g_array_sized_new")]
@@ -3006,7 +3049,8 @@
POST_ORDER,
LEVEL_ORDER
}
-
+
+ [Compact]
[CCode (free_function = "g_tree_destroy")]
public class Tree<K,V> {
public Tree (CompareFunc key_compare_func);
@@ -3120,6 +3164,7 @@
UNBLOCKED
}
+ [Compact]
public class PatternSpec {
public PatternSpec (string pattern);
public void free ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]