>From 9f33660b0794813e08757b3554561c92fd1b7c73 Mon Sep 17 00:00:00 2001 From: Yu Feng Date: Fri, 26 Jun 2009 10:36:49 +0800 Subject: [PATCH] Add type_id_const CCode attribute added to class enum struct, specifying whether the type_id is const or not --- vala/valaclass.vala | 5 +++++ vala/valaenum.vala | 5 +++++ vala/valastruct.vala | 5 +++++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/vala/valaclass.vala b/vala/valaclass.vala index 51efba3..284b631 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -103,6 +103,8 @@ public class Vala.Class : ObjectTypeSymbol { */ public bool has_class_private_fields { get; private set; } + public bool type_id_const { get; private set; default = false; } + private string cname; private string const_cname; private string lower_case_cprefix; @@ -630,6 +632,9 @@ public class Vala.Class : ObjectTypeSymbol { if (a.has_argument ("type_id")) { type_id = a.get_string ("type_id"); } + if (a.has_argument ("type_id_const")) { + type_id_const = a.get_bool ("type_id_const"); + } if (a.has_argument ("marshaller_type_name")) { marshaller_type_name = a.get_string ("marshaller_type_name"); } diff --git a/vala/valaenum.vala b/vala/valaenum.vala index 1d1e8c1..25c5cfe 100644 --- a/vala/valaenum.vala +++ b/vala/valaenum.vala @@ -37,6 +37,8 @@ public class Vala.Enum : TypeSymbol { */ public bool has_type_id { get; set; default = true; } + public bool type_id_const { get; private set; default = false; } + private Gee.List values = new ArrayList (); private Gee.List methods = new ArrayList (); private string cname; @@ -198,6 +200,9 @@ public class Vala.Enum : TypeSymbol { if (a.has_argument ("has_type_id")) { has_type_id = a.get_bool ("has_type_id"); } + if (a.has_argument ("type_id_const")) { + type_id_const = a.get_bool ("type_id_const"); + } if (a.has_argument ("type_id")) { type_id = a.get_string ("type_id"); } diff --git a/vala/valastruct.vala b/vala/valastruct.vala index 166edba..0efb222 100644 --- a/vala/valastruct.vala +++ b/vala/valastruct.vala @@ -91,6 +91,8 @@ public class Vala.Struct : TypeSymbol { */ public bool has_type_id { get; set; default = true; } + public bool type_id_const { get; private set; default = false; } + public int width { get; set; default = 32; } public bool signed { get; set; default = true; } @@ -380,6 +382,9 @@ public class Vala.Struct : TypeSymbol { if (a.has_argument ("type_id")) { set_type_id (a.get_string ("type_id")); } + if (a.has_argument ("type_id_const")) { + type_id_const = a.get_bool ("type_id_const"); + } if (a.has_argument ("marshaller_type_name")) { set_marshaller_type_name (a.get_string ("marshaller_type_name")); } -- 1.6.0.6