Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/exquisite
Dir : e17/apps/exquisite/src/bin
Modified Files:
main.c write.c
Log Message:
1. add -rot option for rotation
2. add a wait mode for equisite-write
===================================================================
RCS file: /cvs/e/e17/apps/exquisite/src/bin/main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- main.c 13 Jan 2008 23:09:51 -0000 1.4
+++ main.c 13 May 2008 01:12:31 -0000 1.5
@@ -68,6 +68,7 @@
int h = 480;
double fps = 60.0;
int fullscreen = 0;
+ int rot = 0;
quiet = 1;
ecore_app_args_get(&argc, &argv);
@@ -93,6 +94,11 @@
i++;
h = atoi(argv[i]);
}
+ else if ((!strcmp(argv[i], "-rot")) && (i < (argc - 1)))
+ {
+ i++;
+ rot = atoi(argv[i]);
+ }
else if ((!strcmp(argv[i], "-ic")) && (i < (argc - 1)))
{
i++;
@@ -140,6 +146,7 @@
"-t theme Use Theme file 'theme'\n"
"-x res Use horizontal res 'res'\n"
"-y res Use vertical res 'res'\n"
+ "-rot deg Use rotation 'deg' if supported by engine (0,
90, 180, 270)\n"
"-ic Kb Set image cache in Kb\n"
"-fc Kb Set font cache in Kb\n"
"-fps fps Set attempted framerate in frames per second\n"
@@ -162,7 +169,7 @@
else if (engine == GL_X)
ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, w, h);
else if (engine == FB)
- ee = ecore_evas_fb_new(NULL, 0, w, h);
+ ee = ecore_evas_fb_new(NULL, rot, w, h);
else if (engine == XRENDER_X)
ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, w, h);
if (!ee)
@@ -170,6 +177,8 @@
printf("Error. Cannot create canvas. Abort.\n");
exit(-1);
}
+
+ ecore_evas_rotation_set(ee, rot);
ecore_evas_size_min_set(ee, w, h);
ecore_evas_size_max_set(ee, w, h);
ecore_evas_callback_delete_request_set(ee, _cb_delete_request);
===================================================================
RCS file: /cvs/e/e17/apps/exquisite/src/bin/write.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- write.c 13 Jan 2008 23:09:51 -0000 1.4
+++ write.c 13 May 2008 01:12:31 -0000 1.5
@@ -22,6 +22,33 @@
static int _ipc_cb_server_data(void *data, int type, void *event);
static Ecore_Ipc_Server *_ipc_server = NULL;
+static int wait_mode = 0;
+static double wait_time = 10.0;
+static Ecore_Timer *connect_timer = NULL;
+static Ecore_Timer *connect_timeout = NULL;
+
+int
+ipc_connect_retry(void *data)
+{
+ if (getenv("EXQUISITE_IPC"))
+ _ipc_server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM,
(getenv("EXQUISITE_IPC")), 0, NULL);
+ else
+ _ipc_server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM,
"exquisite", 0, NULL);
+ if (_ipc_server)
+ {
+ connect_timer = NULL;
+ return 0;
+ }
+ return 1;
+}
+
+int
+ipc_connect_timeout(void *data)
+{
+ ecore_main_loop_quit();
+ connect_timeout = NULL;
+ return 0;
+}
void
ipc_init(void)
@@ -31,10 +58,18 @@
_ipc_server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM,
(getenv("EXQUISITE_IPC")), 0, NULL);
else
_ipc_server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM,
"exquisite", 0, NULL);
- if (!_ipc_server)
+ if (!wait_mode)
{
- _help();
- ecore_main_loop_quit();
+ if (!_ipc_server)
+ {
+ _help();
+ ecore_main_loop_quit();
+ }
+ }
+ else
+ {
+ if (!_ipc_server)
+ connect_timer = ecore_timer_add(0.1, ipc_connect_retry, NULL);
}
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD, _ipc_cb_server_add,
NULL);
ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL, _ipc_cb_server_del,
NULL);
@@ -57,7 +92,14 @@
{
if (!ecore_init()) return -1;
ecore_app_args_set(argc, (const char **)argv);
+ if ((argc == 3) && (!strcmp(argv[1], "-wait")))
+ {
+ wait_mode = 1;
+ wait_time = atof(argv[2]);
+ }
ipc_init();
+ if (wait_mode)
+ connect_timeout = ecore_timer_add(wait_time, ipc_connect_timeout, NULL);
ecore_main_loop_begin();
ipc_shutdown();
ecore_shutdown();
@@ -69,6 +111,7 @@
{
printf("Usage:\n"
" -h This help\n"
+ " -wait N Wait up to N seconds for exquisite's socket to exist
then exit\n"
" QUIT Tell splash to exit immediately\n"
" PROGRESS N Indicate boot progress is at N percent\n"
" MSG X Display string message X\n"
@@ -104,6 +147,13 @@
char buf[4096];
e = event;
+
+ if (wait_mode)
+ {
+ ecore_main_loop_quit();
+ return 1;
+ }
+
ecore_app_args_get(&argc, &argv);
/* parse options */
if (argc != 2)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs