~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/PCwin/cmap.cpp

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* Tina colormap handling PC windows. */
  2 
  3 #include <dibapi.h>
  4 
  5 #ifdef __cplusplus
  6 extern "C" {
  7 #endif
  8 #include <tina/tv.h>
  9 #include <tina/tvfuncs.h>
 10 #include <tina/sysfuncs.h>
 11 #include <tina/tv_screen.h>
 12 #ifdef __cplusplus
 13 }
 14 #endif
 15 
 16 extern void (*screen_text) (char *);
 17 #define Print(x)  if(screen_text!=NULL) screen_text(x)
 18 
 19 
 20 /* Create new colormap. (display, screen & visual are in cmap_data.) */
 21 extern "C" void cmap_create(Cmap_data * cmap_data)
 22 {
 23     if (cmap_data)
 24     {
 25     }
 26     Print("cmap_create?");
 27 }
 28 
 29 /* Get the colormap from cmap_data. */
 30 extern "C" void *cmap_data_cmap_get(Cmap_data * cmap_data)
 31 {
 32     Print("cmap_data_cmap_get?");
 33     return ((void *) 0);
 34 }
 35 
 36 /* Set the colormap from cmap_data. */
 37 extern "C" void cmap_data_cmap_set(Cmap_data * cmap_data, Colormap cmap)
 38 {
 39     if (cmap_data)
 40     {
 41         cmap_data->colormap = cmap;
 42     }
 43 }
 44 
 45 /* Get the number of cells in the colormap from cmap_data. */
 46 extern "C" int cmap_data_cmap_ncells_get(Cmap_data * cmap_data)
 47 {
 48     Print("cmap_data_cmap_ncells_get?");
 49     return(0);
 50 }
 51 
 52 /* Find a colormap for given display,screen & visual, created with
 53  * cmap_create_fn. If found in database use that else create one and
 54  * add it to database. */
 55 extern "C" Bool cmap_data_find(Tv * tv, Cmap_data * tv_screen_cmap_data, 
 56 int ndefault_colors)
 57 {
 58      Print("cmap_data_find?");
 59      return(false);
 60 }
 61 
 62 /* Fill colormap (from cell 0) with 'ndefault_colors' colors from
 63  * default colormap. Sets cmap_data->base to ndefault_colors. */
 64 extern "C" void cmap_data_default_color_fill(Cmap_data * cmap_data, 
 65 int ndefault_colors)
 66 {
 67     if (cmap_data)
 68     {
 69 
 70     }
 71     Print("cmap_data_default_color_fill?");
 72 }
 73 
 74 /* Compare key & data.  If they match return data else return NULL. */
 75 static void *cmap_data_match(Cmap_data * key, Cmap_data * data)
 76 {
 77     Print("cmap_data_match?");
 78     return (NULL);
 79 }
 80 
 81 /* Fill tina_colors (array) with 'ncolors' colors (X pixel & rgb's
 82  * (range: 0 - 0XFFFF)) starting at 'base' in colormap. */
 83 extern "C" void cmap_query_colors(Cmap_data * cmap_data, 
 84 Tina_color * tina_colors, int base, int ncolors)
 85 /* pixel & rgb fields to fill. */
 86 {
 87     if (cmap_data)
 88     {
 89     }
 90     Print("cmap_query_colors?");
 91 }
 92 
 93 /* Fill colormap (starting at 'base') with 'ncolors' colors (rgb's in
 94  * tina_colors array). NB calculates pixels from index in array, offset
 95  * by base.  Sets 'tina_colors[].pixel' to XColor pixel of colormap
 96  * cells used. */
 97 extern "C" void cmap_store_colors(Cmap_data * cmap_data, 
 98 Tina_color * tina_colors, int base, int ncolors)
 99 
100 /* Uses rgb fields & fills in pixel field */
101 
102 {
103     if (cmap_data)
104     {
105     }
106     Print("cmap_store_colors?");
107 }
108 
109 
110 /* Get rgb's corresponding to named colors. */
111 extern "C" void named_colors_rgbs_get(Cmap_data * cmap_data, 
112 char **color_names, int ncolors, Rgb * rgbs)
113 {
114     if (cmap_data)
115     {
116     }
117     Print("named_colors_rgbs_get?");
118 }
119 
120 /* Create colormap of the highest available model class:
121  * (DirectColor>PseudoColor>GrayScale). Also allocate & fill
122  * corresponding Cmap_data structure. If the color map is PseudoColor
123  * or GrayScale then the first ndefault_colors values in the color map
124  * are copied from some default values to prevent too much flashing as
125  * the colormap is (un)installed by the window manager. */
126 extern "C" Cmap_data_visible *tv_screen_cmap_create(void *tv_screen_void, 
127 int ndefault_colors)
128 {
129     Cmap_data *cmap_data = NULL;
130     Tv_screen *tv_screen = (Tv_screen *) tv_screen_void;
131 
132     if (tv_screen)
133     {
134 
135     }
136     Print("tv_screen_cmap_create?");
137     return (Cmap_data_visible *) cmap_data;
138 }
139 
140 /* Find & install a colormap in a tv_screen using a tv's
141  * cmap_create_fn. If colormaps of tv_screen & tv match do nowt.  Else
142  * find a colormap created with the tv's cmap_create_fn and install it
143  * in the tv_screen's window and update the tv's cmap_data_visible
144  * structure.  Finding a colormap means either retrieving a suitable
145  * one from a database or creating a new one and storing in the
146  * database. */
147 extern "C" void tv_screen_cmap_find_and_install(Tv * tv, 
148 Tv_screen * tv_screen)
149 {
150     if (tv_screen)
151     {
152     }
153     Print("tv_screen_cmap_find_and_install?");
154 }
155 
156 /* Install tv_screen's colormap as THE colormap.  Ie override window
157  * manager and use the tv_screen's colormap. (Window manager fails to
158  * do this.) */
159 extern "C" void tv_screen_cmap_install(Tv_screen * tv_screen, 
160 Colormap cmap)
161 {
162 
163     Print("tv_screen_cmap_install?");
164 }
165 
166 /* Get the number of cells in the colormap of a tv_screen. */
167 extern "C" int tv_screen_cmap_ncells_get(Tv_screen * tv_screen)
168 {
169     int     ncells = 0;
170 
171     if (tv_screen)
172     {
173     }
174     Print("tv_screen_cmap_ncells_get?");
175     return ncells;
176 }
177 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.