4 void keyaction_set_none(KeyAction
*a
, guint index
)
6 a
->type
[index
] = DataType_Bool
;
9 void keyaction_set_bool(KeyAction
*a
, guint index
, gboolean b
)
11 a
->type
[index
] = DataType_Bool
;
15 void keyaction_set_int(KeyAction
*a
, guint index
, int i
)
17 a
->type
[index
] = DataType_Int
;
21 void keyaction_set_uint(KeyAction
*a
, guint index
, guint u
)
23 a
->type
[index
] = DataType_Uint
;
27 void keyaction_set_string(KeyAction
*a
, guint index
, char *s
)
29 a
->type
[index
] = DataType_String
;
30 a
->data
[index
].s
= g_strdup(s
);
33 void keyaction_free(KeyAction
*a
)
37 for (i
= 0; i
< 2; ++i
)
38 if (a
->type
[i
] == DataType_String
)
42 void keyaction_do(KeyAction
*a
, Client
*c
)
46 g_assert(a
->type
[0] == DataType_String
);
47 action_execute(a
->data
[0].s
);
50 if (c
!= NULL
) action_iconify(c
);
53 if (c
!= NULL
) action_raise(c
);
56 if (c
!= NULL
) action_lower(c
);
59 if (c
!= NULL
) action_close(c
);
62 if (c
!= NULL
) action_shade(c
);
65 if (c
!= NULL
) action_unshade(c
);
67 case Action_ToggleShade
:
68 if (c
!= NULL
) action_toggle_shade(c
);
70 case Action_ToggleOmnipresent
:
71 if (c
!= NULL
) action_toggle_omnipresent(c
);
73 case Action_MoveRelative
:
74 g_assert(a
->type
[0] == DataType_Int
);
75 g_assert(a
->type
[1] == DataType_Int
);
76 if (c
!= NULL
) action_move_relative(c
, a
->data
[0].i
, a
->data
[1].i
);
78 case Action_ResizeRelative
:
79 g_assert(a
->type
[0] == DataType_Int
);
80 g_assert(a
->type
[1] == DataType_Int
);
81 if (c
!= NULL
) action_resize_relative(c
, a
->data
[0].i
, a
->data
[1].i
);
83 case Action_MaximizeFull
:
84 if (c
!= NULL
) action_maximize_full(c
);
86 case Action_UnmaximizeFull
:
87 if (c
!= NULL
) action_unmaximize_full(c
);
89 case Action_ToggleMaximizeFull
:
90 if (c
!= NULL
) action_toggle_maximize_full(c
);
92 case Action_MaximizeHorz
:
93 if (c
!= NULL
) action_maximize_horz(c
);
95 case Action_UnmaximizeHorz
:
96 if (c
!= NULL
) action_unmaximize_horz(c
);
98 case Action_ToggleMaximizeHorz
:
99 if (c
!= NULL
) action_toggle_maximize_horz(c
);
101 case Action_MaximizeVert
:
102 if (c
!= NULL
) action_maximize_vert(c
);
104 case Action_UnmaximizeVert
:
105 if (c
!= NULL
) action_unmaximize_vert(c
);
107 case Action_ToggleMaximizeVert
:
108 if (c
!= NULL
) action_toggle_maximize_vert(c
);
110 case Action_SendToDesktop
:
111 g_assert(a
->type
[0] == DataType_Uint
);
112 if (c
!= NULL
) action_send_to_desktop(c
, a
->data
[0].u
);
114 case Action_SendToNextDesktop
:
115 g_assert(a
->type
[0] == DataType_Bool
);
116 g_assert(a
->type
[1] == DataType_Bool
);
117 if (c
!= NULL
) action_send_to_next_desktop(c
, a
->data
[0].b
,
120 case Action_SendToPreviousDesktop
:
121 g_assert(a
->type
[0] == DataType_Bool
);
122 g_assert(a
->type
[1] == DataType_Bool
);
123 if (c
!= NULL
) action_send_to_previous_desktop(c
, a
->data
[0].b
,
127 g_assert(a
->type
[0] == DataType_Uint
);
128 action_desktop(a
->data
[0].u
);
130 case Action_NextDesktop
:
131 g_assert(a
->type
[0] == DataType_Bool
);
132 action_next_desktop(a
->data
[0].b
);
134 case Action_PreviousDesktop
:
135 g_assert(a
->type
[0] == DataType_Bool
);
136 action_previous_desktop(a
->data
[0].b
);
138 case Action_NextDesktopColumn
:
139 g_assert(a
->type
[0] == DataType_Bool
);
140 action_next_desktop_column(a
->data
[0].b
);
142 case Action_PreviousDesktopColumn
:
143 g_assert(a
->type
[0] == DataType_Bool
);
144 action_previous_desktop_column(a
->data
[0].b
);
146 case Action_NextDesktopRow
:
147 g_assert(a
->type
[0] == DataType_Bool
);
148 action_next_desktop_row(a
->data
[0].b
);
150 case Action_PreviousDesktopRow
:
151 g_assert(a
->type
[0] == DataType_Bool
);
152 action_previous_desktop_row(a
->data
[0].b
);
154 case Action_ToggleDecorations
:
155 if (c
!= NULL
) action_toggle_decorations(c
);