aboutsummaryrefslogtreecommitdiff
path: root/render.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-05 11:04:22 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-05 11:04:22 -0400
commit0ade9914918238b8da35e995fe9782a517988ae2 (patch)
treeff9871528998544479a1a15144354d8b873ddc20 /render.f90
parent723324ae71f8209e4b1757a3f84bd0e66b6c6319 (diff)
downloadLR-87-0ade9914918238b8da35e995fe9782a517988ae2.zip
LR-87-0ade9914918238b8da35e995fe9782a517988ae2.tar.gz
Fixed link handling. Can now navigate links and page up/down.
Diffstat (limited to 'render.f90')
-rw-r--r--render.f9027
1 files changed, 26 insertions, 1 deletions
diff --git a/render.f90 b/render.f90
index 6f285f7..b3b1c32 100644
--- a/render.f90
+++ b/render.f90
@@ -1,6 +1,11 @@
module render
implicit none
+ integer, parameter::render_action_none = 1
+ integer, parameter::render_action_goto = 2
+ integer, parameter::render_action_layout = 3
+ integer, parameter::render_action_quit = 4
+
type, abstract :: renderer
integer::y
@@ -12,6 +17,7 @@ implicit none
procedure(initialize), deferred::initialize
procedure(prepare_for_layout), deferred::prepare_for_layout
+ procedure(new_page), deferred::new_page
procedure(calculate_width), deferred::text_width
procedure(calculate_height), deferred::text_height
@@ -34,6 +40,8 @@ implicit none
procedure(draw_text), deferred::report_status
+ procedure(request_action), deferred::request_action
+
end type renderer
abstract interface
@@ -42,6 +50,13 @@ implicit none
class(renderer)::self
end subroutine initialize
end interface
+
+ abstract interface
+ subroutine new_page(self)
+ import::renderer
+ class(renderer)::self
+ end subroutine new_page
+ end interface
abstract interface
subroutine prepare_for_layout(self)
@@ -102,7 +117,16 @@ implicit none
logical::request_input
end function request_input
end interface
-
+
+ abstract interface
+ function request_action(self, text)
+ import::renderer
+ class(renderer)::self
+ character(*), intent(out)::text
+ integer::request_action
+ end function request_action
+ end interface
+
contains
function width_of_line(r, text, startpos, endpos)
@@ -238,6 +262,7 @@ contains
d_length = len_trim(url) - i_whitespace + 1
allocate(character(len=d_length) :: display)
display = adjustl(url(i_whitespace:len_trim(url)))
+ url = url(1:(i_whitespace-1))
end if
if(r%is_link_visible(display)) then