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  if( Class->FBCreate() ) {\
71  return Class->GetHIObject(); \
72  } else { \
73  delete Class; \
74  return NULL; \
75  } \
76 } \
77  FBLibraryModule( ClassName ) \
78 { \
79  FBRegisterObject( ClassName,"UI/Tools",Label,Description,RegisterTool##ClassName, false, IconFilename );\
80 }
81 
86 #define FBToolDeclare( ClassName,Parent ) \
87  FBClassDeclare( ClassName,Parent ); \
88 public: \
89  ClassName(const char *pName=NULL):Parent(pName) { FBClassInit; } \
90 private:
91 
95 #define FBToolImplementation( ThisComponent ) \
96  FBClassImplementation( ThisComponent )
97 
98 FB_FORWARD( FBFbxObject );
99 __FB_FORWARD( FBTool );
100 
102 {
108 };
109 
111 class FBSDK_DLL FBTool : public FBLayout {
113 public:
117  FBTool(const char* pName = NULL);
118 
123  FBTool(const char* pName, bool pRegisterTool);
124 
128  virtual void Destroy(int pIsLocal);
130 
134  virtual bool FbxStore ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
135  virtual bool FbxRetrieve ( FBFbxObject* pFbxObject, kFbxObjectStore pStoreWhat );
137 
141  FBToolPossibleDockPosition GetPossibleDockPosition();
142 
146  void SetPossibleDockPosition(FBToolPossibleDockPosition pFlags);
147 
148  IQuery_Declare(K_IMPLEMENTATION); // Interface to IObject.
149 
150  FBPropertyInt StartSize [2];
151  FBPropertyInt MaxSize [2];
152  FBPropertyInt MinSize [2];
153  FBPropertyInt StartPos [2];
155 private:
156 
157  void InitTool();
158 };
159 
165 FBSDK_DLL bool FBPopNormalTool( const char* pToolName, bool pSetFocus = true );
166 
172 FBSDK_DLL FBTool* FBShowToolByName( const char* pToolName, bool pResizeWnd = true );
173 
179 FBSDK_DLL FBTool* FBShowTool( FBTool* pTool, bool pResizeWnd = true );
180 
185 FBSDK_DLL bool FBCloseToolByName( const char* pToolName );
186 
191 FBSDK_DLL bool FBCloseTool( FBTool* pTool );
192 
196 FBSDK_DLL void FBDestroyToolByName( const char* pToolName );
197 
201 FBSDK_DLL void FBDestroyTool( FBTool* pTool );
202 
208 FBSDK_DLL void FBSetToolSizeByName( const char* pToolName, int pWidth, int pHeight );
209 
215 FBSDK_DLL void FBSetToolSize( FBTool* pTool, int pWidth, int pHeight );
216 
222 FBSDK_DLL void FBGetToolSizeByName( const char* pToolName, int &pWidth, int &pHeight );
223 
229 FBSDK_DLL void FBGetToolSize( FBTool* pTool, int &pWidth, int &pHeight );
230 
236 FBSDK_DLL void FBSetToolPositionByName( const char* pToolName, int pPosX, int pPosY );
237 
243 FBSDK_DLL void FBSetToolPosition( FBTool* pTool, int pPosX, int pPosY );
244 
250 FBSDK_DLL void FBGetToolPositionByName( const char* pToolName, int &pPosX, int &pPosY );
251 
257 FBSDK_DLL void FBGetToolPosition( FBTool* pTool, int &pPosX, int &pPosY );
258 
259 #ifdef FBSDKUseNamespace
260 }
261 #endif
262 #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
void FBSetToolPositionByName(const char *pToolName, int pPosX, int pPosY)
This function will set the position of a specific tool.
bool FBPopNormalTool(const char *pToolName, bool pSetFocus=true)
This function is used to bring up a specific tool in the GUI.
#define NULL
Definition: kaydara.h:169
#define K_IMPLEMENTATION
Definition: iobject.h:53
FBTool * FBShowToolByName(const char *pToolName, bool pResizeWnd=true)
This function will show a specific tool in the GUI.
bool FBCloseTool(FBTool *pTool)
This function will close a specific tool in the GUI.
Property class: const char * (String).
void FBDestroyTool(FBTool *pTool)
This function will destroy a specific tool in the GUI.
FBPropertyString Name
Definition: fbtool.h:154
Contains the user interface components for the SDK.
FBX file interface.
Definition: fbfbx.h:80
Used to build the user interface.
Definition: fbcontrols.h:776
void FBSetToolPosition(FBTool *pTool, int pPosX, int pPosY)
This function will set the position of a specific tool.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68
FBTool * FBShowTool(FBTool *pTool, bool pResizeWnd=true)
This function will show a specific tool in the GUI.
void FBGetToolSize(FBTool *pTool, int &pWidth, int &pHeight)
This function will get the size of a specific tool in the GUI.
#define FBSDKNamespace
FBSDKNamespace define.
Definition: fbversion.h:64
void FBSetToolSizeByName(const char *pToolName, int pWidth, int pHeight)
This function will set the size of a specific tool in the GUI.
FBToolPossibleDockPosition
Definition: fbtool.h:101
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:62
bool FBCloseToolByName(const char *pToolName)
This function will close a specific tool in the GUI.
void FBSetToolSize(FBTool *pTool, int pWidth, int pHeight)
This function will set the size of a specific tool in the GUI.
Tool class.
Definition: fbtool.h:111
void FBDestroyToolByName(const char *pToolName)
This function will destroy a specific tool in the GUI.
void FBGetToolPosition(FBTool *pTool, int &pPosX, int &pPosY)
This function will get the position of a specific tool.
void FBGetToolSizeByName(const char *pToolName, int &pWidth, int &pHeight)
This function will get the size of a specific tool in the GUI.
class FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
kFbxObjectStore
Description of the different store/retrieve passes of the FBX format.
Definition: fbtypes.h:74
void FBGetToolPositionByName(const char *pToolName, int &pPosX, int &pPosY)
This function will get the position of a specific tool.
#define IQuery_Declare(IsPure)
Definition: iobject.h:80