From af182891a87fdaf6847764b044e7acdb389807f3 Mon Sep 17 00:00:00 2001 From: Ali Sabil Date: Sat, 17 May 2008 08:57:51 +0000 Subject: [PATCH] Add class method detection 2008-05-17 Ali Sabil * vapigen/valagidlparser.vala: Add class method detection svn path=/trunk/; revision=1393 --- ChangeLog | 4 ++++ vapigen/valagidlparser.vala | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7159021..ecdc484 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-17 Ali Sabil + + * vapigen/valagidlparser.vala: Add class method detection + 2008-05-16 Jürg Billeter * vala/valaconstant.vala: diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 584d669..fd0298c 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -1315,6 +1315,17 @@ public class Vala.GIdlParser : CodeVisitor { param.type.@interface.has_suffix (current_data_type.get_cname ()))) { // instance method continue; + } else if (!(m is CreationMethod) && + current_data_type != null && + param.type.is_interface && + (param_node.name == "klass" || + param.type.@interface.has_suffix ("%sClass".printf(current_data_type.get_cname ())))) { + // class method + m.binding = MemberBinding.CLASS; + if (m.name.has_prefix ("class_")) { + m.name = m.name.substring ("class_".len (), m.name.len () - "class_".len ()); + } + continue; } else { // static method m.binding = MemberBinding.STATIC; -- 2.7.4