Sorry forgot to attach the files.
Here they are.

2009/1/15 Oguz Yarimtepe <comp....@gmail.com>:
> Hi,
>
> I have attached a simple edc file and a c file that is using it to
> show at the X. What the edc file is simple, just going from one state
> to another and changing its colors. I changed also the size of the
> text at one of the states by expecting i will see a size change, but
> it didn't. When i move the mouse out of the text area the font is set
> to 50 and then 40 back. I didn't understand the reason of it. I was
> expecting a zoom effect when i move the mouse on the text.
>
> Second, what should i do make the same effect with a key stroke
> instead of a mouse signal? It may be related with the usage of
> swallow. I tried to find the usage of SWALLOW and also the API, but
> didn't sort things out. I understood it is used for dynamically set
> the part but couln't managed to test it. Can someone give me simple
> usage example of using SWALLOW at an EDC file and using the Edje api
> to set the value and see the effetcs at run time?
>
> It is really bad that there is not an Edje api reference, i had to
> check the C and header files.
>
> Thanx.
>
> --
> Oğuz Yarımtepe
> www.loopbacking.info
>



-- 
Oğuz Yarımtepe
www.loopbacking.info
/* gcc  `pkg-config --cflags --libs ecore-evas evas ecore edje`  main-manual.c -o main */
#include <Ecore_Evas.h>
#include <Ecore.h>
#include <Edje.h>
#include <stdio.h>

int app_signal_exit(void *data, int type, void *event);
        /* GLOBALS */
        Ecore_Evas * ee;
        Evas * evas;
        Evas_Object * edje, *txt;
        Evas_Coord edje_w, edje_h;
        
        int r, g, b, a;
                
void key_down(void *data, Evas *e, Evas_Object *obj, void *event_info);

        
int main(int argv, char *argc[]){
	
		ecore_init();
        ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, app_signal_exit, 0);
        ecore_evas_init();
        
   	ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
   	//ee = ecore_evas_fb_new(NULL,0,0,0);
        ecore_evas_title_set(ee, "TITLE");
        ecore_evas_borderless_set(ee, 0);
        ecore_evas_shaped_set(ee, 0);
        ecore_evas_show(ee);
	
   evas = ecore_evas_get(ee);
	
        evas_font_path_append(evas, "/home/oguz/ELK-Tests");
        edje_init();
	
   edje = edje_object_add(evas);
   evas_object_event_callback_add(edje, EVAS_CALLBACK_KEY_DOWN, key_down, NULL);
   evas_object_focus_set(edje, 1);
        printf("%d\n",edje_object_file_set(edje, "manualfade.edj", "Main"));
        
     	
     	//printf("exist? %d\n", edje_edit_part_exist(edje, "foo"));
     	
		//edje_edit_state_color_get(edje, "foo", "default 0.00", &r, &g, &b, &a);
		//printf("r=%d g=%d b=%d a=%d\n", r, g, b, a);
		
        
        evas_object_move(edje, 0, 0);
        edje_object_size_max_get(edje, &edje_w, &edje_h);
		evas_object_resize(edje, edje_w, edje_h);
        evas_object_show(edje);
        ecore_evas_resize(ee, (int)edje_w, (int)edje_h);
        ecore_evas_show(ee);
        
        
        ecore_main_loop_begin();
        return 0;
}
int app_signal_exit(void *data, int type, void *event){
        printf("DEBUG: Exit called, shutting down\n");
        ecore_main_loop_quit();
        return 1;
}

void key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
        Evas_Event_Key_Down *ev;
        ev = (Evas_Event_Key_Down *)event_info;
        printf("You hit key: %s\n", ev->keyname);
}


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to