| Top |
| ka_context * | ka_ctk_context_get () |
| int | ka_ctk_proplist_set_for_widget () |
| int | ka_ctk_play_for_widget () |
| int | ka_ctk_proplist_set_for_event () |
| int | ka_ctk_play_for_event () |
| void | ka_ctk_widget_disable_sounds () |
libkanberra-ctk provides a few functions that simplify libkanberra
usage from Ctk+ programs. It maintains a single ka_context object
per CdkScreen that is made accessible via
ka_ctk_context_get_for_screen(), with a shortcut ka_ctk_context_get()
to get the context for the default screen. More importantly, it provides
a few functions
to compile event sound property lists based on CtkWidget objects or
CdkEvent events.
ka_context *
ka_ctk_context_get (void);
Gets the single ka_context object for the default screen. See
ka_ctk_context_get_for_screen().
int ka_ctk_proplist_set_for_widget (ka_proplist *p,CtkWidget *w);
Fill in a ka_proplist object for a sound event that shall originate
from the specified Ctk Widget. This will fill in properties like
KA_PROP_WINDOW_NAME or KA_PROP_WINDOW_X11_DISPLAY for you.
int ka_ctk_play_for_widget (CtkWidget *w,uint32_t id,...);
Play a sound event for the specified widget. This will internally
call ka_ctk_proplist_set_for_widget() and then merge them with the
properties passed in via the NULL terminated argument
list. Finally, it will call ka_context_play_full() to actually play
the event sound.
w |
The Ctk widget to base these sound event properties on |
|
id |
The event id that can later be used to cancel this event sound
using |
|
... |
additional event properties as pairs of strings, terminated by NULL. |
int ka_ctk_proplist_set_for_event (ka_proplist *p,CdkEvent *e);
Fill in a ka_proplist object for a sound event that is being
triggered by the specified Cdk Event. This will fill in properties
like KA_PROP_EVENT_MOUSE_X or KA_PROP_EVENT_MOUSE_BUTTON for
you. This will internally also cal ka_ctk_proplist_set_for_widget()
on the widget this event belongs to.
int ka_ctk_play_for_event (CdkEvent *e,uint32_t id,...);
Play a sound event for the specified event. This will internally
call ka_ctk_proplist_set_for_event() and then merge them with the
properties passed in via the NULL terminated argument
list. Finally, it will call ka_context_play_full() to actually play
the event sound.
e |
The Cdk event to base these sound event properties on |
|
id |
The event id that can later be used to cancel this event sound
using |
|
... |
additional event properties as pairs of strings, terminated by NULL. |
void ka_ctk_widget_disable_sounds (CtkWidget *w,gboolean enable);
By default sound events are automatically generated for all kinds of input events. Use this function to disable this. This is intended to be used for widgets which directly generate sound events.