How to get text from Clipboard in Tizen? (CBHM, C/C++)

Hello Everyone!
Anyone worked with Tizen’s clipboard on native side? (C/C++)

I wasted over 6 hours trying to figure out how i can get text from clipboard (cbhm) without crashes and no idea, So i came here to ask about this because docs didn’t explained…

I get stuck when working with the callback of getting text as buffer…

This is cbhm_selection_get which is function used to get data, but i need to get it from the callback with type of cbhm_selection_data_cb

int cbhm_selection_get(cbhm_h cbhm_handle, cbhm_sel_type_e type, cbhm_selection_data_cb callback, void* user_data);	

And here is the problem, How i can use this properly? And is this an array or dyanmically allocated string?

typedef int (*cbhm_selection_data_cb)(cbhm_h cbhm_handle, const char *buf, size_t len, void *user_data)

Also, If anyone can give me full info on both (The callback and the function) along with example i would be thankful!

And thanks!

Below li nks may help you to get text from clipboard:
Native: Tizen Docs
Web: Clipboard API and events | Tizen Docs


1 Like

Thank You!

Though the guides are really helpful enough, I wish if i can work with clipboard without relying on GUIs, CBHM allows to get/set clipboard string without relying on UI and wish if someone can document it…

However thanks for the help!