fbcontrols/fbtool.h Source File

fbtool.h
Go to the documentation of this file.
1 #ifndef __FBTOOL_H__
2 #define __FBTOOL_H__
3 /**************************************************************************
4 Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6 
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12 
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16 
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25 
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
45 
48 #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 #include <fbcontrols/fbcontrols.h>
52 
53 #ifdef FBSDKUseNamespace
54 namespace FBSDKNamespace {;
55 #endif
56 
58 // FBTool
60 
66 #define FBRegisterTool( ClassName, Label, Description, IconFilename ) \
67  static HIObject RegisterTool##ClassName( HIObject pOwner,const char* pName,void * pData) \
68 {\
69  ClassName *Class = new ClassName( Label ); \
70  Class->mAllocated = true; \
71  if( Class->FBCreate() ) {\
72  return Class->GetHIObject(); \
73  } else { \
74  delete Class; \
75  return NULL; \
76  } \
77 } \
78  FBLibraryModule( ClassName ) \
79 { \
80  FBRegisterObject( ClassName,"UI/Tools",Label,Description,RegisterTool##ClassName, false, IconFilename );\
81 }
82 
87 #define FBToolDeclare( ClassName,Parent ) \
88  FBClassDeclare( ClassName,Parent ); \
89 public: \
90  ClassName(const char *pName=NULL):Parent(pName) { FBClassInit; } \
91 private:
92 
96 #define FBToolImplementation( ThisComponent ) \
97  FBClassImplementation( ThisComponent )
98 
99 FB_FORWARD( FBFbxObject );
100 __FB_FORWARD( FBTool );
101 
103 {
109 };
110 
112 class FBSDK_DLL FBTool : public FBLayout {
113  __FBClassDeclare( FBTool,FBLayout );
114 public:
118  FBTool(const char* pName = NULL);
119 
124  FBTool(const char* pName, bool pRegisterTool);
125 
129  virtual void Destroy(int pIsLocal);
131 
135  virtual bool FbxStore ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
136  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
138 
142  FBToolPossibleDockPosition GetPossibleDockPosition();
143 
147  void SetPossibleDockPosition(FBToolPossibleDockPosition pFlags);
148 
149  IQuery_Declare(K_IMPLEMENTATION); // Interface to IObject.
150 
151  FBPropertyInt StartSize [2];
152  FBPropertyInt MaxSize [2];
153  FBPropertyInt MinSize [2];
154  FBPropertyInt StartPos [2];
155  FBPropertyString Name;
156 private:
157 
158  void InitTool();
159 };
160 
166 FBSDK_DLL bool FBPopNormalTool( const char* pToolName, bool pSetFocus = true );
167 
173 FBSDK_DLL FBTool* FBShowToolByName( const char* pToolName, bool pResizeWnd = true );
174 
180 FBSDK_DLL FBTool* FBShowTool( FBTool* pTool, bool pResizeWnd = true );
181 
186 FBSDK_DLL bool FBCloseToolByName( const char* pToolName );
187 
192 FBSDK_DLL bool FBCloseTool( FBTool* pTool );
193 
197 FBSDK_DLL void FBDestroyToolByName( const char* pToolName );
198 
202 FBSDK_DLL void FBDestroyTool( FBTool* pTool );
203 
209 FBSDK_DLL void FBSetToolSizeByName( const char* pToolName, int pWidth, int pHeight );
210 
216 FBSDK_DLL void FBSetToolSize( FBTool* pTool, int pWidth, int pHeight );
217 
223 FBSDK_DLL void FBGetToolSizeByName( const char* pToolName, int &pWidth, int &pHeight );
224 
230 FBSDK_DLL void FBGetToolSize( FBTool* pTool, int &pWidth, int &pHeight );
231 
237 FBSDK_DLL void FBSetToolPositionByName( const char* pToolName, int pPosX, int pPosY );
238 
244 FBSDK_DLL void FBSetToolPosition( FBTool* pTool, int pPosX, int pPosY );
245 
251 FBSDK_DLL void FBGetToolPositionByName( const char* pToolName, int &pPosX, int &pPosY );
252 
258 FBSDK_DLL void FBGetToolPosition( FBTool* pTool, int &pPosX, int &pPosY );
259 
260 #ifdef FBSDKUseNamespace
261 }
262 #endif
263 #endif /* __FBTOOL_H */
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:132
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbtool.h:48
#define NULL
Definition: kaydara.h:179
class __attribute__((visibility("default"))) FBTool bool pSetFocus
Definition: fbtool.h:166
#define K_IMPLEMENTATION
Definition: iobject.h:53
int pPosX
Definition: fbtool.h:237
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
FBToolPossibleDockPosition
Definition: fbtool.h:102
#define Name(a0, a1, a2, a3, a4)
Definition: Python-ast.h:502
Contains the user interface components for the SDK.
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
bool pResizeWnd
Definition: fbtool.h:173
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
int int pPosY
Definition: fbtool.h:237
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
int pWidth
Definition: fbtool.h:209
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
int int pHeight
Definition: fbtool.h:209
#define IQuery_Declare(IsPure)
Definition: iobject.h:80