![]() |
libxputty 0.1
|
Go to the source code of this file.
Functions | |
int | intern_error_handler (Display *dpy, XErrorEvent *e) |
char * | utf8_from_locale (char *localestr) |
utf8_from_locale - convert active codepage to utf8 must be freed by the caller | |
char * | locale_from_utf8 (char *utf8str) |
locale_from_utf8 - convert utf8 to active codepage must be freed by the caller | |
Display * | os_open_display (char *display_name) |
os_open_display - Connect to the display to use | |
void | os_close_display (Display *dpy) |
os_close_display - Close connection to the used display | |
void | os_destroy_window (Widget_t *w) |
os_destroy_window - destroy a widget (close and remove from processing) | |
Window | os_get_root_window (Xputty *main, int flag) |
os_get_root_window - get a pointer to the root window (desktop) | |
void | os_translate_coords (Widget_t *w, Window from_window, Window to_window, int from_x, int from_y, int *to_x, int *to_y) |
os_translate_coords - get x,y related to destination Window | |
void | os_get_window_metrics (Widget_t *w_, Metrics_t *metrics) |
os_get_window_metrics - Get the Merics_t struct related to a Widget_t | |
void | os_set_window_min_size (Widget_t *w, int min_width, int min_height, int base_width, int base_height) |
os_set_window_min_size - Set the min and base size of a Widget_t | |
void | os_move_window (Display *dpy, Widget_t *w, int x, int y) |
os_move_window - Move a Widget_t | |
void | os_resize_window (Display *dpy, Widget_t *w, int x, int y) |
os_resize_window - Resize a Widget_t | |
void | os_get_surface_size (cairo_surface_t *surface, int *width, int *height) |
os_get_surface_size - get the size of the cairo surface | |
void | os_set_widget_surface_size (Widget_t *w, int width, int height) |
os_set_widget_surface_size - set the size of a Widget_t cairo surface | |
void | os_create_main_window_and_surface (Widget_t *w, Xputty *app, Window win, int x, int y, int width, int height) |
os_create_main_window_and_surface - create a Widget_t with a acairo surface this function is used mainly internal on create_window() | |
void | os_create_widget_window_and_surface (Widget_t *w, Xputty *app, Widget_t *parent, int x, int y, int width, int height) |
os_create_main_widget_and_surface - create a Widget_t with a acairo surface this function is used mainly internal on create_widget() | |
void | os_set_title (Widget_t *w, const char *title) |
os_set_title - Set the title of a Widget_t | |
void | os_widget_show (Widget_t *w) |
os_widget_show - Show a Widget_t | |
void | os_widget_hide (Widget_t *w) |
os_widget_hide - Hide a Widget_t | |
void | os_show_tooltip (Widget_t *wid, Widget_t *w) |
os_show_tooltip - Show a tooltip of a Widget_t | |
void | os_expose_widget (Widget_t *w) |
os_expose_widget - Draw the the back buffer to the Widget_t surface | |
void | os_widget_event_loop (void *w_, void *event, Xputty *main, void *user_data) |
os_widget_event_loop - the Widget_t event loop on windows all messges goes into WndProc, so stub here | |
void | widget_set_dnd_aware (Widget_t *w) |
widget_set_dnd_aware - allow drag and drop for on Widget_t | |
void | widget_set_dnd_unaware (Widget_t *w) |
widget_set_dnd_unaware - disable drag and drop for on Widget_t | |
void | strremove (char *str, const char *sub) |
void | strdecode (char *target, const char *needle, const char *replacement) |
strdecode - replace string in char* | |
void | handle_drag_data (Widget_t *w, XEvent *event) |
handle_drag_data - handle recived drag data | |
void | handle_dnd_enter (Xputty *main, XEvent *event) |
handle_drag_enter - handle drag event enter the Widget_t | |
void | send_dnd_status_event (Widget_t *w, XEvent *event) |
send_dnd_status_event - notify the drag sender that prepared to recive the event | |
void | send_dnd_finished_event (Widget_t *w, XEvent *event) |
send_dnd_finished_event - notify the drag sender that the event is handled | |
int | have_paste (Widget_t *w) |
have_paste - check if clipboard contain a textbuffer | |
void | request_paste_from_clipboard (Widget_t *w) |
request_paste_from_clipboard - request textbuffer from clipboard | |
void | receive_paste_from_clipboard (Widget_t *w, XEvent *event) |
receive_paste_from_clipboard - receive textbuffer from clipboard | |
void | copy_to_clipboard (Widget_t *w, char *text, int size) |
copy_to_clipboard - send textbuffer to clipboard | |
void | send_to_clipboard (Widget_t *w, XEvent *event) |
send_to_clipboard - send textbuffer to clipboard on request | |
void | os_send_configure_event (Widget_t *w, int x, int y, int width, int height) |
os_send_configure_event - Send a configure event to a Widget_t | |
void | os_send_button_press_event (Widget_t *w) |
os_send_button_press_event - Send a button press event to a Widget_t see XButtonEvent | |
void | os_send_button_release_event (Widget_t *w) |
os_send_button_release_event - Send a button release event to a Widget_t see XButtonEvent | |
void | os_send_systray_message (Widget_t *w) |
os_send_send_systray_message - Send a systray event to a Widget_t only working on Linux for now | |
void | os_transparent_draw (void *w_, void *user_data) |
os_transparent_draw - Draw the Widget_t to the back buffer | |
void | os_adjustment_callback (void *w_, void *user_data) |
os_adjustment_callback - called when a adjustment value have changed used internal for redraw the Widget_t | |
int | os_grab_pointer (Widget_t *w) |
os_grab_pointer - grab the mouse pointer. Works only on linux | |
void | os_set_input_mask (Widget_t *w) |
os_set_input_mask - set the Event mask to a Widget_t only work on linux, stub on Windows | |
void | os_set_window_attrb (Widget_t *w) |
os_set_window_attrb - set the attribute mask to a Widget_t only work on linux, stub on Windows | |
void | os_set_transient_for_hint (Widget_t *parent, Widget_t *w) |
os_set_ transient_for_hint - set a Widget_t transient to a other Widget_t only work on linux, stub on Windows | |
int | os_get_screen_height (Widget_t *w) |
os_get_screen_height - Get the height of the used Display | |
int | os_get_screen_width (Widget_t *w) |
os_get_screen_width - Get the width of the used Display | |
bool | os_is_directory (const char *filename) |
os_is directory - check if a given path is a directory or a file | |
char * | os_get_home_dir () |
os_get_home_dir - get the users home directory | |
bool | os_get_keyboard_input (Widget_t *w, XKeyEvent *key, char *buf, size_t bufsize) |
os_ get_keyboard_input - Get the Keyboard input and convert it to utf8 | |
void | os_free_pixmap (Widget_t *w, Pixmap pixmap) |
os_free_pixmap - Free the memory used by a Pixmap only Linux, stub otherwise | |
void | os_quit (Widget_t *w) |
os_quit - quit the main loop and free all used memory | |
void | os_quit_widget (Widget_t *w) |
os_quit_widget - remove a Widget_t from the main loop and free it's used memory | |
Atom | os_register_wm_delete_window (Widget_t *wid) |
os_register_wm_delete_window - Get the needed Atom to send a widget delete message | |
Atom | os_register_widget_destroy (Widget_t *wid) |
os_register_widget_destroy - Get the needed Atom to send a widget destroy message | |
void | os_main_run (Xputty *main) |
os_main_run - start the event loop | |
void | os_run_embedded (Xputty *main) |
os_run_embedded - the event handling when run embedded on windows all messges goes into WndProc, so stub here | |
void | os_init_dnd (Xputty *main) |
os_init_dnd - register a Widget_t for handling drag and drop events only implemented on linux | |
Variables | |
int(* | default_error_handler )(Display *dpy, XErrorEvent *e) |
void copy_to_clipboard | ( | Widget_t * | w, |
char * | text, | ||
int | size | ||
) |
copy_to_clipboard - send textbuffer to clipboard
w | - the Widget_t to send the event |
text | - the text buffer to send to clipboard |
size | - the size of the buffer to send |
Definition at line 586 of file xwidget-linux.c.
References Widget_t::app, Xputty::csize, Xputty::ctext, Xputty::dpy, Xputty::selection, and Widget_t::widget.
handle_drag_enter - handle drag event enter the Widget_t
main | - pointer to the Xputty *main struct running |
event | - the drag event contain the drop data |
Definition at line 481 of file xwidget-linux.c.
References Xputty::dnd_source_window, Xputty::dnd_type, Xputty::dnd_type_text, Xputty::dnd_type_uri, Xputty::dnd_type_utf8, Xputty::dnd_version, Xputty::dpy, and Xputty::XdndTypeList.
Referenced by os_widget_event_loop().
handle_drag_data - handle recived drag data
w | - the Widget_t recive the event |
event | - the drag event contain the drop data |
Definition at line 455 of file xwidget-linux.c.
References Widget_t::app, Func_t::dnd_notify_callback, Xputty::dnd_source_window, Xputty::dnd_type, Xputty::dpy, Widget_t::func, send_dnd_finished_event(), strdecode(), strremove(), Widget_t::widget, and Xputty::XdndSelection.
Referenced by os_widget_event_loop().
int have_paste | ( | Widget_t * | w | ) |
have_paste - check if clipboard contain a textbuffer
w | - the Widget_t to send the request |
Definition at line 557 of file xwidget-linux.c.
References Widget_t::app, Xputty::dpy, and Xputty::selection.
int intern_error_handler | ( | Display * | dpy, |
XErrorEvent * | e | ||
) |
Definition at line 36 of file xwidget-linux.c.
Referenced by os_send_systray_message().
char * locale_from_utf8 | ( | char * | utf8str | ) |
locale_from_utf8 - convert utf8 to active codepage must be freed by the caller
*utf8str | - Pointer to char to convert |
Definition at line 48 of file xwidget-linux.c.
void os_adjustment_callback | ( | void * | w_, |
void * | user_data | ||
) |
os_adjustment_callback - called when a adjustment value have changed used internal for redraw the Widget_t
*w_ | - Pointer to the widget |
*user_data | - additional user data or NULL |
Definition at line 737 of file xwidget-linux.c.
void os_close_display | ( | Display * | dpy | ) |
os_close_display - Close connection to the used display
*dpy | - Display to close |
Definition at line 58 of file xwidget-linux.c.
void os_create_main_window_and_surface | ( | Widget_t * | w, |
Xputty * | app, | ||
Window | win, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
os_create_main_window_and_surface - create a Widget_t with a acairo surface this function is used mainly internal on create_window()
*w | - the Widget_t to create |
*app | - the Xputty struct the Widget_t belongs to |
*win | - the Parent Window were the Widget_t belongs to |
x,y | - the position related to the Parent Window |
*width,*height | - the Widget_t size |
Definition at line 122 of file xwidget-linux.c.
void os_create_widget_window_and_surface | ( | Widget_t * | w, |
Xputty * | app, | ||
Widget_t * | parent, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
os_create_main_widget_and_surface - create a Widget_t with a acairo surface this function is used mainly internal on create_widget()
*w | - the Widget_t to create |
*app | - the Xputty struct the Widget_t belongs to |
*parent | - the Parent Widget_t were the Widget_t belongs to |
x,y | - the position related to the Parent Widget_t |
*width,*height | - the Widget_t size |
Definition at line 159 of file xwidget-linux.c.
void os_destroy_window | ( | Widget_t * | w | ) |
os_destroy_window - destroy a widget (close and remove from processing)
*w | - widget to destroy |
Definition at line 62 of file xwidget-linux.c.
void os_expose_widget | ( | Widget_t * | w | ) |
os_expose_widget - Draw the the back buffer to the Widget_t surface
*w | - Pointer to the widget |
Definition at line 222 of file xwidget-linux.c.
os_free_pixmap - Free the memory used by a Pixmap only Linux, stub otherwise
*w | - Pointer to the widget |
pixmap | - the pixmap to be freed |
Definition at line 805 of file xwidget-linux.c.
char * os_get_home_dir | ( | ) |
os_get_home_dir - get the users home directory
Definition at line 791 of file xwidget-linux.c.
os_ get_keyboard_input - Get the Keyboard input and convert it to utf8
*w | - Pointer to the widget |
*key | - the XKeyEvent |
*buf | - the buffer to write the key in utf8 format |
bufsize | - the max buffer size to write to |
Definition at line 798 of file xwidget-linux.c.
os_get_root_window - get a pointer to the root window (desktop)
*main | - pointer to the Xputty struct |
flag | - Could be IS_WIDGET for NO decorated windows (popup etc.)
|
Definition at line 69 of file xwidget-linux.c.
Referenced by os_show_tooltip().
int os_get_screen_height | ( | Widget_t * | w | ) |
int os_get_screen_width | ( | Widget_t * | w | ) |
void os_get_surface_size | ( | cairo_surface_t * | surface, |
int * | width, | ||
int * | height | ||
) |
os_get_surface_size - get the size of the cairo surface
*surface | - the cairo surface |
*width,*height | - (Pointer) to get the size |
Definition at line 113 of file xwidget-linux.c.
os_get_window_metrics - Get the Merics_t struct related to a Widget_t
*w | - Pointer to the widget |
*metrics | - Pointer to the Metrics_t struct to hold the info for widget |
Definition at line 80 of file xwidget-linux.c.
int os_grab_pointer | ( | Widget_t * | w | ) |
os_grab_pointer - grab the mouse pointer. Works only on linux
*w | - Pointer to the widget which will grab the mouse |
Definition at line 742 of file xwidget-linux.c.
void os_init_dnd | ( | Xputty * | main | ) |
os_init_dnd - register a Widget_t for handling drag and drop events only implemented on linux
*main | - pointer to the Xputty struct |
Definition at line 1048 of file xwidget-linux.c.
bool os_is_directory | ( | const char * | filename | ) |
os_is directory - check if a given path is a directory or a file
*filename | - the Path to check |
Definition at line 786 of file xwidget-linux.c.
void os_main_run | ( | Xputty * | main | ) |
os_main_run - start the event loop
*main | - pointer to the Xputty struct |
Definition at line 845 of file xwidget-linux.c.
os_move_window - Move a Widget_t
*dpy | - Pointer to the Display the widget belongs to |
*w | - Pointer to the widget |
x,y | - the point to move to |
Definition at line 105 of file xwidget-linux.c.
Display * os_open_display | ( | char * | display_name | ) |
os_open_display - Connect to the display to use
*display_name | - Display name could be 0 for default |
Definition at line 54 of file xwidget-linux.c.
void os_quit | ( | Widget_t * | w | ) |
os_quit - quit the main loop and free all used memory
*w | - Pointer to the widget request the quit call |
Definition at line 809 of file xwidget-linux.c.
void os_quit_widget | ( | Widget_t * | w | ) |
os_quit_widget - remove a Widget_t from the main loop and free it's used memory
*w | - Pointer to the widget request the quit call |
Definition at line 822 of file xwidget-linux.c.
os_register_widget_destroy - Get the needed Atom to send a widget destroy message
*wid | - Pointer to the widget request the quit call |
Definition at line 841 of file xwidget-linux.c.
Referenced by os_quit_widget().
os_register_wm_delete_window - Get the needed Atom to send a widget delete message
*wid | - Pointer to the widget request the quit call |
Definition at line 834 of file xwidget-linux.c.
Referenced by os_quit().
os_resize_window - Resize a Widget_t
*dpy | - Pointer to the Display the widget belongs to |
*w | - Pointer to the Widget_t |
x,y | - the new size |
Definition at line 109 of file xwidget-linux.c.
void os_run_embedded | ( | Xputty * | main | ) |
os_run_embedded - the event handling when run embedded on windows all messges goes into WndProc, so stub here
*main | - pointer to the Xputty struct |
Definition at line 950 of file xwidget-linux.c.
void os_send_button_press_event | ( | Widget_t * | w | ) |
os_send_button_press_event - Send a button press event to a Widget_t see XButtonEvent
*w | - Pointer to the widget |
Definition at line 641 of file xwidget-linux.c.
void os_send_button_release_event | ( | Widget_t * | w | ) |
os_send_button_release_event - Send a button release event to a Widget_t see XButtonEvent
*w | - Pointer to the widget |
Definition at line 660 of file xwidget-linux.c.
void os_send_configure_event | ( | Widget_t * | w, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
os_send_configure_event - Send a configure event to a Widget_t
*w | - Pointer to the widget |
x,y | - the position to set |
width,height | - the size to set |
Definition at line 623 of file xwidget-linux.c.
void os_send_systray_message | ( | Widget_t * | w | ) |
os_send_send_systray_message - Send a systray event to a Widget_t only working on Linux for now
*w | - Pointer to the widget |
Definition at line 679 of file xwidget-linux.c.
void os_set_input_mask | ( | Widget_t * | w | ) |
os_set_input_mask - set the Event mask to a Widget_t only work on linux, stub on Windows
*w | - Pointer to the widget which will grab the mouse |
Definition at line 749 of file xwidget-linux.c.
void os_set_title | ( | Widget_t * | w, |
const char * | title | ||
) |
os_set_title - Set the title of a Widget_t
*w | - Pointer to the widget |
title | - the title to set |
Definition at line 194 of file xwidget-linux.c.
os_set_ transient_for_hint - set a Widget_t transient to a other Widget_t only work on linux, stub on Windows
*parent | - Pointer to the parent widget |
*w | - Pointer to the widget |
Definition at line 771 of file xwidget-linux.c.
void os_set_widget_surface_size | ( | Widget_t * | w, |
int | width, | ||
int | height | ||
) |
os_set_widget_surface_size - set the size of a Widget_t cairo surface
*w | - Pointer to the Widget_t the surface belongs to |
*width,*height | - the size to set |
Definition at line 118 of file xwidget-linux.c.
void os_set_window_attrb | ( | Widget_t * | w | ) |
os_set_window_attrb - set the attribute mask to a Widget_t only work on linux, stub on Windows
*w | - Pointer to the widget which will grab the mouse |
Definition at line 755 of file xwidget-linux.c.
void os_set_window_min_size | ( | Widget_t * | w, |
int | min_width, | ||
int | min_height, | ||
int | base_width, | ||
int | base_height | ||
) |
os_set_window_min_size - Set the min and base size of a Widget_t
*w | - Pointer to the widget |
min_width,min_height | - the min size to set |
base_width,base_height | - the base size to set |
Definition at line 91 of file xwidget-linux.c.
Referenced by os_create_main_window_and_surface().
os_show_tooltip - Show a tooltip of a Widget_t
*wid | - Pointer to the widget the tooltip belongs to |
*w | - the tooltip Widget_t |
Definition at line 211 of file xwidget-linux.c.
void os_translate_coords | ( | Widget_t * | w, |
Window | from_window, | ||
Window | to_window, | ||
int | from_x, | ||
int | from_y, | ||
int * | to_x, | ||
int * | to_y | ||
) |
os_translate_coords - get x,y related to destination Window
*w | - Widget_t pointer |
from_window | - source Window |
to_window | - destination Window |
from_x,from_y | - point from the source Window |
*to_x,*to_y | - (Pointer) point in the destination Window |
Definition at line 73 of file xwidget-linux.c.
Referenced by os_show_tooltip().
void os_transparent_draw | ( | void * | w_, |
void * | user_data | ||
) |
os_transparent_draw - Draw the Widget_t to the back buffer
*w_ | - Pointer to the widget |
*user_data | - additional user data or NULL |
Definition at line 732 of file xwidget-linux.c.
void os_widget_event_loop | ( | void * | w_, |
void * | event, | ||
Xputty * | main, | ||
void * | user_data | ||
) |
os_widget_event_loop - the Widget_t event loop on windows all messges goes into WndProc, so stub here
*w_ | - Pointer to the widget |
*event | - the event to handle |
*main | - pointer to the Xputty struct |
*user_data | - additional user data could be NULL |
Definition at line 230 of file xwidget-linux.c.
void os_widget_hide | ( | Widget_t * | w | ) |
void os_widget_show | ( | Widget_t * | w | ) |
receive_paste_from_clipboard - receive textbuffer from clipboard
w | - the Widget_t which requested the buffer |
event | - the event contain the request |
Definition at line 566 of file xwidget-linux.c.
References Widget_t::app, Xputty::ctext, Xputty::UTF8, and Widget_t::xpaste_callback.
Referenced by os_widget_event_loop().
void request_paste_from_clipboard | ( | Widget_t * | w | ) |
request_paste_from_clipboard - request textbuffer from clipboard
w | - the Widget_t to send the request |
Definition at line 561 of file xwidget-linux.c.
References Widget_t::app, Xputty::dpy, Xputty::selection, Xputty::UTF8, and Widget_t::widget.
send_dnd_finished_event - notify the drag sender that the event is handled
w | - the Widget_t handled the event |
event | - the drag event contain the drop data |
Definition at line 540 of file xwidget-linux.c.
References Widget_t::app, Xputty::dnd_source_window, Xputty::dnd_version, Xputty::dpy, XEvent::window, Xputty::XdndActionCopy, and Xputty::XdndFinished.
Referenced by handle_drag_data(), and os_widget_event_loop().
send_dnd_status_event - notify the drag sender that prepared to recive the event
w | - the Widget_t to recive the event |
event | - the drag event contain the drop data |
Definition at line 524 of file xwidget-linux.c.
References Widget_t::app, Xputty::dnd_source_window, Xputty::dnd_type, Xputty::dpy, XEvent::window, Xputty::XdndActionCopy, and Xputty::XdndStatus.
Referenced by os_widget_event_loop().
send_to_clipboard - send textbuffer to clipboard on request
w | - the Widget_t to send the event |
event | - the event contain the request |
Definition at line 595 of file xwidget-linux.c.
References Widget_t::app, Xputty::csize, Xputty::ctext, Xputty::dpy, Xputty::targets_atom, Xputty::text_atom, and Xputty::UTF8.
Referenced by os_widget_event_loop().
void strdecode | ( | char * | target, |
const char * | needle, | ||
const char * | replacement | ||
) |
strdecode - replace string in char*
*target | - the string to modify |
*needle | - the string to replace |
*replacement | - the replacement for the needle |
Definition at line 432 of file xwidget-linux.c.
Referenced by handle_drag_data().
void strremove | ( | char * | str, |
const char * | sub | ||
) |
Definition at line 419 of file xwidget-linux.c.
Referenced by handle_drag_data().
char * utf8_from_locale | ( | char * | localestr | ) |
utf8_from_locale - convert active codepage to utf8 must be freed by the caller
*localestr | - Pointer to char to convert |
Definition at line 41 of file xwidget-linux.c.
void widget_set_dnd_aware | ( | Widget_t * | w | ) |
widget_set_dnd_aware - allow drag and drop for on Widget_t
w | - the Widget_t to send the event to |
Definition at line 409 of file xwidget-linux.c.
References Widget_t::app, Xputty::dpy, Widget_t::widget, and Xputty::XdndAware.
void widget_set_dnd_unaware | ( | Widget_t * | w | ) |
widget_set_dnd_unaware - disable drag and drop for on Widget_t
w | - the Widget_t to send the event to |
Definition at line 415 of file xwidget-linux.c.
References Widget_t::app, Xputty::dpy, Widget_t::widget, and Xputty::XdndAware.
Definition at line 34 of file xwidget-linux.c.
Referenced by os_send_systray_message().