aboutsummaryrefslogtreecommitdiff
path: root/layout.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-04-24 21:47:09 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-04-24 21:47:09 -0400
commiteb8d9bc74a0624dbc98ffb75268a3ba57bd43b40 (patch)
tree04e77c082b1c87778f06fe53798db6bb284f834c /layout.f90
downloadLR-87-eb8d9bc74a0624dbc98ffb75268a3ba57bd43b40.zip
LR-87-eb8d9bc74a0624dbc98ffb75268a3ba57bd43b40.tar.gz
Initial code commit
Diffstat (limited to 'layout.f90')
-rw-r--r--layout.f9051
1 files changed, 51 insertions, 0 deletions
diff --git a/layout.f90 b/layout.f90
new file mode 100644
index 0000000..5d6f200
--- /dev/null
+++ b/layout.f90
@@ -0,0 +1,51 @@
+module layout
+implicit none
+
+ integer, parameter::line_type_text = 1
+ integer, parameter::line_type_preformatted = 2
+ integer, parameter::line_type_link = 3
+ integer, parameter::line_type_indicator = 99
+
+ type::line
+ character(len=:), allocatable::text
+ integer::line_type
+
+ type(line), pointer::next
+ end type line
+
+contains
+
+ subroutine layout_lines(first_line, rendering_engine)
+ use render
+ implicit none
+
+ type(line), pointer::first_line
+ class(renderer)::rendering_engine
+
+ type(line), pointer::walker
+ logical::laying_out
+
+ walker => first_line
+ laying_out = .true.
+
+ do while(laying_out)
+ select case (walker%line_type)
+
+ case (line_type_text)
+ call render_proportional(rendering_engine, walker%text)
+
+ case (line_type_preformatted)
+ call render_preformatted(rendering_engine, walker%text)
+
+ end select
+
+ laying_out = associated(walker%next)
+ if(laying_out) then
+ walker => walker%next
+ end if
+
+ end do
+
+ end subroutine layout_lines
+
+end module layout \ No newline at end of file