gui_render_subtree   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/gui.xtm

Implementation

;; walks the tree in pre-order
(bind-func gui_render_subtree
  (lambda (widget:Widget* bounds:Rect*)
    (if (null? widget)
        widget
        (if (and (null? (Widget_left_child widget))
                 (null? (Widget_right_child widget)))
            ;; if a leaf node, set the nanovg transform matrix and
            ;; call the render callback
            (let ((winWidth (GUI_width EXTEMPORE_GUI))
                  (winHeight (GUI_height EXTEMPORE_GUI))
                  (vg (GUI_context EXTEMPORE_GUI))
                  (cb (Widget_cb widget)))
              ;; (nvgResetTransform vg)
              ;; (nvgTranslate vg x y)
              ;; (nvgScale vg w h)
              (cb widget bounds)
              null)
            ;; otherwise recurse into the child widgets
            (let ((split (Widget_split widget)))
              ;; recurse into children
              (if (Widget_split_vertical_p widget)
                  ;; split vertically
                  (begin
                    (let ((sub_bounds:Rect* (zalloc)))
                      (tfill! sub_bounds
                              (tref bounds 0)
                              (tref bounds 1)
                              (tref bounds 2)
                              (floor (* split (tref bounds 3))))
                      (gui_render_subtree (Widget_left_child widget)
                                          sub_bounds))
                    (let ((sub_bounds:Rect* (zalloc)))
                      (tfill! sub_bounds
                              (tref bounds 0)
                              (floor (+ (tref bounds 1)
                                 (* split (tref bounds 3))))
                              (tref bounds 2)
                              (ceil (* (- 1. split) (tref bounds 3))))
                      (gui_render_subtree (Widget_right_child widget)
                                          sub_bounds)))
                  ;; split horizontally
                  (begin
                    (let ((sub_bounds:Rect* (zalloc)))
                      (tfill! sub_bounds
                              (tref bounds 0)
                              (tref bounds 1)
                              (floor (* split (tref bounds 2)))
                              (tref bounds 3))
                      (gui_render_subtree (Widget_left_child widget)
                                          sub_bounds))
                    (let ((sub_bounds:Rect* (zalloc)))
                      (tfill! sub_bounds
                              (floor (+ (tref bounds 0)
                                 (* split (tref bounds 2))))
                              (tref bounds 1)
                              (ceil (* (- 1. split) (tref bounds 2)))
                              (tref bounds 3))
                      (gui_render_subtree (Widget_right_child widget)
                                          sub_bounds)))))))))


Back to Index

Similar Entries

  • GUI_context    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • GUI_height    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • GUI_pixel_ratio    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • GUI_root    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • GUI_set_root    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • GUI_width    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • GUI_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • get_render_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_render_process_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_vg.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/drawtext.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/shadowmap.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/multilight.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/shaderlight.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/qr-code.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/spectrogram.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender3.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender2.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender1.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • gl_render    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender6.xtm
  • gui_add_widget    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_add_widget    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_click_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_draw_circle    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_draw_rect    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_draw_text_in_bounds    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_enter_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_find_leaf_inorder    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_find_leaf_postorder    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_find_leaf_preorder    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_find_next_id    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_find_parent    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_find_widget_with_id    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_inbounds_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_init    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_keypress_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_keyrelease_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_leave_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_left_click_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_mouse_x    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_mouse_y    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_render    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_render_loop    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_reset    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_right_click_p    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_set_default_theme    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_set_monokai_color_theme    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_set_monokai_opensans_theme    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_shutdown    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_validate    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • gui_window_size_callback    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • guint64_alloc    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glib.xtm
  • guint64_halloc    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glib.xtm
  • guint64_zalloc    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glib.xtm
  • guint_alloc    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glib.xtm
  • guint_halloc    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glib.xtm
  • guint_zalloc    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glib.xtm
  • ipc:bind-xtmrender-vars    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • post:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • post:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_vg.xtm
  • post:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • post:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/qr-code.xtm
  • postrender:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • prerender:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender3.xtm
  • prerender:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender2.xtm
  • prerender:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • prerender:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • prerender:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender6.xtm
  • render:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender3.xtm
  • render:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender2.xtm
  • render:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender1.xtm
  • render:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • render:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • render:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender6.xtm
  • trans:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluids_2d.xtm
  • trans:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • vector_gfx:XTMRENDERCB    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • xtm_render    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_fbo    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_dof_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_light_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_quad_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_simple_bone_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_simple_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_skybox_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm