Revert "Corresponding to TizenIVI3.0 M14.3, GENIVI-LayerManagement was used instead...
[profile/ivi/ico-uxf-homescreen.git] / src / homescreen / CicoHSWindow.cpp
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  */
9 /**
10  * @brief   Window class
11  *
12  * @date    Aug-08-2013
13  */
14 #include "CicoHSWindow.h"
15
16 /*============================================================================*/
17 /* functions                                                                  */
18 /*============================================================================*/
19 /*--------------------------------------------------------------------------*/
20 /**
21  * @brief   CicoHSWindow::CicoHSWindow
22  *          Constractor
23  *
24  * @param[in]   none
25  * @return      none
26  */
27 /*--------------------------------------------------------------------------*/
28 CicoHSWindow::CicoHSWindow(void)
29 {
30     window = NULL;
31 }
32 /*--------------------------------------------------------------------------*/
33 /**
34  * @brief   CicoHSWindow::~CicoHSWindow
35  *          Destractor
36  *
37  * @param[in]   none
38  * @return      none
39  */
40 /*--------------------------------------------------------------------------*/
41 CicoHSWindow::~CicoHSWindow(void)
42 {
43     /* Do not somthing to do */
44     if(window != NULL){
45         FreeWindow();
46     }
47 }
48 /*--------------------------------------------------------------------------*/
49 /**
50  * @brief   CicoHSWindow::CreateWindow
51  *          create new window(ecore evas)
52  *
53  * @param[in]   none
54  * @return      none
55  */
56 /*--------------------------------------------------------------------------*/
57 int 
58 CicoHSWindow::CreateWindow(const char *title,int pos_x,int pos_y,int width,int height,int alpha)
59 {
60  
61     this->pos_x = pos_x;
62     this->pos_y = pos_y;
63     this->width = width;
64     this->height = height;
65
66     /* Make a new ecore_evas */
67     window = ecore_evas_new(NULL, pos_x, pos_y, width, height, "frame=0");  
68     /* if do not creted new, enlightenment return NULL */
69     if (!window) {
70         EINA_LOG_CRIT("CicoHSWindow::Initialize: could not create new_window.");
71         return ICO_ERROR;
72     }
73     strncpy(this->title, title, ICO_MAX_TITLE_NAME_LEN);
74     ecore_evas_title_set(window, this->title);
75
76     /* alpha channel is enable*/
77     ecore_evas_alpha_set(window, alpha);
78
79     return ICO_OK;
80 }
81 /*--------------------------------------------------------------------------*/
82 /**
83  * @brief   CicoHSWindow::FreeWindow
84  *          Free the window(ecore evas)
85  *
86  * @param[in]   none
87  * @return      none
88  */
89 /*--------------------------------------------------------------------------*/
90 void 
91 CicoHSWindow::FreeWindow(void)
92 {
93     ecore_evas_free(window);
94 }
95 /*--------------------------------------------------------------------------*/
96 /**
97  * @brief   CicoHSWindow::WindowSetting
98  *          setting to window(ecore evas)
99  *
100  * @param[in]   none
101  * @return      none
102  */
103 /*--------------------------------------------------------------------------*/
104 void
105 CicoHSWindow::WindowSetting(int pos_x,int pos_y,int width,int height,int alpha)
106 {
107     this->pos_x = pos_x;
108     this->pos_y = pos_y;
109     this->width = width;
110     this->height = height;
111
112     /* move */
113     ecore_evas_move(window,pos_x,pos_y);
114     /* resize */
115     ecore_evas_resize(window, width, height);
116     /* alpha channel is enable*/
117     ecore_evas_alpha_set(window, alpha);
118 }
119 /*--------------------------------------------------------------------------*/
120 /**
121  * @brief   CicoHSWindow::ShowWindow
122  *          showing window(ecore evas)
123  *
124  * @param[in]   none
125  * @return      none
126  */
127 /*--------------------------------------------------------------------------*/
128 void
129 CicoHSWindow::ShowWindow(void)
130 {
131     /* showing */
132     ecore_evas_show(window);
133 }
134
135 /*--------------------------------------------------------------------------*/
136 /**
137  * @brief   CicoHSWindow::HideWindow
138  *          hiding window(ecore evas)
139  *
140  * @param[in]   none
141  * @return      none
142  */
143 /*--------------------------------------------------------------------------*/
144 void
145 CicoHSWindow::HideWindow(void)
146 {
147     /* hiding */
148     ecore_evas_hide(window);
149 }
150 // vim:set expandtab ts=4 sw=4: