home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / thesrc15.zip / extcurs.c < prev    next >
C/C++ Source or Header  |  1993-11-10  |  4KB  |  127 lines

  1. /***********************************************************************/
  2. /* EXTCURS.C -                                                         */
  3. /* This file contains pseudo SystemV functions that are missing in AIX */
  4. /* Extended Curses.                                                    */
  5. /***********************************************************************/
  6. /*
  7.  * THE - The Hessling Editor. A text editor similar to VM/CMS xedit.
  8.  * Copyright (C) 1991-1993 Mark Hessling
  9.  *
  10.  * This program is free software; you can redistribute it and/or
  11.  * modify it under the terms of the GNU General Public License as
  12.  * published by the Free Software Foundation; either version 2 of
  13.  * the License, or any later version.
  14.  *
  15.  * This program is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18.  * General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with this program; if not, write to:
  22.  *
  23.  *    The Free Software Foundation, Inc.
  24.  *    675 Mass Ave,
  25.  *    Cambridge, MA 02139 USA.
  26.  *
  27.  *
  28.  * If you make modifications to this software that you feel increases
  29.  * it usefulness for the rest of the community, please email the
  30.  * changes, enhancements, bug fixes as well as any and all ideas to me.
  31.  * This software is going to be maintained and enhanced as deemed
  32.  * necessary by the community.
  33.  *
  34.  * Mark Hessling                     email: M.Hessling@gu.edu.au
  35.  * 36 David Road                     Phone: +61 7 849 7731
  36.  * Holland Park                      Fax:   +61 7 875 5314
  37.  * QLD 4121
  38.  * Australia
  39.  */
  40.  
  41. /*
  42. $Header: C:\THE\RCS\extcurs.c 1.4 1993/09/01 16:25:31 MH Interim MH $
  43. */
  44.  
  45. #include "the.h"
  46.  
  47. chtype color_pair[COLOR_PAIRS];
  48. static chtype fore_color[8];
  49. static chtype back_color[8];
  50. extern VIEW_DETAILS *vd_current,*vd_first,*vd_mark;
  51. /***********************************************************************/
  52. #ifdef PROTO
  53. int has_colors(void)
  54. #else
  55. int has_colors()
  56. #endif
  57. /***********************************************************************/
  58. {
  59. /*--------------------------- local data ------------------------------*/
  60. /*--------------------------- processing ------------------------------*/
  61.  return(TRUE);
  62. }
  63. /***********************************************************************/
  64. #ifdef PROTO
  65. int start_color(void)
  66. #else
  67. int start_color()
  68. #endif
  69. /***********************************************************************/
  70. {
  71. /*--------------------------- local data ------------------------------*/
  72.  register int i;
  73. /*--------------------------- processing ------------------------------*/
  74.  for (i=0;i<COLOR_PAIRS;i++)
  75.    color_pair[i] = NORMAL;
  76.  fore_color[COLOR_BLACK  ] = F_BLACK  ;
  77.  fore_color[COLOR_BLUE   ] = F_BLUE   ;
  78.  fore_color[COLOR_GREEN  ] = F_GREEN  ;
  79.  fore_color[COLOR_CYAN   ] = F_CYAN   ;
  80.  fore_color[COLOR_RED    ] = F_RED    ;
  81.  fore_color[COLOR_MAGENTA] = F_MAGENTA;
  82.  fore_color[COLOR_YELLOW ] = F_BROWN  ;
  83.  fore_color[COLOR_WHITE  ] = F_WHITE  ;
  84.  back_color[COLOR_BLACK  ] = B_BLACK  ;
  85.  back_color[COLOR_BLUE   ] = B_BLUE   ;
  86.  back_color[COLOR_GREEN  ] = B_GREEN  ;
  87.  back_color[COLOR_CYAN   ] = B_CYAN   ;
  88.  back_color[COLOR_RED    ] = B_RED    ;
  89.  back_color[COLOR_MAGENTA] = B_MAGENTA;
  90.  back_color[COLOR_YELLOW ] = B_BROWN  ;
  91.  back_color[COLOR_WHITE  ] = B_WHITE  ;
  92.  return(0);
  93. }
  94. /***********************************************************************/
  95. #ifdef PROTO
  96. int init_pair(int pairnum,chtype fore,chtype back)
  97. #else
  98. int init_pair(pairnum,fore,back)
  99. int pairnum;
  100. chtype fore,back;
  101. #endif
  102. /***********************************************************************/
  103. {
  104. /*--------------------------- local data ------------------------------*/
  105.  register int i;
  106. /*--------------------------- processing ------------------------------*/
  107.  color_pair[pairnum] = fore_color[fore] | back_color[back];
  108.  return(0);
  109. }
  110. /***********************************************************************/
  111. #ifdef PROTO
  112. int doupdate(void)
  113. #else
  114. int doupdate()
  115. #endif
  116. /***********************************************************************/
  117. {
  118. /*--------------------------- local data ------------------------------*/
  119.  short y,x;
  120. /*--------------------------- processing ------------------------------*/
  121.  getyx(CURRENT_WINDOW,y,x);
  122.  wrefresh(CURRENT_WINDOW);
  123.  refresh();
  124.  wmove(CURRENT_WINDOW,y,x);
  125.  return(0);
  126. }
  127.