aboutsummaryrefslogtreecommitdiff
path: root/render.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-06 17:42:40 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-06 17:42:40 -0400
commit09a2a56e22ce36238dce94f927f1909b63493960 (patch)
tree2a1f9c7c5287553bf29b67d86661eaede5783eb5 /render.f90
parent9c957c4a0964ee1f5b0ff582543b9f526978c47e (diff)
downloadLR-87-09a2a56e22ce36238dce94f927f1909b63493960.zip
LR-87-09a2a56e22ce36238dce94f927f1909b63493960.tar.gz
File type is now returned for evaluation. Initial routines for saving implemented but unused.
Diffstat (limited to 'render.f90')
-rw-r--r--render.f9034
1 files changed, 34 insertions, 0 deletions
diff --git a/render.f90 b/render.f90
index 578948c..0045c22 100644
--- a/render.f90
+++ b/render.f90
@@ -7,6 +7,10 @@ implicit none
integer, parameter::render_action_back = 4
integer, parameter::render_action_quit = 5
+ character(11), dimension(2)::base_supported_types = &
+ ["text/plain ", &
+ "text/gemini" ]
+
type, abstract :: renderer
integer::y
@@ -15,6 +19,7 @@ implicit none
contains
procedure::render_proportional
+ procedure::type_supported
procedure(initialize), deferred::initialize
procedure(prepare_for_layout), deferred::prepare_for_layout
@@ -128,8 +133,37 @@ implicit none
end function request_action
end interface
+ abstract interface
+ function request_save_filename(self, url, mimetype, filename)
+ import::renderer
+ class(renderer)::self
+ character(*), intent(in)::url
+ character(*), intent(in)::mimetype
+ character(*), intent(out)::filename
+ logical::request_save_filename
+ end function request_save_filename
+ end interface
+
contains
+ function type_supported(self, mimetype)
+ implicit none
+
+ class(renderer)::self
+ character(*), intent(in)::mimetype
+ logical::type_supported
+ integer::i
+
+ type_supported = .false.
+ do i = 1, size(base_supported_types)
+ if(trim(mimetype) == trim(base_supported_types(i))) then
+ type_supported = .true.
+ exit
+ end if
+ end do
+
+ end function type_supported
+
function width_of_line(r, text, startpos, endpos)
implicit none