Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Side by Side Diff: fpdfsdk/include/pdfwindow/PWL_Wnd.h

Issue 1737593006: Re-land "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Ooops. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/include/pdfwindow/PWL_Utils.h ('k') | fpdfsdk/src/formfiller/FFL_CheckBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_ 7 #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_
8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_ 8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 sTextStrokeColor(), 221 sTextStrokeColor(),
222 nTransparency(255), 222 nTransparency(255),
223 fFontSize(PWL_DEFAULT_FONTSIZE), 223 fFontSize(PWL_DEFAULT_FONTSIZE),
224 sDash(3, 0, 0), 224 sDash(3, 0, 0),
225 pAttachedData(NULL), 225 pAttachedData(NULL),
226 pParentWnd(NULL), 226 pParentWnd(NULL),
227 pMsgControl(NULL), 227 pMsgControl(NULL),
228 eCursorType(FXCT_ARROW), 228 eCursorType(FXCT_ARROW),
229 mtChild(1, 0, 0, 1, 0, 0) {} 229 mtChild(1, 0, 0, 1, 0, 0) {}
230 230
231 CPDF_Rect rcRectWnd; // required 231 CFX_FloatRect rcRectWnd; // required
232 IFX_SystemHandler* pSystemHandler; // required 232 IFX_SystemHandler* pSystemHandler; // required
233 IFX_Edit_FontMap* pFontMap; // required for text window 233 IFX_Edit_FontMap* pFontMap; // required for text window
234 IPWL_Provider* pProvider; // required for self coordinate 234 IPWL_Provider* pProvider; // required for self coordinate
235 IPWL_FocusHandler* pFocusHandler; // optional 235 IPWL_FocusHandler* pFocusHandler; // optional
236 FX_DWORD dwFlags; // optional 236 FX_DWORD dwFlags; // optional
237 CPWL_Color sBackgroundColor; // optional 237 CPWL_Color sBackgroundColor; // optional
238 FX_HWND hAttachedWnd; // required for no-reader framework 238 FX_HWND hAttachedWnd; // required for no-reader framework
239 IPWL_SpellCheck* pSpellCheck; // required for spellchecking 239 IPWL_SpellCheck* pSpellCheck; // required for spellchecking
240 int32_t nBorderStyle; // optional 240 int32_t nBorderStyle; // optional
241 int32_t dwBorderWidth; // optional 241 int32_t dwBorderWidth; // optional
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 public: 287 public:
288 CPWL_Wnd(); 288 CPWL_Wnd();
289 ~CPWL_Wnd() override; 289 ~CPWL_Wnd() override;
290 290
291 void Create(const PWL_CREATEPARAM& cp); 291 void Create(const PWL_CREATEPARAM& cp);
292 virtual CFX_ByteString GetClassName() const; 292 virtual CFX_ByteString GetClassName() const;
293 void InvalidateFocusHandler(IPWL_FocusHandler* handler); 293 void InvalidateFocusHandler(IPWL_FocusHandler* handler);
294 void InvalidateProvider(IPWL_Provider* provider); 294 void InvalidateProvider(IPWL_Provider* provider);
295 void Destroy(); 295 void Destroy();
296 void Move(const CPDF_Rect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh); 296 void Move(const CFX_FloatRect& rcNew, FX_BOOL bReset, FX_BOOL bRefresh);
297 virtual void InvalidateRect(CPDF_Rect* pRect = NULL); 297 virtual void InvalidateRect(CFX_FloatRect* pRect = NULL);
298 298
299 void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device); 299 void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device);
300 300
301 virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); 301 virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag);
302 virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag); 302 virtual FX_BOOL OnKeyUp(FX_WORD nChar, FX_DWORD nFlag);
303 virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag); 303 virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag);
304 virtual FX_BOOL OnLButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag); 304 virtual FX_BOOL OnLButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag);
305 virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); 305 virtual FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
306 virtual FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag); 306 virtual FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
307 virtual FX_BOOL OnMButtonDblClk(const CPDF_Point& point, FX_DWORD nFlag); 307 virtual FX_BOOL OnMButtonDblClk(const CFX_FloatPoint& point, FX_DWORD nFlag);
308 virtual FX_BOOL OnMButtonDown(const CPDF_Point& point, FX_DWORD nFlag); 308 virtual FX_BOOL OnMButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
309 virtual FX_BOOL OnMButtonUp(const CPDF_Point& point, FX_DWORD nFlag); 309 virtual FX_BOOL OnMButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
310 virtual FX_BOOL OnRButtonDown(const CPDF_Point& point, FX_DWORD nFlag); 310 virtual FX_BOOL OnRButtonDown(const CFX_FloatPoint& point, FX_DWORD nFlag);
311 virtual FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag); 311 virtual FX_BOOL OnRButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag);
312 virtual FX_BOOL OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag); 312 virtual FX_BOOL OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag);
313 virtual FX_BOOL OnMouseWheel(short zDelta, 313 virtual FX_BOOL OnMouseWheel(short zDelta,
314 const CPDF_Point& point, 314 const CFX_FloatPoint& point,
315 FX_DWORD nFlag); 315 FX_DWORD nFlag);
316 316
317 virtual void SetFocus(); 317 virtual void SetFocus();
318 virtual void KillFocus(); 318 virtual void KillFocus();
319 void SetCapture(); 319 void SetCapture();
320 void ReleaseCapture(); 320 void ReleaseCapture();
321 321
322 virtual void OnNotify(CPWL_Wnd* pWnd, 322 virtual void OnNotify(CPWL_Wnd* pWnd,
323 FX_DWORD msg, 323 FX_DWORD msg,
324 intptr_t wParam = 0, 324 intptr_t wParam = 0,
325 intptr_t lParam = 0); 325 intptr_t lParam = 0);
326 virtual void SetTextColor(const CPWL_Color& color); 326 virtual void SetTextColor(const CPWL_Color& color);
327 virtual void SetTextStrokeColor(const CPWL_Color& color); 327 virtual void SetTextStrokeColor(const CPWL_Color& color);
328 virtual void SetVisible(FX_BOOL bVisible); 328 virtual void SetVisible(FX_BOOL bVisible);
329 329
330 virtual CPDF_Rect GetFocusRect() const; 330 virtual CFX_FloatRect GetFocusRect() const;
331 virtual CPWL_Color GetBackgroundColor() const; 331 virtual CPWL_Color GetBackgroundColor() const;
332 virtual CPWL_Color GetBorderColor() const; 332 virtual CPWL_Color GetBorderColor() const;
333 virtual CPWL_Color GetTextColor() const; 333 virtual CPWL_Color GetTextColor() const;
334 virtual CPWL_Color GetTextStrokeColor() const; 334 virtual CPWL_Color GetTextStrokeColor() const;
335 virtual FX_FLOAT GetFontSize() const; 335 virtual FX_FLOAT GetFontSize() const;
336 virtual int32_t GetInnerBorderWidth() const; 336 virtual int32_t GetInnerBorderWidth() const;
337 virtual CPWL_Color GetBorderLeftTopColor(int32_t nBorderStyle) const; 337 virtual CPWL_Color GetBorderLeftTopColor(int32_t nBorderStyle) const;
338 virtual CPWL_Color GetBorderRightBottomColor(int32_t nBorderStyle) const; 338 virtual CPWL_Color GetBorderRightBottomColor(int32_t nBorderStyle) const;
339 339
340 virtual void SetFontSize(FX_FLOAT fFontSize); 340 virtual void SetFontSize(FX_FLOAT fFontSize);
341 341
342 void SetBackgroundColor(const CPWL_Color& color); 342 void SetBackgroundColor(const CPWL_Color& color);
343 void SetClipRect(const CPDF_Rect& rect); 343 void SetClipRect(const CFX_FloatRect& rect);
344 void SetBorderStyle(int32_t eBorderStyle); 344 void SetBorderStyle(int32_t eBorderStyle);
345 345
346 virtual CPDF_Rect GetWindowRect() const; 346 virtual CFX_FloatRect GetWindowRect() const;
347 virtual CPDF_Rect GetClientRect() const; 347 virtual CFX_FloatRect GetClientRect() const;
348 CPDF_Point GetCenterPoint() const; 348 CFX_FloatPoint GetCenterPoint() const;
349 int32_t GetBorderWidth() const; 349 int32_t GetBorderWidth() const;
350 FX_BOOL IsVisible() const { return m_bVisible; } 350 FX_BOOL IsVisible() const { return m_bVisible; }
351 FX_BOOL HasFlag(FX_DWORD dwFlags) const; 351 FX_BOOL HasFlag(FX_DWORD dwFlags) const;
352 void AddFlag(FX_DWORD dwFlags); 352 void AddFlag(FX_DWORD dwFlags);
353 void RemoveFlag(FX_DWORD dwFlags); 353 void RemoveFlag(FX_DWORD dwFlags);
354 const CPDF_Rect& GetClipRect() const; 354 const CFX_FloatRect& GetClipRect() const;
355 CPWL_Wnd* GetParentWindow() const; 355 CPWL_Wnd* GetParentWindow() const;
356 int32_t GetBorderStyle() const; 356 int32_t GetBorderStyle() const;
357 const CPWL_Dash& GetBorderDash() const; 357 const CPWL_Dash& GetBorderDash() const;
358 void* GetAttachedData() const; 358 void* GetAttachedData() const;
359 359
360 FX_BOOL WndHitTest(const CPDF_Point& point) const; 360 FX_BOOL WndHitTest(const CFX_FloatPoint& point) const;
361 FX_BOOL ClientHitTest(const CPDF_Point& point) const; 361 FX_BOOL ClientHitTest(const CFX_FloatPoint& point) const;
362 FX_BOOL IsCaptureMouse() const; 362 FX_BOOL IsCaptureMouse() const;
363 363
364 const CPWL_Wnd* GetFocused() const; 364 const CPWL_Wnd* GetFocused() const;
365 FX_BOOL IsFocused() const; 365 FX_BOOL IsFocused() const;
366 FX_BOOL IsReadOnly() const; 366 FX_BOOL IsReadOnly() const;
367 CPWL_ScrollBar* GetVScrollBar() const; 367 CPWL_ScrollBar* GetVScrollBar() const;
368 368
369 IFX_Edit_FontMap* GetFontMap() const; 369 IFX_Edit_FontMap* GetFontMap() const;
370 IPWL_Provider* GetProvider() const; 370 IPWL_Provider* GetProvider() const;
371 IPWL_FocusHandler* GetFocusHandler() const; 371 IPWL_FocusHandler* GetFocusHandler() const;
372 372
373 int32_t GetTransparency(); 373 int32_t GetTransparency();
374 void SetTransparency(int32_t nTransparency); 374 void SetTransparency(int32_t nTransparency);
375 375
376 CFX_Matrix GetChildToRoot() const; 376 CFX_Matrix GetChildToRoot() const;
377 CFX_Matrix GetChildMatrix() const; 377 CFX_Matrix GetChildMatrix() const;
378 void SetChildMatrix(const CFX_Matrix& mt); 378 void SetChildMatrix(const CFX_Matrix& mt);
379 CFX_Matrix GetWindowMatrix() const; 379 CFX_Matrix GetWindowMatrix() const;
380 380
381 virtual CPDF_Point ChildToParent(const CPDF_Point& point) const; 381 virtual CFX_FloatPoint ChildToParent(const CFX_FloatPoint& point) const;
382 virtual CPDF_Rect ChildToParent(const CPDF_Rect& rect) const; 382 virtual CFX_FloatRect ChildToParent(const CFX_FloatRect& rect) const;
383 virtual CPDF_Point ParentToChild(const CPDF_Point& point) const; 383 virtual CFX_FloatPoint ParentToChild(const CFX_FloatPoint& point) const;
384 virtual CPDF_Rect ParentToChild(const CPDF_Rect& rect) const; 384 virtual CFX_FloatRect ParentToChild(const CFX_FloatRect& rect) const;
385 385
386 // those methods only implemented by listctrl item 386 // those methods only implemented by listctrl item
387 virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) { return 0; } 387 virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) { return 0; }
388 virtual FX_FLOAT GetItemLeftMargin() { return 0; } 388 virtual FX_FLOAT GetItemLeftMargin() { return 0; }
389 virtual FX_FLOAT GetItemRightMargin() { return 0; } 389 virtual FX_FLOAT GetItemRightMargin() { return 0; }
390 390
391 void EnableWindow(FX_BOOL bEnable); 391 void EnableWindow(FX_BOOL bEnable);
392 FX_BOOL IsEnabled(); 392 FX_BOOL IsEnabled();
393 virtual void SetCursor(); 393 virtual void SetCursor();
394 394
(...skipping 21 matching lines...) Expand all
416 416
417 virtual void OnEnabled(); 417 virtual void OnEnabled();
418 virtual void OnDisabled(); 418 virtual void OnDisabled();
419 419
420 void SetNotifyFlag(FX_BOOL bNotifying = TRUE) { m_bNotifying = bNotifying; } 420 void SetNotifyFlag(FX_BOOL bNotifying = TRUE) { m_bNotifying = bNotifying; }
421 421
422 FX_BOOL IsValid() const; 422 FX_BOOL IsValid() const;
423 const PWL_CREATEPARAM& GetCreationParam() const; 423 const PWL_CREATEPARAM& GetCreationParam() const;
424 FX_BOOL IsNotifying() const { return m_bNotifying; } 424 FX_BOOL IsNotifying() const { return m_bNotifying; }
425 425
426 void InvalidateRectMove(const CPDF_Rect& rcOld, const CPDF_Rect& rcNew); 426 void InvalidateRectMove(const CFX_FloatRect& rcOld,
427 const CFX_FloatRect& rcNew);
427 428
428 void PWLtoWnd(const CPDF_Point& point, int32_t& x, int32_t& y) const; 429 void PWLtoWnd(const CFX_FloatPoint& point, int32_t& x, int32_t& y) const;
429 FX_RECT PWLtoWnd(const CPDF_Rect& rect) const; 430 FX_RECT PWLtoWnd(const CFX_FloatRect& rect) const;
430 FX_HWND GetAttachedHWnd() const; 431 FX_HWND GetAttachedHWnd() const;
431 432
432 FX_BOOL IsWndCaptureMouse(const CPWL_Wnd* pWnd) const; 433 FX_BOOL IsWndCaptureMouse(const CPWL_Wnd* pWnd) const;
433 FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd* pWnd) const; 434 FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd* pWnd) const;
434 const CPWL_Wnd* GetRootWnd() const; 435 const CPWL_Wnd* GetRootWnd() const;
435 436
436 FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const; 437 FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const;
437 FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const; 438 FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const;
438 FX_BOOL IsALTpressed(FX_DWORD nFlag) const; 439 FX_BOOL IsALTpressed(FX_DWORD nFlag) const;
439 FX_BOOL IsINSERTpressed(FX_DWORD nFlag) const; 440 FX_BOOL IsINSERTpressed(FX_DWORD nFlag) const;
(...skipping 12 matching lines...) Expand all
452 CPWL_MsgControl* GetMsgControl() const; 453 CPWL_MsgControl* GetMsgControl() const;
453 454
454 protected: 455 protected:
455 CFX_ArrayTemplate<CPWL_Wnd*> m_aChildren; 456 CFX_ArrayTemplate<CPWL_Wnd*> m_aChildren;
456 457
457 private: 458 private:
458 PWL_CREATEPARAM m_sPrivateParam; 459 PWL_CREATEPARAM m_sPrivateParam;
459 460
460 CPWL_ScrollBar* m_pVScrollBar; 461 CPWL_ScrollBar* m_pVScrollBar;
461 462
462 CPDF_Rect m_rcWindow; 463 CFX_FloatRect m_rcWindow;
463 CPDF_Rect m_rcClip; 464 CFX_FloatRect m_rcClip;
464 465
465 FX_BOOL m_bCreated; 466 FX_BOOL m_bCreated;
466 FX_BOOL m_bVisible; 467 FX_BOOL m_bVisible;
467 FX_BOOL m_bNotifying; 468 FX_BOOL m_bNotifying;
468 FX_BOOL m_bEnabled; 469 FX_BOOL m_bEnabled;
469 }; 470 };
470 471
471 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_ 472 #endif // FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_
OLDNEW
« no previous file with comments | « fpdfsdk/include/pdfwindow/PWL_Utils.h ('k') | fpdfsdk/src/formfiller/FFL_CheckBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698