aboutsummaryrefslogtreecommitdiff
path: root/main.F90
diff options
context:
space:
mode:
Diffstat (limited to 'main.F90')
-rw-r--r--main.F9034
1 files changed, 26 insertions, 8 deletions
diff --git a/main.F90 b/main.F90
index cb9e8b1..9ab1782 100644
--- a/main.F90
+++ b/main.F90
@@ -12,7 +12,7 @@ use wsa_network, only: windows_network_startup => startup
implicit none
character(256)::initial_site
- character(1024)::current_url
+ character(1024)::current_url, input
type(connection)::conn
type(dumb_renderer)::r
@@ -70,8 +70,6 @@ implicit none
call update_status(r, current_url, return_code)
- loaded = .true.
-
end if
if(return_code == STATUS_REDIRECT) then
@@ -82,17 +80,37 @@ implicit none
else
first_line => load_unit(io, file_type_gemini)
-
+ loaded = .true.
+ call r%new_page()
call r%report_status("Performing Layout")
call layout_lines(first_line, r)
end if
+ do while(loaded .and. running)
- running = .not. loaded
-
-
-
+ select case(r%request_action(input))
+ case (render_action_quit)
+ running = .false.
+
+ case (render_action_layout)
+ call r%report_status("Performing Layout")
+ call layout_lines(first_line, r)
+
+ case (render_action_goto)
+
+ if(index(input, "://") > 0) then
+ current_url = input
+ else
+ call handle_relative_url(current_url, input)
+ end if
+
+ call free_lines(first_line)
+ loaded = .false.
+
+ end select
+
+ end do
end do
close(io)