2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
14 #include "CicoHSWindow.h"
16 //==========================================================================
18 //==========================================================================
19 struct created_window_name *CicoHSWindow::created_window_title = NULL;
21 /*============================================================================*/
23 /*============================================================================*/
24 /*--------------------------------------------------------------------------*/
26 * @brief CicoHSWindow::CicoHSWindow
32 /*--------------------------------------------------------------------------*/
33 CicoHSWindow::CicoHSWindow(void)
38 /*--------------------------------------------------------------------------*/
40 * @brief CicoHSWindow::~CicoHSWindow
46 /*--------------------------------------------------------------------------*/
47 CicoHSWindow::~CicoHSWindow(void)
49 /* Do not somthing to do */
55 /*--------------------------------------------------------------------------*/
57 * @brief CicoHSWindow::CreateWindow
58 * create new window(ecore evas)
63 /*--------------------------------------------------------------------------*/
65 CicoHSWindow::CreateWindow(const char *title, int pos_x, int pos_y,
66 int width, int height, int alpha)
68 struct created_window_name *winname;
69 struct created_window_name *tp;
71 ICO_DBG("CicoHSWindow::CreateWindow: Enter(%s,x/y=%d/%d,w/h=%d/%d,a=%d)",
72 title, pos_x, pos_y, width, height, alpha);
77 this->height = height;
79 /* Make a new ecore_evas */
80 window = ecore_evas_new(NULL, pos_x, pos_y, width, height, "frame=0");
81 /* if do not creted new, enlightenment return NULL */
83 ICO_ERR("CicoHSWindow::CreateWindow: could not create new_window.");
84 ICO_DBG("CicoHSWindow::CreateWindow: Leave(Error)");
87 strncpy(this->title, title, ICO_MAX_TITLE_NAME_LEN);
88 ecore_evas_title_set(window, this->title);
90 /* alpha channel is enable */
91 ecore_evas_alpha_set(window, alpha);
93 /* save window name(title) */
94 winname = (struct created_window_name *)malloc(sizeof(struct created_window_name));
96 ICO_ERR("CicoHSWindow::CreateWindow: out of memory");
97 ICO_DBG("CicoHSWindow::CreateWindow: Leave(Error)");
101 memset(winname, 0, sizeof(struct created_window_name));
102 strncpy(winname->winname, title, ICO_MAX_TITLE_NAME_LEN-1);
103 if (created_window_title) {
104 tp = created_window_title;
105 while (tp->next) tp = tp->next;
109 created_window_title = winname;
112 ICO_DBG("CicoHSWindow::CreateWindow: Leave");
116 /*--------------------------------------------------------------------------*/
118 * @brief CicoHSWindow::getWindowName
119 * get window title by window index
122 * @return window title
124 /*--------------------------------------------------------------------------*/
126 CicoHSWindow::getWindowName(const int index)
129 struct created_window_name *tp = created_window_title;
131 for (i = 0; i < index; i++) {
144 /*--------------------------------------------------------------------------*/
146 * @brief CicoHSWindow::FreeWindow
147 * Free the window(ecore evas)
152 /*--------------------------------------------------------------------------*/
154 CicoHSWindow::FreeWindow(void)
156 ecore_evas_free(window);
159 /*--------------------------------------------------------------------------*/
161 * @brief CicoHSWindow::WindowSetting
162 * setting to window(ecore evas)
167 /*--------------------------------------------------------------------------*/
169 CicoHSWindow::WindowSetting(int pos_x,int pos_y,int width,int height,int alpha)
174 this->height = height;
177 ecore_evas_move(window,pos_x,pos_y);
179 ecore_evas_resize(window, width, height);
180 /* alpha channel is enable */
181 ecore_evas_alpha_set(window, alpha);
184 /*--------------------------------------------------------------------------*/
186 * @brief CicoHSWindow::ShowWindow
187 * showing window(ecore evas)
192 /*--------------------------------------------------------------------------*/
194 CicoHSWindow::ShowWindow(void)
197 ecore_evas_show(window);
200 /*--------------------------------------------------------------------------*/
202 * @brief CicoHSWindow::HideWindow
203 * hiding window(ecore evas)
208 /*--------------------------------------------------------------------------*/
210 CicoHSWindow::HideWindow(void)
213 ecore_evas_hide(window);
215 // vim:set expandtab ts=4 sw=4: