a5061ecec5
An effort was started some time ago to consolidate all internal documentation in the git tree. However, this was just an accumulation of files in various formats without any strucutre or way to browse it, which results in no one even knowing that we have docs here. This converts most of the files to restructuredtext and uses Sphinx to generate an HTML browsable user manual (with a table of content and a first attempt to put things in a global hierarchy). There are almost no changes to the documentation content in this commit (some obviously obsolete things were removed). The plan is to get the toolchain up and running to make these docs easily available, and only then see about improving the content. We can migrate some things off the wiki and website, and rework the table of contents to have some more hierarchy levels because currently it's a bit messy. Change-Id: I924ac9dc6e753887ab56f18a09bdb0a1e1793bfd Reviewed-on: https://review.haiku-os.org/c/haiku/+/4370 Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
66 lines
1.6 KiB
ReStructuredText
66 lines
1.6 KiB
ReStructuredText
PatternHandler class
|
|
####################
|
|
|
|
PatternHandler provides an easy way to integrate pattern support into
|
|
classes which require it, such as the DisplayDriver class.
|
|
|
|
|
|
Enumerated Types
|
|
================
|
|
|
|
pattern_enum
|
|
------------
|
|
|
|
- uint64 type64
|
|
- uint8 type8 [8]
|
|
|
|
Member Functions
|
|
================
|
|
|
|
PatternHandler()
|
|
----------------
|
|
|
|
|
|
1. Initialize internal RGBColor variables to black and white, respectively.
|
|
2. Set internal pattern to B_SOLID_HIGH (all 1's)
|
|
|
|
~PatternHandler()
|
|
-----------------
|
|
|
|
Empty
|
|
|
|
|
|
void SetTarget(int8 \*pattern)
|
|
------------------------------
|
|
|
|
Updates the pattern handler's pattern. It copies the pattern passed to
|
|
it, so it does NOT take responsibility for freeing any memory.
|
|
|
|
|
|
1. cast the passed pointer in such a way to copy it as a uint64 to the
|
|
pattern_enum.type64 member
|
|
|
|
void SetColors(RGBColor c1, RGBColor c2)
|
|
----------------------------------------
|
|
|
|
Sets the internal high and low colors for the pattern handler. These
|
|
will be the colors returned when GetColor() is called.
|
|
|
|
|
|
1. Assign c1 to high color and c2 to low color
|
|
|
|
|
|
RGBColor GetColor(BPoint pt) RGBColor GetColor (float x, float y)
|
|
-----------------------------------------------------------------
|
|
|
|
bool GetValue(BPoint pt) bool GetValue (float x, float y)
|
|
---------------------------------------------------------
|
|
|
|
GetColor returns the color in the pattern at the specified location.
|
|
GetValue returns true for the high color and false for the low color.
|
|
|
|
1. xpos = x % 8, ypos = y % 8 2) value = pointer [ ypos ] & ( 1 << (7 - xpos) )
|
|
2. GetValue: return (value==0)?false:true
|
|
3. GetColor: return (value==0)?lowcolor:highcolor
|
|
|