Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. ///===========================
  3.  
  4. #define CON_COLOR_BLUE          1
  5. #define CON_COLOR_GREEN         2
  6. #define CON_COLOR_RED           4
  7. #define CON_COLOR_BRIGHT        8
  8. /* öâåò ôîíà */
  9. #define CON_BGR_BLUE            0x10
  10. #define CON_BGR_GREEN           0x20
  11. #define CON_BGR_RED             0x40
  12. #define CON_BGR_BRIGHT          0x80
  13.  
  14. ///===========================
  15.  
  16. void (* _stdcall con_init)(unsigned w_w, unsigned w_h, unsigned s_w, unsigned s_h, const char* t);
  17. void (* _cdecl printf)(const char* format,...);
  18. void (* _stdcall _exit)(char bCloseWindow);
  19. void (* __stdcall gets)(char* str, int n);
  20.  int (* __stdcall getch)(void);
  21.  int (* __stdcall con_get_font_height)(void);
  22.  int (* __stdcall con_set_cursor_height)(int new_height);
  23. unsigned (*__stdcall con_get_flags)(void);
  24. unsigned (*__stdcall con_set_flags)(unsigned new_flags);
  25.  
  26. ///===========================
  27.  
  28. void CONSOLE_INIT(char title[])
  29. {
  30. kol_struct_import *imp;
  31.  
  32. imp = kol_cofflib_load("/sys/lib/console.obj");
  33. if (imp == NULL)
  34.         kol_exit();
  35.  
  36. con_init = ( _stdcall  void (*)(unsigned, unsigned, unsigned, unsigned, const char*))
  37.                 kol_cofflib_procload (imp, "con_init");
  38. if (con_init == NULL)
  39.         kol_exit();
  40.  
  41. printf = ( _cdecl void (*)(const char*,...))
  42.                 kol_cofflib_procload (imp, "con_printf");
  43. if (printf == NULL)
  44.         kol_exit();
  45.  
  46. _exit = ( _stdcall void (*)(char))
  47.                 kol_cofflib_procload (imp, "con_exit");
  48. if (_exit == NULL)
  49.         kol_exit();
  50.  
  51. gets = ( _stdcall void (*)(char*, int))
  52.                 kol_cofflib_procload (imp, "con_gets");
  53. if (gets == NULL)
  54.         kol_exit();
  55.  
  56. getch = ( _stdcall int (*)(void))
  57.                 kol_cofflib_procload (imp, "con_getch2");
  58. if (getch == NULL)
  59.         kol_exit();
  60.  
  61. con_get_font_height = ( _stdcall int (*)(void))
  62.                 kol_cofflib_procload (imp, "con_get_font_height");
  63. if (con_get_font_height == NULL)
  64.         kol_exit();
  65.  
  66. con_set_cursor_height = ( _stdcall int (*)(int))
  67.                 kol_cofflib_procload (imp, "con_set_cursor_height");
  68. if (con_set_cursor_height == NULL)
  69.         kol_exit();
  70.  
  71. con_get_flags = ( _stdcall unsigned (*)(void))
  72.                 kol_cofflib_procload (imp, "con_get_flags");
  73. if (con_get_flags == NULL)
  74.         kol_exit();
  75.  
  76. con_set_flags = ( _stdcall unsigned (*)(unsigned))
  77.                 kol_cofflib_procload (imp, "con_set_flags");
  78. if (con_set_flags == NULL)
  79.         kol_exit();
  80.  
  81. con_init(-1, -1, -1, -1, title);
  82. }
  83.