doc:
@echo "entering doc/"
make -C doc doc
-
-maintainer-clean-local:
- rm -rf autom4te.cache
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-AC_ISC_POSIX
+
+AC_CONFIG_HEADERS([config.h])
+AH_TOP([
+#ifndef EFL_CONFIG_H__
+#define EFL_CONFIG_H__
+])
+AH_BOTTOM([
+#endif /* EFL_CONFIG_H__ */
+])
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
-AM_CONFIG_HEADER([config.h])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_GNU_SOURCE
])
AC_SUBST(LTLIBINTL)
-EFL_CHECK_PATH_MAX
-
with_max_log_level="<unset>"
AC_ARG_WITH(internal-maximum-log-level,
[AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
### Default options with respect to host
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+
# dependencies and options
want_curl="no"
want_abstract_sockets="no"
dlopen_libs="-ldl"
;;
*)
- AC_CHECK_LIB([dl], [dlopen], [dlopen_libs=-ldl])
- AC_SEARCH_LIBS([clock_gettime], [rt],
- [
- rt_libs=-lrt
- AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
+ AC_CHECK_LIB([c], [dlopen],
+ [],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [dlopen_libs=-ldl])
+ ])
+ AC_CHECK_LIB([c], [clock_gettime],
+ [AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])],
+ [AC_CHECK_LIB([rt], [clock_gettime],
+ [
+ rt_libs=-lrt
+ AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
+ ])
])
;;
esac
### Checks for header files
+EFL_CHECK_PATH_MAX
+
AC_HEADER_SYS_WAIT
+AC_SYS_LARGEFILE
have_addrinfo="no"
case "$host_os" in
AC_SUBST(lt_enable_auto_import)
### Checks for library functions
+AC_ISC_POSIX
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(gettimeofday strlcpy)
# Copyright (C) 2000 Carsten Haitzler and others.
# This file is distributed under the same license as the ecore package.
# Chris Leick <c.leick@vollbio.de>, 2009.
+# Fabian Nowak <timystery@arcor.de>, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: ecore 0.9.9.063-2\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2010-08-16 17:14+0900\n"
+"POT-Creation-Date: 2010-11-23 23:14+0100\n"
"PO-Revision-Date: 2010-01-03 21:52+GMT\n"
-"Last-Translator: Chris Leick <c.leick@vollbio.de>\n"
+"Last-Translator: Fabian Nowak <timystery@arcor.de>\n"
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
+"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/lib/ecore/ecore_getopt.c:478
msgid "Default: "
-msgstr "Vorgabe: "
+msgstr "Standard: "
#: src/lib/ecore/ecore_getopt.c:501
msgid "Choices: "
-msgstr "Auswahlen: "
+msgstr "Auswahlmöglichkeiten: "
#: src/lib/ecore/ecore_getopt.c:598
msgid "Options:\n"
#: src/lib/ecore/ecore_getopt.c:853 src/lib/ecore/ecore_getopt.c:969
#: src/lib/ecore/ecore_getopt.c:982 src/lib/ecore/ecore_getopt.c:994
#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1052
-#: src/lib/ecore/ecore_getopt.c:1161 src/lib/ecore/ecore_getopt.c:1198
+#: src/lib/ecore/ecore_getopt.c:1160 src/lib/ecore/ecore_getopt.c:1196
msgid "value has no pointer set.\n"
msgstr "kein Zeiger auf Wert gesetzt\n"
-#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1072
+#: src/lib/ecore/ecore_getopt.c:882 src/lib/ecore/ecore_getopt.c:1071
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "unbekannter boolescher Wert %s\n"
-#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1152
+#: src/lib/ecore/ecore_getopt.c:926 src/lib/ecore/ecore_getopt.c:1151
#, c-format
msgid "invalid number format %s\n"
msgstr "ungültiges Zahlenformat %s\n"
#: src/lib/ecore/ecore_getopt.c:1021
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
-msgstr "ungültige Auswahl »%s«. Gültige Werte sind: "
+msgstr "ungültige Auswahl \"%s\". Gültige Werte sind: "
#: src/lib/ecore/ecore_getopt.c:1046
msgid "missing parameter to append.\n"
-msgstr "fehlender Parameter zum Anhängen\n"
+msgstr "fehlender Parameter zum Anhängen.\n"
-#: src/lib/ecore/ecore_getopt.c:1142
+#: src/lib/ecore/ecore_getopt.c:1141
msgid "could not parse value.\n"
-msgstr "Wert kann nicht ausgewertet werden\n"
+msgstr "Wert kann nicht ausgewertet werden.\n"
-#: src/lib/ecore/ecore_getopt.c:1191
+#: src/lib/ecore/ecore_getopt.c:1190
msgid "missing parameter.\n"
-msgstr "fehlender Parameter\n"
+msgstr "fehlender Parameter.\n"
-#: src/lib/ecore/ecore_getopt.c:1205
+#: src/lib/ecore/ecore_getopt.c:1203
msgid "missing callback function!\n"
msgstr "fehlende Rückruffunktion!\n"
-#: src/lib/ecore/ecore_getopt.c:1228
+#: src/lib/ecore/ecore_getopt.c:1226
msgid "no version was defined.\n"
-msgstr "es wurde keine Version definiert.\n"
+msgstr "es wurde keine Version angegeben.\n"
-#: src/lib/ecore/ecore_getopt.c:1242
+#: src/lib/ecore/ecore_getopt.c:1240
msgid "no copyright was defined.\n"
-msgstr "es wurde kein Copyright definiert.\n"
+msgstr "es wurde kein Copyright angegeben.\n"
-#: src/lib/ecore/ecore_getopt.c:1256
+#: src/lib/ecore/ecore_getopt.c:1254
msgid "no license was defined.\n"
-msgstr "es wurde keine Lizenz definiert.\n"
+msgstr "es wurde keine Lizenz angegeben.\n"
-#: src/lib/ecore/ecore_getopt.c:1310
+#: src/lib/ecore/ecore_getopt.c:1308
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "FEHLER: Unbekannte Option --%s, ignoriert\n"
-#: src/lib/ecore/ecore_getopt.c:1343
+#: src/lib/ecore/ecore_getopt.c:1341
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "FEHLER: Option --%s benötigt ein Argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1379
+#: src/lib/ecore/ecore_getopt.c:1377
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "FEHLER: Unbekannte Option -%c, ignoriert\n"
-#: src/lib/ecore/ecore_getopt.c:1417
+#: src/lib/ecore/ecore_getopt.c:1415
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "FEHLER: Option -%c benötigt ein Argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1620
+#: src/lib/ecore/ecore_getopt.c:1614
msgid "ERROR: no parser provided.\n"
-msgstr "FEHLER: Kein Parser bereitgestellt\n"
+msgstr "FEHLER: Kein Parser bereitgestellt.\n"
-#: src/lib/ecore/ecore_getopt.c:1625
+#: src/lib/ecore/ecore_getopt.c:1619
msgid "ERROR: no values provided.\n"
-msgstr "FEHLER: Keine Werte bereitgestellt\n"
+msgstr "FEHLER: Keine Werte bereitgestellt.\n"
-#: src/lib/ecore/ecore_getopt.c:1634
+#: src/lib/ecore/ecore_getopt.c:1628
msgid "ERROR: no arguments provided.\n"
-msgstr "FEHLER: Keine Argumente bereitgestellt\n"
+msgstr "FEHLER: Keine Argumente bereitgestellt.\n"
-#: src/lib/ecore/ecore_getopt.c:1660
+#: src/lib/ecore/ecore_getopt.c:1654
msgid "ERROR: invalid options found."
-msgstr "FEHLER: Ungültige Optionen gefunden"
+msgstr "FEHLER: Ungültige Optionen gefunden."
-#: src/lib/ecore/ecore_getopt.c:1666
+#: src/lib/ecore/ecore_getopt.c:1660
#, c-format
msgid " See --%s.\n"
msgstr " Siehe --%s\n"
-#: src/lib/ecore/ecore_getopt.c:1668
+#: src/lib/ecore/ecore_getopt.c:1662
#, c-format
msgid " See -%c.\n"
msgstr " Siehe -%c\n"
-#: src/lib/ecore/ecore_getopt.c:1705
+#: src/lib/ecore/ecore_getopt.c:1699
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
-msgstr "FEHLER: Falscher Geometriewert »%s«\n"
+msgstr "FEHLER: Falscher Geometriewert \"%s\"\n"
-#: src/lib/ecore/ecore_getopt.c:1728
+#: src/lib/ecore/ecore_getopt.c:1722
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
-msgstr "FEHLER: Falscher Größenwert »%s«\n"
+msgstr "FEHLER: Falscher Größenwert \"%s\"\n"
}
if (ecore_raw_event_type == type)
event_handlers_add_list = (Ecore_Event_Handler *)eina_inlist_append(EINA_INLIST_GET(event_handlers_add_list), EINA_INLIST_GET(eh));
- else
+ else if (type < event_handlers_alloc_num)
event_handlers[type] = (Ecore_Event_Handler *)eina_inlist_append(EINA_INLIST_GET(event_handlers[type]), EINA_INLIST_GET(eh));
return eh;
}
}
}
+ if ((!args) || (!args[0]))
+ {
+ IF_FREE(buf);
+ IF_FREE(args);
+ ERR("arg[0] is NULL!");
+ return;
+ }
+
if (!(flags & ECORE_EXE_NOT_LEADER)) setsid();
if ((flags & ECORE_EXE_USE_SH))
{
static gboolean ecore_fds_ready;
#endif
+void
+_ecore_fd_valid(void)
+{
+#ifdef HAVE_EPOLL
+ if (fcntl(epoll_fd, F_GETFD) < 0)
+ {
+ ERR("arghhh you caught me! report a backtrace to edevel!");
+ pause();
+ }
+#endif
+}
+
#ifdef HAVE_EPOLL
static inline int
_ecore_get_epoll_fd(void)
{
if (errno == EBADF)
{
- WRN("fd %d was closed, can't remove from epoll - reinit!",
+ WRN("fd %d was closed, can't remove from epoll - reinit!",
fdh->fd);
_ecore_main_loop_shutdown();
_ecore_main_loop_init();
{
Ecore_Fd_Handler *fdh;
Eina_Bool pst, st;
-
+
fdh = ev[i].data.ptr;
if (!ECORE_MAGIC_CHECK(fdh, ECORE_MAGIC_FD_HANDLER))
{
Ecore_Fd_Handler *fdh;
if ((fd < 0) || (flags == 0) || (!func)) return NULL;
-
+
fdh = calloc(1, sizeof(Ecore_Fd_Handler));
if (!fdh) return NULL;
ECORE_MAGIC_SET(fdh, ECORE_MAGIC_FD_HANDLER);
ERR("fdh %p deleted twice", fd_handler);
return NULL;
}
-
+
fd_handler->delete_me = EINA_TRUE;
_ecore_main_fdh_poll_del(fd_handler);
fd_handlers_to_delete = eina_list_append(fd_handlers_to_delete, fd_handler);
fd_handlers_to_delete = eina_list_free(fd_handlers_to_delete);
if (fd_handlers_to_call)
fd_handlers_to_call = eina_list_free(fd_handlers_to_call);
-
+
fd_handlers_to_call_current = NULL;
fd_handlers_to_delete = NULL;
fd_handler_current = NULL;
{
# ifdef HAVE_GLIB
ERR("No bad fd found. Maybe a foreign fd from glib?");
-# else
+# else
ERR("No bad fd found. EEEK!");
-# endif
+# endif
}
_ecore_main_fd_handlers_cleanup();
}
deleted_in_use++;
continue;
}
-
+
win32_handlers = (Ecore_Win32_Handler *)
eina_inlist_remove(EINA_INLIST_GET(win32_handlers),
EINA_INLIST_GET(wh));
}
fdh->references--;
+ _ecore_fd_valid();
fdh->read_active = EINA_FALSE;
fdh->write_active = EINA_FALSE;
WSANETWORKEVENTS network_event;
WSAEnumNetworkEvents(sockets[result], objects[result], &network_event);
-
+
if (network_event.lNetworkEvents & FD_READ)
FD_SET(sockets[result], readfds);
if (network_event.lNetworkEvents & FD_WRITE)
FD_SET(sockets[result], writefds);
if (network_event.lNetworkEvents & FD_OOB)
FD_SET(sockets[result], exceptfds);
-
+
res = 1;
}
- else if ((result >= (WAIT_OBJECT_0 + events_nbr)) &&
+ else if ((result >= (WAIT_OBJECT_0 + events_nbr)) &&
(result < (WAIT_OBJECT_0 + objects_nbr)))
{
if (!win32_handler_current)
while (win32_handler_current)
{
wh = win32_handler_current;
-
+
if (objects[result - WAIT_OBJECT_0] == wh->h)
{
if (!wh->delete_me)
EAPI void _ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname);
void _ecore_time_init(void);
+void _ecore_fd_valid(void);
void _ecore_timer_shutdown(void);
void _ecore_timer_cleanup(void);
const char *username,
const char *password,
Eina_Bool safe);
-EAPI Eina_Bool ecore_con_url_send(Ecore_Con_Url *url_con,
+EINA_DEPRECATED EAPI Eina_Bool ecore_con_url_send(Ecore_Con_Url *url_con,
+ const void *data, long length,
+ const char *content_type);
+EAPI Eina_Bool ecore_con_url_get(Ecore_Con_Url *url_con,
+ const void *data, long length,
+ const char *content_type);
+EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con,
const void *data, long length,
const char *content_type);
EAPI void ecore_con_url_time(Ecore_Con_Url *url_con,
EAPI void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con,
Eina_Bool use_epsv);
+EAPI void ecore_con_url_cookies_init(Ecore_Con_Url *url_con);
+EAPI void ecore_con_url_cookies_ignore_old_session_set(Ecore_Con_Url *url_con,
+ Eina_Bool ignore);
+EAPI void ecore_con_url_cookies_clear(Ecore_Con_Url *url_con);
+EAPI void ecore_con_url_cookies_session_clear(Ecore_Con_Url *url_con);
+EAPI void ecore_con_url_cookies_file_add(Ecore_Con_Url *url_con,
+ const char * const file_name);
+EAPI Eina_Bool ecore_con_url_cookies_jar_file_set(Ecore_Con_Url *url_con,
+ const char * const cookiejar_file);
+EAPI void ecore_con_url_cookies_jar_write(Ecore_Con_Url *url_con);
+
/**
* @}
*/
if (svr->fd_handler)
ecore_main_fd_handler_del(svr->fd_handler);
- if (svr->fd >= 0)
+ if (svr->fd > 0)
close(svr->fd);
if (svr->write_buf)
if (svr->fd_handler)
ecore_main_fd_handler_del(svr->fd_handler);
- if (svr->fd >= 0)
+ if (svr->fd > 0)
close(svr->fd);
ecore_con_ssl_server_shutdown(svr);
if (svr->fd_handler)
ecore_main_fd_handler_del(svr->fd_handler);
- if (svr->fd >= 0)
+ if (svr->fd > 0)
close(svr->fd);
servers = eina_list_remove(servers, svr);
if (cl->fd_handler)
ecore_main_fd_handler_del(cl->fd_handler);
- if (cl->fd >= 0)
+ if (cl->fd > 0)
close(cl->fd);
if (cl->client_addr)
struct _Ecore_Con_FD
{
Ecore_Fd_Handler *handler;
- int active;
+ Ecore_Timer *timer;
int fd;
};
static ares_channel info_channel;
static int info_init = 0;
static Eina_List *info_fds = NULL;
-static int active = 0;
-static Ecore_Timer *tm = NULL;
-static fd_set info_readers, info_writers;
static void _ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg,
int status,
int status,
int timeouts,
struct hostent *hostent);
-static Eina_Bool _ecore_con_info_cares_fd_cb(void *data,
- Ecore_Fd_Handler *fd_handler);
+static Eina_Bool _ecore_con_info_cares_fd_cb(Ecore_Con_FD *ecf,
+ Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_con_info_cares_timeout_cb(void *data);
-static void _ecore_con_info_cares_clean(void);
+
+static void
+_ecore_con_info_cares_state_cb(void *data,
+ int fd,
+ int read,
+ int write);
+static int
+_ecore_con_info_fds_search(const Ecore_Con_FD *fd1,
+ const Ecore_Con_FD *fd2);
int
ecore_con_info_init(void)
{
- if (info_init == 0)
+ struct ares_options opts;
+
+ if (!info_init)
{
- if (ares_library_init(ARES_LIB_INIT_ALL) != 0)
+ if (ares_library_init(ARES_LIB_INIT_ALL))
return 0;
- if (ares_init(&info_channel) != ARES_SUCCESS)
+ opts.lookups = "fb"; /* hosts file then dns */
+ opts.sock_state_cb = _ecore_con_info_cares_state_cb;
+
+ if (ares_init_options(&info_channel, &opts,
+ ARES_OPT_LOOKUPS | ARES_OPT_SOCK_STATE_CB) != ARES_SUCCESS)
{
ares_library_cleanup();
return 0;
ares_cancel(info_channel);
ares_destroy(info_channel);
- /* Destroy FD handler here. */
/* Shutdown ares */
ares_library_cleanup();
}
cares);
}
- _ecore_con_info_cares_clean();
-
return 1;
}
-static int
-_ecore_con_info_fds_search(const Ecore_Con_FD *fd1,
- const Ecore_Con_FD *fd2)
+static Eina_Bool
+_ecore_con_info_cares_timeout_cb(void *data __UNUSED__)
{
- return fd1->fd - fd2->fd;
+ ares_process_fd(info_channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
+ return ECORE_CALLBACK_RENEW;
}
static Eina_Bool
-_ecore_con_info_fds_lookup(int fd)
+_ecore_con_info_cares_fd_cb(Ecore_Con_FD *ecf,
+ Ecore_Fd_Handler *fd_handler)
{
- Ecore_Con_FD fdl;
- Ecore_Con_FD *search;
+ int read, write;
- fdl.fd = fd;
+ read = write = ARES_SOCKET_BAD;
- search = eina_list_search_unsorted(
- info_fds, (Eina_Compare_Cb)_ecore_con_info_fds_search, &fdl);
+ if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
+ read = ecf->fd;
+ if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_WRITE))
+ write = ecf->fd;
+
+ ares_process_fd(info_channel, read, write);
- if (search)
- {
- search->active = active;
- return EINA_TRUE;
- }
+ return ECORE_CALLBACK_RENEW;
+}
- return EINA_FALSE;
+static int
+_ecore_con_info_fds_search(const Ecore_Con_FD *fd1,
+ const Ecore_Con_FD *fd2)
+{
+ return fd1->fd - fd2->fd;
}
static void
-_ecore_con_info_cares_clean(void)
+_ecore_con_info_cares_state_cb(void *data __UNUSED__,
+ int fd,
+ int read,
+ int write)
{
- fd_set readers, writers;
- Eina_List *l, *l_next;
- Ecore_Con_FD *ecf;
- int nfds;
- int i;
-
- FD_ZERO(&readers);
- FD_ZERO(&writers);
- nfds = ares_fds(info_channel, &readers, &writers);
-
- active++;
- for (i = 0; i < nfds; ++i)
- {
- int flags = 0;
-
- if (FD_ISSET(i, &readers))
- flags |= ECORE_FD_READ;
+ int flags = 0;
+ Ecore_Con_FD *search = NULL, *ecf = NULL;
- if (FD_ISSET(i, &writers))
- flags |= ECORE_FD_WRITE;
+ search = eina_list_search_unsorted(info_fds,
+ (Eina_Compare_Cb)_ecore_con_info_fds_search, &ecf);
- if (flags && (!_ecore_con_info_fds_lookup(i)))
- {
- ecf = malloc(sizeof(Ecore_Con_FD));
- if (ecf)
- {
- ecf->fd = i;
- ecf->active = active;
- ecf->handler = ecore_main_fd_handler_add(
- i, ECORE_FD_WRITE | ECORE_FD_READ,
- _ecore_con_info_cares_fd_cb,
- NULL, NULL, NULL);
- info_fds = eina_list_append(info_fds, ecf);
- }
- }
- }
-
- info_readers = readers;
- info_writers = writers;
-
- EINA_LIST_FOREACH_SAFE(info_fds, l, l_next, ecf)
+ if (!(read | write))
{
- if (ecf->active != active)
+ ares_process_fd(info_channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
+ if (search)
{
- if (ecf->handler) ecore_main_fd_handler_del(ecf->handler);
- free(ecf);
- info_fds = eina_list_remove_list(info_fds, l);
+ info_fds = eina_list_remove(info_fds, search);
+ ecore_timer_del(search->timer);
+ ecore_main_fd_handler_del(search->handler);
+ free(search);
}
+ return;
}
- if (!info_fds)
- {
- if (tm)
- ecore_timer_del(tm);
-
- tm = NULL;
- }
- else
+ if (!search)
{
- struct timeval tv;
-
- ares_timeout(info_channel, NULL, &tv);
-
- if (tm)
- ecore_timer_delay(tm, tv.tv_sec);
- else
- tm =
- ecore_timer_add((double)tv.tv_sec,
- _ecore_con_info_cares_timeout_cb,
- NULL);
+ search = malloc(sizeof(Ecore_Con_FD));
+ EINA_SAFETY_ON_NULL_RETURN(search);
+
+ search->fd = fd;
+ search->handler = ecore_main_fd_handler_add(fd, ECORE_FD_WRITE | ECORE_FD_READ,
+ (Ecore_Fd_Cb)_ecore_con_info_cares_fd_cb, search, NULL, NULL);
+ /* c-ares default timeout is 5 seconds */
+ search->timer = ecore_timer_add(5, _ecore_con_info_cares_timeout_cb, NULL);
+ info_fds = eina_list_append(info_fds, search);
}
-}
-
-static Eina_Bool
-_ecore_con_info_cares_timeout_cb(void *data __UNUSED__)
-{
- ares_process(info_channel, &info_readers, &info_writers);
- _ecore_con_info_cares_clean();
-
- return ECORE_CALLBACK_RENEW;
-}
-
-static Eina_Bool
-_ecore_con_info_cares_fd_cb(void *data __UNUSED__,
- Ecore_Fd_Handler *fd_handler __UNUSED__)
-{
- ares_process(info_channel, &info_readers, &info_writers);
- _ecore_con_info_cares_clean();
- return ECORE_CALLBACK_RENEW;
+ if (read) flags |= ECORE_FD_READ;
+ if (write) flags |= ECORE_FD_WRITE;
+ ecore_main_fd_handler_active_set(search->handler, flags);
}
static void
case ARES_EDESTRUCTION: /* request canceled, shuting down */
case ARES_ENODATA: /* no data returned */
case ARES_ECONNREFUSED: /* connection refused */
+ case ARES_ETIMEOUT: /* connection timed out */
goto on_error;
default:
tosend_len = sizeof(Ecore_Con_Info) + result->ai_addrlen +
canonname_len;
- if (!(tosend = alloca(tosend_len))) goto on_error;
+ tosend = alloca(tosend_len);
memset(tosend, 0, tosend_len);
container = (Ecore_Con_Info *)tosend;
memcpy(tosend + sizeof(Ecore_Con_Info),
result->ai_addr,
result->ai_addrlen);
- memcpy(tosend + sizeof(Ecore_Con_Info) + result->ai_addrlen,
- result->ai_canonname,
- canonname_len);
+ if (result->ai_canonname) /* FIXME: else... */
+ memcpy(tosend + sizeof(Ecore_Con_Info) + result->ai_addrlen,
+ result->ai_canonname,
+ canonname_len);
if (!getnameinfo(result->ai_addr, result->ai_addrlen,
hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),
* (and optionally the ECORE_CON_EVENT_URL_DATA event to receive
* the response, e.g. for HTTP/FTP downloads)
* 3. Set the URL with ecore_con_url_url_set(...);
- * 4. Perform the operation with ecore_con_url_send(...);
+ * 4. Perform the operation with ecore_con_url_get(...);
*
* Note that it is good to reuse Ecore_Con_Url objects wherever possible, but
* bear in mind that each one can only perform one operation at a time.
*
* Example Usage 1 (HTTP GET):
* ecore_con_url_url_set(url_con, "http://www.google.com");
- * ecore_con_url_send(url_con, NULL, 0, NULL);
+ * ecore_con_url_get(url_con, NULL, 0, NULL);
*
* Example usage 2 (HTTP POST):
* ecore_con_url_url_set(url_con, "http://www.example.com/post_handler.cgi");
- * ecore_con_url_send(url_con, data, data_length, "multipart/form-data");
+ * ecore_con_url_post(url_con, data, data_length, "multipart/form-data");
*
* Example Usage 3 (FTP download):
* ecore_con_url_url_set(url_con, "ftp://ftp.example.com/pub/myfile");
- * ecore_con_url_send(url_con, NULL, 0, NULL);
+ * ecore_con_url_get(url_con, NULL, 0, NULL);
*
* Example Usage 4 (FTP upload as ftp://ftp.example.com/file):
* ecore_con_url_url_set(url_con, "ftp://ftp.example.com");
* Adds an additional header to the request connection object.
*
* Adds an additional header to the request connection object. This addition
- * will be valid for only one ecore_con_url_send() call.
+ * will be valid for only one ecore_con_url_get() or ecore_con_url_post() call.
*
* @param url_con Connection object
* @param key Header key
* @param value Header value
*
*
- * @see ecore_con_url_send()
+ * @see ecore_con_url_get()
+ * @see ecore_con_url_post()
* @see ecore_con_url_additional_headers_clear()
*/
EAPI void
*
*
* @see ecore_con_url_additional_header_add()
- * @see ecore_con_url_send()
+ * @see ecore_con_url_get()
+ * @see ecore_con_url_post()
*/
EAPI void
ecore_con_url_additional_headers_clear(Ecore_Con_Url *url_con)
* @param condition Condition to use for HTTP requests.
* @param timestamp Time since 1 Jan 1970 to use in the condition.
*
- * @sa ecore_con_url_send()
+ * @sa ecore_con_url_get()
+ * @sa ecore_con_url_post()
*/
EAPI void
ecore_con_url_time(Ecore_Con_Url *url_con,
* @return Number of bytes received on request.
*
*
- * @see ecore_con_url_send()
+ * @see ecore_con_url_get()
+ * @see ecore_con_url_post()
*/
EAPI int
ecore_con_url_received_bytes_get(Ecore_Con_Url *url_con)
return EINA_FALSE;
}
-/**
- * Sends a request.
- *
- * @param url_con Connection object to perform a request on, previously created
- * with ecore_con_url_new() or ecore_con_url_custom_new().
- * @param data Payload (data sent on the request)
- * @param length Payload length. If @c -1, rely on automatic length
- * calculation via @c strlen() on @p data.
- * @param content_type Content type of the payload (e.g. text/xml)
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on error.
- *
- * @see ecore_con_url_custom_new()
- * @see ecore_con_url_additional_headers_clear()
- * @see ecore_con_url_additional_header_add()
- * @see ecore_con_url_data_set()
- * @see ecore_con_url_data_get()
- * @see ecore_con_url_response_headers_get()
- * @see ecore_con_url_time()
- */
-EAPI Eina_Bool
-ecore_con_url_send(Ecore_Con_Url *url_con,
- const void *data,
- long length,
- const char *content_type)
+#define MODE_AUTO 0
+#define MODE_GET 1
+#define MODE_POST 2
+
+static Eina_Bool
+_ecore_con_url_send(Ecore_Con_Url *url_con,
+ int mode,
+ const void *data,
+ long length,
+ const char *content_type)
{
#ifdef HAVE_CURL
Eina_List *l;
curl_slist_free_all(url_con->headers);
url_con->headers = NULL;
- if (data)
+ if ((mode == MODE_POST) || (mode == MODE_AUTO))
{
- if ((content_type) && (strlen(content_type) < 200))
+ if (data)
{
- snprintf(tmp, sizeof(tmp), "Content-Type: %s", content_type);
- url_con->headers = curl_slist_append(url_con->headers, tmp);
+ if ((content_type) && (strlen(content_type) < 200))
+ {
+ snprintf(tmp, sizeof(tmp), "Content-Type: %s", content_type);
+ url_con->headers = curl_slist_append(url_con->headers, tmp);
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDS, data);
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, length);
}
-
- curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDS, data);
- curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, length);
}
- else
- curl_easy_setopt(url_con->curl_easy, CURLOPT_POSTFIELDSIZE, 0);
-
+
switch (url_con->time_condition)
{
case ECORE_CON_URL_TIME_NONE:
}
/**
+ * Sends a request.
+ *
+ * @param url_con Connection object to perform a request on, previously created
+ * with ecore_con_url_new() or ecore_con_url_custom_new().
+ * @param data Payload (data sent on the request)
+ * @param length Payload length. If @c -1, rely on automatic length
+ * calculation via @c strlen() on @p data.
+ * @param content_type Content type of the payload (e.g. text/xml)
+ *
+ * @return #EINA_TRUE on success, #EINA_FALSE on error.
+ *
+ * @see ecore_con_url_custom_new()
+ * @see ecore_con_url_additional_headers_clear()
+ * @see ecore_con_url_additional_header_add()
+ * @see ecore_con_url_data_set()
+ * @see ecore_con_url_data_get()
+ * @see ecore_con_url_response_headers_get()
+ * @see ecore_con_url_time()
+ * @see ecore_con_url_get()
+ * @see ecore_con_url_post()
+ */
+EINA_DEPRECATED EAPI Eina_Bool
+ecore_con_url_send(Ecore_Con_Url *url_con,
+ const void *data,
+ long length,
+ const char *content_type)
+{
+ return _ecore_con_url_send(url_con, MODE_AUTO, data, length, content_type);
+}
+
+/**
+ * Sends a get request.
+ *
+ * @param url_con Connection object to perform a request on, previously created
+ * with ecore_con_url_new() or ecore_con_url_custom_new().
+ * @param data Payload (data sent on the request)
+ * @param length Payload length. If @c -1, rely on automatic length
+ * calculation via @c strlen() on @p data.
+ * @param content_type Content type of the payload (e.g. text/xml)
+ *
+ * @return #EINA_TRUE on success, #EINA_FALSE on error.
+ *
+ * @see ecore_con_url_custom_new()
+ * @see ecore_con_url_additional_headers_clear()
+ * @see ecore_con_url_additional_header_add()
+ * @see ecore_con_url_data_set()
+ * @see ecore_con_url_data_get()
+ * @see ecore_con_url_response_headers_get()
+ * @see ecore_con_url_time()
+ * @see ecore_con_url_post()
+ */
+EAPI Eina_Bool
+ecore_con_url_get(Ecore_Con_Url *url_con,
+ const void *data,
+ long length,
+ const char *content_type)
+{
+ return _ecore_con_url_send(url_con, MODE_GET, data, length, content_type);
+}
+
+/**
+ * Sends a post request.
+ *
+ * @param url_con Connection object to perform a request on, previously created
+ * with ecore_con_url_new() or ecore_con_url_custom_new().
+ * @param data Payload (data sent on the request)
+ * @param length Payload length. If @c -1, rely on automatic length
+ * calculation via @c strlen() on @p data.
+ * @param content_type Content type of the payload (e.g. text/xml)
+ *
+ * @return #EINA_TRUE on success, #EINA_FALSE on error.
+ *
+ * @see ecore_con_url_custom_new()
+ * @see ecore_con_url_additional_headers_clear()
+ * @see ecore_con_url_additional_header_add()
+ * @see ecore_con_url_data_set()
+ * @see ecore_con_url_data_get()
+ * @see ecore_con_url_response_headers_get()
+ * @see ecore_con_url_time()
+ * @see ecore_con_url_get()
+ */
+EAPI Eina_Bool
+ecore_con_url_post(Ecore_Con_Url *url_con,
+ const void *data,
+ long length,
+ const char *content_type)
+{
+ return _ecore_con_url_send(url_con, MODE_POST, data, length, content_type);
+}
+
+/**
* @brief Uploads a file to an ftp site.
* @param url_con The Ecore_Con_Url object to send with
* @param filename The path to the file to send
}
/**
+ * Enables the cookie engine for subsequent HTTP requests.
+ *
+ * After this function is called, cookies set by the server in HTTP responses
+ * will be parsed and stored, as well as sent back to the server in new HTTP
+ * requests.
+ *
+ * @note Even though this function is called @c ecore_con_url_cookies_init(),
+ * there is no symmetrical shutdown operation.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ */
+EAPI void
+ecore_con_url_cookies_init(Ecore_Con_Url *url_con)
+{
+#ifdef HAVE_CURL
+ if (!url_con)
+ return;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_init");
+ return;
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIEFILE, "");
+#else
+ (void)url_con;
+#endif
+}
+
+/**
+ * Controls whether session cookies from previous sessions shall be loaded.
+ *
+ * Session cookies are cookies with no expire date set, which usually means
+ * they are removed after the current session is closed.
+ *
+ * By default, when Ecore_Con_Url loads cookies from a file, all cookies are
+ * loaded, including session cookies, which, most of the time, were supposed
+ * to be loaded and valid only for that session.
+ *
+ * If @p ignore is set to @c EINA_TRUE, when Ecore_Con_Url loads cookies from
+ * the files passed to @c ecore_con_url_cookies_file_add(), session cookies
+ * will not be loaded.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ * @param ignore If @c EINA_TRUE, ignore session cookies when loading cookies
+ * from files. If @c EINA_FALSE, all cookies will be loaded.
+ *
+ * @see ecore_con_url_cookies_file_add()
+ */
+EAPI void
+ecore_con_url_cookies_ignore_old_session_set(Ecore_Con_Url *url_con, Eina_Bool ignore)
+{
+#ifdef HAVE_CURL
+ if (!url_con)
+ return;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_ignore_old_session_set");
+ return;
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIESESSION, ignore);
+#else
+ (void)url_con;
+ (void)ignore;
+#endif
+}
+
+/**
+ * Clears currently loaded cookies.
+ *
+ * The cleared cookies are removed and will not be sent in subsequent HTTP
+ * requests, nor will they be written to the cookiejar file set via
+ * @c ecore_con_url_cookies_jar_file_set().
+ *
+ * @note This function will initialize the cookie engine if it has not been
+ * initialized yet.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ *
+ * @see ecore_con_url_cookies_session_clear()
+ * @see ecore_con_url_cookies_ignore_old_session_set()
+ */
+EAPI void
+ecore_con_url_cookies_clear(Ecore_Con_Url *url_con)
+{
+#ifdef HAVE_CURL
+ if (!url_con)
+ return;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_clear");
+ return;
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIELIST, "ALL");
+#else
+ (void)url_con;
+#endif
+}
+
+/**
+ * Clears currently loaded session cookies.
+ *
+ * Session cookies are cookies with no expire date set, which usually means
+ * they are removed after the current session is closed.
+ *
+ * The cleared cookies are removed and will not be sent in subsequent HTTP
+ * requests, nor will they be written to the cookiejar file set via
+ * @c ecore_con_url_cookies_jar_file_set().
+ *
+ * @note This function will initialize the cookie engine if it has not been
+ * initialized yet.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ *
+ * @see ecore_con_url_cookies_clear()
+ * @see ecore_con_url_cookies_ignore_old_session_set()
+ */
+EAPI void
+ecore_con_url_cookies_session_clear(Ecore_Con_Url *url_con)
+{
+#ifdef HAVE_CURL
+ if (!url_con)
+ return;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_session_clear");
+ return;
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIELIST, "SESS");
+#else
+ (void)url_con;
+#endif
+}
+
+/**
+ * Adds a file to the list of files from which to load cookies.
+ *
+ * Files must contain cookies defined according to two possible formats:
+ *
+ * @li HTTP-style header ("Set-Cookie: ...").
+ * @li Netscape/Mozilla cookie data format.
+ *
+ * Please notice that the file will not be read immediately, but rather added
+ * to a list of files that will be loaded and parsed at a later time.
+ *
+ * @note This function will initialize the cookie engine if it has not been
+ * initialized yet.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ * @param file_name Name of the file that will be added to the list.
+ *
+ * @see ecore_con_url_cookies_ignore_old_session_set()
+ */
+EAPI void
+ecore_con_url_cookies_file_add(Ecore_Con_Url *url_con, const char * const file_name)
+{
+#ifdef HAVE_CURL
+ if (!url_con)
+ return;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_file_add");
+ return;
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIEFILE, file_name);
+#else
+ (void)url_con;
+ (void)file_name;
+#endif
+}
+
+/**
+ * Sets the name of the file to which all current cookies will be written when
+ * either cookies are flushed or Ecore_Con is shut down.
+ *
+ * Cookies are written following Netscape/Mozilla's data format, also known as
+ * cookie-jar.
+ *
+ * @note This function will initialize the cookie engine if it has not been
+ * initialized yet.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ * @param cookiejar_file File to which the cookies will be written.
+ *
+ * @return @c EINA_TRUE is the file name has been set successfully,
+ * @c EINA_FALSE otherwise.
+ *
+ * @see ecore_con_url_cookies_jar_write()
+ */
+EAPI Eina_Bool
+ecore_con_url_cookies_jar_file_set(Ecore_Con_Url *url_con, const char * const cookiejar_file)
+{
+#ifdef HAVE_CURL
+ CURLcode ret;
+
+ if (!url_con)
+ return EINA_FALSE;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_jar_file_set");
+ return EINA_FALSE;
+ }
+
+ ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIEJAR,
+ cookiejar_file);
+ if (ret != CURLE_OK)
+ {
+ ERR("Setting the cookie-jar name failed: %s",
+ curl_easy_strerror(ret));
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+#else
+ return EINA_FALSE;
+ (void)url_con;
+ (void)cookiejar_file;
+#endif
+}
+
+/**
+ * Writes all current cookies to the cookie jar immediately.
+ *
+ * A cookie-jar file must have been previously set by
+ * @c ecore_con_url_jar_file_set, otherwise nothing will be done.
+ *
+ * @note This function will initialize the cookie engine if it has not been
+ * initialized yet.
+ *
+ * @param url_con Ecore_Con_Url instance which will be acted upon.
+ *
+ * @see ecore_con_url_cookies_jar_file_set()
+ */
+EAPI void
+ecore_con_url_cookies_jar_write(Ecore_Con_Url *url_con)
+{
+#ifdef HAVE_CURL
+ if (!url_con)
+ return;
+
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
+ "ecore_con_url_cookies_jar_write");
+ return;
+ }
+
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIELIST, "FLUSH");
+#else
+ (void)url_con;
+#endif
+}
+
+/**
* Toggle libcurl's verbose output.
*
* If @p verbose is @c EINA_TRUE, libcurl will output a lot of verbose
}
ecore_wince_window_backend_set((Ecore_WinCE_Window *)ee->prop.window, backend);
- ecore_wince_window_suspend_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.suspend);
- ecore_wince_window_resume_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.resume);
+ ecore_wince_window_suspend_cb_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.suspend);
+ ecore_wince_window_resume_cb_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.resume);
}
ee->engine.func->fn_render = _ecore_evas_wince_render;
# include <libgen.h>
#endif
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
#ifdef HAVE_FEATURES_H
# include <features.h>
#endif
job->progress_cb = progress_cb;
_job_list = eina_list_append(_job_list, job);
- ecore_con_url_send(job->url_con, NULL, 0, NULL);
+ ecore_con_url_get(job->url_con, NULL, 0, NULL);
return job;
}
ecore_input_evas.c
libecore_input_evas_la_LIBADD = \
-$(top_builddir)/src/lib/ecore/libecore.la \
$(top_builddir)/src/lib/ecore_input/libecore_input.la \
+$(top_builddir)/src/lib/ecore/libecore.la \
@EVAS_LIBS@ \
@EINA_LIBS@ \
@EVIL_LIBS@
EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend);
-EAPI void ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int));
+EAPI void ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int));
-EAPI void ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume_cb)(int));
+EAPI void ecore_wince_window_resume_cb_set(Ecore_WinCE_Window *window, int (*resume_cb)(int));
EAPI void ecore_wince_window_geometry_get(Ecore_WinCE_Window *window,
int *x,
return;
}
- if (window->resume)
- window->resume(window->backend);
+ if (window->resume_cb)
+ window->resume_cb(window->backend);
e->window = window;
free(e);
return;
}
- if (window->suspend)
- window->suspend(window->backend);
+ if (window->suspend_cb)
+ window->suspend_cb(window->backend);
e->window = window;
};
-typedef int (*ecore_wince_suspend) (int);
-typedef int (*ecore_wince_resume) (int);
+typedef int (*ecore_wince_suspend_cb) (int);
+typedef int (*ecore_wince_resume_cb) (int);
struct _Ecore_WinCE_Window
{
- HWND window;
+ HWND window;
- int backend;
- ecore_wince_suspend suspend;
- ecore_wince_resume resume;
+ int backend;
+ ecore_wince_suspend_cb suspend_cb;
+ ecore_wince_resume_cb resume_cb;
- RECT rect; /* used to go fullscreen to normal */
+ RECT rect; /* used to go fullscreen to normal */
- unsigned int pointer_is_in : 1;
- unsigned int fullscreen : 1;
+ unsigned int pointer_is_in : 1;
+ unsigned int fullscreen : 1;
};
extern HINSTANCE _ecore_wince_instance;
* function should not be called if Ecore_Evas is used.
*/
EAPI void
-ecore_wince_window_suspend_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int))
+ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int))
{
struct _Ecore_WinCE_Window *w;
INF("setting suspend callback");
w = (struct _Ecore_WinCE_Window *)window;
- w->suspend = suspend;
+ w->suspend_cb = suspend_cb;
}
/**
* function should not be called if Ecore_Evas is used.
*/
EAPI void
-ecore_wince_window_resume_set(Ecore_WinCE_Window *window, int (*resume_cb)(int))
+ecore_wince_window_resume_cb_set(Ecore_WinCE_Window *window, int (*resume_cb)(int))
{
struct _Ecore_WinCE_Window *w;
INF("setting resume callback");
w = (struct _Ecore_WinCE_Window *)window;
- w->resume = resume;
+ w->resume_cb = resume_cb;
}
/**
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (pixmap)
- ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_DUMP,
+ ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_PIXMAP,
ECORE_X_ATOM_PIXMAP, &pixmap, 1);
else
ecore_x_window_prop_property_del(win, pixmap);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret =
ecore_x_window_prop_xid_get(win,
- ECORE_X_ATOM_E_COMP_DUMP,
+ ECORE_X_ATOM_E_COMP_PIXMAP,
ECORE_X_ATOM_PIXMAP,
&pixmap, 1);
if (ret != 1)
_ecore_x_event_handle_any_event(XEvent *xevent)
{
XEvent *ev = malloc(sizeof(XEvent));
-
+ if (!ev) return;
memcpy(ev, xevent, sizeof(XEvent));
ecore_event_add(ECORE_X_EVENT_ANY, ev, NULL, NULL);
} /* _ecore_x_event_handle_any_event */
_randr_minor = 3;
_randr_version = 0;
- _ecore_x_disp = _ecore_x_disp;
_ecore_x_randr_get_screen_resources = NULL;
if (XRRQueryVersion(_ecore_x_disp, &_randr_major, &_randr_minor))
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
XRRScreenResources *res = NULL;
- XRRCrtcInfo *crtc_info[ncrtc];
+ XRRCrtcInfo **crtc_info = NULL;
Eina_Bool ret = EINA_TRUE;
int i, cw, ch, w_max, h_max, nw, nh;
+ crtc_info = alloca(sizeof(XRRCrtcInfo *) * ncrtc);
+ memset(crtc_info, 0, sizeof(XRRCrtcInfo *) * ncrtc);
if (_ecore_x_randr_root_validate(root)
&& (res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
{
goto _ecore_x_randr_move_crtcs_fail_free_crtc_info;
//actually move all the crtcs, keep their rotation and mode.
- for (i = 0; i < ncrtc; i++)
+ for (i = 0; (i < ncrtc) && crtc_info[i]; i++)
{
- if (!ecore_x_randr_crtc_settings_set(root, crtcs[i], NULL,
- Ecore_X_Randr_Unset,
- (crtc_info[i]->x + dx),
- (crtc_info[i]->y + dy),
- crtc_info[i]->mode,
- crtc_info[i]->rotation))
+ if ((crtc_info[i]) &&
+ (!ecore_x_randr_crtc_settings_set(root, crtcs[i], NULL,
+ Ecore_X_Randr_Unset,
+ (crtc_info[i]->x + dx),
+ (crtc_info[i]->y + dy),
+ crtc_info[i]->mode,
+ crtc_info[i]->rotation)))
{
ret = EINA_FALSE;
break;
{
//something went wrong, let's try to move the already moved crtcs
//back.
- while (i-- >= 0)
- ecore_x_randr_crtc_settings_set(root,
- crtcs[i],
- NULL,
- Ecore_X_Randr_Unset,
- (crtc_info[i]->x - dx),
- (crtc_info[i]->y - dy),
- crtc_info[i]->mode,
- crtc_info[i]->rotation);
+ while ((i--) >= 0)
+ {
+ if (crtc_info[i])
+ ecore_x_randr_crtc_settings_set(root,
+ crtcs[i],
+ NULL,
+ Ecore_X_Randr_Unset,
+ (crtc_info[i]->x - dx),
+ (crtc_info[i]->y - dy),
+ crtc_info[i]->mode,
+ crtc_info[i]->rotation);
+ }
}
for (i = 0; i < ncrtc; i++)
{
- XRRFreeCrtcInfo(crtc_info[i]);
+ if (crtc_info[i]) XRRFreeCrtcInfo(crtc_info[i]);
}
}
return EINA_TRUE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- return !XEmptyRegion((Region)region) ? EINA_TRUE : EINA_FALSE;
+ return XEmptyRegion((Region)region) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_xregion_is_empty */
EAPI Eina_Bool