Subversion Repositories Kolibri OS

Rev

Rev 6470 | Rev 6482 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6470 Rev 6479
Line 1... Line 1...
1
#ifndef KOLIBRI_GUI_ELEMENTS_H
1
#ifndef KOLIBRI_GUI_ELEMENTS_H
2
#define KOLIBRI_GUI_ELEMENTS_H
2
#define KOLIBRI_GUI_ELEMENTS_H
Line 3... Line -...
3
 
-
 
4
/* GUI Elements being used */
-
 
5
#include "kolibri_editbox.h"
-
 
6
#include "kolibri_checkbox.h"
-
 
7
#include "kolibri_button.h"
-
 
8
#include "kolibri_progressbar.h"
-
 
9
#include "kolibri_frame.h"
3
 
10
#include "kolibri_scrollbar.h"
-
 
11
#include "kolibri_statictext.h"
-
 
12
 
-
 
Line 13... Line 4...
13
#define X_Y(x,y) (((x)<<16)|(y))
4
#include "kolibri_colors.h"
14
 
5
 
15
/* enum KOLIBRI_GUI_ELEMENT_TYPE contains all available GUI items from box_lib */
6
/* enum KOLIBRI_GUI_ELEMENT_TYPE contains all available GUI items from box_lib */
16
/* More elements can be added from other libraries as required */
7
/* More elements can be added from other libraries as required */
17
enum KOLIBRI_GUI_ELEMENT_TYPE {
8
enum KOLIBRI_GUI_ELEMENT_TYPE {
18
  KOLIBRI_EDIT_BOX,
9
  KOLIBRI_EDIT_BOX,
19
  KOLIBRI_CHECK_BOX,
10
  KOLIBRI_CHECK_BOX,
20
  KOLIBRI_RADIO_BUTTON,
11
  KOLIBRI_OPTIONGROUP,
21
  KOLIBRI_SCROLL_BAR_H,
12
  KOLIBRI_SCROLL_BAR_H,
22
  KOLIBRI_SCROLL_BAR_V,
13
  KOLIBRI_SCROLL_BAR_V,
23
  KOLIBRI_DYNAMIC_BUTTON,
14
  KOLIBRI_DYNAMIC_BUTTON,
Line 66... Line 57...
66
 
57
 
67
  kolibri_window_element *elements;
58
  kolibri_window_element *elements;
Line 68... Line 59...
68
}kolibri_window;
59
}kolibri_window;
-
 
60
 
-
 
61
/*---------------------End of Structure and enum definitions---------------*/
-
 
62
 
-
 
63
void kolibri_window_add_element(kolibri_window *some_window, enum KOLIBRI_GUI_ELEMENT_TYPE element_type, void *some_gui_element); // forward declaration
-
 
64
 
-
 
65
/* GUI Elements being used */
-
 
66
#include "kolibri_editbox.h"
-
 
67
#include "kolibri_checkbox.h"
-
 
68
#include "kolibri_button.h"
-
 
69
#include "kolibri_progressbar.h"
-
 
70
#include "kolibri_frame.h"
-
 
71
#include "kolibri_scrollbar.h"
-
 
72
#include "kolibri_statictext.h"
-
 
73
#include "kolibri_optionbox.h"
-
 
74
 
-
 
75
#define X_Y(x,y) (((x)<<16)|(y))
-
 
76
 
69
 
77
 
Line 70... Line 78...
70
/*---------------------End of Structure and enum definitions---------------*/
78
 
71
/*---------------------Define various functions for initializing GUI-------*/
79
/*---------------------Define various functions for initializing GUI-------*/
Line 92... Line 100...
92
 
100
 
93
/* Setting up functions for progress bar GUI elements*/
101
/* Setting up functions for progress bar GUI elements*/
94
kolibri_gui_op_table[KOLIBRI_PROGRESS_BAR].redraw_fn = (cb_elem_boxlib)progressbar_draw;
102
kolibri_gui_op_table[KOLIBRI_PROGRESS_BAR].redraw_fn = (cb_elem_boxlib)progressbar_draw;
95
kolibri_gui_op_table[KOLIBRI_PROGRESS_BAR].mouse_fn = NULL;
103
kolibri_gui_op_table[KOLIBRI_PROGRESS_BAR].mouse_fn = NULL;
96
kolibri_gui_op_table[KOLIBRI_PROGRESS_BAR].key_fn = NULL;
-
 
Line 97... Line 104...
97
debug_board_printf("PROGRESS (%x,%x,%x)\n", progressbar_draw,0,0);
104
kolibri_gui_op_table[KOLIBRI_PROGRESS_BAR].key_fn = NULL;
98
 
105
 
99
/* Setting up functions for frame GUI elements*/
106
/* Setting up functions for frame GUI elements*/
100
kolibri_gui_op_table[KOLIBRI_FRAME].redraw_fn = (cb_elem_boxlib)frame_draw;
107
kolibri_gui_op_table[KOLIBRI_FRAME].redraw_fn = (cb_elem_boxlib)frame_draw;
Line 101... Line -...
101
kolibri_gui_op_table[KOLIBRI_FRAME].mouse_fn = NULL;
-
 
102
kolibri_gui_op_table[KOLIBRI_FRAME].key_fn = NULL;
-
 
103
 
-
 
104
debug_board_printf("FRAME (%x,%x,%x)\n", frame_draw,0,0);
108
kolibri_gui_op_table[KOLIBRI_FRAME].mouse_fn = NULL;
105
 
109
kolibri_gui_op_table[KOLIBRI_FRAME].key_fn = NULL;
106
 
110
 
107
/* scrollbars */
111
/* scrollbars */
108
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_H].redraw_fn = (cb_elem_boxlib)scrollbar_h_draw;
-
 
Line 109... Line 112...
109
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_H].mouse_fn = (cb_elem_boxlib)scrollbar_h_mouse;
112
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_H].redraw_fn = (cb_elem_boxlib)scrollbar_h_draw;
110
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_H].key_fn = NULL;
113
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_H].mouse_fn = (cb_elem_boxlib)scrollbar_h_mouse;
111
debug_board_printf("SCROLL_H (%x,%x,%x)\n", scrollbar_h_draw,scrollbar_h_mouse,0);
114
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_H].key_fn = NULL;
112
 
-
 
Line 113... Line 115...
113
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_V].redraw_fn = (cb_elem_boxlib)scrollbar_v_draw;
115
 
114
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_V].mouse_fn = (cb_elem_boxlib)scrollbar_v_mouse;
116
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_V].redraw_fn = (cb_elem_boxlib)scrollbar_v_draw;
115
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_V].key_fn = NULL;
117
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_V].mouse_fn = (cb_elem_boxlib)scrollbar_v_mouse;
Line 116... Line 118...
116
debug_board_printf("SCROLL_V (%x,%x,%x)\n", scrollbar_v_draw,scrollbar_v_mouse,0);
118
kolibri_gui_op_table[KOLIBRI_SCROLL_BAR_V].key_fn = NULL;
117
 
119
 
118
kolibri_gui_op_table[KOLIBRI_STATICTEXT].redraw_fn = (cb_elem_boxlib)statictext_draw;
120
kolibri_gui_op_table[KOLIBRI_STATICTEXT].redraw_fn = (cb_elem_boxlib)statictext_draw;
-
 
121
kolibri_gui_op_table[KOLIBRI_STATICTEXT].mouse_fn = NULL;
-
 
122
kolibri_gui_op_table[KOLIBRI_STATICTEXT].key_fn = NULL;
-
 
123
 
-
 
124
kolibri_gui_op_table[KOLIBRI_STATICNUM].redraw_fn = (cb_elem_boxlib)staticnum_draw;
-
 
125
kolibri_gui_op_table[KOLIBRI_STATICNUM].mouse_fn = NULL;
119
kolibri_gui_op_table[KOLIBRI_STATICTEXT].mouse_fn = NULL;
126
kolibri_gui_op_table[KOLIBRI_STATICNUM].key_fn = NULL;
120
kolibri_gui_op_table[KOLIBRI_STATICTEXT].key_fn = NULL;
127
 
Line 121... Line 128...
121
 
128
kolibri_gui_op_table[KOLIBRI_OPTIONGROUP].redraw_fn = (cb_elem_boxlib)option_box_draw;
122
kolibri_gui_op_table[KOLIBRI_STATICNUM].redraw_fn = (cb_elem_boxlib)staticnum_draw;
129
kolibri_gui_op_table[KOLIBRI_OPTIONGROUP].mouse_fn = (cb_elem_boxlib)option_box_mouse;