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_BUTTON, button);
volatile unsigned press_key2;
volatile unsigned press_key;
do /* Start of main activity loop */
{
@ -31,6 +31,7 @@ int main()
}
else if(gui_event == KOLIBRI_EVENT_KEY)
{
/* siemargl commented out because keys stealed from textinput
key = get_key();
switch (key.code)
{
@ -43,6 +44,7 @@ int main()
break;
}
press_key = key.val;
*/
kolibri_handle_event_key(main_window);
}
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 -> identifier = identifier;
new_button -> XY = 0;
return new_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));
}
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)
debug_board_write_byte(*str++);
}

View File

@ -1,7 +1,7 @@
#ifndef KOLIBRI_GUI_H
#define KOLIBRI_GUI_H
#include "stdlib.h" /* for malloc() */
#include <stdlib.h> /* for malloc() */
#include <kos32sys.h>
#include "kolibri_debug.h" /* work with debug board */
@ -41,6 +41,8 @@ void kolibri_handle_event_redraw(struct kolibri_window* some_window)
if(kolibri_gui_op_table[current_element -> type].redraw_fn)
kolibri_gui_op_table[current_element -> type].redraw_fn(current_element -> element);
//sie after fixing calling conventions no more needed
/*
switch(current_element -> type)
{
case KOLIBRI_EDIT_BOX:
@ -48,9 +50,10 @@ void kolibri_handle_event_redraw(struct kolibri_window* some_window)
__asm__ volatile("push $0x13371337"::); / * Random value pushed to balance stack * /
/ * otherwise edit_box_draw leaves stack unbalanced * /
/ * and GCC jumps like a crazy motha' fucka' * /
break;
}
*/
current_element = current_element -> next;
} 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
{
if(kolibri_gui_op_table[current_element -> type].mouse_fn)
kolibri_gui_op_table[current_element -> type].mouse_fn(current_element -> element);
current_element = current_element -> next;
} 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
and mouse inside window */
__asm__ volatile("int $0x40"::"a"(40), "b"(0xC0000027));
return boxlib_init_status;
}
/* Note: The current implementation tries to automatically colors