From 83e86fa0b632a8c3e41eb1030b32f3dbc21c21d7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 19 Mar 2003 04:16:38 +0000 Subject: [PATCH] not using the KeyAction stuff no more --- plugins/keyboard/keyaction.c | 159 ----------------------------------- plugins/keyboard/keyaction.h | 36 -------- 2 files changed, 195 deletions(-) delete mode 100644 plugins/keyboard/keyaction.c delete mode 100644 plugins/keyboard/keyaction.h diff --git a/plugins/keyboard/keyaction.c b/plugins/keyboard/keyaction.c deleted file mode 100644 index e3b9aca4..00000000 --- a/plugins/keyboard/keyaction.c +++ /dev/null @@ -1,159 +0,0 @@ -#include "keyaction.h" -#include - -void keyaction_set_none(KeyAction *a, guint index) -{ - a->type[index] = DataType_Bool; -} - -void keyaction_set_bool(KeyAction *a, guint index, gboolean b) -{ - a->type[index] = DataType_Bool; - a->data[index].b = b; -} - -void keyaction_set_int(KeyAction *a, guint index, int i) -{ - a->type[index] = DataType_Int; - a->data[index].i = i; -} - -void keyaction_set_uint(KeyAction *a, guint index, guint u) -{ - a->type[index] = DataType_Uint; - a->data[index].u = u; -} - -void keyaction_set_string(KeyAction *a, guint index, char *s) -{ - a->type[index] = DataType_String; - a->data[index].s = g_strdup(s); -} - -void keyaction_free(KeyAction *a) -{ - guint i; - - for (i = 0; i < 2; ++i) - if (a->type[i] == DataType_String) - g_free(a->data[i].s); -} - -void keyaction_do(KeyAction *a, Client *c) -{ - switch (a->action) { - case Action_Execute: - g_assert(a->type[0] == DataType_String); - action_execute(a->data[0].s); - break; - case Action_Iconify: - if (c != NULL) action_iconify(c); - break; - case Action_Raise: - if (c != NULL) action_raise(c); - break; - case Action_Lower: - if (c != NULL) action_lower(c); - break; - case Action_Close: - if (c != NULL) action_close(c); - break; - case Action_Shade: - if (c != NULL) action_shade(c); - break; - case Action_Unshade: - if (c != NULL) action_unshade(c); - break; - case Action_ToggleShade: - if (c != NULL) action_toggle_shade(c); - break; - case Action_ToggleOmnipresent: - if (c != NULL) action_toggle_omnipresent(c); - break; - case Action_MoveRelative: - g_assert(a->type[0] == DataType_Int); - g_assert(a->type[1] == DataType_Int); - if (c != NULL) action_move_relative(c, a->data[0].i, a->data[1].i); - break; - case Action_ResizeRelative: - g_assert(a->type[0] == DataType_Int); - g_assert(a->type[1] == DataType_Int); - if (c != NULL) action_resize_relative(c, a->data[0].i, a->data[1].i); - break; - case Action_MaximizeFull: - if (c != NULL) action_maximize_full(c); - break; - case Action_UnmaximizeFull: - if (c != NULL) action_unmaximize_full(c); - break; - case Action_ToggleMaximizeFull: - if (c != NULL) action_toggle_maximize_full(c); - break; - case Action_MaximizeHorz: - if (c != NULL) action_maximize_horz(c); - break; - case Action_UnmaximizeHorz: - if (c != NULL) action_unmaximize_horz(c); - break; - case Action_ToggleMaximizeHorz: - if (c != NULL) action_toggle_maximize_horz(c); - break; - case Action_MaximizeVert: - if (c != NULL) action_maximize_vert(c); - break; - case Action_UnmaximizeVert: - if (c != NULL) action_unmaximize_vert(c); - break; - case Action_ToggleMaximizeVert: - if (c != NULL) action_toggle_maximize_vert(c); - break; - case Action_SendToDesktop: - g_assert(a->type[0] == DataType_Uint); - if (c != NULL) action_send_to_desktop(c, a->data[0].u); - break; - case Action_SendToNextDesktop: - g_assert(a->type[0] == DataType_Bool); - g_assert(a->type[1] == DataType_Bool); - if (c != NULL) action_send_to_next_desktop(c, a->data[0].b, - a->data[1].b); - break; - case Action_SendToPreviousDesktop: - g_assert(a->type[0] == DataType_Bool); - g_assert(a->type[1] == DataType_Bool); - if (c != NULL) action_send_to_previous_desktop(c, a->data[0].b, - a->data[1].b); - break; - case Action_Desktop: - g_assert(a->type[0] == DataType_Uint); - action_desktop(a->data[0].u); - break; - case Action_NextDesktop: - g_assert(a->type[0] == DataType_Bool); - action_next_desktop(a->data[0].b); - break; - case Action_PreviousDesktop: - g_assert(a->type[0] == DataType_Bool); - action_previous_desktop(a->data[0].b); - break; - case Action_NextDesktopColumn: - g_assert(a->type[0] == DataType_Bool); - action_next_desktop_column(a->data[0].b); - break; - case Action_PreviousDesktopColumn: - g_assert(a->type[0] == DataType_Bool); - action_previous_desktop_column(a->data[0].b); - break; - case Action_NextDesktopRow: - g_assert(a->type[0] == DataType_Bool); - action_next_desktop_row(a->data[0].b); - break; - case Action_PreviousDesktopRow: - g_assert(a->type[0] == DataType_Bool); - action_previous_desktop_row(a->data[0].b); - break; - case Action_ToggleDecorations: - if (c != NULL) action_toggle_decorations(c); - break; - } -} - diff --git a/plugins/keyboard/keyaction.h b/plugins/keyboard/keyaction.h deleted file mode 100644 index e4ae977c..00000000 --- a/plugins/keyboard/keyaction.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __plugin_keyboard_action_h -#define __plugin_keyboard_action_h - -#include "../../kernel/action.h" - -typedef enum { - DataType_Bool, - DataType_Int, - DataType_Uint, - DataType_String -} KeyActionDataType; - -typedef union { - gboolean b; - int i; - guint u; - char *s; -} KeyActionData; - -typedef struct { - Action action; - KeyActionDataType type[2]; - KeyActionData data[2]; -} KeyAction; - -void keyaction_set_none(KeyAction *a, guint index); -void keyaction_set_bool(KeyAction *a, guint index, gboolean bool); -void keyaction_set_int(KeyAction *a, guint index, int i); -void keyaction_set_uint(KeyAction *a, guint index, guint uint); -void keyaction_set_string(KeyAction *a, guint index, char *string); - -void keyaction_free(KeyAction *a); - -void keyaction_do(KeyAction *a, Client *c); - -#endif -- 2.45.2