aboutsummaryrefslogtreecommitdiff
path: root/ag_render.f90
diff options
context:
space:
mode:
Diffstat (limited to 'ag_render.f90')
-rw-r--r--ag_render.f9041
1 files changed, 41 insertions, 0 deletions
diff --git a/ag_render.f90 b/ag_render.f90
index c357318..576d34d 100644
--- a/ag_render.f90
+++ b/ag_render.f90
@@ -119,6 +119,8 @@ implicit none
procedure :: report_displayed_page => ag_report_page
+ procedure :: report_unsupported_protocol => ag_report_unsupported_protocol
+
end type appgraphics_renderer
contains
@@ -798,4 +800,43 @@ contains
end subroutine ag_report_page
+ function ag_report_unsupported_protocol(self, url)
+ use iso_c_binding, only: c_null_char, c_null_ptr
+ use appgraphics, only: dlgyesno
+ implicit none
+
+ class(appgraphics_renderer)::self
+ character(*), intent(in)::url
+ logical::ag_report_unsupported_protocol
+
+ type(c_ptr)::ret
+
+ interface
+ function ShellExecute(h, verb, filename, params, dir, showcmd) bind(c, name="ShellExecuteA")
+ use iso_c_binding
+ type(c_ptr)::h
+ character(kind=c_char)::verb
+ character(kind=c_char)::filename
+ type(c_ptr)::params
+ type(c_ptr)::dir
+ integer(kind=c_int)::showcmd
+ type(c_ptr)::ShellExecute
+ end function ShellExecute
+ end interface
+
+ if(dlgyesno(DIALOG_WARN, "Ask Windows to open "//trim(url)//" in another program?")) then
+
+ ret = ShellExecute(c_null_ptr, &
+ "open"//c_null_char, &
+ trim(url)//c_null_char, &
+ c_null_ptr, &
+ c_null_ptr, &
+ 5) ! 5 is SW_SHOW
+
+ end if
+
+ ag_report_unsupported_protocol = .true.
+
+ end function ag_report_unsupported_protocol
+
end module ag_render