diff --git a/contrib/kolibri-libc/samples/basic_gui.c b/contrib/kolibri-libc/samples/basic_gui.c index 4701865530..b7e66386fb 100644 --- a/contrib/kolibri-libc/samples/basic_gui.c +++ b/contrib/kolibri-libc/samples/basic_gui.c @@ -97,7 +97,7 @@ int main() } break; case KSYS_EVENT_MOUSE: - mouse_pos = _ksys_get_mouse_pos(0); // window relative + mouse_pos = _ksys_get_mouse_pos(KSYS_MOUSE_WINDOW_POS); // window relative mouse_button = _ksys_get_mouse_eventstate(); debug_printf("mouse ev (%d,%d)%x\n", mouse_pos.x, mouse_pos.y, mouse_button); if (mouse_button & (1<<24)) // double click diff --git a/contrib/kolibri-libc/source/include/ksys.h b/contrib/kolibri-libc/source/include/ksys.h index b98eae7dea..1a5902503e 100644 --- a/contrib/kolibri-libc/source/include/ksys.h +++ b/contrib/kolibri-libc/source/include/ksys.h @@ -10,18 +10,18 @@ extern "C" { #define asm_inline __asm__ __volatile__ #define not_optimized __attribute__((optimize("O0"))) -#define _KOS_FS_ERR_SUCCESS 0 // Success -#define _KOS_FS_ERR_1 1 // Base and/or partition of a hard disk is not defined (fn21.7 & fn21.8) -#define _KOS_FS_ERR_2 2 // Function is not supported for the given file system -#define _KOS_FS_ERR_3 3 // Unknown file system -#define _KOS_FS_ERR_4 4 // Reserved, is never returned in the current implementation -#define _KOS_FS_ERR_5 5 // File not found -#define _KOS_FS_ERR_EOF 6 // End of file, EOF -#define _KOS_FS_ERR_7 7 // Pointer lies outside of application memory -#define _KOS_FS_ERR_8 8 // Disk is full -#define _KOS_FS_ERR_9 9 // FAT table is destroyed -#define _KOS_FS_ERR_10 10 // Access denied -#define _KOS_FS_ERR_11 11 // Device error +#define KSYS_FS_ERR_SUCCESS 0 // Success +#define KSYS_FS_ERR_1 1 // Base and/or partition of a hard disk is not defined (fn21.7 & fn21.8) +#define KSYS_FS_ERR_2 2 // Function is not supported for the given file system +#define KSYS_FS_ERR_3 3 // Unknown file system +#define KSYS_FS_ERR_4 4 // Reserved, is never returned in the current implementation +#define KSYS_FS_ERR_5 5 // File not found +#define KSYS_FS_ERR_EOF 6 // End of file, EOF +#define KSYS_FS_ERR_7 7 // Pointer lies outside of application memory +#define KSYS_FS_ERR_8 8 // Disk is full +#define KSYS_FS_ERR_9 9 // FAT table is destroyed +#define KSYS_FS_ERR_10 10 // Access denied +#define KSYS_FS_ERR_11 11 // Device error typedef struct { unsigned char blue; @@ -61,7 +61,7 @@ typedef struct{ size_t size; }ksys_ufile_t; - + typedef struct{ unsigned p00; union{ @@ -184,6 +184,11 @@ enum KSYS_CLIP_TYPES{ KSYS_CLIP_RAW = 2 }; +enum KSYS_MOUSE_POS{ + KSYS_MOUSE_SCREEN_POS = 0, + KSYS_MOUSE_WINDOW_POS = 1 +}; + static inline int _ksys_strcmp(const char * s1, const char * s2 ) { diff --git a/contrib/kolibri-libc/source/stdio/fgetc.c b/contrib/kolibri-libc/source/stdio/fgetc.c index c54fd1e704..3e74db15e3 100644 --- a/contrib/kolibri-libc/source/stdio/fgetc.c +++ b/contrib/kolibri-libc/source/stdio/fgetc.c @@ -9,21 +9,21 @@ int fgetc(FILE* stream) unsigned status = _ksys_file_read_file(stream->name, stream->position, 1, &c, &bytes_read); - if (status != _KOS_FS_ERR_SUCCESS) { + if (status != KSYS_FS_ERR_SUCCESS) { switch (status) { - case _KOS_FS_ERR_EOF: + case KSYS_FS_ERR_EOF: stream->eof = 1; break; - case _KOS_FS_ERR_1: - case _KOS_FS_ERR_2: - case _KOS_FS_ERR_3: - case _KOS_FS_ERR_4: - case _KOS_FS_ERR_5: - case _KOS_FS_ERR_7: - case _KOS_FS_ERR_8: - case _KOS_FS_ERR_9: - case _KOS_FS_ERR_10: - case _KOS_FS_ERR_11: + case KSYS_FS_ERR_1: + case KSYS_FS_ERR_2: + case KSYS_FS_ERR_3: + case KSYS_FS_ERR_4: + case KSYS_FS_ERR_5: + case KSYS_FS_ERR_7: + case KSYS_FS_ERR_8: + case KSYS_FS_ERR_9: + case KSYS_FS_ERR_10: + case KSYS_FS_ERR_11: default: // Just some IO error, who knows what exactly happened errno = EIO; diff --git a/contrib/kolibri-libc/source/stdio/fputc.c b/contrib/kolibri-libc/source/stdio/fputc.c index da443ea57a..90230721d4 100644 --- a/contrib/kolibri-libc/source/stdio/fputc.c +++ b/contrib/kolibri-libc/source/stdio/fputc.c @@ -8,19 +8,19 @@ int fputc(int c, FILE *stream) unsigned status = _ksys_file_write_file(stream->name, stream->position, 1, &c, &bytes_written); - if (status != _KOS_FS_ERR_SUCCESS) { + if (status != KSYS_FS_ERR_SUCCESS) { switch (status) { - case _KOS_FS_ERR_1: - case _KOS_FS_ERR_2: - case _KOS_FS_ERR_3: - case _KOS_FS_ERR_4: - case _KOS_FS_ERR_5: - case _KOS_FS_ERR_EOF: - case _KOS_FS_ERR_7: - case _KOS_FS_ERR_8: - case _KOS_FS_ERR_9: - case _KOS_FS_ERR_10: - case _KOS_FS_ERR_11: + case KSYS_FS_ERR_1: + case KSYS_FS_ERR_2: + case KSYS_FS_ERR_3: + case KSYS_FS_ERR_4: + case KSYS_FS_ERR_5: + case KSYS_FS_ERR_EOF: + case KSYS_FS_ERR_7: + case KSYS_FS_ERR_8: + case KSYS_FS_ERR_9: + case KSYS_FS_ERR_10: + case KSYS_FS_ERR_11: default: // Just some IO error, who knows what exactly happened errno = EIO;