aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src
parentMerge elementary into the EFL. (diff)
downloadefl-c2a1c49ab2042f559b28e840e54feb8494888e0e.tar.gz
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/.gitignore7
-rw-r--r--src/bin/elementary/Makefile.am195
-rw-r--r--src/bin/elementary/config.c4115
-rw-r--r--src/bin/elementary/elementary_codegen.c887
-rw-r--r--src/bin/elementary/elm_prefs_cc.c201
-rw-r--r--src/bin/elementary/elm_prefs_cc.h107
-rw-r--r--src/bin/elementary/elm_prefs_cc_handlers.c1218
-rw-r--r--src/bin/elementary/elm_prefs_cc_mem.c35
-rw-r--r--src/bin/elementary/elm_prefs_cc_out.c52
-rw-r--r--src/bin/elementary/elm_prefs_cc_parse.c1401
-rw-r--r--src/bin/elementary/quicklaunch.c347
-rw-r--r--src/bin/elementary/run.c213
-rw-r--r--src/bin/elementary/test.c1030
-rw-r--r--src/bin/elementary/test.h12
-rw-r--r--src/bin/elementary/test_3d.c333
-rw-r--r--src/bin/elementary/test_access.c398
-rw-r--r--src/bin/elementary/test_actionslider.c209
-rw-r--r--src/bin/elementary/test_anim.c97
-rw-r--r--src/bin/elementary/test_application_server.c206
-rw-r--r--src/bin/elementary/test_bg.c270
-rw-r--r--src/bin/elementary/test_box.c882
-rw-r--r--src/bin/elementary/test_bubble.c176
-rw-r--r--src/bin/elementary/test_button.c205
-rw-r--r--src/bin/elementary/test_calendar.c375
-rw-r--r--src/bin/elementary/test_check.c190
-rw-r--r--src/bin/elementary/test_clock.c363
-rw-r--r--src/bin/elementary/test_cnp.c135
-rw-r--r--src/bin/elementary/test_colorclass.c24
-rw-r--r--src/bin/elementary/test_colorselector.c212
-rw-r--r--src/bin/elementary/test_combobox.c278
-rw-r--r--src/bin/elementary/test_config.c534
-rw-r--r--src/bin/elementary/test_conform.c195
-rw-r--r--src/bin/elementary/test_conform_indicator.c384
-rw-r--r--src/bin/elementary/test_ctxpopup.c433
-rw-r--r--src/bin/elementary/test_cursor.c473
-rw-r--r--src/bin/elementary/test_datetime.c107
-rw-r--r--src/bin/elementary/test_dayselector.c125
-rw-r--r--src/bin/elementary/test_disable.c207
-rw-r--r--src/bin/elementary/test_diskselector.c355
-rw-r--r--src/bin/elementary/test_dnd.c1399
-rw-r--r--src/bin/elementary/test_eio.c245
-rw-r--r--src/bin/elementary/test_entry.c2716
-rw-r--r--src/bin/elementary/test_entry_anchor.c236
-rw-r--r--src/bin/elementary/test_entry_anchor2.c109
-rw-r--r--src/bin/elementary/test_explode.c211
-rw-r--r--src/bin/elementary/test_explode.h1
-rw-r--r--src/bin/elementary/test_external.c182
-rw-r--r--src/bin/elementary/test_factory.c181
-rw-r--r--src/bin/elementary/test_fileselector.c589
-rw-r--r--src/bin/elementary/test_fileselector_button.c248
-rw-r--r--src/bin/elementary/test_fileselector_entry.c259
-rw-r--r--src/bin/elementary/test_flip.c711
-rw-r--r--src/bin/elementary/test_flip_page.c909
-rw-r--r--src/bin/elementary/test_flipselector.c188
-rw-r--r--src/bin/elementary/test_floating.c101
-rw-r--r--src/bin/elementary/test_focus.c902
-rw-r--r--src/bin/elementary/test_focus_custom_chain.c243
-rw-r--r--src/bin/elementary/test_focus_policy.c150
-rw-r--r--src/bin/elementary/test_focus_style.c234
-rw-r--r--src/bin/elementary/test_gengrid.c2231
-rw-r--r--src/bin/elementary/test_genlist.c5300
-rw-r--r--src/bin/elementary/test_gesture_layer.c400
-rw-r--r--src/bin/elementary/test_gesture_layer2.c808
-rw-r--r--src/bin/elementary/test_gesture_layer3.c585
-rw-r--r--src/bin/elementary/test_glview.c717
-rw-r--r--src/bin/elementary/test_glview_manygears.c951
-rw-r--r--src/bin/elementary/test_glview_simple.c290
-rw-r--r--src/bin/elementary/test_grid.c189
-rw-r--r--src/bin/elementary/test_hover.c249
-rw-r--r--src/bin/elementary/test_hoversel.c416
-rw-r--r--src/bin/elementary/test_icon.c437
-rw-r--r--src/bin/elementary/test_icon_animated.c57
-rw-r--r--src/bin/elementary/test_icon_desktops.c106
-rw-r--r--src/bin/elementary/test_image.c193
-rw-r--r--src/bin/elementary/test_index.c585
-rw-r--r--src/bin/elementary/test_inwin.c129
-rw-r--r--src/bin/elementary/test_label.c376
-rw-r--r--src/bin/elementary/test_launcher.c921
-rw-r--r--src/bin/elementary/test_layout.c271
-rw-r--r--src/bin/elementary/test_list.c1953
-rw-r--r--src/bin/elementary/test_main_menu.c77
-rw-r--r--src/bin/elementary/test_map.c1208
-rw-r--r--src/bin/elementary/test_menu.c312
-rw-r--r--src/bin/elementary/test_multi.c132
-rw-r--r--src/bin/elementary/test_multibuttonentry.c254
-rw-r--r--src/bin/elementary/test_naviframe.c388
-rw-r--r--src/bin/elementary/test_naviframe_complex.c367
-rw-r--r--src/bin/elementary/test_notify.c448
-rw-r--r--src/bin/elementary/test_panel.c369
-rw-r--r--src/bin/elementary/test_panes.c105
-rw-r--r--src/bin/elementary/test_photo.c100
-rw-r--r--src/bin/elementary/test_photocam.c616
-rw-r--r--src/bin/elementary/test_popup.c934
-rw-r--r--src/bin/elementary/test_prefs.c119
-rw-r--r--src/bin/elementary/test_progressbar.c397
-rw-r--r--src/bin/elementary/test_radio.c189
-rw-r--r--src/bin/elementary/test_scaling.c119
-rw-r--r--src/bin/elementary/test_scroller.c730
-rw-r--r--src/bin/elementary/test_segment_control.c156
-rw-r--r--src/bin/elementary/test_separator.c67
-rw-r--r--src/bin/elementary/test_slider.c307
-rw-r--r--src/bin/elementary/test_slideshow.c236
-rw-r--r--src/bin/elementary/test_spinner.c113
-rw-r--r--src/bin/elementary/test_store.c267
-rw-r--r--src/bin/elementary/test_sys_notify.c148
-rw-r--r--src/bin/elementary/test_systray.c192
-rw-r--r--src/bin/elementary/test_table.c539
-rw-r--r--src/bin/elementary/test_task_switcher.c400
-rw-r--r--src/bin/elementary/test_thumb.c63
-rw-r--r--src/bin/elementary/test_toolbar.c1314
-rw-r--r--src/bin/elementary/test_tooltip.c745
-rw-r--r--src/bin/elementary/test_transit.c770
-rw-r--r--src/bin/elementary/test_transit_bezier.c315
-rw-r--r--src/bin/elementary/test_video.c58
-rw-r--r--src/bin/elementary/test_weather.c168
-rw-r--r--src/bin/elementary/test_web.c693
-rw-r--r--src/bin/elementary/test_win_dialog.c48
-rw-r--r--src/bin/elementary/test_win_inline.c254
-rw-r--r--src/bin/elementary/test_win_keygrab.c243
-rw-r--r--src/bin/elementary/test_win_plug.c211
-rw-r--r--src/bin/elementary/test_win_socket.c202
-rw-r--r--src/bin/elementary/test_win_state.c630
-rw-r--r--src/bin/elementary/test_win_wm_rotation.c214
-rw-r--r--src/edje_external/elementary/Makefile.am59
-rw-r--r--src/edje_external/elementary/elm.c342
-rw-r--r--src/edje_external/elementary/elm_actionslider.c106
-rw-r--r--src/edje_external/elementary/elm_bg.c159
-rw-r--r--src/edje_external/elementary/elm_bubble.c175
-rw-r--r--src/edje_external/elementary/elm_button.c207
-rw-r--r--src/edje_external/elementary/elm_calendar.c200
-rw-r--r--src/edje_external/elementary/elm_check.c154
-rw-r--r--src/edje_external/elementary/elm_clock.c245
-rw-r--r--src/edje_external/elementary/elm_entry.c380
-rw-r--r--src/edje_external/elementary/elm_fileselector.c188
-rw-r--r--src/edje_external/elementary/elm_fileselector_button.c261
-rw-r--r--src/edje_external/elementary/elm_fileselector_entry.c261
-rw-r--r--src/edje_external/elementary/elm_frame.c131
-rw-r--r--src/edje_external/elementary/elm_gengrid.c475
-rw-r--r--src/edje_external/elementary/elm_genlist.c344
-rw-r--r--src/edje_external/elementary/elm_hoversel.c154
-rw-r--r--src/edje_external/elementary/elm_icon.c338
-rw-r--r--src/edje_external/elementary/elm_index.c109
-rw-r--r--src/edje_external/elementary/elm_label.c106
-rw-r--r--src/edje_external/elementary/elm_list.c325
-rw-r--r--src/edje_external/elementary/elm_map.c191
-rw-r--r--src/edje_external/elementary/elm_multibuttonentry.c134
-rw-r--r--src/edje_external/elementary/elm_naviframe.c135
-rw-r--r--src/edje_external/elementary/elm_notify.c295
-rw-r--r--src/edje_external/elementary/elm_panes.c197
-rw-r--r--src/edje_external/elementary/elm_photocam.c215
-rw-r--r--src/edje_external/elementary/elm_progressbar.c284
-rw-r--r--src/edje_external/elementary/elm_radio.c181
-rw-r--r--src/edje_external/elementary/elm_scroller.c109
-rw-r--r--src/edje_external/elementary/elm_segment_control.c82
-rw-r--r--src/edje_external/elementary/elm_slider.c345
-rw-r--r--src/edje_external/elementary/elm_slideshow.c187
-rw-r--r--src/edje_external/elementary/elm_spinner.c251
-rw-r--r--src/edje_external/elementary/elm_thumb.c154
-rw-r--r--src/edje_external/elementary/elm_toolbar.c320
-rw-r--r--src/edje_external/elementary/elm_video.c276
-rw-r--r--src/edje_external/elementary/elm_web.c217
-rw-r--r--src/edje_external/elementary/modules.inc36
-rw-r--r--src/edje_external/elementary/private.h135
-rw-r--r--src/examples/elementary/.gitignore156
-rw-r--r--src/examples/elementary/Makefile.am536
-rw-r--r--src/examples/elementary/actionslider_example_01.c136
-rw-r--r--src/examples/elementary/bg_cxx_example_01.cc23
-rw-r--r--src/examples/elementary/bg_cxx_example_02.cc33
-rw-r--r--src/examples/elementary/bg_example_01.c27
-rw-r--r--src/examples/elementary/bg_example_01.js15
-rw-r--r--src/examples/elementary/bg_example_02.c36
-rw-r--r--src/examples/elementary/bg_example_02.js19
-rw-r--r--src/examples/elementary/bg_example_03.c156
-rw-r--r--src/examples/elementary/box_cxx_example_02.cc142
-rw-r--r--src/examples/elementary/box_example_02.c163
-rw-r--r--src/examples/elementary/box_js_example_01.js34
-rw-r--r--src/examples/elementary/box_js_example_02.js86
-rw-r--r--src/examples/elementary/bubble_cxx_example_01.cc62
-rw-r--r--src/examples/elementary/bubble_example_01.c63
-rw-r--r--src/examples/elementary/bubble_example_01.js54
-rw-r--r--src/examples/elementary/button_cxx_example_00.cc35
-rw-r--r--src/examples/elementary/button_cxx_example_01.cc233
-rw-r--r--src/examples/elementary/button_example_00.c41
-rw-r--r--src/examples/elementary/button_example_00.js21
-rw-r--r--src/examples/elementary/button_example_01.c260
-rw-r--r--src/examples/elementary/button_example_01.js208
-rw-r--r--src/examples/elementary/calendar_cxx_example_01.cc21
-rw-r--r--src/examples/elementary/calendar_cxx_example_02.cc38
-rw-r--r--src/examples/elementary/calendar_cxx_example_03.cc23
-rw-r--r--src/examples/elementary/calendar_cxx_example_04.cc43
-rw-r--r--src/examples/elementary/calendar_cxx_example_05.cc50
-rw-r--r--src/examples/elementary/calendar_example_01.c34
-rw-r--r--src/examples/elementary/calendar_example_01.js14
-rw-r--r--src/examples/elementary/calendar_example_02.c53
-rw-r--r--src/examples/elementary/calendar_example_02.js17
-rw-r--r--src/examples/elementary/calendar_example_03.c37
-rw-r--r--src/examples/elementary/calendar_example_03.js15
-rw-r--r--src/examples/elementary/calendar_example_04.c55
-rw-r--r--src/examples/elementary/calendar_example_04.js32
-rw-r--r--src/examples/elementary/calendar_example_05.c62
-rw-r--r--src/examples/elementary/calendar_example_05.js29
-rw-r--r--src/examples/elementary/calendar_example_06.c89
-rw-r--r--src/examples/elementary/check_example_01.c51
-rw-r--r--src/examples/elementary/clock_cxx_example.cc53
-rw-r--r--src/examples/elementary/clock_example.c72
-rw-r--r--src/examples/elementary/clock_example.js43
-rw-r--r--src/examples/elementary/codegen_example.c140
-rw-r--r--src/examples/elementary/codegen_example.edc109
-rw-r--r--src/examples/elementary/colorselector_example_01.c92
-rw-r--r--src/examples/elementary/combobox_example_01.c135
-rw-r--r--src/examples/elementary/conformant_example_01.c68
-rw-r--r--src/examples/elementary/conformant_example_02.c77
-rw-r--r--src/examples/elementary/ctxpopup_example_01.c136
-rw-r--r--src/examples/elementary/datetime_cxx_example.cc51
-rw-r--r--src/examples/elementary/datetime_example.c55
-rw-r--r--src/examples/elementary/datetime_example.js42
-rw-r--r--src/examples/elementary/dayselector_example.c79
-rw-r--r--src/examples/elementary/dict.txt2913
-rw-r--r--src/examples/elementary/diskselector_example_01.c90
-rw-r--r--src/examples/elementary/diskselector_example_02.c346
-rw-r--r--src/examples/elementary/efl_thread_1.c79
-rw-r--r--src/examples/elementary/efl_thread_2.c95
-rw-r--r--src/examples/elementary/efl_thread_3.c99
-rw-r--r--src/examples/elementary/efl_thread_4.c129
-rw-r--r--src/examples/elementary/efl_thread_5.c112
-rw-r--r--src/examples/elementary/efl_thread_6.c170
-rw-r--r--src/examples/elementary/efl_thread_win32_1.c79
-rw-r--r--src/examples/elementary/efl_thread_win32_2.c95
-rw-r--r--src/examples/elementary/efl_thread_win32_3.c97
-rw-r--r--src/examples/elementary/efl_thread_win32_4.c121
-rw-r--r--src/examples/elementary/entry_example.c576
-rw-r--r--src/examples/elementary/evas3d_map_example.c1210
-rw-r--r--src/examples/elementary/evas3d_map_example.edc966
-rw-r--r--src/examples/elementary/evas3d_object_on_button_example.c289
-rw-r--r--src/examples/elementary/evas3d_scene_on_button_example.c282
-rw-r--r--src/examples/elementary/filemvc.c214
-rw-r--r--src/examples/elementary/fileselector_button_example.c168
-rw-r--r--src/examples/elementary/fileselector_entry_example.c157
-rw-r--r--src/examples/elementary/fileselector_example.c225
-rw-r--r--src/examples/elementary/fileviewlist.c79
-rw-r--r--src/examples/elementary/flip_example_01.c85
-rw-r--r--src/examples/elementary/flipselector_example.c182
-rw-r--r--src/examples/elementary/frame_example_01.c71
-rw-r--r--src/examples/elementary/general_funcs_example.c173
-rw-r--r--src/examples/elementary/gengrid_example.c615
-rw-r--r--src/examples/elementary/genlist_example_01.c79
-rw-r--r--src/examples/elementary/genlist_example_02.c192
-rw-r--r--src/examples/elementary/genlist_example_03.c118
-rw-r--r--src/examples/elementary/genlist_example_04.c353
-rw-r--r--src/examples/elementary/genlist_example_05.c418
-rw-r--r--src/examples/elementary/glview_cxx_example_01.cc263
-rw-r--r--src/examples/elementary/glview_example_01.c321
-rw-r--r--src/examples/elementary/hover_example_01.c74
-rw-r--r--src/examples/elementary/hoversel_cxx_example_01.cc84
-rw-r--r--src/examples/elementary/hoversel_example_01.c128
-rw-r--r--src/examples/elementary/icon_cxx_example_01.cc38
-rw-r--r--src/examples/elementary/icon_example_01.c44
-rw-r--r--src/examples/elementary/icon_example_01.js33
-rw-r--r--src/examples/elementary/image_example_01.c46
-rw-r--r--src/examples/elementary/index_example_01.c177
-rw-r--r--src/examples/elementary/index_example_02.c139
-rw-r--r--src/examples/elementary/inwin_example.c147
-rw-r--r--src/examples/elementary/label_example_01.c75
-rw-r--r--src/examples/elementary/label_example_02.c76
-rw-r--r--src/examples/elementary/label_example_03.c138
-rw-r--r--src/examples/elementary/layout_example.edc180
-rw-r--r--src/examples/elementary/layout_example.js63
-rw-r--r--src/examples/elementary/layout_example_01.c139
-rw-r--r--src/examples/elementary/layout_example_02.c75
-rw-r--r--src/examples/elementary/layout_example_03.c86
-rw-r--r--src/examples/elementary/list_example_01.c57
-rw-r--r--src/examples/elementary/list_example_02.c66
-rw-r--r--src/examples/elementary/list_example_03.c438
-rw-r--r--src/examples/elementary/location_cxx_example_01.cc82
-rw-r--r--src/examples/elementary/location_example_01.c91
-rw-r--r--src/examples/elementary/map_example_01.c110
-rw-r--r--src/examples/elementary/map_example_02.c266
-rw-r--r--src/examples/elementary/map_example_03.c195
-rw-r--r--src/examples/elementary/mapbuf_example.c112
-rw-r--r--src/examples/elementary/menu_cxx_example_01.cc69
-rw-r--r--src/examples/elementary/menu_example_01.c68
-rw-r--r--src/examples/elementary/menu_example_01.js37
-rw-r--r--src/examples/elementary/naviframe_example.c47
-rw-r--r--src/examples/elementary/notify_example_01.c71
-rw-r--r--src/examples/elementary/panel_example_01.c65
-rw-r--r--src/examples/elementary/panes_example.c110
-rw-r--r--src/examples/elementary/performance/HowTo13
-rw-r--r--src/examples/elementary/performance/Makefile.am44
-rw-r--r--src/examples/elementary/performance/Tools.h19
-rw-r--r--src/examples/elementary/performance/background.pngbin0 -> 177255 bytes
-rw-r--r--src/examples/elementary/performance/camera_light.c354
-rw-r--r--src/examples/elementary/performance/graphical.c616
-rw-r--r--src/examples/elementary/performance/graphical_struct.h90
-rw-r--r--src/examples/elementary/performance/initial_config.xml11
-rw-r--r--src/examples/elementary/performance/layout.edc170
-rw-r--r--src/examples/elementary/performance/performance.c957
-rw-r--r--src/examples/elementary/performance/target_texture.pngbin0 -> 2123166 bytes
-rw-r--r--src/examples/elementary/performance/tools_private.h50
-rw-r--r--src/examples/elementary/photocam_example_01.c159
-rw-r--r--src/examples/elementary/popup_cxx_example_01.cc32
-rw-r--r--src/examples/elementary/popup_example_01.c52
-rw-r--r--src/examples/elementary/popup_example_01.js32
-rw-r--r--src/examples/elementary/popup_example_02.c77
-rw-r--r--src/examples/elementary/popup_example_03.c93
-rw-r--r--src/examples/elementary/prefs_data_example.c91
-rw-r--r--src/examples/elementary/prefs_example_01.c109
-rw-r--r--src/examples/elementary/prefs_example_01.epc84
-rw-r--r--src/examples/elementary/prefs_example_02.c110
-rw-r--r--src/examples/elementary/prefs_example_02.epc65
-rw-r--r--src/examples/elementary/prefs_example_03.c112
-rw-r--r--src/examples/elementary/prefs_example_03.edc150
-rw-r--r--src/examples/elementary/prefs_example_03.epc112
-rw-r--r--src/examples/elementary/progressbar_example.c308
-rw-r--r--src/examples/elementary/radio_cxx_example_01.cc79
-rw-r--r--src/examples/elementary/radio_example_01.c87
-rw-r--r--src/examples/elementary/radio_example_01.js65
-rw-r--r--src/examples/elementary/radio_example_02.c94
-rw-r--r--src/examples/elementary/scroller_example_01.c138
-rw-r--r--src/examples/elementary/segment_control_example.c70
-rw-r--r--src/examples/elementary/separator_cxx_example_01.cc51
-rw-r--r--src/examples/elementary/separator_example_01.c49
-rw-r--r--src/examples/elementary/separator_example_01.js41
-rw-r--r--src/examples/elementary/slider_cxx_example.cc109
-rw-r--r--src/examples/elementary/slider_example.c136
-rw-r--r--src/examples/elementary/slider_example.js104
-rw-r--r--src/examples/elementary/slideshow_example.c276
-rw-r--r--src/examples/elementary/sphere_hunter/EFL_defeat.pngbin0 -> 88373 bytes
-rw-r--r--src/examples/elementary/sphere_hunter/EFL_victory.pngbin0 -> 108064 bytes
-rw-r--r--src/examples/elementary/sphere_hunter/Makefile.am42
-rw-r--r--src/examples/elementary/sphere_hunter/evas_3d_sphere_hunter.c858
-rw-r--r--src/examples/elementary/sphere_hunter/score.jpgbin0 -> 51305 bytes
-rw-r--r--src/examples/elementary/sphere_hunter/sphere_hunter.edc251
-rw-r--r--src/examples/elementary/spinner_cxx_example.cc95
-rw-r--r--src/examples/elementary/spinner_example.c120
-rw-r--r--src/examples/elementary/spinner_example.js90
-rw-r--r--src/examples/elementary/table_cxx_example_01.cc43
-rw-r--r--src/examples/elementary/table_cxx_example_02.cc46
-rw-r--r--src/examples/elementary/table_example_01.c48
-rw-r--r--src/examples/elementary/table_example_01.js34
-rw-r--r--src/examples/elementary/table_example_02.c51
-rw-r--r--src/examples/elementary/table_example_02.js38
-rw-r--r--src/examples/elementary/theme_example.edc194
-rw-r--r--src/examples/elementary/theme_example_01.c74
-rw-r--r--src/examples/elementary/theme_example_02.c65
-rw-r--r--src/examples/elementary/thumb_cxx_example_01.cc48
-rw-r--r--src/examples/elementary/thumb_example_01.c63
-rw-r--r--src/examples/elementary/thumb_example_01.js38
-rw-r--r--src/examples/elementary/toolbar_example_01.c83
-rw-r--r--src/examples/elementary/toolbar_example_02.c74
-rw-r--r--src/examples/elementary/toolbar_example_03.c67
-rw-r--r--src/examples/elementary/track_example_01.c68
-rw-r--r--src/examples/elementary/transit_example_01.c38
-rw-r--r--src/examples/elementary/transit_example_02.c80
-rw-r--r--src/examples/elementary/transit_example_03.c312
-rw-r--r--src/examples/elementary/transit_example_04.c162
-rw-r--r--src/examples/elementary/twitter_example_01.edc89
-rw-r--r--src/examples/elementary/twitter_example_01.js82
-rw-r--r--src/examples/elementary/web_example_01.c49
-rw-r--r--src/examples/elementary/web_example_02.c617
-rw-r--r--src/examples/elementary/win_example.c328
-rw-r--r--src/lib/elementary/.gitignore13
-rw-r--r--src/lib/elementary/Elementary.h.in279
-rw-r--r--src/lib/elementary/Elementary.hh.in142
-rw-r--r--src/lib/elementary/Elementary_Cursor.h87
-rw-r--r--src/lib/elementary/Makefile.am716
-rw-r--r--src/lib/elementary/elc_combobox.c635
-rw-r--r--src/lib/elementary/elc_combobox.h64
-rw-r--r--src/lib/elementary/elc_combobox_legacy.h11
-rw-r--r--src/lib/elementary/elc_ctxpopup.c1479
-rw-r--r--src/lib/elementary/elc_ctxpopup.h74
-rw-r--r--src/lib/elementary/elc_ctxpopup_eo.h2
-rw-r--r--src/lib/elementary/elc_ctxpopup_legacy.h12
-rw-r--r--src/lib/elementary/elc_fileselector.c2511
-rw-r--r--src/lib/elementary/elc_fileselector.h80
-rw-r--r--src/lib/elementary/elc_fileselector_button.c517
-rw-r--r--src/lib/elementary/elc_fileselector_button.h75
-rw-r--r--src/lib/elementary/elc_fileselector_button_eo.h1
-rw-r--r--src/lib/elementary/elc_fileselector_button_legacy.h13
-rw-r--r--src/lib/elementary/elc_fileselector_common.h3
-rw-r--r--src/lib/elementary/elc_fileselector_entry.c558
-rw-r--r--src/lib/elementary/elc_fileselector_entry.h84
-rw-r--r--src/lib/elementary/elc_fileselector_entry_eo.h1
-rw-r--r--src/lib/elementary/elc_fileselector_entry_legacy.h14
-rw-r--r--src/lib/elementary/elc_fileselector_eo.h11
-rw-r--r--src/lib/elementary/elc_fileselector_legacy.h414
-rw-r--r--src/lib/elementary/elc_hoversel.c971
-rw-r--r--src/lib/elementary/elc_hoversel.h68
-rw-r--r--src/lib/elementary/elc_hoversel_eo.h2
-rw-r--r--src/lib/elementary/elc_hoversel_legacy.h12
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c2064
-rw-r--r--src/lib/elementary/elc_multibuttonentry.h69
-rw-r--r--src/lib/elementary/elc_multibuttonentry_common.h33
-rw-r--r--src/lib/elementary/elc_multibuttonentry_eo.h2
-rw-r--r--src/lib/elementary/elc_multibuttonentry_legacy.h13
-rw-r--r--src/lib/elementary/elc_naviframe.c2007
-rw-r--r--src/lib/elementary/elc_naviframe.h102
-rw-r--r--src/lib/elementary/elc_naviframe_common.h40
-rw-r--r--src/lib/elementary/elc_naviframe_eo.h12
-rw-r--r--src/lib/elementary/elc_naviframe_legacy.h2
-rw-r--r--src/lib/elementary/elc_player.c750
-rw-r--r--src/lib/elementary/elc_popup.c1869
-rw-r--r--src/lib/elementary/elc_popup.h125
-rw-r--r--src/lib/elementary/elc_popup_eo.h11
-rw-r--r--src/lib/elementary/elc_popup_legacy.h11
-rw-r--r--src/lib/elementary/elc_scrolled_entry.c197
-rw-r--r--src/lib/elementary/elementary_js.cc290
-rw-r--r--src/lib/elementary/elm_access.c1453
-rw-r--r--src/lib/elementary/elm_access.eo13
-rw-r--r--src/lib/elementary/elm_access.h275
-rw-r--r--src/lib/elementary/elm_actionslider.c654
-rw-r--r--src/lib/elementary/elm_actionslider.eo82
-rw-r--r--src/lib/elementary/elm_actionslider.h61
-rw-r--r--src/lib/elementary/elm_actionslider_eo.h1
-rw-r--r--src/lib/elementary/elm_actionslider_legacy.h11
-rw-r--r--src/lib/elementary/elm_app.h297
-rw-r--r--src/lib/elementary/elm_app_client.c332
-rw-r--r--src/lib/elementary/elm_app_client.eo64
-rw-r--r--src/lib/elementary/elm_app_client.h3
-rw-r--r--src/lib/elementary/elm_app_client_eo.h11
-rw-r--r--src/lib/elementary/elm_app_client_view.c315
-rw-r--r--src/lib/elementary/elm_app_client_view.eo126
-rw-r--r--src/lib/elementary/elm_app_client_view.h3
-rw-r--r--src/lib/elementary/elm_app_client_view_eo.h3
-rw-r--r--src/lib/elementary/elm_app_common.c56
-rw-r--r--src/lib/elementary/elm_app_common.h9
-rw-r--r--src/lib/elementary/elm_app_server.c453
-rw-r--r--src/lib/elementary/elm_app_server.eo103
-rw-r--r--src/lib/elementary/elm_app_server.h3
-rw-r--r--src/lib/elementary/elm_app_server_eet.c310
-rw-r--r--src/lib/elementary/elm_app_server_eet.h46
-rw-r--r--src/lib/elementary/elm_app_server_eo.h15
-rw-r--r--src/lib/elementary/elm_app_server_view.c388
-rw-r--r--src/lib/elementary/elm_app_server_view.eo107
-rw-r--r--src/lib/elementary/elm_app_server_view.h3
-rw-r--r--src/lib/elementary/elm_app_server_view_eo.h1
-rw-r--r--src/lib/elementary/elm_atspi_app_object.c73
-rw-r--r--src/lib/elementary/elm_atspi_app_object.eo12
-rw-r--r--src/lib/elementary/elm_atspi_app_object.h6
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c4702
-rw-r--r--src/lib/elementary/elm_atspi_bridge.eo22
-rw-r--r--src/lib/elementary/elm_atspi_bridge.h8
-rw-r--r--src/lib/elementary/elm_authors.h172
-rw-r--r--src/lib/elementary/elm_bg.c287
-rw-r--r--src/lib/elementary/elm_bg.eo117
-rw-r--r--src/lib/elementary/elm_bg.h40
-rw-r--r--src/lib/elementary/elm_bg_eo.h1
-rw-r--r--src/lib/elementary/elm_bg_legacy.h94
-rw-r--r--src/lib/elementary/elm_box.c725
-rw-r--r--src/lib/elementary/elm_box.eo298
-rw-r--r--src/lib/elementary/elm_box.h84
-rw-r--r--src/lib/elementary/elm_box_common.h101
-rw-r--r--src/lib/elementary/elm_box_eo.h1
-rw-r--r--src/lib/elementary/elm_box_legacy.h13
-rw-r--r--src/lib/elementary/elm_bubble.c289
-rw-r--r--src/lib/elementary/elm_bubble.eo54
-rw-r--r--src/lib/elementary/elm_bubble.h72
-rw-r--r--src/lib/elementary/elm_bubble_eo.h1
-rw-r--r--src/lib/elementary/elm_bubble_legacy.h13
-rw-r--r--src/lib/elementary/elm_button.c445
-rw-r--r--src/lib/elementary/elm_button.eo102
-rw-r--r--src/lib/elementary/elm_button.h78
-rw-r--r--src/lib/elementary/elm_button_eo.h1
-rw-r--r--src/lib/elementary/elm_button_legacy.h11
-rw-r--r--src/lib/elementary/elm_cache.h31
-rw-r--r--src/lib/elementary/elm_calendar.c1874
-rw-r--r--src/lib/elementary/elm_calendar.eo452
-rw-r--r--src/lib/elementary/elm_calendar.h60
-rw-r--r--src/lib/elementary/elm_calendar_common.h21
-rw-r--r--src/lib/elementary/elm_calendar_eo.h1
-rw-r--r--src/lib/elementary/elm_calendar_legacy.h30
-rw-r--r--src/lib/elementary/elm_check.c460
-rw-r--r--src/lib/elementary/elm_check.eo60
-rw-r--r--src/lib/elementary/elm_check.h70
-rw-r--r--src/lib/elementary/elm_check_eo.h1
-rw-r--r--src/lib/elementary/elm_check_legacy.h11
-rw-r--r--src/lib/elementary/elm_clock.c960
-rw-r--r--src/lib/elementary/elm_clock.eo235
-rw-r--r--src/lib/elementary/elm_clock.h68
-rw-r--r--src/lib/elementary/elm_clock_eo.h1
-rw-r--r--src/lib/elementary/elm_clock_legacy.h14
-rw-r--r--src/lib/elementary/elm_cnp.c5139
-rw-r--r--src/lib/elementary/elm_cnp.h545
-rw-r--r--src/lib/elementary/elm_color_class.c826
-rw-r--r--src/lib/elementary/elm_color_class.h81
-rw-r--r--src/lib/elementary/elm_color_item.eo43
-rw-r--r--src/lib/elementary/elm_colorselector.c2546
-rw-r--r--src/lib/elementary/elm_colorselector.eo127
-rw-r--r--src/lib/elementary/elm_colorselector.h48
-rw-r--r--src/lib/elementary/elm_colorselector_common.h33
-rw-r--r--src/lib/elementary/elm_colorselector_eo.h1
-rw-r--r--src/lib/elementary/elm_colorselector_legacy.h11
-rw-r--r--src/lib/elementary/elm_combobox.eo78
-rw-r--r--src/lib/elementary/elm_config.c4185
-rw-r--r--src/lib/elementary/elm_config.h2109
-rw-r--r--src/lib/elementary/elm_conform.c1020
-rw-r--r--src/lib/elementary/elm_conform.h61
-rw-r--r--src/lib/elementary/elm_conform_eo.h11
-rw-r--r--src/lib/elementary/elm_conform_legacy.h13
-rw-r--r--src/lib/elementary/elm_conformant.eo20
-rw-r--r--src/lib/elementary/elm_container.c13
-rw-r--r--src/lib/elementary/elm_container.eo45
-rw-r--r--src/lib/elementary/elm_container.h6
-rw-r--r--src/lib/elementary/elm_ctxpopup.eo243
-rw-r--r--src/lib/elementary/elm_ctxpopup_item.eo52
-rw-r--r--src/lib/elementary/elm_cursor.h120
-rw-r--r--src/lib/elementary/elm_datetime.c1130
-rw-r--r--src/lib/elementary/elm_datetime.eo305
-rw-r--r--src/lib/elementary/elm_datetime.h208
-rw-r--r--src/lib/elementary/elm_datetime_common.h9
-rw-r--r--src/lib/elementary/elm_datetime_eo.h1
-rw-r--r--src/lib/elementary/elm_datetime_legacy.h15
-rw-r--r--src/lib/elementary/elm_dayselector.c617
-rw-r--r--src/lib/elementary/elm_dayselector.eo164
-rw-r--r--src/lib/elementary/elm_dayselector.h86
-rw-r--r--src/lib/elementary/elm_dayselector_eo.h1
-rw-r--r--src/lib/elementary/elm_dayselector_item.eo7
-rw-r--r--src/lib/elementary/elm_dayselector_legacy.h11
-rw-r--r--src/lib/elementary/elm_dbus_menu.c1034
-rw-r--r--src/lib/elementary/elm_debug.h28
-rw-r--r--src/lib/elementary/elm_deprecated.h1642
-rw-r--r--src/lib/elementary/elm_diskselector.c1832
-rw-r--r--src/lib/elementary/elm_diskselector.eo217
-rw-r--r--src/lib/elementary/elm_diskselector.h78
-rw-r--r--src/lib/elementary/elm_diskselector_common.h8
-rw-r--r--src/lib/elementary/elm_diskselector_eo.h2
-rw-r--r--src/lib/elementary/elm_diskselector_item.eo90
-rw-r--r--src/lib/elementary/elm_diskselector_legacy.h15
-rw-r--r--src/lib/elementary/elm_entry.c5858
-rw-r--r--src/lib/elementary/elm_entry.eo1001
-rw-r--r--src/lib/elementary/elm_entry.h315
-rw-r--r--src/lib/elementary/elm_entry_common.h259
-rw-r--r--src/lib/elementary/elm_entry_eo.h1
-rw-r--r--src/lib/elementary/elm_entry_legacy.h73
-rw-r--r--src/lib/elementary/elm_factory.c342
-rw-r--r--src/lib/elementary/elm_factory.h6
-rw-r--r--src/lib/elementary/elm_fileselector.eo68
-rw-r--r--src/lib/elementary/elm_fileselector_button.eo106
-rw-r--r--src/lib/elementary/elm_fileselector_entry.eo112
-rw-r--r--src/lib/elementary/elm_finger.h45
-rw-r--r--src/lib/elementary/elm_flip.c2069
-rw-r--r--src/lib/elementary/elm_flip.eo250
-rw-r--r--src/lib/elementary/elm_flip.h49
-rw-r--r--src/lib/elementary/elm_flip_eo.h1
-rw-r--r--src/lib/elementary/elm_flip_legacy.h25
-rw-r--r--src/lib/elementary/elm_flipselector.c811
-rw-r--r--src/lib/elementary/elm_flipselector.eo174
-rw-r--r--src/lib/elementary/elm_flipselector.h70
-rw-r--r--src/lib/elementary/elm_flipselector_eo.h2
-rw-r--r--src/lib/elementary/elm_flipselector_item.eo54
-rw-r--r--src/lib/elementary/elm_flipselector_legacy.h15
-rw-r--r--src/lib/elementary/elm_focus.h402
-rw-r--r--src/lib/elementary/elm_focus_item.h61
-rw-r--r--src/lib/elementary/elm_font.c207
-rw-r--r--src/lib/elementary/elm_font.h99
-rw-r--r--src/lib/elementary/elm_frame.c269
-rw-r--r--src/lib/elementary/elm_frame.eo64
-rw-r--r--src/lib/elementary/elm_frame.h59
-rw-r--r--src/lib/elementary/elm_frame_eo.h1
-rw-r--r--src/lib/elementary/elm_frame_legacy.h11
-rw-r--r--src/lib/elementary/elm_gen.h59
-rw-r--r--src/lib/elementary/elm_gen_common.h74
-rw-r--r--src/lib/elementary/elm_general.eot254
-rw-r--r--src/lib/elementary/elm_general.h309
-rw-r--r--src/lib/elementary/elm_gengrid.c5778
-rw-r--r--src/lib/elementary/elm_gengrid.eo592
-rw-r--r--src/lib/elementary/elm_gengrid.h288
-rw-r--r--src/lib/elementary/elm_gengrid_common.h398
-rw-r--r--src/lib/elementary/elm_gengrid_eo.h14
-rw-r--r--src/lib/elementary/elm_gengrid_item.eo228
-rw-r--r--src/lib/elementary/elm_gengrid_legacy.h215
-rw-r--r--src/lib/elementary/elm_gengrid_pan.eo18
-rw-r--r--src/lib/elementary/elm_genlist.c8452
-rw-r--r--src/lib/elementary/elm_genlist.eo598
-rw-r--r--src/lib/elementary/elm_genlist.h428
-rw-r--r--src/lib/elementary/elm_genlist_common.h350
-rw-r--r--src/lib/elementary/elm_genlist_eo.h14
-rw-r--r--src/lib/elementary/elm_genlist_item.eo441
-rw-r--r--src/lib/elementary/elm_genlist_legacy.h35
-rw-r--r--src/lib/elementary/elm_genlist_pan.eo21
-rw-r--r--src/lib/elementary/elm_gesture_layer.c4162
-rw-r--r--src/lib/elementary/elm_gesture_layer.eo160
-rw-r--r--src/lib/elementary/elm_gesture_layer.h79
-rw-r--r--src/lib/elementary/elm_gesture_layer_common.h351
-rw-r--r--src/lib/elementary/elm_gesture_layer_eo.h1
-rw-r--r--src/lib/elementary/elm_gesture_layer_extra_gestures.c241
-rw-r--r--src/lib/elementary/elm_gesture_layer_legacy.h54
-rw-r--r--src/lib/elementary/elm_getting_started.h195
-rw-r--r--src/lib/elementary/elm_glview.c600
-rw-r--r--src/lib/elementary/elm_glview.eo221
-rw-r--r--src/lib/elementary/elm_glview.h38
-rw-r--r--src/lib/elementary/elm_glview_common.h11
-rw-r--r--src/lib/elementary/elm_glview_eo.h1
-rw-r--r--src/lib/elementary/elm_glview_legacy.h92
-rw-r--r--src/lib/elementary/elm_grid.c274
-rw-r--r--src/lib/elementary/elm_grid.eo65
-rw-r--r--src/lib/elementary/elm_grid.h29
-rw-r--r--src/lib/elementary/elm_grid_eo.h11
-rw-r--r--src/lib/elementary/elm_grid_legacy.h37
-rw-r--r--src/lib/elementary/elm_helper.c50
-rw-r--r--src/lib/elementary/elm_helper.h110
-rw-r--r--src/lib/elementary/elm_hover.c851
-rw-r--r--src/lib/elementary/elm_hover.eo85
-rw-r--r--src/lib/elementary/elm_hover.h91
-rw-r--r--src/lib/elementary/elm_hover_eo.h1
-rw-r--r--src/lib/elementary/elm_hover_legacy.h36
-rw-r--r--src/lib/elementary/elm_hoversel.eo111
-rw-r--r--src/lib/elementary/elm_hoversel_item.eo32
-rw-r--r--src/lib/elementary/elm_icon.c954
-rw-r--r--src/lib/elementary/elm_icon.eo114
-rw-r--r--src/lib/elementary/elm_icon.h154
-rw-r--r--src/lib/elementary/elm_icon_eo.h1
-rw-r--r--src/lib/elementary/elm_icon_legacy.h13
-rw-r--r--src/lib/elementary/elm_image.c1665
-rw-r--r--src/lib/elementary/elm_image.eo265
-rw-r--r--src/lib/elementary/elm_image.h53
-rw-r--r--src/lib/elementary/elm_image_eo.h11
-rw-r--r--src/lib/elementary/elm_image_legacy.h323
-rw-r--r--src/lib/elementary/elm_index.c1725
-rw-r--r--src/lib/elementary/elm_index.eo255
-rw-r--r--src/lib/elementary/elm_index.h74
-rw-r--r--src/lib/elementary/elm_index_eo.h12
-rw-r--r--src/lib/elementary/elm_index_item.eo48
-rw-r--r--src/lib/elementary/elm_index_legacy.h15
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.c610
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.eo436
-rw-r--r--src/lib/elementary/elm_interface_atspi_accessible.h156
-rw-r--r--src/lib/elementary/elm_interface_atspi_action.c23
-rw-r--r--src/lib/elementary/elm_interface_atspi_action.eo76
-rw-r--r--src/lib/elementary/elm_interface_atspi_component.c152
-rw-r--r--src/lib/elementary/elm_interface_atspi_component.eo102
-rw-r--r--src/lib/elementary/elm_interface_atspi_editable_text.c11
-rw-r--r--src/lib/elementary/elm_interface_atspi_editable_text.eo49
-rw-r--r--src/lib/elementary/elm_interface_atspi_image.c55
-rw-r--r--src/lib/elementary/elm_interface_atspi_image.eo43
-rw-r--r--src/lib/elementary/elm_interface_atspi_selection.c11
-rw-r--r--src/lib/elementary/elm_interface_atspi_selection.eo61
-rw-r--r--src/lib/elementary/elm_interface_atspi_text.c20
-rw-r--r--src/lib/elementary/elm_interface_atspi_text.eo225
-rw-r--r--src/lib/elementary/elm_interface_atspi_text.h19
-rw-r--r--src/lib/elementary/elm_interface_atspi_value.c11
-rw-r--r--src/lib/elementary/elm_interface_atspi_value.eo37
-rw-r--r--src/lib/elementary/elm_interface_atspi_widget_action.c143
-rw-r--r--src/lib/elementary/elm_interface_atspi_widget_action.eo24
-rw-r--r--src/lib/elementary/elm_interface_atspi_widget_action.h24
-rw-r--r--src/lib/elementary/elm_interface_atspi_window.c9
-rw-r--r--src/lib/elementary/elm_interface_atspi_window.eo12
-rw-r--r--src/lib/elementary/elm_interface_atspi_window.h56
-rw-r--r--src/lib/elementary/elm_interface_fileselector.c8
-rw-r--r--src/lib/elementary/elm_interface_fileselector.eo180
-rw-r--r--src/lib/elementary/elm_interface_fileselector.h15
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c4552
-rw-r--r--src/lib/elementary/elm_interface_scrollable.eo628
-rw-r--r--src/lib/elementary/elm_interface_scrollable.h241
-rw-r--r--src/lib/elementary/elm_interfaces.h26
-rw-r--r--src/lib/elementary/elm_intro.h.in34
-rw-r--r--src/lib/elementary/elm_inwin.c169
-rw-r--r--src/lib/elementary/elm_inwin.eo31
-rw-r--r--src/lib/elementary/elm_inwin.h55
-rw-r--r--src/lib/elementary/elm_inwin_eo.h1
-rw-r--r--src/lib/elementary/elm_inwin_legacy.h66
-rw-r--r--src/lib/elementary/elm_label.c624
-rw-r--r--src/lib/elementary/elm_label.eo136
-rw-r--r--src/lib/elementary/elm_label.h50
-rw-r--r--src/lib/elementary/elm_label_eo.h11
-rw-r--r--src/lib/elementary/elm_label_legacy.h11
-rw-r--r--src/lib/elementary/elm_layout.c1807
-rw-r--r--src/lib/elementary/elm_layout.eo499
-rw-r--r--src/lib/elementary/elm_layout.h179
-rw-r--r--src/lib/elementary/elm_layout_common.h53
-rw-r--r--src/lib/elementary/elm_layout_eo.h11
-rw-r--r--src/lib/elementary/elm_layout_legacy.h104
-rw-r--r--src/lib/elementary/elm_list.c3285
-rw-r--r--src/lib/elementary/elm_list.eo477
-rw-r--r--src/lib/elementary/elm_list.h108
-rw-r--r--src/lib/elementary/elm_list_eo.h12
-rw-r--r--src/lib/elementary/elm_list_item.eo123
-rw-r--r--src/lib/elementary/elm_list_legacy.h15
-rw-r--r--src/lib/elementary/elm_macros.h16
-rw-r--r--src/lib/elementary/elm_main.c1782
-rw-r--r--src/lib/elementary/elm_map.c5561
-rw-r--r--src/lib/elementary/elm_map.eo647
-rw-r--r--src/lib/elementary/elm_map.h83
-rw-r--r--src/lib/elementary/elm_map_common.h607
-rw-r--r--src/lib/elementary/elm_map_eo.h2
-rw-r--r--src/lib/elementary/elm_map_legacy.h13
-rw-r--r--src/lib/elementary/elm_map_pan.eo30
-rw-r--r--src/lib/elementary/elm_mapbuf.c420
-rw-r--r--src/lib/elementary/elm_mapbuf.eo144
-rw-r--r--src/lib/elementary/elm_mapbuf.h48
-rw-r--r--src/lib/elementary/elm_mapbuf_eo.h11
-rw-r--r--src/lib/elementary/elm_mapbuf_legacy.h14
-rw-r--r--src/lib/elementary/elm_menu.c1410
-rw-r--r--src/lib/elementary/elm_menu.eo89
-rw-r--r--src/lib/elementary/elm_menu.h49
-rw-r--r--src/lib/elementary/elm_menu_eo.h2
-rw-r--r--src/lib/elementary/elm_menu_item.eo92
-rw-r--r--src/lib/elementary/elm_menu_legacy.h34
-rw-r--r--src/lib/elementary/elm_mirroring.h60
-rw-r--r--src/lib/elementary/elm_module.c240
-rw-r--r--src/lib/elementary/elm_multibuttonentry.eo201
-rw-r--r--src/lib/elementary/elm_multibuttonentry_item.eo35
-rw-r--r--src/lib/elementary/elm_naviframe.eo169
-rw-r--r--src/lib/elementary/elm_naviframe_item.eo84
-rw-r--r--src/lib/elementary/elm_need.h110
-rw-r--r--src/lib/elementary/elm_notify.c695
-rw-r--r--src/lib/elementary/elm_notify.eo105
-rw-r--r--src/lib/elementary/elm_notify.h45
-rw-r--r--src/lib/elementary/elm_notify_common.h1
-rw-r--r--src/lib/elementary/elm_notify_eo.h11
-rw-r--r--src/lib/elementary/elm_notify_legacy.h36
-rw-r--r--src/lib/elementary/elm_object.h510
-rw-r--r--src/lib/elementary/elm_object_item.h79
-rw-r--r--src/lib/elementary/elm_pan.eo65
-rw-r--r--src/lib/elementary/elm_panel.c1527
-rw-r--r--src/lib/elementary/elm_panel.eo88
-rw-r--r--src/lib/elementary/elm_panel.h48
-rw-r--r--src/lib/elementary/elm_panel_common.h27
-rw-r--r--src/lib/elementary/elm_panel_eo.h1
-rw-r--r--src/lib/elementary/elm_panel_legacy.h12
-rw-r--r--src/lib/elementary/elm_panes.c541
-rw-r--r--src/lib/elementary/elm_panes.eo147
-rw-r--r--src/lib/elementary/elm_panes.h65
-rw-r--r--src/lib/elementary/elm_panes_eo.h1
-rw-r--r--src/lib/elementary/elm_panes_legacy.h14
-rw-r--r--src/lib/elementary/elm_photo.c420
-rw-r--r--src/lib/elementary/elm_photo.eo69
-rw-r--r--src/lib/elementary/elm_photo.h36
-rw-r--r--src/lib/elementary/elm_photo_eo.h11
-rw-r--r--src/lib/elementary/elm_photo_legacy.h47
-rw-r--r--src/lib/elementary/elm_photocam.c2224
-rw-r--r--src/lib/elementary/elm_photocam.eo213
-rw-r--r--src/lib/elementary/elm_photocam.h91
-rw-r--r--src/lib/elementary/elm_photocam_eo.h2
-rw-r--r--src/lib/elementary/elm_photocam_legacy.h58
-rw-r--r--src/lib/elementary/elm_photocam_pan.eo26
-rw-r--r--src/lib/elementary/elm_player.eo29
-rw-r--r--src/lib/elementary/elm_plug.c192
-rw-r--r--src/lib/elementary/elm_plug.eo42
-rw-r--r--src/lib/elementary/elm_plug.h42
-rw-r--r--src/lib/elementary/elm_plug_eo.h1
-rw-r--r--src/lib/elementary/elm_plug_legacy.h11
-rw-r--r--src/lib/elementary/elm_popup.eo197
-rw-r--r--src/lib/elementary/elm_popup_item.eo15
-rw-r--r--src/lib/elementary/elm_prefs.c1891
-rw-r--r--src/lib/elementary/elm_prefs.eo225
-rw-r--r--src/lib/elementary/elm_prefs.h86
-rw-r--r--src/lib/elementary/elm_prefs_common.h319
-rw-r--r--src/lib/elementary/elm_prefs_data.c1069
-rw-r--r--src/lib/elementary/elm_prefs_data.h298
-rw-r--r--src/lib/elementary/elm_prefs_edd.x326
-rw-r--r--src/lib/elementary/elm_prefs_eo.h11
-rw-r--r--src/lib/elementary/elm_prefs_legacy.h65
-rw-r--r--src/lib/elementary/elm_priv.h611
-rw-r--r--src/lib/elementary/elm_progressbar.c559
-rw-r--r--src/lib/elementary/elm_progressbar.eo174
-rw-r--r--src/lib/elementary/elm_progressbar.h74
-rw-r--r--src/lib/elementary/elm_progressbar_common.h12
-rw-r--r--src/lib/elementary/elm_progressbar_eo.h1
-rw-r--r--src/lib/elementary/elm_progressbar_legacy.h14
-rw-r--r--src/lib/elementary/elm_radio.c409
-rw-r--r--src/lib/elementary/elm_radio.eo92
-rw-r--r--src/lib/elementary/elm_radio.h75
-rw-r--r--src/lib/elementary/elm_radio_eo.h1
-rw-r--r--src/lib/elementary/elm_radio_legacy.h11
-rw-r--r--src/lib/elementary/elm_removed.h6447
-rw-r--r--src/lib/elementary/elm_route.c264
-rw-r--r--src/lib/elementary/elm_route.eo48
-rw-r--r--src/lib/elementary/elm_route.h21
-rw-r--r--src/lib/elementary/elm_route_eo.h1
-rw-r--r--src/lib/elementary/elm_route_legacy.h11
-rw-r--r--src/lib/elementary/elm_scale.h36
-rw-r--r--src/lib/elementary/elm_scroll.h167
-rw-r--r--src/lib/elementary/elm_scroller.c1417
-rw-r--r--src/lib/elementary/elm_scroller.eo136
-rw-r--r--src/lib/elementary/elm_scroller.h76
-rw-r--r--src/lib/elementary/elm_scroller_eo.h11
-rw-r--r--src/lib/elementary/elm_scroller_legacy.h560
-rw-r--r--src/lib/elementary/elm_segment_control.c844
-rw-r--r--src/lib/elementary/elm_segment_control.eo151
-rw-r--r--src/lib/elementary/elm_segment_control.h72
-rw-r--r--src/lib/elementary/elm_segment_control_eo.h2
-rw-r--r--src/lib/elementary/elm_segment_control_item.eo45
-rw-r--r--src/lib/elementary/elm_segment_control_legacy.h15
-rw-r--r--src/lib/elementary/elm_separator.c114
-rw-r--r--src/lib/elementary/elm_separator.eo27
-rw-r--r--src/lib/elementary/elm_separator.h29
-rw-r--r--src/lib/elementary/elm_separator_eo.h1
-rw-r--r--src/lib/elementary/elm_separator_legacy.h12
-rw-r--r--src/lib/elementary/elm_slider.c1304
-rw-r--r--src/lib/elementary/elm_slider.eo295
-rw-r--r--src/lib/elementary/elm_slider.h86
-rw-r--r--src/lib/elementary/elm_slider_common.h12
-rw-r--r--src/lib/elementary/elm_slider_eo.h1
-rw-r--r--src/lib/elementary/elm_slider_legacy.h14
-rw-r--r--src/lib/elementary/elm_slideshow.c737
-rw-r--r--src/lib/elementary/elm_slideshow.eo316
-rw-r--r--src/lib/elementary/elm_slideshow.h85
-rw-r--r--src/lib/elementary/elm_slideshow_common.h36
-rw-r--r--src/lib/elementary/elm_slideshow_eo.h2
-rw-r--r--src/lib/elementary/elm_slideshow_item.eo33
-rw-r--r--src/lib/elementary/elm_slideshow_legacy.h15
-rw-r--r--src/lib/elementary/elm_spinner.c1712
-rw-r--r--src/lib/elementary/elm_spinner.eo248
-rw-r--r--src/lib/elementary/elm_spinner.h68
-rw-r--r--src/lib/elementary/elm_spinner_eo.h1
-rw-r--r--src/lib/elementary/elm_spinner_legacy.h45
-rw-r--r--src/lib/elementary/elm_store.c731
-rw-r--r--src/lib/elementary/elm_store.h407
-rw-r--r--src/lib/elementary/elm_sys_notify.c288
-rw-r--r--src/lib/elementary/elm_sys_notify.eo95
-rw-r--r--src/lib/elementary/elm_sys_notify.h85
-rw-r--r--src/lib/elementary/elm_sys_notify_dbus.c398
-rw-r--r--src/lib/elementary/elm_sys_notify_dbus.eo14
-rw-r--r--src/lib/elementary/elm_sys_notify_interface.c9
-rw-r--r--src/lib/elementary/elm_sys_notify_interface.eo66
-rw-r--r--src/lib/elementary/elm_systray.c518
-rw-r--r--src/lib/elementary/elm_systray.eo124
-rw-r--r--src/lib/elementary/elm_systray.h4
-rw-r--r--src/lib/elementary/elm_systray_common.h6
-rw-r--r--src/lib/elementary/elm_systray_eo.h11
-rw-r--r--src/lib/elementary/elm_systray_watcher.c116
-rw-r--r--src/lib/elementary/elm_systray_watcher.h10
-rw-r--r--src/lib/elementary/elm_table.c417
-rw-r--r--src/lib/elementary/elm_table.eo132
-rw-r--r--src/lib/elementary/elm_table.h40
-rw-r--r--src/lib/elementary/elm_table_eo.h1
-rw-r--r--src/lib/elementary/elm_table_legacy.h45
-rw-r--r--src/lib/elementary/elm_theme.c958
-rw-r--r--src/lib/elementary/elm_theme.h585
-rw-r--r--src/lib/elementary/elm_thumb.c878
-rw-r--r--src/lib/elementary/elm_thumb.eo221
-rw-r--r--src/lib/elementary/elm_thumb.h67
-rw-r--r--src/lib/elementary/elm_thumb_common.h28
-rw-r--r--src/lib/elementary/elm_thumb_eo.h1
-rw-r--r--src/lib/elementary/elm_thumb_legacy.h70
-rw-r--r--src/lib/elementary/elm_toolbar.c4002
-rw-r--r--src/lib/elementary/elm_toolbar.eo402
-rw-r--r--src/lib/elementary/elm_toolbar.h81
-rw-r--r--src/lib/elementary/elm_toolbar_common.h21
-rw-r--r--src/lib/elementary/elm_toolbar_eo.h13
-rw-r--r--src/lib/elementary/elm_toolbar_item.eo323
-rw-r--r--src/lib/elementary/elm_toolbar_legacy.h64
-rw-r--r--src/lib/elementary/elm_tooltip.h247
-rw-r--r--src/lib/elementary/elm_transit.c2571
-rw-r--r--src/lib/elementary/elm_transit.h995
-rw-r--r--src/lib/elementary/elm_url.c152
-rw-r--r--src/lib/elementary/elm_util.c65
-rw-r--r--src/lib/elementary/elm_video.c484
-rw-r--r--src/lib/elementary/elm_video.eo122
-rw-r--r--src/lib/elementary/elm_video.h65
-rw-r--r--src/lib/elementary/elm_video_eo.h2
-rw-r--r--src/lib/elementary/elm_video_legacy.h63
-rw-r--r--src/lib/elementary/elm_view_form.c266
-rw-r--r--src/lib/elementary/elm_view_form.eo32
-rw-r--r--src/lib/elementary/elm_view_form.h10
-rw-r--r--src/lib/elementary/elm_view_list.c429
-rw-r--r--src/lib/elementary/elm_view_list.eo71
-rw-r--r--src/lib/elementary/elm_view_list.h10
-rw-r--r--src/lib/elementary/elm_web.eo544
-rw-r--r--src/lib/elementary/elm_web.h110
-rw-r--r--src/lib/elementary/elm_web2.c227
-rw-r--r--src/lib/elementary/elm_web_common.h283
-rw-r--r--src/lib/elementary/elm_web_eo.h1
-rw-r--r--src/lib/elementary/elm_web_legacy.h50
-rw-r--r--src/lib/elementary/elm_widget.c6003
-rw-r--r--src/lib/elementary/elm_widget.eo871
-rw-r--r--src/lib/elementary/elm_widget.h847
-rw-r--r--src/lib/elementary/elm_widget_actionslider.h66
-rw-r--r--src/lib/elementary/elm_widget_bg.h68
-rw-r--r--src/lib/elementary/elm_widget_box.h97
-rw-r--r--src/lib/elementary/elm_widget_bubble.h62
-rw-r--r--src/lib/elementary/elm_widget_button.h68
-rw-r--r--src/lib/elementary/elm_widget_calendar.h86
-rw-r--r--src/lib/elementary/elm_widget_check.h62
-rw-r--r--src/lib/elementary/elm_widget_clipper.h66
-rw-r--r--src/lib/elementary/elm_widget_clock.h85
-rw-r--r--src/lib/elementary/elm_widget_colorselector.h150
-rw-r--r--src/lib/elementary/elm_widget_combobox.h84
-rw-r--r--src/lib/elementary/elm_widget_conform.h97
-rw-r--r--src/lib/elementary/elm_widget_container.h45
-rw-r--r--src/lib/elementary/elm_widget_ctxpopup.h101
-rw-r--r--src/lib/elementary/elm_widget_datetime.h127
-rw-r--r--src/lib/elementary/elm_widget_dayselector.h78
-rw-r--r--src/lib/elementary/elm_widget_diskselector.h114
-rw-r--r--src/lib/elementary/elm_widget_entry.h180
-rw-r--r--src/lib/elementary/elm_widget_fileselector.h167
-rw-r--r--src/lib/elementary/elm_widget_fileselector_button.h84
-rw-r--r--src/lib/elementary/elm_widget_fileselector_entry.h68
-rw-r--r--src/lib/elementary/elm_widget_flip.h109
-rw-r--r--src/lib/elementary/elm_widget_flipselector.h93
-rw-r--r--src/lib/elementary/elm_widget_frame.h63
-rw-r--r--src/lib/elementary/elm_widget_gengrid.h227
-rw-r--r--src/lib/elementary/elm_widget_genlist.h371
-rw-r--r--src/lib/elementary/elm_widget_glview.h82
-rw-r--r--src/lib/elementary/elm_widget_grid.h31
-rw-r--r--src/lib/elementary/elm_widget_hover.h80
-rw-r--r--src/lib/elementary/elm_widget_hoversel.h102
-rw-r--r--src/lib/elementary/elm_widget_icon.h89
-rw-r--r--src/lib/elementary/elm_widget_image.h120
-rw-r--r--src/lib/elementary/elm_widget_index.h115
-rw-r--r--src/lib/elementary/elm_widget_inwin.h60
-rw-r--r--src/lib/elementary/elm_widget_item.eo539
-rw-r--r--src/lib/elementary/elm_widget_label.h59
-rw-r--r--src/lib/elementary/elm_widget_layout.h79
-rw-r--r--src/lib/elementary/elm_widget_list.h143
-rw-r--r--src/lib/elementary/elm_widget_map.h534
-rw-r--r--src/lib/elementary/elm_widget_mapbuf.h74
-rw-r--r--src/lib/elementary/elm_widget_menu.h107
-rw-r--r--src/lib/elementary/elm_widget_multibuttonentry.h153
-rw-r--r--src/lib/elementary/elm_widget_naviframe.h136
-rw-r--r--src/lib/elementary/elm_widget_notify.h70
-rw-r--r--src/lib/elementary/elm_widget_panel.h79
-rw-r--r--src/lib/elementary/elm_widget_panes.h77
-rw-r--r--src/lib/elementary/elm_widget_photo.h76
-rw-r--r--src/lib/elementary/elm_widget_photocam.h172
-rw-r--r--src/lib/elementary/elm_widget_player.h79
-rw-r--r--src/lib/elementary/elm_widget_plug.h51
-rw-r--r--src/lib/elementary/elm_widget_popup.h118
-rw-r--r--src/lib/elementary/elm_widget_prefs.h131
-rw-r--r--src/lib/elementary/elm_widget_progressbar.h82
-rw-r--r--src/lib/elementary/elm_widget_radio.h73
-rw-r--r--src/lib/elementary/elm_widget_route.h84
-rw-r--r--src/lib/elementary/elm_widget_scroller.h71
-rw-r--r--src/lib/elementary/elm_widget_segment_control.h88
-rw-r--r--src/lib/elementary/elm_widget_separator.h61
-rw-r--r--src/lib/elementary/elm_widget_slider.h89
-rw-r--r--src/lib/elementary/elm_widget_slideshow.h103
-rw-r--r--src/lib/elementary/elm_widget_spinner.h90
-rw-r--r--src/lib/elementary/elm_widget_table.h31
-rw-r--r--src/lib/elementary/elm_widget_thumb.h99
-rw-r--r--src/lib/elementary/elm_widget_toolbar.h137
-rw-r--r--src/lib/elementary/elm_widget_video.h65
-rw-r--r--src/lib/elementary/elm_widget_web.h66
-rw-r--r--src/lib/elementary/elm_win.c5773
-rw-r--r--src/lib/elementary/elm_win.eo1316
-rw-r--r--src/lib/elementary/elm_win.h116
-rw-r--r--src/lib/elementary/elm_win_common.h76
-rw-r--r--src/lib/elementary/elm_win_eo.h11
-rw-r--r--src/lib/elementary/elm_win_legacy.h246
-rw-r--r--src/lib/elementary/elm_win_standard.c36
-rw-r--r--src/lib/elementary/elm_win_standard.eo7
-rw-r--r--src/lib/elementary/elm_win_standard.h3
-rw-r--r--src/lib/elementary/els_box.c500
-rw-r--r--src/lib/elementary/els_box.h1
-rw-r--r--src/lib/elementary/els_cursor.c714
-rw-r--r--src/lib/elementary/els_tooltip.c1066
-rw-r--r--src/lib/elementary/elu_ews_wm.c532
-rw-r--r--src/modules/elementary/Makefile.am10
-rw-r--r--src/modules/elementary/access_output/Makefile.am22
-rw-r--r--src/modules/elementary/access_output/mod.c137
-rw-r--r--src/modules/elementary/datetime_input_ctxpopup/Makefile.am23
-rw-r--r--src/modules/elementary/datetime_input_ctxpopup/datetime_input_ctxpopup.c398
-rw-r--r--src/modules/elementary/prefs/Makefile.am56
-rw-r--r--src/modules/elementary/prefs/elm_button.c72
-rw-r--r--src/modules/elementary/prefs/elm_check.c99
-rw-r--r--src/modules/elementary/prefs/elm_datetime.c100
-rw-r--r--src/modules/elementary/prefs/elm_entry.c283
-rw-r--r--src/modules/elementary/prefs/elm_horizontal_box.c99
-rw-r--r--src/modules/elementary/prefs/elm_horizontal_frame.c118
-rw-r--r--src/modules/elementary/prefs/elm_label.c37
-rw-r--r--src/modules/elementary/prefs/elm_prefs_swallow.edc15
-rw-r--r--src/modules/elementary/prefs/elm_separator.c59
-rw-r--r--src/modules/elementary/prefs/elm_slider.c124
-rw-r--r--src/modules/elementary/prefs/elm_spinner.c124
-rw-r--r--src/modules/elementary/prefs/elm_swallow.c63
-rw-r--r--src/modules/elementary/prefs/elm_vertical_box.c99
-rw-r--r--src/modules/elementary/prefs/elm_vertical_frame.c117
-rw-r--r--src/modules/elementary/prefs/item_widgets.inc9
-rw-r--r--src/modules/elementary/prefs/page_widgets.inc4
-rw-r--r--src/modules/elementary/prefs/prefs_iface.c287
-rw-r--r--src/modules/elementary/prefs/private.h127
-rw-r--r--src/modules/elementary/test_entry/Makefile.am22
-rw-r--r--src/modules/elementary/test_entry/mod.c51
-rw-r--r--src/modules/elementary/test_map/Makefile.am22
-rw-r--r--src/modules/elementary/test_map/mod.c103
-rw-r--r--src/modules/elementary/web/Makefile.am6
-rw-r--r--src/modules/elementary/web/none/.gitignore1
-rw-r--r--src/modules/elementary/web/none/Makefile.am40
-rw-r--r--src/modules/elementary/web/none/elm_web_none.c359
-rw-r--r--src/modules/elementary/web/none/elm_web_none.eo51
-rw-r--r--src/modules/elementary/web/webkit2/.gitignore1
-rw-r--r--src/modules/elementary/web/webkit2/Makefile.am42
-rw-r--r--src/modules/elementary/web/webkit2/elm_web_webkit2.c1157
-rw-r--r--src/modules/elementary/web/webkit2/elm_web_webkit2.eo53
-rw-r--r--src/static_libs/atspi/Makefile.am4
-rw-r--r--src/static_libs/atspi/atspi-constants.h1333
-rw-r--r--src/tests/elementary/.gitignore8
-rw-r--r--src/tests/elementary/Makefile.am112
-rw-r--r--src/tests/elementary/elm_cxx_suite.cc5
-rw-r--r--src/tests/elementary/elm_suite.c123
-rw-r--r--src/tests/elementary/elm_suite.h72
-rw-r--r--src/tests/elementary/elm_test_actionslider.c29
-rw-r--r--src/tests/elementary/elm_test_atspi.c509
-rw-r--r--src/tests/elementary/elm_test_bg.c10
-rw-r--r--src/tests/elementary/elm_test_box.c29
-rw-r--r--src/tests/elementary/elm_test_bubble.c30
-rw-r--r--src/tests/elementary/elm_test_button.c49
-rw-r--r--src/tests/elementary/elm_test_calendar.c29
-rw-r--r--src/tests/elementary/elm_test_check.c75
-rw-r--r--src/tests/elementary/elm_test_clock.c30
-rw-r--r--src/tests/elementary/elm_test_colorselector.c57
-rw-r--r--src/tests/elementary/elm_test_conformant.c29
-rw-r--r--src/tests/elementary/elm_test_ctxpopup.c29
-rw-r--r--src/tests/elementary/elm_test_datetime.c29
-rw-r--r--src/tests/elementary/elm_test_dayselector.c30
-rw-r--r--src/tests/elementary/elm_test_diskselector.c29
-rw-r--r--src/tests/elementary/elm_test_entry.c362
-rw-r--r--src/tests/elementary/elm_test_fileselector.c92
-rw-r--r--src/tests/elementary/elm_test_fileselector_button.c29
-rw-r--r--src/tests/elementary/elm_test_fileselector_entry.c29
-rw-r--r--src/tests/elementary/elm_test_flip.c30
-rw-r--r--src/tests/elementary/elm_test_flipselector.c30
-rw-r--r--src/tests/elementary/elm_test_frame.c30
-rw-r--r--src/tests/elementary/elm_test_gengrid.c83
-rw-r--r--src/tests/elementary/elm_test_genlist.c190
-rw-r--r--src/tests/elementary/elm_test_glview.c34
-rw-r--r--src/tests/elementary/elm_test_grid.c30
-rw-r--r--src/tests/elementary/elm_test_helper.c45
-rw-r--r--src/tests/elementary/elm_test_helper.h8
-rw-r--r--src/tests/elementary/elm_test_hover.c30
-rw-r--r--src/tests/elementary/elm_test_hoversel.c30
-rw-r--r--src/tests/elementary/elm_test_icon.c30
-rw-r--r--src/tests/elementary/elm_test_image.c168
-rw-r--r--src/tests/elementary/elm_test_index.c30
-rw-r--r--src/tests/elementary/elm_test_init.c18
-rw-r--r--src/tests/elementary/elm_test_inwin.c30
-rw-r--r--src/tests/elementary/elm_test_label.c30
-rw-r--r--src/tests/elementary/elm_test_layout.c30
-rw-r--r--src/tests/elementary/elm_test_list.c246
-rw-r--r--src/tests/elementary/elm_test_map.c30
-rw-r--r--src/tests/elementary/elm_test_mapbuf.c30
-rw-r--r--src/tests/elementary/elm_test_menu.c30
-rw-r--r--src/tests/elementary/elm_test_multibuttonentry.c30
-rw-r--r--src/tests/elementary/elm_test_naviframe.c30
-rw-r--r--src/tests/elementary/elm_test_notify.c30
-rw-r--r--src/tests/elementary/elm_test_panel.c31
-rw-r--r--src/tests/elementary/elm_test_panes.c30
-rw-r--r--src/tests/elementary/elm_test_photo.c30
-rw-r--r--src/tests/elementary/elm_test_photocam.c30
-rw-r--r--src/tests/elementary/elm_test_player.c30
-rw-r--r--src/tests/elementary/elm_test_plug.c30
-rw-r--r--src/tests/elementary/elm_test_popup.c30
-rw-r--r--src/tests/elementary/elm_test_prefs.c30
-rw-r--r--src/tests/elementary/elm_test_progressbar.c30
-rw-r--r--src/tests/elementary/elm_test_radio.c30
-rw-r--r--src/tests/elementary/elm_test_scroller.c30
-rw-r--r--src/tests/elementary/elm_test_segmentcontrol.c30
-rw-r--r--src/tests/elementary/elm_test_separator.c30
-rw-r--r--src/tests/elementary/elm_test_slider.c30
-rw-r--r--src/tests/elementary/elm_test_slideshow.c30
-rw-r--r--src/tests/elementary/elm_test_spinner.c31
-rw-r--r--src/tests/elementary/elm_test_table.c30
-rw-r--r--src/tests/elementary/elm_test_thumb.c30
-rw-r--r--src/tests/elementary/elm_test_toolbar.c30
-rw-r--r--src/tests/elementary/elm_test_video.c30
-rw-r--r--src/tests/elementary/elm_test_web.c30
-rw-r--r--src/tests/elementary/elm_test_win.c205
1057 files changed, 310913 insertions, 0 deletions
diff --git a/src/bin/elementary/.gitignore b/src/bin/elementary/.gitignore
new file mode 100644
index 0000000000..5cbbb5c189
--- /dev/null
+++ b/src/bin/elementary/.gitignore
@@ -0,0 +1,7 @@
+/elementary_config
+/elementary_quicklaunch
+/elementary_run
+/elementary_test
+/elementary_codegen
+/elementary_testql
+/elm_prefs_cc
diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am
new file mode 100644
index 0000000000..46db673e5d
--- /dev/null
+++ b/src/bin/elementary/Makefile.am
@@ -0,0 +1,195 @@
+AUTOMAKE_OPTIONS = 1.4 foreign
+
+MAINTAINERCLEANFILES = Makefile.in
+
+AM_CPPFLAGS = \
+-I$(top_srcdir) \
+-I$(top_srcdir)/src/lib \
+-I$(top_builddir)/src/lib \
+-I$(top_srcdir)/src/bin \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" \
+@ELEMENTARY_CFLAGS@
+
+bin_PROGRAMS = \
+@ELEMENTARY_TEST_PRG@ \
+@ELEMENTARY_CONFIG_PRG@ \
+@ELEMENTARY_CODEGEN_PRG@ \
+@ELM_PREFS_CC_PRG@
+
+if BUILD_QUICKLAUNCH
+bin_PROGRAMS += elementary_quicklaunch elementary_run
+endif
+
+EXTRA_PROGRAMS = elementary_test elementary_config elementary_codegen elm_prefs_cc
+
+elementary_test_SOURCES = \
+test.c \
+test_explode.c \
+test_explode.h \
+test_3d.c \
+test_access.c \
+test_actionslider.c \
+test_anim.c \
+test_application_server.c \
+test_bg.c \
+test_box.c \
+test_bubble.c \
+test_button.c \
+test_calendar.c \
+test_check.c \
+test_clock.c \
+test_cnp.c \
+test_colorselector.c \
+test_colorclass.c \
+test_combobox.c \
+test_config.c \
+test_conform.c \
+test_conform_indicator.c \
+test_ctxpopup.c \
+test_cursor.c \
+test_datetime.c \
+test_dayselector.c \
+test_disable.c \
+test_diskselector.c \
+test_dnd.c \
+test_eio.c \
+test_entry.c \
+test_entry_anchor.c \
+test_entry_anchor2.c \
+test_external.c \
+test_fileselector_button.c \
+test_fileselector.c \
+test_fileselector_entry.c \
+test_flip.c \
+test_flip_page.c \
+test_flipselector.c \
+test_floating.c \
+test_focus.c \
+test_focus_custom_chain.c \
+test_focus_policy.c \
+test_focus_style.c \
+test_gengrid.c \
+test_genlist.c \
+test_gesture_layer.c \
+test_gesture_layer2.c \
+test_gesture_layer3.c \
+test_glview_simple.c \
+test_glview.c \
+test_glview_manygears.c \
+test_grid.c \
+test_hover.c \
+test_hoversel.c \
+test_icon.c \
+test_icon_desktops.c \
+test_icon_animated.c \
+test_image.c \
+test_index.c \
+test_inwin.c \
+test_label.c \
+test_launcher.c \
+test_layout.c \
+test_list.c \
+test_map.c \
+test_main_menu.c \
+test_menu.c \
+test_multi.c \
+test_multibuttonentry.c \
+test_naviframe.c \
+test_naviframe_complex.c \
+test_notify.c \
+test_panel.c \
+test_panes.c \
+test_photo.c \
+test_photocam.c \
+test_popup.c \
+test_prefs.c \
+test_progressbar.c \
+test_radio.c \
+test_scaling.c \
+test_scroller.c \
+test_segment_control.c \
+test_separator.c \
+test_slider.c \
+test_slideshow.c \
+test_spinner.c \
+test_store.c \
+test_sys_notify.c \
+test_systray.c \
+test_task_switcher.c \
+test_table.c \
+test_thumb.c \
+test_toolbar.c \
+test_tooltip.c \
+test_transit.c \
+test_transit_bezier.c \
+test_video.c \
+test_weather.c \
+test_web.c \
+test_win_inline.c \
+test_win_keygrab.c \
+test_win_socket.c \
+test_win_plug.c \
+test_win_state.c \
+test_win_wm_rotation.c \
+test_win_dialog.c \
+test.h
+
+elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
+ @ELEMENTARY_LIBS@
+elementary_test_CFLAGS =
+elementary_test_LDFLAGS =
+
+elementary_config_SOURCES = \
+config.c
+
+elementary_config_LDADD = $(top_builddir)/src/lib/libelementary.la \
+ @ELEMENTARY_LIBS@
+elementary_config_LDFLAGS =
+
+elementary_codegen_SOURCES = \
+elementary_codegen.c
+
+elementary_codegen_LDADD = \
+ $(top_builddir)/src/lib/libelementary.la \
+ @ELEMENTARY_LIBS@
+elementary_codegen_LDFLAGS =
+
+noinst_HEADERS = \
+elm_prefs_cc.h
+
+elm_prefs_cc_SOURCES = \
+elm_prefs_cc.c \
+elm_prefs_cc_mem.c \
+elm_prefs_cc_out.c \
+elm_prefs_cc_parse.c \
+elm_prefs_cc_handlers.c
+
+elm_prefs_cc_LDADD = \
+$(top_builddir)/src/lib/libelementary.la \
+@ELEMENTARY_LIBS@
+
+if BUILD_QUICKLAUNCH
+elementary_quicklaunch_SOURCES = quicklaunch.c
+elementary_quicklaunch_LDADD = $(top_builddir)/src/lib/libelementary.la \
+ @ELEMENTARY_LIBS@
+elementary_quicklaunch_LDFLAGS =
+
+if BUILD_RUN
+elementary_run_CPPFLAGS = -I$(top_srcdir) \
+-I$(top_srcdir)/src/lib \
+-I$(top_builddir)/src/lib \
+-I$(top_srcdir)/src/bin \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\"
+
+elementary_run_SOURCES = run.c
+elementary_run_LDADD =
+elementary_run_LDFLAGS =
+endif
+endif
+
+EXTRA_DIST = \
+test_factory.c
diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c
new file mode 100644
index 0000000000..d63bcef157
--- /dev/null
+++ b/src/bin/elementary/config.c
@@ -0,0 +1,4115 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <Elementary.h>
+
+typedef struct _Theme Theme;
+typedef struct _Fonts_Data Fonts_Data;
+typedef struct _Elm_Text_Class_Data Elm_Text_Class_Data;
+typedef struct _Elm_Font_Size_Data Elm_Font_Size_Data;
+
+struct _Theme
+{
+ const char *label;
+ const char *name;
+ const char *path;
+ Eina_Bool in_search_path;
+};
+
+static const Eina_List *tsel = NULL;
+static Eina_List *themes = NULL;
+
+struct _Elm_Text_Class_Data
+{
+ const char *name;
+ const char *desc;
+ const char *font;
+ const char *style;
+ Evas_Font_Size size;
+};
+
+struct _Elm_Font_Size_Data
+{
+ const char *size_str;
+ Evas_Font_Size size;
+};
+
+struct _Fonts_Data
+{
+ Eina_List *text_classes;
+
+ Eina_Hash *font_hash;
+ Eina_List *font_px_list;
+ Eina_List *font_scale_list;
+
+ const char *cur_font;
+ const char *cur_style;
+ double cur_size;
+};
+
+#define ELM_LIST_DISABLE(list) \
+ do \
+ { \
+ const Eina_List *_l = elm_list_items_get(list); \
+ if (_l) \
+ { \
+ elm_list_item_show(eina_list_data_get(_l));\
+ elm_object_disabled_set(list, EINA_TRUE); \
+ } \
+ } \
+ while (0)
+
+#define ELM_LIST_ENABLE(list) \
+ do \
+ { \
+ elm_object_disabled_set(list, EINA_FALSE); \
+ } \
+ while (0)
+
+#define LABEL_FRAME_ADD(label) \
+ do \
+ { \
+ pd = elm_frame_add(win); \
+ evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0); \
+ evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); \
+ elm_object_style_set(pd, "pad_medium"); \
+ elm_box_pack_end(bx, pd); \
+ evas_object_show(pd); \
+ \
+ lb = elm_label_add(win); \
+ evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); \
+ evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); \
+ elm_object_text_set(lb, label); \
+ elm_object_content_set(pd, lb); \
+ evas_object_show(lb); \
+ } \
+ while (0)
+
+#define CHECK_ADD(_label, _desc, _cb, _cb_param) \
+ ck = elm_check_add(win); \
+ elm_object_text_set(ck, _label); \
+ elm_object_tooltip_text_set(ck, _desc); \
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); \
+ evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); \
+ elm_box_pack_end(bx, ck); \
+ evas_object_show(ck); \
+ evas_object_smart_callback_add(ck, "changed", _cb, _cb_param);
+
+static int quiet = 0;
+static int interactive = 1;
+
+static const char *theme_set = NULL;
+static const char *finger_size_set = NULL;
+static const char *scale_set = NULL;
+static const char *web_backend = NULL;
+static Fonts_Data fndata = {NULL, NULL, NULL, NULL, NULL, NULL, 0.0};
+static Evas_Object *web_backend_entry = NULL;
+
+static void
+_font_styles_list_sel(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info);
+
+static void
+config_exit(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Elm_Text_Class_Data *tc_data;
+ Elm_Font_Size_Data *sd;
+
+ EINA_LIST_FREE(fndata.text_classes, tc_data)
+ {
+ eina_stringshare_del(tc_data->name);
+ eina_stringshare_del(tc_data->desc);
+ eina_stringshare_del(tc_data->font);
+ eina_stringshare_del(tc_data->style);
+ free(tc_data);
+ }
+
+ elm_font_available_hash_del(fndata.font_hash);
+ fndata.font_hash = NULL;
+
+ EINA_LIST_FREE(fndata.font_px_list, sd)
+ {
+ eina_stringshare_del(sd->size_str);
+ free(sd);
+ }
+
+ EINA_LIST_FREE(fndata.font_scale_list, sd)
+ {
+ eina_stringshare_del(sd->size_str);
+ free(sd);
+ }
+
+ if (fndata.cur_font) eina_stringshare_del(fndata.cur_font);
+ fndata.cur_font = NULL;
+
+ if (fndata.cur_style) eina_stringshare_del(fndata.cur_style);
+ fndata.cur_style = NULL;
+
+ elm_config_save();
+ elm_exit(); /* exit the program's main loop that runs in elm_run() */
+}
+
+static void
+scroll_animation_disable_change(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sb = elm_config_scroll_animation_disable_get();
+
+ if (val == sb) return;
+ elm_config_scroll_animation_disable_set(val);
+ elm_config_all_flush();
+}
+
+static void
+scroll_accel_factor_change(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ double bf = elm_config_scroll_accel_factor_get();
+ double val = elm_slider_value_get(obj);
+
+ if (fabs(bf - val) < DBL_EPSILON) return;
+ elm_config_scroll_accel_factor_set(val);
+ elm_config_all_flush();
+}
+
+static void
+sb_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sb = elm_config_scroll_bounce_enabled_get();
+
+ if (val == sb) return;
+ elm_config_scroll_bounce_enabled_set(val);
+ elm_config_all_flush();
+
+ /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/
+}
+
+static void
+ss_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool ss = elm_config_scroll_thumbscroll_smooth_start_get();
+
+ if (val == ss) return;
+ elm_config_scroll_thumbscroll_smooth_start_set(val);
+ elm_config_all_flush();
+}
+
+static void
+bf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+bf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double bf = elm_config_scroll_bounce_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (bf == val) return;
+ elm_config_scroll_bounce_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+ps_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+ps_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double ps = elm_config_scroll_page_scroll_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (ps == val) return;
+ elm_config_scroll_page_scroll_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+bis_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+bis_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double bis = elm_config_scroll_bring_in_scroll_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (bis == val) return;
+ elm_config_scroll_bring_in_scroll_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+zf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+zf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double zf = elm_config_scroll_zoom_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (zf == val) return;
+ elm_config_scroll_zoom_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+smooth_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 100.0))) / 100.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+smooth_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double zf = elm_config_scroll_thumbscroll_smooth_amount_get();
+ double val = elm_slider_value_get(obj);
+
+ if (zf == val) return;
+ elm_config_scroll_thumbscroll_smooth_amount_set(val);
+ elm_config_all_flush();
+}
+
+static void
+smooth_win_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 100.0))) / 100.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+smooth_win_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double zf = elm_config_scroll_thumbscroll_smooth_time_window_get();
+ double val = elm_slider_value_get(obj);
+
+ if (zf == val) return;
+ elm_config_scroll_thumbscroll_smooth_time_window_set(val);
+ elm_config_all_flush();
+}
+
+static void
+ts_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sb = elm_config_scroll_thumbscroll_enabled_get();
+
+ if (val == sb) return;
+ elm_config_scroll_thumbscroll_enabled_set(val);
+ elm_config_all_flush();
+
+ /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/
+}
+
+static void
+tst_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tst_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tst = elm_config_scroll_thumbscroll_threshold_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tst == val) return;
+ elm_config_scroll_thumbscroll_threshold_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsht_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsht_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tst = elm_config_scroll_thumbscroll_hold_threshold_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tst == val) return;
+ elm_config_scroll_thumbscroll_hold_threshold_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsmt_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsmt_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsmt = elm_config_scroll_thumbscroll_momentum_threshold_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsmt == val) return;
+ elm_config_scroll_thumbscroll_momentum_threshold_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsfdt_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsfdt_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsfdt = elm_config_scroll_thumbscroll_flick_distance_tolerance_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsfdt == val) return;
+ elm_config_scroll_thumbscroll_flick_distance_tolerance_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsf = elm_config_scroll_thumbscroll_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsf == val) return;
+ elm_config_scroll_thumbscroll_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsmf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsmf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsmf = elm_config_scroll_thumbscroll_min_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsmf == val) return;
+ elm_config_scroll_thumbscroll_min_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsfs_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsfs_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsfs = elm_config_scroll_thumbscroll_friction_standard_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsfs == val) return;
+ elm_config_scroll_thumbscroll_friction_standard_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsbf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsbf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsbf = elm_config_scroll_thumbscroll_border_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsbf == val) return;
+ elm_config_scroll_thumbscroll_border_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tssf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 20.0))) / 20.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tssf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tssf = elm_config_scroll_thumbscroll_sensitivity_friction_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tssf == val) return;
+ elm_config_scroll_thumbscroll_sensitivity_friction_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsat_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsat_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsat = elm_config_scroll_thumbscroll_acceleration_threshold_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsat == val) return;
+ elm_config_scroll_thumbscroll_acceleration_threshold_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsatl_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsatl_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsatl = elm_config_scroll_thumbscroll_acceleration_time_limit_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsatl == val) return;
+ elm_config_scroll_thumbscroll_acceleration_time_limit_set(val);
+ elm_config_all_flush();
+}
+
+static void
+tsaw_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+tsaw_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double tsaw = elm_config_scroll_thumbscroll_acceleration_weight_get();
+ double val = elm_slider_value_get(obj);
+
+ if (tsaw == val) return;
+ elm_config_scroll_thumbscroll_acceleration_weight_set(val);
+ elm_config_all_flush();
+}
+
+static void
+cf_enable(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_cache_flush_enabled_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ if (cf == val) return;
+ elm_object_disabled_set((Evas_Object *)data, !val);
+ elm_config_cache_flush_enabled_set(val);
+ elm_config_all_flush();
+}
+
+static void
+cf_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 5.0))) / 5.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+cf_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double cf = elm_config_cache_flush_interval_get();
+ double val = elm_slider_value_get(obj);
+
+ if (cf == val) return;
+ elm_config_cache_flush_interval_set(val);
+ elm_config_all_flush();
+}
+
+static void
+fc_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+fc_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double font_cache = elm_config_cache_font_cache_size_get();
+ double val = elm_slider_value_get(obj);
+
+ if (font_cache == val) return;
+ elm_config_cache_font_cache_size_set(val * 1024);
+ elm_config_all_flush();
+}
+
+static void
+ic_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+ic_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double image_cache = elm_config_cache_image_cache_size_get();
+ double val = elm_slider_value_get(obj);
+
+ if (image_cache == val) return;
+ elm_config_cache_image_cache_size_set(val * 1024);
+ elm_config_all_flush();
+}
+
+static void
+sc_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 10.0))) / 10.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+sc_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double scale = elm_config_scale_get();
+ double val = elm_slider_value_get(obj);
+
+ if (scale == val) return;
+ elm_config_scale_set(val);
+ elm_config_all_flush();
+}
+
+static void
+fs_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 5.0))) / 5.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+fs_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double fs = elm_config_finger_size_get();
+ double val = elm_slider_value_get(obj);
+
+ if (fs == val) return;
+ elm_config_finger_size_set(val);
+ elm_config_all_flush();
+}
+
+static void
+efc_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 5.0))) / 5.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+efc_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double efc = elm_config_cache_edje_file_cache_size_get();
+ double val = elm_slider_value_get(obj);
+
+ if (efc == val) return;
+ elm_config_cache_edje_file_cache_size_set(val);
+ elm_config_all_flush();
+}
+
+static void
+ecc_round(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ double v;
+
+ v = ((double)((int)(val * 5.0))) / 5.0;
+ if (v != val) elm_slider_value_set(obj, v);
+}
+
+static void
+ecc_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double ecc = elm_config_cache_edje_collection_cache_size_get();
+ double val = elm_slider_value_get(obj);
+
+ if (ecc == val) return;
+ elm_config_cache_edje_collection_cache_size_set(val);
+ elm_config_all_flush();
+}
+
+static void
+ac_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool ac = elm_config_access_get();
+
+ if (val == ac) return;
+ elm_config_access_set(val);
+ elm_config_all_flush();
+}
+
+static void
+sel_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sel = elm_config_selection_unfocused_clear_get();
+
+ if (val == sel) return;
+ elm_config_selection_unfocused_clear_set(val);
+ elm_config_all_flush();
+}
+
+static void
+dbg_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sel = elm_config_clouseau_enabled_get();
+
+ if (val == sel) return;
+ elm_config_clouseau_enabled_set(val);
+ elm_config_all_flush();
+}
+
+static void
+atspi_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sel = elm_config_atspi_mode_get();
+
+ if (val == sel) return;
+ elm_config_atspi_mode_set(val);
+ elm_config_all_flush();
+}
+
+static void
+transition_duration_change(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ double val = elm_slider_value_get(obj);
+ Eina_Bool scale = elm_config_transition_duration_factor_get();
+
+ if (scale == val) return;
+ elm_config_transition_duration_factor_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_status_basic(Evas_Object *win,
+ Evas_Object *bx0)
+{
+ Evas_Object *lb, *fr;
+
+ fr = elm_frame_add(win);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(fr, "Information");
+ elm_box_pack_end(bx0, fr);
+ evas_object_show(fr);
+
+ lb = elm_label_add(win);
+ elm_object_text_set(lb,
+ "Applying configuration change"
+ );
+ elm_object_content_set(fr, lb);
+ evas_object_show(lb);
+}
+
+static void
+_status_config(Evas_Object *win,
+ Evas_Object *bx0)
+{
+ Evas_Object *lb, *pd, *bx, *fr, *sl, *sp;
+
+ fr = elm_frame_add(win);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Sizing");
+ elm_box_pack_end(bx0, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
+
+ LABEL_FRAME_ADD("<hilight>Scale</>");
+
+ sl = elm_slider_add(win);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.25, 5.0);
+ elm_slider_value_set(sl, elm_config_scale_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ LABEL_FRAME_ADD("<hilight>Finger Size</><br/>");
+
+ sl = elm_slider_add(win);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 5, 200);
+ elm_slider_value_set(sl, elm_config_finger_size_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
+
+ // FIXME: add theme selector (basic mode and advanced for fallbacks)
+ // FIXME: save config
+ // FIXME: profile selector / creator etc.
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+}
+
+static void
+_flip_to(Evas_Object *win,
+ const char *name)
+{
+ Evas_Object *wid, *naviframe;
+ wid = evas_object_data_get(win, name);
+ naviframe = evas_object_data_get(win, "naviframe");
+ if (!naviframe) return;
+ elm_naviframe_item_simple_promote(naviframe, wid);
+}
+
+static void
+_cf_sizing(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "sizing");
+}
+
+static void
+_cf_themes(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "themes");
+}
+
+static void
+_cf_fonts(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "fonts");
+}
+
+static void
+_cf_profiles(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "profiles");
+}
+
+static void
+_cf_scrolling(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "scrolling");
+}
+
+static void
+_cf_rendering(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "rendering");
+}
+
+static void
+_cf_caches(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "caches");
+}
+
+static void
+_cf_audio(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data,"audio");
+}
+
+static void
+_cf_focus(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data, "focus");
+}
+
+static void
+_cf_etc(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ _flip_to(data,"etc");
+}
+
+const char *
+_elm_theme_current_get(const char *theme_search_order)
+{
+ const char *ret;
+ const char *p;
+
+ if (!theme_search_order)
+ return NULL;
+
+ for (p = theme_search_order;; p++)
+ {
+ if ((*p == ':') || (!*p))
+ {
+ if (p > theme_search_order)
+ {
+ char *n = malloc(p - theme_search_order + 1);
+ if (!n)
+ return NULL;
+
+ strncpy(n, theme_search_order, p - theme_search_order);
+ n[p - theme_search_order] = 0;
+ ret = eina_stringshare_add(n);
+ free(n);
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
+static void
+_font_overlay_set_all(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *fclasses;
+ Elm_Text_Class_Data *tc_data, *tc;
+ Elm_Object_Item *list_it;
+ Eina_List *l;
+
+ win = data;
+
+ fclasses = evas_object_data_get(win, "font_classes_list");
+ list_it = elm_list_selected_item_get(fclasses);
+ if (!list_it) return;
+ tc_data = elm_object_item_data_get(list_it);
+ if (!tc_data) return;
+
+ EINA_LIST_FOREACH(fndata.text_classes, l, tc)
+ {
+ eina_stringshare_replace(&tc->font, tc_data->font);
+ eina_stringshare_replace(&tc->style, tc_data->style);
+ tc->size = tc_data->size;
+ }
+
+ elm_config_all_flush();
+}
+
+static void
+_font_overlay_reset(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
+ Elm_Text_Class_Data *tc_data;
+ Elm_Object_Item *list_it;
+
+ win = data;
+
+ fclasses = evas_object_data_get(win, "font_classes_list");
+ list_it = elm_list_selected_item_get(fclasses);
+ if (!list_it) return;
+ tc_data = elm_object_item_data_get(list_it);
+ if (!tc_data) return;
+
+ fnames = evas_object_data_get(win, "font_names_list");
+ fstyles = evas_object_data_get(win, "font_styles_list");
+ fsizes = evas_object_data_get(win, "font_sizes_list");
+
+ elm_config_font_overlay_unset(tc_data->name);
+
+ eina_stringshare_replace(&fndata.cur_font, NULL);
+ eina_stringshare_replace(&tc_data->font, NULL);
+ eina_stringshare_replace(&fndata.cur_style, NULL);
+ eina_stringshare_replace(&tc_data->style, NULL);
+ fndata.cur_size = 0.0;
+ tc_data->size = 0.0;
+
+ ELM_LIST_DISABLE(fnames);
+ ELM_LIST_DISABLE(fstyles);
+ ELM_LIST_DISABLE(fsizes);
+
+ elm_config_all_flush();
+}
+
+static void
+_font_overlay_reset_all(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
+ Elm_Text_Class_Data *tc_data;
+ Elm_Object_Item *list_it;
+ Eina_List *l;
+
+ win = data;
+ eina_stringshare_replace(&fndata.cur_font, NULL);
+ eina_stringshare_replace(&fndata.cur_style, NULL);
+ fndata.cur_size = 0.0;
+
+ EINA_LIST_FOREACH(fndata.text_classes, l, tc_data)
+ {
+ elm_config_font_overlay_unset(tc_data->name);
+
+ eina_stringshare_replace(&tc_data->font, NULL);
+ eina_stringshare_replace(&tc_data->style, NULL);
+ tc_data->size = 0.0;
+ }
+
+ fclasses = evas_object_data_get(win, "font_classes_list");
+ fnames = evas_object_data_get(win, "font_names_list");
+ fstyles = evas_object_data_get(win, "font_styles_list");
+ fsizes = evas_object_data_get(win, "font_sizes_list");
+
+ list_it = elm_list_selected_item_get(fclasses);
+ if (list_it) elm_list_item_selected_set(list_it, EINA_FALSE);
+
+ ELM_LIST_DISABLE(fnames);
+ ELM_LIST_DISABLE(fstyles);
+ ELM_LIST_DISABLE(fsizes);
+
+ elm_config_all_flush();
+}
+
+static void
+_font_overlay_change(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Elm_Text_Class_Data *tc_data;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(fndata.text_classes, l, tc_data)
+ {
+ if (tc_data->font)
+ {
+ char *name;
+
+ name = elm_font_fontconfig_name_get(tc_data->font,
+ tc_data->style);
+ elm_config_font_overlay_set(tc_data->name, name,
+ tc_data->size ? tc_data->size : -100);
+ elm_font_fontconfig_name_free(name);
+ }
+ else
+ elm_config_font_overlay_unset(tc_data->name);
+ }
+
+ elm_config_font_overlay_apply();
+ elm_config_all_flush();
+
+ /* TODO: apply hinting */
+}
+
+static void
+_config_display_update(Evas_Object *win)
+{
+ int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould,
+ ts_hold_threshold;
+ double scale, s_bounce_friction, ts_momentum_threshold,
+ ts_flick_distance_tolerance, ts_friction,
+ ts_min_friction, ts_friction_standard, ts_border_friction,
+ ts_sensitivity_friction, ts_acceleration_threshold,
+ ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
+ bring_in_friction, zoom_friction, transition_duration,
+ smooth_amount, smooth_time_window;
+ const char *curr_theme;
+ Eina_Bool s_bounce, ts, smooth_start;
+ Elm_Theme *th;
+ int fs;
+
+ scale = elm_config_scale_get();
+ fs = elm_config_finger_size_get();
+ flush_interval = elm_config_cache_flush_interval_get();
+ font_c = elm_config_cache_font_cache_size_get();
+ image_c = elm_config_cache_image_cache_size_get();
+ transition_duration = elm_config_transition_duration_factor_get();
+ edje_file_c = elm_config_cache_edje_file_cache_size_get();
+ edje_col_c = elm_config_cache_edje_collection_cache_size_get();
+
+ s_bounce = elm_config_scroll_bounce_enabled_get();
+ s_bounce_friction = elm_config_scroll_bounce_friction_get();
+ ts = elm_config_scroll_thumbscroll_enabled_get();
+ ts_threshould = elm_config_scroll_thumbscroll_threshold_get();
+ ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get();
+ ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get();
+ ts_flick_distance_tolerance = elm_config_scroll_thumbscroll_flick_distance_tolerance_get();
+ ts_friction = elm_config_scroll_thumbscroll_friction_get();
+ ts_min_friction = elm_config_scroll_thumbscroll_min_friction_get();
+ ts_friction_standard = elm_config_scroll_thumbscroll_friction_standard_get();
+ ts_border_friction = elm_config_scroll_thumbscroll_border_friction_get();
+ ts_sensitivity_friction = elm_config_scroll_thumbscroll_sensitivity_friction_get();
+ ts_acceleration_threshold = elm_config_scroll_thumbscroll_acceleration_threshold_get();
+ ts_acceleration_time_limit = elm_config_scroll_thumbscroll_acceleration_time_limit_get();
+ ts_acceleration_weight = elm_config_scroll_thumbscroll_acceleration_weight_get();
+ page_friction = elm_config_scroll_page_scroll_friction_get();
+ bring_in_friction = elm_config_scroll_bring_in_scroll_friction_get();
+ zoom_friction = elm_config_scroll_zoom_friction_get();
+ smooth_start = elm_config_scroll_thumbscroll_smooth_start_get();
+ smooth_amount = elm_config_scroll_thumbscroll_smooth_amount_get();
+ smooth_time_window = elm_config_scroll_thumbscroll_smooth_time_window_get();
+
+ /* gotta update root windows' atoms */
+ elm_slider_value_set(evas_object_data_get(win, "scale_slider"), scale);
+ elm_slider_value_set(evas_object_data_get(win, "fs_slider"), fs);
+
+ elm_slider_value_set(evas_object_data_get(win,
+ "cache_flush_interval_slider"),
+ flush_interval);
+ elm_slider_value_set(evas_object_data_get(win, "font_cache_slider"),
+ font_c / 1024.0);
+ elm_slider_value_set(evas_object_data_get(win, "image_cache_slider"),
+ image_c / 1024.0);
+ elm_slider_value_set(evas_object_data_get(win, "edje_file_cache_slider"),
+ edje_file_c);
+ elm_slider_value_set(evas_object_data_get(win,
+ "edje_collection_cache_slider"),
+ edje_col_c);
+
+ elm_check_state_set(evas_object_data_get(win, "scroll_bounce_check"),
+ s_bounce);
+ elm_slider_value_set(evas_object_data_get(win, "bounce_friction_slider"),
+ s_bounce_friction);
+ elm_check_state_set(evas_object_data_get(win, "thumbscroll_check"), ts);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_threshold_slider"),
+ ts_threshould);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_hold_threshold_slider"),
+ ts_hold_threshold);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_momentum_threshold_slider"),
+ ts_momentum_threshold);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_flick_distance_tolerance_slider"),
+ ts_flick_distance_tolerance);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_friction_slider"),
+ ts_friction);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_min_friction_slider"),
+ ts_min_friction);
+ elm_slider_value_set(evas_object_data_get(win,
+ "ts_friction_standard_slider"),
+ ts_friction_standard);
+ elm_slider_value_set(evas_object_data_get(win, "ts_border_friction_slider"),
+ ts_border_friction);
+ elm_slider_value_set(evas_object_data_get(win, "ts_sensitivity_friction_slider"),
+ ts_sensitivity_friction);
+ elm_slider_value_set(evas_object_data_get(win, "ts_acceleration_threshold_slider"),
+ ts_acceleration_threshold);
+ elm_slider_value_set(evas_object_data_get(win, "ts_acceleration_time_limit_slider"),
+ ts_acceleration_time_limit);
+ elm_slider_value_set(evas_object_data_get(win, "ts_acceleration_weight_slider"),
+ ts_acceleration_weight);
+ elm_slider_value_set(evas_object_data_get(win,
+ "page_scroll_friction_slider"),
+ page_friction);
+ elm_slider_value_set(evas_object_data_get(win,
+ "bring_in_scroll_friction_slider"),
+ bring_in_friction);
+ elm_slider_value_set(evas_object_data_get(win,
+ "zoom_scroll_friction_slider"),
+ zoom_friction);
+
+ elm_check_state_set(evas_object_data_get(win, "scroll_smooth_start"),
+ smooth_start);
+ elm_slider_value_set(evas_object_data_get(win,
+ "scroll_smooth_amount"),
+ smooth_amount);
+ elm_slider_value_set(evas_object_data_get(win,
+ "scroll_smooth_time_window"),
+ smooth_time_window);
+
+ curr_theme = _elm_theme_current_get(elm_theme_get(NULL));
+
+ th = elm_theme_new();
+ elm_theme_set(th, curr_theme);
+ elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th);
+ elm_theme_free(th);
+ elm_config_transition_duration_factor_set(transition_duration);
+ eina_stringshare_del(curr_theme);
+}
+
+static Eina_Bool
+_config_all_changed(void *data,
+ int ev_type EINA_UNUSED,
+ void *ev EINA_UNUSED)
+{
+ Evas_Object *win = data;
+ _config_display_update(win);
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static void
+_profile_use(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *li;
+ const char *selection;
+ const char *profile;
+
+ li = data;
+ selection = elm_object_item_data_get(elm_list_selected_item_get(li));
+ if (!selection) return;
+ profile = elm_config_profile_get();
+
+ if (!profile)
+ {
+ fprintf(stderr, "No profile currently set!\n"); /* FIXME: log domain */
+ return;
+ }
+
+ if (!strcmp(profile, selection))
+ return;
+
+ elm_config_profile_set(selection); /* just here to update info for getters below */
+
+ _config_display_update(elm_object_top_widget_get(li));
+ elm_config_all_flush();
+}
+
+static void
+_btn_todo(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ printf("To be done!\n");
+}
+
+static void
+_profile_reset(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ const char *selection;
+ const char *pdir;
+ Evas_Object *li;
+
+ li = data;
+ selection = elm_object_item_data_get(elm_list_selected_item_get(li));
+ if (!selection) return;
+
+ elm_config_all_flush();
+
+ pdir = elm_config_profile_dir_get(selection, EINA_TRUE);
+ if (!pdir)
+ return;
+
+ ecore_file_recursive_rm(pdir);
+ elm_config_profile_dir_free(pdir);
+
+ elm_config_reload();
+
+ elm_config_all_flush();
+ _config_display_update(elm_object_top_widget_get(li));
+}
+
+static void
+_theme_use(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ const char *defth;
+ Elm_Theme *th;
+ Evas_Object *win = elm_object_top_widget_get(obj);
+ Evas_Object *sample = evas_object_data_get(win, "theme_preview");
+
+ th = elm_object_theme_get(sample);
+ defth = elm_theme_get(th);
+ elm_theme_set(NULL, defth);
+ elm_config_all_flush();
+}
+
+static void
+_theme_sel(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *win = elm_object_top_widget_get(obj);
+ Evas_Object *sample = evas_object_data_get(win, "theme_preview");
+ Elm_Theme *th;
+ Elm_Object_Item *list_it;
+ Eina_Strbuf *newth;
+ Eina_List *l;
+
+ if (!sample) return;
+ tsel = elm_list_selected_items_get(obj);
+ newth = eina_strbuf_new();
+ EINA_SAFETY_ON_NULL_RETURN(newth);
+ th = elm_theme_new();
+ if (!th)
+ {
+ eina_strbuf_free(newth);
+ return;
+ }
+ EINA_LIST_REVERSE_FOREACH((Eina_List*)tsel, l, list_it)
+ {
+ Theme *t = elm_object_item_data_get(list_it);
+ if (!t) continue;
+
+ eina_strbuf_append_printf(newth, "%s:", t->name);
+ if ((!l->prev) && strcmp(t->name, "default"))
+ /* ensure default theme is always there for fallback */
+ eina_strbuf_append(newth, "default");
+ }
+ elm_theme_set(th, eina_strbuf_string_get(newth));
+ eina_strbuf_free(newth);
+ elm_object_theme_set(sample, th);
+ elm_theme_free(th);
+}
+
+/*static void
+ _theme_browse(void *data, Evas_Object *obj, void *event_info)
+ {
+ printf("not implemented\n");
+ }*/
+
+static void
+_status_config_sizing(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *lb, *pd, *bx, *sl, *sp;
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
+
+ LABEL_FRAME_ADD("<hilight>Scale</>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "scale_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.25, 5.0);
+ elm_slider_value_set(sl, elm_config_scale_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ LABEL_FRAME_ADD("<hilight>Finger Size</><br/>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "fs_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 5, 200);
+ elm_slider_value_set(sl, elm_config_finger_size_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
+
+ evas_object_data_set(win, "sizing", bx);
+
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+#define MUTE_CB(_cb, _chan) \
+static void \
+_cb(void *data EINA_UNUSED, \
+ Evas_Object *obj, \
+ void *event_info EINA_UNUSED) \
+{ \
+ Eina_Bool val = elm_check_state_get(obj); \
+ Eina_Bool v = elm_config_audio_mute_get(_chan); \
+ if (val == v) return; \
+ elm_config_audio_mute_set(_chan, val); \
+ elm_config_all_flush(); \
+}
+
+MUTE_CB(mute_effect_change, EDJE_CHANNEL_EFFECT)
+MUTE_CB(mute_background_change, EDJE_CHANNEL_BACKGROUND)
+MUTE_CB(mute_music_change, EDJE_CHANNEL_MUSIC)
+MUTE_CB(mute_foreground_change, EDJE_CHANNEL_FOREGROUND)
+MUTE_CB(mute_interface_change, EDJE_CHANNEL_INTERFACE)
+MUTE_CB(mute_input_change, EDJE_CHANNEL_INPUT)
+MUTE_CB(mute_alert_change, EDJE_CHANNEL_ALERT)
+MUTE_CB(mute_all_change, EDJE_CHANNEL_ALL)
+
+static void
+_status_config_audio(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *bx, *ck;
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
+
+#define MUTE_CHECK(_label, _chan, _cb) \
+ CHECK_ADD(_label, _label, _cb, NULL) \
+ elm_check_state_set(ck, elm_config_audio_mute_get(_chan));
+
+ MUTE_CHECK("Mute Effects", EDJE_CHANNEL_EFFECT, mute_effect_change);
+ MUTE_CHECK("Mute Background", EDJE_CHANNEL_BACKGROUND, mute_background_change);
+ MUTE_CHECK("Mute Music", EDJE_CHANNEL_MUSIC, mute_music_change);
+ MUTE_CHECK("Mute Foreground", EDJE_CHANNEL_FOREGROUND, mute_foreground_change);
+ MUTE_CHECK("Mute Interface", EDJE_CHANNEL_INTERFACE, mute_interface_change);
+ MUTE_CHECK("Mute Input", EDJE_CHANNEL_INPUT, mute_input_change);
+ MUTE_CHECK("Mute Alert", EDJE_CHANNEL_ALERT, mute_alert_change);
+ MUTE_CHECK("Mute Everything", EDJE_CHANNEL_ALL, mute_all_change);
+
+ evas_object_data_set(win, "audio", bx);
+
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+static void
+_config_focus_highlight_enabled_cb(void *data EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_focus_highlight_enabled_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ printf("%d %d\n", cf, val);
+ if (cf == val) return;
+ elm_config_focus_highlight_enabled_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_config_focus_highlight_anim_cb(void *data EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_focus_highlight_animate_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ if (cf == val) return;
+ elm_config_focus_highlight_animate_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_config_focus_highlight_clip_cb(void *data EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_focus_highlight_clip_disabled_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ if (cf == val) return;
+ elm_config_focus_highlight_clip_disabled_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_config_focus_item_select_on_focus_cb(void *data EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_item_select_on_focus_disabled_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ if (cf == val) return;
+ elm_config_item_select_on_focus_disabled_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_status_config_focus_autoscroll_changed_cb(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ elm_config_focus_autoscroll_mode_set(elm_radio_value_get(obj));
+}
+
+static void
+_config_focus_auto_show_cb(void *data EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_window_auto_focus_enable_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ if (cf == val) return;
+ elm_config_window_auto_focus_enable_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_config_focus_auto_animate_cb(void *data EINA_UNUSED, Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Eina_Bool cf = elm_config_window_auto_focus_animate_get();
+ Eina_Bool val = elm_check_state_get(obj);
+
+ if (cf == val) return;
+ elm_config_window_auto_focus_animate_set(val);
+ elm_config_all_flush();
+}
+
+static void
+_status_config_focus(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *bx, *ck, *fr;
+
+ bx = elm_box_add(win);
+
+ CHECK_ADD("Enable Focus Highlight (only new window)",
+ "Set whether enable/disable focus highlight.<br/>"
+ "This feature is disabled by default.",
+ _config_focus_highlight_enabled_cb, NULL);
+ elm_check_state_set(ck, elm_config_focus_highlight_enabled_get());
+
+ CHECK_ADD("Enable Focus Highlight Animation (only new window)",
+ "Set whether enable/disable focus highlight animation.<br/>"
+ "This feature is disabled by default",
+ _config_focus_highlight_anim_cb, NULL);
+ elm_check_state_set(ck, elm_config_focus_highlight_animate_get());
+
+ CHECK_ADD("Disable Focus Highlight clip",
+ "Set whether enable/disable focus highlight clip feature.<br/>"
+ "If the focus highlight clip is disabled,<br/>"
+ "focus highlight object would not be clipped"
+ "by the target object's parent",
+ _config_focus_highlight_clip_cb, NULL);
+ elm_check_state_set(ck, elm_config_focus_highlight_clip_disabled_get());
+
+ CHECK_ADD("Disable Item Select on Focus",
+ "Set whether item would be selected on item focus.<br/>"
+ "This is enabled by default.",
+ _config_focus_item_select_on_focus_cb, NULL);
+ elm_check_state_set(ck, elm_config_item_select_on_focus_disabled_get());
+
+ CHECK_ADD("Enable Automatic focus display",
+ "Set whether enable/disable focus highlight automatically.",
+ _config_focus_auto_show_cb, NULL);
+ elm_check_state_set(ck, elm_config_window_auto_focus_enable_get());
+ CHECK_ADD("Enable Automatic focus animation",
+ "Set whether enable/disable focus highlight animation<br/>"
+ "automatically when automatic focus shows.",
+ _config_focus_auto_animate_cb, NULL);
+ elm_check_state_set(ck, elm_config_window_auto_focus_enable_get());
+
+ fr = elm_frame_add(bx);
+ elm_object_text_set(fr, "Focus Autoscroll Mode");
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, fr);
+ evas_object_show(fr);
+ {
+ Evas_Object *bx2, *rdg, *rd;
+ bx2 = elm_box_add(fr);
+ elm_object_content_set(fr, bx2);
+ evas_object_show(bx2);
+
+ rdg = rd = elm_radio_add(bx2);
+ elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_SHOW);
+ elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_SHOW");
+ elm_object_tooltip_text_set(rd, "Directly show the focused region<br/>"
+ "or item automatically inside a scroller.");
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
+ elm_box_pack_end(bx2, rd);
+ evas_object_show(rd);
+ evas_object_smart_callback_add(rd, "changed",
+ _status_config_focus_autoscroll_changed_cb,
+ NULL);
+
+ rd = elm_radio_add(bx2);
+ elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_NONE);
+ elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_NONE");
+ elm_object_tooltip_text_set(rd, "Do not show the focused region or<br/>"
+ "item automatically inside a scroller.");
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
+ elm_box_pack_end(bx2, rd);
+ elm_radio_group_add(rd, rdg);
+ evas_object_show(rd);
+ evas_object_smart_callback_add(rd, "changed",
+ _status_config_focus_autoscroll_changed_cb,
+ NULL);
+
+
+ rd = elm_radio_add(bx2);
+ elm_radio_state_value_set(rd, ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN);
+ elm_object_text_set(rd, "ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN");
+ elm_object_tooltip_text_set(rd, "Bring in the focused region or item<br/>"
+ "automatically which might invole the scrolling.");
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(rd, 0.0, EVAS_HINT_FILL);
+ elm_box_pack_end(bx2, rd);
+ elm_radio_group_add(rd, rdg);
+ evas_object_show(rd);
+ evas_object_smart_callback_add(rd, "changed",
+ _status_config_focus_autoscroll_changed_cb,
+ NULL);
+
+ elm_radio_value_set(rdg, elm_config_focus_autoscroll_mode_get());
+ }
+
+ evas_object_data_set(win, "focus", bx);
+
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+static void
+_status_config_etc(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *bx, *ck, *sl, *fr, *bx2, *fr2, *bx3, *en;
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
+
+ // access
+ CHECK_ADD("Enable Access Mode", "Set access mode", ac_change, NULL);
+ elm_check_state_set(ck, elm_config_access_get());
+
+ // selection
+ CHECK_ADD("Enable clear selection when unfocus", "Set selection mode",
+ sel_change, NULL);
+ elm_check_state_set(ck, elm_config_selection_unfocused_clear_get());
+
+ // clouseau
+ CHECK_ADD("Enable clouseau", "Set clouseau mode", dbg_change, NULL);
+ elm_check_state_set(ck, elm_config_clouseau_enabled_get());
+
+ // atspi
+ CHECK_ADD("Enable ATSPI support", "Set atspi mode", atspi_change, NULL);
+ elm_check_state_set(ck, elm_config_atspi_mode_get());
+
+ // transition duration in edje
+ fr = elm_frame_add(bx);
+ elm_object_text_set(fr, "Edje Transition Duration Factor");
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, fr);
+ evas_object_show(fr);
+
+ bx2 = elm_box_add(fr);
+ elm_object_content_set(fr, bx2);
+ evas_object_show(bx2);
+
+ sl = elm_slider_add(bx2);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0, 20.0);
+ elm_slider_value_set(sl, elm_config_transition_duration_factor_get());
+ elm_box_pack_end(bx2, sl);
+ evas_object_show(sl);
+ evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", transition_duration_change, NULL);
+
+ // Web backend
+ fr2 = elm_frame_add(bx);
+ elm_object_text_set(fr2, "Elm_Web backend");
+ evas_object_size_hint_weight_set(fr2, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr2, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, fr2);
+ evas_object_show(fr2);
+
+ bx3 = elm_box_add(fr2);
+ elm_object_content_set(fr2, bx3);
+ evas_object_show(bx3);
+
+ en = elm_entry_add(win);
+ elm_entry_editable_set(en, EINA_TRUE);
+ elm_entry_scrollable_set(en, EINA_FALSE);
+ elm_object_text_set(en, elm_config_web_backend_get());
+ evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(en);
+ elm_box_pack_end(bx3, en);
+
+ web_backend_entry = en;
+
+ evas_object_data_set(win, "etc", bx);
+
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+static Evas_Object *
+_sample_theme_new(Evas_Object *win)
+{
+ Evas_Object *base, *bg, *bt, *ck, *rd, *rdg, *sl, *fr, *li, *rc, *sp;
+
+ base = elm_table_add(win);
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ bg = elm_bg_add(win);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_table_pack(base, bg, 0, 0, 2, 5);
+ evas_object_show(bg);
+
+ bt = elm_button_add(win);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+ elm_object_text_set(bt, "Button");
+ elm_table_pack(base, bt, 0, 0, 1, 1);
+ evas_object_show(bt);
+
+ ck = elm_check_add(win);
+ evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
+ elm_object_text_set(ck, "Check");
+ elm_table_pack(base, ck, 0, 1, 1, 1);
+ evas_object_show(ck);
+
+ rd = elm_radio_add(win);
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ elm_radio_state_value_set(rd, 0);
+ elm_object_text_set(rd, "Radio 1");
+ elm_table_pack(base, rd, 1, 0, 1, 1);
+ evas_object_show(rd);
+ rdg = rd;
+
+ rd = elm_radio_add(win);
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
+ elm_radio_state_value_set(rd, 1);
+ elm_object_text_set(rd, "Radio 2");
+ elm_radio_group_add(rd, rdg);
+ elm_table_pack(base, rd, 1, 1, 1, 1);
+ evas_object_show(rd);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_table_pack(base, sp, 0, 2, 2, 1);
+ evas_object_show(sp);
+
+ sl = elm_slider_add(win);
+ elm_object_text_set(sl, "Slider");
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_min_max_set(sl, 1, 10);
+ elm_slider_value_set(sl, 4);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_table_pack(base, sl, 0, 3, 2, 1);
+ evas_object_show(sl);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Frame");
+ elm_table_pack(base, fr, 0, 4, 2, 1);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(fr);
+
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, li);
+ evas_object_show(li);
+
+ elm_list_item_append(li, "List Item 1", NULL, NULL, NULL, NULL);
+ elm_list_item_append(li, "Second Item", NULL, NULL, NULL, NULL);
+ elm_list_item_append(li, "Third Item", NULL, NULL, NULL, NULL);
+ elm_list_go(li);
+
+ rc = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_min_set(rc, 160, 120);
+ elm_table_pack(base, rc, 0, 4, 2, 1);
+
+ return base;
+}
+
+static void
+_status_config_themes(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample;
+ Eina_List *list, *l;
+ char *th, *s, *ext;
+ Elm_Theme *d;
+ Elm_Object_Item *list_it, *def_it = NULL;
+ const char *theme_name, *sep[20];
+ unsigned int x;
+
+ tb = elm_table_add(win);
+ evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ rc = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_min_set(rc, 0, 130);
+ elm_table_pack(tb, rc, 0, 0, 1, 1);
+
+ rc = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_min_set(rc, 0, 200);
+ elm_table_pack(tb, rc, 0, 1, 1, 1);
+
+ /////////////////////////////////////////////
+
+ pd = elm_frame_add(win);
+ elm_object_style_set(pd, "pad_medium");
+ evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_table_pack(tb, pd, 0, 0, 1, 1);
+ evas_object_show(pd);
+
+ li = elm_list_add(win);
+ elm_list_multi_select_set(li, EINA_TRUE);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(pd, li);
+ evas_object_show(li);
+
+ list = elm_theme_name_available_list_new();
+ d = elm_theme_default_get();
+ theme_name = elm_theme_get(d);
+ for (x = 1, sep[0] = theme_name; x < sizeof(sep) / sizeof(sep[0]); x++)
+ {
+ sep[x] = strchr(sep[x - 1] + 1, ':');
+ if (!sep[x]) break;
+ }
+ EINA_LIST_FOREACH(list, l, th)
+ {
+ Theme *t;
+ int y;
+
+ t = calloc(1, sizeof(Theme));
+ t->name = eina_stringshare_add(th);
+ s = elm_theme_list_item_path_get(th, &(t->in_search_path));
+ if (s)
+ {
+ t->path = eina_stringshare_add(s);
+ free(s);
+ }
+ if (t->in_search_path)
+ {
+ s = strdup(th);
+ if (s)
+ {
+ s[0] = toupper(s[0]);
+ t->label = eina_stringshare_add(s);
+ free(s);
+ }
+ else
+ t->label = eina_stringshare_add(s);
+ }
+ else
+ {
+ s = strdup(ecore_file_file_get(th));
+ if (s)
+ {
+ s[0] = toupper(s[0]);
+ ext = strrchr(s, '.');
+ if (ext) *ext = 0;
+ t->label = eina_stringshare_add(s);
+ free(s);
+ }
+ else
+ t->label = eina_stringshare_add(s);
+ }
+ themes = eina_list_append(themes, t);
+ list_it = elm_list_item_append(li, t->label, NULL, NULL, NULL, t);
+ if (!strcmp(t->name, "default")) def_it = list_it;
+ for (y = x - 1 /* ignore default e theme */; y > 0; y--)
+ {
+ const char *start = (sep[y - 1][0] == ':') ? sep[y - 1] + 1 : sep[y - 1];
+ unsigned int len = (unsigned int)(sep[y] - start);
+ if (strncmp(start , t->name, len) || (strlen(t->name) != len)) continue;
+
+ if (!elm_list_item_selected_get(list_it))
+ elm_list_item_selected_set(list_it, EINA_TRUE);
+ break;
+ }
+ }
+ if (!elm_list_selected_items_get(li))
+ elm_list_item_selected_set(def_it, EINA_TRUE);
+ evas_object_smart_callback_add(li, "selected", _theme_sel, NULL);
+ evas_object_smart_callback_add(li, "unselected", _theme_sel, NULL);
+ elm_theme_name_available_list_free(list);
+
+ elm_list_go(li);
+
+ pd = elm_frame_add(win);
+ elm_object_style_set(pd, "pad_medium");
+ evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(pd, 0.9, 0.9);
+ elm_table_pack(tb, pd, 0, 0, 1, 1);
+ evas_object_show(pd);
+
+ /* FIXME: not implemented yet
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _theme_browse, win);
+ elm_object_text_set(bt, "Browse...");
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, 0.9, 0.9);
+ elm_object_content_set(pd, bt);
+ evas_object_show(bt);
+ */
+ pd = elm_frame_add(win);
+ elm_object_style_set(pd, "pad_medium");
+ evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_table_pack(tb, pd, 0, 1, 1, 1);
+ evas_object_show(pd);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Preview");
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(pd, fr);
+ evas_object_show(fr);
+
+ sc = elm_scroller_add(win);
+ elm_scroller_bounce_set(sc, EINA_FALSE, EINA_FALSE);
+ evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, sc);
+ evas_object_show(sc);
+
+ sample = _sample_theme_new(win);
+ elm_object_content_set(sc, sample);
+ evas_object_show(sample);
+ evas_object_data_set(win, "theme_preview", sample);
+
+ /////////////////////////////////////////////
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_table_pack(tb, sp, 0, 2, 1, 1);
+ evas_object_show(sp);
+
+ pd = elm_frame_add(win);
+ elm_object_style_set(pd, "pad_medium");
+ evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(pd, 0.5, 0.5);
+ elm_table_pack(tb, pd, 0, 3, 1, 1);
+ evas_object_show(pd);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _theme_use, win);
+ elm_object_text_set(bt, "Use Theme");
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_object_content_set(pd, bt);
+ evas_object_show(bt);
+
+ evas_object_data_set(win, "themes", tb);
+ elm_naviframe_item_simple_push(naviframe, tb);
+}
+
+static void
+_font_preview_update(Evas_Object *win)
+{
+ Evas_Font_Size sz;
+ char *name;
+
+ if (!fndata.cur_font)
+ return;
+
+ name = elm_font_fontconfig_name_get(fndata.cur_font, fndata.cur_style);
+ sz = fndata.cur_size;
+
+ if (sz < 0)
+ sz = (-sz * 10) / 100;
+ if (sz == 0)
+ sz = 10;
+
+ edje_object_text_class_set(evas_object_data_get(win, "font_preview"),
+ "font_preview", name, sz);
+
+ elm_font_fontconfig_name_free(name);
+}
+
+static void
+_font_classes_list_sel(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info)
+{
+ const Eina_List *f_names_items, *l;
+ Elm_Text_Class_Data *tc_data;
+ Evas_Object *f_names_list;
+ Elm_Object_Item *list_it;
+
+ tc_data = elm_object_item_data_get(event_info);
+ if (!tc_data) return;
+
+ f_names_list = evas_object_data_get(elm_object_top_widget_get(obj),
+ "font_names_list");
+ ELM_LIST_ENABLE(f_names_list);
+
+ f_names_items = elm_list_items_get(f_names_list);
+
+ EINA_LIST_FOREACH(f_names_items, l, list_it)
+ {
+ const char *s;
+
+ s = elm_object_item_text_get(list_it);
+ if (!s) continue;
+
+ if (tc_data->font && !strcmp(s, tc_data->font))
+ {
+ elm_list_item_selected_set(list_it, EINA_TRUE);
+ elm_list_item_show(list_it);
+ break;
+ }
+ }
+}
+
+static void
+_font_names_list_sel(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info)
+{
+ Evas_Object *style_list, *cls_list, *win;
+ const char *style, *sel_font;
+ Elm_Text_Class_Data *tc_data;
+ Elm_Object_Item *list_it, *fc_list_it;
+ Elm_Font_Properties *efp;
+ const Eina_List *l;
+
+ list_it = event_info;
+ sel_font = elm_object_item_text_get(list_it);
+
+ win = elm_object_top_widget_get(obj);
+ style_list = evas_object_data_get(win, "font_styles_list");
+ cls_list = evas_object_data_get(win, "font_classes_list");
+
+ fc_list_it = elm_list_selected_item_get(cls_list);
+ if (!fc_list_it) return; /* should not happen, fonts list disabled in
+ * this case */
+
+ eina_stringshare_replace(&fndata.cur_font, sel_font);
+
+ tc_data = elm_object_item_data_get(fc_list_it);
+ if (!tc_data) return;
+ if (tc_data->font) eina_stringshare_del(tc_data->font);
+ if (fndata.cur_font) tc_data->font = eina_stringshare_ref(fndata.cur_font);
+
+ /* load styles list */
+ efp = eina_hash_find(fndata.font_hash, sel_font);
+ if (!efp) return;
+
+ ELM_LIST_ENABLE(style_list);
+ elm_list_clear(style_list);
+
+ evas_event_freeze(evas_object_evas_get(style_list));
+ edje_freeze();
+
+ list_it = NULL;
+
+ EINA_LIST_FOREACH(efp->styles, l, style)
+ {
+ Elm_Object_Item *i;
+
+ i = elm_list_item_append(style_list, style, NULL, NULL,
+ _font_styles_list_sel, NULL);
+
+ if (tc_data->style && (!strcmp(style, tc_data->style)))
+ list_it = i;
+ }
+
+ elm_list_go(style_list);
+
+ edje_thaw();
+ evas_event_thaw(evas_object_evas_get(style_list));
+
+ if (list_it)
+ elm_list_item_selected_set(list_it, EINA_TRUE);
+
+ _font_preview_update(win);
+}
+
+static void
+_font_styles_list_sel(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info)
+{
+ Evas_Object *fc_list, *fs_list, *win;
+ Elm_Text_Class_Data *tc_data;
+ const Eina_List *l;
+ Elm_Object_Item *list_it;
+
+ win = elm_object_top_widget_get(obj);
+ fc_list = evas_object_data_get(win, "font_classes_list");
+ fs_list = evas_object_data_get(win, "font_sizes_list");
+
+ list_it = elm_list_selected_item_get(fc_list);
+ if (!list_it) return; /* should not happen */
+
+ eina_stringshare_replace(&fndata.cur_style,
+ elm_object_item_text_get(event_info));
+ ELM_LIST_ENABLE(fs_list);
+
+ tc_data = elm_object_item_data_get(list_it);
+ if (!tc_data) return;
+ eina_stringshare_del(tc_data->style);
+ tc_data->style = eina_stringshare_ref(fndata.cur_style);
+
+ evas_event_freeze(evas_object_evas_get(fs_list));
+ edje_freeze();
+
+ EINA_LIST_FOREACH(elm_list_items_get(fs_list), l, list_it)
+ {
+ Elm_Font_Size_Data *sdata;
+
+ sdata = elm_object_item_data_get(list_it);
+ if (!sdata) continue;
+ elm_list_item_selected_set(l->data, EINA_FALSE);
+
+ if (tc_data->size == sdata->size)
+ {
+ elm_list_item_selected_set(list_it, EINA_TRUE);
+ elm_list_item_show(list_it);
+ break;
+ }
+ }
+
+ edje_thaw();
+ evas_event_thaw(evas_object_evas_get(fs_list));
+
+ _font_preview_update(win);
+}
+
+static void
+_font_sizes_list_sel(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ Elm_Text_Class_Data *tc_data;
+ Evas_Object *fc_list, *win;
+ Elm_Font_Size_Data *sd;
+ Elm_Object_Item *list_it;
+
+ win = elm_object_top_widget_get(obj);
+ fc_list = evas_object_data_get(win, "font_classes_list");
+
+ list_it = elm_list_selected_item_get(fc_list);
+ if (!list_it) return; /* should not happen */
+ sd = elm_object_item_data_get(event_info);
+ if (!sd) return;
+
+ fndata.cur_size = sd->size;
+
+ tc_data = elm_object_item_data_get(list_it);
+ if (!tc_data) return;
+ tc_data->size = fndata.cur_size;
+
+ _font_preview_update(win);
+}
+
+static void
+_fstyle_list_unselect_cb(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *sizes_list, *win;
+
+ if (elm_list_selected_item_get(obj)) return;
+
+ win = elm_object_top_widget_get(obj);
+
+ sizes_list = evas_object_data_get(win, "font_sizes_list");
+ ELM_LIST_DISABLE(sizes_list);
+}
+
+static void
+_fc_list_unselect_cb(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *font_names_list, *styles_list, *sizes_list, *win;
+
+ if (elm_list_selected_item_get(obj)) return;
+
+ win = elm_object_top_widget_get(obj);
+
+ font_names_list = evas_object_data_get(win, "font_names_list");
+ ELM_LIST_DISABLE(font_names_list);
+
+ styles_list = evas_object_data_get(win, "font_styles_list");
+ ELM_LIST_DISABLE(styles_list);
+
+ sizes_list = evas_object_data_get(win, "font_sizes_list");
+ ELM_LIST_DISABLE(sizes_list);
+}
+
+static void
+_font_classes_list_load(Evas_Object *li)
+{
+ Elm_Text_Class_Data *tc_data;
+ Eina_List *l;
+ Evas *evas;
+
+ evas = evas_object_evas_get(li);
+ evas_event_freeze(evas);
+ edje_freeze();
+
+ EINA_LIST_FOREACH(fndata.text_classes, l, tc_data)
+ elm_list_item_append(li, tc_data->desc, NULL, NULL,
+ _font_classes_list_sel, tc_data);
+
+ evas_object_smart_callback_add(li, "unselected", _fc_list_unselect_cb,
+ NULL);
+
+ elm_list_go(li);
+ edje_thaw();
+ evas_event_thaw(evas);
+}
+
+static void
+_fonts_data_fill(Evas *evas)
+{
+ const Eina_List *fo_list, *l;
+ Eina_List *text_classes;
+ Elm_Text_Class_Data *tc_data;
+ Elm_Font_Size_Data *sd;
+ Elm_Font_Overlay *efo;
+ Eina_List *evas_fonts;
+ Elm_Text_Class *etc;
+ int i;
+
+ evas_fonts = evas_font_available_list(evas);
+ fndata.font_hash = elm_font_available_hash_add(evas_fonts);
+ evas_font_available_list_free(evas, evas_fonts);
+
+ text_classes = elm_config_text_classes_list_get();
+ fo_list = elm_config_font_overlay_list_get();
+
+ EINA_LIST_FOREACH(text_classes, l, etc)
+ {
+ const Eina_List *ll;
+
+ tc_data = calloc(1, sizeof(*tc_data));
+ if (!tc_data) continue;
+
+ tc_data->name = eina_stringshare_add(etc->name);
+ tc_data->desc = eina_stringshare_add(etc->desc);
+
+ EINA_LIST_FOREACH(fo_list, ll, efo)
+ {
+ if (strcmp(tc_data->name, efo->text_class))
+ continue;
+
+ if (efo->font)
+ {
+ Elm_Font_Properties *efp;
+
+ efp = elm_font_properties_get(efo->font);
+ if (efp)
+ {
+ tc_data->font = eina_stringshare_add(efp->name);
+ /* we're sure we recorded with only 1 style selected */
+ tc_data->style = eina_stringshare_add(efp->styles->data);
+ elm_font_properties_free(efp);
+ }
+ }
+ tc_data->size = efo->size;
+ }
+
+ fndata.text_classes = eina_list_append(fndata.text_classes, tc_data);
+ }
+
+ elm_config_text_classes_list_free(text_classes);
+
+ /* FIXME: hinting later */
+ /* fndata.hinting = e_config->font_hinting; */
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add("Tiny");
+ sd->size = -50;
+ fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add("Small");
+ sd->size = -80;
+ fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add("Normal");
+ sd->size = -100;
+ fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add("Big");
+ sd->size = -150;
+ fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add("Really Big");
+ sd->size = -190;
+ fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add("Huge");
+ sd->size = -250;
+ fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
+
+ for (i = 5; i < 51; i++)
+ {
+ char str[16];
+
+ str[0] = 0;
+ snprintf(str, sizeof(str), "%d pixels", i);
+
+ sd = calloc(1, sizeof(Elm_Font_Size_Data));
+ sd->size_str = eina_stringshare_add(str);
+ sd->size = i;
+ fndata.font_px_list = eina_list_append(fndata.font_px_list, sd);
+ }
+}
+
+static int
+_font_sort_cb(const void *data1,
+ const void *data2)
+{
+ if (!data1) return 1;
+ if (!data2) return -1;
+ return strcmp(data1, data2);
+}
+
+static void
+_font_sizes_list_load(Evas_Object *size_list)
+{
+ Elm_Font_Size_Data *size_data;
+ Eina_List *l;
+ Evas *evas;
+
+ evas = evas_object_evas_get(size_list);
+ evas_event_freeze(evas);
+ edje_freeze();
+
+ EINA_LIST_FOREACH(fndata.font_scale_list, l, size_data)
+ elm_list_item_append(size_list, size_data->size_str, NULL, NULL,
+ _font_sizes_list_sel, size_data);
+
+ EINA_LIST_FOREACH(fndata.font_px_list, l, size_data)
+ elm_list_item_append(size_list, size_data->size_str, NULL, NULL,
+ _font_sizes_list_sel, size_data);
+
+ elm_list_go(size_list);
+ edje_thaw();
+ evas_event_thaw(evas);
+}
+
+static void
+_fnames_list_unselect_cb(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ Evas_Object *styles_list, *sizes_list, *win;
+
+ if (elm_list_selected_item_get(obj)) return;
+
+ win = elm_object_top_widget_get(obj);
+
+ styles_list = evas_object_data_get(win, "font_styles_list");
+ ELM_LIST_DISABLE(styles_list);
+
+ sizes_list = evas_object_data_get(win, "font_sizes_list");
+ ELM_LIST_DISABLE(sizes_list);
+}
+
+static Eina_Bool
+_font_list_fill(const Eina_Hash *hash EINA_UNUSED,
+ const void *key EINA_UNUSED,
+ void *data,
+ void *fdata)
+{
+ Elm_Font_Properties *efp;
+ Eina_List **flist;
+
+ flist = fdata;
+ efp = data;
+
+ *flist = eina_list_append(*flist, efp->name);
+
+ return EINA_TRUE;
+}
+
+static void
+_font_names_list_load(Evas_Object *flist)
+{
+ Eina_List *l, *names_list = NULL;
+ const char *font;
+ Evas *evas;
+
+ evas = evas_object_evas_get(flist);
+ evas_event_freeze(evas);
+ edje_freeze();
+
+ eina_hash_foreach(fndata.font_hash, _font_list_fill, &names_list);
+ names_list = eina_list_sort(names_list, eina_list_count(names_list),
+ _font_sort_cb);
+
+ EINA_LIST_FOREACH(names_list, l, font)
+ elm_list_item_append(flist, font, NULL, NULL, _font_names_list_sel, NULL);
+
+ eina_list_free(names_list);
+
+ evas_object_smart_callback_add(flist, "unselected",
+ _fnames_list_unselect_cb, NULL);
+
+ elm_list_go(flist);
+
+ edje_thaw();
+ evas_event_thaw(evas);
+}
+
+static void
+_status_config_fonts(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *base, *fr, *li, *rc, *preview, *sp, *pd, *bt, *bx;
+ char buf[PATH_MAX];
+
+ _fonts_data_fill(evas_object_evas_get(win));
+
+ base = elm_table_add(win);
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ /* yeah, dummy rectangles are ugly as hell, but no good way yet of
+ fixing sizes */
+ rc = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_min_set(rc, 70, 170);
+ elm_table_pack(base, rc, 1, 0, 1, 1);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Font Class");
+ elm_table_pack(base, fr, 0, 0, 1, 2);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(fr);
+
+ /* FIXME: no multiselection for this list, for now */
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, li);
+ evas_object_show(li);
+
+ evas_object_data_set(win, "font_classes_list", li);
+ _font_classes_list_load(li);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Font");
+ elm_table_pack(base, fr, 1, 0, 1, 2);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(fr);
+
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, li);
+ evas_object_show(li);
+
+ evas_object_data_set(win, "font_names_list", li);
+ _font_names_list_load(li);
+ ELM_LIST_DISABLE(li);
+
+ rc = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_min_set(rc, 70, 130);
+ elm_table_pack(base, rc, 1, 2, 1, 1);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Style");
+ elm_table_pack(base, fr, 0, 2, 1, 1);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(fr);
+ ELM_LIST_DISABLE(li);
+
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, li);
+ evas_object_show(li);
+
+ evas_object_data_set(win, "font_styles_list", li);
+ evas_object_smart_callback_add(li, "unselected", _fstyle_list_unselect_cb,
+ NULL);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Size");
+ elm_table_pack(base, fr, 1, 2, 1, 1);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(fr);
+
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, li);
+ evas_object_show(li);
+
+ evas_object_data_set(win, "font_sizes_list", li);
+ _font_sizes_list_load(li);
+ ELM_LIST_DISABLE(li);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_table_pack(base, bx, 0, 3, 2, 1);
+ evas_object_show(bx);
+
+ /* FIXME: what to do here? dedicated widget? some new entry API set? */
+ snprintf(buf, sizeof(buf), "%s/objects/font_preview.edj", elm_app_data_dir_get());
+ preview = elm_layout_add(win);
+ elm_layout_file_set(preview, buf, "font_preview");
+ elm_object_part_text_set(preview, "elm.text", "Preview Text — 我真的会写中文");
+ evas_object_size_hint_weight_set(preview, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(preview, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(preview);
+
+ elm_box_pack_end(bx, preview);
+ evas_object_data_set(win, "font_preview", elm_layout_edje_get(preview));
+
+ /////////////////////////////////////////////
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_table_pack(base, sp, 0, 4, 2, 1);
+ evas_object_show(sp);
+
+ pd = elm_frame_add(win);
+ elm_object_style_set(pd, "pad_medium");
+ evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(pd, 0.5, 0.5);
+ elm_table_pack(base, pd, 0, 5, 2, 1);
+ evas_object_show(pd);
+
+ bx = elm_box_add(win);
+ elm_box_horizontal_set(bx, EINA_TRUE);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(bx);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _font_overlay_set_all, win);
+ elm_object_text_set(bt, "Set to All");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset, win);
+ elm_object_text_set(bt, "Reset");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset_all, win);
+ elm_object_text_set(bt, "Reset All");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _font_overlay_change, win);
+ elm_object_text_set(bt, "Apply");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(bx, bt);
+ evas_object_show(bt);
+
+ elm_object_content_set(pd, bx);
+
+ evas_object_data_set(win, "fonts", base);
+
+ elm_naviframe_item_simple_push(naviframe, base);
+}
+
+static void
+_profiles_list_item_del_cb(void *data,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+ free(data);
+}
+
+static void
+_profiles_list_selected_cb(void *data,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ const char *cur_profile = NULL;
+ const char *sel_profile, *pdir;
+ const char *prof_name;
+ char buf[PATH_MAX];
+ Evas_Object *en;
+#ifdef ELM_EFREET
+ Efreet_Desktop *desk = NULL;
+#endif
+
+ sel_profile = data;
+ if (!sel_profile)
+ return;
+
+ cur_profile = elm_config_profile_get();
+
+ pdir = elm_config_profile_dir_get(sel_profile, EINA_TRUE);
+ if (!pdir) pdir = elm_config_profile_dir_get(sel_profile, EINA_FALSE);
+#ifdef ELM_EFREET
+ snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
+ desk = efreet_desktop_new(buf);
+ if ((desk) && (desk->name)) prof_name = desk->name;
+ else
+ {
+ if (desk) efreet_desktop_free(desk);
+ if (pdir) elm_config_profile_dir_free(pdir);
+
+ pdir = elm_config_profile_dir_get(sel_profile, EINA_FALSE);
+ snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
+ desk = efreet_desktop_new(buf);
+ if ((desk) && (desk->name)) prof_name = desk->name;
+ else prof_name = cur_profile;
+ }
+#endif
+
+ if (!pdir)
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
+ EINA_TRUE);
+ else
+ {
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
+ EINA_TRUE);
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
+ EINA_FALSE);
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"),
+ EINA_FALSE);
+ elm_config_profile_dir_free(pdir);
+ }
+
+ snprintf(buf, sizeof(buf), "<hilight>Selected profile: %s</><br/>",
+ prof_name);
+ elm_object_text_set(evas_object_data_get(obj, "prof_name_lbl"), buf);
+
+ en = evas_object_data_get(obj, "prof_desc_entry");
+#ifdef ELM_EFREET
+ if (desk) elm_object_text_set(en, desk->comment);
+ else
+#endif
+ elm_object_text_set(en, "Unknown");
+
+#ifdef ELM_EFREET
+ if (desk) efreet_desktop_free(desk);
+#endif
+}
+
+static void
+_profiles_list_fill(Evas_Object *l_widget,
+ Eina_List *p_names)
+{
+ const char *cur_profile = NULL;
+ const char *profile;
+ void *sel_it = NULL;
+ Eina_List *l;
+
+ if (!p_names)
+ return;
+
+ elm_list_clear(l_widget);
+
+ cur_profile = elm_config_profile_get();
+
+ EINA_LIST_FOREACH(p_names, l, profile)
+ {
+#ifdef ELM_EFREET
+ Efreet_Desktop *desk = NULL;
+#endif
+ const char *label, *ext, *pdir;
+ char buf[PATH_MAX];
+ Elm_Object_Item *list_it;
+ Evas_Object *ic;
+
+ pdir = elm_config_profile_dir_get(profile, EINA_TRUE);
+ if (!pdir) pdir = elm_config_profile_dir_get(profile, EINA_FALSE);
+
+#ifdef ELM_EFREET
+ snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
+ desk = efreet_desktop_new(buf);
+ if ((desk) && (desk->name)) label = desk->name;
+ else
+ {
+ if (desk) efreet_desktop_free(desk);
+ if (pdir) elm_config_profile_dir_free(pdir);
+
+ pdir = elm_config_profile_dir_get(profile, EINA_FALSE);
+ snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
+ desk = efreet_desktop_new(buf);
+ if ((desk) && (desk->name)) label = desk->name;
+ else label = profile;
+ }
+#endif
+
+ buf[0] = 0;
+ if (pdir) snprintf(buf, sizeof(buf), "%s/icon.edj", pdir);
+#ifdef ELM_EFREET
+ if ((desk) && (desk->icon) && (pdir))
+ snprintf(buf, sizeof(buf), "%s/%s", pdir, desk->icon);
+#endif
+ ic = elm_icon_add(l_widget);
+ ext = strrchr(buf, '.');
+ if (ext)
+ {
+ if (!strcmp(ext, ".edj")) elm_image_file_set(ic, buf, "icon");
+ else elm_image_file_set(ic, buf, NULL);
+ }
+
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL,
+ 1, 1);
+ evas_object_show(ic);
+
+ list_it = elm_list_item_append(l_widget, label, ic, NULL,
+ _profiles_list_selected_cb,
+ strdup(profile));
+ elm_object_item_del_cb_set(list_it, _profiles_list_item_del_cb);
+ if (cur_profile && !strcmp(profile, cur_profile))
+ sel_it = list_it;
+
+ elm_config_profile_dir_free(pdir);
+
+#ifdef ELM_EFREET
+ if (desk) efreet_desktop_free(desk);
+#endif
+ }
+
+ if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE);
+ elm_list_go(l_widget);
+}
+
+static void
+_profiles_list_unselect_cb(void *data EINA_UNUSED,
+ Evas_Object *obj,
+ void *event_info EINA_UNUSED)
+{
+ if (elm_list_selected_item_get(obj)) return;
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
+ EINA_TRUE);
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
+ EINA_TRUE);
+ elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"),
+ EINA_TRUE);
+}
+
+static void
+_status_config_profiles(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *li, *bx, *fr_bx1, *fr_bx2, *btn_bx, *fr, *lb, *en, *sp, *pd,
+ *bt;
+ Eina_List *profs;
+ Evas *evas;
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ fr_bx1 = elm_box_add(win);
+ evas_object_size_hint_weight_set(fr_bx1, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr_bx1, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_homogeneous_set(fr_bx1, EINA_TRUE);
+ evas_object_show(fr_bx1);
+
+ fr_bx2 = elm_box_add(win);
+ evas_object_size_hint_weight_set(fr_bx2, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr_bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(fr_bx2);
+
+ fr = elm_frame_add(win);
+ elm_object_text_set(fr, "Available Profiles");
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(fr, fr_bx1);
+ elm_box_pack_end(bx, fr);
+ evas_object_show(fr);
+
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(li, "unselected", _profiles_list_unselect_cb,
+ NULL);
+
+ profs = elm_config_profile_list_get();
+
+ evas_object_show(li);
+ elm_box_pack_end(fr_bx2, li);
+
+ lb = elm_label_add(win);
+ evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
+
+ evas_object_show(lb);
+
+ en = elm_entry_add(win);
+ elm_entry_scrollable_set(en, EINA_TRUE);
+ elm_entry_editable_set(en, EINA_FALSE);
+ evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(en);
+
+ evas_object_data_set(li, "prof_name_lbl", lb);
+ evas_object_data_set(li, "prof_desc_entry", en);
+
+ elm_box_pack_end(fr_bx2, lb);
+ elm_box_pack_end(fr_bx1, fr_bx2);
+ elm_box_pack_end(fr_bx1, en);
+
+ /////////////////////////////////////////////
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ pd = elm_frame_add(win);
+ elm_object_style_set(pd, "pad_medium");
+ evas_object_size_hint_weight_set(pd, 0.0, 0.0);
+ evas_object_size_hint_align_set(pd, 0.5, 0.5);
+ elm_box_pack_end(bx, pd);
+ evas_object_show(pd);
+
+ btn_bx = elm_box_add(win);
+ elm_box_horizontal_set(btn_bx, EINA_TRUE);
+ evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(btn_bx);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _profile_use, li);
+ elm_object_text_set(bt, "Use");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(btn_bx, bt);
+ evas_object_show(bt);
+
+ evas_object_data_set(li, "prof_use_btn", bt);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */
+ elm_object_text_set(bt, "Delete");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(btn_bx, bt);
+ evas_object_show(bt);
+
+ evas_object_data_set(li, "prof_del_btn", bt);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _profile_reset, li);
+ elm_object_text_set(bt, "Reset");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(btn_bx, bt);
+ evas_object_show(bt);
+
+ evas_object_data_set(li, "prof_reset_btn", bt);
+
+ bt = elm_button_add(win);
+ evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */
+ elm_object_text_set(bt, "Add new");
+ evas_object_size_hint_weight_set(bt, 0.0, 0.0);
+ evas_object_size_hint_align_set(bt, 0.5, 0.5);
+ elm_box_pack_end(btn_bx, bt);
+ evas_object_show(bt);
+
+ elm_object_content_set(pd, btn_bx);
+
+ evas = evas_object_evas_get(li);
+ evas_event_freeze(evas);
+ edje_freeze();
+
+ _profiles_list_fill(li, profs);
+
+ elm_config_profile_list_free(profs);
+
+ edje_thaw();
+ evas_event_thaw(evas);
+
+ evas_object_data_set(win, "profiles", bx);
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+static void
+_status_config_scrolling_bounce(Evas_Object *win, Evas_Object *box)
+{
+ Evas_Object *fr, *bx, *ck, *pd, *lb, *sl;
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Bounce");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+
+ /* Enable Scroll Bounce */
+ CHECK_ADD("Enable scroll bounce",
+ "Set whether scrollers should bounce<br/>"
+ "when they reach their viewport's edge<br/>"
+ "during a scroll",
+ sb_change, NULL);
+ evas_object_data_set(win, "scroll_bounce_check", ck);
+ elm_check_state_set(ck, elm_config_scroll_bounce_enabled_get());
+
+ /* Scroll bounce friction */
+ LABEL_FRAME_ADD("<hilight>Scroll bounce friction</>");
+
+ sl = elm_slider_add(bx);
+ elm_object_tooltip_text_set(sl, "This is the amount of inertia a <br/>"
+ "scroller will impose at bounce animations");
+ evas_object_data_set(win, "bounce_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.0, 4.0);
+ elm_slider_value_set(sl, elm_config_scroll_bounce_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", bf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", bf_change, NULL);
+}
+
+static void
+_status_config_scrolling_thumb(Evas_Object *win, Evas_Object *box)
+{
+ Evas_Object *fr, *bx, *ck, *sl, *sp, *pd, *lb;
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Thumb Scroll");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+
+ /* Enable thumb scroll */
+ CHECK_ADD("Enable thumb scroll",
+ "Set whether scrollers should be<br/>"
+ "draggable from any point in their views",
+ ts_change, NULL);
+ evas_object_data_set(win, "thumbscroll_check", ck);
+ elm_check_state_set(ck, elm_config_scroll_thumbscroll_enabled_get());
+
+ /* Thumb scroll threadhold */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll threshold</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the number of pixels one should<br/>"
+ "travel while dragging a scroller's view<br/>"
+ "to actually trigger scrolling");
+ evas_object_data_set(win, "ts_threshold_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixels");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 8.0, 50.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_threshold_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tst_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tst_change, NULL);
+
+ /* Thumb scroll hold threashold */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll hold threshold</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the number of pixels the range<br/>"
+ "which can be scrolled, while the scroller<br/>"
+ "is holed");
+ evas_object_data_set(win, "ts_hold_threshold_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixels");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 4.0, 500.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_hold_threshold_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsht_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsht_change, NULL);
+
+ /* Thumb scroll momentum threshold */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll momentum threshold</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br/>"
+ "cursor movement which will trigger<br/>"
+ "list self scrolling animation after a<br/>"
+ "mouse up event (pixels/second)");
+ evas_object_data_set(win, "ts_momentum_threshold_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixels/s");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 10.0, 200.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_momentum_threshold_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsmt_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsmt_change,
+ NULL);
+
+ /* Thumb scroll flick distance tolerance */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll flick distance tolerance</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the number of pixels the maximum<br/>"
+ "distance which can be flicked. If it is<br/>"
+ "flicked more than this, the flick distance<br/>"
+ "is same with maximum distance");
+ evas_object_data_set(win, "ts_flick_distance_tolerance_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixels");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 100.0, 3000.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_flick_distance_tolerance_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsfdt_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsfdt_change, NULL);
+
+ /* Thumb scroll friction */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br/>"
+ "scroller will impose at self scrolling<br/>"
+ "animations");
+ evas_object_data_set(win, "ts_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.1, 10.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsf_change, NULL);
+
+ /* Thumb scroll min friction */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll min friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the min amount of inertia a<br/>"
+ "scroller will impose at self scrolling<br/>"
+ "animations");
+ evas_object_data_set(win, "ts_min_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.1, 10.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_min_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsmf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsmf_change, NULL);
+
+ /* Thumb scroll friction standard */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll friction standard</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the standard velocity of the scroller."
+ "<br/>The scroll animation time is same<br/>"
+ "with thumbscroll friction, if the velocity"
+ "<br/>is same with standard velocity.");
+ evas_object_data_set(win, "ts_friction_standard_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixel/s");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 10.0, 5000.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_friction_standard_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsfs_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsfs_change, NULL);
+
+ /* Thumb scroll border friction */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll border friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the amount of lag between your<br/>"
+ "actual mouse cursor dragging movement<br/>"
+ "and a scroller's view movement itself,<br/>"
+ "while pushing it into bounce state<br/>"
+ "manually");
+ evas_object_data_set(win, "ts_border_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.0, 1.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_border_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsbf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsbf_change, NULL);
+
+ /* Thumb scroll sensitivity friction */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll sensitivity friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the sensitivity amount which<br/>"
+ "is be multiplied by the length of mouse<br/>"
+ "dragging.");
+ evas_object_data_set(win, "ts_sensitivity_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.1, 1.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_sensitivity_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tssf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tssf_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+}
+
+static void
+_status_config_scrolling_acceleration(Evas_Object *win, Evas_Object *box)
+{
+ Evas_Object *fr, *bx, *sl, *pd, *lb;
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Thumb Scroll Acceleration");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+
+ /* Thumb scroll acceleration threshold */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration threshold</>");
+
+ sl = elm_slider_add(bx);
+ elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br/>"
+ "cursor movement which will accelerate<br/>"
+ "scrolling velocity after a<br/>"
+ "mouse up event (pixels/second)");
+ evas_object_data_set(win, "ts_acceleration_threshold_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f pixels/s");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 10.0, 5000.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_threshold_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsat_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsat_change, NULL);
+
+ /* Thumb scroll acceleration time limit */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration time limit</>");
+
+ sl = elm_slider_add(bx);
+ elm_object_tooltip_text_set(sl, "This is the time limit for<br/>"
+ "accelerating velocity<br/>");
+ evas_object_data_set(win, "ts_acceleration_time_limit_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.0, 15.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_time_limit_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsatl_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsatl_change, NULL);
+
+ /* Thumb scroll acceleration weight */
+ LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration weight</>");
+
+ sl = elm_slider_add(bx);
+ elm_object_tooltip_text_set(sl, "This is the weight for acceleration");
+ evas_object_data_set(win, "ts_acceleration_weight_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 1.0, 10.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_weight_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", tsaw_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", tsaw_change, NULL);
+}
+
+static void
+_status_config_scrolling(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *lb, *pd, *box, *bx, *sl, *sc, *ck, *fr;
+
+ box = elm_box_add(win);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.5);
+
+ sc = elm_scroller_add(win);
+ elm_scroller_step_size_set(sc, 32, 64 * elm_config_scale_get());
+ evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
+ evas_object_show(sc);
+ elm_object_content_set(sc, box);
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Acceleration");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+
+ LABEL_FRAME_ADD("<hilight>Wheel acceleration factor</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the factor by which scrolling<br/>"
+ "increments will be multiplied when scrolling<br/>"
+ "quickly");
+ evas_object_data_set(win, "scroll_accel_factor", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%2.1f");
+ elm_slider_min_max_set(sl, 0.0, 10.0);
+ elm_slider_value_set(sl, elm_config_scroll_accel_factor_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", bis_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", scroll_accel_factor_change, NULL);
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Animation");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+
+ /* Disable Scroll Animation */
+ CHECK_ADD("Disable scroll animation",
+ "Set whether scrollers should scroll<br/>"
+ "immediately instead of animating",
+ scroll_animation_disable_change, NULL);
+ evas_object_data_set(win, "scroll_animation_disable", ck);
+ elm_check_state_set(ck, elm_config_scroll_animation_disable_get());
+
+ /* Bounce */
+ _status_config_scrolling_bounce(win, box);
+
+ _status_config_scrolling_thumb(win, box);
+
+ /* Acceleration */
+ _status_config_scrolling_acceleration(win, box);
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Friction");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+ /* Page scroll friction */
+ LABEL_FRAME_ADD("<hilight>Page scroll friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br/>"
+ "paged scroller will impose at<br/>"
+ "page fitting animations");
+ evas_object_data_set(win, "page_scroll_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.0, 5.0);
+ elm_slider_value_set(sl, elm_config_scroll_page_scroll_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", ps_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", ps_change, NULL);
+
+ /* Bring in scroll friction */
+ LABEL_FRAME_ADD("<hilight>Bring in scroll friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br/>"
+ "scroller will impose at region bring<br/>"
+ "animations");
+ evas_object_data_set(win, "bring_in_scroll_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.0, 5.0);
+ elm_slider_value_set(sl, elm_config_scroll_bring_in_scroll_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", bis_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", bis_change, NULL);
+
+ /* Zoom scroll friction */
+ LABEL_FRAME_ADD("<hilight>Zoom scroll friction</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the amount of inertia<br/>"
+ "scrollers will impose at animations<br/>"
+ "triggered by Elementary widgets'<br/>"
+ "zooming API");
+ evas_object_data_set(win, "zoom_scroll_friction_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.0, 5.0);
+ elm_slider_value_set(sl, elm_config_scroll_zoom_friction_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", zf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", zf_change, NULL);
+
+ fr = elm_frame_add(box);
+ evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(fr, "Smooth Start");
+ elm_box_pack_end(box, fr);
+ evas_object_show(fr);
+
+ bx = elm_box_add(fr);
+ elm_object_content_set(fr, bx);
+ evas_object_show(bx);
+ CHECK_ADD("Enable smooth start",
+ "Set whether scrollers start smoothly on thumb<br/>"
+ "scroll",
+ ss_change, NULL);
+ evas_object_data_set(win, "scroll_smooth_start", ck);
+ elm_check_state_set(ck, elm_config_scroll_thumbscroll_smooth_start_get());
+
+ /* Scroll Smooth Amount */
+ LABEL_FRAME_ADD("<hilight>Scroll Smooth Amount</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the amount smoothing to apply<br/>"
+ "to thumbscroll to avoid jerky input");
+ evas_object_data_set(win, "scroll_smooth_amount", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.0, 1.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_smooth_amount_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", smooth_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", smooth_change, NULL);
+
+ /* Scroll Smooth Time Window */
+ LABEL_FRAME_ADD("<hilight>Scroll Smooth Time Window</>");
+
+ sl = elm_slider_add(win);
+ elm_object_tooltip_text_set(sl, "This is the window of time to look back<br/>"
+ "into for smoothing of thumbscroll");
+ evas_object_data_set(win, "scroll_smooth_time_window", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.2f");
+ elm_slider_indicator_format_set(sl, "%1.2f");
+ elm_slider_min_max_set(sl, 0.0, 1.0);
+ elm_slider_value_set(sl, elm_config_scroll_thumbscroll_smooth_time_window_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", smooth_win_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", smooth_win_change, NULL);
+
+
+ evas_object_data_set(win, "scrolling", sc);
+
+ elm_naviframe_item_simple_push(naviframe, sc);
+}
+
+static void
+_cb_accel(void *data, Evas_Object *obj EINA_UNUSED, void *info EINA_UNUSED)
+{
+ const char *val = data;
+ const char *ss = elm_config_accel_preference_get();
+
+ if ((!ss) || (ss && (strcasecmp(ss, val))))
+ {
+ elm_config_accel_preference_set(val);
+ elm_config_all_flush();
+ }
+}
+
+static void
+_cb_accel_override(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sb = elm_config_accel_preference_override_get();
+
+ if (val != sb)
+ {
+ elm_config_accel_preference_override_set(val);
+ elm_config_all_flush();
+ }
+}
+
+static void
+_cb_vsync(void *data EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
+{
+ Eina_Bool val = elm_check_state_get(obj);
+ Eina_Bool sb = elm_config_vsync_get();
+
+ if (val != sb)
+ {
+ elm_config_vsync_set(val);
+ elm_config_all_flush();
+ }
+}
+
+static void
+_status_config_rendering(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *li, *bx, *ck, *sp;
+ Elm_Object_Item *it;
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ li = elm_list_add(win);
+ evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(bx, li);
+ evas_object_show(li);
+
+ it = elm_list_item_append(li, "No Acceleration", NULL, NULL,
+ _cb_accel, "none");
+ if (!elm_config_accel_preference_get() ||
+ (!strcasecmp(elm_config_accel_preference_get(), "none")))
+ elm_list_item_selected_set(it, EINA_TRUE);
+
+ it = elm_list_item_append(li, "OpenGL / OpenGL-ES", NULL, NULL,
+ _cb_accel, "gl");
+ if (elm_config_accel_preference_get() &&
+ ((!strcasecmp(elm_config_accel_preference_get(), "gl")) ||
+ (!strcasecmp(elm_config_accel_preference_get(), "opengl"))))
+ elm_list_item_selected_set(it, EINA_TRUE);
+
+ it = elm_list_item_append(li, "3D (any 3D hardware)", NULL, NULL,
+ _cb_accel, "3d");
+ if (elm_config_accel_preference_get() &&
+ (!strcasecmp(elm_config_accel_preference_get(), "3d")))
+ elm_list_item_selected_set(it, EINA_TRUE);
+
+ it = elm_list_item_append(li, "Hardware (any hardware)", NULL, NULL,
+ _cb_accel, "hw");
+ if (elm_config_accel_preference_get() &&
+ ((!strcasecmp(elm_config_accel_preference_get(), "hw")) ||
+ (!strcasecmp(elm_config_accel_preference_get(), "hardware")) ||
+ (!strcasecmp(elm_config_accel_preference_get(), "accel"))))
+ elm_list_item_selected_set(it, EINA_TRUE);
+
+ elm_list_go(li);
+
+ CHECK_ADD("Override Preferred Acceleration",
+ "Force any application requesting<br>"
+ "acceleration to use the system<br>"
+ "configured acceleration as above",
+ _cb_accel_override, NULL);
+ elm_check_state_set(ck, elm_config_accel_preference_override_get());
+
+ /////////////////////////////////////////////
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ CHECK_ADD("Tear-free rendering (VSync)",
+ "This enables Vsync hints for some<br>"
+ "rendering engines to try keep display<br>"
+ "VSynced and from Tearing",
+ _cb_vsync, NULL);
+ elm_check_state_set(ck, elm_config_vsync_get());
+
+ evas_object_data_set(win, "rendering", bx);
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+static void
+_status_config_caches(Evas_Object *win,
+ Evas_Object *naviframe)
+{
+ Evas_Object *lb, *pd, *bx, *sl, *sp, *ck;
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
+
+ LABEL_FRAME_ADD("<hilight>Cache Flush Interval (8 ticks per second)</>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "cache_flush_interval_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f ticks");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 8.0, 4096.0);
+ elm_slider_value_set(sl, elm_config_cache_flush_interval_get());
+ elm_object_disabled_set(sl, !elm_config_cache_flush_enabled_get());
+
+ CHECK_ADD("Enable Flushing", "Enable Flushing", cf_enable, sl);
+ elm_check_state_set(ck, elm_config_cache_flush_enabled_get());
+
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", cf_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", cf_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ LABEL_FRAME_ADD("<hilight>Font Cache Size</>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "font_cache_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.1f MB");
+ elm_slider_indicator_format_set(sl, "%1.1f");
+ elm_slider_min_max_set(sl, 0.0, 4.0);
+ elm_slider_value_set(sl, (double)elm_config_cache_font_cache_size_get() / 1024.0);
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", fc_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", fc_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ LABEL_FRAME_ADD("<hilight>Image Cache Size</>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "image_cache_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f MB");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 0, 32);
+ elm_slider_value_set(sl, (double)elm_config_cache_image_cache_size_get() / 1024.0);
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", ic_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", ic_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ LABEL_FRAME_ADD("<hilight>Number of Edje Files to Cache</>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "edje_file_cache_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f files");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 0, 32);
+ elm_slider_value_set(sl, elm_config_cache_edje_file_cache_size_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", efc_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", efc_change, NULL);
+
+ sp = elm_separator_add(win);
+ elm_separator_horizontal_set(sp, EINA_TRUE);
+ evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
+ elm_box_pack_end(bx, sp);
+ evas_object_show(sp);
+
+ LABEL_FRAME_ADD("<hilight>Number of Edje Collections to Cache</>");
+
+ sl = elm_slider_add(win);
+ evas_object_data_set(win, "edje_collection_cache_slider", sl);
+ evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
+ elm_slider_span_size_set(sl, 120);
+ elm_slider_unit_format_set(sl, "%1.0f collections");
+ elm_slider_indicator_format_set(sl, "%1.0f");
+ elm_slider_min_max_set(sl, 0, 128);
+ elm_slider_value_set(sl, elm_config_cache_edje_collection_cache_size_get());
+ elm_box_pack_end(bx, sl);
+ evas_object_show(sl);
+
+ evas_object_smart_callback_add(sl, "changed", ecc_round, NULL);
+ evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL);
+
+ evas_object_data_set(win, "caches", bx);
+
+ elm_naviframe_item_simple_push(naviframe, bx);
+}
+
+static void
+_status_config_full(Evas_Object *win,
+ Evas_Object *bx0)
+{
+ Evas_Object *tb, *naviframe;
+ Elm_Object_Item *tb_sizing, *tb_it;
+
+ tb = elm_toolbar_add(win);
+ elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_toolbar_menu_parent_set(tb, win);
+ elm_toolbar_homogeneous_set(tb, EINA_FALSE);
+ evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ tb_sizing = elm_toolbar_item_append(tb, "zoom-fit-best", "Sizing",
+ _cf_sizing, win);
+ elm_toolbar_item_priority_set(tb_sizing, 100);
+
+ tb_it = elm_toolbar_item_append(tb, "preferences-desktop-theme", "Theme",
+ _cf_themes, win);
+ elm_toolbar_item_priority_set(tb_it, 90);
+
+ elm_toolbar_item_append(tb, "preferences-desktop-font", "Fonts",
+ _cf_fonts, win);
+
+ tb_it = elm_toolbar_item_append(tb, "system-users", "Profiles",
+ _cf_profiles, win);
+ elm_toolbar_item_priority_set(tb_it, 90);
+
+ elm_toolbar_item_append(tb, "system-run", "Scrolling", _cf_scrolling, win);
+ elm_toolbar_item_append(tb, "video-display", "Rendering",
+ _cf_rendering, win);
+ elm_toolbar_item_append(tb, "appointment-new", "Caches", _cf_caches, win);
+ elm_toolbar_item_append(tb, "sound", "Audio", _cf_audio, win);
+ elm_toolbar_item_append(tb, NULL, "Focus", _cf_focus, win);
+ elm_toolbar_item_append(tb, NULL, "Etc", _cf_etc, win);
+
+ elm_box_pack_end(bx0, tb);
+ evas_object_show(tb);
+
+ naviframe = elm_naviframe_add(win);
+ evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_data_set(win, "naviframe", naviframe);
+
+ _status_config_themes(win, naviframe);
+ _status_config_fonts(win, naviframe);
+ _status_config_profiles(win, naviframe);
+ _status_config_rendering(win, naviframe);
+ _status_config_scrolling(win, naviframe);
+ _status_config_caches(win, naviframe);
+ _status_config_audio(win, naviframe);
+ _status_config_focus(win, naviframe);
+ _status_config_etc(win, naviframe);
+ _status_config_sizing(win, naviframe); // Note: call this at the end.
+
+ // FIXME uncomment after flip style fix, please
+ //elm_object_style_set(naviframe, "flip");
+ elm_toolbar_item_selected_set(tb_sizing, EINA_TRUE);
+ elm_box_pack_end(bx0, naviframe);
+ evas_object_show(naviframe);
+}
+
+static void
+win_create(void)
+{
+ Evas_Object *win, *bx0;
+
+ win = elm_win_util_standard_add("main", "Elementary Config");
+ if (!win) exit(1);
+ ecore_event_handler_add(ELM_EVENT_CONFIG_ALL_CHANGED, _config_all_changed,
+ win);
+ evas_object_smart_callback_add(win, "delete,request", config_exit, NULL);
+
+ bx0 = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx0, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bx0);
+ evas_object_show(bx0);
+
+ if (!interactive) _status_basic(win, bx0);
+ else if (0)
+ _status_config(win, bx0);
+ else _status_config_full(win, bx0);
+
+ evas_object_resize(win, 320, 480);
+ evas_object_show(win);
+}
+
+static Eina_Bool
+_exit_timer(void *data EINA_UNUSED)
+{
+ elm_exit();
+ return ECORE_CALLBACK_CANCEL;
+}
+
+/* this is your elementary main function - it MUST be called IMMEDIATELY
+ * after elm_init() and MUST be passed argc and argv, and MUST be called
+ * elm_main and not be static - must be a visible symbol with EAPI infront */
+EAPI_MAIN int
+elm_main(int argc,
+ char **argv)
+{
+ int i;
+
+ elm_app_info_set(elm_main, "elementary", "images/logo.png");
+ elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
+ elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
+
+ for (i = 1; i < argc; i++)
+ {
+ if (!strcmp(argv[i], "-h"))
+ {
+ printf("Usage:\n"
+ " -h This help\n"
+ " -q Quiet mode (dont show window)\n"
+ " -t THEME Set theme to THEME (ELM_THEME spec)\n"
+ " -f SIZE Set finger size to SIZE pixels\n"
+ " -s SCALE Set scale factor to SCALE\n"
+ " -w WEB_BACKEND Set the web backend to be used\n"
+ );
+ }
+ else if (!strcmp(argv[i], "-q"))
+ {
+ quiet = 1;
+ interactive = 0;
+ }
+ else if ((!strcmp(argv[i], "-t")) && (i < argc - 1))
+ {
+ i++;
+ theme_set = argv[i];
+ interactive = 0;
+ }
+ else if ((!strcmp(argv[i], "-f")) && (i < argc - 1))
+ {
+ i++;
+ finger_size_set = argv[i];
+ interactive = 0;
+ }
+ else if ((!strcmp(argv[i], "-s")) && (i < argc - 1))
+ {
+ i++;
+ scale_set = argv[i];
+ interactive = 0;
+ }
+ else if ((!strcmp(argv[i], "-w")) && (i < argc - 1))
+ {
+ i++;
+ web_backend = argv[i];
+ interactive = 0;
+ }
+ }
+ /* put here any init code specific to this app like parsing args, etc. */
+ if (!quiet)
+ {
+#ifdef ELM_EFREET
+ elm_need_efreet();
+#endif
+ win_create(); /* create main window */
+ if (!interactive)
+ ecore_timer_add(2.0, _exit_timer, NULL);
+ }
+ if (!interactive)
+ {
+ if (theme_set) elm_theme_set(NULL, theme_set);
+ if (finger_size_set) elm_config_finger_size_set(atoi(finger_size_set));
+ if (scale_set) elm_config_scale_set(atof(scale_set));
+ if (web_backend) elm_config_web_backend_set(web_backend);
+
+ elm_config_all_flush();
+
+ if (quiet) elm_exit();
+ }
+ elm_run(); /* and run the program now and handle all events, etc. */
+ /* if the mainloop that elm_run() runs exists, we exit the app */
+ /* exit code */
+
+ if (interactive)
+ {
+ const char *web_backend_set = elm_config_web_backend_get();
+
+ web_backend = elm_object_text_get(web_backend_entry);
+ fprintf(stderr, "[%s] vs [%s]\n", web_backend, web_backend_set);
+ if (strcmp(web_backend, web_backend_set))
+ {
+ elm_config_web_backend_set(web_backend);
+ fprintf(stderr, "web backend set to : [%s]\n", elm_config_web_backend_get());
+ elm_config_all_flush();
+ }
+ }
+
+ return 0;
+}
+/* All elementary apps should use this. Put it right after elm_main() */
+ELM_MAIN()
diff --git a/src/bin/elementary/elementary_codegen.c b/src/bin/elementary/elementary_codegen.c
new file mode 100644
index 0000000000..e9cc685b66
--- /dev/null
+++ b/src/bin/elementary/elementary_codegen.c
@@ -0,0 +1,887 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Ecore_Getopt.h>
+#include <Edje.h>
+#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT 1
+#include <Edje_Edit.h>
+#include <Eina.h>
+
+#include <Elementary.h>
+
+#include <ctype.h>
+#include <fcntl.h>
+#include <locale.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#ifndef ENABLE_NLS
+# ifndef libintl_setlocale
+# define libintl_setlocale(c, l)
+# endif
+#endif
+
+static int _log_dom;
+#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
+#define WRN(...) EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
+
+static Ecore_Evas *ee = NULL;
+static char *file = NULL;
+static char *group = NULL;
+static char *prefix = NULL;
+static FILE *source_fd = NULL;
+static FILE *header_fd = NULL;
+
+#define H_HEADER \
+ "#ifndef _%s\n" \
+ "#define _%s\n\n" \
+ "#include <Edje.h>\n" \
+ "#include <Elementary.h>\n" \
+ "#include <Evas.h>\n\n" \
+ "#include <stdlib.h>\n\n"
+
+#define H_FOOTER \
+ "\n#endif /* _%s */\n"
+
+#define C_HEADER \
+ "#include \"%s\"\n\n"
+
+#define H_CODEGEN_LAYOUT_ADD \
+ "/**\n * @brief Creates the layout object and set the theme\n" \
+ " * @param o The parent\n" \
+ " * @param th The theme to add to, or if NULL, the default theme\n" \
+ " * @param edje_file The path to edj, if NULL it's used the path given\n" \
+ " * to elementary_codegen\n */\n" \
+ "Evas_Object *%s_layout_add(Evas_Object *o, Elm_Theme *th, " \
+ "const char *edje_file);\n"
+
+#define C_CODEGEN_LAYOUT_ADD \
+ "Evas_Object *\n" \
+ "%s_layout_add(Evas_Object *o, Elm_Theme *th, const char *edje_file)\n" \
+ "{\n" \
+ " Evas_Object *l;\n\n" \
+ " if (edje_file)\n" \
+ " elm_theme_extension_add(th, edje_file);\n" \
+ " else\n" \
+ " elm_theme_extension_add(th, \"./%s\");\n\n" \
+ " l = elm_layout_add(o);\n" \
+ " if (!l) return NULL;\n\n" \
+ " if (!elm_layout_theme_set(l, \"%s\", \"%s\", \"%s\"))\n" \
+ " {\n" \
+ " evas_object_del(l);\n" \
+ " return NULL;\n" \
+ " }\n\n" \
+ " return l;\n" \
+ "}\n\n"
+
+#define C_CODEGEN_PART_CONTENT_SET \
+ "void\n" \
+ "%s_%s_set(Evas_Object *o, Evas_Object *value)\n" \
+ "{\n" \
+ " elm_layout_content_set(o, \"%s\", value);\n" \
+ "}\n\n"
+
+#define C_CODEGEN_PART_TEXT_SET \
+ "void\n" \
+ "%s_%s_set(Evas_Object *o, const char *value)\n" \
+ "{\n" \
+ " elm_layout_text_set(o, \"%s\", value);\n" \
+ "}\n\n"
+
+#define C_CODEGEN_PART_CONTENT_UNSET \
+ "Evas_Object *\n" \
+ "%s_%s_unset(Evas_Object *o)\n" \
+ "{\n" \
+ " return elm_layout_content_unset(o, \"%s\");\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_CONTENT_SET \
+ "void %s_%s_set(Evas_Object *o, Evas_Object *value);\n"
+
+#define H_CODEGEN_PART_TEXT_SET \
+ "void %s_%s_set(Evas_Object *o, const char *value);\n"
+
+#define H_CODEGEN_PART_CONTENT_UNSET \
+ "Evas_Object *%s_%s_unset(Evas_Object *o);\n"
+
+#define C_CODEGEN_PART_CONTENT_GET \
+ "Evas_Object *\n" \
+ "%s_%s_get(const Evas_Object *o)\n" \
+ "{\n" \
+ " return elm_layout_content_get(o, \"%s\");\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_CONTENT_GET \
+ "Evas_Object *%s_%s_get(const Evas_Object *o);\n"
+
+#define C_CODEGEN_PART_TEXT_GET \
+ "const char *\n" \
+ "%s_%s_get(const Evas_Object *o)\n" \
+ "{\n" \
+ " return elm_layout_text_get(o, \"%s\");\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_TEXT_GET \
+ "const char *%s_%s_get(const Evas_Object *o);\n"
+
+#define C_CODEGEN_PART_BOX_APPEND \
+ "Eina_Bool\n" \
+ "%s_%s_append(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return elm_layout_box_append(o, \"%s\", child);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_BOX_APPEND \
+ "Eina_Bool %s_%s_append(Evas_Object *o, Evas_Object *child);\n"
+
+#define C_CODEGEN_PART_BOX_PREPEND \
+ "Eina_Bool\n" \
+ "%s_%s_prepend(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return elm_layout_box_prepend(o, \"%s\", child);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_BOX_PREPEND \
+ "Eina_Bool %s_%s_prepend(Evas_Object *o, Evas_Object *child);\n"
+
+#define C_CODEGEN_PART_BOX_INSERT_BEFORE \
+ "Eina_Bool\n" \
+ "%s_%s_insert_before(Evas_Object *o, Evas_Object *child, " \
+ "const Evas_Object *reference)\n" \
+ "{\n" \
+ " return elm_layout_box_insert_before(o, \"%s\", " \
+ "child, reference);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_BOX_INSERT_BEFORE \
+ "Eina_Bool %s_%s_insert_before(Evas_Object *o, Evas_Object *child, " \
+ "const Evas_Object *reference);\n"
+
+#define C_CODEGEN_PART_BOX_INSERT_AT \
+ "Eina_Bool\n" \
+ "%s_%s_insert_at(Evas_Object *o, Evas_Object *child, unsigned int pos)\n" \
+ "{\n" \
+ " return elm_layout_box_insert_at(o, \"%s\", child, pos);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_BOX_INSERT_AT \
+ "Eina_Bool %s_%s_insert_at(Evas_Object *o, Evas_Object *child, " \
+ "unsigned int pos);\n"
+
+#define C_CODEGEN_PART_BOX_REMOVE \
+ "Evas_Object *\n" \
+ "%s_%s_remove(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return elm_layout_box_remove(o, \"%s\", child);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_BOX_REMOVE \
+ "Evas_Object *%s_%s_remove(Evas_Object *o, Evas_Object *child);\n"
+
+#define C_CODEGEN_PART_BOX_REMOVE_ALL \
+ "Eina_Bool\n" \
+ "%s_%s_remove_all(Evas_Object *o, Eina_Bool clear)\n" \
+ "{\n" \
+ " return elm_layout_box_remove_all(o, \"%s\", clear);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_BOX_REMOVE_ALL \
+ "Eina_Bool %s_%s_remove_all(Evas_Object *o, Eina_Bool clear);\n"
+
+#define C_CODEGEN_PART_TABLE_PACK \
+ "Eina_Bool\n" \
+ "%s_%s_pack(Evas_Object *o, Evas_Object *child, unsigned short col, " \
+ "unsigned short row, unsigned short colspan, unsigned short rowspan)\n" \
+ "{\n" \
+ " return elm_layout_table_pack(o, \"%s\", child, col, row, " \
+ "colspan, rowspan);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_TABLE_PACK \
+ "Eina_Bool %s_%s_pack(Evas_Object *o, Evas_Object *child, " \
+ "unsigned short col, unsigned short row, unsigned short " \
+ "colspan, unsigned short rowspan);\n"
+
+#define C_CODEGEN_PART_TABLE_UNPACK \
+ "Evas_Object *\n" \
+ "%s_%s_unpack(Evas_Object *o, Evas_Object *child)\n" \
+ "{\n" \
+ " return elm_layout_table_unpack(o, \"%s\", child);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_TABLE_UNPACK \
+ "Evas_Object *%s_%s_unpack(Evas_Object *o, Evas_Object *child);\n"
+
+#define C_CODEGEN_PART_TABLE_CLEAR \
+ "Eina_Bool\n" \
+ "%s_%s_clear(Evas_Object *o, Eina_Bool clear)\n" \
+ "{\n" \
+ " return elm_layout_table_clear(o, \"%s\", clear);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PART_TABLE_CLEAR \
+ "Eina_Bool %s_%s_clear(Evas_Object *o, Eina_Bool clear);\n"
+
+#define C_CODEGEN_PROGRAM_EMIT \
+ "void\n" \
+ "%s_%s_emit(Evas_Object *o)\n" \
+ "{\n" \
+ " elm_layout_signal_emit(o, \"%s\", \"%s\");\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PROGRAM_EMIT \
+ "void %s_%s_emit(Evas_Object *o);\n"
+
+#define C_CODEGEN_PROGRAM_CALLBACK_ADD \
+ "void\n" \
+ "%s_%s_callback_add(Evas_Object *o, Edje_Signal_Cb func, void *data)\n" \
+ "{\n" \
+ " elm_layout_signal_callback_add(o, \"%s\", \"%s\", func, data);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PROGRAM_CALLBACK_ADD \
+ "void %s_%s_callback_add(Evas_Object *o, Edje_Signal_Cb func, " \
+ "void *data);\n"
+
+#define C_CODEGEN_PROGRAM_CALLBACK_DEL \
+ "void\n" \
+ "%s_%s_callback_del(Evas_Object *o, Edje_Signal_Cb func)\n" \
+ "{\n" \
+ " elm_layout_signal_callback_del(o, \"%s\", \"%s\", func);\n" \
+ "}\n\n"
+
+#define H_CODEGEN_PROGRAM_CALLBACK_DEL \
+ "void %s_%s_callback_del(Evas_Object *o, Edje_Signal_Cb func);\n"
+
+const Ecore_Getopt optdesc =
+{
+ "elm_codegen",
+ "%prog [options] <file.edj> <group> <source_file_name> <header_file_name>",
+ PACKAGE_VERSION,
+ "(C) 2012 - The Enlightenment Project",
+ "BSD",
+ "elm_codegen generates the boilerplate code to get and set the "
+ "parts of a group from a compiled (binary) edje "
+ "file avoiding common errors with typos.\n",
+ 0,
+ {
+ ECORE_GETOPT_STORE_STR('p', "prefix", "The prefix for the " \
+ "generataed code."),
+ ECORE_GETOPT_LICENSE('L', "license"),
+ ECORE_GETOPT_COPYRIGHT('C', "copyright"),
+ ECORE_GETOPT_VERSION('V', "version"),
+ ECORE_GETOPT_HELP('h', "help"),
+ ECORE_GETOPT_SENTINEL
+ }
+};
+
+static char *
+_header_standardize(const char *filename)
+{
+ char *str, *itr, *aux;
+
+ aux = strrchr(filename, '/');
+ str = itr = strdup(aux ? aux + 1 : filename);
+
+ for (; *itr; itr++)
+ if (*itr == '.')
+ *itr = '_';
+ else
+ *itr = toupper(*itr);
+
+ return str;
+}
+
+static Eina_Bool
+_file_descriptors_open(const char *source, const char *header)
+{
+ header_fd = fopen(header, "w");
+ if (!header_fd)
+ return EINA_FALSE;
+
+ source_fd = fopen(source, "w");
+ if (!source_fd)
+ goto err;
+
+ return EINA_TRUE;
+
+ err:
+ fclose(header_fd);
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_file_descriptors_close(void)
+{
+ Eina_Bool ret = EINA_FALSE;
+
+ if (!fclose(header_fd))
+ ret = EINA_TRUE;
+
+ if (!fclose(source_fd))
+ ret &= EINA_TRUE;
+
+ return ret;
+}
+
+static Eina_Bool
+_headers_write(const char *filename)
+{
+ char buf[512];
+ char *str;
+
+ str = _header_standardize(filename);
+ snprintf(buf, sizeof(buf), H_HEADER, str, str);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ {
+ free(str);
+ return EINA_FALSE;
+ }
+
+ free(str);
+
+ snprintf(buf, sizeof(buf), C_HEADER, filename);
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
+ return EINA_FALSE;
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_footer_write(const char *filename)
+{
+ char buf[512];
+ char *str;
+
+ str = _header_standardize(filename);
+ snprintf(buf, sizeof(buf), H_FOOTER, str);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ {
+ free(str);
+ return EINA_FALSE;
+ }
+
+ free(str);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_theme_set_write(void)
+{
+ Eina_Bool ret = EINA_FALSE;
+ char *str[3]; /* *klas, *style, *group */
+ char *token, *_group, buf[512];
+ int i;
+
+ str[0] = str[1] = str[2] = NULL;
+ if (strncmp(group, "elm/", 4)) return EINA_FALSE;
+
+ _group = strdup(group);
+ if (!_group) return EINA_FALSE;
+
+ strtok(_group, "/");
+ for (i = 0; i < 3; i++)
+ {
+ token = strtok(NULL, "/");
+ if (!token) break;
+
+ str[i] = token;
+ }
+
+ if (!str[0] || !str[1] || !str[2])
+ goto end;
+
+ snprintf(buf, sizeof(buf), C_CODEGEN_LAYOUT_ADD, prefix, file, str[0],
+ str[1], str[2]);
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
+ goto end;
+
+ snprintf(buf, sizeof(buf), H_CODEGEN_LAYOUT_ADD, prefix);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto end;
+
+ ret = EINA_TRUE;
+
+end:
+ free(_group);
+ return ret;
+}
+
+static Eina_Bool
+_part_write(const char *apiname, const char *partname, const char *description,
+ Edje_Part_Type type)
+{
+ char buf[1024];
+
+#define TEMPLATE_NAME(sufix) \
+ do { \
+ snprintf(buf, sizeof(buf), C_CODEGEN_PART_##sufix, prefix, \
+ apiname, partname); \
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1) \
+ goto err; \
+ snprintf(buf, sizeof(buf), H_CODEGEN_PART_##sufix, prefix, \
+ apiname); \
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1) \
+ goto err; \
+ } while(0)
+
+ if (description)
+ {
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
+ }
+
+ switch (type)
+ {
+ case EDJE_PART_TYPE_BOX:
+ TEMPLATE_NAME(BOX_APPEND);
+ TEMPLATE_NAME(BOX_PREPEND);
+ TEMPLATE_NAME(BOX_INSERT_BEFORE);
+ TEMPLATE_NAME(BOX_INSERT_AT);
+ TEMPLATE_NAME(BOX_REMOVE);
+ TEMPLATE_NAME(BOX_REMOVE_ALL);
+ break;
+
+ case EDJE_PART_TYPE_TABLE:
+ TEMPLATE_NAME(TABLE_PACK);
+ TEMPLATE_NAME(TABLE_UNPACK);
+ TEMPLATE_NAME(TABLE_CLEAR);
+ break;
+
+ case EDJE_PART_TYPE_TEXT:
+ TEMPLATE_NAME(TEXT_SET);
+ TEMPLATE_NAME(TEXT_GET);
+ break;
+
+ default:
+ TEMPLATE_NAME(CONTENT_SET);
+ TEMPLATE_NAME(CONTENT_UNSET);
+ TEMPLATE_NAME(CONTENT_GET);
+ break;
+ }
+
+#undef TEMPLATE_NAME
+
+ return EINA_TRUE;
+
+ err:
+ ERR("Could not write the part: %s", partname);
+ return EINA_FALSE;
+}
+
+static inline Eina_Bool
+_c_id_allowed(char c)
+{
+ if ((c >= '0') && (c <= '9')) return EINA_TRUE;
+ if ((c >= 'a') && (c <= 'z')) return EINA_TRUE;
+ if ((c >= 'A') && (c <= 'Z')) return EINA_TRUE;
+
+ return EINA_FALSE;
+}
+
+static char *
+_api_name_fix(const char *orig)
+{
+ char *d, *d_end, buf[256];
+ const char *s;
+
+ if (!orig) return NULL;
+
+ s = orig;
+ d = buf;
+ d_end = d + sizeof(buf) - 1;
+
+ for (; (*s != '\0') && (d < d_end); s++, d++)
+ if (_c_id_allowed(*s)) *d = *s;
+ else *d = '_';
+ *d = '\0';
+
+ return strdup(buf);
+}
+
+static char *
+_part_api_name_get(Evas_Object *ed, const char *program)
+{
+ const char *orig;
+ char *fix;
+
+ orig = edje_edit_part_api_name_get(ed, program);
+ fix = _api_name_fix(orig);
+ edje_edit_string_free(orig);
+
+ return fix;
+}
+
+static Eina_Bool
+_parts_parse(Evas_Object *ed)
+{
+ Eina_List *parts, *l;
+ const char *name, *description;
+ char *apiname;
+ Edje_Part_Type type;
+ Eina_Bool ret = EINA_TRUE;
+
+ parts = edje_edit_parts_list_get(ed);
+ EINA_LIST_FOREACH(parts, l, name)
+ {
+ if (!(apiname = _part_api_name_get(ed, name)))
+ {
+ DBG("filter out part '%s': not API.", name);
+ continue;
+ }
+
+ type = edje_edit_part_type_get(ed, name);
+ if ((type != EDJE_PART_TYPE_SWALLOW) &&
+ (type != EDJE_PART_TYPE_TEXT) &&
+ (type != EDJE_PART_TYPE_BOX) &&
+ (type != EDJE_PART_TYPE_TABLE))
+ {
+ free(apiname);
+ continue;
+ }
+
+ description = edje_edit_part_api_description_get(ed, name);
+ if (!_part_write(apiname, name, description, type))
+ {
+ ret = EINA_FALSE;
+ edje_edit_string_free(description);
+ free(apiname);
+ break;
+ }
+
+ edje_edit_string_free(description);
+ free(apiname);
+ }
+
+ edje_edit_string_list_free(parts);
+ return ret;
+}
+
+static Eina_Bool
+_program_emit_write(const char *apiname, const char *source, const char *sig,
+ const char *description)
+{
+ char buf[512];
+
+ snprintf(buf, sizeof(buf), C_CODEGEN_PROGRAM_EMIT, prefix,
+ apiname, sig, source);
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
+ goto err;
+
+ if (description)
+ {
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
+ }
+
+ snprintf(buf, sizeof(buf), H_CODEGEN_PROGRAM_EMIT, prefix,
+ apiname);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
+
+ return EINA_TRUE;
+
+ err:
+ ERR("Could not write the program: %s", apiname);
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_program_add_write(const char *apiname, const char *source, const char *sig,
+ const char *description)
+{
+ char buf[512];
+
+ snprintf(buf, sizeof(buf), C_CODEGEN_PROGRAM_CALLBACK_ADD, prefix,
+ apiname, sig, source);
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
+ goto err;
+
+ snprintf(buf, sizeof(buf), C_CODEGEN_PROGRAM_CALLBACK_DEL, prefix,
+ apiname, sig, source);
+ if (fwrite(buf, strlen(buf), 1, source_fd) != 1)
+ goto err;
+
+ if (description)
+ {
+ snprintf(buf, sizeof(buf), "\n/**\n * @brief %s\n */\n", description);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
+ }
+
+ snprintf(buf, sizeof(buf), H_CODEGEN_PROGRAM_CALLBACK_ADD, prefix,
+ apiname);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
+
+ snprintf(buf, sizeof(buf), H_CODEGEN_PROGRAM_CALLBACK_DEL, prefix,
+ apiname);
+ if (fwrite(buf, strlen(buf), 1, header_fd) != 1)
+ goto err;
+
+ return EINA_TRUE;
+
+ err:
+ ERR("Could not write the program [action]: %s", apiname);
+ return EINA_FALSE;
+}
+
+static char *
+_program_api_name_get(Evas_Object *ed, const char *program)
+{
+ const char *orig;
+ char *fix;
+
+ orig = edje_edit_program_api_name_get(ed, program);
+ fix = _api_name_fix(orig);
+ edje_edit_string_free(orig);
+
+ return fix;
+}
+
+static Eina_Bool
+_programs_parse(Evas_Object *ed)
+{
+ Eina_Bool ret = EINA_TRUE;
+ Eina_List *programs, *l;
+ const char *name, *source = NULL, *sig = NULL, *description;
+ char *apiname;
+ Edje_Action_Type type;
+
+ programs = edje_edit_programs_list_get(ed);
+ EINA_LIST_FOREACH(programs, l, name)
+ {
+ if (!(apiname = _program_api_name_get(ed, name)))
+ {
+ DBG("filter out program '%s': not API.", name);
+ continue;
+ }
+
+ description = edje_edit_program_api_description_get(ed, name);
+ type = edje_edit_program_action_get(ed, name);
+ if (type == EDJE_ACTION_TYPE_SIGNAL_EMIT)
+ {
+ const char *str, *str2;
+ str = edje_edit_program_state_get(ed, name);
+ str2 = edje_edit_program_state2_get(ed, name);
+
+ if (!_program_add_write(apiname, str2, str, description))
+ {
+ ret = EINA_FALSE;
+ edje_edit_string_free(str);
+ edje_edit_string_free(str2);
+ break;
+ }
+
+ edje_edit_string_free(str);
+ edje_edit_string_free(str2);
+ }
+
+ sig = edje_edit_program_signal_get(ed, name);
+ if (!sig) sig = eina_stringshare_add("");
+
+ source = edje_edit_program_source_get(ed, name);
+ if (!source) source = eina_stringshare_add("");
+
+ if (strlen (sig))
+ {
+ if (!_program_emit_write(apiname, source, sig, description))
+ {
+ ret = EINA_FALSE;
+ break;
+ }
+ }
+
+ edje_edit_string_free(description);
+ edje_edit_string_free(sig);
+ edje_edit_string_free(source);
+ free(apiname);
+ }
+
+ edje_edit_string_list_free(programs);
+ if (!ret)
+ {
+ edje_edit_string_free(description);
+ edje_edit_string_free(sig);
+ edje_edit_string_free(source);
+ free(apiname);
+ }
+
+ return ret;
+}
+
+static Eina_Bool
+_parse(void)
+{
+ Evas_Object *ed;
+ Eina_Bool ret;
+
+ ed = edje_edit_object_add(ecore_evas_get(ee));
+ if (!edje_object_file_set(ed, file, group))
+ {
+ Edje_Load_Error err = edje_object_load_error_get(ed);
+ const char *errmsg = edje_load_error_str(err);
+ ERR("could not load group '%s' from file '%s': %s",
+ group, file, errmsg);
+ evas_object_del(ed);
+ return EINA_FALSE;
+ }
+
+ ret = _parts_parse(ed) && _programs_parse(ed);
+
+ evas_object_del(ed);
+ return ret;
+}
+
+int
+main(int argc, char *argv[])
+{
+ Eina_Bool quit_option = EINA_FALSE;
+ char *source = NULL, *header = NULL;
+ int arg_index, ret = 0;
+ Ecore_Getopt_Value values[] = {
+ ECORE_GETOPT_VALUE_STR(prefix),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_BOOL(quit_option),
+ ECORE_GETOPT_VALUE_NONE
+ };
+
+ setlocale(LC_NUMERIC, "C");
+
+ eina_init();
+ ecore_init();
+ ecore_evas_init();
+ edje_init();
+
+ if (argc < 2)
+ {
+ fprintf(stderr, "Missing action. See '--help or -h'.\n");
+ ret = 1;
+ goto error_log;
+ }
+
+ _log_dom = eina_log_domain_register("elementary_codegen", EINA_COLOR_YELLOW);
+ if (_log_dom < 0)
+ {
+ EINA_LOG_CRIT("could not register log domain 'elementary_codegen'");
+ ret = 1;
+ goto error_log;
+ }
+
+ arg_index = ecore_getopt_parse(&optdesc, values, argc, argv);
+ if (arg_index < 0)
+ {
+ ERR("could not parse arguments.");
+ ret = 1;
+ goto error_getopt;
+ }
+ else if (quit_option) goto error_getopt;
+ else if (arg_index != argc - 4)
+ {
+ fprintf(stderr, "Incorrect number of parameters. Requires " \
+ "fours arguments, an edje, the group, " \
+ "the source output (foo.c) and the header(foo.h).\n" \
+ "See %s --help\n", argv[0]);
+ ret = 1;
+ goto error_getopt;
+ }
+
+ file = argv[arg_index++];
+
+ // check if the file is accessible
+ if (access(file, R_OK) == -1)
+ {
+ ERR("File '%s' not accessible, error %d (%s).\n",
+ file, errno, strerror(errno));
+ ret = 1;
+ goto error_getopt;
+ }
+
+ group = argv[arg_index++];
+ source = argv[arg_index++];
+ header = argv[arg_index++];
+
+ if (!edje_file_group_exists(file, group))
+ {
+ ERR("The group %s not exists", group);
+ ret = 2;
+ goto error_getopt;
+ }
+
+ ee = ecore_evas_buffer_new(1, 1);
+ if (!ee)
+ {
+ ERR("could not create ecore_evas_buffer");
+ ret = 3;
+ goto error_getopt;
+ }
+
+ if (!_file_descriptors_open(source, header))
+ {
+ ERR("Could not create the source files, error %d (%s)",
+ errno, strerror(errno));
+ ret = 4;
+ goto error_getopt;
+ }
+
+ if (!_headers_write(header))
+ {
+ ERR("Could not write the header, error %d (%s)",
+ errno, strerror(errno));
+ ret = 5;
+ goto error_getopt;
+ }
+
+ if (!_theme_set_write())
+ WRN("Theme set getter/setter not created. Group name: %s invalid.", group);
+
+ if (!_parse())
+ {
+ ERR("Could not parsing the EDJE");
+ ret = 6;
+ goto error_getopt;
+ }
+
+ if (!_footer_write(header))
+ {
+ ERR("Could not write the footer, error %d (%s)",
+ errno, strerror(errno));
+ ret = 7;
+ goto error_getopt;
+ }
+
+ if (!_file_descriptors_close())
+ {
+ ERR("Could not close the source files, error %d (%s)",
+ errno, strerror(errno));
+ ret = 8;
+ }
+
+error_getopt:
+ if (ee)
+ ecore_evas_free(ee);
+
+error_log:
+ edje_shutdown();
+ ecore_evas_shutdown();
+ ecore_shutdown();
+ eina_log_domain_unregister(_log_dom);
+ eina_shutdown();
+
+ if (ret > 4)
+ {
+ unlink(header);
+ unlink(source);
+ }
+
+ return ret;
+}
diff --git a/src/bin/elementary/elm_prefs_cc.c b/src/bin/elementary/elm_prefs_cc.c
new file mode 100644
index 0000000000..9f5da87bf9
--- /dev/null
+++ b/src/bin/elementary/elm_prefs_cc.c
@@ -0,0 +1,201 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <string.h>
+#include <locale.h>
+#include <limits.h>
+#include <sys/stat.h>
+
+#include "elm_prefs_cc.h"
+
+int _elm_prefs_cc_log_dom = -1;
+static void main_help(void);
+
+Eina_Prefix *pfx = NULL;
+char *file_in = NULL;
+const char *tmp_dir = NULL;
+char *file_out = NULL;
+
+static const char *progname = NULL;
+
+static void
+_elm_prefs_cc_log_cb(const Eina_Log_Domain *d,
+ Eina_Log_Level level,
+ const char *file,
+ const char *fnc,
+ int _line,
+ const char *fmt,
+ EINA_UNUSED void *data,
+ va_list args)
+{
+ if ((d->name) && (d->namelen == sizeof("elm_prefs_cc") - 1) &&
+ (memcmp(d->name, "elm_prefs_cc", sizeof("elm_prefs_cc") - 1) == 0))
+ {
+ const char *prefix;
+
+ eina_log_console_color_set(stderr, eina_log_level_color_get(level));
+ switch (level)
+ {
+ case EINA_LOG_LEVEL_CRITICAL:
+ prefix = "Critical. ";
+ break;
+
+ case EINA_LOG_LEVEL_ERR:
+ prefix = "Error. ";
+ break;
+
+ case EINA_LOG_LEVEL_WARN:
+ prefix = "Warning. ";
+ break;
+
+ default:
+ prefix = "";
+ }
+ fprintf(stderr, "%s: %s", progname, prefix);
+ eina_log_console_color_set(stderr, EINA_COLOR_RESET);
+
+ vfprintf(stderr, fmt, args);
+ putc('\n', stderr);
+ }
+ else
+ eina_log_print_cb_stderr(d, level, file, fnc, _line, fmt, NULL, args);
+}
+
+static void
+main_help(void)
+{
+ printf
+ ("Usage:\n"
+ "\t%s [OPTIONS] input_file.epc [output_file.epb]\n"
+ "\n"
+ "Where OPTIONS is one or more of:\n"
+ "\n"
+ "-v Verbose output\n"
+ , progname);
+}
+
+int
+main(int argc, char **argv)
+{
+ int i;
+ struct stat st;
+#ifdef HAVE_REALPATH
+ char rpath[PATH_MAX], rpath2[PATH_MAX];
+#endif
+
+ setlocale(LC_NUMERIC, "C");
+
+ if (!eina_init())
+ return -1;
+
+ _elm_prefs_cc_log_dom = eina_log_domain_register
+ ("elm_prefs_cc", ELM_PREFS_CC_DEFAULT_LOG_COLOR);
+ if (_elm_prefs_cc_log_dom < 0)
+ {
+ EINA_LOG_ERR("Unable to create a log domain.");
+ exit(-1);
+ }
+ if (!eina_log_domain_level_check(_elm_prefs_cc_log_dom, EINA_LOG_LEVEL_WARN))
+ eina_log_domain_level_set("elm_prefs_cc", EINA_LOG_LEVEL_WARN);
+
+ progname = ecore_file_file_get(argv[0]);
+ eina_log_print_cb_set(_elm_prefs_cc_log_cb, NULL);
+
+ tmp_dir = eina_environment_tmp_get();
+
+ for (i = 1; i < argc; i++)
+ {
+ if (!strcmp(argv[i], "-h"))
+ {
+ main_help();
+ exit(0);
+ }
+ else if (!strcmp(argv[i], "-v"))
+ {
+ eina_log_domain_level_set("elm_prefs_cc", EINA_LOG_LEVEL_INFO);
+ }
+ else if (!file_in)
+ file_in = argv[i];
+ else if (!file_out)
+ file_out = argv[i];
+ }
+
+ if (!file_in)
+ {
+ ERR("no input file specified.");
+ main_help();
+ exit(-1);
+ }
+
+ pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
+ main, /* an optional symbol to check path of */
+ "ELM_PREFS", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
+ "elementary", /* dir to add after "share" (PREFIX/share/DIRNAME) */
+ "themes/default.edj", /* a magic file to check for in PREFIX/share/DIRNAME for success */
+ PACKAGE_BIN_DIR, /* package bin dir @ compile time */
+ PACKAGE_LIB_DIR, /* package lib dir @ compile time */
+ PACKAGE_DATA_DIR, /* package data dir @ compile time */
+ PACKAGE_DATA_DIR); /* if locale needed use LOCALE_DIR */
+
+ /* check whether file_in exists */
+#ifdef HAVE_REALPATH
+ if (!realpath(file_in, rpath) || stat(rpath, &st) || !S_ISREG(st.st_mode))
+#else
+ if (stat(file_in, &st) || !S_ISREG(st.st_mode))
+#endif
+ {
+ ERR("file not found: %s.", file_in);
+ main_help();
+ exit(-1);
+ }
+
+ if (!file_out)
+ {
+ char *suffix;
+
+ if ((suffix = strstr(file_in, ".epc")) && (suffix[4] == 0))
+ {
+ file_out = strdup(file_in);
+ if (file_out)
+ {
+ suffix = strstr(file_out, ".epc");
+ strcpy(suffix, ".epb");
+ }
+ }
+ }
+ if (!file_out)
+ {
+ ERR("no output file specified.");
+ main_help();
+ exit(-1);
+ }
+
+#ifdef HAVE_REALPATH
+ if (realpath(file_out, rpath2) && !strcmp(rpath, rpath2))
+#else
+ if (!strcmp(file_in, file_out))
+#endif
+ {
+ ERR("input file equals output file.");
+ main_help();
+ exit(-1);
+ }
+
+ elm_prefs_file = mem_alloc(SZ(Elm_Prefs_File));
+ elm_prefs_file->compiler = strdup("elm_prefs_cc");
+
+ compile();
+
+ data_init();
+ data_write();
+ data_shutdown();
+
+ eina_prefix_free(pfx);
+ pfx = NULL;
+
+ eina_log_domain_unregister(_elm_prefs_cc_log_dom);
+ eina_shutdown();
+
+ return 0;
+}
diff --git a/src/bin/elementary/elm_prefs_cc.h b/src/bin/elementary/elm_prefs_cc.h
new file mode 100644
index 0000000000..ef848babc8
--- /dev/null
+++ b/src/bin/elementary/elm_prefs_cc.h
@@ -0,0 +1,107 @@
+#ifndef ELM_PREFS_CC_H
+#define ELM_PREFS_CC_H
+
+#include <Elementary.h>
+
+#define ELM_INTERNAL_API_ARGESFSDFEFC
+#include "elm_priv.h"
+#include "elm_widget_prefs.h"
+
+extern Eina_Prefix *pfx;
+
+/*
+ * On Windows, if the file is not opened in binary mode,
+ * read does not return the correct size, because of
+ * CR / LF translation.
+ */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+/* logging variables */
+extern int _elm_prefs_cc_log_dom;
+#define ELM_PREFS_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+
+#ifdef ERR
+# undef ERR
+#endif
+#define ERR(...) EINA_LOG_DOM_ERR(_elm_prefs_cc_log_dom, __VA_ARGS__)
+#ifdef INF
+# undef INF
+#endif
+#define INF(...) EINA_LOG_DOM_INFO(_elm_prefs_cc_log_dom, __VA_ARGS__)
+#ifdef WRN
+# undef WRN
+#endif
+#define WRN(...) EINA_LOG_DOM_WARN(_elm_prefs_cc_log_dom, __VA_ARGS__)
+#ifdef CRI
+# undef CRI
+#endif
+#define CRI(...) EINA_LOG_DOM_CRIT(_elm_prefs_cc_log_dom, __VA_ARGS__)
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_elm_prefs_cc_log_dom, __VA_ARGS__)
+
+/* types */
+typedef struct _Elm_Prefs_File Elm_Prefs_File;
+typedef struct _New_Object_Handler New_Object_Handler;
+typedef struct _New_Statement_Handler New_Statement_Handler;
+
+struct _Elm_Prefs_File
+{
+ const char *compiler;
+
+ Eina_List *pages;
+};
+
+struct _New_Object_Handler
+{
+ const char *type;
+ void (*func)(void);
+};
+
+struct _New_Statement_Handler
+{
+ const char *type;
+ void (*func)(void);
+};
+
+/* global fn calls */
+void compile(void);
+char *parse_str(int n);
+int parse_enum(int n, ...);
+int parse_int(int n);
+int parse_int_range(int n, int f, int t);
+int parse_bool(int n);
+double parse_float(int n);
+void check_arg_count(int n);
+void check_regex(const char *regex);
+void set_verbatim(char *s, int l1, int l2);
+
+void data_init(void);
+void data_write(void);
+void data_shutdown(void);
+
+int object_handler_num(void);
+int statement_handler_num(void);
+
+void *mem_alloc(size_t size);
+char *mem_strdup(const char *s);
+#define SZ sizeof
+
+/* global vars */
+extern char *file_in;
+extern const char *tmp_dir;
+extern char *file_out;
+extern int line;
+extern Eina_List *stack;
+extern Eina_List *params;
+
+extern Elm_Prefs_File *elm_prefs_file;
+
+extern Eina_List *elm_prefs_pages;
+extern New_Object_Handler object_handlers[];
+extern New_Statement_Handler statement_handlers[];
+
+#endif
diff --git a/src/bin/elementary/elm_prefs_cc_handlers.c b/src/bin/elementary/elm_prefs_cc_handlers.c
new file mode 100644
index 0000000000..93577ed38f
--- /dev/null
+++ b/src/bin/elementary/elm_prefs_cc_handlers.c
@@ -0,0 +1,1218 @@
+/*
+ Concerning the EPC reference:
+
+ The formatting for blocks and properties has been implemented as a table
+ which is filled using ALIASES.
+ For maximum flexibility I implemented them in the \@code/\@encode style,
+ this means that missing one or changing the order most certainly cause
+ formatting errors.
+
+ \@block
+ block name
+ \@context
+ code sample of the block
+ \@description
+ the block's description
+ \@endblock
+
+ \@property
+ property name
+ \@parameters
+ property's parameter list
+ \@effect
+ the property description (lol)
+ \@endproperty
+*/
+
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#include "elm_prefs_cc.h"
+
+void check_min_arg_count(int min_required_args);
+int params_min_check(int n);
+
+/**
+ * @page epcref Elementary Prefs Data Collection Reference
+ * An Elementary Prefs Collection is a plain text file (normally
+ * identified with the .epc extension), consisting of instructions for the
+ * Elm Prefs Compiler.
+ *
+ * The syntax for the elementary prefs data files follows a simple structure of
+ * "blocks { .. }" that can contain "properties: ..", more blocks, or both.
+ *
+ * @anchor sec_quickaccess Quick access to block descriptions:
+ * <ul>
+ * <li>@ref sec_page "Page"</li>
+ * <li>@ref sec_items "Items"</li>
+ * <ul>
+ * <li>@ref sec_items_bool "Bool"</li>
+ * <li>@ref sec_items_int "Int"</li>
+ * <li>@ref sec_items_float "Float"</li>
+ * <li>@ref sec_items_date "Date"</li>
+ * <li>@ref sec_items_text "Text"</li>
+ * <li>@ref sec_items_textarea "Text Area"</li>
+ * </ul>
+ * </ul>
+ *
+ * @author Ricardo de Almeida Gonzaga (ricardotk) ricardo@profusion.mobi
+ *
+ * <table class="edcref" border="0">
+ */
+
+static Elm_Prefs_Page_Node *current_page = NULL;
+static Elm_Prefs_Item_Node *current_item = NULL;
+
+/* objects and statments */
+
+/* Collection */
+static void ob_collection(void);
+
+/**
+ @epcsection{page,Page}
+ */
+
+/**
+ @page epcref
+ @block
+ page
+ @context
+ collection {
+ ..
+ page {
+ name: "main";
+ version: 1;
+ title: "Preference Widgets";
+ subtitle: "Subtitle";
+ widget: "elm/vertical_frame";
+
+ items { }
+ }
+ ..
+ }
+ @description
+ A "page" block is a grouping of prefs items together. A prefs widget
+ must always be bound to a page, that can address other pages in the
+ collection too as @b sub-pages.
+ @endblock
+
+ @property
+ name
+ @parameters
+ [page name]
+ @effect
+ The name of the page (to be referred by the application). It must be
+ unique within the collection.
+ @endproperty
+
+ @property
+ version
+ @parameters
+ [page version]
+ @effect
+ The page's version.
+ @endproperty
+
+ @property
+ title
+ @parameters
+ [page title]
+ @effect
+ Set page's title.
+ @endproperty
+
+ @property
+ subtitle
+ @parameters
+ [page subtitle]
+ @effect
+ Set page's subtitle.
+ @endproperty
+
+ @property
+ widget
+ @parameters
+ [page widget]
+ @effect
+ Set the widget from among the available page widgets. Valid, built-in
+ page widgets are:
+ @li elm/horizontal_box
+ @li elm/vertical_box
+ @li elm/horizontal_frame
+ @li elm/vertical_frame
+ @endproperty
+
+ @property
+ style
+ @parameters
+ [page style]
+ @effect
+ Set page's style.
+ @endproperty
+
+ @property
+ icon
+ @parameters
+ [page icon]
+ @effect
+ Set page's icon.
+ @endproperty
+
+ @property
+ autosave
+ @parameters
+ [1 or 0]
+ @effect
+ Takes a boolean value specifying whether page is autosaved (1)
+ or not (0). The default value is 1.
+ @endproperty
+*/
+
+/* Page */
+static void ob_collection_page(void);
+static void st_collection_page_name(void);
+static void st_collection_page_version(void);
+static void st_collection_page_title(void);
+static void st_collection_page_subtitle(void);
+static void st_collection_page_widget(void);
+static void st_collection_page_style(void);
+static void st_collection_page_icon(void);
+static void st_collection_page_autosave(void);
+
+/**
+ @epcsection{items,Items}
+ */
+
+/**
+ @page epcref
+ @block
+ items
+ @context
+ page {
+ ..
+ items {
+ name: "item";
+ type: INT;
+ label: "Just a item label...";
+
+ type { }
+ }
+ ..
+ }
+
+ @description
+ An "item" block declares a new Prefs item, along with its properties.
+ @endblock
+
+ @property
+ name
+ @parameters
+ [item name]
+ @effect
+ The item's name, to be referred by the application. It must be unique
+ within the page.
+ @endproperty
+
+ @property
+ type
+ @parameters
+ [TYPE]
+ @effect
+ Set the type (all types must be entered in capitals) from among the
+ available types, that are:
+ @li BOOL - Checkbox.
+ @li INT - Slider.
+ @li FLOAT - Slider.
+ @li DATE - Date/time display and input widget.
+ @li TEXT - Single-line text entry.
+ @li TEXTAREA - Text entry.
+ @li LABEL - Read-only label.
+ @li PAGE - Prefs subpage object.
+ @li SEPARATOR - Line that serves only to divide and organize prefs
+ item.
+ @li SWALLOW - Swallows an Evas_Object.
+ @li SAVE - Button that will get all the values bounded to items and
+ save it on CFG file.
+ @li ACTION - Button that will emit a signal to .C file and call a
+ smart callback.
+ @li RESET - Button that will return all the values bounded to items
+ as default declared on .EPC file.
+ @endproperty
+
+ @property
+ label
+ @parameters
+ [a string to label]
+ @effect
+ Set a string to item's label.
+ @endproperty
+
+ @property
+ icon
+ @parameters
+ [item icon]
+ @effect
+ This is the item icon.
+ @endproperty
+
+ @property
+ persistent
+ @parameters
+ [1 or 0]
+ @effect
+ Takes a boolean value specifying whether item is persistent (1) or
+ not (0). The default value is 1. A non persistent item doesn't save
+ its values when saved.
+ @endproperty
+
+ @property
+ editable
+ @parameters
+ [1 or 0]
+ @effect
+ Takes a boolean value specifying whether item is editable (1)
+ or not (0). The default value is 1.
+ @endproperty
+
+ @property
+ visible
+ @parameters
+ [1 or 0]
+ @effect
+ Takes a boolean value specifying whether item is visible (1) or not (0).
+ The default value is 1.
+ @endproperty
+
+ @property
+ style
+ @parameters
+ [item style]
+ @effect
+ This is the item's style.
+ @endproperty
+
+ @property
+ widget
+ @parameters
+ [item widget]
+ @effect
+ This is the item's widget, for cases where a widget differs than the
+ default assigned to the type is desired.
+ @endproperty
+*/
+/* Items */
+
+static void ob_collection_page_items(void);
+
+static void ob_collection_page_items_item(void);
+static void st_collection_page_items_item_name(void);
+static void st_collection_page_items_item_type(void);
+static void st_collection_page_items_item_label(void);
+static void st_collection_page_items_item_icon(void);
+static void st_collection_page_items_item_persistent(void);
+static void st_collection_page_items_item_editable(void);
+static void st_collection_page_items_item_visible(void);
+static void st_collection_page_items_item_source(void);
+static void st_collection_page_items_item_style(void);
+static void st_collection_page_items_item_widget(void);
+
+/**
+ @epcsection{items_bool,Bool item sub blocks}
+ */
+
+/**
+ @page epcref
+
+ @block
+ bool
+ @context
+ item {
+ ..
+ bool {
+ default: true;
+ }
+ ..
+ }
+ @description
+ @endblock
+
+ @property
+ default
+ @parameters
+ [true or false]
+ @effect
+ Takes a boolean value specifying whether item is checked (true)
+ or not (false).
+ @endproperty
+*/
+
+/* Item: Bool */
+static void ob_collection_page_items_item_bool(void);
+static void st_collection_page_items_item_bool_default(void);
+
+/**
+ @epcsection{items_int,Int item sub blocks}
+ */
+
+/**
+ @page epcref
+
+ @block
+ int
+ @context
+ item {
+ ..
+ int {
+ default: 150;
+ min: 0;
+ max: 300;
+ }
+ ..
+ }
+ @description
+ @endblock
+
+ @property
+ default
+ @parameters
+ [value]
+ @effect
+ Set a default (initial) value to the item.
+ @endproperty
+
+ @property
+ min
+ @parameters
+ [value]
+ @effect
+ Set a minimum value to the item. Note that, without a minimum
+ value, the widget implementing the item visually will get an
+ available range of values bound to the minimum of the least
+ integer number representable, and it might not be what you
+ want.
+
+ @endproperty
+
+ @property
+ max
+ @parameters
+ [value]
+ @effect
+ Set a maximum value to the item. Note that, without a maximum
+ value, the widget implementing the item visually will get an
+ available range of values bound to the maximum of the least
+ integer number representable, and it might not be what you
+ want.
+ @endproperty
+*/
+
+/* Item: Integer */
+static void ob_collection_page_items_item_int(void);
+static void st_collection_page_items_item_int_default(void);
+static void st_collection_page_items_item_int_max(void);
+static void st_collection_page_items_item_int_min(void);
+
+/**
+ @epcsection{items_float,Float item sub blocks}
+ */
+
+/**
+ @page epcref
+
+ @block
+ float
+ @context
+ item {
+ ..
+ float {
+ default: 0.5;
+ min: 0;
+ max: 1;
+ }
+ ..
+ }
+ @description
+ @endblock
+
+ @property
+ default
+ @parameters
+ [value]
+ @effect
+ Set a default (initial) value to the item.
+ @endproperty
+
+ @property
+ min
+ @parameters
+ [value]
+ @effect
+ Set a minimum value to the item. Note that, without a minimum
+ value, the widget implementing the item visually will get an
+ available range of values bound to the minimum of the least
+ floating point number representable, and it might not be what you
+ want.
+ @endproperty
+
+ @property
+ max
+ @parameters
+ [value]
+ @effect
+ Set a maximum value to the item. Note that, without a maximum
+ value, the widget implementing the item visually will get an
+ available range of values bound to the maximum of the least
+ floating point number representable, and it might not be what you
+ want.
+ @endproperty
+*/
+
+/* Item: Float */
+static void ob_collection_page_items_item_float(void);
+static void st_collection_page_items_item_float_default(void);
+static void st_collection_page_items_item_float_max(void);
+static void st_collection_page_items_item_float_min(void);
+
+/**
+ @epcsection{items_date,Date item sub blocks}
+ */
+
+/**
+ @page epcref
+
+ @block
+ date
+ @context
+ item {
+ ..
+ date {
+ default: 2012 11 05;
+ min: 1900 1 1;
+ max: 2200 12 31;
+ }
+ ..
+ }
+ @description
+ @endblock
+
+ @property
+ default
+ @parameters
+ [year month date] or "today"
+ @effect
+ Set a default (initial) date to the item. "today" will translate
+ to current date.
+ @endproperty
+
+ @property
+ min
+ @parameters
+ [year month date] or "today"
+ @effect
+ Set a minimum date to the item. "today" will translate
+ to current date.
+ @endproperty
+
+ @property
+ max
+ @parameters
+ [year month date] or "today"
+ @effect
+ Set a maximum date to the item. "today" will translate
+ to current date.
+ @endproperty
+*/
+
+/* Item: Date */
+static void ob_collection_page_items_item_date(void);
+static void st_collection_page_items_item_date_default(void);
+static void st_collection_page_items_item_date_max(void);
+static void st_collection_page_items_item_date_min(void);
+
+/**
+ @epcsection{items_text,Text item sub blocks}
+ */
+
+/**
+ @page epcref
+
+ @block
+ text
+ @context
+ item {
+ ..
+ text {
+ default: "Default text";
+ placeholder: "Text:";
+ accept: "^[a-zA-Z ]$";
+ deny: "";
+ }
+ ..
+ }
+ @description
+ @endblock
+
+ @property
+ default
+ @parameters
+ [a string of text]
+ @effect
+ Set a default text.
+ @endproperty
+
+ @property
+ placeholder
+ @parameters
+ [a string of text]
+ @effect
+ Set a placeholder.
+ @endproperty
+
+ @property
+ accept
+ @parameters
+ [regular expression]
+ @effect
+ Set an acceptance regular expression. It must be a valid one.
+ @endproperty
+
+ @property
+ deny
+ @parameters
+ [regular expression]
+ @effect
+ Set a denial regular expression. It must be a valid one.
+ @endproperty
+*/
+
+/**
+ @epcsection{items_textarea,Text Area item sub blocks}
+ */
+
+/**
+ @page epcref
+
+ @block
+ textarea
+ @context
+ item {
+ ..
+ textarea {
+ default: "Default text";
+ placeholder: "No Numbers!";
+ accept: "";
+ deny: "^[0-9]*$";
+ }
+ ..
+ }
+ @description
+ @endblock
+
+ @property
+ default
+ @parameters
+ [a string of text]
+ @effect
+ Set a default text.
+ @endproperty
+
+ @property
+ placeholder
+ @parameters
+ [a string of text]
+ @effect
+ Set a placeholder.
+ @endproperty
+
+ @property
+ accept
+ @parameters
+ [regular expression]
+ @effect
+ Set an acceptance regular expression. It must be a valid one.
+ @endproperty
+
+ @property
+ deny
+ @parameters
+ [regular expression]
+ @effect
+ Set a denial regular expression. It must be a valid one.
+ @endproperty
+*/
+
+/* Item: Text and Text Area */
+static void ob_collection_page_items_item_text(void);
+static void ob_collection_page_items_item_textarea(void);
+
+/* String shared statements */
+static void st_collection_page_items_item_string_default(void);
+static void st_collection_page_items_item_string_placeholder(void);
+static void st_collection_page_items_item_string_accept(void);
+static void st_collection_page_items_item_string_deny(void);
+static void st_collection_page_items_item_string_max(void);
+static void st_collection_page_items_item_string_min(void);
+
+/* Statement Array */
+New_Statement_Handler statement_handlers[] =
+{
+ {"collection.page.name", st_collection_page_name},
+ {"collection.page.name", st_collection_page_name},
+ {"collection.page.version", st_collection_page_version},
+ {"collection.page.title", st_collection_page_title},
+ {"collection.page.subtitle", st_collection_page_subtitle},
+ {"collection.page.widget", st_collection_page_widget},
+ {"collection.page.style", st_collection_page_style},
+ {"collection.page.icon", st_collection_page_icon},
+ {"collection.page.autosave", st_collection_page_autosave},
+
+ {"collection.page.items.item.name", st_collection_page_items_item_name},
+ {"collection.page.items.item.type", st_collection_page_items_item_type},
+ {"collection.page.items.item.label", st_collection_page_items_item_label},
+ {"collection.page.items.item.icon", st_collection_page_items_item_icon},
+ {"collection.page.items.item.persistent", st_collection_page_items_item_persistent},
+ {"collection.page.items.item.editable", st_collection_page_items_item_editable},
+ {"collection.page.items.item.visible", st_collection_page_items_item_visible},
+ {"collection.page.items.item.source", st_collection_page_items_item_source},
+ {"collection.page.items.item.style", st_collection_page_items_item_style},
+ {"collection.page.items.item.widget", st_collection_page_items_item_widget},
+
+ {"collection.page.items.item.bool.default", st_collection_page_items_item_bool_default},
+
+ {"collection.page.items.item.int.default", st_collection_page_items_item_int_default},
+ {"collection.page.items.item.int.max", st_collection_page_items_item_int_max},
+ {"collection.page.items.item.int.min", st_collection_page_items_item_int_min},
+
+ {"collection.page.items.item.float.default", st_collection_page_items_item_float_default},
+ {"collection.page.items.item.float.max", st_collection_page_items_item_float_max},
+ {"collection.page.items.item.float.min", st_collection_page_items_item_float_min},
+
+ {"collection.page.items.item.date.default", st_collection_page_items_item_date_default},
+ {"collection.page.items.item.date.max", st_collection_page_items_item_date_max},
+ {"collection.page.items.item.date.min", st_collection_page_items_item_date_min},
+
+ {"collection.page.items.item.text.placeholder", st_collection_page_items_item_string_placeholder},
+ {"collection.page.items.item.text.default", st_collection_page_items_item_string_default},
+ {"collection.page.items.item.text.accept", st_collection_page_items_item_string_accept},
+ {"collection.page.items.item.text.deny", st_collection_page_items_item_string_deny},
+ {"collection.page.items.item.text.max", st_collection_page_items_item_string_max},
+ {"collection.page.items.item.text.min", st_collection_page_items_item_string_min},
+
+ {"collection.page.items.item.textarea.placeholder", st_collection_page_items_item_string_placeholder},
+ {"collection.page.items.item.textarea.default", st_collection_page_items_item_string_default},
+ {"collection.page.items.item.textarea.accept", st_collection_page_items_item_string_accept},
+ {"collection.page.items.item.textarea.deny", st_collection_page_items_item_string_deny},
+ {"collection.page.items.item.textarea.max", st_collection_page_items_item_string_max},
+ {"collection.page.items.item.textarea.min", st_collection_page_items_item_string_min}
+};
+
+/* Object Array */
+New_Object_Handler object_handlers[] =
+{
+ {"collection", ob_collection},
+ {"collection.page", ob_collection_page},
+
+ {"collection.page.items", ob_collection_page_items},
+ {"collection.page.items.item", ob_collection_page_items_item},
+ {"collection.page.items.item.bool", ob_collection_page_items_item_bool},
+ {"collection.page.items.item.int", ob_collection_page_items_item_int},
+ {"collection.page.items.item.float", ob_collection_page_items_item_float},
+ {"collection.page.items.item.date", ob_collection_page_items_item_date},
+ {"collection.page.items.item.text", ob_collection_page_items_item_text},
+ {"collection.page.items.item.textarea", ob_collection_page_items_item_textarea}
+};
+
+int
+object_handler_num(void)
+{
+ return sizeof(object_handlers) / sizeof (New_Object_Handler);
+}
+
+int
+statement_handler_num(void)
+{
+ return sizeof(statement_handlers) / sizeof (New_Object_Handler);
+}
+
+static void
+ob_collection(void)
+{
+ // NULL
+}
+
+static void
+ob_collection_page(void)
+{
+ current_page = mem_alloc(SZ(Elm_Prefs_Page_Node));
+ if (current_page)
+ elm_prefs_file->pages =
+ eina_list_append(elm_prefs_file->pages, current_page);
+}
+
+static void
+st_collection_page_name(void)
+{
+ check_arg_count(1);
+
+ current_page->name = parse_str(0);
+
+ //TODO: check for duplicated name entries.
+}
+
+static void
+st_collection_page_version(void)
+{
+ check_arg_count(1);
+
+ current_page->version = parse_int(0);
+}
+
+static void
+st_collection_page_title(void)
+{
+ check_arg_count(1);
+
+ current_page->title = parse_str(0);
+}
+
+static void
+st_collection_page_subtitle(void)
+{
+ check_arg_count(1);
+
+ current_page->sub_title = parse_str(0);
+}
+
+static void
+st_collection_page_widget(void)
+{
+ check_arg_count(1);
+
+ current_page->widget = parse_str(0);
+}
+
+static void
+st_collection_page_style(void)
+{
+ check_arg_count(1);
+
+ current_page->style = parse_str(0);
+}
+
+static void
+st_collection_page_icon(void)
+{
+ check_arg_count(1);
+
+ current_page->icon = parse_str(0);
+}
+
+static void
+st_collection_page_autosave(void)
+{
+ check_arg_count(1);
+
+ current_page->autosave = parse_bool(0);
+}
+
+static void
+ob_collection_page_items(void)
+{
+ // NULL
+}
+
+static void
+ob_collection_page_items_item(void)
+{
+ current_item = mem_alloc(SZ(Elm_Prefs_Item_Node));
+ if (current_item)
+ {
+ current_item->visible = EINA_TRUE;
+ current_item->persistent = EINA_TRUE;
+ current_item->editable = EINA_TRUE;
+ current_page->items =
+ eina_list_append(current_page->items, current_item);
+ }
+}
+
+static void
+st_collection_page_items_item_name(void)
+{
+ check_arg_count(1);
+
+ current_item->name = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_type(void)
+{
+ check_arg_count(1);
+
+ current_item->type = parse_enum(0,
+ "ACTION", ELM_PREFS_TYPE_ACTION,
+ "BOOL", ELM_PREFS_TYPE_BOOL,
+ "INT", ELM_PREFS_TYPE_INT,
+ "FLOAT", ELM_PREFS_TYPE_FLOAT,
+ "DATE", ELM_PREFS_TYPE_DATE,
+ "LABEL", ELM_PREFS_TYPE_LABEL,
+ "PAGE", ELM_PREFS_TYPE_PAGE,
+ "TEXT", ELM_PREFS_TYPE_TEXT,
+ "TEXTAREA", ELM_PREFS_TYPE_TEXTAREA,
+ "RESET", ELM_PREFS_TYPE_RESET,
+ "SAVE", ELM_PREFS_TYPE_SAVE,
+ "SEPARATOR", ELM_PREFS_TYPE_SEPARATOR,
+ "SWALLOW", ELM_PREFS_TYPE_SWALLOW,
+ NULL);
+
+ switch (current_item->type)
+ {
+ case ELM_PREFS_TYPE_ACTION:
+ case ELM_PREFS_TYPE_LABEL:
+ case ELM_PREFS_TYPE_RESET:
+ case ELM_PREFS_TYPE_SEPARATOR:
+ case ELM_PREFS_TYPE_SWALLOW:
+ current_item->editable = EINA_FALSE;
+ current_item->persistent = EINA_FALSE;
+ break;
+
+ case ELM_PREFS_TYPE_INT:
+ current_item->spec.i.max = INT_MAX;
+ current_item->spec.i.min = INT_MIN;
+ break;
+
+ case ELM_PREFS_TYPE_FLOAT:
+ current_item->spec.f.max = FLT_MAX;
+ current_item->spec.f.min = -FLT_MAX;
+ break;
+
+ case ELM_PREFS_TYPE_DATE:
+ {
+ time_t t = time(NULL);
+ struct tm *lt = localtime(&t);
+
+ current_item->spec.d.def.y = lt->tm_year + 1900;
+ current_item->spec.d.def.m = lt->tm_mon + 1;
+ current_item->spec.d.def.d = lt->tm_mday;
+
+ current_item->spec.d.min.y = 1900;
+ current_item->spec.d.min.m = 1;
+ current_item->spec.d.min.d = 1;
+
+ current_item->spec.d.max.y = 10000 - 1900;
+ current_item->spec.d.max.m = 1;
+ current_item->spec.d.max.d = 1;
+ }
+ break;
+
+ case ELM_PREFS_TYPE_TEXT:
+ case ELM_PREFS_TYPE_TEXTAREA:
+ current_item->spec.s.length.max = INT_MAX;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void
+st_collection_page_items_item_label(void)
+{
+ check_arg_count(1);
+
+ current_item->label = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_icon(void)
+{
+ check_arg_count(1);
+
+ current_item->icon = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_persistent(void)
+{
+ check_arg_count(1);
+
+ current_item->persistent = parse_bool(0);
+}
+
+static void
+st_collection_page_items_item_editable(void)
+{
+ check_arg_count(1);
+
+ current_item->editable = parse_bool(0);
+}
+
+static void
+st_collection_page_items_item_visible(void)
+{
+ check_arg_count(1);
+
+ current_item->visible = parse_bool(0);
+}
+
+static void
+st_collection_page_items_item_source(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.p.source = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_style(void)
+{
+ check_arg_count(1);
+
+ current_item->style = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_widget(void)
+{
+ check_arg_count(1);
+
+ current_item->widget = parse_str(0);
+}
+
+static void
+ob_collection_page_items_item_bool(void)
+{
+ //TODO: check if current item type match
+}
+
+static void
+st_collection_page_items_item_bool_default(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.b.def = parse_bool(0);
+}
+
+static void
+ob_collection_page_items_item_int(void)
+{
+ //TODO: check if current item type match
+}
+
+static void
+st_collection_page_items_item_int_default(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.i.def = parse_int(0);
+}
+
+static void
+st_collection_page_items_item_int_max(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.i.max = parse_int(0);
+}
+
+static void
+st_collection_page_items_item_int_min(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.i.min = parse_int(0);
+}
+
+static void
+ob_collection_page_items_item_float(void)
+{
+ //TODO: check if current item type match
+}
+
+static void
+st_collection_page_items_item_float_default(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.f.def = parse_float(0);
+}
+
+static void
+st_collection_page_items_item_float_max(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.f.max = parse_float(0);
+}
+
+static void
+st_collection_page_items_item_float_min(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.f.min = parse_float(0);
+}
+
+static void
+ob_collection_page_items_item_date(void)
+{
+ //TODO: check if current item type match
+}
+
+static void
+st_collection_page_items_item_date_default(void)
+{
+ check_min_arg_count(1);
+
+ if (params_min_check(1))
+ {
+ check_arg_count(3);
+
+ current_item->spec.d.def.y = parse_int_range(0, 1900, 10000);
+ current_item->spec.d.def.m = parse_int_range(1, 1, 12);
+ current_item->spec.d.def.d = parse_int_range(2, 1, 31);
+ }
+ else
+ {
+ const char *date = parse_str(0);
+ if (!strcasecmp(date, "today"))
+ {
+ time_t t = time(NULL);
+ struct tm *lt = localtime(&t);
+
+ current_item->spec.d.def.y = lt->tm_year + 1900;
+ current_item->spec.d.def.m = lt->tm_mon + 1;
+ current_item->spec.d.def.d = lt->tm_mday;
+ }
+ free((void *)date);
+ }
+}
+
+static void
+st_collection_page_items_item_date_max(void)
+{
+ check_min_arg_count(1);
+
+ if (params_min_check(1))
+ {
+ check_arg_count(3);
+
+ current_item->spec.d.max.y = parse_int_range(0, 1900, 10000);
+ current_item->spec.d.max.m = parse_int_range(1, 1, 12);
+ current_item->spec.d.max.d = parse_int_range(2, 1, 31);
+ }
+ else
+ {
+ const char *date = parse_str(0);
+ if (!strcasecmp(date, "today"))
+ {
+ time_t t = time(NULL);
+ struct tm *lt = localtime(&t);
+
+ current_item->spec.d.max.y = lt->tm_year + 1900;
+ current_item->spec.d.max.m = lt->tm_mon + 1;
+ current_item->spec.d.max.d = lt->tm_mday;
+ }
+ free((void *)date);
+ }
+}
+
+static void
+st_collection_page_items_item_date_min(void)
+{
+ check_min_arg_count(1);
+
+ if (params_min_check(1))
+ {
+ check_arg_count(3);
+
+ current_item->spec.d.min.y = parse_int_range(0, 1900, 10000);
+ current_item->spec.d.min.m = parse_int_range(1, 1, 12);
+ current_item->spec.d.min.d = parse_int_range(2, 1, 31);
+ }
+ else
+ {
+ const char *date = parse_str(0);
+ if (!strcasecmp(date, "today"))
+ {
+ time_t t = time(NULL);
+ struct tm *lt = localtime(&t);
+
+ current_item->spec.d.min.y = lt->tm_year + 1900;
+ current_item->spec.d.min.m = lt->tm_mon + 1;
+ current_item->spec.d.min.d = lt->tm_mday;
+ }
+ free((void *)date);
+ }
+}
+
+static void
+ob_collection_page_items_item_text(void)
+{
+ //TODO: check if current item type match
+}
+
+static void
+ob_collection_page_items_item_textarea(void)
+{
+ //todo: check if current item type match
+}
+
+static void
+st_collection_page_items_item_string_placeholder(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.s.placeholder = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_string_default(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.s.def = parse_str(0);
+}
+
+static void
+st_collection_page_items_item_string_accept(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.s.accept = parse_str(0);
+
+ check_regex(current_item->spec.s.accept);
+}
+
+static void
+st_collection_page_items_item_string_deny(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.s.deny = parse_str(0);
+
+ check_regex(current_item->spec.s.deny);
+}
+
+static void
+st_collection_page_items_item_string_max(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.s.length.max = parse_int(0);
+}
+
+static void
+st_collection_page_items_item_string_min(void)
+{
+ check_arg_count(1);
+
+ current_item->spec.s.length.min = parse_int(0);
+}
diff --git a/src/bin/elementary/elm_prefs_cc_mem.c b/src/bin/elementary/elm_prefs_cc_mem.c
new file mode 100644
index 0000000000..3e269d3674
--- /dev/null
+++ b/src/bin/elementary/elm_prefs_cc_mem.c
@@ -0,0 +1,35 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <string.h>
+#include <errno.h>
+
+#include "elm_prefs_cc.h"
+
+void *
+mem_alloc(size_t size)
+{
+ void *mem;
+
+ mem = calloc(1, size);
+ if (mem) return mem;
+ ERR("%s:%i memory allocation of %zu bytes failed. %s",
+ file_in, line, size, strerror(errno));
+ exit(-1);
+ return NULL;
+}
+
+char *
+mem_strdup(const char *s)
+{
+ void *str;
+
+ str = strdup(s);
+ if (str) return str;
+ ERR("%s:%i memory allocation of %zu bytes failed. %s. string "
+ "being duplicated: \"%s\"",
+ file_in, line, strlen(s) + 1, strerror(errno), s);
+ exit(-1);
+ return NULL;
+}
diff --git a/src/bin/elementary/elm_prefs_cc_out.c b/src/bin/elementary/elm_prefs_cc_out.c
new file mode 100644
index 0000000000..8913b71712
--- /dev/null
+++ b/src/bin/elementary/elm_prefs_cc_out.c
@@ -0,0 +1,52 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include "elm_prefs_cc.h"
+#include "elm_prefs_edd.x"
+
+Elm_Prefs_File *elm_prefs_file = NULL;
+
+void
+data_init()
+{
+ eet_init();
+ _elm_prefs_descriptors_init();
+}
+
+void
+data_shutdown()
+{
+ _elm_prefs_descriptors_shutdown();
+ eet_shutdown();
+}
+
+void
+data_write()
+{
+ Eina_List *l;
+ Eet_File *ef;
+ Elm_Prefs_Page_Node *page;
+
+ if (!elm_prefs_file || !elm_prefs_file->pages)
+ {
+ ERR("No data to put in \"%s\"", file_out);
+ exit(-1);
+ }
+
+ ef = eet_open(file_out, EET_FILE_MODE_WRITE);
+ if (!ef)
+ {
+ ERR("Unable to open \"%s\" for writing output", file_out);
+ exit(-1);
+ }
+
+ EINA_LIST_FOREACH (elm_prefs_file->pages, l, page)
+ {
+ if (!(eet_data_write
+ (ef, _page_edd, page->name, page, EET_COMPRESSION_DEFAULT)))
+ ERR("Failed to write page %s to file %s", page->name, file_out);
+ }
+
+ eet_close(ef);
+}
diff --git a/src/bin/elementary/elm_prefs_cc_parse.c b/src/bin/elementary/elm_prefs_cc_parse.c
new file mode 100644
index 0000000000..5fda91eed1
--- /dev/null
+++ b/src/bin/elementary/elm_prefs_cc_parse.c
@@ -0,0 +1,1401 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca(size_t);
+#endif
+
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <math.h>
+#include <regex.h>
+
+#include "elm_prefs_cc.h"
+#include <Ecore.h>
+#include <Ecore_File.h>
+
+#ifdef _WIN32
+# define EPP_EXT ".exe"
+#else
+# define EPP_EXT
+#endif
+
+static void new_object(void);
+static void new_statement(void);
+static char *perform_math(char *input);
+static int isdelim(char c);
+static char *next_token(char *p, char *end, char **new_p, int *delim);
+static const char *stack_id(void);
+static void parse(char *data, off_t size);
+
+/* simple expression parsing protos */
+static int my_atoi(const char *s);
+static char *_alphai(char *s, int *val);
+static char *_betai(char *s, int *val);
+static char *_gammai(char *s, int *val);
+static char *_deltai(char *s, int *val);
+static char *_get_numi(char *s, int *val);
+static int _is_numi(char c);
+static int _is_op1i(char c);
+static int _is_op2i(char c);
+static int _calci(char op, int a, int b);
+
+static double my_atof(const char *s);
+static char *_alphaf(char *s, double *val);
+static char *_betaf(char *s, double *val);
+static char *_gammaf(char *s, double *val);
+static char *_deltaf(char *s, double *val);
+static char *_get_numf(char *s, double *val);
+static int _is_numf(char c);
+static int _is_op1f(char c);
+static int _is_op2f(char c);
+static double _calcf(char op, double a, double b);
+static int strstrip(const char *in, char *out, size_t size);
+
+int line = 0;
+Eina_List *stack = NULL;
+Eina_List *params = NULL;
+
+static char file_buf[4096];
+static int verbatim = 0;
+static int verbatim_line1 = 0;
+static int verbatim_line2 = 0;
+static char *verbatim_str = NULL;
+static Eina_Strbuf *stack_buf = NULL;
+
+static void
+err_show_stack(void)
+{
+ const char *s;
+
+ s = stack_id();
+ if (s)
+ ERR("PARSE STACK:\n%s", s);
+ else
+ ERR("NO PARSE STACK");
+}
+
+static void
+err_show_params(void)
+{
+ Eina_List *l;
+ char *p;
+
+ ERR("PARAMS:");
+ EINA_LIST_FOREACH(params, l, p)
+ {
+ ERR(" %s", p);
+ }
+}
+
+static void
+err_show(void)
+{
+ err_show_stack();
+ err_show_params();
+}
+
+static char *
+_parse_param_get(int n)
+{
+ if (n < (int) eina_list_count(params))
+ return eina_list_nth(params, n);
+ return NULL;
+}
+
+static Eina_Hash *_new_object_hash = NULL;
+static Eina_Hash *_new_statement_hash = NULL;
+
+static void
+fill_object_statement_hashes(void)
+{
+ int i, n;
+
+ if (_new_object_hash) return;
+
+ _new_object_hash = eina_hash_string_superfast_new(NULL);
+ _new_statement_hash = eina_hash_string_superfast_new(NULL);
+
+ n = object_handler_num();
+ for (i = 0; i < n; i++)
+ {
+ eina_hash_direct_add(_new_object_hash, object_handlers[i].type,
+ &(object_handlers[i]));
+ }
+ n = statement_handler_num();
+ for (i = 0; i < n; i++)
+ {
+ eina_hash_direct_add(_new_statement_hash, statement_handlers[i].type,
+ &(statement_handlers[i]));
+ }
+}
+
+static void
+new_object(void)
+{
+ const char *id;
+ New_Object_Handler *oh;
+ New_Statement_Handler *sh;
+
+ fill_object_statement_hashes();
+ id = stack_id();
+ oh = eina_hash_find(_new_object_hash, id);
+ if (oh)
+ {
+ if (oh->func) oh->func();
+ }
+ else
+ {
+ sh = eina_hash_find(_new_statement_hash, id);
+ if (!sh)
+ {
+ ERR("%s:%i unhandled keyword %s",
+ file_in, line - 1,
+ (char *)eina_list_data_get(eina_list_last(stack)));
+ err_show();
+ exit(-1);
+ }
+ }
+}
+
+static void
+new_statement(void)
+{
+ const char *id;
+ New_Statement_Handler *sh;
+
+ fill_object_statement_hashes();
+ id = stack_id();
+ sh = eina_hash_find(_new_statement_hash, id);
+ if (sh)
+ {
+ if (sh->func) sh->func();
+ }
+ else
+ {
+ ERR("%s:%i unhandled keyword %s",
+ file_in, line - 1,
+ (char *)eina_list_data_get(eina_list_last(stack)));
+ err_show();
+ exit(-1);
+ }
+}
+
+static char *
+perform_math(char *input)
+{
+ char buf[256];
+ double res;
+
+ /* FIXME
+ * Always apply floating-point arithmetic.
+ * Does this cause problems for integer parameters? (yes it will)
+ *
+ * What we should do is, loop over the string and figure out whether
+ * there are floating point operands, too and then switch to
+ * floating point math.
+ */
+ res = my_atof(input);
+ snprintf(buf, sizeof (buf), "%lf", res);
+ return strdup(buf);
+}
+
+static int
+isdelim(char c)
+{
+ const char *delims = "{},;:";
+ char *d;
+
+ d = (char *)delims;
+ while (*d)
+ {
+ if (c == *d) return 1;
+ d++;
+ }
+ return 0;
+}
+
+static char *
+next_token(char *p, char *end, char **new_p, int *delim)
+{
+ char *tok_start = NULL, *tok_end = NULL, *tok = NULL, *sa_start = NULL;
+ int in_tok = 0;
+ int in_quote = 0;
+ int in_parens = 0;
+ int in_comment_ss = 0;
+ int in_comment_cpp = 0;
+ int in_comment_sa = 0;
+ int had_quote = 0;
+ int is_escaped = 0;
+
+ *delim = 0;
+ if (p >= end) return NULL;
+ while (p < end)
+ {
+ if (*p == '\n')
+ {
+ in_comment_ss = 0;
+ in_comment_cpp = 0;
+ line++;
+ }
+ if ((!in_comment_ss) && (!in_comment_sa))
+ {
+ if ((!in_quote) && (*p == '/') && (p < (end - 1)) && (*(p + 1) == '/'))
+ in_comment_ss = 1;
+ if ((!in_quote) && (*p == '#'))
+ in_comment_cpp = 1;
+ if ((!in_quote) && (*p == '/') && (p < (end - 1)) && (*(p + 1) == '*'))
+ {
+ in_comment_sa = 1;
+ sa_start = p;
+ }
+ }
+ if ((in_comment_cpp) && (*p == '#'))
+ {
+ char *pp, fl[4096];
+ char *tmpstr = NULL;
+ int l, nm;
+
+ /* handle cpp comments */
+ /* their line format is
+ * #line <line no. of next line> <filename from next line on> [??]
+ */
+
+ pp = p;
+ while ((pp < end) && (*pp != '\n'))
+ {
+ pp++;
+ }
+ l = pp - p;
+ tmpstr = alloca(l + 1);
+ if (!tmpstr)
+ {
+ ERR("%s:%i malloc %i bytes failed",
+ file_in, line - 1, l + 1);
+ exit(-1);
+ }
+ strncpy(tmpstr, p, l);
+ tmpstr[l] = 0;
+ l = sscanf(tmpstr, "%*s %i \"%[^\"]\"", &nm, fl);
+ if (l == 2)
+ {
+ strcpy(file_buf, fl);
+ line = nm;
+ file_in = file_buf;
+ }
+ }
+ else if ((!in_comment_ss) && (!in_comment_sa) && (!in_comment_cpp))
+ {
+ if (!in_tok)
+ {
+ if (!in_quote)
+ {
+ if (!isspace(*p))
+ {
+ if (*p == '"')
+ {
+ in_quote = 1;
+ had_quote = 1;
+ }
+ else if (*p == '(')
+ in_parens++;
+
+ in_tok = 1;
+ tok_start = p;
+ if (isdelim(*p)) *delim = 1;
+ }
+ }
+ }
+ else
+ {
+ if (in_quote)
+ {
+ if ((*p) == '\\')
+ is_escaped = !is_escaped;
+ else if (((*p) == '"') && (!is_escaped))
+ {
+ in_quote = 0;
+ had_quote = 1;
+ }
+ else if (is_escaped)
+ is_escaped = 0;
+ }
+ else if (in_parens)
+ {
+ if (((*p) == ')') && (!is_escaped))
+ in_parens--;
+ }
+ else
+ {
+ if (*p == '"')
+ {
+ in_quote = 1;
+ had_quote = 1;
+ }
+ else if (*p == '(')
+ in_parens++;
+
+ /* check for end-of-token */
+ if (
+ (isspace(*p)) ||
+ ((*delim) && (!isdelim(*p))) ||
+ (isdelim(*p))
+ ) /*the line below this is never used because it skips to
+ * the 'done' label which is after the return call for
+ * in_tok being 0. is this intentional?
+ */
+ {
+ in_tok = 0;
+
+ tok_end = p - 1;
+ if (*p == '\n') line--;
+ goto done;
+ }
+ }
+ }
+ }
+ if (in_comment_sa)
+ {
+ if ((*p == '/') && (*(p - 1) == '*') && ((p - sa_start) > 2))
+ in_comment_sa = 0;
+ }
+ p++;
+ }
+ if (!in_tok) return NULL;
+ tok_end = p - 1;
+
+done:
+ *new_p = p;
+
+ tok = mem_alloc(tok_end - tok_start + 2);
+ if (!tok) return NULL;
+ strncpy(tok, tok_start, tok_end - tok_start + 1);
+ tok[tok_end - tok_start + 1] = 0;
+
+ if (had_quote)
+ {
+ is_escaped = 0;
+ p = tok;
+
+ while (*p)
+ {
+ if ((*p == '\"') && (!is_escaped))
+ {
+ memmove(p, p + 1, strlen(p));
+ }
+ else if ((*p == '\\') && (*(p + 1) == 'n'))
+ {
+ memmove(p, p + 1, strlen(p));
+ *p = '\n';
+ }
+ else if ((*p == '\\') && (*(p + 1) == 't'))
+ {
+ memmove(p, p + 1, strlen(p));
+ *p = '\t';
+ }
+ else if (*p == '\\')
+ {
+ memmove(p, p + 1, strlen(p));
+ if (*p == '\\') p++;
+ else is_escaped = 1;
+ }
+ else
+ {
+ if (is_escaped) is_escaped = 0;
+ p++;
+ }
+ }
+ }
+ else if (*tok == '(')
+ {
+ char *tmp;
+ tmp = tok;
+ tok = perform_math(tok);
+ free(tmp);
+ }
+
+ return tok;
+}
+
+static void
+stack_push(char *token)
+{
+ if (stack) eina_strbuf_append(stack_buf, ".");
+ eina_strbuf_append(stack_buf, token);
+
+ stack = eina_list_append(stack, token);
+}
+
+static void
+stack_pop(void)
+{
+ char *top;
+ int top_length;
+
+ if (!stack)
+ {
+ ERR("parse error %s:%i. } marker without matching { marker",
+ file_in, line - 1);
+
+ err_show();
+ exit(-1);
+ }
+
+ top = eina_list_data_get(eina_list_last(stack));
+ top_length = strlen(top);
+
+ stack = eina_list_remove_list(stack, eina_list_last(stack));
+
+ if (eina_list_count(stack)) top_length++; // remove '.' as well.
+
+ eina_strbuf_remove(stack_buf,
+ eina_strbuf_length_get(stack_buf) - top_length,
+ eina_strbuf_length_get(stack_buf));
+
+ free(top);
+}
+
+static const char *
+stack_id(void)
+{
+ return eina_strbuf_string_get(stack_buf);
+}
+
+static void
+parse(char *data, off_t size)
+{
+ char *p, *end, *token;
+ int delim = 0;
+ int do_params = 0;
+
+ DBG("Parsing input file");
+
+ p = data;
+ end = data + size;
+ line = 1;
+ while ((token = next_token(p, end, &p, &delim)))
+ {
+ /* if we are in param mode, the only delimiter
+ * we'll accept is the semicolon
+ */
+ if (do_params && delim && *token != ';')
+ {
+ ERR("parse error %s:%i. %c marker before ; marker",
+ file_in, line - 1, *token);
+ err_show();
+ exit(-1);
+ }
+ else if (delim)
+ {
+ if (*token == ',' || *token == ':') do_params = 1;
+ else if (*token == '}')
+ {
+ if (do_params)
+ {
+ ERR("Parse error %s:%i. } marker before ; marker",
+ file_in, line - 1);
+ err_show();
+ exit(-1);
+ }
+ else
+ stack_pop();
+ }
+ else if (*token == ';')
+ {
+ if (do_params)
+ {
+ do_params = 0;
+ new_statement();
+ /* clear out params */
+ while (params)
+ {
+ free(eina_list_data_get(params));
+ params = eina_list_remove(params, eina_list_data_get(params));
+ }
+ /* remove top from stack */
+ stack_pop();
+ }
+ }
+ else if (*token == '{')
+ {
+ if (do_params)
+ {
+ ERR("parse error %s:%i. { marker before ; marker",
+ file_in, line - 1);
+ err_show();
+ exit(-1);
+ }
+ }
+ free(token);
+ }
+ else
+ {
+ if (do_params)
+ params = eina_list_append(params, token);
+ else
+ {
+ stack_push(token);
+ new_object();
+ if ((verbatim == 1) && (p < (end - 2)))
+ {
+ int escaped = 0;
+ int inquotes = 0;
+ int insquotes = 0;
+ int squigglie = 1;
+ int l1 = 0, l2 = 0;
+ char *verbatim_1;
+ char *verbatim_2;
+
+ l1 = line;
+ while ((p[0] != '{') && (p < end))
+ {
+ if (*p == '\n') line++;
+ p++;
+ }
+ p++;
+ verbatim_1 = p;
+ verbatim_2 = NULL;
+ for (; p < end; p++)
+ {
+ if (*p == '\n') line++;
+ if (escaped) escaped = 0;
+ if (!escaped)
+ {
+ if (p[0] == '\\') escaped = 1;
+ else if (p[0] == '\"')
+ {
+ if (!insquotes)
+ {
+ if (inquotes) inquotes = 0;
+ else inquotes = 1;
+ }
+ }
+ else if (p[0] == '\'')
+ {
+ if (!inquotes)
+ {
+ if (insquotes) insquotes = 0;
+ else insquotes = 1;
+ }
+ }
+ else if ((!inquotes) && (!insquotes))
+ {
+ if (p[0] == '{') squigglie++;
+ else if (p[0] == '}')
+ squigglie--;
+ if (squigglie == 0)
+ {
+ verbatim_2 = p - 1;
+ l2 = line;
+ break;
+ }
+ }
+ }
+ }
+ if (verbatim_2 > verbatim_1)
+ {
+ int l;
+ char *v;
+
+ l = verbatim_2 - verbatim_1 + 1;
+ v = malloc(l + 1);
+ strncpy(v, verbatim_1, l);
+ v[l] = 0;
+ set_verbatim(v, l1, l2);
+ }
+ else
+ {
+ ERR("Parse error %s:%i. { marker does not have matching } marker",
+ file_in, line - 1);
+ err_show();
+ exit(-1);
+ }
+ new_object();
+ verbatim = 0;
+ }
+ }
+ }
+ }
+
+ DBG("Parsing done");
+}
+
+void
+set_verbatim(char *s, int l1, int l2)
+{
+ verbatim_line1 = l1;
+ verbatim_line2 = l2;
+ verbatim_str = s;
+}
+
+void
+compile(void)
+{
+ int fd;
+ off_t size;
+ char *data;
+
+ fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+ {
+ ERR("Cannot open file \"%s\" for input. %s",
+ file_in, strerror(errno));
+ exit(-1);
+ }
+ DBG("Opening \"%s\" for input", file_in);
+
+ size = lseek(fd, 0, SEEK_END);
+ if (size <= 0)
+ {
+ ERR("lseek failed");
+ close(fd);
+ return;
+ }
+ lseek(fd, 0, SEEK_SET);
+ data = malloc(size);
+ if (data && (read(fd, data, size) == size))
+ {
+ stack_buf = eina_strbuf_new();
+ parse(data, size);
+ eina_strbuf_free(stack_buf);
+ stack_buf = NULL;
+ }
+ else
+ {
+ ERR("Cannot read file \"%s\". %s", file_in, strerror(errno));
+ exit(-1);
+ }
+ free(data);
+ close(fd);
+}
+
+char *
+parse_str(int n)
+{
+ char *str;
+ char *s;
+
+ str = eina_list_nth(params, n);
+ if (!str)
+ {
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
+ err_show();
+ exit(-1);
+ }
+ s = mem_strdup(str);
+ return s;
+}
+
+static int
+_parse_enum(char *str, va_list va)
+{
+ va_list va2;
+ va_copy(va2, va); /* iterator for the error message */
+
+ for (;; )
+ {
+ char *s;
+ int v;
+
+ s = va_arg(va, char *);
+
+ /* End of the list, nothing matched. */
+ if (!s)
+ {
+ ERR("%s:%i token %s not one of:", file_in, line - 1, str);
+ s = va_arg(va2, char *);
+ while (s)
+ {
+ va_arg(va2, int);
+ fprintf(stderr, " %s", s);
+ s = va_arg(va2, char *);
+ if (!s) break;
+ }
+ fprintf(stderr, "\n");
+ va_end(va2);
+ va_end(va);
+ err_show();
+ exit(-1);
+ }
+
+ v = va_arg(va, int);
+ if (!strcmp(s, str))
+ {
+ va_end(va2);
+ va_end(va);
+ return v;
+ }
+ }
+ va_end(va2);
+ va_end(va);
+ return 0;
+}
+
+int
+parse_enum(int n, ...)
+{
+ char *str;
+ int result;
+ va_list va;
+
+ str = eina_list_nth(params, n);
+ if (!str)
+ {
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
+ err_show();
+ exit(-1);
+ }
+
+ va_start(va, n);
+ result = _parse_enum(str, va);
+ va_end(va);
+
+ return result;
+}
+
+int
+parse_int(int n)
+{
+ char *str;
+ int i;
+
+ str = eina_list_nth(params, n);
+ if (!str)
+ {
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
+ err_show();
+ exit(-1);
+ }
+ i = my_atoi(str);
+ return i;
+}
+
+int
+parse_int_range(int n, int f, int t)
+{
+ char *str;
+ int i;
+
+ str = eina_list_nth(params, n);
+ if (!str)
+ {
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
+ err_show();
+ exit(-1);
+ }
+ i = my_atoi(str);
+ if ((i < f) || (i > t))
+ {
+ ERR("%s:%i integer %i out of range of %i to %i inclusive",
+ file_in, line - 1, i, f, t);
+ err_show();
+ exit(-1);
+ }
+ return i;
+}
+
+int
+parse_bool(int n)
+{
+ char *str, buf[4096];
+ int i;
+
+ str = eina_list_nth(params, n);
+ if (!str)
+ {
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
+ err_show();
+ exit(-1);
+ }
+
+ if (!strstrip(str, buf, sizeof (buf)))
+ {
+ ERR("%s:%i expression is too long",
+ file_in, line - 1);
+ return 0;
+ }
+
+ if (!strcasecmp(buf, "false") || !strcasecmp(buf, "off"))
+ return 0;
+ if (!strcasecmp(buf, "true") || !strcasecmp(buf, "on"))
+ return 1;
+
+ i = my_atoi(str);
+ if ((i < 0) || (i > 1))
+ {
+ ERR("%s:%i integer %i out of range of 0 to 1 inclusive",
+ file_in, line - 1, i);
+ err_show();
+ exit(-1);
+ }
+ return i;
+}
+
+double
+parse_float(int n)
+{
+ char *str;
+ double i;
+
+ str = eina_list_nth(params, n);
+ if (!str)
+ {
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
+ err_show();
+ exit(-1);
+ }
+ i = my_atof(str);
+ return i;
+}
+
+int
+get_arg_count(void)
+{
+ return eina_list_count(params);
+}
+
+void
+check_arg_count(int required_args)
+{
+ int num_args = eina_list_count(params);
+
+ if (num_args != required_args)
+ {
+ ERR("%s:%i got %i arguments, but expected %i",
+ file_in, line - 1, num_args, required_args);
+ err_show();
+ exit(-1);
+ }
+}
+
+void
+check_min_arg_count(int min_required_args)
+{
+ int num_args = eina_list_count(params);
+
+ if (num_args < min_required_args)
+ {
+ ERR("%s:%i got %i arguments, but expected at least %i",
+ file_in, line - 1, num_args, min_required_args);
+ err_show();
+ exit(-1);
+ }
+}
+
+void
+check_regex(const char *regex)
+{
+ int ret;
+ char errbuf[1024];
+ regex_t preg;
+
+ ret = regcomp(&preg, regex, REG_EXTENDED | REG_NOSUB);
+ if (ret)
+ {
+ regerror(ret, &preg, errbuf, 1024);
+ ERR("%s:%i Invalid regular expression:\n"
+ "%s", file_in, line, errbuf);
+ err_show();
+ exit(-1);
+ }
+
+ regfree(&preg);
+}
+
+/* simple expression parsing stuff */
+
+/*
+ * alpha ::= beta + beta || beta
+ * beta ::= gamma + gamma || gamma
+ * gamma ::= num || delta
+ * delta ::= '(' alpha ')'
+ *
+ */
+
+/* int set of function */
+
+static int
+my_atoi(const char *s)
+{
+ int res = 0;
+ char buf[4096];
+
+ if (!s) return 0;
+ if (!strstrip(s, buf, sizeof(buf)))
+ {
+ ERR("%s:%i expression is too long",
+ file_in, line - 1);
+ return 0;
+ }
+ _alphai(buf, &res);
+ return res;
+}
+
+static char *
+_deltai(char *s, int *val)
+{
+ if (!val) return NULL;
+ if ('(' != s[0])
+ {
+ ERR("%s:%i unexpected character at %s",
+ file_in, line - 1, s);
+ return s;
+ }
+ else
+ {
+ s++;
+ s = _alphai(s, val);
+ s++;
+ return s;
+ }
+ return s;
+}
+
+static char *
+_funci(char *s, int *val)
+{
+ if (!strncmp(s, "floor(", 6))
+ {
+ s += 5;
+ s = _deltai(s, val);
+ }
+ else if (!strncmp(s, "ceil(", 5))
+ {
+ s += 4;
+ s = _deltai(s, val);
+ }
+ else
+ {
+ ERR("%s:%i unexpected character at %s",
+ file_in, line - 1, s);
+ }
+ return s;
+}
+
+static char *
+_gammai(char *s, int *val)
+{
+ if (!val) return NULL;
+ if (_is_numi(s[0]))
+ {
+ s = _get_numi(s, val);
+ return s;
+ }
+ else if ('(' == s[0])
+ {
+ s = _deltai(s, val);
+ return s;
+ }
+ else
+ {
+ s = _funci(s, val);
+// ERR("%s:%i unexpected character at %s",
+// progname, file_in, line - 1, s);
+ }
+ return s;
+}
+
+static char *
+_betai(char *s, int *val)
+{
+ int a1, a2;
+ char op;
+
+ if (!val) return NULL;
+ s = _gammai(s, &a1);
+ while (_is_op1i(s[0]))
+ {
+ op = s[0];
+ s++;
+ s = _gammai(s, &a2);
+ a1 = _calci(op, a1, a2);
+ }
+ (*val) = a1;
+ return s;
+}
+
+static char *
+_alphai(char *s, int *val)
+{
+ int a1, a2;
+ char op;
+
+ if (!val) return NULL;
+ s = _betai(s, &a1);
+ while (_is_op2i(s[0]))
+ {
+ op = s[0];
+ s++;
+ s = _betai(s, &a2);
+ a1 = _calci(op, a1, a2);
+ }
+ (*val) = a1;
+ return s;
+}
+
+static char *
+_get_numi(char *s, int *val)
+{
+ char buf[4096];
+ int pos = 0;
+
+ if (!val) return s;
+ while ((('0' <= s[pos]) && ('9' >= s[pos])) ||
+ ((0 == pos) && ('-' == s[pos])))
+ {
+ buf[pos] = s[pos];
+ pos++;
+ }
+ buf[pos] = '\0';
+ (*val) = atoi(buf);
+ return s + pos;
+}
+
+static int
+_is_numi(char c)
+{
+ if (((c >= '0') && (c <= '9')) || ('-' == c) || ('+' == c))
+ return 1;
+ else
+ return 0;
+}
+
+static int
+_is_op1i(char c)
+{
+ switch (c)
+ {
+ case '*':;
+
+ case '%':;
+
+ case '/': return 1;
+
+ default: break;
+ }
+ return 0;
+}
+
+static int
+_is_op2i(char c)
+{
+ switch (c)
+ {
+ case '+':;
+
+ case '-': return 1;
+
+ default: break;
+ }
+ return 0;
+}
+
+static int
+_calci(char op, int a, int b)
+{
+ switch (op)
+ {
+ case '+':
+ a += b;
+ return a;
+
+ case '-':
+ a -= b;
+ return a;
+
+ case '/':
+ if (0 != b) a /= b;
+ else
+ ERR("%s:%i divide by zero", file_in, line - 1);
+ return a;
+
+ case '*':
+ a *= b;
+ return a;
+
+ case '%':
+ if (0 != b) a = a % b;
+ else
+ ERR("%s:%i modula by zero", file_in, line - 1);
+ return a;
+
+ default:
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
+ }
+ return a;
+}
+
+/* float set of functoins */
+
+static double
+my_atof(const char *s)
+{
+ double res = 0;
+ char buf[4096];
+
+ if (!s) return 0;
+
+ if (!strstrip(s, buf, sizeof (buf)))
+ {
+ ERR("%s:%i expression is too long", file_in, line - 1);
+ return 0;
+ }
+ _alphaf(buf, &res);
+ return res;
+}
+
+static char *
+_deltaf(char *s, double *val)
+{
+ if (!val) return NULL;
+ if ('(' != s[0])
+ {
+ ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
+ return s;
+ }
+ else
+ {
+ s++;
+ s = _alphaf(s, val);
+ s++;
+ }
+ return s;
+}
+
+static char *
+_funcf(char *s, double *val)
+{
+ if (!strncmp(s, "floor(", 6))
+ {
+ s += 5;
+ s = _deltaf(s, val);
+ *val = floor(*val);
+ }
+ else if (!strncmp(s, "ceil(", 5))
+ {
+ s += 4;
+ s = _deltaf(s, val);
+ *val = ceil(*val);
+ }
+ else
+ {
+ ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
+ }
+ return s;
+}
+
+static char *
+_gammaf(char *s, double *val)
+{
+ if (!val) return NULL;
+
+ if (_is_numf(s[0]))
+ {
+ s = _get_numf(s, val);
+ return s;
+ }
+ else if ('(' == s[0])
+ {
+ s = _deltaf(s, val);
+ return s;
+ }
+ else
+ {
+ s = _funcf(s, val);
+// ERR("%s:%i unexpected character at %s",
+// progname, file_in, line - 1, s);
+ }
+ return s;
+}
+
+static char *
+_betaf(char *s, double *val)
+{
+ double a1 = 0, a2 = 0;
+ char op;
+
+ if (!val) return NULL;
+ s = _gammaf(s, &a1);
+ while (_is_op1f(s[0]))
+ {
+ op = s[0];
+ s++;
+ s = _gammaf(s, &a2);
+ a1 = _calcf(op, a1, a2);
+ }
+ (*val) = a1;
+ return s;
+}
+
+static char *
+_alphaf(char *s, double *val)
+{
+ double a1 = 0, a2 = 0;
+ char op;
+
+ if (!val) return NULL;
+ s = _betaf(s, &a1);
+ while (_is_op2f(s[0]))
+ {
+ op = s[0];
+ s++;
+ s = _betaf(s, &a2);
+ a1 = _calcf(op, a1, a2);
+ }
+ (*val) = a1;
+ return s;
+}
+
+static char *
+_get_numf(char *s, double *val)
+{
+ char buf[4096];
+ int pos = 0;
+
+ if (!val) return s;
+
+ while ((('0' <= s[pos]) && ('9' >= s[pos])) ||
+ ('.' == s[pos]) ||
+ ((0 == pos) && ('-' == s[pos])))
+ {
+ buf[pos] = s[pos];
+ pos++;
+ }
+ buf[pos] = '\0';
+ (*val) = atof(buf);
+ return s + pos;
+}
+
+int
+params_min_check(int n)
+{
+ char *str;
+
+ str = _parse_param_get(n);
+ if (str) return 1;
+ return 0;
+}
+
+static int
+_is_numf(char c)
+{
+ if (((c >= '0') && (c <= '9'))
+ || ('-' == c)
+ || ('.' == c)
+ || ('+' == c))
+ return 1;
+ return 0;
+}
+
+static int
+_is_op1f(char c)
+{
+ switch (c)
+ {
+ case '*':;
+
+ case '%':;
+
+ case '/': return 1;
+
+ default: break;
+ }
+ return 0;
+}
+
+static int
+_is_op2f(char c)
+{
+ switch (c)
+ {
+ case '+':;
+
+ case '-': return 1;
+
+ default: break;
+ }
+ return 0;
+}
+
+static double
+_calcf(char op, double a, double b)
+{
+ switch (op)
+ {
+ case '+':
+ a += b;
+ return a;
+
+ case '-':
+ a -= b;
+ return a;
+
+ case '/':
+ if (b != 0) a /= b;
+ else
+ ERR("%s:%i divide by zero", file_in, line - 1);
+ return a;
+
+ case '*':
+ a *= b;
+ return a;
+
+ case '%':
+ if (0 != b) a = (double)((int)a % (int)b);
+ else
+ ERR("%s:%i modula by zero", file_in, line - 1);
+ return a;
+
+ default:
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
+ }
+ return a;
+}
+
+static int
+strstrip(const char *in, char *out, size_t size)
+{
+ if ((size - 1) < strlen(in))
+ {
+ ERR("%s:%i expression is too long", file_in, line - 1);
+ return 0;
+ }
+ /* remove spaces and tabs */
+ while (*in)
+ {
+ if ((0x20 != *in) && (0x09 != *in))
+ {
+ *out = *in;
+ out++;
+ }
+ in++;
+ }
+ *out = '\0';
+ return 1;
+}
diff --git a/src/bin/elementary/quicklaunch.c b/src/bin/elementary/quicklaunch.c
new file mode 100644
index 0000000000..6ca0a3c973
--- /dev/null
+++ b/src/bin/elementary/quicklaunch.c
@@ -0,0 +1,347 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#ifdef HAVE_ENVIRON
+# define _GNU_SOURCE 1
+#endif
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/wait.h>
+
+#include <Elementary.h>
+
+#ifdef HAVE_ENVIRON
+extern char **environ;
+#endif
+
+static double restart_time = 0.0;
+
+#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
+
+static struct sigaction old_sigint;
+static struct sigaction old_sigterm;
+static struct sigaction old_sigquit;
+static struct sigaction old_sigalrm;
+static struct sigaction old_sigusr1;
+static struct sigaction old_sigusr2;
+static struct sigaction old_sighup;
+static struct sigaction old_sigchld;
+static struct sigaction old_sigsegv;
+static struct sigaction old_sigill;
+static struct sigaction old_sigfpe;
+static struct sigaction old_sigbus;
+static struct sigaction old_sigabrt;
+static int _log_dom = -1;
+
+#define CRI(...) EINA_LOG_DOM_CRIT(_log_dom, __VA_ARGS__)
+#define ERR(...) EINA_LOG_DOM_ERR(_log_dom, __VA_ARGS__)
+#define WRN(...) EINA_LOG_DOM_WARN(_log_dom, __VA_ARGS__)
+#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
+#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
+
+static void
+post_fork(void *data EINA_UNUSED)
+{
+ sigaction(SIGINT, &old_sigint, NULL);
+ sigaction(SIGTERM, &old_sigterm, NULL);
+ sigaction(SIGQUIT, &old_sigquit, NULL);
+ sigaction(SIGALRM, &old_sigalrm, NULL);
+ sigaction(SIGUSR1, &old_sigusr1, NULL);
+ sigaction(SIGUSR2, &old_sigusr2, NULL);
+ sigaction(SIGHUP, &old_sighup, NULL);
+ sigaction(SIGCHLD, &old_sigchld, NULL);
+ sigaction(SIGSEGV, &old_sigsegv, NULL);
+ sigaction(SIGILL, &old_sigill, NULL);
+ sigaction(SIGFPE, &old_sigfpe, NULL);
+ sigaction(SIGBUS, &old_sigbus, NULL);
+ sigaction(SIGABRT, &old_sigabrt, NULL);
+ if ((_log_dom > -1) && (_log_dom != EINA_LOG_DOMAIN_GLOBAL))
+ {
+ eina_log_domain_unregister(_log_dom);
+ _log_dom = -1;
+ }
+}
+
+static void
+child_handler(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
+{
+ int status;
+ while (waitpid(-1, &status, WNOHANG) > 0);
+}
+
+static void
+crash_handler(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void *data EINA_UNUSED)
+{
+ double t;
+
+ ERR("crash detected. restarting.");
+ t = ecore_time_get();
+ if ((t - restart_time) <= 2.0)
+ {
+ CRI("crash too fast - less than 2 seconds. abort restart");
+ exit(-1);
+ }
+ ecore_app_restart();
+}
+
+static void
+handle_run(int fd, unsigned long bytes)
+{
+ unsigned char *buf = NULL;
+ int i;
+ char **argv = NULL;
+ char **envir = NULL;
+ char *cwd;
+ int argc, envnum;
+ unsigned long off;
+
+ _elm_startup_time = ecore_time_unix_get();
+
+ buf = alloca(bytes);
+ if (read(fd, buf, bytes) != (int)bytes)
+ {
+ CRI("cannot read %i bytes of args and environment data", (int)bytes);
+ close(fd);
+ return;
+ }
+ close(fd);
+
+ argc = ((unsigned long *)(buf))[0];
+ envnum = ((unsigned long *)(buf))[1];
+
+ if (argc <= 0)
+ {
+ CRI("no executable specified");
+ return;
+ }
+
+ argv = alloca(argc * sizeof(char *));
+ if (envnum > 0) envir = alloca(envnum * sizeof(char *));
+ off = ((unsigned long *)(buf))[2 + argc + envnum] - sizeof(unsigned long);
+ cwd = (char *)(buf + off);
+
+ for (i = 0; i < argc; i++)
+ {
+ off = ((unsigned long *)(buf))[2 + i] - sizeof(unsigned long);
+ argv[i] = (char *)(buf + off);
+ }
+
+#ifdef HAVE_ENVIRON
+ if (envir)
+ {
+#ifdef HAVE_CLEARENV
+ clearenv();
+#else
+ environ = NULL;
+#endif
+ for (i = 0; i < envnum; i++)
+ {
+ off = ((unsigned long *)(buf))[2 + argc + i] - sizeof(unsigned long);
+ envir[i] = (char *)(buf + off);
+ putenv(envir[i]);
+ }
+ }
+#endif
+ elm_quicklaunch_prepare(argc, argv, cwd);
+ elm_quicklaunch_fork(argc, argv, cwd, post_fork, NULL);
+ elm_quicklaunch_cleanup();
+}
+
+int
+main(int argc, char **argv)
+{
+ int sock, socket_unix_len;
+ struct stat st;
+ struct sockaddr_un socket_unix;
+ struct linger lin;
+ char buf[PATH_MAX];
+ struct sigaction action;
+ const char *disp;
+ int ret = 0;
+
+ if (!eina_init())
+ {
+ fprintf(stderr, "ERROR: failed to init eina.");
+ exit(-1);
+ }
+ _log_dom = eina_log_domain_register
+ ("elementary_quicklaunch", EINA_COLOR_CYAN);
+ if (_log_dom < 0)
+ {
+ EINA_LOG_ERR("could not register elementary_quicklaunch log domain.");
+ _log_dom = EINA_LOG_DOMAIN_GLOBAL;
+ }
+
+ if (!(disp = getenv("DISPLAY"))) disp = "unknown";
+ snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid());
+ if (stat(buf, &st) < 0)
+ {
+ ret = mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
+ if (ret < 0)
+ {
+ CRI("cannot create directory '%s'", buf);
+ exit(-1);
+ }
+ }
+ snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp);
+ unlink(buf);
+ sock = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (sock < 0)
+ {
+ CRI("cannot create socket for socket for '%s': %s",
+ buf, strerror(errno));
+ exit(-1);
+ }
+ if (fcntl(sock, F_SETFD, FD_CLOEXEC) < 0)
+ {
+ CRI("cannot set close on exec socket for '%s' (fd=%d): %s",
+ buf, sock, strerror(errno));
+ exit(-1);
+ }
+ lin.l_onoff = 1;
+ lin.l_linger = 0;
+ if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) < 0)
+ {
+ CRI("cannot set linger for socket for '%s' (fd=%d): %s",
+ buf, sock, strerror(errno));
+ exit(-1);
+ }
+ socket_unix.sun_family = AF_UNIX;
+ strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
+ socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
+ if (bind(sock, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
+ {
+ CRI("cannot bind socket for '%s' (fd=%d): %s",
+ buf, sock, strerror(errno));
+ exit(-1);
+ }
+ if (listen(sock, 4096) < 0)
+ {
+ CRI("listen(sock=%d, 4096): %s", sock, strerror(errno));
+ exit(-1);
+ }
+ elm_quicklaunch_mode_set(EINA_TRUE);
+ elm_quicklaunch_init(argc, argv);
+ restart_time = ecore_time_get();
+
+ memset(&action, 0, sizeof(struct sigaction));
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGINT, &action, &old_sigint);
+
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGTERM, &action, &old_sigterm);
+
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGQUIT, &action, &old_sigquit);
+
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGALRM, &action, &old_sigalrm);
+
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGUSR1, &action, &old_sigusr1);
+
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGUSR2, &action, &old_sigusr2);
+
+ action.sa_handler = SIG_DFL;
+ action.sa_sigaction = NULL;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGHUP, &action, &old_sighup);
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = child_handler;
+ action.sa_flags = SA_RESTART | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGCHLD, &action, &old_sigchld);
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = crash_handler;
+ action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGSEGV, &action, &old_sigsegv);
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = crash_handler;
+ action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGILL, &action, &old_sigill);
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = crash_handler;
+ action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGFPE, &action, &old_sigfpe);
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = crash_handler;
+ action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGBUS, &action, &old_sigbus);
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = crash_handler;
+ action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
+ sigemptyset(&action.sa_mask);
+ sigaction(SIGABRT, &action, &old_sigabrt);
+
+ for (;;)
+ {
+ int fd;
+ struct sockaddr_un client;
+ socklen_t len;
+
+ len = sizeof(struct sockaddr_un);
+ fd = accept(sock, (struct sockaddr *)&client, &len);
+ elm_quicklaunch_sub_init(argc, argv);
+ // don't seed since we are doing this AFTER launch request
+ // elm_quicklaunch_seed();
+ if (fd >= 0)
+ {
+ unsigned long bytes;
+ int num;
+
+ num = read(fd, &bytes, sizeof(unsigned long));
+ if (num == sizeof(unsigned long))
+ handle_run(fd, bytes);
+ }
+ while (elm_quicklaunch_sub_shutdown() > 0);
+ }
+ elm_quicklaunch_shutdown();
+
+ if ((_log_dom > -1) && (_log_dom != EINA_LOG_DOMAIN_GLOBAL))
+ {
+ eina_log_domain_unregister(_log_dom);
+ _log_dom = -1;
+ }
+ eina_shutdown();
+
+ return 0;
+}
diff --git a/src/bin/elementary/run.c b/src/bin/elementary/run.c
new file mode 100644
index 0000000000..a3ad3a4cab
--- /dev/null
+++ b/src/bin/elementary/run.c
@@ -0,0 +1,213 @@
+#include "elementary_config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#ifdef HAVE_ENVIRON
+# define _GNU_SOURCE 1
+#endif
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#endif
+
+#ifdef HAVE_ENVIRON
+extern char **environ;
+#endif
+
+#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
+
+int
+main(int argc, char **argv)
+{
+ int sock, socket_unix_len, i, n;
+ struct sockaddr_un socket_unix;
+ char buf[PATH_MAX];
+ struct stat st;
+ char *exe;
+ int we_are_elementary_run = 0;
+ char *disp;
+ char *cwd;
+
+ int sargc, slen, envnum;
+ unsigned char *sbuf = NULL, *pos;
+ char **sargv = NULL;
+
+ if (!getcwd(buf, sizeof(buf) - 1))
+ {
+ fprintf(stderr, "elementary_quicklaunch: currect working dir too big.\n");
+ exit(-1);
+ }
+ cwd = strdup(buf);
+ if (!(disp = getenv("DISPLAY"))) disp = "unknown";
+ snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp);
+ if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
+ {
+ perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");
+ exit(-1);
+ }
+ socket_unix.sun_family = AF_UNIX;
+ strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
+ socket_unix.sun_path[(int)(sizeof(socket_unix.sun_path)/sizeof(socket_unix.sun_path[0])) - 1] = '\0';
+ socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
+ if (connect(sock, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
+ {
+ perror("elementary_quicklaunch: connect(sock, (struct sockaddr *)&socket_unix, socket_unix_len)");
+ printf("elementary_quicklaunch: cannot connect to socket '%s'\n", buf);
+ exit(1);
+ }
+ exe = argv[0];
+ if (!(((exe[0] == '/')) ||
+ ((exe[0] == '.') && (exe[1] == '/')) ||
+ ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/'))))
+ {
+ char *path = getenv("PATH");
+ int exelen = strlen(argv[0]);
+ if (path)
+ {
+ const char *p, *pp;
+
+ p = path;
+ pp = p;
+ exe = NULL;
+ for (;;)
+ {
+ if ((*p == ':') || (!*p))
+ {
+ unsigned int len;
+
+ len = p - pp;
+ if (len < (sizeof(buf) - exelen - 3))
+ {
+ strncpy(buf, pp, len);
+ strcpy(buf + len, "/");
+ strcpy(buf + len + 1, argv[0]);
+ if (!access(buf, R_OK | X_OK))
+ {
+ exe = buf;
+ break;
+ }
+ if (!*p) break;
+ p++;
+ pp = p;
+ }
+ }
+ else
+ {
+ if (!*p) break;
+ p++;
+ }
+ }
+ }
+ }
+ if (exe)
+ {
+ if (!lstat(exe, &st))
+ {
+ if (S_ISLNK(st.st_mode))
+ {
+ char buf2[PATH_MAX];
+
+ ssize_t len = readlink(exe, buf2, sizeof(buf2) - 1);
+ if (len >= 0)
+ {
+ char *p;
+ buf2[len] = 0;
+ p = strrchr(buf2, '/');
+ if (p) p++;
+ else p = buf2;
+ if (!strncasecmp(p, "elementary_run", 14))
+ we_are_elementary_run = 1;
+ }
+ }
+ }
+ }
+ if (we_are_elementary_run)
+ {
+ sargc = argc;
+ sargv = argv;
+ }
+ else
+ {
+ sargc = argc - 1;
+ sargv = &(argv[1]);
+ }
+
+ slen = 0;
+ envnum = 0;
+
+ // header:
+ // UL 'total bytes'
+ // UL 'argnum'
+ // UL 'envnum'
+ slen += sizeof(unsigned long) * 3;
+
+ for (i = 0; i < sargc; i++)
+ {
+ slen += sizeof(unsigned long);
+ slen += strlen(sargv[i]) + 1;
+ }
+
+#ifdef HAVE_ENVIRON
+ // count how much space is needed for environment
+ for (i = 0; environ[i]; i++)
+ {
+ slen += sizeof(unsigned long);
+ slen += strlen(environ[i]) + 1;
+ envnum++;
+ }
+#endif
+
+ // how much space is needed for cwd
+ slen += sizeof(unsigned long);
+ slen += strlen(cwd) + 1;
+
+ // allocate buffer on stack
+ sbuf = alloca(slen);
+
+ // fill in header
+ ((unsigned long *)(sbuf))[0] = slen - sizeof(unsigned long);
+ ((unsigned long *)(sbuf))[1] = sargc;
+ ((unsigned long *)(sbuf))[2] = envnum;
+ // pos pointer after header
+ pos = (unsigned char *)(&((((unsigned long *)(sbuf))[3 + sargc + envnum + 1])));
+ n = 3;
+
+ // fill in args
+ for (i = 0; i < sargc; i++)
+ {
+ ((unsigned long *)(sbuf))[n] = (unsigned long)pos - (unsigned long)sbuf;
+ strcpy((char *)pos, sargv[i]);
+ pos += strlen(sargv[i]) + 1;
+ n++;
+ }
+
+#ifdef HAVE_ENVIRON
+ // fill in environ
+ for (i = 0; environ[i]; i++)
+ {
+ ((unsigned long *)(sbuf))[n] = (unsigned long)pos - (unsigned long)sbuf;
+ strcpy((char *)pos, environ[i]);
+ pos += strlen(environ[i]) + 1;
+ n++;
+ }
+#endif
+
+ // fill in cwd
+ ((unsigned long *)(sbuf))[n] = (unsigned long)pos - (unsigned long)sbuf;
+ n++;
+ strcpy((char *)pos, cwd);
+
+ if (write(sock, sbuf, slen) < 0)
+ printf("elementary_quicklaunch: cannot write to socket '%s'\n", buf);
+ close(sock);
+
+ free(cwd);
+ return 0;
+}
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
new file mode 100644
index 0000000000..3bad1c6d2c
--- /dev/null
+++ b/src/bin/elementary/test.c
@@ -0,0 +1,1030 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <string.h>
+#include <Elementary.h>
+#include "test.h"
+#include "test_explode.h"
+
+int _log_domain = -1;
+
+/* all tests prototypes */
+void test_access(void *data, Evas_Object *obj, void *event_info);
+void test_access2(void *data, Evas_Object *obj, void *event_info);
+void test_access3(void *data, Evas_Object *obj, void *event_info);
+void test_bg_plain(void *data, Evas_Object *obj, void *event_info);
+void test_bg_image(void *data, Evas_Object *obj, void *event_info);
+void test_bg_options(void *data, Evas_Object *obj, void *event_info);
+void test_icon(void *data, Evas_Object *obj, void *event_info);
+void test_icon_transparent(void *data, Evas_Object *obj, void *event_info);
+void test_icon_standard(void *data, Evas_Object *obj, void *event_info);
+void test_box_vert(void *data, Evas_Object *obj, void *event_info);
+void test_box_vert2(void *data, Evas_Object *obj, void *event_info);
+void test_box_pack(void *data, Evas_Object *obj, void *event_info);
+void test_box_horiz(void *data, Evas_Object *obj, void *event_info);
+void test_box_homo(void *data, Evas_Object *obj, void *event_info);
+void test_box_transition(void *data, Evas_Object *obj, void *event_info);
+void test_box_align(void *data, Evas_Object *obj, void *event_info);
+void test_button(void *data, Evas_Object *obj, void *event_info);
+void test_cnp(void *data, Evas_Object *obj, void *event_info);
+void test_transit(void *data, Evas_Object *obj, void *event_info);
+void test_transit_blend(void *data, Evas_Object *obj, void *event_info);
+void test_transit_chain(void *data, Evas_Object *obj, void *event_info);
+void test_transit_custom(void *data, Evas_Object *obj, void *event_info);
+void test_transit_fade(void *data, Evas_Object *obj, void *event_info);
+void test_transit_flip(void *data, Evas_Object *obj, void *event_info);
+void test_transit_resizable_flip(void *data, Evas_Object *obj, void *event_info);
+void test_transit_resizing(void *data, Evas_Object *obj, void *event_info);
+void test_transit_zoom(void *data, Evas_Object *obj, void *event_info);
+void test_transit_tween(void *data, Evas_Object *obj, void *event_info);
+void test_transit_bezier(void *data, Evas_Object *obj, void *event_info);
+void test_fileselector_button(void *data, Evas_Object *obj, void *event_info);
+void test_fileselector_entry(void *data, Evas_Object *obj, void *event_info);
+void test_clock(void *data, Evas_Object *obj, void *event_info);
+void test_clock_edit(void *data, Evas_Object *obj, void *event_info);
+void test_clock_edit2(void *data, Evas_Object *obj, void *event_info);
+void test_clock_pause(void *data, Evas_Object *obj, void *event_info);
+void test_combobox(void *data, Evas_Object *obj, void *event_info);
+void test_combobox2(void *data, Evas_Object *obj, void *event_info);
+void test_check(void *data, Evas_Object *obj, void *event_info);
+void test_check_toggle(void *data, Evas_Object *obj, void *event_info);
+void test_radio(void *data, Evas_Object *obj, void *event_info);
+void test_layout(void *data, Evas_Object *obj, void *event_info);
+void test_layout2(void *data, Evas_Object *obj, void *event_info);
+void test_hover(void *data, Evas_Object *obj, void *event_info);
+void test_hover2(void *data, Evas_Object *obj, void *event_info);
+void test_hover3(void *data, Evas_Object *obj, void *event_info);
+void test_entry(void *data, Evas_Object *obj, void *event_info);
+void test_entry_style_user(void *data, Evas_Object *obj, void *event_info);
+void test_entry_style_default(void *data, Evas_Object *obj, void *event_info);
+void test_entry_scrolled(void *data, Evas_Object *obj, void *event_info);
+void test_entry3(void *data, Evas_Object *obj, void *event_info);
+void test_entry4(void *data, Evas_Object *obj, void *event_info);
+void test_entry5(void *data, Evas_Object *obj, void *event_info);
+void test_entry6(void *data, Evas_Object *obj, void *event_info);
+void test_entry7(void *data, Evas_Object *obj, void *event_info);
+void test_entry8(void *data, Evas_Object *obj, void *event_info);
+void test_entry_regex(void *data, Evas_Object *obj, void *event_info);
+void test_entry_notepad(void *data, Evas_Object *obj, void *event_info);
+void test_multibuttonentry(void *data, Evas_Object *obj, void *event_info);
+void test_entry_anchor2(void *data, Evas_Object *obj, void *event_info);
+void test_entry_anchor(void *data, Evas_Object *obj, void *event_info);
+void test_entry_emoticon(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar2(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar3(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar4(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar5(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar6(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar7(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar8(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar_vertical(void *data, Evas_Object *obj, void *event_info);
+void test_toolbar_focus(void *data, Evas_Object *obj, void *event_info);
+void test_hoversel(void *data, Evas_Object *obj, void *event_info);
+void test_hoversel_focus(void *data, Evas_Object *obj, void *event_info);
+void test_list(void *data, Evas_Object *obj, void *event_info);
+void test_list_horizontal(void *data, Evas_Object *obj, void *event_info);
+void test_list2(void *data, Evas_Object *obj, void *event_info);
+void test_list3(void *data, Evas_Object *obj, void *event_info);
+void test_list4(void *data, Evas_Object *obj, void *event_info);
+void test_list5(void *data, Evas_Object *obj, void *event_info);
+void test_list6(void *data, Evas_Object *obj, void *event_info);
+void test_list7(void *data, Evas_Object *obj, void *event_info);
+void test_list_focus(void *data, Evas_Object *obj, void *event_info);
+void test_list_horiz_focus(void *data, Evas_Object *obj, void *event_info);
+void test_list_separator(void *data, Evas_Object *obj, void *event_info);
+void test_list_multi_select(void *data, Evas_Object *obj, void *event_info);
+void test_inwin(void *data, Evas_Object *obj, void *event_info);
+void test_inwin2(void *data, Evas_Object *obj, void *event_info);
+void test_scaling(void *data, Evas_Object *obj, void *event_info);
+void test_scaling2(void *data, Evas_Object *obj, void *event_info);
+void test_slider(void *data, Evas_Object *obj, void *event_info);
+void test_actionslider(void *data, Evas_Object *obj, void *event_info);
+void test_genlist(void *data, Evas_Object *obj, void *event_info);
+void test_genlist2(void *data, Evas_Object *obj, void *event_info);
+void test_genlist3(void *data, Evas_Object *obj, void *event_info);
+void test_genlist4(void *data, Evas_Object *obj, void *event_info);
+void test_genlist5(void *data, Evas_Object *obj, void *event_info);
+void test_genlist6(void *data, Evas_Object *obj, void *event_info);
+void test_genlist7(void *data, Evas_Object *obj, void *event_info);
+void test_genlist8(void *data, Evas_Object *obj, void *event_info);
+void test_genlist9(void *data, Evas_Object *obj, void *event_info);
+void test_genlist10(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_reorder(void *data, Evas_Object *obj, void *event_info);
+void test_genlist12(void *data, Evas_Object *obj, void *event_info);
+void test_genlist13(void *data, Evas_Object *obj, void *event_info);
+void test_genlist14(void *data, Evas_Object *obj, void *event_info);
+void test_genlist15(void *data, Evas_Object *obj, void *event_info);
+void test_genlist16(void *data, Evas_Object *obj, void *event_info);
+void test_genlist17(void *data, Evas_Object *obj, void *event_info);
+void test_genlist18(void *data, Evas_Object *obj, void *event_info);
+void test_genlist19(void *data, Evas_Object *obj, void *event_info);
+void test_genlist20(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_focus(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_item_styles(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_multi_select(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_del(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_filter(void *data, Evas_Object *obj, void *event_info);
+void test_genlist_show_bring(void *data, Evas_Object *obj, void *event_info);
+void test_gesture_layer(void *data, Evas_Object *obj, void *event_info);
+void test_gesture_layer2(void *data, Evas_Object *obj, void *event_info);
+void test_gesture_layer3(void *data, Evas_Object *obj, void *event_info);
+void test_table(void *data, Evas_Object *obj, void *event_info);
+void test_table2(void *data, Evas_Object *obj, void *event_info);
+void test_table3(void *data, Evas_Object *obj, void *event_info);
+void test_table4(void *data, Evas_Object *obj, void *event_info);
+void test_table5(void *data, Evas_Object *obj, void *event_info);
+void test_table6(void *data, Evas_Object *obj, void *event_info);
+void test_table7(void *data, Evas_Object *obj, void *event_info);
+void test_table8(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid2(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid3(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid4(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid5(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid_item_styles(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid_speed(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid_focus(void *data, Evas_Object *obj, void *event_info);
+void test_gengrid_update(void *data, Evas_Object *obj, void *event_info);
+void test_win_state(void *data, Evas_Object *obj, void *event_info);
+void test_win_state2(void *data, Evas_Object *obj, void *event_info);
+void test_progressbar(void *data, Evas_Object *obj, void *event_info);
+void test_progressbar2(void *data, Evas_Object *obj, void *event_info);
+void test_fileselector(void *data, Evas_Object *obj, void *event_info);
+void test_separator(void *data, Evas_Object *obj, void *event_info);
+void test_scroller(void *data, Evas_Object *obj, void *event_info);
+void test_scroller2(void *data, Evas_Object *obj, void *event_info);
+void test_scroller3(void *data, Evas_Object *obj, void *event_info);
+void test_scroller4(void *data, Evas_Object *obj, void *event_info);
+void test_spinner(void *data, Evas_Object *obj, void *event_info);
+void test_index(void *data, Evas_Object *obj, void *event_info);
+void test_index2(void *data, Evas_Object *obj, void *event_info);
+void test_index3(void *data, Evas_Object *obj, void *event_info);
+void test_index_horizontal(void *data, Evas_Object *obj, void *event_info);
+void test_photocam(void *data, Evas_Object *obj, void *event_info);
+void test_photocam_remote(void *data, Evas_Object *obj, void *event_info);
+void test_photo(void *data, Evas_Object *obj, void *event_info);
+void test_prefs(void *data, Evas_Object *obj, void *event_info);
+void test_thumb(void *data, Evas_Object *obj, void *event_info);
+void test_icon_desktops(void *data, Evas_Object *obj, void *event_info);
+void test_icon_animated(void *data, Evas_Object *obj, void *event_info);
+void test_notify(void *data, Evas_Object *obj, void *event_info);
+void test_slideshow(void *data, Evas_Object *obj, void *event_info);
+void test_menu(void *data, Evas_Object *obj, void *event_info);
+void test_menu2(void *data, Evas_Object *obj, void *event_info);
+void test_panel(void *data, Evas_Object *obj, void *event_info);
+void test_panel2(void *data, Evas_Object *obj, void *event_info);
+void test_panes(void *data, Evas_Object *obj, void *event_info);
+void test_calendar(void *data, Evas_Object *obj, void *event_info);
+void test_calendar2(void *data, Evas_Object *obj, void *event_info);
+void test_calendar3(void *data, Evas_Object *obj, void *event_info);
+void test_map(void *data, Evas_Object *obj, void *event_info);
+void test_weather(void *data, Evas_Object *obj, void *event_info);
+void test_flip(void *data, Evas_Object *obj, void *event_info);
+void test_flip2(void *data, Evas_Object *obj, void *event_info);
+void test_flip3(void *data, Evas_Object *obj, void *event_info);
+void test_flip_interactive(void *data, Evas_Object *obj, void *event_info);
+void test_flip_to(void *data, Evas_Object *obj, void *event_info);
+void test_flip_page(void *data, Evas_Object *obj, void *event_info);
+void test_label(void *data, Evas_Object *obj, void *event_info);
+void test_label_slide(void *data, Evas_Object *obj, void *event_info);
+void test_label_wrap(void *data, Evas_Object *obj, void *event_info);
+void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info);
+void test_conformant(void *data, Evas_Object *obj, void *event_info);
+void test_conformant2(void *data, Evas_Object *obj, void *event_info);
+void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info);
+void test_main_menu(void *data, Evas_Object *obj, void *event_info);
+void test_multi(void *data, Evas_Object *obj, void *event_info);
+void test_floating(void *data, Evas_Object *obj, void *event_info);
+void test_launcher(void *data, Evas_Object *obj, void *event_info);
+void test_launcher2(void *data, Evas_Object *obj, void *event_info);
+void test_launcher3(void *data, Evas_Object *obj, void *event_info);
+void test_anim(void *data, Evas_Object *obj, void *event_info);
+void test_tooltip(void *data, Evas_Object *obj, void *event_info);
+void test_tooltip2(void *data, Evas_Object *obj, void *event_info);
+void test_tooltip3(void *data, Evas_Object *obj, void *event_info);
+void test_cursor(void *data, Evas_Object *obj, void *event_info);
+void test_cursor2(void *data, Evas_Object *obj, void *event_info);
+void test_cursor3(void *data, Evas_Object *obj, void *event_info);
+void test_cursor4(void *data, Evas_Object *obj, void *event_info);
+void test_focus(void *data, Evas_Object *obj, void *event_info);
+void test_focus2(void *data, Evas_Object *obj, void *event_info);
+void test_focus_hide_del(void *data, Evas_Object *obj, void *event_info);
+void test_focus_custom_chain(void *data, Evas_Object *obj, void *event_info);
+void test_focus_style(void *data, Evas_Object *obj, void *event_info);
+void test_focus_part(void *data, Evas_Object *obj, void *event_info);
+void test_focus3(void *data, Evas_Object *obj, void *event_info);
+void test_focus_object_style(void *data, Evas_Object *obj, void *event_info);
+void test_focus_object_policy(void *data, Evas_Object *obj, void *event_info);
+void test_flipselector(void *data, Evas_Object *obj, void *event_info);
+void test_diskselector(void *data, Evas_Object *obj, void *event_info);
+void test_colorselector(void *data, Evas_Object *obj, void *event_info);
+void test_ctxpopup(void *data, Evas_Object *obj, void *event_info);
+void test_bubble(void *data, Evas_Object *obj, void *event_info);
+void test_segment_control(void *data, Evas_Object *obj, void *event_info);
+void test_store(void *data, Evas_Object *obj, void *event_info);
+void test_sys_notify(void *data, Evas_Object *obj, void *event_info);
+void test_systray(void *data, Evas_Object *obj, void *event_info);
+void test_win_inline(void *data, Evas_Object *obj, void *event_info);
+void test_win_keygrab(void *data, Evas_Object *obj, void *event_info);
+void test_win_socket(void *data, Evas_Object *obj, void *event_info);
+void test_win_plug(void *data, Evas_Object *obj, void *event_info);
+void test_win_wm_rotation(void *data, Evas_Object *obj, void *event_info);
+void test_grid(void *data, Evas_Object *obj, void *event_info);
+void test_glview_simple(void *data, Evas_Object *obj, void *event_info);
+void test_glview(void *data, Evas_Object *obj, void *event_info);
+void test_glview_manygears(void *data, Evas_Object *obj, void *event_info);
+void test_3d(void *data, Evas_Object *obj, void *event_info);
+void test_naviframe(void *data, Evas_Object *obj, void *event_info);
+void test_naviframe2(void *data, Evas_Object *obj, void *event_info);
+void test_naviframe3(void *data, Evas_Object *obj, void *event_info);
+void test_naviframe_complex(void *data, Evas_Object *obj, void *event_info);
+//void test_factory(void *data, Evas_Object *obj, void *event_info);
+void test_datetime(void *data, Evas_Object *obj, void *event_info);
+void test_popup(void *data, Evas_Object *obj, void *event_info);
+void test_dayselector(void *data, Evas_Object *obj, void *event_info);
+void test_image(void *data, Evas_Object *obj, void *event_info);
+void test_remote_image(void *data, Evas_Object *obj, void *event_info);
+void test_click_image(void *data, Evas_Object *obj, void *event_info);
+void test_external_button(void *data, Evas_Object *obj, void *event_info);
+void test_external_slider(void *data, Evas_Object *obj, void *event_info);
+void test_external_scroller(void *data, Evas_Object *obj, void *event_info);
+void test_external_pbar(void *data, Evas_Object *obj, void *event_info);
+void test_external_video(void *data, Evas_Object *obj, void *event_info);
+void test_config(void *data, Evas_Object *obj, void *event_info);
+void test_video(void *data, Evas_Object *obj, void *event_info);
+void test_eio(void *data, Evas_Object *obj, void *event_info);
+#ifdef HAVE_ELEMENTARY_WEB
+void test_web(void *data, Evas_Object *obj, void *event_info);
+void test_web_ui(void *data, Evas_Object *obj, void *event_info);
+#endif
+void test_dnd_genlist_default_anim(void *data, Evas_Object *obj, void *event_info);
+void test_dnd_genlist_user_anim(void *data, Evas_Object *obj, void *event_info);
+void test_dnd_genlist_gengrid(void *data, Evas_Object *obj, void *event_info);
+void test_dnd_multi_features(void *data, Evas_Object *obj, void *event_info);
+void test_dnd_types(void *data, Evas_Object *obj, void *event_info);
+void test_task_switcher(void *data, Evas_Object *obj, void *event_info);
+void test_application_server_message(void *data, Evas_Object *obj, void *event_info);
+void test_application_server_phone(void *data, Evas_Object *obj, void *event_info);
+void test_win_dialog(void *data, Evas_Object *obj, void *event_info);
+void test_box_disable(void *data, Evas_Object *obj, void *event_info);
+void test_layout_disable(void *data, Evas_Object *obj, void *event_info);
+
+void test_colorclass(void *data, Evas_Object *obj, void *event_info);
+
+Evas_Object *win, *tbx; // TODO: refactoring
+void *tt;
+Eina_List *tests;
+
+struct elm_test
+{
+ const char *icon;
+ const char *category;
+ const char *name;
+ void (*cb)(void *, Evas_Object *, void *);
+};
+
+static int
+_elm_test_sort(const void *pa, const void *pb)
+{
+ const struct elm_test *a = pa, *b = pb;
+ int res = strcasecmp(a->category, b->category);
+ if (res) return res;
+ return strcasecmp(a->name, b->name);
+}
+
+static void
+_elm_test_add(Eina_List **p_list, const char *icon, const char *category, const char *name, void (*cb)(void *, Evas_Object *, void *))
+{
+ struct elm_test *t = malloc(sizeof(struct elm_test));
+ t->icon = icon;
+ t->category = category;
+ t->name = name;
+ t->cb = cb;
+ *p_list = eina_list_sorted_insert(*p_list, _elm_test_sort, t);
+}
+
+void
+my_win_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ elm_exit(); /* exit the program's main loop that runs in elm_run() */
+}
+
+static void
+_ui_tg_changed(void *data, Evas_Object *obj, void *event_info)
+{
+ (void) data; (void) event_info;
+ elm_config_mirrored_set(elm_check_state_get(obj));
+}
+
+static void
+_frame_clicked(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ printf("frame %p is: %s\n", obj, elm_frame_collapse_get(obj) ? "collapsed" : "expanded");
+}
+
+static void
+_menu_create(const char *option_str)
+{
+ struct elm_test *t = NULL;
+ const char *pcat = NULL;
+ Evas_Object *cfr = NULL, *tbx2 = NULL, *bt = NULL, *ic = NULL;
+ char buf[PATH_MAX];
+ Eina_List *l;
+
+ elm_box_clear(tbx);
+ EINA_LIST_FOREACH(tests, l, t)
+ {
+ if (option_str && !strcasestr(t->name, option_str)) continue;
+ if ((!pcat) || (strcmp(pcat, t->category)))
+ {
+ cfr = elm_frame_add(win);
+ // FIXME: add new style of frame for this
+ evas_object_smart_callback_add(cfr, "clicked", _frame_clicked, NULL);
+ elm_frame_autocollapse_set(cfr, EINA_TRUE);
+ elm_object_text_set(cfr, t->category);
+ evas_object_size_hint_weight_set(cfr, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_fill_set(cfr, EVAS_HINT_FILL, 0.0);
+ elm_box_pack_end(tbx, cfr);
+ evas_object_show(cfr);
+
+ tbx2 = elm_box_add(win);
+ elm_box_layout_set(tbx2, evas_object_box_layout_flow_horizontal, NULL, NULL);
+ evas_object_size_hint_weight_set(tbx2, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(tbx2, EVAS_HINT_FILL, 0.0);
+ elm_box_align_set(tbx2, 0.0, 0.5);
+ elm_object_content_set(cfr, tbx2);
+ evas_object_show(tbx2);
+ }
+ bt = elm_button_add(win);
+ // FIXME: add new style of button for this like efm in e17
+ elm_object_text_set(bt, t->name);
+ if (t->icon)
+ {
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), t->icon);
+ elm_image_file_set(ic, buf, NULL);
+ elm_object_part_content_set(bt, "icon", ic);
+ evas_object_show(ic);
+ }
+ elm_box_pack_end(tbx2, bt);
+ evas_object_show(bt);
+ evas_object_smart_callback_add(bt, "clicked", t->cb, win);
+ pcat = t->category;
+ if (t == tt) tt = cfr;
+ }
+}
+
+static void
+_entry_changed_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ const char *str = elm_entry_entry_get(obj);
+ if (!str) return;
+ _menu_create(str);
+}
+
+static char *
+_space_removed_string_get(const char *name)
+{
+ int i = 0, j = 0, len;
+ char *ret;
+
+ len = strlen(name);
+ ret = calloc(len + 1, sizeof(char));
+
+ while (name[i])
+ {
+ if (name[i] != ' ')
+ {
+ ret[j] = name[i];
+ j++;
+ }
+ i++;
+ }
+
+ return ret;
+}
+
+static void
+my_win_main(const char *autorun, Eina_Bool test_win_only)
+{
+ Evas_Object *bg = NULL, *bx0 = NULL, *bx1 = NULL, *lb = NULL;
+ Evas_Object *fr = NULL, *tg = NULL, *sc = NULL, *en = NULL;
+ Eina_List *l = NULL;
+ struct elm_test *t = NULL;
+
+ if (test_win_only) goto add_tests;
+ /* Create an elm window - It returns an evas object. This is a little
+ * special as the object lives in the canvas that is inside the window
+ * so what is returned is really inside the window, but as you manipulate
+ * the evas object returned - the window will respond. elm_win makes sure
+ * of that so you can blindly treat it like any other evas object
+ * pretty much, just as long as you know it has special significance.
+ * The first parameter is a "parent" window - eg for a dialog you want to
+ * have a main window it is related to, here it is NULL meaning there
+ * is no parent. "main" is the name of the window - used by the window
+ * manager for identifying the window uniquely amongst all the windows
+ * within this application (and all instances of the application). The
+ * type is a basic window (the final parameter).
+ * You can call elm_win_util_standard_add() instead. This is a convenient API
+ * for window and bg creation. You don't need to create bg object manually.
+ * You can also set the title of the window at the same time.
+ * ex) win = elm_win_util_standard_add("main", "Elementary Tests"); */
+ win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
+ if (!win) exit(1);
+
+ explode_win_enable(win);
+ /* Set the title of the window - This is in the titlebar. */
+ elm_win_title_set(win, "Elementary Tests");
+
+ /* Set a callback on the window when "delete,request" is emitted as
+ * a callback. When this happens my_win_del() is called and the
+ * data pointer (first param) is passed the final param here (in this
+ * case it is NULL). This is how you can pass specific things to a
+ * callback like objects or data layered on top. */
+ evas_object_smart_callback_add(win, "delete,request", my_win_del, NULL);
+
+ /* Add a background to our window. This just uses the standard theme set
+ * background. Without a background, you could make a window seem
+ * transparent with elm_win_alpha_set(win, EINA_TRUE); For example. if you
+ * have a compositor running this will make the window able to be
+ * semi-transparent and any space not filled by object/widget pixels will
+ * be transparent or translucent based on alpha. If you do not have a
+ * compositor running this should fall back to using shaped windows
+ * (which have a mask). Both these features will be slow and rely on
+ * a lot more resources, so only use it if you need it. */
+ bg = elm_bg_add(win);
+ /* Set weight to 1.0 x 1.0 == expand in both x and y direction. */
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ /* Tell the window that this object is to be resized along with the window.
+ * Also as a result this object will be one of several objects that
+ * controls the minimum/maximum size of the window. */
+ elm_win_resize_object_add(win, bg);
+ /* And show the background. */
+ evas_object_show(bg);
+
+ /* Add a box layout widget to the window. */
+ bx0 = elm_box_add(win);
+ /* Allow base box (bx0) to expand in x and y. */
+ evas_object_size_hint_weight_set(bx0, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ /* Tell the window that the box affects window size and also will be
+ * resized when the window is resized. */
+ elm_win_resize_object_add(win, bx0);
+ evas_object_show(bx0);
+
+ fr = elm_frame_add(win);
+ evas_object_smart_callback_add(fr, "clicked", _frame_clicked, NULL);
+ elm_frame_autocollapse_set(fr, EINA_TRUE);
+ elm_object_text_set(fr, "Information");
+ elm_box_pack_end(bx0, fr);
+ evas_object_show(fr);
+
+ lb = elm_label_add(win);
+ elm_object_text_set(lb,
+ "Please select a test from the list below by clicking<br/>"
+ "the test button to show the test window.");
+ elm_object_content_set(fr, lb);
+ evas_object_show(lb);
+
+ /* This label will not be read out */
+ elm_access_object_unregister(lb);
+
+ tg = elm_check_add(win);
+ elm_object_style_set(tg, "toggle");
+ elm_object_text_set(tg, "UI-Mirroring:");
+ elm_check_state_set(tg, elm_config_mirrored_get());
+ evas_object_smart_callback_add(tg, "changed", _ui_tg_changed, NULL);
+ elm_box_pack_end(bx0, tg);
+ evas_object_show(tg);
+
+ bx1 = elm_box_add(win);
+ elm_box_horizontal_set(bx1, EINA_TRUE);
+ evas_object_size_hint_weight_set(bx1, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(bx1, EVAS_HINT_FILL, 0.0);
+ elm_box_pack_end(bx0, bx1);
+ evas_object_show(bx1);
+
+ lb = elm_label_add(win);
+ elm_object_text_set(lb, " Search Menu :");
+ evas_object_size_hint_weight_set(lb, 0.0, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(lb, 0.0, EVAS_HINT_FILL);
+ elm_box_pack_end(bx1, lb);
+ evas_object_show(lb);
+
+ en = elm_entry_add(win);
+ elm_entry_single_line_set(en, EINA_TRUE);
+ elm_entry_scrollable_set(en, EINA_TRUE);
+ elm_object_part_text_set(en, "guide", "Type widget name here to search.");
+ evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_smart_callback_add(en, "changed,user", _entry_changed_cb, NULL);
+ elm_box_pack_end(bx1, en);
+ evas_object_show(en);
+ elm_object_focus_set(en, EINA_TRUE);
+
+ sc = elm_scroller_add(win);
+ elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
+ evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_fill_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_pack_end(bx0, sc);
+ evas_object_show(sc);
+
+ tbx = elm_box_add(win);
+ evas_object_size_hint_weight_set(tbx, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(tbx, EVAS_HINT_FILL, 0.0);
+ elm_object_content_set(sc, tbx);
+ evas_object_show(tbx);
+
+add_tests:
+ tests = NULL;
+#define ADD_TEST(icon_, cat_, name_, cb_) _elm_test_add(&tests, icon_, cat_, name_, cb_)
+
+ //------------------------------//
+ ADD_TEST(NULL, "Window / Background", "Bg Plain", test_bg_plain);
+ ADD_TEST(NULL, "Window / Background", "Bg Image", test_bg_image);
+ ADD_TEST(NULL, "Window / Background", "Bg Options", test_bg_options);
+ ADD_TEST(NULL, "Window / Background", "Window States", test_win_state);
+ ADD_TEST(NULL, "Window / Background", "Window States 2", test_win_state2);
+ ADD_TEST(NULL, "Window / Background", "Inwin", test_inwin);
+ ADD_TEST(NULL, "Window / Background", "Inwin 2", test_inwin2);
+ ADD_TEST(NULL, "Window / Background", "Window Inline", test_win_inline);
+ ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket);
+ ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug);
+ ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation);
+ ADD_TEST(NULL, "Window / Background", "Window Standard/Dialog", test_win_dialog);
+ ADD_TEST(NULL, "Window / Background", "Window Keygrab Set", test_win_keygrab);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Images", "Icon", test_icon);
+ ADD_TEST(NULL, "Images", "Icon Transparent", test_icon_transparent);
+ ADD_TEST(NULL, "Images", "Icon Animation", test_icon_animated);
+ ADD_TEST(NULL, "Images", "Icon Standard", test_icon_standard);
+ ADD_TEST(NULL, "Images", "Photocam", test_photocam);
+ ADD_TEST(NULL, "Images", "Photocam Remote", test_photocam_remote);
+ ADD_TEST(NULL, "Images", "Photo", test_photo);
+ ADD_TEST(NULL, "Images", "Thumb", test_thumb);
+ ADD_TEST(NULL, "Images", "Image", test_image);
+ ADD_TEST(NULL, "Images", "Image Remote", test_remote_image);
+ ADD_TEST(NULL, "Images", "Image Click", test_click_image);
+ ADD_TEST(NULL, "Images", "Slideshow", test_slideshow);
+ ADD_TEST(NULL, "Images", "Video", test_video);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Containers", "Box Vert", test_box_vert);
+ ADD_TEST(NULL, "Containers", "Box Vert 2", test_box_vert2);
+ ADD_TEST(NULL, "Containers", "Box Pack", test_box_pack);
+ ADD_TEST(NULL, "Containers", "Box Horiz", test_box_horiz);
+ ADD_TEST(NULL, "Containers", "Box Homogeneous", test_box_homo);
+ ADD_TEST(NULL, "Containers", "Box Transition", test_box_transition);
+ ADD_TEST(NULL, "Containers", "Box Align", test_box_align);
+ ADD_TEST(NULL, "Containers", "Table", test_table);
+ ADD_TEST(NULL, "Containers", "Table Homogeneous", test_table2);
+ ADD_TEST(NULL, "Containers", "Table 3", test_table3);
+ ADD_TEST(NULL, "Containers", "Table 4", test_table4);
+ ADD_TEST(NULL, "Containers", "Table 5", test_table5);
+ ADD_TEST(NULL, "Containers", "Table 6", test_table6);
+ ADD_TEST(NULL, "Containers", "Table 7", test_table7);
+ ADD_TEST(NULL, "Containers", "Table Padding", test_table8);
+ ADD_TEST(NULL, "Containers", "Layout", test_layout);
+ ADD_TEST(NULL, "Containers", "Layout 2", test_layout2);
+ ADD_TEST(NULL, "Containers", "Grid", test_grid);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Entries", "Entry", test_entry);
+ ADD_TEST(NULL, "Entries", "Entry Style Default", test_entry_style_default);
+ ADD_TEST(NULL, "Entries", "Entry Style User", test_entry_style_user);
+ ADD_TEST(NULL, "Entries", "Entry Scrolled", test_entry_scrolled);
+ ADD_TEST(NULL, "Entries", "Entry 3", test_entry3);
+ ADD_TEST(NULL, "Entries", "Entry 4", test_entry4);
+ ADD_TEST(NULL, "Entries", "Entry 5", test_entry5);
+ ADD_TEST(NULL, "Entries", "Entry 6", test_entry6);
+ ADD_TEST(NULL, "Entries", "Entry 7", test_entry7);
+ ADD_TEST(NULL, "Entries", "Entry 8", test_entry8);
+ ADD_TEST(NULL, "Entries", "Entry Regex", test_entry_regex);
+ ADD_TEST(NULL, "Entries", "Entry Notepad", test_entry_notepad);
+ ADD_TEST(NULL, "Entries", "Multibuttonentry", test_multibuttonentry);
+ ADD_TEST(NULL, "Entries", "Entry Anchor", test_entry_anchor);
+ ADD_TEST(NULL, "Entries", "Entry Anchor2", test_entry_anchor2);
+ ADD_TEST(NULL, "Entries", "Entry Emoticon", test_entry_emoticon);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Buttons", "Button", test_button);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Prefs", "Prefs", test_prefs);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Effects", "Transit", test_transit);
+ ADD_TEST(NULL, "Effects", "Transit Resizing", test_transit_resizing);
+ ADD_TEST(NULL, "Effects", "Transit Flip", test_transit_flip);
+ ADD_TEST(NULL, "Effects", "Transit Zoom", test_transit_zoom);
+ ADD_TEST(NULL, "Effects", "Transit Blend", test_transit_blend);
+ ADD_TEST(NULL, "Effects", "Transit Fade", test_transit_fade);
+ ADD_TEST(NULL, "Effects", "Transit Resizable Flip",
+ test_transit_resizable_flip);
+ ADD_TEST(NULL, "Effects", "Transit Custom", test_transit_custom);
+ ADD_TEST(NULL, "Effects", "Transit Chain", test_transit_chain);
+ ADD_TEST(NULL, "Effects", "Transit Tween", test_transit_tween);
+ ADD_TEST(NULL, "Effects", "Transit Bezier", test_transit_bezier);
+ ADD_TEST(NULL, "Effects", "Flip", test_flip);
+ ADD_TEST(NULL, "Effects", "Flip 2", test_flip2);
+ ADD_TEST(NULL, "Effects", "Flip 3", test_flip3);
+ ADD_TEST(NULL, "Effects", "Flip Interactive", test_flip_interactive);
+ ADD_TEST(NULL, "Effects", "Flip To", test_flip_to);
+ ADD_TEST(NULL, "Effects", "Flip Page", test_flip_page);
+ ADD_TEST(NULL, "Effects", "Animation", test_anim);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Edje External", "ExtButton", test_external_button);
+ ADD_TEST(NULL, "Edje External", "ExtProgressBar", test_external_pbar);
+ ADD_TEST(NULL, "Edje External", "ExtScroller", test_external_scroller);
+ ADD_TEST(NULL, "Edje External", "ExtSlider", test_external_slider);
+ ADD_TEST(NULL, "Edje External", "ExtVideo", test_external_video);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Toolbars", "Toolbar", test_toolbar);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 2", test_toolbar2);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 3", test_toolbar3);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 4", test_toolbar4);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 5", test_toolbar5);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 6", test_toolbar6);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 7", test_toolbar7);
+ ADD_TEST(NULL, "Toolbars", "Toolbar 8", test_toolbar8);
+ ADD_TEST(NULL, "Toolbars", "Toolbar Vertical", test_toolbar_vertical);
+ ADD_TEST(NULL, "Toolbars", "Toolbar Focus", test_toolbar_focus);
+
+ //------------------------------//
+ ADD_TEST(NULL, "Lists - List", "List", test_list);
+ ADD_TEST(NULL, "Lists - List", "List - Horizontal", test_list_horizontal);
+ ADD_TEST(NULL, "Lists - List", "List 2", test_list2);
+ ADD_TEST(NULL, "Lists - List", "List 3", test_list3);
+ ADD_TEST(NULL, "Lists - List", "List 4", test_list4);
+ ADD_TEST(NULL, "Lists - List", "List 5", test_list5);
+ ADD_TEST(NULL, "Lists - List", "List 6", test_list6);
+ ADD_TEST(NULL, "Lists - List", "List 7", test_list7);
+ ADD_TEST(NULL, "Lists - List", "List Focus", test_list_focus);
+ ADD_TEST(NULL, "Lists - List", "List Focus Horizontal", test_list_horiz_focus);
+ ADD_TEST(NULL, "Lists - List", "List Separator", test_list_separator);
+ ADD_TEST(NULL, "Lists - List", "List Multi Select", test_list_multi_select);
+
+ //------------------------------//
+
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist", test_genlist);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist 2", test_genlist2);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist 3", test_genlist3);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist 4", test_genlist4);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist 5", test_genlist5);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist 7", test_genlist7);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Tree", test_genlist6);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Group", test_genlist8);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Group Tree", test_genlist9);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Decorate Item Mode", test_genlist10);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Decorate All Mode", test_genlist15);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Reorder Mode", test_genlist_reorder);
+#ifdef HAVE_EIO
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Eio", test_eio);
+#endif
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Textblock", test_genlist12);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Tree, Insert Sorted", test_genlist13);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Tree, Insert Relative", test_genlist14);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Flip Mode", test_genlist16);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Decorate Modes", test_genlist17);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Tree and Decorate All Mode", test_genlist18);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Full Widget", test_genlist19);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Item Search By Text", test_genlist20);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Focus", test_genlist_focus);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Item Styles", test_genlist_item_styles);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Multi Select", test_genlist_multi_select);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Del", test_genlist_del);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Filter", test_genlist_filter);
+ ADD_TEST(NULL, "Lists - Genlist", "Genlist Show/Bring", test_genlist_show_bring);
+
+ //------------------------------//
+
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid", test_gengrid);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid 2", test_gengrid2);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Group", test_gengrid3);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Show/Bring_in", test_gengrid4);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Item Search by Text", test_gengrid5);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Item Styles", test_gengrid_item_styles);
+ ADD_TEST(NULL, "Lists - Gengrid", "Gengrid Update Speed", test_gengrid_speed);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Focus", test_gengrid_focus);
+ ADD_TEST(NULL, "Lists - Gengrid", "GenGrid Update", test_gengrid_update);
+
+ //------------------------------//
+ ADD_TEST(NULL,