Trigger EDC animation from C code

This snipped shows how to trigger an animation (defined in .edc file) by emitting a signal from C code.
//EDC file
collections {
   group { name: "main";
      parts {
		 part 
         { 
            name: "rectangle";
            type: RECT;
            mouse_events: 1;
            description{ 
               state: "default" 0.0;
               color: 200 200 200 255;
               rel1.relative: 0.4 0.45;
               rel2.relative: 0.6 0.55;
            }
            description{ 
               state: "large" 0.0;
               inherit: "default" 0.0;
               rel1.relative: 0.3 0.4;
               rel2.relative: 0.7 0.6;
            }
         }  
      }
      programs {
		program { 
			name: "bounce";
            signal: "animation,play";
            source: "bounce";
            action: STATE_SET "large" 0.0;
            transition: LINEAR 0.3;
            target: "rectangle";
        }
      }
   }
}

//C code
void play_animation(appdata_s *ad){
	edje_object_signal_emit(elm_layout_edje_get(ad->layout), "animation,play", "bounce");
}

Responses

0 Replies