diff options
author | David Walter Seikel | 2014-05-04 22:35:22 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-04 22:35:22 +1000 |
commit | f93abeb98d74b5dea266347e668aa6f88e96d83b (patch) | |
tree | 43b74eeccd136f357992432d76b9db75e27faa90 /src/extantz | |
parent | luaopen_widget is surplus to requirements. (diff) | |
download | SledjHamr-f93abeb98d74b5dea266347e668aa6f88e96d83b.zip SledjHamr-f93abeb98d74b5dea266347e668aa6f88e96d83b.tar.gz SledjHamr-f93abeb98d74b5dea266347e668aa6f88e96d83b.tar.bz2 SledjHamr-f93abeb98d74b5dea266347e668aa6f88e96d83b.tar.xz |
Combine eo_add() and eo_do(), plus related cleanups.
Diffstat (limited to 'src/extantz')
-rw-r--r-- | src/extantz/Evas_3D_demo.c | 237 | ||||
-rw-r--r-- | src/extantz/chat.c | 8 | ||||
-rw-r--r-- | src/extantz/extantz.c | 11 | ||||
-rw-r--r-- | src/extantz/files.c | 45 | ||||
-rw-r--r-- | src/extantz/woMan.c | 5 |
5 files changed, 137 insertions, 169 deletions
diff --git a/src/extantz/Evas_3D_demo.c b/src/extantz/Evas_3D_demo.c index 95b2f2f..f9a5c27 100644 --- a/src/extantz/Evas_3D_demo.c +++ b/src/extantz/Evas_3D_demo.c | |||
@@ -333,27 +333,24 @@ Eina_Bool _animate_scene(globals *ourGlobals) | |||
333 | static void | 333 | static void |
334 | _camera_setup(globals *ourGlobals, Scene_Data *scene) | 334 | _camera_setup(globals *ourGlobals, Scene_Data *scene) |
335 | { | 335 | { |
336 | scene->camera = eo_add(EVAS_3D_CAMERA_CLASS, ourGlobals->evas); | 336 | scene->camera = eo_add(EVAS_3D_CAMERA_CLASS, ourGlobals->evas, |
337 | eo_do(scene->camera, | ||
338 | evas_3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0) | 337 | evas_3d_camera_projection_perspective_set(60.0, 1.0, 1.0, 500.0) |
339 | ); | 338 | ); |
340 | 339 | ||
341 | scene->camera_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_CAMERA); | 340 | scene->camera_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_CAMERA); |
342 | eo_do(scene->camera_node, | 341 | eo_do(scene->camera_node, |
343 | evas_3d_node_camera_set(scene->camera) | 342 | evas_3d_node_camera_set(scene->camera), |
344 | ); | ||
345 | eo_do(scene->root_node, evas_3d_node_member_add(scene->camera_node)); | ||
346 | eo_do(scene->camera_node, | ||
347 | evas_3d_node_position_set(50.0, 0.0, 20.0), | 343 | evas_3d_node_position_set(50.0, 0.0, 20.0), |
348 | evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_3D_SPACE_PARENT, 0.0, 0.0, 1.0) | 344 | evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 20.0, EVAS_3D_SPACE_PARENT, 0.0, 0.0, 1.0) |
349 | ); | 345 | ); |
346 | |||
347 | eo_do(scene->root_node, evas_3d_node_member_add(scene->camera_node)); | ||
350 | } | 348 | } |
351 | 349 | ||
352 | static void | 350 | static void |
353 | _light_setup(globals *ourGlobals, Scene_Data *scene) | 351 | _light_setup(globals *ourGlobals, Scene_Data *scene) |
354 | { | 352 | { |
355 | scene->light = eo_add(EVAS_3D_LIGHT_CLASS, ourGlobals->evas); | 353 | scene->light = eo_add(EVAS_3D_LIGHT_CLASS, ourGlobals->evas, |
356 | eo_do(scene->light, | ||
357 | evas_3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), | 354 | evas_3d_light_ambient_set(1.0, 1.0, 1.0, 1.0), |
358 | evas_3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), | 355 | evas_3d_light_diffuse_set(1.0, 1.0, 1.0, 1.0), |
359 | evas_3d_light_specular_set(1.0, 1.0, 1.0, 1.0), | 356 | evas_3d_light_specular_set(1.0, 1.0, 1.0, 1.0), |
@@ -362,15 +359,13 @@ _light_setup(globals *ourGlobals, Scene_Data *scene) | |||
362 | 359 | ||
363 | scene->light_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_LIGHT); | 360 | scene->light_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_LIGHT); |
364 | eo_do(scene->light_node, | 361 | eo_do(scene->light_node, |
365 | evas_3d_node_light_set(scene->light) | 362 | evas_3d_node_light_set(scene->light), |
366 | ); | ||
367 | eo_do(scene->root_node, | ||
368 | evas_3d_node_member_add(scene->light_node) | ||
369 | ); | ||
370 | eo_do(scene->light_node, | ||
371 | evas_3d_node_position_set(1000.0, 0.0, 1000.0), | 363 | evas_3d_node_position_set(1000.0, 0.0, 1000.0), |
372 | evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0) | 364 | evas_3d_node_look_at_set(EVAS_3D_SPACE_PARENT, 0.0, 0.0, 0.0, EVAS_3D_SPACE_PARENT, 0.0, 1.0, 0.0) |
373 | ); | 365 | ); |
366 | |||
367 | eo_do(scene->root_node, evas_3d_node_member_add(scene->light_node)); | ||
368 | |||
374 | } | 369 | } |
375 | 370 | ||
376 | static void _cube_setup(globals *ourGlobals, Scene_Data *scene) | 371 | static void _cube_setup(globals *ourGlobals, Scene_Data *scene) |
@@ -378,10 +373,20 @@ static void _cube_setup(globals *ourGlobals, Scene_Data *scene) | |||
378 | char buf[PATH_MAX]; | 373 | char buf[PATH_MAX]; |
379 | 374 | ||
380 | // Setup cube materials. | 375 | // Setup cube materials. |
381 | scene->material0 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas); | 376 | scene->texture0 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, |
382 | scene->material1 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas); | 377 | evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels0[0]) |
378 | ); | ||
379 | |||
380 | scene->texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, | ||
381 | evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]) | ||
382 | ); | ||
383 | |||
384 | snprintf(buf, sizeof(buf), "%s/normal_lego.png", elm_app_data_dir_get()); | ||
385 | scene->texture_normal = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, | ||
386 | evas_3d_texture_file_set(buf, NULL) | ||
387 | ); | ||
383 | 388 | ||
384 | eo_do(scene->material0, | 389 | scene->material0 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas, |
385 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), | 390 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), |
386 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), | 391 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), |
387 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), | 392 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), |
@@ -390,10 +395,11 @@ static void _cube_setup(globals *ourGlobals, Scene_Data *scene) | |||
390 | evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0), | 395 | evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0), |
391 | evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0), | 396 | evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0), |
392 | evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0), | 397 | evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0), |
393 | evas_3d_material_shininess_set(100.0) | 398 | evas_3d_material_shininess_set(100.0), |
394 | ); | 399 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture0) |
400 | ); | ||
395 | 401 | ||
396 | eo_do(scene->material1, | 402 | scene->material1 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas, |
397 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), | 403 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), |
398 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), | 404 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), |
399 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), | 405 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), |
@@ -402,29 +408,14 @@ static void _cube_setup(globals *ourGlobals, Scene_Data *scene) | |||
402 | evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0), | 408 | evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0), |
403 | evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0), | 409 | evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0), |
404 | evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0), | 410 | evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0), |
405 | evas_3d_material_shininess_set(100.0) | 411 | evas_3d_material_shininess_set(100.0), |
406 | ); | ||
407 | 412 | ||
408 | scene->texture0 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas); | 413 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture1), |
409 | scene->texture1 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas); | 414 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL, scene->texture_normal) |
410 | scene->texture_normal = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas); | ||
411 | |||
412 | eo_do(scene->texture0, | ||
413 | evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels0[0]) | ||
414 | ); | 415 | ); |
415 | eo_do(scene->texture1, | ||
416 | evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]) | ||
417 | ); | ||
418 | snprintf(buf, sizeof(buf), "%s/normal_lego.png", elm_app_data_dir_get()); | ||
419 | eo_do(scene->texture_normal, evas_3d_texture_file_set(buf, NULL)); | ||
420 | |||
421 | eo_do(scene->material0, evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture0)); | ||
422 | eo_do(scene->material1, evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture1)); | ||
423 | eo_do(scene->material1, evas_3d_material_texture_set(EVAS_3D_MATERIAL_NORMAL, scene->texture_normal)); | ||
424 | 416 | ||
425 | // Setup CUBE mesh. | 417 | // Setup CUBE mesh. |
426 | scene->mesh = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas); | 418 | scene->mesh = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas, |
427 | eo_do(scene->mesh, | ||
428 | evas_3d_mesh_vertex_count_set(24), | 419 | evas_3d_mesh_vertex_count_set(24), |
429 | evas_3d_mesh_frame_add(0), | 420 | evas_3d_mesh_frame_add(0), |
430 | 421 | ||
@@ -443,13 +434,15 @@ static void _cube_setup(globals *ourGlobals, Scene_Data *scene) | |||
443 | evas_3d_mesh_frame_add(20), | 434 | evas_3d_mesh_frame_add(20), |
444 | evas_3d_mesh_frame_material_set(20, scene->material1) | 435 | evas_3d_mesh_frame_material_set(20, scene->material1) |
445 | ); | 436 | ); |
437 | |||
446 | scene->mesh_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_MESH); | 438 | scene->mesh_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_MESH); |
447 | eo_do(scene->root_node, evas_3d_node_member_add(scene->mesh_node)); | ||
448 | eo_do(scene->mesh_node, | 439 | eo_do(scene->mesh_node, |
449 | eo_key_data_set("Name", "cube", NULL), | 440 | eo_key_data_set("Name", "cube", NULL), |
450 | evas_3d_node_position_set(40.0, 3.5, 23.0), | 441 | evas_3d_node_position_set(40.0, 3.5, 23.0), |
451 | evas_3d_node_mesh_add(scene->mesh) | 442 | evas_3d_node_mesh_add(scene->mesh) |
452 | ); | 443 | ); |
444 | |||
445 | eo_do(scene->root_node, evas_3d_node_member_add(scene->mesh_node)); | ||
453 | } | 446 | } |
454 | 447 | ||
455 | static void _sonic_setup(globals *ourGlobals, Scene_Data *scene) | 448 | static void _sonic_setup(globals *ourGlobals, Scene_Data *scene) |
@@ -457,26 +450,14 @@ static void _sonic_setup(globals *ourGlobals, Scene_Data *scene) | |||
457 | char buf[PATH_MAX]; | 450 | char buf[PATH_MAX]; |
458 | 451 | ||
459 | // Setup an MD2 mesh. | 452 | // Setup an MD2 mesh. |
460 | scene->mesh2 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas); | ||
461 | snprintf(buf, sizeof(buf), "%s/sonic.md2", elm_app_data_dir_get()); | ||
462 | eo_do(scene->mesh2, | ||
463 | evas_3d_mesh_file_set(EVAS_3D_MESH_FILE_TYPE_MD2, buf, NULL) | ||
464 | ); | ||
465 | |||
466 | scene->material2 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas); | ||
467 | eo_do(scene->mesh2, | ||
468 | evas_3d_mesh_frame_material_set(0, scene->material2) | ||
469 | ); | ||
470 | |||
471 | scene->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas); | ||
472 | snprintf(buf, sizeof(buf), "%s/sonic.png", elm_app_data_dir_get()); | 453 | snprintf(buf, sizeof(buf), "%s/sonic.png", elm_app_data_dir_get()); |
473 | eo_do(scene->texture2, | 454 | scene->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, |
474 | evas_3d_texture_file_set(buf, NULL), | 455 | evas_3d_texture_file_set(buf, NULL), |
475 | evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST), | 456 | evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST), |
476 | evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT) | 457 | evas_3d_texture_wrap_set(EVAS_3D_WRAP_MODE_REPEAT, EVAS_3D_WRAP_MODE_REPEAT) |
477 | ); | 458 | ); |
478 | 459 | ||
479 | eo_do(scene->material2, | 460 | scene->material2 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas, |
480 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture2), | 461 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture2), |
481 | 462 | ||
482 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), | 463 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), |
@@ -490,18 +471,20 @@ static void _sonic_setup(globals *ourGlobals, Scene_Data *scene) | |||
490 | evas_3d_material_shininess_set(50.0) | 471 | evas_3d_material_shininess_set(50.0) |
491 | ); | 472 | ); |
492 | 473 | ||
493 | scene->mesh2_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_MESH); | 474 | snprintf(buf, sizeof(buf), "%s/sonic.md2", elm_app_data_dir_get()); |
494 | eo_do(scene->root_node, | 475 | scene->mesh2 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas, |
495 | evas_3d_node_member_add(scene->mesh2_node) | 476 | evas_3d_mesh_file_set(EVAS_3D_MESH_FILE_TYPE_MD2, buf, NULL), |
477 | evas_3d_mesh_frame_material_set(0, scene->material2), | ||
478 | evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG) | ||
496 | ); | 479 | ); |
480 | |||
481 | scene->mesh2_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_MESH); | ||
497 | eo_do(scene->mesh2_node, | 482 | eo_do(scene->mesh2_node, |
498 | eo_key_data_set("Name", "sonic", NULL), | 483 | eo_key_data_set("Name", "sonic", NULL), |
499 | evas_3d_node_mesh_add(scene->mesh2) | 484 | evas_3d_node_mesh_add(scene->mesh2) |
500 | ); | 485 | ); |
501 | 486 | ||
502 | eo_do(scene->mesh2, | 487 | eo_do(scene->root_node, evas_3d_node_member_add(scene->mesh2_node)); |
503 | evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_PHONG) | ||
504 | ); | ||
505 | } | 488 | } |
506 | 489 | ||
507 | static void _earth_setup(globals *ourGlobals, Scene_Data *scene) | 490 | static void _earth_setup(globals *ourGlobals, Scene_Data *scene) |
@@ -509,81 +492,76 @@ static void _earth_setup(globals *ourGlobals, Scene_Data *scene) | |||
509 | char buf[PATH_MAX]; | 492 | char buf[PATH_MAX]; |
510 | 493 | ||
511 | // Setup earth material. | 494 | // Setup earth material. |
512 | scene->material3 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas); | ||
513 | |||
514 | scene->texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas); | ||
515 | snprintf(buf, sizeof(buf), "%s/EarthDiffuse.png", elm_app_data_dir_get()); | 495 | snprintf(buf, sizeof(buf), "%s/EarthDiffuse.png", elm_app_data_dir_get()); |
516 | eo_do(scene->texture_diffuse, | 496 | scene->texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, |
517 | evas_3d_texture_file_set(buf, NULL), | 497 | evas_3d_texture_file_set(buf, NULL), |
518 | evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR)); | 498 | evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR) |
519 | eo_do(scene->material3, | 499 | ); |
520 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture_diffuse), | ||
521 | 500 | ||
522 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), | 501 | scene->material3 = eo_add(EVAS_3D_MATERIAL_CLASS, ourGlobals->evas, |
523 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), | 502 | evas_3d_material_texture_set(EVAS_3D_MATERIAL_DIFFUSE, scene->texture_diffuse), |
524 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), | ||
525 | 503 | ||
526 | evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, 0.01, 0.01, 0.01, 1.0), | 504 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_AMBIENT, EINA_TRUE), |
527 | evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 1.0), | 505 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_DIFFUSE, EINA_TRUE), |
528 | evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0), | 506 | evas_3d_material_enable_set(EVAS_3D_MATERIAL_SPECULAR, EINA_TRUE), |
529 | evas_3d_material_shininess_set(50.0)); | 507 | |
508 | evas_3d_material_color_set(EVAS_3D_MATERIAL_AMBIENT, 0.01, 0.01, 0.01, 1.0), | ||
509 | evas_3d_material_color_set(EVAS_3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 1.0), | ||
510 | evas_3d_material_color_set(EVAS_3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0), | ||
511 | evas_3d_material_shininess_set(50.0) | ||
512 | ); | ||
530 | 513 | ||
531 | // Setup earth mesh. | 514 | // Setup earth mesh. |
532 | _sphere_init(100); | 515 | _sphere_init(100); |
533 | 516 | ||
534 | scene->mesh3 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas); | 517 | scene->mesh3 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas, |
535 | eo_do(scene->mesh3, | 518 | evas_3d_mesh_vertex_count_set(vertex_count), |
536 | evas_3d_mesh_vertex_count_set(vertex_count), | 519 | evas_3d_mesh_frame_add(0), |
537 | evas_3d_mesh_frame_add(0), | 520 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_POSITION, sizeof(vertex), &sphere_vertices[0].position), |
538 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_POSITION, sizeof(vertex), &sphere_vertices[0].position), | 521 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_NORMAL, sizeof(vertex), &sphere_vertices[0].normal), |
539 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_NORMAL, sizeof(vertex), &sphere_vertices[0].normal), | 522 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_TANGENT, sizeof(vertex), &sphere_vertices[0].tangent), |
540 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_TANGENT, sizeof(vertex), &sphere_vertices[0].tangent), | 523 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_COLOR, sizeof(vertex), &sphere_vertices[0].color), |
541 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_COLOR, sizeof(vertex), &sphere_vertices[0].color), | 524 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_TEXCOORD, sizeof(vertex), &sphere_vertices[0].texcoord), |
542 | evas_3d_mesh_frame_vertex_data_set(0, EVAS_3D_VERTEX_TEXCOORD, sizeof(vertex), &sphere_vertices[0].texcoord), | 525 | |
543 | 526 | evas_3d_mesh_index_data_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, index_count, &sphere_indices[0]), | |
544 | evas_3d_mesh_index_data_set(EVAS_3D_INDEX_FORMAT_UNSIGNED_SHORT, index_count, &sphere_indices[0]), | 527 | evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES), |
545 | evas_3d_mesh_vertex_assembly_set(EVAS_3D_VERTEX_ASSEMBLY_TRIANGLES), | 528 | evas_3d_mesh_frame_material_set(0, scene->material3), |
546 | evas_3d_mesh_frame_material_set(0, scene->material3) | 529 | |
547 | ); | 530 | evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE) |
531 | ); | ||
548 | 532 | ||
549 | scene->mesh3_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_MESH); | 533 | scene->mesh3_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_MESH); |
550 | eo_do(scene->root_node, | ||
551 | evas_3d_node_member_add(scene->mesh3_node) | ||
552 | ); | ||
553 | eo_do(scene->mesh3_node, | 534 | eo_do(scene->mesh3_node, |
554 | eo_key_data_set("Name", "earth", NULL), | 535 | eo_key_data_set("Name", "earth", NULL), |
555 | evas_3d_node_position_set(40.0, -3.5, 23.0), | 536 | evas_3d_node_position_set(40.0, -3.5, 23.0), |
556 | evas_3d_node_mesh_add(scene->mesh3) | 537 | evas_3d_node_mesh_add(scene->mesh3) |
557 | ); | 538 | ); |
558 | 539 | ||
559 | eo_do(scene->mesh3, | 540 | eo_do(scene->root_node, evas_3d_node_member_add(scene->mesh3_node)); |
560 | evas_3d_mesh_shade_mode_set(EVAS_3D_SHADE_MODE_DIFFUSE) | ||
561 | ); | ||
562 | } | 541 | } |
563 | 542 | ||
564 | 543 | ||
565 | static void | 544 | static void |
566 | _scene_setup(globals *ourGlobals, Scene_Data *scene) | 545 | _scene_setup(globals *ourGlobals, Scene_Data *scene) |
567 | { | 546 | { |
568 | scene->scene = eo_add(EVAS_3D_SCENE_CLASS, ourGlobals->evas); | ||
569 | eo_do(scene->scene, | ||
570 | evas_3d_scene_size_set(512, 512), | ||
571 | evas_3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0) | ||
572 | ); | ||
573 | |||
574 | // TODO - I have no idea how this should work. | 547 | // TODO - I have no idea how this should work. |
575 | // It seems the people that wrote the examples don't know either. lol | 548 | // It seems the people that wrote the examples don't know either. lol |
576 | // scene->root_node = eo_add(EVAS_3D_NODE_CLASS, ourGlobals->evas, EVAS_3D_NODE_TYPE_NODE); | 549 | // scene->root_node = eo_add(EVAS_3D_NODE_CLASS, ourGlobals->evas, EVAS_3D_NODE_TYPE_NODE); |
577 | scene->root_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_NODE); | 550 | scene->root_node = evas_3d_node_add(ourGlobals->evas, EVAS_3D_NODE_TYPE_NODE); |
578 | 551 | ||
552 | scene->scene = eo_add(EVAS_3D_SCENE_CLASS, ourGlobals->evas, | ||
553 | evas_3d_scene_root_node_set(scene->root_node), | ||
554 | evas_3d_scene_size_set(512, 512), | ||
555 | evas_3d_scene_background_color_set(0.0, 0.0, 0.0, 0.0) | ||
556 | ); | ||
557 | |||
579 | _camera_setup(ourGlobals, scene); | 558 | _camera_setup(ourGlobals, scene); |
580 | _light_setup(ourGlobals, scene); | 559 | _light_setup(ourGlobals, scene); |
581 | _cube_setup(ourGlobals, scene); | 560 | _cube_setup(ourGlobals, scene); |
582 | _sonic_setup(ourGlobals, scene); | 561 | _sonic_setup(ourGlobals, scene); |
583 | _earth_setup(ourGlobals, scene); | 562 | _earth_setup(ourGlobals, scene); |
584 | 563 | ||
585 | eo_do(scene->scene, | 564 | eo_do(scene->scene, |
586 | evas_3d_scene_root_node_set(scene->root_node), | ||
587 | evas_3d_scene_camera_node_set(scene->camera_node) | 565 | evas_3d_scene_camera_node_set(scene->camera_node) |
588 | ); | 566 | ); |
589 | } | 567 | } |
@@ -685,28 +663,29 @@ void Evas_3D_Demo_add(globals *ourGlobals) | |||
685 | ourGlobals->scene = &ourScene; | 663 | ourGlobals->scene = &ourScene; |
686 | _scene_setup(ourGlobals, &ourScene); | 664 | _scene_setup(ourGlobals, &ourScene); |
687 | 665 | ||
688 | // Add an image object for 3D scene rendering. | 666 | // Add an image object for 3D scene rendering. |
689 | obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win); | 667 | obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, |
690 | ourScene.image = obj; | 668 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
691 | eo_do(obj, | 669 | elm_obj_image_fill_outside_set(EINA_TRUE), |
692 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 670 | evas_obj_visibility_set(EINA_TRUE), |
693 | elm_obj_image_fill_outside_set(EINA_TRUE), | 671 | temp = elm_obj_image_object_get() |
694 | evas_obj_visibility_set(EINA_TRUE), | 672 | ); |
695 | temp = elm_obj_image_object_get() | 673 | ourScene.image = obj; |
696 | ); | 674 | |
697 | eo_do(temp, | 675 | eo_do(temp, |
698 | evas_obj_image_scene_set(ourScene.scene) | 676 | evas_obj_image_scene_set(ourScene.scene) |
699 | ); | 677 | ); |
700 | elm_object_tooltip_text_set(obj, ""); | 678 | elm_object_tooltip_text_set(obj, ""); |
701 | elm_object_tooltip_hide(obj); | 679 | elm_object_tooltip_hide(obj); |
702 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas calbacks instead. | 680 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas calbacks instead. |
703 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, &ourScene); | 681 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, &ourScene); |
704 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, &ourScene); | 682 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, &ourScene); |
705 | cameraAdd(ourGlobals, obj); | 683 | |
706 | elm_win_resize_object_add(ourGlobals->win, obj); | 684 | cameraAdd(ourGlobals, obj); |
707 | // elm_box_pack_end(ourGlobals->gld.bx, obj); | 685 | elm_win_resize_object_add(ourGlobals->win, obj); |
708 | 686 | // elm_box_pack_end(ourGlobals->gld.bx, obj); | |
709 | ourGlobals->gld.move = calloc(1, sizeof(cameraMove)); | 687 | |
688 | ourGlobals->gld.move = calloc(1, sizeof(cameraMove)); | ||
710 | } | 689 | } |
711 | 690 | ||
712 | void Evas_3D_Demo_fini(globals *ourGlobals) | 691 | void Evas_3D_Demo_fini(globals *ourGlobals) |
diff --git a/src/extantz/chat.c b/src/extantz/chat.c index d71e8bb..d5e492e 100644 --- a/src/extantz/chat.c +++ b/src/extantz/chat.c | |||
@@ -18,22 +18,20 @@ fangWin *chat_add(globals *ourGlobals) | |||
18 | 18 | ||
19 | me = fang_win_add(ourGlobals); | 19 | me = fang_win_add(ourGlobals); |
20 | 20 | ||
21 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win); | 21 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, |
22 | eo_do(bx, | ||
23 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 22 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
24 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) | 23 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) |
25 | ); | 24 | ); |
26 | elm_win_resize_object_add(me->win, bx); | 25 | elm_win_resize_object_add(me->win, bx); |
27 | 26 | ||
28 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win); | 27 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, |
29 | elm_object_text_set(en, "History is shown here"); | ||
30 | eo_do(en, | ||
31 | elm_obj_entry_scrollable_set(EINA_TRUE), | 28 | elm_obj_entry_scrollable_set(EINA_TRUE), |
32 | elm_obj_entry_editable_set(EINA_FALSE), | 29 | elm_obj_entry_editable_set(EINA_FALSE), |
33 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 30 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
34 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 31 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
35 | evas_obj_visibility_set(EINA_TRUE) | 32 | evas_obj_visibility_set(EINA_TRUE) |
36 | ); | 33 | ); |
34 | elm_object_text_set(en, "History is shown here"); | ||
37 | elm_box_pack_end(bx, en); | 35 | elm_box_pack_end(bx, en); |
38 | eo_unref(en); | 36 | eo_unref(en); |
39 | 37 | ||
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 4ef9ecc..ef493b8 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -279,9 +279,7 @@ static void makeMainMenu(globals *ourGlobals) | |||
279 | Elm_Object_Item *tb_it; | 279 | Elm_Object_Item *tb_it; |
280 | 280 | ||
281 | // A toolbar thingy. | 281 | // A toolbar thingy. |
282 | tb = eo_add(ELM_OBJ_TOOLBAR_CLASS, ourGlobals->win); | 282 | tb = eo_add(ELM_OBJ_TOOLBAR_CLASS, ourGlobals->win, |
283 | ourGlobals->tb = tb; | ||
284 | eo_do(tb, | ||
285 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 283 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), |
286 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 284 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
287 | elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU), | 285 | elm_obj_toolbar_shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU), |
@@ -289,6 +287,7 @@ static void makeMainMenu(globals *ourGlobals) | |||
289 | evas_obj_position_set(0, 0), | 287 | evas_obj_position_set(0, 0), |
290 | elm_obj_toolbar_align_set(0.0) | 288 | elm_obj_toolbar_align_set(0.0) |
291 | ); | 289 | ); |
290 | ourGlobals->tb = tb; | ||
292 | 291 | ||
293 | // Menus. | 292 | // Menus. |
294 | menu = _toolbar_menu_add(ourGlobals->win, tb, "file"); | 293 | menu = _toolbar_menu_add(ourGlobals->win, tb, "file"); |
@@ -398,9 +397,8 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
398 | ourGlobals.win_h = ourGlobals.scr_h - 30; | 397 | ourGlobals.win_h = ourGlobals.scr_h - 30; |
399 | 398 | ||
400 | // Add a background image object. | 399 | // Add a background image object. |
401 | obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals.win); | ||
402 | snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); | 400 | snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); |
403 | eo_do(obj, | 401 | obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals.win, |
404 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 402 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
405 | elm_obj_image_fill_outside_set(EINA_TRUE), | 403 | elm_obj_image_fill_outside_set(EINA_TRUE), |
406 | elm_obj_image_file_set(buf, NULL), | 404 | elm_obj_image_file_set(buf, NULL), |
@@ -409,8 +407,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
409 | elm_win_resize_object_add(ourGlobals.win, obj); | 407 | elm_win_resize_object_add(ourGlobals.win, obj); |
410 | eo_unref(obj); | 408 | eo_unref(obj); |
411 | 409 | ||
412 | ourGlobals.bx = eo_add(ELM_OBJ_BOX_CLASS, ourGlobals.win); | 410 | ourGlobals.bx = eo_add(ELM_OBJ_BOX_CLASS, ourGlobals.win, |
413 | eo_do(ourGlobals.bx, | ||
414 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 411 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
415 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 412 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
416 | evas_obj_visibility_set(EINA_TRUE) | 413 | evas_obj_visibility_set(EINA_TRUE) |
diff --git a/src/extantz/files.c b/src/extantz/files.c index 024e2df..06cd257 100644 --- a/src/extantz/files.c +++ b/src/extantz/files.c | |||
@@ -148,8 +148,7 @@ fangWin *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
148 | 148 | ||
149 | me = fang_win_add(ourGlobals); | 149 | me = fang_win_add(ourGlobals); |
150 | 150 | ||
151 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win); | 151 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, |
152 | eo_do(bx, | ||
153 | elm_obj_box_homogeneous_set(EINA_FALSE), | 152 | elm_obj_box_homogeneous_set(EINA_FALSE), |
154 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 153 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
155 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) | 154 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) |
@@ -189,16 +188,13 @@ fangWin *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
189 | // Call back for double click or Enter pressed on file. | 188 | // Call back for double click or Enter pressed on file. |
190 | evas_object_smart_callback_add(fs, "activated", my_fileselector_activated, me); | 189 | evas_object_smart_callback_add(fs, "activated", my_fileselector_activated, me); |
191 | 190 | ||
192 | vbox = eo_add(ELM_OBJ_BOX_CLASS, me->win); | 191 | vbox = eo_add(ELM_OBJ_BOX_CLASS, me->win, |
193 | eo_do(vbox, | ||
194 | elm_obj_box_homogeneous_set(EINA_FALSE), | 192 | elm_obj_box_homogeneous_set(EINA_FALSE), |
195 | elm_obj_box_horizontal_set(EINA_TRUE), | 193 | elm_obj_box_horizontal_set(EINA_TRUE), |
196 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) | 194 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) |
197 | ); | 195 | ); |
198 | 196 | ||
199 | hoversel = eo_add(ELM_OBJ_HOVERSEL_CLASS, vbox); | 197 | hoversel = eo_add(ELM_OBJ_HOVERSEL_CLASS, vbox, |
200 | elm_object_text_set(hoversel, "sorting"); | ||
201 | eo_do(hoversel, | ||
202 | elm_obj_hoversel_hover_parent_set(me->win), | 198 | elm_obj_hoversel_hover_parent_set(me->win), |
203 | eo_key_data_set("fileselector", fs, NULL), | 199 | eo_key_data_set("fileselector", fs, NULL), |
204 | elm_obj_hoversel_item_add("name(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_FILENAME_ASC), | 200 | elm_obj_hoversel_item_add("name(asc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_FILENAME_ASC), |
@@ -211,12 +207,11 @@ fangWin *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
211 | elm_obj_hoversel_item_add("time(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC), | 207 | elm_obj_hoversel_item_add("time(desc)", NULL, ELM_ICON_NONE, _sort_selected_cb, (const void *) ELM_FILESELECTOR_SORT_BY_MODIFIED_DESC), |
212 | evas_obj_visibility_set(EINA_TRUE) | 208 | evas_obj_visibility_set(EINA_TRUE) |
213 | ); | 209 | ); |
210 | elm_object_text_set(hoversel, "sorting"); | ||
214 | elm_box_pack_end(vbox, hoversel); | 211 | elm_box_pack_end(vbox, hoversel); |
215 | eo_unref(hoversel); | 212 | eo_unref(hoversel); |
216 | 213 | ||
217 | hoversel = eo_add(ELM_OBJ_HOVERSEL_CLASS, vbox); | 214 | hoversel = eo_add(ELM_OBJ_HOVERSEL_CLASS, vbox, |
218 | elm_object_text_set(hoversel, "size"); | ||
219 | eo_do(hoversel, | ||
220 | elm_obj_hoversel_hover_parent_set(me->win), | 215 | elm_obj_hoversel_hover_parent_set(me->win), |
221 | eo_key_data_set("fileselector", fs, NULL), | 216 | eo_key_data_set("fileselector", fs, NULL), |
222 | elm_obj_hoversel_item_add("tiny", NULL, ELM_ICON_NONE, _tiny_icon_clicked, fs), | 217 | elm_obj_hoversel_item_add("tiny", NULL, ELM_ICON_NONE, _tiny_icon_clicked, fs), |
@@ -225,57 +220,57 @@ fangWin *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
225 | elm_obj_hoversel_item_add("big", NULL, ELM_ICON_NONE, _big_icon_clicked, fs), | 220 | elm_obj_hoversel_item_add("big", NULL, ELM_ICON_NONE, _big_icon_clicked, fs), |
226 | evas_obj_visibility_set(EINA_TRUE) | 221 | evas_obj_visibility_set(EINA_TRUE) |
227 | ); | 222 | ); |
223 | elm_object_text_set(hoversel, "size"); | ||
228 | elm_box_pack_end(vbox, hoversel); | 224 | elm_box_pack_end(vbox, hoversel); |
229 | // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug. | 225 | // Make sure it starts off as small, works around "hitting grid mode before hitting size not showing anything" bug. |
230 | _small_icon_clicked(fs, hoversel, NULL); | 226 | _small_icon_clicked(fs, hoversel, NULL); |
231 | eo_unref(hoversel); | 227 | eo_unref(hoversel); |
232 | 228 | ||
233 | 229 | ||
234 | bt = eo_add(ELM_OBJ_CHECK_CLASS, vbox); | 230 | bt = eo_add(ELM_OBJ_CHECK_CLASS, vbox, |
235 | elm_object_text_set(bt, "hidden"); | 231 | elm_obj_check_state_set(elm_fileselector_hidden_visible_get(fs)), |
236 | eo_do(bt, | ||
237 | elm_obj_check_state_set(elm_fileselector_hidden_visible_get(fs)), | ||
238 | evas_obj_visibility_set(EINA_TRUE) | 232 | evas_obj_visibility_set(EINA_TRUE) |
239 | ); | 233 | ); |
234 | elm_object_text_set(bt, "hidden"); | ||
240 | evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs); | 235 | evas_object_smart_callback_add(bt, "changed", _hidden_clicked, fs); |
241 | elm_box_pack_end(vbox, bt); | 236 | elm_box_pack_end(vbox, bt); |
242 | eo_unref(bt); | 237 | eo_unref(bt); |
243 | 238 | ||
244 | rdg = rd = eo_add(ELM_OBJ_RADIO_CLASS, vbox); | 239 | rdg = rd = eo_add(ELM_OBJ_RADIO_CLASS, vbox, |
245 | elm_object_text_set(rd, "grid"); | ||
246 | eo_do(rd, | ||
247 | elm_obj_radio_state_value_set(ELM_FILESELECTOR_GRID), | 240 | elm_obj_radio_state_value_set(ELM_FILESELECTOR_GRID), |
248 | evas_obj_visibility_set(EINA_TRUE) | 241 | evas_obj_visibility_set(EINA_TRUE) |
249 | ); | 242 | ); |
243 | elm_object_text_set(rd, "grid"); | ||
250 | elm_box_pack_end(vbox, rd); | 244 | elm_box_pack_end(vbox, rd); |
251 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); | 245 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); |
252 | // Make it start in grid mode. It defaults to list mode, so this swaps it over. | 246 | // Make it start in grid mode. It defaults to list mode, so this swaps it over. |
253 | _mode_changed_cb(fs, rd, NULL); | 247 | _mode_changed_cb(fs, rd, NULL); |
254 | eo_unref(rd); | 248 | eo_unref(rd); |
255 | 249 | ||
256 | rd = eo_add(ELM_OBJ_RADIO_CLASS, vbox); | 250 | rd = eo_add(ELM_OBJ_RADIO_CLASS, vbox, |
257 | elm_radio_group_add(rd, rdg); | ||
258 | elm_object_text_set(rd, "list"); | ||
259 | eo_do(rd, | ||
260 | elm_obj_radio_state_value_set(ELM_FILESELECTOR_LIST), | 251 | elm_obj_radio_state_value_set(ELM_FILESELECTOR_LIST), |
261 | evas_obj_visibility_set(EINA_TRUE) | 252 | evas_obj_visibility_set(EINA_TRUE) |
262 | ); | 253 | ); |
254 | elm_radio_group_add(rd, rdg); | ||
255 | elm_object_text_set(rd, "list"); | ||
263 | elm_box_pack_end(vbox, rd); | 256 | elm_box_pack_end(vbox, rd); |
264 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); | 257 | evas_object_smart_callback_add(rd, "changed", _mode_changed_cb, fs); |
265 | eo_unref(rd); | 258 | eo_unref(rd); |
266 | // No need to unref this, it's taken care of already. | 259 | // No need to unref this, it's taken care of already. |
267 | //eo_unref(rdg); | 260 | //eo_unref(rdg); |
268 | 261 | ||
269 | bt = eo_add(ELM_OBJ_BUTTON_CLASS, me->win); | 262 | bt = eo_add(ELM_OBJ_BUTTON_CLASS, me->win, |
263 | evas_obj_visibility_set(EINA_TRUE) | ||
264 | ); | ||
270 | elm_object_text_set(bt, "OK"); | 265 | elm_object_text_set(bt, "OK"); |
271 | eo_do(bt, evas_obj_visibility_set(EINA_TRUE)); | ||
272 | evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me); | 266 | evas_object_smart_callback_add(bt, "clicked", _OK_clicked, me); |
273 | elm_box_pack_end(vbox, bt); | 267 | elm_box_pack_end(vbox, bt); |
274 | eo_unref(bt); | 268 | eo_unref(bt); |
275 | 269 | ||
276 | bt = eo_add(ELM_OBJ_BUTTON_CLASS, me->win); | 270 | bt = eo_add(ELM_OBJ_BUTTON_CLASS, me->win, |
271 | evas_obj_visibility_set(EINA_TRUE) | ||
272 | ); | ||
277 | elm_object_text_set(bt, "CANCEL"); | 273 | elm_object_text_set(bt, "CANCEL"); |
278 | eo_do(bt, evas_obj_visibility_set(EINA_TRUE)); | ||
279 | evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me); | 274 | evas_object_smart_callback_add(bt, "clicked", _CANCEL_clicked, me); |
280 | elm_box_pack_end(vbox, bt); | 275 | elm_box_pack_end(vbox, bt); |
281 | eo_unref(bt); | 276 | eo_unref(bt); |
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index ffb063c..0a3456b 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c | |||
@@ -274,14 +274,13 @@ fangWin *woMan_add(globals *ourGlobals) | |||
274 | tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Grids", _promote, tab_it); | 274 | tab = gridList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Grids", _promote, tab_it); |
275 | elm_box_pack_end(bx, nf); | 275 | elm_box_pack_end(bx, nf); |
276 | 276 | ||
277 | bt = eo_add(ELM_OBJ_BUTTON_CLASS, me->win); | 277 | bt = eo_add(ELM_OBJ_BUTTON_CLASS, me->win, |
278 | elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. | ||
279 | eo_do(bt, | ||
280 | // evas_obj_text_set("Login"), | 278 | // evas_obj_text_set("Login"), |
281 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 279 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
282 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), | 280 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, 0.0), |
283 | evas_obj_visibility_set(EINA_TRUE) | 281 | evas_obj_visibility_set(EINA_TRUE) |
284 | ); | 282 | ); |
283 | elm_object_text_set(bt, "Login"); // No eo interface for this that I can find. | ||
285 | // evas_object_smart_callback_add(bt, "clicked", NULL, NULL); | 284 | // evas_object_smart_callback_add(bt, "clicked", NULL, NULL); |
286 | elm_box_pack_end(bx, bt); | 285 | elm_box_pack_end(bx, bt); |
287 | eo_unref(bt); | 286 | eo_unref(bt); |