Led_Color
Led_Coordinate
Led_DIB
Led_Distance
Led_FontMetrics
Led_FontSpecification
Led_GDIGlobals
Led_GDI_Obj_Selector
Led_IncrementalFontSpecification
Led_Justification
Led_LineSpacing
Led_Pen
Led_Picture
Led_Point
Led_Rect
Led_Region
Led_Size
Led_TWIPS
Led_TWIPS_Point
Led_TabStopList
Led_Tablet
Led_Tablet_
Led_Tablet_::ClipNarrowAndRestore
Led_Win_Obj_Selector
ListStyle
OffscreenTablet
qWorkAroundWin95UNICODECharImagingBugs
qWorkAroundWin98UNICODECharImagingBugs
EnsureRectInRect
EnsureRectOnScreen
InsetRect
Led_CloneDIB
Led_CvtScreenPixelsFromTWIPSH
Led_CvtScreenPixelsFromTWIPSV
Led_CvtScreenPixelsToTWIPSH
Led_CvtScreenPixelsToTWIPSV
Led_GetDIBImageByteCount
Led_GetDIBImageSize
Graphix Library support. This code encapsulates access to underlying GDI for modularity sake. For historical reasons - as of Led 3.0 - there is still some direct access to underlying GDI in parts of Led but that will gradually (hopefully right after 3.0) be eliminated.
Also - no class library dependencies (ie no MFC dependencies). So we can build MFC-Free Win32 apps more easily.
Led_Color [public]
This class is a portable representation of a color. It can be constructed either from its basic RGB componets, or from the native color representations on a particular platform.
Led_Coordinate [public]
Led_Coordinate
is the signed
analog of Led_Distance
.
Led_Point
is a tuple of Led_Coordinates
s
(vertical and horizontal).
Led_DIB [public]
Led_DIB is a MS-Windows DIB (device independent bitmap) object. Much
like Led_Picture
, it has a host of accessor routines to get at its size, etc. But slightly
better than Led_Picture, Led_DIB can be rendered on the Mac without assuming any special
software (ie no analog to QT) is available. The downside is that I only support a few types
of DIBs, but I appear to have most that windows currently generates. And it wouldn't be
too hard to extend the code to support a few more types, if I knew what they were.
Led_Distance [public]
Led_Distance
is an unsigned type, specifying the distance (always non-negative)
between two graphics locations. Led_Size
is a tuple of Led_Distance
s
(vertical and horizontal).
Led_FontMetrics [public]
Led_FontMetrics
is a portable wrapper class on the Macintosh
FontInfo structure, or the Windows TEXTMETRIC structure. It provides
portable access to things like GetLineHeight (), and GetAscent (), etc...
Led_FontSpecification [public]
Led_FontSpecification
is a utility class which portably represents
a user font choice. This largely corresponds to the MS-Windows LOGFONT
structure
or the Macintosh txFace, txSize, txStyle
.
In addition to being a portable represenation of this information, it also contains handy wrapper accessors, and extra information like subscript, superscript, and font color.
See also, Led_IncrementalFontSpecification
Member Details |
---|
Retrieve the 'FontName' attribute of the given font specification. This name is a string, and corresponds to the font family name. See also |
Checks all the various font 'style' attributes, such as 'bold', or 'italic'. Returns true iff all of these styles are not set. See also |
See also |
Clears all 'style' attributes, such as 'bold', or 'italic'. See also |
Led_GDIGlobals [public]
Something of a hack version of GDI global variables. We want to keep certain GDI global variables computed ONCE, for speed reasons. And yet - if we get a certain windows message, we must refresh our cached global variables. The compromise is that all these globals are associated with this class, so that there is one place to call to refresh those globals.
Led_GDI_Obj_Selector [public]
Led_GDI_Obj_Selector
is a stack-based class designed to help
out selecting objects into a Led_Tablet (windows DC, grafport, etc).
The constructor takes a tablet, and object to select into it (HGDIObject, etc), and selects it into the tablet. It saves gthe results of the SelectObject calls (old values). And on its destructor, it restores the old values.
This is useful when you want to make sure that an object you've selected into a tablet (HDC) will be released, and restored to its original state through all paths through the code, including in the even of exceptions.
Led_IncrementalFontSpecification [public]
Led_IncrementalFontSpecification
is a simple subclass of
Led_FontSpecification
which adds a bool flag for each
font attribute indicating whether or not it is really specified.
With this, and the Led_FontSpecification::MergeIn method,
you can specify just one or two changes to a font record, pass them around,
and apply them to an existing font choice.
See also, Led_FontSpecification
Led_Justification [public]
Led defines several kinds of justification, but doesn't implement all of them.
These extra unimplemented enums are provided so you can more easily write code and read/write files etc which keep track of this information, and even show the styles in the UI. They just aren't reflected in how the text is drawn yet. That should come in the next major Led release.
Led_LineSpacing [public]
Support at least all the crazy formats/options in the Win32 PARAFORMAT2 structure, and the ill-documented RTF 1.5 SPEC \sl options.
Led_Pen [public]
Helper class to keep track of GDI information used for drawing. Very different implementations befween Mac and Windows.
Note - this class is used in conjunction with Led_GDI_Obj_Selector
.
Led_Picture [public]
Led_Picture
is a portable abstraction of a Macintosh Picture object.
It can be displayed both on windows, and on the Mac (on Windows, it is only displayed if Apples
QuickTime is installed). There are a bunch of routines (e.g Led_GetMacPictTop) which portable
allow access to the size of the picture (even on windows if QT not available). And there are
portable routines to draw the picture (again, with the windows QT caveat).
Led_Point [public]
Led_Rect [public]
Member Details |
---|
Retrieve bottom of rectangle. |
Asserts height is non-negative, and then returns height. |
Retrieve left of rectangle. |
Retrieve right of rectangle. |
Retrieve top of rectangle. |
Asserts width is non-negative, and then returns width. |
Returns true if either horizontal or vertical dimentions are less or equal to zero. |
No-argument constructor leaves object uninitialized (garbage data). |
Initialize with argument top, left, height, width. |
Intersects this rect with the argument rectangle. |
Led_Region [public]
Portable GDI abstraction for 'Region' object.
Led_Size [public]
Led_TWIPS [public]
Many distances are specified in Led in TWIPS - 1/20 of a printers point. This means - 1/1440 of an inch.
This size refers to the size when printed on a page. So it can be scaled - depnding on screen resolution.
Led will often save this internally - and scale it at the last minute to the resolution of the Led_Tablet
being printed on.
NB: This marks a change from Led 2.3 and earlier - where most distances were stored in pixels (still many are).
NB: declard as a class instead of a typedef so we get better type checking. Shouldn't affect sizes or code generation - I would hope!
Led_TWIPS_Point [public]
Led_TWIPS
units.
Led_TabStopList [public]
Even though WinSDK supports GetTabbedTextExtent/TabbedTextOut () - they do a bad job. In particular, they offer no (obvious) way to specify the tab origin for GetTabbedTextExtent(). This makes proper text display nearly impossible.
Also, the Mac provides NO tab support at all. Because of the Mac - we NEED to implement our own tab support. Given we are doing that anyhow, may as well use our portable support on both platforms.
For both calculating widths, and doing imaging, we follow essentially the same algorithm.
Led_Tablet [public]
A pointer to a Led_Tablet_
structure. These pointers are used throughout Led.
In versions of Led prior to Led 3.0 - this typedef refered directly to a Mac GrafPort or MFC CDC.
Now it refers to a structure which wraps those lower level concepts (and doesnt depend on MFC anymore).
Led_Tablet_ [public]
See also Led_Tablet
- since that is what Led tends to make use of directly.
This class is used to wrap a low level graphics drawing device. On Windows - this is an HDC. On the Mac - a GrafPtr (also CGrafPtr and GWorldPtr). On X-Windows - a drawable and display, and GC.
This class right now is a very thin wrapper on those drawing prodedures (mostly for backward compatability reasons. Eventually - it may do a better job of wrapping those concepts/APIs genericly.
Member Details |
---|
See also |
See also |
Utility routine to convert from logical coordinates (usually pixels) to TWIPS. See also |
Utility routine to convert from logical coordinates (usually pixels) to TWIPS. See also |
EraseBackground_SolidHelper () is simple helper function - usually called from subclasses which override
|
Draw the outline of the given region 'r' in color 'c'. |
Retrieve the ( |
HilightARectangle__SolidHelper () is simple helper function - usually called from subclasses which override
Note the backColor and foreColor are advisory - and maybe ignored if the GDI better supports (or the platform UI conventionally calls for) inverting the text via a simple XOR. |
Measure the widths of the given argument |
Scroll the given 'windowRect' by 'scrollVBy localical units. The area of the window exposed by this action is invalidated (so a later update event will fix it). |
Draw the given text (Led_tChars) to this tablet object, at the given logical coordinates. Use the given tabstop origin, and tabStopList object to compute where tabs go. Return the amountDrawn (number of pixels used by draw). (EXPLAIN CAREFULLY REQUIREMENTS ABOUT BUFSIZE of charLocations and handling of zero case and offset rules, handling of tabs, AND MUCH MORE etc) |
Led_Tablet_::ClipNarrowAndRestore [public]
Further narrow the existing clip region in the given tablet to the constructor. Then restore the clip region for the tablet to what it was when the contructor was called.
Led_Win_Obj_Selector [public]
Alias for newer Led_GDI_Obj_Selector
.
ListStyle [public]
Different styles of bullet / list markers for list items in the WordProcessor.
Numeric values come from RTF 1.5 Spec \levelnfc (except for eListStyle_None which is special)
OffscreenTablet [public]
An offscreen tablet is a helper object used to do offscreen imaging. This is useful in avoidance of flicker. Also, by encapsulating this procedure into a class, it becomes easier to add the functionality to several places in Led, yet with very different underlying implementations on each platform.
Member Details |
---|
Copy the bits which have been saved away into this offscreen tablet back to the original tablet specified in
|
Prepare the offscreen drawing environment for the given 'currentRowRect'. This can only be safely called
after the call to |
Prepare a new offscreen drawing environment given the starting basis 'originalTablet' (typically from a window). Later call |
qWorkAroundWin95UNICODECharImagingBugs [public]
Contrary to the MSDEV 50 online docs, many of the Win32 UNICODE versions of GDI functions don't work, or worse - only half-way work.
For example, GetTextExtentExPointW DOESN'T WORK AT ALL, TextOutW works pretty well, but draws underlines the wrong width...(for proportional fonts).
Turning this feature on makes the code work under Win95/Win98 and NT, but makes the NT code a little slower.
NB: This has NO EFFECT unless you have built for UNICODE (qLed_CharacterSet
== qUNICODE_CharacterSet).
Turn ON by default.
qWorkAroundWin98UNICODECharImagingBugs [public]
See qWorkAroundWin95UNICODECharImagingBugs.
This is very similar, but a strict subset of the problems in @qWorkAroundWin95UNICODECharImagingBugs'. In other words, some were fixed, and some weren't.
Turn ON by default.
Led_Rect EnsureRectInRect (const Led_Rect& r, Led_Rect enlosingR)
Utility routine to ensure the first rect is entirely enclosed in the second (enclosing) rectangle. Pin the edges so it fits.
Led_Rect EnsureRectOnScreen (Led_Rect& r)
Utility routine to ensure the first rect (typically used for a window) fits on the sceen.
Pin the edges so it fits. See also EnsureRectInRect
.
Led_Rect InsetRect (const Led_Rect& r, int vBy, int hBy)
Utility routine to convert shrink (if vBy/hBy posative), or expand (if negative) the given Led_Rect
.
NB: This routine pins the minimum output rect size (in each dimention) to be zero.
Led_DIB* Led_CloneDIB (const Led_DIB* dib)
Make a copy of the given Led_DIB
object using ::operator new (). Just use normal C++ ::operator delete ()
to destroy the result.
Led_CvtScreenPixelsFromTWIPSH [public]
Led_Coordinate Led_CvtScreenPixelsFromTWIPSH (Led_TWIPS from)
Utility routine to convert from TWIPS to logical coordinates (usually pixels).
See also Led_CvtScreenPixelsFromTWIPSV
.
Led_CvtScreenPixelsFromTWIPSV [public]
Led_Coordinate Led_CvtScreenPixelsFromTWIPSV (Led_TWIPS from)
Utility routine to convert from TWIPS to logical coordinates (usually pixels).
See also Led_CvtScreenPixelsFromTWIPSH
.
Led_CvtScreenPixelsToTWIPSH [public]
Led_TWIPS Led_CvtScreenPixelsToTWIPSH (Led_Coordinate from)
Utility routine to convert from logical coordinates (usually pixels) to TWIPS.
See also Led_CvtScreenPixelsToTWIPSV
.
Led_CvtScreenPixelsToTWIPSV [public]
Led_TWIPS Led_CvtScreenPixelsToTWIPSV (Led_Coordinate from)
Utility routine to convert from logical coordinates (usually pixels) to TWIPS.
See also Led_CvtScreenPixelsToTWIPSH
.
Led_GetDIBImageByteCount [public]
size_t Led_GetDIBImageByteCount (const Led_DIB* dib)
Return the size in bytes of the given argument DIB. DIBs are consequetive chunks of RAM.
Led_Size Led_GetDIBImageSize (const Led_DIB* dib)
Return the size in pixels of the given argument DIB