2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
21 #include "indicator.h"
22 #include "indicator_ui.h"
23 #include "indicator_gui.h"
24 #include "indicator_util.h"
25 #include "indicator_icon_util.h"
26 #include "indicator_box_util.h"
29 #define DEFAULT_DIR ICONDIR
30 #define DIR_PREFIX "Theme_%02d_"
31 #define LABEL_STRING "<color=#%02x%02x%02x%02x>%s</color>"
33 static char *_icondir;
35 char *set_label_text_color(const char *txt)
37 Eina_Strbuf *temp_buf = NULL;
38 Eina_Bool buf_result = EINA_FALSE;
41 retif(txt == NULL, NULL, "Invalid parameter!");
43 temp_buf = eina_strbuf_new();
44 buf_result = eina_strbuf_append_printf(temp_buf,
45 LABEL_STRING, FONT_COLOR, txt);
47 if (buf_result == EINA_FALSE)
48 INFO("Failed to make label string!");
50 ret_str = eina_strbuf_string_steal(temp_buf);
52 eina_strbuf_free(temp_buf);
56 const char *get_icon_dir(void)
59 _icondir = DEFAULT_DIR;
61 return (const char *)_icondir;
64 static int _set_icon_dir(char *newdir)
66 char *new_icon_dir = NULL;
68 char dirname[PATH_MAX];
71 retif(!newdir, FAIL, "Invalid parameter!");
72 memset(dirname, 0x00, sizeof(dirname));
73 r = snprintf(dirname, sizeof(dirname), ICONDIR "/%s", newdir);
75 ERR("Failed to set new dir name!");
79 if (new_icon_dir != NULL)
82 new_icon_dir = strdup(dirname);
83 _icondir = new_icon_dir;