[libbluray-devel] commit: keys.h: Use enum instead of defines (hpi1 )

git at videolan.org git at videolan.org
Mon Sep 6 14:57:42 CEST 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Sep  6 15:50:40 2010 +0300| [1382ac16d2c6d6cf4a2ffa481a55c2658b84e50b] | committer: hpi1 

keys.h: Use enum instead of defines
(suggested by j-b)

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=1382ac16d2c6d6cf4a2ffa481a55c2658b84e50b
---

 src/libbluray/keys.h |   52 +++++++++++++++++++++++++------------------------
 1 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/src/libbluray/keys.h b/src/libbluray/keys.h
index 94ff753..52fcb8f 100644
--- a/src/libbluray/keys.h
+++ b/src/libbluray/keys.h
@@ -24,30 +24,32 @@
  * User input
  */
 
-#define BD_VK_NONE       0xffff
-
-/* numeric key events */
-#define BD_VK_0          0
-#define BD_VK_1          1
-#define BD_VK_2          2
-#define BD_VK_3          3
-#define BD_VK_4          4
-#define BD_VK_5          5
-#define BD_VK_6          6
-#define BD_VK_7          7
-#define BD_VK_8          8
-#define BD_VK_9          9
-
-/* */
-#define BD_VK_ROOT_MENU  10  /* open root menu */
-#define BD_VK_POPUP      11  /* toggle popup menu */
-
-/* interactive key events */
-#define BD_VK_UP         12
-#define BD_VK_DOWN       13
-#define BD_VK_LEFT       14
-#define BD_VK_RIGHT      15
-#define BD_VK_ENTER      16
-
+typedef enum {
+    BD_VK_NONE      = 0xffff,
+
+    /* numeric key events */
+    BD_VK_0         = 0,
+    BD_VK_1         = 1,
+    BD_VK_2         = 2,
+    BD_VK_3         = 3,
+    BD_VK_4         = 4,
+    BD_VK_5         = 5,
+    BD_VK_6         = 6,
+    BD_VK_7         = 7,
+    BD_VK_8         = 8,
+    BD_VK_9         = 9,
+
+    /* */
+    BD_VK_ROOT_MENU = 10,  /* open root menu */
+    BD_VK_POPUP     = 11,  /* toggle popup menu */
+
+    /* interactive key events */
+    BD_VK_UP        = 12,
+    BD_VK_DOWN      = 13,
+    BD_VK_LEFT      = 14,
+    BD_VK_RIGHT     = 15,
+    BD_VK_ENTER     = 16,
+
+} bd_vk_key_e;
 
 #endif // _BD_KEYS_H_



More information about the libbluray-devel mailing list