My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gui_manager.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 /*
24  * Header for GUI manager implementation
25  */
26 
27 #ifndef __GUI_H__
28 #define __GUI_H__
29 
30 #include <sw_types.h>
31 
32 #define PORTRAIT 1
33 #define LANDSCAPE 0
34 
35 #define PASSWORD 1
36 #define NO_PASSWORD 0
37 
38 #define REPAINT 1
39 #define NO_REPAINT 0
40 
41 #define TEXT_BG 1
42 #define NO_TEXT_BG 0
43 
44 #define TITLE_BAR 1
45 #define NO_TITLE_BAR 0
46 
47 #define FONT_SIZE 8
48 
49 #define FONTDATA_LEN 1024
50 
51 extern u8 fontdata_8x8[FONTDATA_LEN];
52 
53 extern char clicked_text[500][200];
54 
55 extern s32int gui_open;
56 
60 struct gui_info {
61  s32int orientation;
62  s32int screen_width;
63  s32int screen_height;
65  s32int line_length;
66  s32int smem_length;
67 };
68 
69 extern struct gui_info gui_info;
70 
74 struct obj_values {
75  s32int button_width;
77  s32int label_width;
79  obj_x, obj_y;
83  s32int obj_coord[500][4];
84  u8* obj_str[500];
85  u8* obj_type[500];
86  u8 obj_id[500][500];
88  s32int obj_count;
89  s32int space_bw_obj;
90  u8 active_textbox[100];
91  s32int total_textbox;
92 };
93 
94 extern struct obj_values obj_val;
95 
99 struct event {
100  u32 on_touch;
102 };
103 
109 extern void set_active_textbox_layout(s32int active_tf);
110 
116 extern void set_inactive_textbox_layout(s32int active_tf);
117 
124 extern void set_event_handler(u32 touch, u32 release);
125 
131 extern void set_orientation(s32int orient);
132 
140 extern void put_pixel(s32int x, s32int y, u32 colour);
141 
151 extern void draw_line(s32int x1, s32int y1, s32int x2, s32int y2,
152  u32 colour);
153 
163 extern void fill_rect(s32int x1, s32int y1, s32int x2, s32int y2,
164  u32 colour);
165 
176 extern void set_window_values(s32int x1, s32int y1, s32int x2, s32int y2, s32int
177  titlebar,u32 colour);
178 
189 extern void bitmap_on_given_coord(s32int x, s32int y, s32int width,
190  s32int height, u32 *bmp_array, char* id);
191 
200 extern void bitmap(s32int width, s32int height, u32* bmp_array, char* id);
201 
205 extern void sw_window_init(void);
206 
210 extern void sw_window_exit(void);
211 
218 extern void sw_window_set_pixel(s32int offset, u32 colour);
219 
231 extern void set_window(s32int x1, s32int y1, s32int x2, s32int y2,
232  u8* title, u32 colour, s32int titlebar);
233 
245 extern void button_on_given_coord(s32int x, s32int y, u8* str, s32int width,
246  s32int height, u32 col, u8* id);
247 
257 extern void button(u8* id, u8* str, s32int width, s32int height, u32 colour);
258 
270 extern void label_on_given_coord(s32int x, s32int y, u8* str, u8* id,
271  s32int width, s32int height, u32 col);
272 
282 extern void label(u8* id, u8* str, s32int width, s32int height, u32 colour);
283 
296 extern void textfield_on_given_coord(s32int x, s32int y, u8* str, u8* id,
297  s32int width, s32int height, u32 col, u32 password);
298 
309 extern void textfield(u8* id, u8* str, s32int width,
310  s32int height, u32 colour, u32 password);
311 
317 extern void compute_button_width(u8* str);
318 
324 extern void compute_label_width(u8* str);
325 
331 extern void compute_textfield_width(u8* str);
332 
342 extern s32int check_space_for_object(u8* str, s32int width, s32int height);
343 
354 extern void set_object_values(u8* id, u8* str, s32int width, s32int height,
355  u8* type, u32 colour);
356 
369 extern void set_object_values_given_coord(u8* id, u8* str, s32int x, s32int y,
370  s32int width, s32int height, u8* type, u32 colour);
371 
380 extern void put_char(s32int x, s32int y, u8 c, u32 colour);
381 
392 extern void put_string(s32int x, s32int y, u8 *str, s32int length,
393  u32 col, s32int clear);
394 
401 extern void set_text(char* str, u8 id[]);
402 
403 /*Function to assign default values of the objects*/
407 void assign_obj_values();
408 
409 #endif
s32int obj_height
Definition: gui_manager.h:80
s32int orientation
Definition: gui_manager.h:61
char clicked_text[500][200]
Definition: textfield.c:30
Definition: gui_manager.h:74
void label(u8 *id, u8 *str, s32int width, s32int height, u32 colour)
Definition: label.c:41
s32int obj_width
Definition: gui_manager.h:80
Definition: gui_manager.h:60
void label_on_given_coord(s32int x, s32int y, u8 *str, u8 *id, s32int width, s32int height, u32 col)
Definition: label.c:81
void assign_obj_values()
Definition: gui_manager.c:55
void set_event_handler(u32 touch, u32 release)
Definition: gui_manager.c:289
s32int space_bw_obj
Definition: gui_manager.h:89
s32int textfield_width
Definition: gui_manager.h:76
#define FONTDATA_LEN
Definition: gui_manager.h:49
u8 fontdata_8x8[FONTDATA_LEN]
Definition: fontdata.c:28
void set_orientation(s32int orient)
Definition: gui_manager.c:46
void textfield(u8 *id, u8 *str, s32int width, s32int height, u32 colour, u32 password)
Definition: textfield.c:43
s32int smem_length
Definition: gui_manager.h:66
void compute_button_width(u8 *str)
Definition: gui_manager.c:128
void compute_textfield_width(u8 *str)
Definition: gui_manager.c:156
s32int window_y2
Definition: gui_manager.h:78
Definition: gui_manager.h:99
void set_active_textbox_layout(s32int active_tf)
Definition: gui_manager.c:300
s32int window_y1
Definition: gui_manager.h:78
u8 obj_id[500][500]
Definition: gui_manager.h:86
void put_pixel(s32int x, s32int y, u32 colour)
Definition: draw_obj.c:37
void set_window_values(s32int x1, s32int y1, s32int x2, s32int y2, s32int titlebar, u32 colour)
Definition: gui_manager.c:202
u8 * obj_type[500]
Definition: gui_manager.h:85
s32int gui_open
Definition: gui_manager.c:33
void set_window(s32int x1, s32int y1, s32int x2, s32int y2, u8 *title, u32 colour, s32int titlebar)
Definition: window.c:43
s32int curr_height
Definition: gui_manager.h:81
s32int screen_height
Definition: gui_manager.h:63
s32int screen_width
Definition: gui_manager.h:62
void textfield_on_given_coord(s32int x, s32int y, u8 *str, u8 *id, s32int width, s32int height, u32 col, u32 password)
Definition: textfield.c:87
u32 on_touch
Definition: gui_manager.h:100
void set_object_values_given_coord(u8 *id, u8 *str, s32int x, s32int y, s32int width, s32int height, u8 *type, u32 colour)
Definition: gui_manager.c:265
void fill_rect(s32int x1, s32int y1, s32int x2, s32int y2, u32 colour)
Definition: draw_obj.c:58
s32int window_x2
Definition: gui_manager.h:78
struct obj_values obj_val
Definition: gui_manager.c:37
macro save_context stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp x1
Definition: macros.h:24
s32int window_x1
Definition: gui_manager.h:78
void compute_label_width(u8 *str)
Definition: gui_manager.c:142
s32int line_length
Definition: gui_manager.h:65
s32int total_textbox
Definition: gui_manager.h:91
u8 * obj_str[500]
Definition: gui_manager.h:84
s32int check_space_for_object(u8 *str, s32int width, s32int height)
Definition: gui_manager.c:173
u8 active_textbox[100]
Definition: gui_manager.h:90
void bitmap_on_given_coord(s32int x, s32int y, s32int width, s32int height, u32 *bmp_array, char *id)
Definition: bitmap.c:39
s32int max_height
Definition: gui_manager.h:81
u32 window_color
Definition: gui_manager.h:87
void(* touch)()
Definition: touch_manager.h:32
s32int obj_count
Definition: gui_manager.h:88
void bitmap(s32int width, s32int height, u32 *bmp_array, char *id)
Definition: bitmap.c:65
s32int obj_y
Definition: gui_manager.h:78
void set_text(char *str, u8 id[])
Definition: set_text.c:40
u32 obj_color[500]
Definition: gui_manager.h:87
void set_object_values(u8 *id, u8 *str, s32int width, s32int height, u8 *type, u32 colour)
Definition: gui_manager.c:229
void put_string(s32int x, s32int y, u8 *str, s32int length, u32 col, s32int clear)
Definition: put_string.c:75
s32int label_width
Definition: gui_manager.h:77
void button_on_given_coord(s32int x, s32int y, u8 *str, s32int width, s32int height, u32 col, u8 *id)
Function to draw button given x and y coordinates.
Definition: button.c:82
s32int active_tf
Definition: virtual_keyboard_app.c:40
void button(u8 *id, u8 *str, s32int width, s32int height, u32 colour)
Definition: button.c:39
void draw_line(s32int x1, s32int y1, s32int x2, s32int y2, u32 colour)
Definition: draw_obj.c:83
void put_char(s32int x, s32int y, u8 c, u32 colour)
Definition: put_string.c:40
s32int bits_per_pixel
Definition: gui_manager.h:64
u32 on_release
Definition: gui_manager.h:101
s32int button_width
Definition: gui_manager.h:75
void sw_window_exit(void)
Definition: gui_manager.c:96
s32int obj_coord[500][4]
Definition: gui_manager.h:83
void sw_window_set_pixel(s32int offset, u32 colour)
Definition: gui_manager.c:116
s32int obj_x
Definition: gui_manager.h:78
s32int end_inserting_obj
Definition: gui_manager.h:82
macro save_context stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp!stp x2
Definition: macros.h:24
void set_inactive_textbox_layout(s32int active_tf)
Definition: gui_manager.c:319
void sw_window_init(void)
Definition: gui_manager.c:76