refactor(timeline): de-Qt oaktimeline and wrap it in a pure C ABI

- de-Qt all 11 sources: markers/workarea lose QObject/signals (list
  re-sort via direct resort() call, drawing moves to the app layer),
  explicit unique_ptr ownership for marker lists and viewer's
  workarea/markers
- timeline undo command families (split/pointer/ripple/general/track)
  now hold oaknode C handles and do all graph work through the oaknode
  C ABI (no adapter layer); gaps are attached to the project graph
  before insertion, orphan handles tracked and freed
- fix the de-Qt severed Block->Track length-changed chain with a
  direct block_length_changed() call (positions were stale after
  split/trim)
- expand oaknode C API by ~20 functions needed by timeline
  (copy_in_graph, block kind/casts, connect_element, input arrays,
  tracklist family, marker/workarea borrowed outlets)
- pure C ABI in include/timeline (marker/workarea/edit, command
  factories returning OakUndoCommand), oakcommon XML get_native
  accessors
- oaknode<->oaktimeline resolve each other at runtime; standalone
  drivers link both into test binaries
- tests: oaktimeline 117, regressions oakcommon 193 / oaknode 96 /
  oakrender 42 / oakcodec 18 / oakaudio 36 all green
This commit is contained in:
2026-08-07 04:37:24 +08:00
parent 354df2e194
commit 66831a870e
59 changed files with 7459 additions and 98 deletions
+49
View File
@@ -49,6 +49,13 @@ typedef struct OakNodeBlock OakNodeBlock;
*/
typedef struct OakNodeTrack OakNodeTrack;
/**
* @brief Opaque handle to a node (olive::Node), see node/node.h.
*
* Re-declared here so block.h is self-contained; the typedef is identical.
*/
typedef struct OakNodeNode OakNodeNode;
/**
* @brief Concrete transition kinds for oaknode_block_transition_create().
*/
@@ -57,6 +64,14 @@ enum OakNodeTransitionKind {
OAKNODE_TRANSITION_DIP_TO_COLOR = 1 /**< DipToColorTransition. */
};
/**
* @brief Input ids of a TransitionBlock's block connections
* (TransitionBlock::k_out_block_input / k_in_block_input). Pinned by
* test; pass to oaknode_node_connect()/oaknode_node_disconnect().
*/
#define OAKNODE_TRANSITION_OUT_BLOCK_INPUT "out_block_in"
#define OAKNODE_TRANSITION_IN_BLOCK_INPUT "in_block_in"
/**
* @brief Create a ClipBlock.
*
@@ -91,6 +106,32 @@ OakNodeBlock *oaknode_block_transition_create(int kind);
*/
void oaknode_block_free(OakNodeBlock *block);
enum OakNodeBlockKind {
OAKNODE_BLOCK_OTHER = 0,
OAKNODE_BLOCK_CLIP = 1,
OAKNODE_BLOCK_GAP = 2,
OAKNODE_BLOCK_TRANSITION = 3
};
/**
* @brief Concrete kind of a block (dynamic_cast query).
*/
int oaknode_block_get_kind(OakNodeBlock *block, int *out_kind);
/**
* @brief Borrowed cast from a block handle to its node handle.
*
* Every Block is a Node; the result must not be freed. NULL for NULL.
*/
OakNodeNode *oaknode_block_as_node(OakNodeBlock *block);
/**
* @brief Borrowed cast from a node handle to a block handle.
*
* Returns NULL if the node is not a Block (or for NULL).
*/
OakNodeBlock *oaknode_block_from_node(OakNodeNode *node);
/**
* @brief Rational getters/setters use numerator/denominator out pairs.
*
@@ -233,6 +274,14 @@ int oaknode_transition_get_connected_out_block(OakNodeBlock *transition,
int oaknode_transition_get_connected_in_block(OakNodeBlock *transition,
OakNodeBlock **out);
/**
* @brief Forward cache passthroughs from another clip
* (ClipBlock::add_cache_passthrough_from()). Used after splitting a
* clip so the new part shares the render caches.
*/
int oaknode_clip_add_cache_passthrough_from(OakNodeBlock *clip,
OakNodeBlock *other);
#ifdef __cplusplus
}
#endif