-
Notifications
You must be signed in to change notification settings - Fork 0
Code Map
Randall C. O'Reilly edited this page Jan 25, 2024
·
1 revision
This is an overview of where stuff is within the repository.
-
examples/widgets
-- main example widget gallery --go get ...
go build
in there to give it a try -- see README there for more info. Many other demos / tests inexamples/*
. -
node*.go
--NodeBase
,Node2DBase
,3D
structs and interfaces -- all Gi nodes are of this type. -
geom2d.go
--Vec2D
is main geom type used for 2D, plus transformMatrix2D
. -
paint.go
--Paint
struct that does all the direct rendering, usesgg
-based API but now uses thesrwiley/renderx
rendering system which supports SVG 2.0, and is very fast.-
stroke.go
,fill.go
--StrokeStyle
andFillStyle
structs for stroke, fill settings -
color.go
--ColorSpec
for full gradient support,Color
is basiccolor.Color
compatibale RGBA type with many additional useful methods, including support forHSL
colorspace -- see Wiki Color for more info.
-
-
style.go
--Style
and associated structs for CSS-basedWidget
styling. -
viewport2d.go
--Viewport2D
that has anImage.RGBA
thatPaint
renders onto. -
window.go
--Window
is the top-level window that manages an OS-specificoswin.Window
and handles the event loop.-
oswin
is a modified version of the back-end OS-specific code from Shiny: https://github.com/golang/exp/tree/master/shiny -- originally used https://github.com/skelterjohn/go.wde but shiny is much faster for updating the window because it is gl-based, and doesn't have any other dependencies (removed dependencies on mobile, changed the event structure to better fit needs here).
-
-
font.go
,text.go
--FontStyle
,TextStyle
, andTextRender
that manages rich-text rendering in a powerful, efficient manner (layered onRuneRender
andSpanRender
).FontStyle
contains the globalcolor
,background-color
, andopacity
values, to make these easily avail to theTextRender
logic. -
layout.go
-- mainLayout
object with various ways of arranging widget elements, andFrame
which does layout and renders a surrounding frame. -
widget.go
--WidgetBase
for all widgets. -
buttons.go
--ButtonBase
,Button
and other basic button types. -
action.go
--Action
is a Button-type used in menus and toolbars, with a simplifiedActionSig
signal. -
bars.go
--MenuBar
andToolBar
-
sliders.go
--SliderBase
,Slider
,ScrollBar
. -
textfield.go
forTextField
,label.go
forLabel
, etc -- also defines thegi.Labeler
interface andToLabel
converter method (which falls back on kit.ToString using Stringer), which is used for generating a gui-appropriate label for an object -- e.g., for reflect.Type it just presents the raw type name without prefix. -
icon.go
forIcon
wrapper around svg icons (insvg
sub-package) - Sub-packages:
-
svg
-- has all the SVG nodes (Path
,Rect
etc) plusio.go
parser -
giv
-- has all the*View
elements -
gimain
-- provides a meta-package wrapper to simplify imports formain
apps -- also does relevant final platform-specific customization -
units
-- CSS unit representation
-