add the forgotten files
|
@ -0,0 +1 @@
|
||||||
|
2018-04-22b "Greebo"
|
|
@ -0,0 +1,103 @@
|
||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use splitbrain\phpcli\CLI;
|
||||||
|
use splitbrain\phpcli\Colors;
|
||||||
|
use splitbrain\phpcli\Options;
|
||||||
|
|
||||||
|
if(!defined('DOKU_INC')) define('DOKU_INC', realpath(dirname(__FILE__) . '/../') . '/');
|
||||||
|
define('NOSESSION', 1);
|
||||||
|
require_once(DOKU_INC . 'inc/init.php');
|
||||||
|
|
||||||
|
class PluginCLI extends CLI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register options and arguments on the given $options object
|
||||||
|
*
|
||||||
|
* @param Options $options
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function setup(Options $options) {
|
||||||
|
$options->setHelp('Excecutes Plugin command line tools');
|
||||||
|
$options->registerArgument('plugin', 'The plugin CLI you want to run. Leave off to see list', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Your main program
|
||||||
|
*
|
||||||
|
* Arguments and options have been parsed when this is run
|
||||||
|
*
|
||||||
|
* @param Options $options
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function main(Options $options) {
|
||||||
|
global $argv;
|
||||||
|
$argv = $options->getArgs();
|
||||||
|
|
||||||
|
if($argv) {
|
||||||
|
$plugin = $this->loadPlugin($argv[0]);
|
||||||
|
if($plugin !== null) {
|
||||||
|
$plugin->run();
|
||||||
|
} else {
|
||||||
|
$this->fatal('Command {cmd} not found.', ['cmd' => $argv[0]]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo $options->help();
|
||||||
|
$this->listPlugins();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List available plugins
|
||||||
|
*/
|
||||||
|
protected function listPlugins() {
|
||||||
|
/** @var Doku_Plugin_Controller $plugin_controller */
|
||||||
|
global $plugin_controller;
|
||||||
|
|
||||||
|
echo "\n";
|
||||||
|
echo "\n";
|
||||||
|
echo $this->colors->wrap('AVAILABLE PLUGINS:', Colors::C_BROWN);
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
|
$list = $plugin_controller->getList('cli');
|
||||||
|
sort($list);
|
||||||
|
if(!count($list)) {
|
||||||
|
echo $this->colors->wrap(" No plugins providing CLI components available\n", Colors::C_RED);
|
||||||
|
} else {
|
||||||
|
$tf = new \splitbrain\phpcli\TableFormatter($this->colors);
|
||||||
|
|
||||||
|
foreach($list as $name) {
|
||||||
|
$plugin = $this->loadPlugin($name);
|
||||||
|
if($plugin === null) continue;
|
||||||
|
$info = $plugin->getInfo();
|
||||||
|
|
||||||
|
echo $tf->format(
|
||||||
|
[2, '30%', '*'],
|
||||||
|
['', $name, $info['desc']],
|
||||||
|
['', Colors::C_CYAN, '']
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiate a CLI plugin
|
||||||
|
*
|
||||||
|
* @param string $name
|
||||||
|
* @return DokuWiki_CLI_Plugin|null
|
||||||
|
*/
|
||||||
|
protected
|
||||||
|
function loadPlugin($name) {
|
||||||
|
// execute the plugin CLI
|
||||||
|
$class = "cli_plugin_$name";
|
||||||
|
if(class_exists($class)) {
|
||||||
|
return new $class();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main
|
||||||
|
$cli = new PluginCLI();
|
||||||
|
$cli->run();
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"display": "standalone"
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
This is the www content for enlightenment.org
|
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 837 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 298 KiB |
After Width: | Height: | Size: 440 KiB |
|
@ -0,0 +1,142 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
//Click Callback: print Clicked
|
||||||
|
static void
|
||||||
|
_button_click_cb(void *data, Evas_Object *button, void *event_info)
|
||||||
|
{
|
||||||
|
elm_object_text_set(button, "Clicked!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Press callback: print Pressed
|
||||||
|
static void
|
||||||
|
_button_press_cb(void * data, Evas_Object *button, void *event_info)
|
||||||
|
{
|
||||||
|
elm_object_text_set(button, "Pressed!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Unpress callback: print Unpressed
|
||||||
|
static void
|
||||||
|
_button_unpress_cb(void *data, Evas_Object *button, void *event_info)
|
||||||
|
{
|
||||||
|
elm_object_text_set(button, "Unpressed!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Repeat callback: print number of times callback is called
|
||||||
|
static void
|
||||||
|
_button_repeat_cb(void *data, Evas_Object *button, void *event_info)
|
||||||
|
{
|
||||||
|
static int count = 0;
|
||||||
|
char buffer[16];
|
||||||
|
|
||||||
|
snprintf(buffer, sizeof(buffer), "Repeat %d", count++);
|
||||||
|
|
||||||
|
//print the number of time callback was called
|
||||||
|
elm_object_text_set(button, buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Unpress callback: print Focused
|
||||||
|
static void
|
||||||
|
_button_focused_cb(void * data, Evas_Object *button, void *event_info)
|
||||||
|
{
|
||||||
|
elm_object_text_set(button, "Focused");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Unpress callback: print Unfocused
|
||||||
|
static void
|
||||||
|
_button_unfocused_cb(void * data, Evas_Object *button, void *event_info)
|
||||||
|
{
|
||||||
|
elm_object_text_set(button, "Unfocused");
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Main", "Hello, World!");
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
/*basic tutorial code*/
|
||||||
|
//basic text button
|
||||||
|
Evas_Object *button_text;
|
||||||
|
button_text = elm_button_add(win);
|
||||||
|
|
||||||
|
elm_object_text_set(button_text,"Clik me");
|
||||||
|
|
||||||
|
//how a container object should resize a given child within its area
|
||||||
|
evas_object_size_hint_weight_set(button_text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
//how to align an object
|
||||||
|
evas_object_size_hint_align_set(button_text, EVAS_HINT_FILL, 0.5);
|
||||||
|
|
||||||
|
evas_object_resize(button_text, 100, 30);
|
||||||
|
evas_object_show(button_text);
|
||||||
|
|
||||||
|
//Basic icon button
|
||||||
|
Evas_Object *button_icon, *icon;
|
||||||
|
button_icon = elm_button_add(win);
|
||||||
|
icon = elm_icon_add(win);
|
||||||
|
|
||||||
|
//set the image file and the button as an icon
|
||||||
|
elm_image_file_set(icon, "icon.png", NULL);
|
||||||
|
elm_object_part_content_set(button_icon, "icon", icon);
|
||||||
|
|
||||||
|
evas_object_size_hint_weight_set(button_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(button_icon, EVAS_HINT_FILL, 0.5);
|
||||||
|
|
||||||
|
evas_object_resize(button_icon, 100, 30);
|
||||||
|
evas_object_move(button_icon, 110, 0);
|
||||||
|
evas_object_show(button_icon);
|
||||||
|
|
||||||
|
//Icon and text button
|
||||||
|
Evas_Object *button_icon_text, *icon2;
|
||||||
|
button_icon_text = elm_button_add(win);
|
||||||
|
icon2 = elm_icon_add(win);
|
||||||
|
|
||||||
|
elm_image_file_set(icon2, "icon.png", NULL);
|
||||||
|
elm_object_part_content_set(button_icon_text, "icon", icon2);
|
||||||
|
elm_object_text_set(button_icon_text, "Press me");
|
||||||
|
evas_object_size_hint_weight_set(button_icon_text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(button_icon_text, EVAS_HINT_FILL, 0.5);
|
||||||
|
|
||||||
|
evas_object_resize(button_icon_text, 100, 30);
|
||||||
|
evas_object_move(button_icon_text, 220, 0);
|
||||||
|
evas_object_show(button_icon_text);
|
||||||
|
|
||||||
|
//Clik event
|
||||||
|
evas_object_smart_callback_add(button_text, "clicked", _button_click_cb, NULL);
|
||||||
|
|
||||||
|
//Press event
|
||||||
|
evas_object_smart_callback_add(button_icon, "pressed", _button_press_cb, NULL);
|
||||||
|
//Unpress event
|
||||||
|
evas_object_smart_callback_add(button_icon, "unpressed", _button_unpress_cb, NULL);
|
||||||
|
|
||||||
|
//Get whether the autorepeat feature is enabled.
|
||||||
|
elm_button_autorepeat_set(button_icon_text, EINA_TRUE);
|
||||||
|
//Set the initial timeout before the autorepeat event is generated.
|
||||||
|
elm_button_autorepeat_initial_timeout_set(button_icon_text, 1.0);
|
||||||
|
//gap between two callbacks
|
||||||
|
elm_button_autorepeat_gap_timeout_set(button_icon_text, 0.5);
|
||||||
|
//"repeated": the user pressed the button without releasing it.
|
||||||
|
evas_object_smart_callback_add(button_icon_text, "repeated", _button_repeat_cb, NULL);
|
||||||
|
|
||||||
|
//Focused/unfocused event
|
||||||
|
Evas_Object *button;
|
||||||
|
|
||||||
|
button = elm_button_add(win);
|
||||||
|
elm_object_text_set(button, "button");
|
||||||
|
evas_object_resize(button, 100, 30);
|
||||||
|
evas_object_move(button, 0, 40);
|
||||||
|
evas_object_show(button);
|
||||||
|
|
||||||
|
evas_object_smart_callback_add(button, "focused", _button_focused_cb, NULL);
|
||||||
|
evas_object_smart_callback_add(button, "unfocused", _button_unfocused_cb, NULL);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,47 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Main", "Hello, World!");
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
/*basic tutorial code*/
|
||||||
|
//text_label
|
||||||
|
Evas_Object *label_text;
|
||||||
|
label_text = elm_label_add(win);
|
||||||
|
|
||||||
|
elm_object_text_set(label_text,"My label");
|
||||||
|
evas_object_color_set(label_text, 0, 0, 255, 255);
|
||||||
|
|
||||||
|
evas_object_resize(label_text, 90, 30);
|
||||||
|
evas_object_show(label_text);
|
||||||
|
|
||||||
|
//sliding text
|
||||||
|
Evas_Object *label_slide;
|
||||||
|
label_slide = elm_label_add(win);
|
||||||
|
|
||||||
|
elm_object_text_set(label_slide, "<b>Some long bold text for our label_slide, that is long but</b>"
|
||||||
|
"<b>not too long.</b>");
|
||||||
|
|
||||||
|
elm_object_style_set(label_slide,"slide_bounce");
|
||||||
|
elm_label_slide_duration_set(label_slide, 3);
|
||||||
|
elm_label_slide_mode_set(label_slide, ELM_LABEL_SLIDE_MODE_ALWAYS);
|
||||||
|
|
||||||
|
elm_label_slide_go(label_slide);
|
||||||
|
|
||||||
|
evas_object_resize(label_slide, 200, 15);
|
||||||
|
evas_object_move(label_slide,0,40);
|
||||||
|
evas_object_show(label_slide);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,66 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
_prepend_itembutton_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *list_it;
|
||||||
|
Evas_Object *li = obj;
|
||||||
|
|
||||||
|
Elm_Object_Item *selected=elm_list_selected_item_get(li);
|
||||||
|
if(selected == (Elm_Object_Item*)data)
|
||||||
|
{
|
||||||
|
static int counter=0;
|
||||||
|
char label[32];
|
||||||
|
snprintf(label, sizeof(label), "Item %i", counter++);
|
||||||
|
|
||||||
|
list_it = elm_list_item_prepend(li, label, NULL, NULL, NULL, NULL);
|
||||||
|
elm_list_go(li);
|
||||||
|
if (!list_it) printf("Error adding item\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *label, *label2;
|
||||||
|
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Main", "Hello, World!");
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
Evas_Object *list, *icon, *button;
|
||||||
|
list = elm_list_add(win);
|
||||||
|
/*elm_list_horizontal_set(list, EINA_TRUE);*/ //uncoment to get horizontal
|
||||||
|
//size giving scrollbar
|
||||||
|
evas_object_resize(list, 320, 300);
|
||||||
|
elm_list_mode_set(list, ELM_LIST_LIMIT);
|
||||||
|
// elm_scroller_bounce_set(list, EINA_TRUE, EINA_TRUE);
|
||||||
|
|
||||||
|
//first item: text
|
||||||
|
elm_list_item_append(list, "Text item", NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
//second item: icon
|
||||||
|
icon = elm_icon_add(list);
|
||||||
|
elm_icon_standard_set(icon, "chat");
|
||||||
|
elm_list_item_append(list, "Icon item", icon, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
//third item: button
|
||||||
|
button = elm_button_add(list);
|
||||||
|
elm_object_text_set(button, "Button");
|
||||||
|
Elm_Object_Item *itembutton=elm_list_item_append(list, "Button item", NULL, button, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
elm_list_go(list);
|
||||||
|
evas_object_show(list);
|
||||||
|
|
||||||
|
evas_object_smart_callback_add(list, "selected", _prepend_itembutton_cb, itembutton);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
|
||||||
|
elm_run();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,177 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_do_rotate(void *data, double pos)
|
||||||
|
{
|
||||||
|
// Get the animation target
|
||||||
|
Evas_Object *obj = data;
|
||||||
|
// Declaration of an `Evas_Map`
|
||||||
|
Evas_Map *m;
|
||||||
|
// Variables to store the target size and position
|
||||||
|
int x, y, w, h;
|
||||||
|
|
||||||
|
// Getting the size and position of the target
|
||||||
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||||
|
// Creation of an `Evas_Map` of 4 points
|
||||||
|
m = evas_map_new(4);
|
||||||
|
// Populate source and destination map points to match exactly object.
|
||||||
|
evas_map_util_points_populate_from_object(m, obj);
|
||||||
|
// Create a rotation of 360° with x+(w/2) "x" center and y +(h/2) "y" center.
|
||||||
|
evas_map_util_rotate(m, 360.0 * pos, x + (w / 2), y + (h / 2));
|
||||||
|
// Setting the object to "animate" in the `Evas_Map`
|
||||||
|
evas_object_map_set(obj, m);
|
||||||
|
// Starting the Animation
|
||||||
|
evas_object_map_enable_set(obj, EINA_TRUE);
|
||||||
|
// Free used memory
|
||||||
|
evas_map_free(m);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_rotate_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Evas_Object *target = data;
|
||||||
|
ecore_animator_timeline_add(1, _do_rotate, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_do_zoom(void *data, double pos)
|
||||||
|
{
|
||||||
|
Evas_Object *obj = data;
|
||||||
|
Evas_Map *m;
|
||||||
|
int x, y, w, h;
|
||||||
|
|
||||||
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||||
|
m = evas_map_new(4);
|
||||||
|
evas_map_util_points_populate_from_object(m, obj);
|
||||||
|
evas_map_util_zoom(m, 2 * pos, 2 * pos, x , y);
|
||||||
|
evas_object_map_set(obj, m);
|
||||||
|
evas_object_map_enable_set(obj, EINA_TRUE);
|
||||||
|
evas_map_free(m);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void _btn_zoom_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Evas_Object *target = data;
|
||||||
|
ecore_animator_timeline_add(1, _do_zoom, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_do_3d(void *data, double pos)
|
||||||
|
{
|
||||||
|
Evas_Object *obj = data;
|
||||||
|
Evas_Map *m;
|
||||||
|
int x, y, w, h;
|
||||||
|
|
||||||
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||||
|
m = evas_map_new(4);
|
||||||
|
evas_map_util_points_populate_from_object(m, obj);
|
||||||
|
evas_map_util_3d_rotate(m, pos * 360, pos * 360, pos * 360, x + (w / 3), y + 60, 0);
|
||||||
|
evas_object_map_set(obj, m);
|
||||||
|
evas_object_map_enable_set(obj, EINA_TRUE);
|
||||||
|
evas_map_free(m);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_3d_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Evas_Object *target = data;
|
||||||
|
ecore_animator_timeline_add(1, _do_3d, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
_do_drop(void *data, double pos)
|
||||||
|
{
|
||||||
|
Evas_Object *obj = data;
|
||||||
|
int x, y, w, h;
|
||||||
|
double frame = pos;
|
||||||
|
frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 2, 4);
|
||||||
|
|
||||||
|
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||||
|
evas_object_move(obj, x, 600 * frame);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *label, *bt1, *bt2, *bt3, *target;
|
||||||
|
win = elm_win_util_standard_add("Ecore Animator", "Ecore Animator Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
|
||||||
|
if (elm_win_wm_rotation_supported_get(win))
|
||||||
|
{
|
||||||
|
int rots[4] = { 0, 90, 180, 270 };
|
||||||
|
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Application title
|
||||||
|
label = elm_label_add(win);
|
||||||
|
elm_object_text_set(label, "Ecore Animator Tutorial");
|
||||||
|
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, label);
|
||||||
|
evas_object_show(label);
|
||||||
|
|
||||||
|
// Animation target
|
||||||
|
// Setting the image path
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
snprintf(buf, sizeof(buf), "icon.png");
|
||||||
|
// Adding the image
|
||||||
|
target = elm_image_add(win);
|
||||||
|
// Setting the image path
|
||||||
|
if (!elm_image_file_set(target, buf, NULL))
|
||||||
|
printf("error: could not load image \"%s\"\n", buf);
|
||||||
|
evas_object_size_hint_weight_set(target, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
//Moving the image
|
||||||
|
evas_object_move(target, 130, 100);
|
||||||
|
//Resizing the image
|
||||||
|
evas_object_resize(target, 200, 100);
|
||||||
|
//Showing the image
|
||||||
|
evas_object_show(target);
|
||||||
|
|
||||||
|
// Button 1 : Rotation effect
|
||||||
|
bt1 = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt1, "Rotate");
|
||||||
|
evas_object_size_hint_weight_set(bt1, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_move(bt1, 25, 0);
|
||||||
|
evas_object_resize(bt1, 90, 70);
|
||||||
|
evas_object_smart_callback_add(bt1, "clicked", _btn_rotate_cb, target);
|
||||||
|
evas_object_show(bt1);
|
||||||
|
|
||||||
|
// Button 2 : Zoom Effect
|
||||||
|
bt2 = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt2, "Zoom");
|
||||||
|
evas_object_size_hint_weight_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_move(bt2, 315, 0);
|
||||||
|
evas_object_resize(bt2, 90, 70);
|
||||||
|
evas_object_smart_callback_add(bt2, "clicked", _btn_zoom_cb, target);
|
||||||
|
evas_object_show(bt2);
|
||||||
|
|
||||||
|
// Button 3 : 3D Rotation Effect
|
||||||
|
bt3 = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt3, "3D");
|
||||||
|
evas_object_size_hint_weight_set(bt3, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_move(bt3, 170, 0);
|
||||||
|
evas_object_resize(bt3, 90, 70);
|
||||||
|
evas_object_smart_callback_add(bt3, "clicked", _btn_3d_cb, target);
|
||||||
|
evas_object_show(bt3);
|
||||||
|
|
||||||
|
//drop and bounce effects
|
||||||
|
ecore_animator_timeline_add(2, _do_drop, bt1);
|
||||||
|
ecore_animator_timeline_add(2.3, _do_drop, bt2);
|
||||||
|
ecore_animator_timeline_add(2.5, _do_drop, bt3);
|
||||||
|
|
||||||
|
evas_object_resize(win, 480, 800);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
elm_shutdown();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *layout, *button, *btn_up;
|
||||||
|
win = elm_win_util_standard_add("Edje Animation", "Edje Animation Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
|
||||||
|
layout = elm_layout_add(win);
|
||||||
|
|
||||||
|
elm_layout_file_set(layout, "edje_animation.edj", "my_layout");
|
||||||
|
|
||||||
|
// Creation button in the app window
|
||||||
|
button = elm_button_add(win);
|
||||||
|
elm_object_text_set(button, "Rotate");
|
||||||
|
// Add the button to the edje layout container called "btn/rotate"
|
||||||
|
elm_object_part_content_set(layout, "btn/rotate", button);
|
||||||
|
evas_object_show(button);
|
||||||
|
|
||||||
|
// Creation a up button in the app window
|
||||||
|
btn_up = elm_button_add(win);
|
||||||
|
// Add the button to the edje layout container called "btn/grow"
|
||||||
|
elm_object_text_set(btn_up, "Grow");
|
||||||
|
elm_object_part_content_set(layout, "btn/grow", btn_up);
|
||||||
|
evas_object_show(btn_up);
|
||||||
|
|
||||||
|
evas_object_resize(layout, 400, 400);
|
||||||
|
evas_object_show(layout);
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
elm_shutdown();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,238 @@
|
||||||
|
collections {
|
||||||
|
images
|
||||||
|
{
|
||||||
|
image: "image1.png" COMP;
|
||||||
|
image: "image2.png" COMP;
|
||||||
|
}
|
||||||
|
group {
|
||||||
|
name: "my_layout";
|
||||||
|
parts {
|
||||||
|
// An image using image1
|
||||||
|
part
|
||||||
|
{
|
||||||
|
name: "image";
|
||||||
|
type: IMAGE;
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
max: 63 63;
|
||||||
|
min: 63 63;
|
||||||
|
image { normal: "icon.png"; }
|
||||||
|
rel1.relative: 0.2 0.0;
|
||||||
|
rel2.relative: 0.0 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "down-state" 1.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
rel1.relative: 0.2 0.92;
|
||||||
|
rel2.relative: 0.05 0.9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part
|
||||||
|
{
|
||||||
|
name: "txt_title";
|
||||||
|
type: TEXT;
|
||||||
|
mouse_events: 0;
|
||||||
|
|
||||||
|
// The default State
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
align: 0.0 0.0;
|
||||||
|
rel1 { relative: 0.5 0.0; }
|
||||||
|
rel2 { relative: 1.0 0.5; }
|
||||||
|
text
|
||||||
|
{
|
||||||
|
font: "Sans";
|
||||||
|
size: 22;
|
||||||
|
text: "edje animation";
|
||||||
|
}
|
||||||
|
color: 0 0 0 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The "Bigger" state
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "Bigger" 0.0;
|
||||||
|
align: 0.0 0.0;
|
||||||
|
rel1 { relative: 0.0 0.0; }
|
||||||
|
rel2 { relative: 1.0 0.2; }
|
||||||
|
text
|
||||||
|
{
|
||||||
|
size: 26;
|
||||||
|
text: "animation terminated";
|
||||||
|
}
|
||||||
|
color: 0 0 0 255;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Container for the rotate button
|
||||||
|
part
|
||||||
|
{
|
||||||
|
type: SWALLOW;
|
||||||
|
name: "btn/rotate";
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1.relative: 0.30 0.9;
|
||||||
|
rel2.relative: 0.50 0.99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Container for the grow button
|
||||||
|
part
|
||||||
|
{
|
||||||
|
type: SWALLOW;
|
||||||
|
name: "btn/grow";
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1.relative: 1.02 0;
|
||||||
|
rel1.to: "btn/rotate";
|
||||||
|
rel2.relative: 2.02 1;
|
||||||
|
rel2.to: "btn/rotate";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// The animation target
|
||||||
|
part
|
||||||
|
{
|
||||||
|
name: "atarget";
|
||||||
|
type: IMAGE;
|
||||||
|
|
||||||
|
// Default state
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
image { normal: "c1.svg"; }
|
||||||
|
color: 255 0 0 255; /* red */
|
||||||
|
rel1 { relative: 0.3 0.3; }
|
||||||
|
rel2 { relative: 0.7 0.7; }
|
||||||
|
}
|
||||||
|
// The rotate state
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "rotate" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
|
||||||
|
map
|
||||||
|
{
|
||||||
|
//Enable Map on the part
|
||||||
|
on: 1;
|
||||||
|
//Enable smooth rendering
|
||||||
|
smooth: 1;
|
||||||
|
//Enable perspective
|
||||||
|
perspective_on: 1;
|
||||||
|
|
||||||
|
//Apply rotations on the part
|
||||||
|
rotation.x: 0;
|
||||||
|
rotation.y: 0;
|
||||||
|
rotation.z: 0;
|
||||||
|
}
|
||||||
|
color: 0 255 0 255; /* green */
|
||||||
|
}
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "rotate" 1.0;
|
||||||
|
inherit: "rotate" 0.0;
|
||||||
|
map.rotation.z: 360;
|
||||||
|
}
|
||||||
|
// The grow state
|
||||||
|
description {
|
||||||
|
state: "grow" 0.0;
|
||||||
|
inherit: "default" 0.0;
|
||||||
|
color: 0 0 255 255; /* blue */
|
||||||
|
rel1
|
||||||
|
{
|
||||||
|
relative: 0.2 0.2;
|
||||||
|
offset: 0.3 0.3;
|
||||||
|
}
|
||||||
|
rel2
|
||||||
|
{
|
||||||
|
relative: 0.7 0.4;
|
||||||
|
offset: 0.3 0.3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
programs {
|
||||||
|
// Icon drop animation
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,state1";
|
||||||
|
source: "";
|
||||||
|
signal: "load";
|
||||||
|
action: STATE_SET "down-state" 1.0;
|
||||||
|
target: "image";
|
||||||
|
transition: BOUNCE 2.5 0.0 5.0;
|
||||||
|
}
|
||||||
|
// Make the title bigger
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,bigtitle";
|
||||||
|
source: "";
|
||||||
|
signal: "load";
|
||||||
|
action: STATE_SET "Bigger" 1.0;
|
||||||
|
target: "txt_title";
|
||||||
|
transition: LINEAR 5.0;
|
||||||
|
}
|
||||||
|
// Make the title go back to normal
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,normaltitle";
|
||||||
|
source: "image";
|
||||||
|
signal: "mouse,clicked,*";
|
||||||
|
action: STATE_SET "default" 1.0;
|
||||||
|
target: "txt_title";
|
||||||
|
transition: LINEAR 0.5;
|
||||||
|
}
|
||||||
|
// Change the color of target to green
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "rotate,target";
|
||||||
|
source: "btn/rotate";
|
||||||
|
signal: "mouse,clicked,*";
|
||||||
|
action: STATE_SET "rotate" 0.0;
|
||||||
|
target: "atarget";
|
||||||
|
transition: SIN 0.2;
|
||||||
|
after: "rotate,target,2";
|
||||||
|
}
|
||||||
|
// Rotate 360°
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "rotate,target,2";
|
||||||
|
action: STATE_SET "rotate" 1.0;
|
||||||
|
target: "atarget";
|
||||||
|
transition: SIN 0.7;
|
||||||
|
after: "rotate,end";
|
||||||
|
}
|
||||||
|
// Go back to the normal.
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "rotate,end";
|
||||||
|
action: STATE_SET "rotate" 0.0;
|
||||||
|
target: "atarget";
|
||||||
|
transition: LINEAR 0.2;
|
||||||
|
}
|
||||||
|
// Grow the target and go back to normal state
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "grow,target";
|
||||||
|
source: "btn/grow";
|
||||||
|
signal: "mouse,clicked,*";
|
||||||
|
action: STATE_SET "grow" 1.0;
|
||||||
|
after: "go,default";
|
||||||
|
target: "atarget";
|
||||||
|
transition: SINUSOIDAL 1.0;
|
||||||
|
}
|
||||||
|
// Go back to normal (default) state
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "go,default";
|
||||||
|
action: STATE_SET "default" 1.0;
|
||||||
|
target: "atarget";
|
||||||
|
transition: SIN 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,376 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
typedef struct _Animations
|
||||||
|
{
|
||||||
|
Evas_Object *button;
|
||||||
|
Evas_Object *buttonbck;
|
||||||
|
float *rt_angle;
|
||||||
|
float *zto;
|
||||||
|
float *zfrom;
|
||||||
|
} Animations;
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* Resize
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_resize_effect(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
// Elementary Transition declaration and creation
|
||||||
|
Elm_Transit *trans = elm_transit_add();
|
||||||
|
|
||||||
|
// Adding the transition target object
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
|
||||||
|
// Setting the resize effect
|
||||||
|
elm_transit_effect_resizing_add(trans, 100, 50, 300, 150);
|
||||||
|
|
||||||
|
// Setting the transition duration
|
||||||
|
elm_transit_duration_set(trans, 3.0);
|
||||||
|
|
||||||
|
// Starting the transition
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_resize_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
// Starting the rotation effect 360 degrees
|
||||||
|
//evas_object_resize(button, 100, 50);
|
||||||
|
elm_object_text_set(anim->button, "Resize");
|
||||||
|
_resize_effect(anim->button);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************
|
||||||
|
* Rotation
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_rotation_effect(Evas_Object *obj, float angle)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
|
||||||
|
// rotates the object from its original angle to given degrees to the right
|
||||||
|
elm_transit_effect_rotation_add(trans, 0.0, angle);
|
||||||
|
elm_transit_duration_set(trans, 2.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_rotate_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
// Setting the button text
|
||||||
|
elm_object_text_set(anim->button, "Rotate");
|
||||||
|
_rotation_effect(anim->button, *(anim->rt_angle));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* Zoom
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_zoom_effect(Evas_Object *obj, float from, float to)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
|
||||||
|
elm_transit_effect_zoom_add(trans, from, to);
|
||||||
|
elm_transit_duration_set(trans, 2.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_zoom_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
// Starting the rotation effect 360 degrees
|
||||||
|
//evas_object_resize(anim->button, 100, 50);
|
||||||
|
elm_object_text_set(anim->button, "Zoom");
|
||||||
|
_zoom_effect(anim->button, *(anim->zfrom), *(anim->zto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* Flip
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_flip_effect(Evas_Object *obj, Evas_Object *obj2)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans;
|
||||||
|
|
||||||
|
trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
elm_transit_object_add(trans, obj2);
|
||||||
|
elm_transit_effect_flip_add(trans, ELM_TRANSIT_EFFECT_FLIP_AXIS_X, EINA_TRUE);
|
||||||
|
|
||||||
|
elm_transit_duration_set(trans, 3.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_flip_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
// Setting the button text
|
||||||
|
elm_object_text_set(anim->button, "Flip");
|
||||||
|
_flip_effect(anim->button, anim->buttonbck);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* Blend
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_blend_effect(Evas_Object *obj, Evas_Object *obj2)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans;
|
||||||
|
|
||||||
|
trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
elm_transit_object_add(trans, obj2);
|
||||||
|
elm_transit_effect_blend_add(trans);
|
||||||
|
elm_transit_duration_set(trans, 3.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_blend_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
// Setting the button text
|
||||||
|
elm_object_text_set(anim->button, "Blend");
|
||||||
|
_blend_effect(anim->button, anim->buttonbck);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* Fade
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_fade_effect(Evas_Object *obj, Evas_Object *obj2)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans;
|
||||||
|
|
||||||
|
trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
elm_transit_object_add(trans, obj2);
|
||||||
|
elm_transit_effect_fade_add(trans);
|
||||||
|
elm_transit_duration_set(trans, 3.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_fade_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
|
||||||
|
// Setting the button text
|
||||||
|
elm_object_text_set(anim->button, "Fade");
|
||||||
|
_fade_effect(anim->button, anim->buttonbck);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* FlipY
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_flip_y_effect(Evas_Object *obj, Evas_Object *obj2)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans;
|
||||||
|
|
||||||
|
trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
elm_transit_object_add(trans, obj2);
|
||||||
|
elm_transit_effect_flip_add(trans, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE);
|
||||||
|
elm_transit_duration_set(trans, 3.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_flip_y_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
|
||||||
|
// Setting the button text
|
||||||
|
elm_object_text_set(anim->button, "Flip 2");
|
||||||
|
_flip_y_effect(anim->button, anim->buttonbck);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************
|
||||||
|
* Wipe
|
||||||
|
*************/
|
||||||
|
static void
|
||||||
|
_wipe_effect(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Elm_Transit *trans;
|
||||||
|
|
||||||
|
trans = elm_transit_add();
|
||||||
|
elm_transit_object_add(trans, obj);
|
||||||
|
elm_transit_effect_wipe_add(trans, ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
|
||||||
|
elm_transit_duration_set(trans, 3.0);
|
||||||
|
elm_transit_go(trans);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_wipe_cb(void *data, Evas_Object *btn, void *ev)
|
||||||
|
{
|
||||||
|
Animations *anim = (Animations *)data;
|
||||||
|
|
||||||
|
// Starting the rotation effect 360 degrees
|
||||||
|
//evas_object_resize(anim->button, 100, 50);
|
||||||
|
// Setting the button text
|
||||||
|
elm_object_text_set(anim->button, "Wipe");
|
||||||
|
_wipe_effect(anim->button);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *label, *hbox, *left_vbox, *center_vbox, *right_vbox;
|
||||||
|
Evas_Object *button, *buttonbck;
|
||||||
|
float rt_angle, zto, zfrom;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Elementary Animations", "Elementary Animations Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
if (elm_win_wm_rotation_supported_get(win))
|
||||||
|
{
|
||||||
|
int rots[4] = { 0, 90, 180, 270 };
|
||||||
|
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
//set the values for animations
|
||||||
|
rt_angle = 360.0;
|
||||||
|
zfrom = 1.0;
|
||||||
|
zto = 2.0;
|
||||||
|
|
||||||
|
/* Label*/
|
||||||
|
label = elm_label_add(win);
|
||||||
|
elm_object_text_set(label, "Effects Tutorial");
|
||||||
|
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_move(label, 100, 0);
|
||||||
|
evas_object_resize(label, 200, 50);
|
||||||
|
evas_object_show(label);
|
||||||
|
|
||||||
|
/* Creation a button in the app window*/
|
||||||
|
button = elm_button_add(win);
|
||||||
|
evas_object_move(button, 100, 100); // Moving the button to x=50 y=100
|
||||||
|
evas_object_resize(button, 200, 50); // Resizing the button 100x50
|
||||||
|
evas_object_show(button); // Showing the button
|
||||||
|
/* Creation a back button in the app window*/
|
||||||
|
buttonbck = elm_button_add(win);
|
||||||
|
elm_object_text_set(buttonbck, "Button back");
|
||||||
|
evas_object_move(buttonbck, 100, 100);
|
||||||
|
evas_object_resize(buttonbck, 200, 50);
|
||||||
|
|
||||||
|
/*set the structure of pointeurs*/
|
||||||
|
Animations anim = { button, buttonbck, &rt_angle, &zto, &zfrom };
|
||||||
|
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
*Boxes*
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
// Creation of the main container box
|
||||||
|
hbox = elm_box_add(win);
|
||||||
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
||||||
|
elm_box_homogeneous_set(hbox, EINA_TRUE);
|
||||||
|
evas_object_move(hbox, 130, 200);
|
||||||
|
evas_object_show(hbox);
|
||||||
|
|
||||||
|
// Creation of the first column
|
||||||
|
left_vbox = elm_box_add(hbox);
|
||||||
|
elm_box_horizontal_set(left_vbox, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(left_vbox, EINA_TRUE);
|
||||||
|
evas_object_show(left_vbox);
|
||||||
|
elm_box_pack_start(hbox, left_vbox);
|
||||||
|
|
||||||
|
// Creation of the second column
|
||||||
|
center_vbox = elm_box_add(hbox);
|
||||||
|
elm_box_horizontal_set(center_vbox, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(center_vbox, EINA_TRUE);
|
||||||
|
evas_object_show(center_vbox);
|
||||||
|
elm_box_pack_end(hbox, center_vbox);
|
||||||
|
|
||||||
|
// Creation of the last column
|
||||||
|
right_vbox = elm_box_add(hbox);
|
||||||
|
elm_box_horizontal_set(right_vbox, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(right_vbox, EINA_TRUE);
|
||||||
|
evas_object_show(right_vbox);
|
||||||
|
elm_box_pack_end(hbox, right_vbox);
|
||||||
|
|
||||||
|
/***********************************************************************************************************************
|
||||||
|
*Buttons*
|
||||||
|
***********************************************************************************************************************/
|
||||||
|
// The resize button
|
||||||
|
Evas_Object *btn_resize = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_resize, "Resize"); // Setting the button text
|
||||||
|
evas_object_size_hint_weight_set(btn_resize, EVAS_HINT_FILL, EVAS_HINT_FILL); // Setting the hint weight policy
|
||||||
|
evas_object_show(btn_resize); // Showing the button
|
||||||
|
evas_object_smart_callback_add(btn_resize, "clicked", _btn_resize_cb, &anim); // Setting the "clicked" callback
|
||||||
|
elm_box_pack_end(left_vbox, btn_resize); // Adding the button to the first column
|
||||||
|
|
||||||
|
// The rotation button
|
||||||
|
Evas_Object *btn_rotate = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_rotate, "Rotate");
|
||||||
|
evas_object_size_hint_weight_set(btn_rotate, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_rotate);
|
||||||
|
evas_object_smart_callback_add(btn_rotate, "clicked", _btn_rotate_cb, &anim);
|
||||||
|
elm_box_pack_end(center_vbox, btn_rotate);
|
||||||
|
|
||||||
|
// The zoom button
|
||||||
|
Evas_Object *btn_zoom = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_zoom, "Zoom");
|
||||||
|
evas_object_size_hint_weight_set(btn_zoom, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_zoom);
|
||||||
|
evas_object_smart_callback_add(btn_zoom, "clicked", _btn_zoom_cb, &anim);
|
||||||
|
elm_box_pack_end(right_vbox, btn_zoom);
|
||||||
|
|
||||||
|
// The flip button
|
||||||
|
Evas_Object *btn_flip = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_flip, "Flip x");
|
||||||
|
evas_object_size_hint_weight_set(btn_flip, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_flip);
|
||||||
|
evas_object_smart_callback_add(btn_flip, "clicked", _btn_flip_cb, &anim);
|
||||||
|
elm_box_pack_end(left_vbox, btn_flip);
|
||||||
|
|
||||||
|
// The blend button
|
||||||
|
Evas_Object *btn_blend = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_blend, "Blend");
|
||||||
|
evas_object_size_hint_weight_set(btn_blend, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_blend);
|
||||||
|
evas_object_smart_callback_add(btn_blend, "clicked", _btn_blend_cb, &anim);
|
||||||
|
elm_box_pack_end(center_vbox, btn_blend);
|
||||||
|
|
||||||
|
// The fade button
|
||||||
|
Evas_Object *btn_fade = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_fade, "Fade");
|
||||||
|
evas_object_size_hint_weight_set(btn_fade, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_fade);
|
||||||
|
evas_object_smart_callback_add(btn_fade, "clicked", _btn_fade_cb, &anim);
|
||||||
|
elm_box_pack_end(right_vbox, btn_fade);
|
||||||
|
|
||||||
|
// The flip y button
|
||||||
|
Evas_Object *btn_flip_y = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_flip_y, "Flip y");
|
||||||
|
evas_object_size_hint_weight_set(btn_flip_y, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_flip_y);
|
||||||
|
evas_object_smart_callback_add(btn_flip_y, "clicked", _btn_flip_y_cb, &anim);
|
||||||
|
elm_box_pack_end(left_vbox, btn_flip_y);
|
||||||
|
|
||||||
|
// The wipe button
|
||||||
|
Evas_Object *btn_wipe = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn_wipe, "Wipe");
|
||||||
|
evas_object_size_hint_weight_set(btn_wipe, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(btn_wipe);
|
||||||
|
evas_object_smart_callback_add(btn_wipe, "clicked", _btn_wipe_cb, &anim);
|
||||||
|
elm_box_pack_end(right_vbox, btn_wipe);
|
||||||
|
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
elm_shutdown();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,248 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
/* store naviframe pointeurs */
|
||||||
|
typedef struct _Navi
|
||||||
|
{
|
||||||
|
Evas_Object *navi;
|
||||||
|
Evas_Object *navi2;
|
||||||
|
} Navi;
|
||||||
|
|
||||||
|
static void
|
||||||
|
rotation_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
// 360 degree rotation effect in the clock-wise direction
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_effect_rotation_add(transit, 0, 360);
|
||||||
|
elm_transit_duration_set(transit, 1);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
zoom_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
// Zoom out to scale 0.6
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
elm_transit_smooth_set(transit, EINA_FALSE);
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_effect_zoom_add(transit, 1.0, 0.4);
|
||||||
|
elm_transit_duration_set(transit, 0.5);
|
||||||
|
|
||||||
|
// Zoom in to the original size
|
||||||
|
Elm_Transit *transit2 = elm_transit_add();
|
||||||
|
elm_transit_smooth_set(transit2, EINA_FALSE);
|
||||||
|
elm_transit_object_add(transit2, navi);
|
||||||
|
elm_transit_effect_zoom_add(transit2, 0.4, 1.0);
|
||||||
|
elm_transit_duration_set(transit2, 0.5);
|
||||||
|
|
||||||
|
elm_transit_chain_transit_add(transit, transit2);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
blend_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Evas_Object *navi2=navis->navi2;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_object_add(transit, navi2);
|
||||||
|
elm_transit_effect_blend_add(transit);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fade_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Evas_Object *navi2=navis->navi2;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_object_add(transit, navi2);
|
||||||
|
elm_transit_effect_fade_add(transit);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
flip_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Evas_Object *navi2=navis->navi2;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_object_add(transit, navi2);
|
||||||
|
elm_transit_effect_flip_add(transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_X, EINA_TRUE);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
resizable_flip_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Evas_Object *navi2=navis->navi2;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_object_add(transit, navi2);
|
||||||
|
elm_transit_effect_resizable_flip_add(transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
wipe_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_effect_wipe_add(transit, ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE, ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
translation_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_effect_translation_add(transit, 0, 0, 50, 100);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
color_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_effect_color_add(transit,0,0,0,0,255,255,0,255);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
custom_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Navi *navis = data;
|
||||||
|
Evas_Object *navi=navis->navi;
|
||||||
|
Evas_Object *navi2=navis->navi2;
|
||||||
|
Elm_Transit *transit = elm_transit_add();
|
||||||
|
|
||||||
|
elm_transit_object_add(transit, navi);
|
||||||
|
elm_transit_object_add(transit, navi2);
|
||||||
|
elm_transit_effect_color_add(transit,0,0,0,0,255,255,0,255);
|
||||||
|
elm_transit_effect_flip_add(transit, ELM_TRANSIT_EFFECT_FLIP_AXIS_Y, EINA_TRUE);
|
||||||
|
elm_transit_duration_set(transit, 3.0);
|
||||||
|
|
||||||
|
Elm_Transit *transit2 = elm_transit_add();
|
||||||
|
elm_transit_object_add(transit2, navi2);
|
||||||
|
elm_transit_object_add(transit2, navi);
|
||||||
|
elm_transit_effect_color_add(transit2,0,0,0,0,180,255,0,255);
|
||||||
|
elm_transit_effect_zoom_add(transit2, 1.0, 0.1);
|
||||||
|
elm_transit_duration_set(transit2, 3.0);
|
||||||
|
|
||||||
|
elm_transit_chain_transit_add(transit, transit2);
|
||||||
|
elm_transit_go(transit);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *navi, *navi2, *list, *list2;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Transition", "Transition Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
if (elm_win_wm_rotation_supported_get(win))
|
||||||
|
{
|
||||||
|
int rots[4] = { 0, 90, 180, 270 };
|
||||||
|
elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rots), 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
Elm_Object_Item *nf_it, *nf_it2;
|
||||||
|
|
||||||
|
/* add two naviframes and two lists to switch
|
||||||
|
* from one to another in some transitions */
|
||||||
|
navi2 = elm_naviframe_add(win);
|
||||||
|
navi = elm_naviframe_add(win);
|
||||||
|
list = elm_list_add(navi);
|
||||||
|
list2 = elm_list_add(navi2);
|
||||||
|
elm_list_mode_set(list, ELM_LIST_COMPRESS);
|
||||||
|
elm_list_mode_set(list2, ELM_LIST_COMPRESS);
|
||||||
|
|
||||||
|
/* store naviframe pointeurs to pass them
|
||||||
|
* in data pointeur parameter */
|
||||||
|
Navi navis = {navi, navi2};
|
||||||
|
Navi navis2 = {navi2, navi};
|
||||||
|
|
||||||
|
/* first list items */
|
||||||
|
elm_list_item_append(list, "Blend", NULL, NULL, blend_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Color", NULL, NULL, color_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Fade", NULL, NULL, fade_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Flip", NULL, NULL, flip_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Rotation", NULL, NULL, rotation_cb, &navis);
|
||||||
|
elm_list_item_append(list, "ResizableFlip", NULL, NULL, resizable_flip_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Translation", NULL, NULL, translation_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Wipe", NULL, NULL, wipe_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Zoom", NULL, NULL, zoom_cb, &navis);
|
||||||
|
elm_list_item_append(list, "Custom", NULL, NULL, custom_cb, &navis);
|
||||||
|
elm_list_go(list);
|
||||||
|
|
||||||
|
/* second list items*/
|
||||||
|
elm_list_item_append(list2, "Blend2", NULL, NULL, blend_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Color2", NULL, NULL, color_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Fade2", NULL, NULL, fade_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Flip2", NULL, NULL, flip_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Rotation2", NULL, NULL, rotation_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "ResizableFlip2", NULL, NULL, resizable_flip_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Translation2", NULL, NULL, translation_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Wipe2", NULL, NULL, wipe_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Zoom2", NULL, NULL, zoom_cb, &navis2);
|
||||||
|
elm_list_item_append(list2, "Custom2", NULL, NULL, custom_cb, &navis2);
|
||||||
|
elm_list_go(list2);
|
||||||
|
|
||||||
|
nf_it = elm_naviframe_item_push(navi, "Transit", NULL, NULL, list, NULL);
|
||||||
|
nf_it2 = elm_naviframe_item_push(navi2, "Transit2", NULL, NULL, list2, NULL);
|
||||||
|
|
||||||
|
evas_object_show(navi);
|
||||||
|
evas_object_show(navi2);
|
||||||
|
evas_object_show(list);
|
||||||
|
evas_object_show(list2);
|
||||||
|
evas_object_resize(navi2, 400, 400);
|
||||||
|
evas_object_resize(navi, 400, 400);
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
elm_shutdown();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,203 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
#define ICON_PATH "<your_path_to_contact_icons_directory>"
|
||||||
|
typedef struct _Contact Contact;
|
||||||
|
|
||||||
|
struct _Contact
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
const char *mobile;
|
||||||
|
const char *address;
|
||||||
|
const char *email;
|
||||||
|
const char *icon;
|
||||||
|
};
|
||||||
|
|
||||||
|
static Contact contacts[] =
|
||||||
|
{
|
||||||
|
{"Alexander Holmes", "+1234567896", "", "alexander_holmes@tizen.org", "c1.svg"},
|
||||||
|
{"Lara Alvaréz", "+9876543216", "", "lara_alvares@tizen.org", "c2.svg"},
|
||||||
|
{"Aksel Møller", "+1679432846", "", "aksel_moller@tizen.org", "c3.svg"},
|
||||||
|
{"Anir Amghar", "+1679432846", "", "anir_amghar@tizen.org", "c4.svg"},
|
||||||
|
{"Noémie Cordier", "+1679432846", "", "noemie_cordier@tizen.org", "c5.svg"},
|
||||||
|
{"Henry Thompson", "+1679432846", "", "henry_thompson@tizen.org", "c6.svg"},
|
||||||
|
{"Mai Phan", "+1679432846", "", "mai_phan@tizen.org", "c7.svg"},
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char *form_items[] =
|
||||||
|
{
|
||||||
|
"name :", "mobile :", "address :", "email :"
|
||||||
|
};
|
||||||
|
|
||||||
|
static Evas_Object *nav;
|
||||||
|
static Elm_Genlist_Item_Class *itc = NULL;
|
||||||
|
|
||||||
|
//contact form called in item callback
|
||||||
|
static Evas_Object *
|
||||||
|
_create_contact_form(Evas_Object *parent, Contact *contact)
|
||||||
|
{
|
||||||
|
//Create the vbox
|
||||||
|
Evas_Object *vbox, *ic;
|
||||||
|
int i;
|
||||||
|
vbox = elm_box_add(parent);
|
||||||
|
elm_box_align_set(vbox, 0, 0);
|
||||||
|
evas_object_show(vbox);
|
||||||
|
|
||||||
|
//add the icon to the vbox
|
||||||
|
ic = elm_icon_add(vbox);
|
||||||
|
char filename[PATH_MAX];
|
||||||
|
snprintf(filename, sizeof(filename), "%s%s", ICON_PATH, contact->icon);
|
||||||
|
elm_image_file_set(ic, filename, NULL);
|
||||||
|
evas_object_size_hint_min_set(ic, 96, 96);
|
||||||
|
evas_object_show(ic);
|
||||||
|
elm_box_pack_end(vbox, ic);
|
||||||
|
|
||||||
|
//create the entries for contact information
|
||||||
|
for (i = 0; i < EINA_C_ARRAY_LENGTH(form_items); i++)
|
||||||
|
{
|
||||||
|
Evas_Object *hbox, *label, *edit;
|
||||||
|
const char *str;
|
||||||
|
|
||||||
|
//hbox
|
||||||
|
hbox = elm_box_add(vbox);
|
||||||
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
||||||
|
elm_box_padding_set(hbox, 32, 32);
|
||||||
|
evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0);
|
||||||
|
evas_object_size_hint_align_set(hbox, EVAS_HINT_FILL, 0);
|
||||||
|
evas_object_show(hbox);
|
||||||
|
|
||||||
|
//label
|
||||||
|
label = elm_label_add(hbox);
|
||||||
|
elm_object_text_set(label, form_items[i]);
|
||||||
|
evas_object_size_hint_weight_set(label, 0, 0);
|
||||||
|
evas_object_size_hint_align_set(label, 0, 0);
|
||||||
|
evas_object_show(label);
|
||||||
|
|
||||||
|
//edit
|
||||||
|
edit = elm_entry_add(hbox);
|
||||||
|
|
||||||
|
if(!strcmp(form_items[i], "name :")) str = contact->name;
|
||||||
|
else if(!strcmp(form_items[i], "mobile :")) str = contact->mobile;
|
||||||
|
else if(!strcmp(form_items[i], "address :")) str = contact->address;
|
||||||
|
else if(!strcmp(form_items[i], "email :")) str = contact->email;
|
||||||
|
else str = NULL;
|
||||||
|
|
||||||
|
elm_object_text_set(edit, str);
|
||||||
|
evas_object_size_hint_weight_set(edit, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(edit, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(edit);
|
||||||
|
|
||||||
|
elm_box_pack_end(hbox, label);
|
||||||
|
elm_box_pack_end(hbox, edit);
|
||||||
|
|
||||||
|
elm_box_pack_end(vbox, hbox);
|
||||||
|
}
|
||||||
|
return vbox;
|
||||||
|
}
|
||||||
|
|
||||||
|
//item callback
|
||||||
|
static void
|
||||||
|
_contact_selected_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *form;
|
||||||
|
Contact *contact = data;
|
||||||
|
//Create a new contact form
|
||||||
|
form = _create_contact_form(nav, contact);
|
||||||
|
//Push the form on top of naviframe
|
||||||
|
elm_naviframe_item_push(nav, NULL, NULL, NULL, form, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
//set item text
|
||||||
|
static char *
|
||||||
|
_genlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
|
||||||
|
{
|
||||||
|
Contact *contact = data;
|
||||||
|
|
||||||
|
//Return a new allocated string for the contact name
|
||||||
|
return strdup(contact->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
//set item content
|
||||||
|
static Evas_Object *
|
||||||
|
_genlist_content_get(void *data, Evas_Object *obj, const char *part)
|
||||||
|
{
|
||||||
|
Contact *contact = data;
|
||||||
|
|
||||||
|
//Test which part is being created
|
||||||
|
if (!strcmp(part, "elm.swallow.icon"))
|
||||||
|
{
|
||||||
|
char filename[PATH_MAX];
|
||||||
|
// Create a new icon
|
||||||
|
Evas_Object *ic = elm_icon_add(obj);
|
||||||
|
// Set the filename of the file which is to be loaded
|
||||||
|
snprintf(filename, sizeof(filename), "%s%s", ICON_PATH, contact->icon);
|
||||||
|
elm_image_file_set(ic, filename, NULL);
|
||||||
|
// Keep the ratio squared
|
||||||
|
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
|
||||||
|
|
||||||
|
// Return the icon
|
||||||
|
return ic;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_create_contact_list(Evas_Object *parent)
|
||||||
|
{
|
||||||
|
Evas_Object *list;
|
||||||
|
int i;
|
||||||
|
//Create a new genlist
|
||||||
|
list = elm_genlist_add(parent);
|
||||||
|
evas_object_show(list);
|
||||||
|
// Create a new item class for the genlist
|
||||||
|
itc = elm_genlist_item_class_new();
|
||||||
|
itc->item_style = "default";
|
||||||
|
// Set the callback which will be used when the genlist text will be created
|
||||||
|
itc->func.text_get = _genlist_text_get;
|
||||||
|
// Set the callback wich will be used when the content of the item will be created
|
||||||
|
itc->func.content_get = _genlist_content_get;
|
||||||
|
itc->func.state_get = NULL;
|
||||||
|
itc->func.del = NULL;
|
||||||
|
// Create a genlist item for each item in the contacts array
|
||||||
|
for (i = 0; i < EINA_C_ARRAY_LENGTH(contacts); i++)
|
||||||
|
{
|
||||||
|
// Append the item, add a callback when the item is selected, and use the
|
||||||
|
// current contact item as data pointer for the callbacks.
|
||||||
|
elm_genlist_item_append(
|
||||||
|
list, itc,
|
||||||
|
&contacts[i], // Item data
|
||||||
|
NULL, // Parent item for trees, NULL if none
|
||||||
|
ELM_GENLIST_ITEM_NONE, // Item type; this is the common one
|
||||||
|
_contact_selected_cb, // Callback on selection of the item
|
||||||
|
&contacts[i] // Data for that callback function
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
win = elm_win_util_standard_add("Form", "Form Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
//Create the naviframe
|
||||||
|
nav = elm_naviframe_add(win);
|
||||||
|
evas_object_size_hint_weight_set(nav, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, nav);
|
||||||
|
evas_object_show(nav);
|
||||||
|
|
||||||
|
// Create the list of contacts
|
||||||
|
Evas_Object *list = _create_contact_list(win);
|
||||||
|
|
||||||
|
// Push the list on top of the naviframe
|
||||||
|
elm_naviframe_item_push(nav, NULL, NULL, NULL, list, NULL);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,139 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_genlist_text_get_size(void *data, Evas_Object *obj , const char *part)
|
||||||
|
{
|
||||||
|
char buf[20];
|
||||||
|
snprintf(buf, sizeof(buf), "Entry %d", (int)(uintptr_t)data);
|
||||||
|
return strdup(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_genlist_text_get_nosize(void *data, Evas_Object *obj , const char *part)
|
||||||
|
{
|
||||||
|
char buf[20];
|
||||||
|
snprintf(buf, sizeof(buf), "OHOHO %d", (int)(uintptr_t)data);
|
||||||
|
return strdup(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_genlist_content_get_bg(void *data, Evas_Object *obj, const char *part)
|
||||||
|
{
|
||||||
|
int i = (int) (uintptr_t) data;
|
||||||
|
|
||||||
|
Evas_Object *bg = elm_bg_add(obj);
|
||||||
|
elm_bg_color_set(bg, 255 * cos(i / (double) 10), 0, i % 255);
|
||||||
|
|
||||||
|
return bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_tree_item_expand_request(void *data, Evas_Object *o, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it = (Elm_Object_Item*) event_info;
|
||||||
|
|
||||||
|
elm_genlist_item_item_class_update(it, data);
|
||||||
|
|
||||||
|
elm_genlist_item_expanded_set(it, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_tree_item_contract_request(void *data, Evas_Object *o, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it = (Elm_Object_Item*) event_info;
|
||||||
|
|
||||||
|
elm_genlist_item_item_class_update(it, data);
|
||||||
|
|
||||||
|
elm_genlist_item_expanded_set(it, EINA_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_tree_item_expanded(void *data, Evas_Object *o, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
|
||||||
|
int i_parent = (int)(uintptr_t)elm_object_item_data_get(it_parent);
|
||||||
|
Elm_Object_Item *list = o;
|
||||||
|
Elm_Genlist_Item_Class *itc = data;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
elm_genlist_item_append(list, itc,
|
||||||
|
(void *)(uintptr_t) (i + i_parent),
|
||||||
|
it_parent,
|
||||||
|
ELM_GENLIST_ITEM_NONE,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_tree_item_contracted(void *data, Evas_Object *o, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it_parent = (Elm_Object_Item*) event_info;
|
||||||
|
|
||||||
|
elm_genlist_item_subitems_clear(it_parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Genlist", "Genlist Basic Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
Evas_Object *list;
|
||||||
|
list = elm_genlist_add(win);
|
||||||
|
evas_object_resize(list, 400, 400);
|
||||||
|
|
||||||
|
Elm_Genlist_Item_Class *_itc_child = elm_genlist_item_class_new();
|
||||||
|
_itc_child->item_style = "default_style";
|
||||||
|
_itc_child->func.text_get = _genlist_text_get_size;
|
||||||
|
_itc_child->func.content_get = _genlist_content_get_bg;
|
||||||
|
_itc_child->func.state_get = NULL;
|
||||||
|
_itc_child->func.del = NULL;
|
||||||
|
|
||||||
|
Elm_Genlist_Item_Class *_itc_parent = elm_genlist_item_class_new();
|
||||||
|
_itc_parent->item_style = "default_style";
|
||||||
|
_itc_parent->func.text_get = _genlist_text_get_nosize;
|
||||||
|
_itc_parent->func.content_get = _genlist_content_get_bg;
|
||||||
|
_itc_parent->func.state_get = NULL;
|
||||||
|
_itc_parent->func.del = NULL;
|
||||||
|
|
||||||
|
int i,j;
|
||||||
|
Elm_Object_Item *it = NULL;
|
||||||
|
|
||||||
|
for (i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
it = elm_genlist_item_append(list, _itc_parent,
|
||||||
|
(void *)(uintptr_t) (10 * i),
|
||||||
|
NULL,
|
||||||
|
ELM_GENLIST_ITEM_TREE,
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
|
||||||
|
evas_object_smart_callback_add(list, "expand,request",
|
||||||
|
_tree_item_expand_request, _itc_parent);
|
||||||
|
evas_object_smart_callback_add(list, "expanded", _tree_item_expanded,
|
||||||
|
_itc_child);
|
||||||
|
|
||||||
|
evas_object_smart_callback_add(list, "contract,request",
|
||||||
|
_tree_item_contract_request, _itc_child);
|
||||||
|
evas_object_smart_callback_add(list, "contracted", _tree_item_contracted,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
evas_object_show(list);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,96 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_genlist_text_get(void *data, Evas_Object *obj , const char *part)
|
||||||
|
{
|
||||||
|
if (strcmp(part, "elm.text") == 0)
|
||||||
|
{
|
||||||
|
char *buf = malloc(16);
|
||||||
|
snprintf(buf, 16, "Entry %d.", (int)(uintptr_t)data);
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
else return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_genlist_content_get(void *data, Evas_Object *obj, const char *part)
|
||||||
|
{
|
||||||
|
int i = (int) (uintptr_t) data;
|
||||||
|
|
||||||
|
if (strcmp(part, "elm.swallow.icon") == 0)
|
||||||
|
{
|
||||||
|
Evas_Object *bg = elm_bg_add(obj);
|
||||||
|
elm_bg_color_set(bg, 255 * cos(i / (double) 10), 0, i % 255);
|
||||||
|
|
||||||
|
return bg;
|
||||||
|
}
|
||||||
|
else if (strcmp(part, "elm.swallow.end") == 0)
|
||||||
|
{
|
||||||
|
Evas_Object *bg = elm_bg_add(obj);
|
||||||
|
elm_bg_color_set(bg, 0, 255 * sin(i / (double) 10), i % 255);
|
||||||
|
|
||||||
|
return bg;
|
||||||
|
}
|
||||||
|
else return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_genlist_selected_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it = (Elm_Object_Item*) event_info;
|
||||||
|
|
||||||
|
elm_genlist_item_item_class_update(it, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Genlist", "Genlist Basic Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
//GENLIST here
|
||||||
|
Evas_Object *list;
|
||||||
|
list = elm_genlist_add(win);
|
||||||
|
|
||||||
|
Elm_Genlist_Item_Class *_itc = elm_genlist_item_class_new();
|
||||||
|
_itc->item_style = "default";
|
||||||
|
_itc->func.text_get = _genlist_text_get;
|
||||||
|
_itc->func.content_get = _genlist_content_get;
|
||||||
|
_itc->func.state_get = NULL;
|
||||||
|
_itc->func.del = NULL;
|
||||||
|
|
||||||
|
Elm_Genlist_Item_Class *_itc2 = elm_genlist_item_class_new();
|
||||||
|
_itc2->item_style = "group_index";
|
||||||
|
_itc2->func.text_get = _genlist_text_get;
|
||||||
|
_itc2->func.content_get = _genlist_content_get;
|
||||||
|
_itc2->func.state_get = NULL;
|
||||||
|
_itc2->func.del = NULL;
|
||||||
|
|
||||||
|
int i=0;
|
||||||
|
for (i=0; i<20; i++)
|
||||||
|
{
|
||||||
|
elm_genlist_item_append(list,
|
||||||
|
_itc,
|
||||||
|
(void *)(uintptr_t) i, // Item data
|
||||||
|
NULL, // Parent item for trees, NULL if none
|
||||||
|
ELM_GENLIST_ITEM_NONE, // Item type; this is the common one
|
||||||
|
_genlist_selected_cb, // Callback on selection of the item
|
||||||
|
_itc2 // Data for that callback function
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, list);
|
||||||
|
evas_object_show(list);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,669 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
#include <Evas_GL.h>
|
||||||
|
|
||||||
|
typedef struct _GLData GLData;
|
||||||
|
// GL related data here..
|
||||||
|
struct _GLData
|
||||||
|
{
|
||||||
|
Evas_GL_API *glapi;
|
||||||
|
GLuint program;
|
||||||
|
GLuint vtx_shader;
|
||||||
|
GLuint fgmt_shader;
|
||||||
|
GLuint vbo;
|
||||||
|
GLuint vertexID;
|
||||||
|
GLuint colorID;
|
||||||
|
GLuint mvpLoc;
|
||||||
|
GLuint positionLoc;
|
||||||
|
GLuint colorLoc;
|
||||||
|
GLfloat model[16], mvp[16];
|
||||||
|
GLfloat view[16];
|
||||||
|
GLfloat xangle;
|
||||||
|
GLfloat yangle;
|
||||||
|
GLfloat zangle;
|
||||||
|
Eina_Bool mouse_down : 1;
|
||||||
|
Eina_Bool initialized : 1;
|
||||||
|
Evas_Object *slx;
|
||||||
|
Evas_Object *sly;
|
||||||
|
Evas_Object *slz;
|
||||||
|
float slx_value;
|
||||||
|
float sly_value;
|
||||||
|
float slz_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
const float unit_matrix[] =
|
||||||
|
{
|
||||||
|
1.0f, 0.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 1.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 0.0f, 1.0f
|
||||||
|
};
|
||||||
|
|
||||||
|
static const float vertices[] =
|
||||||
|
{
|
||||||
|
// Front
|
||||||
|
-0.5f, 0.5f, 0.5f,
|
||||||
|
-0.5f, -0.5f, 0.5f,
|
||||||
|
0.5f, 0.5f, 0.5f,
|
||||||
|
0.5f, 0.5f, 0.5f,
|
||||||
|
-0.5f, -0.5f, 0.5f,
|
||||||
|
0.5f, -0.5f, 0.5f,
|
||||||
|
// Right
|
||||||
|
0.5f, 0.5f, 0.5f,
|
||||||
|
0.5f, -0.5f, 0.5f,
|
||||||
|
0.5f, 0.5f, -0.5f,
|
||||||
|
0.5f, 0.5f, -0.5f,
|
||||||
|
0.5f, -0.5f, 0.5f,
|
||||||
|
0.5f, -0.5f, -0.5f,
|
||||||
|
// Back
|
||||||
|
0.5f, 0.5f, -0.5f,
|
||||||
|
0.5f, -0.5f, -0.5f,
|
||||||
|
-0.5f, 0.5f, -0.5f,
|
||||||
|
-0.5f, 0.5f, -0.5f,
|
||||||
|
0.5f, -0.5f, -0.5f,
|
||||||
|
-0.5f, -0.5f, -0.5f,
|
||||||
|
// Left
|
||||||
|
-0.5f, 0.5f, -0.5f,
|
||||||
|
-0.5f, -0.5f, -0.5f,
|
||||||
|
-0.5f, 0.5f, 0.5f,
|
||||||
|
-0.5f, 0.5f, 0.5f,
|
||||||
|
-0.5f, -0.5f, -0.5f,
|
||||||
|
-0.5f, -0.5f, 0.5f,
|
||||||
|
// Top
|
||||||
|
-0.5f, 0.5f, -0.5f,
|
||||||
|
-0.5f, 0.5f, 0.5f,
|
||||||
|
0.5f, 0.5f, -0.5f,
|
||||||
|
0.5f, 0.5f, -0.5f,
|
||||||
|
-0.5f, 0.5f, 0.5f,
|
||||||
|
0.5f, 0.5f, 0.5f,
|
||||||
|
// Bottom
|
||||||
|
-0.5f, -0.5f, 0.5f,
|
||||||
|
-0.5f, -0.5f, -0.5f,
|
||||||
|
0.5f, -0.5f, 0.5f,
|
||||||
|
0.5f, -0.5f, 0.5f,
|
||||||
|
-0.5f, -0.5f, -0.5f,
|
||||||
|
0.5f, -0.5f, -0.5f
|
||||||
|
};
|
||||||
|
|
||||||
|
static const float colors[] =
|
||||||
|
{
|
||||||
|
// Front
|
||||||
|
0.0625f, 0.57421875f, 0.92578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.92578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.92578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.92578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.92578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.92578125f, 1.0f,
|
||||||
|
// Right
|
||||||
|
0.29296875f, 0.66796875f, 0.82578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.82578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.82578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.82578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.82578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.82578125f, 1.0f,
|
||||||
|
// Back
|
||||||
|
0.52734375f, 0.76171875f, 0.72578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.72578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.72578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.72578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.72578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.72578125f, 1.0f,
|
||||||
|
// Left
|
||||||
|
0.0625f, 0.57421875f, 0.62578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.62578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.62578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.62578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.62578125f, 1.0f,
|
||||||
|
0.0625f, 0.57421875f, 0.62578125f, 1.0f,
|
||||||
|
// Top
|
||||||
|
0.29296875f, 0.66796875f, 0.52578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.52578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.52578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.52578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.52578125f, 1.0f,
|
||||||
|
0.29296875f, 0.66796875f, 0.52578125f, 1.0f,
|
||||||
|
// Bottom
|
||||||
|
0.52734375f, 0.76171875f, 0.42578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.42578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.42578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.42578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.42578125f, 1.0f,
|
||||||
|
0.52734375f, 0.76171875f, 0.42578125f, 1.0f
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
customLoadIdentity(float matrix[16])
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 16; i++)
|
||||||
|
matrix[i] = unit_matrix[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
customMutlMatrix(float matrix[16], const float matrix0[16], const float matrix1[16])
|
||||||
|
{
|
||||||
|
int i, row, column;
|
||||||
|
float temp[16];
|
||||||
|
for (column = 0; column < 4; column++)
|
||||||
|
{
|
||||||
|
for (row = 0; row < 4; row++)
|
||||||
|
{
|
||||||
|
temp[column * 4 + row] = 0.0f;
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
temp[column * 4 + row] += matrix0[i * 4 + row] * matrix1[column * 4 + i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; i < 16; i++)
|
||||||
|
matrix[i] = temp[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
customScale(float matrix[16], const float sx, const float sy, const float sz)
|
||||||
|
{
|
||||||
|
matrix[0] *= sx;
|
||||||
|
matrix[1] *= sx;
|
||||||
|
matrix[2] *= sx;
|
||||||
|
matrix[3] *= sx;
|
||||||
|
|
||||||
|
matrix[4] *= sy;
|
||||||
|
matrix[5] *= sy;
|
||||||
|
matrix[6] *= sy;
|
||||||
|
matrix[7] *= sy;
|
||||||
|
|
||||||
|
matrix[8] *= sz;
|
||||||
|
matrix[9] *= sz;
|
||||||
|
matrix[10] *= sz;
|
||||||
|
matrix[11] *= sz;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
customRotate(float matrix[16], const float anglex, const float angley, const float anglez)
|
||||||
|
{
|
||||||
|
const float pi = 3.141592f;
|
||||||
|
float temp[16];
|
||||||
|
float rz = 2.0f * pi * anglez / 360.0f;
|
||||||
|
float rx = 2.0f * pi * anglex / 360.0f;
|
||||||
|
float ry = 2.0f * pi * angley / 360.0f;
|
||||||
|
float sy = sinf(ry);
|
||||||
|
float cy = cosf(ry);
|
||||||
|
float sx = sinf(rx);
|
||||||
|
float cx = cosf(rx);
|
||||||
|
float sz = sinf(rz);
|
||||||
|
float cz = cosf(rz);
|
||||||
|
|
||||||
|
customLoadIdentity(temp);
|
||||||
|
|
||||||
|
temp[0] = cy * cz - sx * sy * sz;
|
||||||
|
temp[1] = cz * sx * sy + cy * sz;
|
||||||
|
temp[2] = -cx * sy;
|
||||||
|
|
||||||
|
temp[4] = -cx * sz;
|
||||||
|
temp[5] = cx * cz;
|
||||||
|
temp[6] = sx;
|
||||||
|
|
||||||
|
temp[8] = cz * sy + cy * sx * sz;
|
||||||
|
temp[9] = -cy * cz * sx + sy * sz;
|
||||||
|
temp[10] = cx * cy;
|
||||||
|
|
||||||
|
customMutlMatrix(matrix, matrix, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
customFrustum(float result[16], const float left, const float right, const float bottom, const float top, const float near, const float far)
|
||||||
|
{
|
||||||
|
if ((right - left) == 0.0f || (top - bottom) == 0.0f || (far - near) == 0.0f) return 0;
|
||||||
|
|
||||||
|
result[0] = 2.0f / (right - left);
|
||||||
|
result[1] = 0.0f;
|
||||||
|
result[2] = 0.0f;
|
||||||
|
result[3] = 0.0f;
|
||||||
|
|
||||||
|
result[4] = 0.0f;
|
||||||
|
result[5] = 2.0f / (top - bottom);
|
||||||
|
result[6] = 0.0f;
|
||||||
|
result[7] = 0.0f;
|
||||||
|
|
||||||
|
result[8] = 0.0f;
|
||||||
|
result[9] = 0.0f;
|
||||||
|
result[10] = -2.0f / (far - near);
|
||||||
|
result[11] = 0.0f;
|
||||||
|
|
||||||
|
result[12] = -(right + left) / (right - left);
|
||||||
|
result[13] = -(top + bottom) / (top - bottom);
|
||||||
|
result[14] = -(far + near) / (far - near);
|
||||||
|
result[15] = 1.0f;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
init_shaders(GLData *gld)
|
||||||
|
{
|
||||||
|
Evas_GL_API *gl = gld->glapi;
|
||||||
|
|
||||||
|
GLbyte vertex_shader[] =
|
||||||
|
"#ifdef GL_ES\n"
|
||||||
|
"precision mediump float;\n"
|
||||||
|
"#endif\n"
|
||||||
|
"attribute vec4 a_position;\n"
|
||||||
|
"attribute vec4 a_color;\n"
|
||||||
|
"uniform mat4 u_mvp_mat;\n"
|
||||||
|
"varying vec4 v_color;\n"
|
||||||
|
"void main()\n"
|
||||||
|
"{\n"
|
||||||
|
" gl_Position = u_mvp_mat*a_position;\n"
|
||||||
|
" v_color = a_color;\n"
|
||||||
|
"}";
|
||||||
|
GLbyte fragment_shader[] =
|
||||||
|
"#ifdef GL_ES\n"
|
||||||
|
"precision highp float;\n"
|
||||||
|
"#endif\n"
|
||||||
|
"varying vec4 v_color;\n"
|
||||||
|
"void main()\n"
|
||||||
|
"{\n"
|
||||||
|
" gl_FragColor = v_color;\n"
|
||||||
|
"}";
|
||||||
|
|
||||||
|
GLint compiled;
|
||||||
|
const char *p = vertex_shader;
|
||||||
|
|
||||||
|
//vertex shader
|
||||||
|
gld->vtx_shader = gl->glCreateShader(GL_VERTEX_SHADER);
|
||||||
|
gl->glShaderSource(gld->vtx_shader, 1, &p, NULL);
|
||||||
|
gl->glCompileShader(gld->vtx_shader);
|
||||||
|
gl->glGetShaderiv(gld->vtx_shader, GL_COMPILE_STATUS, &compiled);
|
||||||
|
if (!compiled)
|
||||||
|
{
|
||||||
|
GLint info_len = 0;
|
||||||
|
gl->glGetShaderiv(gld->vtx_shader, GL_INFO_LOG_LENGTH, &info_len);
|
||||||
|
if (info_len > 1)
|
||||||
|
{
|
||||||
|
char* info_log = malloc(sizeof(char) * info_len);
|
||||||
|
gl->glGetShaderInfoLog(gld->vtx_shader, info_len, NULL, info_log);
|
||||||
|
printf("Error compiling shader:\n%s\n======\n%s\n======\n", info_log, p);
|
||||||
|
free(info_log);
|
||||||
|
}
|
||||||
|
gl->glDeleteShader(gld->vtx_shader);
|
||||||
|
}
|
||||||
|
|
||||||
|
//fragment shader
|
||||||
|
p = fragment_shader;
|
||||||
|
gld->fgmt_shader = gl->glCreateShader(GL_FRAGMENT_SHADER);
|
||||||
|
gl->glShaderSource(gld->fgmt_shader, 1, &p, NULL);
|
||||||
|
gl->glCompileShader(gld->fgmt_shader);
|
||||||
|
gl->glGetShaderiv(gld->fgmt_shader, GL_COMPILE_STATUS, &compiled);
|
||||||
|
if (!compiled)
|
||||||
|
{
|
||||||
|
GLint info_len = 0;
|
||||||
|
gl->glGetShaderiv(gld->fgmt_shader, GL_INFO_LOG_LENGTH, &info_len);
|
||||||
|
if (info_len > 1)
|
||||||
|
{
|
||||||
|
char* info_log = malloc(sizeof(char) * info_len);
|
||||||
|
gl->glGetShaderInfoLog(gld->fgmt_shader, info_len, NULL, info_log);
|
||||||
|
printf("Error compiling shader:\n%s\n======\n%s\n======\n", info_log, p);
|
||||||
|
free(info_log);
|
||||||
|
}
|
||||||
|
gl->glDeleteShader(gld->fgmt_shader);
|
||||||
|
}
|
||||||
|
|
||||||
|
gld->program = gl->glCreateProgram();
|
||||||
|
|
||||||
|
GLint linked;
|
||||||
|
// Load the vertex/fragment shaders
|
||||||
|
gl->glAttachShader(gld->program, gld->vtx_shader);
|
||||||
|
gl->glAttachShader(gld->program, gld->fgmt_shader);
|
||||||
|
gl->glDeleteShader(gld->vtx_shader);
|
||||||
|
gl->glDeleteShader(gld->fgmt_shader);
|
||||||
|
|
||||||
|
gl->glBindAttribLocation(gld->program, 0, "a_position");
|
||||||
|
gl->glLinkProgram(gld->program);
|
||||||
|
gl->glGetProgramiv(gld->program, GL_LINK_STATUS, &linked);
|
||||||
|
if (!linked)
|
||||||
|
{
|
||||||
|
GLint info_len = 0;
|
||||||
|
gl->glGetProgramiv(gld->program, GL_INFO_LOG_LENGTH, &info_len);
|
||||||
|
if (info_len > 1)
|
||||||
|
{
|
||||||
|
char* info_log = malloc(sizeof(char) * info_len);
|
||||||
|
gl->glGetProgramInfoLog(gld->program, info_len, NULL, info_log);
|
||||||
|
printf("Error linking program:\n%s\n", info_log);
|
||||||
|
free(info_log);
|
||||||
|
}
|
||||||
|
gl->glDeleteProgram(gld->program);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
gld->mvpLoc = gl->glGetUniformLocation(gld->program, "u_mvp_mat");
|
||||||
|
gld->positionLoc = gl->glGetAttribLocation(gld->program, "a_position");
|
||||||
|
gld->colorLoc = gl->glGetAttribLocation(gld->program, "a_color");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Callbacks
|
||||||
|
// intialize callback that gets called once for intialization
|
||||||
|
static void
|
||||||
|
_init_gl(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
GLData *gld = evas_object_data_get(obj, "gld");
|
||||||
|
Evas_GL_API *gl = gld->glapi;
|
||||||
|
|
||||||
|
elm_glview_size_get(obj, &w, &h);
|
||||||
|
|
||||||
|
if (!gld->initialized)
|
||||||
|
{
|
||||||
|
if (!init_shaders(gld))
|
||||||
|
{
|
||||||
|
printf("Error Initializing Shaders\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
gl->glGenBuffers(1, &gld->vertexID);
|
||||||
|
gl->glBindBuffer(GL_ARRAY_BUFFER, gld->vertexID);
|
||||||
|
gl->glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||||
|
|
||||||
|
gl->glGenBuffers(1, &gld->colorID);
|
||||||
|
gl->glBindBuffer(GL_ARRAY_BUFFER, gld->colorID);
|
||||||
|
gl->glBufferData(GL_ARRAY_BUFFER, sizeof(colors), colors, GL_STATIC_DRAW);
|
||||||
|
|
||||||
|
gld->initialized = EINA_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// draw callback is where all the main GL rendering happens
|
||||||
|
static void
|
||||||
|
_draw_gl(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_GL_API *gl = elm_glview_gl_api_get(obj);
|
||||||
|
GLData *gld = evas_object_data_get(obj, "gld");
|
||||||
|
if(!gld) return;
|
||||||
|
int w, h;
|
||||||
|
int r, g, b, a;
|
||||||
|
//scale
|
||||||
|
double scalex = elm_slider_value_get(gld->slx);
|
||||||
|
double scaley = elm_slider_value_get(gld->sly);
|
||||||
|
double scalez = elm_slider_value_get(gld->slz);
|
||||||
|
|
||||||
|
r = 255; g = 255; b = 0; a = 0;
|
||||||
|
|
||||||
|
elm_glview_size_get(obj, &w, &h);
|
||||||
|
|
||||||
|
gl->glClearDepthf(1.0f);
|
||||||
|
gl->glClearColor(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
|
||||||
|
gl->glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
|
gl->glViewport(0, 0, w, h);
|
||||||
|
gl->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
gl->glUseProgram(gld->program);
|
||||||
|
|
||||||
|
gl->glEnableVertexAttribArray(gld->positionLoc);
|
||||||
|
gl->glBindBuffer(GL_ARRAY_BUFFER, gld->vertexID);
|
||||||
|
gl->glVertexAttribPointer(gld->positionLoc, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), 0);
|
||||||
|
|
||||||
|
gl->glEnableVertexAttribArray(gld->colorLoc);
|
||||||
|
gl->glBindBuffer(GL_ARRAY_BUFFER, gld->colorID);
|
||||||
|
gl->glVertexAttribPointer(gld->colorLoc, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
|
||||||
|
|
||||||
|
customLoadIdentity(gld->model);
|
||||||
|
customRotate(gld->model, gld->xangle, gld->yangle, gld->zangle++);
|
||||||
|
//scale
|
||||||
|
customScale(gld->model, scalex, scaley, scalez);
|
||||||
|
customMutlMatrix(gld->mvp, gld->view, gld->model);
|
||||||
|
|
||||||
|
gl->glUniformMatrix4fv(gld->mvpLoc, 1, GL_FALSE, gld->mvp);
|
||||||
|
gl->glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||||
|
gl->glFlush();
|
||||||
|
}
|
||||||
|
|
||||||
|
// resize callback gets called every time object is resized
|
||||||
|
static void
|
||||||
|
_resize_gl(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
GLData *gld = evas_object_data_get(obj, "gld");
|
||||||
|
Evas_GL_API *gl = gld->glapi;
|
||||||
|
float aspect;
|
||||||
|
|
||||||
|
elm_glview_size_get(obj, &w, &h);
|
||||||
|
customLoadIdentity(gld->view);
|
||||||
|
|
||||||
|
if (w > h)
|
||||||
|
{
|
||||||
|
aspect = (float) w / h;
|
||||||
|
customFrustum(gld->view, -1.0 * aspect, 1.0 * aspect, -1.0, 1.0, -1.0, 1.0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
aspect = (float) h / w;
|
||||||
|
customFrustum(gld->view, -1.0, 1.0, -1.0 * aspect, 1.0 * aspect, -1.0, 1.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// delete callback gets called when glview is deleted
|
||||||
|
static void
|
||||||
|
_del_gl(Evas_Object *obj)
|
||||||
|
{
|
||||||
|
GLData *gld = evas_object_data_get(obj, "gld");
|
||||||
|
if (!gld)
|
||||||
|
{
|
||||||
|
printf("Unable to get GLData. \n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Evas_GL_API *gl = gld->glapi;
|
||||||
|
gl->glDeleteShader(gld->vtx_shader);
|
||||||
|
gl->glDeleteShader(gld->fgmt_shader);
|
||||||
|
gl->glDeleteProgram(gld->program);
|
||||||
|
evas_object_data_del((Evas_Object*) obj, "..gld");
|
||||||
|
}
|
||||||
|
|
||||||
|
// just need to notify that glview has changed so it can render
|
||||||
|
static Eina_Bool
|
||||||
|
_anim(void *data)
|
||||||
|
{
|
||||||
|
elm_glview_changed_set(data);
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
_mouse_down_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
|
||||||
|
{
|
||||||
|
GLData *gld = data;
|
||||||
|
gld->mouse_down = EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_mouse_up_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
|
||||||
|
{
|
||||||
|
GLData *gld = data;
|
||||||
|
gld->mouse_down = EINA_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_mouse_move_cb(void *data, Evas *e , Evas_Object *obj , void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Move *ev;
|
||||||
|
ev = (Evas_Event_Mouse_Move *)event_info;
|
||||||
|
GLData *gld = data;
|
||||||
|
float dx = 0, dy = 0;
|
||||||
|
|
||||||
|
if(gld->mouse_down)
|
||||||
|
{
|
||||||
|
dx = ev->cur.canvas.x - ev->prev.canvas.x;
|
||||||
|
dy = ev->cur.canvas.y - ev->prev.canvas.y;
|
||||||
|
gld->xangle += dy;
|
||||||
|
gld->yangle += dx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_on_done(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
evas_object_del((Evas_Object*)data);
|
||||||
|
elm_exit();
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
_del(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Ecore_Animator *ani = evas_object_data_get(obj, "ani");
|
||||||
|
ecore_animator_del(ani);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Eina_Bool
|
||||||
|
animate_reset_cb(void *data, double pos)
|
||||||
|
{
|
||||||
|
GLData *gld = data;
|
||||||
|
double frame = pos;
|
||||||
|
float x, y, z;
|
||||||
|
|
||||||
|
frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 1.8, 7);
|
||||||
|
x = gld->slx_value * (1 - frame) + 0.75 * frame;
|
||||||
|
y = gld->sly_value * (1 - frame) + 0.75 * frame;
|
||||||
|
z = gld->slz_value * (1 - frame) + 0.75 * frame;
|
||||||
|
|
||||||
|
elm_slider_value_set(gld->slx, x);
|
||||||
|
elm_slider_value_set(gld->sly, y);
|
||||||
|
elm_slider_value_set(gld->slz, z);
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void btn_reset_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
GLData *gld = data;
|
||||||
|
gld->slx_value = elm_slider_value_get(gld->slx);
|
||||||
|
gld->sly_value = elm_slider_value_get(gld->sly);
|
||||||
|
gld->slz_value = elm_slider_value_get(gld->slz);
|
||||||
|
ecore_animator_timeline_add(1, animate_reset_cb, gld);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *bx, *inner_box, *bt, *gl, *btn_reset;
|
||||||
|
Ecore_Animator *ani;
|
||||||
|
GLData *gld = NULL;
|
||||||
|
if (!(gld = calloc(1, sizeof(GLData)))) return 1;
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
win = elm_win_util_standard_add("glview simple", "GLView Simple");
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
bx = elm_box_add(win);
|
||||||
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_show(bx);
|
||||||
|
inner_box = elm_box_add(bx);
|
||||||
|
evas_object_size_hint_weight_set(inner_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_show(inner_box);
|
||||||
|
|
||||||
|
//-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
|
||||||
|
//-//
|
||||||
|
// create a new glview object
|
||||||
|
gl = elm_glview_add(win);
|
||||||
|
gld->glapi = elm_glview_gl_api_get(gl);
|
||||||
|
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
// mode is simply for supporting alpha, depth buffering, and stencil
|
||||||
|
// buffering.
|
||||||
|
elm_glview_mode_set(gl, ELM_GLVIEW_ALPHA | ELM_GLVIEW_DEPTH);
|
||||||
|
// resize policy tells glview what to do with the surface when it
|
||||||
|
// resizes. ELM_GLVIEW_RESIZE_POLICY_RECREATE will tell it to
|
||||||
|
// destroy the current surface and recreate it to the new size
|
||||||
|
elm_glview_resize_policy_set(gl, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
|
||||||
|
// render policy tells glview how it would like glview to render
|
||||||
|
// gl code. ELM_GLVIEW_RENDER_POLICY_ON_DEMAND will have the gl
|
||||||
|
// calls called in the pixel_get callback, which only gets called
|
||||||
|
// if the object is visible, hence ON_DEMAND. ALWAYS mode renders
|
||||||
|
// it despite the visibility of the object.
|
||||||
|
elm_glview_render_policy_set(gl, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
|
||||||
|
// initialize callback function gets registered here
|
||||||
|
elm_glview_init_func_set(gl, _init_gl);
|
||||||
|
// delete callback function gets registered here
|
||||||
|
elm_glview_del_func_set(gl, _del_gl);
|
||||||
|
elm_glview_resize_func_set(gl, _resize_gl);
|
||||||
|
elm_glview_render_func_set(gl, _draw_gl);
|
||||||
|
//-//
|
||||||
|
//-//-//-// END GL INIT BLOB
|
||||||
|
elm_box_pack_end(bx, gl);
|
||||||
|
evas_object_show(gl);
|
||||||
|
elm_object_focus_set(gl, EINA_TRUE);
|
||||||
|
// animating - just a demo. as long as you trigger an update on the image
|
||||||
|
// object via elm_glview_changed_set() it will be updated.
|
||||||
|
//
|
||||||
|
// NOTE: if you delete gl, this animator will keep running trying to access
|
||||||
|
// gl so you'd better delete this animator with ecore_animator_del().
|
||||||
|
ani = ecore_animator_add(_anim, gl);
|
||||||
|
evas_object_data_set(gl, "ani", ani);
|
||||||
|
evas_object_data_set(gl, "gld", gld);
|
||||||
|
evas_object_event_callback_add(gl, EVAS_CALLBACK_DEL, _del, gl);
|
||||||
|
evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, gld);
|
||||||
|
evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, gld);
|
||||||
|
evas_object_event_callback_add(gl, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, gld);
|
||||||
|
/* Set rotation variables */
|
||||||
|
gld->xangle = 45.0f;
|
||||||
|
gld->yangle = 45.0f;
|
||||||
|
gld->zangle = 0.0f;
|
||||||
|
gld->mouse_down = EINA_FALSE;
|
||||||
|
gld->initialized = EINA_FALSE;
|
||||||
|
// add an 'OK' button to end the program
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "OK");
|
||||||
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _on_done, win);
|
||||||
|
|
||||||
|
// Slider for X-axis scale
|
||||||
|
gld->slx = elm_slider_add(inner_box);
|
||||||
|
evas_object_size_hint_align_set(gld->slx, EVAS_HINT_FILL, 0);
|
||||||
|
elm_slider_horizontal_set(gld->slx, EINA_TRUE);
|
||||||
|
elm_slider_unit_format_set(gld->slx, "%1.2f units");
|
||||||
|
elm_slider_indicator_format_set(gld->slx, "%1.2f units");
|
||||||
|
elm_slider_indicator_show_set(gld->slx, EINA_TRUE);
|
||||||
|
elm_slider_min_max_set(gld->slx, 0, 1.5);
|
||||||
|
elm_slider_value_set(gld->slx, 0.75);
|
||||||
|
evas_object_color_set(gld->slx, 0.0, 0.0, 120, 255);
|
||||||
|
elm_box_pack_end(inner_box, gld->slx);
|
||||||
|
evas_object_show(gld->slx);
|
||||||
|
|
||||||
|
// Slider for Y-axis scale
|
||||||
|
gld->sly = elm_slider_add(inner_box);
|
||||||
|
evas_object_size_hint_align_set(gld->sly, EVAS_HINT_FILL, 0);
|
||||||
|
elm_slider_horizontal_set(gld->sly, EINA_TRUE);
|
||||||
|
elm_slider_unit_format_set(gld->sly, "%1.2f units");
|
||||||
|
elm_slider_indicator_format_set(gld->sly, "%1.2f units");
|
||||||
|
elm_slider_indicator_show_set(gld->sly, EINA_TRUE);
|
||||||
|
elm_slider_min_max_set(gld->sly, 0, 1.5);
|
||||||
|
elm_slider_value_set(gld->sly, 0.75);
|
||||||
|
evas_object_color_set(gld->sly, 0.0, 0.0, 120, 255);
|
||||||
|
elm_box_pack_end(inner_box, gld->sly);
|
||||||
|
evas_object_show(gld->sly);
|
||||||
|
|
||||||
|
// Slider for Z-axis scale
|
||||||
|
gld->slz = elm_slider_add(inner_box);
|
||||||
|
evas_object_size_hint_align_set(gld->slz, EVAS_HINT_FILL, 0);
|
||||||
|
elm_slider_horizontal_set(gld->slz, EINA_TRUE);
|
||||||
|
elm_slider_unit_format_set(gld->slz, "%1.2f units");
|
||||||
|
elm_slider_indicator_format_set(gld->slz, "%1.2f units");
|
||||||
|
elm_slider_indicator_show_set(gld->slz, EINA_TRUE);
|
||||||
|
elm_slider_min_max_set(gld->slz, 0, 1.5);
|
||||||
|
elm_slider_value_set(gld->slz, 0.75);
|
||||||
|
evas_object_color_set(gld->slz, 0.0, 0.0, 120, 255);
|
||||||
|
elm_box_pack_end(inner_box, gld->slz);
|
||||||
|
evas_object_show(gld->slz);
|
||||||
|
|
||||||
|
// Reset button
|
||||||
|
btn_reset = elm_button_add(inner_box);
|
||||||
|
elm_object_text_set(btn_reset, "Reset");
|
||||||
|
evas_object_smart_callback_add(btn_reset, "clicked", btn_reset_cb, gld);
|
||||||
|
evas_object_size_hint_align_set(btn_reset, EVAS_HINT_FILL, 0);
|
||||||
|
elm_box_pack_end(inner_box, btn_reset);
|
||||||
|
evas_object_show(btn_reset);
|
||||||
|
|
||||||
|
evas_object_resize(inner_box, 100, 100);
|
||||||
|
evas_object_move(inner_box, 0, 5);
|
||||||
|
evas_object_resize(bx, 800, 800);
|
||||||
|
evas_object_resize(win, 800, 800);
|
||||||
|
evas_object_show(win);
|
||||||
|
// run the mainloop and process events and callbacks
|
||||||
|
elm_run();
|
||||||
|
free(gld);
|
||||||
|
elm_shutdown();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,273 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
#include "structure_menu.h"
|
||||||
|
|
||||||
|
#define MAINVIEW "view/main"
|
||||||
|
#define MAINMENU "menu/main"
|
||||||
|
#define SIDEMENU "menu/side"
|
||||||
|
#define ICON_DIR "<path_to_your_icon_dir>"
|
||||||
|
|
||||||
|
//to handle the key down events
|
||||||
|
static Eina_Bool
|
||||||
|
keydown_cb(void *data , int type , void *event)
|
||||||
|
{
|
||||||
|
Menu *me = data;
|
||||||
|
Ecore_Event_Key *ev = event;
|
||||||
|
if (!strcmp(ev->keyname, "XF86Send"))
|
||||||
|
{
|
||||||
|
if (me->sdmenu_up == EINA_TRUE)
|
||||||
|
{
|
||||||
|
// If the menu is visible send a "hide,sidemenu" signal
|
||||||
|
elm_object_signal_emit(me->layout, "hide,sidemenu", "MenuButton");
|
||||||
|
// Store the new menu status (hidden).
|
||||||
|
me->sdmenu_up = EINA_FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If the menu is visible send a "hide,sidemenu" signal
|
||||||
|
elm_object_signal_emit(me->layout, "show,sidemenu", "MenuButton");
|
||||||
|
// Store the new menu status (hidden).
|
||||||
|
me->sdmenu_up = EINA_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
//create the views
|
||||||
|
static void
|
||||||
|
_build_main_view(Menu *me)
|
||||||
|
{
|
||||||
|
Mainview *view = me->main_view;
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
|
||||||
|
//Main box
|
||||||
|
view->box = elm_box_add(me->nf);
|
||||||
|
elm_box_horizontal_set(view->box, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(view->box, EINA_TRUE);
|
||||||
|
|
||||||
|
view->img = elm_image_add(view->box);
|
||||||
|
evas_object_size_hint_weight_set(view->img, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_align_set(view->img, 0.5, 0.5);
|
||||||
|
evas_object_size_hint_min_set(view->img, 25, 25);
|
||||||
|
snprintf(buf, sizeof(buf), "%s/%s", ICON_DIR, "icon.png");
|
||||||
|
if (!elm_image_file_set(view->img, buf, NULL))
|
||||||
|
elm_object_text_set(view->lb_day, "Problem loading image");
|
||||||
|
elm_box_pack_start(view->box, view->img);
|
||||||
|
evas_object_show(view->img);
|
||||||
|
|
||||||
|
view->lb_day = elm_label_add(view->box);
|
||||||
|
elm_object_text_set(view->lb_day, "Main view");
|
||||||
|
evas_object_size_hint_weight_set(view->lb_day, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_box_pack_end(view->box, view->lb_day);
|
||||||
|
evas_object_show(view->lb_day);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_build_calendar_view(Menu *me)
|
||||||
|
{
|
||||||
|
Calview *view = me->cal_view;
|
||||||
|
|
||||||
|
view->box = elm_box_add(me->nf);
|
||||||
|
elm_box_horizontal_set(view->box, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(view->box, EINA_TRUE);
|
||||||
|
|
||||||
|
view->calendar = elm_calendar_add(me->nf);
|
||||||
|
evas_object_size_hint_weight_set(view->calendar, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_align_set(view->calendar, 0.5, 0.5);
|
||||||
|
elm_box_pack_end(view->box, view->calendar);
|
||||||
|
evas_object_show(view->calendar);
|
||||||
|
|
||||||
|
view->lb_cal = elm_label_add(view->box);
|
||||||
|
elm_object_text_set(view->lb_cal, "The calendar view");
|
||||||
|
evas_object_size_hint_weight_set(view->lb_cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_box_pack_end(view->box, view->lb_cal);
|
||||||
|
evas_object_show(view->lb_cal);
|
||||||
|
} // End of_build_calendar_view
|
||||||
|
|
||||||
|
static void
|
||||||
|
_build_date_view(Menu *me)
|
||||||
|
{
|
||||||
|
Dateview *view = me->date_view;
|
||||||
|
|
||||||
|
view->box = elm_box_add(me->nf);
|
||||||
|
elm_box_horizontal_set(view->box, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(view->box, EINA_TRUE);
|
||||||
|
|
||||||
|
view->datetime = elm_datetime_add(me->nf);
|
||||||
|
evas_object_size_hint_weight_set(view->datetime, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(view->datetime, EVAS_HINT_FILL, 0.5);
|
||||||
|
elm_box_pack_end(view->box, view->datetime);
|
||||||
|
evas_object_show(view->datetime);
|
||||||
|
|
||||||
|
view->lb_date = elm_label_add(view->box);
|
||||||
|
elm_object_text_set(view->lb_date, "The calendar view");
|
||||||
|
evas_object_size_hint_weight_set(view->lb_date, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_box_pack_end(view->box, view->lb_date);
|
||||||
|
evas_object_show(view->lb_date);
|
||||||
|
} // End of_build_calendar_view
|
||||||
|
|
||||||
|
static void
|
||||||
|
_build_settings_view(Menu *me)
|
||||||
|
{
|
||||||
|
Setview *view = me->settings_view;
|
||||||
|
|
||||||
|
view->box = elm_box_add(me->nf);
|
||||||
|
elm_box_horizontal_set(view->box, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(view->box, EINA_TRUE);
|
||||||
|
|
||||||
|
view->lb = elm_label_add(view->box);
|
||||||
|
elm_object_text_set(view->lb, "The settings view");
|
||||||
|
evas_object_size_hint_weight_set(view->lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_box_pack_end(view->box, view->lb);
|
||||||
|
evas_object_show(view->lb);
|
||||||
|
} // End of_build_calendar_view
|
||||||
|
|
||||||
|
static void
|
||||||
|
_menu_item_selected_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Elm_Object_Item *it = (Elm_Object_Item*) event_info;
|
||||||
|
Menu * me = (Menu *)data;
|
||||||
|
Evas_Object *view;
|
||||||
|
|
||||||
|
// Get the menu item text
|
||||||
|
const char *str = elm_object_item_text_get(it);
|
||||||
|
|
||||||
|
// Comparing with the possible view names
|
||||||
|
if (!strcmp(str, "Calendar"))
|
||||||
|
{
|
||||||
|
// Build the "Calendar View"
|
||||||
|
_build_calendar_view(me);
|
||||||
|
// Set the view from the application data
|
||||||
|
view = me->cal_view->box;
|
||||||
|
}
|
||||||
|
else if (!strcmp(str, "Date"))
|
||||||
|
{
|
||||||
|
// Build the "Date View"
|
||||||
|
_build_date_view(data);
|
||||||
|
// Set the view from the application data
|
||||||
|
view = me->date_view->box;
|
||||||
|
}
|
||||||
|
else if (!strcmp(str, "Home"))
|
||||||
|
{
|
||||||
|
// Build the "Home or main View"
|
||||||
|
_build_main_view(me);
|
||||||
|
// Set the view from the application data
|
||||||
|
view = me->main_view->box;
|
||||||
|
}
|
||||||
|
else if (!strcmp(str, "Settings"))
|
||||||
|
{
|
||||||
|
// Build the "Settings" view
|
||||||
|
_build_settings_view(data);
|
||||||
|
// Set the view from the application data
|
||||||
|
view = me->settings_view->box;
|
||||||
|
}
|
||||||
|
else if (!strcmp(str, "Clock"))
|
||||||
|
{
|
||||||
|
// Build the "Date View"
|
||||||
|
_build_date_view(me);
|
||||||
|
// Set the view from the application data
|
||||||
|
view = me->date_view->box;
|
||||||
|
}
|
||||||
|
else return;
|
||||||
|
|
||||||
|
// Show the view in the naviframe
|
||||||
|
elm_layout_content_set(me->layout, MAINVIEW, view);
|
||||||
|
}
|
||||||
|
|
||||||
|
//main menu
|
||||||
|
static void
|
||||||
|
_build_main_menu(Menu *me, Evas_Object *win)
|
||||||
|
{
|
||||||
|
//Memory allocation for the main menu function.
|
||||||
|
Tbarmenu *menu = calloc(1, sizeof(Tbarmenu));
|
||||||
|
//Putting the "main" menu in the application data.
|
||||||
|
me->menu = menu;
|
||||||
|
|
||||||
|
// Creation of the "Menu" toolbar
|
||||||
|
menu->tb = elm_toolbar_add(win);
|
||||||
|
|
||||||
|
// Setting the "Menu" Toolbar properties
|
||||||
|
elm_toolbar_shrink_mode_set(menu->tb, ELM_TOOLBAR_SHRINK_NONE);
|
||||||
|
elm_toolbar_transverse_expanded_set(menu->tb, EINA_TRUE);
|
||||||
|
elm_toolbar_homogeneous_set(menu->tb, EINA_FALSE);
|
||||||
|
|
||||||
|
// Adding menu items to the "Menu" toolbar
|
||||||
|
elm_toolbar_item_append(menu->tb, ICON_DIR"home.svg", "Home", _menu_item_selected_cb, me);
|
||||||
|
elm_toolbar_item_append(menu->tb, ICON_DIR"calendar.svg", "Calendar", _menu_item_selected_cb, me);
|
||||||
|
elm_toolbar_item_append(menu->tb, ICON_DIR"clock.svg", "Date", _menu_item_selected_cb, me);
|
||||||
|
elm_toolbar_item_append(menu->tb, ICON_DIR"settings.svg", "Settings", _menu_item_selected_cb, me);
|
||||||
|
|
||||||
|
// Showing the widget
|
||||||
|
evas_object_show(menu->tb);
|
||||||
|
|
||||||
|
// Adding the widget to the "menu/main" SWALLOW container defined in the .edc theme file.
|
||||||
|
elm_layout_content_set(me->layout, "menu/main", menu->tb);
|
||||||
|
|
||||||
|
// Set the default view
|
||||||
|
elm_toolbar_item_selected_set(elm_toolbar_first_item_get(menu->tb), EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//side menu not visible at default
|
||||||
|
static void _build_side_menu(Menu *me, Evas_Object *win)
|
||||||
|
{
|
||||||
|
Tbarmenu *sidemenu = calloc(1, sizeof(Tbarmenu));
|
||||||
|
me->sidemenu = sidemenu;
|
||||||
|
|
||||||
|
sidemenu->tb = elm_toolbar_add(win);
|
||||||
|
|
||||||
|
elm_toolbar_shrink_mode_set(sidemenu->tb, ELM_TOOLBAR_SHRINK_EXPAND);
|
||||||
|
elm_toolbar_transverse_expanded_set(sidemenu->tb, EINA_TRUE);
|
||||||
|
|
||||||
|
elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/home.svg", "Home", _menu_item_selected_cb, me);
|
||||||
|
elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/account.svg", "Account", NULL, NULL);
|
||||||
|
elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/contact.svg", "Friends", NULL, NULL);
|
||||||
|
elm_toolbar_item_append(sidemenu->tb, ICON_DIR"/clock.svg", "Clock", _menu_item_selected_cb, me);
|
||||||
|
elm_toolbar_homogeneous_set(sidemenu->tb, EINA_FALSE);
|
||||||
|
evas_object_show(sidemenu->tb);
|
||||||
|
elm_object_part_content_set(me->layout, "menu/side", sidemenu->tb);
|
||||||
|
elm_toolbar_horizontal_set(sidemenu->tb, EINA_FALSE);
|
||||||
|
elm_toolbar_item_selected_set(elm_toolbar_first_item_get(sidemenu->tb), EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
win = elm_win_util_standard_add("Menu", "Menu Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
|
||||||
|
// Memory allocation
|
||||||
|
Menu *me = calloc(1, sizeof(Menu));
|
||||||
|
me->main_view = calloc(1, sizeof(Mainview)); // Allocating memory for the main view
|
||||||
|
me->cal_view = calloc(1, sizeof(Calview)); // Allocating memory for the calendar view
|
||||||
|
me->date_view = calloc(1, sizeof(Dateview)); // allocating memory for the date view
|
||||||
|
me->settings_view = calloc(1, sizeof(Setview)); // allocating memory for the date view
|
||||||
|
me->sdmenu_up = EINA_FALSE;
|
||||||
|
|
||||||
|
me->layout = elm_layout_add(win);
|
||||||
|
evas_object_resize(me->layout, 400, 400);
|
||||||
|
|
||||||
|
elm_layout_file_set(me->layout, "menu.edj", "my_layout");
|
||||||
|
|
||||||
|
me->nf = elm_naviframe_add(win);
|
||||||
|
_build_main_menu(me, win);
|
||||||
|
_build_side_menu(me, win);
|
||||||
|
|
||||||
|
evas_object_show(me->layout);
|
||||||
|
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, keydown_cb, me);
|
||||||
|
evas_object_smart_callback_add(win, "delete,request", _free_menu_cb, me);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
free(me->menu);
|
||||||
|
free(me->sidemenu);
|
||||||
|
free(me->main_view);
|
||||||
|
free(me->cal_view);
|
||||||
|
free(me->settings_view);
|
||||||
|
free(me);
|
||||||
|
elm_shutdown();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,102 @@
|
||||||
|
collections {
|
||||||
|
group {
|
||||||
|
name: "my_layout";
|
||||||
|
parts {
|
||||||
|
part
|
||||||
|
{
|
||||||
|
name: "menu/main";
|
||||||
|
type: SWALLOW;
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1.relative: 1.0 0.0;
|
||||||
|
rel2.relative: 1.0 1.0;
|
||||||
|
}
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "up" 0.0;
|
||||||
|
rel1.relative: 0.0 0.01;
|
||||||
|
rel2.relative: 1.0 0.18;
|
||||||
|
|
||||||
|
}
|
||||||
|
} //End menu/main
|
||||||
|
part
|
||||||
|
{
|
||||||
|
name: "view/main";
|
||||||
|
type: SWALLOW;
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1.relative: 1.0 1.0;
|
||||||
|
rel2.relative: 1.0 1.0;
|
||||||
|
}
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "up" 0.0;
|
||||||
|
rel1.relative: 0.0 1.01;
|
||||||
|
rel1.to: "menu/main";
|
||||||
|
rel2.relative: 1.0 1.0;
|
||||||
|
color: 0 255 0 255;
|
||||||
|
}
|
||||||
|
} // END view/main
|
||||||
|
part
|
||||||
|
{
|
||||||
|
name: "menu/side";
|
||||||
|
type: SWALLOW;
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "default" 0.0;
|
||||||
|
rel1.relative: -0.3 0.0;
|
||||||
|
rel2.relative: -0.3 1.0;
|
||||||
|
color: 255 0 0 255;
|
||||||
|
}
|
||||||
|
description
|
||||||
|
{
|
||||||
|
state: "up" 0.0;
|
||||||
|
rel1.relative: 0.0 0.2;
|
||||||
|
rel2.relative: 0.10 1.0;
|
||||||
|
color: 255 0 0 255;
|
||||||
|
}
|
||||||
|
} //END menu/side
|
||||||
|
}
|
||||||
|
programs {
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,menu_main";
|
||||||
|
source: "";
|
||||||
|
signal: "load";
|
||||||
|
action: STATE_SET "up" 1.0;
|
||||||
|
target: "menu/main";
|
||||||
|
transition: LINEAR 0.5;
|
||||||
|
} // END animation,menu_main
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,view_main";
|
||||||
|
source: "";
|
||||||
|
signal: "load";
|
||||||
|
action: STATE_SET "up" 1.0;
|
||||||
|
target: "view/main";
|
||||||
|
transition: LINEAR 0.2;
|
||||||
|
} //END animation,view_main²
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,menu_side,hide";
|
||||||
|
source: "MenuButton";
|
||||||
|
signal: "hide,sidemenu";
|
||||||
|
action: STATE_SET "default" 1.0;
|
||||||
|
target: "menu/side";
|
||||||
|
transition: LINEAR 0.2;
|
||||||
|
} //END animation,menu_side,hide
|
||||||
|
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "animation,menu_side";
|
||||||
|
source: "MenuButton";
|
||||||
|
signal: "show,sidemenu";
|
||||||
|
action: STATE_SET "up" 1.0;
|
||||||
|
target: "menu/side";
|
||||||
|
transition: LINEAR 0.2;
|
||||||
|
} //END animation,menu_side
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
#ifndef __STRUCTURE_MENU_
|
||||||
|
#define __STRUCTURE_MENU_
|
||||||
|
|
||||||
|
typedef struct _Mainview
|
||||||
|
{
|
||||||
|
Evas_Object *box; //The main container of the view
|
||||||
|
Evas_Object *img; //An image
|
||||||
|
Evas_Object *lb_day; //A label
|
||||||
|
} Mainview;
|
||||||
|
|
||||||
|
typedef struct _Dateview
|
||||||
|
{
|
||||||
|
Evas_Object *box; //The main container of the view
|
||||||
|
Evas_Object *datetime; //A datetime widget
|
||||||
|
Evas_Object *lb_date; //A label
|
||||||
|
} Dateview;
|
||||||
|
|
||||||
|
typedef struct _Calview
|
||||||
|
{
|
||||||
|
Evas_Object *box; //The main container of the view
|
||||||
|
Evas_Object *calendar; //A calendar widget
|
||||||
|
Evas_Object *lb_cal; //A label widget
|
||||||
|
} Calview;
|
||||||
|
|
||||||
|
typedef struct _Setview
|
||||||
|
{
|
||||||
|
Evas_Object *box; //The main container of the view
|
||||||
|
Evas_Object *lb; //A label widget
|
||||||
|
} Setview;
|
||||||
|
|
||||||
|
typedef struct _Tbarmenu
|
||||||
|
{
|
||||||
|
Evas_Object *tb; //The toolbar
|
||||||
|
Elm_Object_Item *submenu; //The submenu item
|
||||||
|
} Tbarmenu;
|
||||||
|
|
||||||
|
typedef struct _Menu
|
||||||
|
{
|
||||||
|
Evas_Object* layout; // The "edje" layout
|
||||||
|
Evas_Object *nf; // The Naviframe to handle the views
|
||||||
|
Tbarmenu *menu; // The main menu
|
||||||
|
Tbarmenu *sidemenu; // The side menu
|
||||||
|
Mainview *main_view; // The main view
|
||||||
|
Calview *cal_view; // The calendar view
|
||||||
|
Dateview *date_view; // The date and time view
|
||||||
|
Setview *settings_view; //The settin view
|
||||||
|
|
||||||
|
Eina_Bool sdmenu_up; // A bool variable to keep the side menu status
|
||||||
|
} Menu;
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,196 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
#include <Emotion.h>
|
||||||
|
|
||||||
|
#define FILE "<pathToYourVideo>/big_buck_bunny_1080p_h264.mov"
|
||||||
|
|
||||||
|
static Evas_Object *nav;
|
||||||
|
static Eina_Bool info; //if displaying info item
|
||||||
|
|
||||||
|
/* Time position and duration update */
|
||||||
|
static void
|
||||||
|
_player_info_time_update(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *emotion = obj, *label = data;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
|
//switch on main item
|
||||||
|
if (!info)
|
||||||
|
{
|
||||||
|
evas_object_smart_callback_del(emotion, "position_update", _player_info_time_update);
|
||||||
|
evas_object_smart_callback_del(emotion, "length_change", _player_info_time_update);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update
|
||||||
|
double position = emotion_object_position_get(emotion);
|
||||||
|
double duration = emotion_object_play_length_get(emotion);
|
||||||
|
int p_sec = (int) position % 60;
|
||||||
|
int p_min = position / 60;
|
||||||
|
int p_hour = position / 3600;
|
||||||
|
int d_sec = (int) duration % 60;
|
||||||
|
int d_min = duration / 60;
|
||||||
|
int d_hour = duration / 3600;
|
||||||
|
snprintf(buf, sizeof(buf), "%d:%02d:%02d / %d:%02d:%02d", p_hour, p_min, p_sec, d_hour, d_min, d_sec);
|
||||||
|
elm_object_text_set(label, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get update status */
|
||||||
|
static void
|
||||||
|
_player_info_status_update(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *emotion = obj, *label = data;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
|
//switch on main item
|
||||||
|
if (!info)
|
||||||
|
{
|
||||||
|
evas_object_smart_callback_del(obj, "playback_finished", _player_info_status_update);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update
|
||||||
|
double position = emotion_object_position_get(emotion);
|
||||||
|
double duration = emotion_object_play_length_get(emotion);
|
||||||
|
if (emotion_object_play_get(emotion))
|
||||||
|
elm_object_text_set(label, "<b>Playing</b>");
|
||||||
|
else if (position < duration)
|
||||||
|
elm_object_text_set(label, "<b>Paused</b>");
|
||||||
|
else
|
||||||
|
elm_object_text_set(label, "<b>Ended</b>");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* del info item callback */
|
||||||
|
static Eina_Bool
|
||||||
|
_player_info_del_cb(void *data, Elm_Object_Item *it)
|
||||||
|
{
|
||||||
|
info = EINA_FALSE;
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* info callback */
|
||||||
|
static void
|
||||||
|
_player_info_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *video = data, *emotion;
|
||||||
|
Evas_Object *table, *label;
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
|
emotion = elm_video_emotion_get(video);
|
||||||
|
info = EINA_TRUE;
|
||||||
|
table = elm_table_add(obj);
|
||||||
|
elm_table_padding_set(table, 8, 8);
|
||||||
|
evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_show(table);
|
||||||
|
|
||||||
|
/* display the playing status in label */
|
||||||
|
label = elm_label_add(table);
|
||||||
|
evas_object_show(label);
|
||||||
|
_player_info_status_update(label, emotion, NULL);
|
||||||
|
elm_table_pack(table, label, 0, 0, 2, 1);
|
||||||
|
evas_object_smart_callback_add(emotion, "playback_finished", _player_info_status_update, label);
|
||||||
|
|
||||||
|
/* get the file name and location */
|
||||||
|
//set file label
|
||||||
|
label = elm_label_add(table);
|
||||||
|
elm_object_text_set(label, "File:");
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 0, 1, 1, 1);
|
||||||
|
|
||||||
|
//set file name label
|
||||||
|
const char *file = emotion_object_file_get(emotion);
|
||||||
|
label = elm_label_add(table);
|
||||||
|
elm_object_text_set(label, ecore_file_file_get(file));
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 1, 1, 1, 1);
|
||||||
|
|
||||||
|
//set location label
|
||||||
|
label = elm_label_add(table);
|
||||||
|
elm_object_text_set(label, "Location:");
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 0, 2, 1, 1);
|
||||||
|
|
||||||
|
//set location path label
|
||||||
|
label = elm_label_add(table);
|
||||||
|
elm_object_text_set(label, ecore_file_dir_get(file));
|
||||||
|
elm_object_text_set(label,"/home/efl/videos");
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 1, 2, 1, 1);
|
||||||
|
|
||||||
|
/* get the video position and duration */
|
||||||
|
//set time label
|
||||||
|
label = elm_label_add(table);
|
||||||
|
elm_object_text_set(label, "Time:");
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 0, 3, 1, 1);
|
||||||
|
|
||||||
|
//set position-duration label
|
||||||
|
label = elm_label_add(table);
|
||||||
|
double position = elm_video_play_position_get(video);
|
||||||
|
double duration = elm_video_play_length_get(video);
|
||||||
|
int p_sec = (int) position % 60;
|
||||||
|
int p_min = position / 60;
|
||||||
|
int p_hour = position / 3600;
|
||||||
|
int d_sec = (int) duration % 60;
|
||||||
|
int d_min = duration / 60;
|
||||||
|
int d_hour = duration / 3600;
|
||||||
|
snprintf(buf, sizeof(buf), "%d:%02d:%02d / %d:%02d:%02d", p_hour, p_min, p_sec, d_hour, d_min, d_sec);
|
||||||
|
elm_object_text_set(label, buf);
|
||||||
|
elm_table_pack(table, label, 1, 3, 1, 1);
|
||||||
|
evas_object_show(label);
|
||||||
|
evas_object_smart_callback_add(emotion, "position_update", _player_info_time_update, label);
|
||||||
|
evas_object_smart_callback_add(emotion, "length_change", _player_info_time_update, label);
|
||||||
|
|
||||||
|
/* get the video dimensions */
|
||||||
|
label = elm_label_add(table);
|
||||||
|
elm_object_text_set(label, "Size:");
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 0, 4, 1, 1);
|
||||||
|
label = elm_label_add(table);
|
||||||
|
int w, h;
|
||||||
|
emotion_object_size_get(emotion, &w, &h);
|
||||||
|
snprintf(buf, sizeof(buf), "%d × %d", w, h);
|
||||||
|
elm_object_text_set(label, buf);
|
||||||
|
evas_object_show(label);
|
||||||
|
elm_table_pack(table, label, 1, 4, 1, 1);
|
||||||
|
|
||||||
|
/* push info in a separate naviframe item */
|
||||||
|
Elm_Object_Item *it = elm_naviframe_item_push(nav, "Information", NULL, NULL, table, NULL);
|
||||||
|
elm_naviframe_item_pop_cb_set(it, _player_info_del_cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
info = EINA_FALSE;
|
||||||
|
win = elm_win_util_standard_add("main", "Multimedia Tutorial");
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
nav = elm_naviframe_add(win);
|
||||||
|
evas_object_size_hint_weight_set(nav, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, nav);
|
||||||
|
evas_object_show(nav);
|
||||||
|
|
||||||
|
Evas_Object *video;
|
||||||
|
video = elm_video_add(win);
|
||||||
|
evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_video_file_set(video, FILE);
|
||||||
|
elm_video_play(video);
|
||||||
|
evas_object_show(video);
|
||||||
|
|
||||||
|
Evas_Object *player;
|
||||||
|
player = elm_player_add(win);
|
||||||
|
evas_object_size_hint_weight_set(player, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_object_content_set(player, video);
|
||||||
|
evas_object_smart_callback_add(player, "info,clicked", _player_info_cb, video);
|
||||||
|
evas_object_show(player);
|
||||||
|
|
||||||
|
Elm_Object_Item *it = elm_naviframe_item_push(nav, "Video", NULL, NULL, player, NULL);
|
||||||
|
elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
|
||||||
|
|
||||||
|
elm_run();
|
||||||
|
elm_shutdown();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,227 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
#define __UNUSED__ __attribute__((__unused__))
|
||||||
|
|
||||||
|
// NOTE: A zipper is a datastructure for an ordered set of elements and a
|
||||||
|
// cursor in this set, meaning there are elements before the cursor (which are
|
||||||
|
// stored inside the naviframe) and after (which are stored in the "popped"
|
||||||
|
// list.
|
||||||
|
struct naviframe_zipper
|
||||||
|
{
|
||||||
|
Evas_Object *naviframe;
|
||||||
|
Eina_List *popped;
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct naviframe_zipper *
|
||||||
|
_naviframe_add(Evas_Object *parent)
|
||||||
|
{
|
||||||
|
struct naviframe_zipper *z = malloc(sizeof(struct naviframe_zipper));
|
||||||
|
z->naviframe = elm_naviframe_add(parent);
|
||||||
|
z->popped = NULL;
|
||||||
|
|
||||||
|
evas_object_size_hint_weight_set(z->naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(z->naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(z->naviframe);
|
||||||
|
// By default, objects are destroyed when they are popped from the naviframe
|
||||||
|
// To save and re-use them, enable "preserve_on_pop"
|
||||||
|
elm_naviframe_content_preserve_on_pop_set(z->naviframe, EINA_TRUE);
|
||||||
|
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
// forward declaration of the _button function since there is a circular
|
||||||
|
// reference below
|
||||||
|
static Evas_Object * _button(struct naviframe_zipper *, int direction);
|
||||||
|
|
||||||
|
// Save the element that is popped from the naviframe
|
||||||
|
// callback of the prev button
|
||||||
|
static void
|
||||||
|
_naviframe_prev(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
struct naviframe_zipper *z = data;
|
||||||
|
//if more than one item push in naviframe
|
||||||
|
if (elm_naviframe_bottom_item_get(z->naviframe) != elm_naviframe_top_item_get(z->naviframe))
|
||||||
|
{
|
||||||
|
z->popped = eina_list_prepend(z->popped, elm_naviframe_item_pop(z->naviframe));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the first element after the current one available and push it to the
|
||||||
|
// naviframe
|
||||||
|
// callback of the next button
|
||||||
|
static void
|
||||||
|
_naviframe_next(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
struct naviframe_zipper *z = data;
|
||||||
|
Evas_Object *label, *prev, *next;
|
||||||
|
const char *text;
|
||||||
|
Elm_Object_Item *it;
|
||||||
|
|
||||||
|
label = eina_list_data_get(z->popped);
|
||||||
|
z->popped = eina_list_remove_list(z->popped, z->popped);
|
||||||
|
if (label != NULL)
|
||||||
|
{
|
||||||
|
// The widget is saved inside the naviframe but nothing more; we need
|
||||||
|
// to create new buttons and set the title text again (copy the one
|
||||||
|
// from the label that is saved).
|
||||||
|
text = elm_object_text_get(label);
|
||||||
|
// The _button function creates a button which is either "Previous" (-1) or
|
||||||
|
// "Next" (1)
|
||||||
|
prev = _button(z, -1);
|
||||||
|
next = _button(z, 1);
|
||||||
|
it = elm_naviframe_item_push(z->naviframe, text, prev, next, label, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build either a "Previous" or a "Next" button
|
||||||
|
static Evas_Object *
|
||||||
|
_button(struct naviframe_zipper *z, int direction)
|
||||||
|
{
|
||||||
|
Evas_Object *button;
|
||||||
|
Evas_Smart_Cb callback;
|
||||||
|
const char *text;
|
||||||
|
if (direction < 0)
|
||||||
|
{
|
||||||
|
text = "Previous";
|
||||||
|
callback = _naviframe_prev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
text = "Next";
|
||||||
|
callback = _naviframe_next;
|
||||||
|
}
|
||||||
|
button = elm_button_add(z->naviframe);
|
||||||
|
elm_object_text_set(button, text);
|
||||||
|
evas_object_smart_callback_add(button, "clicked", callback, z);
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generic naviframe-populate function:
|
||||||
|
// Its third (and last) parameter is a callback for customization, i.e. pushes
|
||||||
|
// the new items to a specific position; it returns a "context" value that is
|
||||||
|
// used between its calls and enables behaviors such as "push after the
|
||||||
|
// previously-pushed item"
|
||||||
|
static struct naviframe_zipper*
|
||||||
|
_naviframe_populate_gen(Evas_Object *parent, const char *id,
|
||||||
|
void * (*populate_cb) (Evas_Object *nav, const char *title, Evas_Object
|
||||||
|
*prev, Evas_Object *next, Evas_Object *label, Elm_Object_Item *context)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
struct naviframe_zipper *z;
|
||||||
|
Evas_Object *label,*label2, *prev, *next;
|
||||||
|
Elm_Object_Item *context = NULL;
|
||||||
|
char buf[256];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
z = _naviframe_add(parent);
|
||||||
|
|
||||||
|
for (i = 0; i < 20; i++)
|
||||||
|
{
|
||||||
|
label = elm_label_add(z->naviframe);
|
||||||
|
label2 = elm_label_add(z->naviframe);
|
||||||
|
snprintf(buf, sizeof(buf), "%s [%d]", id, i);
|
||||||
|
elm_object_text_set(label, buf);
|
||||||
|
evas_object_show(label);
|
||||||
|
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
// The _button function creates a button which is either "Previous" (-1) or
|
||||||
|
// "Next" (1)
|
||||||
|
prev = _button(z, -1);
|
||||||
|
next = _button(z, 1);
|
||||||
|
// Use the populate_cb callback to provide the customization of the way the
|
||||||
|
// elements are added inside the naviframe
|
||||||
|
context = populate_cb(z->naviframe, buf, prev, next, label, context);
|
||||||
|
}
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Push items one after the other
|
||||||
|
static Elm_Object_Item *
|
||||||
|
_populate_cb__push(Evas_Object *nav, const char *title,
|
||||||
|
Evas_Object *prev, Evas_Object *next, Evas_Object *label,
|
||||||
|
Elm_Object_Item *context)
|
||||||
|
{
|
||||||
|
return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Push items one after the other but use insert_after for it
|
||||||
|
static Elm_Object_Item *
|
||||||
|
_populate_cb__push_then_insert_after(Evas_Object *nav, const char *title,
|
||||||
|
Evas_Object *prev, Evas_Object *next, Evas_Object *label,
|
||||||
|
Elm_Object_Item *context)
|
||||||
|
{
|
||||||
|
if (context == NULL)
|
||||||
|
{
|
||||||
|
return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return elm_naviframe_item_insert_after(nav, context, title, prev, next, label, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Push one item and repeatedly insert new items before the last inserted
|
||||||
|
// item
|
||||||
|
static Elm_Object_Item *
|
||||||
|
_populate_cb__push_then_insert_before(Evas_Object *nav, const char *title,
|
||||||
|
Evas_Object *prev, Evas_Object *next, Evas_Object *label,
|
||||||
|
Elm_Object_Item *context)
|
||||||
|
{
|
||||||
|
if (context == NULL)
|
||||||
|
{
|
||||||
|
return elm_naviframe_item_push(nav, title, prev, next, label, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return elm_naviframe_item_insert_before(nav, context, title, prev, next, label, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_delete_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
struct naviframe_zipper **z = data;
|
||||||
|
free(*z);
|
||||||
|
free(*(z+1));
|
||||||
|
free(*(z+2));
|
||||||
|
free(z);
|
||||||
|
evas_object_del(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Naviframe", "Naviframe Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
|
||||||
|
Evas_Object *box;
|
||||||
|
struct naviframe_zipper **z = malloc(3*sizeof(struct naviframe_zipper *));
|
||||||
|
|
||||||
|
box = elm_box_add(win);
|
||||||
|
elm_box_horizontal_set(box, EINA_FALSE);
|
||||||
|
elm_box_homogeneous_set(box, EINA_TRUE);
|
||||||
|
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(box);
|
||||||
|
elm_win_resize_object_add(win, box);
|
||||||
|
|
||||||
|
z[0] = _naviframe_populate_gen(win, "Before", (void *)_populate_cb__push_then_insert_before);
|
||||||
|
elm_box_pack_end(box, (*z)->naviframe);
|
||||||
|
|
||||||
|
z[1] = _naviframe_populate_gen(win, "After", (void *)_populate_cb__push_then_insert_after);
|
||||||
|
elm_box_pack_end(box, (*(z+1))->naviframe);
|
||||||
|
|
||||||
|
z[2] = _naviframe_populate_gen(win, "Push", (void *)_populate_cb__push);
|
||||||
|
elm_box_pack_end(box, (*(z+2))->naviframe);
|
||||||
|
|
||||||
|
evas_object_smart_callback_add(win, "delete,request", _delete_cb, z);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,116 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
// clicked callback
|
||||||
|
static void
|
||||||
|
_clicked_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
printf("Clicked\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// press callback
|
||||||
|
static void
|
||||||
|
_press_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
printf("Pressed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// unpress callback
|
||||||
|
static void
|
||||||
|
_unpress_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
printf("Unpressed, size : %f\n", elm_panes_content_left_size_get(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
// double clicked callback
|
||||||
|
static void
|
||||||
|
_clicked_double_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
static double size = 0.0;
|
||||||
|
double tmp_size = 0.0;
|
||||||
|
tmp_size = elm_panes_content_left_size_get(obj);
|
||||||
|
if (tmp_size > 0)
|
||||||
|
{
|
||||||
|
elm_panes_content_left_size_set(obj, 0.0);
|
||||||
|
printf("Double clicked, hidden.\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
elm_panes_content_left_size_set(obj, size);
|
||||||
|
printf("Double clicked, restoring size.\n");
|
||||||
|
}
|
||||||
|
size = tmp_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Panes", "Panes Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
Evas_Object *panes, *panes_h, *bt;
|
||||||
|
|
||||||
|
// Add an elm_panes
|
||||||
|
panes = elm_panes_add(win);
|
||||||
|
evas_object_size_hint_weight_set(panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, panes);
|
||||||
|
evas_object_show(panes);
|
||||||
|
|
||||||
|
// Add a horizontal elm_panes
|
||||||
|
panes_h = elm_panes_add(win);
|
||||||
|
elm_panes_horizontal_set(panes_h, EINA_TRUE);
|
||||||
|
elm_object_part_content_set(panes, "left", panes_h);
|
||||||
|
|
||||||
|
// Create a button object
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "Right");
|
||||||
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
// and set it to the "right" part of the vertical Panes
|
||||||
|
elm_object_part_content_set(panes, "right", bt);
|
||||||
|
|
||||||
|
// Create a "Up" button
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "Up");
|
||||||
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(bt);
|
||||||
|
elm_object_part_content_set(panes_h, "left", bt);
|
||||||
|
|
||||||
|
// Create a "Down" button
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "Down");
|
||||||
|
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(bt);
|
||||||
|
elm_object_part_content_set(panes_h, "right", bt);
|
||||||
|
|
||||||
|
// Set the proportion of the panes to 80%
|
||||||
|
elm_panes_content_left_size_set(panes, 0.8);
|
||||||
|
elm_panes_content_left_size_set(panes_h, 0.8);
|
||||||
|
|
||||||
|
//panes callbacks
|
||||||
|
evas_object_smart_callback_add(panes, "clicked", _clicked_cb, panes);
|
||||||
|
evas_object_smart_callback_add(panes, "press", _press_cb, panes);
|
||||||
|
evas_object_smart_callback_add(panes, "unpress", _unpress_cb, panes);
|
||||||
|
evas_object_smart_callback_add(panes, "clicked,double", _clicked_double_cb,
|
||||||
|
panes);
|
||||||
|
|
||||||
|
//panes_h callbacks
|
||||||
|
evas_object_smart_callback_add(panes_h, "clicked", _clicked_cb, panes_h);
|
||||||
|
evas_object_smart_callback_add(panes_h, "press", _press_cb, panes_h);
|
||||||
|
evas_object_smart_callback_add(panes_h, "unpress", _unpress_cb, panes_h);
|
||||||
|
evas_object_smart_callback_add(panes_h, "clicked,double", _clicked_double_cb,
|
||||||
|
panes_h);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,57 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
_popup_close_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Evas_Object *popup = data;
|
||||||
|
//delete popup
|
||||||
|
evas_object_del(popup);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_btn_click_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
// Add an elm popup
|
||||||
|
Evas_Object *popup;
|
||||||
|
Evas_Object *btn;
|
||||||
|
|
||||||
|
popup = elm_popup_add(data);
|
||||||
|
elm_object_text_set(popup, "This Popup has content area and "
|
||||||
|
"action area set, action area has one button Close");
|
||||||
|
|
||||||
|
// popup buttons
|
||||||
|
btn = elm_button_add(popup);
|
||||||
|
elm_object_text_set(btn, "Close");
|
||||||
|
elm_object_part_content_set(popup, "button1", btn);
|
||||||
|
evas_object_smart_callback_add(btn, "clicked", _popup_close_cb, popup);
|
||||||
|
|
||||||
|
// popup show should be called after adding all the contents and the buttons
|
||||||
|
// of popup to set the focus into popup's contents correctly.
|
||||||
|
evas_object_show(popup);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *btn;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("Popup", "Popup Tutorial");
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
//win 400x400 px
|
||||||
|
evas_object_resize(win, 400, 400);
|
||||||
|
|
||||||
|
btn = elm_button_add(win);
|
||||||
|
elm_object_text_set(btn, "popup");
|
||||||
|
evas_object_resize(btn, 100, 50);
|
||||||
|
evas_object_move(btn, 150, 150);
|
||||||
|
evas_object_show(btn);
|
||||||
|
evas_object_smart_callback_add(btn, "clicked", _btn_click_cb, win);
|
||||||
|
|
||||||
|
evas_object_show(win);
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
|
@ -0,0 +1,82 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
_save_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *prefs;
|
||||||
|
Evas_Object *label;
|
||||||
|
prefs = obj;
|
||||||
|
label = (Evas_Object *) elm_prefs_item_object_get(prefs, "main:label");
|
||||||
|
elm_object_text_set(label, "<i>Preferences have been saved.</i>");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_action_cb(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *prefs;
|
||||||
|
Elm_Prefs_Data *prefs_data;
|
||||||
|
Elm_Prefs_Item_Type type;
|
||||||
|
Eina_Value value;
|
||||||
|
int value_int = -1;
|
||||||
|
Evas_Object *button;
|
||||||
|
char buf[64];
|
||||||
|
prefs = obj;
|
||||||
|
prefs_data = elm_prefs_data_get(prefs);
|
||||||
|
if (elm_prefs_data_value_get(prefs_data, "main:universe", &type, &value))
|
||||||
|
{
|
||||||
|
eina_value_get(&value, &value_int);
|
||||||
|
snprintf(buf, sizeof(buf), "Value: %d", value_int);
|
||||||
|
button = (Evas_Object *) elm_prefs_item_object_get(prefs, "main:buttons:action");
|
||||||
|
elm_object_text_set(button, buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void
|
||||||
|
_changed_cb(void *data, Elm_Prefs_Data_Event_Type type, Elm_Prefs_Data *prefs_data, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Object *prefs;
|
||||||
|
Elm_Prefs_Data_Event_Changed *event;
|
||||||
|
int value_int;
|
||||||
|
Evas_Object *label;
|
||||||
|
char buf[64];
|
||||||
|
prefs = data;
|
||||||
|
event = event_info;
|
||||||
|
if (strcmp(event->key, "main:another")) return;
|
||||||
|
eina_value_get(event->value, &value_int);
|
||||||
|
snprintf(buf, sizeof(buf), "Spinner: %d", value_int);
|
||||||
|
label = (Evas_Object *) elm_prefs_item_object_get(prefs, "main:label");
|
||||||
|
elm_object_text_set(label, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
EAPI_MAIN int
|
||||||
|
elm_main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *conform;
|
||||||
|
win = elm_win_util_standard_add("main", "Preferences Tutorial");
|
||||||
|
elm_win_conformant_set(win, EINA_TRUE);
|
||||||
|
evas_object_show(win);
|
||||||
|
evas_object_resize(win, 480, 800);
|
||||||
|
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
|
||||||
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
conform = elm_conformant_add(win);
|
||||||
|
evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, conform);
|
||||||
|
evas_object_show(conform);
|
||||||
|
Evas_Object *prefs;
|
||||||
|
prefs = elm_prefs_add(win);
|
||||||
|
evas_object_size_hint_weight_set(prefs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_object_content_set(conform, prefs);
|
||||||
|
evas_object_show(prefs);
|
||||||
|
elm_prefs_autosave_set(prefs, EINA_FALSE);
|
||||||
|
elm_prefs_file_set(prefs, "preference.epb", NULL);
|
||||||
|
Elm_Prefs_Data *prefs_data;
|
||||||
|
prefs_data = elm_prefs_data_new("preference.cfg", NULL, EET_FILE_MODE_READ_WRITE);
|
||||||
|
elm_prefs_data_set(prefs, prefs_data);
|
||||||
|
evas_object_smart_callback_add(prefs, "page,saved", _save_cb, NULL);
|
||||||
|
evas_object_smart_callback_add(prefs, "action", _action_cb, NULL);
|
||||||
|
elm_prefs_data_event_callback_add(prefs_data, ELM_PREFS_DATA_EVENT_ITEM_CHANGED, _changed_cb, prefs);
|
||||||
|
elm_run();
|
||||||
|
elm_shutdown();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
ELM_MAIN()
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
collection {
|
||||||
|
//! [page_main_head]
|
||||||
|
page {
|
||||||
|
name: "main";
|
||||||
|
version: 1;
|
||||||
|
title: "Main preferences";
|
||||||
|
subtitle: "Some preferences";
|
||||||
|
widget: "elm/vertical_box";
|
||||||
|
//! [page_main_head]
|
||||||
|
items {
|
||||||
|
//! [item_int]
|
||||||
|
item {
|
||||||
|
name: "universe";
|
||||||
|
type: INT;
|
||||||
|
label: "Ultimate Answer of Life, the Universe and Everything";
|
||||||
|
editable: 1;
|
||||||
|
int {
|
||||||
|
min: 0;
|
||||||
|
max: 100;
|
||||||
|
default: 42;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [item_int]
|
||||||
|
//! [item_int_spinner]
|
||||||
|
item {
|
||||||
|
name: "another";
|
||||||
|
type: INT;
|
||||||
|
label: "Spinner";
|
||||||
|
widget: "elm/spinner";
|
||||||
|
int {
|
||||||
|
min: -50;
|
||||||
|
max: 200;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [item_int_spinner]
|
||||||
|
//! [item_float]
|
||||||
|
item {
|
||||||
|
name: "floating";
|
||||||
|
type: FLOAT;
|
||||||
|
editable: 1;
|
||||||
|
label: "floating value";
|
||||||
|
float {
|
||||||
|
default: 0.6;
|
||||||
|
min: 0;
|
||||||
|
max: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [item_float]
|
||||||
|
//! [item_bool]
|
||||||
|
item {
|
||||||
|
name: "boolean";
|
||||||
|
type: BOOL;
|
||||||
|
label: "Check here";
|
||||||
|
bool {
|
||||||
|
default: true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [item_bool]
|
||||||
|
//! [item_display]
|
||||||
|
item {
|
||||||
|
name: "sep";
|
||||||
|
type: SEPARATOR;
|
||||||
|
}
|
||||||
|
item {
|
||||||
|
name: "label";
|
||||||
|
type: LABEL;
|
||||||
|
label: "Some other preferences…";
|
||||||
|
}
|
||||||
|
//! [item_display]
|
||||||
|
//! [item_text]
|
||||||
|
item {
|
||||||
|
name: "text";
|
||||||
|
type: TEXT;
|
||||||
|
editable: 1;
|
||||||
|
text {
|
||||||
|
placeholder: "Enter some text here.";
|
||||||
|
default: "default";
|
||||||
|
deny: "^[0-9]*$";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [item_text]
|
||||||
|
//! [item_date]
|
||||||
|
item {
|
||||||
|
name: "date";
|
||||||
|
type: DATE;
|
||||||
|
label: "First EFL Developer Day";
|
||||||
|
date {
|
||||||
|
default: 2012 11 05;
|
||||||
|
min: 1980 11 1;
|
||||||
|
max: 2200 12 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [item_date]
|
||||||
|
item {
|
||||||
|
name: "sep";
|
||||||
|
type: SEPARATOR;
|
||||||
|
}
|
||||||
|
//! [item_page]
|
||||||
|
item {
|
||||||
|
name: "buttons";
|
||||||
|
type: PAGE;
|
||||||
|
source: "buttons";
|
||||||
|
}
|
||||||
|
//! [item_page]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [page_buttons]
|
||||||
|
page {
|
||||||
|
name: "buttons";
|
||||||
|
version: 1;
|
||||||
|
title: "Actions";
|
||||||
|
widget: "elm/horizontal_box";
|
||||||
|
items {
|
||||||
|
item {
|
||||||
|
name: "save";
|
||||||
|
type: SAVE;
|
||||||
|
label: "Save";
|
||||||
|
}
|
||||||
|
item {
|
||||||
|
name: "reset";
|
||||||
|
type: RESET;
|
||||||
|
label: "Reset";
|
||||||
|
}
|
||||||
|
item {
|
||||||
|
name: "action";
|
||||||
|
type: ACTION;
|
||||||
|
label: "Action!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [page_buttons]
|
||||||
|
}
|
After Width: | Height: | Size: 197 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 826 B |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 11 KiB |
|
@ -0,0 +1,216 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="120"
|
||||||
|
height="100"
|
||||||
|
viewBox="0 0 120 100"
|
||||||
|
id="svg2"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.91 r13725"
|
||||||
|
sodipodi:docname="diagram-block-efl.svg"
|
||||||
|
inkscape:export-filename="/home/raster/C/wc/media/diagram-block-efl.png"
|
||||||
|
inkscape:export-xdpi="270"
|
||||||
|
inkscape:export-ydpi="270">
|
||||||
|
<defs
|
||||||
|
id="defs4" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#404040"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="10.59246"
|
||||||
|
inkscape:cx="71.183579"
|
||||||
|
inkscape:cy="54.339412"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="true"
|
||||||
|
units="px"
|
||||||
|
objecttolerance="20"
|
||||||
|
guidetolerance="20"
|
||||||
|
gridtolerance="50"
|
||||||
|
showguides="false"
|
||||||
|
inkscape:snap-bbox="true"
|
||||||
|
inkscape:bbox-paths="true"
|
||||||
|
inkscape:bbox-nodes="true"
|
||||||
|
inkscape:snap-bbox-edge-midpoints="true"
|
||||||
|
inkscape:snap-bbox-midpoints="true"
|
||||||
|
inkscape:snap-grids="true"
|
||||||
|
inkscape:snap-to-guides="false"
|
||||||
|
inkscape:window-width="2042"
|
||||||
|
inkscape:window-height="1638"
|
||||||
|
inkscape:window-x="2977"
|
||||||
|
inkscape:window-y="212"
|
||||||
|
inkscape:window-maximized="0">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid4136"
|
||||||
|
spacingx="1"
|
||||||
|
spacingy="1"
|
||||||
|
empspacing="10"
|
||||||
|
units="px"
|
||||||
|
dotted="false" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata7">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-952.36216)">
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#3399ff;fill-opacity:0.25098039;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4144-5"
|
||||||
|
width="26"
|
||||||
|
height="19.999979"
|
||||||
|
x="92"
|
||||||
|
y="954.36218" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#3399ff;fill-opacity:0.50196078;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4144"
|
||||||
|
width="15.931442"
|
||||||
|
height="19.999979"
|
||||||
|
x="74"
|
||||||
|
y="954.36218" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#3399ff;fill-opacity:0.50196078;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4144-1-4"
|
||||||
|
width="32.068558"
|
||||||
|
height="19.999979"
|
||||||
|
x="40"
|
||||||
|
y="954.36218" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#3399ff;fill-opacity:0.69019608;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4144-1"
|
||||||
|
width="36.034576"
|
||||||
|
height="19.999979"
|
||||||
|
x="1.9654238"
|
||||||
|
y="954.36218" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4144-8"
|
||||||
|
width="115.9239"
|
||||||
|
height="19.999979"
|
||||||
|
x="2.0761015"
|
||||||
|
y="976.52509" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4140"
|
||||||
|
width="116"
|
||||||
|
height="29.858479"
|
||||||
|
x="2"
|
||||||
|
y="998.50366" />
|
||||||
|
<rect
|
||||||
|
style="opacity:1;fill:#606060;fill-opacity:1;stroke:none;stroke-width:35.40000153;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:0;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||||
|
id="rect4138"
|
||||||
|
width="115.91983"
|
||||||
|
height="20"
|
||||||
|
x="2"
|
||||||
|
y="1030.3622" />
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="38.779495"
|
||||||
|
y="1042.1505"
|
||||||
|
id="text4161"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan4163"
|
||||||
|
x="38.779495"
|
||||||
|
y="1042.1505"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:5px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';fill:#ffffff;fill-opacity:1">Base OS + GFX etc.</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="55.882568"
|
||||||
|
y="1015.2176"
|
||||||
|
id="text4161-1"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan4163-8"
|
||||||
|
x="55.882568"
|
||||||
|
y="1015.2176"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:5px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light'">EFL</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="47.129116"
|
||||||
|
y="987.82391"
|
||||||
|
id="text4161-1-6"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan4163-8-5"
|
||||||
|
x="47.129116"
|
||||||
|
y="987.82391"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:5px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light'">Elementary</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="3.4446261"
|
||||||
|
y="965.66101"
|
||||||
|
id="text4161-1-6-9"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
id="tspan4163-8-5-5"
|
||||||
|
x="3.4446261"
|
||||||
|
y="965.66101"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:5px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';fill:#ffffff;fill-opacity:1">Enlightenment</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="42.169533"
|
||||||
|
y="965.66101"
|
||||||
|
id="text4161-1-6-9-7"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
x="42.169533"
|
||||||
|
y="965.66101"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:5px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';fill:#ffffff;fill-opacity:1"
|
||||||
|
id="tspan4237">Terminology</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="76.368797"
|
||||||
|
y="965.54626"
|
||||||
|
id="text4161-1-6-9-7-6"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
x="76.368797"
|
||||||
|
y="965.54626"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:5px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';fill:#ffffff;fill-opacity:1"
|
||||||
|
id="tspan4237-2">Rage</tspan></text>
|
||||||
|
<text
|
||||||
|
xml:space="preserve"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8px;line-height:125%;font-family:Elegante;-inkscape-font-specification:Elegante;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
x="100.96191"
|
||||||
|
y="965.97961"
|
||||||
|
id="text4161-1-6-9-7-6-6"
|
||||||
|
sodipodi:linespacing="125%"><tspan
|
||||||
|
sodipodi:role="line"
|
||||||
|
x="100.96191"
|
||||||
|
y="965.97961"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:6.25px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans Light';fill:#ffffff;fill-opacity:1"
|
||||||
|
id="tspan4237-2-4"><tspan
|
||||||
|
style="font-size:5px"
|
||||||
|
id="tspan4155">etc</tspan>.</tspan></text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 226 KiB |
After Width: | Height: | Size: 228 KiB |
After Width: | Height: | Size: 249 KiB |
After Width: | Height: | Size: 250 KiB |
After Width: | Height: | Size: 257 KiB |
After Width: | Height: | Size: 558 B |
After Width: | Height: | Size: 254 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.6 KiB |