Subversion Repositories Kolibri OS

Rev

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. void (*__stdcall con_cls)(void);
  26.  
  27. ///===========================
  28.  
  29. void CONSOLE_INIT(char title[])
  30. {
  31. kol_struct_import *imp;
  32.  
  33. imp = kol_cofflib_load("/sys/lib/console.obj");
  34. if (imp == NULL)
  35.         kol_exit();
  36.  
  37. con_init = ( _stdcall  void (*)(unsigned, unsigned, unsigned, unsigned, const char*))
  38.                 kol_cofflib_procload (imp, "con_init");
  39. if (con_init == NULL)
  40.         kol_exit();
  41.  
  42. printf = ( _cdecl void (*)(const char*,...))
  43.                 kol_cofflib_procload (imp, "con_printf");
  44. if (printf == NULL)
  45.         kol_exit();
  46.  
  47. _exit = ( _stdcall void (*)(char))
  48.                 kol_cofflib_procload (imp, "con_exit");
  49. if (_exit == NULL)
  50.         kol_exit();
  51.  
  52. gets = ( _stdcall void (*)(char*, int))
  53.                 kol_cofflib_procload (imp, "con_gets");
  54. if (gets == NULL)
  55.         kol_exit();
  56.  
  57. getch = ( _stdcall int (*)(void))
  58.                 kol_cofflib_procload (imp, "con_getch2");
  59. if (getch == NULL)
  60.         kol_exit();
  61.  
  62. con_get_font_height = ( _stdcall int (*)(void))
  63.                 kol_cofflib_procload (imp, "con_get_font_height");
  64. if (con_get_font_height == NULL)
  65.         kol_exit();
  66.  
  67. con_set_cursor_height = ( _stdcall int (*)(int))
  68.                 kol_cofflib_procload (imp, "con_set_cursor_height");
  69. if (con_set_cursor_height == NULL)
  70.         kol_exit();
  71.  
  72. con_get_flags = ( _stdcall unsigned (*)(void))
  73.                 kol_cofflib_procload (imp, "con_get_flags");
  74. if (con_get_flags == NULL)
  75.         kol_exit();
  76.  
  77. con_set_flags = ( _stdcall unsigned (*)(unsigned))
  78.                 kol_cofflib_procload (imp, "con_set_flags");
  79. if (con_set_flags == NULL)
  80.         kol_exit();
  81.  
  82. con_cls = ( _stdcall void (*)(void))
  83.                 kol_cofflib_procload (imp, "con_cls");
  84. if (con_cls == NULL)
  85.         kol_exit();
  86.  
  87. con_init(-1, -1, -1, -1, title);
  88. }
  89.