edje_codegen: Making the example uses the externals code

SVN revision: 76992
This commit is contained in:
Flavio Vinicius Alvares Ceolin 2012-09-21 17:34:09 +00:00
parent 8214538527
commit 675d863dc3
2 changed files with 46 additions and 17 deletions

View File

@ -1,22 +1,11 @@
collections {
group {
name: "sel_group";
parts {
part {
name: "rect";
type: RECT;
description {
state: "default" 0.0;
color: 0 255 0 255; /* green */
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.0;
}
}
externals { /* declare the modules you want to load */
external: "elm"; /* toolkit/widgets */
}
}
group {
name: "example_group";
max: 500 500;
min: 50 50;
styles {
@ -55,7 +44,7 @@ collections {
min: 50 50;
state: "default" 0.0;
rel1.relative: 0.0 0.3;
rel2.relative: 1.0 0.6;
rel2.relative: 0.3 0.6;
}
}
@ -82,6 +71,19 @@ collections {
rel2.relative: 1.0 1.0;
}
}
part {
name: "part_five";
type: EXTERNAL;
source: "elm/button";
api: "part_five" "An elm button using externals";
description {
state: "default" 0.0;
rel1.relative: 0.9 0.5;
rel2.relative: 1.0 0.6;
params.string: "icon" "apps";
}
}
}
programs {

View File

@ -60,6 +60,7 @@ _on_mouse_over(void *data, Evas_Object *obj, const char *emission,
const char *source)
{
Evas_Object *rect;
Eina_Bool disabled;
static int i = 0;
printf("Mouse over, source: %s - emission: %s\n",
@ -78,6 +79,15 @@ _on_mouse_over(void *data, Evas_Object *obj, const char *emission,
codegen_example_part_four_clear(obj, EINA_TRUE);
_columns_rows_print(obj);
codegen_example_part_three_remove_all(obj, EINA_TRUE);
part_five_part_five_disabled_set(obj, EINA_TRUE);
if (part_five_part_five_disabled_get(obj, &disabled))
if (disabled)
fprintf(stdout, "Button is disabled\n");
else
fprintf(stdout, "Button is enabled\n");
else
fprintf(stderr, "Couldn't check if the button is disabled\n");
}
}
@ -99,13 +109,14 @@ int
main(int argc, char *argv[])
{
char edje_file_path[PATH_MAX];
const char *edje_file = "codegen.edj";
const char *edje_file = "codegen.edj", *aux;
Ecore_Evas *ee;
Evas *evas;
Evas_Object *bg;
Evas_Object *edje_obj;
Evas_Object *red_rect, *yellow_rect, *blue_rect, *rects[4];
Eina_Prefix *pfx;
Eina_Bool disabled;
if (!ecore_evas_init())
return EXIT_FAILURE;
@ -177,6 +188,22 @@ main(int argc, char *argv[])
if (!codegen_example_part_four_pack(edje_obj, rects[3], 1, 1, 1, 1))
fprintf(stderr, "Cannot add the rectangle 4 to table\n");
if (!part_five_part_five_label_set(edje_obj, "new label"))
fprintf(stderr, "Cannot set the label of the button\n");
if (part_five_part_five_label_get(edje_obj, &aux))
fprintf(stdout, "Label contents: %s\n", aux);
else
fprintf(stderr, "Couldn't get the label contents\n");
if (part_five_part_five_disabled_get(edje_obj, &disabled))
if (disabled)
fprintf(stdout, "Button is disabled\n");
else
fprintf(stdout, "Button is enabled\n");
else
fprintf(stderr, "Couldn't check if the button is disabled\n");
_columns_rows_print(edje_obj);
ecore_evas_show(ee);