Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
TextImager.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Frameworks::Led {
6
7 /*
8 ********************************************************************************
9 ******************************** StandardTabStopList ***************************
10 ********************************************************************************
11 */
12 inline StandardTabStopList::StandardTabStopList ()
13 : TabStopList ()
14 , fDefaultTabWidth (720)
15 , // default to 1/2 inch - RTF spec default
16 fTabStops ()
17 {
18 Assert (fDefaultTabWidth > 0);
19 }
20 inline StandardTabStopList::StandardTabStopList (TWIPS eachWidth)
21 : TabStopList ()
22 , fDefaultTabWidth (eachWidth)
23 , fTabStops ()
24 {
25 Require (fDefaultTabWidth > 0);
26 }
27 inline StandardTabStopList::StandardTabStopList (const vector<TWIPS>& tabstops)
28 : TabStopList ()
29 , fDefaultTabWidth (720)
30 , // default to 1/2 inch - RTF spec default
31 fTabStops (tabstops)
32 {
33 Assert (fDefaultTabWidth > 0);
34 }
35 inline StandardTabStopList::StandardTabStopList (const vector<TWIPS>& tabstops, TWIPS afterTabsWidth)
36 : TabStopList ()
37 , fDefaultTabWidth (afterTabsWidth)
38 , fTabStops (tabstops)
39 {
40 Require (fDefaultTabWidth > 0);
41 }
42 inline TWIPS StandardTabStopList::ComputeIthTab (size_t i) const
43 {
44 TWIPS r = TWIPS (0);
45 size_t smallI = min (i + 1, fTabStops.size ());
46 for (size_t j = 0; j < smallI; ++j) {
47 r += fTabStops[j];
48 }
49 if (smallI <= i) {
50 r = TWIPS (static_cast<long> ((r / fDefaultTabWidth + (i - smallI + 1)) * fDefaultTabWidth));
51 }
52 return r;
53 }
54 inline TWIPS StandardTabStopList::ComputeTabStopAfterPosition (TWIPS afterPos) const
55 {
56 // Instead if walking all tabstops til we find the right one - GUESS where the right one is (division) and then
57 // walk back and forth if/as needed to narrow it down. This will guess perfectly if there are no user-defined tabstops.
58 size_t guessIdx = afterPos / fDefaultTabWidth;
59 TWIPS guessVal = ComputeIthTab (guessIdx);
60
61 // Go back first to assure we've gotten the FIRST one after 'afterPos' - not just 'A' tabstop after 'afterPos'.
62 while (guessIdx > 0 and guessVal > afterPos) {
63 Assert (guessIdx == 0 or ComputeIthTab (guessIdx - 1) < ComputeIthTab (guessIdx)); // assure monotonicly increasing so this will complete!
64 --guessIdx;
65 guessVal = ComputeIthTab (guessIdx);
66 }
67
68 // Now we've scanned to a good spot to start looking...
69 Assert (guessIdx == 0 or guessVal <= afterPos);
70 for (;; ++guessIdx) {
71 Assert (guessIdx == 0 or ComputeIthTab (guessIdx - 1) < ComputeIthTab (guessIdx)); // assure monotonicly increasing so this will complete!
72 TWIPS d = ComputeIthTab (guessIdx);
73 if (d > afterPos) {
74 return d;
75 }
76 }
78 return afterPos;
79 }
80 constexpr bool StandardTabStopList::operator== (const StandardTabStopList& rhs) const
81 {
82 return fDefaultTabWidth == rhs.fDefaultTabWidth and fTabStops == rhs.fTabStops;
83 }
84
85#if qStroika_Frameworks_Led_SupportGDI
86
87 /*
88 ********************************************************************************
89 ***************************** TextImager::SimpleTabStopList ********************
90 ********************************************************************************
91 */
92 inline TextImager::SimpleTabStopList::SimpleTabStopList (TWIPS twipsPerTabStop)
93 : TabStopList ()
94 , fTWIPSPerTabStop (twipsPerTabStop)
95 {
96 Require (twipsPerTabStop > 0);
97 }
98 inline TWIPS TextImager::SimpleTabStopList::ComputeIthTab (size_t i) const
99 {
100 return TWIPS (static_cast<long> ((i + 1) * fTWIPSPerTabStop));
101 }
102 inline TWIPS TextImager::SimpleTabStopList::ComputeTabStopAfterPosition (TWIPS afterPos) const
103 {
104 Assert (fTWIPSPerTabStop > 0);
105 size_t idx = afterPos / fTWIPSPerTabStop;
106 TWIPS result = TWIPS (static_cast<long> ((idx + 1) * fTWIPSPerTabStop));
107 Ensure (result % fTWIPSPerTabStop == 0);
108 Ensure (result > afterPos);
109 return result;
110 }
111
112 /*
113 ********************************************************************************
114 ****************** TextImager::GoalColumnRecomputerControlContext **************
115 ********************************************************************************
116 */
117 inline TextImager::GoalColumnRecomputerControlContext::GoalColumnRecomputerControlContext (TextImager& imager, bool suppressRecompute)
118 : fTextImager (imager)
119 , fSavedSuppressRecompute (imager.fSuppressGoalColumnRecompute)
120 {
121 imager.fSuppressGoalColumnRecompute = suppressRecompute;
122 }
123 inline TextImager::GoalColumnRecomputerControlContext::~GoalColumnRecomputerControlContext ()
124 {
125 fTextImager.fSuppressGoalColumnRecompute = fSavedSuppressRecompute;
126 }
127
128 /*
129 ********************************************************************************
130 ************************************** TextImager ******************************
131 ********************************************************************************
132 */
133 inline void TextImager::SetWindowRect_ (const Led_Rect& windowRect)
134 {
135 fWindowRect = windowRect;
136 }
137 /*
138 @METHOD: TextImager::GetForceAllRowsShowing
139 @DESCRIPTION: <p>Return the ForceAllRowsShowing flag. If this flag is true, then the TextImager
140 will never allow scrolling so that the last row doesn't reach the end of the buffer.
141 This is useful primarily for printing. Because otherwise, you would probably always want
142 to disable scrolling past the point where the last row is showing.</p>
143 <p>But thats a UI choice we allow you to make if you like (or if you have some other application
144 like printing where it makes sense).</p>
145 <p>Call @'TextImager::SetForceAllRowsShowing' () to set the value.</p>
146 */
147 inline bool TextImager::GetForceAllRowsShowing () const
148 {
149 return fForceAllRowsShowing;
150 }
151 /*
152 @METHOD: TextImager::SetForceAllRowsShowing
153 @DESCRIPTION: <p>See @'TextImager::GetForceAllRowsShowing'.</p>
154 */
155 inline void TextImager::SetForceAllRowsShowing (bool forceAllRowsShowing)
156 {
157 if (forceAllRowsShowing != fForceAllRowsShowing) {
158 fForceAllRowsShowing = forceAllRowsShowing;
159 AssureWholeWindowUsedIfNeeded ();
160 }
161 }
162 /*
163 @METHOD: TextImager::GetImageUsingOffscreenBitmaps
164 @DESCRIPTION: <p>Led already has very little flicker. This is because we are very careful to
165 draw as little as possible, and to draw quickly. But some cases still exist.
166 Like large pictures being drawn are flicker, cuz we must erase the bounds and then
167 draw the picture.</p>
168 <p>Using this gets rid of these few cases of flicker, but at a small performance cost
169 in overall draw speed.</p>
170 <p>This value defaults to true (temporarily defaulting to @'qUseOffscreenBitmapsToReduceFlicker).</p>
171 <p>See @'TextImager::SetImageUsingOffscreenBitmaps'.</p>
172 */
173 inline bool TextImager::GetImageUsingOffscreenBitmaps () const
174 {
175 return fImageUsingOffscreenBitmaps;
176 }
177 /*
178 @METHOD: TextImager::SetImageUsingOffscreenBitmaps
179 @DESCRIPTION: <p>See @'TextImager::GetForceAllRowsShowing'.</p>
180 */
181 inline void TextImager::SetImageUsingOffscreenBitmaps (bool imageUsingOffscreenBitmaps)
182 {
183 if (imageUsingOffscreenBitmaps != fImageUsingOffscreenBitmaps) {
184 fImageUsingOffscreenBitmaps = imageUsingOffscreenBitmaps;
185 // add some hook function in the future if there is a need for subclasses to know this has changed...
186 }
187 }
188 /*
189 @METHOD: TextImager::GetHScrollPos
190 @DESCRIPTION: <p>Returns the horizontal offset the image is scrolled to. If this is zero, then
191 no horizontal scrolling has taken place. Call @'TextImager::SetHScrollPos ()' to set where you have
192 horizontally scrolled to.</p>
193 */
194 inline CoordinateType TextImager::GetHScrollPos () const
195 {
196 return (fHScrollPos);
197 }
198 inline void TextImager::SetHScrollPos_ (CoordinateType hScrollPos)
199 {
200 fHScrollPos = hScrollPos;
201 }
202 /*
203 @METHOD: TextImager::GetSelectionGoalColumn
204 @DESCRIPTION: <p></p>
205 */
206 inline TWIPS TextImager::GetSelectionGoalColumn () const
207 {
208 return (fSelectionGoalColumn);
209 }
210 /*
211 @METHOD: TextImager::SetSelectionGoalColumn
212 @DESCRIPTION: <p></p>
213 */
214 inline void TextImager::SetSelectionGoalColumn (TWIPS selectionGoalColumn)
215 {
216 fSelectionGoalColumn = selectionGoalColumn;
217 }
218 inline void TextImager::InvalidateScrollBarParameters ()
219 {
220 // typically you would OVERRIDE this to update your scrollbar position, and perhaps
221 // hilight state (if you have a scrollbar). Typically only used in TextInteractor subclasses.
222 }
223 /*
224 @METHOD: TextImager::GetUseSelectEOLBOLRowHilightStyle
225 @DESCRIPTION: <p>On MacOS - when you select a region of text which includes a newline - the visual display of selecting
226 the newline is that you 'invert' or 'hilight' all the way to the end of the following row and in the following
227 row all the way to the start of the next character. On Windows - you simply don't show the hilighting for the newline
228 (as in Notepad) or you display a very narrow empty character (as in WinWord XP).</p>
229 <p>I personally don't like this Windows style hilight display, and greatly prefer the MacOS style. Since
230 nobody has ever complained - the MacOS style will remain the default. But - since I was rewriting the
231 draw-hilgiht code anyhow (SPR#1207 etc), and I noted this would be easy - I now support both styles
232 in case someone prefers the more standard windows style.</p>
233 <p>See also @'TextImager::SetUseSelectEOLBOLRowHilightStyle'.</p>
234 */
235 inline bool TextImager::GetUseSelectEOLBOLRowHilightStyle () const
236 {
237 return fUseEOLBOLRowHilightStyle;
238 }
239 /*
240 @METHOD: TextImager::SetUseSelectEOLBOLRowHilightStyle
241 @DESCRIPTION: <p>See also @'TextImager::GetUseSelectEOLBOLRowHilightStyle'.</p>
242 */
243 inline void TextImager::SetUseSelectEOLBOLRowHilightStyle (bool useEOLBOLRowHilightStyle)
244 {
245 fUseEOLBOLRowHilightStyle = useEOLBOLRowHilightStyle;
246 }
247 inline bool TextImager::GetSelectionShown () const
248 {
249 return (fSelectionShown);
250 }
251 /*
252 @METHOD: TextImager::GetWindowRect
253 @DESCRIPTION: <p>Returns the WindowRect associated with this TextImager. The WindowRect is essentially two things. Its
254 origin specifies the offset mapping applied to all coordinate transformations before GDI output (and typically in TextInteractors
255 UI input). And its Size dictate the size of the current window, used for deciding how much to draw, and scrolling operations.</p>
256 <p>You can logically think of this - in Win32 SDK terminology - as the 'client rect'. In MacOS SDK terms, its close
257 to the 'portRect' - its the same if you presume you are already focused, or that your text
258 editor view takes up the entire window.</p>
259 <p>See @'TextImager' for more information about Windows/Scrolling. See also @'TextImager::SetWindowRect'.</p>
260 */
261 inline Led_Rect TextImager::GetWindowRect () const
262 {
263 return (fWindowRect);
264 }
265 /*
266 @METHOD: TextImager::GetDefaultFont
267 @DESCRIPTION: <p>Returns the default font used to image new text. The exact meaning and use of this
268 default font will depend some on the particular TextImager subclass you are using.</p>
269 */
270 inline FontSpecification TextImager::GetDefaultFont () const
271 {
272 return (fDefaultFont);
273 }
274 /*
275 @METHOD: TextImager::GetRowLength
276 @DESCRIPTION: <p>Returns the number of tChars within the given row (by row index). This method's use is discouraged
277 when word-wrapping is present, because it forces word-wrapping up to the given row # in the buffer.</p>
278 */
279 inline size_t TextImager::GetRowLength (size_t rowNumber) const
280 {
281 return (GetEndOfRow (rowNumber) - GetStartOfRow (rowNumber));
282 }
283 /*
284 @METHOD: TextImager::GetDefaultTextColor
285 @DESCRIPTION: <p>Returns the value of the given indexed color attribute. These colors values default to nullptr,
286 which means @'TextImager::GetEffectiveDefaultTextColor' will use the system default for each color value.</p>
287 <p>See also
288 <ul>
289 <li>@'TextImager::GetEffectiveDefaultTextColor'</li>
290 <li>@'TextImager::ClearDefaultTextColor'</li>
291 <li>@'TextImager::SetDefaultTextColor'</li>
292 </ul>
293 </p>
294 */
295 inline Color* TextImager::GetDefaultTextColor (DefaultColorIndex dci) const
296 {
297 Require (dci < eMaxDefaultColorIndex);
298 return fDefaultColorIndex[dci];
299 }
300 /*
301 @METHOD: TextImager::GetEffectiveDefaultTextColor
302 @DESCRIPTION: <p>Returns either the effective color corresponding to the given @'TextImager::DefaultColorIndex',
303 or its default value.</p>
304 <p>See also
305 <ul>
306 <li>@'TextImager::GetDefaultTextColor'</li>
307 <li>@'TextImager::ClearDefaultTextColor'</li>
308 <li>@'TextImager::SetDefaultTextColor'</li>
309 </ul>
310 </p>
311 */
312 inline Color TextImager::GetEffectiveDefaultTextColor (DefaultColorIndex dci) const
313 {
314 Require (dci < eMaxDefaultColorIndex);
315 if (fDefaultColorIndex[dci] == nullptr) {
316 switch (dci) {
317 case eDefaultTextColor:
318 return fDefaultFont.GetTextColor ();
319 case TextImager::eDefaultBackgroundColor:
320 return Led_GetTextBackgroundColor ();
321 case TextImager::eDefaultSelectedTextColor:
322 return Led_GetSelectedTextColor ();
323 case TextImager::eDefaultSelectedTextBackgroundColor:
324 return Led_GetSelectedTextBackgroundColor ();
325 default:
326 Assert (false); /*NOTREACHED*/
327 return Color::kBlack;
328 }
329 }
330 else {
331 return *fDefaultColorIndex[dci];
332 }
333 }
334 /*
335 @METHOD: TextImager::ClearDefaultTextColor
336 @DESCRIPTION: <p>Nulls out the given default color attribute, which means @'TextImager::GetEffectiveDefaultTextColor' will
337 use the system default for each color value.</p>
338 <p>See also
339 <ul>
340 <li>@'TextImager::GetDefaultTextColor'</li>
341 <li>@'TextImager::GetEffectiveDefaultTextColor'</li>
342 <li>@'TextImager::SetDefaultTextColor'</li>
343 </ul>
344 </p>
345 */
346 inline void TextImager::ClearDefaultTextColor (DefaultColorIndex dci)
347 {
348 Require (dci < eMaxDefaultColorIndex);
349 delete fDefaultColorIndex[dci];
350 fDefaultColorIndex[dci] = nullptr;
351 if (dci == eDefaultTextColor) {
352 fDefaultFont.SetTextColor (Led_GetTextColor ());
353 }
354 }
355 /*
356 @METHOD: TextImager::SetDefaultTextColor
357 @DESCRIPTION: <p>Sets the given indexed default text color attribute. The effect of this is to OVERRIDE the behavior
358 of @'TextImager::GetEffectiveDefaultTextColor'.</p>
359 <p>See also
360 <ul>
361 <li>@'TextImager::GetDefaultTextColor'</li>
362 <li>@'TextImager::GetEffectiveDefaultTextColor'</li>
363 <li>@'TextImager::ClearDefaultTextColor'</li>
364 </ul>
365 </p>
366 */
367 inline void TextImager::SetDefaultTextColor (DefaultColorIndex dci, const Color& textColor)
368 {
369 Require (dci < eMaxDefaultColorIndex);
370 ClearDefaultTextColor (dci);
371 if (dci == eDefaultTextColor) {
372 fDefaultFont.SetTextColor (textColor);
373 }
374 fDefaultColorIndex[dci] = new Color (textColor);
375 }
376 /*
377 @METHOD: TextImager::GetStartOfNextRowFromRowContainingPosition
378 @DESCRIPTION: <p>Returns the marker position of the start of the row following the row which contains the given marker position.
379 If the given marker position is already in the last row, then it returns the start of that last row. So the result could
380 posibly be less than the initial value.</p>
381 <p>The reason for this apparantly obscure API is that marker positions allow you to name rows in a way which doesn't involve
382 word-wrapping (row numbers would). And yet this code doesn't assume use of MultiRowTextImager, or any of its data structures (so
383 these APIs can be used in things like TextInteractor).</p>
384 */
385 inline size_t TextImager::GetStartOfNextRowFromRowContainingPosition (size_t charPosition) const
386 {
387 // Use startOfRow positions as 'tokens' for RowReferences...
388 size_t rowEnd = FindNextCharacter (GetEndOfRowContainingPosition (charPosition));
389 return GetStartOfRowContainingPosition (rowEnd);
390 }
391 /*
392 @METHOD: TextImager::GetStartOfPrevRowFromRowContainingPosition
393 @DESCRIPTION: <p>Returns the marker position of the start of the row preceeding the row
394 which contains the given marker position, or the beginning of the buffer, if none preceed it.</p>
395 <p>See the docs for @'TextImager::GetStartOfNextRowFromRowContainingPosition' for
396 insight into how to use this API.</p>
397 */
398 inline size_t TextImager::GetStartOfPrevRowFromRowContainingPosition (size_t charPosition) const
399 {
400 // Use startOfRow positions as 'tokens' for RowReferences...
401 size_t rowStart = GetStartOfRowContainingPosition (charPosition);
402 if (rowStart > 0) {
403 rowStart = GetStartOfRowContainingPosition (FindPreviousCharacter (rowStart));
404 }
405 return rowStart;
406 }
407
408 // class TextImager::FontCacheInfoUpdater
409 inline TextImager::FontCacheInfoUpdater::~FontCacheInfoUpdater ()
410 {
411#if qStroika_Foundation_Common_Platform_Windows
412 if (fRestoreObject != nullptr) {
413 Verify (::SelectObject (fTablet->m_hDC, fRestoreObject));
414 }
415 if (fRestoreAttribObject != nullptr) {
416 Verify (::SelectObject (fTablet->m_hAttribDC, fRestoreAttribObject));
417 }
418#endif
419 }
420 inline FontMetrics TextImager::FontCacheInfoUpdater::GetMetrics () const
421 {
422 return fImager->fCachedFontInfo;
423 }
424
425 // class TrivialImager<TEXTSTORE,IMAGER>
426 template <typename TEXTSTORE, typename IMAGER>
427 /*
428 @METHOD: TrivialImager<TEXTSTORE,IMAGER>::TrivialImager
429 @DESCRIPTION: <p>Two overloaded versions - one protected, and the other public. The protected one
430 does NOT call @'TrivialImager<TEXTSTORE,IMAGER>::SnagAttributesFromTablet' - so you must in your subclass.</p>
431 */
432 TrivialImager<TEXTSTORE, IMAGER>::TrivialImager (Tablet* t)
433 : IMAGER{}
434 , fTablet{t}
435 , fTextStore{}
436 , fBackgroundTransparent{false}
437 {
438 this->SpecifyTextStore (&fTextStore);
439 }
440 template <typename TEXTSTORE, typename IMAGER>
441 TrivialImager<TEXTSTORE, IMAGER>::TrivialImager (Tablet* t, Led_Rect bounds, const Led_tString& initialText)
442 : TrivialImager{t}
443 {
444 SnagAttributesFromTablet ();
445 this->SetWindowRect (bounds);
446 fTextStore.Replace (0, 0, initialText.c_str (), initialText.length ());
447 }
448 template <typename TEXTSTORE, typename IMAGER>
449 TrivialImager<TEXTSTORE, IMAGER>::~TrivialImager ()
450 {
451 this->SpecifyTextStore (nullptr);
452 }
453 template <typename TEXTSTORE, typename IMAGER>
454 void TrivialImager<TEXTSTORE, IMAGER>::Draw (bool printing)
455 {
456 Draw (this->GetWindowRect (), printing);
457 }
458 template <typename TEXTSTORE, typename IMAGER>
459 void TrivialImager<TEXTSTORE, IMAGER>::Draw (const Led_Rect& subsetToDraw, bool printing)
460 {
461 IMAGER::Draw (subsetToDraw, printing);
462 }
463 template <typename TEXTSTORE, typename IMAGER>
464 Tablet* TrivialImager<TEXTSTORE, IMAGER>::AcquireTablet () const
465 {
466 return fTablet;
467 }
468 template <typename TEXTSTORE, typename IMAGER>
469 void TrivialImager<TEXTSTORE, IMAGER>::ReleaseTablet (Tablet* /*tablet*/) const
470 {
471 }
472 template <typename TEXTSTORE, typename IMAGER>
473 void TrivialImager<TEXTSTORE, IMAGER>::EraseBackground (Tablet* tablet, const Led_Rect& subsetToDraw, bool printing)
474 {
475 if (not fBackgroundTransparent) {
476 inherited::EraseBackground (tablet, subsetToDraw, printing);
477 }
478 }
479 template <typename TEXTSTORE, typename IMAGER>
480 /*
481 @METHOD: TrivialImager<TEXTSTORE,IMAGER>::SnagAttributesFromTablet
482 @DESCRIPTION: <p>Snag font, background color etc, from the currently associated tablet.</p>
483 <p>Since this calls virtual methods of the imager (this) - it must be called in the final
484 CTOR (most specific type). Really it shouldnt need to be THE most specific - just enough specific to
485 get the right virtual methods called. But because of MSVC compiler bugs
486 (@'qCannotSafelyCallLotsOfComplexVirtMethodCallsInsideCTORDTOR')- its generally best to be THE final
487 CTOR.</p>
488 */
489 void TrivialImager<TEXTSTORE, IMAGER>::SnagAttributesFromTablet ()
490 {
491#if qStroika_Foundation_Common_Platform_MacOS
492// Should probably do something similar?
493#elif qStroika_Foundation_Common_Platform_Windows
494 HFONT hFont = (HFONT)::GetCurrentObject (fTablet->m_hAttribDC, OBJ_FONT);
495 Verify (hFont != nullptr);
496 LOGFONT lf;
497 Verify (::GetObject (hFont, sizeof (LOGFONT), &lf));
498 this->SetDefaultFont (FontSpecification (lf));
499 this->SetDefaultTextColor (TextImager::eDefaultBackgroundColor, Color (::GetBkColor (fTablet->m_hAttribDC)));
500 if (::GetBkMode (fTablet->m_hAttribDC) == TRANSPARENT) {
501 SetBackgroundTransparent (true);
502 }
503#endif
504 }
505 template <typename TEXTSTORE, typename IMAGER>
506 /*
507 @METHOD: TrivialImager<TEXTSTORE,IMAGER>::GetBackgroundColor
508 @DESCRIPTION: <p>See also @'TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundColor'.</p>
509 */
510 inline Color TrivialImager<TEXTSTORE, IMAGER>::GetBackgroundColor () const
511 {
512 return this->GetEffectiveDefaultTextColor (TextImager::eDefaultBackgroundColor);
513 }
514 template <typename TEXTSTORE, typename IMAGER>
515 /*
516 @METHOD: TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundColor
517 @DESCRIPTION: <p>Specifies the color the background of the imager will be drawn with.</p>
518 <p>See also @'TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundTransparent',
519 @'TrivialImager<TEXTSTORE,IMAGER>::GetBackgroundColor'.</p>
520 */
521 inline void TrivialImager<TEXTSTORE, IMAGER>::SetBackgroundColor (Color c)
522 {
523 this->SetDefaultTextColor (TextImager::eDefaultBackgroundColor, c);
524 }
525 template <typename TEXTSTORE, typename IMAGER>
526 /*
527 @METHOD: TrivialImager<TEXTSTORE,IMAGER>::GetBackgroundTransparent
528 @DESCRIPTION: <p>See also @'TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundTransparent'.</p>
529 */
530 inline bool TrivialImager<TEXTSTORE, IMAGER>::GetBackgroundTransparent () const
531 {
532 return fBackgroundTransparent;
533 }
534 template <typename TEXTSTORE, typename IMAGER>
535 /*
536 @METHOD: TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundTransparent
537 @DESCRIPTION: <p>Specifies that the given TrivialImager will (or will not) draw any background color. Use this if
538 you are drawing over an existing background which you don't want touched - you just want the TEXT imaged
539 and no 'erasing' to be done. When TRUE, it negates the effect of @'TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundColor'</p>
540 <p>This defaults to off (except if overriden by @'TrivialImager<TEXTSTORE,IMAGER>::SnagAttributesFromTablet' if your
541 Tablet*'s ::GetBkMode ()==TRANSPARENT)</p>
542 <p>See also @'TrivialImager<TEXTSTORE,IMAGER>::GetBackgroundTransparent',
543 @'TrivialImager<TEXTSTORE,IMAGER>::SetBackgroundColor'.</p>
544 */
545 inline void TrivialImager<TEXTSTORE, IMAGER>::SetBackgroundTransparent (bool transparent)
546 {
547 fBackgroundTransparent = transparent;
548 }
549#endif
550
551}
#define AssertNotReached()
Definition Assertions.h:355
#define Verify(c)
Definition Assertions.h:419