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

Side by Side Diff: xfa/fwl/lightwidget/cfwl_widget.cpp

Issue 1946213003: Remove CLASSHASH defines in favour of an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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
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 #include "xfa/fwl/lightwidget/cfwl_widget.h" 7 #include "xfa/fwl/lightwidget/cfwl_widget.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/core/cfwl_themetext.h" 10 #include "xfa/fwl/core/cfwl_themetext.h"
11 #include "xfa/fwl/core/fwl_noteimp.h" 11 #include "xfa/fwl/core/fwl_noteimp.h"
12 #include "xfa/fwl/core/fwl_noteimp.h" 12 #include "xfa/fwl/core/fwl_noteimp.h"
13 #include "xfa/fwl/core/fwl_widgetimp.h" 13 #include "xfa/fwl/core/fwl_widgetimp.h"
14 #include "xfa/fwl/core/fwl_widgetmgrimp.h" 14 #include "xfa/fwl/core/fwl_widgetmgrimp.h"
15 #include "xfa/fwl/core/ifwl_app.h" 15 #include "xfa/fwl/core/ifwl_app.h"
16 #include "xfa/fwl/core/ifwl_themeprovider.h" 16 #include "xfa/fwl/core/ifwl_themeprovider.h"
17 17
18 IFWL_Widget* CFWL_Widget::GetWidget() { 18 IFWL_Widget* CFWL_Widget::GetWidget() {
19 return m_pIface; 19 return m_pIface;
20 } 20 }
21 21
22 FWL_ERR CFWL_Widget::GetClassName(CFX_WideString& wsClass) const { 22 FWL_ERR CFWL_Widget::GetClassName(CFX_WideString& wsClass) const {
23 if (!m_pIface) 23 if (!m_pIface)
24 return FWL_ERR_Indefinite; 24 return FWL_ERR_Indefinite;
25 return m_pIface->GetClassName(wsClass); 25 return m_pIface->GetClassName(wsClass);
26 } 26 }
27 27
28 uint32_t CFWL_Widget::GetClassID() const { 28 FWL_Type CFWL_Widget::GetClassID() const {
29 if (!m_pIface) 29 if (!m_pIface)
30 return 0; 30 return FWL_Type::Unknown;
31 return m_pIface->GetClassID(); 31 return m_pIface->GetClassID();
32 } 32 }
33 33
34 FX_BOOL CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { 34 FX_BOOL CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const {
35 if (!m_pIface) 35 if (!m_pIface)
36 return FALSE; 36 return FALSE;
37 return m_pIface->IsInstance(wsClass); 37 return m_pIface->IsInstance(wsClass);
38 } 38 }
39 39
40 static void* gs_pFWLWidget = (void*)FXBSTR_ID('l', 'i', 'g', 't'); 40 static void* gs_pFWLWidget = (void*)FXBSTR_ID('l', 'i', 'g', 't');
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; 330 calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft;
331 CFX_RectF rect; 331 CFX_RectF rect;
332 FX_FLOAT fWidth = bMultiLine 332 FX_FLOAT fWidth = bMultiLine
333 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth 333 ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth
334 : FWL_WGT_CalcMultiLineDefWidth) 334 : FWL_WGT_CalcMultiLineDefWidth)
335 : FWL_WGT_CalcWidth; 335 : FWL_WGT_CalcWidth;
336 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight); 336 rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight);
337 pTheme->CalcTextRect(&calPart, rect); 337 pTheme->CalcTextRect(&calPart, rect);
338 return CFX_SizeF(rect.width, rect.height); 338 return CFX_SizeF(rect.width, rect.height);
339 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698