initial commit

main
Daniel Barlow 2022-12-19 18:19:13 +00:00
commit 38c71c347e
3 changed files with 120 additions and 0 deletions

15
dunlin.fnl Normal file
View File

@ -0,0 +1,15 @@
(local lgi (require :lgi))
(local { : Gtk : Gdk : WebKit2 : cairo } lgi)
(fn invoke-command [command]
)
(set _G.invoke-commad invoke-command)
(local pane (require :pane))
(pane.new)
(Gtk.main)

68
musing.md Normal file
View File

@ -0,0 +1,68 @@
what if ... a web browser, but tabs were more like emacs buffers?
buffer attributes:
- url
- viewport (this is a departure from the emacs buffer)
## commands
A command is a description of a function that may be invoked
interactively, and the parameters it expects.
```fennel
(define-command "visit-location"
visit-location
{:url Type.Url input-from-minibuffer})
;; hit "g" and then enter the location in the minibuffer
(bind-key "g" (command "visit-location"))
;; hit "h" to go straight to your home page
(bind-key "h" (command "visit-location")
{:url (Type.Url "https://home.example.com")})
;; left mouse click on minibuffer hit "h" to go straight to your home page
(bind-event Dunlin.minibuffer :button-1-click (command "visit-location"))
```
when it is run from the command prompt, each parameter is
prompted, with appropriate defaults.
when it is bound to a key chord/sequence, the binding may specify
where it gets its parameters from - otherise
visit-location
visit-location-in-new-buffer
run-command
back
switch-to-buffer
save-file
save-link
## objects/data types
buffer
Buffer.find ;; by name, title, url
Buffer.by_name (maybe?)
buffer has-a webview but it is not shown by default. Later we may
add some kind of webview reuse so that invisible and old buffers
don't need to have a webview until needed.
frame
Frame.the-frame
frame.set-buffer (buffer)
frame.get-buffer => buffer
frame.commander - text entry widget
frame.actions - container of toolbar buttons
location (url)
document
document element(?)
webview
lua's standard types
# getting started
gtk stuffz for frame/commander/initial buffer
command parser hooked to commander
visit-location command

37
pane.fnl Normal file
View File

@ -0,0 +1,37 @@
(local { : Gtk : Gdk : WebKit2 : cairo } (require :lgi))
(fn new-pane []
(let [hpad 2
vpad 2
window (Gtk.Window {
:title "Dunlin"
:default_width 800
:default_height 720
:on_destroy Gtk.main_quit
})
container (Gtk.Box {
:orientation Gtk.Orientation.VERTICAL
})
commander (Gtk.Entry {
:on_activate
(fn [event]
(_G.invoke-command event.text))
})
progress-bar (Gtk.ProgressBar {
:orientation Gtk.Orientation.HORIZONTAL
:fraction 1.0
:margin 0
})
contentwidget (Gtk.Button {
:label "paceholder"
})
]
(doto container
(: :pack_start commander false false vpad)
(: :pack_start progress-bar false false vpad)
(: :pack_start contentwidget true true vpad))
(window:add container)
(window:show_all)
window))
{ :new new-pane }