summaryrefslogtreecommitdiff
path: root/ivi-layermanagement-examples
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2014-08-06 13:53:09 +0000
committerNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-11-13 08:34:25 +0900
commitc6b53d63f220c512418906002415ab91a8793618 (patch)
treef1c115d9e300b6f512ba1671050bc5bb8f99238d /ivi-layermanagement-examples
parentc6b51f97b6f2581b4bf3ca6a1a2d80ea50664ec7 (diff)
downloadwayland-ivi-extension-c6b53d63f220c512418906002415ab91a8793618.tar.gz
ivi-layermnagement-examples: Add command-line option for surface to EGLWLInputEventExample
Signed-off-by: James Thomas <james.thomas@codethink.co.uk>
Diffstat (limited to 'ivi-layermanagement-examples')
-rw-r--r--ivi-layermanagement-examples/EGLWLInputEventExample/src/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/ivi-layermanagement-examples/EGLWLInputEventExample/src/main.cpp b/ivi-layermanagement-examples/EGLWLInputEventExample/src/main.cpp
index 6584c42..685f8f0 100644
--- a/ivi-layermanagement-examples/EGLWLInputEventExample/src/main.cpp
+++ b/ivi-layermanagement-examples/EGLWLInputEventExample/src/main.cpp
@@ -22,6 +22,7 @@
#include <string.h>
#include <signal.h>
#include <unistd.h>
+#include <getopt.h>
#include "WLContext.h"
#include "WLEGLSurface.h"
#include "WLEyes.h"
@@ -49,6 +50,29 @@ int main(int argc, char **argv)
argc = argc; // avoid warning
argv = argv;
+
+ // Get command-line options
+ while (true){
+ int c;
+ static struct option opts[] = {
+ {"surface", required_argument, NULL, 's'},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long(argc, argv, "s:", opts, NULL);
+
+ if (c == -1)
+ break;
+
+ switch(c){
+ case 's':
+ surfaceId = strtol(optarg, NULL, 0);
+ break;
+ default:
+ fprintf(stderr, "Unrecognized option '%s'\n", optarg);
+ }
+ }
+
// signal handling
signal(SIGINT,SigFunc);