#[repr(C, packed(1))]pub struct ARAArchivingControllerInterface {
pub structSize: ARASize,
pub getArchiveSize: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARASize>,
pub readBytesFromArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef, position: ARASize, length: ARASize, buffer: *mut ARAByte) -> ARABool>,
pub writeBytesToArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveWriterHostRef: ARAArchiveWriterHostRef, position: ARASize, length: ARASize, buffer: *const ARAByte) -> ARABool>,
pub notifyDocumentArchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>,
pub notifyDocumentUnarchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>,
pub getDocumentArchiveID: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARAPersistentID>,
}Expand description
! Host interface: archive controller. ! As with all host interfaces, the function pointers in this struct must remain valid until ! all document controllers on the plug-in side that use it have been destroyed.
Fields§
§structSize: ARASize! @see_Versioned_Structs_
getArchiveSize: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARASize>! Query the size of the archive. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(), ! or if using API generation 1 from the deprecated begin-/endRestoringDocumentFromArchive() calls. ! Plug-ins must respect this size when reading the archive, reading beyond the end of the data ! is a programming error (and should thus be asserted by the host).
readBytesFromArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef, position: ARASize, length: ARASize, buffer: *mut ARAByte) -> ARABool>! Read bytes. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(), ! or if using API generation 1 from the deprecated begin-/endRestoringDocumentFromArchive() calls. ! Result is kARATrue upon success, or kARAFalse when there is a critical, nonrecoverable ! I/O error, such as a network failure while the file is being read from a server. ! In case of failing in this call, the host must notify the user about the problem in some ! appropriate way. The archive will not be restored by the plug-in then, it’ll fall back into ! some proper initial state for the affected objects.
writeBytesToArchive: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveWriterHostRef: ARAArchiveWriterHostRef, position: ARASize, length: ARASize, buffer: *const ARAByte) -> ARABool>! Write bytes. ! This may only be called from storeObjectsToArchive() or the deprecated storeDocumentToArchive(). ! Result is kARATrue upon success, or kARAFalse when there is a critical, nonrecoverable ! I/O error, such as a network failure while the file is being written to a server. ! In case of failing in this call, the host must notify the user about the problem in an appropriate way. ! \br ! Note that a plug-in should strive to write the data consecutively in a stream-like manner. ! Nevertheless, repositioning is needed to support chunk-style archives where the chunk length ! must be specified at the start of the chunk, but is not known until the chunk data has been ! fully created (and possibly compressed). In that case, the plug-in will need to “rewind” to ! the chunk size entry in the chunk header after writing the chunk and update it accordingly. ! As in most file APIs, any range of bytes that was skipped when writing should be filled with ! 0 by the host.
notifyDocumentArchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>! Message to the host signaling document save progress, value ranges from 0.0f to 1.0f. ! This may only be called from storeObjectsToArchive() or from the deprecated storeDocumentToArchive(). ! In order to keep CPU load low, plug-ins should try to keep the update rate for this call ! as low as about 1000 calls per archive, which equals increments of 0.1%.
notifyDocumentUnarchivingProgress: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, value: f32)>! Message to the host signaling document save progress, value ranges from 0.0f to 1.0f. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(), ! or if using API generation 1 from the deprecated begin-/endRestoringDocumentFromArchive() ! and the associated model object creation/update calls guarded by them. In the deprecated form, ! the first call should be made from begin- and the last call from endRestoringDocumentFromArchive(). ! In order to keep CPU load low, plug-ins should try to keep the update rate for this call ! as low as about 1000 calls per archive, which equals increments of 0.1%.
getDocumentArchiveID: Option<unsafe extern "C" fn(controllerHostRef: ARAArchivingControllerHostRef, archiveReaderHostRef: ARAArchiveReaderHostRef) -> ARAPersistentID>! Query the document archive ID that the plug-in’s factory provided when saving the archive. ! This may only be called from ARADocumentControllerInterface::restoreObjectsFromArchive(). ! Plug-ins can use this information to optimize their unarchiving code in case different ! archive formats are used depending on document archive ID. ! The returned pointer is owned by the host and must remain valid until the archive reader ! is destroyed. ! All hosts that support kARAAPIGeneration_2_0_Final or newer must implement this call.
Trait Implementations§
Source§impl Clone for ARAArchivingControllerInterface
impl Clone for ARAArchivingControllerInterface
Source§fn clone(&self) -> ARAArchivingControllerInterface
fn clone(&self) -> ARAArchivingControllerInterface
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more