summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/fl_double_window.html5
-rw-r--r--doc/fl_gl_window.html10
-rw-r--r--doc/fl_overlay_window.html5
-rw-r--r--doc/fl_single_window.html5
-rw-r--r--doc/fl_window.html5
-rw-r--r--src/c_fl_double_window.cpp4
-rw-r--r--src/c_fl_double_window.h1
-rw-r--r--src/c_fl_gl_window.cpp4
-rw-r--r--src/c_fl_gl_window.h1
-rw-r--r--src/c_fl_overlay_window.cpp4
-rw-r--r--src/c_fl_overlay_window.h1
-rw-r--r--src/c_fl_single_window.cpp4
-rw-r--r--src/c_fl_single_window.h1
-rw-r--r--src/c_fl_window.cpp4
-rw-r--r--src/c_fl_window.h1
-rw-r--r--src/fltk-widgets-groups-windows-double-overlay.adb14
-rw-r--r--src/fltk-widgets-groups-windows-double-overlay.ads4
-rw-r--r--src/fltk-widgets-groups-windows-double.adb22
-rw-r--r--src/fltk-widgets-groups-windows-double.ads4
-rw-r--r--src/fltk-widgets-groups-windows-opengl.adb14
-rw-r--r--src/fltk-widgets-groups-windows-opengl.ads4
-rw-r--r--src/fltk-widgets-groups-windows-single.adb14
-rw-r--r--src/fltk-widgets-groups-windows-single.ads4
-rw-r--r--src/fltk-widgets-groups-windows.adb51
-rw-r--r--src/fltk-widgets-groups-windows.ads19
25 files changed, 195 insertions, 10 deletions
diff --git a/doc/fl_double_window.html b/doc/fl_double_window.html
index 6c61c93..cdaf7a4 100644
--- a/doc/fl_double_window.html
+++ b/doc/fl_double_window.html
@@ -138,7 +138,10 @@ procedure Show
<td><pre>
void show(int a, char **b);
</pre></td>
-<td>&nbsp;</td>
+<td><pre>
+procedure Show_With_Args
+ (This : in out Double_Window);
+</pre></td>
</tr>
</table>
diff --git a/doc/fl_gl_window.html b/doc/fl_gl_window.html
index b213406..5dfc0fe 100644
--- a/doc/fl_gl_window.html
+++ b/doc/fl_gl_window.html
@@ -356,11 +356,19 @@ procedure Resize
<tr>
<td><pre>
void show();
+</pre></td>
+<td><pre>
+procedure Show
+ (This : in out GL_Window);
+</pre></td>
+ </tr>
+ <tr>
+<td><pre>
void show(int a, char **b);
</pre></td>
<td><pre>
-procedure Show
+procedure Show_With_Args
(This : in out GL_Window);
</pre></td>
</tr>
diff --git a/doc/fl_overlay_window.html b/doc/fl_overlay_window.html
index ac86aac..ef338bc 100644
--- a/doc/fl_overlay_window.html
+++ b/doc/fl_overlay_window.html
@@ -145,7 +145,10 @@ procedure Show
<td><pre>
void show(int a, char **b);
</pre></td>
-<td>&nbsp;</td>
+<td><pre>
+procedure Show_With_Args
+ (This : in out Overlay_Window);
+</pre></td>
</tr>
</table>
diff --git a/doc/fl_single_window.html b/doc/fl_single_window.html
index 4fb76b2..21f97db 100644
--- a/doc/fl_single_window.html
+++ b/doc/fl_single_window.html
@@ -113,7 +113,10 @@ procedure Show
<td><pre>
void show(int a, char **b);
</pre></td>
-<td>&nbsp;</td>
+<td><pre>
+procedure Show_With_Args
+ (This : in out Single_Window);
+</pre></td>
</tr>
</table>
diff --git a/doc/fl_window.html b/doc/fl_window.html
index 9b39c93..93ab5fd 100644
--- a/doc/fl_window.html
+++ b/doc/fl_window.html
@@ -618,7 +618,10 @@ procedure Show
<td><pre>
void show(int argc, char **argv);
</pre></td>
-<td>&nbsp;</td>
+<td><pre>
+procedure Show_With_Args
+ (This : in out Window);
+</pre></td>
</tr>
<tr>
diff --git a/src/c_fl_double_window.cpp b/src/c_fl_double_window.cpp
index ac949d9..4bbe48b 100644
--- a/src/c_fl_double_window.cpp
+++ b/src/c_fl_double_window.cpp
@@ -65,6 +65,10 @@ void fl_double_window_show(DOUBLEWINDOW d) {
reinterpret_cast<Fl_Double_Window*>(d)->show();
}
+void fl_double_window_show2(DOUBLEWINDOW d, int c, void * v) {
+ reinterpret_cast<Fl_Double_Window*>(d)->show(c, static_cast<char**>(v));
+}
+
void fl_double_window_hide(DOUBLEWINDOW d) {
reinterpret_cast<Fl_Double_Window*>(d)->hide();
}
diff --git a/src/c_fl_double_window.h b/src/c_fl_double_window.h
index d518381..b1bb7d4 100644
--- a/src/c_fl_double_window.h
+++ b/src/c_fl_double_window.h
@@ -17,6 +17,7 @@ extern "C" void free_fl_double_window(DOUBLEWINDOW d);
extern "C" void fl_double_window_show(DOUBLEWINDOW d);
+extern "C" void fl_double_window_show2(DOUBLEWINDOW d, int c, void * v);
extern "C" void fl_double_window_hide(DOUBLEWINDOW d);
extern "C" void fl_double_window_flush(DOUBLEWINDOW d);
diff --git a/src/c_fl_gl_window.cpp b/src/c_fl_gl_window.cpp
index 1bcd616..70ba7e3 100644
--- a/src/c_fl_gl_window.cpp
+++ b/src/c_fl_gl_window.cpp
@@ -65,6 +65,10 @@ void fl_gl_window_show(GLWINDOW w) {
reinterpret_cast<Fl_Gl_Window*>(w)->show();
}
+void fl_gl_window_show2(GLWINDOW w, int c, void * v) {
+ reinterpret_cast<Fl_Gl_Window*>(w)->show(c, static_cast<char**>(v));
+}
+
void fl_gl_window_hide(GLWINDOW w) {
reinterpret_cast<Fl_Gl_Window*>(w)->hide();
}
diff --git a/src/c_fl_gl_window.h b/src/c_fl_gl_window.h
index 0079008..4c48b59 100644
--- a/src/c_fl_gl_window.h
+++ b/src/c_fl_gl_window.h
@@ -17,6 +17,7 @@ extern "C" void free_fl_gl_window(GLWINDOW w);
extern "C" void fl_gl_window_show(GLWINDOW w);
+extern "C" void fl_gl_window_show2(GLWINDOW w, int c, void * v);
extern "C" void fl_gl_window_hide(GLWINDOW w);
extern "C" void fl_gl_window_hide_overlay(GLWINDOW w);
extern "C" void fl_gl_window_flush(GLWINDOW w);
diff --git a/src/c_fl_overlay_window.cpp b/src/c_fl_overlay_window.cpp
index 3ce76a4..c5610ef 100644
--- a/src/c_fl_overlay_window.cpp
+++ b/src/c_fl_overlay_window.cpp
@@ -86,6 +86,10 @@ void fl_overlay_window_show(OVERLAYWINDOW w) {
reinterpret_cast<Fl_Overlay_Window*>(w)->show();
}
+void fl_overlay_window_show2(OVERLAYWINDOW w, int c, void * v) {
+ reinterpret_cast<Fl_Overlay_Window*>(w)->show(c, static_cast<char**>(v));
+}
+
void fl_overlay_window_hide(OVERLAYWINDOW w) {
reinterpret_cast<Fl_Overlay_Window*>(w)->hide();
}
diff --git a/src/c_fl_overlay_window.h b/src/c_fl_overlay_window.h
index 781f074..a94bbec 100644
--- a/src/c_fl_overlay_window.h
+++ b/src/c_fl_overlay_window.h
@@ -21,6 +21,7 @@ extern "C" void fl_overlay_window_resize(OVERLAYWINDOW ow, int x, int y, int w,
extern "C" void fl_overlay_window_show(OVERLAYWINDOW w);
+extern "C" void fl_overlay_window_show2(OVERLAYWINDOW w, int c, void * v);
extern "C" void fl_overlay_window_hide(OVERLAYWINDOW w);
extern "C" void fl_overlay_window_flush(OVERLAYWINDOW w);
diff --git a/src/c_fl_single_window.cpp b/src/c_fl_single_window.cpp
index 4968e46..974a3c1 100644
--- a/src/c_fl_single_window.cpp
+++ b/src/c_fl_single_window.cpp
@@ -65,6 +65,10 @@ void fl_single_window_show(SINGLEWINDOW w) {
reinterpret_cast<Fl_Single_Window*>(w)->show();
}
+void fl_single_window_show2(SINGLEWINDOW w, int c, void * v) {
+ reinterpret_cast<Fl_Single_Window*>(w)->show(c, static_cast<char**>(v));
+}
+
void fl_single_window_flush(SINGLEWINDOW w) {
reinterpret_cast<Fl_Single_Window*>(w)->flush();
}
diff --git a/src/c_fl_single_window.h b/src/c_fl_single_window.h
index 3179f5a..85e6e29 100644
--- a/src/c_fl_single_window.h
+++ b/src/c_fl_single_window.h
@@ -17,6 +17,7 @@ extern "C" void free_fl_single_window(SINGLEWINDOW w);
extern "C" void fl_single_window_show(SINGLEWINDOW w);
+extern "C" void fl_single_window_show2(SINGLEWINDOW w, int c, void * v);
extern "C" void fl_single_window_flush(SINGLEWINDOW w);
diff --git a/src/c_fl_window.cpp b/src/c_fl_window.cpp
index 37c8a44..631c98b 100644
--- a/src/c_fl_window.cpp
+++ b/src/c_fl_window.cpp
@@ -67,6 +67,10 @@ void fl_window_show(WINDOW n) {
reinterpret_cast<Fl_Window*>(n)->Fl_Window::show();
}
+void fl_window_show2(WINDOW n, int c, void * v) {
+ reinterpret_cast<Fl_Window*>(n)->show(c, static_cast<char**>(v));
+}
+
void fl_window_hide(WINDOW n) {
// virtual, so disable dispatch
reinterpret_cast<Fl_Window*>(n)->Fl_Window::hide();
diff --git a/src/c_fl_window.h b/src/c_fl_window.h
index f17051e..ed6ebdd 100644
--- a/src/c_fl_window.h
+++ b/src/c_fl_window.h
@@ -17,6 +17,7 @@ extern "C" void free_fl_window(WINDOW n);
extern "C" void fl_window_show(WINDOW n);
+extern "C" void fl_window_show2(WINDOW n, int c, void * v);
extern "C" void fl_window_hide(WINDOW n);
extern "C" int fl_window_shown(WINDOW n);
extern "C" void fl_window_wait_for_expose(WINDOW n);
diff --git a/src/fltk-widgets-groups-windows-double-overlay.adb b/src/fltk-widgets-groups-windows-double-overlay.adb
index 33a2f92..3b16b62 100644
--- a/src/fltk-widgets-groups-windows-double-overlay.adb
+++ b/src/fltk-widgets-groups-windows-double-overlay.adb
@@ -48,6 +48,13 @@ package body FLTK.Widgets.Groups.Windows.Double.Overlay is
pragma Import (C, fl_overlay_window_show, "fl_overlay_window_show");
pragma Inline (fl_overlay_window_show);
+ procedure fl_overlay_window_show2
+ (W : in Storage.Integer_Address;
+ C : in Interfaces.C.int;
+ V : in Storage.Integer_Address);
+ pragma Import (C, fl_overlay_window_show2, "fl_overlay_window_show2");
+ pragma Inline (fl_overlay_window_show2);
+
procedure fl_overlay_window_hide
(W : in Storage.Integer_Address);
pragma Import (C, fl_overlay_window_hide, "fl_overlay_window_hide");
@@ -212,6 +219,13 @@ package body FLTK.Widgets.Groups.Windows.Double.Overlay is
end Show;
+ procedure Show_With_Args
+ (This : in out Overlay_Window) is
+ begin
+ Dispatch_Show_With_Args (fl_overlay_window_show2'Access, This.Void_Ptr);
+ end Show_With_Args;
+
+
procedure Hide
(This : in out Overlay_Window) is
begin
diff --git a/src/fltk-widgets-groups-windows-double-overlay.ads b/src/fltk-widgets-groups-windows-double-overlay.ads
index 082087c..3d07549 100644
--- a/src/fltk-widgets-groups-windows-double-overlay.ads
+++ b/src/fltk-widgets-groups-windows-double-overlay.ads
@@ -35,6 +35,9 @@ package FLTK.Widgets.Groups.Windows.Double.Overlay is
procedure Show
(This : in out Overlay_Window);
+ procedure Show_With_Args
+ (This : in out Overlay_Window);
+
procedure Hide
(This : in out Overlay_Window);
@@ -86,6 +89,7 @@ private
pragma Inline (Show);
+ pragma Inline (Show_With_Args);
pragma Inline (Hide);
pragma Inline (Flush);
diff --git a/src/fltk-widgets-groups-windows-double.adb b/src/fltk-widgets-groups-windows-double.adb
index cff5c5c..3864a1a 100644
--- a/src/fltk-widgets-groups-windows-double.adb
+++ b/src/fltk-widgets-groups-windows-double.adb
@@ -31,7 +31,7 @@ package body FLTK.Widgets.Groups.Windows.Double is
pragma Inline (new_fl_double_window2);
procedure free_fl_double_window
- (W : in Storage.Integer_Address);
+ (W : in Storage.Integer_Address);
pragma Import (C, free_fl_double_window, "free_fl_double_window");
pragma Inline (free_fl_double_window);
@@ -39,17 +39,24 @@ package body FLTK.Widgets.Groups.Windows.Double is
procedure fl_double_window_show
- (W : in Storage.Integer_Address);
+ (W : in Storage.Integer_Address);
pragma Import (C, fl_double_window_show, "fl_double_window_show");
pragma Inline (fl_double_window_show);
+ procedure fl_double_window_show2
+ (W : in Storage.Integer_Address;
+ C : in Interfaces.C.int;
+ V : in Storage.Integer_Address);
+ pragma Import (C, fl_double_window_show2, "fl_double_window_show2");
+ pragma Inline (fl_double_window_show2);
+
procedure fl_double_window_hide
- (W : in Storage.Integer_Address);
+ (W : in Storage.Integer_Address);
pragma Import (C, fl_double_window_hide, "fl_double_window_hide");
pragma Inline (fl_double_window_hide);
procedure fl_double_window_flush
- (W : in Storage.Integer_Address);
+ (W : in Storage.Integer_Address);
pragma Import (C, fl_double_window_flush, "fl_double_window_flush");
pragma Inline (fl_double_window_flush);
@@ -174,6 +181,13 @@ package body FLTK.Widgets.Groups.Windows.Double is
end Show;
+ procedure Show_With_Args
+ (This : in out Double_Window) is
+ begin
+ Dispatch_Show_With_Args (fl_double_window_show2'Access, This.Void_Ptr);
+ end Show_With_Args;
+
+
procedure Hide
(This : in out Double_Window) is
begin
diff --git a/src/fltk-widgets-groups-windows-double.ads b/src/fltk-widgets-groups-windows-double.ads
index f4e7089..919e687 100644
--- a/src/fltk-widgets-groups-windows-double.ads
+++ b/src/fltk-widgets-groups-windows-double.ads
@@ -35,6 +35,9 @@ package FLTK.Widgets.Groups.Windows.Double is
procedure Show
(This : in out Double_Window);
+ procedure Show_With_Args
+ (This : in out Double_Window);
+
procedure Hide
(This : in out Double_Window);
@@ -72,6 +75,7 @@ private
pragma Inline (Show);
+ pragma Inline (Show_With_Args);
pragma Inline (Hide);
pragma Inline (Flush);
diff --git a/src/fltk-widgets-groups-windows-opengl.adb b/src/fltk-widgets-groups-windows-opengl.adb
index 04a4b65..190b5c1 100644
--- a/src/fltk-widgets-groups-windows-opengl.adb
+++ b/src/fltk-widgets-groups-windows-opengl.adb
@@ -50,6 +50,13 @@ package body FLTK.Widgets.Groups.Windows.OpenGL is
pragma Import (C, fl_gl_window_show, "fl_gl_window_show");
pragma Inline (fl_gl_window_show);
+ procedure fl_gl_window_show2
+ (S : in Storage.Integer_Address;
+ C : in Interfaces.C.int;
+ V : in Storage.Integer_Address);
+ pragma Import (C, fl_gl_window_show2, "fl_gl_window_show2");
+ pragma Inline (fl_gl_window_show2);
+
procedure fl_gl_window_hide
(S : in Storage.Integer_Address);
pragma Import (C, fl_gl_window_hide, "fl_gl_window_hide");
@@ -301,6 +308,13 @@ package body FLTK.Widgets.Groups.Windows.OpenGL is
end Show;
+ procedure Show_With_Args
+ (This : in out GL_Window) is
+ begin
+ Dispatch_Show_With_Args (fl_gl_window_show2'Access, This.Void_Ptr);
+ end Show_With_Args;
+
+
procedure Hide
(This : in out GL_Window) is
begin
diff --git a/src/fltk-widgets-groups-windows-opengl.ads b/src/fltk-widgets-groups-windows-opengl.ads
index 9c8d1c9..44a7647 100644
--- a/src/fltk-widgets-groups-windows-opengl.ads
+++ b/src/fltk-widgets-groups-windows-opengl.ads
@@ -64,6 +64,9 @@ package FLTK.Widgets.Groups.Windows.OpenGL is
procedure Show
(This : in out GL_Window);
+ procedure Show_With_Args
+ (This : in out GL_Window);
+
procedure Hide
(This : in out GL_Window);
@@ -228,6 +231,7 @@ private
pragma Inline (Show);
+ pragma Inline (Show_With_Args);
pragma Inline (Hide);
pragma Inline (Hide_Overlay);
pragma Inline (Flush);
diff --git a/src/fltk-widgets-groups-windows-single.adb b/src/fltk-widgets-groups-windows-single.adb
index 720ce28..6e7c7c1 100644
--- a/src/fltk-widgets-groups-windows-single.adb
+++ b/src/fltk-widgets-groups-windows-single.adb
@@ -43,6 +43,13 @@ package body FLTK.Widgets.Groups.Windows.Single is
pragma Import (C, fl_single_window_show, "fl_single_window_show");
pragma Inline (fl_single_window_show);
+ procedure fl_single_window_show2
+ (S : in Storage.Integer_Address;
+ C : in Interfaces.C.int;
+ V : in Storage.Integer_Address);
+ pragma Import (C, fl_single_window_show2, "fl_single_window_show2");
+ pragma Inline (fl_single_window_show2);
+
procedure fl_single_window_flush
(S : in Storage.Integer_Address);
pragma Import (C, fl_single_window_flush, "fl_single_window_flush");
@@ -168,6 +175,13 @@ package body FLTK.Widgets.Groups.Windows.Single is
end Show;
+ procedure Show_With_Args
+ (This : in out Single_Window) is
+ begin
+ Dispatch_Show_With_Args (fl_single_window_show2'Access, This.Void_Ptr);
+ end Show_With_Args;
+
+
procedure Flush
(This : in out Single_Window) is
begin
diff --git a/src/fltk-widgets-groups-windows-single.ads b/src/fltk-widgets-groups-windows-single.ads
index 73b2620..be2fea6 100644
--- a/src/fltk-widgets-groups-windows-single.ads
+++ b/src/fltk-widgets-groups-windows-single.ads
@@ -35,6 +35,9 @@ package FLTK.Widgets.Groups.Windows.Single is
procedure Show
(This : in out Single_Window);
+ procedure Show_With_Args
+ (This : in out Single_Window);
+
procedure Flush
(This : in out Single_Window);
@@ -68,6 +71,7 @@ private
pragma Inline (Show);
+ pragma Inline (Show_With_Args);
pragma Inline (Flush);
pragma Inline (Make_Current);
diff --git a/src/fltk-widgets-groups-windows.adb b/src/fltk-widgets-groups-windows.adb
index 090def8..afd17ae 100644
--- a/src/fltk-widgets-groups-windows.adb
+++ b/src/fltk-widgets-groups-windows.adb
@@ -6,6 +6,7 @@
with
+ Ada.Command_Line,
Interfaces.C.Strings,
FLTK.Images.RGB;
@@ -50,6 +51,13 @@ package body FLTK.Widgets.Groups.Windows is
pragma Import (C, fl_window_show, "fl_window_show");
pragma Inline (fl_window_show);
+ procedure fl_window_show2
+ (W : in Storage.Integer_Address;
+ C : in Interfaces.C.int;
+ V : in Storage.Integer_Address);
+ pragma Import (C, fl_window_show2, "fl_window_show2");
+ pragma Inline (fl_window_show2);
+
procedure fl_window_hide
(W : in Storage.Integer_Address);
pragma Import (C, fl_window_hide, "fl_window_hide");
@@ -291,6 +299,42 @@ package body FLTK.Widgets.Groups.Windows is
+ ------------------------
+ -- Internal Utility --
+ ------------------------
+
+ function Create_Argv
+ return Interfaces.C.Strings.chars_ptr_array
+ is
+ package ICS renames Interfaces.C.Strings;
+ package ACom renames Ada.Command_Line;
+
+ Result : ICS.chars_ptr_array (0 .. Interfaces.C.size_t (ACom.Argument_Count));
+ begin
+ Result (0) := ICS.New_String (ACom.Command_Name);
+ for Index in Integer range 1 .. ACom.Argument_Count loop
+ Result (Interfaces.C.size_t (Index)) := ICS.New_String (ACom.Argument (Index));
+ end loop;
+ return Result;
+ end Create_Argv;
+
+
+ procedure Dispatch_Show_With_Args
+ (Func : in Show_With_Args_Func;
+ CObj : in Storage.Integer_Address)
+ is
+ Argv : Interfaces.C.Strings.chars_ptr_array := Create_Argv;
+ begin
+ Func (CObj, Interfaces.C.int (Ada.Command_Line.Argument_Count + 1),
+ Storage.To_Integer (Argv (Argv'First)'Address));
+ for Ptr of Argv loop
+ Interfaces.C.Strings.Free (Ptr);
+ end loop;
+ end Dispatch_Show_With_Args;
+
+
+
+
-------------------
-- Destructors --
-------------------
@@ -385,6 +429,13 @@ package body FLTK.Widgets.Groups.Windows is
end Show;
+ procedure Show_With_Args
+ (This : in out Window) is
+ begin
+ Dispatch_Show_With_Args (fl_window_show2'Access, This.Void_Ptr);
+ end Show_With_Args;
+
+
procedure Hide
(This : in out Window) is
begin
diff --git a/src/fltk-widgets-groups-windows.ads b/src/fltk-widgets-groups-windows.ads
index a419fbb..97d79d9 100644
--- a/src/fltk-widgets-groups-windows.ads
+++ b/src/fltk-widgets-groups-windows.ads
@@ -10,7 +10,7 @@ with
private with
- Interfaces.C;
+ Interfaces.C.Strings;
package FLTK.Widgets.Groups.Windows is
@@ -48,6 +48,9 @@ package FLTK.Widgets.Groups.Windows is
procedure Show
(This : in out Window);
+ procedure Show_With_Args
+ (This : in out Window);
+
procedure Hide
(This : in out Window);
@@ -232,7 +235,21 @@ private
with Inline;
+ -- Used for implementing show(argc,argv)
+ type Show_With_Args_Func is access procedure
+ (CObj : in Storage.Integer_Address;
+ Argc : in Interfaces.C.int;
+ Argv : in Storage.Integer_Address);
+
+ pragma Convention (C, Show_With_Args_Func);
+
+ procedure Dispatch_Show_With_Args
+ (Func : in Show_With_Args_Func;
+ CObj : in Storage.Integer_Address);
+
+
pragma Inline (Show);
+ pragma Inline (Show_With_Args);
pragma Inline (Hide);
pragma Inline (Is_Shown);
pragma Inline (Wait_For_Expose);