| 41 | === Example of use === |
| 42 | |
| 43 | {{{ |
| 44 | int main(int argc, char *argv[]) |
| 45 | { |
| 46 | char *theme = NULL; |
| 47 | char *themePath = NULL; |
| 48 | char *tmp; |
| 49 | char path[PATH_MAX]; |
| 50 | (...) |
| 51 | themePath = findThemePath(theme); |
| 52 | if (!themePath) |
| 53 | return quit(EINA_FALSE, "ERROR: could not find theme.\n"); |
| 54 | ewk_init(); |
| 55 | tmp = getenv("TMPDIR"); |
| 56 | if (!tmp) |
| 57 | tmp = "/tmp"; |
| 58 | snprintf(path, sizeof(path), "%s/.ewebkit-%u", tmp, getuid()); |
| 59 | if (!ecore_file_mkpath(path)) |
| 60 | return quit(EINA_FALSE, "ERROR: could not create settings database directory.\n"); |
| 61 | |
| 62 | ewk_settings_repaint_throttling_set( 0.1, 2, 10, 1 )//for heavy level |
| 63 | if (ewk_settings_icon_database_path_set(path)==EINA_FALSE) |
| 64 | return quit(EINA_FALSE, "ERROR: Icon database already open.\n"); |
| 65 | ewk_settings_web_database_path_set(path); |
| 66 | browserCreate(url, themePath, userAgent, geometry, engine, backingStore, isFlattening, isFullscreen, path); |
| 67 | ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows); |
| 68 | ecore_main_loop_begin(); |
| 69 | ewk_shutdown(); |
| 70 | return quit(EINA_TRUE, NULL); |
| 71 | } |
| 72 | }}} |
| 73 | |
| 74 | Example is based on the Tools/EWebLauncher/main.c. Api elements which were used: |
| 75 | [[BR]] |
| 76 | '''ewk_settings_repaint_throttling_set()'''– sets value for the repaint throttling,it gives possibility of setting slow loading of page in case of having a content with css/gif animationts, in example arguments are adjusted to heavy level, for lighter level the arguments are proportionally fewer |
| 77 | [[BR]] |
| 78 | '''ewk_settings_icon_database_path_set()''' – sets current path to the icon database |
| 79 | [[BR]] |
| 80 | '''ewk_settings_web_database_path_set()''' – sets current path to the Web database |
| 81 | |
| 82 | |