Author: manolo
Date: 2010-10-12 05:34:19 -0700 (Tue, 12 Oct 2010)
New Revision: 7720
Log:
Added Doxygen doc to offscreen drawing functions.


Modified:
   branches/branch-1.3/FL/Fl.H
   branches/branch-1.3/documentation/src/drawing.dox
   branches/branch-1.3/src/Fl_Double_Window.cxx

Modified: branches/branch-1.3/FL/Fl.H
===================================================================
--- branches/branch-1.3/FL/Fl.H 2010-10-12 09:25:37 UTC (rev 7719)
+++ branches/branch-1.3/FL/Fl.H 2010-10-12 12:34:19 UTC (rev 7720)
@@ -779,7 +779,9 @@
 
   /**   @} */
  /** \defgroup  fl_drawings  Drawing functions
-       fl global graphics and gui drawing functions
+  FLTK global graphics and GUI drawing functions.
+  These functions are declared in <FL/fl_draw.H>, 
+  and in <FL/x.H> for offscreen buffer-related ones.
      @{ */
   // <Hack to re-order the 'Drawing functions' group>
  /** @} */

Modified: branches/branch-1.3/documentation/src/drawing.dox
===================================================================
--- branches/branch-1.3/documentation/src/drawing.dox   2010-10-12 09:25:37 UTC 
(rev 7719)
+++ branches/branch-1.3/documentation/src/drawing.dox   2010-10-12 12:34:19 UTC 
(rev 7720)
@@ -925,15 +925,13 @@
 
 \subsection ssect_Offscreen Offscreen Drawing
 
-\todo
-Doxygenate the offscreen drawing functions.
-
 Sometimes it can be very useful to generate a complex drawing
 in memory first and copy it to the screen at a later point in 
 time. This technique can significantly reduce the amount of
-repeated drawing. Fl_Double_Window uses offscreen rendering
+repeated drawing. Offscreen drawing functions are declared in <FL/x.H>.
+Fl_Double_Window uses offscreen rendering
 to avoid flickering on systems that don't support 
-double-buffering natively.
+double-buffering natively. 
 
 Fl_Offscreen fl_create_offscreen(int w, int h)
 
@@ -957,8 +955,7 @@
 \par
 Quit sending drawing commands to this offscreen buffer.
 
-void fl_copy_offscreen(int x, int y, int w, int h,
-Fl_Offscreen osrc, int srcx, int srcy)
+void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen osrc, int 
srcx, int srcy)
 
 \par
 Copy a rectangular area of the size \p w*h from \p srcx,srcy

Modified: branches/branch-1.3/src/Fl_Double_Window.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Double_Window.cxx        2010-10-12 09:25:37 UTC 
(rev 7719)
+++ branches/branch-1.3/src/Fl_Double_Window.cxx        2010-10-12 12:34:19 UTC 
(rev 7720)
@@ -67,6 +67,15 @@
 
 static void fl_copy_offscreen_to_display(int x, int y, int w, int h, 
Fl_Offscreen pixmap, int srcx, int srcy);
 
+/** \addtogroup fl_drawings
+ @{
+ */
+/** Copy a rectangular area of the given offscreen buffer into the current 
drawing destination.
+ \param x,y    position where to draw the copied rectangle
+ \param w,h    size of the copied rectangle
+ \param pixmap  offscreen buffer containing the rectangle to copy
+ \param srcx,srcy origin in offscreen buffer of rectangle to copy
+ */
 void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int 
srcx, int srcy) {
   if( fl_graphics_driver == fl_display_device->driver()) {
     fl_copy_offscreen_to_display(x, y, w, h, pixmap, srcx, srcy);
@@ -79,6 +88,7 @@
     delete img;
   }
 }
+/** @} */
 
 #if defined(USE_X11)
 
@@ -184,26 +194,35 @@
 
 extern void fl_restore_clip();
 
-#elif defined(__APPLE_QUARTZ__)
+#elif defined(__APPLE_QUARTZ__) || defined(FL_DOXYGEN)
 
 char fl_can_do_alpha_blending() {
   return 1;
 }
 
-Fl_Offscreen fl_create_offscreen(int w, int h) {
+Fl_Offscreen fl_create_offscreen_with_alpha(int w, int h) {
   void *data = calloc(w*h,4);
   CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
   CGContextRef ctx = CGBitmapContextCreate(
-    data, w, h, 8, w*4, lut, kCGImageAlphaNoneSkipLast);
+    data, w, h, 8, w*4, lut, kCGImageAlphaPremultipliedLast);
   CGColorSpaceRelease(lut);
   return (Fl_Offscreen)ctx;
 }
 
-Fl_Offscreen fl_create_offscreen_with_alpha(int w, int h) {
+/** \addtogroup fl_drawings
+ @{
+ */
+
+/** 
+  Creation of an offscreen graphics buffer.
+ \param w,h     width and height in pixels of the buffer.
+ \return    the created graphics buffer.
+ */
+Fl_Offscreen fl_create_offscreen(int w, int h) {
   void *data = calloc(w*h,4);
   CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB();
   CGContextRef ctx = CGBitmapContextCreate(
-    data, w, h, 8, w*4, lut, kCGImageAlphaPremultipliedLast);
+    data, w, h, 8, w*4, lut, kCGImageAlphaNoneSkipLast);
   CGColorSpaceRelease(lut);
   return (Fl_Offscreen)ctx;
 }
@@ -238,6 +257,9 @@
   CGDataProviderRelease(src_bytes);
 }
 
+/**  Deletion of an offscreen graphics buffer.
+ \param ctx     the buffer to be deleted.
+ */
 void fl_delete_offscreen(Fl_Offscreen ctx) {
   if (!ctx) return;
   void *data = CGBitmapContextGetData((CGContextRef)ctx);
@@ -252,6 +274,9 @@
 static Window stack_window[stack_max];
 static Fl_Surface_Device *_ss;
 
+/**  Send all subsequent drawing commands to this offscreen buffer.
+ \param ctx     the offscreen buffer.
+ */
 void fl_begin_offscreen(Fl_Offscreen ctx) {
   _ss = fl_surface; 
   fl_display_device->set_current();
@@ -268,6 +293,8 @@
   fl_push_no_clip();
 }
 
+/** Quit sending drawing commands to the current offscreen buffer.
+ */
 void fl_end_offscreen() {
   Fl_X::q_release_context();
   fl_pop_clip();
@@ -282,6 +309,8 @@
   _ss->set_current();
 }
 
+/** @} */
+
 extern void fl_restore_clip();
 
 #else

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to