diff --git a/legacy/elementary/Makefile.am b/legacy/elementary/Makefile.am index 70ac6e1c8c..01507a823f 100644 --- a/legacy/elementary/Makefile.am +++ b/legacy/elementary/Makefile.am @@ -6,8 +6,8 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \ config.h.in config.sub configure install-sh \ ltconfig ltmain.sh missing mkinstalldirs \ stamp-h.in acconfig.h depcomp - -EXTRA_DIST = README AUTHORS COPYING autogen.sh elementary.pc.in + +EXTRA_DIST = README AUTHORS COPYING autogen.sh elementary.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = elementary.pc @@ -20,4 +20,3 @@ installed_headers_DATA = elementary_config.h doc: @echo "entering doc/" $(MAKE) -C doc doc - diff --git a/legacy/elementary/configure.ac b/legacy/elementary/configure.ac index 137e402928..048087e52c 100644 --- a/legacy/elementary/configure.ac +++ b/legacy/elementary/configure.ac @@ -44,7 +44,7 @@ case "$host_os" in ;; esac AC_SUBST(release_info) - + requirement_elm="" PKG_PROG_PKG_CONFIG @@ -83,15 +83,15 @@ dnl managed by evil ELM_UNIX_DEF="#define" AC_CHECK_FUNCS(dlopen, res=yes, res=no) if test "x$res" = "xyes"; then - AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR)) + AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR)) else - AC_CHECK_LIB(dl, dlopen, res=yes, res=no) - if test "x$res" = "xyes"; then - AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR)) - dlopen_libs=-ldl - else - AC_MSG_ERROR(Cannot find dlopen) - fi + AC_CHECK_LIB(dl, dlopen, res=yes, res=no) + if test "x$res" = "xyes"; then + AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR)) + dlopen_libs=-ldl + else + AC_MSG_ERROR(Cannot find dlopen) + fi fi have_socket="yes" ;; diff --git a/legacy/elementary/src/bin/quicklaunch.c b/legacy/elementary/src/bin/quicklaunch.c index c29f5e4424..434335ae55 100644 --- a/legacy/elementary/src/bin/quicklaunch.c +++ b/legacy/elementary/src/bin/quicklaunch.c @@ -53,7 +53,7 @@ child_handler(int x, siginfo_t *info, void *data) { int status; pid_t pid; - + while ((pid = waitpid(-1, &status, WNOHANG)) > 0); } @@ -61,13 +61,13 @@ static void crash_handler(int x, siginfo_t *info, void *data) { double t; - + EINA_ERROR_PERR("elementary_quicklaunch: crash detected. restarting.\n"); t = ecore_time_get(); if ((t - restart_time) <= 2.0) { - EINA_ERROR_PERR("elementary_quicklaunch: crash too fast - less than 2 seconds. abort restart\n"); - exit(-1); + EINA_ERROR_PERR("elementary_quicklaunch: crash too fast - less than 2 seconds. abort restart\n"); + exit(-1); } ecore_app_restart(); } @@ -80,12 +80,12 @@ handle_run(int fd, unsigned long bytes) char **argv = NULL; char *cwd; int argc; - + buf = alloca(bytes); if ((num = read(fd, buf, bytes)) < 0) { - close(fd); - return; + close(fd); + return; } close(fd); argc = ((unsigned long *)(buf))[0]; @@ -101,16 +101,16 @@ int main(int argc, char **argv) { int sock, socket_unix_len; - struct stat st; + struct stat st; struct sockaddr_un socket_unix; struct linger lin; char buf[PATH_MAX]; struct sigaction action; - + if (!getenv("DISPLAY")) { - EINA_ERROR_PERR("elementary_quicklaunch: DISPLAY env var not set\n"); - exit(-1); + EINA_ERROR_PERR("elementary_quicklaunch: DISPLAY env var not set\n"); + exit(-1); } snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid()); if (stat(buf, &st) < 0) mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR); @@ -119,37 +119,37 @@ main(int argc, char **argv) sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { - perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)"); - EINA_ERROR_PERR("elementary_quicklaunch: cannot create socket for socket for '%s'\n", buf); - exit(-1); + perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)"); + EINA_ERROR_PERR("elementary_quicklaunch: cannot create socket for socket for '%s'\n", buf); + exit(-1); } if (fcntl(sock, F_SETFD, FD_CLOEXEC) < 0) { - perror("elementary_quicklaunch: fcntl(sock, F_SETFD, FD_CLOEXEC)"); - EINA_ERROR_PERR("elementary_quicklaunch: cannot set close on exec socket for '%s'\n", buf); - exit(-1); + perror("elementary_quicklaunch: fcntl(sock, F_SETFD, FD_CLOEXEC)"); + EINA_ERROR_PERR("elementary_quicklaunch: cannot set close on exec socket for '%s'\n", buf); + exit(-1); } lin.l_onoff = 1; lin.l_linger = 0; if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) < 0) { - perror("elementary_quicklaunch: setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) "); - EINA_ERROR_PERR("elementary_quicklaunch: cannot set linger for socket for '%s'\n", buf); - exit(-1); + perror("elementary_quicklaunch: setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) "); + EINA_ERROR_PERR("elementary_quicklaunch: cannot set linger for socket for '%s'\n", buf); + 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) { - perror("elementary_quicklaunch: bind(sock, (struct sockaddr *)&socket_unix, socket_unix_len)"); - EINA_ERROR_PERR("elementary_quicklaunch: cannot bind socket for '%s'\n", buf); - exit(-1); + perror("elementary_quicklaunch: bind(sock, (struct sockaddr *)&socket_unix, socket_unix_len)"); + EINA_ERROR_PERR("elementary_quicklaunch: cannot bind socket for '%s'\n", buf); + exit(-1); } if (listen(sock, 4096) < 0) { - perror("elementary_quicklaunch: listen(sock, 4096)"); - exit(-1); + perror("elementary_quicklaunch: listen(sock, 4096)"); + exit(-1); } elm_quicklaunch_init(argc, argv); restart_time = ecore_time_get(); @@ -160,43 +160,43 @@ main(int argc, char **argv) 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; @@ -208,55 +208,55 @@ main(int argc, char **argv) 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; + int fd; + struct sockaddr_un client; + socklen_t len; - elm_quicklaunch_sub_init(argc, argv); - elm_quicklaunch_seed(); - len = sizeof(struct sockaddr_un); - fd = accept(sock, (struct sockaddr *)&client, &len); - if (fd >= 0) - { - int bytes; - char line[4096]; - int num; - - num = read(fd, &bytes, sizeof(unsigned long)); - if (num == sizeof(unsigned long)) - { - ecore_app_args_set(argc, (const char **)argv); - handle_run(fd, bytes); - } - } - elm_quicklaunch_sub_shutdown(); + elm_quicklaunch_sub_init(argc, argv); + elm_quicklaunch_seed(); + len = sizeof(struct sockaddr_un); + fd = accept(sock, (struct sockaddr *)&client, &len); + if (fd >= 0) + { + int bytes; + char line[4096]; + int num; + + num = read(fd, &bytes, sizeof(unsigned long)); + if (num == sizeof(unsigned long)) + { + ecore_app_args_set(argc, (const char **)argv); + handle_run(fd, bytes); + } + } + elm_quicklaunch_sub_shutdown(); } elm_quicklaunch_shutdown(); return 0; diff --git a/legacy/elementary/src/bin/run.c b/legacy/elementary/src/bin/run.c index 28624475f6..8941665d8d 100644 --- a/legacy/elementary/src/bin/run.c +++ b/legacy/elementary/src/bin/run.c @@ -27,119 +27,119 @@ main(int argc, char **argv) int we_are_elementary_run = 0; char *disp; char *cwd; - + int sargc, slen; 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); + fprintf(stderr, "elementary_quicklaunch: currect working dir too big.\n"); + exit(-1); } cwd = strdup(buf); if (!(disp = getenv("DISPLAY"))) { - fprintf(stderr, "elementary_quicklaunch: DISPLAY env var not set\n"); - exit(-1); + fprintf(stderr, "elementary_quicklaunch: DISPLAY env var not set\n"); + exit(-1); } 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); + 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_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); + 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] == '/')))) + ((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, *s; - int exelen; - - p = path; - pp = p; - exe = NULL; - for (;;) - { - if ((*p == ':') || (*p == 0)) - { - 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) == 0) - { - exe = buf; - break; - } - if (*p == 0) break; - p++; - pp = p; - } - } - else - { - if (*p == 0) break; - p++; - } - } - } + char *path = getenv("PATH"); + int exelen = strlen(argv[0]); + if (path) + { + const char *p, *pp, *s; + int exelen; + + p = path; + pp = p; + exe = NULL; + for (;;) + { + if ((*p == ':') || (*p == 0)) + { + 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) == 0) + { + exe = buf; + break; + } + if (*p == 0) break; + p++; + pp = p; + } + } + else + { + if (*p == 0) break; + p++; + } + } + } } if (exe) { - if (lstat(exe, &st) == 0) - { - 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 (lstat(exe, &st) == 0) + { + 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; + sargc = argc; + sargv = argv; } else { - sargc = argc - 1; - sargv = &(argv[1]); + sargc = argc - 1; + sargv = &(argv[1]); } slen = sizeof(unsigned long) + sizeof(unsigned long); for (i = 0; i < sargc; i++) { - slen += sizeof(unsigned long); - slen += strlen(sargv[i]) + 1; + slen += sizeof(unsigned long); + slen += strlen(sargv[i]) + 1; } slen += strlen(cwd) + 1; sbuf = alloca(slen); @@ -148,10 +148,10 @@ main(int argc, char **argv) pos = (unsigned char *)(&((((unsigned long *)(sbuf))[2 + sargc]))); for (i = 0; i < sargc; i++) { - ((unsigned long *)(sbuf))[2 + i] = - (unsigned long)pos - ((unsigned long)sbuf + sizeof(unsigned long)); - strcpy(pos, sargv[i]); - pos += strlen(sargv[i]) + 1; + ((unsigned long *)(sbuf))[2 + i] = + (unsigned long)pos - ((unsigned long)sbuf + sizeof(unsigned long)); + strcpy(pos, sargv[i]); + pos += strlen(sargv[i]) + 1; } strcpy(pos, cwd); write(sock, sbuf, slen); diff --git a/legacy/elementary/src/bin/test.c b/legacy/elementary/src/bin/test.c index 62f545d5ac..9d07a08f47 100644 --- a/legacy/elementary/src/bin/test.c +++ b/legacy/elementary/src/bin/test.c @@ -15,7 +15,7 @@ static void my_bt_1(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg; - + win = elm_win_add(NULL, "bg-plain", ELM_WIN_BASIC); elm_win_title_set(win, "Bg Plain"); elm_win_autodel_set(win, 1); @@ -25,7 +25,7 @@ my_bt_1(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); evas_object_show(bg); - + /* set size hints. a minimum size for the bg. this should propagate back * to the window thus limiting its size based off the bg as the bg is one * of the window's resize objects. */ @@ -46,7 +46,7 @@ my_bt_2(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "bg-image", ELM_WIN_BASIC); elm_win_title_set(win, "Bg Image"); elm_win_autodel_set(win, 1); @@ -57,7 +57,7 @@ my_bt_2(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); evas_object_show(bg); - + evas_object_size_hint_min_set(bg, 160, 160); evas_object_size_hint_max_set(bg, 640, 640); evas_object_resize(win, 320, 320); @@ -69,7 +69,7 @@ my_bt_3(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "icon-transparent", ELM_WIN_BASIC); elm_win_title_set(win, "Icon Transparent"); elm_win_autodel_set(win, 1); @@ -81,7 +81,7 @@ my_bt_3(void *data, Evas_Object *obj, void *event_info) elm_icon_scale_set(ic, 0, 0); elm_win_resize_object_add(win, ic); evas_object_show(ic); - + evas_object_show(win); } @@ -90,7 +90,7 @@ my_bt_4(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "box-vert", ELM_WIN_BASIC); elm_win_title_set(win, "Box Vert"); elm_win_autodel_set(win, 1); @@ -99,7 +99,7 @@ my_bt_4(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); elm_win_resize_object_add(win, bx); evas_object_size_hint_weight_set(bx, 1.0, 1.0); @@ -112,7 +112,7 @@ my_bt_4(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.5); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -120,7 +120,7 @@ my_bt_4(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.0, 0.5); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -128,7 +128,7 @@ my_bt_4(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 1.0, 0.5); elm_box_pack_end(bx, ic); evas_object_show(ic); - + evas_object_show(win); } @@ -137,7 +137,7 @@ my_bt_5(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "box-horiz", ELM_WIN_BASIC); elm_win_title_set(win, "Box Horiz"); elm_win_autodel_set(win, 1); @@ -146,7 +146,7 @@ my_bt_5(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); elm_box_horizontal_set(bx, 1); elm_win_resize_object_add(win, bx); @@ -160,7 +160,7 @@ my_bt_5(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.5); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -168,7 +168,7 @@ my_bt_5(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.0); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -176,7 +176,7 @@ my_bt_5(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.0, 1.0); elm_box_pack_end(bx, ic); evas_object_show(ic); - + evas_object_show(win); } @@ -185,7 +185,7 @@ my_bt_6(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ic, *bt; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "buttons", ELM_WIN_BASIC); elm_win_title_set(win, "Buttons"); elm_win_autodel_set(win, 1); @@ -194,7 +194,7 @@ my_bt_6(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -210,7 +210,7 @@ my_bt_6(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -221,12 +221,12 @@ my_bt_6(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); - + bt = elm_button_add(win); elm_button_label_set(bt, "Label Only"); elm_box_pack_end(bx, bt); evas_object_show(bt); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -236,7 +236,7 @@ my_bt_6(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, bt); evas_object_show(bt); evas_object_show(ic); - + evas_object_show(win); } @@ -245,7 +245,7 @@ my_bt_7(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ic, *tg; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "toggles", ELM_WIN_BASIC); elm_win_title_set(win, "Toggles"); elm_win_autodel_set(win, 1); @@ -254,7 +254,7 @@ my_bt_7(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -274,7 +274,7 @@ my_bt_7(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, tg); evas_object_show(tg); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -301,7 +301,7 @@ my_bt_7(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, tg); evas_object_show(tg); evas_object_show(ic); - + evas_object_show(win); } @@ -309,7 +309,7 @@ static void my_bt_8(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *tb, *bt; - + win = elm_win_add(NULL, "table", ELM_WIN_BASIC); elm_win_title_set(win, "Table"); elm_win_autodel_set(win, 1); @@ -318,54 +318,54 @@ my_bt_8(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bg, 1.0, 1.0); elm_win_resize_object_add(win, bg); evas_object_show(bg); - + tb = elm_table_add(win); elm_win_resize_object_add(win, tb); evas_object_size_hint_weight_set(tb, 1.0, 1.0); evas_object_show(tb); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 1"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 0, 0, 1, 1); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 2"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 1, 0, 1, 1); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 3"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 2, 0, 1, 1); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 4"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 0, 1, 2, 1); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 5"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 2, 1, 1, 3); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 6"); evas_object_size_hint_weight_set(bt, 1.0, 1.0); evas_object_size_hint_align_set(bt, -1.0, -1.0); elm_table_pack(tb, bt, 0, 2, 2, 2); evas_object_show(bt); - + evas_object_show(win); } @@ -373,7 +373,7 @@ static void my_bt_9(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ck; - + win = elm_win_add(NULL, "clock", ELM_WIN_BASIC); elm_win_title_set(win, "Clock"); elm_win_autodel_set(win, 1); @@ -382,7 +382,7 @@ my_bt_9(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -391,23 +391,23 @@ my_bt_9(void *data, Evas_Object *obj, void *event_info) ck = elm_clock_add(win); elm_box_pack_end(bx, ck); evas_object_show(ck); - + ck = elm_clock_add(win); elm_clock_show_am_pm_set(ck, 1); elm_box_pack_end(bx, ck); evas_object_show(ck); - + ck = elm_clock_add(win); elm_clock_show_seconds_set(ck, 1); elm_box_pack_end(bx, ck); evas_object_show(ck); - + ck = elm_clock_add(win); elm_clock_show_seconds_set(ck, 1); elm_clock_show_am_pm_set(ck, 1); elm_box_pack_end(bx, ck); evas_object_show(ck); - + ck = elm_clock_add(win); elm_clock_edit_set(ck, 1); elm_clock_show_seconds_set(ck, 1); @@ -415,7 +415,7 @@ my_bt_9(void *data, Evas_Object *obj, void *event_info) elm_clock_time_set(ck, 10, 11, 12); elm_box_pack_end(bx, ck); evas_object_show(ck); - + evas_object_show(win); } @@ -424,7 +424,7 @@ my_bt_10(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *ly, *bt; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "layout", ELM_WIN_BASIC); elm_win_title_set(win, "Layout"); elm_win_autodel_set(win, 1); @@ -433,29 +433,29 @@ my_bt_10(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + ly = elm_layout_add(win); snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR); elm_layout_file_set(ly, buf, "layout"); evas_object_size_hint_weight_set(ly, 1.0, 1.0); elm_win_resize_object_add(win, ly); evas_object_show(ly); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 1"); elm_layout_content_set(ly, "element1", bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 2"); elm_layout_content_set(ly, "element2", bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button 3"); elm_layout_content_set(ly, "element3", bt); evas_object_show(bt); - + evas_object_show(win); } @@ -463,7 +463,7 @@ static void my_hover_bt_1(void *data, Evas_Object *obj, void *event_info) { Evas_Object *hv = data; - + evas_object_show(hv); } @@ -472,7 +472,7 @@ my_bt_11(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bt, *hv, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "hover", ELM_WIN_BASIC); elm_win_title_set(win, "Hover"); elm_win_autodel_set(win, 1); @@ -481,14 +481,14 @@ my_bt_11(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); evas_object_show(bx); hv = elm_hover_add(win); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button"); evas_object_smart_callback_add(bt, "clicked", my_hover_bt_1, hv); @@ -503,7 +503,7 @@ my_bt_11(void *data, Evas_Object *obj, void *event_info) evas_object_show(bt); bx = elm_box_add(win); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -531,12 +531,12 @@ my_bt_11(void *data, Evas_Object *obj, void *event_info) elm_button_label_set(bt, "Bottom"); elm_hover_content_set(hv, "bottom", bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Left"); elm_hover_content_set(hv, "left", bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Right"); elm_hover_content_set(hv, "right", bt); @@ -553,7 +553,7 @@ my_bt_12(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bt, *hv, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "hover2", ELM_WIN_BASIC); elm_win_title_set(win, "Hover 2"); elm_win_autodel_set(win, 1); @@ -562,7 +562,7 @@ my_bt_12(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -570,7 +570,7 @@ my_bt_12(void *data, Evas_Object *obj, void *event_info) hv = elm_hover_add(win); elm_object_style_set(hv, "popout"); - + bt = elm_button_add(win); elm_button_label_set(bt, "Button"); evas_object_smart_callback_add(bt, "clicked", my_hover_bt_1, hv); @@ -578,14 +578,14 @@ my_bt_12(void *data, Evas_Object *obj, void *event_info) evas_object_show(bt); elm_hover_parent_set(hv, win); elm_hover_target_set(hv, bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Popup"); elm_hover_content_set(hv, "middle", bt); evas_object_show(bt); bx = elm_box_add(win); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -611,17 +611,17 @@ my_bt_12(void *data, Evas_Object *obj, void *event_info) elm_button_label_set(bt, "Bot"); elm_hover_content_set(hv, "bottom", bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Left"); elm_hover_content_set(hv, "left", bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Right"); elm_hover_content_set(hv, "right", bt); evas_object_show(bt); - + evas_object_size_hint_min_set(bg, 160, 160); evas_object_size_hint_max_set(bg, 640, 640); evas_object_resize(win, 320, 320); @@ -665,7 +665,7 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bx2, *bt, *en; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "entry", ELM_WIN_BASIC); elm_win_title_set(win, "Entry"); elm_win_autodel_set(win, 1); @@ -674,7 +674,7 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -699,7 +699,7 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info) elm_box_horizontal_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "Clear"); evas_object_smart_callback_add(bt, "clicked", my_entry_bt_1, en); @@ -715,7 +715,7 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Selection"); evas_object_smart_callback_add(bt, "clicked", my_entry_bt_3, en); @@ -723,7 +723,7 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Insert"); evas_object_smart_callback_add(bt, "clicked", my_entry_bt_4, en); @@ -731,7 +731,7 @@ my_bt_13(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -744,7 +744,7 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bx2, *bt, *en, *sc; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "entry-scrolled", ELM_WIN_BASIC); elm_win_title_set(win, "Entry Scrolled"); elm_win_autodel_set(win, 1); @@ -753,7 +753,7 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -765,7 +765,7 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(sc, 1.0, 0.0); evas_object_size_hint_align_set(sc, -1.0, -1.0); elm_box_pack_end(bx, sc); - + en = elm_entry_add(win); elm_entry_single_line_set(en, 1); elm_entry_entry_set(en, "This is a single line"); @@ -776,14 +776,14 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_show(en); evas_object_show(sc); - + sc = elm_scroller_add(win); elm_scroller_content_min_limit(sc, 0, 1); elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); evas_object_size_hint_weight_set(sc, 1.0, 0.0); evas_object_size_hint_align_set(sc, -1.0, -1.0); elm_box_pack_end(bx, sc); - + en = elm_entry_add(win); elm_entry_password_set(en, 1); elm_entry_entry_set(en, "Password here"); @@ -793,13 +793,13 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_show(en); evas_object_show(sc); - + sc = elm_scroller_add(win); evas_object_size_hint_weight_set(sc, 1.0, 1.0); evas_object_size_hint_align_set(sc, -1.0, -1.0); elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON); elm_box_pack_end(bx, sc); - + en = elm_entry_add(win); elm_entry_entry_set(en, "This is an entry widget in this window that
" @@ -815,12 +815,12 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_show(en); evas_object_show(sc); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "Clear"); evas_object_smart_callback_add(bt, "clicked", my_entry_bt_1, en); @@ -836,7 +836,7 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Selection"); evas_object_smart_callback_add(bt, "clicked", my_entry_bt_3, en); @@ -844,7 +844,7 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Insert"); evas_object_smart_callback_add(bt, "clicked", my_entry_bt_4, en); @@ -852,12 +852,12 @@ my_bt_14(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); evas_object_resize(win, 320, 300); - + elm_object_focus(win); evas_object_show(win); } @@ -885,7 +885,7 @@ my_bt_15(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bx2, *bt, *ic, *np; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "notepad", ELM_WIN_BASIC); elm_win_title_set(win, "Notepad"); elm_win_autodel_set(win, 1); @@ -894,7 +894,7 @@ my_bt_15(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -906,13 +906,13 @@ my_bt_15(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(np, -1.0, -1.0); elm_box_pack_end(bx, np); evas_object_show(np); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); ic = elm_icon_add(win); elm_icon_standard_set(ic, "arrow_left"); @@ -924,7 +924,7 @@ my_bt_15(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); ic = elm_icon_add(win); elm_icon_standard_set(ic, "close"); @@ -936,7 +936,7 @@ my_bt_15(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); ic = elm_icon_add(win); elm_icon_standard_set(ic, "arrow_right"); @@ -948,12 +948,12 @@ my_bt_15(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); evas_object_resize(win, 320, 300); - + elm_object_focus(win); evas_object_show(win); } @@ -971,7 +971,7 @@ my_anchorview_anchor(void *data, Evas_Object *obj, void *event_info) Evas_Object *av = data; Elm_Entry_Anchorview_Info *ei = event_info; Evas_Object *bt, *bx; - + bt = elm_button_add(obj); elm_button_label_set(bt, ei->name); elm_hover_content_set(ei->hover, "middle", bt); @@ -1030,7 +1030,7 @@ my_bt_16(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *av; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "anchorview", ELM_WIN_BASIC); elm_win_title_set(win, "Anchorview"); elm_win_autodel_set(win, 1); @@ -1039,7 +1039,7 @@ my_bt_16(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + av = elm_anchorview_add(win); elm_anchorview_hover_style_set(av, "popout"); elm_anchorview_hover_parent_set(av, win); @@ -1057,7 +1057,7 @@ my_bt_16(void *data, Evas_Object *obj, void *event_info) evas_object_show(av); evas_object_resize(win, 320, 300); - + elm_object_focus(win); evas_object_show(win); } @@ -1075,7 +1075,7 @@ my_anchorblock_anchor(void *data, Evas_Object *obj, void *event_info) Evas_Object *av = data; Elm_Entry_Anchorblock_Info *ei = event_info; Evas_Object *bt, *bx; - + bt = elm_button_add(obj); elm_button_label_set(bt, ei->name); elm_hover_content_set(ei->hover, "middle", bt); @@ -1157,7 +1157,7 @@ static void my_anchorblock_scroll(void *data, Evas_Object *obj, void *event_info) { Evas_Coord x, y, w, h, vw, vh; - + elm_scroller_region_get(obj, &x, &y, &w, &h); elm_scroller_child_size_get(obj, &vw, &vh); printf("scroll %ix%i +%i+%i in %ix%i\n", w, h, x, y, vw, vh); @@ -1168,7 +1168,7 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *av, *sc, *bx, *bb, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "anchorblock", ELM_WIN_BASIC); elm_win_title_set(win, "Anchorblock"); elm_win_autodel_set(win, 1); @@ -1177,11 +1177,11 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + sc = elm_scroller_add(win); evas_object_size_hint_weight_set(sc, 1.0, 1.0); elm_win_resize_object_add(win, sc); - + evas_object_smart_callback_add(sc, "edge_left", my_anchorblock_edge_left, NULL); evas_object_smart_callback_add(sc, "edge_right", my_anchorblock_edge_right, NULL); evas_object_smart_callback_add(sc, "edge_top", my_anchorblock_edge_top, NULL); @@ -1193,13 +1193,13 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(bx, -1.0, -1.0); elm_scroller_content_set(sc, bx); evas_object_show(bx); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 0, 0); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - + bb = elm_bubble_add(win); elm_bubble_label_set(bb, "Message 3"); elm_bubble_info_set(bb, "10:32 4/11/2008"); @@ -1219,12 +1219,12 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) evas_object_show(av); elm_box_pack_end(bx, bb); evas_object_show(bb); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - + bb = elm_bubble_add(win); elm_bubble_label_set(bb, "Message 2"); elm_bubble_info_set(bb, "7:16 27/10/2008"); @@ -1254,13 +1254,13 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) evas_object_show(av); elm_box_pack_end(bx, bb); evas_object_show(bb); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_icon_scale_set(ic, 0, 0); evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - + bb = elm_bubble_add(win); elm_bubble_label_set(bb, "Message 1"); elm_bubble_info_set(bb, "20:47 18/6/2008"); @@ -1278,11 +1278,11 @@ my_bt_17(void *data, Evas_Object *obj, void *event_info) evas_object_show(av); elm_box_pack_end(bx, bb); evas_object_show(bb); - + evas_object_show(sc); evas_object_resize(win, 320, 300); - + elm_object_focus(win); evas_object_show(win); } @@ -1331,7 +1331,7 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) Evas_Object *win, *bg, *bx, *tb, *ic, *ph; Evas_Object *ph1, *ph2, *ph3, *ph4; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "toolbar", ELM_WIN_BASIC); elm_win_title_set(win, "Toolbar"); elm_win_autodel_set(win, 1); @@ -1340,7 +1340,7 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); elm_win_resize_object_add(win, bx); evas_object_size_hint_weight_set(bx, 1.0, 1.0); @@ -1354,32 +1354,32 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) ph2 = elm_photo_add(win); ph3 = elm_photo_add(win); ph4 = elm_photo_add(win); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_toolbar_item_add(tb, ic, "Hello", tb_1, ph1); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_toolbar_item_add(tb, ic, "World", tb_2, ph1); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_toolbar_item_add(tb, ic, "Here", tb_3, ph4); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_toolbar_item_add(tb, ic, "Comes", tb_4, ph4); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); elm_toolbar_item_add(tb, ic, "Elementary", tb_5, ph4); - + elm_box_pack_end(bx, tb); evas_object_show(tb); @@ -1387,7 +1387,7 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) // elm_table_homogenous_set(tb, 1); evas_object_size_hint_weight_set(tb, 0.0, 1.0); evas_object_size_hint_align_set(tb, -1.0, -1.0); - + ph = ph1; elm_photo_size_set(ph, 40); snprintf(buf, sizeof(buf), "%s/images/plant_01.jpg", PACKAGE_DATA_DIR); @@ -1396,14 +1396,14 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ph, 0.5, 0.5); elm_table_pack(tb, ph, 0, 0, 1, 1); evas_object_show(ph); - + ph = ph2; elm_photo_size_set(ph, 80); evas_object_size_hint_weight_set(ph, 1.0, 1.0); evas_object_size_hint_align_set(ph, 0.5, 0.5); elm_table_pack(tb, ph, 1, 0, 1, 1); evas_object_show(ph); - + ph = ph3; elm_photo_size_set(ph, 20); snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); @@ -1412,7 +1412,7 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ph, 0.5, 0.5); elm_table_pack(tb, ph, 0, 1, 1, 1); evas_object_show(ph); - + ph = ph4; elm_photo_size_set(ph, 60); snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); @@ -1421,12 +1421,12 @@ my_bt_18(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ph, 0.5, 0.5); elm_table_pack(tb, ph, 1, 1, 1, 1); evas_object_show(ph); - + elm_box_pack_end(bx, tb); evas_object_show(tb); - + evas_object_resize(win, 320, 300); - + evas_object_show(win); } @@ -1435,7 +1435,7 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bt, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "hoversel", ELM_WIN_BASIC); elm_win_title_set(win, "Hoversel"); elm_win_autodel_set(win, 1); @@ -1461,7 +1461,7 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(bt, 0.5, 0.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_hoversel_add(win); elm_hoversel_hover_parent_set(bt, win); elm_hoversel_label_set(bt, "Some Icons"); @@ -1473,7 +1473,7 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(bt, 0.5, 0.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_hoversel_add(win); elm_hoversel_hover_parent_set(bt, win); elm_hoversel_label_set(bt, "All Icons"); @@ -1485,7 +1485,7 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(bt, 0.5, 0.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_hoversel_add(win); elm_hoversel_hover_parent_set(bt, win); elm_hoversel_label_set(bt, "All Icons"); @@ -1498,7 +1498,7 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(bt, 0.5, 0.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_hoversel_add(win); elm_hoversel_hover_parent_set(bt, win); elm_hoversel_label_set(bt, "Icon + Label"); @@ -1508,7 +1508,7 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) elm_icon_file_set(ic, buf, NULL); elm_hoversel_icon_set(bt, ic); evas_object_show(ic); - + elm_hoversel_item_add(bt, "Item 1", "apps", ELM_ICON_STANDARD, NULL, NULL); elm_hoversel_item_add(bt, "Item 2", "arrow_down", ELM_ICON_STANDARD, NULL, NULL); elm_hoversel_item_add(bt, "Item 3", "home", ELM_ICON_STANDARD, NULL, NULL); @@ -1517,9 +1517,9 @@ my_bt_19(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(bt, 0.5, 0.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + evas_object_resize(win, 320, 300); - + evas_object_show(win); } @@ -1528,7 +1528,7 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *li, *ic, *ic2, *bx; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "list", ELM_WIN_BASIC); elm_win_title_set(win, "List"); elm_win_autodel_set(win, 1); @@ -1556,7 +1556,7 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) elm_icon_standard_set(ic, "edit"); elm_icon_scale_set(ic, 0, 0); elm_list_item_append(li, ".", ic, NULL, NULL, NULL); - + ic = elm_icon_add(win); elm_icon_standard_set(ic, "delete"); elm_icon_scale_set(ic, 0, 0); @@ -1564,7 +1564,7 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) elm_icon_standard_set(ic2, "clock"); elm_icon_scale_set(ic2, 0, 0); elm_list_item_append(li, "How", ic, ic2, NULL, NULL); - + bx = elm_box_add(win); elm_box_horizontal_set(bx, 1); @@ -1575,7 +1575,7 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.5); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -1583,7 +1583,7 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.0); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -1592,7 +1592,7 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, ic); evas_object_show(ic); elm_list_item_append(li, "are", bx, NULL, NULL, NULL); - + elm_list_item_append(li, "you", NULL, NULL, NULL, NULL); elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); elm_list_item_append(li, "out", NULL, NULL, NULL, NULL); @@ -1608,9 +1608,9 @@ my_bt_20(void *data, Evas_Object *obj, void *event_info) elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL); elm_list_go(li); - + evas_object_show(li); - + evas_object_resize(win, 320, 300); evas_object_show(win); } @@ -1635,7 +1635,7 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) Evas_Object *win, *bg, *li, *ic, *ic2, *bx, *bx2, *bt; char buf[PATH_MAX]; Elm_List_Item *it; - + win = elm_win_add(NULL, "list-2", ELM_WIN_BASIC); elm_win_title_set(win, "List 2"); elm_win_autodel_set(win, 1); @@ -1672,7 +1672,7 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) elm_icon_standard_set(ic, "edit"); elm_icon_scale_set(ic, 0, 0); elm_list_item_append(li, ".", ic, NULL, NULL, NULL); - + ic = elm_icon_add(win); elm_icon_standard_set(ic, "delete"); elm_icon_scale_set(ic, 0, 0); @@ -1680,7 +1680,7 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) elm_icon_standard_set(ic2, "clock"); elm_icon_scale_set(ic2, 0, 0); elm_list_item_append(li, "How", ic, ic2, NULL, NULL); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); @@ -1691,7 +1691,7 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.5); elm_box_pack_end(bx2, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -1700,7 +1700,7 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx2, ic); evas_object_show(ic); elm_list_item_append(li, "are", bx2, NULL, NULL, NULL); - + elm_list_item_append(li, "you", NULL, NULL, NULL, NULL); elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); elm_list_item_append(li, "out", NULL, NULL, NULL, NULL); @@ -1715,16 +1715,16 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) elm_list_item_append(li, "Longer label.", NULL, NULL, NULL, NULL); elm_list_go(li); - + elm_box_pack_end(bx, li); evas_object_show(li); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "Clear"); evas_object_smart_callback_add(bt, "clicked", my_li2_clear, li); @@ -1732,7 +1732,7 @@ my_bt_21(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -1745,7 +1745,7 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *li, *ic, *ic2, *bx; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "list-3", ELM_WIN_BASIC); elm_win_title_set(win, "List 3"); elm_win_autodel_set(win, 1); @@ -1773,7 +1773,7 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) elm_icon_standard_set(ic, "edit"); elm_icon_scale_set(ic, 0, 0); elm_list_item_append(li, ".", ic, NULL, NULL, NULL); - + ic = elm_icon_add(win); elm_icon_standard_set(ic, "delete"); elm_icon_scale_set(ic, 0, 0); @@ -1781,7 +1781,7 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) elm_icon_standard_set(ic2, "clock"); elm_icon_scale_set(ic2, 0, 0); elm_list_item_append(li, "How", ic, ic2, NULL, NULL); - + bx = elm_box_add(win); elm_box_horizontal_set(bx, 1); @@ -1792,7 +1792,7 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.5); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -1800,7 +1800,7 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_align_set(ic, 0.5, 0.0); elm_box_pack_end(bx, ic); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -1809,7 +1809,7 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, ic); evas_object_show(ic); elm_list_item_append(li, "are", bx, NULL, NULL, NULL); - + elm_list_item_append(li, "you", NULL, NULL, NULL, NULL); elm_list_item_append(li, "doing", NULL, NULL, NULL, NULL); elm_list_item_append(li, "out", NULL, NULL, NULL, NULL); @@ -1825,9 +1825,9 @@ my_bt_22(void *data, Evas_Object *obj, void *event_info) elm_list_item_append(li, "Maybe this one is even longer so we can test long long items.", NULL, NULL, NULL, NULL); elm_list_go(li); - + evas_object_show(li); - + evas_object_resize(win, 320, 300); evas_object_show(win); } @@ -1837,7 +1837,7 @@ my_bt_23(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "carousel", ELM_WIN_BASIC); elm_win_title_set(win, "Carousel"); elm_win_autodel_set(win, 1); @@ -1846,7 +1846,7 @@ my_bt_23(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + evas_object_resize(win, 320, 240); evas_object_show(win); } @@ -1856,7 +1856,7 @@ my_bt_24(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *inwin, *lb; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "inwin", ELM_WIN_BASIC); elm_win_title_set(win, "Inwin"); elm_win_autodel_set(win, 1); @@ -1865,20 +1865,20 @@ my_bt_24(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + inwin = elm_win_inwin_add(win); evas_object_show(inwin); - + lb = elm_label_add(win); elm_label_label_set(lb, - "This is an \"inwin\" - a window in a
" - "window. This is handy for quick popups
" - "you want centered, taking over the window
" - "until dismissed somehow. Unlike hovers they
" - "don't hover over their target."); + "This is an \"inwin\" - a window in a
" + "window. This is handy for quick popups
" + "you want centered, taking over the window
" + "until dismissed somehow. Unlike hovers they
" + "don't hover over their target."); elm_win_inwin_content_set(inwin, lb); evas_object_show(lb); - + evas_object_resize(win, 320, 240); evas_object_show(win); } @@ -1888,7 +1888,7 @@ my_bt_25(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *inwin, *lb; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "inwin", ELM_WIN_BASIC); elm_win_title_set(win, "Inwin"); elm_win_autodel_set(win, 1); @@ -1897,24 +1897,24 @@ my_bt_25(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + inwin = elm_win_inwin_add(win); elm_object_style_set(inwin, "minimal_vertical"); evas_object_show(inwin); - + lb = elm_label_add(win); elm_label_label_set(lb, - "This is an \"inwin\" - a window in a
" - "window. This is handy for quick popups
" - "you want centered, taking over the window
" - "until dismissed somehow. Unlike hovers they
" - "don't hover over their target.
" - "
" - "This inwin style compacts itself vertically
" - "to the size of its contents minimum size."); + "This is an \"inwin\" - a window in a
" + "window. This is handy for quick popups
" + "you want centered, taking over the window
" + "until dismissed somehow. Unlike hovers they
" + "don't hover over their target.
" + "
" + "This inwin style compacts itself vertically
" + "to the size of its contents minimum size."); elm_win_inwin_content_set(inwin, lb); evas_object_show(lb); - + evas_object_resize(win, 320, 240); evas_object_show(win); } @@ -1924,7 +1924,7 @@ my_bt_26(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *bt; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "scaling", ELM_WIN_BASIC); elm_win_title_set(win, "Scaling"); elm_win_autodel_set(win, 1); @@ -1938,43 +1938,43 @@ my_bt_26(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); evas_object_show(bx); - + bt = elm_button_add(win); elm_button_label_set(bt, "Scale: 0.5"); elm_object_scale_set(bt, 0.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Scale: 0.75"); elm_object_scale_set(bt, 0.75); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Scale: 1.0"); elm_object_scale_set(bt, 1.0); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Scale: 1.5"); elm_object_scale_set(bt, 1.5); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Scale: 2.0"); elm_object_scale_set(bt, 2.0); elm_box_pack_end(bx, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Scale: 3.0"); elm_object_scale_set(bt, 3.0); elm_box_pack_end(bx, bt); evas_object_show(bt); - + evas_object_resize(win, 320, 320); evas_object_show(win); } @@ -1984,7 +1984,7 @@ my_bt_27(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *fr, *lb; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "scaling-2", ELM_WIN_BASIC); elm_win_title_set(win, "Scaling 2"); elm_win_autodel_set(win, 1); @@ -2004,40 +2004,40 @@ my_bt_27(void *data, Evas_Object *obj, void *event_info) elm_frame_label_set(fr, "Scale: 0.5"); lb = elm_label_add(win); elm_label_label_set(lb, - "Parent frame scale
" - "is 0.5. Child should
" - "inherit it."); + "Parent frame scale
" + "is 0.5. Child should
" + "inherit it."); elm_frame_content_set(fr, lb); evas_object_show(lb); elm_box_pack_end(bx, fr); evas_object_show(fr); - + fr = elm_frame_add(win); elm_frame_label_set(fr, "Scale: 1.0"); lb = elm_label_add(win); elm_label_label_set(lb, - "Parent frame scale
" - "is 1.0. Child should
" - "inherit it."); + "Parent frame scale
" + "is 1.0. Child should
" + "inherit it."); elm_frame_content_set(fr, lb); evas_object_show(lb); elm_object_scale_set(fr, 1.0); elm_box_pack_end(bx, fr); evas_object_show(fr); - + fr = elm_frame_add(win); elm_frame_label_set(fr, "Scale: 2.0"); lb = elm_label_add(win); elm_label_label_set(lb, - "Parent frame scale
" - "is 2.0. Child should
" - "inherit it."); + "Parent frame scale
" + "is 2.0. Child should
" + "inherit it."); elm_frame_content_set(fr, lb); evas_object_show(lb); elm_object_scale_set(fr, 2.0); elm_box_pack_end(bx, fr); evas_object_show(fr); - + evas_object_resize(win, 320, 320); evas_object_show(win); } @@ -2047,7 +2047,7 @@ my_bt_28(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *sl, *ic; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "slider", ELM_WIN_BASIC); elm_win_title_set(win, "Slider"); elm_win_autodel_set(win, 1); @@ -2056,7 +2056,7 @@ my_bt_28(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -2091,7 +2091,7 @@ my_bt_28(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, sl); evas_object_show(ic); evas_object_show(sl); - + sl = elm_slider_add(win); elm_slider_label_set(sl, "Label 3"); elm_slider_unit_format_set(sl, "units"); @@ -2106,7 +2106,7 @@ my_bt_28(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, sl); evas_object_show(ic); evas_object_show(sl); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -2125,7 +2125,7 @@ my_bt_28(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, sl); evas_object_show(ic); evas_object_show(sl); - + evas_object_show(win); } @@ -2165,7 +2165,7 @@ my_bt_29(void *data, Evas_Object *obj, void *event_info) Evas_Object *win, *bg, *gl; Elm_Genlist_Item *gli; int i; - + win = elm_win_add(NULL, "genlist", ELM_WIN_BASIC); elm_win_title_set(win, "Genlist"); elm_win_autodel_set(win, 1); @@ -2174,13 +2174,13 @@ my_bt_29(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + gl = elm_genlist_add(win); elm_genlist_horizontal_mode_set(gl, ELM_LIST_LIMIT); elm_win_resize_object_add(win, gl); evas_object_size_hint_weight_set(gl, 1.0, 1.0); evas_object_show(gl); - + itc1.item_style = "default"; itc1.func.label_get = gl_label_get; itc1.func.icon_get = gl_icon_get; @@ -2189,12 +2189,12 @@ my_bt_29(void *data, Evas_Object *obj, void *event_info) for (i = 0; i < 2000; i++) { - gli = elm_genlist_item_append(gl, &itc1, - (void *)i/* item data */, - NULL/* parent */, - ELM_GENLIST_ITEM_NONE, - gl_sel/* func */, - (void *)(i * 10)/* func data */); + gli = elm_genlist_item_append(gl, &itc1, + (void *)i/* item data */, + NULL/* parent */, + ELM_GENLIST_ITEM_NONE, + gl_sel/* func */, + (void *)(i * 10)/* func data */); } evas_object_resize(win, 480, 800); evas_object_show(win); @@ -2220,12 +2220,12 @@ my_gl_add(void *data, Evas_Object *obj, void *event_info) itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; - gli = elm_genlist_item_append(gl, &itc1, - (void *)i/* item data */, - NULL/* parent */, - ELM_GENLIST_ITEM_NONE, - gl_sel/* func */, - (void *)(i * 10)/* func data */); + gli = elm_genlist_item_append(gl, &itc1, + (void *)i/* item data */, + NULL/* parent */, + ELM_GENLIST_ITEM_NONE, + gl_sel/* func */, + (void *)(i * 10)/* func data */); i++; } @@ -2236,8 +2236,8 @@ my_gl_del(void *data, Evas_Object *obj, void *event_info) Elm_Genlist_Item *gli = elm_genlist_selected_item_get(gl); if (!gli) { - printf("no item selected\n"); - return; + printf("no item selected\n"); + return; } elm_genlist_item_del(gli); } @@ -2249,8 +2249,8 @@ my_gl_disable(void *data, Evas_Object *obj, void *event_info) Elm_Genlist_Item *gli = elm_genlist_selected_item_get(gl); if (!gli) { - printf("no item selected\n"); - return; + printf("no item selected\n"); + return; } elm_genlist_item_disabled_set(gli, 1); elm_genlist_item_selected_set(gli, 0); @@ -2265,10 +2265,10 @@ my_gl_update_all(void *data, Evas_Object *obj, void *event_info) Elm_Genlist_Item *it = elm_genlist_first_item_get(gl); while (it) { - elm_genlist_item_update(it); - printf("%i\n", i); - i++; - it = elm_genlist_item_next_get(it); + elm_genlist_item_update(it); + printf("%i\n", i); + i++; + it = elm_genlist_item_next_get(it); } } @@ -2299,7 +2299,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) Elm_Genlist_Item *gli[10]; char buf[PATH_MAX]; int i; - + win = elm_win_add(NULL, "genlist-2", ELM_WIN_BASIC); elm_win_title_set(win, "Genlist 2"); elm_win_autodel_set(win, 1); @@ -2310,7 +2310,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -2327,36 +2327,36 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; - gli[0] = elm_genlist_item_append(gl, &itc1, - (void *)1001/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1001/* func data */); - gli[1] = elm_genlist_item_append(gl, &itc1, - (void *)1002/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1002/* func data */); - gli[2] = elm_genlist_item_append(gl, &itc1, - (void *)1003/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1003/* func data */); - gli[3] = elm_genlist_item_prepend(gl, &itc1, - (void *)1004/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1004/* func data */); - gli[4] = elm_genlist_item_prepend(gl, &itc1, - (void *)1005/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1005/* func data */); - gli[5] = elm_genlist_item_insert_before(gl, &itc1, - (void *)1006/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1006/* func data */); - gli[6] = elm_genlist_item_insert_after(gl, &itc1, - (void *)1007/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - (void *)1007/* func data */); - + gli[0] = elm_genlist_item_append(gl, &itc1, + (void *)1001/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1001/* func data */); + gli[1] = elm_genlist_item_append(gl, &itc1, + (void *)1002/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1002/* func data */); + gli[2] = elm_genlist_item_append(gl, &itc1, + (void *)1003/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1003/* func data */); + gli[3] = elm_genlist_item_prepend(gl, &itc1, + (void *)1004/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1004/* func data */); + gli[4] = elm_genlist_item_prepend(gl, &itc1, + (void *)1005/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1005/* func data */); + gli[5] = elm_genlist_item_insert_before(gl, &itc1, + (void *)1006/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1006/* func data */); + gli[6] = elm_genlist_item_insert_after(gl, &itc1, + (void *)1007/* item data */, gli[2]/* rel */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + (void *)1007/* func data */); + elm_box_pack_end(bx, gl); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "/\\"); evas_object_smart_callback_add(bt, "clicked", my_gl_first, gl); @@ -2364,7 +2364,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "\\/"); evas_object_smart_callback_add(bt, "clicked", my_gl_last, gl); @@ -2372,7 +2372,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "#"); evas_object_smart_callback_add(bt, "clicked", my_gl_disable, gl); @@ -2380,7 +2380,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "U"); evas_object_smart_callback_add(bt, "clicked", my_gl_update_all, gl); @@ -2388,7 +2388,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -2397,7 +2397,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "X"); evas_object_smart_callback_add(bt, "clicked", my_gl_clear, gl); @@ -2405,7 +2405,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "+"); evas_object_smart_callback_add(bt, "clicked", my_gl_add, gl); @@ -2413,7 +2413,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "-"); evas_object_smart_callback_add(bt, "clicked", my_gl_del, gl); @@ -2421,7 +2421,7 @@ my_bt_30(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -2450,27 +2450,27 @@ Evas_Object *gl2_icon_get(const void *data, Evas_Object *obj, const char *part) Evas_Object *ic = elm_icon_add(obj); if (!strcmp(part, "elm.swallow.icon")) { - if ((tit->mode & 0x3) == 0) - snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); - else if ((tit->mode & 0x3) == 1) - snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR); - else if ((tit->mode & 0x3) == 2) - snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", PACKAGE_DATA_DIR); - else if ((tit->mode & 0x3) == 3) - snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR); - elm_icon_file_set(ic, buf, NULL); + if ((tit->mode & 0x3) == 0) + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + else if ((tit->mode & 0x3) == 1) + snprintf(buf, sizeof(buf), "%s/images/logo.png", PACKAGE_DATA_DIR); + else if ((tit->mode & 0x3) == 2) + snprintf(buf, sizeof(buf), "%s/images/panel_01.jpg", PACKAGE_DATA_DIR); + else if ((tit->mode & 0x3) == 3) + snprintf(buf, sizeof(buf), "%s/images/rock_01.jpg", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); } else if (!strcmp(part, "elm.swallow.end")) { - if ((tit->mode & 0x3) == 0) - snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); - else if ((tit->mode & 0x3) == 1) - snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); - else if ((tit->mode & 0x3) == 2) - snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR); - else if ((tit->mode & 0x3) == 3) - snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", PACKAGE_DATA_DIR); - elm_icon_file_set(ic, buf, NULL); + if ((tit->mode & 0x3) == 0) + snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", PACKAGE_DATA_DIR); + else if ((tit->mode & 0x3) == 1) + snprintf(buf, sizeof(buf), "%s/images/sky_02.jpg", PACKAGE_DATA_DIR); + else if ((tit->mode & 0x3) == 2) + snprintf(buf, sizeof(buf), "%s/images/sky_03.jpg", PACKAGE_DATA_DIR); + else if ((tit->mode & 0x3) == 3) + snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); } evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); return ic; @@ -2497,7 +2497,7 @@ my_bt_31(void *data, Evas_Object *obj, void *event_info) Evas_Object *win, *bg, *gl, *bx, *bx2, *bt; static Testitem tit[3]; int i; - + win = elm_win_add(NULL, "genlist-3", ELM_WIN_BASIC); elm_win_title_set(win, "Genlist 3"); elm_win_autodel_set(win, 1); @@ -2506,7 +2506,7 @@ my_bt_31(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -2524,27 +2524,27 @@ my_bt_31(void *data, Evas_Object *obj, void *event_info) itc2.func.del = gl2_del; tit[0].mode = 0; - tit[0].item = elm_genlist_item_append(gl, &itc2, - &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); + tit[0].item = elm_genlist_item_append(gl, &itc2, + &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); tit[1].mode = 1; - tit[1].item = elm_genlist_item_append(gl, &itc2, - &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); + tit[1].item = elm_genlist_item_append(gl, &itc2, + &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); tit[2].mode = 2; - tit[2].item = elm_genlist_item_append(gl, &itc2, - &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); - + tit[2].item = elm_genlist_item_append(gl, &itc2, + &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); + elm_box_pack_end(bx, gl); evas_object_show(bx2); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "[1]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[0])); @@ -2552,7 +2552,7 @@ my_bt_31(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[2]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[1])); @@ -2560,7 +2560,7 @@ my_bt_31(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[3]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[2])); @@ -2568,7 +2568,7 @@ my_bt_31(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -2598,32 +2598,32 @@ Evas_Object *gl3_icon_get(const void *data, Evas_Object *obj, const char *part) char buf[PATH_MAX]; if (!strcmp(part, "elm.swallow.icon")) { - Evas_Object *bx = elm_box_add(obj); - Evas_Object *ic; - elm_box_horizontal_set(bx, 1); - ic = elm_icon_add(obj); - snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); - elm_icon_file_set(ic, buf, NULL); - elm_icon_scale_set(ic, 0, 0); - evas_object_show(ic); - elm_box_pack_end(bx, ic); - ic = elm_icon_add(obj); - elm_icon_file_set(ic, buf, NULL); - elm_icon_scale_set(ic, 0, 0); - evas_object_show(ic); - elm_box_pack_end(bx, ic); - evas_object_show(bx); - return bx; + Evas_Object *bx = elm_box_add(obj); + Evas_Object *ic; + elm_box_horizontal_set(bx, 1); + ic = elm_icon_add(obj); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_icon_scale_set(ic, 0, 0); + evas_object_show(ic); + elm_box_pack_end(bx, ic); + ic = elm_icon_add(obj); + elm_icon_file_set(ic, buf, NULL); + elm_icon_scale_set(ic, 0, 0); + evas_object_show(ic); + elm_box_pack_end(bx, ic); + evas_object_show(bx); + return bx; } else if (!strcmp(part, "elm.swallow.end")) { - Evas_Object *ck; - ck = elm_check_add(obj); - evas_object_propagate_events_set(ck, 0); - elm_check_state_set(ck, tit->onoff); - evas_object_smart_callback_add(ck, "changed", my_gl_item_check_changed, data); - evas_object_show(ck); - return ck; + Evas_Object *ck; + ck = elm_check_add(obj); + evas_object_propagate_events_set(ck, 0); + elm_check_state_set(ck, tit->onoff); + evas_object_smart_callback_add(ck, "changed", my_gl_item_check_changed, data); + evas_object_show(ck); + return ck; } return NULL; } @@ -2641,7 +2641,7 @@ my_bt_32(void *data, Evas_Object *obj, void *event_info) Evas_Object *win, *bg, *gl, *bx, *bx2, *bt; static Testitem tit[3]; int i; - + win = elm_win_add(NULL, "genlist-4", ELM_WIN_BASIC); elm_win_title_set(win, "Genlist 4"); elm_win_autodel_set(win, 1); @@ -2650,7 +2650,7 @@ my_bt_32(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -2669,27 +2669,27 @@ my_bt_32(void *data, Evas_Object *obj, void *event_info) itc3.func.del = gl3_del; tit[0].mode = 0; - tit[0].item = elm_genlist_item_append(gl, &itc3, - &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); + tit[0].item = elm_genlist_item_append(gl, &itc3, + &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); tit[1].mode = 1; - tit[1].item = elm_genlist_item_append(gl, &itc3, - &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); + tit[1].item = elm_genlist_item_append(gl, &itc3, + &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); tit[2].mode = 2; - tit[2].item = elm_genlist_item_append(gl, &itc3, - &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); - + tit[2].item = elm_genlist_item_append(gl, &itc3, + &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); + elm_box_pack_end(bx, gl); evas_object_show(bx2); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "[1]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[0])); @@ -2697,7 +2697,7 @@ my_bt_32(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[2]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[1])); @@ -2705,7 +2705,7 @@ my_bt_32(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[3]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[2])); @@ -2713,7 +2713,7 @@ my_bt_32(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -2726,7 +2726,7 @@ my_bt_33(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ic, *ck; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "check", ELM_WIN_BASIC); elm_win_title_set(win, "Checks"); elm_win_autodel_set(win, 1); @@ -2735,7 +2735,7 @@ my_bt_33(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -2754,7 +2754,7 @@ my_bt_33(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, ck); evas_object_show(ck); evas_object_show(ic); - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -2780,7 +2780,7 @@ my_bt_33(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, ck); evas_object_show(ck); evas_object_show(ic); - + evas_object_show(win); } @@ -2789,7 +2789,7 @@ my_bt_34(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *bx, *ic, *rd, *rdg; char buf[PATH_MAX]; - + win = elm_win_add(NULL, "radio", ELM_WIN_BASIC); elm_win_title_set(win, "Radios"); elm_win_autodel_set(win, 1); @@ -2798,7 +2798,7 @@ my_bt_34(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -2818,7 +2818,7 @@ my_bt_34(void *data, Evas_Object *obj, void *event_info) evas_object_show(rd); evas_object_show(ic); rdg = rd; - + ic = elm_icon_add(win); snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); elm_icon_file_set(ic, buf, NULL); @@ -2850,9 +2850,9 @@ my_bt_34(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, rd); evas_object_show(rd); evas_object_show(ic); - + elm_radio_value_set(rdg, 2); - + evas_object_show(win); } @@ -2897,7 +2897,7 @@ my_bt_35(void *data, Evas_Object *obj, void *event_info) Evas_Object *win, *bg, *pg, *bx, *lb, *bt; char buf[PATH_MAX]; static Pginfo info; - + win = elm_win_add(NULL, "pager", ELM_WIN_BASIC); elm_win_title_set(win, "Pager"); elm_win_autodel_set(win, 1); @@ -2906,32 +2906,32 @@ my_bt_35(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + pg = elm_pager_add(win); elm_win_resize_object_add(win, pg); evas_object_show(pg); - + info.pager = pg; - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); evas_object_show(bx); - + lb = elm_label_add(win); elm_label_label_set(lb, - "This is page 1 in a pager stack.
" - "
" - "So what is a pager stack? It is a stack
" - "of pages that hold widgets in it. The
" - "pages can be pushed and popped on and
" - "off the stack, activated and otherwise
" - "activated if already in the stack
" - "(activated means promoted to the top of
" - "the stack).
" - "
" - "The theme may define the animation how
" - "show and hide of pages." - ); + "This is page 1 in a pager stack.
" + "
" + "So what is a pager stack? It is a stack
" + "of pages that hold widgets in it. The
" + "pages can be pushed and popped on and
" + "off the stack, activated and otherwise
" + "activated if already in the stack
" + "(activated means promoted to the top of
" + "the stack).
" + "
" + "The theme may define the animation how
" + "show and hide of pages." + ); elm_box_pack_end(bx, lb); evas_object_show(lb); bt = elm_button_add(win); @@ -2952,11 +2952,11 @@ my_bt_35(void *data, Evas_Object *obj, void *event_info) evas_object_show(bx); lb = elm_label_add(win); elm_label_label_set(lb, - "This is page 2 in a pager stack.
" - "
" - "This is just like the previous page in
" - "the pager stack." - ); + "This is page 2 in a pager stack.
" + "
" + "This is just like the previous page in
" + "the pager stack." + ); elm_box_pack_end(bx, lb); evas_object_show(lb); bt = elm_button_add(win); @@ -2977,11 +2977,11 @@ my_bt_35(void *data, Evas_Object *obj, void *event_info) evas_object_show(bx); lb = elm_label_add(win); elm_label_label_set(lb, - "This is page 3 in a pager stack.
" - "
" - "This is just like the previous page in
" - "the pager stack." - ); + "This is page 3 in a pager stack.
" + "
" + "This is just like the previous page in
" + "the pager stack." + ); elm_box_pack_end(bx, lb); evas_object_show(lb); bt = elm_button_add(win); @@ -3013,15 +3013,15 @@ gl4_exp(void *data, Evas_Object *obj, void *event_info) Evas_Object *gl = elm_genlist_item_genlist_get(it); int val = (int)elm_genlist_item_data_get(it); val *= 10; - elm_genlist_item_append(gl, &itc4, - (void *)(val + 1)/* item data */, it/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc4, - (void *)(val + 2)/* item data */, it/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc4, - (void *)(val + 3)/* item data */, it/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); + elm_genlist_item_append(gl, &itc4, + (void *)(val + 1)/* item data */, it/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc4, + (void *)(val + 2)/* item data */, it/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc4, + (void *)(val + 3)/* item data */, it/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); } static void gl4_con(void *data, Evas_Object *obj, void *event_info) @@ -3054,19 +3054,19 @@ Evas_Object *gl4_icon_get(const void *data, Evas_Object *obj, const char *part) char buf[PATH_MAX]; if (!strcmp(part, "elm.swallow.icon")) { - Evas_Object *ic = elm_icon_add(obj); - snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); - elm_icon_file_set(ic, buf, NULL); - evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); - evas_object_show(ic); - return ic; + Evas_Object *ic = elm_icon_add(obj); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + evas_object_show(ic); + return ic; } else if (!strcmp(part, "elm.swallow.end")) { - Evas_Object *ck; - ck = elm_check_add(obj); - evas_object_show(ck); - return ck; + Evas_Object *ck; + ck = elm_check_add(obj); + evas_object_show(ck); + return ck; } return NULL; } @@ -3082,7 +3082,7 @@ static void my_bt_36(void *data, Evas_Object *obj, void *event_info) { Evas_Object *win, *bg, *gl, *bx, *bx2, *bt; - + win = elm_win_add(NULL, "genlist-tree", ELM_WIN_BASIC); elm_win_title_set(win, "Genlist Tree"); elm_win_autodel_set(win, 1); @@ -3091,7 +3091,7 @@ my_bt_36(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -3108,30 +3108,30 @@ my_bt_36(void *data, Evas_Object *obj, void *event_info) itc4.func.state_get = gl4_state_get; itc4.func.del = gl4_del; - elm_genlist_item_append(gl, &itc4, - (void *)1/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc4, - (void *)2/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, - NULL/* func data */); - elm_genlist_item_append(gl, &itc4, - (void *)3/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, - NULL/* func data */); - + elm_genlist_item_append(gl, &itc4, + (void *)1/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc4, + (void *)2/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_SUBITEMS, gl4_sel/* func */, + NULL/* func data */); + elm_genlist_item_append(gl, &itc4, + (void *)3/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl4_sel/* func */, + NULL/* func data */); + evas_object_smart_callback_add(gl, "expand,request", gl4_exp_req, gl); evas_object_smart_callback_add(gl, "contract,request", gl4_con_req, gl); evas_object_smart_callback_add(gl, "expanded", gl4_exp, gl); evas_object_smart_callback_add(gl, "contracted", gl4_con, gl); - + elm_box_pack_end(bx, gl); evas_object_show(bx2); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "[1]"); // evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[0])); @@ -3139,7 +3139,7 @@ my_bt_36(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[2]"); // evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[1])); @@ -3147,7 +3147,7 @@ my_bt_36(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[3]"); // evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[2])); @@ -3155,7 +3155,7 @@ my_bt_36(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -3178,11 +3178,11 @@ char *gl5_label_get(const void *data, Evas_Object *obj, const char *part) char buf[256]; if (!strcmp(part, "elm.text")) { - snprintf(buf, sizeof(buf), "Item mode %i", tit->mode); + snprintf(buf, sizeof(buf), "Item mode %i", tit->mode); } else if (!strcmp(part, "elm.text.sub")) { - snprintf(buf, sizeof(buf), "%i bottles on the wall", tit->mode); + snprintf(buf, sizeof(buf), "%i bottles on the wall", tit->mode); } return strdup(buf); } @@ -3192,32 +3192,32 @@ Evas_Object *gl5_icon_get(const void *data, Evas_Object *obj, const char *part) char buf[PATH_MAX]; if (!strcmp(part, "elm.swallow.icon")) { - Evas_Object *bx = elm_box_add(obj); - Evas_Object *ic; - elm_box_horizontal_set(bx, 1); - ic = elm_icon_add(obj); - snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); - elm_icon_file_set(ic, buf, NULL); - elm_icon_scale_set(ic, 0, 0); - evas_object_show(ic); - elm_box_pack_end(bx, ic); - ic = elm_icon_add(obj); - elm_icon_file_set(ic, buf, NULL); - elm_icon_scale_set(ic, 0, 0); - evas_object_show(ic); - elm_box_pack_end(bx, ic); - evas_object_show(bx); - return bx; + Evas_Object *bx = elm_box_add(obj); + Evas_Object *ic; + elm_box_horizontal_set(bx, 1); + ic = elm_icon_add(obj); + snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR); + elm_icon_file_set(ic, buf, NULL); + elm_icon_scale_set(ic, 0, 0); + evas_object_show(ic); + elm_box_pack_end(bx, ic); + ic = elm_icon_add(obj); + elm_icon_file_set(ic, buf, NULL); + elm_icon_scale_set(ic, 0, 0); + evas_object_show(ic); + elm_box_pack_end(bx, ic); + evas_object_show(bx); + return bx; } else if (!strcmp(part, "elm.swallow.end")) { - Evas_Object *ck; - ck = elm_check_add(obj); - evas_object_propagate_events_set(ck, 0); - elm_check_state_set(ck, tit->onoff); - evas_object_smart_callback_add(ck, "changed", my_gl_item_check_changed2, data); - evas_object_show(ck); - return ck; + Evas_Object *ck; + ck = elm_check_add(obj); + evas_object_propagate_events_set(ck, 0); + elm_check_state_set(ck, tit->onoff); + evas_object_smart_callback_add(ck, "changed", my_gl_item_check_changed2, data); + evas_object_show(ck); + return ck; } return NULL; } @@ -3244,7 +3244,7 @@ my_bt_37(void *data, Evas_Object *obj, void *event_info) elm_win_resize_object_add(win, bg); evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); @@ -3262,27 +3262,27 @@ my_bt_37(void *data, Evas_Object *obj, void *event_info) itc5.func.del = gl5_del; tit[0].mode = 0; - tit[0].item = elm_genlist_item_append(gl, &itc5, - &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); + tit[0].item = elm_genlist_item_append(gl, &itc5, + &(tit[0])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); tit[1].mode = 1; - tit[1].item = elm_genlist_item_append(gl, &itc5, - &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); + tit[1].item = elm_genlist_item_append(gl, &itc5, + &(tit[1])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); tit[2].mode = 2; - tit[2].item = elm_genlist_item_append(gl, &itc5, - &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, - NULL/* func data */); - + tit[2].item = elm_genlist_item_append(gl, &itc5, + &(tit[2])/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_NONE, gl_sel/* func */, + NULL/* func data */); + elm_box_pack_end(bx, gl); evas_object_show(bx2); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "[1]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[0])); @@ -3290,7 +3290,7 @@ my_bt_37(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[2]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[1])); @@ -3298,7 +3298,7 @@ my_bt_37(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "[3]"); evas_object_smart_callback_add(bt, "clicked", my_gl_update, &(tit[2])); @@ -3306,7 +3306,7 @@ my_bt_37(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -3380,18 +3380,18 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bg, 1.0, 1.0); evas_object_show(bg); evas_object_data_set(win, "bg", bg); - + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, 1.0, 1.0); elm_win_resize_object_add(win, bx); evas_object_show(bx); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "Alpha On"); evas_object_smart_callback_add(bt, "clicked", my_bt_38_alpha_on, win); @@ -3399,7 +3399,7 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Alpha Off"); evas_object_smart_callback_add(bt, "clicked", my_bt_38_alpha_off, win); @@ -3410,13 +3410,13 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) elm_box_pack_end(bx, bx2); evas_object_show(bx2); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 1.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + sl = elm_slider_add(win); elm_slider_label_set(sl, "Test"); elm_slider_span_size_set(sl, 100); @@ -3428,16 +3428,16 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) elm_slider_inverted_set(sl, 1); elm_box_pack_end(bx2, sl); evas_object_show(sl); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); - + bx2 = elm_box_add(win); elm_box_horizontal_set(bx2, 1); elm_box_homogenous_set(bx2, 1); evas_object_size_hint_weight_set(bx2, 1.0, 0.0); evas_object_size_hint_align_set(bx2, -1.0, -1.0); - + bt = elm_button_add(win); elm_button_label_set(bt, "Rot 0"); evas_object_smart_callback_add(bt, "clicked", my_bt_38_rot_0, win); @@ -3445,7 +3445,7 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Rot 90"); evas_object_smart_callback_add(bt, "clicked", my_bt_38_rot_90, win); @@ -3453,7 +3453,7 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Rot 180"); evas_object_smart_callback_add(bt, "clicked", my_bt_38_rot_180, win); @@ -3461,7 +3461,7 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + bt = elm_button_add(win); elm_button_label_set(bt, "Rot 270"); evas_object_smart_callback_add(bt, "clicked", my_bt_38_rot_270, win); @@ -3469,7 +3469,7 @@ my_bt_38(void *data, Evas_Object *obj, void *event_info) evas_object_size_hint_weight_set(bt, 1.0, 0.0); elm_box_pack_end(bx2, bt); evas_object_show(bt); - + elm_box_pack_end(bx, bx2); evas_object_show(bx2); @@ -3481,7 +3481,7 @@ static void my_win_main(void) { Evas_Object *win, *bg, *bx0, *lb, *li, *fr; - + /* 1 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 @@ -3497,14 +3497,14 @@ my_win_main(void) win = elm_win_add(NULL, "main", ELM_WIN_BASIC); /* 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 + * 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 backgorund, you could make a window seem * transparent with elm_win_alpha_set(win, 1); for example. if you have @@ -3523,36 +3523,36 @@ my_win_main(void) 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, 1.0, 1.0); - /* tell the window that the box affects window size and also will be + /* tell the window that the box affects window size and also will be * resized when the window is */ elm_win_resize_object_add(win, bx0); evas_object_show(bx0); - + fr = elm_frame_add(win); elm_frame_label_set(fr, "Information"); elm_box_pack_end(bx0, fr); evas_object_show(fr); - + lb = elm_label_add(win); - elm_label_label_set(lb, - "Please select a test from the list below
" - "by clicking the test button to show the
" - "test window."); + elm_label_label_set(lb, + "Please select a test from the list below
" + "by clicking the test button to show the
" + "test window."); elm_frame_content_set(fr, lb); evas_object_show(lb); - + li = elm_list_add(win); elm_list_always_select_mode_set(li, 1); evas_object_size_hint_weight_set(li, 1.0, 1.0); evas_object_size_hint_align_set(li, -1.0, -1.0); elm_box_pack_end(bx0, li); evas_object_show(li); - + elm_list_item_append(li, "Bg Plain", NULL, NULL, my_bt_1, NULL); elm_list_item_append(li, "Bg Image", NULL, NULL, my_bt_2, NULL); elm_list_item_append(li, "Icon Transparent", NULL, NULL, my_bt_3, NULL); @@ -3591,9 +3591,9 @@ my_win_main(void) elm_list_item_append(li, "Genlist Tree", NULL, NULL, my_bt_36, NULL); elm_list_item_append(li, "Genlist 5", NULL, NULL, my_bt_37, NULL); elm_list_item_append(li, "Window States", NULL, NULL, my_bt_38, NULL); - + elm_list_go(li); - + /* set an initial window size */ evas_object_resize(win, 240, 480); /* show the window */ diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index cd0776f59f..ee61259490 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/src/lib/Elementary.h.in @@ -58,7 +58,7 @@ # endif #endif - + /* EFL headers */ #include #include @@ -109,8 +109,8 @@ extern "C" { /* handy macros */ #define ELM_RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy))) - -/**************************************************************************/ + +/**************************************************************************/ /* Objects */ typedef enum _Elm_Win_Type { @@ -127,30 +127,30 @@ extern "C" { typedef enum _Elm_Win_Keyboard_Mode { ELM_WIN_KEYBOARD_UNKNOWN, - ELM_WIN_KEYBOARD_OFF, - ELM_WIN_KEYBOARD_ON, - ELM_WIN_KEYBOARD_ALPHA, - ELM_WIN_KEYBOARD_NUMERIC, - ELM_WIN_KEYBOARD_PIN, - ELM_WIN_KEYBOARD_PHONE_NUMBER, - ELM_WIN_KEYBOARD_HEX, - ELM_WIN_KEYBOARD_TERMINAL, - ELM_WIN_KEYBOARD_PASSWORD + ELM_WIN_KEYBOARD_OFF, + ELM_WIN_KEYBOARD_ON, + ELM_WIN_KEYBOARD_ALPHA, + ELM_WIN_KEYBOARD_NUMERIC, + ELM_WIN_KEYBOARD_PIN, + ELM_WIN_KEYBOARD_PHONE_NUMBER, + ELM_WIN_KEYBOARD_HEX, + ELM_WIN_KEYBOARD_TERMINAL, + ELM_WIN_KEYBOARD_PASSWORD } Elm_Win_Keyboard_Mode; -#ifndef ELM_LIB_QUICKLAUNCH +#ifndef ELM_LIB_QUICKLAUNCH #define ELM_MAIN() int main(int argc, char **argv) {elm_init(argc, argv); return elm_main(argc, argv);} #else #define ELM_MAIN() int main(int argc, char **argv) {return elm_quicklaunch_fallback(argc, argv);} #endif - -/**************************************************************************/ + +/**************************************************************************/ /* General calls */ EAPI void elm_init(int argc, char **argv); EAPI void elm_shutdown(void); EAPI void elm_run(void); EAPI void elm_exit(void); - + EAPI void elm_quicklaunch_init(int argc, char **argv); EAPI void elm_quicklaunch_sub_init(int argc, char **argv); EAPI void elm_quicklaunch_sub_shutdown(void); @@ -161,7 +161,7 @@ extern "C" { EAPI void elm_quicklaunch_cleanup(void); EAPI int elm_quicklaunch_fallback(int argc, char **argv); EAPI char *elm_quicklaunch_exe_path_get(const char *exe); - + EAPI void elm_object_scale_set(Evas_Object *obj, double scale); EAPI double elm_object_scale_get(const Evas_Object *obj); EAPI void elm_object_style_set(Evas_Object *obj, const char *style); @@ -171,14 +171,14 @@ extern "C" { EAPI void elm_scale_set(double scale); EAPI Evas_Coord elm_finger_size_get(void); EAPI void elm_finger_size_set(Evas_Coord size); - + EAPI void elm_object_focus(Evas_Object *obj); - + EAPI void elm_coords_finger_size_adjust(int times_w, Evas_Coord *w, int times_h, Evas_Coord *h); - + EAPI void elm_theme_overlay_add(const char *item); EAPI void elm_theme_extension_add(const char *item); - + EAPI Evas_Object *elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type); EAPI void elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj); EAPI void elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj); @@ -206,7 +206,7 @@ extern "C" { * ecore_x_icccm_window_role_set -> role (add to ecore_evas) * ecore_x_icccm_transient_for_set -> forwin (add to ecore_evas) * ecore_x_netwm_window_type_set -> type (add to ecore_evas) - * + * * (add to ecore_x) set netwm argb icon! (add to ecore_evas) * (blank mouse, private mouse obj, defaultmouse) * @@ -218,14 +218,14 @@ extern "C" { EAPI void elm_win_inwin_activate(Evas_Object *obj); EAPI void elm_win_inwin_style_set(Evas_Object *obj, const char *style); EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content); - /* available styles: + /* available styles: * default * minimal * minimal_vertical */ - + /* X specific calls - won't work on non-x engines (return 0) */ - EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj); + EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj); /* smart callbacks called: * "delete-request" - the user requested to delete the window * "focus-in" - window got focus @@ -282,14 +282,14 @@ extern "C" { EAPI void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after); /* smart callbacks called: */ - + EAPI Evas_Object *elm_button_add(Evas_Object *parent); EAPI void elm_button_label_set(Evas_Object *obj, const char *label); EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon); EAPI void elm_button_style_set(Evas_Object *obj, const char *style); - /* available styles: - * default - * hoversel_vertical + /* available styles: + * default + * hoversel_vertical * hoversel_vertical_entry */ /* smart callbacks called: @@ -298,12 +298,12 @@ extern "C" { typedef enum _Elm_Scroller_Policy { - ELM_SCROLLER_POLICY_AUTO, - ELM_SCROLLER_POLICY_ON, - ELM_SCROLLER_POLICY_OFF + ELM_SCROLLER_POLICY_AUTO, + ELM_SCROLLER_POLICY_ON, + ELM_SCROLLER_POLICY_OFF } Elm_Scroller_Policy; - + EAPI Evas_Object *elm_scroller_add(Evas_Object *parent); EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child); EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h); @@ -324,7 +324,7 @@ extern "C" { EAPI void elm_label_label_set(Evas_Object *obj, const char *label); /* smart callbacks called: */ - + EAPI Evas_Object *elm_toggle_add(Evas_Object *parent); EAPI void elm_toggle_label_set(Evas_Object *obj, const char *label); EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon); @@ -335,7 +335,7 @@ extern "C" { /* smart callbacks called: * "changed" - the user toggled the state */ - + EAPI Evas_Object *elm_frame_add(Evas_Object *parent); EAPI void elm_frame_label_set(Evas_Object *obj, const char *label); EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content); @@ -351,13 +351,13 @@ extern "C" { */ /* smart callbacks called: */ - + EAPI Evas_Object *elm_table_add(Evas_Object *parent); EAPI void elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous); EAPI void elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h); /* smart callbacks called: */ - + EAPI Evas_Object *elm_clock_add(Evas_Object *parent); EAPI void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec); EAPI void elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec); @@ -374,13 +374,13 @@ extern "C" { EAPI Evas_Object *elm_layout_edje_get(const Evas_Object *obj); /* smart callbacks called: */ - + typedef enum _Elm_Hover_Axis { ELM_HOVER_AXIS_NONE, - ELM_HOVER_AXIS_HORIZONTAL, - ELM_HOVER_AXIS_VERTICAL, - ELM_HOVER_AXIS_BOTH + ELM_HOVER_AXIS_HORIZONTAL, + ELM_HOVER_AXIS_VERTICAL, + ELM_HOVER_AXIS_BOTH } Elm_Hover_Axis; EAPI Evas_Object *elm_hover_add(Evas_Object *parent); EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target); @@ -388,7 +388,7 @@ extern "C" { EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content); EAPI void elm_hover_style_set(Evas_Object *obj, const char *style); EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis); - /* available styles: + /* available styles: * default * popout * hoversel_vertical @@ -417,7 +417,7 @@ extern "C" { EAPI void elm_entry_select_all(Evas_Object *obj); EAPI char *elm_entry_markup_to_utf8(const char *s); EAPI char *elm_entry_utf8_to_markup(const char *s); - + /* smart callbacks called: * "changed" - the text content changed * "selection,start" - the user started selecting text @@ -430,7 +430,7 @@ extern "C" { * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchor_Info * "activated" - when the enter key is pressed (useful for single line) */ - + /* composite widgets - these basically put together basic widgets above * in convenient packages that do more than basic stuff */ @@ -466,7 +466,7 @@ extern "C" { /* smart callbacks called: * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorview_Info */ - + typedef struct _Elm_Entry_Anchorblock_Info Elm_Entry_Anchorblock_Info; struct _Elm_Entry_Anchorblock_Info { @@ -489,7 +489,7 @@ extern "C" { /* smart callbacks called: * "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorblock_Info */ - + EAPI Evas_Object *elm_bubble_add(Evas_Object *parent); EAPI void elm_bubble_label_set(Evas_Object *obj, const char *label); EAPI void elm_bubble_info_set(Evas_Object *obj, const char *info); @@ -508,9 +508,9 @@ extern "C" { typedef enum _Elm_Icon_Type { - ELM_ICON_NONE, - ELM_ICON_FILE, - ELM_ICON_STANDARD + ELM_ICON_NONE, + ELM_ICON_FILE, + ELM_ICON_STANDARD } Elm_Icon_Type; typedef struct _Elm_Hoversel_Item Elm_Hoversel_Item; EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent); @@ -527,7 +527,7 @@ extern "C" { * "selected" - an item in the hoversel list is selected * "dismissed" - the hover is dismissed */ - + typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item; EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent); EAPI Elm_Toolbar_Item *elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data); @@ -540,9 +540,9 @@ extern "C" { typedef enum _Elm_List_Mode { - ELM_LIST_COMPRESS, - ELM_LIST_SCROLL, - ELM_LIST_LIMIT + ELM_LIST_COMPRESS, + ELM_LIST_SCROLL, + ELM_LIST_LIMIT } Elm_List_Mode; typedef struct _Elm_List_Item Elm_List_Item; EAPI Evas_Object *elm_list_add(Evas_Object *parent); @@ -585,7 +585,7 @@ extern "C" { /* smart callbacks called: * "clicked" - when the user clicks on a carousel item and becomes selected */ - + EAPI Evas_Object *elm_slider_add(Evas_Object *parent); EAPI void elm_slider_label_set(Evas_Object *obj, const char *label); EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon); @@ -601,11 +601,11 @@ extern "C" { * "changed" - when the slider value changes * "delay,changed" - when the slider value changed, but a small time after a change (use this if you only want to respond to a change once the slider is held still for a short while). */ - + typedef enum _Elm_Genlist_Item_Flags { - ELM_GENLIST_ITEM_NONE = 0, - ELM_GENLIST_ITEM_SUBITEMS = (1 << 0) + ELM_GENLIST_ITEM_NONE = 0, + ELM_GENLIST_ITEM_SUBITEMS = (1 << 0) } Elm_Genlist_Item_Flags; typedef struct _Elm_Genlist_Item_Class Elm_Genlist_Item_Class; typedef struct _Elm_Genlist_Item Elm_Genlist_Item; @@ -614,16 +614,16 @@ extern "C" { typedef Evas_Object *(*GenlistItemIconGetFunc) (const void *data, Evas_Object *obj, const char *part); typedef Eina_Bool (*GenlistItemStateGetFunc) (const void *data, Evas_Object *obj, const char *part); typedef void (*GenlistItemDelFunc) (const void *data, Evas_Object *obj); - + struct _Elm_Genlist_Item_Class { - const char *item_style; - struct _Elm_Genlist_Item_Class_Func { - GenlistItemLabelGetFunc label_get; - GenlistItemIconGetFunc icon_get; - GenlistItemStateGetFunc state_get; - GenlistItemDelFunc del; - } func; + const char *item_style; + struct _Elm_Genlist_Item_Class_Func { + GenlistItemLabelGetFunc label_get; + GenlistItemIconGetFunc icon_get; + GenlistItemStateGetFunc state_get; + GenlistItemDelFunc del; + } func; }; EAPI Evas_Object *elm_genlist_add(Evas_Object *parent); @@ -655,7 +655,7 @@ extern "C" { EAPI void elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode); EAPI void elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select); EAPI void elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select); - /* available item styles: + /* available item styles: * default * double_label */ @@ -668,7 +668,7 @@ extern "C" { * "expand,request" - when the user requested to expand an item * "contract,request" - when the user requested to expand an item */ - + EAPI Evas_Object *elm_check_add(Evas_Object *parent); EAPI void elm_check_label_set(Evas_Object *obj, const char *label); EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon); @@ -678,7 +678,7 @@ extern "C" { /* smart callbacks called: * "changed" - the user toggled the state */ - + EAPI Evas_Object *elm_radio_add(Evas_Object *parent); EAPI void elm_radio_label_set(Evas_Object *obj, const char *label); EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon); @@ -690,7 +690,7 @@ extern "C" { /* smart callbacks called: * "changed" - the user toggled the state */ - + EAPI Evas_Object *elm_pager_add(Evas_Object *parent); EAPI void elm_pager_content_push(Evas_Object *obj, Evas_Object *content); EAPI void elm_pager_content_pop(Evas_Object *obj); @@ -699,7 +699,7 @@ extern "C" { EAPI Evas_Object *elm_pager_content_top_get(Evas_Object *obj); /* smart callbacks called: */ - + #ifdef __cplusplus } #endif @@ -707,20 +707,20 @@ extern "C" { //////////////////////////////////////////////////////////////////////////// /// FIXME: TODO LIST /////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// -// +// //// (bugs - high priority) // * scale change for hover doesnt seem to do new size alloc nicely // * left/right arrow broken with password mode for entry + utf8 chars... // * bubble doesnt handle child size changes right // * table doesnt do homogenous properly -// +// //// (incomplete - medium priority) // * disabled not supported // * on the fly theme changes - test (should work) // * need a hold-scroll counter in elm_widget // * hoversel only vertical right now - make horizontal // * when entries are in a scroller and change size, the scroller shows scrollbars. fix. same for selecting. for 1 line entries in a scroller should only have scroll arrow indicators. -// +// //// (more widgets/features - medium priority) // * multiple genlist item styles (multi-label, 1 icon + 2 line label, header etc.) // * carousel selector widget @@ -746,7 +746,7 @@ extern "C" { // * status widget (busy, stalled, running, etc.) // * full window in window widget (so move/resize of window object does as you'd expect a child window to do within the canvas) // * window frame widget for borderless windows that want the app to do its own frame (move, resize as well etc.) -// +// //// (improvements - low priority) // * test for all bubble styles // * test for all frame styles @@ -784,6 +784,6 @@ extern "C" { // * win should emit signals based on vkbd type - if it gets a message and is a vkbd win // * win needs a way of setting aspect too // * use the wrong call on the wrong widget and *BOOM* ... crashland -// +// ////////////////////////////////////////////////////////////////////////////// #endif diff --git a/legacy/elementary/src/lib/elc_anchorblock.c b/legacy/elementary/src/lib/elc_anchorblock.c index 3e85e66c22..8cd96d4180 100644 --- a/legacy/elementary/src/lib/elc_anchorblock.c +++ b/legacy/elementary/src/lib/elc_anchorblock.c @@ -3,15 +3,15 @@ /** * @defgroup Anchorblock Anchorblock - * + * * Anchorblock is for displaying tet that contains markup with anchors like: * \something\ in it. These will be drawn differently and will * be able to be clicked on by the user to display a popup. This popup then * is intended to contain extra options such as "call", "add to contacts", * "open web page" etc. - * + * * Signals that you can add callbacks for are: - * + * * anchor,clicked - achor called was clicked. event_info is anchor info - * Elm_Entry_Anchorview_Info */ @@ -87,11 +87,11 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info) Evas_Object *hover_parent; Elm_Entry_Anchorblock_Info ei; Evas_Coord x, w, y, h, px, py; - + wd->pop = elm_icon_add(obj); evas_object_move(wd->pop, info->x, info->y); evas_object_resize(wd->pop, info->w, info->h); - + wd->hover = elm_hover_add(obj); if (wd->hover_style) elm_hover_style_set(wd->hover, wd->hover_style); hover_parent = wd->hover_parent; @@ -114,13 +114,13 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info) px = info->x + (info->w / 2); py = info->y + (info->h / 2); ei.hover_left = 1; - if (px < (x + (w / 3))) ei.hover_left = 0; + if (px < (x + (w / 3))) ei.hover_left = 0; ei.hover_right = 1; - if (px > (x + ((w * 2) / 3))) ei.hover_right = 0; + if (px > (x + ((w * 2) / 3))) ei.hover_right = 0; ei.hover_top = 1; - if (py < (y + (h / 3))) ei.hover_top = 0; + if (py < (y + (h / 3))) ei.hover_top = 0; ei.hover_bottom = 1; - if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0; + if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0; evas_object_smart_callback_call(data, "anchor,clicked", &ei); evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data); evas_object_show(wd->hover); @@ -135,10 +135,10 @@ _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info) /** * Add a new Anchorblock object - * + * * @param parent The parent object * @return The new object or NULL if it cannot be created - * + * * @ingroup Anchorblock */ EAPI Evas_Object * @@ -147,7 +147,7 @@ elm_anchorblock_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -156,35 +156,35 @@ elm_anchorblock_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); - + wd->entry = elm_entry_add(parent); elm_widget_resize_object_set(obj, wd->entry); elm_entry_editable_set(wd->entry, 0); evas_object_size_hint_weight_set(wd->entry, 1.0, 1.0); evas_object_size_hint_align_set(wd->entry, -1.0, -1.0); - + evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - + elm_entry_entry_set(wd->entry, ""); - + evas_object_smart_callback_add(wd->entry, "anchor,clicked", _anchor_clicked, obj); - + _sizing_eval(obj); return obj; } /** * Set the text markup of the anchorblock - * + * * This sets the text of the anchorblock to be the text given as @p text. This * text is in markup format with \ beginning an achor with the * string link of 'XXX', and \ or \ ending the link. Other markup can * be used dependign on the style support. - * + * * @param obj The anchorblock object * @param text The text to set, or NULL to clear - * + * * @ingroup Anchorblock */ EAPI void @@ -201,13 +201,13 @@ elm_anchorblock_text_set(Evas_Object *obj, const char *text) /** * Set the parent of the hover popup - * + * * This sets the parent of the hover that anchorblock will create. See hover * objects for more information on this. - * + * * @param obj The anchorblock object * @param parent The parent the hover should use - * + * * @ingroup Anchorblock */ EAPI void @@ -223,13 +223,13 @@ elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent) /** * Set the style that the hover should use - * + * * This sets the style for the hover that anchorblock will create. See hover * objects for more information - * + * * @param obj The anchorblock object * @param style The style to use - * + * * @ingroup Anchorblock */ EAPI void @@ -239,15 +239,15 @@ elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style) if (wd->hover_style) eina_stringshare_del(wd->hover_style); wd->hover_style = NULL; if (style) wd->hover_style = eina_stringshare_add(style); -} +} /** * Stop the hover popup in the anchorblock - * + * * This will stop the hover popup in the anchorblock if it is currently active. - * + * * @param obj The anchorblock object - * + * * @ingroup Anchorblock */ EAPI void diff --git a/legacy/elementary/src/lib/elc_anchorview.c b/legacy/elementary/src/lib/elc_anchorview.c index b6e36003e8..b9a9899611 100644 --- a/legacy/elementary/src/lib/elc_anchorview.c +++ b/legacy/elementary/src/lib/elc_anchorview.c @@ -3,12 +3,12 @@ /** * @defgroup Anchorview Anchorview - * + * * This is just like the Anchorblock object, but provides a scroller to hold * the text automatically. - * + * * Signals that you can add callbacks for are: - * + * * anchor,clicked - achor called was clicked. event_info is anchor info - * Elm_Entry_Anchorview_Info */ @@ -73,11 +73,11 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info) Evas_Object *hover_parent; Elm_Entry_Anchorview_Info ei; Evas_Coord x, w, y, h, px, py; - + wd->pop = elm_icon_add(obj); evas_object_move(wd->pop, info->x, info->y); evas_object_resize(wd->pop, info->w, info->h); - + wd->hover = elm_hover_add(obj); if (wd->hover_style) elm_hover_style_set(wd->hover, wd->hover_style); hover_parent = wd->hover_parent; @@ -100,13 +100,13 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info) px = info->x + (info->w / 2); py = info->y + (info->h / 2); ei.hover_left = 1; - if (px < (x + (w / 3))) ei.hover_left = 0; + if (px < (x + (w / 3))) ei.hover_left = 0; ei.hover_right = 1; - if (px > (x + ((w * 2) / 3))) ei.hover_right = 0; + if (px > (x + ((w * 2) / 3))) ei.hover_right = 0; ei.hover_top = 1; - if (py < (y + (h / 3))) ei.hover_top = 0; + if (py < (y + (h / 3))) ei.hover_top = 0; ei.hover_bottom = 1; - if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0; + if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0; evas_object_smart_callback_call(data, "anchor,clicked", &ei); evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data); evas_object_show(wd->hover); @@ -133,7 +133,7 @@ elm_anchorview_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -142,7 +142,7 @@ elm_anchorview_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); - + wd->scroller = elm_scroller_add(parent); elm_widget_resize_object_set(obj, wd->scroller); wd->entry = elm_entry_add(parent); @@ -151,14 +151,14 @@ elm_anchorview_add(Evas_Object *parent) evas_object_size_hint_align_set(wd->entry, -1.0, -1.0); elm_scroller_content_set(wd->scroller, wd->entry); evas_object_show(wd->entry); - + evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - + elm_entry_entry_set(wd->entry, ""); - + evas_object_smart_callback_add(wd->entry, "anchor,clicked", _anchor_clicked, obj); - + _sizing_eval(obj); return obj; } @@ -228,7 +228,7 @@ elm_anchorview_hover_style_set(Evas_Object *obj, const char *style) if (wd->hover_style) eina_stringshare_del(wd->hover_style); wd->hover_style = NULL; if (style) wd->hover_style = eina_stringshare_add(style); -} +} /** * Stop the hover popup in the anchorview diff --git a/legacy/elementary/src/lib/elc_hoversel.c b/legacy/elementary/src/lib/elc_hoversel.c index 6a6e4e1a83..517865f8f2 100644 --- a/legacy/elementary/src/lib/elc_hoversel.c +++ b/legacy/elementary/src/lib/elc_hoversel.c @@ -3,20 +3,20 @@ /** * @defgroup Hoversel - * + * * A hoversel is a button that pops up a list of items (automatically * choosing the direction to display) that have a lable and/or an icon to * select from. It is a convenience widget to avoid the need to do all the * piecing together yourself. It is intended for a small numbr of items in * the hoversel menu (no more than 8), though is capable of many more. - * + * * Signals that you can add callbacks for are: - * + * * clicked - the user clicked the hoversel button and popped up the sel - * + * * selected - an item in the hoversel list is selected. event_info is the item * selected - Elm_Hoversel_Item - * + * * dismissed - the hover is dismissed */ typedef struct _Widget_Data Widget_Data; @@ -60,9 +60,9 @@ _del_hook(Evas_Object *obj) elm_hoversel_hover_end(obj); EINA_LIST_FREE(wd->items, it) { - eina_stringshare_del(it->label); - eina_stringshare_del(it->icon_file); - free(it); + eina_stringshare_del(it->label); + eina_stringshare_del(it->icon_file); + free(it); } free(wd); } @@ -122,25 +122,25 @@ _activate(Evas_Object *obj) EINA_LIST_FOREACH(wd->items, l, it) { - bt = elm_button_add(wd->hover); - elm_button_style_set(bt, "hoversel_vertical_entry"); - elm_button_label_set(bt, it->label); - if (it->icon_file) - { - ic = elm_icon_add(obj); - elm_icon_scale_set(ic, 0, 1); - if (it->icon_type == ELM_ICON_FILE) - elm_icon_file_set(ic, it->icon_file, NULL); - else if (it->icon_type == ELM_ICON_STANDARD) - elm_icon_standard_set(ic, it->icon_file); - elm_button_icon_set(bt, ic); - evas_object_show(ic); - } - evas_object_size_hint_weight_set(bt, 1.0, 0.0); - evas_object_size_hint_align_set(bt, -1.0, -1.0); - elm_box_pack_end(bx, bt); - evas_object_smart_callback_add(bt, "clicked", _item_clicked, it); - evas_object_show(bt); + bt = elm_button_add(wd->hover); + elm_button_style_set(bt, "hoversel_vertical_entry"); + elm_button_label_set(bt, it->label); + if (it->icon_file) + { + ic = elm_icon_add(obj); + elm_icon_scale_set(ic, 0, 1); + if (it->icon_type == ELM_ICON_FILE) + elm_icon_file_set(ic, it->icon_file, NULL); + else if (it->icon_type == ELM_ICON_STANDARD) + elm_icon_standard_set(ic, it->icon_file); + elm_button_icon_set(bt, ic); + evas_object_show(ic); + } + evas_object_size_hint_weight_set(bt, 1.0, 0.0); + evas_object_size_hint_align_set(bt, -1.0, -1.0); + elm_box_pack_end(bx, bt); + evas_object_smart_callback_add(bt, "clicked", _item_clicked, it); + evas_object_show(bt); } elm_hover_content_set @@ -148,7 +148,7 @@ _activate(Evas_Object *obj) elm_hover_best_content_location_get(wd->hover, ELM_HOVER_AXIS_VERTICAL), bx); evas_object_show(bx); - + evas_object_show(wd->hover); evas_object_smart_callback_call(obj, "clicked", NULL); } @@ -156,7 +156,7 @@ _activate(Evas_Object *obj) static void _button_clicked(void *data, Evas_Object *obj, void *event_info) { - _activate(data); + _activate(data); } static void @@ -181,7 +181,7 @@ elm_hoversel_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -190,7 +190,7 @@ elm_hoversel_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_pre_hook_set(obj, _del_pre_hook); elm_widget_del_hook_set(obj, _del_hook); - + wd->btn = elm_button_add(parent); elm_button_style_set(wd->btn, "hoversel_vertical"); elm_widget_resize_object_set(obj, wd->btn); @@ -203,7 +203,7 @@ elm_hoversel_add(Evas_Object *parent) /** * Set the Hover parent - * + * * Sets the hover parent object. See Hover objects for more information. * * @param obj The hoversel object @@ -225,7 +225,7 @@ elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent) /** * Set the hoversel button label - * + * * This sets the label of the button that is always visible (before it is * clicked and expanded). Also see elm_button_label_set(). * @@ -244,7 +244,7 @@ elm_hoversel_label_set(Evas_Object *obj, const char *label) /** * Set the icon of the hoversel button - * + * * Sets the icon of the button that is always visible (before it is clicked * and expanded). Also see elm_button_icon_set(). * @@ -263,7 +263,7 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Trigger the hoversel popup from code - * + * * This makes the hoversel popup activate with the items added being listed. * * @param obj The hoversel object @@ -281,7 +281,7 @@ elm_hoversel_hover_begin(Evas_Object *obj) /** * This ends the hoversel popup. - * + * * This will close the hoversel popup, making it disappear, if it was active. * * @param obj The hoversel object @@ -295,15 +295,15 @@ elm_hoversel_hover_end(Evas_Object *obj) if (!wd) return; if (wd->hover) { - evas_object_del(wd->hover); - wd->hover = NULL; - evas_object_smart_callback_call(obj, "dismissed", NULL); + evas_object_del(wd->hover); + wd->hover = NULL; + evas_object_smart_callback_call(obj, "dismissed", NULL); } } /** * Add an item to the hoversel button - * + * * This adds an item to the hoversel to show when it is clicked * * @param obj The hoversel object @@ -336,7 +336,7 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file /** * Delete an item from the hoversel - * + * * This deletes the item from the hoversel (should not be called while the * hoversel is active). * @@ -358,7 +358,7 @@ elm_hoversel_item_del(Elm_Hoversel_Item *it) /** * Get the data pointer passed to the item add function - * + * * This returns the data pointer supplied with elm_hoversel_item_add() that * will be passed to the select function callback. * diff --git a/legacy/elementary/src/lib/elc_notepad.c b/legacy/elementary/src/lib/elc_notepad.c index 5fbc9b8d75..54da6ad67c 100644 --- a/legacy/elementary/src/lib/elc_notepad.c +++ b/legacy/elementary/src/lib/elc_notepad.c @@ -5,17 +5,17 @@ * * The notepad is an object for quickly loading a text file, displaying it, * allowing editing of it and saving of changes back to the file loaded. - * + * * Signals that you can add callbacks for are: - * + * * NONE - * + * * A notepad object contains a scroller and an entry. It is a convenience * widget that loads a text file indicated, puts it int he scrollable entry * and allows the user to edit it. Changes are written back to the original * file after a short delay. The file to load and save to is specificed by * elm_notepad_file_set(). - */ + */ typedef struct _Widget_Data Widget_Data; struct _Widget_Data @@ -52,7 +52,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); } @@ -88,13 +88,13 @@ _load_file(const char *file) size_t size; int alloc = 0, len = 0; char *text = NULL, buf[4096]; - + f = fopen(file, "rb"); if (!f) return NULL; while ((size = fread(buf, 1, sizeof(buf), f))) { buf[size] = 0; - text = _buf_append(text, buf, &len, &alloc); + text = _buf_append(text, buf, &len, &alloc); } fclose(f); return text; @@ -104,13 +104,13 @@ static char * _load_plain(const char *file) { char *text, *text2; - + text = _load_file(file); if (text) { - text2 = elm_entry_utf8_to_markup(text); - free(text); - return text2; + text2 = elm_entry_utf8_to_markup(text); + free(text); + return text2; } return NULL; } @@ -120,7 +120,7 @@ _load(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); char *text; - + if (!wd->file) { elm_entry_entry_set(wd->entry, ""); @@ -171,12 +171,12 @@ static void _save_plain_utf8(const char *file, const char *text) { char *text2; - + text2 = elm_entry_markup_to_utf8(text); if (text2) { - _save_markup_utf8(file, text2); - free(text2); + _save_markup_utf8(file, text2); + free(text2); } } @@ -188,7 +188,7 @@ _save(Evas_Object *obj) switch (wd->format) { case ELM_TEXT_FORMAT_PLAIN_UTF8: - _save_plain_utf8(wd->file, elm_entry_entry_get(wd->entry)); + _save_plain_utf8(wd->file, elm_entry_entry_get(wd->entry)); break; case ELM_TEXT_FORMAT_MARKUP_UTF8: _save_markup_utf8(wd->file, elm_entry_entry_get(wd->entry)); @@ -219,7 +219,7 @@ _entry_changed(void *data, Evas_Object *obj, void *event_info) if (!wd->auto_write) return; wd->delay_write = ecore_timer_add(2.0, _delay_write, data); } - + /** * Add a new notepad to the parent * @@ -234,7 +234,7 @@ elm_notepad_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -244,7 +244,7 @@ elm_notepad_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_can_focus_set(obj, 1); - + wd->scroller = elm_scroller_add(parent); elm_widget_resize_object_set(obj, wd->scroller); wd->entry = elm_entry_add(parent); @@ -255,23 +255,23 @@ elm_notepad_add(Evas_Object *parent) elm_entry_entry_set(wd->entry, ""); evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj); - + wd->auto_write = EINA_TRUE; - + _sizing_eval(obj); return obj; } /** * Set the file to load text from and save text back to - * + * * @param obj The notepad object * @param file The path to the file to load and save * @param format The file format - * + * * This sets the file (and implicitly loads it) for the text to display and * then edit. All changes are written back to the file after a short delay. - * + * * @ingroup Notepad */ EAPI void diff --git a/legacy/elementary/src/lib/elm_bg.c b/legacy/elementary/src/lib/elm_bg.c index 12a7254a19..670baeae53 100644 --- a/legacy/elementary/src/lib/elm_bg.c +++ b/legacy/elementary/src/lib/elm_bg.c @@ -72,7 +72,7 @@ elm_bg_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -82,10 +82,10 @@ elm_bg_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, 0); - + wd->img = edje_object_add(e); _elm_theme_set(wd->img, "bg", "base", "default"); - elm_widget_resize_object_set(obj, wd->img); + elm_widget_resize_object_set(obj, wd->img); return obj; } @@ -95,7 +95,7 @@ elm_bg_add(Evas_Object *parent) * @param obj The bg object * @param file The file path * @param group Optional key (group in Edje) within the file - * + * * This sets the image file used in the background object. The image (or edje) * will be stretched (retaining aspect if its an image file) to completely fill * the bg object. This may mean some parts arte not visible. @@ -107,7 +107,7 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group) { Widget_Data *wd = elm_widget_data_get(obj); const char *p; - + if (wd->custom_img) { evas_object_del(wd->custom_img); @@ -125,7 +125,7 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group) wd->custom_img = edje_object_add(evas_object_evas_get(wd->img)); edje_object_file_set(wd->custom_img, file, group); } - else + else { wd->custom_img = evas_object_image_add(evas_object_evas_get(wd->img)); evas_object_event_callback_add(wd->custom_img, EVAS_CALLBACK_RESIZE, _custom_resize, wd); diff --git a/legacy/elementary/src/lib/elm_box.c b/legacy/elementary/src/lib/elm_box.c index 04e0d7d94f..c5856287f6 100644 --- a/legacy/elementary/src/lib/elm_box.c +++ b/legacy/elementary/src/lib/elm_box.c @@ -15,7 +15,7 @@ * will set the packing weight. The weights of all items being packed are added * up and if items are to be sized up to fit, those with the higher weights get * proportionally more space. - * + * */ typedef struct _Widget_Data Widget_Data; @@ -86,7 +86,7 @@ elm_box_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -94,20 +94,20 @@ elm_box_add(Evas_Object *parent) elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); - + wd->box = _els_smart_box_add(e); evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); elm_widget_resize_object_set(obj, wd->box); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + return obj; } /** * Set the horizontal orientation - * + * * By default box object arrange their contents vertically from top to bottom. * By calling this and providing @p orizontal as true, the box will become * horizontal arranging contents left to right. @@ -126,7 +126,7 @@ elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) /** * Set homogenous layout - * + * * If enabled, homogenous layout makes all items the same size. This size is * of course governed by the size of the largest item in the box. * @@ -147,10 +147,10 @@ elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous) * * This will add the @p subobj to the box object indicated at the beginning * of the box (the left or top end). - * + * * @param obj The box object * @param subobj The object to add to the box - * + * * @ingroup Box */ EAPI void @@ -166,10 +166,10 @@ elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj) * * This will add the @p subobj to the box object indicated at the end * of the box (the right or bottom end). - * + * * @param obj The box object * @param subobj The object to add to the box - * + * * @ingroup Box */ EAPI void @@ -187,7 +187,7 @@ elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj) * indicated with @p before. If @p before is not already in the box, results * are undefined. Before means either to the left of the indicated object or * above it depending on orientation. - * + * * @param obj The box object * @param subobj The object to add to the box * @param before The object before which to add it @@ -209,7 +209,7 @@ elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before) * indicated with @p after. If @p after is not already in the box, results * are undefined. After means either to the right of the indicated object or * below it depending on orientation. - * + * * @param obj The box object * @param subobj The object to add to the box * @param after The object after which to add it diff --git a/legacy/elementary/src/lib/elm_bubble.c b/legacy/elementary/src/lib/elm_bubble.c index a0e50e53f4..359c09d169 100644 --- a/legacy/elementary/src/lib/elm_bubble.c +++ b/legacy/elementary/src/lib/elm_bubble.c @@ -41,7 +41,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + edje_object_size_min_calc(wd->bbl, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); @@ -85,7 +85,7 @@ elm_bubble_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -94,13 +94,13 @@ elm_bubble_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->bbl = edje_object_add(e); _elm_theme_set(wd->bbl, "bubble", "base", "default"); elm_widget_resize_object_set(obj, wd->bbl); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -165,7 +165,7 @@ EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner) { Widget_Data *wd = elm_widget_data_get(obj); - + _elm_theme_set(wd->bbl, "bubble", corner, elm_widget_style_get(obj)); if (wd->icon) edje_object_part_swallow(wd->bbl, "elm.swallow.icon", wd->icon); diff --git a/legacy/elementary/src/lib/elm_button.c b/legacy/elementary/src/lib/elm_button.c index 0047230ce7..303b8f8ff7 100644 --- a/legacy/elementary/src/lib/elm_button.c +++ b/legacy/elementary/src/lib/elm_button.c @@ -54,7 +54,7 @@ _sizing_eval(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->btn, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); @@ -84,7 +84,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) evas_object_event_callback_del (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); wd->icon = NULL; - edje_object_message_signal_process(wd->btn); + edje_object_message_signal_process(wd->btn); _sizing_eval(obj); } } @@ -103,7 +103,7 @@ elm_button_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -112,14 +112,14 @@ elm_button_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->btn = edje_object_add(e); _elm_theme_set(wd->btn, "button", "base", "default"); edje_object_signal_callback_add(wd->btn, "elm,action,click", "", _signal_clicked, obj); elm_widget_resize_object_set(obj, wd->btn); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -134,13 +134,13 @@ elm_button_label_set(Evas_Object *obj, const char *label) if (wd->label) eina_stringshare_del(wd->label); if (label) { - wd->label = eina_stringshare_add(label); + wd->label = eina_stringshare_add(label); edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm"); edje_object_message_signal_process(wd->btn); } else { - wd->label = NULL; + wd->label = NULL; edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm"); edje_object_message_signal_process(wd->btn); } @@ -157,13 +157,13 @@ elm_button_icon_set(Evas_Object *obj, Evas_Object *icon) elm_widget_sub_object_del(obj, wd->icon); if ((icon) && (wd->icon != icon)) { - wd->icon = icon; + wd->icon = icon; elm_widget_sub_object_add(obj, icon); edje_object_part_swallow(wd->btn, "elm.swallow.content", icon); edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm"); evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); - edje_object_message_signal_process(wd->btn); + edje_object_message_signal_process(wd->btn); _sizing_eval(obj); } else diff --git a/legacy/elementary/src/lib/elm_carousel.c b/legacy/elementary/src/lib/elm_carousel.c index 99a5acb39b..bc0fd9f9e6 100644 --- a/legacy/elementary/src/lib/elm_carousel.c +++ b/legacy/elementary/src/lib/elm_carousel.c @@ -32,7 +32,7 @@ _item_show(Elm_Carousel_Item *it) { Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Coord x, y, w, h, bx, by; - + evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL); evas_object_geometry_get(it->base, &x, &y, &w, &h); elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h); @@ -48,12 +48,12 @@ _item_select(Elm_Carousel_Item *it) if (it->selected) return; EINA_LIST_FOREACH(wd->items, l, it2) { - if (it2->selected) - { - it2->selected = EINA_FALSE; - edje_object_signal_emit(it2->base, "elm,state,unselected", "elm"); - break; - } + if (it2->selected) + { + it2->selected = EINA_FALSE; + edje_object_signal_emit(it2->base, "elm,state,unselected", "elm"); + break; + } } it->selected = EINA_TRUE; edje_object_signal_emit(it->base, "elm,state,selected", "elm"); @@ -79,21 +79,21 @@ _theme_hook(Evas_Object *obj) Evas_Coord mw, mh; EINA_LIST_FOREACH(wd->items, l, it) { - if (it->selected) - edje_object_signal_emit(it->base, "elm,state,selected", "elm"); - _elm_theme_set(it->base, "carousel", "item", elm_widget_style_get(obj)); - edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale); - if (it->icon) - { - edje_extern_object_min_size_set(it->icon, - (double)wd->icon_size * _elm_config->scale, - (double)wd->icon_size * _elm_config->scale); - edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); - } - edje_object_part_text_set(it->base, "elm.text", it->label); - edje_object_size_min_calc(it->base, &mw, &mh); - evas_object_size_hint_min_set(it->base, mw, mh); - evas_object_size_hint_max_set(it->base, 9999, mh); + if (it->selected) + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + _elm_theme_set(it->base, "carousel", "item", elm_widget_style_get(obj)); + edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale); + if (it->icon) + { + edje_extern_object_min_size_set(it->icon, + (double)wd->icon_size * _elm_config->scale, + (double)wd->icon_size * _elm_config->scale); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); + } + edje_object_part_text_set(it->base, "elm.text", it->label); + edje_object_size_min_calc(it->base, &mw, &mh); + evas_object_size_hint_min_set(it->base, mw, mh); + evas_object_size_hint_max_set(it->base, 9999, mh); } _sizing_eval(obj); } @@ -123,23 +123,23 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info) Evas_Coord mw, mh, vw, vh, w, h; const Eina_List *l; Elm_Carousel_Item *it; - + elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); evas_object_size_hint_min_get(wd->bx, &mw, &mh); evas_object_geometry_get(wd->bx, NULL, NULL, &w, &h); if (vw >= mw) { - if (w != vw) evas_object_resize(wd->bx, vw, h); + if (w != vw) evas_object_resize(wd->bx, vw, h); } EINA_LIST_FOREACH(wd->items, l, it) { - if (it->selected) - { - _item_show(it); - break; - } + if (it->selected) + { + _item_show(it); + break; + } } - + } static void @@ -154,7 +154,7 @@ elm_carousel_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -164,16 +164,16 @@ elm_carousel_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, 0); - + wd->scr = elm_smart_scroller_add(e); elm_smart_scroller_theme_set(wd->scr, "carousel", "base", "default"); elm_widget_resize_object_set(obj, wd->scr); - elm_smart_scroller_policy_set(wd->scr, - ELM_SMART_SCROLLER_POLICY_AUTO, - ELM_SMART_SCROLLER_POLICY_OFF); - + elm_smart_scroller_policy_set(wd->scr, + ELM_SMART_SCROLLER_POLICY_AUTO, + ELM_SMART_SCROLLER_POLICY_OFF); + wd->icon_size = 32; - + wd->bx = _els_smart_box_add(e); _els_smart_box_orientation_set(wd->bx, 1); _els_smart_box_homogenous_set(wd->bx, 1); @@ -182,8 +182,8 @@ elm_carousel_add(Evas_Object *parent) evas_object_show(wd->bx); evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE, - _resize, obj); - + _resize, obj); + _sizing_eval(obj); return obj; } @@ -204,16 +204,16 @@ elm_carousel_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, vo it->base = edje_object_add(evas_object_evas_get(obj)); _elm_theme_set(it->base, "carousel", "item", elm_widget_style_get(obj)); edje_object_signal_callback_add(it->base, "elm,action,click", "elm", - _select, it); + _select, it); elm_widget_sub_object_add(obj, it->base); if (it->icon) { - edje_extern_object_min_size_set(it->icon, - (double)wd->icon_size * _elm_config->scale, - (double)wd->icon_size * _elm_config->scale); - edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); - evas_object_show(it->icon); - elm_widget_sub_object_add(obj, it->icon); + edje_extern_object_min_size_set(it->icon, + (double)wd->icon_size * _elm_config->scale, + (double)wd->icon_size * _elm_config->scale); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); + evas_object_show(it->icon); + elm_widget_sub_object_add(obj, it->icon); } edje_object_part_text_set(it->base, "elm.text", it->label); edje_object_size_min_calc(it->base, &mw, &mh); diff --git a/legacy/elementary/src/lib/elm_check.c b/legacy/elementary/src/lib/elm_check.c index 9c88d6078b..34bd444755 100644 --- a/legacy/elementary/src/lib/elm_check.c +++ b/legacy/elementary/src/lib/elm_check.c @@ -3,22 +3,22 @@ /** * @defgroup Check Check - * + * * The check widget allows for toggling a value between true or false (1 or 0). - * + * * Signals that you can add callbacks for are: - * + * * changed - This is called whenever the user changes the state of one of the * check object. - * - * Check objects are a lot like radio objects in layout and functionality + * + * Check objects are a lot like radio objects in layout and functionality * except they do not work as a group, but independently and only toggle the * value of a boolean from false to true (0 or 1). elm_check_state_set() sets * the boolean state (1 for true, 0 for false), and elm_check_state_get() * returns the current state. For convenience, like the radio objects, you * can set a pointer to a boolean directly with elm_check_state_pointer_set() * for it to modify. - */ + */ typedef struct _Widget_Data Widget_Data; struct _Widget_Data @@ -75,7 +75,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->chk, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); @@ -156,7 +156,7 @@ elm_check_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -165,7 +165,7 @@ elm_check_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->chk = edje_object_add(e); _elm_theme_set(wd->chk, "check", "base", "default"); edje_object_signal_callback_add(wd->chk, "elm,action,check,on", "", _signal_check_on, obj); @@ -174,7 +174,7 @@ elm_check_add(Evas_Object *parent) elm_widget_resize_object_set(obj, wd->chk); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -196,13 +196,13 @@ elm_check_label_set(Evas_Object *obj, const char *label) if (wd->label) eina_stringshare_del(wd->label); if (label) { - wd->label = eina_stringshare_add(label); + wd->label = eina_stringshare_add(label); edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm"); edje_object_message_signal_process(wd->chk); } else { - wd->label = NULL; + wd->label = NULL; edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm"); edje_object_message_signal_process(wd->chk); } @@ -217,7 +217,7 @@ elm_check_label_set(Evas_Object *obj, const char *label) * be deleted when the check object is deleted. If another icon object is set * then the previous one becomes orophaned and will no longer be deleted along * with the check. - * + * * @param obj The check object * @param icon The icon object * @@ -246,7 +246,7 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon) * * This sets the state of the check and will also set the value if pointed to * to the state supplied, but will not call any callbacks. - * + * * @param obj The check object * @param state The state to use (1 == on, 0 == off) * @@ -284,7 +284,7 @@ elm_check_state_get(const Evas_Object *obj) /** * Set a convenience pointer to a boolean to change - * + * * This sets a pointer to a boolean, that, in addition to the check objects * state will also be modified directly. To stop setting the object pointed * to simply use NULL as the statep parameter. If statep is not NULL, then @@ -316,6 +316,6 @@ elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) } else { - wd->statep = NULL; + wd->statep = NULL; } } diff --git a/legacy/elementary/src/lib/elm_clock.c b/legacy/elementary/src/lib/elm_clock.c index 7ce3d1be47..2e78ad22b8 100644 --- a/legacy/elementary/src/lib/elm_clock.c +++ b/legacy/elementary/src/lib/elm_clock.c @@ -197,7 +197,7 @@ _time_update(Evas_Object *obj) evas_object_del(wd->ampm); wd->ampm = NULL; } - + if ((wd->seconds) && (wd->am_pm)) _elm_theme_set(wd->clk, "clock", "base-all", style); else if (wd->seconds) @@ -206,8 +206,8 @@ _time_update(Evas_Object *obj) _elm_theme_set(wd->clk, "clock", "base-am_pm", style); else _elm_theme_set(wd->clk, "clock", "base", style); - edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) * _elm_config->scale); - + edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) * _elm_config->scale); + for (i = 0; i < 6; i++) { char buf[16]; @@ -215,17 +215,17 @@ _time_update(Evas_Object *obj) if ((!wd->seconds) && (i >= 4)) break; wd->digit[i] = edje_object_add(evas_object_evas_get(wd->clk)); _elm_theme_set(wd->digit[i], "clock", "flipdigit", style); - edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * _elm_config->scale); + edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * _elm_config->scale); if (wd->edit) edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm"); edje_object_signal_callback_add(wd->digit[i], "elm,action,up", "", _signal_clock_val_up, obj); edje_object_signal_callback_add(wd->digit[i], "elm,action,down", "", _signal_clock_val_down, obj); - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 2, &mh); + mw = mh = -1; + elm_coords_finger_size_adjust(1, &mw, 2, &mh); edje_object_size_min_restricted_calc(wd->digit[i], &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 2, &mh); + elm_coords_finger_size_adjust(1, &mw, 2, &mh); edje_extern_object_min_size_set(wd->digit[i], mw, mh); snprintf(buf, sizeof(buf), "d%i", i); edje_object_part_swallow(wd->clk , buf, wd->digit[i]); @@ -235,22 +235,22 @@ _time_update(Evas_Object *obj) { wd->ampm = edje_object_add(evas_object_evas_get(wd->clk)); _elm_theme_set(wd->ampm, "clock", "flipampm", style); - edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) * _elm_config->scale); + edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) * _elm_config->scale); if (wd->edit) edje_object_signal_emit(wd->ampm, "elm,state,edit,on", "elm"); edje_object_signal_callback_add(wd->ampm, "elm,action,up", "", _signal_clock_val_up, obj); edje_object_signal_callback_add(wd->ampm, "elm,action,down", "", _signal_clock_val_down, obj); - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 2, &mh); + mw = mh = -1; + elm_coords_finger_size_adjust(1, &mw, 2, &mh); edje_object_size_min_restricted_calc(wd->ampm, &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 2, &mh); + elm_coords_finger_size_adjust(1, &mw, 2, &mh); edje_extern_object_min_size_set(wd->ampm, mw, mh); edje_object_part_swallow(wd->clk , "ampm", wd->ampm); evas_object_show(wd->ampm); } - + edje_object_size_min_calc(wd->clk, &mw, &mh); evas_object_size_hint_min_set(obj, mw, mh); @@ -296,7 +296,7 @@ _time_update(Evas_Object *obj) if (wd->min != wd->cur.min) { int d1, d2, dc1, dc2; - + d1 = wd->min / 10; d2 = wd->min % 10; dc1 = wd->cur.min / 10; @@ -318,7 +318,7 @@ _time_update(Evas_Object *obj) if (wd->sec != wd->cur.sec) { int d1, d2, dc1, dc2; - + d1 = wd->sec / 10; d2 = wd->sec % 10; dc1 = wd->cur.sec / 10; @@ -337,15 +337,15 @@ _time_update(Evas_Object *obj) } } else - wd->cur.sec = -1; - + wd->cur.sec = -1; + if (wd->am_pm) { if (wd->hrs >= 12) ampm = 1; if (ampm != wd->cur.ampm) { int d1, d2, dc1, dc2; - + if (wd->cur.ampm != ampm) { msg.val = ampm; @@ -364,7 +364,7 @@ elm_clock_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -373,7 +373,7 @@ elm_clock_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->clk = edje_object_add(e); elm_widget_resize_object_set(obj, wd->clk); @@ -381,10 +381,10 @@ elm_clock_add(Evas_Object *parent) wd->cur.seconds = EINA_TRUE; wd->cur.am_pm = EINA_TRUE; wd->cur.edit = EINA_TRUE; - + _time_update(obj); _ticker(obj); - + return obj; } diff --git a/legacy/elementary/src/lib/elm_entry.c b/legacy/elementary/src/lib/elm_entry.c index 43eb47a66f..982b512e49 100644 --- a/legacy/elementary/src/lib/elm_entry.c +++ b/legacy/elementary/src/lib/elm_entry.c @@ -8,7 +8,7 @@ struct _Widget_Data Evas_Object *ent; Evas_Object *hoversel; Ecore_Job *deferred_recalc_job; - Ecore_Event_Handler *sel_notify_handler; + Ecore_Event_Handler *sel_notify_handler; Ecore_Event_Handler *sel_clear_handler; Ecore_Timer *longpress_timer; const char *cut_sel; @@ -51,7 +51,7 @@ _del_hook(Evas_Object *obj) #ifdef HAVE_ELEMENTARY_X ecore_event_handler_del(wd->sel_notify_handler); ecore_event_handler_del(wd->sel_clear_handler); -#endif +#endif if (wd->cut_sel) eina_stringshare_del(wd->cut_sel); if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job); if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer); @@ -77,7 +77,7 @@ _elm_win_recalc_job(void *data) Widget_Data *wd = elm_widget_data_get(data); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord resw, resh, minminw; - + wd->deferred_recalc_job = NULL; evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh); resh = 0; @@ -124,15 +124,15 @@ _on_focus_hook(void *data, Evas_Object *obj) if (!wd->editable) return; if (elm_widget_focus_get(obj)) { - evas_object_focus_set(wd->ent, 1); - edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); - if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); + evas_object_focus_set(wd->ent, 1); + edje_object_signal_emit(wd->ent, "elm,action,focus", "elm"); + if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON); } else { - edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm"); - evas_object_focus_set(wd->ent, 0); - if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); + edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm"); + evas_object_focus_set(wd->ent, 0); + if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF); } } @@ -142,18 +142,18 @@ _hoversel_position(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord cx, cy, cw, ch, x, y, mw, mh; evas_object_geometry_get(wd->ent, &x, &y, NULL, NULL); - edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text", - &cx, &cy, &cw, &ch); + edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text", + &cx, &cy, &cw, &ch); evas_object_size_hint_min_get(wd->hoversel, &mw, &mh); if (cw < mw) { - cx += (cw - mw) / 2; - cw = mw; + cx += (cw - mw) / 2; + cw = mw; } if (ch < mh) { - cy += (ch - mh) / 2; - ch = mh; + cy += (ch - mh) / 2; + ch = mh; } evas_object_move(wd->hoversel, x + cx, y + cy); evas_object_resize(wd->hoversel, cw, ch); @@ -205,17 +205,17 @@ _paste(void *data, Evas_Object *obj, void *event_info) if (wd->sel_notify_handler) { #ifdef HAVE_ELEMENTARY_X - Evas_Object *top; - - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - { - ecore_x_selection_primary_request - (elm_win_xwindow_get(top), - ECORE_X_SELECTION_TARGET_UTF8_STRING); - wd->selection_asked = EINA_TRUE; - } -#endif + Evas_Object *top; + + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + { + ecore_x_selection_primary_request + (elm_win_xwindow_get(top), + ECORE_X_SELECTION_TARGET_UTF8_STRING); + wd->selection_asked = EINA_TRUE; + } +#endif } } @@ -278,20 +278,20 @@ _long_press(void *data) evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, data); if (!wd->selmode) { - elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE, _select, data); - elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE, _paste, data); + elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE, _select, data); + elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE, _paste, data); } else { - elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE, _copy, data); - elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE, _cut, data); - elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE, _cancel, data); + elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE, _copy, data); + elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE, _cut, data); + elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE, _cancel, data); } if (wd->hoversel) { - _hoversel_position(data); - evas_object_show(wd->hoversel); - elm_hoversel_hover_begin(wd->hoversel); + _hoversel_position(data); + evas_object_show(wd->hoversel); + elm_hoversel_hover_begin(wd->hoversel); } wd->longpress_timer = NULL; edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0); @@ -322,9 +322,9 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) if (ev->button != 1) return; if (wd->longpress_timer) { - elm_widget_scroll_freeze_pop(data); - ecore_timer_del(wd->longpress_timer); - wd->longpress_timer = NULL; + elm_widget_scroll_freeze_pop(data); + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; } } @@ -335,49 +335,49 @@ _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) Evas_Event_Mouse_Move *ev = event_info; if (!wd->selmode) { - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) - { - if (wd->longpress_timer) - { - elm_widget_scroll_freeze_pop(data); - ecore_timer_del(wd->longpress_timer); - wd->longpress_timer = NULL; - } - } - else if (wd->longpress_timer) - { - Evas_Coord dx, dy; - - dx = wd->downx - ev->cur.canvas.x; - dx *= dx; - dy = wd->downy - ev->cur.canvas.y; - dy *= dy; - if ((dx + dy) > - ((_elm_config->finger_size / 2) * - (_elm_config->finger_size / 2))) - { - elm_widget_scroll_freeze_pop(data); - ecore_timer_del(wd->longpress_timer); - wd->longpress_timer = NULL; - } - } + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) + { + if (wd->longpress_timer) + { + elm_widget_scroll_freeze_pop(data); + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; + } + } + else if (wd->longpress_timer) + { + Evas_Coord dx, dy; + + dx = wd->downx - ev->cur.canvas.x; + dx *= dx; + dy = wd->downy - ev->cur.canvas.y; + dy *= dy; + if ((dx + dy) > + ((_elm_config->finger_size / 2) * + (_elm_config->finger_size / 2))) + { + elm_widget_scroll_freeze_pop(data); + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; + } + } } else if (wd->longpress_timer) { - Evas_Coord dx, dy; - - dx = wd->downx - ev->cur.canvas.x; - dx *= dx; - dy = wd->downy - ev->cur.canvas.y; - dy *= dy; - if ((dx + dy) > - ((_elm_config->finger_size / 2) * - (_elm_config->finger_size / 2))) - { - elm_widget_scroll_freeze_pop(data); - ecore_timer_del(wd->longpress_timer); - wd->longpress_timer = NULL; - } + Evas_Coord dx, dy; + + dx = wd->downx - ev->cur.canvas.x; + dx *= dx; + dy = wd->downy - ev->cur.canvas.y; + dy *= dy; + if ((dx + dy) > + ((_elm_config->finger_size / 2) * + (_elm_config->finger_size / 2))) + { + elm_widget_scroll_freeze_pop(data); + ecore_timer_del(wd->longpress_timer); + wd->longpress_timer = NULL; + } } } @@ -421,14 +421,14 @@ _str_append(char *str, const char *txt, int *len, int *alloc) if (txt_len <= 0) return str; if ((*len + txt_len) >= *alloc) { - char *str2; - int alloc2; - - alloc2 = *alloc + txt_len + 128; - str2 = realloc(str, alloc2); - if (!str2) return str; - *alloc = alloc2; - str = str2; + char *str2; + int alloc2; + + alloc2 = *alloc + txt_len + 128; + str2 = realloc(str, alloc2); + if (!str2) return str; + *alloc = alloc2; + str = str2; } strcpy(str + *len, txt); *len += txt_len; @@ -442,121 +442,121 @@ _mkup_to_text(const char *mkup) int str_len = 0, str_alloc = 0; char *s, *p; char *tag_start, *tag_end, *esc_start, *esc_end, *ts; - + if (!mkup) return NULL; tag_start = tag_end = esc_start = esc_end = NULL; p = (char *)mkup; s = p; for (;;) { - if ((*p == 0) || - (tag_end) || (esc_end) || - (tag_start) || (esc_start)) - { - if (tag_end) - { - char *ttag, *match; - - ttag = malloc(tag_end - tag_start); - if (ttag) - { - strncpy(ttag, tag_start + 1, tag_end - tag_start - 1); - ttag[tag_end - tag_start - 1] = 0; - if (!strcmp(ttag, "br")) - str = _str_append(str, "\n", &str_len, &str_alloc); - else if (!strcmp(ttag, "\n")) - str = _str_append(str, "\n", &str_len, &str_alloc); - else if (!strcmp(ttag, "\\n")) - str = _str_append(str, "\n", &str_len, &str_alloc); - else if (!strcmp(ttag, "\t")) - str = _str_append(str, "\t", &str_len, &str_alloc); - else if (!strcmp(ttag, "\\t")) - str = _str_append(str, "\t", &str_len, &str_alloc); - free(ttag); - } - tag_start = tag_end = NULL; - } - else if (esc_end) - { - ts = malloc(esc_end - esc_start + 1); - if (ts) - { - const char *esc; - strncpy(ts, esc_start, esc_end - esc_start); - ts[esc_end - esc_start] = 0; - esc = evas_textblock_escape_string_get(ts); - if (esc) - str = _str_append(str, esc, &str_len, &str_alloc); - free(ts); - } - esc_start = esc_end = NULL; - } - else if (*p == 0) - { - ts = malloc(p - s + 1); - if (ts) - { - strncpy(ts, s, p - s); - ts[p - s] = 0; - str = _str_append(str, ts, &str_len, &str_alloc); - free(ts); - } - s = NULL; - } - if (*p == 0) - break; - } - if (*p == '<') - { - if (!esc_start) - { - tag_start = p; - tag_end = NULL; - ts = malloc(p - s + 1); - if (ts) - { - strncpy(ts, s, p - s); - ts[p - s] = 0; - str = _str_append(str, ts, &str_len, &str_alloc); - free(ts); - } - s = NULL; - } - } - else if (*p == '>') - { - if (tag_start) - { - tag_end = p; - s = p + 1; - } - } - else if (*p == '&') - { - if (!tag_start) - { - esc_start = p; - esc_end = NULL; - ts = malloc(p - s + 1); - if (ts) - { - strncpy(ts, s, p - s); - ts[p - s] = 0; - str = _str_append(str, ts, &str_len, &str_alloc); - free(ts); - } - s = NULL; - } - } - else if (*p == ';') - { - if (esc_start) - { - esc_end = p; - s = p + 1; - } - } - p++; + if ((*p == 0) || + (tag_end) || (esc_end) || + (tag_start) || (esc_start)) + { + if (tag_end) + { + char *ttag, *match; + + ttag = malloc(tag_end - tag_start); + if (ttag) + { + strncpy(ttag, tag_start + 1, tag_end - tag_start - 1); + ttag[tag_end - tag_start - 1] = 0; + if (!strcmp(ttag, "br")) + str = _str_append(str, "\n", &str_len, &str_alloc); + else if (!strcmp(ttag, "\n")) + str = _str_append(str, "\n", &str_len, &str_alloc); + else if (!strcmp(ttag, "\\n")) + str = _str_append(str, "\n", &str_len, &str_alloc); + else if (!strcmp(ttag, "\t")) + str = _str_append(str, "\t", &str_len, &str_alloc); + else if (!strcmp(ttag, "\\t")) + str = _str_append(str, "\t", &str_len, &str_alloc); + free(ttag); + } + tag_start = tag_end = NULL; + } + else if (esc_end) + { + ts = malloc(esc_end - esc_start + 1); + if (ts) + { + const char *esc; + strncpy(ts, esc_start, esc_end - esc_start); + ts[esc_end - esc_start] = 0; + esc = evas_textblock_escape_string_get(ts); + if (esc) + str = _str_append(str, esc, &str_len, &str_alloc); + free(ts); + } + esc_start = esc_end = NULL; + } + else if (*p == 0) + { + ts = malloc(p - s + 1); + if (ts) + { + strncpy(ts, s, p - s); + ts[p - s] = 0; + str = _str_append(str, ts, &str_len, &str_alloc); + free(ts); + } + s = NULL; + } + if (*p == 0) + break; + } + if (*p == '<') + { + if (!esc_start) + { + tag_start = p; + tag_end = NULL; + ts = malloc(p - s + 1); + if (ts) + { + strncpy(ts, s, p - s); + ts[p - s] = 0; + str = _str_append(str, ts, &str_len, &str_alloc); + free(ts); + } + s = NULL; + } + } + else if (*p == '>') + { + if (tag_start) + { + tag_end = p; + s = p + 1; + } + } + else if (*p == '&') + { + if (!tag_start) + { + esc_start = p; + esc_end = NULL; + ts = malloc(p - s + 1); + if (ts) + { + strncpy(ts, s, p - s); + ts[p - s] = 0; + str = _str_append(str, ts, &str_len, &str_alloc); + free(ts); + } + s = NULL; + } + } + else if (*p == ';') + { + if (esc_start) + { + esc_end = p; + s = p + 1; + } + } + p++; } return str; } @@ -567,27 +567,27 @@ _text_to_mkup(const char *text) char *str = NULL; int str_len = 0, str_alloc = 0; int ch, pos = 0, pos2 = 0; - + if (!text) return NULL; for (;;) { - // FIXME: use evas_string_char_next_get() - pos = pos2; - ch = evas_common_font_utf8_get_next((unsigned char *)(text), &pos2); - if (ch <= 0) break; - if (ch == '\n') str = _str_append(str, "
", &str_len, &str_alloc); - else if (ch == '\t') str = _str_append(str, "<\t>", &str_len, &str_alloc); - else if (ch == '<') str = _str_append(str, "<", &str_len, &str_alloc); - else if (ch == '>') str = _str_append(str, ">", &str_len, &str_alloc); - else if (ch == '&') str = _str_append(str, "&", &str_len, &str_alloc); - else - { - char tstr[16]; - - strncpy(tstr, text + pos, pos2 - pos); - tstr[pos2 - pos] = 0; - str = _str_append(str, tstr, &str_len, &str_alloc); - } + // FIXME: use evas_string_char_next_get() + pos = pos2; + ch = evas_common_font_utf8_get_next((unsigned char *)(text), &pos2); + if (ch <= 0) break; + if (ch == '\n') str = _str_append(str, "
", &str_len, &str_alloc); + else if (ch == '\t') str = _str_append(str, "<\t>", &str_len, &str_alloc); + else if (ch == '<') str = _str_append(str, "<", &str_len, &str_alloc); + else if (ch == '>') str = _str_append(str, ">", &str_len, &str_alloc); + else if (ch == '&') str = _str_append(str, "&", &str_len, &str_alloc); + else + { + char tstr[16]; + + strncpy(tstr, text + pos, pos2 - pos); + tstr[pos2 - pos] = 0; + str = _str_append(str, tstr, &str_len, &str_alloc); + } } return str; } @@ -609,26 +609,26 @@ _signal_selection_start(void *data, Evas_Object *obj, const char *emission, cons Evas_Object *entry; EINA_LIST_FOREACH(entries, l, entry) { - if (entry != data) elm_entry_select_none(entry); + if (entry != data) elm_entry_select_none(entry); } wd->have_selection = EINA_TRUE; evas_object_smart_callback_call(data, "selection,start", NULL); if (wd->sel_notify_handler) { - char *txt = _mkup_to_text(elm_entry_selection_get(data)); - if (txt) - { + char *txt = _mkup_to_text(elm_entry_selection_get(data)); + if (txt) + { #ifdef HAVE_ELEMENTARY_X - Evas_Object *top; - - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - ecore_x_selection_primary_set - (elm_win_xwindow_get(top), txt, strlen(txt)); -#endif - free(txt); - } - } + Evas_Object *top; + + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + ecore_x_selection_primary_set + (elm_win_xwindow_get(top), txt, strlen(txt)); +#endif + free(txt); + } + } } static void @@ -639,19 +639,19 @@ _signal_selection_changed(void *data, Evas_Object *obj, const char *emission, co evas_object_smart_callback_call(data, "selection,changed", NULL); if (wd->sel_notify_handler) { - char *txt = _mkup_to_text(elm_entry_selection_get(data)); - if (txt) - { + char *txt = _mkup_to_text(elm_entry_selection_get(data)); + if (txt) + { #ifdef HAVE_ELEMENTARY_X - Evas_Object *top; - - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - ecore_x_selection_primary_set - (elm_win_xwindow_get(top), txt, strlen(txt)); -#endif - free(txt); - } + Evas_Object *top; + + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + ecore_x_selection_primary_set + (elm_win_xwindow_get(top), txt, strlen(txt)); +#endif + free(txt); + } } } @@ -664,38 +664,38 @@ _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, co evas_object_smart_callback_call(data, "selection,cleared", NULL); if (wd->sel_notify_handler) { - if (wd->cut_sel) - { + if (wd->cut_sel) + { #ifdef HAVE_ELEMENTARY_X - Evas_Object *top; - - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - { - char *t; - - t = _mkup_to_text(wd->cut_sel); - if (t) - { - ecore_x_selection_primary_set - (elm_win_xwindow_get(top), t, strlen(t)); - free(t); - } - } -#endif - eina_stringshare_del(wd->cut_sel); - wd->cut_sel = NULL; - } - else - { + Evas_Object *top; + + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + { + char *t; + + t = _mkup_to_text(wd->cut_sel); + if (t) + { + ecore_x_selection_primary_set + (elm_win_xwindow_get(top), t, strlen(t)); + free(t); + } + } +#endif + eina_stringshare_del(wd->cut_sel); + wd->cut_sel = NULL; + } + else + { #ifdef HAVE_ELEMENTARY_X - Evas_Object *top; - - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - ecore_x_selection_primary_clear(); -#endif - } + Evas_Object *top; + + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + ecore_x_selection_primary_clear(); +#endif + } } } @@ -707,17 +707,17 @@ _signal_entry_paste_request(void *data, Evas_Object *obj, const char *emission, if (wd->sel_notify_handler) { #ifdef HAVE_ELEMENTARY_X - Evas_Object *top; - - top = elm_widget_top_get(data); - if ((top) && (elm_win_xwindow_get(top))) - { - ecore_x_selection_primary_request - (elm_win_xwindow_get(top), - ECORE_X_SELECTION_TARGET_UTF8_STRING); - wd->selection_asked = EINA_TRUE; - } -#endif + Evas_Object *top; + + top = elm_widget_top_get(data); + if ((top) && (elm_win_xwindow_get(top))) + { + ecore_x_selection_primary_request + (elm_win_xwindow_get(top), + ECORE_X_SELECTION_TARGET_UTF8_STRING); + wd->selection_asked = EINA_TRUE; + } +#endif } } @@ -739,8 +739,8 @@ _signal_entry_cut_notify(void *data, Evas_Object *obj, const char *emission, con txt = _mkup_to_text(elm_entry_selection_get(data)); if (txt) { - wd->cut_sel = eina_stringshare_add(txt); - free(txt); + wd->cut_sel = eina_stringshare_add(txt); + free(txt); } edje_object_part_text_insert(wd->ent, "elm.text", ""); wd->changed = EINA_TRUE; @@ -758,11 +758,11 @@ _signal_cursor_changed(void *data, Evas_Object *obj, const char *emission, const elm_widget_show_region_set(data, cx, cy, cw, ch); else { - wd->deferred_cur = EINA_TRUE; - wd->cx = cx; - wd->cy = cy; - wd->cw = cw; - wd->ch = ch; + wd->deferred_cur = EINA_TRUE; + wd->cx = cx; + wd->cy = cy; + wd->cw = cw; + wd->ch = ch; } } @@ -783,7 +783,7 @@ _signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char if (p) { const Eina_List *geoms; - + n = p + 1; p2 = p -1; while (p2 >= emission) @@ -809,7 +809,7 @@ _signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char evas_pointer_output_xy_get(evas_object_evas_get(wd->ent), &px, &py); EINA_LIST_FOREACH(geoms, l, r) { - if (((r->x + x) <= px) && ((r->y + y) <= py) && + if (((r->x + x) <= px) && ((r->y + y) <= py) && ((r->x + x + r->w) > px) && ((r->y + y + r->h) > py)) { ei.x = r->x + x; @@ -859,26 +859,26 @@ _event_selection_notify(void *data, int type, void *event) if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) || (ev->selection == ECORE_X_SELECTION_PRIMARY)) { - Ecore_X_Selection_Data_Text *text_data; - - text_data = ev->data; - if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT) - { - if (text_data->text) - { - char *txt = _text_to_mkup(text_data->text); - if (txt) - { - elm_entry_entry_insert(data, txt); - free(txt); - } - } - } - wd->selection_asked = EINA_FALSE; + Ecore_X_Selection_Data_Text *text_data; + + text_data = ev->data; + if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT) + { + if (text_data->text) + { + char *txt = _text_to_mkup(text_data->text); + if (txt) + { + elm_entry_entry_insert(data, txt); + free(txt); + } + } + } + wd->selection_asked = EINA_FALSE; } return 1; } - + static int _event_selection_clear(void *data, int type, void *event) { @@ -888,7 +888,7 @@ _event_selection_clear(void *data, int type, void *event) if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) || (ev->selection == ECORE_X_SELECTION_PRIMARY)) { - elm_entry_select_none(data); + elm_entry_select_none(data); } return 1; } @@ -900,7 +900,7 @@ elm_entry_add(Evas_Object *parent) Evas_Object *obj, *top; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -914,14 +914,14 @@ elm_entry_add(Evas_Object *parent) wd->linewrap = EINA_TRUE; wd->editable = EINA_TRUE; - + wd->ent = edje_object_add(e); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOVE, _move, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_RESIZE, _resize, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, obj); - + _elm_theme_set(wd->ent, "entry", "base", "default"); edje_object_signal_callback_add(wd->ent, "entry,changed", "elm.text", _signal_entry_changed, obj); edje_object_signal_callback_add(wd->ent, "selection,start", "elm.text", _signal_selection_start, obj); @@ -945,15 +945,15 @@ elm_entry_add(Evas_Object *parent) top = elm_widget_top_get(obj); if ((top) && (elm_win_xwindow_get(top))) { - wd->sel_notify_handler = - ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, - _event_selection_notify, obj); - wd->sel_clear_handler = - ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, - _event_selection_clear, obj); + wd->sel_notify_handler = + ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, + _event_selection_notify, obj); + wd->sel_clear_handler = + ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR, + _event_selection_clear, obj); } #endif - + entries = eina_list_prepend(entries, obj); return obj; } @@ -1004,7 +1004,7 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry) EINA_LIST_FOREACH(an, l, anchor) printf("ANCHOR: %s\n", anchor); } -#endif +#endif wd->changed = EINA_TRUE; _sizing_eval(obj); } @@ -1068,9 +1068,9 @@ elm_entry_select_none(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (wd->selmode) { - wd->selmode = EINA_FALSE; - edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0); - edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); + wd->selmode = EINA_FALSE; + edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0); + edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); } wd->have_selection = EINA_FALSE; edje_object_part_text_select_none(wd->ent, "elm.text"); @@ -1082,9 +1082,9 @@ elm_entry_select_all(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (wd->selmode) { - wd->selmode = EINA_FALSE; - edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0); - edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); + wd->selmode = EINA_FALSE; + edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0); + edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm"); } wd->have_selection = EINA_TRUE; edje_object_part_text_select_all(wd->ent, "elm.text"); diff --git a/legacy/elementary/src/lib/elm_frame.c b/legacy/elementary/src/lib/elm_frame.c index 94bcc79787..094ff48a0b 100644 --- a/legacy/elementary/src/lib/elm_frame.c +++ b/legacy/elementary/src/lib/elm_frame.c @@ -38,7 +38,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + edje_object_size_min_calc(wd->frm, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); @@ -72,7 +72,7 @@ elm_frame_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -81,13 +81,13 @@ elm_frame_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->frm = edje_object_add(e); _elm_theme_set(wd->frm, "frame", "base", "default"); elm_widget_resize_object_set(obj, wd->frm); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index ce1aa898b7..de5b14ca5b 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -3,51 +3,51 @@ /** * @defgroup Genlist Genlist - * - * The aim was to have more expansive list that the simple list in + * + * The aim was to have more expansive list that the simple list in * Elementary that could have more flexible items and allow many more entries * while still being fast and low on memory usage. At the same time it was * also made to be able to do tree structures. But the price to pay is more * complexity when it comes to usage. If all you want is a simple list with * icons and a single label, use the normal List object. - * + * * Signals that you can add callbacks for are: - * + * * clicked - This is called when a user has double-clicked an item. The * event_info parameter is the genlist item that as double-clicked. - * + * * selected - This is called when a user has made an item selected. The * event_info parameter is the genlist item that was selected. - * + * * unselected - This is called when a user has made an item unselected. The * event_info parameter is the genlist item that was unselected. - * + * * expanded - This is called when elm_genlist_item_expanded_set() is called * and the item is now meant to be expanded. The event_info parameter is the * genlist item that was indicated to expand. It is the job of this callback * to then fill in the child items. - * + * * contracted - This is called when elm_genlist_item_expanded_set() is called * and the item is now meant to be contracted. The event_info parameter is * the genlist item that was indicated to contract. It is the job of this * callback to then delete the child items - * + * * expand,request - This is called when a user has indicated they want to * expand a tree branch item. The callback should decide if the item can * expand (has any children) and then call elm_genlist_item_expanded_set() * appropriately to set the state. The event_info parameter is the genlist * item that was indicated to expand. - * + * * contract,request - This is called when a user has indicated they want to * contract a tree branch item. The callback should decide if the item can * contract (has any children) and then call elm_genlist_item_expanded_set() * appropriately to set the state. The event_info parameter is the genlist * item that was indicated to contract. - * + * * Genlist has a fairly large API, mostly because it's relatively complex, * trying to be both expansive, powerful and efficient. First we will begin * an overview o the theory behind genlist. - * + * * Evas tracks every object you create. Every time it processes an event * (mouse move, down, up etc.) it needs to walk through objects and find out * what event that affects. Even worse every time it renders display updates, @@ -69,13 +69,13 @@ * time, actually appearing some time later, so if your list has many members * you may find it takes a while for them to all appear, with your process * consuming a lot of CPU while it is busy spooling. - * + * * Genlist also implements a tree structure, but it does so with callbacks to * the application, with the application filling in tree structures when * requested (allowing for efficient building of a very deep tree that could * even be used for file-management). See the above smart signal callbacks for * details. - * + * * An item in the genlist world can have 0 or more text labels (they can be * regular text or textblock – that's up to the style to determine), 0 or * more icons (which are simply objects swallowed into the genlist item) and @@ -83,7 +83,7 @@ * indicators by the edje theme style. An item may be one of several styles * (Elementary provides 2 by default - “default” and “double_label”, but this * can be extended by system or application custom themes/overlays/extensions). - * + * * In order to implement the ability to add and delete items on the fly, * Genlist implements a class/callback system where the application provides * a structure with information about that type of item (genlist may contain @@ -92,10 +92,10 @@ * “realized” (that is created dynamically while scrolling). All objects will * simply be deleted when no longer needed with evas_object_del(). The * Elm_Genlist_Item_Class structure contains the following members: - * + * * item_style - This is a constant string and simply defines the name of the * item style. It must be specified and the default should be “default”. - * + * * func.label_get - This function is called when an actual item object is * created. The data parameter is the data parameter passed to * elm_genlist_item_append() and related item creation functions. The obj @@ -103,7 +103,7 @@ * of the text part in the edje design that is listed as one of the possible * labels that can be set. This function must return a strudup()'ed string as * the caller will free() it when done. - * + * * func.icon_get - This function is called when an actual item object is * created. The data parameter is the data parameter passed to * elm_genlist_item_append() and related item creation functions. The obj @@ -112,7 +112,7 @@ * icons that can be set. This must return NULL for no object or a valid * object. The object will be deleted by genlist on shutdown or when the item * its unrealized. - * + * * func.state_get - This function is called when an actual item object is * created. The data parameter is the data parameter passed to * elm_genlist_item_append() and related item creation functions. The obj @@ -120,15 +120,15 @@ * of the state part in the edje design that is listed as one of the possible * states that can be set. Return 0 for false or 1 for true. Genlist will * emit a signal to the edje object with “elm,state,XXX,active” “elm” when - * true (the default is false), where XXX is the name of the part. - * + * true (the default is false), where XXX is the name of the part. + * * func.del - This is called when elm_genlist_item_del() is called on an * item, elm_genlist_clear() is called on the genlist, or * elm_genlist_item_subitems_clear() is called to clear sub-items. This is * intended for use when actual genlist items are deleted, so any backing * data attached to the item (e.g. its data parameter on creation) can be * deleted. - * + * * Items can be added by several calls. All of them return a Elm_Genlist_Item * handle that is an internal member inside the genlist. They all take a data * parameter that is meant to be used for a handle to the applications @@ -141,19 +141,19 @@ * convenience callback that is called when the item is selected and the data * parameter will be the func_data parameter, obj be the genlist object and * vent_info will be the genlist item. - * + * * elm_genlist_item_append() appends an item to the end of the list, or if * there is a parent, to the end of all the child items of the parent. * elm_genlist_item_prepend() is the same but prepends to the beginning of * the list or children list. elm_genlist_item_insert_before() inserts at * item before another item and elm_genlist_item_insert_after() inserts after * the indicated item. - * + * * The application can clear the list with elm_genlist_clear() which deletes * all the items in the list and elm_genlist_item_del() will delete a specific * item. elm_genlist_item_subitems_clear() will clear all items that are * children of the indicated parent item. - * + * * If the application wants multiple items to be able to be selected, * elm_genlist_multi_select_set() can enable this. If the list is * single-selection only (the default), then elm_genlist_selected_item_get() @@ -161,7 +161,7 @@ * list is multi-select then elm_genlist_selected_items_get() will return a * list (that is only valid as long as no items are modified (added, deleted, * selected or unselected). - * + * * To help inspect list items you can jump to the item at the top of the list * with elm_genlist_first_item_get() which will return the item pointer, and * similarly elm_genlist_last_item_get() gets the item at the end of the list. @@ -171,18 +171,18 @@ * the items are flattened in the list, so elm_genlist_item_parent_get() will * let you know which item is the parent (and thus know how to skip them if * wanted). - * + * * There are also convenience functions. elm_genlist_item_genlist_get() will * return the genlist object the item belongs to. elm_genlist_item_show() * will make the scroller scroll to show that specific item so its visible. * elm_genlist_item_data_get() returns the data pointer set by the item * creation functions. - * + * * If an item changes (state of boolean changes, label or icons change), * then use elm_genlist_item_update() to have genlist update the item with * the new state. Genlist will re-realize the item thus call the functions - * in the _Elm_Genlist_Item_Class for that item. - * + * in the _Elm_Genlist_Item_Class for that item. + * * To programmatically (un)select an item use elm_genlist_item_selected_set(). * To get its selected state use elm_genlist_item_selected_get(). Similarly * to expand/contract and item and get its expanded state, use @@ -190,7 +190,7 @@ * again to make an item disabled (unable to be selected and appear * differently) use elm_genlist_item_disabled_set() to set this and * elm_genlist_item_disabled_get() to get the disabled state. - * + * * In general to indicate how the genlist should expand items horizontally to * fill the list area, use elm_genlist_horizontal_mode_set(). Valid modes are * ELM_LIST_LIMIT and ELM_LIST_SCROLL . The default is ELM_LIST_SCROLL. This @@ -200,7 +200,7 @@ * to the viewport width and limited to that size. This can be combined with * a different style that uses edjes' ellipsis feature (cutting text off like * this: “tex...”). - * + * * Items will only call their selection func and callback when first becoming * selected. Any further clicks will do nothing, unless you enable always * select with elm_genlist_always_select_mode_set(). This means even if @@ -208,7 +208,7 @@ * elm_genlist_no_select_mode_set() will turn off the ability to select * items entirely and they will neither appear selected nor call selected * callback functions. - * + * * Remember that you can create new styles and add you own theme augmentation * per application with elm_theme_extension_add(). If you absolutely must * have a specific style that overrides any theme the user or system sets up @@ -267,16 +267,16 @@ struct _Elm_Genlist_Item void (*func) (void *data, Evas_Object *obj, void *event_info); const void *data; } func; - + Evas_Object *base; Evas_Object *spacer; Eina_List *labels, *icons, *states; Eina_List *icon_objs; - + Elm_Genlist_Item *rel; int relcount; Eina_Bool before : 1; - + Eina_Bool realized : 1; Eina_Bool selected : 1; Eina_Bool hilighted : 1; @@ -303,7 +303,7 @@ static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _item_unrealize(Elm_Genlist_Item *it); static void _item_block_unrealize(Item_Block *itb); static void _calc_job(void *data); - + static Evas_Smart_Class _pan_sc = {NULL}; static void @@ -325,16 +325,16 @@ _theme_hook(Evas_Object *obj) edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); EINA_INLIST_FOREACH(wd->blocks, itb) { - if (itb->realized) _item_block_unrealize(itb); + if (itb->realized) _item_block_unrealize(itb); Eina_List *l; Elm_Genlist_Item *it; EINA_LIST_FOREACH(itb->items, l, it) - { - it->mincalcd = EINA_FALSE; - } + { + it->mincalcd = EINA_FALSE; + } - itb->changed = EINA_TRUE; + itb->changed = EINA_TRUE; } if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); @@ -372,19 +372,19 @@ _stringlist_get(const char *str) if (!str) return NULL; for (b = s = str; 1; s++) { - if ((*s == ' ') || (*s == 0)) - { - char *t = malloc(s - b + 1); - if (t) - { - strncpy(t, b, s - b); - t[s - b] = 0; - list = eina_list_append(list, eina_stringshare_add(t)); - free(t); - } - b = s + 1; - } - if (*s == 0) break; + if ((*s == ' ') || (*s == 0)) + { + char *t = malloc(s - b + 1); + if (t) + { + strncpy(t, b, s - b); + t[s - b] = 0; + list = eina_list_append(list, eina_stringshare_add(t)); + free(t); + } + b = s + 1; + } + if (*s == 0) break; } return list; } @@ -419,8 +419,8 @@ _item_select(Elm_Genlist_Item *it) if (it->delete_me) return; if (it->selected) { - if (it->wd->always_select) goto call; - return; + if (it->wd->always_select) goto call; + return; } it->selected = EINA_TRUE; it->wd->selected = eina_list_append(it->wd->selected, it); @@ -440,15 +440,15 @@ _item_unselect(Elm_Genlist_Item *it) selectraise = edje_object_data_get(it->base, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) { - if ((stacking) && (!strcmp(stacking, "below"))) - evas_object_lower(it->base); + if ((stacking) && (!strcmp(stacking, "below"))) + evas_object_lower(it->base); } it->hilighted = EINA_FALSE; if (it->selected) { - it->selected = EINA_FALSE; - it->wd->selected = eina_list_remove(it->wd->selected, it); - evas_object_smart_callback_call(it->wd->obj, "unselected", it); + it->selected = EINA_FALSE; + it->wd->selected = eina_list_remove(it->wd->selected, it); + evas_object_smart_callback_call(it->wd->obj, "unselected", it); } } @@ -459,11 +459,11 @@ _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) Evas_Event_Mouse_Move *ev = event_info; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) { - if (!it->wd->on_hold) - { - it->wd->on_hold = EINA_TRUE; - _item_unselect(it); - } + if (!it->wd->on_hold) + { + it->wd->on_hold = EINA_TRUE; + _item_unselect(it); + } } } @@ -489,18 +489,18 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) else it->wd->on_hold = EINA_FALSE; if (it->wd->on_hold) { - it->wd->on_hold = EINA_FALSE; - return; + it->wd->on_hold = EINA_FALSE; + return; } if (it->disabled) return; if (it->wd->multi) { - if (!it->selected) - { - _item_hilight(it); - _item_select(it); - } - else _item_unselect(it); + if (!it->selected) + { + _item_hilight(it); + _item_select(it); + } + else _item_unselect(it); } else { @@ -509,18 +509,18 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) Widget_Data *wd = it->wd; while (wd->selected) _item_unselect(wd->selected->data); - _item_hilight(it); + _item_hilight(it); _item_select(it); } else { const Eina_List *l, *l_next; Elm_Genlist_Item *it2; - EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2) - if (it2 != it) _item_unselect(it2); - _item_hilight(it); + EINA_LIST_FOREACH_SAFE(it->wd->selected, l, l_next, it2) + if (it2 != it) _item_unselect(it2); + _item_hilight(it); _item_select(it); - } + } } } @@ -558,7 +558,7 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) const char *treesize; char buf[1024]; int depth, tsize = 20; - + if (it->realized) return; if (it->delete_me) return; it->base = edje_object_add(evas_object_evas_get(it->wd->obj)); @@ -567,17 +567,17 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) elm_widget_sub_object_add(it->wd->obj, it->base); if (it->flags & ELM_GENLIST_ITEM_SUBITEMS) { - if (in & 0x1) - snprintf(buf, sizeof(buf), "%s/%s", "tree_odd", it->itc->item_style); - else - snprintf(buf, sizeof(buf), "%s/%s", "tree", it->itc->item_style); + if (in & 0x1) + snprintf(buf, sizeof(buf), "%s/%s", "tree_odd", it->itc->item_style); + else + snprintf(buf, sizeof(buf), "%s/%s", "tree", it->itc->item_style); } else { - if (in & 0x1) - snprintf(buf, sizeof(buf), "%s/%s", "item_odd", it->itc->item_style); - else - snprintf(buf, sizeof(buf), "%s/%s", "item", it->itc->item_style); + if (in & 0x1) + snprintf(buf, sizeof(buf), "%s/%s", "item_odd", it->itc->item_style); + else + snprintf(buf, sizeof(buf), "%s/%s", "item", it->itc->item_style); } _elm_theme_set(it->base, "genlist", buf, elm_widget_style_get(it->wd->obj)); it->spacer = evas_object_rectangle_add(evas_object_evas_get(it->wd->obj)); @@ -590,88 +590,88 @@ _item_realize(Elm_Genlist_Item *it, int in, int calc) edje_object_part_swallow(it->base, "elm.swallow.pad", it->spacer); if (!calc) { - edje_object_signal_callback_add(it->base, "elm,action,expand,toggle", "elm", _signal_expand_toggle, it); - edje_object_signal_callback_add(it->base, "elm,action,expand", "elm", _signal_expand, it); - edje_object_signal_callback_add(it->base, "elm,action,contract", "elm", _signal_contract, it); - stacking = edje_object_data_get(it->base, "stacking"); - if (stacking) - { - if (!strcmp(stacking, "below")) evas_object_lower(it->base); - else if (!strcmp(stacking, "above")) evas_object_raise(it->base); - } - evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN, - _mouse_down, it); - evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_UP, - _mouse_up, it); - evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move, it); - if (it->selected) - edje_object_signal_emit(it->base, "elm,state,selected", "elm"); - if (it->disabled) - edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); - if (it->expanded) - edje_object_signal_emit(it->base, "elm,state,expanded", "elm"); + edje_object_signal_callback_add(it->base, "elm,action,expand,toggle", "elm", _signal_expand_toggle, it); + edje_object_signal_callback_add(it->base, "elm,action,expand", "elm", _signal_expand, it); + edje_object_signal_callback_add(it->base, "elm,action,contract", "elm", _signal_contract, it); + stacking = edje_object_data_get(it->base, "stacking"); + if (stacking) + { + if (!strcmp(stacking, "below")) evas_object_lower(it->base); + else if (!strcmp(stacking, "above")) evas_object_raise(it->base); + } + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN, + _mouse_down, it); + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_UP, + _mouse_up, it); + evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_MOVE, + _mouse_move, it); + if (it->selected) + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + if (it->disabled) + edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); + if (it->expanded) + edje_object_signal_emit(it->base, "elm,state,expanded", "elm"); } - + if (it->itc->func.label_get) { const Eina_List *l; const char *key; - it->labels = _stringlist_get(edje_object_data_get(it->base, "labels")); + it->labels = _stringlist_get(edje_object_data_get(it->base, "labels")); EINA_LIST_FOREACH(it->labels, l, key) - { - char *s = it->itc->func.label_get(it->data, it->wd->obj, l->data); - if (s) - { - edje_object_part_text_set(it->base, l->data, s); - free(s); - } - } + { + char *s = it->itc->func.label_get(it->data, it->wd->obj, l->data); + if (s) + { + edje_object_part_text_set(it->base, l->data, s); + free(s); + } + } } if (it->itc->func.icon_get) { const Eina_List *l; const char *key; - it->icons = _stringlist_get(edje_object_data_get(it->base, "icons")); + it->icons = _stringlist_get(edje_object_data_get(it->base, "icons")); EINA_LIST_FOREACH(it->icons, l, key) - { - Evas_Object *ic = it->itc->func.icon_get(it->data, it->wd->obj, l->data); - if (ic) - { - it->icon_objs = eina_list_append(it->icon_objs, ic); - edje_object_part_swallow(it->base, key, ic); - evas_object_show(ic); - elm_widget_sub_object_add(it->wd->obj, ic); - } - } + { + Evas_Object *ic = it->itc->func.icon_get(it->data, it->wd->obj, l->data); + if (ic) + { + it->icon_objs = eina_list_append(it->icon_objs, ic); + edje_object_part_swallow(it->base, key, ic); + evas_object_show(ic); + elm_widget_sub_object_add(it->wd->obj, ic); + } + } } if (it->itc->func.state_get) { const Eina_List *l; const char *key; - it->states = _stringlist_get(edje_object_data_get(it->base, "states")); + it->states = _stringlist_get(edje_object_data_get(it->base, "states")); EINA_LIST_FOREACH(it->states, l, key) - { - Eina_Bool on = it->itc->func.state_get(it->data, it->wd->obj, l->data); - if (on) - { - snprintf(buf, sizeof(buf), "elm,state,%s,active", key); - edje_object_signal_emit(it->base, buf, "elm"); - } - } + { + Eina_Bool on = it->itc->func.state_get(it->data, it->wd->obj, l->data); + if (on) + { + snprintf(buf, sizeof(buf), "elm,state,%s,active", key); + edje_object_signal_emit(it->base, buf, "elm"); + } + } } if (!it->mincalcd) { - Evas_Coord mw = -1, mh = -1; - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - it->w = it->minw = mw; - it->h = it->minh = mh; - it->mincalcd = EINA_TRUE; + Evas_Coord mw = -1, mh = -1; + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + it->w = it->minw = mw; + it->h = it->minh = mh; + it->mincalcd = EINA_TRUE; } if (!calc) evas_object_show(it->base); it->realized = EINA_TRUE; @@ -681,7 +681,7 @@ static void _item_unrealize(Elm_Genlist_Item *it) { Evas_Object *icon; - + if (!it->realized) return; evas_object_del(it->base); it->base = NULL; @@ -710,21 +710,21 @@ _item_block_recalc(Item_Block *itb, int in) EINA_LIST_FOREACH(itb->items, l, it) { - if (it->delete_me) continue; - showme |= it->showme; - if (!itb->realized) - { - _item_realize(it, in, 1); - _item_unrealize(it); - } - else - _item_realize(it, in, 0); - minh += it->minh; - if (minw < it->minw) minw = it->minw; - in++; - it->x = 0; - it->y = y; - y += it->minw; + if (it->delete_me) continue; + showme |= it->showme; + if (!itb->realized) + { + _item_realize(it, in, 1); + _item_unrealize(it); + } + else + _item_realize(it, in, 0); + minh += it->minh; + if (minw < it->minw) minw = it->minw; + in++; + it->x = 0; + it->y = y; + y += it->minw; } itb->minw = minw; itb->minh = minh; @@ -742,9 +742,9 @@ _item_block_realize(Item_Block *itb, int in, int full) if (itb->realized) return; EINA_LIST_FOREACH(itb->items, l, it) { - if (it->delete_me) continue; - if (full) _item_realize(it, in, 0); - in++; + if (it->delete_me) continue; + if (full) _item_realize(it, in, 0); + in++; } itb->realized = EINA_TRUE; } @@ -758,7 +758,7 @@ _item_block_unrealize(Item_Block *itb) if (!itb->realized) return; EINA_LIST_FOREACH(itb->items, l, it) { - _item_unrealize(it); + _item_unrealize(it); } itb->realized = EINA_FALSE; } @@ -770,37 +770,37 @@ _item_block_position(Item_Block *itb, int in) Elm_Genlist_Item *it; Evas_Coord y = 0, ox, oy, ow, oh; int vis; - + evas_object_geometry_get(itb->wd->pan_smart, &ox, &oy, &ow, &oh); EINA_LIST_FOREACH(itb->items, l, it) { - if (it->delete_me) continue; - it->x = 0; - it->y = y; - it->w = itb->w; - vis = (ELM_RECTS_INTERSECT(itb->x + it->x - itb->wd->pan_x, - itb->y + it->y - itb->wd->pan_y, - it->w, it->h, - 0, 0, ow, oh)); - if ((itb->realized) && (!it->realized)) - { - if (vis) _item_realize(it, in, 0); - } - if (it->realized) - { - if (vis) - { - evas_object_resize(it->base, it->w, it->h); - evas_object_move(it->base, - ox + itb->x + it->x - itb->wd->pan_x, - oy + itb->y + it->y - itb->wd->pan_y); - evas_object_show(it->base); - } - else - _item_unrealize(it); - } - y += it->h; - in++; + if (it->delete_me) continue; + it->x = 0; + it->y = y; + it->w = itb->w; + vis = (ELM_RECTS_INTERSECT(itb->x + it->x - itb->wd->pan_x, + itb->y + it->y - itb->wd->pan_y, + it->w, it->h, + 0, 0, ow, oh)); + if ((itb->realized) && (!it->realized)) + { + if (vis) _item_realize(it, in, 0); + } + if (it->realized) + { + if (vis) + { + evas_object_resize(it->base, it->w, it->h); + evas_object_move(it->base, + ox + itb->x + it->x - itb->wd->pan_x, + oy + itb->y + it->y - itb->wd->pan_y); + evas_object_show(it->base); + } + else + _item_unrealize(it); + } + y += it->h; + in++; } } @@ -817,49 +817,49 @@ _calc_job(void *data) in = 0; EINA_INLIST_FOREACH(wd->blocks, itb) { - int showme = 0; - if (chb) - { - if (itb->realized) _item_block_unrealize(itb); - } - if (itb->changed) - { - if (itb->realized) _item_block_unrealize(itb); - showme = _item_block_recalc(itb, in); - chb = itb; - } - itb->y = y; - itb->x = 0; - minh += itb->minh; - if (minw == -1) minw = itb->minw; - else if (minw < itb->minw) - { - minw = itb->minw; - minw_change = 1; - } - itb->w = minw; - itb->h = itb->minh; - y += itb->h; - in += itb->count; - if (showme) - { - wd->show_item->showme = 0; - elm_smart_scroller_child_region_show(wd->scr, - wd->show_item->x + wd->show_item->block->x, - wd->show_item->y + wd->show_item->block->y, - wd->show_item->block->w, - wd->show_item->h); - wd->show_item = NULL; - showme = 0; - } + int showme = 0; + if (chb) + { + if (itb->realized) _item_block_unrealize(itb); + } + if (itb->changed) + { + if (itb->realized) _item_block_unrealize(itb); + showme = _item_block_recalc(itb, in); + chb = itb; + } + itb->y = y; + itb->x = 0; + minh += itb->minh; + if (minw == -1) minw = itb->minw; + else if (minw < itb->minw) + { + minw = itb->minw; + minw_change = 1; + } + itb->w = minw; + itb->h = itb->minh; + y += itb->h; + in += itb->count; + if (showme) + { + wd->show_item->showme = 0; + elm_smart_scroller_child_region_show(wd->scr, + wd->show_item->x + wd->show_item->block->x, + wd->show_item->y + wd->show_item->block->y, + wd->show_item->block->w, + wd->show_item->h); + wd->show_item = NULL; + showme = 0; + } } if (minw_change) { EINA_INLIST_FOREACH(wd->blocks, itb) - { - itb->minw = minw; - itb->w = itb->minw; - } + { + itb->minw = minw; + itb->w = itb->minw; + } } if ((chb) && (EINA_INLIST_GET(chb)->next)) { @@ -870,11 +870,11 @@ _calc_job(void *data) if (minw < ow) minw = ow; if ((minw != wd->minw) || (minh != wd->minh)) { - wd->minw = minw; - wd->minh = minh; - evas_object_size_hint_min_set(wd->pan_smart, wd->minw, wd->minh); - evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); - _sizing_eval(wd->obj); + wd->minw = minw; + wd->minh = minh; + evas_object_size_hint_min_set(wd->pan_smart, wd->minw, wd->minh); + evas_object_smart_callback_call(wd->pan_smart, "changed", NULL); + _sizing_eval(wd->obj); } wd->calc_job = NULL; evas_object_smart_changed(wd->pan_smart); @@ -910,7 +910,7 @@ _pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) static void _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) -{ +{ Pan *sd = evas_object_smart_data_get(obj); Evas_Coord ow, oh; evas_object_geometry_get(obj, NULL, NULL, &ow, &oh); @@ -918,8 +918,8 @@ _pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y) if (ow < 0) ow = 0; oh = sd->wd->minh - oh; if (oh < 0) oh = 0; - if (x) *x = ow; - if (y) *y = oh; + if (x) *x = ow; + if (y) *y = oh; } static void @@ -944,7 +944,7 @@ _pan_add(Evas_Object *obj) free(cd); evas_object_smart_data_set(obj, sd); } - + static void _pan_del(Evas_Object *obj) { @@ -976,29 +976,29 @@ _pan_calculate(Evas_Object *obj) in = 0; EINA_INLIST_FOREACH(sd->wd->blocks, itb) { - itb->w = sd->wd->minw; - if (ELM_RECTS_INTERSECT(itb->x - sd->wd->pan_x, - itb->y - sd->wd->pan_y, - itb->w, itb->h, - 0, 0, ow, oh)) - { - if ((!itb->realized) || (itb->changed)) - { - _item_block_realize(itb, in, 0); - } - _item_block_position(itb, in); - } - else - { - if (itb->realized) - { - _item_block_unrealize(itb); - } - } - in += itb->count; + itb->w = sd->wd->minw; + if (ELM_RECTS_INTERSECT(itb->x - sd->wd->pan_x, + itb->y - sd->wd->pan_y, + itb->w, itb->h, + 0, 0, ow, oh)) + { + if ((!itb->realized) || (itb->changed)) + { + _item_block_realize(itb, in, 0); + } + _item_block_position(itb, in); + } + else + { + if (itb->realized) + { + _item_block_unrealize(itb); + } + } + in += itb->count; } } - + /** * Add a new Genlist object * @@ -1015,7 +1015,7 @@ elm_genlist_add(Evas_Object *parent) Widget_Data *wd; Evas_Coord minw, minh; static Evas_Smart *smart = NULL; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -1024,54 +1024,54 @@ elm_genlist_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->scr = elm_smart_scroller_add(e); elm_widget_resize_object_set(obj, wd->scr); - + elm_smart_scroller_bounce_allow_set(wd->scr, 0, 1); - + wd->obj = obj; wd->mode = ELM_LIST_SCROLL; - + if (!smart) { - static Evas_Smart_Class sc; - evas_object_smart_clipped_smart_set(&_pan_sc); - sc = _pan_sc; - sc.name = "elm_genlist_pan"; - sc.version = EVAS_SMART_CLASS_VERSION; - sc.add = _pan_add; - sc.del = _pan_del; - sc.resize = _pan_resize; - sc.calculate = _pan_calculate; - smart = evas_smart_class_new(&sc); + static Evas_Smart_Class sc; + evas_object_smart_clipped_smart_set(&_pan_sc); + sc = _pan_sc; + sc.name = "elm_genlist_pan"; + sc.version = EVAS_SMART_CLASS_VERSION; + sc.add = _pan_add; + sc.del = _pan_del; + sc.resize = _pan_resize; + sc.calculate = _pan_calculate; + smart = evas_smart_class_new(&sc); } if (smart) { - wd->pan_smart = evas_object_smart_add(e, smart); - wd->pan = evas_object_smart_data_get(wd->pan_smart); - wd->pan->wd = wd; + wd->pan_smart = evas_object_smart_add(e, smart); + wd->pan = evas_object_smart_data_get(wd->pan_smart); + wd->pan->wd = wd; } - + elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart, - _pan_set, _pan_get, - _pan_max_get, _pan_child_size_get); + _pan_set, _pan_get, + _pan_max_get, _pan_child_size_get); edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); - + _sizing_eval(obj); return obj; } static Elm_Genlist_Item * -_item_new(Widget_Data *wd, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *parent, - Elm_Genlist_Item_Flags flags, - void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) +_item_new(Widget_Data *wd, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *parent, + Elm_Genlist_Item_Flags flags, + void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { Elm_Genlist_Item *it; - + it = calloc(1, sizeof(Elm_Genlist_Item)); if (!it) return NULL; it->wd = wd; @@ -1089,7 +1089,7 @@ _item_block_del(Elm_Genlist_Item *it) { Eina_Inlist *il; Item_Block *itb = it->block; - + itb->items = eina_list_remove(itb->items, it); itb->count--; itb->changed = EINA_TRUE; @@ -1098,50 +1098,50 @@ _item_block_del(Elm_Genlist_Item *it) if (itb->count < 1) { il = EINA_INLIST_GET(itb); - Item_Block *itbn = (Item_Block *)(il->next); - if (it->parent) - it->parent->items = eina_list_remove(it->parent->items, it); - else - it->wd->blocks = eina_inlist_remove(it->wd->blocks, il); - free(itb); - if (itbn) itbn->changed = EINA_TRUE; + Item_Block *itbn = (Item_Block *)(il->next); + if (it->parent) + it->parent->items = eina_list_remove(it->parent->items, it); + else + it->wd->blocks = eina_inlist_remove(it->wd->blocks, il); + free(itb); + if (itbn) itbn->changed = EINA_TRUE; } else { - if (itb->count < 16) - { + if (itb->count < 16) + { il = EINA_INLIST_GET(itb); - Item_Block *itbp = (Item_Block *)(il->prev); - Item_Block *itbn = (Item_Block *)(il->next); - if ((itbp) && ((itbp->count + itb->count) < 48)) - { + Item_Block *itbp = (Item_Block *)(il->prev); + Item_Block *itbn = (Item_Block *)(il->next); + if ((itbp) && ((itbp->count + itb->count) < 48)) + { Elm_Genlist_Item *it2; EINA_LIST_FREE(itb->items, it2) - { - it2->block = itbp; - itbp->items = eina_list_append(itbp->items, it2); - itbp->count++; - itbp->changed = EINA_TRUE; - } - it->wd->blocks = eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); - free(itb); - } - else if ((itbn) && ((itbn->count + itb->count) < 48)) - { - while (itb->items) - { - Eina_List *last = eina_list_last(itb->items); - Elm_Genlist_Item *it2 = last->data; - it2->block = itbn; - itb->items = eina_list_remove_list(itb->items, last); - itbn->items = eina_list_prepend(itbn->items, it2); - itbn->count++; - itbn->changed = EINA_TRUE; - } - it->wd->blocks = eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); - free(itb); - } - } + { + it2->block = itbp; + itbp->items = eina_list_append(itbp->items, it2); + itbp->count++; + itbp->changed = EINA_TRUE; + } + it->wd->blocks = eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); + free(itb); + } + else if ((itbn) && ((itbn->count + itb->count) < 48)) + { + while (itb->items) + { + Eina_List *last = eina_list_last(itb->items); + Elm_Genlist_Item *it2 = last->data; + it2->block = itbn; + itb->items = eina_list_remove_list(itb->items, last); + itbn->items = eina_list_prepend(itbn->items, it2); + itbn->count++; + itbn->changed = EINA_TRUE; + } + it->wd->blocks = eina_inlist_remove(it->wd->blocks, EINA_INLIST_GET(itb)); + free(itb); + } + } } } @@ -1170,90 +1170,90 @@ _item_block_add(Widget_Data *wd, Elm_Genlist_Item *it) if (!it->rel) { - newblock: - if (it->rel) - { - itb = calloc(1, sizeof(Item_Block)); - if (!itb) return; - itb->wd = wd; - if (!it->rel->block) - { - wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb)); - itb->items = eina_list_append(itb->items, it); - } - else - { - if (it->before) - { - wd->blocks = eina_inlist_prepend_relative(wd->blocks, EINA_INLIST_GET(itb), EINA_INLIST_GET(it->rel->block)); - itb->items = eina_list_prepend_relative(itb->items, it, it->rel); - } - else - { - wd->blocks = eina_inlist_append_relative(wd->blocks, EINA_INLIST_GET(itb), EINA_INLIST_GET(it->rel->block)); - itb->items = eina_list_append_relative(itb->items, it, it->rel); - } - } - } - else - { - if (it->before) - { - if (wd->blocks) - { - itb = (Item_Block *)(wd->blocks); - if (itb->count >= 32) - { - itb = calloc(1, sizeof(Item_Block)); - if (!itb) return; - itb->wd = wd; - wd->blocks = eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb)); - } - } - else - { - itb = calloc(1, sizeof(Item_Block)); - if (!itb) return; - itb->wd = wd; - wd->blocks = eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb)); - } - itb->items = eina_list_prepend(itb->items, it); - } - else - { - if (wd->blocks) - { - itb = (Item_Block *)(wd->blocks->last); - if (itb->count >= 32) - { - itb = calloc(1, sizeof(Item_Block)); - if (!itb) return; - itb->wd = wd; - wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb)); - } - } - else - { - itb = calloc(1, sizeof(Item_Block)); - if (!itb) return; - itb->wd = wd; - wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb)); - } - itb->items = eina_list_append(itb->items, it); - } - } + newblock: + if (it->rel) + { + itb = calloc(1, sizeof(Item_Block)); + if (!itb) return; + itb->wd = wd; + if (!it->rel->block) + { + wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb)); + itb->items = eina_list_append(itb->items, it); + } + else + { + if (it->before) + { + wd->blocks = eina_inlist_prepend_relative(wd->blocks, EINA_INLIST_GET(itb), EINA_INLIST_GET(it->rel->block)); + itb->items = eina_list_prepend_relative(itb->items, it, it->rel); + } + else + { + wd->blocks = eina_inlist_append_relative(wd->blocks, EINA_INLIST_GET(itb), EINA_INLIST_GET(it->rel->block)); + itb->items = eina_list_append_relative(itb->items, it, it->rel); + } + } + } + else + { + if (it->before) + { + if (wd->blocks) + { + itb = (Item_Block *)(wd->blocks); + if (itb->count >= 32) + { + itb = calloc(1, sizeof(Item_Block)); + if (!itb) return; + itb->wd = wd; + wd->blocks = eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb)); + } + } + else + { + itb = calloc(1, sizeof(Item_Block)); + if (!itb) return; + itb->wd = wd; + wd->blocks = eina_inlist_prepend(wd->blocks, EINA_INLIST_GET(itb)); + } + itb->items = eina_list_prepend(itb->items, it); + } + else + { + if (wd->blocks) + { + itb = (Item_Block *)(wd->blocks->last); + if (itb->count >= 32) + { + itb = calloc(1, sizeof(Item_Block)); + if (!itb) return; + itb->wd = wd; + wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb)); + } + } + else + { + itb = calloc(1, sizeof(Item_Block)); + if (!itb) return; + itb->wd = wd; + wd->blocks = eina_inlist_append(wd->blocks, EINA_INLIST_GET(itb)); + } + itb->items = eina_list_append(itb->items, it); + } + } } else { - itb = it->rel->block; - if ((!itb) || (itb->count >= 32)) - { - goto newblock; - } - if (it->before) - itb->items = eina_list_prepend_relative(itb->items, it, it->rel); - else - itb->items = eina_list_append_relative(itb->items, it, it->rel); + itb = it->rel->block; + if ((!itb) || (itb->count >= 32)) + { + goto newblock; + } + if (it->before) + itb->items = eina_list_prepend_relative(itb->items, it, it->rel); + else + itb->items = eina_list_append_relative(itb->items, it, it->rel); } itb->count++; itb->changed = EINA_TRUE; @@ -1262,10 +1262,10 @@ _item_block_add(Widget_Data *wd, Elm_Genlist_Item *it) itb->wd->calc_job = ecore_job_add(_calc_job, itb->wd); if (it->rel) { - it->rel->relcount--; - if ((it->rel->delete_me) && (it->rel->relcount == 0)) - _item_del(it->rel); - it->rel = NULL; + it->rel->relcount--; + if ((it->rel->delete_me) && (it->rel->relcount == 0)) + _item_del(it->rel); + it->rel = NULL; } } @@ -1277,22 +1277,22 @@ _item_idler(void *data) for (n = 0; (wd->queue) && (n < 8); n++) { - Elm_Genlist_Item *it; - - it = wd->queue->data; - wd->queue = eina_list_remove_list(wd->queue, wd->queue); - it->queued = EINA_FALSE; - _item_block_add(wd, it); + Elm_Genlist_Item *it; + + it = wd->queue->data; + wd->queue = eina_list_remove_list(wd->queue, wd->queue); + it->queued = EINA_FALSE; + _item_block_add(wd, it); } if (n > 0) { - if (wd->calc_job) ecore_job_del(wd->calc_job); - wd->calc_job = ecore_job_add(_calc_job, wd); + if (wd->calc_job) ecore_job_del(wd->calc_job); + wd->calc_job = ecore_job_add(_calc_job, wd); } if (!wd->queue) { - wd->queue_idler = NULL; - return 0; + wd->queue_idler = NULL; + return 0; } return 1; } @@ -1311,7 +1311,7 @@ _item_queue(Widget_Data *wd, Elm_Genlist_Item *it) * * This appends the given item to the end of the list or the end of the * children if the parent is given. - * + * * @param obj The genlist object * @param itc The item class for the item * @param data The item data @@ -1324,31 +1324,31 @@ _item_queue(Widget_Data *wd, Elm_Genlist_Item *it) * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *parent, - Elm_Genlist_Item_Flags flags, - void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) +elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *parent, + Elm_Genlist_Item_Flags flags, + void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); if (!it) return NULL; if (!it->parent) { - wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it)); - it->rel = NULL; - it->before = 0; + wd->items = eina_inlist_append(wd->items, EINA_INLIST_GET(it)); + it->rel = NULL; + it->before = 0; } else { - Elm_Genlist_Item *it2 = NULL; - Eina_List *ll = eina_list_last(it->parent->items); - if (ll) it2 = ll->data; - it->parent->items = eina_list_append(it->parent->items, it); - if (!it2) it2 = it->parent; - wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2)); - it->rel = it2; - it->rel->relcount++; - it->before = 0; + Elm_Genlist_Item *it2 = NULL; + Eina_List *ll = eina_list_last(it->parent->items); + if (ll) it2 = ll->data; + it->parent->items = eina_list_append(it->parent->items, it); + if (!it2) it2 = it->parent; + wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(it2)); + it->rel = it2; + it->rel->relcount++; + it->before = 0; } _item_queue(wd, it); return it; @@ -1359,7 +1359,7 @@ elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, * * This adds an item to the beginning of the list or beginning of the children * of the parent if given. - * + * * @param obj The genlist object * @param itc The item class for the item * @param data The item data @@ -1372,10 +1372,10 @@ elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *parent, - Elm_Genlist_Item_Flags flags, - void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) +elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *parent, + Elm_Genlist_Item_Flags flags, + void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, parent, flags, func, func_data); @@ -1384,7 +1384,7 @@ elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, wd->items = eina_inlist_prepend(wd->items, EINA_INLIST_GET(it)); else { - printf("FIXME: 12 tree not handled yet\n"); + printf("FIXME: 12 tree not handled yet\n"); } it->rel = NULL; it->before = 1; @@ -1394,7 +1394,7 @@ elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, /** * Insert item before another in the genlist - * + * * This inserts an item before another in the list. It will be in the same tree * level as the item it is inseted before. * @@ -1410,10 +1410,10 @@ elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *before, - Elm_Genlist_Item_Flags flags, - void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) +elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *before, + Elm_Genlist_Item_Flags flags, + void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func, func_data); @@ -1422,7 +1422,7 @@ elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *i wd->items = eina_inlist_prepend_relative(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(before)); else { - printf("FIXME: 13 tree not handled yet\n"); + printf("FIXME: 13 tree not handled yet\n"); } it->rel = before; it->rel->relcount++; @@ -1449,10 +1449,10 @@ elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *i * @ingroup Genlist */ EAPI Elm_Genlist_Item * -elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, - const void *data, Elm_Genlist_Item *after, - Elm_Genlist_Item_Flags flags, - void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) +elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, + const void *data, Elm_Genlist_Item *after, + Elm_Genlist_Item_Flags flags, + void (*func) (void *data, Evas_Object *obj, void *event_info), const void *func_data) { Widget_Data *wd = elm_widget_data_get(obj); Elm_Genlist_Item *it = _item_new(wd, itc, data, NULL, flags, func, func_data); @@ -1461,7 +1461,7 @@ elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *it wd->items = eina_inlist_append_relative(wd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(after)); else { - printf("FIXME: 14 tree not handled yet\n"); + printf("FIXME: 14 tree not handled yet\n"); } it->rel = after; it->rel->relcount++; @@ -1474,7 +1474,7 @@ elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *it * Clear the genlist * * This clears all items in the list, leaving it empty. - * + * * @param obj The genlist object * * @ingroup Genlist @@ -1485,38 +1485,38 @@ elm_genlist_clear(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); while (wd->items) { - Elm_Genlist_Item *it = (Elm_Genlist_Item *)(wd->items); - wd->items = eina_inlist_remove(wd->items, wd->items); - if (it->realized) _item_unrealize(it); - if (it->itc->func.del) it->itc->func.del(it->data, it->wd->obj); - free(it); + Elm_Genlist_Item *it = (Elm_Genlist_Item *)(wd->items); + wd->items = eina_inlist_remove(wd->items, wd->items); + if (it->realized) _item_unrealize(it); + if (it->itc->func.del) it->itc->func.del(it->data, it->wd->obj); + free(it); } while (wd->blocks) { - Item_Block *itb = (Item_Block *)(wd->blocks); - wd->blocks = eina_inlist_remove(wd->blocks, wd->blocks); - if (itb->items) eina_list_free(itb->items); - free(itb); + Item_Block *itb = (Item_Block *)(wd->blocks); + wd->blocks = eina_inlist_remove(wd->blocks, wd->blocks); + if (itb->items) eina_list_free(itb->items); + free(itb); } if (wd->calc_job) { - ecore_job_del(wd->calc_job); - wd->calc_job = NULL; + ecore_job_del(wd->calc_job); + wd->calc_job = NULL; } if (wd->queue_idler) { - ecore_idler_del(wd->queue_idler); - wd->queue_idler = NULL; + ecore_idler_del(wd->queue_idler); + wd->queue_idler = NULL; } if (wd->queue) { - eina_list_free(wd->queue); - wd->queue = NULL; + eina_list_free(wd->queue); + wd->queue = NULL; } if (wd->selected) { - eina_list_free(wd->selected); - wd->selected = NULL; + eina_list_free(wd->selected); + wd->selected = NULL; } wd->show_item = NULL; wd->pan_x = 0; @@ -1533,7 +1533,7 @@ elm_genlist_clear(Evas_Object *obj) * * This enables (1) or disableds (0) multi-select in the list. This allows * more than 1 item to be selected. - * + * * @param obj The genlist object * @param multi Multi-select enable/disable * @@ -1552,9 +1552,9 @@ elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi) * This gets the selected item in the list (if multi-select is enabled only * the first item in the list is selected - which is not very useful, so see * elm_genlist_selected_items_get()for when multi-select is used). - * + * * If no item is selected, NULL is returned. - * + * * @param obj The genlist object * @return The selected item, or NULL if none. * @@ -1574,7 +1574,7 @@ elm_genlist_selected_item_get(const Evas_Object *obj) * This retgurns a list of the selected items. This list pointer is only valid * so long as no items are selected or unselected (or unselected implicitly * by deletion). The list contains Elm_Genlist_Item pointers. - * + * * @param obj The genlist object * @return The list of selected items, nor NUL if none are selected. * @@ -1591,7 +1591,7 @@ elm_genlist_selected_items_get(const Evas_Object *obj) * Get the first item in the genlist * * This returns the first item in the list. - * + * * @param obj The genlist object * @return The first item, or NULL if none * @@ -1611,7 +1611,7 @@ elm_genlist_first_item_get(const Evas_Object *obj) * Get the last item in the genlist * * This returns the last item in the list. - * + * * @return The last item, or NULL if none * * @ingroup Genlist @@ -1630,8 +1630,8 @@ elm_genlist_last_item_get(const Evas_Object *obj) /** * Get the next item in the genlist * - * This returns the item after the item @p it. - * + * This returns the item after the item @p it. + * * @param it The item * @return The item after @p it, or NULL if none * @@ -1642,8 +1642,8 @@ elm_genlist_item_next_get(const Elm_Genlist_Item *it) { while (it) { - it = (Elm_Genlist_Item *)(EINA_INLIST_GET(it)->next); - if ((it) && (!it->delete_me)) break; + it = (Elm_Genlist_Item *)(EINA_INLIST_GET(it)->next); + if ((it) && (!it->delete_me)) break; } return (Elm_Genlist_Item *)it; } @@ -1651,8 +1651,8 @@ elm_genlist_item_next_get(const Elm_Genlist_Item *it) /** * Get the previous item in the genlist * - * This returns the item before the item @p it. - * + * This returns the item before the item @p it. + * * @param it The item * @return The item before @p it, or NULL if none * @@ -1663,8 +1663,8 @@ elm_genlist_item_prev_get(const Elm_Genlist_Item *it) { while (it) { - it = (Elm_Genlist_Item *)(EINA_INLIST_GET(it)->prev); - if ((it) && (!it->delete_me)) break; + it = (Elm_Genlist_Item *)(EINA_INLIST_GET(it)->prev); + if ((it) && (!it->delete_me)) break; } return (Elm_Genlist_Item *)it; } @@ -1673,7 +1673,7 @@ elm_genlist_item_prev_get(const Elm_Genlist_Item *it) * Get the genlist object from an item * * This returns the genlist object itself that an item belongs to. - * + * * @param it The item * @return The genlist object * @@ -1690,7 +1690,7 @@ elm_genlist_item_genlist_get(const Elm_Genlist_Item *it) * Get the parent item of the given item * * This returns the prent item of the item @p it given. - * + * * @param it The item * @return The parent of the item or NULL if none * @@ -1705,7 +1705,7 @@ elm_genlist_item_parent_get(const Elm_Genlist_Item *it) /** * Clear all sub-items (children) of the given item - * + * * This clears all items that are children (or their descendants) of the * given item @p it. * @@ -1718,7 +1718,7 @@ elm_genlist_item_subitems_clear(Elm_Genlist_Item *it) { Eina_List *tl = NULL, *l; Elm_Genlist_Item *it2; - + if (!it) return; EINA_LIST_FOREACH(it->items, l, it2) tl = eina_list_append(tl, it2); @@ -1728,7 +1728,7 @@ elm_genlist_item_subitems_clear(Elm_Genlist_Item *it) /** * Set the selected state of an item - * + * * This sets the selected state (1 selected, 0 not selected) of the given * item @p it. * @@ -1749,11 +1749,11 @@ elm_genlist_item_selected_set(Elm_Genlist_Item *it, Eina_Bool selected) if (selected) { - if (!wd->multi) - { + if (!wd->multi) + { while (wd->selected) _item_unselect(wd->selected->data); - } + } _item_hilight(it); _item_select(it); } @@ -1763,9 +1763,9 @@ elm_genlist_item_selected_set(Elm_Genlist_Item *it, Eina_Bool selected) /** * Get the selected state of an item - * + * * This gets the selected state of an item (1 selected, 0 not selected). - * + * * @param it The item * @return The selected state * @@ -1780,7 +1780,7 @@ elm_genlist_item_selected_get(const Elm_Genlist_Item *it) /** * Sets the expanded state of an item (if it's a parent) - * + * * This expands or contracts a parent iterm (thus showing or hiding the * children). * @@ -1797,15 +1797,15 @@ elm_genlist_item_expanded_set(Elm_Genlist_Item *it, Eina_Bool expanded) it->expanded = expanded; if (it->expanded) { - if (it->realized) - edje_object_signal_emit(it->base, "elm,state,expanded", "elm"); - evas_object_smart_callback_call(it->wd->obj, "expanded", it); + if (it->realized) + edje_object_signal_emit(it->base, "elm,state,expanded", "elm"); + evas_object_smart_callback_call(it->wd->obj, "expanded", it); } else { - if (it->realized) - edje_object_signal_emit(it->base, "elm,state,contracted", "elm"); - evas_object_smart_callback_call(it->wd->obj, "contracted", it); + if (it->realized) + edje_object_signal_emit(it->base, "elm,state,contracted", "elm"); + evas_object_smart_callback_call(it->wd->obj, "contracted", it); } } @@ -1813,7 +1813,7 @@ elm_genlist_item_expanded_set(Elm_Genlist_Item *it, Eina_Bool expanded) * Get the expanded state of an item * * This gets the expanded state of an item - * + * * @param it The item * @return Thre expanded state * @@ -1825,10 +1825,10 @@ elm_genlist_item_expanded_get(const Elm_Genlist_Item *it) if (!it) return EINA_FALSE; return it->expanded; } - + /** * Sets the disabled state of an item. - * + * * A disabled item cannot be selected or unselected. It will also change * appearance to appear disabled. This sets the disabled state (1 disabled, 0 * not disabled). @@ -1847,10 +1847,10 @@ elm_genlist_item_disabled_set(Elm_Genlist_Item *it, Eina_Bool disabled) it->disabled = disabled; if (it->realized) { - if (it->disabled) - edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); - else - edje_object_signal_emit(it->base, "elm,state,enabled", "elm"); + if (it->disabled) + edje_object_signal_emit(it->base, "elm,state,disabled", "elm"); + else + edje_object_signal_emit(it->base, "elm,state,enabled", "elm"); } } @@ -1858,7 +1858,7 @@ elm_genlist_item_disabled_set(Elm_Genlist_Item *it, Eina_Bool disabled) * Get the disabled state of an item * * This gets the disabld state of the given item. - * + * * @param it The item * @return The disabled state * @@ -1877,7 +1877,7 @@ elm_genlist_item_disabled_get(const Elm_Genlist_Item *it) * * This causes genlist to jump to the given item @p it and show it (by scrolling), * if it is not fully visible. - * + * * @param it The item * * @ingroup Genlist @@ -1889,19 +1889,19 @@ elm_genlist_item_show(Elm_Genlist_Item *it) if (it->delete_me) return; if ((it->queued) || (!it->mincalcd)) { - it->wd->show_item = it; - it->showme = EINA_TRUE; - return; + it->wd->show_item = it; + it->showme = EINA_TRUE; + return; } if (it->wd->show_item) { - it->wd->show_item->showme = EINA_FALSE; - it->wd->show_item = NULL; + it->wd->show_item->showme = EINA_FALSE; + it->wd->show_item = NULL; } elm_smart_scroller_child_region_show(it->wd->scr, - it->x + it->block->x, - it->y + it->block->y, - it->block->w, it->h); + it->x + it->block->x, + it->y + it->block->y, + it->block->w, it->h); } /** @@ -1918,19 +1918,19 @@ elm_genlist_item_del(Elm_Genlist_Item *it) if (!it) return; if (it->relcount > 0) { - elm_genlist_item_subitems_clear(it); - it->delete_me = EINA_TRUE; - if (it->wd->show_item == it) it->wd->show_item = NULL; - if (it->selected) it->wd->selected = eina_list_remove(it->wd->selected, it); - if (it->block) - { - if (it->realized) _item_unrealize(it); - it->block->changed = EINA_TRUE; - if (it->wd->calc_job) ecore_job_del(it->wd->calc_job); - it->wd->calc_job = ecore_job_add(_calc_job, it->wd); - } - if (it->itc->func.del) it->itc->func.del(it->data, it->wd->obj); - return; + elm_genlist_item_subitems_clear(it); + it->delete_me = EINA_TRUE; + if (it->wd->show_item == it) it->wd->show_item = NULL; + if (it->selected) it->wd->selected = eina_list_remove(it->wd->selected, it); + if (it->block) + { + if (it->realized) _item_unrealize(it); + it->block->changed = EINA_TRUE; + if (it->wd->calc_job) ecore_job_del(it->wd->calc_job); + it->wd->calc_job = ecore_job_add(_calc_job, it->wd); + } + if (it->itc->func.del) it->itc->func.del(it->data, it->wd->obj); + return; } _item_del(it); } @@ -1940,7 +1940,7 @@ elm_genlist_item_del(Elm_Genlist_Item *it) * * This returns the data value passed on the elm_genlist_item_append() and * related item addition calls. - * + * * @param it The item * @return The data pointer provided when created * @@ -1958,7 +1958,7 @@ elm_genlist_item_data_get(const Elm_Genlist_Item *it) * This updates an item by calling all the item class functions again to get * the icons, labels and states. Use this when he original item data has * changed and the changes are desired to be reflected. - * + * * @param it The item * * @ingroup Genlist @@ -1978,32 +1978,32 @@ elm_genlist_item_update(Elm_Genlist_Item *it) it->mincalcd = EINA_FALSE; EINA_INLIST_FOREACH(it->wd->blocks, itb) { - if (itb == it->block) break; - num += itb->count; + if (itb == it->block) break; + num += itb->count; } numb = num; EINA_LIST_FOREACH(it->block->items, l, it2) { - if (it2 == it) break; - num++; + if (it2 == it) break; + num++; } if (it->realized) { - _item_unrealize(it); - _item_realize(it, num, 0); - _item_block_recalc(it->block, numb); - _item_block_position(it->block, num); + _item_unrealize(it); + _item_realize(it, num, 0); + _item_block_recalc(it->block, numb); + _item_block_position(it->block, num); } else { - _item_realize(it, num, 1); - _item_unrealize(it); + _item_realize(it, num, 1); + _item_unrealize(it); } if ((it->minw > minw) || (it->minh != minh)) { - it->block->changed = EINA_TRUE; - if (it->wd->calc_job) ecore_job_del(it->wd->calc_job); - it->wd->calc_job = ecore_job_add(_calc_job, it->wd); + it->block->changed = EINA_TRUE; + if (it->wd->calc_job) ecore_job_del(it->wd->calc_job); + it->wd->calc_job = ecore_job_add(_calc_job, it->wd); } } @@ -2016,7 +2016,7 @@ elm_genlist_item_update(Elm_Genlist_Item *it) * horizontally. Otherwise items are expanded to fill the width of the * viewport of the scroller. If it is ELM_LIST_LIMIT, Items will be expanded * to the viewport width and limited to that size. - * + * * @param obj The genlist object * @param mode The mode to use * @@ -2036,7 +2036,7 @@ elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) /** * Set the always select mode. - * + * * Items will only call their selection func and callback when first becoming * selected. Any further clicks will do nothing, unless you enable always * select with elm_genlist_always_select_mode_set(). This means even if @@ -2059,7 +2059,7 @@ elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) * * This will turn off the ability to select items entirely and they will * neither appear selected nor call selected callback functions. - * + * * @param obj The genlist object * @param no_select The no select mode (1 on, 2 off) * diff --git a/legacy/elementary/src/lib/elm_hover.c b/legacy/elementary/src/lib/elm_hover.c index 5c490d0cb8..cecca151d0 100644 --- a/legacy/elementary/src/lib/elm_hover.c +++ b/legacy/elementary/src/lib/elm_hover.c @@ -78,7 +78,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0; - + if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h); if (wd->hov) evas_object_geometry_get(wd->hov, &x2, &y2, &w2, &h2); evas_object_move(wd->cov, x, y); @@ -134,7 +134,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) break; } } -} +} static void _hov_show_do(Evas_Object *obj) @@ -152,7 +152,7 @@ _hov_show_do(Evas_Object *obj) char buf[1024]; if (!strncmp(si->swallow, "elm.swallow.slot.", 17)) { - snprintf(buf, sizeof(buf), "elm,action,slot,%s,show", + snprintf(buf, sizeof(buf), "elm,action,slot,%s,show", si->swallow + 17); edje_object_signal_emit(wd->cov, buf, "elm"); } @@ -193,7 +193,7 @@ _hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) char buf[1024]; if (!strncmp(si->swallow, "elm.swallow.slot.", 17)) { - snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide", + snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide", si->swallow + 17); edje_object_signal_emit(wd->cov, buf, "elm"); } @@ -254,7 +254,7 @@ elm_hover_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -273,27 +273,27 @@ elm_hover_add(Evas_Object *parent) evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_RESIZE, _hov_resize, obj); evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_SHOW, _hov_show, obj); evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_HIDE, _hov_hide, obj); - + wd->cov = edje_object_add(e); _elm_theme_set(wd->cov, "hover", "base", "default"); elm_widget_sub_object_add(obj, wd->cov); edje_object_signal_callback_add(wd->cov, "elm,action,dismiss", "", _signal_dismiss, obj); - + wd->offset = evas_object_rectangle_add(e); evas_object_pass_events_set(wd->offset, 1); evas_object_color_set(wd->offset, 0, 0, 0, 0); elm_widget_sub_object_add(obj, wd->offset); - + wd->size = evas_object_rectangle_add(e); evas_object_pass_events_set(wd->size, 1); evas_object_color_set(wd->size, 0, 0, 0, 0); elm_widget_sub_object_add(obj, wd->size); - + edje_object_part_swallow(wd->cov, "elm.swallow.offset", wd->offset); edje_object_part_swallow(wd->cov, "elm.swallow.size", wd->size); - + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -385,7 +385,7 @@ elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_ Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0; Evas_Coord spc_l, spc_r, spc_t, spc_b; - + if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h); if (wd->target) evas_object_geometry_get(wd->target, &x2, &y2, &w2, &h2); spc_l = x2 - x; @@ -398,19 +398,19 @@ elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_ if (spc_b < 0) spc_b = 0; if (pref_axis == ELM_HOVER_AXIS_HORIZONTAL) { - if (spc_l < spc_r) return "right"; - else return "left"; + if (spc_l < spc_r) return "right"; + else return "left"; } else if (pref_axis == ELM_HOVER_AXIS_VERTICAL) { - if (spc_t < spc_b) return "bottom"; - else return "top"; + if (spc_t < spc_b) return "bottom"; + else return "top"; } if (spc_l < spc_r) { - if (spc_t > spc_r) return "top"; - else if (spc_b > spc_r) return "bottom"; - return "right"; + if (spc_t > spc_r) return "top"; + else if (spc_b > spc_r) return "bottom"; + return "right"; } if (spc_t > spc_r) return "top"; else if (spc_b > spc_r) return "bottom"; diff --git a/legacy/elementary/src/lib/elm_icon.c b/legacy/elementary/src/lib/elm_icon.c index 4d8b162a37..43082ade80 100644 --- a/legacy/elementary/src/lib/elm_icon.c +++ b/legacy/elementary/src/lib/elm_icon.c @@ -45,7 +45,7 @@ _sizing_eval(Evas_Object *obj) if (!wd) return; Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; int w, h; - + _els_smart_icon_size_get(wd->img, &w, &h); _els_smart_icon_scale_up_set(wd->img, wd->scale_up); _els_smart_icon_scale_down_set(wd->img, wd->scale_down); @@ -54,8 +54,8 @@ _sizing_eval(Evas_Object *obj) if (wd->no_scale) _els_smart_icon_scale_set(wd->img, 1.0); else { - _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) * - _elm_config->scale); + _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) * + _elm_config->scale); _els_smart_icon_size_get(wd->img, &w, &h); } if (!wd->scale_down) @@ -84,7 +84,7 @@ elm_icon_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -94,17 +94,17 @@ elm_icon_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, 0); - + wd->img = _els_smart_icon_add(e); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); evas_object_repeat_events_set(wd->img, 1); - elm_widget_resize_object_set(obj, wd->img); + elm_widget_resize_object_set(obj, wd->img); wd->smooth = EINA_TRUE; wd->scale_up = EINA_TRUE; wd->scale_down = EINA_TRUE; - + _sizing_eval(obj); return obj; } @@ -133,7 +133,7 @@ elm_icon_standard_set(Evas_Object *obj, const char *name) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - + if (!name) return; if (wd->stdicon) eina_stringshare_del(wd->stdicon); wd->stdicon = eina_stringshare_add(name); diff --git a/legacy/elementary/src/lib/elm_image.c b/legacy/elementary/src/lib/elm_image.c index 964da4cdc0..0360ac7c40 100644 --- a/legacy/elementary/src/lib/elm_image.c +++ b/legacy/elementary/src/lib/elm_image.c @@ -45,7 +45,7 @@ _sizing_eval(Evas_Object *obj) if (!wd) return; Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; int w, h; - + _els_smart_icon_size_get(wd->img, &w, &h); _els_smart_icon_scale_up_set(wd->img, wd->scale_up); _els_smart_icon_scale_down_set(wd->img, wd->scale_down); @@ -83,7 +83,7 @@ elm_image_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -93,17 +93,17 @@ elm_image_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, 0); - + wd->img = _els_smart_icon_add(e); evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj); evas_object_repeat_events_set(wd->img, 1); - elm_widget_resize_object_set(obj, wd->img); + elm_widget_resize_object_set(obj, wd->img); wd->smooth = EINA_TRUE; wd->scale_up = EINA_TRUE; wd->scale_down = EINA_TRUE; - + _els_smart_icon_scale_size_set(wd->img, 0); _sizing_eval(obj); diff --git a/legacy/elementary/src/lib/elm_label.c b/legacy/elementary/src/lib/elm_label.c index 44dea131e4..1b51d2bda4 100644 --- a/legacy/elementary/src/lib/elm_label.c +++ b/legacy/elementary/src/lib/elm_label.c @@ -36,7 +36,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + edje_object_size_min_calc(wd->lbl, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); @@ -48,7 +48,7 @@ elm_label_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -58,7 +58,7 @@ elm_label_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, 0); - + wd->lbl = edje_object_add(e); _elm_theme_set(wd->lbl, "label", "base", "default"); wd->label = eina_stringshare_add("
"); diff --git a/legacy/elementary/src/lib/elm_layout.c b/legacy/elementary/src/lib/elm_layout.c index 707590f646..4d30e08497 100644 --- a/legacy/elementary/src/lib/elm_layout.c +++ b/legacy/elementary/src/lib/elm_layout.c @@ -48,7 +48,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + edje_object_size_min_calc(wd->lay, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); @@ -90,7 +90,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) break; } } -} +} EAPI Evas_Object * elm_layout_add(Evas_Object *parent) @@ -98,7 +98,7 @@ elm_layout_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -107,12 +107,12 @@ elm_layout_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->lay = edje_object_add(e); elm_widget_resize_object_set(obj, wd->lay); - + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 94f10faf29..a21afb9d70 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -50,14 +50,14 @@ _del_hook(Evas_Object *obj) EINA_LIST_FREE(wd->items, it) { if (it->del_cb) it->del_cb((void *)it->data, it->obj, it); - eina_stringshare_del(it->label); - if (!it->fixed) - { - if (it->icon) evas_object_del(it->icon); - if (it->end) evas_object_del(it->end); - } - if (it->base) evas_object_del(it->base); - free(it); + eina_stringshare_del(it->label); + if (!it->fixed) + { + if (it->icon) evas_object_del(it->icon); + if (it->end) evas_object_del(it->end); + } + if (it->base) evas_object_del(it->base); + free(it); } eina_list_free(wd->selected); free(wd); @@ -68,7 +68,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + evas_object_size_hint_min_get(wd->scroller, &minw, &minh); evas_object_size_hint_max_get(wd->scroller, &maxw, &maxh); evas_object_size_hint_min_set(obj, minw, minh); @@ -91,7 +91,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info) // _sizing_eval(data); } -static void +static void _sub_del(void *data, Evas_Object *obj, void *event_info) { Widget_Data *wd = elm_widget_data_get(obj); @@ -101,16 +101,16 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) EINA_LIST_FOREACH(wd->items, l, it) { - if ((sub == it->icon) || (sub == it->end)) - { - if (it->icon == sub) it->icon = NULL; - if (it->end == sub) it->end = NULL; - evas_object_event_callback_del - (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); - _fix_items(obj); - _sizing_eval(obj); - break; - } + if ((sub == it->icon) || (sub == it->end)) + { + if (it->icon == sub) it->icon = NULL; + if (it->end == sub) it->end = NULL; + evas_object_event_callback_del + (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); + _fix_items(obj); + _sizing_eval(obj); + break; + } } } @@ -134,8 +134,8 @@ _item_select(Elm_List_Item *it) const char *selectraise; if (it->selected) { - if (wd->always_select) goto call; - return; + if (wd->always_select) goto call; + return; } it->selected = EINA_TRUE; wd->selected = eina_list_append(wd->selected, it); @@ -155,15 +155,15 @@ _item_unselect(Elm_List_Item *it) selectraise = edje_object_data_get(it->base, "selectraise"); if ((selectraise) && (!strcmp(selectraise, "on"))) { - if ((stacking) && (!strcmp(stacking, "below"))) - evas_object_lower(it->base); + if ((stacking) && (!strcmp(stacking, "below"))) + evas_object_lower(it->base); } it->hilighted = EINA_FALSE; if (it->selected) { - it->selected = EINA_FALSE; - wd->selected = eina_list_remove(wd->selected, it); - evas_object_smart_callback_call(it->obj, "unselected", it); + it->selected = EINA_FALSE; + wd->selected = eina_list_remove(wd->selected, it); + evas_object_smart_callback_call(it->obj, "unselected", it); } } @@ -175,11 +175,11 @@ _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info) Evas_Event_Mouse_Move *ev = event_info; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) { - if (!wd->on_hold) - { - wd->on_hold = EINA_TRUE; - _item_unselect(it); - } + if (!wd->on_hold) + { + wd->on_hold = EINA_TRUE; + _item_unselect(it); + } } } @@ -206,35 +206,35 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info) else wd->on_hold = EINA_FALSE; if (wd->on_hold) { - wd->on_hold = EINA_FALSE; - return; + wd->on_hold = EINA_FALSE; + return; } if (wd->multi) { - if (!it->selected) - { - _item_hilight(it); - _item_select(it); - } - else _item_unselect(it); + if (!it->selected) + { + _item_hilight(it); + _item_select(it); + } + else _item_unselect(it); } else { if (!it->selected) { while (wd->selected) - _item_unselect(wd->selected->data); - _item_hilight(it); + _item_unselect(wd->selected->data); + _item_hilight(it); _item_select(it); - } + } else { const Eina_List *l, *l_next; Elm_List_Item *it2; EINA_LIST_FOREACH_SAFE(wd->selected, l, l_next, it2) if (it2 != it) _item_unselect(it2); - _item_hilight(it); - _item_select(it); + _item_hilight(it); + _item_select(it); } } } @@ -244,7 +244,7 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e { Widget_Data *wd = elm_widget_data_get(obj); Elm_List_Item *it; - + it = calloc(1, sizeof(Elm_List_Item)); it->obj = obj; it->label = eina_stringshare_add(label); @@ -254,24 +254,24 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e it->data = data; it->base = edje_object_add(evas_object_evas_get(obj)); evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN, - _mouse_down, it); + _mouse_down, it); evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_UP, - _mouse_up, it); + _mouse_up, it); evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_MOVE, - _mouse_move, it); + _mouse_move, it); evas_object_size_hint_weight_set(it->base, 1.0, 1.0); evas_object_size_hint_align_set(it->base, -1.0, -1.0); if (it->icon) { - elm_widget_sub_object_add(obj, it->icon); - evas_object_event_callback_add(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + elm_widget_sub_object_add(obj, it->icon); + evas_object_event_callback_add(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); } if (it->end) { - elm_widget_sub_object_add(obj, it->end); - evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + elm_widget_sub_object_add(obj, it->end); + evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); } return it; } @@ -289,107 +289,107 @@ _fix_items(Evas_Object *obj) EINA_LIST_FOREACH(wd->items, l, it) { - Evas_Coord mw, mh; - if (it->icon) - { - evas_object_size_hint_min_get(it->icon, &mw, &mh); - if (mw > minw[0]) minw[0] = mw; - if (mh > minh[0]) minh[0] = mh; - } - if (it->end) - { - evas_object_size_hint_min_get(it->end, &mw, &mh); - if (mw > minw[1]) minw[1] = mw; - if (mh > minh[1]) minh[1] = mh; - } + Evas_Coord mw, mh; + if (it->icon) + { + evas_object_size_hint_min_get(it->icon, &mw, &mh); + if (mw > minw[0]) minw[0] = mw; + if (mh > minh[0]) minh[0] = mh; + } + if (it->end) + { + evas_object_size_hint_min_get(it->end, &mw, &mh); + if (mw > minw[1]) minw[1] = mw; + if (mh > minh[1]) minh[1] = mh; + } } - if ((minw[0] != wd->minw[0]) || (minw[1] != wd->minw[1]) || + if ((minw[0] != wd->minw[0]) || (minw[1] != wd->minw[1]) || (minw[0] != wd->minh[0]) || (minh[1] != wd->minh[1])) { - wd->minw[0] = minw[0]; - wd->minw[1] = minw[1]; - wd->minh[0] = minh[0]; - wd->minh[1] = minh[1]; - redo = 1; + wd->minw[0] = minw[0]; + wd->minw[1] = minw[1]; + wd->minh[0] = minh[0]; + wd->minh[1] = minh[1]; + redo = 1; } i = 0; EINA_LIST_FOREACH(wd->items, l, it) { - it->even = i & 0x1; - if ((it->even != it->is_even) || (!it->fixed) || (redo)) - { - const char *stacking; - - if (wd->mode == ELM_LIST_COMPRESS) - { - if (it->even) - _elm_theme_set(it->base, "list", "item_compress", style); - else - _elm_theme_set(it->base, "list", "item_compress_odd", style); - } - else - { - if (it->even) - _elm_theme_set(it->base, "list", "item", style); - else - _elm_theme_set(it->base, "list", "item_odd", style); - } - stacking = edje_object_data_get(it->base, "stacking"); - if (stacking) - { - if (!strcmp(stacking, "below")) - evas_object_lower(it->base); - else if (!strcmp(stacking, "above")) - evas_object_raise(it->base); - } - edje_object_part_text_set(it->base, "elm.text", it->label); - if ((!it->icon) && (minh[0] > 0)) - { - it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base)); - evas_object_color_set(it->icon, 0, 0, 0, 0); - it->dummy_icon = EINA_TRUE; - } - if ((!it->end) && (minh[1] > 0)) - { - it->end = evas_object_rectangle_add(evas_object_evas_get(it->base)); - evas_object_color_set(it->end, 0, 0, 0, 0); - it->dummy_end = EINA_TRUE; - } - if (it->icon) - { - evas_object_size_hint_min_set(it->icon, minw[0], minh[0]); - evas_object_size_hint_max_set(it->icon, 99999, 99999); - edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); - } - if (it->end) - { - evas_object_size_hint_min_set(it->end, minw[1], minh[1]); - evas_object_size_hint_max_set(it->end, 99999, 99999); - edje_object_part_swallow(it->base, "elm.swallow.end", it->end); - } - if (!it->fixed) - { - edje_object_message_signal_process(it->base); - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_min_set(it->base, mw, mh); - evas_object_show(it->base); - } - if ((it->selected) || (it->hilighted)) - { - const char *selectraise; - - edje_object_signal_emit(it->base, "elm,state,selected", "elm"); - selectraise = edje_object_data_get(it->base, "selectraise"); - if ((selectraise) && (!strcmp(selectraise, "on"))) - evas_object_raise(it->base); - stacking = edje_object_data_get(it->base, "stacking"); - } - it->fixed = EINA_TRUE; - it->is_even = it->even; - } + it->even = i & 0x1; + if ((it->even != it->is_even) || (!it->fixed) || (redo)) + { + const char *stacking; + + if (wd->mode == ELM_LIST_COMPRESS) + { + if (it->even) + _elm_theme_set(it->base, "list", "item_compress", style); + else + _elm_theme_set(it->base, "list", "item_compress_odd", style); + } + else + { + if (it->even) + _elm_theme_set(it->base, "list", "item", style); + else + _elm_theme_set(it->base, "list", "item_odd", style); + } + stacking = edje_object_data_get(it->base, "stacking"); + if (stacking) + { + if (!strcmp(stacking, "below")) + evas_object_lower(it->base); + else if (!strcmp(stacking, "above")) + evas_object_raise(it->base); + } + edje_object_part_text_set(it->base, "elm.text", it->label); + if ((!it->icon) && (minh[0] > 0)) + { + it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base)); + evas_object_color_set(it->icon, 0, 0, 0, 0); + it->dummy_icon = EINA_TRUE; + } + if ((!it->end) && (minh[1] > 0)) + { + it->end = evas_object_rectangle_add(evas_object_evas_get(it->base)); + evas_object_color_set(it->end, 0, 0, 0, 0); + it->dummy_end = EINA_TRUE; + } + if (it->icon) + { + evas_object_size_hint_min_set(it->icon, minw[0], minh[0]); + evas_object_size_hint_max_set(it->icon, 99999, 99999); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); + } + if (it->end) + { + evas_object_size_hint_min_set(it->end, minw[1], minh[1]); + evas_object_size_hint_max_set(it->end, 99999, 99999); + edje_object_part_swallow(it->base, "elm.swallow.end", it->end); + } + if (!it->fixed) + { + edje_object_message_signal_process(it->base); + mw = mh = -1; + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + evas_object_size_hint_min_set(it->base, mw, mh); + evas_object_show(it->base); + } + if ((it->selected) || (it->hilighted)) + { + const char *selectraise; + + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + selectraise = edje_object_data_get(it->base, "selectraise"); + if ((selectraise) && (!strcmp(selectraise, "on"))) + evas_object_raise(it->base); + stacking = edje_object_data_get(it->base, "stacking"); + } + it->fixed = EINA_TRUE; + it->is_even = it->even; + } i++; } mw = 0; mh = 0; @@ -407,7 +407,7 @@ elm_list_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -417,12 +417,12 @@ elm_list_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_can_focus_set(obj, 1); - + wd->scroller = elm_scroller_add(parent); elm_widget_resize_object_set(obj, wd->scroller); - + elm_scroller_bounce_set(wd->scroller, 0, 1); - + wd->box = elm_box_add(parent); elm_box_homogenous_set(wd->box, 1); evas_object_size_hint_weight_set(wd->box, 1.0, 0.0); @@ -433,7 +433,7 @@ elm_list_add(Evas_Object *parent) wd->mode = ELM_LIST_SCROLL; evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -526,7 +526,7 @@ elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) elm_scroller_content_min_limit(wd->scroller, 0, 0); } -EAPI void +EAPI void elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) { Widget_Data *wd = elm_widget_data_get(obj); @@ -565,13 +565,13 @@ elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected) if (selected) { - if (!wd->multi) - { + if (!wd->multi) + { while (wd->selected) - _item_unselect(wd->selected->data); - } - _item_hilight(it); - _item_select(it); + _item_unselect(wd->selected->data); + } + _item_hilight(it); + _item_select(it); } else _item_unselect(it); diff --git a/legacy/elementary/src/lib/elm_main.c b/legacy/elementary/src/lib/elm_main.c index 5f39ca441d..6432e55ddd 100644 --- a/legacy/elementary/src/lib/elm_main.c +++ b/legacy/elementary/src/lib/elm_main.c @@ -17,9 +17,9 @@ /** * @defgroup Start Getting Started - * + * * To write an Elementary app, you can get started with the following: - * + * * @code * #include * #ifndef ELM_LIB_QUICKLAUNCH @@ -34,16 +34,16 @@ * #endif * ELM_MAIN() * @endcode - * + * * To take full advantage of the quicklaunch architecture for launching * processes as quickly as possible (saving time at startup time like * connecting to X11, loading and linking shared libraries) you may want to * use the following configure.in/configure.ac and Makefile.am and autogen.sh * script to generate your files. It is assumed your application uses the * main.c file for its code. - * + * * configure.in/configure.ac: - * + * @verbatim AC_INIT(myapp, 0.0.0, myname@mydomain.com) AC_PREREQ(2.52) @@ -68,9 +68,9 @@ PKG_CHECK_MODULES([ELEMENTARY], elementary) AC_OUTPUT(Makefile) @endverbatim - * + * * Makefile.am: - * + * @verbatim AUTOMAKE_OPTIONS = 1.4 foreign MAINTAINERCLEANFILES = Makefile.in @@ -91,9 +91,9 @@ myapp_SOURCES = main.c myapp_LDADD = @ELEMENTARY_LIBS@ myapp_CFLAGS = -DELM_LIB_QUICKLAUNCH=1 @endverbatim - * + * * autogen.sh: - * + * @verbatim #!/bin/sh rm -rf autom4te.cache @@ -112,9 +112,9 @@ if [ -z "$NOCONFIGURE" ]; then ./configure "$@" fi @endverbatim - * + * * To gnerate all the things needed to bootstrap just run: - * + * @verbatim ./autogen.sh @endverbatim @@ -126,28 +126,28 @@ fi make sudo make install @endverbatim - * + * * Note sudo was assumed to get root permissions, as this would install in * /usr/local which is system-owned. Ue any way you like to gain root, or * specify a different prefix with configure: - * + * @verbatim ./confiugre --prefix=$HOME/mysoftware @endverbatim - * + * * Also remember that autotools buys you some useful commands like: @verbatim make uninstall @endverbatim - * + * * This uninstalls the software after it was installed with "make install". * It is very useful to clear up what you built if you wish to clean the * system. - * + * @verbatim make distcheck @endverbatim - * + * * This firstly checks if your build tree is "clean" and ready for * distribution. It also builds a tarball (myapp-0.0.0.tar.gz) that is * ready to upload and distribute to the world, that contains the generated @@ -159,26 +159,26 @@ make distcheck * contain any files that are temporarily generated like binaries and other * build-gnerated files, so the tarball is clean, and no need to worry * about cleaning up your tree before packaging. - * + * @verbatim make clean @endverbatim - * + * * This cleans up all build files (binaries, objects etc.) from the tree. - * + * @verbatim make distclean @endverbatim - * + * * This cleans out all files from the build and from configure's output too. - * + * @verbatim make maintainer-clean @endverbatim - * + * * This deletes all the files autogen.sh will produce so the tree is clean * to be put into a revision-control system (like CVS, SVN or GIT for example). - * + * * The above will build a library - libmyapp.so and install in the target * library directory (default is /usr/local/lib). You will also get a * myapp.a and myapp.la - these are useless and can be deleted. Libtool likes @@ -187,28 +187,28 @@ make maintainer-clean * This will run and dlopen() the myapp.so and then jump to it's elm_main * function. This allows for easy debugging with GDB and Valgrind. When you * are ready to go to production do the following: - * + * * 1. delete the myapp binary. i.e. rm /usr/local/bin/myapp - * + * * 2. symlink the myapp binary to elementary_run (supplied by elementary). * i.e. ln -s elmentary_run /usr/local/bin/myapp - * + * * 3. run elementary_quicklaunch as part of your graphical login session and * keep it running. - * + * * This will man elementary_quicklaunch does pre-initialization before the * application needs to be run, saving the effort at the time the application * is needed, thus speeding up the time it takes to appear. - * + * * If you don't want to use the quicklaunch infrastructure (which is * optional), you can execute the old fashioned way by just running the * myapp binary loader than will load the myapp.so for you, or you can * remove the split-file binary and put it into one binary as things always * have been with the following configure.in/configure.ac and Makfile.am * files: - * + * * configure.in/configure.ac: - * + * @verbatim AC_INIT(myapp, 0.0.0, myname@mydomain.com) AC_PREREQ(2.52) @@ -228,9 +228,9 @@ PKG_CHECK_MODULES([ELEMENTARY], elementary) AC_OUTPUT(Makefile) @endverbatim - * + * * Makefile.am: - * + * @verbatim AUTOMAKE_OPTIONS = 1.4 foreign MAINTAINERCLEANFILES = Makefile.in @@ -241,9 +241,9 @@ bin_PROGRAMS = myapp myapp_SOURCES = main.c myapp_LDADD = @ELEMENTARY_LIBS@ -myapp_CFLAGS = +myapp_CFLAGS = @endverbatim - * + * * Notice that they are the same as before, just with libtool and library * building sections removed. Both ways work for building elementary * applications. It is up to you to decide what is best for you. If you just @@ -252,7 +252,7 @@ myapp_CFLAGS = * That is perfectly valid, bu has been left out here for simplicity, as our * aim to have an Elementary (and EFL) tutorial, not an autoconf & automake * document. - * + * */ static int _elm_signal_exit(void *data, int ev_type, void *ev); @@ -283,24 +283,24 @@ static int _elm_window_property_change(void *data, int ev_type, void *ev) { Ecore_X_Event_Window_Property *event = ev; - + if (event->win == ecore_x_window_root_first_get()) { - if (event->atom == _elm_atom_enlightenment_scale) - { - int val = 1000; - - if (ecore_x_window_prop_card32_get(event->win, - event->atom, - &val, 1) > 0) - { - double pscale; - - pscale = _elm_config->scale; - if (val > 0) _elm_config->scale = (double)val / 1000.0; - if (pscale != _elm_config->scale) _elm_rescale(); - } - } + if (event->atom == _elm_atom_enlightenment_scale) + { + int val = 1000; + + if (ecore_x_window_prop_card32_get(event->win, + event->atom, + &val, 1) > 0) + { + double pscale; + + pscale = _elm_config->scale; + if (val > 0) _elm_config->scale = (double)val / 1000.0; + if (pscale != _elm_config->scale) _elm_rescale(); + } + } } return 1; } @@ -319,8 +319,8 @@ _elm_rescale(void) /** * Inititalise Elementary - * - * This call is exported only for use by the ELM_MAIN() macro. There is no + * + * This call is exported only for use by the ELM_MAIN() macro. There is no * need to use this if you use this macro (which is highly advisable). * @ingroup General */ @@ -333,7 +333,7 @@ elm_init(int argc, char **argv) /** * Shut down Elementary - * + * * This should be called at the end of your application just before it ceases * to do any more processing. This will clean up any permanent resources your * application may have allocated via Elementary that would otherwise persist @@ -353,67 +353,67 @@ elm_quicklaunch_init(int argc, char **argv) int i; char buf[PATH_MAX]; char *s; - + eet_init(); - ecore_init(); + ecore_init(); ecore_app_args_set(argc, (const char **)argv); ecore_file_init(); evas_init(); edje_init(); ecore_evas_init(); // FIXME: check errors - + _elm_exit_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL); - + _elm_appname = strdup(ecore_file_file_get(argv[0])); if (!_elm_data_dir) { - s = getenv("ELM_DATA_DIR"); - _elm_data_dir = eina_stringshare_add(s); + s = getenv("ELM_DATA_DIR"); + _elm_data_dir = eina_stringshare_add(s); } if (!_elm_data_dir) - { - s = getenv("ELM_PREFIX"); - if (s) - { - snprintf(buf, sizeof(buf), "%s/share/elementary", s); - _elm_data_dir = eina_stringshare_add(buf); - } + { + s = getenv("ELM_PREFIX"); + if (s) + { + snprintf(buf, sizeof(buf), "%s/share/elementary", s); + _elm_data_dir = eina_stringshare_add(buf); + } } #ifdef HAVE_DLADDR if (!_elm_data_dir) { - Dl_info elementary_dl; - // libelementary.so/../../share/elementary/ - if (dladdr(elm_init, &elementary_dl)) - { - char *dir, *dir2; - - dir = ecore_file_dir_get(elementary_dl.dli_fname); - if (dir) - { - dir2 = ecore_file_dir_get(dir); - if (dir2) - { - snprintf(buf, sizeof(buf), "%s/share/elementary", dir2); - if (ecore_file_is_dir(buf)) - _elm_data_dir = eina_stringshare_add(buf); - free(dir2); - } - free(dir); - } - } + Dl_info elementary_dl; + // libelementary.so/../../share/elementary/ + if (dladdr(elm_init, &elementary_dl)) + { + char *dir, *dir2; + + dir = ecore_file_dir_get(elementary_dl.dli_fname); + if (dir) + { + dir2 = ecore_file_dir_get(dir); + if (dir2) + { + snprintf(buf, sizeof(buf), "%s/share/elementary", dir2); + if (ecore_file_is_dir(buf)) + _elm_data_dir = eina_stringshare_add(buf); + free(dir2); + } + free(dir); + } + } } #endif if (!_elm_data_dir) { - _elm_data_dir = eina_stringshare_add(PACKAGE_DATA_DIR); + _elm_data_dir = eina_stringshare_add(PACKAGE_DATA_DIR); } if (!_elm_data_dir) { - _elm_data_dir = eina_stringshare_add("/"); + _elm_data_dir = eina_stringshare_add("/"); } - + // FIXME: actually load config _elm_config = ELM_NEW(Elm_Config); _elm_config->engine = ELM_SOFTWARE_X11; @@ -432,44 +432,44 @@ elm_quicklaunch_init(int argc, char **argv) _elm_config->bgpixmap = 0; _elm_config->compositing = 1; _elm_config->fps = 60.0; - + s = getenv("ELM_ENGINE"); if (s) { - if ((!strcasecmp(s, "x11")) || - (!strcasecmp(s, "x")) || - (!strcasecmp(s, "software-x11")) || - (!strcasecmp(s, "software_x11"))) - _elm_config->engine = ELM_SOFTWARE_X11; - else if ((!strcasecmp(s, "x11-16")) || - (!strcasecmp(s, "x16")) || - (!strcasecmp(s, "software-16-x11")) || - (!strcasecmp(s, "software_16_x11"))) - _elm_config->engine = ELM_SOFTWARE_16_X11; - else if ((!strcasecmp(s, "xrender")) || - (!strcasecmp(s, "xr")) || - (!strcasecmp(s, "xrender-x11")) || - (!strcasecmp(s, "xrender_x11"))) - _elm_config->engine = ELM_XRENDER_X11; - else if ((!strcasecmp(s, "fb")) || - (!strcasecmp(s, "software-fb")) || - (!strcasecmp(s, "software_fb"))) - _elm_config->engine = ELM_SOFTWARE_FB; - else if ((!strcasecmp(s, "opengl")) || - (!strcasecmp(s, "gl")) || - (!strcasecmp(s, "opengl-x11")) || - (!strcasecmp(s, "opengl_x11"))) - _elm_config->engine = ELM_OPENGL_X11; - else if ((!strcasecmp(s, "gdi")) || - (!strcasecmp(s, "software-gdi")) || - (!strcasecmp(s, "software_gdi"))) - _elm_config->engine = ELM_SOFTWARE_WIN32; - else if ((!strcasecmp(s, "wince-gdi")) || - (!strcasecmp(s, "software-16-wince-gdi")) || - (!strcasecmp(s, "software_16_wince_gdi"))) - _elm_config->engine = ELM_SOFTWARE_16_WINCE; + if ((!strcasecmp(s, "x11")) || + (!strcasecmp(s, "x")) || + (!strcasecmp(s, "software-x11")) || + (!strcasecmp(s, "software_x11"))) + _elm_config->engine = ELM_SOFTWARE_X11; + else if ((!strcasecmp(s, "x11-16")) || + (!strcasecmp(s, "x16")) || + (!strcasecmp(s, "software-16-x11")) || + (!strcasecmp(s, "software_16_x11"))) + _elm_config->engine = ELM_SOFTWARE_16_X11; + else if ((!strcasecmp(s, "xrender")) || + (!strcasecmp(s, "xr")) || + (!strcasecmp(s, "xrender-x11")) || + (!strcasecmp(s, "xrender_x11"))) + _elm_config->engine = ELM_XRENDER_X11; + else if ((!strcasecmp(s, "fb")) || + (!strcasecmp(s, "software-fb")) || + (!strcasecmp(s, "software_fb"))) + _elm_config->engine = ELM_SOFTWARE_FB; + else if ((!strcasecmp(s, "opengl")) || + (!strcasecmp(s, "gl")) || + (!strcasecmp(s, "opengl-x11")) || + (!strcasecmp(s, "opengl_x11"))) + _elm_config->engine = ELM_OPENGL_X11; + else if ((!strcasecmp(s, "gdi")) || + (!strcasecmp(s, "software-gdi")) || + (!strcasecmp(s, "software_gdi"))) + _elm_config->engine = ELM_SOFTWARE_WIN32; + else if ((!strcasecmp(s, "wince-gdi")) || + (!strcasecmp(s, "software-16-wince-gdi")) || + (!strcasecmp(s, "software_16_wince_gdi"))) + _elm_config->engine = ELM_SOFTWARE_16_WINCE; } - + s = getenv("ELM_THUMBSCROLL_ENABLE"); if (s) _elm_config->thumbscroll_enable = atoi(s); s = getenv("ELM_THUMBSCROLL_THRESHOLD"); @@ -479,54 +479,54 @@ elm_quicklaunch_init(int argc, char **argv) if (s) _elm_config->thumbscroll_momentum_threshhold = atof(s); s = getenv("ELM_THUMBSCROLL_FRICTION"); if (s) _elm_config->thumbscroll_friction = atof(s); - + s = getenv("ELM_THEME"); if (s) _elm_theme_parse(s); else _elm_theme_parse("default"); - + _elm_config->font_hinting = 2; s= getenv("ELM_FONT_HINTING"); if (s) { - if (!strcasecmp(s, "none")) - _elm_config->font_hinting = 0; - else if (!strcasecmp(s, "auto")) - _elm_config->font_hinting = 1; - else if (!strcasecmp(s, "bytecode")) - _elm_config->font_hinting = 2; + if (!strcasecmp(s, "none")) + _elm_config->font_hinting = 0; + else if (!strcasecmp(s, "auto")) + _elm_config->font_hinting = 1; + else if (!strcasecmp(s, "bytecode")) + _elm_config->font_hinting = 2; } - + s = getenv("ELM_FONT_PATH"); if (s) { - const char *p, *pp; - char *buf; - - buf = alloca(strlen(s) + 1); - p = s; - pp = p; - for (;;) - { - if ((*p == ':') || (*p == 0)) - { - int len; - - len = p - pp; - strncpy(buf, pp, len); - buf[len] = 0; - _elm_config->font_dirs = eina_list_append(_elm_config->font_dirs, eina_stringshare_add(buf)); - if (*p == 0) break; - p++; - pp = p; - } - else - { - if (*p == 0) break; - p++; - } - } + const char *p, *pp; + char *buf; + + buf = alloca(strlen(s) + 1); + p = s; + pp = p; + for (;;) + { + if ((*p == ':') || (*p == 0)) + { + int len; + + len = p - pp; + strncpy(buf, pp, len); + buf[len] = 0; + _elm_config->font_dirs = eina_list_append(_elm_config->font_dirs, eina_stringshare_add(buf)); + if (*p == 0) break; + p++; + pp = p; + } + else + { + if (*p == 0) break; + p++; + } + } } - + s = getenv("ELM_IMAGE_CACHE"); if (s) _elm_config->image_cache = atoi(s); @@ -535,18 +535,18 @@ elm_quicklaunch_init(int argc, char **argv) s = getenv("ELM_SCALE"); if (s) _elm_config->scale = atof(s); - - _elm_config->finger_size = + + _elm_config->finger_size = (double)_elm_config->finger_size * _elm_config->scale; s = getenv("ELM_FINGER_SIZE"); if (s) _elm_config->finger_size = atoi(s); - + s = getenv("ELM_FPS"); if (s) _elm_config->fps = atof(s); - + if (_elm_config->fps < 1.0) _elm_config->fps = 1.0; - + ecore_animator_frametime_set(1.0 / _elm_config->fps); } @@ -561,35 +561,35 @@ elm_quicklaunch_sub_init(int argc, char **argv) { #ifdef HAVE_ELEMENTARY_X int val = 1000; - + if (!ecore_x_init(NULL)) - { - EINA_ERROR_PERR("elementary: ERROR. Cannot connect to X11 display. check $DISPLAY variable\n"); - exit(1); - } + { + EINA_ERROR_PERR("elementary: ERROR. Cannot connect to X11 display. check $DISPLAY variable\n"); + exit(1); + } if (!ecore_x_screen_is_composited(0)) _elm_config->compositing = 0; - _elm_atom_enlightenment_scale = ecore_x_atom_get("ENLIGHTENMENT_SCALE"); - ecore_x_event_mask_set(ecore_x_window_root_first_get(), - ECORE_X_EVENT_MASK_WINDOW_PROPERTY); - _elm_event_property_change = ecore_event_handler_add - (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_window_property_change, NULL); - if (!getenv("ELM_SCALE")) - { - if (ecore_x_window_prop_card32_get(ecore_x_window_root_first_get(), - _elm_atom_enlightenment_scale, - &val, 1) > 0) - { - if (val > 0) - { - _elm_config->scale = (double)val / 1000.0; - // FIXME: hack until e export finger size too - if (getenv("ELM_FINGER_SIZE")) - _elm_config->finger_size = 40.0 * _elm_config->scale; - } - } - } -#endif + _elm_atom_enlightenment_scale = ecore_x_atom_get("ENLIGHTENMENT_SCALE"); + ecore_x_event_mask_set(ecore_x_window_root_first_get(), + ECORE_X_EVENT_MASK_WINDOW_PROPERTY); + _elm_event_property_change = ecore_event_handler_add + (ECORE_X_EVENT_WINDOW_PROPERTY, _elm_window_property_change, NULL); + if (!getenv("ELM_SCALE")) + { + if (ecore_x_window_prop_card32_get(ecore_x_window_root_first_get(), + _elm_atom_enlightenment_scale, + &val, 1) > 0) + { + if (val > 0) + { + _elm_config->scale = (double)val / 1000.0; + // FIXME: hack until e export finger size too + if (getenv("ELM_FINGER_SIZE")) + _elm_config->finger_size = 40.0 * _elm_config->scale; + } + } + } +#endif } } @@ -606,11 +606,11 @@ elm_quicklaunch_sub_shutdown(void) (_elm_config->engine == ELM_SOFTWARE_16_WINCE)) { #ifdef HAVE_ELEMENTARY_X - ecore_event_handler_del(_elm_event_property_change); - _elm_event_property_change = NULL; - ecore_x_disconnect(); + ecore_event_handler_del(_elm_event_property_change); + _elm_event_property_change = NULL; + ecore_x_disconnect(); #endif - evas_cserve_disconnect(); + evas_cserve_disconnect(); } } @@ -618,18 +618,18 @@ EAPI void elm_quicklaunch_shutdown(void) { const char *fontdir; - + eina_stringshare_del(_elm_data_dir); _elm_data_dir = NULL; EINA_LIST_FREE(_elm_config->font_dirs, fontdir) { - eina_stringshare_del(fontdir); + eina_stringshare_del(fontdir); } ecore_event_handler_del(_elm_exit_handler); _elm_exit_handler = NULL; - + free(_elm_config); free(_elm_appname); ecore_evas_shutdown(); @@ -644,7 +644,7 @@ EAPI void elm_quicklaunch_seed(void) { Evas_Object *win, *bg, *bt; - + win = elm_win_add(NULL, "seed", ELM_WIN_BASIC); bg = elm_bg_add(win); elm_win_resize_object_add(win, bg); @@ -661,8 +661,8 @@ elm_quicklaunch_seed(void) (_elm_config->engine == ELM_OPENGL_X11)) { #ifdef HAVE_ELEMENTARY_X - ecore_x_sync(); -#endif + ecore_x_sync(); +#endif } ecore_main_loop_iterate(); } @@ -677,32 +677,32 @@ elm_quicklaunch_prepare(int argc, char **argv) char *exe = elm_quicklaunch_exe_path_get(argv[0]); if (!exe) { - printf("ERROR: %s does not exist\n", argv[0]); - return EINA_FALSE; + printf("ERROR: %s does not exist\n", argv[0]); + return EINA_FALSE; } else { - char *exe2, *p; - char *exename; - - exe2 = malloc(strlen(exe) + 1 + 10); - strcpy(exe2, exe); - p = strrchr(exe2, '/'); - if (p) p++; - else p = exe2; - exename = alloca(strlen(p) + 1); - strcpy(exename, p); - *p = 0; - strcat(p, "../lib/"); - strcat(p, exename); - strcat(p, ".so"); - if (access(exe2, R_OK | X_OK) == 0) - { - free(exe); - exe = exe2; - } - else - free(exe2); + char *exe2, *p; + char *exename; + + exe2 = malloc(strlen(exe) + 1 + 10); + strcpy(exe2, exe); + p = strrchr(exe2, '/'); + if (p) p++; + else p = exe2; + exename = alloca(strlen(p) + 1); + strcpy(exename, p); + *p = 0; + strcat(p, "../lib/"); + strcat(p, exename); + strcat(p, ".so"); + if (access(exe2, R_OK | X_OK) == 0) + { + free(exe); + exe = exe2; + } + else + free(exe2); } qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL); free(exe); @@ -710,9 +710,9 @@ elm_quicklaunch_prepare(int argc, char **argv) qr_main = dlsym(qr_handle, "elm_main"); if (!qr_main) { - dlclose(qr_handle); - qr_handle = NULL; - return EINA_FALSE; + dlclose(qr_handle); + qr_handle = NULL; + return EINA_FALSE; } return EINA_TRUE; #else @@ -727,17 +727,17 @@ save_env(void) int i, size; extern char **environ; char **oldenv, **p; - + oldenv = environ; - + for (i = 0, size = 0; environ[i] != NULL; i++) size += strlen(environ[i]) + 1; - + p = malloc((i + 1) * sizeof(char *)); if (!p) return; - + environ = p; - + for (i = 0; oldenv[i] != NULL; i++) environ[i] = strdup(oldenv[i]); environ[i] = NULL; @@ -752,29 +752,29 @@ elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (postfork_func) (voi int ret; int real_argc; char **real_argv; - + // FIXME: // need to accept current environment from elementary_run if (!qr_main) { - int i; - char **args; - - child = fork(); - if (child > 0) return EINA_TRUE; + int i; + char **args; + + child = fork(); + if (child > 0) return EINA_TRUE; else if (child < 0) { perror("could not fork"); return EINA_FALSE; } - setsid(); - if (chdir(cwd) != 0) + setsid(); + if (chdir(cwd) != 0) perror("could not chdir"); - args = alloca((argc + 1) * sizeof(char *)); - for (i = 0; i < argc; i++) args[i] = argv[i]; - args[argc] = NULL; - printf("WARNING: %s not quicklaunch capable\n", argv[0]); - exit(execvp(argv[0], args)); + args = alloca((argc + 1) * sizeof(char *)); + for (i = 0; i < argc; i++) args[i] = argv[i]; + args[argc] = NULL; + printf("WARNING: %s not quicklaunch capable\n", argv[0]); + exit(execvp(argv[0], args)); } child = fork(); if (child > 0) return EINA_TRUE; @@ -794,12 +794,12 @@ elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (postfork_func) (voi save_env(); if (real_argv) { - char *lastarg, *p; + char *lastarg, *p; - ecore_app_args_get(&real_argc, &real_argv); - lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]); - for (p = real_argv[0]; p < lastarg; p++) *p = 0; - strcpy(real_argv[0], argv[0]); + ecore_app_args_get(&real_argc, &real_argv); + lastarg = real_argv[real_argc - 1] + strlen(real_argv[real_argc - 1]); + for (p = real_argv[0]; p < lastarg; p++) *p = 0; + strcpy(real_argv[0], argv[0]); } ecore_app_args_set(argc, (const char **)argv); ret = qr_main(argc, argv); @@ -807,7 +807,7 @@ elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (postfork_func) (voi return EINA_TRUE; #else return EINA_FALSE; -#endif +#endif } EAPI void @@ -816,9 +816,9 @@ elm_quicklaunch_cleanup(void) #ifdef HAVE_FORK if (qr_handle) { - dlclose(qr_handle); - qr_handle = NULL; - qr_main = NULL; + dlclose(qr_handle); + qr_handle = NULL; + qr_main = NULL; } #endif } @@ -848,44 +848,44 @@ elm_quicklaunch_exe_path_get(const char *exe) if ((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/')) return strdup(exe); if (!path) { - const char *p, *pp, *s; - char *buf; - path = getenv("PATH"); - buf = alloca(strlen(path) + 1); - p = path; - pp = p; - for (;;) - { - if ((*p == ':') || (*p == 0)) - { - int len; - - len = p - pp; - strncpy(buf, pp, len); - buf[len] = 0; - pathlist = eina_list_append(pathlist, eina_stringshare_add(buf)); - if (*p == 0) break; - p++; - pp = p; - } - else - { - if (*p == 0) break; - p++; - } - } + const char *p, *pp, *s; + char *buf; + path = getenv("PATH"); + buf = alloca(strlen(path) + 1); + p = path; + pp = p; + for (;;) + { + if ((*p == ':') || (*p == 0)) + { + int len; + + len = p - pp; + strncpy(buf, pp, len); + buf[len] = 0; + pathlist = eina_list_append(pathlist, eina_stringshare_add(buf)); + if (*p == 0) break; + p++; + pp = p; + } + else + { + if (*p == 0) break; + p++; + } + } } EINA_LIST_FOREACH(pathlist, l, pathitr) { - snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe); - if (access(buf, R_OK | X_OK) == 0) return strdup(buf); + snprintf(buf, sizeof(buf), "%s/%s", pathitr, exe); + if (access(buf, R_OK | X_OK) == 0) return strdup(buf); } return NULL; } /** * Run the main loop - * + * * This call should be called just after all initialization is complete. This * function will not return until elm_exit() is called. It will keep looping * running the main event/processing loop for Elementary. @@ -899,7 +899,7 @@ elm_run(void) /** * Exit the main loop - * + * * If this call is called, it will flag the main loop to cease processing and * return back to its parent function. * @ingroup General @@ -912,10 +912,10 @@ elm_exit(void) /** * @defgroup Scaling Selective Widget Scaling - * + * * Different widgets can be scaled independently. These functions allow you to - * manipulate this scaling on a per-widget basis. The object and all its - * children get their scaling factors multiplied by the scale factor set. + * manipulate this scaling on a per-widget basis. The object and all its + * children get their scaling factors multiplied by the scale factor set. * This is multiplicative, in that if a child also has a scale size set it is * in turn multiplied by its parent's scale size. 1.0 means “don't scale”, * 2.0 is double size, 0.5 is half etc. @@ -923,7 +923,7 @@ elm_exit(void) /** * Set the scaling factor - * + * * @param obj The object * @param scale Scale factor (from 0.0 up, with 1.0 == no scaling) * @ingroup Scaling @@ -936,7 +936,7 @@ elm_object_scale_set(Evas_Object *obj, double scale) /** * Get the scaling factor - * + * * @param obj The object * @return The scaling factor set by elm_object_scale_set() * @ingroup Scaling @@ -949,14 +949,14 @@ elm_object_scale_get(const Evas_Object *obj) /** * @defgroup Styles Styles - * + * * Widgets can have different styles of look. These generic API's set * styles of widgets, if they support them (and if the theme(s) do). */ /** * Set the style - * + * * This sets the name of the style * @param obj The object * @param style The style name to use @@ -970,11 +970,11 @@ elm_object_style_set(Evas_Object *obj, const char *style) /** * Get the style - * + * * This gets the style being used for that widget. Note that the string - * pointer is only valid as longas the object is valid and the style doesn't + * pointer is only valid as longas the object is valid and the style doesn't * change. - * + * * @param obj The object * @return The style name * @ingroup Styles @@ -987,10 +987,10 @@ elm_object_style_get(const Evas_Object *obj) /** * Get the global scaling factor - * + * * This gets the globally configured scaling factor that is applied to all * objects. - * + * * @return The scaling factor * @ingroup Scaling */ @@ -1002,10 +1002,10 @@ elm_scale_get(void) /** * Set the global scaling factor - * + * * This sets the globally configured scaling factor that is applied to all * objects. - * + * * @param scale The scaling factor to set * @ingroup Scaling */ @@ -1019,7 +1019,7 @@ elm_scale_set(double scale) /** * @defgroup Fingers Fingers - * + * * Elementary is designed to be finger-friendly for touchscreens, and so in * addition to scaling for display resolution, it can also scale based on * finger "resoltion" (or size). @@ -1027,9 +1027,9 @@ elm_scale_set(double scale) /** * Get the configured finger size - * + * * This gets the globally configured finger size in pixels - * + * * @return The finger size * @ingroup Fingers */ @@ -1041,9 +1041,9 @@ elm_finger_size_get(void) /** * Set the configured finger size - * + * * This sets the globally configured finger size in pixels - * + * * @paramsize The finger size * @ingroup Fingers */ @@ -1056,13 +1056,13 @@ elm_finger_size_set(Evas_Coord size) } /** - * Adjust size of an element for finger usage - * + * Adjust size of an element for finger usage + * * This takes width and height sizes (in pixels) as input and a size multiple * (which is how many fingers you want to place within the area), and adjusts * the size tobe large enough to accomodate finger. On return the w and h * sizes poiner do by these parameters will be modified. - * + * * @param times_w How many fingers should fit horizontally * @param w Pointer to the width size to adjust * @param times_h How many fingers should fit vertically @@ -1080,16 +1080,16 @@ elm_coords_finger_size_adjust(int times_w, Evas_Coord *w, int times_h, Evas_Coor /** * @defgroup Focus Focus - * + * * Objects have focus. This is what determines where the keyboard input goes to * within the application window. */ /** * Set the focus to the object - * + * * This sets the focus target forkeyboard input to be the object indicated. - * + * * @param obj The object * @ingroup Focus */ diff --git a/legacy/elementary/src/lib/elm_pager.c b/legacy/elementary/src/lib/elm_pager.c index 930d9c0056..11e19b741c 100644 --- a/legacy/elementary/src/lib/elm_pager.c +++ b/legacy/elementary/src/lib/elm_pager.c @@ -3,10 +3,10 @@ /** * @defgroup Pager Pager - * + * * The pager is an object that allows flipping (with animation) between 1 or - * more “pages” of objects, much like a stack of windows within the window. - * + * more “pages” of objects, much like a stack of windows within the window. + * * Objects can be pushed or popped from he stack or deleted as normal. * Pushes and pops will animate (and a pop will delete the object once the * animation is finished). Any object in the pager can be promoted to the top @@ -69,8 +69,8 @@ _sizing_eval(Evas_Object *obj) Item *it; EINA_LIST_FOREACH(wd->stack, l, it) { - if (it->minw > minw) minw = it->minw; - if (it->minh > minh) minh = it->minh; + if (it->minw > minw) minw = it->minw; + if (it->minh > minh) minh = it->minh; } evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); @@ -94,30 +94,30 @@ _eval_top(Evas_Object *obj) ittop = eina_list_last(wd->stack)->data; if (ittop != wd->top) { - Evas_Object *o; - const char *onshow, *onhide; + Evas_Object *o; + const char *onshow, *onhide; - if (wd->top) - { - o = wd->top->base; - edje_object_signal_emit(o, "elm,action,hide", "elm"); - onhide = edje_object_data_get(o, "onhide"); - if (onhide) - { - if (!strcmp(onhide, "raise")) evas_object_raise(o); - else if (!strcmp(onhide, "lower")) evas_object_lower(o); - } - } - wd->top = ittop; - o = wd->top->base; - evas_object_show(o); - edje_object_signal_emit(o, "elm,action,show", "elm"); - onshow = edje_object_data_get(o, "onshow"); - if (onshow) - { - if (!strcmp(onshow, "raise")) evas_object_raise(o); - else if (!strcmp(onshow, "lower")) evas_object_lower(o); - } + if (wd->top) + { + o = wd->top->base; + edje_object_signal_emit(o, "elm,action,hide", "elm"); + onhide = edje_object_data_get(o, "onhide"); + if (onhide) + { + if (!strcmp(onhide, "raise")) evas_object_raise(o); + else if (!strcmp(onhide, "lower")) evas_object_lower(o); + } + } + wd->top = ittop; + o = wd->top->base; + evas_object_show(o); + edje_object_signal_emit(o, "elm,action,show", "elm"); + onshow = edje_object_data_get(o, "onshow"); + if (onshow) + { + if (!strcmp(onshow, "raise")) evas_object_raise(o); + else if (!strcmp(onshow, "lower")) evas_object_lower(o); + } } } @@ -142,18 +142,18 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) Item *it; EINA_LIST_FOREACH(wd->stack, l, it) { - if (it->content == sub) - { - wd->stack = eina_list_remove_list(wd->stack, l); - evas_object_event_callback_del - (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); - evas_object_del(it->base); - _eval_top(it->obj); - free(it); - return; - } + if (it->content == sub) + { + wd->stack = eina_list_remove_list(wd->stack, l); + evas_object_event_callback_del + (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); + evas_object_del(it->base); + _eval_top(it->obj); + free(it); + return; + } } -} +} static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info) @@ -177,7 +177,7 @@ _signal_hide_finished(void *data, Evas_Object *obj, const char *emission, const edje_object_message_signal_process(it->base); if (it->popme) { - evas_object_del(it->content); + evas_object_del(it->content); } _sizing_eval(obj2); } @@ -196,7 +196,7 @@ elm_pager_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -205,19 +205,19 @@ elm_pager_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj); - + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } /** * Push an object to the top of the pager stack (and show it) - * + * * The object pushed becomes a child of the pager and will be controlled * it and deleted when the pager is deleted. * @@ -240,7 +240,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content) evas_object_geometry_get(obj, &x, &y, &w, &h); evas_object_move(it->base, x, y); evas_object_resize(it->base, w, h); - elm_widget_sub_object_add(obj, it->base); + elm_widget_sub_object_add(obj, it->base); elm_widget_sub_object_add(obj, it->content); _elm_theme_set(it->base, "pager", "base", elm_widget_style_get(obj)); edje_object_signal_callback_add(it->base, "elm,action,hide,finished", "", _signal_hide_finished, it); @@ -248,7 +248,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content) edje_object_size_min_calc(it->base, &it->minw, &it->minh); evas_object_show(it->content); evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, it); + _changed_size_hints, it); wd->stack = eina_list_append(wd->stack, it); _eval_top(obj); _sizing_eval(obj); @@ -260,7 +260,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content) * This pops the object that is on top (visible) in the pager, makes it * disappear, then deletes the object. The object that was underneath it * on the stack will become visible. - * + * * @param obj The pager object * * @ingroup Pager @@ -277,28 +277,28 @@ elm_pager_content_pop(Evas_Object *obj) ll = eina_list_last(wd->stack); if (ll) { - ll = ll->prev; - if (!ll) - { - Evas_Object *o; - const char *onhide; - - wd->top = it; - o = wd->top->base; - edje_object_signal_emit(o, "elm,action,hide", "elm"); - onhide = edje_object_data_get(o, "onhide"); - if (onhide) - { - if (!strcmp(onhide, "raise")) evas_object_raise(o); - else if (!strcmp(onhide, "lower")) evas_object_lower(o); - } - wd->top = NULL; - } - else - { - it = ll->data; - elm_pager_content_promote(obj, it->content); - } + ll = ll->prev; + if (!ll) + { + Evas_Object *o; + const char *onhide; + + wd->top = it; + o = wd->top->base; + edje_object_signal_emit(o, "elm,action,hide", "elm"); + onhide = edje_object_data_get(o, "onhide"); + if (onhide) + { + if (!strcmp(onhide, "raise")) evas_object_raise(o); + else if (!strcmp(onhide, "lower")) evas_object_lower(o); + } + wd->top = NULL; + } + else + { + it = ll->data; + elm_pager_content_promote(obj, it->content); + } } } @@ -308,7 +308,7 @@ elm_pager_content_pop(Evas_Object *obj) * This will take the indicated object and promote it to the top of the stack * as if it had been pushed there. The object must already be inside the * pager stack to work. - * + * * @param obj The pager object * @param content The object to promote * @@ -322,13 +322,13 @@ elm_pager_content_promote(Evas_Object *obj, Evas_Object *content) Item *it; EINA_LIST_FOREACH(wd->stack, l, it) { - if (it->content == content) - { - wd->stack = eina_list_remove_list(wd->stack, l); - wd->stack = eina_list_append(wd->stack, it); - _eval_top(obj); - return; - } + if (it->content == content) + { + wd->stack = eina_list_remove_list(wd->stack, l); + wd->stack = eina_list_append(wd->stack, it); + _eval_top(obj); + return; + } } } @@ -367,4 +367,3 @@ elm_pager_content_top_get(Evas_Object *obj) it = eina_list_last(wd->stack)->data; return it->content; } - diff --git a/legacy/elementary/src/lib/elm_photo.c b/legacy/elementary/src/lib/elm_photo.c index d368f4e006..ef784f3eeb 100644 --- a/legacy/elementary/src/lib/elm_photo.c +++ b/legacy/elementary/src/lib/elm_photo.c @@ -35,10 +35,10 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - - evas_object_size_hint_min_set(wd->img, - wd->size * elm_widget_scale_get(obj) * _elm_config->scale, - wd->size * elm_widget_scale_get(obj) * _elm_config->scale); + + evas_object_size_hint_min_set(wd->img, + wd->size * elm_widget_scale_get(obj) * _elm_config->scale, + wd->size * elm_widget_scale_get(obj) * _elm_config->scale); edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img); elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->frm, &minw, &minh, minw, minh); @@ -61,7 +61,7 @@ elm_photo_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -75,7 +75,7 @@ elm_photo_add(Evas_Object *parent) wd->frm = edje_object_add(e); _elm_theme_set(wd->frm, "photo", "base", "default"); elm_widget_resize_object_set(obj, wd->frm); - + wd->img = _els_smart_icon_add(e); _els_smart_icon_scale_up_set(wd->img, 1); _els_smart_icon_scale_down_set(wd->img, 1); @@ -88,9 +88,9 @@ elm_photo_add(Evas_Object *parent) edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img); evas_object_show(wd->img); elm_widget_sub_object_add(obj, wd->img); - + wd->size = 40; - + _sizing_eval(obj); return obj; } diff --git a/legacy/elementary/src/lib/elm_priv.h b/legacy/elementary/src/lib/elm_priv.h index a3f112b3bc..1e38aefffc 100644 --- a/legacy/elementary/src/lib/elm_priv.h +++ b/legacy/elementary/src/lib/elm_priv.h @@ -97,11 +97,11 @@ EAPI void elm_widget_disabled_set(Evas_Object *obj, int disabled); EAPI int elm_widget_disabled_get(const Evas_Object *obj); EAPI void elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); EAPI void elm_widget_show_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); -EAPI void elm_widget_scroll_hold_push(Evas_Object *obj); -EAPI void elm_widget_scroll_hold_pop(Evas_Object *obj); +EAPI void elm_widget_scroll_hold_push(Evas_Object *obj); +EAPI void elm_widget_scroll_hold_pop(Evas_Object *obj); EAPI int elm_widget_scroll_hold_get(const Evas_Object *obj); -EAPI void elm_widget_scroll_freeze_push(Evas_Object *obj); -EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj); +EAPI void elm_widget_scroll_freeze_push(Evas_Object *obj); +EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj); EAPI int elm_widget_scroll_freeze_get(const Evas_Object *obj); EAPI void elm_widget_scale_set(Evas_Object *obj, double scale); EAPI double elm_widget_scale_get(const Evas_Object *obj); diff --git a/legacy/elementary/src/lib/elm_radio.c b/legacy/elementary/src/lib/elm_radio.c index 39d45189d4..7f931f7950 100644 --- a/legacy/elementary/src/lib/elm_radio.c +++ b/legacy/elementary/src/lib/elm_radio.c @@ -3,19 +3,19 @@ /** * @defgroup Radio Radio - * - * The radio button allows for 1 or more selectors to be created to select 1 + * + * The radio button allows for 1 or more selectors to be created to select 1 * of a set of options. - * + * * Signals that you can add callbacks for are: - * - * changed - This is called whenever the user changes the state of one of the + * + * changed - This is called whenever the user changes the state of one of the * radio objects within the group of radio objects that work together. - * - * A radio object contains an indicator, an optional Label and an optional - * icon object. They work normally in groups of 2 or more. When you create a - * radio (if it is not the first member of the group), simply add it to the - * group by adding it to any other member of the group that already exists + * + * A radio object contains an indicator, an optional Label and an optional + * icon object. They work normally in groups of 2 or more. When you create a + * radio (if it is not the first member of the group), simply add it to the + * group by adding it to any other member of the group that already exists * (or the first member) with elm_radio_group_add() with the second parameter * being the existing group member. The radio object(s) will select from one * of a set of integer values, so any value they are configuring needs to be @@ -97,7 +97,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->chk, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); @@ -137,11 +137,11 @@ _state_set(Evas_Object *obj, Eina_Bool state) Widget_Data *wd = elm_widget_data_get(obj); if (state != wd->state) { - wd->state = state; - if (wd->state) - edje_object_signal_emit(wd->chk, "elm,state,radio,on", "elm"); - else - edje_object_signal_emit(wd->chk, "elm,state,radio,off", "elm"); + wd->state = state; + if (wd->state) + edje_object_signal_emit(wd->chk, "elm,state,radio,on", "elm"); + else + edje_object_signal_emit(wd->chk, "elm,state,radio,off", "elm"); } } @@ -153,9 +153,9 @@ _state_set_all(Widget_Data *wd) EINA_LIST_FOREACH(wd->group->radios, l, child) { - Widget_Data *wd2 = elm_widget_data_get(child); - if (wd2->value == wd->group->value) _state_set(child, 1); - else _state_set(child, 0); + Widget_Data *wd2 = elm_widget_data_get(child); + if (wd2->value == wd->group->value) _state_set(child, 1); + else _state_set(child, 0); } } @@ -184,7 +184,7 @@ elm_radio_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -193,7 +193,7 @@ elm_radio_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->chk = edje_object_add(e); _elm_theme_set(wd->chk, "radio", "base", "default"); edje_object_signal_callback_add(wd->chk, "elm,action,radio,on", "", _signal_radio_on, obj); @@ -205,7 +205,7 @@ elm_radio_add(Evas_Object *parent) wd->group = calloc(1, sizeof(Group)); wd->group->radios = eina_list_append(wd->group->radios, obj); wd->state = 0; - + _sizing_eval(obj); return obj; } @@ -227,13 +227,13 @@ elm_radio_label_set(Evas_Object *obj, const char *label) if (wd->label) eina_stringshare_del(wd->label); if (label) { - wd->label = eina_stringshare_add(label); + wd->label = eina_stringshare_add(label); edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm"); edje_object_message_signal_process(wd->chk); } else { - wd->label = NULL; + wd->label = NULL; edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm"); edje_object_message_signal_process(wd->chk); } @@ -274,7 +274,7 @@ elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Add this radio to a group of other radio objects - * + * * Radio objects work in groups. Each member should have a different integer * value assigned. In order ro have them work as a group, they need to know * about eacthother. This adds the given radio object to the group of which @@ -322,10 +322,10 @@ elm_radio_state_value_set(Evas_Object *obj, int value) /** * Set the value the radio - * + * * This sets the value of the radio group and will also set the value if * pointed to, to the value supplied, but will not call any callbacks. - * + * * @param obj The radio object * @param state The value to use for the group * @@ -380,18 +380,18 @@ elm_radio_value_pointer_set(Evas_Object *obj, int *valuep) if (valuep) { - wd->group->valuep = valuep; + wd->group->valuep = valuep; if (*(wd->group->valuep) != wd->group->value) { - const Eina_List *l; + const Eina_List *l; Evas_Object *child; - wd->group->value = *(wd->group->valuep); + wd->group->value = *(wd->group->valuep); _state_set_all(wd); - } + } } else { - wd->group->valuep = NULL; + wd->group->valuep = NULL; } } diff --git a/legacy/elementary/src/lib/elm_scroller.c b/legacy/elementary/src/lib/elm_scroller.c index 03f5d1e611..c0eef01ece 100644 --- a/legacy/elementary/src/lib/elm_scroller.c +++ b/legacy/elementary/src/lib/elm_scroller.c @@ -174,7 +174,7 @@ elm_scroller_add(Evas_Object *parent) Evas *e; Widget_Data *wd; Evas_Coord vw, vh, minw, minh; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -183,11 +183,11 @@ elm_scroller_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->scr = elm_smart_scroller_add(e); elm_widget_resize_object_set(obj, wd->scr); - evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); + evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); @@ -198,13 +198,13 @@ elm_scroller_add(Evas_Object *parent) evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj); evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj); evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj); - + evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj); evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj); evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj); evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom, obj); evas_object_smart_callback_add(wd->scr, "scroll", _scroll, obj); - + _sizing_eval(obj); return obj; } @@ -222,7 +222,7 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content) elm_widget_on_show_region_hook_set(content, _show_region_hook, obj); elm_widget_sub_object_add(obj, content); elm_smart_scroller_child_set(wd->scr, content); - evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); _sizing_eval(obj); } @@ -250,11 +250,11 @@ EAPI void elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) { Widget_Data *wd = elm_widget_data_get(obj); - const Elm_Scroller_Policy map[3] = + const Elm_Scroller_Policy map[3] = { - ELM_SMART_SCROLLER_POLICY_AUTO, - ELM_SMART_SCROLLER_POLICY_ON, - ELM_SMART_SCROLLER_POLICY_OFF + ELM_SMART_SCROLLER_POLICY_AUTO, + ELM_SMART_SCROLLER_POLICY_ON, + ELM_SMART_SCROLLER_POLICY_OFF }; if (!wd) return; if ((policy_h < 0) || (policy_h >= 3) || (policy_v < 0) || (policy_v >= 3)) diff --git a/legacy/elementary/src/lib/elm_slider.c b/legacy/elementary/src/lib/elm_slider.c index a6ea33c2e9..c3cc72b3c0 100644 --- a/legacy/elementary/src/lib/elm_slider.c +++ b/legacy/elementary/src/lib/elm_slider.c @@ -3,30 +3,30 @@ /** * @defgroup Slider Slider - * + * * The slider adds a dragable “slider” widget for selecting the value of - * something within a range. - * + * something within a range. + * * Signals that you can add callbacks for are: - * + * * changed - Whenever the slider value is changed by the user. - * - * delay,changed - A short time after the value is changed by the user. + * + * delay,changed - A short time after the value is changed by the user. * This will be called only when the user stops dragging for a very short - * period or when they release their finger/mouse, so it avoids possibly + * period or when they release their finger/mouse, so it avoids possibly * expensive reactions to the value change. - * - * A slider can be horizontal or vertical. It can contain an Icon and has a - * primary label as well as a units label (that is formatted with floating - * point values and thus accepts a printf-style format string, like - * “%1.2f units”. There is also an indicator string that may be somewhere - * else (like on the slider itself) that also accepts a format string like + * + * A slider can be horizontal or vertical. It can contain an Icon and has a + * primary label as well as a units label (that is formatted with floating + * point values and thus accepts a printf-style format string, like + * “%1.2f units”. There is also an indicator string that may be somewhere + * else (like on the slider itself) that also accepts a format string like * units. Label, Icon Unit and Indicator strings/objects are optional. - * - * A slider may be inverted which means values invert, with high vales being - * on the left or top and low values on the right or bottom (as opposed to + * + * A slider may be inverted which means values invert, with high vales being + * on the left or top and low values on the right or bottom (as opposed to * normally being low on the left or top and high on the bottom and right). - * + * * The slider should have its minimum and maximum values set by the * application with elm_slider_min_max_set() and value should also be set by * the application before use with elm_slider_value_set(). The span of the @@ -97,7 +97,7 @@ _theme_hook(Evas_Object *obj) edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); if (wd->horizontal) evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1); - else + else evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale); edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer); _units_set(obj); @@ -111,7 +111,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->slider, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); @@ -157,19 +157,19 @@ _val_fetch(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); double posx = 0.0, posy = 0.0, pos = 0.0, val; - - edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", - &posx, &posy); + + edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", + &posx, &posy); if (wd->horizontal) pos = posx; else pos = posy; if (wd->inverted) pos = 1.0 - pos; val = (pos * (wd->val_max - wd->val_min)) + wd->val_min; if (val != wd->val) { - wd->val = val; - evas_object_smart_callback_call(obj, "changed", NULL); - if (wd->delay) ecore_timer_del(wd->delay); - wd->delay = ecore_timer_add(0.2, _delay_change, obj); + wd->val = val; + evas_object_smart_callback_call(obj, "changed", NULL); + if (wd->delay) ecore_timer_del(wd->delay); + wd->delay = ecore_timer_add(0.2, _delay_change, obj); } } @@ -194,10 +194,10 @@ _units_set(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (wd->units) { - char buf[1024]; - - snprintf(buf, sizeof(buf), wd->units, wd->val); - edje_object_part_text_set(wd->slider, "elm.units", buf); + char buf[1024]; + + snprintf(buf, sizeof(buf), wd->units, wd->val); + edje_object_part_text_set(wd->slider, "elm.units", buf); } else edje_object_part_text_set(wd->slider, "elm.units", NULL); @@ -209,16 +209,16 @@ _indicator_set(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); if (wd->indicator) { - char buf[1024]; - - snprintf(buf, sizeof(buf), wd->indicator, wd->val); - edje_object_part_text_set(wd->slider, "elm.indicator", buf); + char buf[1024]; + + snprintf(buf, sizeof(buf), wd->indicator, wd->val); + edje_object_part_text_set(wd->slider, "elm.indicator", buf); } else edje_object_part_text_set(wd->slider, "elm.indicator", NULL); } -static void +static void _drag(void *data, Evas_Object *obj, const char *emission, const char *source) { _val_fetch(data); @@ -226,17 +226,17 @@ _drag(void *data, Evas_Object *obj, const char *emission, const char *source) _indicator_set(data); } -static void +static void _drag_start(void *data, Evas_Object *obj, const char *emission, const char *source) -{ +{ _val_fetch(data); _units_set(data); _indicator_set(data); } -static void +static void _drag_stop(void *data, Evas_Object *obj, const char *emission, const char *source) -{ +{ _val_fetch(data); _units_set(data); _indicator_set(data); @@ -244,10 +244,10 @@ _drag_stop(void *data, Evas_Object *obj, const char *emission, const char *sourc /** * Add a new slider to the parent - * + * * @param parent The parent object * @return The new object or NULL if it cannot be created - * + * * @ingroup Slider */ EAPI Evas_Object * @@ -256,7 +256,7 @@ elm_slider_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -265,12 +265,12 @@ elm_slider_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->horizontal = EINA_TRUE; wd->val = 0.0; wd->val_min = 0.0; wd->val_max = 1.0; - + wd->slider = edje_object_add(e); _elm_theme_set(wd->slider, "slider", "horizontal", "default"); elm_widget_resize_object_set(obj, wd->slider); @@ -281,25 +281,25 @@ elm_slider_add(Evas_Object *parent) edje_object_signal_callback_add(wd->slider, "drag,page", "*", _drag_stop, obj); // edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, obj); edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", 0.0, 0.0); - + wd->spacer = evas_object_rectangle_add(e); evas_object_color_set(wd->spacer, 0, 0, 0, 0); evas_object_pass_events_set(wd->spacer, 1); elm_widget_sub_object_add(obj, wd->spacer); edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer); - + evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } /** * Set the label of the slider - * + * * @param obj The slider object * @param label The text label string in UTF-8 - * + * * @ingroup Slider */ EAPI void @@ -310,13 +310,13 @@ elm_slider_label_set(Evas_Object *obj, const char *label) if (wd->label) eina_stringshare_del(wd->label); if (label) { - wd->label = eina_stringshare_add(label); + wd->label = eina_stringshare_add(label); edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm"); edje_object_message_signal_process(wd->slider); } else { - wd->label = NULL; + wd->label = NULL; edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm"); edje_object_message_signal_process(wd->slider); } @@ -334,7 +334,7 @@ elm_slider_label_set(Evas_Object *obj, const char *label) * * @param obj The slider object * @param icon The icon object - * + * * @ingroup Slider */ EAPI void @@ -357,15 +357,15 @@ elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) /** * Set the length of the dragable region of the slider - * + * * Thois sets the minimum width or height (depending on orientation) of the * area of the slider that allows the slider to be dragged around. This in * turn affects the objects minimum size (along with icon label and unit * text). Note that this will also get multiplied by the scale factor. - * + * * @param obj The slider object * @param size The length of the slider area - * + * * @ingroup Slider */ EAPI void @@ -376,7 +376,7 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) wd->size = size; if (wd->horizontal) evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1); - else + else evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale); edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer); _sizing_eval(obj); @@ -384,15 +384,15 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) /** * Set the format string of the unit area - * + * * If NULL, this disabls the unit area display. If not it sets the format * string for the unit text. The unit text is provided a floating point * value, so the unit text can display up to 1 floating point falue. Note that * this is optional. Use a format string such as "%1.2f meters" for example. - * + * * @param obj The slider object * @param units The format string for the units display - * + * * @ingroup Slider */ EAPI void @@ -402,13 +402,13 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units) if (wd->units) eina_stringshare_del(wd->units); if (units) { - wd->units = eina_stringshare_add(units); + wd->units = eina_stringshare_add(units); edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm"); edje_object_message_signal_process(wd->slider); } else { - wd->units = NULL; + wd->units = NULL; edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm"); edje_object_message_signal_process(wd->slider); } @@ -418,15 +418,15 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units) /** * Set the format string for the inducator area - * + * * The slider may also display a value (the value of the slider) somewhere * (for example above the slider knob that is dragged around). This sets the * format string for this. See elm_slider_unit_format_set() for more * information on how this works. - * + * * @param obj The slider object * @param units The format string for the indicator display - * + * * @ingroup Slider */ EAPI void @@ -441,10 +441,10 @@ elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator) /** * Set orientation of the slider - * + * * @param obj The slider object * @param horizontal If set, the slider will be horizontal - * + * * @ingroup Slider */ EAPI void @@ -459,13 +459,13 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) /** * Set the minimum and maximum values for the slider - * + * * Maximum mut be greater than minimum. - * + * * @param obj The slider object * @param min The minimum value * @param max The maximum value - * + * * @ingroup Slider */ EAPI void @@ -484,10 +484,10 @@ elm_slider_min_max_set(Evas_Object *obj, double min, double max) /** * Set the value the slider indicates - * + * * @param obj The slider object * @param val The value (must be beween min and max for the slider) - * + * * @ingroup Slider */ EAPI void @@ -505,10 +505,10 @@ elm_slider_value_set(Evas_Object *obj, double val) /** * Get the value the slider has - * + * * @param obj The slider object * @return The value of the slider - * + * * @ingroup Slider */ EAPI double @@ -520,15 +520,15 @@ elm_slider_value_get(const Evas_Object *obj) /** * Invert the slider display - * + * * Normally the slider will display and interpret values from low to high * and when horizontal that is left to right. When vertical that is top * to bottom. This inverts this (so from right to left or bottom to top) if * inverted is set to 1. - * + * * @param obj The slider object * @param inverted The inverted flag. 1 == inverted, 0 == normal - * + * * @ingroup Slider */ EAPI void diff --git a/legacy/elementary/src/lib/elm_table.c b/legacy/elementary/src/lib/elm_table.c index bf9a41504d..b9fe899569 100644 --- a/legacy/elementary/src/lib/elm_table.c +++ b/legacy/elementary/src/lib/elm_table.c @@ -26,7 +26,7 @@ _sizing_eval(Evas_Object *obj) Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord w, h; - + evas_object_size_hint_min_get(wd->tbl, &minw, &minh); evas_object_size_hint_max_get(wd->tbl, &maxw, &maxh); evas_object_size_hint_min_set(obj, minw, minh); @@ -61,7 +61,7 @@ elm_table_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -69,14 +69,14 @@ elm_table_add(Evas_Object *parent) elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); - + wd->tbl = _els_smart_table_add(e); evas_object_event_callback_add(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); elm_widget_resize_object_set(obj, wd->tbl); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + return obj; } diff --git a/legacy/elementary/src/lib/elm_theme.c b/legacy/elementary/src/lib/elm_theme.c index 06a956e6a5..71df795d02 100644 --- a/legacy/elementary/src/lib/elm_theme.c +++ b/legacy/elementary/src/lib/elm_theme.c @@ -10,15 +10,15 @@ static const char * _elm_theme_find_try(const char *f, const char *group) { const char *file; - + if (edje_file_group_exists(f, group)) { - file = eina_stringshare_add(f); - if (file) - { - eina_hash_add(cache, group, file); - return file; - } + file = eina_stringshare_add(f); + if (file) + { + eina_hash_add(cache, group, file); + return file; + } } return NULL; } @@ -28,15 +28,15 @@ _elm_theme_theme_element_try(const char *home, const char *f, const char *group) { char buf[PATH_MAX]; const char *file = NULL; - + if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) || ((f[0] == '.') && (f[1] == '.') && (f[2] == '/'))) return _elm_theme_find_try(f, group); else if (((f[0] == '~') && (f[1] == '/'))) { - snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); - return _elm_theme_find_try(buf, group); + snprintf(buf, sizeof(buf), "%s/%s", home, f + 2); + return _elm_theme_find_try(buf, group); } snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f); file = _elm_theme_find_try(buf, group); @@ -57,23 +57,23 @@ _elm_theme_group_file_find(const char *group) if (file) return file; if (!home) { - home = getenv("HOME"); - if (!home) home = ""; + home = getenv("HOME"); + if (!home) home = ""; } EINA_LIST_FOREACH(overlay, l, f) { - file = _elm_theme_theme_element_try(home, f, group); - if (file) return file; + file = _elm_theme_theme_element_try(home, f, group); + if (file) return file; } EINA_LIST_FOREACH(themes, l, f) { - file = _elm_theme_theme_element_try(home, f, group); - if (file) return file; + file = _elm_theme_theme_element_try(home, f, group); + if (file) return file; } EINA_LIST_FOREACH(extension, l, f) { - file = _elm_theme_theme_element_try(home, f, group); - if (file) return file; + file = _elm_theme_theme_element_try(home, f, group); + if (file) return file; } return NULL; } @@ -98,13 +98,13 @@ _elm_theme_set(Evas_Object *o, const char *clas, const char *group, const char * const char *file; char buf2[1024]; int ok; - + snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, group, style); file = _elm_theme_group_file_find(buf2); if (file) { - ok = edje_object_file_set(o, file, buf2); - if (ok) return 1; + ok = edje_object_file_set(o, file, buf2); + if (ok) return 1; } snprintf(buf2, sizeof(buf2), "elm/%s/%s/default", clas, group); file = _elm_theme_group_file_find(buf2); @@ -120,14 +120,14 @@ _elm_theme_icon_set(Evas_Object *o, const char *group, const char *style) char buf2[1024]; int w, h; int ok; - + snprintf(buf2, sizeof(buf2), "elm/icon/%s/%s", group, style); file = _elm_theme_group_file_find(buf2); if (file) { - _els_smart_icon_file_edje_set(o, file, buf2); - _els_smart_icon_size_get(o, &w, &h); - if (w > 0) return 1; + _els_smart_icon_file_edje_set(o, file, buf2); + _els_smart_icon_size_get(o, &w, &h); + if (w > 0) return 1; } snprintf(buf2, sizeof(buf2), "elm/icon/%s/default", group); file = _elm_theme_group_file_find(buf2); @@ -149,52 +149,52 @@ _elm_theme_parse(const char *theme) { Eina_List *names = NULL; const char *p, *pe; - + p = theme; pe = p; for (;;) { - if ((*pe == ':') || (*pe == 0)) - { // p -> pe == 'name/' - if (pe > p) - { - char *n = malloc(pe - p + 1); - if (n) - { - const char *nn; - strncpy(n, p, pe - p); - n[pe - p] = 0; - nn = eina_stringshare_add(n); - if (nn) - names = eina_list_append(names, nn); - free(n); - } - } - if (*pe == 0) break; - p = pe + 1; - pe = p; - } - else - pe++; + if ((*pe == ':') || (*pe == 0)) + { // p -> pe == 'name/' + if (pe > p) + { + char *n = malloc(pe - p + 1); + if (n) + { + const char *nn; + strncpy(n, p, pe - p); + n[pe - p] = 0; + nn = eina_stringshare_add(n); + if (nn) + names = eina_list_append(names, nn); + free(n); + } + } + if (*pe == 0) break; + p = pe + 1; + pe = p; + } + else + pe++; } p = eina_list_data_get(eina_list_last(names)); if ((!p) || ((p) && (strcmp(p, "default")))) { - p = eina_stringshare_add("default"); - if (p) - names = eina_list_append(names, p); + p = eina_stringshare_add("default"); + if (p) + names = eina_list_append(names, p); } if (cache) { - eina_hash_foreach(cache, _cache_free_cb, NULL); - eina_hash_free(cache); - cache = NULL; + eina_hash_foreach(cache, _cache_free_cb, NULL); + eina_hash_free(cache); + cache = NULL; } cache = eina_hash_string_superfast_new(NULL); EINA_LIST_FREE(themes, p) { - eina_stringshare_del(p); + eina_stringshare_del(p); } themes = names; diff --git a/legacy/elementary/src/lib/elm_toggle.c b/legacy/elementary/src/lib/elm_toggle.c index e4ef09ee80..5b59fa5195 100644 --- a/legacy/elementary/src/lib/elm_toggle.c +++ b/legacy/elementary/src/lib/elm_toggle.c @@ -61,7 +61,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->tgl, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); @@ -119,7 +119,7 @@ elm_toggle_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -128,7 +128,7 @@ elm_toggle_add(Evas_Object *parent) elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); - + wd->tgl = edje_object_add(e); _elm_theme_set(wd->tgl, "toggle", "base", "default"); wd->ontext = eina_stringshare_add("ON"); @@ -140,7 +140,7 @@ elm_toggle_add(Evas_Object *parent) edje_object_part_text_set(wd->tgl, "elm.offtext", wd->offtext); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); - + _sizing_eval(obj); return obj; } @@ -154,13 +154,13 @@ elm_toggle_label_set(Evas_Object *obj, const char *label) if (wd->label) eina_stringshare_del(wd->label); if (label) { - wd->label = eina_stringshare_add(label); + wd->label = eina_stringshare_add(label); edje_object_signal_emit(wd->tgl, "elm,state,text,visible", "elm"); edje_object_message_signal_process(wd->tgl); } else { - wd->label = NULL; + wd->label = NULL; edje_object_signal_emit(wd->tgl, "elm,state,text,hidden", "elm"); edje_object_message_signal_process(wd->tgl); } @@ -242,6 +242,6 @@ elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) } else { - wd->statep = NULL; + wd->statep = NULL; } } diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index 0af1f6ad54..428c66d9c4 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -31,7 +31,7 @@ _item_show(Elm_Toolbar_Item *it) { Widget_Data *wd = elm_widget_data_get(it->obj); Evas_Coord x, y, w, h, bx, by; - + evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL); evas_object_geometry_get(it->base, &x, &y, &w, &h); elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h); @@ -47,12 +47,12 @@ _item_select(Elm_Toolbar_Item *it) if (it->selected) return; EINA_LIST_FOREACH(wd->items, l, it2) { - if (it2->selected) - { - it2->selected = EINA_FALSE; - edje_object_signal_emit(it2->base, "elm,state,unselected", "elm"); - break; - } + if (it2->selected) + { + it2->selected = EINA_FALSE; + edje_object_signal_emit(it2->base, "elm,state,unselected", "elm"); + break; + } } it->selected = EINA_TRUE; edje_object_signal_emit(it->base, "elm,state,selected", "elm"); @@ -69,10 +69,10 @@ _del_hook(Evas_Object *obj) Elm_Toolbar_Item *it; EINA_LIST_FREE(wd->items, it) { - eina_stringshare_del(it->label); - if (it->icon) evas_object_del(it->icon); - evas_object_del(it->base); - free(it); + eina_stringshare_del(it->label); + if (it->icon) evas_object_del(it->icon); + evas_object_del(it->base); + free(it); } free(wd); } @@ -89,24 +89,24 @@ _theme_hook(Evas_Object *obj) edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); EINA_LIST_FOREACH(wd->items, l, it) { - edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale); - if (it->selected) - edje_object_signal_emit(it->base, "elm,state,selected", "elm"); - _elm_theme_set(it->base, "toolbar", "item", style); - if (it->icon) - { - edje_extern_object_min_size_set(it->icon, - (double)wd->icon_size * _elm_config->scale, - (double)wd->icon_size * _elm_config->scale); - edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); - } - edje_object_part_text_set(it->base, "elm.text", it->label); - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - evas_object_size_hint_min_set(it->base, mw, mh); - evas_object_size_hint_max_set(it->base, 9999, mh); + edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale); + if (it->selected) + edje_object_signal_emit(it->base, "elm,state,selected", "elm"); + _elm_theme_set(it->base, "toolbar", "item", style); + if (it->icon) + { + edje_extern_object_min_size_set(it->icon, + (double)wd->icon_size * _elm_config->scale, + (double)wd->icon_size * _elm_config->scale); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); + } + edje_object_part_text_set(it->base, "elm.text", it->label); + mw = mh = -1; + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh); + elm_coords_finger_size_adjust(1, &mw, 1, &mh); + evas_object_size_hint_min_set(it->base, mw, mh); + evas_object_size_hint_max_set(it->base, 9999, mh); } _sizing_eval(obj); } @@ -125,13 +125,13 @@ _sizing_eval(Evas_Object *obj) elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); if (wd->scrollable) { - minw = 500 - vw; - minh = minh + (500 - vh); + minw = 500 - vw; + minh = minh + (500 - vh); } else { - minw = minw + (500 - vw); - minh = minh + (500 - vh); + minw = minw + (500 - vw); + minh = minh + (500 - vh); } evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); @@ -144,23 +144,23 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info) Evas_Coord mw, mh, vw, vh, w, h; const Eina_List *l; Elm_Toolbar_Item *it; - + elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh); evas_object_size_hint_min_get(wd->bx, &mw, &mh); evas_object_geometry_get(wd->bx, NULL, NULL, &w, &h); if (vw >= mw) { - if (w != vw) evas_object_resize(wd->bx, vw, h); + if (w != vw) evas_object_resize(wd->bx, vw, h); } EINA_LIST_FOREACH(wd->items, l, it) { - if (it->selected) - { - _item_show(it); - break; - } + if (it->selected) + { + _item_show(it); + break; + } } - + } static void @@ -175,7 +175,7 @@ elm_toolbar_add(Evas_Object *parent) Evas_Object *obj; Evas *e; Widget_Data *wd; - + wd = ELM_NEW(Widget_Data); e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -185,18 +185,18 @@ elm_toolbar_add(Evas_Object *parent) elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, 0); - + wd->scr = elm_smart_scroller_add(e); elm_scroller_bounce_set(wd->scr, 1, 0); elm_smart_scroller_theme_set(wd->scr, "toolbar", "base", "default"); elm_widget_resize_object_set(obj, wd->scr); - elm_smart_scroller_policy_set(wd->scr, - ELM_SMART_SCROLLER_POLICY_AUTO, - ELM_SMART_SCROLLER_POLICY_OFF); - + elm_smart_scroller_policy_set(wd->scr, + ELM_SMART_SCROLLER_POLICY_AUTO, + ELM_SMART_SCROLLER_POLICY_OFF); + wd->icon_size = 32; wd->scrollable = EINA_TRUE; - + wd->bx = _els_smart_box_add(e); _els_smart_box_orientation_set(wd->bx, 1); _els_smart_box_homogenous_set(wd->bx, 1); @@ -205,8 +205,8 @@ elm_toolbar_add(Evas_Object *parent) evas_object_show(wd->bx); evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE, - _resize, obj); - + _resize, obj); + _sizing_eval(obj); return obj; } @@ -227,16 +227,16 @@ elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, voi it->base = edje_object_add(evas_object_evas_get(obj)); _elm_theme_set(it->base, "toolbar", "item", elm_widget_style_get(obj)); edje_object_signal_callback_add(it->base, "elm,action,click", "elm", - _select, it); + _select, it); elm_widget_sub_object_add(obj, it->base); if (it->icon) { - edje_extern_object_min_size_set(it->icon, - (double)wd->icon_size * _elm_config->scale, - (double)wd->icon_size * _elm_config->scale); - edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); - evas_object_show(it->icon); - elm_widget_sub_object_add(obj, it->icon); + edje_extern_object_min_size_set(it->icon, + (double)wd->icon_size * _elm_config->scale, + (double)wd->icon_size * _elm_config->scale); + edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon); + evas_object_show(it->icon); + elm_widget_sub_object_add(obj, it->icon); } edje_object_part_text_set(it->base, "elm.text", it->label); mw = mh = -1; diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index aaada83f90..3581c072af 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -5,8 +5,8 @@ #define API_ENTRY \ Smart_Data *sd = evas_object_smart_data_get(obj); \ if ((!obj) || (!sd) || \ - (evas_object_type_get(obj) && \ - strcmp(evas_object_type_get(obj), SMART_NAME))) + (evas_object_type_get(obj) && \ + strcmp(evas_object_type_get(obj), SMART_NAME))) #define INTERNAL_ENTRY \ Smart_Data *sd = evas_object_smart_data_get(obj); \ if (!sd) return; @@ -14,7 +14,7 @@ typedef struct _Smart_Data Smart_Data; struct _Smart_Data -{ +{ Evas_Object *obj; const char *type; Evas_Object *parent_obj; @@ -44,7 +44,7 @@ struct _Smart_Data unsigned char child_can_focus : 1; unsigned char focused : 1; unsigned char disabled : 1; -}; +}; /* local subsystem functions */ static void _smart_reconfigure(Smart_Data *sd); @@ -68,12 +68,12 @@ _sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info) Smart_Data *sd = data; if (obj == sd->resize_obj) { - sd->resize_obj = NULL; + sd->resize_obj = NULL; } else if (obj == sd->hover_obj) sd->hover_obj = NULL; else { - sd->subobjs = eina_list_remove(sd->subobjs, obj); + sd->subobjs = eina_list_remove(sd->subobjs, obj); } evas_object_smart_callback_call(sd->obj, "sub-object-del", obj); } @@ -238,11 +238,11 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj) API_ENTRY return; if (sd->resize_obj) { - if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME)) - { - Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj); - if (sd2) sd2->parent_obj = NULL; - } + if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME)) + { + Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj); + if (sd2) sd2->parent_obj = NULL; + } evas_object_event_callback_del(sd->resize_obj, EVAS_CALLBACK_DEL, _sub_obj_del); evas_object_event_callback_del(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN, _sub_obj_mouse_down); evas_object_smart_member_del(sd->resize_obj); @@ -250,11 +250,11 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj) sd->resize_obj = sobj; if (sd->resize_obj) { - if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME)) - { - Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj); - if (sd2) sd2->parent_obj = obj; - } + if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME)) + { + Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj); + if (sd2) sd2->parent_obj = obj; + } evas_object_clip_set(sobj, evas_object_clip_get(obj)); evas_object_smart_member_add(sobj, obj); evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd); @@ -331,7 +331,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward) { API_ENTRY return 0; if (!elm_widget_can_focus_get(obj)) return 0; - + /* if it has a focus func its an end-point widget like a button */ if (sd->focus_func) { @@ -345,8 +345,8 @@ elm_widget_focus_jump(Evas_Object *obj, int forward) else { int focus_next; - int noloop = 0; - + int noloop = 0; + focus_next = 0; if (!sd->focused) { @@ -359,53 +359,53 @@ elm_widget_focus_jump(Evas_Object *obj, int forward) { if (forward) { - if (elm_widget_can_focus_get(sd->resize_obj)) - { - if ((focus_next) && - (!elm_widget_disabled_get(sd->resize_obj))) - { - /* the previous focused item was unfocused - so focus - * the next one (that can be focused) */ - if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1; - else noloop = 1; - } - else - { - if (elm_widget_focus_get(sd->resize_obj)) - { - /* jump to the next focused item or focus this item */ - if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1; - /* it returned 0 - it got to the last item and is past it */ - focus_next = 1; - } - } - } - if (!noloop) - { + if (elm_widget_can_focus_get(sd->resize_obj)) + { + if ((focus_next) && + (!elm_widget_disabled_get(sd->resize_obj))) + { + /* the previous focused item was unfocused - so focus + * the next one (that can be focused) */ + if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1; + else noloop = 1; + } + else + { + if (elm_widget_focus_get(sd->resize_obj)) + { + /* jump to the next focused item or focus this item */ + if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1; + /* it returned 0 - it got to the last item and is past it */ + focus_next = 1; + } + } + } + if (!noloop) + { const Eina_List *l; Evas_Object *child; EINA_LIST_FOREACH(sd->subobjs, l, child) - { - if (elm_widget_can_focus_get(child)) - { - if ((focus_next) && - (!elm_widget_disabled_get(child))) - { - /* the previous focused item was unfocused - so focus - * the next one (that can be focused) */ - if (elm_widget_focus_jump(child, forward)) return 1; - else break; - } - else - { - if (elm_widget_focus_get(child)) - { - /* jump to the next focused item or focus this item */ - if (elm_widget_focus_jump(child, forward)) return 1; - /* it returned 0 - it got to the last item and is past it */ - focus_next = 1; - } - } + { + if (elm_widget_can_focus_get(child)) + { + if ((focus_next) && + (!elm_widget_disabled_get(child))) + { + /* the previous focused item was unfocused - so focus + * the next one (that can be focused) */ + if (elm_widget_focus_jump(child, forward)) return 1; + else break; + } + else + { + if (elm_widget_focus_get(child)) + { + /* jump to the next focused item or focus this item */ + if (elm_widget_focus_jump(child, forward)) return 1; + /* it returned 0 - it got to the last item and is past it */ + focus_next = 1; + } + } } } } @@ -439,8 +439,8 @@ elm_widget_focus_jump(Evas_Object *obj, int forward) } } } - if (!l) - { + if (!l) + { if (elm_widget_can_focus_get(sd->resize_obj)) { if ((focus_next) && @@ -461,15 +461,15 @@ elm_widget_focus_jump(Evas_Object *obj, int forward) } } } - } + } } } } /* no next item can be focused */ if (sd->focused) { - sd->focused = 0; - if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj); + sd->focused = 0; + if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj); } return 0; } @@ -492,25 +492,25 @@ elm_widget_focus_set(Evas_Object *obj, int first) { if (first) { - if ((elm_widget_can_focus_get(sd->resize_obj)) && - (!elm_widget_disabled_get(sd->resize_obj))) - { - elm_widget_focus_set(sd->resize_obj, first); - } - else - { + if ((elm_widget_can_focus_get(sd->resize_obj)) && + (!elm_widget_disabled_get(sd->resize_obj))) + { + elm_widget_focus_set(sd->resize_obj, first); + } + else + { const Eina_List *l; Evas_Object *child; EINA_LIST_FOREACH(sd->subobjs, l, child) - { - if ((elm_widget_can_focus_get(child)) && - (!elm_widget_disabled_get(child))) - { - elm_widget_focus_set(child, first); - break; - } - } - } + { + if ((elm_widget_can_focus_get(child)) && + (!elm_widget_disabled_get(child))) + { + elm_widget_focus_set(child, first); + break; + } + } + } } else { @@ -525,14 +525,14 @@ elm_widget_focus_set(Evas_Object *obj, int first) break; } } - if (!l) - { - if ((elm_widget_can_focus_get(sd->resize_obj)) && - (!elm_widget_disabled_get(sd->resize_obj))) - { - elm_widget_focus_set(sd->resize_obj, first); - } - } + if (!l) + { + if ((elm_widget_can_focus_get(sd->resize_obj)) && + (!elm_widget_disabled_get(sd->resize_obj))) + { + elm_widget_focus_set(sd->resize_obj, first); + } + } } } } @@ -551,20 +551,20 @@ elm_widget_focused_object_clear(Evas_Object *obj) if (!sd->focused) return; if (elm_widget_focus_get(sd->resize_obj)) { - elm_widget_focused_object_clear(sd->resize_obj); + elm_widget_focused_object_clear(sd->resize_obj); } else { const Eina_List *l; Evas_Object *child; EINA_LIST_FOREACH(sd->subobjs, l, child) - { - if (elm_widget_focus_get(child)) - { - elm_widget_focused_object_clear(child); - break; - } - } + { + if (elm_widget_focus_get(child)) + { + elm_widget_focused_object_clear(child); + break; + } + } } sd->focused = 0; if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj); @@ -595,31 +595,31 @@ elm_widget_focus_steal(Evas_Object *obj) { o = elm_widget_parent_get(parent); if (!o) break; - sd = evas_object_smart_data_get(o); - if (sd->focused) break; + sd = evas_object_smart_data_get(o); + if (sd->focused) break; parent = o; } if (!elm_widget_parent_get(parent)) elm_widget_focused_object_clear(parent); else { - parent = elm_widget_parent_get(parent); - sd = evas_object_smart_data_get(parent); - if (elm_widget_focus_get(sd->resize_obj)) - elm_widget_focused_object_clear(sd->resize_obj); - else - { + parent = elm_widget_parent_get(parent); + sd = evas_object_smart_data_get(parent); + if (elm_widget_focus_get(sd->resize_obj)) + elm_widget_focused_object_clear(sd->resize_obj); + else + { const Eina_List *l; Evas_Object *child; EINA_LIST_FOREACH(sd->subobjs, l, child) - { - if (elm_widget_focus_get(child)) - { - elm_widget_focused_object_clear(child); - break; - } - } - } + { + if (elm_widget_focus_get(child)) + { + elm_widget_focused_object_clear(child); + break; + } + } + } } _elm_widget_parent_focus(obj); return; @@ -653,8 +653,8 @@ elm_widget_disabled_set(Evas_Object *obj, int disabled) Evas_Object *o, *parent; parent = obj; - for (;;) - { + for (;;) + { o = elm_widget_parent_get(parent); if (!o) break; parent = o; @@ -756,8 +756,8 @@ elm_widget_scale_set(Evas_Object *obj, double scale) if (scale <= 0.0) scale = 0.0; if (sd->scale != scale) { - sd->scale = scale; - elm_widget_theme(obj); + sd->scale = scale; + elm_widget_theme(obj); } } @@ -832,7 +832,7 @@ static void _smart_add(Evas_Object *obj) { Smart_Data *sd; - + sd = calloc(1, sizeof(Smart_Data)); if (!sd) return; sd->obj = obj; @@ -848,29 +848,29 @@ static void _smart_del(Evas_Object *obj) { Evas_Object *sobj; - + INTERNAL_ENTRY; if (sd->del_pre_func) sd->del_pre_func(obj); if (sd->resize_obj) { - sobj = sd->resize_obj; + sobj = sd->resize_obj; sd->resize_obj = NULL; evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del); - evas_object_smart_callback_call(sd->obj, "sub-object-del", sd->resize_obj); + evas_object_smart_callback_call(sd->obj, "sub-object-del", sd->resize_obj); evas_object_del(sobj); } if (sd->hover_obj) { - sobj = sd->resize_obj; + sobj = sd->resize_obj; sd->hover_obj = NULL; evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del); - evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); + evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); evas_object_del(sobj); } EINA_LIST_FREE(sd->subobjs, sobj) { evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del); - evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); + evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj); evas_object_del(sobj); } if (sd->del_func) sd->del_func(obj); @@ -930,7 +930,7 @@ _smart_clip_unset(Evas_Object *obj) { INTERNAL_ENTRY; evas_object_clip_unset(sd->resize_obj); -} +} /* never need to touch this */ @@ -944,7 +944,7 @@ _smart_init(void) SMART_NAME, EVAS_SMART_CLASS_VERSION, _smart_add, - _smart_del, + _smart_del, _smart_move, _smart_resize, _smart_show, @@ -957,6 +957,6 @@ _smart_init(void) NULL, NULL }; - _e_smart = evas_smart_class_new(&sc); + _e_smart = evas_smart_class_new(&sc); } } diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index 214c5ba680..24220aa675 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -13,7 +13,7 @@ struct _Elm_Win Ecore_X_Window xwin; Ecore_Job *deferred_resize_job; Ecore_Job *deferred_child_eval_job; - + Elm_Win_Type type; Elm_Win_Keyboard_Mode kbdmode; Eina_Bool autodel : 1; @@ -25,7 +25,7 @@ static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, voi static void _elm_win_resize(Ecore_Evas *ee); static void _elm_win_delete_request(Ecore_Evas *ee); static void _elm_win_resize_job(void *data); -#ifdef HAVE_ELEMENTARY_X +#ifdef HAVE_ELEMENTARY_X static void _elm_win_xwin_update(Elm_Win *win); #endif static void _elm_win_eval_subobjs(Evas_Object *obj); @@ -80,12 +80,12 @@ _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_inf while (evas_object_bottom_get(win->evas) && (evas_object_bottom_get(win->evas) != obj)) { - evas_object_del(evas_object_bottom_get(win->evas)); + evas_object_del(evas_object_bottom_get(win->evas)); } while (evas_object_top_get(win->evas) && (evas_object_top_get(win->evas) != obj)) { - evas_object_del(evas_object_top_get(win->evas)); + evas_object_del(evas_object_top_get(win->evas)); } evas_image_cache_flush(win->evas); evas_font_cache_flush(win->evas); @@ -118,7 +118,7 @@ _elm_win_resize_job(void *data) const Eina_List *l; Evas_Object *obj; int w, h; - + win->deferred_resize_job = NULL; ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h); evas_object_resize(win->win_obj, w, h); @@ -161,12 +161,12 @@ _elm_win_xwindow_get(Elm_Win *win) static void _elm_win_xwin_update(Elm_Win *win) { -#ifdef HAVE_ELEMENTARY_X +#ifdef HAVE_ELEMENTARY_X _elm_win_xwindow_get(win); if (win->parent) { Elm_Win *win2; - + win2 = elm_widget_data_get(win->parent); if (win2) { @@ -226,13 +226,13 @@ _elm_win_eval_subobjs(Evas_Object *obj) evas_object_size_hint_weight_get(child, &wx, &wy); if (wx == 0.0) xx = 0; if (wy == 0.0) xy = 0; - + evas_object_size_hint_min_get(child, &w, &h); if (w < 1) w = -1; if (h < 1) h = -1; if (w > minw) minw = w; if (h > minh) minh = h; - + evas_object_size_hint_max_get(child, &w, &h); if (w < 1) w = -1; if (h < 1) h = -1; @@ -290,7 +290,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) Elm_Win *win; const Eina_List *l; const char *fontpath; - + win = ELM_NEW(Elm_Win); switch (_elm_config->engine) { @@ -328,12 +328,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) if (_elm_config->bgpixmap && !_elm_config->compositing) ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE); // bg pixmap done by x - has other issues like can be redrawn by x before it -// is filled/ready by app +// is filled/ready by app // ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN); - + win->type = type; win->parent = parent; - + win->evas = ecore_evas_get(win->ee); win->win_obj = elm_widget_add(win->evas); elm_widget_type_set(win->win_obj, "win"); @@ -345,12 +345,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) evas_object_pass_events_set(win->win_obj, 1); ecore_evas_object_associate(win->ee, win->win_obj, - ECORE_EVAS_OBJECT_ASSOCIATE_BASE | - ECORE_EVAS_OBJECT_ASSOCIATE_STACK | - ECORE_EVAS_OBJECT_ASSOCIATE_LAYER); + ECORE_EVAS_OBJECT_ASSOCIATE_BASE | + ECORE_EVAS_OBJECT_ASSOCIATE_STACK | + ECORE_EVAS_OBJECT_ASSOCIATE_LAYER); evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL, - _elm_win_obj_callback_del, win); - + _elm_win_obj_callback_del, win); + ecore_evas_name_class_set(win->ee, name, _elm_appname); ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request); ecore_evas_callback_resize_set(win->ee, _elm_win_resize); @@ -372,12 +372,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) _elm_win_xwin_update(win); _elm_win_list = eina_list_append(_elm_win_list, win->win_obj); - + switch (_elm_config->engine) { case ELM_SOFTWARE_16_WINCE: case ELM_SOFTWARE_FB: - ecore_evas_fullscreen_set(win->ee, 1); + ecore_evas_fullscreen_set(win->ee, 1); break; case ELM_SOFTWARE_X11: case ELM_SOFTWARE_16_X11: @@ -425,7 +425,7 @@ elm_win_title_set(Evas_Object *obj, const char *title) if (!win) return; ecore_evas_title_set(win->ee, title); } - + EAPI void elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel) { @@ -516,12 +516,12 @@ elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen) { case ELM_SOFTWARE_16_WINCE: case ELM_SOFTWARE_FB: - // these engines... can ONLY be fullscreen - break; + // these engines... can ONLY be fullscreen + break; default: - ecore_evas_fullscreen_set(win->ee, fullscreen); - _elm_win_xwin_update(win); - break; + ecore_evas_fullscreen_set(win->ee, fullscreen); + _elm_win_xwin_update(win); + break; } } @@ -583,11 +583,11 @@ elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode) if (mode == win->kbdmode) return; _elm_win_xwindow_get(win); win->kbdmode = mode; -#ifdef HAVE_ELEMENTARY_X +#ifdef HAVE_ELEMENTARY_X if (win->xwin) ecore_x_e_virtual_keyboard_state_set (win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode); -#endif +#endif } EAPI void @@ -596,11 +596,11 @@ elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard) Elm_Win *win = elm_widget_data_get(obj); if (!win) return; _elm_win_xwindow_get(win); -#ifdef HAVE_ELEMENTARY_X +#ifdef HAVE_ELEMENTARY_X if (win->xwin) ecore_x_e_virtual_keyboard_set (win->xwin, is_keyboard); -#endif +#endif } typedef struct _Widget_Data Widget_Data; @@ -639,7 +639,7 @@ _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - + evas_object_size_hint_min_get(wd->content, &minw, &minh); edje_object_size_min_calc(wd->frm, &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); @@ -661,10 +661,10 @@ _sub_del(void *data, Evas_Object *obj, void *event_info) Evas_Object *sub = event_info; if (sub == wd->content) { - evas_object_event_callback_del - (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); - wd->content = NULL; - _sizing_eval(obj); + evas_object_event_callback_del + (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints); + wd->content = NULL; + _sizing_eval(obj); } } @@ -682,17 +682,17 @@ elm_win_inwin_add(Evas_Object *obj) evas_object_size_hint_weight_set(obj2, 1.0, 1.0); evas_object_size_hint_align_set(obj2, -1.0, -1.0); elm_win_resize_object_add(obj, obj2); - + elm_widget_data_set(obj2, wd); elm_widget_del_hook_set(obj2, _del_hook); elm_widget_theme_hook_set(obj2, _theme_hook); - + wd->frm = edje_object_add(win->evas); _elm_theme_set(wd->frm, "win", "inwin", "default"); elm_widget_resize_object_set(obj2, wd->frm); - + evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2); - + _sizing_eval(obj2); return obj2; } @@ -722,11 +722,11 @@ elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content) wd->content = content; if (content) { - elm_widget_sub_object_add(obj, content); - edje_object_part_swallow(wd->frm, "elm.swallow.content", content); - evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, - _changed_size_hints, obj); - _sizing_eval(obj); + elm_widget_sub_object_add(obj, content); + edje_object_part_swallow(wd->frm, "elm.swallow.content", content); + evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, + _changed_size_hints, obj); + _sizing_eval(obj); } }