1 #ifndef ACCESSIBLE_UTILS_H
2 #define ACCESSIBLE_UTILS_H
4 #include <atspi/atspi.h>
11 void operator() (gpointer ptr) const { if (ptr) g_object_unref(ptr); }
14 struct GarrayDeletor {
15 void operator() (GArray *ptr) const { if (ptr) g_array_free(ptr, 1); }
18 template<class T> using unique_ptr_gobj = std::unique_ptr<T, GobjDeletor>;
19 template<class T> using unique_ptr_garray = std::unique_ptr<T, GarrayDeletor>;
22 unique_ptr_gobj<T> make_gobj_unique(T *ptr)
24 return unique_ptr_gobj<T>(ptr);
28 unique_ptr_garray<T> make_garray_unique(T *ptr)
30 return unique_ptr_garray<T>(ptr);
34 unique_ptr_gobj<T> make_gobj_ref_unique(T *ptr)
37 return unique_ptr_gobj<T>(ptr);
40 char *state_to_char(AtspiStateType state);