-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e9bbf5
commit ac29968
Showing
18 changed files
with
336 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ build | |
__pycache__ | ||
logs | ||
danger_zone | ||
tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2.4 | ||
0.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
------------------------------------------------------------------------------- | ||
-- -- | ||
-- M A L E F - S D K - M E S S A G E _ B O X E S . A D B -- | ||
-- -- | ||
-- M A L E F -- | ||
-- -- | ||
-- B O D Y -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
-- Copyright (c) 2021 José Antonio Verde Jiménez All Rights Reserved -- | ||
------------------------------------------------------------------------------- | ||
-- This file is part of Malef. -- | ||
-- -- | ||
-- This program is free software: you can redistribute it and/or modify it -- | ||
-- under the terms of the GNU General License as published by the Free -- | ||
-- Software Foundation, either version 3 of the License, or (at your -- | ||
-- opinion) any later version. -- | ||
-- -- | ||
-- This program is distributed in the hope that it will be useful, but -- | ||
-- WITHOUT ANY WARRANTY; without even the implied warranty of -- | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- | ||
-- Public License for more details. -- | ||
-- -- | ||
-- You should have received a copy of the GNU General Public License along -- | ||
-- with this program. If not, see <https://www.gnu.org/licenses/>. -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
|
||
package body Malef.SDK.Message_Boxes is | ||
|
||
function Create ( | ||
Message : Str_Type; | ||
Foreground_Color : Color_Type; | ||
Background_Color : Color_Type; | ||
Selected_Color : Color_Type; | ||
Shadow_Color : Color_Type := Default_Shadow_Color; | ||
Borders : String := "+-+| |+-+") | ||
return Message_Box_Type is | ||
begin | ||
|
||
return Message_Box_Type'(Message_Boxes_Widgets.Widget_Type with | ||
Message => new Str_Type'(Message), | ||
others => <>); | ||
|
||
end Create; | ||
|
||
overriding | ||
function Run (Message_Box : in out Message_Box_Type) | ||
return Return_Type is | ||
begin | ||
|
||
pragma Unreferenced (Message_Box); | ||
|
||
return Return_Type'First; | ||
|
||
end Run; | ||
|
||
|
||
overriding | ||
procedure Finalize (Message_Box : in out Message_Box_Type) is | ||
Upcast : constant access Base_Type := Base_Type(Message_Box)'Access; | ||
begin | ||
|
||
Upcast.Finalize; | ||
|
||
end Finalize; | ||
|
||
|
||
end Malef.SDK.Message_Boxes; | ||
|
||
---=======================-------------------------=========================--- | ||
--=======================-- E N D O F F I L E --=========================-- | ||
---=======================-------------------------=========================--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
------------------------------------------------------------------------------- | ||
-- -- | ||
-- M A L E F - S D K - M E S S A G E _ B O X E S . A D S -- | ||
-- -- | ||
-- M A L E F -- | ||
-- -- | ||
-- S P E C -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
-- Copyright (c) 2021 José Antonio Verde Jiménez All Rights Reserved -- | ||
------------------------------------------------------------------------------- | ||
-- This file is part of Malef. -- | ||
-- -- | ||
-- This program is free software: you can redistribute it and/or modify it -- | ||
-- under the terms of the GNU General License as published by the Free -- | ||
-- Software Foundation, either version 3 of the License, or (at your -- | ||
-- opinion) any later version. -- | ||
-- -- | ||
-- This program is distributed in the hope that it will be useful, but -- | ||
-- WITHOUT ANY WARRANTY; without even the implied warranty of -- | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- | ||
-- Public License for more details. -- | ||
-- -- | ||
-- You should have received a copy of the GNU General Public License along -- | ||
-- with this program. If not, see <https://www.gnu.org/licenses/>. -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
|
||
-- | ||
-- @summary | ||
-- | ||
-- | ||
-- @description | ||
-- | ||
generic | ||
type Return_Type is (<>); | ||
package Malef.SDK.Message_Boxes is | ||
|
||
package Message_Boxes_Widgets is new Widgets (Return_Type); | ||
|
||
type Message_Box_Type is | ||
new Message_Boxes_Widgets.Widget_Type with | ||
private; | ||
|
||
function Create ( | ||
Message : Str_Type; | ||
Foreground_Color : Color_Type; | ||
Background_Color : Color_Type; | ||
Selected_Color : Color_Type; | ||
Shadow_Color : Color_Type := Default_Shadow_Color; | ||
Borders : String := "+-+| |+-+") | ||
return Message_Box_Type | ||
with Pre => Borders'Length = 9 and Borders'First = 1; | ||
|
||
overriding | ||
function Run (Message_Box : in out Message_Box_Type) | ||
return Return_Type; | ||
|
||
private | ||
|
||
type Message_Box_Type is | ||
new Message_Boxes_Widgets.Widget_Type with | ||
record | ||
Message : Str_Access; | ||
Position : Return_Type := Return_Type'First; | ||
end record; | ||
|
||
overriding | ||
procedure Update (Message_Box : in out Message_Box_Type) is null; | ||
procedure Finalize (Message_Box : in out Message_Box_Type); | ||
|
||
end Malef.SDK.Message_Boxes; | ||
|
||
---=======================-------------------------=========================--- | ||
--=======================-- E N D O F F I L E --=========================-- | ||
---=======================-------------------------=========================--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
------------------------------------------------------------------------------- | ||
-- -- | ||
-- M A L E F - S D K . A D B -- | ||
-- -- | ||
-- M A L E F -- | ||
-- -- | ||
-- B O D Y -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
-- Copyright (c) 2021 José Antonio Verde Jiménez All Rights Reserved -- | ||
------------------------------------------------------------------------------- | ||
-- This file is part of Malef. -- | ||
-- -- | ||
-- This program is free software: you can redistribute it and/or modify it -- | ||
-- under the terms of the GNU General License as published by the Free -- | ||
-- Software Foundation, either version 3 of the License, or (at your -- | ||
-- opinion) any later version. -- | ||
-- -- | ||
-- This program is distributed in the hope that it will be useful, but -- | ||
-- WITHOUT ANY WARRANTY; without even the implied warranty of -- | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- | ||
-- Public License for more details. -- | ||
-- -- | ||
-- You should have received a copy of the GNU General Public License along -- | ||
-- with this program. If not, see <https://www.gnu.org/licenses/>. -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
|
||
--with Ada.Unchecked_Deallocation; | ||
|
||
package body Malef.SDK is | ||
|
||
package body Widgets is | ||
|
||
overriding | ||
function Get_Reference (Widget : in Widget_Type) | ||
return Surface_Reference is | ||
begin | ||
|
||
return Widget.Box.Get_Reference; | ||
|
||
end Get_Reference; | ||
|
||
end Widgets; | ||
|
||
end Malef.SDK; | ||
|
||
---=======================-------------------------=========================--- | ||
--=======================-- E N D O F F I L E --=========================-- | ||
---=======================-------------------------=========================--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
------------------------------------------------------------------------------- | ||
-- -- | ||
-- M A L E F - S D K . A D S -- | ||
-- -- | ||
-- M A L E F -- | ||
-- -- | ||
-- S P E C -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
-- Copyright (c) 2021 José Antonio Verde Jiménez All Rights Reserved -- | ||
------------------------------------------------------------------------------- | ||
-- This file is part of Malef. -- | ||
-- -- | ||
-- This program is free software: you can redistribute it and/or modify it -- | ||
-- under the terms of the GNU General License as published by the Free -- | ||
-- Software Foundation, either version 3 of the License, or (at your -- | ||
-- opinion) any later version. -- | ||
-- -- | ||
-- This program is distributed in the hope that it will be useful, but -- | ||
-- WITHOUT ANY WARRANTY; without even the implied warranty of -- | ||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- | ||
-- Public License for more details. -- | ||
-- -- | ||
-- You should have received a copy of the GNU General Public License along -- | ||
-- with this program. If not, see <https://www.gnu.org/licenses/>. -- | ||
-- -- | ||
------------------------------------------------------------------------------- | ||
|
||
with Malef.Boxes; | ||
with Malef.Surfaces; | ||
|
||
-- | ||
-- @summary | ||
-- This package is meant to facilitate the creation of interactive porgrams | ||
-- with the Malef API. | ||
-- | ||
-- @description | ||
-- This package declares a new type called Widget which is derived from the Box | ||
-- type which helps with the creation of interactive applications such as | ||
-- message boxes or other kind of things. This was planned to be added in | ||
-- future versions but I needed it for a current project. | ||
-- | ||
package Malef.SDK is | ||
|
||
Default_Shadow_Color : constant Color_Type := (0, 0, 0, 128); | ||
|
||
generic | ||
type Return_Type is (<>); | ||
package Widgets is | ||
|
||
type Widget_Type is abstract new Base_Type with private; | ||
|
||
function Run (Widget : in out Widget_Type) | ||
return Return_Type is abstract; | ||
|
||
private | ||
|
||
type Widget_Type is abstract new Base_Type with | ||
record | ||
Box : Malef.Boxes.Box_Type; | ||
Surface : Malef.Surfaces.Surface_Type; | ||
Shadow : Malef.Surfaces.Surface_Type; | ||
end record; | ||
|
||
overriding | ||
function Get_Reference (Widget : in Widget_Type) | ||
return Surface_Reference; | ||
|
||
end Widgets; | ||
|
||
end Malef.SDK; | ||
|
||
---=======================-------------------------=========================--- | ||
--=======================-- E N D O F F I L E --=========================-- | ||
---=======================-------------------------=========================--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.