locale: clarify internally what is xkbfile and what is xkb
authorMads Kiilerich <mads@kiilerich.com>
Sat, 24 Mar 2012 00:57:09 +0000 (01:57 +0100)
committerMads Kiilerich <mads@kiilerich.com>
Sat, 24 Mar 2012 00:57:09 +0000 (01:57 +0100)
Refactoring - no semantic changes.

--HG--
rename : libfreerdp-locale/keyboard_xkb.c => libfreerdp-locale/keyboard_xkbfile.c
rename : libfreerdp-locale/keyboard_xkb.h => libfreerdp-locale/keyboard_xkbfile.h

libfreerdp-locale/CMakeLists.txt
libfreerdp-locale/keyboard.c
libfreerdp-locale/keyboard_sun.c
libfreerdp-locale/keyboard_sun.h
libfreerdp-locale/keyboard_xkbfile.c [moved from libfreerdp-locale/keyboard_xkb.c with 97% similarity]
libfreerdp-locale/keyboard_xkbfile.h [moved from libfreerdp-locale/keyboard_xkb.h with 86% similarity]

index 56f475d..bc737a9 100644 (file)
@@ -29,9 +29,9 @@ set(FREERDP_LOCALE_X11_SRCS
        keyboard_x11.c
        keyboard_x11.h)
 
-set(FREERDP_LOCALE_XKB_SRCS
-       keyboard_xkb.c
-       keyboard_xkb.h)
+set(FREERDP_LOCALE_XKBFILE_SRCS
+       keyboard_xkbfile.c
+       keyboard_xkbfile.h)
 
 set(FREERDP_LOCALE_SUN_SRCS
        keyboard_sun.c
@@ -53,9 +53,9 @@ if(NOT WIN32)
                if(NOT APPLE)
                        find_suggested_package(XKBFile)
                        if(WITH_XKBFILE)
-                               add_definitions(-DWITH_XKB)
+                               add_definitions(-DWITH_XKBFILE)
                                include_directories(${XKBFILE_INCLUDE_DIRS})
-                               set(FREERDP_LOCALE_SRCS ${FREERDP_LOCALE_SRCS} ${FREERDP_LOCALE_XKB_SRCS})
+                               set(FREERDP_LOCALE_SRCS ${FREERDP_LOCALE_SRCS} ${FREERDP_LOCALE_XKBFILE_SRCS})
                                set(FREERDP_LOCALE_LINK_LIBRARIES ${FREERDP_LOCALE_LINK_LIBRARIES} ${XKBFILE_LIBRARIES})
                        endif()
                endif()
@@ -73,4 +73,3 @@ set_target_properties(freerdp-locale PROPERTIES VERSION ${FREERDP_VERSION_FULL}
 target_link_libraries(freerdp-locale ${FREERDP_LOCALE_LINK_LIBRARIES})
 
 install(TARGETS freerdp-locale DESTINATION ${CMAKE_INSTALL_LIBDIR})
-
index 8929b8b..c9bfafc 100644 (file)
@@ -32,8 +32,8 @@
 #include "keyboard_x11.h"
 #endif
 
-#ifdef WITH_XKB
-#include "keyboard_xkb.h"
+#ifdef WITH_XKBFILE
+#include "keyboard_xkbfile.h"
 #endif
 
 #ifdef WITH_SUN
@@ -244,8 +244,8 @@ uint32 freerdp_detect_keyboard(uint32 keyboardLayoutID)
 
 uint32 freerdp_keyboard_init(uint32 keyboardLayoutId)
 {
-#ifdef WITH_XKB
-       keyboardLayoutId = freerdp_keyboard_init_xkb(keyboardLayoutId);
+#ifdef WITH_XKBFILE
+       keyboardLayoutId = freerdp_keyboard_init_xkbfile(keyboardLayoutId);
 
        if (keyboardLayoutId == 0)
                keyboardLayoutId = freerdp_keyboard_init_x11(keyboardLayoutId);
index 81e0ae6..743dbee 100644 (file)
@@ -197,7 +197,7 @@ static const SOLARIS_KEYBOARD SOLARIS_KEYBOARD_TABLE[] =
        { 6,   272,  "sun(type6)",               KBD_PORTUGUESE_BRAZILIAN_ABNT          }  /*  Brazil6_usb */
 };
 
-uint32 freerdp_detect_keyboard_type_and_layout_solaris(char* xkbfile, int length)
+uint32 freerdp_detect_keyboard_type_and_layout_solaris(char* keyboard_type, int length)
 {
        FILE* kbd;
 
@@ -251,7 +251,7 @@ uint32 freerdp_detect_keyboard_type_and_layout_solaris(char* xkbfile, int length
                {
                        if (SOLARIS_KEYBOARD_TABLE[i].layout == layout)
                        {
-                               strncpy(xkbfile, SOLARIS_KEYBOARD_TABLE[i].xkbType, length);
+                               strncpy(keyboard_type, SOLARIS_KEYBOARD_TABLE[i].xkbType, length);
                                return SOLARIS_KEYBOARD_TABLE[i].keyboardLayoutId;
                        }
                }
index 96367d4..2404723 100644 (file)
@@ -20,8 +20,6 @@
 #ifndef __LOCALE_KEYBOARD_SUN_H
 #define __LOCALE_KEYBOARD_SUN_H
 
-#include "keyboard_x11.h"
-
-uint32 freerdp_detect_keyboard_type_and_layout_solaris(char* xkbfile, int length);
+uint32 freerdp_detect_keyboard_type_and_layout_solaris(char* keyboard_type, int length);
 
 #endif /* __LOCALE_KEYBOARD_SUN_H */
similarity index 97%
rename from libfreerdp-locale/keyboard_xkb.c
rename to libfreerdp-locale/keyboard_xkbfile.c
index 7a4817f..12aa5d4 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "liblocale.h"
 
-#include "keyboard_xkb.h"
+#include "keyboard_xkbfile.h"
 #include "keyboard_x11.h"
 #include <freerdp/locale/keyboard.h>
 
@@ -315,7 +315,7 @@ void* freerdp_keyboard_xkb_init()
        return (void*) display;
 }
 
-uint32 freerdp_keyboard_init_xkb(uint32 keyboardLayoutId)
+uint32 freerdp_keyboard_init_xkbfile(uint32 keyboardLayoutId)
 {
        void* display;
        memset(X11_KEYCODE_TO_RDP_SCANCODE, 0, sizeof(X11_KEYCODE_TO_RDP_SCANCODE));
@@ -331,11 +331,11 @@ uint32 freerdp_keyboard_init_xkb(uint32 keyboardLayoutId)
 
        if (keyboardLayoutId == 0)
        {
-               keyboardLayoutId = detect_keyboard_layout_from_xkb(display);
+               keyboardLayoutId = detect_keyboard_layout_from_xkbfile(display);
                DEBUG_KBD("detect_keyboard_layout_from_xkb: %X", keyboardLayoutId);
        }
 
-       freerdp_keyboard_load_map_from_xkb(display);
+       freerdp_keyboard_load_map_from_xkbfile(display);
 
        XCloseDisplay(display);
 
@@ -364,7 +364,7 @@ static char* comma_substring(char* s, int n)
        return s;
 }
 
-uint32 detect_keyboard_layout_from_xkb(void* display)
+uint32 detect_keyboard_layout_from_xkbfile(void* display)
 {
        char* layout;
        char* variant;
@@ -405,7 +405,7 @@ uint32 detect_keyboard_layout_from_xkb(void* display)
        return keyboard_layout;
 }
 
-int freerdp_keyboard_load_map_from_xkb(void* display)
+int freerdp_keyboard_load_map_from_xkbfile(void* display)
 {
        int i, j;
        uint32 vkcode;
similarity index 86%
rename from libfreerdp-locale/keyboard_xkb.h
rename to libfreerdp-locale/keyboard_xkbfile.h
index 8308e86..02e4d81 100644 (file)
@@ -31,8 +31,8 @@ struct _VIRTUAL_KEY_CODE_TO_XKB_KEY_NAME
 };
 typedef struct _VIRTUAL_KEY_CODE_TO_XKB_KEY_NAME VIRTUAL_KEY_CODE_TO_XKB_KEY_NAME;
 
-uint32 freerdp_keyboard_init_xkb(uint32 keyboardLayoutId);
-uint32 detect_keyboard_layout_from_xkb(void* display);
-int freerdp_keyboard_load_map_from_xkb(void* display);
+uint32 freerdp_keyboard_init_xkbfile(uint32 keyboardLayoutId);
+uint32 detect_keyboard_layout_from_xkbfile(void* display);
+int freerdp_keyboard_load_map_from_xkbfile(void* display);
 
 #endif /* __LOCALE_KEYBOARD_XKB_H */