Custom Platform Support Development Kit  1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FCMMacros.h
Go to the documentation of this file.
1 /******************************************************************************
2 * ADOBE CONFIDENTIAL
3 * ___________________
4 *
5 * Copyright [2013] Adobe Systems Incorporated
6 * All Rights Reserved.
7 *
8 * NOTICE: All information contained herein is, and remains
9 * the property of Adobe Systems Incorporated and its suppliers,
10 * if any. The intellectual and technical concepts contained
11 * herein are proprietary to Adobe Systems Incorporated and its
12 * suppliers and are protected by all applicable intellectual
13 * property laws, including trade secret and copyright laws.
14 * Dissemination of this information or reproduction of this material
15 * is strictly forbidden unless prior written permission is obtained
16 * from Adobe Systems Incorporated.
17 ******************************************************************************/
18 
25 #ifndef FCM_MACROS_H_
26 #define FCM_MACROS_H_
27 
28 #include "FCMPreConfig.h"
29 
30 
31 /* -------------------------------------------------- Forward Decl */
32 
33 
34 /* -------------------------------------------------- Enums */
35 
36 
37 /* -------------------------------------------------- Macros / Constants */
38 
39 namespace FCM
40 {
46  #define FCM_VERSION_MAJOR 0x01
47 
48 
54  #define FCM_VERSION_MINOR 0x03
55 
56 
62  #define FCM_VERSION_MAINTENANCE 0x00
63 
64 
70  #define FCM_VERSION_BUILD 0x00
71 
72 
78  #define FCM_VERSION ((FCM_VERSION_MAJOR << 24) | (FCM_VERSION_MINOR << 16) | \
79  (FCM_VERSION_MAINTENANCE << 8) | (FCM_VERSION_BUILD))
80 
81 
88  #define DEFINE_FCMIID (name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
89  const FCMID name = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}
90 
91 
97  #define IID(ifx) IID_##ifx
98 
99 
105  #define _FCM_SIMPLEMAPENTRY ((_FCM_CREATORARGFUNC*)0)
106 
107 
108 
114  #define FORWARD_DECLARE_INTERFACE(ifx) \
115  class ifx; \
116  typedef ifx* P##ifx;
117 
118 
119 
125  #define BEGIN_DECLARE_INTERFACE_COMMON(ifx, iid) \
126  FORWARD_DECLARE_INTERFACE(ifx) \
127  const FCM::FCMIID IID_##ifx = (iid); \
128  using namespace FCM;
129 
130 
136  #define BEGIN_DECLARE_INTERFACE_INHERIT(ifx, iid, baseifx) \
137  BEGIN_DECLARE_INTERFACE_COMMON (ifx, iid) \
138  class ifx : public baseifx { public: inline static FCM::FCMIID GetIID() {return IID(ifx);}
139 
140 
141 
147  #define BEGIN_DECLARE_INTERFACE(ifx, iid) BEGIN_DECLARE_INTERFACE_INHERIT(ifx, iid, FCM::IFCMUnknown);
148 
149 
155  #define BEGIN_DECLARE_BASE_INTERFACE(ifx, iid) \
156  BEGIN_DECLARE_INTERFACE_COMMON (ifx, iid) \
157  class ifx { public: inline static FCM::FCMIID GetIID() {return IID(ifx);}
158 
159 
165  #define END_DECLARE_INTERFACE };
166 
167 
173  #if defined(__GNUC__)
174  #define _FCMCALL
175  #else
176  #define _FCMCALL __stdcall
177  #endif
178 
179 
185  #define FCM_ADDREF(intPtr) if(intPtr){(intPtr)->AddRef();}
186 
187 
193  #define FCM_RELEASE(intPtr) if(intPtr){(intPtr)->Release();(intPtr)=0;}
194 
195 
201  #define _FCM_PACKING 1
202 
203 
209  #define offsetofclass(base, derived) \
210  ((FCM::S_Int64)(static_cast<base*>((derived*)_FCM_PACKING))-_FCM_PACKING)
211 
212 
218  #define offsetofclasscustom(base,custom, derived) \
219  ((FCM::S_Int64)(static_cast<base*>((custom*)((derived*)_FCM_PACKING)))-_FCM_PACKING)
220 
221 
227  #define offsetofmem(m,s) \
228  (FCM::S_Int64)&(((s *)0)->m)
229 
230 
231 
237  #define BEGIN_INTERFACE_MAP(impl,implVersion) \
238  public: \
239  virtual FCM::PIFCMCallback GetCallback()=0; \
240  typedef impl _ClassImpl; \
241  static FCM::U_Int32 GetVersion(){ return (FCM::U_Int32)implVersion;} \
242  static FCM::FCMInterfaceMap* GetInterfaceMap() \
243  { static FCM::FCMInterfaceMap _pInterfaceMap [] ={ \
244  INTERFACE_ENTRY(IFCMUnknown)
245 
246 
253  #define BEGIN_MULTI_INTERFACE_MAP(impl,implVersion) \
254  public: \
255  virtual FCM::PIFCMCallback GetCallback()=0; \
256  typedef impl _ClassImpl; \
257  static FCM::U_Int32 GetVersion(){ return (FCM::U_Int32)implVersion;} \
258  static FCM::FCMInterfaceMap* GetInterfaceMap() \
259  { static FCM::FCMInterfaceMap _pInterfaceMap [] ={
260 
261 
267  #define INTERFACE_ENTRY(ifx) \
268  {IID(ifx),offsetofclass(ifx,_ClassImpl),_FCM_SIMPLEMAPENTRY},
269 
270 
277  #define INTERFACE_ENTRY_CUSTOM(ifx,custom) \
278  {IID(ifx),offsetofclasscustom(ifx,custom,_ClassImpl),_FCM_SIMPLEMAPENTRY},
279 
280 
286  #define INTERFACE_ENTRY_AGGREGATE(ifx, punk)\
287  {IID(ifx),offsetofmem(punk,_ClassImpl),_Delegate},
288 
289 
295  #define END_INTERFACE_MAP \
296  {FCM::FCMIID_NULL,0,_FCM_SIMPLEMAPENTRY}}; \
297  return _pInterfaceMap;}
298 
304  #define BEGIN_MODULE(usrModule) \
305  class usrModule : public FCM::FCMPluginModule {
306 
307 
313  #define BEGIN_CLASS_ENTRY \
314  public: \
315  FCM::Result init(FCM::PIFCMCallback pCallback) { FCM::Result res = FCMPluginModule::init(pCallback);
316 
317 
323  #define CLASS_ENTRY(clsid,ursClass) \
324  addClassEntry(clsid,&FCMClassFactory<ursClass>::GetFactory,&ursClass::GetInterfaceMap,ursClass::GetVersion());
325 
326 
332  #define END_CLASS_ENTRY return res; }
333 
334 
340  #define END_MODULE };
341 
342 
348  #if defined(__GNUC__)
349  #ifndef DllExport
350  #define DllExport __attribute__((visibility("default")))
351  #endif
352  #else
353  #ifndef DllExport
354  #define DllExport __declspec( dllexport )
355  #endif
356  #endif
357 
358 
364  #if defined( __FCM_INTERNAL_PLUGIN__)
365  #define FCMPLUGIN_IMP_EXP
366  #else
367  #define FCMPLUGIN_IMP_EXP DllExport
368  #endif //__FCM_INTERNAL_PLUGIN__
369 
370 };
371 
372 
373 /* -------------------------------------------------- Structs / Unions */
374 
375 
376 /* -------------------------------------------------- Class Decl */
377 
378 
379 /* -------------------------------------------------- Inline / Functions */
380 
381 
382 #include "FCMPostConfig.h"
383 
384 #endif //FCM_MACROS_H_
The definitions contained in this namespace define a framework called Flash Component Model (FCM)...
Definition: IGroup.h:36