Pajdeg
0.2.2
Pajdeg
|
A Pajdeg pipe task. More...
Files | |
file | PDTask.h |
Typedefs | |
typedef struct PDTask * | PDTaskRef |
typedef PDTaskResult(* | PDTaskFunc) (PDPipeRef pipe, PDTaskRef task, PDObjectRef object, void *info) |
Enumerations | |
enum | PDFType { PDFTypePage = 1, PDFTypePages, PDFTypeCatalog, PDFTypeAnnot, PDFTypeFont, PDFTypeFontDescriptor, PDFTypeAction, _PDFTypeCount } |
enum | PDPropertyType { PDPropertyObjectId = 1, PDPropertyRootObject, PDPropertyInfoObject, PDPropertyPDFType, PDPropertyPage } |
enum | PDTaskResult { PDTaskFailure = -1, PDTaskDone = 0, PDTaskSkipRest = 1, PDTaskUnload = 2 } |
Creating and manipulating filters | |
PDTaskRef | PDTaskCreateFilter (PDPropertyType propertyType) |
PDTaskRef | PDTaskCreateFilterWithValue (PDPropertyType propertyType, PDInteger value) |
PDTaskRef | PDTaskCreateMutator (PDTaskFunc mutatorFunc) |
void | PDTaskAppendTask (PDTaskRef parentTask, PDTaskRef childTask) |
void | PDTaskSetInfo (PDTaskRef task, void *info) |
PDTaskResult | PDTaskExec (PDTaskRef task, PDPipeRef pipe, PDObjectRef object) |
Convenience functions | |
PDTaskRef | PDTaskCreateMutatorForObject (long objectID, PDTaskFunc mutatorFunc) |
PDTaskRef | PDTaskCreateMutatorForPropertyType (PDPropertyType propertyType, PDTaskFunc mutatorFunc) |
PDTaskRef | PDTaskCreateMutatorForPropertyTypeWithValue (PDPropertyType propertyType, PDInteger value, PDTaskFunc mutatorFunc) |
A Pajdeg pipe task.
typedef PDTaskResult(* PDTaskFunc) (PDPipeRef pipe, PDTaskRef task, PDObjectRef object, void *info) |
Function signature for task callbacks.
enum PDFType |
PDF object types.
enum PDPropertyType |
Task filter property type.
enum PDTaskResult |
Task result type.
Tasks are chained together. When triggered, the first task in the list of tasks for the specific state is executed. Before moving on to the next task in the list, each task has a number of options specified in the task result.
Returning PDTaskDone means the task ended normally, and that the next task, if any, may execute. This is usually the preferred return value.
Append a child task to a task. Child tasks are executed after their parent tasks, unless the parent decides to stop the chain. The child is appended to the end, as one would intuitively expect. Adding child A, followed by adding child B, to parent P, will result in the execution order
P -> A -> B
PDTaskRef PDTaskCreateFilter | ( | PDPropertyType | propertyType | ) |
Create a filtering task. Filtering tasks find objects in a pipe based on given criteria and forward these to their child tasks.
PDTaskRef PDTaskCreateFilterWithValue | ( | PDPropertyType | propertyType, |
PDInteger | value | ||
) |
Create a filtering task with the given argument.
PDTaskRef PDTaskCreateMutator | ( | PDTaskFunc | mutatorFunc | ) |
Create a mutator task. Mutator tasks receive objects from the pipe if their parent tasks pass them through. A mutator task can be a filter, if it uses PDTaskSkipRest to abort for objects that should be skipped.
PDTaskRef PDTaskCreateMutatorForObject | ( | long | objectID, |
PDTaskFunc | mutatorFunc | ||
) |
Create a mutator for the given object ID.
PDTaskRef PDTaskCreateMutatorForPropertyType | ( | PDPropertyType | propertyType, |
PDTaskFunc | mutatorFunc | ||
) |
Create a mutator for the given (value-less) property type.
PDTaskRef PDTaskCreateMutatorForPropertyTypeWithValue | ( | PDPropertyType | propertyType, |
PDInteger | value, | ||
PDTaskFunc | mutatorFunc | ||
) |
Create a mutator for the given property type with the given value.
PDTaskResult PDTaskExec | ( | PDTaskRef | task, |
PDPipeRef | pipe, | ||
PDObjectRef | object | ||
) |
Execute a task, possibly resulting in a chain of tasks executing if the task has children.
void PDTaskSetInfo | ( | PDTaskRef | task, |
void * | info | ||
) |
Set the info object for a task.
The info object is passed as is to the task upon execution.
task | The task. |
info | The info object. |