2 * ion/ioncore/binding.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_BINDING_H
10 #define ION_IONCORE_BINDING_H
12 #include <libtu/obj.h>
14 #include <libtu/map.h>
17 #include <libextl/extl.h>
25 BINDING_BUTTONDBLCLICK
,
27 BINDING_SUBMAP_RELEASEMOD
28 /*BINDING_SUBMAP_LEAVE*/
31 #define BINDING_IS_PSEUDO(A) \
32 ((A)==BINDING_SUBMAP_ENTER || (A)==BINDING_SUBMAP_RELEASEMOD)
34 #define BINDMAP_INIT {0, NULL, NULL, NULL, NULL}
36 #define FOR_ALL_BINDINGS(B, NODE, MAP) \
37 rb_traverse(NODE, MAP) if(((B)=(WBinding*)rb_val(NODE))!=NULL)
41 INTRSTRUCT(WRegBindingInfo
);
45 uint kcb
; /* keycode or button */
46 uint ksb
; /* keysym or button */
57 DECLSTRUCT(WRegBindingInfo
){
59 WRegBindingInfo
*next
, *prev
;
60 WRegBindingInfo
*bm_next
, *bm_prev
;
71 WRegBindingInfo
*rbind_list
;
72 const StringIntMap
*areamap
;
76 extern void ioncore_init_bindings();
77 extern void ioncore_update_modmap();
78 extern int ioncore_unmod(int state
, int keycode
);
79 extern bool ioncore_ismod(int keycode
);
80 extern int ioncore_modstate();
82 extern WBindmap
*create_bindmap();
84 extern void bindmap_destroy(WBindmap
*bindmap
);
85 extern void bindmap_refresh(WBindmap
*bindmap
);
86 extern bool bindmap_add_binding(WBindmap
*bindmap
, const WBinding
*binding
);
87 extern bool bindmap_remove_binding(WBindmap
*bindmap
, const WBinding
*binding
);
88 extern WBinding
*bindmap_lookup_binding(WBindmap
*bindmap
, int act
,
89 uint state
, uint kcb
);
90 extern WBinding
*bindmap_lookup_binding_area(WBindmap
*bindmap
, int act
,
91 uint state
, uint kcb
, int area
);
93 extern void binding_deinit(WBinding
*binding
);
94 extern void binding_grab_on(const WBinding
*binding
, Window win
);
95 extern void binding_ungrab_on(const WBinding
*binding
, Window win
);
97 #endif /* ION_IONCORE_BINDING_H */