Rev 6482 | Rev 6524 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6482 | Rev 6495 | ||
---|---|---|---|
1 | format coff |
1 | format coff |
2 | use32 ; Tell compiler to use 32 bit instructions |
2 | use32 ; Tell compiler to use 32 bit instructions |
3 | 3 | ||
4 | section '.init' code ; Keep this line before includes or GCC messes up call addresses |
4 | section '.init' code ; Keep this line before includes or GCC messes up call addresses |
5 | 5 | ||
6 | include '../../../programs/proc32.inc' |
6 | include '../../../programs/proc32.inc' |
7 | include '../../../programs/macros.inc' |
7 | include '../../../programs/macros.inc' |
8 | purge section,mov,add,sub |
8 | purge section,mov,add,sub |
9 | 9 | ||
10 | include '../../../programs/develop/libraries/box_lib/trunk/box_lib.mac' |
10 | include '../../../programs/develop/libraries/box_lib/trunk/box_lib.mac' |
11 | include '../../../programs/system/run/trunk/txtbut.inc' |
11 | include '../../../programs/system/run/trunk/txtbut.inc' |
12 | include '../../../programs/dll.inc' |
12 | include '../../../programs/dll.inc' |
13 | 13 | ||
14 | public init_boxlib as '_init_boxlib_asm' |
14 | public init_boxlib as '_kolibri_boxlib_init' |
15 | public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
15 | public editbox_key_thunk as '_editbox_key@4' ; renamed due to ambiguity |
16 | public press_key as '_press_key' |
16 | public press_key as '_press_key' |
17 | ;;; Returns 0 on success. -1 on failure. |
17 | ;;; Returns 0 on success. -1 on failure. |
18 | 18 | ||
19 | proc init_boxlib |
19 | proc init_boxlib |
20 | - | ||
21 | mcall 68,11 |
20 | mcall 68,11 |
22 | - | ||
23 | stdcall dll.Load, @IMPORT |
21 | stdcall dll.Load, @IMPORT |
24 | test eax, eax |
- | |
25 | jnz error |
- | |
26 | - | ||
27 | mov eax, 0 |
- | |
28 | ret |
- | |
29 | - | ||
30 | error: |
- | |
31 | mov eax, -1 |
- | |
32 | ret |
22 | ret |
33 | endp |
23 | endp |
34 | 24 | ||
35 | ;; Wrapper to handle edit_box_key function for editboxes. |
25 | ;; Wrapper to handle edit_box_key function for editboxes. |
36 | ;; Call this baby from C (refer kolibri_editbox.h for details) |
26 | ;; Call this baby from C (refer kolibri_editbox.h for details) |
37 | editbox_key_thunk: |
27 | editbox_key_thunk: |
38 | mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise. |
28 | mov [oldebp], ebp ;Save ebp because GCC is crazy for it otherwise. |
39 | pop ebp ;Save return address in ebp. Stack top is param now. |
29 | pop ebp ;Save return address in ebp. Stack top is param now. |
40 | mov eax, dword [press_key] |
30 | mov eax, dword [press_key] |
41 | call [edit_box_key] ; The pointer we passed should be on the stack already. |
31 | call [edit_box_key] ; The pointer we passed should be on the stack already. |
42 | push ebp ;push the return address back to stack |
32 | push ebp ;push the return address back to stack |
43 | mov ebp, [oldebp] |
33 | mov ebp, [oldebp] |
44 | ret |
34 | ret |
45 | 35 | ||
46 | oldebp dd ? |
36 | oldebp dd ? |
47 | press_key dd ? |
37 | press_key dd ? |
48 | 38 | ||
49 | @IMPORT: |
39 | @IMPORT: |
50 | library lib_boxlib, 'box_lib.obj' |
40 | library lib_boxlib, 'box_lib.obj' |
51 | 41 | ||
52 | import lib_boxlib, \ |
42 | import lib_boxlib, \ |
53 | edit_box_draw, 'edit_box' , \ |
43 | edit_box_draw, 'edit_box' , \ |
54 | edit_box_key, 'edit_box_key' , \ |
44 | edit_box_key, 'edit_box_key' , \ |
55 | edit_box_mouse, 'edit_box_mouse', \ |
45 | edit_box_mouse, 'edit_box_mouse', \ |
56 | edit_box_set_text, 'edit_box_set_text' , \ |
46 | edit_box_set_text, 'edit_box_set_text' , \ |
57 | init_checkbox2, 'init_checkbox2' , \ |
47 | init_checkbox2, 'init_checkbox2' , \ |
58 | check_box_draw2, 'check_box_draw2' , \ |
48 | check_box_draw2, 'check_box_draw2' , \ |
59 | check_box_mouse2, 'check_box_mouse2' , \ |
49 | check_box_mouse2, 'check_box_mouse2' , \ |
60 | option_box_draw, 'option_box_draw' , \ |
50 | option_box_draw, 'option_box_draw' , \ |
61 | option_box_mouse, 'option_box_mouse' , \ |
51 | option_box_mouse, 'option_box_mouse' , \ |
62 | scrollbar_v_draw, 'scrollbar_v_draw' , \ |
52 | scrollbar_v_draw, 'scrollbar_v_draw' , \ |
63 | scrollbar_v_mouse, 'scrollbar_v_mouse' , \ |
53 | scrollbar_v_mouse, 'scrollbar_v_mouse' , \ |
64 | scrollbar_h_draw, 'scrollbar_h_draw' , \ |
54 | scrollbar_h_draw, 'scrollbar_h_draw' , \ |
65 | scrollbar_h_mouse, 'scrollbar_h_mouse' , \ |
55 | scrollbar_h_mouse, 'scrollbar_h_mouse' , \ |
66 | dynamic_button_draw, 'dbutton_draw' , \ |
56 | dynamic_button_draw, 'dbutton_draw' , \ |
67 | dynamic_button_mouse, 'dbutton_mouse' , \ |
57 | dynamic_button_mouse, 'dbutton_mouse' , \ |
68 | menu_bar_draw, 'menu_bar_draw' , \ |
58 | menu_bar_draw, 'menu_bar_draw' , \ |
69 | menu_bar_mouse, 'menu_bar_mouse' , \ |
59 | menu_bar_mouse, 'menu_bar_mouse' , \ |
70 | menu_bar_activate, 'menu_bar_activate' , \ |
60 | menu_bar_activate, 'menu_bar_activate' , \ |
71 | fb_draw_panel, 'filebrowser_draw' , \ |
61 | fb_draw_panel, 'filebrowser_draw' , \ |
72 | fb_mouse, 'filebrowser_mouse' , \ |
62 | fb_mouse, 'filebrowser_mouse' , \ |
73 | fb_key, 'filebrowser_key' , \ |
63 | fb_key, 'filebrowser_key' , \ |
74 | tl_data_init, 'tl_data_init' , \ |
64 | tl_data_init, 'tl_data_init' , \ |
75 | tl_data_clear, 'tl_data_clear' , \ |
65 | tl_data_clear, 'tl_data_clear' , \ |
76 | tl_info_clear, 'tl_info_clear' , \ |
66 | tl_info_clear, 'tl_info_clear' , \ |
77 | tl_key, 'tl_key' , \ |
67 | tl_key, 'tl_key' , \ |
78 | tl_mouse, 'tl_mouse' , \ |
68 | tl_mouse, 'tl_mouse' , \ |
79 | tl_draw, 'tl_draw' , \ |
69 | tl_draw, 'tl_draw' , \ |
80 | tl_info_undo, 'tl_info_undo' , \ |
70 | tl_info_undo, 'tl_info_undo' , \ |
81 | tl_info_redo, 'tl_info_redo' , \ |
71 | tl_info_redo, 'tl_info_redo' , \ |
82 | tl_node_add, 'tl_node_add' , \ |
72 | tl_node_add, 'tl_node_add' , \ |
83 | tl_node_set_data, 'tl_node_set_data' , \ |
73 | tl_node_set_data, 'tl_node_set_data' , \ |
84 | tl_node_get_data, 'tl_node_get_data' , \ |
74 | tl_node_get_data, 'tl_node_get_data' , \ |
85 | tl_node_delete, 'tl_node_delete' , \ |
75 | tl_node_delete, 'tl_node_delete' , \ |
86 | tl_cur_beg, 'tl_cur_beg' , \ |
76 | tl_cur_beg, 'tl_cur_beg' , \ |
87 | tl_cur_next, 'tl_cur_next' , \ |
77 | tl_cur_next, 'tl_cur_next' , \ |
88 | tl_cur_perv, 'tl_cur_perv' , \ |
78 | tl_cur_perv, 'tl_cur_perv' , \ |
89 | tl_node_close_open, 'tl_node_close_open' , \ |
79 | tl_node_close_open, 'tl_node_close_open' , \ |
90 | tl_node_lev_inc, 'tl_node_lev_inc' , \ |
80 | tl_node_lev_inc, 'tl_node_lev_inc' , \ |
91 | tl_node_lev_dec, 'tl_node_lev_dec' , \ |
81 | tl_node_lev_dec, 'tl_node_lev_dec' , \ |
92 | tl_node_move_up, 'tl_node_move_up' , \ |
82 | tl_node_move_up, 'tl_node_move_up' , \ |
93 | tl_node_move_down, 'tl_node_move_down' , \ |
83 | tl_node_move_down, 'tl_node_move_down' , \ |
94 | tl_node_poi_get_info, 'tl_node_poi_get_info' , \ |
84 | tl_node_poi_get_info, 'tl_node_poi_get_info' , \ |
95 | tl_node_poi_get_next_info, 'tl_node_poi_get_next_info' , \ |
85 | tl_node_poi_get_next_info, 'tl_node_poi_get_next_info' , \ |
96 | tl_node_poi_get_data, 'tl_node_poi_get_data' , \ |
86 | tl_node_poi_get_data, 'tl_node_poi_get_data' , \ |
97 | tl_save_mem, 'tl_save_mem' , \ |
87 | tl_save_mem, 'tl_save_mem' , \ |
98 | tl_load_mem, 'tl_load_mem' , \ |
88 | tl_load_mem, 'tl_load_mem' , \ |
99 | tl_get_mem_size, 'tl_get_mem_size' , \ |
89 | tl_get_mem_size, 'tl_get_mem_size' , \ |
100 | path_show_prepare, 'pathshow_prepare' , \ |
90 | path_show_prepare, 'pathshow_prepare' , \ |
101 | path_show_draw, 'pathshow_draw' , \ |
91 | path_show_draw, 'pathshow_draw' , \ |
102 | ted_but_sumb_upper, 'ted_but_sumb_upper' , \ |
92 | ted_but_sumb_upper, 'ted_but_sumb_upper' , \ |
103 | ted_but_sumb_lover, 'ted_but_sumb_lover' , \ |
93 | ted_but_sumb_lover, 'ted_but_sumb_lover' , \ |
104 | ted_but_convert_by_table, 'ted_but_convert_by_table' , \ |
94 | ted_but_convert_by_table, 'ted_but_convert_by_table' , \ |
105 | ted_can_save, 'ted_can_save' , \ |
95 | ted_can_save, 'ted_can_save' , \ |
106 | ted_clear, 'ted_clear' , \ |
96 | ted_clear, 'ted_clear' , \ |
107 | ted_delete, 'ted_delete' , \ |
97 | ted_delete, 'ted_delete' , \ |
108 | ted_draw, 'ted_draw' , \ |
98 | ted_draw, 'ted_draw' , \ |
109 | ted_init, 'ted_init' , \ |
99 | ted_init, 'ted_init' , \ |
110 | ted_init_scroll_bars, 'ted_init_scroll_bars' , \ |
100 | ted_init_scroll_bars, 'ted_init_scroll_bars' , \ |
111 | ted_init_syntax_file, 'ted_init_syntax_file' , \ |
101 | ted_init_syntax_file, 'ted_init_syntax_file' , \ |
112 | ted_is_select, 'ted_is_select' , \ |
102 | ted_is_select, 'ted_is_select' , \ |
113 | ted_key, 'ted_key' , \ |
103 | ted_key, 'ted_key' , \ |
114 | ted_mouse, 'ted_mouse' , \ |
104 | ted_mouse, 'ted_mouse' , \ |
115 | ted_open_file, 'ted_open_file' , \ |
105 | ted_open_file, 'ted_open_file' , \ |
116 | ted_save_file, 'ted_save_file' , \ |
106 | ted_save_file, 'ted_save_file' , \ |
117 | ted_text_add, 'ted_text_add' , \ |
107 | ted_text_add, 'ted_text_add' , \ |
118 | ted_but_select_word, 'ted_but_select_word' , \ |
108 | ted_but_select_word, 'ted_but_select_word' , \ |
119 | ted_but_cut, 'ted_but_cut' , \ |
109 | ted_but_cut, 'ted_but_cut' , \ |
120 | ted_but_copy, 'ted_but_copy' , \ |
110 | ted_but_copy, 'ted_but_copy' , \ |
121 | ted_but_paste, 'ted_but_paste' , \ |
111 | ted_but_paste, 'ted_but_paste' , \ |
122 | ted_but_undo, 'ted_but_undo' , \ |
112 | ted_but_undo, 'ted_but_undo' , \ |
123 | ted_but_redo, 'ted_but_redo' , \ |
113 | ted_but_redo, 'ted_but_redo' , \ |
124 | ted_but_reverse, 'ted_but_reverse' , \ |
114 | ted_but_reverse, 'ted_but_reverse' , \ |
125 | ted_but_find_next, 'ted_but_find_next' , \ |
115 | ted_but_find_next, 'ted_but_find_next' , \ |
126 | ted_text_colored, 'ted_text_colored' , \ |
116 | ted_text_colored, 'ted_text_colored' , \ |
127 | frame_draw, 'frame_draw' , \ |
117 | frame_draw, 'frame_draw' , \ |
128 | progressbar_draw,'progressbar_draw' , \ |
118 | progressbar_draw,'progressbar_draw' , \ |
129 | progressbar_progress, 'progressbar_progress' |
119 | progressbar_progress, 'progressbar_progress' |
130 | 120 | ||
131 | 121 | ||
132 | public edit_box_draw as '_edit_box_draw' |
122 | public edit_box_draw as '_edit_box_draw' |
133 | public edit_box_key as '_edit_box_key' |
123 | public edit_box_key as '_edit_box_key' |
134 | public edit_box_mouse as '_edit_box_mouse' |
124 | public edit_box_mouse as '_edit_box_mouse' |
135 | public edit_box_set_text as '_edit_box_set_text' |
125 | public edit_box_set_text as '_edit_box_set_text' |
136 | 126 | ||
137 | public check_box_draw2 as '_check_box_draw2' |
127 | public check_box_draw2 as '_check_box_draw2' |
138 | public check_box_mouse2 as '_check_box_mouse2' |
128 | public check_box_mouse2 as '_check_box_mouse2' |
139 | public init_checkbox2 as '_init_checkbox2' |
129 | public init_checkbox2 as '_init_checkbox2' |
140 | 130 | ||
141 | public progressbar_draw as '_progressbar_draw' |
131 | public progressbar_draw as '_progressbar_draw' |
142 | public progressbar_progress as '_progressbar_progress' |
132 | public progressbar_progress as '_progressbar_progress' |
143 | 133 | ||
144 | public frame_draw as '_frame_draw' |
134 | public frame_draw as '_frame_draw' |
145 | 135 | ||
146 | public scrollbar_v_draw as '_scrollbar_v_draw' |
136 | public scrollbar_v_draw as '_scrollbar_v_draw' |
147 | public scrollbar_v_mouse as '_scrollbar_v_mouse' |
137 | public scrollbar_v_mouse as '_scrollbar_v_mouse' |
148 | public scrollbar_h_draw as '_scrollbar_h_draw' |
138 | public scrollbar_h_draw as '_scrollbar_h_draw' |
149 | public scrollbar_h_mouse as '_scrollbar_h_mouse' |
139 | public scrollbar_h_mouse as '_scrollbar_h_mouse' |
150 | 140 | ||
151 | public option_box_draw as '_option_box_draw' |
141 | public option_box_draw as '_option_box_draw' |
152 | public option_box_mouse as '_option_box_mouse' |
142 | public option_box_mouse as '_option_box_mouse' |
153 | 143 | ||
154 | public menu_bar_draw as '_menu_bar_draw' |
144 | public menu_bar_draw as '_menu_bar_draw' |
155 | public menu_bar_mouse as '_menu_bar_mouse' |
145 | public menu_bar_mouse as '_menu_bar_mouse' |
156 | public menu_bar_activate as '_menu_bar_activate' |
146 | public menu_bar_activate as '_menu_bar_activate' |