callin'convention fix

git-svn-id: svn://kolibrios.org@6395 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
siemargl 2016-04-12 18:50:48 +00:00
parent b4322cddd9
commit 191083b6c3
4 changed files with 41 additions and 32 deletions

View File

@ -21,7 +21,7 @@ int main()
kolibri_window_add_element(main_window, KOLIBRI_CHECK_BOX, checkbox); kolibri_window_add_element(main_window, KOLIBRI_CHECK_BOX, checkbox);
kolibri_window_add_element(main_window, KOLIBRI_BUTTON, button); kolibri_window_add_element(main_window, KOLIBRI_BUTTON, button);
volatile unsigned press_key2; volatile unsigned press_key;
do /* Start of main activity loop */ do /* Start of main activity loop */
{ {
@ -31,11 +31,12 @@ int main()
} }
else if(gui_event == KOLIBRI_EVENT_KEY) else if(gui_event == KOLIBRI_EVENT_KEY)
{ {
/* siemargl commented out because keys stealed from textinput
key = get_key(); key = get_key();
switch (key.code) switch (key.code)
{ {
case 13: case 13:
if(checkbox -> flags & CHECKBOX_IS_SET) /* Append BoardMsg checkbox is set */ if(checkbox -> flags & CHECKBOX_IS_SET) /* Append BoardMsg checkbox is set * /
debug_board_write_str("BOARDMSG: "); debug_board_write_str("BOARDMSG: ");
debug_board_write_str(textbox->text); debug_board_write_str(textbox->text);
@ -43,6 +44,7 @@ int main()
break; break;
} }
press_key = key.val; press_key = key.val;
*/
kolibri_handle_event_key(main_window); kolibri_handle_event_key(main_window);
} }
else if(gui_event == KOLIBRI_EVENT_BUTTON) else if(gui_event == KOLIBRI_EVENT_BUTTON)

View File

@ -18,6 +18,7 @@ struct kolibri_button *kolibri_new_button(unsigned int tlx, unsigned int tly, un
new_button -> color = color; new_button -> color = color;
new_button -> identifier = identifier; new_button -> identifier = identifier;
new_button -> XY = 0; new_button -> XY = 0;
return new_button;
} }
void draw_button(struct kolibri_button *some_button) void draw_button(struct kolibri_button *some_button)

View File

@ -11,7 +11,8 @@ inline void debug_board_write_byte(const char ch){
:"a"(63), "b"(1), "c"(ch)); :"a"(63), "b"(1), "c"(ch));
} }
inline void debug_board_write_str(const char* str){ //added noninline because incofortabre stepping in in debugger
void __attribute__ ((noinline)) debug_board_write_str(const char* str){
while(*str) while(*str)
debug_board_write_byte(*str++); debug_board_write_byte(*str++);
} }

View File

@ -1,7 +1,7 @@
#ifndef KOLIBRI_GUI_H #ifndef KOLIBRI_GUI_H
#define KOLIBRI_GUI_H #define KOLIBRI_GUI_H
#include "stdlib.h" /* for malloc() */ #include <stdlib.h> /* for malloc() */
#include <kos32sys.h> #include <kos32sys.h>
#include "kolibri_debug.h" /* work with debug board */ #include "kolibri_debug.h" /* work with debug board */
@ -41,16 +41,19 @@ void kolibri_handle_event_redraw(struct kolibri_window* some_window)
if(kolibri_gui_op_table[current_element -> type].redraw_fn) if(kolibri_gui_op_table[current_element -> type].redraw_fn)
kolibri_gui_op_table[current_element -> type].redraw_fn(current_element -> element); kolibri_gui_op_table[current_element -> type].redraw_fn(current_element -> element);
//sie after fixing calling conventions no more needed
/*
switch(current_element -> type) switch(current_element -> type)
{ {
case KOLIBRI_EDIT_BOX: case KOLIBRI_EDIT_BOX:
case KOLIBRI_CHECK_BOX: case KOLIBRI_CHECK_BOX:
__asm__ volatile("push $0x13371337"::); /* Random value pushed to balance stack */ __asm__ volatile("push $0x13371337"::); / * Random value pushed to balance stack * /
/* otherwise edit_box_draw leaves stack unbalanced */ / * otherwise edit_box_draw leaves stack unbalanced * /
/* and GCC jumps like a crazy motha' fucka' */ / * and GCC jumps like a crazy motha' fucka' * /
break; break;
} }
*/
current_element = current_element -> next; current_element = current_element -> next;
} while(current_element != some_window->elements); /* Have we covered all elements? */ } while(current_element != some_window->elements); /* Have we covered all elements? */
@ -84,11 +87,11 @@ void kolibri_handle_event_mouse(struct kolibri_window* some_window)
do do
{ {
if(kolibri_gui_op_table[current_element -> type].mouse_fn) if(kolibri_gui_op_table[current_element -> type].mouse_fn)
kolibri_gui_op_table[current_element -> type].mouse_fn(current_element -> element); kolibri_gui_op_table[current_element -> type].mouse_fn(current_element -> element);
current_element = current_element -> next; current_element = current_element -> next;
} while(current_element != some_window->elements); /* Have we covered all elements? */ } while(current_element != some_window->elements); /* Have we covered all elements? */
} }
} }
@ -121,6 +124,8 @@ int kolibri_gui_init(void)
/* Also set filters so that window receives mouse events only when active /* Also set filters so that window receives mouse events only when active
and mouse inside window */ and mouse inside window */
__asm__ volatile("int $0x40"::"a"(40), "b"(0xC0000027)); __asm__ volatile("int $0x40"::"a"(40), "b"(0xC0000027));
return boxlib_init_status;
} }
/* Note: The current implementation tries to automatically colors /* Note: The current implementation tries to automatically colors