diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-29 13:38:11 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-29 13:38:11 +1300 |
commit | 82ec0d8c8d1ba164aa2d29c8f1203730aa51988c (patch) | |
tree | 5a97b24d2c1325a2563a4cff70f285fd6da34b44 /body | |
parent | dee76d5884c6f079ea3a2387d07289534a51a0c1 (diff) |
Raises of Internal_FLTK_Error now come with error messages
Diffstat (limited to 'body')
26 files changed, 215 insertions, 89 deletions
diff --git a/body/c_fl_draw.cpp b/body/c_fl_draw.cpp index 488a73f..ddf17b0 100644 --- a/body/c_fl_draw.cpp +++ b/body/c_fl_draw.cpp @@ -260,8 +260,8 @@ void fl_draw_draw_box(int bk, int x, int y, int w, int h, unsigned int c) { fl_draw_box((Fl_Boxtype)bk, x, y, w, h, (Fl_Color)c); } -void fl_draw_draw_symbol(const char *label, int x, int y, int w, int h, unsigned int c) { - fl_draw_symbol(label, x, y, w, h, (Fl_Color)c); +int fl_draw_draw_symbol(const char *label, int x, int y, int w, int h, unsigned int c) { + return fl_draw_symbol(label, x, y, w, h, (Fl_Color)c); } void fl_draw_measure(const char * str, int &w, int &h, int draw_symbols) { diff --git a/body/c_fl_draw.h b/body/c_fl_draw.h index d719903..ae3419f 100644 --- a/body/c_fl_draw.h +++ b/body/c_fl_draw.h @@ -80,7 +80,7 @@ extern "C" void fl_draw_draw_text3(const char *str, int x, int y, int w, int h, extern "C" void fl_draw_draw_text4(int angle, const char *str, int n, int x, int y); extern "C" void fl_draw_rtl_draw(const char *str, int n, int x, int y); extern "C" void fl_draw_draw_box(int bk, int x, int y, int w, int h, unsigned int c); -extern "C" void fl_draw_draw_symbol(const char *label, int x, int y, int w, int h, unsigned int c); +extern "C" int fl_draw_draw_symbol(const char *label, int x, int y, int w, int h, unsigned int c); extern "C" void fl_draw_measure(const char * str, int &w, int &h, int draw_symbols); extern "C" void fl_draw_scroll(int x, int y, int w, int h, int dx, int dy, void * func, void * data); diff --git a/body/fltk-asks.adb b/body/fltk-asks.adb index bd09fac..d6eb8ee 100644 --- a/body/fltk-asks.adb +++ b/body/fltk-asks.adb @@ -402,7 +402,9 @@ package body FLTK.Asks is pragma Assert (Result in -3 .. 2); return Extended_Choice_Result'Val (Result mod 6); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_choice_n returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Extended_Choice; @@ -420,7 +422,9 @@ package body FLTK.Asks is pragma Assert (Result in -3 .. 2); return Extended_Choice_Result'Val (Result mod 6); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_choice_n returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Extended_Choice; @@ -439,7 +443,9 @@ package body FLTK.Asks is pragma Assert (Result in -3 .. 2); return Extended_Choice_Result'Val (Result mod 6); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_choice_n returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Extended_Choice; @@ -512,7 +518,9 @@ package body FLTK.Asks is return Cancel; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_color_chooser returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Color_Chooser; @@ -540,7 +548,9 @@ package body FLTK.Asks is return Cancel; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_color_chooser returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Color_Chooser; diff --git a/body/fltk-devices-surface-paged-postscript.adb b/body/fltk-devices-surface-paged-postscript.adb index fa9f66d..b58b1da 100644 --- a/body/fltk-devices-surface-paged-postscript.adb +++ b/body/fltk-devices-surface-paged-postscript.adb @@ -355,7 +355,9 @@ package body FLTK.Devices.Surface.Paged.Postscript is begin pragma Assert (Code = 0); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_PostScript_File_Device::start_job returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Start_Job; @@ -377,7 +379,9 @@ package body FLTK.Devices.Surface.Paged.Postscript is when others => pragma Assert (Code = 0); end case; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_PostScript_File_Device::start_job returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Start_Job; diff --git a/body/fltk-devices-surface-paged.adb b/body/fltk-devices-surface-paged.adb index 829974a..e13338f 100644 --- a/body/fltk-devices-surface-paged.adb +++ b/body/fltk-devices-surface-paged.adb @@ -211,7 +211,7 @@ package body FLTK.Devices.Surface.Paged is return Media; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Constraint_Error; end To_Page_Format; @@ -243,7 +243,7 @@ package body FLTK.Devices.Surface.Paged is return Orientation; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Constraint_Error; end To_Page_Layout; @@ -267,6 +267,10 @@ package body FLTK.Devices.Surface.Paged is Data (Index).My_Height := Natural (C_Height); end loop; end return; + exception + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Paged_Device::NO_PAGE_FORMATS has inconsistent value of " & + Interfaces.C.int'Image (fl_no_page_formats); end Get_Page_Formats; diff --git a/body/fltk-draw.adb b/body/fltk-draw.adb index 8e98a7f..a98edae 100644 --- a/body/fltk-draw.adb +++ b/body/fltk-draw.adb @@ -685,7 +685,9 @@ package body FLTK.Draw is return False; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_can_do_alpha_blending returned unexpected value of " & + Interfaces.C.int'Image (Result); end Can_Do_Alpha_Blending; @@ -1228,7 +1230,9 @@ package body FLTK.Draw is pragma Assert (Buffer = Storage.To_Integer (Result (Result'First)'Address)); return Result; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_read_image returned unexpected address value that did not " & + "correspond to supplied address value"; end Read_Image; @@ -1254,7 +1258,9 @@ package body FLTK.Draw is pragma Assert (Ret_Val = 1); end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_add_symbol returned unexpected int value of " & + Interfaces.C.int'Image (Ret_Val); end Add_Symbol; procedure Draw_Text @@ -1423,7 +1429,9 @@ package body FLTK.Draw is pragma Assert (Ret_Val = 1); end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_draw_symbol returned unexpected int value of " & + Interfaces.C.int'Image (Ret_Val); end Draw_Symbol; diff --git a/body/fltk-environment.adb b/body/fltk-environment.adb index 22cf676..58c13d6 100644 --- a/body/fltk-environment.adb +++ b/body/fltk-environment.adb @@ -392,7 +392,7 @@ package body FLTK.Environment is return User; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Constraint_Error; end To_Scope; diff --git a/body/fltk-event.adb b/body/fltk-event.adb index 4521fc2..186df71 100644 --- a/body/fltk-event.adb +++ b/body/fltk-event.adb @@ -364,7 +364,8 @@ package body FLTK.Event is end if; return Actual_Grab; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::grab did not have user_data reference back to Ada"; end Get_Grab; @@ -394,7 +395,8 @@ package body FLTK.Event is end if; return Actual_Pushed; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::pushed did not have user_data reference back to Ada"; end Get_Pushed; @@ -418,7 +420,8 @@ package body FLTK.Event is end if; return Actual_Below; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::belowmouse did not have user_data reference back to Ada"; end Get_Below_Mouse; @@ -442,7 +445,8 @@ package body FLTK.Event is end if; return Actual_Focus; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::focus did not have user_data reference back to Ada"; end Get_Focus; diff --git a/body/fltk-file_choosers.adb b/body/fltk-file_choosers.adb index 5662f8a..9345eee 100644 --- a/body/fltk-file_choosers.adb +++ b/body/fltk-file_choosers.adb @@ -967,7 +967,8 @@ package body FLTK.File_Choosers is end if; return Ada_Obj; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_File_Chooser::add_extra returned Widget with no user_data reference back to Ada"; end Eject_Extra; @@ -1058,7 +1059,9 @@ package body FLTK.File_Choosers is pragma Assert (Ret in 0 .. 1); return Boolean'Val (Ret); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_File_Chooser::preview returned unexpected int value of " & + Interfaces.C.int'Image (Ret); end Has_Preview; diff --git a/body/fltk-filenames.adb b/body/fltk-filenames.adb index 7674323..40645de 100644 --- a/body/fltk-filenames.adb +++ b/body/fltk-filenames.adb @@ -170,7 +170,9 @@ package body FLTK.Filenames is (Result in Comparison'Pos (Comparison'First) .. Comparison'Pos (Comparison'Last)); return Comparison'Val (Result); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Wrapper of fl_alphasort returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Alpha_Sort; @@ -185,7 +187,9 @@ package body FLTK.Filenames is (Result in Comparison'Pos (Comparison'First) .. Comparison'Pos (Comparison'Last)); return Comparison'Val (Result); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Wrapper of fl_casealphasort returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Case_Alpha_Sort; @@ -200,7 +204,9 @@ package body FLTK.Filenames is (Result in Comparison'Pos (Comparison'First) .. Comparison'Pos (Comparison'Last)); return Comparison'Val (Result); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Wrapper of fl_numericsort returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Numeric_Sort; @@ -215,7 +221,9 @@ package body FLTK.Filenames is (Result in Comparison'Pos (Comparison'First) .. Comparison'Pos (Comparison'Last)); return Comparison'Val (Result); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Wrapper of fl_casenumericsort returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Case_Numeric_Sort; @@ -286,7 +294,8 @@ package body FLTK.Filenames is pragma Assert (Result = 1); end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "fl_open_uri returned unexpected int value of " & Interfaces.C.int'Image (Result); end Open_URI; diff --git a/body/fltk-static.adb b/body/fltk-static.adb index 56b30c0..5912a3f 100644 --- a/body/fltk-static.adb +++ b/body/fltk-static.adb @@ -915,7 +915,8 @@ package body FLTK.Static is end if; return Actual_First; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::first_window did not have user_data reference back to Ada"; end Get_First_Window; @@ -940,7 +941,8 @@ package body FLTK.Static is end if; return Actual_Next; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::next_window did not have user_data reference back to Ada"; end Get_Next_Window; @@ -957,7 +959,8 @@ package body FLTK.Static is end if; return Actual_Modal; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::modal did not have user_data reference back to Ada"; end Get_Top_Modal; @@ -976,7 +979,8 @@ package body FLTK.Static is end if; return Actual_Queue; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl::readqueue did not have user_data reference back to Ada"; end Read_Queue; diff --git a/body/fltk-tooltips.adb b/body/fltk-tooltips.adb index ccdb649..9c7d9ad 100644 --- a/body/fltk-tooltips.adb +++ b/body/fltk-tooltips.adb @@ -189,7 +189,8 @@ package body FLTK.Tooltips is end if; return Actual_Widget; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl_Tooltip::current did not have user_data reference back to Ada"; end Get_Target; diff --git a/body/fltk-widgets-groups-browsers-textline-file.adb b/body/fltk-widgets-groups-browsers-textline-file.adb index e45396c..5585b6d 100644 --- a/body/fltk-widgets-groups-browsers-textline-file.adb +++ b/body/fltk-widgets-groups-browsers-textline-file.adb @@ -406,7 +406,9 @@ package body FLTK.Widgets.Groups.Browsers.Textline.File is pragma Assert (Code in File_Kind'Pos (File_Kind'First) .. File_Kind'Pos (File_Kind'Last)); return File_Kind'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_File_Browser::filetype returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Get_File_Kind; diff --git a/body/fltk-widgets-groups-browsers-textline.adb b/body/fltk-widgets-groups-browsers-textline.adb index b7b3077..744315f 100644 --- a/body/fltk-widgets-groups-browsers-textline.adb +++ b/body/fltk-widgets-groups-browsers-textline.adb @@ -625,7 +625,8 @@ package body FLTK.Widgets.Groups.Browsers.Textline is pragma Assert (Code = 1); end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser::load returned unexpected int value of " & Interfaces.C.int'Image (Code); end Load; @@ -797,7 +798,8 @@ package body FLTK.Widgets.Groups.Browsers.Textline is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser::select returned unexpected int value of " & Interfaces.C.int'Image (Code); end Set_Select; @@ -813,7 +815,8 @@ package body FLTK.Widgets.Groups.Browsers.Textline is begin pragma Assert (Code in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser::select returned unexpected int value of " & Interfaces.C.int'Image (Code); end Set_Select; @@ -829,7 +832,8 @@ package body FLTK.Widgets.Groups.Browsers.Textline is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser::selected returned unexpected int value of " & Interfaces.C.int'Image (Code); end Is_Selected; @@ -872,7 +876,8 @@ package body FLTK.Widgets.Groups.Browsers.Textline is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser::displayed returned unexpected int value of " & Interfaces.C.int'Image (Code); end Is_Displayed; @@ -1126,7 +1131,9 @@ package body FLTK.Widgets.Groups.Browsers.Textline is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Dispatched item_selected function returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Item_Selected; diff --git a/body/fltk-widgets-groups-browsers.adb b/body/fltk-widgets-groups-browsers.adb index 36b9f2f..dde3fe7 100644 --- a/body/fltk-widgets-groups-browsers.adb +++ b/body/fltk-widgets-groups-browsers.adb @@ -794,7 +794,8 @@ package body FLTK.Widgets.Groups.Browsers is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::select returned unexpected int value of " & Interfaces.C.int'Image (Code); end Set_Select; @@ -812,7 +813,8 @@ package body FLTK.Widgets.Groups.Browsers is begin pragma Assert (Code in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::select returned unexpected int value of " & Interfaces.C.int'Image (Code); end Set_Select; @@ -830,7 +832,9 @@ package body FLTK.Widgets.Groups.Browsers is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::select_only returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Select_Only; @@ -846,7 +850,9 @@ package body FLTK.Widgets.Groups.Browsers is begin pragma Assert (Code in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::select_only returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Select_Only; @@ -870,7 +876,9 @@ package body FLTK.Widgets.Groups.Browsers is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::deselect returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Deselect; @@ -884,7 +892,9 @@ package body FLTK.Widgets.Groups.Browsers is begin pragma Assert (Code in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::deselect returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Deselect; @@ -907,7 +917,9 @@ package body FLTK.Widgets.Groups.Browsers is pragma Assert (Code in 0 .. 1); return Boolean'Val (Code); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Browser_::displayed returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Is_Displayed; diff --git a/body/fltk-widgets-groups-color_choosers.adb b/body/fltk-widgets-groups-color_choosers.adb index 15f34ed..fdb2f04 100644 --- a/body/fltk-widgets-groups-color_choosers.adb +++ b/body/fltk-widgets-groups-color_choosers.adb @@ -262,7 +262,9 @@ package body FLTK.Widgets.Groups.Color_Choosers is begin pragma Assert (Result in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Color_Chooser::rgb returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_RGB; @@ -279,7 +281,9 @@ package body FLTK.Widgets.Groups.Color_Choosers is begin return Boolean'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Color_Chooser::rgb returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_RGB; @@ -321,7 +325,9 @@ package body FLTK.Widgets.Groups.Color_Choosers is begin pragma Assert (Result in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Color_Chooser:hsv returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_HSV; @@ -338,7 +344,9 @@ package body FLTK.Widgets.Groups.Color_Choosers is begin return Boolean'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Color_Chooser::hsv returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_HSV; diff --git a/body/fltk-widgets-groups-help_views.adb b/body/fltk-widgets-groups-help_views.adb index 6435c0f..afcec47 100644 --- a/body/fltk-widgets-groups-help_views.adb +++ b/body/fltk-widgets-groups-help_views.adb @@ -260,7 +260,9 @@ package body FLTK.Widgets.Groups.Help_Views is return Ada_Help_View.Hilda; end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Help_View::link callback hook received Widget with no user_data reference " & + "back to Ada"; end Link_Callback_Hook; @@ -451,7 +453,9 @@ package body FLTK.Widgets.Groups.Help_Views is pragma Assert (Code = 0); end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Help_View::load returned unexpected int value of " & + Interfaces.C.int'Image (Code); end Load; diff --git a/body/fltk-widgets-groups-tabbed.adb b/body/fltk-widgets-groups-tabbed.adb index 360b824..7ed9ea9 100644 --- a/body/fltk-widgets-groups-tabbed.adb +++ b/body/fltk-widgets-groups-tabbed.adb @@ -214,7 +214,8 @@ package body FLTK.Widgets.Groups.Tabbed is end if; return Actual_Widget; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Tabs::push returned Widget with no user_data reference back to Ada"; end Get_Push; @@ -240,7 +241,8 @@ package body FLTK.Widgets.Groups.Tabbed is end if; return Actual_Widget; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Tabs::value returned Widget with no user_data reference back to Ada"; end Get_Visible; @@ -268,7 +270,8 @@ package body FLTK.Widgets.Groups.Tabbed is end if; return Actual_Widget; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Tabs::which returned Widget with no user_data reference back to Ada"; end Get_Which; diff --git a/body/fltk-widgets-groups-windows-double-cairo.adb b/body/fltk-widgets-groups-windows-double-cairo.adb index 897c206..a605c49 100644 --- a/body/fltk-widgets-groups-windows-double-cairo.adb +++ b/body/fltk-widgets-groups-windows-double-cairo.adb @@ -85,7 +85,8 @@ package body FLTK.Widgets.Groups.Windows.Double.Cairo is Ada_Object.My_Func (Cairo_Window (Ada_Object.all), Storage.To_Address (Cairo_Addr)); end if; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Cairo_Window draw hook received Widget with no user_data reference back to Ada"; end Cairo_Draw_Hook; diff --git a/body/fltk-widgets-groups-wizards.adb b/body/fltk-widgets-groups-wizards.adb index eb604a1..06aa1e9 100644 --- a/body/fltk-widgets-groups-wizards.adb +++ b/body/fltk-widgets-groups-wizards.adb @@ -193,7 +193,8 @@ package body FLTK.Widgets.Groups.Wizards is end if; return Actual_Widget; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Wizard::value returned Widget with no user_data reference back to Ada"; end Get_Visible; diff --git a/body/fltk-widgets-groups.adb b/body/fltk-widgets-groups.adb index 3b2e287..281d273 100644 --- a/body/fltk-widgets-groups.adb +++ b/body/fltk-widgets-groups.adb @@ -374,7 +374,8 @@ package body FLTK.Widgets.Groups is Actual_Widget := Widget_Convert.To_Pointer (Storage.To_Address (Widget_Ptr)); return (Data => Actual_Widget); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Group::child returned Widget with no user_data reference back to Ada"; end Child; @@ -471,11 +472,15 @@ package body FLTK.Widgets.Groups is function Get_Clip_Mode (This : in Group) - return Clip_Mode is + return Clip_Mode + is + Result : Interfaces.C.unsigned := fl_group_get_clip_children (This.Void_Ptr); begin - return Clip_Mode'Val (fl_group_get_clip_children (This.Void_Ptr)); + return Clip_Mode'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Group::clip_children returned unexpected unsigned int value of " & + Interfaces.C.unsigned'Image (Result); end Get_Clip_Mode; @@ -511,7 +516,8 @@ package body FLTK.Widgets.Groups is end if; return Actual_Widget; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Group::resizable returned Widget with no user_data reference back to Ada"; end Get_Resizable; @@ -558,7 +564,8 @@ package body FLTK.Widgets.Groups is end if; return Actual_Group; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Group::current returned Widget with no user_data reference back to Ada"; end Get_Current; diff --git a/body/fltk-widgets-inputs-text-file.adb b/body/fltk-widgets-inputs-text-file.adb index c7e4919..18b227f 100644 --- a/body/fltk-widgets-inputs-text-file.adb +++ b/body/fltk-widgets-inputs-text-file.adb @@ -245,7 +245,9 @@ package body FLTK.Widgets.Inputs.Text.File is begin pragma Assert (Result /= 0); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_File_Input::value returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Value; diff --git a/body/fltk-widgets-inputs.adb b/body/fltk-widgets-inputs.adb index 0d3a3fe..ab83121 100644 --- a/body/fltk-widgets-inputs.adb +++ b/body/fltk-widgets-inputs.adb @@ -414,7 +414,9 @@ package body FLTK.Widgets.Inputs is begin pragma Assert (Result in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Input_::copy returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Copy; @@ -429,7 +431,9 @@ package body FLTK.Widgets.Inputs is pragma Assert (Result in 0 .. 1); return Boolean'Val (Result); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Input_::copy returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Copy; diff --git a/body/fltk-widgets-positioners.adb b/body/fltk-widgets-positioners.adb index 053d731..68532a2 100644 --- a/body/fltk-widgets-positioners.adb +++ b/body/fltk-widgets-positioners.adb @@ -284,7 +284,9 @@ package body FLTK.Widgets.Positioners is begin pragma Assert (Result in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Positioner::value returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Coords; @@ -300,7 +302,9 @@ package body FLTK.Widgets.Positioners is begin return Boolean'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Positioner::value returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Coords; @@ -375,7 +379,9 @@ package body FLTK.Widgets.Positioners is begin pragma Assert (Result in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Positioner::xvalue returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Ecks; @@ -390,7 +396,9 @@ package body FLTK.Widgets.Positioners is begin return Boolean'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Positioner::xvalue returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Ecks; @@ -465,7 +473,9 @@ package body FLTK.Widgets.Positioners is begin pragma Assert (Result in 0 .. 1); exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Fl_Positioner::yvalue returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Why; @@ -480,7 +490,9 @@ package body FLTK.Widgets.Positioners is begin return Boolean'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Positioner::yvalue returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Set_Why; @@ -519,17 +531,21 @@ package body FLTK.Widgets.Positioners is (This : in out Positioner; Event : in Event_Kind; X, Y, W, H : in Integer) - return Event_Outcome is - begin - return Event_Outcome'Val (fl_positioner_handle2 + return Event_Outcome + is + Result : Interfaces.C.int := fl_positioner_handle2 (This.Void_Ptr, Event_Kind'Pos (Event), Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), - Interfaces.C.int (H))); + Interfaces.C.int (H)); + begin + return Event_Outcome'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Positioner::handle returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Handle; diff --git a/body/fltk-widgets-valuators-dials.adb b/body/fltk-widgets-valuators-dials.adb index 6dc9e69..93a636a 100644 --- a/body/fltk-widgets-valuators-dials.adb +++ b/body/fltk-widgets-valuators-dials.adb @@ -270,17 +270,21 @@ package body FLTK.Widgets.Valuators.Dials is (This : in out Dial; Event : in Event_Kind; X, Y, W, H : in Integer) - return Event_Outcome is - begin - return Event_Outcome'Val (fl_dial_handle2 + return Event_Outcome + is + Result : Interfaces.C.int := fl_dial_handle2 (This.Void_Ptr, Event_Kind'Pos (Event), Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), - Interfaces.C.int (H))); + Interfaces.C.int (H)); + begin + return Event_Outcome'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Dial::handle returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Handle; diff --git a/body/fltk-widgets.adb b/body/fltk-widgets.adb index a312641..4518491 100644 --- a/body/fltk-widgets.adb +++ b/body/fltk-widgets.adb @@ -800,7 +800,8 @@ package body FLTK.Widgets is end if; return Actual_Parent; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl_Widget::parent has no user_data reference back to Ada"; end Parent; @@ -836,7 +837,8 @@ package body FLTK.Widgets is end if; return Actual_Window; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl_Widget::window has no user_data reference back to Ada"; end Nearest_Window; @@ -854,7 +856,8 @@ package body FLTK.Widgets is end if; return Actual_Window; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl_Widget::top_window has no user_data reference back to Ada"; end Top_Window; @@ -876,7 +879,8 @@ package body FLTK.Widgets is end if; return Actual_Window; exception - when Chk.Assertion_Error => raise Internal_FLTK_Error; + when Chk.Assertion_Error => raise Internal_FLTK_Error with + "Widget returned by Fl_Widget::top_window_offset has no user_data reference back to Ada"; end Top_Window_Offset; @@ -1269,10 +1273,14 @@ package body FLTK.Widgets is return Interfaces.C.int; for my_handle'Address use This.Handle_Ptr; pragma Import (Ada, my_handle); + + Result : Interfaces.C.int := my_handle (This.Void_Ptr, Event_Kind'Pos (Event)); begin - return Event_Outcome'Val (my_handle (This.Void_Ptr, Event_Kind'Pos (Event))); + return Event_Outcome'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Dispatched handle function returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Handle; |