fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Pixmap.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Pixmap drawing code for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2015 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 // Draws X pixmap data, keeping it stashed in a server pixmap so it
20 // redraws fast.
21 
22 // See fl_draw_pixmap.cxx for code used to get the actual data into pixmap.
23 // Implemented without using the xpm library (which I can't use because
24 // it interferes with the color cube used by fl_draw_image).
25 
26 #include <config.h>
27 #include <FL/Fl.H>
28 #include <FL/fl_draw.H>
29 #include <FL/x.H>
30 #include <FL/Fl_Widget.H>
31 #include <FL/Fl_Menu_Item.H>
32 #include <FL/Fl_Pixmap.H>
33 #include <FL/Fl_Printer.H>
34 
35 #if defined(USE_X11)
36 # if HAVE_X11_XREGION_H
37 # include <X11/Xregion.h>
38 # else // if the X11/Xregion.h header is not available, we assume this is the layout of an X11 Region:
39 typedef struct {
40  short x1, x2, y1, y2;
41 } BOX;
42 struct _XRegion {
43  long size;
44  long numRects;
45  BOX *rects;
46  BOX extents;
47 };
48 # endif // HAVE_X11_XREGION_H
49 #endif // USE_X11
50 
51 #include <stdio.h>
52 #include "flstring.h"
53 #include <ctype.h>
54 
55 #ifdef WIN32
56 extern void fl_release_dc(HWND, HDC); // located in Fl_win32.cxx
57 #endif
58 
59 extern uchar **fl_mask_bitmap; // used by fl_draw_pixmap.cxx to store mask
60 void fl_restore_clip(); // in fl_rect.cxx
61 
63  int W, H;
64 
65  // ignore empty or bad pixmap data:
66  if (w()<0 && data()) {
67  fl_measure_pixmap(data(), W, H);
68  w(W); h(H);
69  }
70 }
71 
72 void Fl_Pixmap::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
73  fl_graphics_driver->draw(this, XP, YP, WP, HP, cx, cy);
74 }
75 
76 static int start(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int w, int h, int &cx, int &cy,
77  int &X, int &Y, int &W, int &H)
78 {
79  // ignore empty or bad pixmap data:
80  if (!pxm->data()) {
81  return 2;
82  }
83  if (WP == -1) {
84  WP = w;
85  HP = h;
86  }
87  if (!w) {
88  return 2;
89  }
90  // account for current clip region (faster on Irix):
91  fl_clip_box(XP,YP,WP,HP,X,Y,W,H);
92  cx += X-XP; cy += Y-YP;
93  // clip the box down to the size of image, quit if empty:
94  if (cx < 0) {W += cx; X -= cx; cx = 0;}
95  if (cx+W > w) W = w-cx;
96  if (W <= 0) return 1;
97  if (cy < 0) {H += cy; Y -= cy; cy = 0;}
98  if (cy+H > h) H = h-cy;
99  if (H <= 0) return 1;
100  return 0;
101 }
102 
103 int Fl_Pixmap::prepare(int XP, int YP, int WP, int HP, int &cx, int &cy,
104  int &X, int &Y, int &W, int &H) {
105  if (w() < 0) measure();
106  int code = start(this, XP, YP, WP, HP, w(), h(), cx, cy, X, Y, W, H);
107  if (code) {
108  if (code == 2) draw_empty(XP, YP);
109  return 1;
110  }
111  if (!id_) {
112 #ifdef __APPLE__
113  id_ = Fl_Quartz_Graphics_Driver::create_offscreen_with_alpha(w(), h());
114 #else
115  id_ = fl_create_offscreen(w(), h());
116 #endif
118 #ifndef __APPLE__
119  uchar *bitmap = 0;
120  fl_mask_bitmap = &bitmap;
121 #endif
122  fl_draw_pixmap(data(), 0, 0, FL_BLACK);
123 #ifndef __APPLE__
124 #if defined(WIN32)
125  extern UINT win_pixmap_bg_color; // computed by fl_draw_pixmap()
126  this->pixmap_bg_color = win_pixmap_bg_color;
127 #endif
128  fl_mask_bitmap = 0;
129  if (bitmap) {
130  mask_ = fl_create_bitmask(w(), h(), bitmap);
131  delete[] bitmap;
132  }
133 #endif
135  }
136  return 0;
137 }
138 
139 //------------------------------------------------------------------------------
140 #ifdef __APPLE__ // Apple, Mac OS X
141 //------------------------------------------------------------------------------
142 
143 void Fl_Quartz_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
144  int X, Y, W, H;
145  if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
146  copy_offscreen(X, Y, W, H, (Fl_Offscreen)pxm->id_, cx, cy);
147 }
148 
149 //------------------------------------------------------------------------------
150 #elif defined(WIN32) // Windows GDI
151 //------------------------------------------------------------------------------
152 
153 void Fl_GDI_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
154  int X, Y, W, H;
155  if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
156  if (pxm->mask_) {
157  HDC new_gc = CreateCompatibleDC(fl_gc);
158  int save = SaveDC(new_gc);
159  SelectObject(new_gc, (void*)pxm->mask_);
160  BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCAND);
161  SelectObject(new_gc, (void*)pxm->id_);
162  BitBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, SRCPAINT);
163  RestoreDC(new_gc,save);
164  DeleteDC(new_gc);
165  } else {
166  copy_offscreen(X, Y, W, H, (Fl_Offscreen)pxm->id_, cx, cy);
167  }
168 }
169 
170 #if FLTK_ABI_VERSION < 10301
171 UINT Fl_Pixmap::pixmap_bg_color = 0;
172 #endif
173 
174 void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
175  int X, Y, W, H;
176  if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
177  typedef BOOL (WINAPI* fl_transp_func) (HDC,int,int,int,int,HDC,int,int,int,int,UINT);
178  static HMODULE hMod = NULL;
179  static fl_transp_func fl_TransparentBlt = NULL;
180  if (!hMod) {
181  hMod = LoadLibrary("MSIMG32.DLL");
182  if(hMod) fl_TransparentBlt = (fl_transp_func)GetProcAddress(hMod, "TransparentBlt");
183  }
184  if (fl_TransparentBlt) {
185  HDC new_gc = CreateCompatibleDC(fl_gc);
186  int save = SaveDC(new_gc);
187  SelectObject(new_gc, (void*)pxm->id_);
188  // print all of offscreen but its parts in background color
189  fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, W, H, pxm->pixmap_bg_color );
190  RestoreDC(new_gc,save);
191  DeleteDC(new_gc);
192  }
193  else {
194  copy_offscreen(X, Y, W, H, (Fl_Offscreen)pxm->id_, cx, cy);
195  }
196 }
197 
198 //------------------------------------------------------------------------------
199 #else // X11, Xlib
200 //------------------------------------------------------------------------------
201 
202 void Fl_Xlib_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) {
203  int X, Y, W, H;
204  if (pxm->prepare(XP, YP, WP, HP, cx, cy, X, Y, W, H)) return;
205  if (pxm->mask_) {
206  // make X use the bitmap as a mask:
207  XSetClipMask(fl_display, fl_gc, pxm->mask_);
208  XSetClipOrigin(fl_display, fl_gc, X-cx, Y-cy);
209  if (clip_region()) {
210  // At this point, XYWH is the bounding box of the intersection between
211  // the current clip region and the (portion of the) pixmap we have to draw.
212  // The current clip region is often a rectangle. But, when a window with rounded
213  // corners is moved above another window, expose events may create a complex clip
214  // region made of several (e.g., 10) rectangles. We have to draw only in the clip
215  // region, and also to mask out the transparent pixels of the image. This can't
216  // be done in a single Xlib call for a multi-rectangle clip region. Thus, we
217  // process each rectangle of the intersection between the clip region and XYWH.
218  // See also STR #3206.
219  Region r = XRectangleRegion(X,Y,W,H);
220  XIntersectRegion(r, clip_region(), r);
221  int X1, Y1, W1, H1;
222  for (int i = 0; i < r->numRects; i++) {
223  X1 = r->rects[i].x1;
224  Y1 = r->rects[i].y1;
225  W1 = r->rects[i].x2 - r->rects[i].x1;
226  H1 = r->rects[i].y2 - r->rects[i].y1;
227  copy_offscreen(X1, Y1, W1, H1, pxm->id_, cx + (X1 - X), cy + (Y1 - Y));
228  }
229  XDestroyRegion(r);
230  } else {
231  copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
232  }
233  // put the old clip region back
234  XSetClipOrigin(fl_display, fl_gc, 0, 0);
235  restore_clip();
236  }
237  else copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
238 }
239 
240 //------------------------------------------------------------------------------
241 #endif // (platform-specific)
242 //------------------------------------------------------------------------------
243 
249  uncache();
250  delete_data();
251 }
252 
254  if (id_) {
256  id_ = 0;
257  }
258 
259  if (mask_) {
261  mask_ = 0;
262  }
263 }
264 
266  widget->image(this);
267 }
268 
271  m->label(_FL_IMAGE_LABEL, (const char*)this);
272 }
273 
275  if (alloc_data) return;
276 
277  char **new_data, // New data array
278  **new_row; // Current row in image
279  int i, // Looping var
280  ncolors, // Number of colors in image
281  chars_per_pixel,// Characters per color
282  chars_per_line; // Characters per line
283 
284  // Figure out how many colors there are, and how big they are...
285  sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel);
286  chars_per_line = chars_per_pixel * w() + 1;
287 
288  // Allocate memory for the new array...
289  if (ncolors < 0) new_data = new char *[h() + 2];
290  else new_data = new char *[h() + ncolors + 1];
291 
292  new_data[0] = new char[strlen(data()[0]) + 1];
293  strcpy(new_data[0], data()[0]);
294 
295  // Copy colors...
296  if (ncolors < 0) {
297  // Copy FLTK colormap values...
298  ncolors = -ncolors;
299  new_row = new_data + 1;
300  *new_row = new char[ncolors * 4];
301  memcpy(*new_row, data()[1], ncolors * 4);
302  ncolors = 1;
303  new_row ++;
304  } else {
305  // Copy standard XPM colormap values...
306  for (i = 0, new_row = new_data + 1; i < ncolors; i ++, new_row ++) {
307  *new_row = new char[strlen(data()[i + 1]) + 1];
308  strcpy(*new_row, data()[i + 1]);
309  }
310  }
311 
312  // Copy image data...
313  for (i = 0; i < h(); i ++, new_row ++) {
314  *new_row = new char[chars_per_line];
315  memcpy(*new_row, data()[i + ncolors + 1], chars_per_line);
316  }
317 
318  // Update pointers...
319  data((const char **)new_data, h() + ncolors + 1);
320  alloc_data = 1;
321 }
322 
323 Fl_Image *Fl_Pixmap::copy(int W, int H) {
324  Fl_Pixmap *new_image; // New pixmap
325 
326  // Optimize the simple copy where the width and height are the same...
327  if (W == w() && H == h()) {
328  // Make an exact copy of the image and return it...
329  new_image = new Fl_Pixmap(data());
330  new_image->copy_data();
331  return new_image;
332  }
333  if (W <= 0 || H <= 0) return 0;
334 
335  // OK, need to resize the image data; allocate memory and
336  char **new_data, // New array for image data
337  **new_row, // Pointer to row in image data
338  *new_ptr, // Pointer into new array
339  new_info[255]; // New information line
340  const char *old_ptr; // Pointer into old array
341  int i, // Looping var
342  c, // Channel number
343  sy, // Source coordinate
344  dx, dy, // Destination coordinates
345  xerr, yerr, // X & Y errors
346  xmod, ymod, // X & Y moduli
347  xstep, ystep; // X & Y step increments
348  int ncolors, // Number of colors in image
349  chars_per_pixel,// Characters per color
350  chars_per_line; // Characters per line
351 
352  // Figure out how many colors there are, and how big they are...
353  sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel);
354  chars_per_line = chars_per_pixel * W + 1;
355 
356  sprintf(new_info, "%d %d %d %d", W, H, ncolors, chars_per_pixel);
357 
358  // Figure out Bresenham step/modulus values...
359  xmod = w() % W;
360  xstep = (w() / W) * chars_per_pixel;
361  ymod = h() % H;
362  ystep = h() / H;
363 
364  // Allocate memory for the new array...
365  if (ncolors < 0) new_data = new char *[H + 2];
366  else new_data = new char *[H + ncolors + 1];
367  new_data[0] = new char[strlen(new_info) + 1];
368  strcpy(new_data[0], new_info);
369 
370  // Copy colors...
371  if (ncolors < 0) {
372  // Copy FLTK colormap values...
373  ncolors = -ncolors;
374  new_row = new_data + 1;
375  *new_row = new char[ncolors * 4];
376  memcpy(*new_row, data()[1], ncolors * 4);
377  ncolors = 1;
378  new_row ++;
379  } else {
380  // Copy standard XPM colormap values...
381  for (i = 0, new_row = new_data + 1; i < ncolors; i ++, new_row ++) {
382  *new_row = new char[strlen(data()[i + 1]) + 1];
383  strcpy(*new_row, data()[i + 1]);
384  }
385  }
386 
387  // Scale the image using a nearest-neighbor algorithm...
388  for (dy = H, sy = 0, yerr = H; dy > 0; dy --, new_row ++) {
389  *new_row = new char[chars_per_line];
390  new_ptr = *new_row;
391 
392  for (dx = W, xerr = W, old_ptr = data()[sy + ncolors + 1];
393  dx > 0;
394  dx --) {
395  for (c = 0; c < chars_per_pixel; c ++) *new_ptr++ = old_ptr[c];
396 
397  old_ptr += xstep;
398  xerr -= xmod;
399 
400  if (xerr <= 0) {
401  xerr += W;
402  old_ptr += chars_per_pixel;
403  }
404  }
405 
406  *new_ptr = '\0';
407  sy += ystep;
408  yerr -= ymod;
409  if (yerr <= 0) {
410  yerr += H;
411  sy ++;
412  }
413  }
414 
415  new_image = new Fl_Pixmap((char*const*)new_data);
416  new_image->alloc_data = 1;
417 
418  return new_image;
419 }
420 
422  // Delete any existing pixmap/mask objects...
423  uncache();
424 
425  // Allocate memory as needed...
426  copy_data();
427 
428  // Get the color to blend with...
429  uchar r, g, b;
430  unsigned ia, ir, ig, ib;
431 
432  Fl::get_color(c, r, g, b);
433  if (i < 0.0f) i = 0.0f;
434  else if (i > 1.0f) i = 1.0f;
435 
436  ia = (unsigned)(256 * i);
437  ir = r * (256 - ia);
438  ig = g * (256 - ia);
439  ib = b * (256 - ia);
440 
441  // Update the colormap to do the blend...
442  char line[255]; // New colormap line
443  int color, // Looping var
444  ncolors, // Number of colors in image
445  chars_per_pixel;// Characters per color
446 
447 
448  sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel);
449 
450  if (ncolors < 0) {
451  // Update FLTK colormap...
452  ncolors = -ncolors;
453  uchar *cmap = (uchar *)(data()[1]);
454  for (color = 0; color < ncolors; color ++, cmap += 4) {
455  cmap[1] = (ia * cmap[1] + ir) >> 8;
456  cmap[2] = (ia * cmap[2] + ig) >> 8;
457  cmap[3] = (ia * cmap[3] + ib) >> 8;
458  }
459  } else {
460  // Update standard XPM colormap...
461  for (color = 0; color < ncolors; color ++) {
462  // look for "c word", or last word if none:
463  const char *p = data()[color + 1] + chars_per_pixel + 1;
464  const char *previous_word = p;
465  for (;;) {
466  while (*p && isspace(*p)) p++;
467  char what = *p++;
468  while (*p && !isspace(*p)) p++;
469  while (*p && isspace(*p)) p++;
470  if (!*p) {p = previous_word; break;}
471  if (what == 'c') break;
472  previous_word = p;
473  while (*p && !isspace(*p)) p++;
474  }
475 
476  if (fl_parse_color(p, r, g, b)) {
477  r = (ia * r + ir) >> 8;
478  g = (ia * g + ig) >> 8;
479  b = (ia * b + ib) >> 8;
480 
481  if (chars_per_pixel > 1) sprintf(line, "%c%c c #%02X%02X%02X",
482  data()[color + 1][0],
483  data()[color + 1][1], r, g, b);
484  else sprintf(line, "%c c #%02X%02X%02X", data()[color + 1][0], r, g, b);
485 
486  delete[] (char *)data()[color + 1];
487  ((char **)data())[color + 1] = new char[strlen(line) + 1];
488  strcpy((char *)data()[color + 1], line);
489  }
490  }
491  }
492 }
493 
495  if (alloc_data) {
496  for (int i = 0; i < count(); i ++) delete[] (char *)data()[i];
497  delete[] (char **)data();
498  }
499 }
500 
501 void Fl_Pixmap::set_data(const char * const * p) {
502  int height, // Number of lines in image
503  ncolors; // Number of colors in image
504 
505  if (p) {
506  sscanf(p[0],"%*d%d%d", &height, &ncolors);
507  if (ncolors < 0) data(p, height + 2);
508  else data(p, height + ncolors + 1);
509  }
510 }
511 
512 
514  // Delete any existing pixmap/mask objects...
515  uncache();
516 
517  // Allocate memory as needed...
518  copy_data();
519 
520  // Update the colormap to grayscale...
521  char line[255]; // New colormap line
522  int i, // Looping var
523  ncolors, // Number of colors in image
524  chars_per_pixel;// Characters per color
525  uchar r, g, b;
526 
527  sscanf(data()[0],"%*d%*d%d%d", &ncolors, &chars_per_pixel);
528 
529  if (ncolors < 0) {
530  // Update FLTK colormap...
531  ncolors = -ncolors;
532  uchar *cmap = (uchar *)(data()[1]);
533  for (i = 0; i < ncolors; i ++, cmap += 4) {
534  g = (uchar)((cmap[1] * 31 + cmap[2] * 61 + cmap[3] * 8) / 100);
535  cmap[1] = cmap[2] = cmap[3] = g;
536  }
537  } else {
538  // Update standard XPM colormap...
539  for (i = 0; i < ncolors; i ++) {
540  // look for "c word", or last word if none:
541  const char *p = data()[i + 1] + chars_per_pixel + 1;
542  const char *previous_word = p;
543  for (;;) {
544  while (*p && isspace(*p)) p++;
545  char what = *p++;
546  while (*p && !isspace(*p)) p++;
547  while (*p && isspace(*p)) p++;
548  if (!*p) {p = previous_word; break;}
549  if (what == 'c') break;
550  previous_word = p;
551  while (*p && !isspace(*p)) p++;
552  }
553 
554  if (fl_parse_color(p, r, g, b)) {
555  g = (uchar)((r * 31 + g * 61 + b * 8) / 100);
556 
557  if (chars_per_pixel > 1) sprintf(line, "%c%c c #%02X%02X%02X", data()[i + 1][0],
558  data()[i + 1][1], g, g, g);
559  else sprintf(line, "%c c #%02X%02X%02X", data()[i + 1][0], g, g, g);
560 
561  delete[] (char *)data()[i + 1];
562  ((char **)data())[i + 1] = new char[strlen(line) + 1];
563  strcpy((char *)data()[i + 1], line);
564  }
565  }
566  }
567 }
568 
569 //
570 // End of "$Id$".
571 //
Fl_Widget.H
Fl_Pixmap.H
Fl.H
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
Fl_Image::data
void data(const char *const *p, int c)
Definition: Fl_Image.H:100
chars_per_pixel
static int chars_per_pixel
Definition: fl_draw_pixmap.cxx:41
Fl_Image::data
const char *const * data() const
Definition: Fl_Image.H:138
Fl_Pixmap::delete_data
void delete_data()
Definition: Fl_Pixmap.cxx:494
ncolors
static int ncolors
Definition: fl_draw_pixmap.cxx:41
Fl_Image
Base class for image caching and drawing.
Definition: Fl_Image.H:55
Fl_Image::count
int count() const
Definition: Fl_Image.H:133
Fl_Menu_Item::label
const char * label() const
Definition: Fl_Menu_Item.H:148
x.H
H
static int H
Definition: Fl_Tooltip.cxx:76
start
static int start(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int w, int h, int &cx, int &cy, int &X, int &Y, int &W, int &H)
Definition: Fl_Pixmap.cxx:76
NULL
#define NULL
Definition: forms.H:34
Fl_Pixmap::color_average
virtual void color_average(Fl_Color c, float i)
Definition: Fl_Pixmap.cxx:421
b
long b
Definition: jpegint.h:397
FL_BLACK
const Fl_Color FL_BLACK
Definition: Enumerations.H:956
Fl_Pixmap::set_data
void set_data(const char *const *p)
Definition: Fl_Pixmap.cxx:501
Fl_Xlib_Graphics_Driver::copy_offscreen
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
Fl_Pixmap::uncache
virtual void uncache()
Definition: Fl_Pixmap.cxx:253
Fl_Graphics_Driver::draw
virtual void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
Definition: Fl_Device.H:251
Fl_Pixmap::~Fl_Pixmap
virtual ~Fl_Pixmap()
Definition: Fl_Pixmap.cxx:248
p
static menustate * p
Definition: Fl_Menu.cxx:606
Fl::get_color
static unsigned get_color(Fl_Color i)
Definition: fl_color.cxx:359
fl_create_bitmask
Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data)
Definition: Fl_Bitmap.cxx:156
Fl_Image::measure
static void measure(const Fl_Label *lo, int &lw, int &lh)
Definition: Fl_Image.cxx:207
fl_delete_bitmask
void fl_delete_bitmask(Fl_Bitmask bm)
Definition: Fl_Bitmap.cxx:161
Fl_Image::labeltype
static void labeltype(const Fl_Label *lo, int lx, int ly, int lw, int lh, Fl_Align la)
Definition: Fl_Image.cxx:182
Fl_Pixmap::copy
Fl_Image * copy()
Definition: Fl_Pixmap.H:88
fl_measure_pixmap
FL_EXPORT int fl_measure_pixmap(char *const *data, int &w, int &h)
Definition: fl_draw_pixmap.cxx:52
draw
static void draw(int which, int x, int y, int w, int h, int inset)
Definition: fl_gtk.cxx:166
fl_draw.H
utility header to pull drawing functions together
Fl_Pixmap
Definition: Fl_Pixmap.H:41
Fl_Image::draw_empty
void draw_empty(int X, int Y)
Definition: Fl_Image.cxx:75
fl_restore_clip
void fl_restore_clip()
Definition: fl_draw.H:129
fl_clip_box
int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
Definition: fl_draw.H:126
fl_parse_color
int fl_parse_color(const char *p, uchar &r, uchar &g, uchar &b)
Definition: Fl_get_system_colors.cxx:122
Fl_Graphics_Driver::restore_clip
void restore_clip()
see fl_restore_clip().
Definition: fl_rect.cxx:542
Fl_Pixmap::Fl_Pixmap
Fl_Pixmap(char *const *D)
Definition: Fl_Pixmap.H:79
Fl_Pixmap::prepare
int prepare(int XP, int YP, int WP, int HP, int &cx, int &cy, int &X, int &Y, int &W, int &H)
Definition: Fl_Pixmap.cxx:103
Fl_Image::h
int h() const
Definition: Fl_Image.H:115
Fl_Pixmap::mask_
unsigned mask_
Definition: Fl_Pixmap.H:73
fl_display
FL_EXPORT HINSTANCE fl_display
END TIMERS.
Definition: Fl_win32.cxx:2147
Fl_Pixmap::label
virtual void label(Fl_Widget *w)
Definition: Fl_Pixmap.cxx:265
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Printer.H
declaration of classes Fl_Printer, Fl_System_Printer and Fl_PostScript_Printer.
fl_graphics_driver
FL_EXPORT Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
Definition: Fl_Device.cxx:50
fl_delete_offscreen
void fl_delete_offscreen(Fl_Offscreen gWorld)
XRectangleRegion
Fl_Region XRectangleRegion(int x, int y, int w, int h)
Definition: fl_rect.cxx:532
cmap
static short cmap[256][3]
Definition: cmap.cxx:37
Fl_Xlib_Graphics_Driver::draw
void draw(const char *str, int n, int x, int y)
see fl_draw(const char *str, int n, int x, int y).
Definition: fl_font_x.cxx:311
color
void color(int n)
Definition: gl2opengl.h:29
Fl_Pixmap::desaturate
virtual void desaturate()
Definition: Fl_Pixmap.cxx:513
Fl_Pixmap::draw
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Definition: Fl_Pixmap.cxx:72
Fl::set_labeltype
static void set_labeltype(Fl_Labeltype, Fl_Label_Draw_F *, Fl_Label_Measure_F *)
Definition: fl_labeltype.cxx:69
Fl_Graphics_Driver::clip_region
Fl_Region clip_region()
see fl_clip_region().
Definition: fl_rect.cxx:572
fl_begin_offscreen
void fl_begin_offscreen(Fl_Offscreen gWorld)
fl_draw_pixmap
FL_EXPORT int fl_draw_pixmap(char *const *data, int x, int y, Fl_Color=FL_GRAY)
Definition: fl_draw_pixmap.cxx:78
fl_release_dc
void fl_release_dc(HWND w, HDC dc)
Definition: Fl_win32.cxx:2669
Fl_Pixmap::measure
void measure()
Definition: Fl_Pixmap.cxx:62
dy
uchar dy
Definition: fl_boxtype.cxx:286
fl_gc
CGContextRef fl_gc
Definition: Fl_win32.cxx:2568
Fl_Menu_Item
Definition: Fl_Menu_Item.H:112
Fl_Image::w
int w() const
Definition: Fl_Image.H:111
fl_end_offscreen
void fl_end_offscreen()
Fl_Pixmap::alloc_data
int alloc_data
Definition: Fl_Pixmap.H:58
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
Fl_Offscreen
CGContextRef Fl_Offscreen
Definition: mac.H:45
fl_create_offscreen
Fl_Offscreen fl_create_offscreen(int w, int h)
Y
static int Y
Definition: Fl_Tooltip.cxx:76
flstring.h
_FL_IMAGE_LABEL
the label displays an "icon" based on a Fl_Image
Definition: Enumerations.H:771
Fl_Bitmask
CGImageRef Fl_Bitmask
Definition: mac.H:241
code
Definition: inftrees.h:24
fl_mask_bitmap
uchar ** fl_mask_bitmap
Definition: fl_draw_pixmap.cxx:67
uchar
unsigned char uchar
Definition: fl_types.h:30
Fl_Pixmap::id_
unsigned id_
Definition: Fl_Pixmap.H:72
dx
uchar dx
Definition: fl_boxtype.cxx:286
Fl_Menu_Item.H
Fl_Pixmap::copy_data
void copy_data()
Definition: Fl_Pixmap.cxx:274
rects
void rects(int x, int y, int r, int t)
Definition: gl2opengl.h:34
Fl_Widget::image
Fl_Image * image()
Definition: Fl_Widget.H:514