?login_element?

Subversion Repositories NedoOS

Rev

Rev 2117 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. void putdec(int c)
  2. {
  3.   int div;
  4.   int hassent = 0;
  5.   for (div = 100; div > 0; div /= 10)
  6.   {
  7.     int disp = c / div;
  8.     c %= div;
  9.     if ((disp != 0) || (hassent) || (div == 1))
  10.     {
  11.       hassent = 1;
  12.       putchar('0' + disp);
  13.     }
  14.   }
  15. }
  16.  
  17. void AT(int X, int Y)
  18. {
  19.   putchar(27);
  20.   putchar('[');
  21.   putdec(Y);
  22.   putchar(';');
  23.   putdec(X);
  24.   putchar('H');
  25. }
  26.  
  27. void ATRIB(int color)
  28. {
  29.   putchar(27);
  30.   putchar('[');
  31.   putdec(color);
  32.   putchar('m');
  33. }
  34.  
  35. void BOX(unsigned char Xbox, unsigned char Ybox, unsigned char Wbox, unsigned char Hbox, unsigned char Cbox, unsigned char character)
  36. {
  37.   unsigned char x, y;
  38.   ATRIB(Cbox);
  39.   for (y = 0; y < Hbox; y++)
  40.   {
  41.     AT(Xbox, Ybox + y);
  42.     for (x = 0; x < Wbox; x++)
  43.     {
  44.       putchar(character);
  45.     }
  46.   }
  47. }
  48.  
  49. void BDBOX(unsigned char Xbox, unsigned char Ybox, unsigned char Wbox, unsigned char Hbox, unsigned char Cbox, unsigned char character)
  50. {
  51.   unsigned char x, y;
  52.   OS_SETCOLOR(Cbox);
  53.   for (y = 0; y < Hbox; y++)
  54.   {
  55.     OS_SETXY(Xbox, Ybox + y);
  56.     for (x = 0; x < Wbox; x++)
  57.     {
  58.       putchar(character);
  59.     }
  60.   }
  61. }