From 3d57e65a65b09a12b0b0897ac56c18c66edfc1c6 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Sat, 24 Mar 2012 01:57:09 +0100 Subject: [PATCH] locale: clarify internally what is xkbfile and what is xkb 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 | 11 +++++------ libfreerdp-locale/keyboard.c | 8 ++++---- libfreerdp-locale/keyboard_sun.c | 4 ++-- libfreerdp-locale/keyboard_sun.h | 4 +--- libfreerdp-locale/{keyboard_xkb.c => keyboard_xkbfile.c} | 12 ++++++------ libfreerdp-locale/{keyboard_xkb.h => keyboard_xkbfile.h} | 6 +++--- 6 files changed, 21 insertions(+), 24 deletions(-) rename libfreerdp-locale/{keyboard_xkb.c => keyboard_xkbfile.c} (97%) rename libfreerdp-locale/{keyboard_xkb.h => keyboard_xkbfile.h} (86%) diff --git a/libfreerdp-locale/CMakeLists.txt b/libfreerdp-locale/CMakeLists.txt index 56f475d..bc737a9 100644 --- a/libfreerdp-locale/CMakeLists.txt +++ b/libfreerdp-locale/CMakeLists.txt @@ -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}) - diff --git a/libfreerdp-locale/keyboard.c b/libfreerdp-locale/keyboard.c index 8929b8b..c9bfafc 100644 --- a/libfreerdp-locale/keyboard.c +++ b/libfreerdp-locale/keyboard.c @@ -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); diff --git a/libfreerdp-locale/keyboard_sun.c b/libfreerdp-locale/keyboard_sun.c index 81e0ae6..743dbee 100644 --- a/libfreerdp-locale/keyboard_sun.c +++ b/libfreerdp-locale/keyboard_sun.c @@ -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; } } diff --git a/libfreerdp-locale/keyboard_sun.h b/libfreerdp-locale/keyboard_sun.h index 96367d4..2404723 100644 --- a/libfreerdp-locale/keyboard_sun.h +++ b/libfreerdp-locale/keyboard_sun.h @@ -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 */ diff --git a/libfreerdp-locale/keyboard_xkb.c b/libfreerdp-locale/keyboard_xkbfile.c similarity index 97% rename from libfreerdp-locale/keyboard_xkb.c rename to libfreerdp-locale/keyboard_xkbfile.c index 7a4817f..12aa5d4 100644 --- a/libfreerdp-locale/keyboard_xkb.c +++ b/libfreerdp-locale/keyboard_xkbfile.c @@ -19,7 +19,7 @@ #include "liblocale.h" -#include "keyboard_xkb.h" +#include "keyboard_xkbfile.h" #include "keyboard_x11.h" #include @@ -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; diff --git a/libfreerdp-locale/keyboard_xkb.h b/libfreerdp-locale/keyboard_xkbfile.h similarity index 86% rename from libfreerdp-locale/keyboard_xkb.h rename to libfreerdp-locale/keyboard_xkbfile.h index 8308e86..02e4d81 100644 --- a/libfreerdp-locale/keyboard_xkb.h +++ b/libfreerdp-locale/keyboard_xkbfile.h @@ -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 */ -- 2.7.4