tizen 2.3.1 release
[apps/home/starter.git] / test / get_theme.c
1 /*
2  *  starter
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #include <stdio.h>
23 #include <X11/Xlib.h>
24 #include <X11/Xatom.h>
25 #include <X11/Xutil.h>
26
27 int main(int argc, char *argv[])
28 {
29         XTextProperty xtp;
30         Display *d;
31         Atom a_e17;
32         Status r;
33
34         d = XOpenDisplay(NULL);
35         if (d == NULL) {
36                 printf("Display open error\n");
37                 return 1;
38         }
39
40         a_e17 = XInternAtom(d, "ENLIGHTENMENT_THEME", False);
41         if (a_e17 == None) {
42                 printf("XInternAtom error\n");
43                 goto exit;
44         }
45
46         r = XGetTextProperty(d, DefaultRootWindow(d), &xtp, a_e17);
47         if (!r) {
48                 printf("XGetTextProperty error\n");
49                 goto exit;
50         }
51
52         printf("THEME: [%s]\n", (char *)xtp.value);
53
54         XFree(xtp.value);
55
56  exit:
57         XCloseDisplay(d);
58         return 0;
59 }