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
doc:
@echo "entering doc/"
$(MAKE) -C doc doc
-
;;
esac
AC_SUBST(release_info)
-
+
requirement_elm=""
PKG_PROG_PKG_CONFIG
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"
;;
{
int status;
pid_t pid;
-
+
while ((pid = waitpid(-1, &status, WNOHANG)) > 0);
}
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();
}
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];
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);
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();
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;
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;
- 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();
+ 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;
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);
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);
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);
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. */
{
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);
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);
{
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);
elm_icon_scale_set(ic, 0, 0);
elm_win_resize_object_add(win, ic);
evas_object_show(ic);
-
+
evas_object_show(win);
}
{
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);
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);
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);
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);
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);
}
{
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);
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);
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);
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);
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);
}
{
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);
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);
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);
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);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
evas_object_show(ic);
-
+
evas_object_show(win);
}
{
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);
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);
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);
elm_box_pack_end(bx, tg);
evas_object_show(tg);
evas_object_show(ic);
-
+
evas_object_show(win);
}
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);
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);
}
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);
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);
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);
elm_clock_time_set(ck, 10, 11, 12);
elm_box_pack_end(bx, ck);
evas_object_show(ck);
-
+
evas_object_show(win);
}
{
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);
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);
}
my_hover_bt_1(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *hv = data;
-
+
evas_object_show(hv);
}
{
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);
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);
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);
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);
{
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);
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);
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);
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);
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);
{
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);
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);
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);
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);
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);
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 *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);
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_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");
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");
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<br>"
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);
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);
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);
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);
}
{
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);
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_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");
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");
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");
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);
}
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);
{
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);
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);
evas_object_show(av);
evas_object_resize(win, 320, 300);
-
+
elm_object_focus(win);
evas_object_show(win);
}
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);
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);
{
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);
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);
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");
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");
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");
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);
}
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);
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);
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);
// 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);
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);
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);
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);
}
{
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);
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");
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");
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");
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");
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);
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);
}
{
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);
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);
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);
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);
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);
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);
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);
}
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);
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);
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);
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);
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);
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);
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 *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);
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);
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);
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);
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);
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);
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);
}
{
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);
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);
}
{
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);
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<br>"
- "window. This is handy for quick popups<br>"
- "you want centered, taking over the window<br>"
- "until dismissed somehow. Unlike hovers they<br>"
- "don't hover over their target.");
+ "This is an \"inwin\" - a window in a<br>"
+ "window. This is handy for quick popups<br>"
+ "you want centered, taking over the window<br>"
+ "until dismissed somehow. Unlike hovers they<br>"
+ "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);
}
{
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);
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<br>"
- "window. This is handy for quick popups<br>"
- "you want centered, taking over the window<br>"
- "until dismissed somehow. Unlike hovers they<br>"
- "don't hover over their target.<br>"
- "<br>"
- "This inwin style compacts itself vertically<br>"
- "to the size of its contents minimum size.");
+ "This is an \"inwin\" - a window in a<br>"
+ "window. This is handy for quick popups<br>"
+ "you want centered, taking over the window<br>"
+ "until dismissed somehow. Unlike hovers they<br>"
+ "don't hover over their target.<br>"
+ "<br>"
+ "This inwin style compacts itself vertically<br>"
+ "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);
}
{
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);
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);
}
{
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);
elm_frame_label_set(fr, "Scale: 0.5");
lb = elm_label_add(win);
elm_label_label_set(lb,
- "Parent frame scale<br>"
- "is 0.5. Child should<br>"
- "inherit it.");
+ "Parent frame scale<br>"
+ "is 0.5. Child should<br>"
+ "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<br>"
- "is 1.0. Child should<br>"
- "inherit it.");
+ "Parent frame scale<br>"
+ "is 1.0. Child should<br>"
+ "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<br>"
- "is 2.0. Child should<br>"
- "inherit it.");
+ "Parent frame scale<br>"
+ "is 2.0. Child should<br>"
+ "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);
}
{
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);
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);
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");
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);
elm_box_pack_end(bx, sl);
evas_object_show(ic);
evas_object_show(sl);
-
+
evas_object_show(win);
}
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);
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;
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);
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++;
}
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);
}
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);
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);
}
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 *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;
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);
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);
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]));
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]));
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]));
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);
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;
}
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);
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);
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]));
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]));
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]));
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 *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);
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);
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);
elm_box_pack_end(bx, ck);
evas_object_show(ck);
evas_object_show(ic);
-
+
evas_object_show(win);
}
{
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);
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(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);
elm_box_pack_end(bx, rd);
evas_object_show(rd);
evas_object_show(ic);
-
+
elm_radio_value_set(rdg, 2);
-
+
evas_object_show(win);
}
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);
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.<br>"
- "<br>"
- "So what is a pager stack? It is a stack<br>"
- "of pages that hold widgets in it. The<br>"
- "pages can be pushed and popped on and<br>"
- "off the stack, activated and otherwise<br>"
- "activated if already in the stack<br>"
- "(activated means promoted to the top of<br>"
- "the stack).<br>"
- "<br>"
- "The theme may define the animation how<br>"
- "show and hide of pages."
- );
+ "This is page 1 in a pager stack.<br>"
+ "<br>"
+ "So what is a pager stack? It is a stack<br>"
+ "of pages that hold widgets in it. The<br>"
+ "pages can be pushed and popped on and<br>"
+ "off the stack, activated and otherwise<br>"
+ "activated if already in the stack<br>"
+ "(activated means promoted to the top of<br>"
+ "the stack).<br>"
+ "<br>"
+ "The theme may define the animation how<br>"
+ "show and hide of pages."
+ );
elm_box_pack_end(bx, lb);
evas_object_show(lb);
bt = elm_button_add(win);
evas_object_show(bx);
lb = elm_label_add(win);
elm_label_label_set(lb,
- "This is page 2 in a pager stack.<br>"
- "<br>"
- "This is just like the previous page in<br>"
- "the pager stack."
- );
+ "This is page 2 in a pager stack.<br>"
+ "<br>"
+ "This is just like the previous page in<br>"
+ "the pager stack."
+ );
elm_box_pack_end(bx, lb);
evas_object_show(lb);
bt = elm_button_add(win);
evas_object_show(bx);
lb = elm_label_add(win);
elm_label_label_set(lb,
- "This is page 3 in a pager stack.<br>"
- "<br>"
- "This is just like the previous page in<br>"
- "the pager stack."
- );
+ "This is page 3 in a pager stack.<br>"
+ "<br>"
+ "This is just like the previous page in<br>"
+ "the pager stack."
+ );
elm_box_pack_end(bx, lb);
evas_object_show(lb);
bt = elm_button_add(win);
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)
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;
}
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);
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);
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]));
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]));
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]));
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);
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);
}
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;
}
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);
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]));
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]));
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]));
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_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);
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);
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);
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);
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);
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);
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);
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);
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
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
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<br>"
- "by clicking the test button to show the<br>"
- "test window.");
+ elm_label_label_set(lb,
+ "Please select a test from the list below<br>"
+ "by clicking the test button to show the<br>"
+ "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);
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 */
# endif
#endif
-
+
/* EFL headers */
#include <Eina.h>
#include <Eet.h>
/* 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
{
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);
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);
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);
* 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)
*
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
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:
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);
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);
/* 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);
*/
/* 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);
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);
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
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
* "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 */
/* 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
{
/* 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);
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);
* "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);
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);
/* 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);
* "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;
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);
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
*/
* "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);
/* 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);
/* 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);
EAPI Evas_Object *elm_pager_content_top_get(Evas_Object *obj);
/* smart callbacks called:
*/
-
+
#ifdef __cplusplus
}
#endif
////////////////////////////////////////////////////////////////////////////
/// 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
// * 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
// * 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
/**
* @defgroup Anchorblock Anchorblock
- *
+ *
* Anchorblock is for displaying tet that contains markup with anchors like:
* \<a href=1234\>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
*/
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;
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);
/**
* 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 *
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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 \<a href=XXX\> beginning an achor with the
* string link of 'XXX', and \</\> or \</a\> 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
/**
* 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
/**
* 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
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
/**
* @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
*/
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;
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
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;
}
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
/**
* @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;
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);
}
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
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);
}
static void
_button_clicked(void *data, Evas_Object *obj, void *event_info)
{
- _activate(data);
+ _activate(data);
}
static void
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
/**
* Set the Hover parent
- *
+ *
* Sets the hover parent object. See Hover objects for more information.
*
* @param obj The hoversel object
/**
* 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().
*
/**
* 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().
*
/**
* Trigger the hoversel popup from code
- *
+ *
* This makes the hoversel popup activate with the items added being listed.
*
* @param obj The hoversel object
/**
* This ends the hoversel popup.
- *
+ *
* This will close the hoversel popup, making it disappear, if it was active.
*
* @param obj The hoversel object
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
/**
* Delete an item from the hoversel
- *
+ *
* This deletes the item from the hoversel (should not be called while the
* hoversel is active).
*
/**
* 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.
*
*
* 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
{
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);
}
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;
_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;
}
{
Widget_Data *wd = elm_widget_data_get(obj);
char *text;
-
+
if (!wd->file)
{
elm_entry_entry_set(wd->entry, "");
_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);
}
}
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));
if (!wd->auto_write) return;
wd->delay_write = ecore_timer_add(2.0, _delay_write, data);
}
-
+
/**
* Add a new notepad to the 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);
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);
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
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
* @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.
{
Widget_Data *wd = elm_widget_data_get(obj);
const char *p;
-
+
if (wd->custom_img)
{
evas_object_del(wd->custom_img);
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);
* 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;
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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.
/**
* 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.
*
*
* 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
*
* 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
* 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
* 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
{
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
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);
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);
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);
}
}
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
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);
}
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
{
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);
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");
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);
}
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
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
evas_object_show(wd->bx);
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE,
- _resize, obj);
-
+ _resize, obj);
+
_sizing_eval(obj);
return obj;
}
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);
/**
* @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
{
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
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;
}
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);
}
* 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
*
*
* 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)
*
/**
* 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
}
else
{
- wd->statep = NULL;
+ wd->statep = NULL;
}
}
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)
_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];
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]);
{
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);
if (wd->min != wd->cur.min)
{
int d1, d2, dc1, dc2;
-
+
d1 = wd->min / 10;
d2 = wd->min % 10;
dc1 = wd->cur.min / 10;
if (wd->sec != wd->cur.sec)
{
int d1, d2, dc1, dc2;
-
+
d1 = wd->sec / 10;
d2 = wd->sec % 10;
dc1 = wd->cur.sec / 10;
}
}
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;
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
wd->cur.seconds = EINA_TRUE;
wd->cur.am_pm = EINA_TRUE;
wd->cur.edit = EINA_TRUE;
-
+
_time_update(obj);
_ticker(obj);
-
+
return obj;
}
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;
#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);
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;
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);
}
}
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);
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
}
}
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);
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;
}
}
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;
+ }
}
}
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;
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;
}
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, "<br>", &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, "<br>", &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;
}
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
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);
+ }
}
}
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
+ }
}
}
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
}
}
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;
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;
}
}
if (p)
{
const Eina_List *geoms;
-
+
n = p + 1;
p2 = p -1;
while (p2 >= emission)
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;
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)
{
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;
}
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);
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);
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;
}
EINA_LIST_FOREACH(an, l, anchor)
printf("ANCHOR: %s\n", anchor);
}
-#endif
+#endif
wd->changed = EINA_TRUE;
_sizing_eval(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");
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");
{
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
/**
* @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,
* 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
* 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
* “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
* 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
* 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
* 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
* 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()
* 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.
* 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
* 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
* 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
* 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
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;
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
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);
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;
}
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);
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);
}
}
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);
+ }
}
}
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
{
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);
- }
+ }
}
}
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));
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));
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;
_item_unrealize(Elm_Genlist_Item *it)
{
Evas_Object *icon;
-
+
if (!it->realized) return;
evas_object_del(it->base);
it->base = NULL;
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;
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;
}
if (!itb->realized) return;
EINA_LIST_FOREACH(itb->items, l, it)
{
- _item_unrealize(it);
+ _item_unrealize(it);
}
itb->realized = EINA_FALSE;
}
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++;
}
}
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))
{
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);
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);
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
free(cd);
evas_object_smart_data_set(obj, sd);
}
-
+
static void
_pan_del(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
*
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);
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;
{
Eina_Inlist *il;
Item_Block *itb = it->block;
-
+
itb->items = eina_list_remove(itb->items, it);
itb->count--;
itb->changed = EINA_TRUE;
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);
+ }
+ }
}
}
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;
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;
}
}
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;
}
*
* 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
* @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;
*
* 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
* @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);
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;
/**
* 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.
*
* @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);
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++;
* @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);
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++;
* Clear the genlist
*
* This clears all items in the list, leaving it empty.
- *
+ *
* @param obj The genlist object
*
* @ingroup Genlist
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;
*
* 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
*
* 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.
*
* 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.
*
* 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
*
* 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
/**
* 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
*
{
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;
}
/**
* 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
*
{
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;
}
* 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
*
* 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
*
/**
* 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.
*
{
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);
/**
* Set the selected state of an item
- *
+ *
* This sets the selected state (1 selected, 0 not selected) of the given
* item @p it.
*
if (selected)
{
- if (!wd->multi)
- {
+ if (!wd->multi)
+ {
while (wd->selected)
_item_unselect(wd->selected->data);
- }
+ }
_item_hilight(it);
_item_select(it);
}
/**
* 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
*
/**
* 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).
*
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);
}
}
* Get the expanded state of an item
*
* This gets the expanded state of an item
- *
+ *
* @param it The item
* @return Thre expanded state
*
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).
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");
}
}
* Get the disabled state of an item
*
* This gets the disabld state of the given item.
- *
+ *
* @param it The item
* @return The disabled state
*
*
* 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
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);
}
/**
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);
}
*
* 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
*
* 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
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);
}
}
* 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
*
/**
* 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
*
* 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)
*
{
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);
break;
}
}
-}
+}
static void
_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");
}
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");
}
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
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;
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";
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);
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)
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
{
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);
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
{
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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("<br>");
{
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);
break;
}
}
-}
+}
EAPI Evas_Object *
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);
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;
}
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);
{
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);
// _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);
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;
+ }
}
}
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);
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);
}
}
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);
+ }
}
}
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);
}
}
}
{
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);
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;
}
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;
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
wd->mode = ELM_LIST_SCROLL;
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
-
+
_sizing_eval(obj);
return obj;
}
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);
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);
/**
* @defgroup Start Getting Started
- *
+ *
* To write an Elementary app, you can get started with the following:
- *
+ *
* @code
* #include <Elementary.h>
* #ifndef ELM_LIB_QUICKLAUNCH
* #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)
AC_OUTPUT(Makefile)
@endverbatim
- *
+ *
* Makefile.am:
- *
+ *
@verbatim
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
myapp_LDADD = @ELEMENTARY_LIBS@
myapp_CFLAGS = -DELM_LIB_QUICKLAUNCH=1
@endverbatim
- *
+ *
* autogen.sh:
- *
+ *
@verbatim
#!/bin/sh
rm -rf autom4te.cache
./configure "$@"
fi
@endverbatim
- *
+ *
* To gnerate all the things needed to bootstrap just run:
- *
+ *
@verbatim
./autogen.sh
@endverbatim
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
* 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
* 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)
AC_OUTPUT(Makefile)
@endverbatim
- *
+ *
* Makefile.am:
- *
+ *
@verbatim
AUTOMAKE_OPTIONS = 1.4 foreign
MAINTAINERCLEANFILES = Makefile.in
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
* 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);
_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;
}
/**
* 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
*/
/**
* 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
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;
_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");
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);
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);
}
{
#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
}
}
(_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();
}
}
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();
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);
(_elm_config->engine == ELM_OPENGL_X11))
{
#ifdef HAVE_ELEMENTARY_X
- ecore_x_sync();
-#endif
+ ecore_x_sync();
+#endif
}
ecore_main_loop_iterate();
}
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);
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
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;
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;
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);
return EINA_TRUE;
#else
return EINA_FALSE;
-#endif
+#endif
}
EAPI 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
}
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.
/**
* 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
/**
* @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.
/**
* Set the scaling factor
- *
+ *
* @param obj The object
* @param scale Scale factor (from 0.0 up, with 1.0 == no scaling)
* @ingroup Scaling
/**
* Get the scaling factor
- *
+ *
* @param obj The object
* @return The scaling factor set by elm_object_scale_set()
* @ingroup Scaling
/**
* @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
/**
* 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
/**
* Get the global scaling factor
- *
+ *
* This gets the globally configured scaling factor that is applied to all
* objects.
- *
+ *
* @return The scaling factor
* @ingroup Scaling
*/
/**
* 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
*/
/**
* @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).
/**
* Get the configured finger size
- *
+ *
* This gets the globally configured finger size in pixels
- *
+ *
* @return The finger size
* @ingroup Fingers
*/
/**
* Set the configured finger size
- *
+ *
* This sets the globally configured finger size in pixels
- *
+ *
* @paramsize The finger size
* @ingroup Fingers
*/
}
/**
- * 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
/**
* @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
*/
/**
* @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
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);
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);
+ }
}
}
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)
edje_object_message_signal_process(it->base);
if (it->popme)
{
- evas_object_del(it->content);
+ evas_object_del(it->content);
}
_sizing_eval(obj2);
}
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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.
*
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);
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);
* 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
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);
+ }
}
}
* 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
*
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;
+ }
}
}
it = eina_list_last(wd->stack)->data;
return it->content;
}
-
{
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
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;
}
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);
/**
* @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
{
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);
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");
}
}
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);
}
}
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
wd->group = calloc(1, sizeof(Group));
wd->group->radios = eina_list_append(wd->group->radios, obj);
wd->state = 0;
-
+
_sizing_eval(obj);
return obj;
}
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);
}
/**
* 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
/**
* 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
*
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;
}
}
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);
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);
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;
}
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);
}
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))
/**
* @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
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);
{
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);
{
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);
}
}
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);
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);
_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);
/**
* 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 *
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
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
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);
}
*
* @param obj The slider object
* @param icon The icon object
- *
+ *
* @ingroup Slider
*/
EAPI void
/**
* 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
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);
/**
* 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
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);
}
/**
* 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
/**
* Set orientation of the slider
- *
+ *
* @param obj The slider object
* @param horizontal If set, the slider will be horizontal
- *
+ *
* @ingroup Slider
*/
EAPI void
/**
* 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
/**
* 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
/**
* Get the value the slider has
- *
+ *
* @param obj The slider object
* @return The value of the slider
- *
+ *
* @ingroup Slider
*/
EAPI double
/**
* 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
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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;
}
_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;
}
{
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);
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;
}
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);
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);
{
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;
{
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);
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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");
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;
}
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);
}
}
else
{
- wd->statep = NULL;
+ wd->statep = NULL;
}
}
{
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);
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");
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);
}
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);
}
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);
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
Evas_Object *obj;
Evas *e;
Widget_Data *wd;
-
+
wd = ELM_NEW(Widget_Data);
e = evas_object_evas_get(parent);
obj = elm_widget_add(e);
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);
evas_object_show(wd->bx);
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE,
- _resize, obj);
-
+ _resize, obj);
+
_sizing_eval(obj);
return obj;
}
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;
#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;
typedef struct _Smart_Data Smart_Data;
struct _Smart_Data
-{
+{
Evas_Object *obj;
const char *type;
Evas_Object *parent_obj;
unsigned char child_can_focus : 1;
unsigned char focused : 1;
unsigned char disabled : 1;
-};
+};
/* local subsystem functions */
static void _smart_reconfigure(Smart_Data *sd);
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);
}
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);
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);
{
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)
{
else
{
int focus_next;
- int noloop = 0;
-
+ int noloop = 0;
+
focus_next = 0;
if (!sd->focused)
{
{
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;
+ }
+ }
}
}
}
}
}
}
- if (!l)
- {
+ if (!l)
+ {
if (elm_widget_can_focus_get(sd->resize_obj))
{
if ((focus_next) &&
}
}
}
- }
+ }
}
}
}
/* 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;
}
{
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
{
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);
+ }
+ }
}
}
}
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);
{
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;
Evas_Object *o, *parent;
parent = obj;
- for (;;)
- {
+ for (;;)
+ {
o = elm_widget_parent_get(parent);
if (!o) break;
parent = o;
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);
}
}
_smart_add(Evas_Object *obj)
{
Smart_Data *sd;
-
+
sd = calloc(1, sizeof(Smart_Data));
if (!sd) return;
sd->obj = obj;
_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);
{
INTERNAL_ENTRY;
evas_object_clip_unset(sd->resize_obj);
-}
+}
/* never need to touch this */
SMART_NAME,
EVAS_SMART_CLASS_VERSION,
_smart_add,
- _smart_del,
+ _smart_del,
_smart_move,
_smart_resize,
_smart_show,
NULL,
NULL
};
- _e_smart = evas_smart_class_new(&sc);
+ _e_smart = evas_smart_class_new(&sc);
}
}
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;
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);
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);
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);
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)
{
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;
Elm_Win *win;
const Eina_List *l;
const char *fontpath;
-
+
win = ELM_NEW(Elm_Win);
switch (_elm_config->engine)
{
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");
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);
_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:
if (!win) return;
ecore_evas_title_set(win->ee, title);
}
-
+
EAPI void
elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
{
{
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;
}
}
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
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;
{
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);
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);
}
}
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;
}
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);
}
}