ecore/examples: Follow E coding style here as a good example for others.
I had a look at the ecore_events examples and the indent was mixed with tabs and spaces. Made it really unreadable on the HTML output. Give newcomers a hand and start with the E coding style here. SVN revision: 73347
This commit is contained in:
parent
cc785441c2
commit
c41226948a
|
@ -114,3 +114,4 @@ _thaw_third_anim(void *data)
|
|||
ecore_animator_thaw(data);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,8 @@ _spawn(void *data)
|
|||
printf("***Job done***\n");
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
double done;
|
||||
eina_init();
|
||||
|
@ -75,3 +76,4 @@ int main(void)
|
|||
printf("\nTime elapsed for %i connections: %f seconds\n%s", NUM_CLIENTS, ecore_time_get() - done, eina_counter_dump(counter));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ _add(void *data, int type, Ecore_Con_Event_Server_Add *ev)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
||||
Eina_Bool
|
||||
_del(void *data, int type, Ecore_Con_Event_Server_Del *ev)
|
||||
{
|
||||
|
@ -47,7 +46,9 @@ _data(void *data, int type, Ecore_Con_Event_Server_Data *ev)
|
|||
printf(fmt, ev->data);
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
int main()
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
Ecore_Con_Server *svr;
|
||||
Eina_Iterator *it;
|
||||
|
@ -88,3 +89,4 @@ int main()
|
|||
/* start client */
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
# define __UNUSED__
|
||||
#endif
|
||||
|
||||
struct _Server {
|
||||
struct _Server
|
||||
{
|
||||
int sdata;
|
||||
};
|
||||
|
||||
|
@ -31,7 +32,6 @@ _add(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Add *ev)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
||||
Eina_Bool
|
||||
_del(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Del *ev)
|
||||
{
|
||||
|
@ -77,7 +77,8 @@ _data(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Server_Data *e
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
Ecore_Con_Server *svr;
|
||||
const char *address;
|
||||
|
@ -122,3 +123,4 @@ int main(int argc, const char *argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ _lookup_done_cb(const char *canonname, const char *ip, struct sockaddr *addr, in
|
|||
printf("addrlen = %d\n", addrlen);
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
|
@ -36,3 +37,4 @@ end:
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ _add(void *data, int type, Ecore_Con_Event_Client_Add *ev)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
||||
Eina_Bool
|
||||
_del(void *data, int type, Ecore_Con_Event_Client_Del *ev)
|
||||
{
|
||||
|
@ -48,7 +47,9 @@ _data(void *data, int type, Ecore_Con_Event_Client_Data *ev)
|
|||
printf(fmt, ev->data);
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
int main()
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
Ecore_Con_Server *svr;
|
||||
eina_init();
|
||||
|
@ -59,10 +60,8 @@ int main()
|
|||
gnutls_global_set_log_level(9);
|
||||
gnutls_global_set_log_function(tls_log_func);
|
||||
|
||||
|
||||
/* to use a PEM certificate with TLS and SSL3, uncomment the lines below */
|
||||
if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_USE_SSL3 | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL)))
|
||||
|
||||
/* to use simple tcp with ssl/tls, use this line */
|
||||
// if (!ecore_con_server_add(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_SSL3, "127.0.0.1", 8080, NULL))
|
||||
exit(1);
|
||||
|
@ -79,3 +78,4 @@ int main()
|
|||
/* start server */
|
||||
ecore_main_loop_begin();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,8 @@ static const char response_template[] =
|
|||
"\r\n"
|
||||
"%s";
|
||||
|
||||
struct _Client {
|
||||
struct _Client
|
||||
{
|
||||
int sdata;
|
||||
};
|
||||
|
||||
|
@ -46,11 +47,9 @@ _add(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev)
|
|||
ecore_con_client_send(ev->client, buf, strlen(buf));
|
||||
ecore_con_client_flush(ev->client);
|
||||
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
||||
Eina_Bool
|
||||
_del(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Del *ev)
|
||||
{
|
||||
|
@ -95,7 +94,8 @@ _data(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Data *e
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
Ecore_Con_Server *svr;
|
||||
Ecore_Con_Client *cl;
|
||||
|
@ -133,3 +133,4 @@ int main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
# define __UNUSED__
|
||||
#endif
|
||||
|
||||
struct _Client {
|
||||
struct _Client
|
||||
{
|
||||
int sdata;
|
||||
};
|
||||
|
||||
|
@ -44,7 +45,6 @@ _add(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Add *ev)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
||||
Eina_Bool
|
||||
_del(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Del *ev)
|
||||
{
|
||||
|
@ -89,7 +89,8 @@ _data(void *data __UNUSED__, int type __UNUSED__, Ecore_Con_Event_Client_Data *e
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
Ecore_Con_Server *svr;
|
||||
Ecore_Con_Client *cl;
|
||||
|
@ -129,3 +130,4 @@ int main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ _url_complete_cb(void *data __UNUSED__, int type __UNUSED__, void *event_info)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
Ecore_Con_Url *ec_url = NULL;
|
||||
char cmd = '\0';
|
||||
|
@ -90,10 +91,12 @@ int main(int argc, const char *argv[])
|
|||
printf("Cleaning previously set cookies.\n");
|
||||
ecore_con_url_cookies_clear(ec_url);
|
||||
break;
|
||||
|
||||
case 's': // clear session
|
||||
printf("Cleaning previously set session cookies.\n");
|
||||
ecore_con_url_cookies_session_clear(ec_url);
|
||||
break;
|
||||
|
||||
case 'i': // ignore session
|
||||
printf("Ignoring old session cookies.\n");
|
||||
ecore_con_url_cookies_ignore_old_session_set(ec_url, EINA_TRUE);
|
||||
|
@ -117,3 +120,4 @@ end:
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
#include <Ecore.h>
|
||||
#include <Ecore_Con.h>
|
||||
|
||||
struct _request {
|
||||
struct _request
|
||||
{
|
||||
long size;
|
||||
};
|
||||
|
||||
|
@ -46,7 +47,8 @@ _url_complete_cb(void *data, int type, void *event_info)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
Ecore_Con_Url *ec_url = NULL;
|
||||
struct _request *req;
|
||||
|
@ -108,3 +110,4 @@ end:
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ _url_complete_cb(void *data, int type, void *event_info)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
Ecore_Con_Url *ec_url = NULL;
|
||||
const char *type;
|
||||
|
@ -102,3 +103,4 @@ end:
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -86,3 +86,4 @@ main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,3 +125,4 @@ main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,11 +96,13 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_hide(ee);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
printf("show all windows\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_show(ee);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
printf("move all windows left\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
|
@ -110,6 +112,7 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
ecore_evas_move(ee, x - 10, y);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
printf("move all windows right\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
|
@ -119,6 +122,7 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
ecore_evas_move(ee, x + 10, y);
|
||||
}
|
||||
break;
|
||||
|
||||
case 't':
|
||||
printf("move all windows top\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
|
@ -128,6 +132,7 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
ecore_evas_move(ee, x, y - 10);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
printf("move all windows bottom\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
|
@ -137,6 +142,7 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
ecore_evas_move(ee, x, y + 10);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
printf("make all windows smaller\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
|
@ -146,6 +152,7 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
ecore_evas_resize(ee, w - 10, h - 10);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
printf("make all windows bigger\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
|
@ -155,40 +162,48 @@ _stdin_cb(void *data, Ecore_Fd_Handler *handler)
|
|||
ecore_evas_resize(ee, w + 10, h + 10);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
printf("make all windows unmaximized\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_maximized_set(ee, EINA_FALSE);
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
printf("make all windows maximized\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_maximized_set(ee, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
printf("make all windows uniconified\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_iconified_set(ee, EINA_FALSE);
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
printf("make all windows iconified\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_iconified_set(ee, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
printf("make all windows unfullscreen\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_fullscreen_set(ee, EINA_FALSE);
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
printf("make all windows fullscreen\n");
|
||||
EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
|
||||
ecore_evas_fullscreen_set(ee, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
printf("quit\n");
|
||||
ecore_main_loop_quit();
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!isspace(c))
|
||||
printf("Unknown command: %c\n", c);
|
||||
|
@ -251,3 +266,4 @@ main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,3 +50,4 @@ main(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,3 +23,4 @@ main(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <Ecore.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct context { // helper struct to give some context to the callbacks
|
||||
struct context // helper struct to give some context to the callbacks
|
||||
{
|
||||
const char *str1, *str2;
|
||||
Ecore_Event_Handler *handler1;
|
||||
Ecore_Event_Handler *handler2;
|
||||
|
@ -47,7 +48,8 @@ _event_handler2_cb(void *data, int type, void *event) // event callback
|
|||
return ECORE_CALLBACK_DONE; // same as EINA_FALSE
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct context ctxt = {0};
|
||||
int i;
|
||||
|
@ -84,3 +86,4 @@ int main(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ _msg_from_child_handler(void *data, int type, void *event)
|
|||
fprintf(stdout, "I received a message from my child: %s\n", msg);
|
||||
|
||||
return ECORE_CALLBACK_DONE;
|
||||
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -42,8 +41,6 @@ _sendMessage(void *data)
|
|||
fprintf(stdout,
|
||||
"I'm the father and I sent this message to the child: %s\n", msg);
|
||||
|
||||
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
@ -91,3 +88,4 @@ ecore_shutdown:
|
|||
exit:
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <unistd.h>
|
||||
#include <Ecore.h>
|
||||
|
||||
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -38,7 +37,6 @@ _fd_handler_cb(void *data, Ecore_Fd_Handler
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
||||
if (!ecore_init())
|
||||
goto error;
|
||||
|
||||
|
@ -55,3 +53,4 @@ main(int argc, char **argv)
|
|||
error:
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <Ecore.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct context {
|
||||
struct context
|
||||
{
|
||||
Ecore_Fd_Handler *handler;
|
||||
Ecore_Timer *timer;
|
||||
};
|
||||
|
@ -52,7 +53,8 @@ _timer_cb(void *data)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct context ctxt = {0};
|
||||
|
||||
|
@ -84,3 +86,4 @@ int main(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
* compile with gcc $(pkgconfig --cflags --libs gnutls ecore)
|
||||
*/
|
||||
|
||||
|
||||
#define print(...) fprintf(stderr, "line %i: ", __LINE__); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n")
|
||||
|
||||
static int done = 0;
|
||||
|
@ -31,24 +30,34 @@ SSL_GNUTLS_PRINT_HANDSHAKE_STATUS(gnutls_handshake_description_t status)
|
|||
{
|
||||
case GNUTLS_HANDSHAKE_HELLO_REQUEST:
|
||||
return "Hello request";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CLIENT_HELLO:
|
||||
return "Client hello";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SERVER_HELLO:
|
||||
return "Server hello";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CERTIFICATE_PKT:
|
||||
return "Certificate packet";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SERVER_KEY_EXCHANGE:
|
||||
return "Server key exchange";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST:
|
||||
return "Certificate request";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SERVER_HELLO_DONE:
|
||||
return "Server hello done";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CERTIFICATE_VERIFY:
|
||||
return "Certificate verify";
|
||||
|
||||
case GNUTLS_HANDSHAKE_CLIENT_KEY_EXCHANGE:
|
||||
return "Client key exchange";
|
||||
|
||||
case GNUTLS_HANDSHAKE_FINISHED:
|
||||
return "Finished";
|
||||
|
||||
case GNUTLS_HANDSHAKE_SUPPLEMENTAL:
|
||||
return "Supplemental";
|
||||
}
|
||||
|
@ -131,7 +140,6 @@ _process_data(gnutls_session_t client, Ecore_Fd_Handler *fd_handler)
|
|||
print("yarrr this be an error!");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
if (ret == GNUTLS_E_SUCCESS)
|
||||
{
|
||||
|
@ -169,7 +177,6 @@ main (void)
|
|||
gnutls_credentials_set(client, GNUTLS_CRD_CERTIFICATE, c_certcred);
|
||||
gnutls_server_name_set(client, GNUTLS_NAME_DNS, "www.verisign.com", strlen("www.verisign.com"));
|
||||
|
||||
|
||||
/* connect to the peer
|
||||
*/
|
||||
sd = tcp_connect();
|
||||
|
@ -193,3 +200,4 @@ main (void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#define DST "linux-1.0.tar.gz"
|
||||
#define DST_MIME "[x-gzip]linux-1.0.tar.gz"
|
||||
|
||||
|
||||
void
|
||||
completion_cb(void *data, const char *file, int status)
|
||||
{
|
||||
|
@ -33,8 +32,8 @@ progress_cb(void *data, const char *file,
|
|||
return ECORE_FILE_PROGRESS_CONTINUE; // continue the download
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
double start;
|
||||
Eina_Hash *headers;
|
||||
|
@ -84,3 +83,4 @@ done:
|
|||
eina_shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <Ecore.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct context { // helper struct to give some context to the callbacks
|
||||
struct context // helper struct to give some context to the callbacks
|
||||
{
|
||||
int count;
|
||||
Ecore_Idle_Enterer *enterer;
|
||||
Ecore_Idler *idler;
|
||||
|
@ -85,7 +86,8 @@ _timer_cb(void *data)
|
|||
return ECORE_CALLBACK_CANCEL; // same as EINA_FALSE
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct context ctxt = {0};
|
||||
|
||||
|
@ -110,3 +112,4 @@ int main(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ struct _Entry
|
|||
Eina_Bool have_preedit : 1;
|
||||
};
|
||||
|
||||
static void _mouse_up_cb(void *data, Evas *e, Evas_Object *o, void *event_info)
|
||||
static void
|
||||
_mouse_up_cb(void *data, Evas *e, Evas_Object *o, void *event_info)
|
||||
{
|
||||
Entry *en = data;
|
||||
if (!en) return;
|
||||
|
@ -35,7 +36,8 @@ static void _mouse_up_cb(void *data, Evas *e, Evas_Object *o, void *event_info)
|
|||
evas_object_focus_set(en->rect, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void _entry_focus_in_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
static void
|
||||
_entry_focus_in_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Entry *en = data;
|
||||
if (!en) return;
|
||||
|
@ -44,7 +46,8 @@ static void _entry_focus_in_cb(void *data, Evas *e, Evas_Object *obj, void *even
|
|||
ecore_imf_context_focus_in(en->imf_context);
|
||||
}
|
||||
|
||||
static void _entry_focus_out_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
static void
|
||||
_entry_focus_out_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Entry *en = data;
|
||||
if (!en) return;
|
||||
|
@ -92,7 +95,8 @@ _imf_cursor_info_set(Entry *en)
|
|||
ecore_imf_context_cursor_location_set(en->imf_context, x + cx, y + cy, cw, ch);
|
||||
}
|
||||
|
||||
static void _preedit_del(Entry *en)
|
||||
static void
|
||||
_preedit_del(Entry *en)
|
||||
{
|
||||
if (!en || !en->have_preedit) return;
|
||||
if (!en->preedit_start || !en->preedit_end) return;
|
||||
|
@ -165,7 +169,8 @@ _ecore_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx, void
|
|||
evas_textblock_cursor_free(del_end);
|
||||
}
|
||||
|
||||
static void _ecore_imf_event_commit_cb (void *data, Ecore_IMF_Context *ctx, void *event_info)
|
||||
static void
|
||||
_ecore_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
|
||||
{
|
||||
Entry *en = data;
|
||||
char *commit_str = (char *)event_info;
|
||||
|
@ -185,7 +190,8 @@ static void _ecore_imf_event_commit_cb (void *data, Ecore_IMF_Context *ctx, void
|
|||
return;
|
||||
}
|
||||
|
||||
static void _ecore_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
|
||||
static void
|
||||
_ecore_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
|
||||
{
|
||||
/* example how to get preedit string */
|
||||
Entry *en = data;
|
||||
|
@ -263,7 +269,8 @@ static void _ecore_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *c
|
|||
/* notify cursor information */
|
||||
_imf_cursor_info_set(en);
|
||||
|
||||
EINA_LIST_FREE(attrs, attr) free(attr);
|
||||
EINA_LIST_FREE(attrs, attr)
|
||||
free(attr);
|
||||
|
||||
free(preedit_string);
|
||||
}
|
||||
|
@ -493,7 +500,8 @@ delete_input_field(Entry *en)
|
|||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
Ecore_Evas *ee;
|
||||
Evas *evas;
|
||||
|
@ -560,3 +568,4 @@ int main(int argc, char *argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ _job_quit_cb(void *data)
|
|||
ecore_main_loop_quit();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
Ecore_Job *job1, *job2, *job3, *job_quit;
|
||||
char *str1 = "Job 1 started.";
|
||||
|
@ -46,3 +47,4 @@ int main(int argc, char **argv)
|
|||
ecore_main_loop_begin();
|
||||
ecore_shutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@ static void new_decoded_pad_cb (GstElement *demuxer,
|
|||
GstPad *new_pad,
|
||||
gpointer user_data);
|
||||
|
||||
static void handler(void *data, void *buf, unsigned int len)
|
||||
static void
|
||||
handler(void *data, void *buf, unsigned int len)
|
||||
{
|
||||
GstBuffer *buffer = *((GstBuffer **)buf);
|
||||
|
||||
|
@ -18,8 +19,8 @@ static void handler(void *data, void *buf, unsigned int len)
|
|||
gst_buffer_unref(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void handoff (GstElement* object,
|
||||
static void
|
||||
handoff(GstElement *object,
|
||||
GstBuffer *arg0,
|
||||
GstPad *arg1,
|
||||
gpointer user_data)
|
||||
|
@ -55,7 +56,8 @@ main (int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (argc < 2) {
|
||||
if (argc < 2)
|
||||
{
|
||||
g_print("usage: %s file.avi\n", argv[0]);
|
||||
ecore_pipe_del(pipe);
|
||||
ecore_shutdown();
|
||||
|
@ -65,7 +67,8 @@ main (int argc, char *argv[])
|
|||
filename = argv[1];
|
||||
|
||||
pipeline = _buid_pipeline(filename, pipe);
|
||||
if (!pipeline) {
|
||||
if (!pipeline)
|
||||
{
|
||||
g_print("Error during the pipeline building\n");
|
||||
ecore_pipe_del(pipe);
|
||||
ecore_shutdown();
|
||||
|
@ -97,11 +100,13 @@ new_decoded_pad_cb (GstElement *demuxer,
|
|||
caps = gst_pad_get_caps(new_pad);
|
||||
str = gst_caps_to_string(caps);
|
||||
|
||||
if (g_str_has_prefix (str, "video/")) {
|
||||
if (g_str_has_prefix(str, "video/"))
|
||||
{
|
||||
decoder = GST_ELEMENT(user_data);
|
||||
|
||||
pad = gst_element_get_pad(decoder, "sink");
|
||||
if (GST_PAD_LINK_FAILED (gst_pad_link (new_pad, pad))) {
|
||||
if (GST_PAD_LINK_FAILED(gst_pad_link(new_pad, pad)))
|
||||
{
|
||||
g_warning("Failed to link %s:%s to %s:%s", GST_DEBUG_PAD_NAME(new_pad),
|
||||
GST_DEBUG_PAD_NAME(pad));
|
||||
}
|
||||
|
@ -125,20 +130,23 @@ _buid_pipeline (gchar *filename, Ecore_Pipe *pipe)
|
|||
return NULL;
|
||||
|
||||
filesrc = gst_element_factory_make("filesrc", "filesrc");
|
||||
if (!filesrc) {
|
||||
if (!filesrc)
|
||||
{
|
||||
printf("no filesrc");
|
||||
goto failure;
|
||||
}
|
||||
g_object_set(G_OBJECT(filesrc), "location", filename, NULL);
|
||||
|
||||
demuxer = gst_element_factory_make("oggdemux", "demuxer");
|
||||
if (!demuxer) {
|
||||
if (!demuxer)
|
||||
{
|
||||
printf("no demux");
|
||||
goto failure;
|
||||
}
|
||||
|
||||
decoder = gst_element_factory_make("theoradec", "decoder");
|
||||
if (!decoder) {
|
||||
if (!decoder)
|
||||
{
|
||||
printf("no dec");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -147,7 +155,8 @@ _buid_pipeline (gchar *filename, Ecore_Pipe *pipe)
|
|||
G_CALLBACK(new_decoded_pad_cb), decoder);
|
||||
|
||||
sink = gst_element_factory_make("fakesink", "sink");
|
||||
if (!sink) {
|
||||
if (!sink)
|
||||
{
|
||||
printf("no sink");
|
||||
goto failure;
|
||||
}
|
||||
|
@ -178,3 +187,4 @@ _buid_pipeline (gchar *filename, Ecore_Pipe *pipe)
|
|||
gst_object_unref(GST_OBJECT(pipeline));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,3 +64,4 @@ main (int argc, char *argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,8 @@ _poller_print_cb(void *data)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
double interval = 0.3; // tick each 0.3 seconds
|
||||
Ecore_Poller *poller1, *poller2;
|
||||
|
@ -45,3 +46,4 @@ int main(int argc, char **argv)
|
|||
|
||||
ecore_shutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@ _del(void *data, int type, Ecore_Con_Event_Client_Del *ev)
|
|||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
int
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
ecore_init();
|
||||
ecore_con_init();
|
||||
|
@ -37,7 +38,6 @@ int main(int argc, const char *argv[])
|
|||
eina_log_domain_level_set("ecore_con", EINA_LOG_LEVEL_ERR);
|
||||
eina_log_domain_level_set("eina", EINA_LOG_LEVEL_ERR);
|
||||
|
||||
|
||||
/* to use a PEM certificate with TLS and SSL3, uncomment the lines below */
|
||||
// if (!(svr = ecore_con_server_add(ECORE_CON_REMOTE_NODELAY | ECORE_CON_USE_MIXED | ECORE_CON_LOAD_CERT, "127.0.0.1", 8080, NULL)))
|
||||
|
||||
|
@ -60,3 +60,4 @@ int main(int argc, const char *argv[])
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -392,3 +392,4 @@ main(int argc, char *argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@ _timer_cb(void *data)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
if (!ecore_init())
|
||||
{
|
||||
|
@ -30,3 +31,4 @@ int main(int argc, char **argv)
|
|||
ecore_main_loop_begin();
|
||||
ecore_shutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
|
||||
static double _initial_time = 0;
|
||||
|
||||
struct context { // helper struct to give some context to the callbacks
|
||||
struct context // helper struct to give some context to the callbacks
|
||||
{
|
||||
Ecore_Timer *timer1;
|
||||
Ecore_Timer *timer2;
|
||||
Ecore_Timer *timer3;
|
||||
|
@ -138,7 +139,8 @@ _timer6_cb(void *data)
|
|||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct context ctxt = {0};
|
||||
|
||||
|
@ -182,3 +184,4 @@ int main(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue