Merge to XFA: Kill FX_DEFINEHANDLE
authorTom Sepez <tsepez@chromium.org>
Mon, 4 May 2015 22:18:56 +0000 (15:18 -0700)
committerTom Sepez <tsepez@chromium.org>
Mon, 4 May 2015 22:18:56 +0000 (15:18 -0700)
Original Review URL: https://codereview.chromium.org/1129433002

R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1122903002

core/include/fxcrt/fx_stream.h
core/include/fxcrt/fx_system.h
core/include/fxge/fpf.h
xfa/include/fxjse/fxjse.h
xfa/src/fxfa/src/common/xfa_fm2jsapi.h

index c23c71d..dc162f0 100644 (file)
@@ -16,7 +16,9 @@ FX_BOOL FX_GetNextFile(void* handle, CFX_ByteString& filename, FX_BOOL& bFolder)
 FX_BOOL FX_GetNextFile(void* handle, CFX_WideString& filename, FX_BOOL& bFolder);
 void FX_CloseFolder(void* handle);
 FX_WCHAR FX_GetFolderSeparator();
-FX_DEFINEHANDLE(FX_HFILE)
+typedef struct FX_HFILE_ {
+    FX_LPVOID pData;
+}* FX_HFILE;
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
 #define FX_FILESIZE                    FX_INT32
 #else
index d030bf7..ce86d5a 100644 (file)
@@ -110,7 +110,6 @@ typedef wchar_t*                            FX_LPWSTR;
 typedef wchar_t const*                 FX_LPCWSTR;
 typedef FX_DWORD                               FX_UINT32;
 typedef FX_UINT64                              FX_QWORD;
-#define FX_DEFINEHANDLE(name)  typedef struct _##name {FX_LPVOID pData;} * name;
 #if defined(DEBUG) && !defined(_DEBUG)
 #define _DEBUG
 #endif
index 28d028c..9fb38f8 100644 (file)
@@ -18,7 +18,9 @@ public:
 };
 IFPF_DeviceModule*     FPF_GetDeviceModule();
 #define FPF_MATCHFONT_REPLACEANSI              1
-FX_DEFINEHANDLE(FPF_HFONT);
+typedef struct FPF_HFONT_ {
+    FX_LPVOID pData;
+}* FPF_HFONT;
 class IFPF_Font
 {
 public:
index 0bd4434..aeec9af 100644 (file)
@@ -6,16 +6,22 @@
 \r
 #ifndef _FXJSE_H_\r
 #define _FXJSE_H_\r
-#ifdef __cplusplus\r
-#define FXJSE_DEFINEINHERITHANDLE(name, subtypename) typedef struct _##subtypename : public _##name {} * subtypename;\r
-#else\r
-#define FXJSE_DEFINEINHERITHANDLE(name, subtypename) typedef name subtypename;\r
-#endif\r
-FX_DEFINEHANDLE(FXJSE_HRUNTIME);\r
-FX_DEFINEHANDLE(FXJSE_HCONTEXT);\r
-FX_DEFINEHANDLE(FXJSE_HCLASS);\r
-FX_DEFINEHANDLE(FXJSE_HVALUE);\r
-FXJSE_DEFINEINHERITHANDLE(FXJSE_HVALUE, FXJSE_HOBJECT);\r
+\r
+typedef struct FXJSE_HRUNTIME_ {\r
+    FX_LPVOID pData;\r
+}* FXJSE_HRUNTIME;\r
+typedef struct FXJSE_HCONTEXT_ {\r
+    FX_LPVOID pData;\r
+}* FXJSE_HCONTEXT;\r
+typedef struct FXJSE_HCLASS_ {\r
+    FX_LPVOID pData;\r
+}* FXJSE_HCLASS;\r
+typedef struct FXJSE_HVALUE_ {\r
+    FX_LPVOID pData;\r
+}* FXJSE_HVALUE;\r
+typedef struct FXJSE_HOBJECT_ : public FXJSE_HVALUE_ {\r
+}* FXJSE_HOBJECT;\r
+\r
 typedef double FXJSE_DOUBLE;\r
 void FXJSE_Initialize();\r
 void FXJSE_Finalize();\r
index 499ceca..cdb4fe9 100644 (file)
@@ -11,7 +11,9 @@
 extern "C"\r
 {\r
 #endif\r
-FX_DEFINEHANDLE(XFA_HFM2JSCONTEXT)\r
+typedef struct XFA_HFM2JSCONTEXT_ {\r
+    FX_LPVOID* pData;\r
+}* XFA_HFM2JSCONTEXT;\r
 FX_INT32                       XFA_FM2JS_Translate(FX_WSTR wsFormcalc, CFX_WideTextBuf& wsJavascript, CFX_WideString& wsError);\r
 XFA_HFM2JSCONTEXT      XFA_FM2JS_ContextCreate();\r
 void                           XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext, FXJSE_HRUNTIME hScriptRuntime,\r