From 8088abdfae2f18520b9135221885479ae37a5dae Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Sat, 23 May 2020 09:38:28 -0400 Subject: Introduced new handling of other protocols under windows. Likely broke dumb renderer for the moment. --- ag_render.f90 | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'ag_render.f90') 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 -- cgit v1.2.3