Documentation ¶
Overview ¶
Package gui is an abstraction layer for real GUI implementations. It defines the Events that can be passed from the GUI to the emulation code and also the Requests that can be made from the emulation code to the GUI. Implementations need to convert their specific signals and requests to and from these abstractions.
Index ¶
Constants ¶
const (
UnsupportedGuiFeature = "unsupported gui feature: %v"
)
Sentinal error returned if GUI does no support requested feature.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmulationState ¶ added in v0.7.1
type EmulationState int
EmulationState indicates to the GUI that the debugger is in a particular state.
const ( StatePaused EmulationState = iota StateRunning StateRewinding StateGotoCoords )
List of valid emulation states.
type Event ¶
type Event interface{}
Event represents all the different type of events that can occur in the gui
Events are the things that happen in the gui, as a result of user interaction, and sent over a registered event channel.
type EventDbgMouseButton ¶
type EventDbgMouseButton struct { Button MouseButton Down bool X int Y int HorizPos int Scanline int }
EventDbgMouseButton is the data that accompanies MouseEventMove events.
type EventKeyboard ¶
EventKeyboard is the data that accompanies EventKeyboard events.
type EventMouseButton ¶
type EventMouseButton struct { Button MouseButton Down bool }
EventMouseButton is the data that accompanies MouseEventMove events.
type EventMouseMotion ¶
EventMouseMotion is the data that accompanies MouseEventMove events.
type FeatureReq ¶
type FeatureReq string
FeatureReq is used to request the setting of a gui attribute eg. toggling the overlay.
const ( // visibility can be interpreted by the gui implementation in different // ways. at it's simplest it should set the visibility of the TV screen. ReqSetVisibility FeatureReq = "ReqSetVisibility" // bool ReqToggleVisibility FeatureReq = "ReqToggleVisibility" // none // notify GUI of emulation state. the GUI should use this to alter how // infomration, particularly the display of the PixelRenderer. ReqState FeatureReq = "ReqState" // EmulationState // the following requests should set or toggle visual elements of the debugger. ReqSetDbgColors FeatureReq = "ReqSetDbgColors" // bool ReqToggleDbgColors FeatureReq = "ReqToggleDbgColors" // none ReqSetCropping FeatureReq = "ReqSetCropping" // bool ReqToggleCropping FeatureReq = "ReqToggleCropping" // none ReqSetOverlay FeatureReq = "ReqSetOverlay" // bool ReqToggleOverlay FeatureReq = "ReqToggleOverlay" // none ReqCRTeffects FeatureReq = "ReqCRTeffects" // bool ReqSetScale FeatureReq = "ReqSetScale" // float ReqIncScale FeatureReq = "ReqIncScale" // none ReqDecScale FeatureReq = "ReqDecScale" // none // the add VCS request is used to associate the gui with an emulated VCS. // a debugger does not need to send this request if it already sends a // ReqAddDebugger request (which it should). ReqAddVCS FeatureReq = "ReqAddVCS" // *hardware.VCS // the add debugger request must be made by the debugger if debug access to // the the machine is required by the GUI. ReqAddDebugger FeatureReq = "ReqAddDebugger" // *debugger.Debugger // the event channel is used to by the GUI implementation to send // information back to the main program. the GUI may or may not be in its // own go routine but regardless, the event channel is used for this // purpose. ReqSetEventChan FeatureReq = "ReqSetEventChan" // chan gui.Event() // playmode is called whenever the play/debugger looper is changed. like // all other requests this may not do anything, depending on the GUI // specifics. ReqSetPlaymode FeatureReq = "ReqSetPlaymode" // bool // trigger a save preferences event. usually performed before gui is // destroyed or before some other destructive action. ReqSavePrefs FeatureReq = "ReqSavePrefs" // none // triggered when cartridge is being change. ReqChangingCartridge FeatureReq = "ReqChangingCartridge" // bool // special request for PlusROM cartridges. ReqPlusROMFirstInstallation FeatureReq = "ReqPlusROMFirstInstallation" // PlusROMFirstInstallation )
List of valid feature requests. argument must be of the type specified or else the interface{} type conversion will fail and the application will probably crash.
Note that, like the name suggests, these are requests, they may or may not be satisfied depending other conditions in the GUI.
type FeatureReqData ¶ added in v0.7.1
type FeatureReqData interface{}
FeatureReqData represents the information associated with a FeatureReq. See commentary for the defined FeatureReq values for the underlying type.
type GUI ¶
type GUI interface { // Send a request to set a GUI feature. SetFeature(request FeatureReq, args ...FeatureReqData) error // Same as SetFeature() but not waiting for the result. Useful in time // critical situations when you are absolutely sure there will be no // errors that need handling. SetFeatureNoError(request FeatureReq, args ...FeatureReqData) // Return current state of GUI feautre. GetFeature(request FeatureReq) (FeatureReqData, error) }
GUI defines the operations that can be performed on visual user interfaces.
type MouseButton ¶
type MouseButton int
MouseButton identifies the mouse button.
const ( MouseButtonNone MouseButton = iota MouseButtonLeft MouseButtonRight MouseButtonMiddle )
list of valid MouseButtonIDs.
type PlusROMFirstInstallation ¶ added in v0.7.1
PlusROMFirstInstallation is used to pass information to the GUI as part of the request.
type Stub ¶ added in v0.7.1
type Stub struct{}
func (Stub) GetFeature ¶ added in v0.7.1
func (s Stub) GetFeature(request FeatureReq) (FeatureReqData, error)
GetFeature implements the GUI interface.
func (Stub) SetFeature ¶ added in v0.7.1
func (s Stub) SetFeature(request FeatureReq, args ...FeatureReqData) error
SetFeature implements the GUI interface.
func (Stub) SetFeatureNoError ¶ added in v0.7.1
func (s Stub) SetFeatureNoError(request FeatureReq, args ...FeatureReqData)
SetFeatureNoError implements the GUI interface.
Directories ¶
Path | Synopsis |
---|---|
Package sdlaudio provides the Audio type.
|
Package sdlaudio provides the Audio type. |
This file is part of Gopher2600.
|
This file is part of Gopher2600. |
lazyvalues
Package lazyvalues is the method used by sdlimgui to read emulator data from the GUI thread.
|
Package lazyvalues is the method used by sdlimgui to read emulator data from the GUI thread. |