summaryrefslogtreecommitdiff
path: root/src/fltk-draw.ads
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-draw.ads')
-rw-r--r--src/fltk-draw.ads504
1 files changed, 504 insertions, 0 deletions
diff --git a/src/fltk-draw.ads b/src/fltk-draw.ads
new file mode 100644
index 0000000..32ee90b
--- /dev/null
+++ b/src/fltk-draw.ads
@@ -0,0 +1,504 @@
+
+
+with
+
+ FLTK.Images,
+ FLTK.Widgets.Groups.Windows;
+
+
+package FLTK.Draw is
+
+
+ --------------------------
+ -- Types and Constants --
+ --------------------------
+
+ type Line_Kind is
+ (Solid_Line,
+ Dash_Line,
+ Dot_Line,
+ Dashdot_Line,
+ Dashdotdot_Line);
+
+ type Cap_Kind is
+ (Default_Cap,
+ Flat_Cap,
+ Round_Cap,
+ Square_Cap);
+
+ type Join_Kind is
+ (Default_Join,
+ Miter_Join,
+ Round_Join,
+ Bevel_Join);
+
+ type Dash_Length is new Integer range 1 .. 255;
+
+ type Dash_Gap is record
+ Solid : Dash_Length;
+ Blank : Dash_Length;
+ end record;
+
+ type Dash_Gap_Array is array (Positive range <>) of Dash_Gap;
+
+ Empty_Dashes : constant Dash_Gap_Array (1 .. 0) := (others => (1, 1));
+
+ type Text_Draw_Function is access procedure
+ (X, Y : in Integer;
+ Text : in String);
+
+ type Symbol_Draw_Function is access procedure
+ (Hue : in Color);
+
+ type Area_Draw_Function is access procedure
+ (X, Y, W, H : in Integer);
+
+ Draw_Error : exception;
+
+
+
+
+ ------------------------
+ -- No Documentation --
+ ------------------------
+
+ procedure Reset_Spot;
+
+ procedure Set_Spot
+ (X, Y, W, H : in Integer;
+ Font : in Font_Kind;
+ Size : in Font_Size);
+
+ procedure Set_Spot
+ (X, Y, W, H : in Integer;
+ Font : in Font_Kind;
+ Size : in Font_Size;
+ Pane : in FLTK.Widgets.Groups.Windows.Window'Class);
+
+ procedure Set_Status
+ (X, Y, W, H : in Integer);
+
+
+
+
+ ---------------
+ -- Utility --
+ ---------------
+
+ function Can_Do_Alpha_Blending
+ return Boolean;
+
+ function Shortcut_Label
+ (Keys : in Key_Combo)
+ return String;
+
+
+
+
+ --------------------------
+ -- Charset Conversion --
+ --------------------------
+
+ function Latin1_To_Local
+ (From : in String)
+ return String;
+
+ function Local_To_Latin1
+ (From : in String)
+ return String;
+
+ function Mac_Roman_To_Local
+ (From : in String)
+ return String;
+
+ function Local_To_Mac_Roman
+ (From : in String)
+ return String;
+
+
+
+
+ ----------------
+ -- Clipping --
+ ----------------
+
+ function Clip_Box
+ (X, Y, W, H : in Integer;
+ BX, BY, BW, BH : out Integer)
+ return Boolean;
+
+ function Clip_Intersects
+ (X, Y, W, H : in Integer)
+ return Boolean;
+
+ procedure Pop_Clip;
+
+ procedure Push_Clip
+ (X, Y, W, H : in Integer);
+
+ procedure Push_No_Clip;
+
+ procedure Restore_Clip;
+
+
+
+
+ ---------------
+ -- Overlay --
+ ---------------
+
+ procedure Overlay_Clear;
+
+ procedure Overlay_Rect
+ (X, Y, W, H : in Integer);
+
+
+
+
+ ----------------
+ -- Settings --
+ ----------------
+
+ function Get_Color
+ return Color;
+
+ procedure Set_Color
+ (To : in Color);
+
+ procedure Set_Color
+ (R, G, B : in Color_Component);
+
+ function Get_Font
+ return Font_Kind;
+
+ function Get_Font_Size
+ return Font_Size;
+
+ procedure Set_Font
+ (Kind : in Font_Kind;
+ Size : in Font_Size);
+
+ function Font_Line_Spacing
+ return Integer;
+
+ function Font_Descent
+ return Integer;
+
+ function Font_Height
+ (Kind : in Font_Kind;
+ Size : in Font_Size)
+ return Natural;
+
+ procedure Set_Line_Style
+ (Line : in Line_Kind := Solid_Line;
+ Cap : in Cap_Kind := Default_Cap;
+ Join : in Join_Kind := Default_Join;
+ Width : in Natural := 0;
+ Dashes : in Dash_Gap_Array := Empty_Dashes);
+
+
+
+
+ -------------------------
+ -- Matrix Operations --
+ -------------------------
+
+ procedure Mult_Matrix
+ (A, B, C, D, X, Y : in Long_Float);
+
+ procedure Pop_Matrix;
+
+ procedure Push_Matrix;
+
+ procedure Rotate
+ (Angle : in Long_Float);
+
+ procedure Scale
+ (Factor : in Long_Float);
+
+ procedure Scale
+ (Factor_X, Factor_Y : in Long_Float);
+
+ function Transform_DX
+ (X, Y : in Long_Float)
+ return Long_Float;
+
+ function Transform_DY
+ (X, Y : in Long_Float)
+ return Long_Float;
+
+ function Transform_X
+ (X, Y : in Long_Float)
+ return Long_Float;
+
+ function Transform_Y
+ (X, Y : in Long_Float)
+ return Long_Float;
+
+ procedure Transformed_Vertex
+ (XF, YF : in Long_Float);
+
+ procedure Translate
+ (X, Y : in Long_Float);
+
+ procedure Vertex
+ (X, Y : in Long_Float);
+
+
+
+
+ -----------------------
+ -- Special Drawing --
+ -----------------------
+
+ procedure Add_Symbol
+ (Text : in String;
+ Callback : in Symbol_Draw_Function;
+ Scalable : in Boolean);
+
+ procedure Draw_Text
+ (X, Y : in Integer;
+ Text : in String)
+ with Pre => Text'Length > 0;
+
+ procedure Draw_Text
+ (X, Y, W, H : in Integer;
+ Text : in String;
+ Align : in Alignment;
+ Symbols : in Boolean := True);
+
+ procedure Draw_Text
+ (X, Y, W, H : in Integer;
+ Text : in String;
+ Align : in Alignment;
+ Picture : in FLTK.Images.Image'Class;
+ Symbols : in Boolean := True);
+
+ procedure Draw_Text
+ (X, Y, W, H : in Integer;
+ Text : in String;
+ Align : in Alignment;
+ Callback : in Text_Draw_Function;
+ Symbols : in Boolean := True);
+
+ procedure Draw_Text
+ (X, Y, W, H : in Integer;
+ Text : in String;
+ Align : in Alignment;
+ Callback : in Text_Draw_Function;
+ Picture : in FLTK.Images.Image'Class;
+ Symbols : in Boolean := True);
+
+ procedure Draw_Text
+ (X, Y : in Integer;
+ Text : in String;
+ Angle : in Integer);
+
+ procedure Draw_Text_Right_Left
+ (X, Y : in Integer;
+ Text : in String);
+
+ procedure Draw_Box
+ (X, Y, W, H : in Integer;
+ Kind : in Box_Kind;
+ Hue : in Color);
+
+ procedure Draw_Symbol
+ (X, Y, W, H : in Integer;
+ Name : in String;
+ Hue : in Color);
+
+ procedure Measure
+ (Text : in String;
+ W, H : out Natural;
+ Symbols : in Boolean := True;
+ Wrap : in Natural := 0);
+
+ procedure Scroll
+ (X, Y, W, H : in Integer;
+ DX, DY : in Integer;
+ Callback : in Area_Draw_Function);
+
+ procedure Text_Extents
+ (Text : in String;
+ DX, DY, W, H : out Integer);
+
+ function Width
+ (Text : in String)
+ return Long_Float;
+
+ function Width
+ (Glyph : in Character)
+ return Long_Float;
+
+ function Width
+ (Glyph : in Wide_Character)
+ return Long_Float;
+
+ function Width
+ (Glyph : in Wide_Wide_Character)
+ return Long_Float;
+
+
+
+
+ ----------------------
+ -- Manual Drawing --
+ ----------------------
+
+ procedure Begin_Complex_Polygon;
+ procedure Begin_Line;
+ procedure Begin_Loop;
+ procedure Begin_Points;
+ procedure Begin_Polygon;
+
+ procedure Arc
+ (X, Y, R, Start, Finish : in Long_Float);
+
+ procedure Arc
+ (X, Y, W, H : in Integer;
+ Start, Finish : in Long_Float);
+
+ -- As per 1.3.9 docs, currently a placeholder
+ procedure Chord
+ (X, Y, W, H : in Integer;
+ Angle1, Angle2 : in Long_Float);
+
+ procedure Circle
+ (X, Y, R : in Long_Float);
+
+ procedure Curve
+ (X0, Y0 : in Long_Float;
+ X1, Y1 : in Long_Float;
+ X2, Y2 : in Long_Float;
+ X3, Y3 : in Long_Float);
+
+ procedure Frame
+ (X, Y, W, H : in Integer;
+ Top, Left, Bottom, Right : in Greyscale);
+
+ procedure Gap;
+
+ procedure Line
+ (X0, Y0 : in Integer;
+ X1, Y1 : in Integer);
+
+ procedure Line
+ (X0, Y0 : in Integer;
+ X1, Y1 : in Integer;
+ X2, Y2 : in Integer);
+
+ procedure Outline
+ (X0, Y0 : in Integer;
+ X1, Y1 : in Integer;
+ X2, Y2 : in Integer);
+
+ procedure Outline
+ (X0, Y0 : in Integer;
+ X1, Y1 : in Integer;
+ X2, Y2 : in Integer;
+ X3, Y3 : in Integer);
+
+ procedure Pie
+ (X, Y, W, H : in Integer;
+ Angle1, Angle2 : in Long_Float);
+
+ procedure Point
+ (X, Y : in Integer);
+
+ procedure Polygon
+ (X0, Y0 : in Integer;
+ X1, Y1 : in Integer;
+ X2, Y2 : in Integer);
+
+ procedure Polygon
+ (X0, Y0 : in Integer;
+ X1, Y1 : in Integer;
+ X2, Y2 : in Integer;
+ X3, Y3 : in Integer);
+
+ procedure Rect
+ (X, Y, W, H : in Integer);
+
+ procedure Rect
+ (X, Y, W, H : in Integer;
+ Hue : in Color);
+
+ procedure Rect_Fill
+ (X, Y, W, H : in Integer);
+
+ procedure Rect_Fill
+ (X, Y, W, H : in Integer;
+ Hue : in Color);
+
+ procedure Rect_Fill
+ (X, Y, W, H : in Integer;
+ R, G, B : in Color_Component);
+
+ procedure XY_Line
+ (X0, Y0, X1 : in Integer);
+
+ procedure XY_Line
+ (X0, Y0, X1, Y2 : in Integer);
+
+ procedure XY_Line
+ (X0, Y0, X1, Y2, X3 : in Integer);
+
+ procedure YX_Line
+ (X0, Y0, Y1 : in Integer);
+
+ procedure YX_Line
+ (X0, Y0, Y1, X2 : in Integer);
+
+ procedure YX_Line
+ (X0, Y0, Y1, X2, Y3 : in Integer);
+
+ procedure End_Complex_Polygon;
+ procedure End_Line;
+ procedure End_Loop;
+ procedure End_Points;
+ procedure End_Polygon;
+
+
+private
+
+
+ pragma Convention (C, Symbol_Draw_Function);
+
+
+ pragma Inline (Can_Do_Alpha_Blending);
+
+
+ pragma Inline (Get_Color);
+ pragma Inline (Set_Color);
+ pragma Inline (Get_Font);
+ pragma Inline (Set_Font);
+
+
+ pragma Inline (Draw_Box);
+
+
+ pragma Inline (Begin_Complex_Polygon);
+ pragma Inline (Begin_Line);
+ pragma Inline (Begin_Loop);
+ pragma Inline (Begin_Points);
+ pragma Inline (Begin_Polygon);
+
+
+ pragma Inline (Arc);
+ pragma Inline (Circle);
+ pragma Inline (Frame);
+ pragma Inline (Gap);
+ pragma Inline (Line);
+
+
+ pragma Inline (End_Complex_Polygon);
+ pragma Inline (End_Line);
+ pragma Inline (End_Loop);
+ pragma Inline (End_Points);
+ pragma Inline (End_Polygon);
+
+
+end FLTK.Draw;
+
+