2 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * This file is part of <starter>
5 * Written by <Seungtaek Chung> <seungtaek.chung@samsung.com>, <Mi-Ju Lee> <miju52.lee@samsung.com>, <Xi Zhichan> <zhichan.xi@samsung.com>
7 * PROPRIETARY/CONFIDENTIAL
9 * This software is the confidential and proprietary information of SAMSUNG ELECTRONICS ("Confidential Information").
10 * You shall not disclose such Confidential Information and shall use it only in accordance
11 * with the terms of the license agreement you entered into with SAMSUNG ELECTRONICS.
12 * SAMSUNG make no representations or warranties about the suitability of the software,
13 * either express or implied, including but not limited to the implied warranties of merchantability,
14 * fitness for a particular purpose, or non-infringement.
15 * SAMSUNG shall not be liable for any damages suffered by licensee as a result of using,
16 * modifying or distributing this software or its derivatives.
25 #include <X11/Xatom.h>
26 #include <X11/Xutil.h>
28 #define DEFAULT_WINDOW_H 1280
30 void prop_string_set(const char *name, const char *value)
37 if (name == NULL || value == NULL || value[0] == '\0')
40 d = XOpenDisplay(NULL);
44 a_name = XInternAtom(d, name, False);
48 a_UTF8 = XInternAtom(d, "UTF8_STRING", False);
52 xtp.value = (unsigned char *)value;
54 xtp.encoding = a_UTF8;
55 xtp.nitems = strlen(value);
57 XSetTextProperty(d, DefaultRootWindow(d), &xtp, a_name);
63 void prop_int_set(const char *name, unsigned int val)
71 d = XOpenDisplay(NULL);
75 a_name = XInternAtom(d, name, False);
79 XChangeProperty(d, DefaultRootWindow(d), a_name, XA_CARDINAL, 32,
80 PropModeReplace, (unsigned char *)&val, 1);
86 void set_window_scale(void)
88 double root_width = 0.0, root_height = 0.0;
89 char buf[128] = { 0, };
93 disp = XOpenDisplay(NULL);
97 screen_num = DefaultScreen(disp);
99 root_width = DisplayWidth(disp, screen_num);
100 root_height = DisplayHeight(disp, screen_num);
104 snprintf(buf, sizeof(buf), "%lf", root_height / DEFAULT_WINDOW_H);
106 if (root_width == 800 && root_height == 1280) {
107 snprintf(buf, sizeof(buf), "0.71");
110 setenv("ELM_SCALE", buf, 1);
111 setenv("SCALE_FACTOR", buf, 1);