/contrib/C_Layer/INCLUDE/kolibri_colordialog.h |
---|
43,6 → 43,7 |
return new_colordialog; |
} |
extern void kolibri_proclib_init() __attribute__((__stdcall__)); |
extern void (*ColorDialog_init)(color_dialog *) __attribute__((__stdcall__)); |
extern void (*ColorDialog_start)(color_dialog *) __attribute__((__stdcall__)); |
#endif /* KOLIBRI_COLORDIALOG_H */ |
/contrib/C_Layer/INCLUDE/kolibri_d_button.h |
---|
0,0 → 1,52 |
#ifndef KOLIBRI_DBUTTON_H |
#define KOLIBRI_DBUTTON_H |
typedef struct { |
uint32_t type; |
uint32_t x_w; |
uint32_t y_h; |
uint32_t mouse_pos; |
uint32_t mouse_keys; |
uint32_t mouse_keys_old; |
void* active_raw; //active bitmap |
void* passive_raw; //passive bitmap |
void* click_raw; //pressed bitmap |
uint32_t resolution_raw; // bpp, as esi fn65 |
void* palette_raw; // palette, as edi fn65 |
uint32_t offset_raw; // width as ebp fn65 |
uint32_t select; // internal state: 0 - passive, 2 - pressed, 1 - clicked |
uint32_t click; // clicked - 1, zero it after tested |
} pict_button; |
inline pict_button* kolibri_pict_button(pict_button* b, uint32_t x_w, uint32_t y_h, void* active_pict, void* passive_pict, void* pressed_pict, uint32_t bpp, void* palette, int32_t offset_line) |
{ |
b->type = b->mouse_pos = b->mouse_keys = b->mouse_keys_old = b->select = b->click = 0; |
b->x_w = x_w; |
b->y_h = y_h; |
b->active_raw = active_pict; |
b->passive_raw = passive_pict; |
b->click_raw = pressed_pict; |
b->resolution_raw = bpp; |
b->palette_raw = palette; |
b->offset_raw = offset_line; |
return b; |
} |
inline pict_button* kolibri_new_pict_button(uint32_t x_w, uint32_t y_h, void* active_pict, void* passive_pict, void* pressed_pict, uint32_t bpp, void* palette, int32_t offset_line) |
{ |
pict_button *new_d_but = (pict_button *)malloc(sizeof(pict_button)); |
return kolibri_pict_button(new_d_but, x_w, y_h, active_pict, passive_pict, pressed_pict, bpp, palette, offset_line); |
} |
inline void gui_add_pict_button(kolibri_window *wnd, pict_button* db) |
{ |
kolibri_window_add_element(wnd, KOLIBRI_D_BUTTON, db); |
} |
extern void (*dynamic_button_draw)(pict_button *) __attribute__((__stdcall__)); |
extern void (*dynamic_button_mouse)(pict_button *) __attribute__((__stdcall__)); |
#endif /* KOLIBRI_DBUTTON_H */ |
/contrib/C_Layer/INCLUDE/kolibri_gui_elements.h |
---|
21,8 → 21,9 |
KOLIBRI_PROGRESS_BAR, |
KOLIBRI_STATICTEXT, |
KOLIBRI_STATICNUM, |
KOLIBRI_BUTTON, |
KOLIBRI_D_BUTTON, |
KOLIBRI_PATHSHOW, |
/* Add elements above this element in order to let KOLIBRI_NUM_GUI_ELEMENTS */ |
/* stay at correct value */ |
65,19 → 66,22 |
void kolibri_window_add_element(kolibri_window *some_window, enum KOLIBRI_GUI_ELEMENT_TYPE element_type, void *some_gui_element); // forward declaration |
/* GUI Elements being used */ |
#include "kolibri_button.h" |
#include "kolibri_checkbox.h" |
#include "kolibri_d_button.h" |
#include "kolibri_editbox.h" |
#include "kolibri_checkbox.h" |
#include "kolibri_button.h" |
#include "kolibri_frame.h" |
#include "kolibri_menubar.h" |
#include "kolibri_optionbox.h" |
#include "kolibri_pathshow.h" |
#include "kolibri_progressbar.h" |
#include "kolibri_frame.h" |
#include "kolibri_scrollbar.h" |
#include "kolibri_statictext.h" |
#include "kolibri_optionbox.h" |
#include "kolibri_menubar.h" |
/*---------------------Define various functions for initializing GUI-------*/ |
/* Master table containing operations for various GUI elements in one place */ |
135,7 → 139,15 |
kolibri_gui_op_table[KOLIBRI_MENU_BAR].mouse_fn = (cb_elem_boxlib)menu_bar_mouse; |
kolibri_gui_op_table[KOLIBRI_MENU_BAR].key_fn = NULL; |
debug_board_printf("KOLIBRI_MENU_BAR (%x,%x,%x)\n", menu_bar_draw,menu_bar_mouse,menu_bar_activate); |
kolibri_gui_op_table[KOLIBRI_D_BUTTON].redraw_fn = (cb_elem_boxlib)dynamic_button_draw; |
kolibri_gui_op_table[KOLIBRI_D_BUTTON].mouse_fn = (cb_elem_boxlib)dynamic_button_mouse; |
kolibri_gui_op_table[KOLIBRI_D_BUTTON].key_fn = NULL; |
debug_board_printf("KOLIBRI_D_BUTTON (%x,%x,%x)\n", dynamic_button_draw, dynamic_button_mouse, 0); |
kolibri_gui_op_table[KOLIBRI_PATHSHOW].redraw_fn = (cb_elem_boxlib)path_show_draw; |
kolibri_gui_op_table[KOLIBRI_PATHSHOW].mouse_fn = NULL; |
kolibri_gui_op_table[KOLIBRI_PATHSHOW].key_fn = NULL; |
debug_board_printf("KOLIBRI_PATHSHOW (%x,%x,%x)\n", path_show_draw, 0, 0); |
} |
/* Create a new main GUI window for KolibriOS */ |
/contrib/C_Layer/INCLUDE/kolibri_opendialog.h |
---|
5,19 → 5,30 |
char sz_dir_default_path[] = "/rd/1"; |
char sz_start_path[] = "/rd/1/File managers/opendial"; |
enum open_dialog_mode { |
OPEN, |
SAVE, |
SELECT |
}; |
typedef struct { |
unsigned int size; |
unsigned char end; |
}od_filter; |
typedef struct { |
unsigned int mode; |
unsigned int procinfo; |
unsigned int com_area_name; |
char* procinfo; |
char* com_area_name; |
unsigned int com_area; |
unsigned int opendir_path; |
unsigned int dir_default_path; |
unsigned int start_path; |
unsigned int draw_window; |
char* opendir_path; |
char* dir_default_path; |
char* start_path; |
void (*draw_window)(); |
unsigned int status; |
unsigned int openfile_path; |
unsigned int filename_area; |
unsigned int filter_area; |
char* openfile_path; |
char* filename_area; |
od_filter* filter_area; |
unsigned short x_size; |
unsigned short x_start; |
unsigned short y_size; |
24,14 → 35,9 |
unsigned short y_start; |
}open_dialog; |
typedef struct { |
unsigned int size; |
unsigned char end; |
}od_filter; |
void fake_on_redraw(void) {} |
struct open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size) |
open_dialog* kolibri_new_open_dialog(unsigned int mode, unsigned short tlx, unsigned short tly, unsigned short x_size, unsigned short y_size) |
{ |
open_dialog *new_opendialog = (open_dialog *)malloc(sizeof(open_dialog)); |
od_filter *new_od_filter = (od_filter *)malloc(sizeof(od_filter)); |
45,11 → 51,11 |
new_opendialog -> mode = mode; |
new_opendialog -> procinfo = proc_info; |
new_opendialog -> com_area_name = &sz_com_area_name; |
new_opendialog -> com_area_name = sz_com_area_name; |
new_opendialog -> com_area = 0; |
new_opendialog -> opendir_path = plugin_path; |
new_opendialog -> dir_default_path = &sz_dir_default_path; |
new_opendialog -> start_path = &sz_start_path; |
new_opendialog -> dir_default_path = sz_dir_default_path; |
new_opendialog -> start_path = sz_start_path; |
new_opendialog -> draw_window = &fake_on_redraw; |
new_opendialog -> status = 0; |
new_opendialog -> openfile_path = openfile_path; |
62,6 → 68,7 |
return new_opendialog; |
} |
extern void kolibri_proclib_init(); |
extern void (*OpenDialog_init)(open_dialog *) __attribute__((__stdcall__)); |
extern void (*OpenDialog_start)(open_dialog *) __attribute__((__stdcall__)); |
#endif /* KOLIBRI_OPENDIALOG_H */ |
/contrib/C_Layer/INCLUDE/kolibri_pathshow.h |
---|
0,0 → 1,51 |
#ifndef KOLIBRI_PATHSHOW_H |
#define KOLIBRI_PATHSHOW_H |
typedef struct { |
uint32_t type; |
uint32_t x_y; |
uint16_t font_size_x; // 6 - for font 0, 8 - for font 1 |
uint16_t area_size_x; |
uint32_t font_number; // 0 - monospace, 1 - variable, as fn4 (2bit only 0-3) |
uint32_t background_flag; // as fn4, if 0, bk_color unneeded |
color_t font_color; // as fn4 |
color_t background_color; // as fn4 |
char* text_pointer; // 4096 ? |
char* work_area_pointer; // 4096 ? |
uint32_t temp_text_length; |
} pathview; |
inline pathview* kolibri_pathview(pathview* p, uint32_t x_y, uint32_t width, uint32_t font_number, uint32_t is_bkgr, char* text, char* temp_buf, color_t font, color_t bkgr) |
{ |
p->type = p->temp_text_length = 0; |
p->x_y = x_y; |
p->font_size_x = font_number == 0 ? 6 : 8; // need correction for bigger fonts |
p->area_size_x = width; |
p->font_number = font_number; |
p->background_flag = is_bkgr; |
p->text_pointer = text; |
p->work_area_pointer = temp_buf; |
p->font_color = font; |
p->background_color = bkgr; |
return p; |
} |
inline pathview* kolibri_new_pathview(pathview* p, uint32_t x_y, uint32_t width, uint32_t font_number, uint32_t is_bkgr, char* text, char* temp_buf, color_t font, color_t bkgr) |
{ |
pathview *new_pv = (pathview *)malloc(sizeof(pathview)); |
return kolibri_pathview(new_pv, x_y, width, font_number, is_bkgr, text, temp_buf, font, bkgr); |
} |
inline void gui_add_pathview(kolibri_window *wnd, pathview* pv) |
{ |
kolibri_window_add_element(wnd, KOLIBRI_PATHSHOW, pv); |
} |
extern void (*path_show_prepare)(pathview *) __attribute__((__stdcall__)); |
extern void (*path_show_draw)(pathview *) __attribute__((__stdcall__)); |
#endif /* KOLIBRI_PATHSHOW_H */ |
/contrib/C_Layer/INCLUDE/kolibri_statictext.h |
---|
66,6 → 66,13 |
:); |
} |
inline void gui_add_statictext(kolibri_window *wnd, statictext* st) |
{ |
kolibri_window_add_element(wnd, KOLIBRI_STATICTEXT, st); |
} |
staticnum* kolibri_staticnum(staticnum* st, uint32_t xy, int32_t width, int16_t number, encoding_t enc, int size, color_t font, color_t bg) |
{ |
st->start_xy = xy; |
97,6 → 104,12 |
return kolibri_new_staticnum(xy, width, number, cp866, 0, kolibri_color_table.color_work_text, 0); |
} |
inline void gui_add_staticnum(kolibri_window *wnd, staticnum* sn) |
{ |
kolibri_window_add_element(wnd, KOLIBRI_STATICNUM, sn); |
} |
__attribute__((__stdcall__)) |
void staticnum_draw(staticnum *st) |
{ |