/PseudoCode

Conceptual Overview

The drawing API centers around the Widget object, which represents a widget in the toolkit. The MnWidget object contains the required context information to allow the drawing routines to render the required interface element. Each of the basic widgets are represented with one paint function. Complex (composite) widgets take an extra parameter to determine which element ("part") of the widget is required to be drawn.

Each drawing function expects the basic parameters of widget, cairo context, state, flags, position and dimensions. The state and flags are per-function because complex widgets may not have the same state per part.

In addition to the drawing API, there are data functions to allow the toolkit to retrieve useful information about the widget that Monet handles, such as padding and colour values.

TODO: window frame styling.

Widget

Style Properties

These are properties that are read from the current theme. They are read-only in the API.

  • background color
  • foreground color
  • border color
  • hilight colour
  • padding

Context Properties

These are properties set by the toolkit. They provide the context information needed to query the theme.

  • parent
  • type
  • id
  • class

Drawing States

  • normal: The normal state of the widget
  • disabled: The widget is non-reactive
  • active: The user is currently interacting with the widget (e.g. pressed)
  • hover: The mouse pointer is over the widget

Drawing Flags

  • focus: The widget has keyboard focus
  • checked: The widget is a toggle and is "on"

Basic Widget Types

  • Button
  • Check button
  • Radio button
  • Single line entry
  • Multi line entry
  • Menu Window
  • Menu Item
  • Menu Bar
  • Expander
  • Toolbar Item
  • Separator
  • Resize Grip
  • Corner Grip
  • Selection
  • Tooltip

Complex Widgets

These are more complex widgets that require drawing in multiple stages.

A CompositeWidget object will contain a list of all sub-widgets. The toolkit will be able to query the position of the sub-widgets to determine the hit areas.

  • Scrollbar {stepper-up, stepper-down, stepper-left, stepper-right, slider, trough}
  • Combobox { entry, button }
  • Sliders { trough, slider }
  • Toolbar { handle, background, seperator, button }
  • Progress Bar { trough, indicator }
  • Spin Button { entry, up button, down button }
  • Treeview { border, column header, selection, (...) }

Basic Drawing Types

  • Shadow
  • Line
  • Arrow
  • Text (to allow for styling of disabled text)

Attic/GnomeArt/Monet/Api (last edited 2013-11-27 14:33:58 by WilliamJonMcCann)