attached files show that edje_object_signal_callback_add() will not
work while in signal emission.

This pattern is often used to wait for animations to end.

I guess the problem is with fnmatch replacement not being invalidaded
as it should. I'll look into this soon, but if someone (Cedric?) have
ideas before, then fix it! :-)

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [EMAIL PROTECTED]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Edje.h>
#include <stdio.h>
#include <stdlib.h>

//#define WORK_AROUND

static void end(void *data, Evas_Object *o, const char *emission, const char *source)
{
    printf("ended, now reset!\n");
#ifdef WORK_AROUND
    edje_object_signal_callback_del(o, "end", source, end);
#endif
    edje_object_signal_emit(o, "reset", source);
}

static void clicked(void *data, Evas_Object *o, const char *emission, const char *source)
{
    printf("wait end...\n");
#ifdef WORK_AROUND
    edje_object_signal_callback_add(o, "end", source, end, data);
#endif
    edje_object_signal_emit(o, "start", source);
}

static void delete(void *data, Evas *e, Evas_Object *o, void *einfo)
{
    ecore_main_loop_quit();
}

int main(int argc, char *argv[]) {
    evas_init();
    ecore_init();
    ecore_evas_init();
    edje_init();

    Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 320, 240, NULL);
    Evas *e = ecore_evas_get(ee);
    Evas_Object *o = edje_object_add(e);
    ecore_evas_object_associate(ee, o, 0);
    edje_object_file_set(o, "t.edj", "main");
    evas_object_resize(o, 320, 240);
    evas_object_show(o);

    evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, delete, NULL);
    edje_object_signal_callback_add(o, "mouse,clicked,1", "p", clicked, NULL);

#ifdef WORK_AROUND
    printf("using work around.\n");
    edje_object_signal_callback_add(o, "end", "p", end, NULL);
#endif

    ecore_main_loop_begin();

    return 0;
}
collections {
   group {
      name: "main";
      parts {

         part {
            name: "p";
            type: RECT;
            description {
               state: "default" 0.0;
               color: 255 255 255 255;
            }
            description {
               state: "changed" 0.0;
               color: 255 0 0 255;
            }
         }

         programs {
            program {
               name: "reset";
               signal: "reset";
               source: "p";
               action: STATE_SET "default" 0.0;
               target: "p";
            }

            program {
               name: "start";
               signal: "start";
               source: "p";
               action: STATE_SET "changed" 0.0;
               transition: LINEAR 1.0;
               target: "p";
               after: "end";
            }

            program {
               name: "end";
               action: SIGNAL_EMIT "end" "p";
            }
         }
      }
   }
}
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to