From b4438b2fbe895694be98e6e8426103deefc51448 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Tue, 21 Jan 2025 21:04:54 +1300 Subject: Split public API and private implementation files into different directories --- spec/fltk-widgets-groups-spinners.ads | 216 ++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 spec/fltk-widgets-groups-spinners.ads (limited to 'spec/fltk-widgets-groups-spinners.ads') diff --git a/spec/fltk-widgets-groups-spinners.ads b/spec/fltk-widgets-groups-spinners.ads new file mode 100644 index 0000000..3124dc2 --- /dev/null +++ b/spec/fltk-widgets-groups-spinners.ads @@ -0,0 +1,216 @@ + + +-- Programmed by Jedidiah Barber +-- Released into the public domain + + +private with + + Interfaces.C.Strings; + + +package FLTK.Widgets.Groups.Spinners is + + + type Spinner is new Group with private; + + type Spinner_Reference (Data : not null access Spinner'Class) is limited null record + with Implicit_Dereference => Data; + + type Spinner_Kind is (Float_Spin, Int_Spin); + + + + + package Forge is + + function Create + (X, Y, W, H : in Integer; + Text : in String := "") + return Spinner; + + function Create + (Parent : in out Group'Class; + X, Y, W, H : in Integer; + Text : in String := "") + return Spinner; + + end Forge; + + + + + function Get_Background_Color + (This : in Spinner) + return Color; + + procedure Set_Background_Color + (This : in out Spinner; + To : in Color); + + function Get_Selection_Color + (This : in Spinner) + return Color; + + procedure Set_Selection_Color + (This : in out Spinner; + To : in Color); + + function Get_Text_Color + (This : in Spinner) + return Color; + + procedure Set_Text_Color + (This : in out Spinner; + To : in Color); + + function Get_Text_Font + (This : in Spinner) + return Font_Kind; + + procedure Set_Text_Font + (This : in out Spinner; + To : in Font_Kind); + + function Get_Text_Size + (This : in Spinner) + return Font_Size; + + procedure Set_Text_Size + (This : in out Spinner; + To : in Font_Size); + + + + + function Get_Minimum + (This : in Spinner) + return Long_Float; + + procedure Set_Minimum + (This : in out Spinner; + To : in Long_Float); + + function Get_Maximum + (This : in Spinner) + return Long_Float; + + procedure Set_Maximum + (This : in out Spinner; + To : in Long_Float); + + procedure Get_Range + (This : in Spinner; + Min, Max : out Long_Float); + + procedure Set_Range + (This : in out Spinner; + Min, Max : in Long_Float); + + function Get_Step + (This : in Spinner) + return Long_Float; + + procedure Set_Step + (This : in out Spinner; + To : in Long_Float); + + function Get_Value + (This : in Spinner) + return Long_Float; + + procedure Set_Value + (This : in out Spinner; + To : in Long_Float); + + + + + function Get_Format + (This : in Spinner) + return String; + + procedure Set_Format + (This : in out Spinner; + To : in String); + + function Get_Kind + (This : in Spinner) + return Spinner_Kind; + + procedure Set_Kind + (This : in out Spinner; + To : in Spinner_Kind); + + + + + procedure Resize + (This : in out Spinner; + X, Y, W, H : in Integer); + + + + + function Handle + (This : in out Spinner; + Event : in Event_Kind) + return Event_Outcome; + + +private + + + type Spinner is new Group with record + Format_Str : Interfaces.C.Strings.chars_ptr; + end record; + + overriding procedure Initialize + (This : in out Spinner); + + overriding procedure Finalize + (This : in out Spinner); + + procedure Extra_Init + (This : in out Spinner; + X, Y, W, H : in Integer; + Text : in String) + with Inline; + + procedure Extra_Final + (This : in out Spinner) + with Inline; + + + pragma Inline (Get_Background_Color); + pragma Inline (Set_Background_Color); + pragma Inline (Get_Selection_Color); + pragma Inline (Set_Selection_Color); + pragma Inline (Get_Text_Color); + pragma Inline (Set_Text_Color); + pragma Inline (Get_Text_Font); + pragma Inline (Set_Text_Font); + pragma Inline (Get_Text_Size); + pragma Inline (Set_Text_Size); + + pragma Inline (Get_Minimum); + pragma Inline (Set_Minimum); + pragma Inline (Get_Maximum); + pragma Inline (Set_Maximum); + pragma Inline (Set_Range); + pragma Inline (Get_Step); + pragma Inline (Set_Step); + pragma Inline (Get_Value); + pragma Inline (Set_Value); + + pragma Inline (Get_Kind); + pragma Inline (Set_Kind); + + pragma Inline (Resize); + + pragma Inline (Handle); + + +end FLTK.Widgets.Groups.Spinners; + + -- cgit