-
首页
-
C4D R23.110 C++ SDK
SDKBrowser Class Reference
Library
»
Browser
#include <lib_browser.h>
详细描述
The main browser library class.
SDKBrowserFileSystemTypes
|
enum
|
{
Computer
,
Drive
,
DriveCD
,
Folder
,
FolderOpen
,
FolderPresets
,
FolderCatalogs
,
FolderSearch
,
Document
,
ThreeDFile
,
ImageFile
,
MovieFile
,
预置
}
|
预置
|
static
Bool
|
ExistsPreset
(const
SDKBrowserURL
&url)
|
static
Bool
|
LoadPreset
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
&plugin_id,
BaseContainer
*bc, void **data,
Int
*length)
|
static
Bool
|
SavePreset
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
plugin_id, const
BaseContainer
*bc, void *data,
Int
length)
|
static
Bool
|
DeletePreset
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
plugin_id)
|
static
Bool
|
CopyPreset
(const
SDKBrowserURL
&src, const
SDKBrowserURL
&dst)
|
static
Bool
|
GetPresetName
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
language_id,
String
&out_name)
|
static
Bool
|
SetPresetName
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
language_id, const
String
&name)
|
static
Bool
|
ChangePresetURL
(
Int32
db_index, const
SDKBrowserURL
&url, const
SDKBrowserURL
&new_url,
Int32
plugin_id)
|
static
Bool
|
GetPresetAnnotation
(
Int32
db_index, const
SDKBrowserURL
&url,
String
&annotation)
|
static
Bool
|
SetPresetAnnotation
(
Int32
db_index, const
SDKBrowserURL
&url, const
String
&annotation)
|
static
Bool
|
SetPresetPreview
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
模式,
Int32
preview_quality,
BaseBitmap
*bm, const
LocalFileTime
*lft)
|
static
BaseBitmap
*
|
GetPresetPreview
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
frame_idx)
|
static
Bool
|
GetPresetAnimationData
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
*first_frame_idx,
Int32
*last_frame_idx,
Float
*fps)
|
static
Bool
|
SetPresetAnimationData
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
first_frame_idx,
Int32
last_frame_idx,
Float
fps)
|
static
Bool
|
SavePresetObject
(const
SDKBrowserURL
&url,
BaseList2D
*bl)
|
static
Bool
|
ReadNodesFromDatabase
(
Int32
db_index, const
SDKBrowserURL
&base_url,
SDKBrowserContentNodeRef
base_node,
InsertNodeFromDataBase
*callback, void *user_data)
|
static
Bool
|
CreatePresetNode
(
Int32
db_index, const
SDKBrowserURL
&url,
Int32
plugin_id,
Int32
mode=0)
|
static
Bool
|
SetPresetSortOrder
(
SDKBrowserContentNodeRef
*nodes,
Int32
cnt)
|
static
Bool
|
MountPresetLibrary
(const
Filename
&fn,
UInt32
flags,
SDKBrowserURL
*domain=nullptr)
|
杂项
|
static void
|
UpdateNotification
(
SDKBrowserContentNodeRef
node,
Int32
flags=0)
|
static
Int32
|
PreviewDialogMisc
(
SubDialog
*dlg, void *&private_data,
Int32
cmd,
Int32
value0=0,
Int32
value1=0, void *value2=nullptr, void *value3=nullptr)
|
static
SDKBrowserContentNodeRef
|
FindNode
(const
SDKBrowserURL
&url,
Int32
flags=
FindExactMatch
,
SDKBrowserContentNodeRef
start_from=0)
|
static
Bool
|
Identify
(const
SDKBrowserURL
&url,
UInt32
flags,
SDKBrowserPluginRef
*plugin_out)
|
Member Typedef Documentation
◆
InsertNodeFromDataBase
Node insertion callback.
-
参数
-
[in]
|
parent
|
The parent node.
|
[in]
|
existing_node
|
An existing node.
|
[in]
|
url
|
The URL.
|
[in]
|
name
|
The name.
|
[in]
|
flags
|
The flags.
|
[in]
|
db_index
|
The database index.
|
[in]
|
user_data
|
The callback user data.
|
-
返回
-
A content node.
Member Enumeration Documentation
◆
anonymous enum
Enumerator
|
CategoryPresetNodes
|
Preset category.
|
CategoryCatalogNodes
|
Catalog category.
|
CategoryDriveNodes
|
Drive category.
|
CategoryRecentNodes
|
Recent category.
|
CategorySearchNodes
|
Search category.
|
ddumdumdimdum
|
|
◆
anonymous enum
Enumerator
|
FindExactMatch
|
Find exact match.
|
FindBestMatch
|
Find best match.
|
ForceDirectoryUpdate
|
Force directory update.
|
◆
anonymous enum
Enumerator
|
Computer
|
Computer.
|
Drive
|
Drive.
|
DriveCD
|
CD drive.
|
Folder
|
Folder.
|
FolderOpen
|
Open folder.
|
FolderPresets
|
Presets folder.
|
FolderCatalogs
|
Catalogs folder.
|
FolderSearch
|
Search folder.
|
Document
|
Document folder.
|
ThreeDFile
|
3D file.
|
ImageFile
|
Image file.
|
MovieFile
|
Movie file.
|
Preset
|
Preset.
|
◆
anonymous enum
Enumerator
|
UserPresetDb
|
User preset library database index.
|
InvalidPresetDb
|
Invalid database index.
|
◆
anonymous enum
Enumerator
|
ReadOnlyPresetLibrary
|
Disable write operations to the preset library (regardless of the file system settings).
|
SystemPresetLibrary
|
System preset library.
|
IgnoreROPresetLibrary
|
Ignore a read-only flag in the preset library and makes it writable.
|
◆
anonymous enum
Enumerator
|
PreviewReplace
|
Previews are replaced.
|
PreviewAppend
|
Previews are appended.
|
构造函数 & 析构函数文档编制
◆
SDKBrowser()
◆
~SDKBrowser()
成员函数文档编制
◆
OpenNewBrowser()
Opens a new browser at
path
.
-
参数
-
[in]
|
path
|
The path to open.
|
[in]
|
flags
|
The flags.
|
-
返回
-
true
if successful, otherwise
false
.
◆
OpenNewBrowserWithTitle()
Opens a new browser at
path
with a custom title.
-
参数
-
[in]
|
path
|
The path to open.
|
[in]
|
custom_title
|
The custom title.
|
[in]
|
flags
|
The flags.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetCategoryNode()
Gets a category node.
-
参数
-
[in]
|
where
|
The category. See
SDKBrowserCategory
.
|
-
返回
-
The category node, or
nullptr
if it could not be found.
◆
GetIcon()
[1/2]
Gets an icon by ID.
-
参数
-
[in]
|
id
|
The icon ID.
|
[in]
|
pref_wh
|
The preferred width/height of the icon.
|
-
返回
-
The icon.
◆
GetIcon()
[2/2]
Gets an icon by URL and plugin ID.
-
参数
-
[in]
|
url
|
A URL to get the icon for.
|
[in]
|
plugin
|
A corresponding plugin ID.
|
[in]
|
flags
|
Reserved.
|
[in]
|
preview_time
|
An optional preview time.
|
-
返回
-
The icon.
◆
GetPreviewIcon()
Retrieves the pointer to a preview icon. If no preview is available the default icon for the type of node will be returned. The browser will cache the icon.
-
参数
-
[in]
|
content
|
The node for which an icon will be returned.
|
[in]
|
pref_wh
|
The preferred width/height of the icon.
|
[in]
|
flags
|
The flags. See
SDKBrowserIconFlags
.
|
-
返回
-
The icon.
◆
CreateIcon()
Creates an icon from a bitmap.
-
参数
-
[in]
|
bm
|
The bitmap to create the icon from.
|
[in]
|
dont_free
|
true
if the icon bitmap should not be freed.
|
-
返回
-
The icon.
◆
ReleaseIcon()
Releases
icon
.
-
参数
-
[in,out]
|
icon
|
The icon to release.
|
◆
RegisterBrowserPlugin()
Registers the browser plugin in
plugin_info
.
-
参数
-
[in]
|
plugin_info
|
The browser plugin to register.
|
[in]
|
flags
|
The flags.
|
-
返回
-
true
if successful, otherwise
false
.
◆
UnregisterBrowserPlugin()
Unregisters the browser plugin in
plugin_info
.
-
参数
-
[in]
|
plugin_info
|
The browser plugin to unregister.
|
-
返回
-
true
if successful, otherwise
false
.
◆
RegisterPresetLibrary()
Registers a preset library.
-
参数
-
[in]
|
domain
|
The preset domain.
|
[in]
|
name
|
The name of the database.
|
[in]
|
f
|
The file name and path.
|
-
返回
-
The database index of the registered preset library, or <
0
if an error occurred.
◆
UnregisterPresetLibrary()
Unregisters a preset library.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GetDbIndex()
Gets the database index of
url
.
-
参数
-
[in]
|
url
|
The URL to get the database index for.
|
[in]
|
flags
|
The flags.
|
-
返回
-
The database index, or
InvalidPresetDb
if
url
does not belong to any preset database.
◆
ExistsPreset()
Checks if a preset exists.
-
参数
-
[in]
|
url
|
The URL of the preset.
|
-
返回
-
true
if a preset exists at
url
, otherwise
false
.
◆
LoadPreset()
Loads data for a preset node in a specific preset database.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[out]
|
plugin_id
|
Assigned The ID of the plugin that saved the data.
|
[out]
|
bc
|
Assigned an information container. Can be
nullptr
.
|
[out]
|
data
|
Assigned a memory block with private node data. The memory will be owned by the caller. Can be
nullptr
.
|
[out]
|
length
|
Assigned the length of the private node data in bytes.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SavePreset()
Saves data for a preset node in a specific preset database.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
plugin_id
|
The ID of the plugin that saves the data. (This should be the same value as
SDKBrowserPluginInterface::GetPluginID()
.)
|
[in]
|
bc
|
Pointer to an information container. Can be
nullptr
.
|
[in]
|
data
|
Memory block with private node data. The caller owns the memory block. Can be
nullptr
.
|
[in]
|
length
|
The length of the private node data in bytes.
|
-
返回
-
true
if successful, otherwise
false
.
◆
DeletePreset()
Deletes data for a preset node in a specific preset database.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
CopyPreset()
Copies presets.
-
参数
-
[in]
|
src
|
The URL of the source preset.
|
[in]
|
dst
|
The URL of the destination preset.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetPresetName()
Retrieves the language specific name of a preset.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
language_id
|
The language ID.
LanguageDefault
for the default language. See
SDKBrowserLanguage
.
|
[out]
|
out_name
|
Assigned the preset name.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetPresetName()
Sets the language specific name of a preset.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
language_id
|
The language ID.
LanguageDefault
for the default language. See
SDKBrowserLanguage
.
|
[in]
|
name
|
The new name..
|
-
返回
-
true
if successful, otherwise
false
.
◆
ChangePresetURL()
Changes the preset URL.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GetPresetAnnotation()
Retrieves the annotation string of a preset.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[out]
|
annotation
|
Assigned the annotation.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetPresetAnnotation()
Sets the annotation string of a preset.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
annotation
|
The new annotation.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetPresetPreview()
Sets the preview bitmap of a preset.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
mode
|
The mode. See
SDKBrowserPreview
.
|
[in]
|
preview_quality
|
The new preview quality. See
SDKBrowserPreviewQuality
.
|
[in]
|
bm
|
The preview bitmap. Copied.
|
[in]
|
lft
|
The preview time. Copied.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetPresetPreview()
Gets the preview bitmap for a preset.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
frame_idx
|
The frame index, for movie clip previews.
|
-
返回
-
The preview bitmap.
◆
GetPresetAnimationData()
Retrieves the animation data for an animated preset preview.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[out]
|
first_frame_idx
|
Assigned the number of the first frame.
|
[out]
|
last_frame_idx
|
Assigned the number of the last frame.
|
[out]
|
fps
|
Assigned the frames per second.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetPresetAnimationData()
Sets the animation data for an animated preset preview.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
url
|
The URL of the preset node.
|
[in]
|
first_frame_idx
|
The number of the first frame.
|
[in]
|
last_frame_idx
|
The number of the last frame.
|
[in]
|
fps
|
Assigned the frames per second.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SavePresetObject()
Saves a
BaseList2D
object as preset. An already existing node with the
url
will be replaced.
-
参数
-
[in]
|
url
|
The URL of the preset node. There must be an existing node for the URL!
|
[in]
|
bl
|
The base list object.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ReadNodesFromDatabase()
Reads nodes from a database.
-
参数
-
[in]
|
db_index
|
The database index. Use
UserPresetDb
for the user preset library, or a value from
GetDbIndex()
or
RegisterPresetLibrary()
.
|
[in]
|
base_url
|
The base URL.
|
[in]
|
base_node
|
The base node.
|
[in]
|
callback
|
The callback.
|
[in]
|
user_data
|
The user data for the callback.
|
-
返回
-
true
if successful, otherwise
false
.
◆
CreatePresetNode()
Creates a new preset node.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
SetPresetSortOrder()
Used to define a custom preset order for a directory.
When iterating through the nodes in a directory the content browser will return them in the order that is specified in the array
nodes
.
BodyPaint 3D
for example uses this function to change the order of the brush presets.
-
参数
-
[in]
|
nodes
|
The nodes array.
|
[in]
|
cnt
|
The length of the
nodes
array.
|
-
返回
-
true
if successful, otherwise
false
.
◆
MountPresetLibrary()
Mounts a preset library.
-
参数
-
[in]
|
fn
|
The file name of the library to load.
|
[in]
|
flags
|
The flags. See
SDKBrowserPresetLibrary
.
|
[out]
|
domain
|
Assigned the domain of the preset, can be
nullptr
.
|
-
返回
-
true
if successful, otherwise
false
.
◆
UpdateNotification()
Tells the browser about changes in
node
.
-
参数
-
[in]
|
node
|
The modified node (or parent node).
|
[in]
|
flags
|
Reserved.
|
◆
PreviewDialogMisc()
static
Int32
PreviewDialogMisc
|
(
|
SubDialog
*
|
dlg
,
|
|
|
void *&
|
private_data
,
|
|
|
Int32
|
cmd
,
|
|
|
Int32
|
value0
=
0
,
|
|
|
Int32
|
value1
=
0
,
|
|
|
void *
|
value2
=
nullptr
,
|
|
|
void *
|
value3
=
nullptr
|
|
)
|
|
|
|
static
|
Private
.
◆
FindNode()
Retrieves the browser content node corresponding to
url
.
-
参数
-
[in]
|
url
|
The URL of the node.
|
[in]
|
flags
|
The flags. See
SDKBrowserFind
.
|
[in]
|
start_from
|
An optional start node.
|
-
返回
-
The found node, or
nullptr
if no node was found.
◆
Identify()
Identifies
url
.
-
参数
-
[in]
|
url
|
The URL to identify.
|
[in]
|
flags
|
The flags.
|
[in]
|
plugin_out
|
Assigned the corresponding plugin, if found.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetDefaultObject()
Retrieves a default object of type
id
if available.
-
参数
-
[in]
|
id
|
The object type.
|
[in]
|
flags
|
The flags.
|
-
返回
-
A clone of the default object. The caller owns the pointed object.
◆
SetDefaultObject()
Sets a default object for the type of
bl
, overwriting older default library objects for this type.
-
参数
-
[in]
|
bl
|
The new default object. The object is cloned. The caller owns the pointed object.
|
[in]
|
flags
|
The flags.
|
-
返回
-
true
if successful, otherwise
false
.