Skip to content

Commit

Permalink
Document how strings are handled in the cut/copy/paste callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed May 4, 2024
1 parent 89b4155 commit 370f433
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/kinc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,23 @@ KINC_FUNC void kinc_set_drop_files_callback(void (*callback)(wchar_t *, void *),

/// <summary>
/// Sets a callback which is called when the application is instructed to cut, typically via ctrl+x or cmd+x.
/// Kinc does not take ownership of the provided string.
/// </summary>
/// <param name="callback">The cut-callback</param>
/// <param name="data">Arbitrary data-pointer that's passed to the callback</param>
KINC_FUNC void kinc_set_cut_callback(char *(*callback)(void *), void *data);

/// <summary>
/// Sets a callback which is called when the application is instructed to copy, typically via ctrl+c or cmd+c.
/// Kinc does not take ownership of the provided string.
/// </summary>
/// <param name="callback">The copy-callback</param>
/// <param name="data">Arbitrary data-pointer that's passed to the callback</param>
KINC_FUNC void kinc_set_copy_callback(char *(*callback)(void *), void *data);

/// <summary>
/// Sets a callback which is called when the application is instructed to paste, typically via ctrl+v or cmd+v.
/// The provided string is only valid during the callback-call - copy it if you want to keep it.
/// </summary>
/// <param name="callback">The paste-callback</param>
/// <param name="data">Arbitrary data-pointer that's passed to the callback</param>
Expand Down

0 comments on commit 370f433

Please sign in to comment.