TextureBinders: Correct usage for getNativeContent()
[profile/ivi/layer-management.git] / GeniviDemo.sh
1 #!/bin/sh
2 ############################################################################
3
4 # Copyright 2010, 2011 BMW Car IT GmbH
5
6
7 # Licensed under the Apache License, Version 2.0 (the "License"); 
8 # you may not use this file except in compliance with the License. 
9 # You may obtain a copy of the License at 
10 #
11 #               http://www.apache.org/licenses/LICENSE-2.0 
12 #
13 # Unless required by applicable law or agreed to in writing, software 
14 # distributed under the License is distributed on an "AS IS" BASIS, 
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
16 # See the License for the specific language governing permissions and 
17 # limitations under the License.
18 #
19 ############################################################################
20
21 export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
22 export DISPLAY=:0.0
23 export DBUS_SESSION_BUS_ADDRESS=tcp:host=0.0.0.0,port=12434
24 PIDSURFACE1=/var/run/surface1.pid
25 PIDSURFACE2=/var/run/surface2.pid
26
27 init_scene()
28 {
29         LayerManagerClientExample
30 }
31
32 deinit_scene()
33 {
34         LayerManagerClientExample 2
35 }
36
37 start_egl_example_application()
38 {
39         EGLX11ApplicationExample &
40         pidofdlt=`ps aux | grep EGLX11ApplicationExample | grep -v grep | awk '{print $2}'`
41         echo $pidofdlt > $PIDSURFACE1
42 }
43
44 start_glx_example_application()
45 {
46         GLX11ApplicationExample &
47         pidofdlt=`ps aux | GLX11ApplicationExample | grep -v grep | awk '{print $2}'`
48         echo $pidofdlt > $PIDSURFACE2
49 }
50
51
52 killprocess()
53 {
54         if [ -f $1 ]; then
55                 kill -9 `cat $1`
56                 rm -f $1
57         fi
58 }
59 stop() 
60 {
61         killprocess $PIDSURFACE1
62         killprocess $PIDSURFACE2
63         deinit_scene
64 }
65
66
67
68 start()
69 {
70         init_scene
71         sleep 1
72         start_egl_example_application
73         sleep 2
74         start_glx_example_application
75 }
76
77 case "$1" in
78         start)
79                 start
80                 ;;
81         init_scene)
82                 init_scene
83                 ;;
84         start_example_application)
85                 start_example_application
86                 ;;
87         stop)
88                 stop
89                 ;;
90
91         *)
92                 echo "Usage: $0 {init_scene|start|start_example_application|stop"
93                 ;;
94 esac
95 exit 0