From ad10541237cbb2f1047bfafa7386f3784f828c42 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 29 Jan 2025 18:04:38 +1300 Subject: Filled holes in FLTK.Draw API, refactored Pixmap data marshalling --- doc/fl_draw.html | 85 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 35 deletions(-) (limited to 'doc') diff --git a/doc/fl_draw.html b/doc/fl_draw.html index 03c31f5..d987920 100644 --- a/doc/fl_draw.html +++ b/doc/fl_draw.html @@ -32,52 +32,64 @@ Types - Fl_Line + int Line_Kind -   + int Cap_Kind -   + int Join_Kind -   + char Dash_Length -   + char * Dash_Gap -   + char * Dash_Gap_Array -   - Text_Draw_Function + Fl_Draw_Image_Cb + Image_Draw_Function -   + void(*drawit)(Fl_Color) Symbol_Draw_Function -   + void(*callthis)(const char *, int, int, int) + Text_Draw_Function + + + + void(*draw_area)(void *, int, int, int, int) Area_Draw_Function + + + + + + + - + @@ -96,7 +108,7 @@ int fl_add_symbol(const char *name, void(*drawit)(Fl_Color), @@ -215,14 +227,14 @@ function Clip_Box - + - + @@ -354,14 +366,14 @@ procedure Draw_Text (X, Y, W, H : in Integer; Text : in String; Align : in Alignment; - Func : in Text_Drawing_Function; + Func : in Text_Draw_Function; Symbols : in Boolean := True); procedure Draw_Text (X, Y, W, H : in Integer; Text : in String; Align : in Alignment; - Func : in Text_Drawing_Function; + Func : in Text_Draw_Function; Picture : in FLTK.Images.Image'Class; Symbols : in Boolean := True); @@ -455,19 +467,23 @@ procedure Draw_Image_Mono - - - - @@ -535,7 +551,14 @@ const char * fl_expand_text(const char *from, char *buf, int maxbuf, double maxw, int &n, double &width, int wrap, int draw_symbols=0); @@ -727,19 +750,11 @@ procedure Measure - - - - - - + -- cgit
Errors
 int Draw_Error
 procedure Add_Symbol
        (Text     : in String;
-        Func     : in Symbol_Drawing_Function;
+        Func     : in Symbol_Draw_Function;
         Scalable : in Boolean);
 
 Fl_Region fl_clip_region();
 
Left unbound due to being OS-specificLeft unbound due to being OS-specific.
 void fl_clip_region(Fl_Region r);
 
Left unbound due to being OS-specificLeft unbound due to being OS-specific.
 int fl_draw_pixmap(char * const *data, int x, int y,
     Fl_Color=FL_GRAY);
-
-
-
 int fl_draw_pixmap(const char * const *cdata, int x, int y,
     Fl_Color=FL_GRAY);
 
-
+procedure Draw_Pixmap
+       (Values : in FLTK.Images.Pixmaps.Header;
+        Colors : in FLTK.Images.Pixmaps.Color_Definition_Array;
+        Pixels : in FLTK.Images.Pixmaps.Pixmap_Data;
+        X, Y   : in Integer;
+        Hue    : in Color := Grey0_Color)
+with Pre =>
+    Colors'Length = Values.Colors and
+    Pixels'Length (1) = Values.Height and
+    (for all Definition of Colors =>
+        Ada.Strings.Unbounded.Length (Definition.Name) = Values.Per_Pixel) and
+    Pixels'Length (2) = Values.Width * Values.Per_Pixel;
 
-
+function Expand_Text
+       (Text      : in     String;
+        Max_Width : in     Long_Float;
+        Width     :    out Long_Float;
+        Last      :    out Natural;
+        Wrap      : in     Boolean;
+        Symbols   : in     Boolean := False)
+    return String;
 
 int fl_measure_pixmap(char *const *data, int &w, int &h);
-
 
-
 int fl_measure_pixmap(const char *const *cdata, int &w, int &h);
 
-
-
If you have the Header as defined in FLTK.Images.Pixmaps +then you should already have the width and height values.