diff options
Diffstat (limited to 'body/fltk-images-rgb-png.adb')
-rw-r--r-- | body/fltk-images-rgb-png.adb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/body/fltk-images-rgb-png.adb b/body/fltk-images-rgb-png.adb index 67befe3..84dc9af 100644 --- a/body/fltk-images-rgb-png.adb +++ b/body/fltk-images-rgb-png.adb @@ -12,6 +12,10 @@ with package body FLTK.Images.RGB.PNG is + ------------------------ + -- Functions From C -- + ------------------------ + function new_fl_png_image (F : in Interfaces.C.char_array) return Storage.Integer_Address; @@ -34,6 +38,10 @@ package body FLTK.Images.RGB.PNG is + ------------------- + -- Destructors -- + ------------------- + overriding procedure Finalize (This : in out PNG_Image) is begin @@ -47,7 +55,7 @@ package body FLTK.Images.RGB.PNG is -------------------- - -- Construction -- + -- Constructors -- -------------------- package body Forge is @@ -59,15 +67,11 @@ package body FLTK.Images.RGB.PNG is return This : PNG_Image do This.Void_Ptr := new_fl_png_image (Interfaces.C.To_C (Filename)); - case fl_image_fail (This.Void_Ptr) is - when 1 => raise No_Image_Error; - when 2 => raise File_Access_Error; - when 3 => raise Format_Error; - when others => null; - end case; + Raise_Fail_Errors (This); end return; end Create; + function Create (Name : in String := ""; Data : in Color_Component_Array) @@ -78,12 +82,7 @@ package body FLTK.Images.RGB.PNG is (Interfaces.C.To_C (Name), Storage.To_Integer (Data (Data'First)'Address), Data'Length); - case fl_image_fail (This.Void_Ptr) is - when 1 => raise No_Image_Error; - when 2 => raise File_Access_Error; - when 3 => raise Format_Error; - when others => null; - end case; + Raise_Fail_Errors (This); end return; end Create; @@ -92,3 +91,4 @@ package body FLTK.Images.RGB.PNG is end FLTK.Images.RGB.PNG; + |