Skip to content

Commit

Permalink
Removing some C-isms in identifiers from the binding
Browse files Browse the repository at this point in the history
Since the package gives the context in Ada and provides a specific
namespace, the prefixes are unnecessary and redundant.

In some cases, Ada 2012 aspects syntax has been used to allow an overloaded
name to be imported.
  • Loading branch information
mgrojo committed Nov 8, 2020
1 parent f700799 commit b4b35b9
Show file tree
Hide file tree
Showing 68 changed files with 2,390 additions and 2,126 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The library has been tested with the following environments:
- GNAT FSF 7.5.0 under ubuntu 18.04 with bundled CSFML 2.4
- GNAT Community 2020 under Windows 10 with CSFML 2.5

It is writen in standard Ada95 without the use of any specific GNAT extensions.
It is writen in standard Ada without the use of any specific GNAT extensions.

## State

Expand Down
195 changes: 195 additions & 0 deletions include/generated/constants.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
sfBlack
sfWhite
sfRed
sfGreen
sfBlue
sfYellow
sfMagenta
sfCyan
sfTransparent
sfPoints
sfLines
sfLineStrip
sfTriangles
sfTriangleStrip
sfTriangleFan
sfQuads
sfLinesStrip
sfTrianglesStrip
sfTrianglesFan
sfTextRegular
sfTextBold
sfTextItalic
sfTextUnderlined
sfTextStrikeThrough
sfFtpRestartMarkerReply
sfFtpServiceReadySoon
sfFtpDataConnectionAlreadyOpened
sfFtpOpeningDataConnection
sfFtpOk
sfFtpPointlessCommand
sfFtpSystemStatus
sfFtpDirectoryStatus
sfFtpFileStatus
sfFtpHelpMessage
sfFtpSystemType
sfFtpServiceReady
sfFtpClosingConnection
sfFtpDataConnectionOpened
sfFtpClosingDataConnection
sfFtpEnteringPassiveMode
sfFtpLoggedIn
sfFtpFileActionOk
sfFtpDirectoryOk
sfFtpNeedPassword
sfFtpNeedAccountToLogIn
sfFtpNeedInformation
sfFtpServiceUnavailable
sfFtpDataConnectionUnavailable
sfFtpTransferAborted
sfFtpFileActionAborted
sfFtpLocalError
sfFtpInsufficientStorageSpace
sfFtpCommandUnknown
sfFtpParametersUnknown
sfFtpCommandNotImplemented
sfFtpBadCommandSequence
sfFtpParameterNotImplemented
sfFtpNotLoggedIn
sfFtpNeedAccountToStore
sfFtpFileUnavailable
sfFtpPageTypeUnknown
sfFtpNotEnoughMemory
sfFtpFilenameNotAllowed
sfFtpInvalidResponse
sfFtpConnectionFailed
sfFtpConnectionClosed
sfFtpInvalidFile
sfHttpOk
sfHttpCreated
sfHttpAccepted
sfHttpNoContent
sfHttpMultipleChoices
sfHttpMovedPermanently
sfHttpMovedTemporarily
sfHttpNotModified
sfHttpBadRequest
sfHttpUnauthorized
sfHttpForbidden
sfHttpNotFound
sfHttpInternalServerError
sfHttpNotImplemented
sfHttpBadGateway
sfHttpServiceNotAvailable
sfHttpInvalidResponse
sfHttpConnectionFailed
sfKeyUnknown
sfKeyA
sfKeyB
sfKeyC
sfKeyD
sfKeyE
sfKeyF
sfKeyG
sfKeyH
sfKeyI
sfKeyJ
sfKeyK
sfKeyL
sfKeyM
sfKeyN
sfKeyO
sfKeyP
sfKeyQ
sfKeyR
sfKeyS
sfKeyT
sfKeyU
sfKeyV
sfKeyW
sfKeyX
sfKeyY
sfKeyZ
sfKeyNum0
sfKeyNum1
sfKeyNum2
sfKeyNum3
sfKeyNum4
sfKeyNum5
sfKeyNum6
sfKeyNum7
sfKeyNum8
sfKeyNum9
sfKeyEscape
sfKeyLControl
sfKeyLShift
sfKeyLAlt
sfKeyLSystem
sfKeyRControl
sfKeyRShift
sfKeyRAlt
sfKeyRSystem
sfKeyMenu
sfKeyLBracket
sfKeyRBracket
sfKeySemiColon
sfKeyComma
sfKeyPeriod
sfKeyQuote
sfKeySlash
sfKeyBackSlash
sfKeyTilde
sfKeyEqual
sfKeyDash
sfKeySpace
sfKeyReturn
sfKeyBack
sfKeyTab
sfKeyPageUp
sfKeyPageDown
sfKeyEnd
sfKeyHome
sfKeyInsert
sfKeyDelete
sfKeyAdd
sfKeySubtract
sfKeyMultiply
sfKeyDivide
sfKeyLeft
sfKeyRight
sfKeyUp
sfKeyDown
sfKeyNumpad0
sfKeyNumpad1
sfKeyNumpad2
sfKeyNumpad3
sfKeyNumpad4
sfKeyNumpad5
sfKeyNumpad6
sfKeyNumpad7
sfKeyNumpad8
sfKeyNumpad9
sfKeyF1
sfKeyF2
sfKeyF3
sfKeyF4
sfKeyF5
sfKeyF6
sfKeyF7
sfKeyF8
sfKeyF9
sfKeyF10
sfKeyF11
sfKeyF12
sfKeyF13
sfKeyF14
sfKeyF15
sfKeyPause
sfKeyCount
sfNone
sfTitlebar
sfResize
sfClose
sfFullscreen
sfDefaultContextSettings
sfDefaultContextSettings
32 changes: 16 additions & 16 deletions include/sf-audio-listener.ads
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ package Sf.Audio.Listener is
--/ @param volume New global volume, in the range [0, 100]
--/
--//////////////////////////////////////////////////////////
procedure sfListener_setGlobalVolume (volume : float);
procedure setGlobalVolume (volume : float);

--//////////////////////////////////////////////////////////
--/ @brief Get the current value of the global volume
--/
--/ @return Current global volume, in the range [0, 100]
--/
--//////////////////////////////////////////////////////////
function sfListener_getGlobalVolume return float;
function getGlobalVolume return float;

--//////////////////////////////////////////////////////////
--/ @brief Set the position of the listener in the scene
Expand All @@ -47,15 +47,15 @@ package Sf.Audio.Listener is
--/ @param position New position of the listener
--/
--//////////////////////////////////////////////////////////
procedure sfListener_setPosition (position : Sf.System.Vector3.sfVector3f);
procedure setPosition (position : Sf.System.Vector3.sfVector3f);

--//////////////////////////////////////////////////////////
--/ @brief Get the current position of the listener in the scene
--/
--/ @return The listener's position
--/
--//////////////////////////////////////////////////////////
function sfListener_getPosition return Sf.System.Vector3.sfVector3f;
function getPosition return Sf.System.Vector3.sfVector3f;

--//////////////////////////////////////////////////////////
--/ @brief Set the orientation of the forward vector in the scene
Expand All @@ -70,15 +70,15 @@ package Sf.Audio.Listener is
--/ @param direction New listener's direction
--/
--//////////////////////////////////////////////////////////
procedure sfListener_setDirection (direction : Sf.System.Vector3.sfVector3f);
procedure setDirection (direction : Sf.System.Vector3.sfVector3f);

--//////////////////////////////////////////////////////////
--/ @brief Get the current forward vector of the listener in the scene
--/
--/ @return Listener's forward vector (not normalized)
--/
--//////////////////////////////////////////////////////////
function sfListener_getDirection return Sf.System.Vector3.sfVector3f;
function getDirection return Sf.System.Vector3.sfVector3f;

--//////////////////////////////////////////////////////////
--/ @brief Set the upward vector of the listener in the scene
Expand All @@ -93,26 +93,26 @@ package Sf.Audio.Listener is
--/ @param upVector New listener's up vector
--/
--//////////////////////////////////////////////////////////
procedure sfListener_setUpVector (upVector : Sf.System.Vector3.sfVector3f);
procedure setUpVector (upVector : Sf.System.Vector3.sfVector3f);

--//////////////////////////////////////////////////////////
--/ @brief Get the current upward vector of the listener in the scene
--/
--/ @return Listener's upward vector (not normalized)
--/
--//////////////////////////////////////////////////////////
function sfListener_getUpVector return Sf.System.Vector3.sfVector3f;
function getUpVector return Sf.System.Vector3.sfVector3f;

private

pragma Import (C, sfListener_setGlobalVolume, "sfListener_setGlobalVolume");
pragma Import (C, sfListener_getGlobalVolume, "sfListener_getGlobalVolume");
pragma Import (C, sfListener_setPosition, "sfListener_setPosition");
pragma Import (C, sfListener_getPosition, "sfListener_getPosition");
pragma Import (C, sfListener_setDirection, "sfListener_setDirection");
pragma Import (C, sfListener_getDirection, "sfListener_getDirection");
pragma Import (C, sfListener_setUpVector, "sfListener_setUpVector");
pragma Import (C, sfListener_getUpVector, "sfListener_getUpVector");
pragma Import (C, setGlobalVolume, "sfListener_setGlobalVolume");
pragma Import (C, getGlobalVolume, "sfListener_getGlobalVolume");
pragma Import (C, setPosition, "sfListener_setPosition");
pragma Import (C, getPosition, "sfListener_getPosition");
pragma Import (C, setDirection, "sfListener_setDirection");
pragma Import (C, getDirection, "sfListener_getDirection");
pragma Import (C, setUpVector, "sfListener_setUpVector");
pragma Import (C, getUpVector, "sfListener_getUpVector");



Expand Down
4 changes: 2 additions & 2 deletions include/sf-audio-music.adb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ package body Sf.Audio.Music is
--/ @return A new sfMusic object (NULL if failed)
--/
--//////////////////////////////////////////////////////////
function sfMusic_CreateFromFile (Filename : String) return sfMusic_Ptr is
function CreateFromFile (Filename : String) return sfMusic_Ptr is
function Internal (Filename : chars_ptr) return sfMusic_Ptr;
pragma Import (C, Internal, "sfMusic_createFromFile");
Temp : chars_ptr := New_String (Filename);
R : sfMusic_Ptr := Internal (Temp);
begin
Free (Temp);
return R;
end sfMusic_CreateFromFile;
end CreateFromFile;

end Sf.Audio.Music;
Loading

0 comments on commit b4b35b9

Please sign in to comment.