forked from enlightenment/efl
parent
66a02d654c
commit
e2be9d2b24
|
@ -6,8 +6,8 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
|
|||
config.h.in config.sub configure install-sh \
|
||||
ltconfig ltmain.sh missing mkinstalldirs \
|
||||
stamp-h.in acconfig.h depcomp
|
||||
|
||||
EXTRA_DIST = README AUTHORS COPYING autogen.sh elementary.pc.in
|
||||
|
||||
EXTRA_DIST = README AUTHORS COPYING autogen.sh elementary.pc.in
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = elementary.pc
|
||||
|
@ -20,4 +20,3 @@ installed_headers_DATA = elementary_config.h
|
|||
doc:
|
||||
@echo "entering doc/"
|
||||
$(MAKE) -C doc doc
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ case "$host_os" in
|
|||
;;
|
||||
esac
|
||||
AC_SUBST(release_info)
|
||||
|
||||
|
||||
requirement_elm=""
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
@ -83,15 +83,15 @@ dnl managed by evil
|
|||
ELM_UNIX_DEF="#define"
|
||||
AC_CHECK_FUNCS(dlopen, res=yes, res=no)
|
||||
if test "x$res" = "xyes"; then
|
||||
AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR))
|
||||
AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR))
|
||||
else
|
||||
AC_CHECK_LIB(dl, dlopen, res=yes, res=no)
|
||||
if test "x$res" = "xyes"; then
|
||||
AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR))
|
||||
dlopen_libs=-ldl
|
||||
else
|
||||
AC_MSG_ERROR(Cannot find dlopen)
|
||||
fi
|
||||
AC_CHECK_LIB(dl, dlopen, res=yes, res=no)
|
||||
if test "x$res" = "xyes"; then
|
||||
AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR))
|
||||
dlopen_libs=-ldl
|
||||
else
|
||||
AC_MSG_ERROR(Cannot find dlopen)
|
||||
fi
|
||||
fi
|
||||
have_socket="yes"
|
||||
;;
|
||||
|
|
|
@ -53,7 +53,7 @@ child_handler(int x, siginfo_t *info, void *data)
|
|||
{
|
||||
int status;
|
||||
pid_t pid;
|
||||
|
||||
|
||||
while ((pid = waitpid(-1, &status, WNOHANG)) > 0);
|
||||
}
|
||||
|
||||
|
@ -61,13 +61,13 @@ static void
|
|||
crash_handler(int x, siginfo_t *info, void *data)
|
||||
{
|
||||
double t;
|
||||
|
||||
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: crash detected. restarting.\n");
|
||||
t = ecore_time_get();
|
||||
if ((t - restart_time) <= 2.0)
|
||||
{
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: crash too fast - less than 2 seconds. abort restart\n");
|
||||
exit(-1);
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: crash too fast - less than 2 seconds. abort restart\n");
|
||||
exit(-1);
|
||||
}
|
||||
ecore_app_restart();
|
||||
}
|
||||
|
@ -80,12 +80,12 @@ handle_run(int fd, unsigned long bytes)
|
|||
char **argv = NULL;
|
||||
char *cwd;
|
||||
int argc;
|
||||
|
||||
|
||||
buf = alloca(bytes);
|
||||
if ((num = read(fd, buf, bytes)) < 0)
|
||||
{
|
||||
close(fd);
|
||||
return;
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
close(fd);
|
||||
argc = ((unsigned long *)(buf))[0];
|
||||
|
@ -101,16 +101,16 @@ int
|
|||
main(int argc, char **argv)
|
||||
{
|
||||
int sock, socket_unix_len;
|
||||
struct stat st;
|
||||
struct stat st;
|
||||
struct sockaddr_un socket_unix;
|
||||
struct linger lin;
|
||||
char buf[PATH_MAX];
|
||||
struct sigaction action;
|
||||
|
||||
|
||||
if (!getenv("DISPLAY"))
|
||||
{
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: DISPLAY env var not set\n");
|
||||
exit(-1);
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: DISPLAY env var not set\n");
|
||||
exit(-1);
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid());
|
||||
if (stat(buf, &st) < 0) mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
|
||||
|
@ -119,37 +119,37 @@ main(int argc, char **argv)
|
|||
sock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot create socket for socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot create socket for socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
}
|
||||
if (fcntl(sock, F_SETFD, FD_CLOEXEC) < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: fcntl(sock, F_SETFD, FD_CLOEXEC)");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot set close on exec socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
perror("elementary_quicklaunch: fcntl(sock, F_SETFD, FD_CLOEXEC)");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot set close on exec socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
}
|
||||
lin.l_onoff = 1;
|
||||
lin.l_linger = 0;
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) ");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot set linger for socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
perror("elementary_quicklaunch: setsockopt(sock, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) ");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot set linger for socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
}
|
||||
socket_unix.sun_family = AF_UNIX;
|
||||
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
|
||||
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
|
||||
if (bind(sock, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: bind(sock, (struct sockaddr *)&socket_unix, socket_unix_len)");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot bind socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
perror("elementary_quicklaunch: bind(sock, (struct sockaddr *)&socket_unix, socket_unix_len)");
|
||||
EINA_ERROR_PERR("elementary_quicklaunch: cannot bind socket for '%s'\n", buf);
|
||||
exit(-1);
|
||||
}
|
||||
if (listen(sock, 4096) < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: listen(sock, 4096)");
|
||||
exit(-1);
|
||||
perror("elementary_quicklaunch: listen(sock, 4096)");
|
||||
exit(-1);
|
||||
}
|
||||
elm_quicklaunch_init(argc, argv);
|
||||
restart_time = ecore_time_get();
|
||||
|
@ -160,43 +160,43 @@ main(int argc, char **argv)
|
|||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGINT, &action, &old_sigint);
|
||||
|
||||
|
||||
action.sa_handler = SIG_DFL;
|
||||
action.sa_sigaction = NULL;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGTERM, &action, &old_sigterm);
|
||||
|
||||
|
||||
action.sa_handler = SIG_DFL;
|
||||
action.sa_sigaction = NULL;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGQUIT, &action, &old_sigquit);
|
||||
|
||||
|
||||
action.sa_handler = SIG_DFL;
|
||||
action.sa_sigaction = NULL;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGALRM, &action, &old_sigalrm);
|
||||
|
||||
|
||||
action.sa_handler = SIG_DFL;
|
||||
action.sa_sigaction = NULL;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGUSR1, &action, &old_sigusr1);
|
||||
|
||||
|
||||
action.sa_handler = SIG_DFL;
|
||||
action.sa_sigaction = NULL;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGUSR2, &action, &old_sigusr2);
|
||||
|
||||
|
||||
action.sa_handler = SIG_DFL;
|
||||
action.sa_sigaction = NULL;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGHUP, &action, &old_sighup);
|
||||
|
||||
|
||||
action.sa_handler = NULL;
|
||||
action.sa_sigaction = child_handler;
|
||||
action.sa_flags = SA_RESTART | SA_SIGINFO;
|
||||
|
@ -208,55 +208,55 @@ main(int argc, char **argv)
|
|||
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGSEGV, &action, &old_sigsegv);
|
||||
|
||||
|
||||
action.sa_handler = NULL;
|
||||
action.sa_sigaction = crash_handler;
|
||||
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGILL, &action, &old_sigill);
|
||||
|
||||
|
||||
action.sa_handler = NULL;
|
||||
action.sa_sigaction = crash_handler;
|
||||
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGFPE, &action, &old_sigfpe);
|
||||
|
||||
|
||||
action.sa_handler = NULL;
|
||||
action.sa_sigaction = crash_handler;
|
||||
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGBUS, &action, &old_sigbus);
|
||||
|
||||
|
||||
action.sa_handler = NULL;
|
||||
action.sa_sigaction = crash_handler;
|
||||
action.sa_flags = SA_NODEFER | SA_RESETHAND | SA_SIGINFO;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGABRT, &action, &old_sigabrt);
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int fd;
|
||||
struct sockaddr_un client;
|
||||
socklen_t len;
|
||||
int fd;
|
||||
struct sockaddr_un client;
|
||||
socklen_t len;
|
||||
|
||||
elm_quicklaunch_sub_init(argc, argv);
|
||||
elm_quicklaunch_seed();
|
||||
len = sizeof(struct sockaddr_un);
|
||||
fd = accept(sock, (struct sockaddr *)&client, &len);
|
||||
if (fd >= 0)
|
||||
{
|
||||
int bytes;
|
||||
char line[4096];
|
||||
int num;
|
||||
|
||||
num = read(fd, &bytes, sizeof(unsigned long));
|
||||
if (num == sizeof(unsigned long))
|
||||
{
|
||||
ecore_app_args_set(argc, (const char **)argv);
|
||||
handle_run(fd, bytes);
|
||||
}
|
||||
}
|
||||
elm_quicklaunch_sub_shutdown();
|
||||
elm_quicklaunch_sub_init(argc, argv);
|
||||
elm_quicklaunch_seed();
|
||||
len = sizeof(struct sockaddr_un);
|
||||
fd = accept(sock, (struct sockaddr *)&client, &len);
|
||||
if (fd >= 0)
|
||||
{
|
||||
int bytes;
|
||||
char line[4096];
|
||||
int num;
|
||||
|
||||
num = read(fd, &bytes, sizeof(unsigned long));
|
||||
if (num == sizeof(unsigned long))
|
||||
{
|
||||
ecore_app_args_set(argc, (const char **)argv);
|
||||
handle_run(fd, bytes);
|
||||
}
|
||||
}
|
||||
elm_quicklaunch_sub_shutdown();
|
||||
}
|
||||
elm_quicklaunch_shutdown();
|
||||
return 0;
|
||||
|
|
|
@ -27,119 +27,119 @@ main(int argc, char **argv)
|
|||
int we_are_elementary_run = 0;
|
||||
char *disp;
|
||||
char *cwd;
|
||||
|
||||
|
||||
int sargc, slen;
|
||||
unsigned char *sbuf = NULL, *pos;
|
||||
char **sargv = NULL;
|
||||
|
||||
|
||||
if (!getcwd(buf, sizeof(buf) - 1))
|
||||
{
|
||||
fprintf(stderr, "elementary_quicklaunch: currect working dir too big.\n");
|
||||
exit(-1);
|
||||
fprintf(stderr, "elementary_quicklaunch: currect working dir too big.\n");
|
||||
exit(-1);
|
||||
}
|
||||
cwd = strdup(buf);
|
||||
if (!(disp = getenv("DISPLAY")))
|
||||
{
|
||||
fprintf(stderr, "elementary_quicklaunch: DISPLAY env var not set\n");
|
||||
exit(-1);
|
||||
fprintf(stderr, "elementary_quicklaunch: DISPLAY env var not set\n");
|
||||
exit(-1);
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp);
|
||||
if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");
|
||||
exit(-1);
|
||||
perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");
|
||||
exit(-1);
|
||||
}
|
||||
socket_unix.sun_family = AF_UNIX;
|
||||
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
|
||||
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
|
||||
if (connect(sock, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
|
||||
{
|
||||
perror("elementary_quicklaunch: connect(sock, (struct sockaddr *)&socket_unix, socket_unix_len)");
|
||||
printf("elementary_quicklaunch: cannot connect to socket '%s'\n", buf);
|
||||
exit(1);
|
||||
perror("elementary_quicklaunch: connect(sock, (struct sockaddr *)&socket_unix, socket_unix_len)");
|
||||
printf("elementary_quicklaunch: cannot connect to socket '%s'\n", buf);
|
||||
exit(1);
|
||||
}
|
||||
exe = argv[0];
|
||||
if (!(((exe[0] == '/')) ||
|
||||
((exe[0] == '.') && (exe[1] == '/')) ||
|
||||
((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/'))))
|
||||
((exe[0] == '.') && (exe[1] == '/')) ||
|
||||
((exe[0] == '.') && (exe[1] == '.') && (exe[2] == '/'))))
|
||||
{
|
||||
char *path = getenv("PATH");
|
||||
int exelen = strlen(argv[0]);
|
||||
if (path)
|
||||
{
|
||||
const char *p, *pp, *s;
|
||||
int exelen;
|
||||
|
||||
p = path;
|
||||
pp = p;
|
||||
exe = NULL;
|
||||
for (;;)
|
||||
{
|
||||
if ((*p == ':') || (*p == 0))
|
||||
{
|
||||
int len;
|
||||
|
||||
len = p - pp;
|
||||
if (len < (sizeof(buf) - exelen - 3))
|
||||
{
|
||||
strncpy(buf, pp, len);
|
||||
strcpy(buf + len, "/");
|
||||
strcpy(buf + len + 1, argv[0]);
|
||||
if (access(buf, R_OK | X_OK) == 0)
|
||||
{
|
||||
exe = buf;
|
||||
break;
|
||||
}
|
||||
if (*p == 0) break;
|
||||
p++;
|
||||
pp = p;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*p == 0) break;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
char *path = getenv("PATH");
|
||||
int exelen = strlen(argv[0]);
|
||||
if (path)
|
||||
{
|
||||
const char *p, *pp, *s;
|
||||
int exelen;
|
||||
|
||||
p = path;
|
||||
pp = p;
|
||||
exe = NULL;
|
||||
for (;;)
|
||||
{
|
||||
if ((*p == ':') || (*p == 0))
|
||||
{
|
||||
int len;
|
||||
|
||||
len = p - pp;
|
||||
if (len < (sizeof(buf) - exelen - 3))
|
||||
{
|
||||
strncpy(buf, pp, len);
|
||||
strcpy(buf + len, "/");
|
||||
strcpy(buf + len + 1, argv[0]);
|
||||
if (access(buf, R_OK | X_OK) == 0)
|
||||
{
|
||||
exe = buf;
|
||||
break;
|
||||
}
|
||||
if (*p == 0) break;
|
||||
p++;
|
||||
pp = p;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*p == 0) break;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (exe)
|
||||
{
|
||||
if (lstat(exe, &st) == 0)
|
||||
{
|
||||
if (S_ISLNK(st.st_mode))
|
||||
{
|
||||
char buf2[PATH_MAX];
|
||||
|
||||
ssize_t len = readlink(exe, buf2, sizeof(buf2) - 1);
|
||||
if (len >= 0)
|
||||
{
|
||||
char *p;
|
||||
buf2[len] = 0;
|
||||
p = strrchr(buf2, '/');
|
||||
if (p) p++;
|
||||
else p = buf2;
|
||||
if (!strncasecmp(p, "elementary_run", 14))
|
||||
we_are_elementary_run = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lstat(exe, &st) == 0)
|
||||
{
|
||||
if (S_ISLNK(st.st_mode))
|
||||
{
|
||||
char buf2[PATH_MAX];
|
||||
|
||||
ssize_t len = readlink(exe, buf2, sizeof(buf2) - 1);
|
||||
if (len >= 0)
|
||||
{
|
||||
char *p;
|
||||
buf2[len] = 0;
|
||||
p = strrchr(buf2, '/');
|
||||
if (p) p++;
|
||||
else p = buf2;
|
||||
if (!strncasecmp(p, "elementary_run", 14))
|
||||
we_are_elementary_run = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (we_are_elementary_run)
|
||||
{
|
||||
sargc = argc;
|
||||
sargv = argv;
|
||||
sargc = argc;
|
||||
sargv = argv;
|
||||
}
|
||||
else
|
||||
{
|
||||
sargc = argc - 1;
|
||||
sargv = &(argv[1]);
|
||||
sargc = argc - 1;
|
||||
sargv = &(argv[1]);
|
||||
}
|
||||
slen = sizeof(unsigned long) + sizeof(unsigned long);
|
||||
for (i = 0; i < sargc; i++)
|
||||
{
|
||||
slen += sizeof(unsigned long);
|
||||
slen += strlen(sargv[i]) + 1;
|
||||
slen += sizeof(unsigned long);
|
||||
slen += strlen(sargv[i]) + 1;
|
||||
}
|
||||
slen += strlen(cwd) + 1;
|
||||
sbuf = alloca(slen);
|
||||
|
@ -148,10 +148,10 @@ main(int argc, char **argv)
|
|||
pos = (unsigned char *)(&((((unsigned long *)(sbuf))[2 + sargc])));
|
||||
for (i = 0; i < sargc; i++)
|
||||
{
|
||||
((unsigned long *)(sbuf))[2 + i] =
|
||||
(unsigned long)pos - ((unsigned long)sbuf + sizeof(unsigned long));
|
||||
strcpy(pos, sargv[i]);
|
||||
pos += strlen(sargv[i]) + 1;
|
||||
((unsigned long *)(sbuf))[2 + i] =
|
||||
(unsigned long)pos - ((unsigned long)sbuf + sizeof(unsigned long));
|
||||
strcpy(pos, sargv[i]);
|
||||
pos += strlen(sargv[i]) + 1;
|
||||
}
|
||||
strcpy(pos, cwd);
|
||||
write(sock, sbuf, slen);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -58,7 +58,7 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* EFL headers */
|
||||
#include <Eina.h>
|
||||
#include <Eet.h>
|
||||
|
@ -109,8 +109,8 @@ extern "C" {
|
|||
|
||||
/* handy macros */
|
||||
#define ELM_RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy)))
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
/**************************************************************************/
|
||||
/* Objects */
|
||||
typedef enum _Elm_Win_Type
|
||||
{
|
||||
|
@ -127,30 +127,30 @@ extern "C" {
|
|||
typedef enum _Elm_Win_Keyboard_Mode
|
||||
{
|
||||
ELM_WIN_KEYBOARD_UNKNOWN,
|
||||
ELM_WIN_KEYBOARD_OFF,
|
||||
ELM_WIN_KEYBOARD_ON,
|
||||
ELM_WIN_KEYBOARD_ALPHA,
|
||||
ELM_WIN_KEYBOARD_NUMERIC,
|
||||
ELM_WIN_KEYBOARD_PIN,
|
||||
ELM_WIN_KEYBOARD_PHONE_NUMBER,
|
||||
ELM_WIN_KEYBOARD_HEX,
|
||||
ELM_WIN_KEYBOARD_TERMINAL,
|
||||
ELM_WIN_KEYBOARD_PASSWORD
|
||||
ELM_WIN_KEYBOARD_OFF,
|
||||
ELM_WIN_KEYBOARD_ON,
|
||||
ELM_WIN_KEYBOARD_ALPHA,
|
||||
ELM_WIN_KEYBOARD_NUMERIC,
|
||||
ELM_WIN_KEYBOARD_PIN,
|
||||
ELM_WIN_KEYBOARD_PHONE_NUMBER,
|
||||
ELM_WIN_KEYBOARD_HEX,
|
||||
ELM_WIN_KEYBOARD_TERMINAL,
|
||||
ELM_WIN_KEYBOARD_PASSWORD
|
||||
} Elm_Win_Keyboard_Mode;
|
||||
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
#define ELM_MAIN() int main(int argc, char **argv) {elm_init(argc, argv); return elm_main(argc, argv);}
|
||||
#else
|
||||
#define ELM_MAIN() int main(int argc, char **argv) {return elm_quicklaunch_fallback(argc, argv);}
|
||||
#endif
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
/**************************************************************************/
|
||||
/* General calls */
|
||||
EAPI void elm_init(int argc, char **argv);
|
||||
EAPI void elm_shutdown(void);
|
||||
EAPI void elm_run(void);
|
||||
EAPI void elm_exit(void);
|
||||
|
||||
|
||||
EAPI void elm_quicklaunch_init(int argc, char **argv);
|
||||
EAPI void elm_quicklaunch_sub_init(int argc, char **argv);
|
||||
EAPI void elm_quicklaunch_sub_shutdown(void);
|
||||
|
@ -161,7 +161,7 @@ extern "C" {
|
|||
EAPI void elm_quicklaunch_cleanup(void);
|
||||
EAPI int elm_quicklaunch_fallback(int argc, char **argv);
|
||||
EAPI char *elm_quicklaunch_exe_path_get(const char *exe);
|
||||
|
||||
|
||||
EAPI void elm_object_scale_set(Evas_Object *obj, double scale);
|
||||
EAPI double elm_object_scale_get(const Evas_Object *obj);
|
||||
EAPI void elm_object_style_set(Evas_Object *obj, const char *style);
|
||||
|
@ -171,14 +171,14 @@ extern "C" {
|
|||
EAPI void elm_scale_set(double scale);
|
||||
EAPI Evas_Coord elm_finger_size_get(void);
|
||||
EAPI void elm_finger_size_set(Evas_Coord size);
|
||||
|
||||
|
||||
EAPI void elm_object_focus(Evas_Object *obj);
|
||||
|
||||
|
||||
EAPI void elm_coords_finger_size_adjust(int times_w, Evas_Coord *w, int times_h, Evas_Coord *h);
|
||||
|
||||
|
||||
EAPI void elm_theme_overlay_add(const char *item);
|
||||
EAPI void elm_theme_extension_add(const char *item);
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type);
|
||||
EAPI void elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj);
|
||||
EAPI void elm_win_resize_object_del(Evas_Object *obj, Evas_Object *subobj);
|
||||
|
@ -206,7 +206,7 @@ extern "C" {
|
|||
* ecore_x_icccm_window_role_set -> role (add to ecore_evas)
|
||||
* ecore_x_icccm_transient_for_set -> forwin (add to ecore_evas)
|
||||
* ecore_x_netwm_window_type_set -> type (add to ecore_evas)
|
||||
*
|
||||
*
|
||||
* (add to ecore_x) set netwm argb icon! (add to ecore_evas)
|
||||
* (blank mouse, private mouse obj, defaultmouse)
|
||||
*
|
||||
|
@ -218,14 +218,14 @@ extern "C" {
|
|||
EAPI void elm_win_inwin_activate(Evas_Object *obj);
|
||||
EAPI void elm_win_inwin_style_set(Evas_Object *obj, const char *style);
|
||||
EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content);
|
||||
/* available styles:
|
||||
/* available styles:
|
||||
* default
|
||||
* minimal
|
||||
* minimal_vertical
|
||||
*/
|
||||
|
||||
|
||||
/* X specific calls - won't work on non-x engines (return 0) */
|
||||
EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj);
|
||||
EAPI Ecore_X_Window elm_win_xwindow_get(const Evas_Object *obj);
|
||||
/* smart callbacks called:
|
||||
* "delete-request" - the user requested to delete the window
|
||||
* "focus-in" - window got focus
|
||||
|
@ -282,14 +282,14 @@ extern "C" {
|
|||
EAPI void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_button_add(Evas_Object *parent);
|
||||
EAPI void elm_button_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_button_icon_set(Evas_Object *obj, Evas_Object *icon);
|
||||
EAPI void elm_button_style_set(Evas_Object *obj, const char *style);
|
||||
/* available styles:
|
||||
* default
|
||||
* hoversel_vertical
|
||||
/* available styles:
|
||||
* default
|
||||
* hoversel_vertical
|
||||
* hoversel_vertical_entry
|
||||
*/
|
||||
/* smart callbacks called:
|
||||
|
@ -298,12 +298,12 @@ extern "C" {
|
|||
|
||||
typedef enum _Elm_Scroller_Policy
|
||||
{
|
||||
ELM_SCROLLER_POLICY_AUTO,
|
||||
ELM_SCROLLER_POLICY_ON,
|
||||
ELM_SCROLLER_POLICY_OFF
|
||||
ELM_SCROLLER_POLICY_AUTO,
|
||||
ELM_SCROLLER_POLICY_ON,
|
||||
ELM_SCROLLER_POLICY_OFF
|
||||
}
|
||||
Elm_Scroller_Policy;
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_scroller_add(Evas_Object *parent);
|
||||
EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child);
|
||||
EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
|
||||
|
@ -324,7 +324,7 @@ extern "C" {
|
|||
EAPI void elm_label_label_set(Evas_Object *obj, const char *label);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_toggle_add(Evas_Object *parent);
|
||||
EAPI void elm_toggle_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon);
|
||||
|
@ -335,7 +335,7 @@ extern "C" {
|
|||
/* smart callbacks called:
|
||||
* "changed" - the user toggled the state
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_frame_add(Evas_Object *parent);
|
||||
EAPI void elm_frame_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content);
|
||||
|
@ -351,13 +351,13 @@ extern "C" {
|
|||
*/
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_table_add(Evas_Object *parent);
|
||||
EAPI void elm_table_homogenous_set(Evas_Object *obj, Eina_Bool homogenous);
|
||||
EAPI void elm_table_pack(Evas_Object *obj, Evas_Object *subobj, int x, int y, int w, int h);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_clock_add(Evas_Object *parent);
|
||||
EAPI void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec);
|
||||
EAPI void elm_clock_time_get(const Evas_Object *obj, int *hrs, int *min, int *sec);
|
||||
|
@ -374,13 +374,13 @@ extern "C" {
|
|||
EAPI Evas_Object *elm_layout_edje_get(const Evas_Object *obj);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
||||
typedef enum _Elm_Hover_Axis
|
||||
{
|
||||
ELM_HOVER_AXIS_NONE,
|
||||
ELM_HOVER_AXIS_HORIZONTAL,
|
||||
ELM_HOVER_AXIS_VERTICAL,
|
||||
ELM_HOVER_AXIS_BOTH
|
||||
ELM_HOVER_AXIS_HORIZONTAL,
|
||||
ELM_HOVER_AXIS_VERTICAL,
|
||||
ELM_HOVER_AXIS_BOTH
|
||||
} Elm_Hover_Axis;
|
||||
EAPI Evas_Object *elm_hover_add(Evas_Object *parent);
|
||||
EAPI void elm_hover_target_set(Evas_Object *obj, Evas_Object *target);
|
||||
|
@ -388,7 +388,7 @@ extern "C" {
|
|||
EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content);
|
||||
EAPI void elm_hover_style_set(Evas_Object *obj, const char *style);
|
||||
EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis);
|
||||
/* available styles:
|
||||
/* available styles:
|
||||
* default
|
||||
* popout
|
||||
* hoversel_vertical
|
||||
|
@ -417,7 +417,7 @@ extern "C" {
|
|||
EAPI void elm_entry_select_all(Evas_Object *obj);
|
||||
EAPI char *elm_entry_markup_to_utf8(const char *s);
|
||||
EAPI char *elm_entry_utf8_to_markup(const char *s);
|
||||
|
||||
|
||||
/* smart callbacks called:
|
||||
* "changed" - the text content changed
|
||||
* "selection,start" - the user started selecting text
|
||||
|
@ -430,7 +430,7 @@ extern "C" {
|
|||
* "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchor_Info
|
||||
* "activated" - when the enter key is pressed (useful for single line)
|
||||
*/
|
||||
|
||||
|
||||
/* composite widgets - these basically put together basic widgets above
|
||||
* in convenient packages that do more than basic stuff */
|
||||
|
||||
|
@ -466,7 +466,7 @@ extern "C" {
|
|||
/* smart callbacks called:
|
||||
* "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorview_Info
|
||||
*/
|
||||
|
||||
|
||||
typedef struct _Elm_Entry_Anchorblock_Info Elm_Entry_Anchorblock_Info;
|
||||
struct _Elm_Entry_Anchorblock_Info
|
||||
{
|
||||
|
@ -489,7 +489,7 @@ extern "C" {
|
|||
/* smart callbacks called:
|
||||
* "anchor,clicked" - achor called was clicked | event_info = Elm_Entry_Anchorblock_Info
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_bubble_add(Evas_Object *parent);
|
||||
EAPI void elm_bubble_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_bubble_info_set(Evas_Object *obj, const char *info);
|
||||
|
@ -508,9 +508,9 @@ extern "C" {
|
|||
|
||||
typedef enum _Elm_Icon_Type
|
||||
{
|
||||
ELM_ICON_NONE,
|
||||
ELM_ICON_FILE,
|
||||
ELM_ICON_STANDARD
|
||||
ELM_ICON_NONE,
|
||||
ELM_ICON_FILE,
|
||||
ELM_ICON_STANDARD
|
||||
} Elm_Icon_Type;
|
||||
typedef struct _Elm_Hoversel_Item Elm_Hoversel_Item;
|
||||
EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent);
|
||||
|
@ -527,7 +527,7 @@ extern "C" {
|
|||
* "selected" - an item in the hoversel list is selected
|
||||
* "dismissed" - the hover is dismissed
|
||||
*/
|
||||
|
||||
|
||||
typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item;
|
||||
EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent);
|
||||
EAPI Elm_Toolbar_Item *elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, void (*func) (void *data, Evas_Object *obj, void *event_info), const void *data);
|
||||
|
@ -540,9 +540,9 @@ extern "C" {
|
|||
|
||||
typedef enum _Elm_List_Mode
|
||||
{
|
||||
ELM_LIST_COMPRESS,
|
||||
ELM_LIST_SCROLL,
|
||||
ELM_LIST_LIMIT
|
||||
ELM_LIST_COMPRESS,
|
||||
ELM_LIST_SCROLL,
|
||||
ELM_LIST_LIMIT
|
||||
} Elm_List_Mode;
|
||||
typedef struct _Elm_List_Item Elm_List_Item;
|
||||
EAPI Evas_Object *elm_list_add(Evas_Object *parent);
|
||||
|
@ -585,7 +585,7 @@ extern "C" {
|
|||
/* smart callbacks called:
|
||||
* "clicked" - when the user clicks on a carousel item and becomes selected
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_slider_add(Evas_Object *parent);
|
||||
EAPI void elm_slider_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon);
|
||||
|
@ -601,11 +601,11 @@ extern "C" {
|
|||
* "changed" - when the slider value changes
|
||||
* "delay,changed" - when the slider value changed, but a small time after a change (use this if you only want to respond to a change once the slider is held still for a short while).
|
||||
*/
|
||||
|
||||
|
||||
typedef enum _Elm_Genlist_Item_Flags
|
||||
{
|
||||
ELM_GENLIST_ITEM_NONE = 0,
|
||||
ELM_GENLIST_ITEM_SUBITEMS = (1 << 0)
|
||||
ELM_GENLIST_ITEM_NONE = 0,
|
||||
ELM_GENLIST_ITEM_SUBITEMS = (1 << 0)
|
||||
} Elm_Genlist_Item_Flags;
|
||||
typedef struct _Elm_Genlist_Item_Class Elm_Genlist_Item_Class;
|
||||
typedef struct _Elm_Genlist_Item Elm_Genlist_Item;
|
||||
|
@ -614,16 +614,16 @@ extern "C" {
|
|||
typedef Evas_Object *(*GenlistItemIconGetFunc) (const void *data, Evas_Object *obj, const char *part);
|
||||
typedef Eina_Bool (*GenlistItemStateGetFunc) (const void *data, Evas_Object *obj, const char *part);
|
||||
typedef void (*GenlistItemDelFunc) (const void *data, Evas_Object *obj);
|
||||
|
||||
|
||||
struct _Elm_Genlist_Item_Class
|
||||
{
|
||||
const char *item_style;
|
||||
struct _Elm_Genlist_Item_Class_Func {
|
||||
GenlistItemLabelGetFunc label_get;
|
||||
GenlistItemIconGetFunc icon_get;
|
||||
GenlistItemStateGetFunc state_get;
|
||||
GenlistItemDelFunc del;
|
||||
} func;
|
||||
const char *item_style;
|
||||
struct _Elm_Genlist_Item_Class_Func {
|
||||
GenlistItemLabelGetFunc label_get;
|
||||
GenlistItemIconGetFunc icon_get;
|
||||
GenlistItemStateGetFunc state_get;
|
||||
GenlistItemDelFunc del;
|
||||
} func;
|
||||
};
|
||||
|
||||
EAPI Evas_Object *elm_genlist_add(Evas_Object *parent);
|
||||
|
@ -655,7 +655,7 @@ extern "C" {
|
|||
EAPI void elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode);
|
||||
EAPI void elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
|
||||
EAPI void elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
|
||||
/* available item styles:
|
||||
/* available item styles:
|
||||
* default
|
||||
* double_label
|
||||
*/
|
||||
|
@ -668,7 +668,7 @@ extern "C" {
|
|||
* "expand,request" - when the user requested to expand an item
|
||||
* "contract,request" - when the user requested to expand an item
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_check_add(Evas_Object *parent);
|
||||
EAPI void elm_check_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_check_icon_set(Evas_Object *obj, Evas_Object *icon);
|
||||
|
@ -678,7 +678,7 @@ extern "C" {
|
|||
/* smart callbacks called:
|
||||
* "changed" - the user toggled the state
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_radio_add(Evas_Object *parent);
|
||||
EAPI void elm_radio_label_set(Evas_Object *obj, const char *label);
|
||||
EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon);
|
||||
|
@ -690,7 +690,7 @@ extern "C" {
|
|||
/* smart callbacks called:
|
||||
* "changed" - the user toggled the state
|
||||
*/
|
||||
|
||||
|
||||
EAPI Evas_Object *elm_pager_add(Evas_Object *parent);
|
||||
EAPI void elm_pager_content_push(Evas_Object *obj, Evas_Object *content);
|
||||
EAPI void elm_pager_content_pop(Evas_Object *obj);
|
||||
|
@ -699,7 +699,7 @@ extern "C" {
|
|||
EAPI Evas_Object *elm_pager_content_top_get(Evas_Object *obj);
|
||||
/* smart callbacks called:
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -707,20 +707,20 @@ extern "C" {
|
|||
////////////////////////////////////////////////////////////////////////////
|
||||
/// FIXME: TODO LIST ///////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//// (bugs - high priority)
|
||||
// * scale change for hover doesnt seem to do new size alloc nicely
|
||||
// * left/right arrow broken with password mode for entry + utf8 chars...
|
||||
// * bubble doesnt handle child size changes right
|
||||
// * table doesnt do homogenous properly
|
||||
//
|
||||
//
|
||||
//// (incomplete - medium priority)
|
||||
// * disabled not supported
|
||||
// * on the fly theme changes - test (should work)
|
||||
// * need a hold-scroll counter in elm_widget
|
||||
// * hoversel only vertical right now - make horizontal
|
||||
// * when entries are in a scroller and change size, the scroller shows scrollbars. fix. same for selecting. for 1 line entries in a scroller should only have scroll arrow indicators.
|
||||
//
|
||||
//
|
||||
//// (more widgets/features - medium priority)
|
||||
// * multiple genlist item styles (multi-label, 1 icon + 2 line label, header etc.)
|
||||
// * carousel selector widget
|
||||
|
@ -746,7 +746,7 @@ extern "C" {
|
|||
// * status widget (busy, stalled, running, etc.)
|
||||
// * full window in window widget (so move/resize of window object does as you'd expect a child window to do within the canvas)
|
||||
// * window frame widget for borderless windows that want the app to do its own frame (move, resize as well etc.)
|
||||
//
|
||||
//
|
||||
//// (improvements - low priority)
|
||||
// * test for all bubble styles
|
||||
// * test for all frame styles
|
||||
|
@ -784,6 +784,6 @@ extern "C" {
|
|||
// * win should emit signals based on vkbd type - if it gets a message and is a vkbd win
|
||||
// * win needs a way of setting aspect too
|
||||
// * use the wrong call on the wrong widget and *BOOM* ... crashland
|
||||
//
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#endif
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
@ -87,11 +87,11 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
|
|||
Evas_Object *hover_parent;
|
||||
Elm_Entry_Anchorblock_Info ei;
|
||||
Evas_Coord x, w, y, h, px, py;
|
||||
|
||||
|
||||
wd->pop = elm_icon_add(obj);
|
||||
evas_object_move(wd->pop, info->x, info->y);
|
||||
evas_object_resize(wd->pop, info->w, info->h);
|
||||
|
||||
|
||||
wd->hover = elm_hover_add(obj);
|
||||
if (wd->hover_style) elm_hover_style_set(wd->hover, wd->hover_style);
|
||||
hover_parent = wd->hover_parent;
|
||||
|
@ -114,13 +114,13 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
|
|||
px = info->x + (info->w / 2);
|
||||
py = info->y + (info->h / 2);
|
||||
ei.hover_left = 1;
|
||||
if (px < (x + (w / 3))) ei.hover_left = 0;
|
||||
if (px < (x + (w / 3))) ei.hover_left = 0;
|
||||
ei.hover_right = 1;
|
||||
if (px > (x + ((w * 2) / 3))) ei.hover_right = 0;
|
||||
if (px > (x + ((w * 2) / 3))) ei.hover_right = 0;
|
||||
ei.hover_top = 1;
|
||||
if (py < (y + (h / 3))) ei.hover_top = 0;
|
||||
if (py < (y + (h / 3))) ei.hover_top = 0;
|
||||
ei.hover_bottom = 1;
|
||||
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
|
||||
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
|
||||
evas_object_smart_callback_call(data, "anchor,clicked", &ei);
|
||||
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
|
||||
evas_object_show(wd->hover);
|
||||
|
@ -135,10 +135,10 @@ _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
|
||||
/**
|
||||
* Add a new Anchorblock object
|
||||
*
|
||||
*
|
||||
* @param parent The parent object
|
||||
* @return The new object or NULL if it cannot be created
|
||||
*
|
||||
*
|
||||
* @ingroup Anchorblock
|
||||
*/
|
||||
EAPI Evas_Object *
|
||||
|
@ -147,7 +147,7 @@ elm_anchorblock_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -156,35 +156,35 @@ elm_anchorblock_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
|
||||
|
||||
wd->entry = elm_entry_add(parent);
|
||||
elm_widget_resize_object_set(obj, wd->entry);
|
||||
elm_entry_editable_set(wd->entry, 0);
|
||||
evas_object_size_hint_weight_set(wd->entry, 1.0, 1.0);
|
||||
evas_object_size_hint_align_set(wd->entry, -1.0, -1.0);
|
||||
|
||||
|
||||
evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
|
||||
|
||||
elm_entry_entry_set(wd->entry, "");
|
||||
|
||||
|
||||
evas_object_smart_callback_add(wd->entry, "anchor,clicked", _anchor_clicked, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the text markup of the anchorblock
|
||||
*
|
||||
*
|
||||
* This sets the text of the anchorblock to be the text given as @p text. This
|
||||
* text is in markup format with \<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
|
||||
|
@ -201,13 +201,13 @@ elm_anchorblock_text_set(Evas_Object *obj, const char *text)
|
|||
|
||||
/**
|
||||
* Set the parent of the hover popup
|
||||
*
|
||||
*
|
||||
* This sets the parent of the hover that anchorblock will create. See hover
|
||||
* objects for more information on this.
|
||||
*
|
||||
*
|
||||
* @param obj The anchorblock object
|
||||
* @param parent The parent the hover should use
|
||||
*
|
||||
*
|
||||
* @ingroup Anchorblock
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -223,13 +223,13 @@ elm_anchorblock_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
|
||||
/**
|
||||
* Set the style that the hover should use
|
||||
*
|
||||
*
|
||||
* This sets the style for the hover that anchorblock will create. See hover
|
||||
* objects for more information
|
||||
*
|
||||
*
|
||||
* @param obj The anchorblock object
|
||||
* @param style The style to use
|
||||
*
|
||||
*
|
||||
* @ingroup Anchorblock
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -239,15 +239,15 @@ elm_anchorblock_hover_style_set(Evas_Object *obj, const char *style)
|
|||
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
|
||||
wd->hover_style = NULL;
|
||||
if (style) wd->hover_style = eina_stringshare_add(style);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the hover popup in the anchorblock
|
||||
*
|
||||
*
|
||||
* This will stop the hover popup in the anchorblock if it is currently active.
|
||||
*
|
||||
*
|
||||
* @param obj The anchorblock object
|
||||
*
|
||||
*
|
||||
* @ingroup Anchorblock
|
||||
*/
|
||||
EAPI void
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
/**
|
||||
* @defgroup Anchorview Anchorview
|
||||
*
|
||||
*
|
||||
* This is just like the Anchorblock object, but provides a scroller to hold
|
||||
* the text automatically.
|
||||
*
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
*
|
||||
* anchor,clicked - achor called was clicked. event_info is anchor info -
|
||||
* Elm_Entry_Anchorview_Info
|
||||
*/
|
||||
|
@ -73,11 +73,11 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
|
|||
Evas_Object *hover_parent;
|
||||
Elm_Entry_Anchorview_Info ei;
|
||||
Evas_Coord x, w, y, h, px, py;
|
||||
|
||||
|
||||
wd->pop = elm_icon_add(obj);
|
||||
evas_object_move(wd->pop, info->x, info->y);
|
||||
evas_object_resize(wd->pop, info->w, info->h);
|
||||
|
||||
|
||||
wd->hover = elm_hover_add(obj);
|
||||
if (wd->hover_style) elm_hover_style_set(wd->hover, wd->hover_style);
|
||||
hover_parent = wd->hover_parent;
|
||||
|
@ -100,13 +100,13 @@ _anchor_clicked(void *data, Evas_Object *obj, void *event_info)
|
|||
px = info->x + (info->w / 2);
|
||||
py = info->y + (info->h / 2);
|
||||
ei.hover_left = 1;
|
||||
if (px < (x + (w / 3))) ei.hover_left = 0;
|
||||
if (px < (x + (w / 3))) ei.hover_left = 0;
|
||||
ei.hover_right = 1;
|
||||
if (px > (x + ((w * 2) / 3))) ei.hover_right = 0;
|
||||
if (px > (x + ((w * 2) / 3))) ei.hover_right = 0;
|
||||
ei.hover_top = 1;
|
||||
if (py < (y + (h / 3))) ei.hover_top = 0;
|
||||
if (py < (y + (h / 3))) ei.hover_top = 0;
|
||||
ei.hover_bottom = 1;
|
||||
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
|
||||
if (py > (y + ((h * 2) / 3))) ei.hover_bottom = 0;
|
||||
evas_object_smart_callback_call(data, "anchor,clicked", &ei);
|
||||
evas_object_smart_callback_add(wd->hover, "clicked", _hover_clicked, data);
|
||||
evas_object_show(wd->hover);
|
||||
|
@ -133,7 +133,7 @@ elm_anchorview_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -142,7 +142,7 @@ elm_anchorview_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
|
||||
|
||||
wd->scroller = elm_scroller_add(parent);
|
||||
elm_widget_resize_object_set(obj, wd->scroller);
|
||||
wd->entry = elm_entry_add(parent);
|
||||
|
@ -151,14 +151,14 @@ elm_anchorview_add(Evas_Object *parent)
|
|||
evas_object_size_hint_align_set(wd->entry, -1.0, -1.0);
|
||||
elm_scroller_content_set(wd->scroller, wd->entry);
|
||||
evas_object_show(wd->entry);
|
||||
|
||||
|
||||
evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
|
||||
|
||||
elm_entry_entry_set(wd->entry, "");
|
||||
|
||||
|
||||
evas_object_smart_callback_add(wd->entry, "anchor,clicked", _anchor_clicked, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ elm_anchorview_hover_style_set(Evas_Object *obj, const char *style)
|
|||
if (wd->hover_style) eina_stringshare_del(wd->hover_style);
|
||||
wd->hover_style = NULL;
|
||||
if (style) wd->hover_style = eina_stringshare_add(style);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the hover popup in the anchorview
|
||||
|
|
|
@ -3,20 +3,20 @@
|
|||
|
||||
/**
|
||||
* @defgroup Hoversel
|
||||
*
|
||||
*
|
||||
* A hoversel is a button that pops up a list of items (automatically
|
||||
* choosing the direction to display) that have a lable and/or an icon to
|
||||
* select from. It is a convenience widget to avoid the need to do all the
|
||||
* piecing together yourself. It is intended for a small numbr of items in
|
||||
* the hoversel menu (no more than 8), though is capable of many more.
|
||||
*
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
*
|
||||
* clicked - the user clicked the hoversel button and popped up the sel
|
||||
*
|
||||
*
|
||||
* selected - an item in the hoversel list is selected. event_info is the item
|
||||
* selected - Elm_Hoversel_Item
|
||||
*
|
||||
*
|
||||
* dismissed - the hover is dismissed
|
||||
*/
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
@ -60,9 +60,9 @@ _del_hook(Evas_Object *obj)
|
|||
elm_hoversel_hover_end(obj);
|
||||
EINA_LIST_FREE(wd->items, it)
|
||||
{
|
||||
eina_stringshare_del(it->label);
|
||||
eina_stringshare_del(it->icon_file);
|
||||
free(it);
|
||||
eina_stringshare_del(it->label);
|
||||
eina_stringshare_del(it->icon_file);
|
||||
free(it);
|
||||
}
|
||||
free(wd);
|
||||
}
|
||||
|
@ -122,25 +122,25 @@ _activate(Evas_Object *obj)
|
|||
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
bt = elm_button_add(wd->hover);
|
||||
elm_button_style_set(bt, "hoversel_vertical_entry");
|
||||
elm_button_label_set(bt, it->label);
|
||||
if (it->icon_file)
|
||||
{
|
||||
ic = elm_icon_add(obj);
|
||||
elm_icon_scale_set(ic, 0, 1);
|
||||
if (it->icon_type == ELM_ICON_FILE)
|
||||
elm_icon_file_set(ic, it->icon_file, NULL);
|
||||
else if (it->icon_type == ELM_ICON_STANDARD)
|
||||
elm_icon_standard_set(ic, it->icon_file);
|
||||
elm_button_icon_set(bt, ic);
|
||||
evas_object_show(ic);
|
||||
}
|
||||
evas_object_size_hint_weight_set(bt, 1.0, 0.0);
|
||||
evas_object_size_hint_align_set(bt, -1.0, -1.0);
|
||||
elm_box_pack_end(bx, bt);
|
||||
evas_object_smart_callback_add(bt, "clicked", _item_clicked, it);
|
||||
evas_object_show(bt);
|
||||
bt = elm_button_add(wd->hover);
|
||||
elm_button_style_set(bt, "hoversel_vertical_entry");
|
||||
elm_button_label_set(bt, it->label);
|
||||
if (it->icon_file)
|
||||
{
|
||||
ic = elm_icon_add(obj);
|
||||
elm_icon_scale_set(ic, 0, 1);
|
||||
if (it->icon_type == ELM_ICON_FILE)
|
||||
elm_icon_file_set(ic, it->icon_file, NULL);
|
||||
else if (it->icon_type == ELM_ICON_STANDARD)
|
||||
elm_icon_standard_set(ic, it->icon_file);
|
||||
elm_button_icon_set(bt, ic);
|
||||
evas_object_show(ic);
|
||||
}
|
||||
evas_object_size_hint_weight_set(bt, 1.0, 0.0);
|
||||
evas_object_size_hint_align_set(bt, -1.0, -1.0);
|
||||
elm_box_pack_end(bx, bt);
|
||||
evas_object_smart_callback_add(bt, "clicked", _item_clicked, it);
|
||||
evas_object_show(bt);
|
||||
}
|
||||
|
||||
elm_hover_content_set
|
||||
|
@ -148,7 +148,7 @@ _activate(Evas_Object *obj)
|
|||
elm_hover_best_content_location_get(wd->hover, ELM_HOVER_AXIS_VERTICAL),
|
||||
bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
|
||||
evas_object_show(wd->hover);
|
||||
evas_object_smart_callback_call(obj, "clicked", NULL);
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ _activate(Evas_Object *obj)
|
|||
static void
|
||||
_button_clicked(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
_activate(data);
|
||||
_activate(data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -181,7 +181,7 @@ elm_hoversel_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -190,7 +190,7 @@ elm_hoversel_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_pre_hook_set(obj, _del_pre_hook);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
|
||||
|
||||
wd->btn = elm_button_add(parent);
|
||||
elm_button_style_set(wd->btn, "hoversel_vertical");
|
||||
elm_widget_resize_object_set(obj, wd->btn);
|
||||
|
@ -203,7 +203,7 @@ elm_hoversel_add(Evas_Object *parent)
|
|||
|
||||
/**
|
||||
* Set the Hover parent
|
||||
*
|
||||
*
|
||||
* Sets the hover parent object. See Hover objects for more information.
|
||||
*
|
||||
* @param obj The hoversel object
|
||||
|
@ -225,7 +225,7 @@ elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
|||
|
||||
/**
|
||||
* Set the hoversel button label
|
||||
*
|
||||
*
|
||||
* This sets the label of the button that is always visible (before it is
|
||||
* clicked and expanded). Also see elm_button_label_set().
|
||||
*
|
||||
|
@ -244,7 +244,7 @@ elm_hoversel_label_set(Evas_Object *obj, const char *label)
|
|||
|
||||
/**
|
||||
* Set the icon of the hoversel button
|
||||
*
|
||||
*
|
||||
* Sets the icon of the button that is always visible (before it is clicked
|
||||
* and expanded). Also see elm_button_icon_set().
|
||||
*
|
||||
|
@ -263,7 +263,7 @@ elm_hoversel_icon_set(Evas_Object *obj, Evas_Object *icon)
|
|||
|
||||
/**
|
||||
* Trigger the hoversel popup from code
|
||||
*
|
||||
*
|
||||
* This makes the hoversel popup activate with the items added being listed.
|
||||
*
|
||||
* @param obj The hoversel object
|
||||
|
@ -281,7 +281,7 @@ elm_hoversel_hover_begin(Evas_Object *obj)
|
|||
|
||||
/**
|
||||
* This ends the hoversel popup.
|
||||
*
|
||||
*
|
||||
* This will close the hoversel popup, making it disappear, if it was active.
|
||||
*
|
||||
* @param obj The hoversel object
|
||||
|
@ -295,15 +295,15 @@ elm_hoversel_hover_end(Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
if (wd->hover)
|
||||
{
|
||||
evas_object_del(wd->hover);
|
||||
wd->hover = NULL;
|
||||
evas_object_smart_callback_call(obj, "dismissed", NULL);
|
||||
evas_object_del(wd->hover);
|
||||
wd->hover = NULL;
|
||||
evas_object_smart_callback_call(obj, "dismissed", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an item to the hoversel button
|
||||
*
|
||||
*
|
||||
* This adds an item to the hoversel to show when it is clicked
|
||||
*
|
||||
* @param obj The hoversel object
|
||||
|
@ -336,7 +336,7 @@ elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file
|
|||
|
||||
/**
|
||||
* Delete an item from the hoversel
|
||||
*
|
||||
*
|
||||
* This deletes the item from the hoversel (should not be called while the
|
||||
* hoversel is active).
|
||||
*
|
||||
|
@ -358,7 +358,7 @@ elm_hoversel_item_del(Elm_Hoversel_Item *it)
|
|||
|
||||
/**
|
||||
* Get the data pointer passed to the item add function
|
||||
*
|
||||
*
|
||||
* This returns the data pointer supplied with elm_hoversel_item_add() that
|
||||
* will be passed to the select function callback.
|
||||
*
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
*
|
||||
* The notepad is an object for quickly loading a text file, displaying it,
|
||||
* allowing editing of it and saving of changes back to the file loaded.
|
||||
*
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
*
|
||||
* NONE
|
||||
*
|
||||
*
|
||||
* A notepad object contains a scroller and an entry. It is a convenience
|
||||
* widget that loads a text file indicated, puts it int he scrollable entry
|
||||
* and allows the user to edit it. Changes are written back to the original
|
||||
* file after a short delay. The file to load and save to is specificed by
|
||||
* elm_notepad_file_set().
|
||||
*/
|
||||
*/
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
||||
struct _Widget_Data
|
||||
|
@ -52,7 +52,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
}
|
||||
|
@ -88,13 +88,13 @@ _load_file(const char *file)
|
|||
size_t size;
|
||||
int alloc = 0, len = 0;
|
||||
char *text = NULL, buf[4096];
|
||||
|
||||
|
||||
f = fopen(file, "rb");
|
||||
if (!f) return NULL;
|
||||
while ((size = fread(buf, 1, sizeof(buf), f)))
|
||||
{
|
||||
buf[size] = 0;
|
||||
text = _buf_append(text, buf, &len, &alloc);
|
||||
text = _buf_append(text, buf, &len, &alloc);
|
||||
}
|
||||
fclose(f);
|
||||
return text;
|
||||
|
@ -104,13 +104,13 @@ static char *
|
|||
_load_plain(const char *file)
|
||||
{
|
||||
char *text, *text2;
|
||||
|
||||
|
||||
text = _load_file(file);
|
||||
if (text)
|
||||
{
|
||||
text2 = elm_entry_utf8_to_markup(text);
|
||||
free(text);
|
||||
return text2;
|
||||
text2 = elm_entry_utf8_to_markup(text);
|
||||
free(text);
|
||||
return text2;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ _load(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
char *text;
|
||||
|
||||
|
||||
if (!wd->file)
|
||||
{
|
||||
elm_entry_entry_set(wd->entry, "");
|
||||
|
@ -171,12 +171,12 @@ static void
|
|||
_save_plain_utf8(const char *file, const char *text)
|
||||
{
|
||||
char *text2;
|
||||
|
||||
|
||||
text2 = elm_entry_markup_to_utf8(text);
|
||||
if (text2)
|
||||
{
|
||||
_save_markup_utf8(file, text2);
|
||||
free(text2);
|
||||
_save_markup_utf8(file, text2);
|
||||
free(text2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ _save(Evas_Object *obj)
|
|||
switch (wd->format)
|
||||
{
|
||||
case ELM_TEXT_FORMAT_PLAIN_UTF8:
|
||||
_save_plain_utf8(wd->file, elm_entry_entry_get(wd->entry));
|
||||
_save_plain_utf8(wd->file, elm_entry_entry_get(wd->entry));
|
||||
break;
|
||||
case ELM_TEXT_FORMAT_MARKUP_UTF8:
|
||||
_save_markup_utf8(wd->file, elm_entry_entry_get(wd->entry));
|
||||
|
@ -219,7 +219,7 @@ _entry_changed(void *data, Evas_Object *obj, void *event_info)
|
|||
if (!wd->auto_write) return;
|
||||
wd->delay_write = ecore_timer_add(2.0, _delay_write, data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add a new notepad to the parent
|
||||
*
|
||||
|
@ -234,7 +234,7 @@ elm_notepad_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -244,7 +244,7 @@ elm_notepad_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_can_focus_set(obj, 1);
|
||||
|
||||
|
||||
wd->scroller = elm_scroller_add(parent);
|
||||
elm_widget_resize_object_set(obj, wd->scroller);
|
||||
wd->entry = elm_entry_add(parent);
|
||||
|
@ -255,23 +255,23 @@ elm_notepad_add(Evas_Object *parent)
|
|||
|
||||
elm_entry_entry_set(wd->entry, "");
|
||||
evas_object_smart_callback_add(wd->entry, "changed", _entry_changed, obj);
|
||||
|
||||
|
||||
wd->auto_write = EINA_TRUE;
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the file to load text from and save text back to
|
||||
*
|
||||
*
|
||||
* @param obj The notepad object
|
||||
* @param file The path to the file to load and save
|
||||
* @param format The file format
|
||||
*
|
||||
*
|
||||
* This sets the file (and implicitly loads it) for the text to display and
|
||||
* then edit. All changes are written back to the file after a short delay.
|
||||
*
|
||||
*
|
||||
* @ingroup Notepad
|
||||
*/
|
||||
EAPI void
|
||||
|
|
|
@ -72,7 +72,7 @@ elm_bg_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -82,10 +82,10 @@ elm_bg_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_can_focus_set(obj, 0);
|
||||
|
||||
|
||||
wd->img = edje_object_add(e);
|
||||
_elm_theme_set(wd->img, "bg", "base", "default");
|
||||
elm_widget_resize_object_set(obj, wd->img);
|
||||
elm_widget_resize_object_set(obj, wd->img);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ elm_bg_add(Evas_Object *parent)
|
|||
* @param obj The bg object
|
||||
* @param file The file path
|
||||
* @param group Optional key (group in Edje) within the file
|
||||
*
|
||||
*
|
||||
* This sets the image file used in the background object. The image (or edje)
|
||||
* will be stretched (retaining aspect if its an image file) to completely fill
|
||||
* the bg object. This may mean some parts arte not visible.
|
||||
|
@ -107,7 +107,7 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
const char *p;
|
||||
|
||||
|
||||
if (wd->custom_img)
|
||||
{
|
||||
evas_object_del(wd->custom_img);
|
||||
|
@ -125,7 +125,7 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
|
|||
wd->custom_img = edje_object_add(evas_object_evas_get(wd->img));
|
||||
edje_object_file_set(wd->custom_img, file, group);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
wd->custom_img = evas_object_image_add(evas_object_evas_get(wd->img));
|
||||
evas_object_event_callback_add(wd->custom_img, EVAS_CALLBACK_RESIZE, _custom_resize, wd);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* will set the packing weight. The weights of all items being packed are added
|
||||
* up and if items are to be sized up to fit, those with the higher weights get
|
||||
* proportionally more space.
|
||||
*
|
||||
*
|
||||
*/
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
||||
|
@ -86,7 +86,7 @@ elm_box_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -94,20 +94,20 @@ elm_box_add(Evas_Object *parent)
|
|||
elm_widget_sub_object_add(parent, obj);
|
||||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
|
||||
|
||||
wd->box = _els_smart_box_add(e);
|
||||
evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
elm_widget_resize_object_set(obj, wd->box);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the horizontal orientation
|
||||
*
|
||||
*
|
||||
* By default box object arrange their contents vertically from top to bottom.
|
||||
* By calling this and providing @p orizontal as true, the box will become
|
||||
* horizontal arranging contents left to right.
|
||||
|
@ -126,7 +126,7 @@ elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
|||
|
||||
/**
|
||||
* Set homogenous layout
|
||||
*
|
||||
*
|
||||
* If enabled, homogenous layout makes all items the same size. This size is
|
||||
* of course governed by the size of the largest item in the box.
|
||||
*
|
||||
|
@ -147,10 +147,10 @@ elm_box_homogenous_set(Evas_Object *obj, Eina_Bool homogenous)
|
|||
*
|
||||
* This will add the @p subobj to the box object indicated at the beginning
|
||||
* of the box (the left or top end).
|
||||
*
|
||||
*
|
||||
* @param obj The box object
|
||||
* @param subobj The object to add to the box
|
||||
*
|
||||
*
|
||||
* @ingroup Box
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -166,10 +166,10 @@ elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj)
|
|||
*
|
||||
* This will add the @p subobj to the box object indicated at the end
|
||||
* of the box (the right or bottom end).
|
||||
*
|
||||
*
|
||||
* @param obj The box object
|
||||
* @param subobj The object to add to the box
|
||||
*
|
||||
*
|
||||
* @ingroup Box
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -187,7 +187,7 @@ elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj)
|
|||
* indicated with @p before. If @p before is not already in the box, results
|
||||
* are undefined. Before means either to the left of the indicated object or
|
||||
* above it depending on orientation.
|
||||
*
|
||||
*
|
||||
* @param obj The box object
|
||||
* @param subobj The object to add to the box
|
||||
* @param before The object before which to add it
|
||||
|
@ -209,7 +209,7 @@ elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before)
|
|||
* indicated with @p after. If @p after is not already in the box, results
|
||||
* are undefined. After means either to the right of the indicated object or
|
||||
* below it depending on orientation.
|
||||
*
|
||||
*
|
||||
* @param obj The box object
|
||||
* @param subobj The object to add to the box
|
||||
* @param after The object after which to add it
|
||||
|
|
|
@ -41,7 +41,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
edje_object_size_min_calc(wd->bbl, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
|
@ -85,7 +85,7 @@ elm_bubble_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -94,13 +94,13 @@ elm_bubble_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->bbl = edje_object_add(e);
|
||||
_elm_theme_set(wd->bbl, "bubble", "base", "default");
|
||||
elm_widget_resize_object_set(obj, wd->bbl);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ EAPI void
|
|||
elm_bubble_corner_set(Evas_Object *obj, const char *corner)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
||||
|
||||
_elm_theme_set(wd->bbl, "bubble", corner, elm_widget_style_get(obj));
|
||||
if (wd->icon)
|
||||
edje_object_part_swallow(wd->bbl, "elm.swallow.icon", wd->icon);
|
||||
|
|
|
@ -54,7 +54,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
edje_object_size_min_restricted_calc(wd->btn, &minw, &minh, minw, minh);
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
|
@ -84,7 +84,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
wd->icon = NULL;
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ elm_button_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -112,14 +112,14 @@ elm_button_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->btn = edje_object_add(e);
|
||||
_elm_theme_set(wd->btn, "button", "base", "default");
|
||||
edje_object_signal_callback_add(wd->btn, "elm,action,click", "", _signal_clicked, obj);
|
||||
elm_widget_resize_object_set(obj, wd->btn);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -134,13 +134,13 @@ elm_button_label_set(Evas_Object *obj, const char *label)
|
|||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->btn, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->btn, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
}
|
||||
|
@ -157,13 +157,13 @@ elm_button_icon_set(Evas_Object *obj, Evas_Object *icon)
|
|||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
if ((icon) && (wd->icon != icon))
|
||||
{
|
||||
wd->icon = icon;
|
||||
wd->icon = icon;
|
||||
elm_widget_sub_object_add(obj, icon);
|
||||
edje_object_part_swallow(wd->btn, "elm.swallow.content", icon);
|
||||
edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm");
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
edje_object_message_signal_process(wd->btn);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -32,7 +32,7 @@ _item_show(Elm_Carousel_Item *it)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||
Evas_Coord x, y, w, h, bx, by;
|
||||
|
||||
|
||||
evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL);
|
||||
evas_object_geometry_get(it->base, &x, &y, &w, &h);
|
||||
elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h);
|
||||
|
@ -48,12 +48,12 @@ _item_select(Elm_Carousel_Item *it)
|
|||
if (it->selected) return;
|
||||
EINA_LIST_FOREACH(wd->items, l, it2)
|
||||
{
|
||||
if (it2->selected)
|
||||
{
|
||||
it2->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(it2->base, "elm,state,unselected", "elm");
|
||||
break;
|
||||
}
|
||||
if (it2->selected)
|
||||
{
|
||||
it2->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(it2->base, "elm,state,unselected", "elm");
|
||||
break;
|
||||
}
|
||||
}
|
||||
it->selected = EINA_TRUE;
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
|
@ -79,21 +79,21 @@ _theme_hook(Evas_Object *obj)
|
|||
Evas_Coord mw, mh;
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
if (it->selected)
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
_elm_theme_set(it->base, "carousel", "item", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
if (it->icon)
|
||||
{
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
edje_object_size_min_calc(it->base, &mw, &mh);
|
||||
evas_object_size_hint_min_set(it->base, mw, mh);
|
||||
evas_object_size_hint_max_set(it->base, 9999, mh);
|
||||
if (it->selected)
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
_elm_theme_set(it->base, "carousel", "item", elm_widget_style_get(obj));
|
||||
edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
if (it->icon)
|
||||
{
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
edje_object_size_min_calc(it->base, &mw, &mh);
|
||||
evas_object_size_hint_min_set(it->base, mw, mh);
|
||||
evas_object_size_hint_max_set(it->base, 9999, mh);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -123,23 +123,23 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
Evas_Coord mw, mh, vw, vh, w, h;
|
||||
const Eina_List *l;
|
||||
Elm_Carousel_Item *it;
|
||||
|
||||
|
||||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||
evas_object_size_hint_min_get(wd->bx, &mw, &mh);
|
||||
evas_object_geometry_get(wd->bx, NULL, NULL, &w, &h);
|
||||
if (vw >= mw)
|
||||
{
|
||||
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
||||
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
||||
}
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
if (it->selected)
|
||||
{
|
||||
_item_show(it);
|
||||
break;
|
||||
}
|
||||
if (it->selected)
|
||||
{
|
||||
_item_show(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -154,7 +154,7 @@ elm_carousel_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -164,16 +164,16 @@ elm_carousel_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_can_focus_set(obj, 0);
|
||||
|
||||
|
||||
wd->scr = elm_smart_scroller_add(e);
|
||||
elm_smart_scroller_theme_set(wd->scr, "carousel", "base", "default");
|
||||
elm_widget_resize_object_set(obj, wd->scr);
|
||||
elm_smart_scroller_policy_set(wd->scr,
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF);
|
||||
|
||||
elm_smart_scroller_policy_set(wd->scr,
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF);
|
||||
|
||||
wd->icon_size = 32;
|
||||
|
||||
|
||||
wd->bx = _els_smart_box_add(e);
|
||||
_els_smart_box_orientation_set(wd->bx, 1);
|
||||
_els_smart_box_homogenous_set(wd->bx, 1);
|
||||
|
@ -182,8 +182,8 @@ elm_carousel_add(Evas_Object *parent)
|
|||
evas_object_show(wd->bx);
|
||||
|
||||
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE,
|
||||
_resize, obj);
|
||||
|
||||
_resize, obj);
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -204,16 +204,16 @@ elm_carousel_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, vo
|
|||
it->base = edje_object_add(evas_object_evas_get(obj));
|
||||
_elm_theme_set(it->base, "carousel", "item", elm_widget_style_get(obj));
|
||||
edje_object_signal_callback_add(it->base, "elm,action,click", "elm",
|
||||
_select, it);
|
||||
_select, it);
|
||||
elm_widget_sub_object_add(obj, it->base);
|
||||
if (it->icon)
|
||||
{
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
evas_object_show(it->icon);
|
||||
elm_widget_sub_object_add(obj, it->icon);
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
evas_object_show(it->icon);
|
||||
elm_widget_sub_object_add(obj, it->icon);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
edje_object_size_min_calc(it->base, &mw, &mh);
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
|
||||
/**
|
||||
* @defgroup Check Check
|
||||
*
|
||||
*
|
||||
* The check widget allows for toggling a value between true or false (1 or 0).
|
||||
*
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
*
|
||||
* changed - This is called whenever the user changes the state of one of the
|
||||
* check object.
|
||||
*
|
||||
* Check objects are a lot like radio objects in layout and functionality
|
||||
*
|
||||
* Check objects are a lot like radio objects in layout and functionality
|
||||
* except they do not work as a group, but independently and only toggle the
|
||||
* value of a boolean from false to true (0 or 1). elm_check_state_set() sets
|
||||
* the boolean state (1 for true, 0 for false), and elm_check_state_get()
|
||||
* returns the current state. For convenience, like the radio objects, you
|
||||
* can set a pointer to a boolean directly with elm_check_state_pointer_set()
|
||||
* for it to modify.
|
||||
*/
|
||||
*/
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
||||
struct _Widget_Data
|
||||
|
@ -75,7 +75,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
edje_object_size_min_restricted_calc(wd->chk, &minw, &minh, minw, minh);
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
|
@ -156,7 +156,7 @@ elm_check_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -165,7 +165,7 @@ elm_check_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->chk = edje_object_add(e);
|
||||
_elm_theme_set(wd->chk, "check", "base", "default");
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,check,on", "", _signal_check_on, obj);
|
||||
|
@ -174,7 +174,7 @@ elm_check_add(Evas_Object *parent)
|
|||
elm_widget_resize_object_set(obj, wd->chk);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -196,13 +196,13 @@ elm_check_label_set(Evas_Object *obj, const char *label)
|
|||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ elm_check_label_set(Evas_Object *obj, const char *label)
|
|||
* be deleted when the check object is deleted. If another icon object is set
|
||||
* then the previous one becomes orophaned and will no longer be deleted along
|
||||
* with the check.
|
||||
*
|
||||
*
|
||||
* @param obj The check object
|
||||
* @param icon The icon object
|
||||
*
|
||||
|
@ -246,7 +246,7 @@ elm_check_icon_set(Evas_Object *obj, Evas_Object *icon)
|
|||
*
|
||||
* This sets the state of the check and will also set the value if pointed to
|
||||
* to the state supplied, but will not call any callbacks.
|
||||
*
|
||||
*
|
||||
* @param obj The check object
|
||||
* @param state The state to use (1 == on, 0 == off)
|
||||
*
|
||||
|
@ -284,7 +284,7 @@ elm_check_state_get(const Evas_Object *obj)
|
|||
|
||||
/**
|
||||
* Set a convenience pointer to a boolean to change
|
||||
*
|
||||
*
|
||||
* This sets a pointer to a boolean, that, in addition to the check objects
|
||||
* state will also be modified directly. To stop setting the object pointed
|
||||
* to simply use NULL as the statep parameter. If statep is not NULL, then
|
||||
|
@ -316,6 +316,6 @@ elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
|
|||
}
|
||||
else
|
||||
{
|
||||
wd->statep = NULL;
|
||||
wd->statep = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ _time_update(Evas_Object *obj)
|
|||
evas_object_del(wd->ampm);
|
||||
wd->ampm = NULL;
|
||||
}
|
||||
|
||||
|
||||
if ((wd->seconds) && (wd->am_pm))
|
||||
_elm_theme_set(wd->clk, "clock", "base-all", style);
|
||||
else if (wd->seconds)
|
||||
|
@ -206,8 +206,8 @@ _time_update(Evas_Object *obj)
|
|||
_elm_theme_set(wd->clk, "clock", "base-am_pm", style);
|
||||
else
|
||||
_elm_theme_set(wd->clk, "clock", "base", style);
|
||||
edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
|
||||
edje_object_scale_set(wd->clk, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
char buf[16];
|
||||
|
@ -215,17 +215,17 @@ _time_update(Evas_Object *obj)
|
|||
if ((!wd->seconds) && (i >= 4)) break;
|
||||
wd->digit[i] = edje_object_add(evas_object_evas_get(wd->clk));
|
||||
_elm_theme_set(wd->digit[i], "clock", "flipdigit", style);
|
||||
edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_scale_set(wd->digit[i], elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
if (wd->edit)
|
||||
edje_object_signal_emit(wd->digit[i], "elm,state,edit,on", "elm");
|
||||
edje_object_signal_callback_add(wd->digit[i], "elm,action,up", "",
|
||||
_signal_clock_val_up, obj);
|
||||
edje_object_signal_callback_add(wd->digit[i], "elm,action,down", "",
|
||||
_signal_clock_val_down, obj);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
edje_object_size_min_restricted_calc(wd->digit[i], &mw, &mh, mw, mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
edje_extern_object_min_size_set(wd->digit[i], mw, mh);
|
||||
snprintf(buf, sizeof(buf), "d%i", i);
|
||||
edje_object_part_swallow(wd->clk , buf, wd->digit[i]);
|
||||
|
@ -235,22 +235,22 @@ _time_update(Evas_Object *obj)
|
|||
{
|
||||
wd->ampm = edje_object_add(evas_object_evas_get(wd->clk));
|
||||
_elm_theme_set(wd->ampm, "clock", "flipampm", style);
|
||||
edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_scale_set(wd->ampm, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
if (wd->edit)
|
||||
edje_object_signal_emit(wd->ampm, "elm,state,edit,on", "elm");
|
||||
edje_object_signal_callback_add(wd->ampm, "elm,action,up", "",
|
||||
_signal_clock_val_up, obj);
|
||||
edje_object_signal_callback_add(wd->ampm, "elm,action,down", "",
|
||||
_signal_clock_val_down, obj);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
edje_object_size_min_restricted_calc(wd->ampm, &mw, &mh, mw, mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 2, &mh);
|
||||
edje_extern_object_min_size_set(wd->ampm, mw, mh);
|
||||
edje_object_part_swallow(wd->clk , "ampm", wd->ampm);
|
||||
evas_object_show(wd->ampm);
|
||||
}
|
||||
|
||||
|
||||
edje_object_size_min_calc(wd->clk, &mw, &mh);
|
||||
evas_object_size_hint_min_set(obj, mw, mh);
|
||||
|
||||
|
@ -296,7 +296,7 @@ _time_update(Evas_Object *obj)
|
|||
if (wd->min != wd->cur.min)
|
||||
{
|
||||
int d1, d2, dc1, dc2;
|
||||
|
||||
|
||||
d1 = wd->min / 10;
|
||||
d2 = wd->min % 10;
|
||||
dc1 = wd->cur.min / 10;
|
||||
|
@ -318,7 +318,7 @@ _time_update(Evas_Object *obj)
|
|||
if (wd->sec != wd->cur.sec)
|
||||
{
|
||||
int d1, d2, dc1, dc2;
|
||||
|
||||
|
||||
d1 = wd->sec / 10;
|
||||
d2 = wd->sec % 10;
|
||||
dc1 = wd->cur.sec / 10;
|
||||
|
@ -337,15 +337,15 @@ _time_update(Evas_Object *obj)
|
|||
}
|
||||
}
|
||||
else
|
||||
wd->cur.sec = -1;
|
||||
|
||||
wd->cur.sec = -1;
|
||||
|
||||
if (wd->am_pm)
|
||||
{
|
||||
if (wd->hrs >= 12) ampm = 1;
|
||||
if (ampm != wd->cur.ampm)
|
||||
{
|
||||
int d1, d2, dc1, dc2;
|
||||
|
||||
|
||||
if (wd->cur.ampm != ampm)
|
||||
{
|
||||
msg.val = ampm;
|
||||
|
@ -364,7 +364,7 @@ elm_clock_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -373,7 +373,7 @@ elm_clock_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->clk = edje_object_add(e);
|
||||
elm_widget_resize_object_set(obj, wd->clk);
|
||||
|
||||
|
@ -381,10 +381,10 @@ elm_clock_add(Evas_Object *parent)
|
|||
wd->cur.seconds = EINA_TRUE;
|
||||
wd->cur.am_pm = EINA_TRUE;
|
||||
wd->cur.edit = EINA_TRUE;
|
||||
|
||||
|
||||
_time_update(obj);
|
||||
_ticker(obj);
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ struct _Widget_Data
|
|||
Evas_Object *ent;
|
||||
Evas_Object *hoversel;
|
||||
Ecore_Job *deferred_recalc_job;
|
||||
Ecore_Event_Handler *sel_notify_handler;
|
||||
Ecore_Event_Handler *sel_notify_handler;
|
||||
Ecore_Event_Handler *sel_clear_handler;
|
||||
Ecore_Timer *longpress_timer;
|
||||
const char *cut_sel;
|
||||
|
@ -51,7 +51,7 @@ _del_hook(Evas_Object *obj)
|
|||
#ifdef HAVE_ELEMENTARY_X
|
||||
ecore_event_handler_del(wd->sel_notify_handler);
|
||||
ecore_event_handler_del(wd->sel_clear_handler);
|
||||
#endif
|
||||
#endif
|
||||
if (wd->cut_sel) eina_stringshare_del(wd->cut_sel);
|
||||
if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
|
||||
if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
|
||||
|
@ -77,7 +77,7 @@ _elm_win_recalc_job(void *data)
|
|||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
Evas_Coord resw, resh, minminw;
|
||||
|
||||
|
||||
wd->deferred_recalc_job = NULL;
|
||||
evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh);
|
||||
resh = 0;
|
||||
|
@ -124,15 +124,15 @@ _on_focus_hook(void *data, Evas_Object *obj)
|
|||
if (!wd->editable) return;
|
||||
if (elm_widget_focus_get(obj))
|
||||
{
|
||||
evas_object_focus_set(wd->ent, 1);
|
||||
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
|
||||
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
|
||||
evas_object_focus_set(wd->ent, 1);
|
||||
edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
|
||||
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
|
||||
evas_object_focus_set(wd->ent, 0);
|
||||
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
|
||||
edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
|
||||
evas_object_focus_set(wd->ent, 0);
|
||||
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,18 +142,18 @@ _hoversel_position(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord cx, cy, cw, ch, x, y, mw, mh;
|
||||
evas_object_geometry_get(wd->ent, &x, &y, NULL, NULL);
|
||||
edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
|
||||
&cx, &cy, &cw, &ch);
|
||||
edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
|
||||
&cx, &cy, &cw, &ch);
|
||||
evas_object_size_hint_min_get(wd->hoversel, &mw, &mh);
|
||||
if (cw < mw)
|
||||
{
|
||||
cx += (cw - mw) / 2;
|
||||
cw = mw;
|
||||
cx += (cw - mw) / 2;
|
||||
cw = mw;
|
||||
}
|
||||
if (ch < mh)
|
||||
{
|
||||
cy += (ch - mh) / 2;
|
||||
ch = mh;
|
||||
cy += (ch - mh) / 2;
|
||||
ch = mh;
|
||||
}
|
||||
evas_object_move(wd->hoversel, x + cx, y + cy);
|
||||
evas_object_resize(wd->hoversel, cw, ch);
|
||||
|
@ -205,17 +205,17 @@ _paste(void *data, Evas_Object *obj, void *event_info)
|
|||
if (wd->sel_notify_handler)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
ecore_x_selection_primary_request
|
||||
(elm_win_xwindow_get(top),
|
||||
ECORE_X_SELECTION_TARGET_UTF8_STRING);
|
||||
wd->selection_asked = EINA_TRUE;
|
||||
}
|
||||
#endif
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
ecore_x_selection_primary_request
|
||||
(elm_win_xwindow_get(top),
|
||||
ECORE_X_SELECTION_TARGET_UTF8_STRING);
|
||||
wd->selection_asked = EINA_TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,20 +278,20 @@ _long_press(void *data)
|
|||
evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, data);
|
||||
if (!wd->selmode)
|
||||
{
|
||||
elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE, _select, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE, _paste, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE, _select, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE, _paste, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE, _copy, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE, _cut, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE, _cancel, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE, _copy, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE, _cut, data);
|
||||
elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE, _cancel, data);
|
||||
}
|
||||
if (wd->hoversel)
|
||||
{
|
||||
_hoversel_position(data);
|
||||
evas_object_show(wd->hoversel);
|
||||
elm_hoversel_hover_begin(wd->hoversel);
|
||||
_hoversel_position(data);
|
||||
evas_object_show(wd->hoversel);
|
||||
elm_hoversel_hover_begin(wd->hoversel);
|
||||
}
|
||||
wd->longpress_timer = NULL;
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
|
||||
|
@ -322,9 +322,9 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
|||
if (ev->button != 1) return;
|
||||
if (wd->longpress_timer)
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -335,49 +335,49 @@ _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
|||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
if (!wd->selmode)
|
||||
{
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
{
|
||||
if (wd->longpress_timer)
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
}
|
||||
else if (wd->longpress_timer)
|
||||
{
|
||||
Evas_Coord dx, dy;
|
||||
|
||||
dx = wd->downx - ev->cur.canvas.x;
|
||||
dx *= dx;
|
||||
dy = wd->downy - ev->cur.canvas.y;
|
||||
dy *= dy;
|
||||
if ((dx + dy) >
|
||||
((_elm_config->finger_size / 2) *
|
||||
(_elm_config->finger_size / 2)))
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
}
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
{
|
||||
if (wd->longpress_timer)
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
}
|
||||
else if (wd->longpress_timer)
|
||||
{
|
||||
Evas_Coord dx, dy;
|
||||
|
||||
dx = wd->downx - ev->cur.canvas.x;
|
||||
dx *= dx;
|
||||
dy = wd->downy - ev->cur.canvas.y;
|
||||
dy *= dy;
|
||||
if ((dx + dy) >
|
||||
((_elm_config->finger_size / 2) *
|
||||
(_elm_config->finger_size / 2)))
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (wd->longpress_timer)
|
||||
{
|
||||
Evas_Coord dx, dy;
|
||||
|
||||
dx = wd->downx - ev->cur.canvas.x;
|
||||
dx *= dx;
|
||||
dy = wd->downy - ev->cur.canvas.y;
|
||||
dy *= dy;
|
||||
if ((dx + dy) >
|
||||
((_elm_config->finger_size / 2) *
|
||||
(_elm_config->finger_size / 2)))
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
Evas_Coord dx, dy;
|
||||
|
||||
dx = wd->downx - ev->cur.canvas.x;
|
||||
dx *= dx;
|
||||
dy = wd->downy - ev->cur.canvas.y;
|
||||
dy *= dy;
|
||||
if ((dx + dy) >
|
||||
((_elm_config->finger_size / 2) *
|
||||
(_elm_config->finger_size / 2)))
|
||||
{
|
||||
elm_widget_scroll_freeze_pop(data);
|
||||
ecore_timer_del(wd->longpress_timer);
|
||||
wd->longpress_timer = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,14 +421,14 @@ _str_append(char *str, const char *txt, int *len, int *alloc)
|
|||
if (txt_len <= 0) return str;
|
||||
if ((*len + txt_len) >= *alloc)
|
||||
{
|
||||
char *str2;
|
||||
int alloc2;
|
||||
|
||||
alloc2 = *alloc + txt_len + 128;
|
||||
str2 = realloc(str, alloc2);
|
||||
if (!str2) return str;
|
||||
*alloc = alloc2;
|
||||
str = str2;
|
||||
char *str2;
|
||||
int alloc2;
|
||||
|
||||
alloc2 = *alloc + txt_len + 128;
|
||||
str2 = realloc(str, alloc2);
|
||||
if (!str2) return str;
|
||||
*alloc = alloc2;
|
||||
str = str2;
|
||||
}
|
||||
strcpy(str + *len, txt);
|
||||
*len += txt_len;
|
||||
|
@ -442,121 +442,121 @@ _mkup_to_text(const char *mkup)
|
|||
int str_len = 0, str_alloc = 0;
|
||||
char *s, *p;
|
||||
char *tag_start, *tag_end, *esc_start, *esc_end, *ts;
|
||||
|
||||
|
||||
if (!mkup) return NULL;
|
||||
tag_start = tag_end = esc_start = esc_end = NULL;
|
||||
p = (char *)mkup;
|
||||
s = p;
|
||||
for (;;)
|
||||
{
|
||||
if ((*p == 0) ||
|
||||
(tag_end) || (esc_end) ||
|
||||
(tag_start) || (esc_start))
|
||||
{
|
||||
if (tag_end)
|
||||
{
|
||||
char *ttag, *match;
|
||||
|
||||
ttag = malloc(tag_end - tag_start);
|
||||
if (ttag)
|
||||
{
|
||||
strncpy(ttag, tag_start + 1, tag_end - tag_start - 1);
|
||||
ttag[tag_end - tag_start - 1] = 0;
|
||||
if (!strcmp(ttag, "br"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
free(ttag);
|
||||
}
|
||||
tag_start = tag_end = NULL;
|
||||
}
|
||||
else if (esc_end)
|
||||
{
|
||||
ts = malloc(esc_end - esc_start + 1);
|
||||
if (ts)
|
||||
{
|
||||
const char *esc;
|
||||
strncpy(ts, esc_start, esc_end - esc_start);
|
||||
ts[esc_end - esc_start] = 0;
|
||||
esc = evas_textblock_escape_string_get(ts);
|
||||
if (esc)
|
||||
str = _str_append(str, esc, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
esc_start = esc_end = NULL;
|
||||
}
|
||||
else if (*p == 0)
|
||||
{
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
strncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
if (*p == 0)
|
||||
break;
|
||||
}
|
||||
if (*p == '<')
|
||||
{
|
||||
if (!esc_start)
|
||||
{
|
||||
tag_start = p;
|
||||
tag_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
strncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == '>')
|
||||
{
|
||||
if (tag_start)
|
||||
{
|
||||
tag_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
else if (*p == '&')
|
||||
{
|
||||
if (!tag_start)
|
||||
{
|
||||
esc_start = p;
|
||||
esc_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
strncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == ';')
|
||||
{
|
||||
if (esc_start)
|
||||
{
|
||||
esc_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
if ((*p == 0) ||
|
||||
(tag_end) || (esc_end) ||
|
||||
(tag_start) || (esc_start))
|
||||
{
|
||||
if (tag_end)
|
||||
{
|
||||
char *ttag, *match;
|
||||
|
||||
ttag = malloc(tag_end - tag_start);
|
||||
if (ttag)
|
||||
{
|
||||
strncpy(ttag, tag_start + 1, tag_end - tag_start - 1);
|
||||
ttag[tag_end - tag_start - 1] = 0;
|
||||
if (!strcmp(ttag, "br"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\n"))
|
||||
str = _str_append(str, "\n", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
else if (!strcmp(ttag, "\\t"))
|
||||
str = _str_append(str, "\t", &str_len, &str_alloc);
|
||||
free(ttag);
|
||||
}
|
||||
tag_start = tag_end = NULL;
|
||||
}
|
||||
else if (esc_end)
|
||||
{
|
||||
ts = malloc(esc_end - esc_start + 1);
|
||||
if (ts)
|
||||
{
|
||||
const char *esc;
|
||||
strncpy(ts, esc_start, esc_end - esc_start);
|
||||
ts[esc_end - esc_start] = 0;
|
||||
esc = evas_textblock_escape_string_get(ts);
|
||||
if (esc)
|
||||
str = _str_append(str, esc, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
esc_start = esc_end = NULL;
|
||||
}
|
||||
else if (*p == 0)
|
||||
{
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
strncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
if (*p == 0)
|
||||
break;
|
||||
}
|
||||
if (*p == '<')
|
||||
{
|
||||
if (!esc_start)
|
||||
{
|
||||
tag_start = p;
|
||||
tag_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
strncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == '>')
|
||||
{
|
||||
if (tag_start)
|
||||
{
|
||||
tag_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
else if (*p == '&')
|
||||
{
|
||||
if (!tag_start)
|
||||
{
|
||||
esc_start = p;
|
||||
esc_end = NULL;
|
||||
ts = malloc(p - s + 1);
|
||||
if (ts)
|
||||
{
|
||||
strncpy(ts, s, p - s);
|
||||
ts[p - s] = 0;
|
||||
str = _str_append(str, ts, &str_len, &str_alloc);
|
||||
free(ts);
|
||||
}
|
||||
s = NULL;
|
||||
}
|
||||
}
|
||||
else if (*p == ';')
|
||||
{
|
||||
if (esc_start)
|
||||
{
|
||||
esc_end = p;
|
||||
s = p + 1;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
@ -567,27 +567,27 @@ _text_to_mkup(const char *text)
|
|||
char *str = NULL;
|
||||
int str_len = 0, str_alloc = 0;
|
||||
int ch, pos = 0, pos2 = 0;
|
||||
|
||||
|
||||
if (!text) return NULL;
|
||||
for (;;)
|
||||
{
|
||||
// FIXME: use evas_string_char_next_get()
|
||||
pos = pos2;
|
||||
ch = evas_common_font_utf8_get_next((unsigned char *)(text), &pos2);
|
||||
if (ch <= 0) break;
|
||||
if (ch == '\n') str = _str_append(str, "<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;
|
||||
}
|
||||
|
@ -609,26 +609,26 @@ _signal_selection_start(void *data, Evas_Object *obj, const char *emission, cons
|
|||
Evas_Object *entry;
|
||||
EINA_LIST_FOREACH(entries, l, entry)
|
||||
{
|
||||
if (entry != data) elm_entry_select_none(entry);
|
||||
if (entry != data) elm_entry_select_none(entry);
|
||||
}
|
||||
wd->have_selection = EINA_TRUE;
|
||||
evas_object_smart_callback_call(data, "selection,start", NULL);
|
||||
if (wd->sel_notify_handler)
|
||||
{
|
||||
char *txt = _mkup_to_text(elm_entry_selection_get(data));
|
||||
if (txt)
|
||||
{
|
||||
char *txt = _mkup_to_text(elm_entry_selection_get(data));
|
||||
if (txt)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_set
|
||||
(elm_win_xwindow_get(top), txt, strlen(txt));
|
||||
#endif
|
||||
free(txt);
|
||||
}
|
||||
}
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_set
|
||||
(elm_win_xwindow_get(top), txt, strlen(txt));
|
||||
#endif
|
||||
free(txt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -639,19 +639,19 @@ _signal_selection_changed(void *data, Evas_Object *obj, const char *emission, co
|
|||
evas_object_smart_callback_call(data, "selection,changed", NULL);
|
||||
if (wd->sel_notify_handler)
|
||||
{
|
||||
char *txt = _mkup_to_text(elm_entry_selection_get(data));
|
||||
if (txt)
|
||||
{
|
||||
char *txt = _mkup_to_text(elm_entry_selection_get(data));
|
||||
if (txt)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_set
|
||||
(elm_win_xwindow_get(top), txt, strlen(txt));
|
||||
#endif
|
||||
free(txt);
|
||||
}
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_set
|
||||
(elm_win_xwindow_get(top), txt, strlen(txt));
|
||||
#endif
|
||||
free(txt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -664,38 +664,38 @@ _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, co
|
|||
evas_object_smart_callback_call(data, "selection,cleared", NULL);
|
||||
if (wd->sel_notify_handler)
|
||||
{
|
||||
if (wd->cut_sel)
|
||||
{
|
||||
if (wd->cut_sel)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
char *t;
|
||||
|
||||
t = _mkup_to_text(wd->cut_sel);
|
||||
if (t)
|
||||
{
|
||||
ecore_x_selection_primary_set
|
||||
(elm_win_xwindow_get(top), t, strlen(t));
|
||||
free(t);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
eina_stringshare_del(wd->cut_sel);
|
||||
wd->cut_sel = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
char *t;
|
||||
|
||||
t = _mkup_to_text(wd->cut_sel);
|
||||
if (t)
|
||||
{
|
||||
ecore_x_selection_primary_set
|
||||
(elm_win_xwindow_get(top), t, strlen(t));
|
||||
free(t);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
eina_stringshare_del(wd->cut_sel);
|
||||
wd->cut_sel = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_clear();
|
||||
#endif
|
||||
}
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
ecore_x_selection_primary_clear();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -707,17 +707,17 @@ _signal_entry_paste_request(void *data, Evas_Object *obj, const char *emission,
|
|||
if (wd->sel_notify_handler)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
ecore_x_selection_primary_request
|
||||
(elm_win_xwindow_get(top),
|
||||
ECORE_X_SELECTION_TARGET_UTF8_STRING);
|
||||
wd->selection_asked = EINA_TRUE;
|
||||
}
|
||||
#endif
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(data);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
ecore_x_selection_primary_request
|
||||
(elm_win_xwindow_get(top),
|
||||
ECORE_X_SELECTION_TARGET_UTF8_STRING);
|
||||
wd->selection_asked = EINA_TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -739,8 +739,8 @@ _signal_entry_cut_notify(void *data, Evas_Object *obj, const char *emission, con
|
|||
txt = _mkup_to_text(elm_entry_selection_get(data));
|
||||
if (txt)
|
||||
{
|
||||
wd->cut_sel = eina_stringshare_add(txt);
|
||||
free(txt);
|
||||
wd->cut_sel = eina_stringshare_add(txt);
|
||||
free(txt);
|
||||
}
|
||||
edje_object_part_text_insert(wd->ent, "elm.text", "");
|
||||
wd->changed = EINA_TRUE;
|
||||
|
@ -758,11 +758,11 @@ _signal_cursor_changed(void *data, Evas_Object *obj, const char *emission, const
|
|||
elm_widget_show_region_set(data, cx, cy, cw, ch);
|
||||
else
|
||||
{
|
||||
wd->deferred_cur = EINA_TRUE;
|
||||
wd->cx = cx;
|
||||
wd->cy = cy;
|
||||
wd->cw = cw;
|
||||
wd->ch = ch;
|
||||
wd->deferred_cur = EINA_TRUE;
|
||||
wd->cx = cx;
|
||||
wd->cy = cy;
|
||||
wd->cw = cw;
|
||||
wd->ch = ch;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -783,7 +783,7 @@ _signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char
|
|||
if (p)
|
||||
{
|
||||
const Eina_List *geoms;
|
||||
|
||||
|
||||
n = p + 1;
|
||||
p2 = p -1;
|
||||
while (p2 >= emission)
|
||||
|
@ -809,7 +809,7 @@ _signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char
|
|||
evas_pointer_output_xy_get(evas_object_evas_get(wd->ent), &px, &py);
|
||||
EINA_LIST_FOREACH(geoms, l, r)
|
||||
{
|
||||
if (((r->x + x) <= px) && ((r->y + y) <= py) &&
|
||||
if (((r->x + x) <= px) && ((r->y + y) <= py) &&
|
||||
((r->x + x + r->w) > px) && ((r->y + y + r->h) > py))
|
||||
{
|
||||
ei.x = r->x + x;
|
||||
|
@ -859,26 +859,26 @@ _event_selection_notify(void *data, int type, void *event)
|
|||
if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
|
||||
(ev->selection == ECORE_X_SELECTION_PRIMARY))
|
||||
{
|
||||
Ecore_X_Selection_Data_Text *text_data;
|
||||
|
||||
text_data = ev->data;
|
||||
if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
|
||||
{
|
||||
if (text_data->text)
|
||||
{
|
||||
char *txt = _text_to_mkup(text_data->text);
|
||||
if (txt)
|
||||
{
|
||||
elm_entry_entry_insert(data, txt);
|
||||
free(txt);
|
||||
}
|
||||
}
|
||||
}
|
||||
wd->selection_asked = EINA_FALSE;
|
||||
Ecore_X_Selection_Data_Text *text_data;
|
||||
|
||||
text_data = ev->data;
|
||||
if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
|
||||
{
|
||||
if (text_data->text)
|
||||
{
|
||||
char *txt = _text_to_mkup(text_data->text);
|
||||
if (txt)
|
||||
{
|
||||
elm_entry_entry_insert(data, txt);
|
||||
free(txt);
|
||||
}
|
||||
}
|
||||
}
|
||||
wd->selection_asked = EINA_FALSE;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
_event_selection_clear(void *data, int type, void *event)
|
||||
{
|
||||
|
@ -888,7 +888,7 @@ _event_selection_clear(void *data, int type, void *event)
|
|||
if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
|
||||
(ev->selection == ECORE_X_SELECTION_PRIMARY))
|
||||
{
|
||||
elm_entry_select_none(data);
|
||||
elm_entry_select_none(data);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ elm_entry_add(Evas_Object *parent)
|
|||
Evas_Object *obj, *top;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -914,14 +914,14 @@ elm_entry_add(Evas_Object *parent)
|
|||
|
||||
wd->linewrap = EINA_TRUE;
|
||||
wd->editable = EINA_TRUE;
|
||||
|
||||
|
||||
wd->ent = edje_object_add(e);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOVE, _move, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_RESIZE, _resize, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_UP, _mouse_up, obj);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, obj);
|
||||
|
||||
|
||||
_elm_theme_set(wd->ent, "entry", "base", "default");
|
||||
edje_object_signal_callback_add(wd->ent, "entry,changed", "elm.text", _signal_entry_changed, obj);
|
||||
edje_object_signal_callback_add(wd->ent, "selection,start", "elm.text", _signal_selection_start, obj);
|
||||
|
@ -945,15 +945,15 @@ elm_entry_add(Evas_Object *parent)
|
|||
top = elm_widget_top_get(obj);
|
||||
if ((top) && (elm_win_xwindow_get(top)))
|
||||
{
|
||||
wd->sel_notify_handler =
|
||||
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
|
||||
_event_selection_notify, obj);
|
||||
wd->sel_clear_handler =
|
||||
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
|
||||
_event_selection_clear, obj);
|
||||
wd->sel_notify_handler =
|
||||
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
|
||||
_event_selection_notify, obj);
|
||||
wd->sel_clear_handler =
|
||||
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
|
||||
_event_selection_clear, obj);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
entries = eina_list_prepend(entries, obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -1004,7 +1004,7 @@ elm_entry_entry_set(Evas_Object *obj, const char *entry)
|
|||
EINA_LIST_FOREACH(an, l, anchor)
|
||||
printf("ANCHOR: %s\n", anchor);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
wd->changed = EINA_TRUE;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -1068,9 +1068,9 @@ elm_entry_select_none(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (wd->selmode)
|
||||
{
|
||||
wd->selmode = EINA_FALSE;
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
|
||||
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
|
||||
wd->selmode = EINA_FALSE;
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
|
||||
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
|
||||
}
|
||||
wd->have_selection = EINA_FALSE;
|
||||
edje_object_part_text_select_none(wd->ent, "elm.text");
|
||||
|
@ -1082,9 +1082,9 @@ elm_entry_select_all(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (wd->selmode)
|
||||
{
|
||||
wd->selmode = EINA_FALSE;
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
|
||||
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
|
||||
wd->selmode = EINA_FALSE;
|
||||
edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
|
||||
edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
|
||||
}
|
||||
wd->have_selection = EINA_TRUE;
|
||||
edje_object_part_text_select_all(wd->ent, "elm.text");
|
||||
|
|
|
@ -38,7 +38,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
edje_object_size_min_calc(wd->frm, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
|
@ -72,7 +72,7 @@ elm_frame_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -81,13 +81,13 @@ elm_frame_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->frm = edje_object_add(e);
|
||||
_elm_theme_set(wd->frm, "frame", "base", "default");
|
||||
elm_widget_resize_object_set(obj, wd->frm);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -78,7 +78,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0;
|
||||
|
||||
|
||||
if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h);
|
||||
if (wd->hov) evas_object_geometry_get(wd->hov, &x2, &y2, &w2, &h2);
|
||||
evas_object_move(wd->cov, x, y);
|
||||
|
@ -134,7 +134,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_hov_show_do(Evas_Object *obj)
|
||||
|
@ -152,7 +152,7 @@ _hov_show_do(Evas_Object *obj)
|
|||
char buf[1024];
|
||||
if (!strncmp(si->swallow, "elm.swallow.slot.", 17))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "elm,action,slot,%s,show",
|
||||
snprintf(buf, sizeof(buf), "elm,action,slot,%s,show",
|
||||
si->swallow + 17);
|
||||
edje_object_signal_emit(wd->cov, buf, "elm");
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ _hov_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
char buf[1024];
|
||||
if (!strncmp(si->swallow, "elm.swallow.slot.", 17))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide",
|
||||
snprintf(buf, sizeof(buf), "elm,action,slot,%s,hide",
|
||||
si->swallow + 17);
|
||||
edje_object_signal_emit(wd->cov, buf, "elm");
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ elm_hover_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -273,27 +273,27 @@ elm_hover_add(Evas_Object *parent)
|
|||
evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_RESIZE, _hov_resize, obj);
|
||||
evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_SHOW, _hov_show, obj);
|
||||
evas_object_event_callback_add(wd->hov, EVAS_CALLBACK_HIDE, _hov_hide, obj);
|
||||
|
||||
|
||||
wd->cov = edje_object_add(e);
|
||||
_elm_theme_set(wd->cov, "hover", "base", "default");
|
||||
elm_widget_sub_object_add(obj, wd->cov);
|
||||
edje_object_signal_callback_add(wd->cov, "elm,action,dismiss", "", _signal_dismiss, obj);
|
||||
|
||||
|
||||
wd->offset = evas_object_rectangle_add(e);
|
||||
evas_object_pass_events_set(wd->offset, 1);
|
||||
evas_object_color_set(wd->offset, 0, 0, 0, 0);
|
||||
elm_widget_sub_object_add(obj, wd->offset);
|
||||
|
||||
|
||||
wd->size = evas_object_rectangle_add(e);
|
||||
evas_object_pass_events_set(wd->size, 1);
|
||||
evas_object_color_set(wd->size, 0, 0, 0, 0);
|
||||
elm_widget_sub_object_add(obj, wd->size);
|
||||
|
||||
|
||||
edje_object_part_swallow(wd->cov, "elm.swallow.offset", wd->offset);
|
||||
edje_object_part_swallow(wd->cov, "elm.swallow.size", wd->size);
|
||||
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord x = 0, y = 0, w = 0, h = 0, x2 = 0, y2 = 0, w2 = 0, h2 = 0;
|
||||
Evas_Coord spc_l, spc_r, spc_t, spc_b;
|
||||
|
||||
|
||||
if (wd->parent) evas_object_geometry_get(wd->parent, &x, &y, &w, &h);
|
||||
if (wd->target) evas_object_geometry_get(wd->target, &x2, &y2, &w2, &h2);
|
||||
spc_l = x2 - x;
|
||||
|
@ -398,19 +398,19 @@ elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_
|
|||
if (spc_b < 0) spc_b = 0;
|
||||
if (pref_axis == ELM_HOVER_AXIS_HORIZONTAL)
|
||||
{
|
||||
if (spc_l < spc_r) return "right";
|
||||
else return "left";
|
||||
if (spc_l < spc_r) return "right";
|
||||
else return "left";
|
||||
}
|
||||
else if (pref_axis == ELM_HOVER_AXIS_VERTICAL)
|
||||
{
|
||||
if (spc_t < spc_b) return "bottom";
|
||||
else return "top";
|
||||
if (spc_t < spc_b) return "bottom";
|
||||
else return "top";
|
||||
}
|
||||
if (spc_l < spc_r)
|
||||
{
|
||||
if (spc_t > spc_r) return "top";
|
||||
else if (spc_b > spc_r) return "bottom";
|
||||
return "right";
|
||||
if (spc_t > spc_r) return "top";
|
||||
else if (spc_b > spc_r) return "bottom";
|
||||
return "right";
|
||||
}
|
||||
if (spc_t > spc_r) return "top";
|
||||
else if (spc_b > spc_r) return "bottom";
|
||||
|
|
|
@ -45,7 +45,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
int w, h;
|
||||
|
||||
|
||||
_els_smart_icon_size_get(wd->img, &w, &h);
|
||||
_els_smart_icon_scale_up_set(wd->img, wd->scale_up);
|
||||
_els_smart_icon_scale_down_set(wd->img, wd->scale_down);
|
||||
|
@ -54,8 +54,8 @@ _sizing_eval(Evas_Object *obj)
|
|||
if (wd->no_scale) _els_smart_icon_scale_set(wd->img, 1.0);
|
||||
else
|
||||
{
|
||||
_els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) *
|
||||
_elm_config->scale);
|
||||
_els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) *
|
||||
_elm_config->scale);
|
||||
_els_smart_icon_size_get(wd->img, &w, &h);
|
||||
}
|
||||
if (!wd->scale_down)
|
||||
|
@ -84,7 +84,7 @@ elm_icon_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -94,17 +94,17 @@ elm_icon_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_can_focus_set(obj, 0);
|
||||
|
||||
|
||||
wd->img = _els_smart_icon_add(e);
|
||||
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
|
||||
_mouse_up, obj);
|
||||
evas_object_repeat_events_set(wd->img, 1);
|
||||
elm_widget_resize_object_set(obj, wd->img);
|
||||
elm_widget_resize_object_set(obj, wd->img);
|
||||
|
||||
wd->smooth = EINA_TRUE;
|
||||
wd->scale_up = EINA_TRUE;
|
||||
wd->scale_down = EINA_TRUE;
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ elm_icon_standard_set(Evas_Object *obj, const char *name)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
||||
|
||||
if (!name) return;
|
||||
if (wd->stdicon) eina_stringshare_del(wd->stdicon);
|
||||
wd->stdicon = eina_stringshare_add(name);
|
||||
|
|
|
@ -45,7 +45,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
if (!wd) return;
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
int w, h;
|
||||
|
||||
|
||||
_els_smart_icon_size_get(wd->img, &w, &h);
|
||||
_els_smart_icon_scale_up_set(wd->img, wd->scale_up);
|
||||
_els_smart_icon_scale_down_set(wd->img, wd->scale_down);
|
||||
|
@ -83,7 +83,7 @@ elm_image_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -93,17 +93,17 @@ elm_image_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_can_focus_set(obj, 0);
|
||||
|
||||
|
||||
wd->img = _els_smart_icon_add(e);
|
||||
evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
|
||||
_mouse_up, obj);
|
||||
evas_object_repeat_events_set(wd->img, 1);
|
||||
elm_widget_resize_object_set(obj, wd->img);
|
||||
elm_widget_resize_object_set(obj, wd->img);
|
||||
|
||||
wd->smooth = EINA_TRUE;
|
||||
wd->scale_up = EINA_TRUE;
|
||||
wd->scale_down = EINA_TRUE;
|
||||
|
||||
|
||||
_els_smart_icon_scale_size_set(wd->img, 0);
|
||||
|
||||
_sizing_eval(obj);
|
||||
|
|
|
@ -36,7 +36,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
edje_object_size_min_calc(wd->lbl, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
|
@ -48,7 +48,7 @@ elm_label_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -58,7 +58,7 @@ elm_label_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_can_focus_set(obj, 0);
|
||||
|
||||
|
||||
wd->lbl = edje_object_add(e);
|
||||
_elm_theme_set(wd->lbl, "label", "base", "default");
|
||||
wd->label = eina_stringshare_add("<br>");
|
||||
|
|
|
@ -48,7 +48,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
edje_object_size_min_calc(wd->lay, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
|
@ -90,7 +90,7 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_layout_add(Evas_Object *parent)
|
||||
|
@ -98,7 +98,7 @@ elm_layout_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -107,12 +107,12 @@ elm_layout_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->lay = edje_object_add(e);
|
||||
elm_widget_resize_object_set(obj, wd->lay);
|
||||
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
|
|
@ -50,14 +50,14 @@ _del_hook(Evas_Object *obj)
|
|||
EINA_LIST_FREE(wd->items, it)
|
||||
{
|
||||
if (it->del_cb) it->del_cb((void *)it->data, it->obj, it);
|
||||
eina_stringshare_del(it->label);
|
||||
if (!it->fixed)
|
||||
{
|
||||
if (it->icon) evas_object_del(it->icon);
|
||||
if (it->end) evas_object_del(it->end);
|
||||
}
|
||||
if (it->base) evas_object_del(it->base);
|
||||
free(it);
|
||||
eina_stringshare_del(it->label);
|
||||
if (!it->fixed)
|
||||
{
|
||||
if (it->icon) evas_object_del(it->icon);
|
||||
if (it->end) evas_object_del(it->end);
|
||||
}
|
||||
if (it->base) evas_object_del(it->base);
|
||||
free(it);
|
||||
}
|
||||
eina_list_free(wd->selected);
|
||||
free(wd);
|
||||
|
@ -68,7 +68,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
evas_object_size_hint_min_get(wd->scroller, &minw, &minh);
|
||||
evas_object_size_hint_max_get(wd->scroller, &maxw, &maxh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
@ -91,7 +91,7 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
// _sizing_eval(data);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -101,16 +101,16 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
if ((sub == it->icon) || (sub == it->end))
|
||||
{
|
||||
if (it->icon == sub) it->icon = NULL;
|
||||
if (it->end == sub) it->end = NULL;
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
_fix_items(obj);
|
||||
_sizing_eval(obj);
|
||||
break;
|
||||
}
|
||||
if ((sub == it->icon) || (sub == it->end))
|
||||
{
|
||||
if (it->icon == sub) it->icon = NULL;
|
||||
if (it->end == sub) it->end = NULL;
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
_fix_items(obj);
|
||||
_sizing_eval(obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,8 +134,8 @@ _item_select(Elm_List_Item *it)
|
|||
const char *selectraise;
|
||||
if (it->selected)
|
||||
{
|
||||
if (wd->always_select) goto call;
|
||||
return;
|
||||
if (wd->always_select) goto call;
|
||||
return;
|
||||
}
|
||||
it->selected = EINA_TRUE;
|
||||
wd->selected = eina_list_append(wd->selected, it);
|
||||
|
@ -155,15 +155,15 @@ _item_unselect(Elm_List_Item *it)
|
|||
selectraise = edje_object_data_get(it->base, "selectraise");
|
||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||
{
|
||||
if ((stacking) && (!strcmp(stacking, "below")))
|
||||
evas_object_lower(it->base);
|
||||
if ((stacking) && (!strcmp(stacking, "below")))
|
||||
evas_object_lower(it->base);
|
||||
}
|
||||
it->hilighted = EINA_FALSE;
|
||||
if (it->selected)
|
||||
{
|
||||
it->selected = EINA_FALSE;
|
||||
wd->selected = eina_list_remove(wd->selected, it);
|
||||
evas_object_smart_callback_call(it->obj, "unselected", it);
|
||||
it->selected = EINA_FALSE;
|
||||
wd->selected = eina_list_remove(wd->selected, it);
|
||||
evas_object_smart_callback_call(it->obj, "unselected", it);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,11 +175,11 @@ _mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
|||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
{
|
||||
if (!wd->on_hold)
|
||||
{
|
||||
wd->on_hold = EINA_TRUE;
|
||||
_item_unselect(it);
|
||||
}
|
||||
if (!wd->on_hold)
|
||||
{
|
||||
wd->on_hold = EINA_TRUE;
|
||||
_item_unselect(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,35 +206,35 @@ _mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
|
|||
else wd->on_hold = EINA_FALSE;
|
||||
if (wd->on_hold)
|
||||
{
|
||||
wd->on_hold = EINA_FALSE;
|
||||
return;
|
||||
wd->on_hold = EINA_FALSE;
|
||||
return;
|
||||
}
|
||||
if (wd->multi)
|
||||
{
|
||||
if (!it->selected)
|
||||
{
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
}
|
||||
else _item_unselect(it);
|
||||
if (!it->selected)
|
||||
{
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
}
|
||||
else _item_unselect(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!it->selected)
|
||||
{
|
||||
while (wd->selected)
|
||||
_item_unselect(wd->selected->data);
|
||||
_item_hilight(it);
|
||||
_item_unselect(wd->selected->data);
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l, *l_next;
|
||||
Elm_List_Item *it2;
|
||||
EINA_LIST_FOREACH_SAFE(wd->selected, l, l_next, it2)
|
||||
if (it2 != it) _item_unselect(it2);
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Elm_List_Item *it;
|
||||
|
||||
|
||||
it = calloc(1, sizeof(Elm_List_Item));
|
||||
it->obj = obj;
|
||||
it->label = eina_stringshare_add(label);
|
||||
|
@ -254,24 +254,24 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e
|
|||
it->data = data;
|
||||
it->base = edje_object_add(evas_object_evas_get(obj));
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_mouse_down, it);
|
||||
_mouse_down, it);
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_UP,
|
||||
_mouse_up, it);
|
||||
_mouse_up, it);
|
||||
evas_object_event_callback_add(it->base, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_mouse_move, it);
|
||||
_mouse_move, it);
|
||||
evas_object_size_hint_weight_set(it->base, 1.0, 1.0);
|
||||
evas_object_size_hint_align_set(it->base, -1.0, -1.0);
|
||||
if (it->icon)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, it->icon);
|
||||
evas_object_event_callback_add(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
elm_widget_sub_object_add(obj, it->icon);
|
||||
evas_object_event_callback_add(it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
}
|
||||
if (it->end)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, it->end);
|
||||
evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
elm_widget_sub_object_add(obj, it->end);
|
||||
evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
@ -289,107 +289,107 @@ _fix_items(Evas_Object *obj)
|
|||
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
Evas_Coord mw, mh;
|
||||
if (it->icon)
|
||||
{
|
||||
evas_object_size_hint_min_get(it->icon, &mw, &mh);
|
||||
if (mw > minw[0]) minw[0] = mw;
|
||||
if (mh > minh[0]) minh[0] = mh;
|
||||
}
|
||||
if (it->end)
|
||||
{
|
||||
evas_object_size_hint_min_get(it->end, &mw, &mh);
|
||||
if (mw > minw[1]) minw[1] = mw;
|
||||
if (mh > minh[1]) minh[1] = mh;
|
||||
}
|
||||
Evas_Coord mw, mh;
|
||||
if (it->icon)
|
||||
{
|
||||
evas_object_size_hint_min_get(it->icon, &mw, &mh);
|
||||
if (mw > minw[0]) minw[0] = mw;
|
||||
if (mh > minh[0]) minh[0] = mh;
|
||||
}
|
||||
if (it->end)
|
||||
{
|
||||
evas_object_size_hint_min_get(it->end, &mw, &mh);
|
||||
if (mw > minw[1]) minw[1] = mw;
|
||||
if (mh > minh[1]) minh[1] = mh;
|
||||
}
|
||||
}
|
||||
if ((minw[0] != wd->minw[0]) || (minw[1] != wd->minw[1]) ||
|
||||
if ((minw[0] != wd->minw[0]) || (minw[1] != wd->minw[1]) ||
|
||||
(minw[0] != wd->minh[0]) || (minh[1] != wd->minh[1]))
|
||||
{
|
||||
wd->minw[0] = minw[0];
|
||||
wd->minw[1] = minw[1];
|
||||
wd->minh[0] = minh[0];
|
||||
wd->minh[1] = minh[1];
|
||||
redo = 1;
|
||||
wd->minw[0] = minw[0];
|
||||
wd->minw[1] = minw[1];
|
||||
wd->minh[0] = minh[0];
|
||||
wd->minh[1] = minh[1];
|
||||
redo = 1;
|
||||
}
|
||||
i = 0;
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
it->even = i & 0x1;
|
||||
if ((it->even != it->is_even) || (!it->fixed) || (redo))
|
||||
{
|
||||
const char *stacking;
|
||||
|
||||
if (wd->mode == ELM_LIST_COMPRESS)
|
||||
{
|
||||
if (it->even)
|
||||
_elm_theme_set(it->base, "list", "item_compress", style);
|
||||
else
|
||||
_elm_theme_set(it->base, "list", "item_compress_odd", style);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->even)
|
||||
_elm_theme_set(it->base, "list", "item", style);
|
||||
else
|
||||
_elm_theme_set(it->base, "list", "item_odd", style);
|
||||
}
|
||||
stacking = edje_object_data_get(it->base, "stacking");
|
||||
if (stacking)
|
||||
{
|
||||
if (!strcmp(stacking, "below"))
|
||||
evas_object_lower(it->base);
|
||||
else if (!strcmp(stacking, "above"))
|
||||
evas_object_raise(it->base);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
if ((!it->icon) && (minh[0] > 0))
|
||||
{
|
||||
it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base));
|
||||
evas_object_color_set(it->icon, 0, 0, 0, 0);
|
||||
it->dummy_icon = EINA_TRUE;
|
||||
}
|
||||
if ((!it->end) && (minh[1] > 0))
|
||||
{
|
||||
it->end = evas_object_rectangle_add(evas_object_evas_get(it->base));
|
||||
evas_object_color_set(it->end, 0, 0, 0, 0);
|
||||
it->dummy_end = EINA_TRUE;
|
||||
}
|
||||
if (it->icon)
|
||||
{
|
||||
evas_object_size_hint_min_set(it->icon, minw[0], minh[0]);
|
||||
evas_object_size_hint_max_set(it->icon, 99999, 99999);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
}
|
||||
if (it->end)
|
||||
{
|
||||
evas_object_size_hint_min_set(it->end, minw[1], minh[1]);
|
||||
evas_object_size_hint_max_set(it->end, 99999, 99999);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.end", it->end);
|
||||
}
|
||||
if (!it->fixed)
|
||||
{
|
||||
edje_object_message_signal_process(it->base);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
evas_object_size_hint_min_set(it->base, mw, mh);
|
||||
evas_object_show(it->base);
|
||||
}
|
||||
if ((it->selected) || (it->hilighted))
|
||||
{
|
||||
const char *selectraise;
|
||||
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
selectraise = edje_object_data_get(it->base, "selectraise");
|
||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||
evas_object_raise(it->base);
|
||||
stacking = edje_object_data_get(it->base, "stacking");
|
||||
}
|
||||
it->fixed = EINA_TRUE;
|
||||
it->is_even = it->even;
|
||||
}
|
||||
it->even = i & 0x1;
|
||||
if ((it->even != it->is_even) || (!it->fixed) || (redo))
|
||||
{
|
||||
const char *stacking;
|
||||
|
||||
if (wd->mode == ELM_LIST_COMPRESS)
|
||||
{
|
||||
if (it->even)
|
||||
_elm_theme_set(it->base, "list", "item_compress", style);
|
||||
else
|
||||
_elm_theme_set(it->base, "list", "item_compress_odd", style);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (it->even)
|
||||
_elm_theme_set(it->base, "list", "item", style);
|
||||
else
|
||||
_elm_theme_set(it->base, "list", "item_odd", style);
|
||||
}
|
||||
stacking = edje_object_data_get(it->base, "stacking");
|
||||
if (stacking)
|
||||
{
|
||||
if (!strcmp(stacking, "below"))
|
||||
evas_object_lower(it->base);
|
||||
else if (!strcmp(stacking, "above"))
|
||||
evas_object_raise(it->base);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
if ((!it->icon) && (minh[0] > 0))
|
||||
{
|
||||
it->icon = evas_object_rectangle_add(evas_object_evas_get(it->base));
|
||||
evas_object_color_set(it->icon, 0, 0, 0, 0);
|
||||
it->dummy_icon = EINA_TRUE;
|
||||
}
|
||||
if ((!it->end) && (minh[1] > 0))
|
||||
{
|
||||
it->end = evas_object_rectangle_add(evas_object_evas_get(it->base));
|
||||
evas_object_color_set(it->end, 0, 0, 0, 0);
|
||||
it->dummy_end = EINA_TRUE;
|
||||
}
|
||||
if (it->icon)
|
||||
{
|
||||
evas_object_size_hint_min_set(it->icon, minw[0], minh[0]);
|
||||
evas_object_size_hint_max_set(it->icon, 99999, 99999);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
}
|
||||
if (it->end)
|
||||
{
|
||||
evas_object_size_hint_min_set(it->end, minw[1], minh[1]);
|
||||
evas_object_size_hint_max_set(it->end, 99999, 99999);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.end", it->end);
|
||||
}
|
||||
if (!it->fixed)
|
||||
{
|
||||
edje_object_message_signal_process(it->base);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
evas_object_size_hint_min_set(it->base, mw, mh);
|
||||
evas_object_show(it->base);
|
||||
}
|
||||
if ((it->selected) || (it->hilighted))
|
||||
{
|
||||
const char *selectraise;
|
||||
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
selectraise = edje_object_data_get(it->base, "selectraise");
|
||||
if ((selectraise) && (!strcmp(selectraise, "on")))
|
||||
evas_object_raise(it->base);
|
||||
stacking = edje_object_data_get(it->base, "stacking");
|
||||
}
|
||||
it->fixed = EINA_TRUE;
|
||||
it->is_even = it->even;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
mw = 0; mh = 0;
|
||||
|
@ -407,7 +407,7 @@ elm_list_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -417,12 +417,12 @@ elm_list_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_can_focus_set(obj, 1);
|
||||
|
||||
|
||||
wd->scroller = elm_scroller_add(parent);
|
||||
elm_widget_resize_object_set(obj, wd->scroller);
|
||||
|
||||
|
||||
elm_scroller_bounce_set(wd->scroller, 0, 1);
|
||||
|
||||
|
||||
wd->box = elm_box_add(parent);
|
||||
elm_box_homogenous_set(wd->box, 1);
|
||||
evas_object_size_hint_weight_set(wd->box, 1.0, 0.0);
|
||||
|
@ -433,7 +433,7 @@ elm_list_add(Evas_Object *parent)
|
|||
wd->mode = ELM_LIST_SCROLL;
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ elm_list_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode)
|
|||
elm_scroller_content_min_limit(wd->scroller, 0, 0);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
EAPI void
|
||||
elm_list_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -565,13 +565,13 @@ elm_list_item_selected_set(Elm_List_Item *it, Eina_Bool selected)
|
|||
|
||||
if (selected)
|
||||
{
|
||||
if (!wd->multi)
|
||||
{
|
||||
if (!wd->multi)
|
||||
{
|
||||
while (wd->selected)
|
||||
_item_unselect(wd->selected->data);
|
||||
}
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
_item_unselect(wd->selected->data);
|
||||
}
|
||||
_item_hilight(it);
|
||||
_item_select(it);
|
||||
}
|
||||
else
|
||||
_item_unselect(it);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,10 +3,10 @@
|
|||
|
||||
/**
|
||||
* @defgroup Pager Pager
|
||||
*
|
||||
*
|
||||
* The pager is an object that allows flipping (with animation) between 1 or
|
||||
* more “pages” of objects, much like a stack of windows within the window.
|
||||
*
|
||||
* more “pages” of objects, much like a stack of windows within the window.
|
||||
*
|
||||
* Objects can be pushed or popped from he stack or deleted as normal.
|
||||
* Pushes and pops will animate (and a pop will delete the object once the
|
||||
* animation is finished). Any object in the pager can be promoted to the top
|
||||
|
@ -69,8 +69,8 @@ _sizing_eval(Evas_Object *obj)
|
|||
Item *it;
|
||||
EINA_LIST_FOREACH(wd->stack, l, it)
|
||||
{
|
||||
if (it->minw > minw) minw = it->minw;
|
||||
if (it->minh > minh) minh = it->minh;
|
||||
if (it->minw > minw) minw = it->minw;
|
||||
if (it->minh > minh) minh = it->minh;
|
||||
}
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
|
@ -94,30 +94,30 @@ _eval_top(Evas_Object *obj)
|
|||
ittop = eina_list_last(wd->stack)->data;
|
||||
if (ittop != wd->top)
|
||||
{
|
||||
Evas_Object *o;
|
||||
const char *onshow, *onhide;
|
||||
Evas_Object *o;
|
||||
const char *onshow, *onhide;
|
||||
|
||||
if (wd->top)
|
||||
{
|
||||
o = wd->top->base;
|
||||
edje_object_signal_emit(o, "elm,action,hide", "elm");
|
||||
onhide = edje_object_data_get(o, "onhide");
|
||||
if (onhide)
|
||||
{
|
||||
if (!strcmp(onhide, "raise")) evas_object_raise(o);
|
||||
else if (!strcmp(onhide, "lower")) evas_object_lower(o);
|
||||
}
|
||||
}
|
||||
wd->top = ittop;
|
||||
o = wd->top->base;
|
||||
evas_object_show(o);
|
||||
edje_object_signal_emit(o, "elm,action,show", "elm");
|
||||
onshow = edje_object_data_get(o, "onshow");
|
||||
if (onshow)
|
||||
{
|
||||
if (!strcmp(onshow, "raise")) evas_object_raise(o);
|
||||
else if (!strcmp(onshow, "lower")) evas_object_lower(o);
|
||||
}
|
||||
if (wd->top)
|
||||
{
|
||||
o = wd->top->base;
|
||||
edje_object_signal_emit(o, "elm,action,hide", "elm");
|
||||
onhide = edje_object_data_get(o, "onhide");
|
||||
if (onhide)
|
||||
{
|
||||
if (!strcmp(onhide, "raise")) evas_object_raise(o);
|
||||
else if (!strcmp(onhide, "lower")) evas_object_lower(o);
|
||||
}
|
||||
}
|
||||
wd->top = ittop;
|
||||
o = wd->top->base;
|
||||
evas_object_show(o);
|
||||
edje_object_signal_emit(o, "elm,action,show", "elm");
|
||||
onshow = edje_object_data_get(o, "onshow");
|
||||
if (onshow)
|
||||
{
|
||||
if (!strcmp(onshow, "raise")) evas_object_raise(o);
|
||||
else if (!strcmp(onshow, "lower")) evas_object_lower(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,18 +142,18 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
Item *it;
|
||||
EINA_LIST_FOREACH(wd->stack, l, it)
|
||||
{
|
||||
if (it->content == sub)
|
||||
{
|
||||
wd->stack = eina_list_remove_list(wd->stack, l);
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_del(it->base);
|
||||
_eval_top(it->obj);
|
||||
free(it);
|
||||
return;
|
||||
}
|
||||
if (it->content == sub)
|
||||
{
|
||||
wd->stack = eina_list_remove_list(wd->stack, l);
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
evas_object_del(it->base);
|
||||
_eval_top(it->obj);
|
||||
free(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
|
@ -177,7 +177,7 @@ _signal_hide_finished(void *data, Evas_Object *obj, const char *emission, const
|
|||
edje_object_message_signal_process(it->base);
|
||||
if (it->popme)
|
||||
{
|
||||
evas_object_del(it->content);
|
||||
evas_object_del(it->content);
|
||||
}
|
||||
_sizing_eval(obj2);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ elm_pager_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -205,19 +205,19 @@ elm_pager_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj);
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
|
||||
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Push an object to the top of the pager stack (and show it)
|
||||
*
|
||||
*
|
||||
* The object pushed becomes a child of the pager and will be controlled
|
||||
* it and deleted when the pager is deleted.
|
||||
*
|
||||
|
@ -240,7 +240,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content)
|
|||
evas_object_geometry_get(obj, &x, &y, &w, &h);
|
||||
evas_object_move(it->base, x, y);
|
||||
evas_object_resize(it->base, w, h);
|
||||
elm_widget_sub_object_add(obj, it->base);
|
||||
elm_widget_sub_object_add(obj, it->base);
|
||||
elm_widget_sub_object_add(obj, it->content);
|
||||
_elm_theme_set(it->base, "pager", "base", elm_widget_style_get(obj));
|
||||
edje_object_signal_callback_add(it->base, "elm,action,hide,finished", "", _signal_hide_finished, it);
|
||||
|
@ -248,7 +248,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content)
|
|||
edje_object_size_min_calc(it->base, &it->minw, &it->minh);
|
||||
evas_object_show(it->content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, it);
|
||||
_changed_size_hints, it);
|
||||
wd->stack = eina_list_append(wd->stack, it);
|
||||
_eval_top(obj);
|
||||
_sizing_eval(obj);
|
||||
|
@ -260,7 +260,7 @@ elm_pager_content_push(Evas_Object *obj, Evas_Object *content)
|
|||
* This pops the object that is on top (visible) in the pager, makes it
|
||||
* disappear, then deletes the object. The object that was underneath it
|
||||
* on the stack will become visible.
|
||||
*
|
||||
*
|
||||
* @param obj The pager object
|
||||
*
|
||||
* @ingroup Pager
|
||||
|
@ -277,28 +277,28 @@ elm_pager_content_pop(Evas_Object *obj)
|
|||
ll = eina_list_last(wd->stack);
|
||||
if (ll)
|
||||
{
|
||||
ll = ll->prev;
|
||||
if (!ll)
|
||||
{
|
||||
Evas_Object *o;
|
||||
const char *onhide;
|
||||
|
||||
wd->top = it;
|
||||
o = wd->top->base;
|
||||
edje_object_signal_emit(o, "elm,action,hide", "elm");
|
||||
onhide = edje_object_data_get(o, "onhide");
|
||||
if (onhide)
|
||||
{
|
||||
if (!strcmp(onhide, "raise")) evas_object_raise(o);
|
||||
else if (!strcmp(onhide, "lower")) evas_object_lower(o);
|
||||
}
|
||||
wd->top = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = ll->data;
|
||||
elm_pager_content_promote(obj, it->content);
|
||||
}
|
||||
ll = ll->prev;
|
||||
if (!ll)
|
||||
{
|
||||
Evas_Object *o;
|
||||
const char *onhide;
|
||||
|
||||
wd->top = it;
|
||||
o = wd->top->base;
|
||||
edje_object_signal_emit(o, "elm,action,hide", "elm");
|
||||
onhide = edje_object_data_get(o, "onhide");
|
||||
if (onhide)
|
||||
{
|
||||
if (!strcmp(onhide, "raise")) evas_object_raise(o);
|
||||
else if (!strcmp(onhide, "lower")) evas_object_lower(o);
|
||||
}
|
||||
wd->top = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
it = ll->data;
|
||||
elm_pager_content_promote(obj, it->content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ elm_pager_content_pop(Evas_Object *obj)
|
|||
* This will take the indicated object and promote it to the top of the stack
|
||||
* as if it had been pushed there. The object must already be inside the
|
||||
* pager stack to work.
|
||||
*
|
||||
*
|
||||
* @param obj The pager object
|
||||
* @param content The object to promote
|
||||
*
|
||||
|
@ -322,13 +322,13 @@ elm_pager_content_promote(Evas_Object *obj, Evas_Object *content)
|
|||
Item *it;
|
||||
EINA_LIST_FOREACH(wd->stack, l, it)
|
||||
{
|
||||
if (it->content == content)
|
||||
{
|
||||
wd->stack = eina_list_remove_list(wd->stack, l);
|
||||
wd->stack = eina_list_append(wd->stack, it);
|
||||
_eval_top(obj);
|
||||
return;
|
||||
}
|
||||
if (it->content == content)
|
||||
{
|
||||
wd->stack = eina_list_remove_list(wd->stack, l);
|
||||
wd->stack = eina_list_append(wd->stack, it);
|
||||
_eval_top(obj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -367,4 +367,3 @@ elm_pager_content_top_get(Evas_Object *obj)
|
|||
it = eina_list_last(wd->stack)->data;
|
||||
return it->content;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,10 +35,10 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
evas_object_size_hint_min_set(wd->img,
|
||||
wd->size * elm_widget_scale_get(obj) * _elm_config->scale,
|
||||
wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
|
||||
evas_object_size_hint_min_set(wd->img,
|
||||
wd->size * elm_widget_scale_get(obj) * _elm_config->scale,
|
||||
wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
edje_object_size_min_restricted_calc(wd->frm, &minw, &minh, minw, minh);
|
||||
|
@ -61,7 +61,7 @@ elm_photo_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -75,7 +75,7 @@ elm_photo_add(Evas_Object *parent)
|
|||
wd->frm = edje_object_add(e);
|
||||
_elm_theme_set(wd->frm, "photo", "base", "default");
|
||||
elm_widget_resize_object_set(obj, wd->frm);
|
||||
|
||||
|
||||
wd->img = _els_smart_icon_add(e);
|
||||
_els_smart_icon_scale_up_set(wd->img, 1);
|
||||
_els_smart_icon_scale_down_set(wd->img, 1);
|
||||
|
@ -88,9 +88,9 @@ elm_photo_add(Evas_Object *parent)
|
|||
edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->img);
|
||||
evas_object_show(wd->img);
|
||||
elm_widget_sub_object_add(obj, wd->img);
|
||||
|
||||
|
||||
wd->size = 40;
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
|
|
@ -97,11 +97,11 @@ EAPI void elm_widget_disabled_set(Evas_Object *obj, int disabled);
|
|||
EAPI int elm_widget_disabled_get(const Evas_Object *obj);
|
||||
EAPI void elm_widget_show_region_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
|
||||
EAPI void elm_widget_show_region_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
|
||||
EAPI void elm_widget_scroll_hold_push(Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_hold_pop(Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_hold_push(Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_hold_pop(Evas_Object *obj);
|
||||
EAPI int elm_widget_scroll_hold_get(const Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_freeze_push(Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_freeze_push(Evas_Object *obj);
|
||||
EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj);
|
||||
EAPI int elm_widget_scroll_freeze_get(const Evas_Object *obj);
|
||||
EAPI void elm_widget_scale_set(Evas_Object *obj, double scale);
|
||||
EAPI double elm_widget_scale_get(const Evas_Object *obj);
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
|
||||
/**
|
||||
* @defgroup Radio Radio
|
||||
*
|
||||
* The radio button allows for 1 or more selectors to be created to select 1
|
||||
*
|
||||
* The radio button allows for 1 or more selectors to be created to select 1
|
||||
* of a set of options.
|
||||
*
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
* changed - This is called whenever the user changes the state of one of the
|
||||
*
|
||||
* changed - This is called whenever the user changes the state of one of the
|
||||
* radio objects within the group of radio objects that work together.
|
||||
*
|
||||
* A radio object contains an indicator, an optional Label and an optional
|
||||
* icon object. They work normally in groups of 2 or more. When you create a
|
||||
* radio (if it is not the first member of the group), simply add it to the
|
||||
* group by adding it to any other member of the group that already exists
|
||||
*
|
||||
* A radio object contains an indicator, an optional Label and an optional
|
||||
* icon object. They work normally in groups of 2 or more. When you create a
|
||||
* radio (if it is not the first member of the group), simply add it to the
|
||||
* group by adding it to any other member of the group that already exists
|
||||
* (or the first member) with elm_radio_group_add() with the second parameter
|
||||
* being the existing group member. The radio object(s) will select from one
|
||||
* of a set of integer values, so any value they are configuring needs to be
|
||||
|
@ -97,7 +97,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
edje_object_size_min_restricted_calc(wd->chk, &minw, &minh, minw, minh);
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
|
@ -137,11 +137,11 @@ _state_set(Evas_Object *obj, Eina_Bool state)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (state != wd->state)
|
||||
{
|
||||
wd->state = state;
|
||||
if (wd->state)
|
||||
edje_object_signal_emit(wd->chk, "elm,state,radio,on", "elm");
|
||||
else
|
||||
edje_object_signal_emit(wd->chk, "elm,state,radio,off", "elm");
|
||||
wd->state = state;
|
||||
if (wd->state)
|
||||
edje_object_signal_emit(wd->chk, "elm,state,radio,on", "elm");
|
||||
else
|
||||
edje_object_signal_emit(wd->chk, "elm,state,radio,off", "elm");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,9 +153,9 @@ _state_set_all(Widget_Data *wd)
|
|||
|
||||
EINA_LIST_FOREACH(wd->group->radios, l, child)
|
||||
{
|
||||
Widget_Data *wd2 = elm_widget_data_get(child);
|
||||
if (wd2->value == wd->group->value) _state_set(child, 1);
|
||||
else _state_set(child, 0);
|
||||
Widget_Data *wd2 = elm_widget_data_get(child);
|
||||
if (wd2->value == wd->group->value) _state_set(child, 1);
|
||||
else _state_set(child, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ elm_radio_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -193,7 +193,7 @@ elm_radio_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->chk = edje_object_add(e);
|
||||
_elm_theme_set(wd->chk, "radio", "base", "default");
|
||||
edje_object_signal_callback_add(wd->chk, "elm,action,radio,on", "", _signal_radio_on, obj);
|
||||
|
@ -205,7 +205,7 @@ elm_radio_add(Evas_Object *parent)
|
|||
wd->group = calloc(1, sizeof(Group));
|
||||
wd->group->radios = eina_list_append(wd->group->radios, obj);
|
||||
wd->state = 0;
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -227,13 +227,13 @@ elm_radio_label_set(Evas_Object *obj, const char *label)
|
|||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->chk, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->chk);
|
||||
}
|
||||
|
@ -274,7 +274,7 @@ elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon)
|
|||
|
||||
/**
|
||||
* Add this radio to a group of other radio objects
|
||||
*
|
||||
*
|
||||
* Radio objects work in groups. Each member should have a different integer
|
||||
* value assigned. In order ro have them work as a group, they need to know
|
||||
* about eacthother. This adds the given radio object to the group of which
|
||||
|
@ -322,10 +322,10 @@ elm_radio_state_value_set(Evas_Object *obj, int value)
|
|||
|
||||
/**
|
||||
* Set the value the radio
|
||||
*
|
||||
*
|
||||
* This sets the value of the radio group and will also set the value if
|
||||
* pointed to, to the value supplied, but will not call any callbacks.
|
||||
*
|
||||
*
|
||||
* @param obj The radio object
|
||||
* @param state The value to use for the group
|
||||
*
|
||||
|
@ -380,18 +380,18 @@ elm_radio_value_pointer_set(Evas_Object *obj, int *valuep)
|
|||
|
||||
if (valuep)
|
||||
{
|
||||
wd->group->valuep = valuep;
|
||||
wd->group->valuep = valuep;
|
||||
if (*(wd->group->valuep) != wd->group->value)
|
||||
{
|
||||
const Eina_List *l;
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
|
||||
wd->group->value = *(wd->group->valuep);
|
||||
wd->group->value = *(wd->group->valuep);
|
||||
_state_set_all(wd);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->group->valuep = NULL;
|
||||
wd->group->valuep = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ elm_scroller_add(Evas_Object *parent)
|
|||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
Evas_Coord vw, vh, minw, minh;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -183,11 +183,11 @@ elm_scroller_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->scr = elm_smart_scroller_add(e);
|
||||
elm_widget_resize_object_set(obj, wd->scr);
|
||||
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
|
||||
edje_object_size_min_calc(elm_smart_scroller_edje_object_get(wd->scr), &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
@ -198,13 +198,13 @@ elm_scroller_add(Evas_Object *parent)
|
|||
evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
|
||||
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
|
||||
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
|
||||
|
||||
|
||||
evas_object_smart_callback_add(wd->scr, "edge,left", _edge_left, obj);
|
||||
evas_object_smart_callback_add(wd->scr, "edge,right", _edge_right, obj);
|
||||
evas_object_smart_callback_add(wd->scr, "edge,top", _edge_top, obj);
|
||||
evas_object_smart_callback_add(wd->scr, "edge,bottom", _edge_bottom, obj);
|
||||
evas_object_smart_callback_add(wd->scr, "scroll", _scroll, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ elm_scroller_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
elm_smart_scroller_child_set(wd->scr, content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -250,11 +250,11 @@ EAPI void
|
|||
elm_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
const Elm_Scroller_Policy map[3] =
|
||||
const Elm_Scroller_Policy map[3] =
|
||||
{
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_ON,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_ON,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF
|
||||
};
|
||||
if (!wd) return;
|
||||
if ((policy_h < 0) || (policy_h >= 3) || (policy_v < 0) || (policy_v >= 3))
|
||||
|
|
|
@ -3,30 +3,30 @@
|
|||
|
||||
/**
|
||||
* @defgroup Slider Slider
|
||||
*
|
||||
*
|
||||
* The slider adds a dragable “slider” widget for selecting the value of
|
||||
* something within a range.
|
||||
*
|
||||
* something within a range.
|
||||
*
|
||||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
*
|
||||
* changed - Whenever the slider value is changed by the user.
|
||||
*
|
||||
* delay,changed - A short time after the value is changed by the user.
|
||||
*
|
||||
* delay,changed - A short time after the value is changed by the user.
|
||||
* This will be called only when the user stops dragging for a very short
|
||||
* period or when they release their finger/mouse, so it avoids possibly
|
||||
* period or when they release their finger/mouse, so it avoids possibly
|
||||
* expensive reactions to the value change.
|
||||
*
|
||||
* A slider can be horizontal or vertical. It can contain an Icon and has a
|
||||
* primary label as well as a units label (that is formatted with floating
|
||||
* point values and thus accepts a printf-style format string, like
|
||||
* “%1.2f units”. There is also an indicator string that may be somewhere
|
||||
* else (like on the slider itself) that also accepts a format string like
|
||||
*
|
||||
* A slider can be horizontal or vertical. It can contain an Icon and has a
|
||||
* primary label as well as a units label (that is formatted with floating
|
||||
* point values and thus accepts a printf-style format string, like
|
||||
* “%1.2f units”. There is also an indicator string that may be somewhere
|
||||
* else (like on the slider itself) that also accepts a format string like
|
||||
* units. Label, Icon Unit and Indicator strings/objects are optional.
|
||||
*
|
||||
* A slider may be inverted which means values invert, with high vales being
|
||||
* on the left or top and low values on the right or bottom (as opposed to
|
||||
*
|
||||
* A slider may be inverted which means values invert, with high vales being
|
||||
* on the left or top and low values on the right or bottom (as opposed to
|
||||
* normally being low on the left or top and high on the bottom and right).
|
||||
*
|
||||
*
|
||||
* The slider should have its minimum and maximum values set by the
|
||||
* application with elm_slider_min_max_set() and value should also be set by
|
||||
* the application before use with elm_slider_value_set(). The span of the
|
||||
|
@ -97,7 +97,7 @@ _theme_hook(Evas_Object *obj)
|
|||
edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm");
|
||||
if (wd->horizontal)
|
||||
evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1);
|
||||
else
|
||||
else
|
||||
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
||||
_units_set(obj);
|
||||
|
@ -111,7 +111,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
edje_object_size_min_restricted_calc(wd->slider, &minw, &minh, minw, minh);
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
|
@ -157,19 +157,19 @@ _val_fetch(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
double posx = 0.0, posy = 0.0, pos = 0.0, val;
|
||||
|
||||
edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider",
|
||||
&posx, &posy);
|
||||
|
||||
edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider",
|
||||
&posx, &posy);
|
||||
if (wd->horizontal) pos = posx;
|
||||
else pos = posy;
|
||||
if (wd->inverted) pos = 1.0 - pos;
|
||||
val = (pos * (wd->val_max - wd->val_min)) + wd->val_min;
|
||||
if (val != wd->val)
|
||||
{
|
||||
wd->val = val;
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
if (wd->delay) ecore_timer_del(wd->delay);
|
||||
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
|
||||
wd->val = val;
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
if (wd->delay) ecore_timer_del(wd->delay);
|
||||
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,10 +194,10 @@ _units_set(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (wd->units)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf), wd->units, wd->val);
|
||||
edje_object_part_text_set(wd->slider, "elm.units", buf);
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf), wd->units, wd->val);
|
||||
edje_object_part_text_set(wd->slider, "elm.units", buf);
|
||||
}
|
||||
else
|
||||
edje_object_part_text_set(wd->slider, "elm.units", NULL);
|
||||
|
@ -209,16 +209,16 @@ _indicator_set(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (wd->indicator)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf), wd->indicator, wd->val);
|
||||
edje_object_part_text_set(wd->slider, "elm.indicator", buf);
|
||||
char buf[1024];
|
||||
|
||||
snprintf(buf, sizeof(buf), wd->indicator, wd->val);
|
||||
edje_object_part_text_set(wd->slider, "elm.indicator", buf);
|
||||
}
|
||||
else
|
||||
edje_object_part_text_set(wd->slider, "elm.indicator", NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_drag(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
_val_fetch(data);
|
||||
|
@ -226,17 +226,17 @@ _drag(void *data, Evas_Object *obj, const char *emission, const char *source)
|
|||
_indicator_set(data);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_drag_start(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
{
|
||||
_val_fetch(data);
|
||||
_units_set(data);
|
||||
_indicator_set(data);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_drag_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
|
||||
{
|
||||
{
|
||||
_val_fetch(data);
|
||||
_units_set(data);
|
||||
_indicator_set(data);
|
||||
|
@ -244,10 +244,10 @@ _drag_stop(void *data, Evas_Object *obj, const char *emission, const char *sourc
|
|||
|
||||
/**
|
||||
* Add a new slider to the parent
|
||||
*
|
||||
*
|
||||
* @param parent The parent object
|
||||
* @return The new object or NULL if it cannot be created
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI Evas_Object *
|
||||
|
@ -256,7 +256,7 @@ elm_slider_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -265,12 +265,12 @@ elm_slider_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->horizontal = EINA_TRUE;
|
||||
wd->val = 0.0;
|
||||
wd->val_min = 0.0;
|
||||
wd->val_max = 1.0;
|
||||
|
||||
|
||||
wd->slider = edje_object_add(e);
|
||||
_elm_theme_set(wd->slider, "slider", "horizontal", "default");
|
||||
elm_widget_resize_object_set(obj, wd->slider);
|
||||
|
@ -281,25 +281,25 @@ elm_slider_add(Evas_Object *parent)
|
|||
edje_object_signal_callback_add(wd->slider, "drag,page", "*", _drag_stop, obj);
|
||||
// edje_object_signal_callback_add(wd->slider, "drag,set", "*", _drag_stop, obj);
|
||||
edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", 0.0, 0.0);
|
||||
|
||||
|
||||
wd->spacer = evas_object_rectangle_add(e);
|
||||
evas_object_color_set(wd->spacer, 0, 0, 0, 0);
|
||||
evas_object_pass_events_set(wd->spacer, 1);
|
||||
elm_widget_sub_object_add(obj, wd->spacer);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
||||
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the label of the slider
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param label The text label string in UTF-8
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -310,13 +310,13 @@ elm_slider_label_set(Evas_Object *obj, const char *label)
|
|||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->slider, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ elm_slider_label_set(Evas_Object *obj, const char *label)
|
|||
*
|
||||
* @param obj The slider object
|
||||
* @param icon The icon object
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -357,15 +357,15 @@ elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon)
|
|||
|
||||
/**
|
||||
* Set the length of the dragable region of the slider
|
||||
*
|
||||
*
|
||||
* Thois sets the minimum width or height (depending on orientation) of the
|
||||
* area of the slider that allows the slider to be dragged around. This in
|
||||
* turn affects the objects minimum size (along with icon label and unit
|
||||
* text). Note that this will also get multiplied by the scale factor.
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param size The length of the slider area
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -376,7 +376,7 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
|
|||
wd->size = size;
|
||||
if (wd->horizontal)
|
||||
evas_object_size_hint_min_set(wd->spacer, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale, 1);
|
||||
else
|
||||
else
|
||||
evas_object_size_hint_min_set(wd->spacer, 1, (double)wd->size * elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
|
||||
_sizing_eval(obj);
|
||||
|
@ -384,15 +384,15 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size)
|
|||
|
||||
/**
|
||||
* Set the format string of the unit area
|
||||
*
|
||||
*
|
||||
* If NULL, this disabls the unit area display. If not it sets the format
|
||||
* string for the unit text. The unit text is provided a floating point
|
||||
* value, so the unit text can display up to 1 floating point falue. Note that
|
||||
* this is optional. Use a format string such as "%1.2f meters" for example.
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param units The format string for the units display
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -402,13 +402,13 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units)
|
|||
if (wd->units) eina_stringshare_del(wd->units);
|
||||
if (units)
|
||||
{
|
||||
wd->units = eina_stringshare_add(units);
|
||||
wd->units = eina_stringshare_add(units);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,units,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->units = NULL;
|
||||
wd->units = NULL;
|
||||
edje_object_signal_emit(wd->slider, "elm,state,units,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
|
@ -418,15 +418,15 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units)
|
|||
|
||||
/**
|
||||
* Set the format string for the inducator area
|
||||
*
|
||||
*
|
||||
* The slider may also display a value (the value of the slider) somewhere
|
||||
* (for example above the slider knob that is dragged around). This sets the
|
||||
* format string for this. See elm_slider_unit_format_set() for more
|
||||
* information on how this works.
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param units The format string for the indicator display
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -441,10 +441,10 @@ elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator)
|
|||
|
||||
/**
|
||||
* Set orientation of the slider
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param horizontal If set, the slider will be horizontal
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -459,13 +459,13 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
|||
|
||||
/**
|
||||
* Set the minimum and maximum values for the slider
|
||||
*
|
||||
*
|
||||
* Maximum mut be greater than minimum.
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param min The minimum value
|
||||
* @param max The maximum value
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -484,10 +484,10 @@ elm_slider_min_max_set(Evas_Object *obj, double min, double max)
|
|||
|
||||
/**
|
||||
* Set the value the slider indicates
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param val The value (must be beween min and max for the slider)
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
@ -505,10 +505,10 @@ elm_slider_value_set(Evas_Object *obj, double val)
|
|||
|
||||
/**
|
||||
* Get the value the slider has
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @return The value of the slider
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI double
|
||||
|
@ -520,15 +520,15 @@ elm_slider_value_get(const Evas_Object *obj)
|
|||
|
||||
/**
|
||||
* Invert the slider display
|
||||
*
|
||||
*
|
||||
* Normally the slider will display and interpret values from low to high
|
||||
* and when horizontal that is left to right. When vertical that is top
|
||||
* to bottom. This inverts this (so from right to left or bottom to top) if
|
||||
* inverted is set to 1.
|
||||
*
|
||||
*
|
||||
* @param obj The slider object
|
||||
* @param inverted The inverted flag. 1 == inverted, 0 == normal
|
||||
*
|
||||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void
|
||||
|
|
|
@ -26,7 +26,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
Evas_Coord w, h;
|
||||
|
||||
|
||||
evas_object_size_hint_min_get(wd->tbl, &minw, &minh);
|
||||
evas_object_size_hint_max_get(wd->tbl, &maxw, &maxh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
@ -61,7 +61,7 @@ elm_table_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -69,14 +69,14 @@ elm_table_add(Evas_Object *parent)
|
|||
elm_widget_sub_object_add(parent, obj);
|
||||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
|
||||
|
||||
wd->tbl = _els_smart_table_add(e);
|
||||
evas_object_event_callback_add(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
elm_widget_resize_object_set(obj, wd->tbl);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,15 +10,15 @@ static const char *
|
|||
_elm_theme_find_try(const char *f, const char *group)
|
||||
{
|
||||
const char *file;
|
||||
|
||||
|
||||
if (edje_file_group_exists(f, group))
|
||||
{
|
||||
file = eina_stringshare_add(f);
|
||||
if (file)
|
||||
{
|
||||
eina_hash_add(cache, group, file);
|
||||
return file;
|
||||
}
|
||||
file = eina_stringshare_add(f);
|
||||
if (file)
|
||||
{
|
||||
eina_hash_add(cache, group, file);
|
||||
return file;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -28,15 +28,15 @@ _elm_theme_theme_element_try(const char *home, const char *f, const char *group)
|
|||
{
|
||||
char buf[PATH_MAX];
|
||||
const char *file = NULL;
|
||||
|
||||
|
||||
if ((f[0] == '/') ||
|
||||
((f[0] == '.') && (f[1] == '/')) ||
|
||||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')))
|
||||
return _elm_theme_find_try(f, group);
|
||||
else if (((f[0] == '~') && (f[1] == '/')))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
|
||||
return _elm_theme_find_try(buf, group);
|
||||
snprintf(buf, sizeof(buf), "%s/%s", home, f + 2);
|
||||
return _elm_theme_find_try(buf, group);
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%s/.elementary/themes/%s.edj", home, f);
|
||||
file = _elm_theme_find_try(buf, group);
|
||||
|
@ -57,23 +57,23 @@ _elm_theme_group_file_find(const char *group)
|
|||
if (file) return file;
|
||||
if (!home)
|
||||
{
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
home = getenv("HOME");
|
||||
if (!home) home = "";
|
||||
}
|
||||
EINA_LIST_FOREACH(overlay, l, f)
|
||||
{
|
||||
file = _elm_theme_theme_element_try(home, f, group);
|
||||
if (file) return file;
|
||||
file = _elm_theme_theme_element_try(home, f, group);
|
||||
if (file) return file;
|
||||
}
|
||||
EINA_LIST_FOREACH(themes, l, f)
|
||||
{
|
||||
file = _elm_theme_theme_element_try(home, f, group);
|
||||
if (file) return file;
|
||||
file = _elm_theme_theme_element_try(home, f, group);
|
||||
if (file) return file;
|
||||
}
|
||||
EINA_LIST_FOREACH(extension, l, f)
|
||||
{
|
||||
file = _elm_theme_theme_element_try(home, f, group);
|
||||
if (file) return file;
|
||||
file = _elm_theme_theme_element_try(home, f, group);
|
||||
if (file) return file;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -98,13 +98,13 @@ _elm_theme_set(Evas_Object *o, const char *clas, const char *group, const char *
|
|||
const char *file;
|
||||
char buf2[1024];
|
||||
int ok;
|
||||
|
||||
|
||||
snprintf(buf2, sizeof(buf2), "elm/%s/%s/%s", clas, group, style);
|
||||
file = _elm_theme_group_file_find(buf2);
|
||||
if (file)
|
||||
{
|
||||
ok = edje_object_file_set(o, file, buf2);
|
||||
if (ok) return 1;
|
||||
ok = edje_object_file_set(o, file, buf2);
|
||||
if (ok) return 1;
|
||||
}
|
||||
snprintf(buf2, sizeof(buf2), "elm/%s/%s/default", clas, group);
|
||||
file = _elm_theme_group_file_find(buf2);
|
||||
|
@ -120,14 +120,14 @@ _elm_theme_icon_set(Evas_Object *o, const char *group, const char *style)
|
|||
char buf2[1024];
|
||||
int w, h;
|
||||
int ok;
|
||||
|
||||
|
||||
snprintf(buf2, sizeof(buf2), "elm/icon/%s/%s", group, style);
|
||||
file = _elm_theme_group_file_find(buf2);
|
||||
if (file)
|
||||
{
|
||||
_els_smart_icon_file_edje_set(o, file, buf2);
|
||||
_els_smart_icon_size_get(o, &w, &h);
|
||||
if (w > 0) return 1;
|
||||
_els_smart_icon_file_edje_set(o, file, buf2);
|
||||
_els_smart_icon_size_get(o, &w, &h);
|
||||
if (w > 0) return 1;
|
||||
}
|
||||
snprintf(buf2, sizeof(buf2), "elm/icon/%s/default", group);
|
||||
file = _elm_theme_group_file_find(buf2);
|
||||
|
@ -149,52 +149,52 @@ _elm_theme_parse(const char *theme)
|
|||
{
|
||||
Eina_List *names = NULL;
|
||||
const char *p, *pe;
|
||||
|
||||
|
||||
p = theme;
|
||||
pe = p;
|
||||
for (;;)
|
||||
{
|
||||
if ((*pe == ':') || (*pe == 0))
|
||||
{ // p -> pe == 'name/'
|
||||
if (pe > p)
|
||||
{
|
||||
char *n = malloc(pe - p + 1);
|
||||
if (n)
|
||||
{
|
||||
const char *nn;
|
||||
strncpy(n, p, pe - p);
|
||||
n[pe - p] = 0;
|
||||
nn = eina_stringshare_add(n);
|
||||
if (nn)
|
||||
names = eina_list_append(names, nn);
|
||||
free(n);
|
||||
}
|
||||
}
|
||||
if (*pe == 0) break;
|
||||
p = pe + 1;
|
||||
pe = p;
|
||||
}
|
||||
else
|
||||
pe++;
|
||||
if ((*pe == ':') || (*pe == 0))
|
||||
{ // p -> pe == 'name/'
|
||||
if (pe > p)
|
||||
{
|
||||
char *n = malloc(pe - p + 1);
|
||||
if (n)
|
||||
{
|
||||
const char *nn;
|
||||
strncpy(n, p, pe - p);
|
||||
n[pe - p] = 0;
|
||||
nn = eina_stringshare_add(n);
|
||||
if (nn)
|
||||
names = eina_list_append(names, nn);
|
||||
free(n);
|
||||
}
|
||||
}
|
||||
if (*pe == 0) break;
|
||||
p = pe + 1;
|
||||
pe = p;
|
||||
}
|
||||
else
|
||||
pe++;
|
||||
}
|
||||
p = eina_list_data_get(eina_list_last(names));
|
||||
if ((!p) || ((p) && (strcmp(p, "default"))))
|
||||
{
|
||||
p = eina_stringshare_add("default");
|
||||
if (p)
|
||||
names = eina_list_append(names, p);
|
||||
p = eina_stringshare_add("default");
|
||||
if (p)
|
||||
names = eina_list_append(names, p);
|
||||
}
|
||||
if (cache)
|
||||
{
|
||||
eina_hash_foreach(cache, _cache_free_cb, NULL);
|
||||
eina_hash_free(cache);
|
||||
cache = NULL;
|
||||
eina_hash_foreach(cache, _cache_free_cb, NULL);
|
||||
eina_hash_free(cache);
|
||||
cache = NULL;
|
||||
}
|
||||
cache = eina_hash_string_superfast_new(NULL);
|
||||
|
||||
EINA_LIST_FREE(themes, p)
|
||||
{
|
||||
eina_stringshare_del(p);
|
||||
eina_stringshare_del(p);
|
||||
}
|
||||
|
||||
themes = names;
|
||||
|
|
|
@ -61,7 +61,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
edje_object_size_min_restricted_calc(wd->tgl, &minw, &minh, minw, minh);
|
||||
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
|
||||
|
@ -119,7 +119,7 @@ elm_toggle_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -128,7 +128,7 @@ elm_toggle_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
|
||||
|
||||
wd->tgl = edje_object_add(e);
|
||||
_elm_theme_set(wd->tgl, "toggle", "base", "default");
|
||||
wd->ontext = eina_stringshare_add("ON");
|
||||
|
@ -140,7 +140,7 @@ elm_toggle_add(Evas_Object *parent)
|
|||
edje_object_part_text_set(wd->tgl, "elm.offtext", wd->offtext);
|
||||
|
||||
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
|
||||
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -154,13 +154,13 @@ elm_toggle_label_set(Evas_Object *obj, const char *label)
|
|||
if (wd->label) eina_stringshare_del(wd->label);
|
||||
if (label)
|
||||
{
|
||||
wd->label = eina_stringshare_add(label);
|
||||
wd->label = eina_stringshare_add(label);
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,text,visible", "elm");
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
}
|
||||
else
|
||||
{
|
||||
wd->label = NULL;
|
||||
wd->label = NULL;
|
||||
edje_object_signal_emit(wd->tgl, "elm,state,text,hidden", "elm");
|
||||
edje_object_message_signal_process(wd->tgl);
|
||||
}
|
||||
|
@ -242,6 +242,6 @@ elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
|
|||
}
|
||||
else
|
||||
{
|
||||
wd->statep = NULL;
|
||||
wd->statep = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ _item_show(Elm_Toolbar_Item *it)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(it->obj);
|
||||
Evas_Coord x, y, w, h, bx, by;
|
||||
|
||||
|
||||
evas_object_geometry_get(wd->bx, &bx, &by, NULL, NULL);
|
||||
evas_object_geometry_get(it->base, &x, &y, &w, &h);
|
||||
elm_smart_scroller_child_region_show(wd->scr, x - bx, y - by, w, h);
|
||||
|
@ -47,12 +47,12 @@ _item_select(Elm_Toolbar_Item *it)
|
|||
if (it->selected) return;
|
||||
EINA_LIST_FOREACH(wd->items, l, it2)
|
||||
{
|
||||
if (it2->selected)
|
||||
{
|
||||
it2->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(it2->base, "elm,state,unselected", "elm");
|
||||
break;
|
||||
}
|
||||
if (it2->selected)
|
||||
{
|
||||
it2->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(it2->base, "elm,state,unselected", "elm");
|
||||
break;
|
||||
}
|
||||
}
|
||||
it->selected = EINA_TRUE;
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
|
@ -69,10 +69,10 @@ _del_hook(Evas_Object *obj)
|
|||
Elm_Toolbar_Item *it;
|
||||
EINA_LIST_FREE(wd->items, it)
|
||||
{
|
||||
eina_stringshare_del(it->label);
|
||||
if (it->icon) evas_object_del(it->icon);
|
||||
evas_object_del(it->base);
|
||||
free(it);
|
||||
eina_stringshare_del(it->label);
|
||||
if (it->icon) evas_object_del(it->icon);
|
||||
evas_object_del(it->base);
|
||||
free(it);
|
||||
}
|
||||
free(wd);
|
||||
}
|
||||
|
@ -89,24 +89,24 @@ _theme_hook(Evas_Object *obj)
|
|||
edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
if (it->selected)
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
_elm_theme_set(it->base, "toolbar", "item", style);
|
||||
if (it->icon)
|
||||
{
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
evas_object_size_hint_min_set(it->base, mw, mh);
|
||||
evas_object_size_hint_max_set(it->base, 9999, mh);
|
||||
edje_object_scale_set(it->base, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
if (it->selected)
|
||||
edje_object_signal_emit(it->base, "elm,state,selected", "elm");
|
||||
_elm_theme_set(it->base, "toolbar", "item", style);
|
||||
if (it->icon)
|
||||
{
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
mw = mh = -1;
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
edje_object_size_min_restricted_calc(it->base, &mw, &mh, mw, mh);
|
||||
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
|
||||
evas_object_size_hint_min_set(it->base, mw, mh);
|
||||
evas_object_size_hint_max_set(it->base, 9999, mh);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -125,13 +125,13 @@ _sizing_eval(Evas_Object *obj)
|
|||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||
if (wd->scrollable)
|
||||
{
|
||||
minw = 500 - vw;
|
||||
minh = minh + (500 - vh);
|
||||
minw = 500 - vw;
|
||||
minh = minh + (500 - vh);
|
||||
}
|
||||
else
|
||||
{
|
||||
minw = minw + (500 - vw);
|
||||
minh = minh + (500 - vh);
|
||||
minw = minw + (500 - vw);
|
||||
minh = minh + (500 - vh);
|
||||
}
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
evas_object_size_hint_max_set(obj, maxw, maxh);
|
||||
|
@ -144,23 +144,23 @@ _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
Evas_Coord mw, mh, vw, vh, w, h;
|
||||
const Eina_List *l;
|
||||
Elm_Toolbar_Item *it;
|
||||
|
||||
|
||||
elm_smart_scroller_child_viewport_size_get(wd->scr, &vw, &vh);
|
||||
evas_object_size_hint_min_get(wd->bx, &mw, &mh);
|
||||
evas_object_geometry_get(wd->bx, NULL, NULL, &w, &h);
|
||||
if (vw >= mw)
|
||||
{
|
||||
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
||||
if (w != vw) evas_object_resize(wd->bx, vw, h);
|
||||
}
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
{
|
||||
if (it->selected)
|
||||
{
|
||||
_item_show(it);
|
||||
break;
|
||||
}
|
||||
if (it->selected)
|
||||
{
|
||||
_item_show(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -175,7 +175,7 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
Evas_Object *obj;
|
||||
Evas *e;
|
||||
Widget_Data *wd;
|
||||
|
||||
|
||||
wd = ELM_NEW(Widget_Data);
|
||||
e = evas_object_evas_get(parent);
|
||||
obj = elm_widget_add(e);
|
||||
|
@ -185,18 +185,18 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_can_focus_set(obj, 0);
|
||||
|
||||
|
||||
wd->scr = elm_smart_scroller_add(e);
|
||||
elm_scroller_bounce_set(wd->scr, 1, 0);
|
||||
elm_smart_scroller_theme_set(wd->scr, "toolbar", "base", "default");
|
||||
elm_widget_resize_object_set(obj, wd->scr);
|
||||
elm_smart_scroller_policy_set(wd->scr,
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF);
|
||||
|
||||
elm_smart_scroller_policy_set(wd->scr,
|
||||
ELM_SMART_SCROLLER_POLICY_AUTO,
|
||||
ELM_SMART_SCROLLER_POLICY_OFF);
|
||||
|
||||
wd->icon_size = 32;
|
||||
wd->scrollable = EINA_TRUE;
|
||||
|
||||
|
||||
wd->bx = _els_smart_box_add(e);
|
||||
_els_smart_box_orientation_set(wd->bx, 1);
|
||||
_els_smart_box_homogenous_set(wd->bx, 1);
|
||||
|
@ -205,8 +205,8 @@ elm_toolbar_add(Evas_Object *parent)
|
|||
evas_object_show(wd->bx);
|
||||
|
||||
evas_object_event_callback_add(wd->scr, EVAS_CALLBACK_RESIZE,
|
||||
_resize, obj);
|
||||
|
||||
_resize, obj);
|
||||
|
||||
_sizing_eval(obj);
|
||||
return obj;
|
||||
}
|
||||
|
@ -227,16 +227,16 @@ elm_toolbar_item_add(Evas_Object *obj, Evas_Object *icon, const char *label, voi
|
|||
it->base = edje_object_add(evas_object_evas_get(obj));
|
||||
_elm_theme_set(it->base, "toolbar", "item", elm_widget_style_get(obj));
|
||||
edje_object_signal_callback_add(it->base, "elm,action,click", "elm",
|
||||
_select, it);
|
||||
_select, it);
|
||||
elm_widget_sub_object_add(obj, it->base);
|
||||
if (it->icon)
|
||||
{
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
evas_object_show(it->icon);
|
||||
elm_widget_sub_object_add(obj, it->icon);
|
||||
edje_extern_object_min_size_set(it->icon,
|
||||
(double)wd->icon_size * _elm_config->scale,
|
||||
(double)wd->icon_size * _elm_config->scale);
|
||||
edje_object_part_swallow(it->base, "elm.swallow.icon", it->icon);
|
||||
evas_object_show(it->icon);
|
||||
elm_widget_sub_object_add(obj, it->icon);
|
||||
}
|
||||
edje_object_part_text_set(it->base, "elm.text", it->label);
|
||||
mw = mh = -1;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#define API_ENTRY \
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj); \
|
||||
if ((!obj) || (!sd) || \
|
||||
(evas_object_type_get(obj) && \
|
||||
strcmp(evas_object_type_get(obj), SMART_NAME)))
|
||||
(evas_object_type_get(obj) && \
|
||||
strcmp(evas_object_type_get(obj), SMART_NAME)))
|
||||
#define INTERNAL_ENTRY \
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj); \
|
||||
if (!sd) return;
|
||||
|
@ -14,7 +14,7 @@
|
|||
typedef struct _Smart_Data Smart_Data;
|
||||
|
||||
struct _Smart_Data
|
||||
{
|
||||
{
|
||||
Evas_Object *obj;
|
||||
const char *type;
|
||||
Evas_Object *parent_obj;
|
||||
|
@ -44,7 +44,7 @@ struct _Smart_Data
|
|||
unsigned char child_can_focus : 1;
|
||||
unsigned char focused : 1;
|
||||
unsigned char disabled : 1;
|
||||
};
|
||||
};
|
||||
|
||||
/* local subsystem functions */
|
||||
static void _smart_reconfigure(Smart_Data *sd);
|
||||
|
@ -68,12 +68,12 @@ _sub_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
Smart_Data *sd = data;
|
||||
if (obj == sd->resize_obj)
|
||||
{
|
||||
sd->resize_obj = NULL;
|
||||
sd->resize_obj = NULL;
|
||||
}
|
||||
else if (obj == sd->hover_obj) sd->hover_obj = NULL;
|
||||
else
|
||||
{
|
||||
sd->subobjs = eina_list_remove(sd->subobjs, obj);
|
||||
sd->subobjs = eina_list_remove(sd->subobjs, obj);
|
||||
}
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", obj);
|
||||
}
|
||||
|
@ -238,11 +238,11 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
|
|||
API_ENTRY return;
|
||||
if (sd->resize_obj)
|
||||
{
|
||||
if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = NULL;
|
||||
}
|
||||
if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = NULL;
|
||||
}
|
||||
evas_object_event_callback_del(sd->resize_obj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_event_callback_del(sd->resize_obj, EVAS_CALLBACK_MOUSE_DOWN, _sub_obj_mouse_down);
|
||||
evas_object_smart_member_del(sd->resize_obj);
|
||||
|
@ -250,11 +250,11 @@ elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj)
|
|||
sd->resize_obj = sobj;
|
||||
if (sd->resize_obj)
|
||||
{
|
||||
if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = obj;
|
||||
}
|
||||
if (!strcmp(evas_object_type_get(sd->resize_obj), SMART_NAME))
|
||||
{
|
||||
Smart_Data *sd2 = evas_object_smart_data_get(sd->resize_obj);
|
||||
if (sd2) sd2->parent_obj = obj;
|
||||
}
|
||||
evas_object_clip_set(sobj, evas_object_clip_get(obj));
|
||||
evas_object_smart_member_add(sobj, obj);
|
||||
evas_object_event_callback_add(sobj, EVAS_CALLBACK_DEL, _sub_obj_del, sd);
|
||||
|
@ -331,7 +331,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
{
|
||||
API_ENTRY return 0;
|
||||
if (!elm_widget_can_focus_get(obj)) return 0;
|
||||
|
||||
|
||||
/* if it has a focus func its an end-point widget like a button */
|
||||
if (sd->focus_func)
|
||||
{
|
||||
|
@ -345,8 +345,8 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
else
|
||||
{
|
||||
int focus_next;
|
||||
int noloop = 0;
|
||||
|
||||
int noloop = 0;
|
||||
|
||||
focus_next = 0;
|
||||
if (!sd->focused)
|
||||
{
|
||||
|
@ -359,53 +359,53 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
{
|
||||
if (forward)
|
||||
{
|
||||
if (elm_widget_can_focus_get(sd->resize_obj))
|
||||
{
|
||||
if ((focus_next) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||
else noloop = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!noloop)
|
||||
{
|
||||
if (elm_widget_can_focus_get(sd->resize_obj))
|
||||
{
|
||||
if ((focus_next) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||
else noloop = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!noloop)
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_can_focus_get(child))
|
||||
{
|
||||
if ((focus_next) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||
else break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (elm_widget_can_focus_get(child))
|
||||
{
|
||||
if ((focus_next) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
/* the previous focused item was unfocused - so focus
|
||||
* the next one (that can be focused) */
|
||||
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||
else break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
/* jump to the next focused item or focus this item */
|
||||
if (elm_widget_focus_jump(child, forward)) return 1;
|
||||
/* it returned 0 - it got to the last item and is past it */
|
||||
focus_next = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -439,8 +439,8 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!l)
|
||||
{
|
||||
if (!l)
|
||||
{
|
||||
if (elm_widget_can_focus_get(sd->resize_obj))
|
||||
{
|
||||
if ((focus_next) &&
|
||||
|
@ -461,15 +461,15 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* no next item can be focused */
|
||||
if (sd->focused)
|
||||
{
|
||||
sd->focused = 0;
|
||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||
sd->focused = 0;
|
||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -492,25 +492,25 @@ elm_widget_focus_set(Evas_Object *obj, int first)
|
|||
{
|
||||
if (first)
|
||||
{
|
||||
if ((elm_widget_can_focus_get(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((elm_widget_can_focus_get(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if ((elm_widget_can_focus_get(child)) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
elm_widget_focus_set(child, first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
if ((elm_widget_can_focus_get(child)) &&
|
||||
(!elm_widget_disabled_get(child)))
|
||||
{
|
||||
elm_widget_focus_set(child, first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -525,14 +525,14 @@ elm_widget_focus_set(Evas_Object *obj, int first)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!l)
|
||||
{
|
||||
if ((elm_widget_can_focus_get(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
}
|
||||
if (!l)
|
||||
{
|
||||
if ((elm_widget_can_focus_get(sd->resize_obj)) &&
|
||||
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||
{
|
||||
elm_widget_focus_set(sd->resize_obj, first);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -551,20 +551,20 @@ elm_widget_focused_object_clear(Evas_Object *obj)
|
|||
if (!sd->focused) return;
|
||||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
{
|
||||
elm_widget_focused_object_clear(sd->resize_obj);
|
||||
elm_widget_focused_object_clear(sd->resize_obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sd->focused = 0;
|
||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||
|
@ -595,31 +595,31 @@ elm_widget_focus_steal(Evas_Object *obj)
|
|||
{
|
||||
o = elm_widget_parent_get(parent);
|
||||
if (!o) break;
|
||||
sd = evas_object_smart_data_get(o);
|
||||
if (sd->focused) break;
|
||||
sd = evas_object_smart_data_get(o);
|
||||
if (sd->focused) break;
|
||||
parent = o;
|
||||
}
|
||||
if (!elm_widget_parent_get(parent))
|
||||
elm_widget_focused_object_clear(parent);
|
||||
else
|
||||
{
|
||||
parent = elm_widget_parent_get(parent);
|
||||
sd = evas_object_smart_data_get(parent);
|
||||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
elm_widget_focused_object_clear(sd->resize_obj);
|
||||
else
|
||||
{
|
||||
parent = elm_widget_parent_get(parent);
|
||||
sd = evas_object_smart_data_get(parent);
|
||||
if (elm_widget_focus_get(sd->resize_obj))
|
||||
elm_widget_focused_object_clear(sd->resize_obj);
|
||||
else
|
||||
{
|
||||
const Eina_List *l;
|
||||
Evas_Object *child;
|
||||
EINA_LIST_FOREACH(sd->subobjs, l, child)
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
if (elm_widget_focus_get(child))
|
||||
{
|
||||
elm_widget_focused_object_clear(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_elm_widget_parent_focus(obj);
|
||||
return;
|
||||
|
@ -653,8 +653,8 @@ elm_widget_disabled_set(Evas_Object *obj, int disabled)
|
|||
Evas_Object *o, *parent;
|
||||
|
||||
parent = obj;
|
||||
for (;;)
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
o = elm_widget_parent_get(parent);
|
||||
if (!o) break;
|
||||
parent = o;
|
||||
|
@ -756,8 +756,8 @@ elm_widget_scale_set(Evas_Object *obj, double scale)
|
|||
if (scale <= 0.0) scale = 0.0;
|
||||
if (sd->scale != scale)
|
||||
{
|
||||
sd->scale = scale;
|
||||
elm_widget_theme(obj);
|
||||
sd->scale = scale;
|
||||
elm_widget_theme(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -832,7 +832,7 @@ static void
|
|||
_smart_add(Evas_Object *obj)
|
||||
{
|
||||
Smart_Data *sd;
|
||||
|
||||
|
||||
sd = calloc(1, sizeof(Smart_Data));
|
||||
if (!sd) return;
|
||||
sd->obj = obj;
|
||||
|
@ -848,29 +848,29 @@ static void
|
|||
_smart_del(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object *sobj;
|
||||
|
||||
|
||||
INTERNAL_ENTRY;
|
||||
if (sd->del_pre_func) sd->del_pre_func(obj);
|
||||
if (sd->resize_obj)
|
||||
{
|
||||
sobj = sd->resize_obj;
|
||||
sobj = sd->resize_obj;
|
||||
sd->resize_obj = NULL;
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sd->resize_obj);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sd->resize_obj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
if (sd->hover_obj)
|
||||
{
|
||||
sobj = sd->resize_obj;
|
||||
sobj = sd->resize_obj;
|
||||
sd->hover_obj = NULL;
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
EINA_LIST_FREE(sd->subobjs, sobj)
|
||||
{
|
||||
evas_object_event_callback_del(sobj, EVAS_CALLBACK_DEL, _sub_obj_del);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_smart_callback_call(sd->obj, "sub-object-del", sobj);
|
||||
evas_object_del(sobj);
|
||||
}
|
||||
if (sd->del_func) sd->del_func(obj);
|
||||
|
@ -930,7 +930,7 @@ _smart_clip_unset(Evas_Object *obj)
|
|||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_clip_unset(sd->resize_obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* never need to touch this */
|
||||
|
||||
|
@ -944,7 +944,7 @@ _smart_init(void)
|
|||
SMART_NAME,
|
||||
EVAS_SMART_CLASS_VERSION,
|
||||
_smart_add,
|
||||
_smart_del,
|
||||
_smart_del,
|
||||
_smart_move,
|
||||
_smart_resize,
|
||||
_smart_show,
|
||||
|
@ -957,6 +957,6 @@ _smart_init(void)
|
|||
NULL,
|
||||
NULL
|
||||
};
|
||||
_e_smart = evas_smart_class_new(&sc);
|
||||
_e_smart = evas_smart_class_new(&sc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ struct _Elm_Win
|
|||
Ecore_X_Window xwin;
|
||||
Ecore_Job *deferred_resize_job;
|
||||
Ecore_Job *deferred_child_eval_job;
|
||||
|
||||
|
||||
Elm_Win_Type type;
|
||||
Elm_Win_Keyboard_Mode kbdmode;
|
||||
Eina_Bool autodel : 1;
|
||||
|
@ -25,7 +25,7 @@ static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, voi
|
|||
static void _elm_win_resize(Ecore_Evas *ee);
|
||||
static void _elm_win_delete_request(Ecore_Evas *ee);
|
||||
static void _elm_win_resize_job(void *data);
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
static void _elm_win_xwin_update(Elm_Win *win);
|
||||
#endif
|
||||
static void _elm_win_eval_subobjs(Evas_Object *obj);
|
||||
|
@ -80,12 +80,12 @@ _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_inf
|
|||
while (evas_object_bottom_get(win->evas) &&
|
||||
(evas_object_bottom_get(win->evas) != obj))
|
||||
{
|
||||
evas_object_del(evas_object_bottom_get(win->evas));
|
||||
evas_object_del(evas_object_bottom_get(win->evas));
|
||||
}
|
||||
while (evas_object_top_get(win->evas) &&
|
||||
(evas_object_top_get(win->evas) != obj))
|
||||
{
|
||||
evas_object_del(evas_object_top_get(win->evas));
|
||||
evas_object_del(evas_object_top_get(win->evas));
|
||||
}
|
||||
evas_image_cache_flush(win->evas);
|
||||
evas_font_cache_flush(win->evas);
|
||||
|
@ -118,7 +118,7 @@ _elm_win_resize_job(void *data)
|
|||
const Eina_List *l;
|
||||
Evas_Object *obj;
|
||||
int w, h;
|
||||
|
||||
|
||||
win->deferred_resize_job = NULL;
|
||||
ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
|
||||
evas_object_resize(win->win_obj, w, h);
|
||||
|
@ -161,12 +161,12 @@ _elm_win_xwindow_get(Elm_Win *win)
|
|||
static void
|
||||
_elm_win_xwin_update(Elm_Win *win)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
_elm_win_xwindow_get(win);
|
||||
if (win->parent)
|
||||
{
|
||||
Elm_Win *win2;
|
||||
|
||||
|
||||
win2 = elm_widget_data_get(win->parent);
|
||||
if (win2)
|
||||
{
|
||||
|
@ -226,13 +226,13 @@ _elm_win_eval_subobjs(Evas_Object *obj)
|
|||
evas_object_size_hint_weight_get(child, &wx, &wy);
|
||||
if (wx == 0.0) xx = 0;
|
||||
if (wy == 0.0) xy = 0;
|
||||
|
||||
|
||||
evas_object_size_hint_min_get(child, &w, &h);
|
||||
if (w < 1) w = -1;
|
||||
if (h < 1) h = -1;
|
||||
if (w > minw) minw = w;
|
||||
if (h > minh) minh = h;
|
||||
|
||||
|
||||
evas_object_size_hint_max_get(child, &w, &h);
|
||||
if (w < 1) w = -1;
|
||||
if (h < 1) h = -1;
|
||||
|
@ -290,7 +290,7 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
Elm_Win *win;
|
||||
const Eina_List *l;
|
||||
const char *fontpath;
|
||||
|
||||
|
||||
win = ELM_NEW(Elm_Win);
|
||||
switch (_elm_config->engine)
|
||||
{
|
||||
|
@ -328,12 +328,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
if (_elm_config->bgpixmap && !_elm_config->compositing)
|
||||
ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
|
||||
// bg pixmap done by x - has other issues like can be redrawn by x before it
|
||||
// is filled/ready by app
|
||||
// is filled/ready by app
|
||||
// ecore_evas_avoid_damage_set(win->ee, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
|
||||
|
||||
|
||||
win->type = type;
|
||||
win->parent = parent;
|
||||
|
||||
|
||||
win->evas = ecore_evas_get(win->ee);
|
||||
win->win_obj = elm_widget_add(win->evas);
|
||||
elm_widget_type_set(win->win_obj, "win");
|
||||
|
@ -345,12 +345,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
evas_object_pass_events_set(win->win_obj, 1);
|
||||
|
||||
ecore_evas_object_associate(win->ee, win->win_obj,
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
|
||||
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
|
||||
_elm_win_obj_callback_del, win);
|
||||
|
||||
_elm_win_obj_callback_del, win);
|
||||
|
||||
ecore_evas_name_class_set(win->ee, name, _elm_appname);
|
||||
ecore_evas_callback_delete_request_set(win->ee, _elm_win_delete_request);
|
||||
ecore_evas_callback_resize_set(win->ee, _elm_win_resize);
|
||||
|
@ -372,12 +372,12 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
_elm_win_xwin_update(win);
|
||||
|
||||
_elm_win_list = eina_list_append(_elm_win_list, win->win_obj);
|
||||
|
||||
|
||||
switch (_elm_config->engine)
|
||||
{
|
||||
case ELM_SOFTWARE_16_WINCE:
|
||||
case ELM_SOFTWARE_FB:
|
||||
ecore_evas_fullscreen_set(win->ee, 1);
|
||||
ecore_evas_fullscreen_set(win->ee, 1);
|
||||
break;
|
||||
case ELM_SOFTWARE_X11:
|
||||
case ELM_SOFTWARE_16_X11:
|
||||
|
@ -425,7 +425,7 @@ elm_win_title_set(Evas_Object *obj, const char *title)
|
|||
if (!win) return;
|
||||
ecore_evas_title_set(win->ee, title);
|
||||
}
|
||||
|
||||
|
||||
EAPI void
|
||||
elm_win_autodel_set(Evas_Object *obj, Eina_Bool autodel)
|
||||
{
|
||||
|
@ -516,12 +516,12 @@ elm_win_fullscreen_set(Evas_Object *obj, Eina_Bool fullscreen)
|
|||
{
|
||||
case ELM_SOFTWARE_16_WINCE:
|
||||
case ELM_SOFTWARE_FB:
|
||||
// these engines... can ONLY be fullscreen
|
||||
break;
|
||||
// these engines... can ONLY be fullscreen
|
||||
break;
|
||||
default:
|
||||
ecore_evas_fullscreen_set(win->ee, fullscreen);
|
||||
_elm_win_xwin_update(win);
|
||||
break;
|
||||
ecore_evas_fullscreen_set(win->ee, fullscreen);
|
||||
_elm_win_xwin_update(win);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -583,11 +583,11 @@ elm_win_keyboard_mode_set(Evas_Object *obj, Elm_Win_Keyboard_Mode mode)
|
|||
if (mode == win->kbdmode) return;
|
||||
_elm_win_xwindow_get(win);
|
||||
win->kbdmode = mode;
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
if (win->xwin)
|
||||
ecore_x_e_virtual_keyboard_state_set
|
||||
(win->xwin, (Ecore_X_Virtual_Keyboard_State)win->kbdmode);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -596,11 +596,11 @@ elm_win_keyboard_win_set(Evas_Object *obj, Eina_Bool is_keyboard)
|
|||
Elm_Win *win = elm_widget_data_get(obj);
|
||||
if (!win) return;
|
||||
_elm_win_xwindow_get(win);
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
if (win->xwin)
|
||||
ecore_x_e_virtual_keyboard_set
|
||||
(win->xwin, is_keyboard);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct _Widget_Data Widget_Data;
|
||||
|
@ -639,7 +639,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
|
||||
|
||||
|
||||
evas_object_size_hint_min_get(wd->content, &minw, &minh);
|
||||
edje_object_size_min_calc(wd->frm, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
@ -661,10 +661,10 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
Evas_Object *sub = event_info;
|
||||
if (sub == wd->content)
|
||||
{
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
wd->content = NULL;
|
||||
_sizing_eval(obj);
|
||||
evas_object_event_callback_del
|
||||
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints);
|
||||
wd->content = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -682,17 +682,17 @@ elm_win_inwin_add(Evas_Object *obj)
|
|||
evas_object_size_hint_weight_set(obj2, 1.0, 1.0);
|
||||
evas_object_size_hint_align_set(obj2, -1.0, -1.0);
|
||||
elm_win_resize_object_add(obj, obj2);
|
||||
|
||||
|
||||
elm_widget_data_set(obj2, wd);
|
||||
elm_widget_del_hook_set(obj2, _del_hook);
|
||||
elm_widget_theme_hook_set(obj2, _theme_hook);
|
||||
|
||||
|
||||
wd->frm = edje_object_add(win->evas);
|
||||
_elm_theme_set(wd->frm, "win", "inwin", "default");
|
||||
elm_widget_resize_object_set(obj2, wd->frm);
|
||||
|
||||
|
||||
evas_object_smart_callback_add(obj2, "sub-object-del", _sub_del, obj2);
|
||||
|
||||
|
||||
_sizing_eval(obj2);
|
||||
return obj2;
|
||||
}
|
||||
|
@ -722,11 +722,11 @@ elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
|
|||
wd->content = content;
|
||||
if (content)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
_sizing_eval(obj);
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
|
||||
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue