From 05284a03f9002b03a66ae355b34790ec02b726f0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 4 Aug 2011 14:45:46 +1000 Subject: input: make InputOption opaque, provide interface functions. InputOptions is not switched to use struct list for a future patch to unify it with the XF86OptionRec. Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson --- include/input.h | 17 ++++++++++++----- include/inputstr.h | 7 +++++++ 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/input.h b/include/input.h index 5377a0c13..0258f4f18 100644 --- a/include/input.h +++ b/include/input.h @@ -56,6 +56,7 @@ SOFTWARE. #include "window.h" /* for WindowPtr */ #include "xkbrules.h" #include "events.h" +#include "list.h" #define DEVICE_INIT 0 #define DEVICE_ON 1 @@ -202,11 +203,7 @@ typedef struct { extern _X_EXPORT KeybdCtrl defaultKeyboardControl; extern _X_EXPORT PtrCtrl defaultPointerControl; -typedef struct _InputOption { - char *key; - char *value; - struct _InputOption *next; -} InputOption; +typedef struct _InputOption InputOption; typedef struct _InputAttributes { char *product; @@ -595,4 +592,14 @@ extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src); extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum); +/* InputOption handling interface */ +extern _X_EXPORT InputOption* input_option_new(InputOption *list, const char *key, const char *value); +extern _X_EXPORT void input_option_free_list(InputOption **opt); +extern _X_EXPORT InputOption* input_option_free_element(InputOption *opt, const char *key); +extern _X_EXPORT InputOption* input_option_find(InputOption *list, const char *key); +extern _X_EXPORT const char* input_option_get_key(const InputOption *opt); +extern _X_EXPORT const char* input_option_get_value(const InputOption *opt); +extern _X_EXPORT void input_option_set_key(InputOption *opt, const char* key); +extern _X_EXPORT void input_option_set_value(InputOption *opt, const char* value); + #endif /* INPUT_H */ diff --git a/include/inputstr.h b/include/inputstr.h index 838f9f021..480e95671 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -602,4 +602,11 @@ static inline WindowPtr DeepestSpriteWin(SpritePtr sprite) return sprite->spriteTrace[sprite->spriteTraceGood - 1]; } +struct _InputOption { + char *key; + char *value; + struct _InputOption *next; +}; + + #endif /* INPUTSTRUCT_H */ -- cgit v1.2.3