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
13 #include "CicoCommonWindow.h"
15 //--------------------------------------------------------------------------
17 * @brief default constructor
22 //--------------------------------------------------------------------------
23 CicoCommonWindow::CicoCommonWindow()
24 : window_(NULL), windowobj_(NULL),
25 posx_(0), posy_(0), width_(0), height_(0)
29 //--------------------------------------------------------------------------
36 //--------------------------------------------------------------------------
37 CicoCommonWindow::~CicoCommonWindow()
41 //--------------------------------------------------------------------------
43 * @brief terminate the window
46 * @return true on success, false on error
48 //--------------------------------------------------------------------------
50 CicoCommonWindow::Terminate(void)
52 ICO_TRA("CicoCommonWindow::Terminate Enter");
53 std::list<CicoCommonComponent*>::iterator itr, itr_end;
54 itr_end = componentlist_.end();
55 for (itr = componentlist_.begin(); itr != itr_end; itr++) {
58 componentlist_.clear();
59 ICO_TRA("CicoCommonWindow::Terminate Leave");
63 //--------------------------------------------------------------------------
65 * @brief show the window
70 //--------------------------------------------------------------------------
72 CicoCommonWindow::Show(void)
74 ICO_TRA("CicoCommonWindow::Show Enter");
75 ecore_evas_show(window_);
76 if (windowobj_ != NULL) {
77 evas_object_show(windowobj_);
78 std::list<CicoCommonComponent*>::iterator itr, itr_end;
79 itr_end = componentlist_.end();
80 for (itr = componentlist_.begin(); itr != itr_end; itr++) {
84 ICO_TRA("CicoCommonWindow::Show Leave");
87 //--------------------------------------------------------------------------
89 * @brief hide the window
94 //--------------------------------------------------------------------------
96 CicoCommonWindow::Hide(void)
98 ICO_TRA("CicoCommonWindow::Hide Enter");
99 ecore_evas_hide(window_);
100 if (windowobj_ != NULL) {
101 evas_object_hide(windowobj_);
102 std::list<CicoCommonComponent*>::iterator itr, itr_end;
103 itr_end = componentlist_.end();
104 for (itr = componentlist_.begin(); itr != itr_end; itr++) {
108 ICO_TRA("CicoCommonWindow::Show Enter");
111 //--------------------------------------------------------------------------
113 * @brief set position of the window
115 * @param[in] x position x
116 * @param[in] y position y
119 //--------------------------------------------------------------------------
121 CicoCommonWindow::SetPos(int x, int y)
125 ecore_evas_move(window_, posx_, posy_);
126 if (windowobj_ != NULL) {
127 evas_object_move(windowobj_, posx_, posy_);
128 std::list<CicoCommonComponent*>::iterator itr, itr_end;
129 itr_end = componentlist_.end();
130 for (itr = componentlist_.begin(); itr != itr_end; itr++) {
131 (*itr)->SetPos(posx_, posy_);
136 //--------------------------------------------------------------------------
138 * @brief set size of the window
140 * @param[in] w window width
141 * @param[in] h window height
144 //--------------------------------------------------------------------------
146 CicoCommonWindow::SetSize(int w, int h)
150 ecore_evas_resize(window_, width_, height_);
151 if (windowobj_ != NULL) {
152 evas_object_resize(windowobj_, width_, height_);
153 std::list<CicoCommonComponent*>::iterator itr, itr_end;
154 itr_end = componentlist_.end();
155 for (itr = componentlist_.begin(); itr != itr_end; itr++) {
156 (*itr)->SetSize(width_, height_);
161 //--------------------------------------------------------------------------
163 * @brief set component
165 * @param [in] component the object of component
168 //--------------------------------------------------------------------------
170 CicoCommonWindow::SetComponent(CicoCommonComponent *component)
172 componentlist_.push_back(component);
175 //--------------------------------------------------------------------------
177 * @brief unset component
179 * @param [in] component the object of component
182 //--------------------------------------------------------------------------
184 CicoCommonWindow::UnsetComponent(CicoCommonComponent *component)
186 componentlist_.remove(component);
188 // vim: set expandtab ts=4 sw=4: