Advertisement
Guest User

Untitled

a guest
Aug 15th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 14.89 KB | None | 0 0
  1. #ifndef EFL_BETA_API_SUPPORT
  2. #define EFL_BETA_API_SUPPORT
  3. #endif
  4. #ifndef EFL_EO_API_SUPPORT
  5. #define EFL_EO_API_SUPPORT
  6. #endif
  7. #ifndef ELM_INTERNAL_API_ARGESFSDFEFC
  8. #define ELM_INTERNAL_API_ARGESFSDFEFC
  9. #endif
  10.  
  11. #include <Elementary.h>
  12. #include <Eo.h>
  13.  
  14. #define ELM_WIDGET_PROTECTED
  15. #include "elm_widget.h"
  16. #include "elm_widget_container.h"
  17. #include "elm_interface_scrollable.h"
  18.  
  19. typedef struct
  20. {
  21.    Eo *bg_1;
  22.    Eo *win_1;
  23. } _button_1_clicked_info;
  24.  
  25. typedef struct
  26. {
  27.    Eo *bg_1;
  28.    Eo *win_1;
  29. } _button_2_clicked_info;
  30.  
  31. typedef struct
  32. {
  33.    Eo *win_1;
  34. } _button_10_clicked_info;
  35.  
  36. typedef struct
  37. {
  38.    Eo *win_1;
  39. } _button_11_clicked_info;
  40.  
  41. typedef struct
  42. {
  43.    Eo *win_1;
  44. } _button_12_clicked_info;
  45.  
  46. typedef struct
  47. {
  48.    Eo *win_1;
  49. } _button_13_clicked_info;
  50.  
  51.  
  52. static void
  53. _button_1_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
  54. {
  55.    _button_1_clicked_info *ext_wdgs = data;
  56.    efl_gfx_visible_set(ext_wdgs->bg_1, EINA_FALSE);
  57.    efl_ui_win_alpha_set(ext_wdgs->win_1, EINA_TRUE);
  58. }
  59.  
  60. static void
  61. _button_2_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
  62. {
  63.    _button_2_clicked_info *ext_wdgs = data;
  64.    efl_gfx_visible_set(ext_wdgs->bg_1, EINA_TRUE);
  65.    efl_ui_win_alpha_set(ext_wdgs->win_1, EINA_FALSE);
  66. }
  67.  
  68. static void
  69. _button_10_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
  70. {
  71.    _button_10_clicked_info *ext_wdgs = data;
  72.    elm_obj_widget_orientation_set(ext_wdgs->win_1, 0);
  73. }
  74.  
  75. static void
  76. _button_11_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
  77. {
  78.    _button_11_clicked_info *ext_wdgs = data;
  79.    elm_obj_widget_orientation_set(ext_wdgs->win_1, 90);
  80. }
  81.  
  82. static void
  83. _button_12_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
  84. {
  85.    _button_12_clicked_info *ext_wdgs = data;
  86.    elm_obj_widget_orientation_set(ext_wdgs->win_1, 180);
  87. }
  88.  
  89. static void
  90. _button_13_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
  91. {
  92.    _button_13_clicked_info *ext_wdgs = data;
  93.    elm_obj_widget_orientation_set(ext_wdgs->win_1, 270);
  94. }
  95.  
  96. void
  97. win_1_create()
  98. {
  99. #if 1
  100.    Eo *win_1 = efl_add(EFL_UI_WIN_CLASS, NULL,
  101.          efl_ui_win_name_set(efl_added, "window-states"),
  102.          efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
  103. #else
  104.    Eo *win_1 = elm_win_add(NULL, "window-states", ELM_WIN_BASIC);
  105. #endif
  106.    efl_text_set(win_1, "Window States");
  107.    efl_ui_win_autodel_set(win_1, EINA_TRUE);
  108.    efl_gfx_size_set(win_1, 280, 400);
  109.    efl_gfx_visible_set(win_1, EINA_TRUE);
  110.  
  111.    Eo *bg_1 = efl_add(ELM_BG_CLASS, win_1);
  112.    efl_gfx_size_hint_weight_set(bg_1, 1, 1);
  113.    efl_content_set(win_1, bg_1);
  114.  
  115.    Eo *box_1 = elm_box_add(win_1);
  116.    efl_gfx_size_hint_weight_set(box_1, 1, 1);
  117.    efl_gfx_visible_set(box_1, EINA_TRUE);
  118.  
  119.    Eo *box_2 = elm_box_add(box_1);
  120.    elm_box_horizontal_set(box_2, EINA_TRUE);
  121.    elm_box_homogeneous_set(box_2, EINA_TRUE);
  122.    efl_gfx_size_hint_weight_set(box_2, 1, 0);
  123.    efl_gfx_size_hint_align_set(box_2, -1, -1);
  124.    efl_gfx_visible_set(box_2, EINA_TRUE);
  125.  
  126.    Eo *button_1 = efl_add(EFL_UI_BUTTON_CLASS, box_2);
  127.    elm_obj_widget_part_text_set(button_1, NULL, "Alpha On");
  128.    efl_gfx_size_hint_align_set(button_1, -1, -1);
  129.    efl_gfx_size_hint_weight_set(button_1, 1, 0);
  130.    efl_gfx_visible_set(button_1, EINA_TRUE);
  131.    elm_box_pack_end(box_2, button_1);
  132.  
  133.    Eo *button_2 = efl_add(EFL_UI_BUTTON_CLASS, box_2);
  134.    elm_obj_widget_part_text_set(button_2, NULL, "Alpha Off");
  135.    efl_gfx_size_hint_align_set(button_2, -1, -1);
  136.    efl_gfx_size_hint_weight_set(button_2, 1, 0);
  137.    efl_gfx_visible_set(button_2, EINA_TRUE);
  138.    elm_box_pack_end(box_2, button_2);
  139.  
  140.    Eo *button_3 = efl_add(EFL_UI_BUTTON_CLASS, box_2);
  141.    elm_obj_widget_part_text_set(button_3, NULL, "Withdraw");
  142.    efl_gfx_size_hint_align_set(button_3, -1, -1);
  143.    efl_gfx_size_hint_weight_set(button_3, 1, 0);
  144.    efl_gfx_visible_set(button_3, EINA_TRUE);
  145.    elm_box_pack_end(box_2, button_3);
  146.  
  147.    Eo *button_4 = efl_add(EFL_UI_BUTTON_CLASS, box_2);
  148.    elm_obj_widget_part_text_set(button_4, NULL, "Massive");
  149.    efl_gfx_size_hint_align_set(button_4, -1, -1);
  150.    efl_gfx_size_hint_weight_set(button_4, 1, 0);
  151.    efl_gfx_visible_set(button_4, EINA_TRUE);
  152.    elm_box_pack_end(box_2, button_4);
  153.  
  154.    Eo *button_5 = efl_add(EFL_UI_BUTTON_CLASS, box_2);
  155.    elm_obj_widget_part_text_set(button_5, NULL, "Move 20 20");
  156.    efl_gfx_size_hint_align_set(button_5, -1, -1);
  157.    efl_gfx_size_hint_weight_set(button_5, 1, 0);
  158.    efl_gfx_visible_set(button_5, EINA_TRUE);
  159.    elm_box_pack_end(box_2, button_5);
  160.    elm_box_pack_end(box_1, box_2);
  161.  
  162.    Eo *box_3 = elm_box_add(box_1);
  163.    elm_box_horizontal_set(box_3, EINA_TRUE);
  164.    elm_box_homogeneous_set(box_3, EINA_TRUE);
  165.    efl_gfx_size_hint_weight_set(box_3, 1, 0);
  166.    efl_gfx_size_hint_align_set(box_3, -1, -1);
  167.    efl_gfx_visible_set(box_3, EINA_TRUE);
  168.  
  169.    Eo *button_6 = efl_add(EFL_UI_BUTTON_CLASS, box_3);
  170.    elm_obj_widget_part_text_set(button_6, NULL, "Lower");
  171.    efl_gfx_size_hint_align_set(button_6, -1, -1);
  172.    efl_gfx_size_hint_weight_set(button_6, 1, 0);
  173.    efl_gfx_visible_set(button_6, EINA_TRUE);
  174.    elm_box_pack_end(box_3, button_6);
  175.  
  176.    Eo *button_7 = efl_add(EFL_UI_BUTTON_CLASS, box_3);
  177.    elm_obj_widget_part_text_set(button_7, NULL, "Iconify and Activate");
  178.    efl_gfx_size_hint_align_set(button_7, -1, -1);
  179.    efl_gfx_size_hint_weight_set(button_7, 1, 0);
  180.    efl_gfx_visible_set(button_7, EINA_TRUE);
  181.    elm_box_pack_end(box_3, button_7);
  182.  
  183.    Eo *button_8 = efl_add(EFL_UI_BUTTON_CLASS, box_3);
  184.    elm_obj_widget_part_text_set(button_8, NULL, "Iconify and Deiconify");
  185.    efl_gfx_size_hint_align_set(button_8, -1, -1);
  186.    efl_gfx_size_hint_weight_set(button_8, 1, 0);
  187.    efl_gfx_visible_set(button_8, EINA_TRUE);
  188.    elm_box_pack_end(box_3, button_8);
  189.  
  190.    Eo *button_9 = efl_add(EFL_UI_BUTTON_CLASS, box_3);
  191.    elm_obj_widget_part_text_set(button_9, NULL, "Center");
  192.    efl_gfx_size_hint_weight_set(button_9, 1, 0);
  193.    efl_gfx_size_hint_align_set(button_9, -1, -1);
  194.    efl_gfx_visible_set(button_9, EINA_TRUE);
  195.    elm_box_pack_end(box_3, button_9);
  196.    elm_box_pack_end(box_1, box_3);
  197.  
  198.    Eo *box_4 = elm_box_add(box_1);
  199.    elm_box_horizontal_set(box_4, EINA_TRUE);
  200.    elm_box_homogeneous_set(box_4, EINA_TRUE);
  201.    efl_gfx_size_hint_weight_set(box_4, 1, 1);
  202.    efl_gfx_size_hint_align_set(box_4, -1, -1);
  203.    efl_gfx_visible_set(box_4, EINA_TRUE);
  204.  
  205.    Eo *slider_1 = efl_add(EFL_UI_SLIDER_CLASS, box_4);
  206.    elm_obj_widget_part_text_set(slider_1, NULL, "Test");
  207.    efl_ui_range_span_size_set(slider_1, 100);
  208.    efl_gfx_size_hint_align_set(slider_1, 0.5, 0.5);
  209.    efl_gfx_size_hint_weight_set(slider_1, 1, 1);
  210.    efl_ui_slider_indicator_format_set(slider_1, "%3.0f");
  211.    efl_ui_range_min_max_set(slider_1, 50, 150);
  212.    efl_ui_range_value_set(slider_1, 50);
  213.    efl_ui_direction_set(slider_1, EFL_UI_DIR_RTL);
  214.    efl_gfx_visible_set(slider_1, EINA_TRUE);
  215.    elm_box_pack_end(box_4, slider_1);
  216.    elm_box_pack_end(box_1, box_4);
  217.  
  218.    Eo *check_1 = efl_add(EFL_UI_CHECK_CLASS, box_1);
  219.    elm_obj_widget_part_text_set(check_1, NULL, "resize");
  220.    efl_ui_check_selected_set(check_1, EINA_FALSE);
  221.    efl_gfx_size_hint_weight_set(check_1, 1, 1);
  222.    efl_gfx_size_hint_align_set(check_1, 0.02, 0.99);
  223.    efl_gfx_visible_set(check_1, EINA_TRUE);
  224.    elm_box_pack_end(box_1, check_1);
  225.  
  226.    Eo *check_2 = efl_add(EFL_UI_CHECK_CLASS, box_1);
  227.    elm_obj_widget_part_text_set(check_2, NULL, "fullscreen");
  228.    efl_ui_check_selected_set(check_2, EINA_FALSE);
  229.    efl_gfx_size_hint_weight_set(check_2, 1, 1);
  230.    efl_gfx_size_hint_align_set(check_2, 0.02, 0.99);
  231.    efl_gfx_visible_set(check_2, EINA_TRUE);
  232.    elm_box_pack_end(box_1, check_2);
  233.  
  234.    Eo *check_3 = efl_add(EFL_UI_CHECK_CLASS, box_1);
  235.    elm_obj_widget_part_text_set(check_3, NULL, "borderless");
  236.    efl_ui_check_selected_set(check_3, EINA_FALSE);
  237.    efl_gfx_size_hint_weight_set(check_3, 1, 1);
  238.    efl_gfx_size_hint_align_set(check_3, 0.02, 0.99);
  239.    efl_gfx_visible_set(check_3, EINA_TRUE);
  240.    elm_box_pack_end(box_1, check_3);
  241.  
  242.    Eo *check_4 = efl_add(EFL_UI_CHECK_CLASS, box_1);
  243.    elm_obj_widget_part_text_set(check_4, NULL, "floating");
  244.    efl_ui_check_selected_set(check_4, EINA_FALSE);
  245.    efl_gfx_size_hint_weight_set(check_4, 1, 1);
  246.    efl_gfx_size_hint_align_set(check_4, 0.02, 0.99);
  247.    efl_gfx_visible_set(check_4, EINA_TRUE);
  248.    elm_box_pack_end(box_1, check_4);
  249.  
  250.    Eo *box_5 = elm_box_add(box_1);
  251.    elm_box_horizontal_set(box_5, EINA_TRUE);
  252.    elm_box_homogeneous_set(box_5, EINA_TRUE);
  253.    efl_gfx_size_hint_weight_set(box_5, 1, 0);
  254.    efl_gfx_size_hint_align_set(box_5, -1, -1);
  255.    efl_gfx_visible_set(box_5, EINA_TRUE);
  256.  
  257.    Eo *button_10 = efl_add(EFL_UI_BUTTON_CLASS, box_5);
  258.    elm_obj_widget_part_text_set(button_10, NULL, "Rot 0");
  259.    efl_gfx_size_hint_align_set(button_10, -1, -1);
  260.    efl_gfx_size_hint_weight_set(button_10, 1, 0);
  261.    efl_gfx_visible_set(button_10, EINA_TRUE);
  262.    elm_box_pack_end(box_5, button_10);
  263.  
  264.    Eo *button_11 = efl_add(EFL_UI_BUTTON_CLASS, box_5);
  265.    elm_obj_widget_part_text_set(button_11, NULL, "Rot 90");
  266.    efl_gfx_size_hint_align_set(button_11, -1, -1);
  267.    efl_gfx_size_hint_weight_set(button_11, 1, 0);
  268.    efl_gfx_visible_set(button_11, EINA_TRUE);
  269.    elm_box_pack_end(box_5, button_11);
  270.  
  271.    Eo *button_12 = efl_add(EFL_UI_BUTTON_CLASS, box_5);
  272.    elm_obj_widget_part_text_set(button_12, NULL, "Rot 180");
  273.    efl_gfx_size_hint_align_set(button_12, -1, -1);
  274.    efl_gfx_size_hint_weight_set(button_12, 1, 0);
  275.    efl_gfx_visible_set(button_12, EINA_TRUE);
  276.    elm_box_pack_end(box_5, button_12);
  277.  
  278.    Eo *button_13 = efl_add(EFL_UI_BUTTON_CLASS, box_5);
  279.    elm_obj_widget_part_text_set(button_13, NULL, "Rot 270");
  280.    efl_gfx_size_hint_align_set(button_13, -1, -1);
  281.    efl_gfx_size_hint_weight_set(button_13, 1, 0);
  282.    efl_gfx_visible_set(button_13, EINA_TRUE);
  283.    elm_box_pack_end(box_5, button_13);
  284.  
  285.    Eo *button_14 = efl_add(EFL_UI_BUTTON_CLASS, box_5);
  286.    elm_obj_widget_part_text_set(button_14, NULL, "Move 0 0");
  287.    efl_gfx_size_hint_align_set(button_14, -1, -1);
  288.    efl_gfx_size_hint_weight_set(button_14, 1, 0);
  289.    efl_gfx_visible_set(button_14, EINA_TRUE);
  290.    elm_box_pack_end(box_5, button_14);
  291.    elm_box_pack_end(box_1, box_5);
  292.  
  293.    Eo *table_1 = elm_table_add(box_1);
  294.    efl_gfx_size_hint_weight_set(table_1, 1, 1);
  295.    efl_gfx_size_hint_align_set(table_1, -1, -1);
  296.    efl_gfx_visible_set(table_1, EINA_TRUE);
  297.  
  298.    Eo *button_15 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  299.    elm_obj_widget_part_text_set(button_15, NULL, "Top Left");
  300.    efl_gfx_size_hint_weight_set(button_15, 1, 1);
  301.    efl_gfx_size_hint_align_set(button_15, -1, -1);
  302.    efl_gfx_visible_set(button_15, EINA_TRUE);
  303.    elm_table_pack(table_1, button_15, 0, 0, 1, 1);
  304.  
  305.    Eo *button_16 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  306.    elm_obj_widget_part_text_set(button_16, NULL, "Top");
  307.    efl_gfx_size_hint_weight_set(button_16, 1, 1);
  308.    efl_gfx_size_hint_align_set(button_16, -1, -1);
  309.    efl_gfx_visible_set(button_16, EINA_TRUE);
  310.    elm_table_pack(table_1, button_16, 1, 0, 1, 1);
  311.  
  312.    Eo *button_17 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  313.    elm_obj_widget_part_text_set(button_17, NULL, "Top Right");
  314.    efl_gfx_size_hint_weight_set(button_17, 1, 1);
  315.    efl_gfx_size_hint_align_set(button_17, -1, -1);
  316.    efl_gfx_visible_set(button_17, EINA_TRUE);
  317.    elm_table_pack(table_1, button_17, 2, 0, 1, 1);
  318.  
  319.    Eo *button_18 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  320.    elm_obj_widget_part_text_set(button_18, NULL, "Left");
  321.    efl_gfx_size_hint_weight_set(button_18, 1, 1);
  322.    efl_gfx_size_hint_align_set(button_18, -1, -1);
  323.    efl_gfx_visible_set(button_18, EINA_TRUE);
  324.    elm_table_pack(table_1, button_18, 0, 1, 1, 1);
  325.  
  326.    Eo *button_19 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  327.    elm_obj_widget_part_text_set(button_19, NULL, "Move");
  328.    efl_gfx_size_hint_weight_set(button_19, 1, 1);
  329.    efl_gfx_size_hint_align_set(button_19, -1, -1);
  330.    efl_gfx_visible_set(button_19, EINA_TRUE);
  331.    elm_table_pack(table_1, button_19, 1, 1, 1, 1);
  332.  
  333.    Eo *button_20 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  334.    elm_obj_widget_part_text_set(button_20, NULL, "Right");
  335.    efl_gfx_size_hint_weight_set(button_20, 1, 1);
  336.    efl_gfx_size_hint_align_set(button_20, -1, -1);
  337.    efl_gfx_visible_set(button_20, EINA_TRUE);
  338.    elm_table_pack(table_1, button_20, 2, 1, 1, 1);
  339.  
  340.    Eo *button_21 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  341.    elm_obj_widget_part_text_set(button_21, NULL, "Bot Left");
  342.    efl_gfx_size_hint_weight_set(button_21, 1, 1);
  343.    efl_gfx_size_hint_align_set(button_21, -1, -1);
  344.    efl_gfx_visible_set(button_21, EINA_TRUE);
  345.    elm_table_pack(table_1, button_21, 0, 2, 1, 1);
  346.  
  347.    Eo *button_22 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  348.    elm_obj_widget_part_text_set(button_22, NULL, "Bottom");
  349.    efl_gfx_size_hint_weight_set(button_22, 1, 1);
  350.    efl_gfx_size_hint_align_set(button_22, -1, -1);
  351.    efl_gfx_visible_set(button_22, EINA_TRUE);
  352.    elm_table_pack(table_1, button_22, 1, 2, 1, 1);
  353.  
  354.    Eo *button_23 = efl_add(EFL_UI_BUTTON_CLASS, table_1);
  355.    elm_obj_widget_part_text_set(button_23, NULL, "Bot Right");
  356.    efl_gfx_size_hint_weight_set(button_23, 1, 1);
  357.    efl_gfx_size_hint_align_set(button_23, -1, -1);
  358.    efl_gfx_visible_set(button_23, EINA_TRUE);
  359.    elm_table_pack(table_1, button_23, 2, 2, 1, 1);
  360.    elm_box_pack_end(box_1, table_1);
  361.    efl_content_set(win_1, box_1);
  362.  
  363.    _button_1_clicked_info *button_1_clicked_info = calloc(1, sizeof(*button_1_clicked_info));
  364.    button_1_clicked_info->bg_1 = bg_1;
  365.    button_1_clicked_info->win_1 = win_1;
  366.    efl_event_callback_add(button_1, EFL_UI_EVENT_CLICKED, _button_1_clicked_cb, button_1_clicked_info);
  367.  
  368.    _button_2_clicked_info *button_2_clicked_info = calloc(1, sizeof(*button_2_clicked_info));
  369.    button_2_clicked_info->bg_1 = bg_1;
  370.    button_2_clicked_info->win_1 = win_1;
  371.    efl_event_callback_add(button_2, EFL_UI_EVENT_CLICKED, _button_2_clicked_cb, button_2_clicked_info);
  372.  
  373.    _button_10_clicked_info *button_10_clicked_info = calloc(1, sizeof(*button_10_clicked_info));
  374.    button_10_clicked_info->win_1 = win_1;
  375.    efl_event_callback_add(button_10, EFL_UI_EVENT_CLICKED, _button_10_clicked_cb, button_10_clicked_info);
  376.  
  377.    _button_11_clicked_info *button_11_clicked_info = calloc(1, sizeof(*button_11_clicked_info));
  378.    button_11_clicked_info->win_1 = win_1;
  379.    efl_event_callback_add(button_11, EFL_UI_EVENT_CLICKED, _button_11_clicked_cb, button_11_clicked_info);
  380.  
  381.    _button_12_clicked_info *button_12_clicked_info = calloc(1, sizeof(*button_12_clicked_info));
  382.    button_12_clicked_info->win_1 = win_1;
  383.    efl_event_callback_add(button_12, EFL_UI_EVENT_CLICKED, _button_12_clicked_cb, button_12_clicked_info);
  384.  
  385.    _button_13_clicked_info *button_13_clicked_info = calloc(1, sizeof(*button_13_clicked_info));
  386.    button_13_clicked_info->win_1 = win_1;
  387.    efl_event_callback_add(button_13, EFL_UI_EVENT_CLICKED, _button_13_clicked_cb, button_13_clicked_info);
  388. }
  389.  
  390. EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
  391. { win_1_create(NULL); }
  392. EFL_MAIN()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement