Documentation
¶
Overview ¶
Package ui provides the GTK4 presentation layer for the dumber browser.
Index ¶
- Constants
- func ErrMissingDependency(name string) error
- func RunWithArgs(ctx context.Context, deps *Dependencies) int
- type App
- func (a *App) CloseFindBar(ctx context.Context)
- func (a *App) FindNext(ctx context.Context)
- func (a *App) FindPrevious(ctx context.Context)
- func (a *App) GetSessionID() entity.SessionID
- func (a *App) GetTabList() *entity.TabList
- func (a *App) MainWindow() *window.MainWindow
- func (a *App) MarkDirty()
- func (a *App) Quit()
- func (a *App) Run(ctx context.Context, args []string) int
- func (a *App) SetOmniboxOnNavigate(fn func(url string))
- func (a *App) Tabs() *entity.TabList
- func (a *App) ToggleFindBar(ctx context.Context)
- func (a *App) ToggleOmnibox(ctx context.Context)
- func (a *App) ToggleSessionManager(ctx context.Context)
- func (a *App) UpdateOmniboxZoom(factor float64)
- type Dependencies
- type DependencyError
Constants ¶
const (
// AppID is the application identifier for GTK.
AppID = "com.github.bnema.dumber"
)
Variables ¶
This section is empty.
Functions ¶
func ErrMissingDependency ¶
ErrMissingDependency creates a new DependencyError.
func RunWithArgs ¶
func RunWithArgs(ctx context.Context, deps *Dependencies) int
RunWithArgs is a convenience function that creates and runs an App.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App wraps the GTK Application and manages the browser lifecycle.
func New ¶
func New(deps *Dependencies) (*App, error)
New creates a new App with the given dependencies.
func (*App) CloseFindBar ¶
CloseFindBar hides the find bar if visible.
func (*App) FindPrevious ¶
FindPrevious selects the previous match in the active find bar.
func (*App) GetSessionID ¶ added in v0.21.0
GetSessionID implements port.TabListProvider.
func (*App) GetTabList ¶ added in v0.21.0
GetTabList implements port.TabListProvider.
func (*App) MainWindow ¶
func (a *App) MainWindow() *window.MainWindow
MainWindow returns the main window.
func (*App) MarkDirty ¶ added in v0.21.0
func (a *App) MarkDirty()
MarkDirty signals that session state has changed and should be saved.
func (*App) SetOmniboxOnNavigate ¶
SetOmniboxOnNavigate implements OmniboxProvider. This is called to set the navigation callback on new omniboxes. Since omniboxes are created per-pane, we store the config with the callback.
func (*App) ToggleFindBar ¶
ToggleFindBar shows or hides the find bar in the active workspace view.
func (*App) ToggleOmnibox ¶
ToggleOmnibox implements OmniboxProvider. Toggles the omnibox visibility in the active workspace view.
func (*App) ToggleSessionManager ¶ added in v0.21.0
ToggleSessionManager shows or hides the session manager.
func (*App) UpdateOmniboxZoom ¶
UpdateOmniboxZoom implements OmniboxProvider. Updates the zoom indicator on the current omnibox if visible.
type Dependencies ¶
type Dependencies struct {
// Core context and configuration
Ctx context.Context
Config *config.Config
InitialURL string // URL to open on startup (optional)
RestoreSessionID string // Session ID to restore on startup (optional)
// Theme management
Theme *theme.Manager
// WebKit infrastructure
WebContext *webkit.WebKitContext
Pool *webkit.WebViewPool
Factory port.WebViewFactory
Settings *webkit.SettingsManager
Injector *webkit.ContentInjector
MessageRouter *webkit.MessageRouter
// Repositories
HistoryRepo repository.HistoryRepository
FavoriteRepo repository.FavoriteRepository
ZoomRepo repository.ZoomRepository
FilterRepo repository.ContentWhitelistRepository
// Use Cases
TabsUC *usecase.ManageTabsUseCase
PanesUC *usecase.ManagePanesUseCase
ZoomUC *usecase.ManageZoomUseCase
FavoritesUC *usecase.ManageFavoritesUseCase
HistoryUC *usecase.SearchHistoryUseCase
CopyURLUC *usecase.CopyURLUseCase
// Infrastructure Adapters
Clipboard port.Clipboard
FaviconService *favicon.Service
FilterManager *filtering.Manager
IdleInhibitor port.IdleInhibitor
// Session management
SessionStateRepo repository.SessionStateRepository
SessionRepo repository.SessionRepository
CurrentSessionID entity.SessionID
SnapshotUC *usecase.SnapshotSessionUseCase
// Update management
CheckUpdateUC *usecase.CheckUpdateUseCase
ApplyUpdateUC *usecase.ApplyUpdateUseCase
}
Dependencies holds all injected dependencies for the UI layer. This struct is created once at startup and passed to UI components.
func (*Dependencies) Validate ¶
func (d *Dependencies) Validate() error
Validate checks that all required dependencies are set.
type DependencyError ¶
type DependencyError struct {
Name string
}
DependencyError indicates a missing required dependency.
func (DependencyError) Error ¶
func (e DependencyError) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package adapter provides UI-layer adapters that bridge domain services to GTK.
|
Package adapter provides UI-layer adapters that bridge domain services to GTK. |
|
Package component provides UI components for the browser.
|
Package component provides UI components for the browser. |
|
Package focus provides focus state management and geometric navigation for panes.
|
Package focus provides focus state management and geometric navigation for panes. |
|
Package input provides keyboard event handling and modal input mode management.
|
Package input provides keyboard event handling and modal input mode management. |
|
Package layout provides GTK widget abstractions and layout management for the pane system.
|
Package layout provides GTK widget abstractions and layout management for the pane system. |
|
Package theme provides GTK CSS styling for UI components.
|
Package theme provides GTK CSS styling for UI components. |
|
Package window provides GTK window implementations.
|
Package window provides GTK window implementations. |