--- /dev/null
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __EFL_EXTENSION_CONFIG_H__
+#define __EFL_EXTENSION_CONFIG_H__
+
+#include <Elementary.h>
+
+#ifdef EAPI
+# undef EAPI
+#endif
+
+#ifdef _WIN32
+# ifdef EFL_EXTENSION_BUILD
+# ifdef DLL_EXPORT
+# define EAPI __declspec(dllexport)
+# else
+# define EAPI
+# endif /* ! DLL_EXPORT */
+# else
+# define EAPI __declspec(dllimport)
+# endif /* ! EFL_EXTENSION_BUILD */
+#else
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define EAPI __attribute__ ((visibility("default")))
+# else
+# define EAPI
+# endif
+# else
+# define EAPI
+# endif
+#endif /* ! _WIN32 */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EAPI Eina_Bool eext_config_font_set(char *name, int size);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __EFL_EXTENSION_CONFIG_H__ */
--- /dev/null
+#include "efl_extension.h"
+#include "efl_extension_private.h"
+
+#include <systemd/sd-login.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+#include <fcntl.h>
+
+#define EFL_CONFIG_SOCK_PATH "/run/user_ext/%d/system_share"
+#define EFL_CONFIG_SOCKET_FILE ".efl-config.sock"
+
+Eina_Bool _is_in_system_session()
+{
+ int ret = 0;
+ char *slice = NULL;
+
+ ret = sd_pid_get_slice(getpid(), &slice);
+ if (0 <= ret && slice)
+ {
+ if (0 == strncmp(slice, "system.slice", strlen("system.slice")))
+ {
+ free(slice);
+ return EINA_TRUE;
+ }
+ }
+ else
+ {
+ ERR("sd_pid_get_slice() Fail(%d)", ret);
+ }
+
+ free(slice);
+ return EINA_FALSE;
+}
+
+Eina_Bool _get_active_uid(uid_t *uid)
+{
+ int active_user_count = 0;
+ uid_t *active_user_list = NULL;
+
+ active_user_count = sd_get_active_uids(&active_user_list);
+ /* the number of active users is 1 in tizen3.0 */
+ if (1 == active_user_count && active_user_list)
+ {
+ *uid = active_user_list[0];
+ INF("active uid = %d", *uid);
+ }
+ else
+ {
+ ERR("sd_get_active_uids() Fail(%d)", active_user_count);
+ free(active_user_list);
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+eext_config_font_set(char *name, int size)
+{
+ int fd;
+ char sock_file[1024] = {0};
+ static char buf[1024] ={0};
+
+ uid_t active_uid = getuid();
+ Eina_Bool ret = EINA_FALSE;
+
+ if (_is_in_system_session() == EINA_TRUE)
+ {
+ if (_get_active_uid(&active_uid) == EINA_FALSE)
+ {
+ ERR("get active uid fail");
+ return EINA_FALSE;
+ }
+ }
+
+ snprintf(sock_file, sizeof(sock_file), EFL_CONFIG_SOCK_PATH"/%s",
+ active_uid,
+ EFL_CONFIG_SOCKET_FILE);
+
+ snprintf(buf, sizeof(buf), "font_name: %s, font_size: %d", name, size);
+
+ do
+ {
+ int r, size, flags;
+ struct sockaddr_un server_addr;
+
+ fd = socket(PF_UNIX, SOCK_STREAM, 0);
+ if (fd < 0)
+ {
+ ERR("socket[%d] error :%d", fd, errno);
+ break;
+ }
+
+ flags = fcntl(fd, F_GETFL, 0);
+ if (flags == -1)
+ flags = 0;
+ r = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+ if (0 != r)
+ ERR("fcntl fail : %d", errno);
+
+ bzero(&server_addr, sizeof(server_addr));
+ server_addr.sun_family = AF_UNIX;
+ snprintf(server_addr.sun_path, sizeof(server_addr.sun_path), "%s",
+ sock_file);
+
+ r = connect(fd, (struct sockaddr *)&server_addr, sizeof(server_addr));
+ if (r != 0)
+ {
+ ERR("connect error : %d, %d", r, errno);
+ close(fd);
+ break;
+ }
+
+ size = write(fd, buf, strlen(buf));
+ if (size <= 0)
+ {
+ ERR("write fail : %d", errno);
+ }
+ else
+ {
+ ret = EINA_TRUE;
+ }
+ close(fd);
+ } while (0);
+
+ return ret;
+}
+