QUESTIONS ON HFT COLOR AND CURSES

ITEM: RTA000049704



QUESTION:                                                                       
My customer is using an HFT terminal on a 580 machine.  There is an             
application that they are trying to move from a PC to the AIX                   
environment.  The PC application uses the full PC character set and             
that allows them to use 16 foreground and 16 background colors. They            
have managed to get 8 foreground and 8 background colors on the HFT.            
                                                                                
1. How can they get 16 foreground and 16 background colors out of the           
    IBM enhance curses implementation?                                          
2. There is the possibility that the system could have either a mono-           
    chrome or color screen.  How would they detect if it's a monochrome         
    or a color screen that is connected ( has_colors() standard                 
    curses function?                                                            
3. In the DOS environment, they use a 3rd party library function called         
    setattr(startrow,startcol,endrow,endcol,num_attribute) to set the          
    screen attributes and getattr(row,col) to retrieve the current              
    attribute from the screen. How could this be done in AIX?                   
Thanks for your help.                                                           
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: 1) There are only 8 background colors.  There are up to 8                    
      basic foreground colors which, but these 8 colors may be                  
      modified with the "BOLD" and "STANDOUT" specifications to                 
      the curses colorout() call.  Unfortunately, this does not                 
      work on all displays, and we could not get it to work on                  
      any of our HFTs or aixterms.                                              
                                                                                
   2) You cannot determine whether or not you have a color                      
      display, but you can determine whether you have a color                   
      display adapter.  See the InfoExplorer article entitled                  
      "hft.h File Structures for HFT Query ioctl Operations".                   
      The section "Query Physical Display IDs Operation" shows                  
      how to do this.  This article shows how to determine the                  
      adapter type with ioctl() calls.  We know of no way to                    
      determine the adapter type with curses functions.                         
                                                                                
   3) DOS computers map the video memory to physical memory                     
      addresses.  Therefore, to get or set the attribute                        
      associated with a character, all a program needs to do is                 
      to read or write the correct byte in memory.  This makes                  
      functions like setattr() and getattr() possible.                          
                                                                                
      Unfortunately, we know of no functions which allow a                      
      program to read or write an attribute byte directly in                    
      AIX.  You might consider writing a curses program which                  
      does nothing but set the color and write a byte, then                     
      run the dbx debugger on this program.  With an assembly                   
      language reference like "AIX Version 3.2 Assembler                        
      Language Reference" (document ID SC23-2197-02), you might                 
      be able to determine precisely how curses writes a                        
      character and its attribute.  Once you have determined this               
      you can write library functions in assembly language to                   
      get and set an attribute for you.  Though this may be                     
      difficult, once you have the library function, you will                   
      never have to do it again.                                                
                                                                                
   Thank you.                                                                   
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                               
                                                                                
This item was created from library item Q672916      CWJBP                      
                                                                                
Additional search words:                                                        
AUTO AUTOMATIC COLOR CURSES CWJBP HFT IX LPPS OCT94 OZIBM OZNEW                 
QUESTION RISCO RISCSYSTEM SOFTWARE SUPT                                         
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000049704 ITEM: RTA000049704
Dated: 10/1996 Category: RISCADEV
This HTML file was generated 99/06/24~12:43:18
Comments or suggestions? Contact us