X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Frb_edje_main.c;h=d11d4565121cf206f3f1a460d18782173f0cd372;hb=65601ae3f90449b95a469ae55f3dc8d4f0242a27;hp=a553b54703202fbb8aff456105bd27cd599bda10;hpb=30fb3b8341f1f9ee89d0fc2a699401c98b4c9201;p=ruby-edje.git diff --git a/src/rb_edje_main.c b/src/rb_edje_main.c index a553b54..d11d456 100644 --- a/src/rb_edje_main.c +++ b/src/rb_edje_main.c @@ -1,5 +1,5 @@ /* - * $Id: rb_edje_main.c 59 2004-08-10 14:10:31Z tilman $ + * $Id: rb_edje_main.c 330 2005-04-28 15:38:47Z tilman $ * * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de) * @@ -78,6 +78,27 @@ static VALUE m_frametime_set (VALUE self, VALUE val) return Qnil; } +static VALUE m_collections_get (VALUE self, VALUE file) +{ + VALUE ary; + Evas_List *list, *l; + + Check_Type (file, T_STRING); + + ary = rb_ary_new (); + + list = edje_file_collection_list (StringValuePtr (file)); + if (!list) + return ary; + + for (l = list; l; l = l->next) + rb_ary_push (ary, rb_str_new2 (l->data)); + + edje_file_collection_list_free (list); + + return ary; +} + void Init_edje (void) { rb_require ("evas"); @@ -88,6 +109,7 @@ void Init_edje (void) rb_define_module_function (mEdje, "thaw", m_thaw, 0); rb_define_module_function (mEdje, "frametime", m_frametime_get, 0); rb_define_module_function (mEdje, "frametime=", m_frametime_set, 1); + rb_define_module_function (mEdje, "collections", m_collections_get, 1); Init_Edje (); Init_Part ();