- Timestamp:
- Aug 2, 2009, 1:09:16 PM (13 years ago)
- Location:
- libcaca/trunk/caca
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca.h
r3587 r3603 29 29 #if !defined(__KERNEL__) 30 30 # include <stdarg.h> 31 # include <stdio.h> 31 32 #endif 32 33 … … 492 493 __extern int caca_get_event_resize_width(caca_event_t const *); 493 494 __extern int caca_get_event_resize_height(caca_event_t const *); 495 /* @} */ 496 497 /** \brief DOS colours 498 * 499 * This enum lists the colour values for the DOS conio.h compatibility 500 * layer. 501 */ 502 enum CACA_CONIO_COLORS 503 { 504 CACA_CONIO_BLINK = 128, 505 CACA_CONIO_BLACK = 0, 506 CACA_CONIO_BLUE = 1, 507 CACA_CONIO_GREEN = 2, 508 CACA_CONIO_CYAN = 3, 509 CACA_CONIO_RED = 4, 510 CACA_CONIO_MAGENTA = 5, 511 CACA_CONIO_BROWN = 6, 512 CACA_CONIO_LIGHTGRAY = 7, 513 CACA_CONIO_DARKGRAY = 8, 514 CACA_CONIO_LIGHTBLUE = 9, 515 CACA_CONIO_LIGHTGREEN = 10, 516 CACA_CONIO_LIGHTCYAN = 11, 517 CACA_CONIO_LIGHTRED = 12, 518 CACA_CONIO_LIGHTMAGENTA = 13, 519 CACA_CONIO_YELLOW = 14, 520 CACA_CONIO_WHITE = 15, 521 }; 522 523 /** \brief DOS cursor modes 524 * 525 * This enum lists the cursor mode values for the DOS conio.h compatibility 526 * layer. 527 */ 528 enum CACA_CONIO_CURSOR 529 { 530 CACA_CONIO__NOCURSOR = 0, 531 CACA_CONIO__SOLIDCURSOR = 1, 532 CACA_CONIO__NORMALCURSOR = 2, 533 }; 534 535 /** \brief DOS video modes 536 * 537 * This enum lists the video mode values for the DOS conio.h compatibility 538 * layer. 539 */ 540 enum CACA_CONIO_MODE 541 { 542 CACA_CONIO_LASTMODE = -1, 543 CACA_CONIO_BW40 = 0, 544 CACA_CONIO_C40 = 1, 545 CACA_CONIO_BW80 = 2, 546 CACA_CONIO_C80 = 3, 547 CACA_CONIO_MONO = 7, 548 CACA_CONIO_C4350 = 64, 549 }; 550 551 /** \brief DOS text area information 552 * 553 * This structure stores text area information for the DOS conio.h 554 * compatibility layer. 555 */ 556 struct caca_conio_text_info 557 { 558 unsigned char winleft; /* left window coordinate */ 559 unsigned char wintop; /* top window coordinate */ 560 unsigned char winright; /* right window coordinate */ 561 unsigned char winbottom; /* bottom window coordinate */ 562 unsigned char attribute; /* text attribute */ 563 unsigned char normattr; /* normal attribute */ 564 unsigned char currmode; /* current video mode: 565 BW40, BW80, C40, C80, or C4350 */ 566 unsigned char screenheight; /* text screen's height */ 567 unsigned char screenwidth; /* text screen's width */ 568 unsigned char curx; /* x-coordinate in current window */ 569 unsigned char cury; /* y-coordinate in current window */ 570 }; 571 572 /** \brief DOS direct video control */ 573 __extern int caca_conio_directvideo; 574 575 /** \brief DOS scrolling control */ 576 __extern int caca_conio__wscroll; 577 578 /** \defgroup conio libcaca DOS conio.h compatibility layer 579 * 580 * These functions implement DOS-like functions for high-level text 581 * operations. 582 * 583 * @{ */ 584 __extern char * caca_conio_cgets(char *str); 585 __extern void caca_conio_clreol(void); 586 __extern void caca_conio_clrscr(void); 587 __extern int caca_conio_cprintf(const char *format, ...); 588 __extern int caca_conio_cputs(const char *str); 589 __extern int caca_conio_cscanf(char *format, ...); 590 __extern void caca_conio_delay(unsigned int); 591 __extern void caca_conio_delline(void); 592 __extern int caca_conio_getch(void); 593 __extern int caca_conio_getche(void); 594 __extern char * caca_conio_getpass(const char *prompt); 595 __extern int caca_conio_gettext(int left, int top, int right, int bottom, 596 void *destin); 597 __extern void caca_conio_gettextinfo(struct caca_conio_text_info *r); 598 __extern void caca_conio_gotoxy(int x, int y); 599 __extern void caca_conio_highvideo(void); 600 __extern void caca_conio_insline(void); 601 __extern int caca_conio_kbhit(void); 602 __extern void caca_conio_lowvideo(void); 603 __extern int caca_conio_movetext(int left, int top, int right, int bottom, 604 int destleft, int desttop); 605 __extern void caca_conio_normvideo(void); 606 __extern void caca_conio_nosound(void); 607 __extern int caca_conio_printf(const char *format, ...); 608 __extern int caca_conio_putch(int ch); 609 __extern int caca_conio_puttext(int left, int top, int right, int bottom, 610 void *destin); 611 __extern void caca_conio__setcursortype(int cur_t); 612 __extern void caca_conio_sleep(unsigned int); 613 __extern void caca_conio_sound(unsigned int); 614 __extern void caca_conio_textattr(int newattr); 615 __extern void caca_conio_textbackground(int newcolor); 616 __extern void caca_conio_textcolor(int newcolor); 617 __extern void caca_conio_textmode(int newmode); 618 __extern int caca_conio_ungetch(int ch); 619 __extern int caca_conio_wherex(void); 620 __extern int caca_conio_wherey(void); 621 __extern void caca_conio_window(int left, int top, int right, int bottom); 494 622 /* @} */ 495 623 -
libcaca/trunk/caca/caca_conio.h
r3601 r3603 21 21 22 22 #include <caca.h> 23 24 #if !defined(__KERNEL__)25 # include <stdio.h>26 #endif27 28 #undef __extern29 #if defined(_DOXYGEN_SKIP_ME)30 #elif defined(_WIN32) && defined(__LIBCACA__)31 # define __extern extern __declspec(dllexport)32 #else33 # define __extern extern34 #endif35 36 #ifdef __cplusplus37 extern "C"38 {39 #endif40 41 /* conio.h enums and global variables */42 enum CACA_CONIO_COLORS43 {44 CACA_CONIO_BLINK = 128,45 CACA_CONIO_BLACK = 0,46 CACA_CONIO_BLUE = 1,47 CACA_CONIO_GREEN = 2,48 CACA_CONIO_CYAN = 3,49 CACA_CONIO_RED = 4,50 CACA_CONIO_MAGENTA = 5,51 CACA_CONIO_BROWN = 6,52 CACA_CONIO_LIGHTGRAY = 7,53 CACA_CONIO_DARKGRAY = 8,54 CACA_CONIO_LIGHTBLUE = 9,55 CACA_CONIO_LIGHTGREEN = 10,56 CACA_CONIO_LIGHTCYAN = 11,57 CACA_CONIO_LIGHTRED = 12,58 CACA_CONIO_LIGHTMAGENTA = 13,59 CACA_CONIO_YELLOW = 14,60 CACA_CONIO_WHITE = 15,61 };62 __extern int caca_conio_directvideo;63 enum CACA_CONIO_CURSOR64 {65 CACA_CONIO__NOCURSOR = 0,66 CACA_CONIO__SOLIDCURSOR = 1,67 CACA_CONIO__NORMALCURSOR = 2,68 };69 struct caca_conio_text_info70 {71 unsigned char winleft; /* left window coordinate */72 unsigned char wintop; /* top window coordinate */73 unsigned char winright; /* right window coordinate */74 unsigned char winbottom; /* bottom window coordinate */75 unsigned char attribute; /* text attribute */76 unsigned char normattr; /* normal attribute */77 unsigned char currmode; /* current video mode:78 BW40, BW80, C40, C80, or C4350 */79 unsigned char screenheight; /* text screen's height */80 unsigned char screenwidth; /* text screen's width */81 unsigned char curx; /* x-coordinate in current window */82 unsigned char cury; /* y-coordinate in current window */83 };84 enum CACA_CONIO_MODE85 {86 CACA_CONIO_LASTMODE = -1,87 CACA_CONIO_BW40 = 0,88 CACA_CONIO_C40 = 1,89 CACA_CONIO_BW80 = 2,90 CACA_CONIO_C80 = 3,91 CACA_CONIO_MONO = 7,92 CACA_CONIO_C4350 = 64,93 };94 __extern int caca_conio__wscroll;95 23 96 24 #if !defined _DOXYGEN_SKIP_ME && !defined __LIBCACA__ … … 129 57 # undef WHITE 130 58 # define WHITE CACA_CONIO_WHITE 131 # undef directvideo 132 # define directvideo caca_conio_directvideo 59 #endif 60 61 #if !defined _DOXYGEN_SKIP_ME && !defined __LIBCACA__ 133 62 # undef _NOCURSOR 134 63 # define _NOCURSOR CACA_CONIO__NOCURSOR … … 137 66 # undef _NORMALCURSOR 138 67 # define _NORMALCURSOR CACA_CONIO__NORMALCURSOR 139 # undef text_info 140 # define text_info caca_conio_text_info 68 #endif 69 70 #if !defined _DOXYGEN_SKIP_ME && !defined __LIBCACA__ 141 71 # undef LASTMODE 142 72 # define LASTMODE CACA_CONIO_LASTMODE … … 153 83 # undef C4350 154 84 # define C4350 CACA_CONIO_C4350 85 #endif 86 87 #if !defined _DOXYGEN_SKIP_ME && !defined __LIBCACA__ 88 # undef directvideo 89 # define directvideo caca_conio_directvideo 90 # undef text_info 91 # define text_info caca_conio_text_info 155 92 # undef _wscroll 156 93 # define _wscroll caca_conio__wscroll 157 94 #endif 158 159 /* conio.h functions */160 __extern char * caca_conio_cgets(char *str);161 __extern void caca_conio_clreol(void);162 __extern void caca_conio_clrscr(void);163 __extern int caca_conio_cprintf(const char *format, ...);164 __extern int caca_conio_cputs(const char *str);165 __extern int caca_conio_cscanf(char *format, ...);166 __extern void caca_conio_delay(unsigned int);167 __extern void caca_conio_delline(void);168 __extern int caca_conio_getch(void);169 __extern int caca_conio_getche(void);170 __extern char * caca_conio_getpass(const char *prompt);171 __extern int caca_conio_gettext(int left, int top, int right, int bottom,172 void *destin);173 __extern void caca_conio_gettextinfo(struct caca_conio_text_info *r);174 __extern void caca_conio_gotoxy(int x, int y);175 __extern void caca_conio_highvideo(void);176 __extern void caca_conio_insline(void);177 __extern int caca_conio_kbhit(void);178 __extern void caca_conio_lowvideo(void);179 __extern int caca_conio_movetext(int left, int top, int right, int bottom,180 int destleft, int desttop);181 __extern void caca_conio_normvideo(void);182 __extern void caca_conio_nosound(void);183 __extern int caca_conio_printf(const char *format, ...);184 __extern int caca_conio_putch(int ch);185 __extern int caca_conio_puttext(int left, int top, int right, int bottom,186 void *destin);187 __extern void caca_conio__setcursortype(int cur_t);188 __extern void caca_conio_sleep(unsigned int);189 __extern void caca_conio_sound(unsigned int);190 __extern void caca_conio_textattr(int newattr);191 __extern void caca_conio_textbackground(int newcolor);192 __extern void caca_conio_textcolor(int newcolor);193 __extern void caca_conio_textmode(int newmode);194 __extern int caca_conio_ungetch(int ch);195 __extern int caca_conio_wherex(void);196 __extern int caca_conio_wherey(void);197 __extern void caca_conio_window(int left, int top, int right, int bottom);198 95 199 96 #if !defined _DOXYGEN_SKIP_ME && !defined __LIBCACA__ … … 270 167 #endif 271 168 272 #ifdef __cplusplus273 }274 #endif275 276 169 #endif /* __CACA_CONIO_H__ */
Note: See TracChangeset
for help on using the changeset viewer.