OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ | 7 #ifndef CORE_INCLUDE_FXGE_FX_GE_H_ |
8 #define CORE_INCLUDE_FXGE_FX_GE_H_ | 8 #define CORE_INCLUDE_FXGE_FX_GE_H_ |
9 | 9 |
10 #include "fx_dib.h" | 10 #include "fx_dib.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void SetPointCount(int nPoints); | 188 void SetPointCount(int nPoints); |
189 void AllocPointCount(int nPoints); | 189 void AllocPointCount(int nPoints); |
190 void AddPointCount(int addPoints); | 190 void AddPointCount(int addPoints); |
191 | 191 |
192 CFX_FloatRect GetBoundingBox() const; | 192 CFX_FloatRect GetBoundingBox() const; |
193 | 193 |
194 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT mit
er_limit) const; | 194 CFX_FloatRect GetBoundingBox(FX_FLOAT line_width, FX_FLOAT mit
er_limit) const; |
195 | 195 |
196 void Transform(const CFX_AffineMatrix* pMatri
x); | 196 void Transform(const CFX_AffineMatrix* pMatri
x); |
197 | 197 |
198 FX_BOOL» » » » IsRect() const; | 198 bool» » » » IsRect() const; |
199 | 199 |
200 FX_BOOL» » » » GetZeroAreaPath(CFX_PathData& NewPath, C
FX_AffineMatrix* pMatrix, FX_BOOL&bThin, FX_BOOL bAdjust) const; | 200 bool» » » » GetZeroAreaPath(CFX_PathData& NewPath, C
FX_AffineMatrix* pMatrix, bool&bThin, bool bAdjust) const; |
201 | 201 |
202 FX_BOOL» » » » IsRect(const CFX_AffineMatrix* pMatrix,
CFX_FloatRect* rect) const; | 202 bool» » » » IsRect(const CFX_AffineMatrix* pMatrix,
CFX_FloatRect* rect) const; |
203 | 203 |
204 void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); | 204 void Append(const CFX_PathData* pSrc, const CFX_AffineMatrix* pMatrix); |
205 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top
); | 205 void AppendRect(FX_FLOAT left, FX_FLOAT bottom, FX_FLOAT right, FX_FLOAT top
); |
206 | 206 |
207 void SetPoint(int index, FX_FLOAT x, FX_FLOAT
y, int flag); | 207 void SetPoint(int index, FX_FLOAT x, FX_FLOAT
y, int flag); |
208 | 208 |
209 void TrimPoints(int nPoints); | 209 void TrimPoints(int nPoints); |
210 | 210 |
211 void Copy(const CFX_PathData &src); | 211 void Copy(const CFX_PathData &src); |
212 protected: | 212 protected: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 #define FXTEXT_CLEARTYPE 0x01 | 289 #define FXTEXT_CLEARTYPE 0x01 |
290 #define FXTEXT_BGR_STRIPE 0x02 | 290 #define FXTEXT_BGR_STRIPE 0x02 |
291 #define FXTEXT_PRINTGRAPHICTEXT 0x04 | 291 #define FXTEXT_PRINTGRAPHICTEXT 0x04 |
292 #define FXTEXT_NO_NATIVETEXT 0x08 | 292 #define FXTEXT_NO_NATIVETEXT 0x08 |
293 #define FXTEXT_PRINTIMAGETEXT 0x10 | 293 #define FXTEXT_PRINTIMAGETEXT 0x10 |
294 #define FXTEXT_NOSMOOTH 0x20 | 294 #define FXTEXT_NOSMOOTH 0x20 |
295 typedef struct { | 295 typedef struct { |
296 FX_DWORD m_GlyphIndex; | 296 FX_DWORD m_GlyphIndex; |
297 FX_FLOAT m_OriginX, m_OriginY; | 297 FX_FLOAT m_OriginX, m_OriginY; |
298 int m_FontCharWidth; | 298 int m_FontCharWidth; |
299 FX_BOOL» » » » m_bGlyphAdjust; | 299 bool» » » » m_bGlyphAdjust; |
300 FX_FLOAT m_AdjustMatrix[4]; | 300 FX_FLOAT m_AdjustMatrix[4]; |
301 FX_DWORD m_ExtGID; | 301 FX_DWORD m_ExtGID; |
302 FX_BOOL» » » » m_bFontStyle; | 302 bool» » » » m_bFontStyle; |
303 } FXTEXT_CHARPOS; | 303 } FXTEXT_CHARPOS; |
304 class CFX_RenderDevice | 304 class CFX_RenderDevice |
305 { | 305 { |
306 public: | 306 public: |
307 CFX_RenderDevice(); | 307 CFX_RenderDevice(); |
308 | 308 |
309 virtual ~CFX_RenderDevice(); | 309 virtual ~CFX_RenderDevice(); |
310 | 310 |
311 void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver)
; | 311 void SetDeviceDriver(IFX_RenderDeviceDriver* pDriver)
; |
312 | 312 |
313 IFX_RenderDeviceDriver* GetDeviceDriver() const | 313 IFX_RenderDeviceDriver* GetDeviceDriver() const |
314 { | 314 { |
315 return m_pDeviceDriver; | 315 return m_pDeviceDriver; |
316 } | 316 } |
317 | 317 |
318 FX_BOOL» » » StartRendering(); | 318 bool» » » StartRendering(); |
319 | 319 |
320 void EndRendering(); | 320 void EndRendering(); |
321 | 321 |
322 | 322 |
323 | 323 |
324 void SaveState(); | 324 void SaveState(); |
325 | 325 |
326 void» » » RestoreState(FX_BOOL bKeepSaved = FALSE); | 326 void» » » RestoreState(bool bKeepSaved = false); |
327 | 327 |
328 | 328 |
329 | 329 |
330 | 330 |
331 int GetWidth() const | 331 int GetWidth() const |
332 { | 332 { |
333 return m_Width; | 333 return m_Width; |
334 } | 334 } |
335 | 335 |
336 int GetHeight() const | 336 int GetHeight() const |
(...skipping 23 matching lines...) Expand all Loading... |
360 | 360 |
361 CFX_DIBitmap* GetBitmap() const | 361 CFX_DIBitmap* GetBitmap() const |
362 { | 362 { |
363 return m_pBitmap; | 363 return m_pBitmap; |
364 } | 364 } |
365 void SetBitmap(CFX_DIBitmap* pBitmap) | 365 void SetBitmap(CFX_DIBitmap* pBitmap) |
366 { | 366 { |
367 m_pBitmap = pBitmap; | 367 m_pBitmap = pBitmap; |
368 } | 368 } |
369 | 369 |
370 FX_BOOL» » » CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int w
idth, int height) const; | 370 bool» » » CreateCompatibleBitmap(CFX_DIBitmap* pDIB, int w
idth, int height) const; |
371 | 371 |
372 const FX_RECT& GetClipBox() const | 372 const FX_RECT& GetClipBox() const |
373 { | 373 { |
374 return m_ClipBox; | 374 return m_ClipBox; |
375 } | 375 } |
376 | 376 |
377 FX_BOOL» » » SetClip_PathFill(const CFX_PathData* pPathData, | 377 bool» » » SetClip_PathFill(const CFX_PathData* pPathData, |
378 const CFX_AffineMatrix* pObject2Device, | 378 const CFX_AffineMatrix* pObject2Device, |
379 int fill_mode | 379 int fill_mode |
380 ); | 380 ); |
381 | 381 |
382 FX_BOOL» » » SetClip_Rect(const FX_RECT* pRect); | 382 bool» » » SetClip_Rect(const FX_RECT* pRect); |
383 | 383 |
384 FX_BOOL» » » SetClip_PathStroke(const CFX_PathData* pPathData
, | 384 bool» » » SetClip_PathStroke(const CFX_PathData* pPathData
, |
385 const CFX_AffineMatrix* pObject2Device, | 385 const CFX_AffineMatrix* pObject2Device, |
386 const CFX_GraphStateData* pGraphState | 386 const CFX_GraphStateData* pGraphState |
387 ); | 387 ); |
388 | 388 |
389 FX_BOOL» » » DrawPath(const CFX_PathData* pPathData, | 389 bool» » » DrawPath(const CFX_PathData* pPathData, |
390 const CFX_AffineMatrix* pObject2Device, | 390 const CFX_AffineMatrix* pObject2Device, |
391 const CFX_GraphStateData* pGraphState, | 391 const CFX_GraphStateData* pGraphState, |
392 FX_DWORD fill_color, | 392 FX_DWORD fill_color, |
393 FX_DWORD stroke_color, | 393 FX_DWORD stroke_color, |
394 int fill_mode, | 394 int fill_mode, |
395 int alpha_flag = 0, | 395 int alpha_flag = 0, |
396 void* pIccTransform = NULL, | 396 void* pIccTransform = NULL, |
397 int blend_type = FXDIB_BLEND_NORMAL | 397 int blend_type = FXDIB_BLEND_NORMAL |
398 ); | 398 ); |
399 | 399 |
400 FX_BOOL» » » SetPixel(int x, int y, FX_DWORD color, | 400 bool» » » SetPixel(int x, int y, FX_DWORD color, |
401 int alpha_flag = 0, void* pIccTransform = NULL); | 401 int alpha_flag = 0, void* pIccTransform = NULL); |
402 | 402 |
403 FX_BOOL» » » FillRect(const FX_RECT* pRect, FX_DWORD color, | 403 bool» » » FillRect(const FX_RECT* pRect, FX_DWORD color, |
404 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL); | 404 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL); |
405 | 405 |
406 FX_BOOL» » » DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FL
OAT x2, FX_FLOAT y2, FX_DWORD color, | 406 bool» » » DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FL
OAT x2, FX_FLOAT y2, FX_DWORD color, |
407 int fill_mode = 0, int alpha_flag = 0, void
* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); | 407 int fill_mode = 0, int alpha_flag = 0, void
* pIccTransform = NULL, int blend_type = FXDIB_BLEND_NORMAL); |
408 | 408 |
409 FX_BOOL» » » GetDIBits(CFX_DIBitmap* pBitmap, int left, int t
op, void* pIccTransform = NULL); | 409 bool» » » GetDIBits(CFX_DIBitmap* pBitmap, int left, int t
op, void* pIccTransform = NULL); |
410 | 410 |
411 CFX_DIBitmap* GetBackDrop(); | 411 CFX_DIBitmap* GetBackDrop(); |
412 | 412 |
413 FX_BOOL» » » SetDIBits(const CFX_DIBSource* pBitmap, int left
, int top, int blend_type = FXDIB_BLEND_NORMAL, | 413 bool» » » SetDIBits(const CFX_DIBSource* pBitmap, int left
, int top, int blend_type = FXDIB_BLEND_NORMAL, |
414 void* pIccTransform = NULL); | 414 void* pIccTransform = NULL); |
415 | 415 |
416 FX_BOOL» » » StretchDIBits(const CFX_DIBSource* pBitmap, int
left, int top, int dest_width, int dest_height, | 416 bool» » » StretchDIBits(const CFX_DIBSource* pBitmap, int
left, int top, int dest_width, int dest_height, |
417 FX_DWORD flags = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL); | 417 FX_DWORD flags = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL); |
418 | 418 |
419 FX_BOOL» » » SetBitMask(const CFX_DIBSource* pBitmap, int lef
t, int top, FX_DWORD color, | 419 bool» » » SetBitMask(const CFX_DIBSource* pBitmap, int lef
t, int top, FX_DWORD color, |
420 int alpha_flag = 0, void* pIccTransform = NULL); | 420 int alpha_flag = 0, void* pIccTransform = NULL); |
421 | 421 |
422 FX_BOOL» » » StretchBitMask(const CFX_DIBSource* pBitmap, int
left, int top, int dest_width, int dest_height, | 422 bool» » » StretchBitMask(const CFX_DIBSource* pBitmap, int
left, int top, int dest_width, int dest_height, |
423 FX_DWORD color, FX_DWORD flags = 0, int alpha
_flag = 0, void* pIccTransform = NULL); | 423 FX_DWORD color, FX_DWORD flags = 0, int alpha
_flag = 0, void* pIccTransform = NULL); |
424 | 424 |
425 FX_BOOL» » » StartDIBits(const CFX_DIBSource* pBitmap, int bi
tmap_alpha, FX_DWORD color, | 425 bool» » » StartDIBits(const CFX_DIBSource* pBitmap, int bi
tmap_alpha, FX_DWORD color, |
426 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, | 426 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, |
427 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL); | 427 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL); |
428 | 428 |
429 FX_BOOL» » » ContinueDIBits(void* handle, IFX_Pause* pPause); | 429 bool» » » ContinueDIBits(void* handle, IFX_Pause* pPause); |
430 | 430 |
431 void CancelDIBits(void* handle); | 431 void CancelDIBits(void* handle); |
432 | 432 |
433 FX_BOOL» » » DrawNormalText(int nChars, const FXTEXT_CHARPOS*
pCharPos, | 433 bool» » » DrawNormalText(int nChars, const FXTEXT_CHARPOS*
pCharPos, |
434 CFX_Font* pFont, CFX_FontCache* pCache, | 434 CFX_Font* pFont, CFX_FontCache* pCache, |
435 FX_FLOAT font_size, const CFX_AffineMatrix* p
Text2Device, | 435 FX_FLOAT font_size, const CFX_AffineMatrix* p
Text2Device, |
436 FX_DWORD fill_color, FX_DWORD text_flags, | 436 FX_DWORD fill_color, FX_DWORD text_flags, |
437 int alpha_flag = 0, void* pIccTransform = NUL
L); | 437 int alpha_flag = 0, void* pIccTransform = NUL
L); |
438 | 438 |
439 FX_BOOL» » » DrawTextPath(int nChars, const FXTEXT_CHARPOS* p
CharPos, | 439 bool» » » DrawTextPath(int nChars, const FXTEXT_CHARPOS* p
CharPos, |
440 CFX_Font* pFont, CFX_FontCache* pCache, | 440 CFX_Font* pFont, CFX_FontCache* pCache, |
441 FX_FLOAT font_size, const CFX_AffineMatrix* pTe
xt2User, | 441 FX_FLOAT font_size, const CFX_AffineMatrix* pTe
xt2User, |
442 const CFX_AffineMatrix* pUser2Device, const CFX
_GraphStateData* pGraphState, | 442 const CFX_AffineMatrix* pUser2Device, const CFX
_GraphStateData* pGraphState, |
443 FX_DWORD fill_color, FX_DWORD stroke_color, CFX
_PathData* pClippingPath, int nFlag = 0, | 443 FX_DWORD fill_color, FX_DWORD stroke_color, CFX
_PathData* pClippingPath, int nFlag = 0, |
444 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL); | 444 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL); |
445 virtual void Begin() {} | 445 virtual void Begin() {} |
446 virtual void End() {} | 446 virtual void End() {} |
447 private: | 447 private: |
448 | 448 |
449 CFX_DIBitmap* m_pBitmap; | 449 CFX_DIBitmap* m_pBitmap; |
(...skipping 22 matching lines...) Expand all Loading... |
472 void UpdateClipBox(); | 472 void UpdateClipBox(); |
473 }; | 473 }; |
474 class CFX_FxgeDevice : public CFX_RenderDevice | 474 class CFX_FxgeDevice : public CFX_RenderDevice |
475 { | 475 { |
476 public: | 476 public: |
477 | 477 |
478 CFX_FxgeDevice(); | 478 CFX_FxgeDevice(); |
479 | 479 |
480 ~CFX_FxgeDevice(); | 480 ~CFX_FxgeDevice(); |
481 | 481 |
482 FX_BOOL» » » Attach(CFX_DIBitmap* pBitmap, int dither_bits =
0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGrou
pKnockout = FALSE); | 482 bool» » » Attach(CFX_DIBitmap* pBitmap, int dither_bits =
0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnock
out = false); |
483 | 483 |
484 FX_BOOL» » » Create(int width, int height, FXDIB_Format forma
t, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); | 484 bool» » » Create(int width, int height, FXDIB_Format forma
t, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); |
485 protected: | 485 protected: |
486 | 486 |
487 FX_BOOL» » » m_bOwnedBitmap; | 487 bool» » » m_bOwnedBitmap; |
488 }; | 488 }; |
489 class CFX_SkiaDevice : public CFX_RenderDevice | 489 class CFX_SkiaDevice : public CFX_RenderDevice |
490 { | 490 { |
491 public: | 491 public: |
492 | 492 |
493 CFX_SkiaDevice(); | 493 CFX_SkiaDevice(); |
494 | 494 |
495 ~CFX_SkiaDevice(); | 495 ~CFX_SkiaDevice(); |
496 | 496 |
497 FX_BOOL» » » Attach(CFX_DIBitmap* pBitmap, int dither_bits =
0, FX_BOOL bRgbByteOrder = FALSE, CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGrou
pKnockout = FALSE); | 497 bool» » » Attach(CFX_DIBitmap* pBitmap, int dither_bits =
0, bool bRgbByteOrder = false, CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnock
out = false); |
498 | 498 |
499 FX_BOOL» » » Create(int width, int height, FXDIB_Format forma
t, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); | 499 bool» » » Create(int width, int height, FXDIB_Format forma
t, int dither_bits = 0, CFX_DIBitmap* pOriDevice = NULL); |
500 protected: | 500 protected: |
501 | 501 |
502 FX_BOOL» » » m_bOwnedBitmap; | 502 bool» » » m_bOwnedBitmap; |
503 }; | 503 }; |
504 class IFX_RenderDeviceDriver | 504 class IFX_RenderDeviceDriver |
505 { | 505 { |
506 public: | 506 public: |
507 | 507 |
508 static IFX_RenderDeviceDriver*» » CreateFxgeDriver(CFX_DIBitmap* p
Bitmap, FX_BOOL bRgbByteOrder = FALSE, | 508 static IFX_RenderDeviceDriver*» » CreateFxgeDriver(CFX_DIBitmap* p
Bitmap, bool bRgbByteOrder = false, |
509 CFX_DIBitmap* pOriDevice = NULL, FX_BOOL bGroupKnockout = FALSE); | 509 CFX_DIBitmap* pOriDevice = NULL, bool bGroupKnockout = false); |
510 | 510 |
511 virtual ~IFX_RenderDeviceDriver() {} | 511 virtual ~IFX_RenderDeviceDriver() {} |
512 virtual void Begin() { } | 512 virtual void Begin() { } |
513 virtual void End() { } | 513 virtual void End() { } |
514 | 514 |
515 virtual int GetDeviceCaps(int caps_id) = 0; | 515 virtual int GetDeviceCaps(int caps_id) = 0; |
516 | 516 |
517 virtual CFX_Matrix GetCTM() const | 517 virtual CFX_Matrix GetCTM() const |
518 { | 518 { |
519 return CFX_Matrix(); | 519 return CFX_Matrix(); |
520 } | 520 } |
521 | 521 |
522 virtual FX_BOOL IsPSPrintDriver() | 522 virtual bool IsPSPrintDriver() |
523 { | 523 { |
524 return FALSE; | 524 return false; |
525 } | 525 } |
526 | 526 |
527 virtual FX_BOOL» StartRendering() | 527 virtual bool» StartRendering() |
528 { | 528 { |
529 return TRUE; | 529 return true; |
530 } | 530 } |
531 | 531 |
532 virtual void EndRendering() {} | 532 virtual void EndRendering() {} |
533 | 533 |
534 | 534 |
535 | 535 |
536 | 536 |
537 virtual void SaveState() = 0; | 537 virtual void SaveState() = 0; |
538 | 538 |
539 virtual void» RestoreState(FX_BOOL bKeepSaved = FALSE) = 0; | 539 virtual void» RestoreState(bool bKeepSaved = false) = 0; |
540 | 540 |
541 | 541 |
542 virtual FX_BOOL» SetClip_PathFill(const CFX_PathData* pPathData, | 542 virtual bool» SetClip_PathFill(const CFX_PathData* pPathData, |
543 const CFX_AffineMatrix* pObject2Device, | 543 const CFX_AffineMatrix* pObject2Device, |
544 int fill_mode | 544 int fill_mode |
545 ) = 0; | 545 ) = 0; |
546 | 546 |
547 virtual FX_BOOL» SetClip_PathStroke(const CFX_PathData* pPathData, | 547 virtual bool» SetClip_PathStroke(const CFX_PathData* pPathData, |
548 const CFX_AffineMatrix* pObject2Device, | 548 const CFX_AffineMatrix* pObject2Device, |
549 const CFX_GraphStateData* pGraphState | 549 const CFX_GraphStateData* pGraphState |
550 ) | 550 ) |
551 { | 551 { |
552 return FALSE; | 552 return false; |
553 } | 553 } |
554 | 554 |
555 virtual FX_BOOL» DrawPath(const CFX_PathData* pPathData, | 555 virtual bool» DrawPath(const CFX_PathData* pPathData, |
556 const CFX_AffineMatrix* pObject2Device, | 556 const CFX_AffineMatrix* pObject2Device, |
557 const CFX_GraphStateData* pGraphState, | 557 const CFX_GraphStateData* pGraphState, |
558 FX_DWORD fill_color, | 558 FX_DWORD fill_color, |
559 FX_DWORD stroke_color, | 559 FX_DWORD stroke_color, |
560 int fill_mode, | 560 int fill_mode, |
561 int alpha_flag = 0, | 561 int alpha_flag = 0, |
562 void* pIccTransform = NULL, | 562 void* pIccTransform = NULL, |
563 int blend_type = FXDIB_BLEND_NORMAL | 563 int blend_type = FXDIB_BLEND_NORMAL |
564 ) = 0; | 564 ) = 0; |
565 | 565 |
566 virtual FX_BOOL» SetPixel(int x, int y, FX_DWORD color, | 566 virtual bool» SetPixel(int x, int y, FX_DWORD color, |
567 int alpha_flag = 0, void* pIccTransform = NULL) | 567 int alpha_flag = 0, void* pIccTransform = NULL) |
568 { | 568 { |
569 return FALSE; | 569 return false; |
570 } | 570 } |
571 | 571 |
572 virtual FX_BOOL FillRect(const FX_RECT* pRect, FX_DWORD fill_color, | 572 virtual bool FillRect(const FX_RECT* pRect, FX_DWORD fill_color, |
573 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL) | 573 int alpha_flag = 0, void* pIccTransform = NULL, int
blend_type = FXDIB_BLEND_NORMAL) |
574 { | 574 { |
575 return FALSE; | 575 return false; |
576 } | 576 } |
577 | 577 |
578 virtual FX_BOOL» DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2,
FX_FLOAT y2, FX_DWORD color, | 578 virtual bool» DrawCosmeticLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2,
FX_FLOAT y2, FX_DWORD color, |
579 int alpha_flag = 0, void* pIccTransform = N
ULL, int blend_type = FXDIB_BLEND_NORMAL) | 579 int alpha_flag = 0, void* pIccTransform = N
ULL, int blend_type = FXDIB_BLEND_NORMAL) |
580 { | 580 { |
581 return FALSE; | 581 return false; |
582 } | 582 } |
583 | 583 |
584 virtual FX_BOOL GetClipBox(FX_RECT* pRect) = 0; | 584 virtual bool GetClipBox(FX_RECT* pRect) = 0; |
585 | 585 |
586 virtual FX_BOOL» GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
* pIccTransform = NULL, FX_BOOL bDEdge = FALSE) | 586 virtual bool» GetDIBits(CFX_DIBitmap* pBitmap, int left, int top, void
* pIccTransform = NULL, bool bDEdge = false) |
587 { | 587 { |
588 return FALSE; | 588 return false; |
589 } | 589 } |
590 virtual CFX_DIBitmap* GetBackDrop() | 590 virtual CFX_DIBitmap* GetBackDrop() |
591 { | 591 { |
592 return NULL; | 592 return NULL; |
593 } | 593 } |
594 | 594 |
595 virtual FX_BOOL» SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
const FX_RECT* pSrcRect, | 595 virtual bool» SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD color,
const FX_RECT* pSrcRect, |
596 int dest_left, int dest_top, int blend_type, | 596 int dest_left, int dest_top, int blend_type, |
597 int alpha_flag = 0, void* pIccTransform = NULL) =
0; | 597 int alpha_flag = 0, void* pIccTransform = NULL) =
0; |
598 | 598 |
599 virtual FX_BOOL» StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD col
or, int dest_left, int dest_top, | 599 virtual bool» StretchDIBits(const CFX_DIBSource* pBitmap, FX_DWORD col
or, int dest_left, int dest_top, |
600 int dest_width, int dest_height, const FX_RECT
* pClipRect, FX_DWORD flags, | 600 int dest_width, int dest_height, const FX_RECT
* pClipRect, FX_DWORD flags, |
601 int alpha_flag = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL) = 0; | 601 int alpha_flag = 0, void* pIccTransform = NULL
, int blend_type = FXDIB_BLEND_NORMAL) = 0; |
602 | 602 |
603 virtual FX_BOOL» StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alp
ha, FX_DWORD color, | 603 virtual bool» StartDIBits(const CFX_DIBSource* pBitmap, int bitmap_alp
ha, FX_DWORD color, |
604 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, | 604 const CFX_AffineMatrix* pMatrix, FX_DWORD flags,
void*& handle, |
605 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL) = 0; | 605 int alpha_flag = 0, void* pIccTransform = NULL,
int blend_type = FXDIB_BLEND_NORMAL) = 0; |
606 | 606 |
607 virtual FX_BOOL» ContinueDIBits(void* handle, IFX_Pause* pPause) | 607 virtual bool» ContinueDIBits(void* handle, IFX_Pause* pPause) |
608 { | 608 { |
609 return FALSE; | 609 return false; |
610 } | 610 } |
611 | 611 |
612 virtual void CancelDIBits(void* handle) {} | 612 virtual void CancelDIBits(void* handle) {} |
613 | 613 |
614 virtual FX_BOOL DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, C
FX_Font* pFont, | 614 virtual bool DrawDeviceText(int nChars, const FXTEXT_CHARPOS* pCharPos, CFX_
Font* pFont, |
615 CFX_FontCache* pCache, const CFX_AffineMatrix
* pObject2Device, FX_FLOAT font_size, FX_DWORD color, | 615 CFX_FontCache* pCache, const CFX_AffineMatrix
* pObject2Device, FX_FLOAT font_size, FX_DWORD color, |
616 int alpha_flag = 0, void* pIccTransform = NUL
L) | 616 int alpha_flag = 0, void* pIccTransform = NUL
L) |
617 { | 617 { |
618 return FALSE; | 618 return false; |
619 } | 619 } |
620 | 620 |
621 virtual void* GetPlatformSurface() | 621 virtual void* GetPlatformSurface() |
622 { | 622 { |
623 return NULL; | 623 return NULL; |
624 } | 624 } |
625 | 625 |
626 virtual int GetDriverType() | 626 virtual int GetDriverType() |
627 { | 627 { |
628 return 0; | 628 return 0; |
(...skipping 12 matching lines...) Expand all Loading... |
641 }; | 641 }; |
642 class CPSFont; | 642 class CPSFont; |
643 class CFX_PSRenderer | 643 class CFX_PSRenderer |
644 { | 644 { |
645 public: | 645 public: |
646 | 646 |
647 CFX_PSRenderer(); | 647 CFX_PSRenderer(); |
648 | 648 |
649 ~CFX_PSRenderer(); | 649 ~CFX_PSRenderer(); |
650 | 650 |
651 void» » » Init(IFX_PSOutput* pOutput, int ps_level, int wi
dth, int height, FX_BOOL bCmykOutput); | 651 void» » » Init(IFX_PSOutput* pOutput, int ps_level, int wi
dth, int height, bool bCmykOutput); |
652 FX_BOOL» » » StartRendering(); | 652 bool» » » StartRendering(); |
653 void EndRendering(); | 653 void EndRendering(); |
654 | 654 |
655 void SaveState(); | 655 void SaveState(); |
656 | 656 |
657 void» » » RestoreState(FX_BOOL bKeepSaved = FALSE); | 657 void» » » RestoreState(bool bKeepSaved = false); |
658 | 658 |
659 void SetClip_PathFill(const CFX_PathData* pPathData, | 659 void SetClip_PathFill(const CFX_PathData* pPathData, |
660 const CFX_AffineMatrix* pObject2Device, | 660 const CFX_AffineMatrix* pObject2Device, |
661 int fill_mode | 661 int fill_mode |
662 ); | 662 ); |
663 | 663 |
664 void SetClip_PathStroke(const CFX_PathData* pPathData
, | 664 void SetClip_PathStroke(const CFX_PathData* pPathData
, |
665 const CFX_AffineMatrix* pObject2Device, | 665 const CFX_AffineMatrix* pObject2Device, |
666 const CFX_GraphStateData* pGraphState | 666 const CFX_GraphStateData* pGraphState |
667 ); | 667 ); |
668 | 668 |
669 FX_RECT GetClipBox() | 669 FX_RECT GetClipBox() |
670 { | 670 { |
671 return m_ClipBox; | 671 return m_ClipBox; |
672 } | 672 } |
673 | 673 |
674 FX_BOOL» » » DrawPath(const CFX_PathData* pPathData, | 674 bool» » » DrawPath(const CFX_PathData* pPathData, |
675 const CFX_AffineMatrix* pObject2Device, | 675 const CFX_AffineMatrix* pObject2Device, |
676 const CFX_GraphStateData* pGraphState, | 676 const CFX_GraphStateData* pGraphState, |
677 FX_DWORD fill_color, | 677 FX_DWORD fill_color, |
678 FX_DWORD stroke_color, | 678 FX_DWORD stroke_color, |
679 int fill_mode, | 679 int fill_mode, |
680 int alpha_flag = 0, | 680 int alpha_flag = 0, |
681 void* pIccTransform = NULL | 681 void* pIccTransform = NULL |
682 ); | 682 ); |
683 | 683 |
684 FX_BOOL» » » SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD
color, int dest_left, int dest_top, | 684 bool» » » SetDIBits(const CFX_DIBSource* pBitmap, FX_DWORD
color, int dest_left, int dest_top, |
685 int alpha_flag = 0, void* pIccTransform = NULL); | 685 int alpha_flag = 0, void* pIccTransform = NULL); |
686 | 686 |
687 FX_BOOL» » » StretchDIBits(const CFX_DIBSource* pBitmap, FX_D
WORD color, int dest_left, int dest_top, | 687 bool» » » StretchDIBits(const CFX_DIBSource* pBitmap, FX_D
WORD color, int dest_left, int dest_top, |
688 int dest_width, int dest_height, FX_DWORD flag
s, | 688 int dest_width, int dest_height, FX_DWORD flag
s, |
689 int alpha_flag = 0, void* pIccTransform = NULL
); | 689 int alpha_flag = 0, void* pIccTransform = NULL
); |
690 | 690 |
691 FX_BOOL» » » DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWOR
D color, | 691 bool» » » DrawDIBits(const CFX_DIBSource* pBitmap, FX_DWOR
D color, |
692 const CFX_AffineMatrix* pMatrix, FX_DWORD flags, | 692 const CFX_AffineMatrix* pMatrix, FX_DWORD flags, |
693 int alpha_flag = 0, void* pIccTransform = NULL); | 693 int alpha_flag = 0, void* pIccTransform = NULL); |
694 | 694 |
695 FX_BOOL» » » DrawText(int nChars, const FXTEXT_CHARPOS* pChar
Pos, CFX_Font* pFont, CFX_FontCache* pCache, | 695 bool» » » DrawText(int nChars, const FXTEXT_CHARPOS* pChar
Pos, CFX_Font* pFont, CFX_FontCache* pCache, |
696 const CFX_AffineMatrix* pObject2Device, FX_FLOAT fo
nt_size, FX_DWORD color, | 696 const CFX_AffineMatrix* pObject2Device, FX_FLOAT fo
nt_size, FX_DWORD color, |
697 int alpha_flag = 0, void* pIccTransform = NULL); | 697 int alpha_flag = 0, void* pIccTransform = NULL); |
698 private: | 698 private: |
699 | 699 |
700 IFX_PSOutput* m_pOutput; | 700 IFX_PSOutput* m_pOutput; |
701 | 701 |
702 int m_PSLevel; | 702 int m_PSLevel; |
703 | 703 |
704 CFX_GraphStateData m_CurGraphState; | 704 CFX_GraphStateData m_CurGraphState; |
705 | 705 |
706 FX_BOOL» » » m_bGraphStateSet; | 706 bool» » » m_bGraphStateSet; |
707 | 707 |
708 FX_BOOL» » » m_bCmykOutput; | 708 bool» » » m_bCmykOutput; |
709 | 709 |
710 FX_BOOL» » » m_bColorSet; | 710 bool» » » m_bColorSet; |
711 | 711 |
712 FX_DWORD m_LastColor; | 712 FX_DWORD m_LastColor; |
713 | 713 |
714 FX_RECT m_ClipBox; | 714 FX_RECT m_ClipBox; |
715 | 715 |
716 CFX_ArrayTemplate<CPSFont*> m_PSFontList; | 716 CFX_ArrayTemplate<CPSFont*> m_PSFontList; |
717 | 717 |
718 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; | 718 CFX_ArrayTemplate<FX_RECT> m_ClipBoxStack; |
719 FX_BOOL» » » m_bInited; | 719 bool» » » m_bInited; |
720 | 720 |
721 void OutputPath(const CFX_PathData* pPathData, const
CFX_AffineMatrix* pObject2Device); | 721 void OutputPath(const CFX_PathData* pPathData, const
CFX_AffineMatrix* pObject2Device); |
722 | 722 |
723 void SetGraphState(const CFX_GraphStateData* pGraphSt
ate); | 723 void SetGraphState(const CFX_GraphStateData* pGraphSt
ate); |
724 | 724 |
725 void SetColor(FX_DWORD color, int alpha_flag, void* p
IccTransform); | 725 void SetColor(FX_DWORD color, int alpha_flag, void* p
IccTransform); |
726 | 726 |
727 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_F
ont* pFont, const FXTEXT_CHARPOS& charpos, int& ps_fontnum, int &ps_glyphindex); | 727 void FindPSFontGlyph(CFX_FaceCache* pFaceCache, CFX_F
ont* pFont, const FXTEXT_CHARPOS& charpos, int& ps_fontnum, int &ps_glyphindex); |
728 | 728 |
729 void WritePSBinary(const uint8_t* data, int len); | 729 void WritePSBinary(const uint8_t* data, int len); |
730 }; | 730 }; |
731 | 731 |
732 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ | 732 #endif // CORE_INCLUDE_FXGE_FX_GE_H_ |
OLD | NEW |