diff --git a/include/freerdp/api.h b/include/freerdp/api.h new file mode 100644 index 000000000..7905e6a64 --- /dev/null +++ b/include/freerdp/api.h @@ -0,0 +1,53 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * FreeRDP Interface + * + * Copyright 2009-2011 Jay Sorg + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __FREERDP_API_H +#define __FREERDP_API_H + +#define FREERDP_INTERFACE_VERSION 4 + +#if defined _WIN32 || defined __CYGWIN__ + #ifdef FREERDP_EXPORTS + #ifdef __GNUC__ + #define FREERDP_API __attribute__((dllexport)) + #else + #define FREERDP_API __declspec(dllexport) + #endif + #else + #ifdef __GNUC__ + #define FREERDP_API __attribute__((dllimport)) + #else + #define FREERDP_API __declspec(dllimport) + #endif + #endif +#else + #if __GNUC__ >= 4 + #define FREERDP_API __attribute__ ((visibility("default"))) + #else + #define FREERDP_API + #endif +#endif + +#ifdef _WIN32 +#define FREERDP_CC __stdcall +#else +#define FREERDP_CC +#endif + +#endif diff --git a/include/freerdp/constants.h b/include/freerdp/constants.h index 233fc3f26..0ca3debd9 100644 --- a/include/freerdp/constants.h +++ b/include/freerdp/constants.h @@ -17,6 +17,9 @@ * limitations under the License. */ +#ifndef __FREERDP_CONSTANTS +#define __FREERDP_CONSTANTS + /** * Protocol Security Negotiation Protocols */ @@ -38,3 +41,5 @@ enum RDP_NEG_FAILURE_FAILURECODES INCONSISTENT_FLAGS = 0x00000004, HYBRID_REQUIRED_BY_SERVER = 0x00000005 }; + +#endif diff --git a/include/freerdp/extension.h b/include/freerdp/extension.h index 733d75a73..91b25df3e 100644 --- a/include/freerdp/extension.h +++ b/include/freerdp/extension.h @@ -20,14 +20,9 @@ #ifndef __RDP_EXTENSION_H #define __RDP_EXTENSION_H +#include #include -#ifdef _WIN32 -#define RDPEXT_CC __stdcall -#else -#define RDPEXT_CC -#endif - /* Extensions ought to check for it to ensure compatibility */ #define RDPEXT_API 1 @@ -42,11 +37,11 @@ struct rdp_ext_plugin int (*uninit) (rdpExtPlugin * plugin, rdpInst * inst); }; -typedef uint32 (RDPEXT_CC * PFREERDP_EXTENSION_HOOK)(rdpExtPlugin * plugin, rdpInst * inst); +typedef uint32 (FREERDP_CC * PFREERDP_EXTENSION_HOOK)(rdpExtPlugin * plugin, rdpInst * inst); -typedef uint32 (RDPEXT_CC * PREGISTEREXTENSION)(rdpExtPlugin * plugin); -typedef uint32 (RDPEXT_CC * PREGISTERPRECONNECTHOOK)(rdpExtPlugin * plugin, PFREERDP_EXTENSION_HOOK hook); -typedef uint32 (RDPEXT_CC * PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin * plugin, PFREERDP_EXTENSION_HOOK hook); +typedef uint32 (FREERDP_CC * PREGISTEREXTENSION)(rdpExtPlugin * plugin); +typedef uint32 (FREERDP_CC * PREGISTERPRECONNECTHOOK)(rdpExtPlugin * plugin, PFREERDP_EXTENSION_HOOK hook); +typedef uint32 (FREERDP_CC * PREGISTERPOSTCONNECTHOOK)(rdpExtPlugin * plugin, PFREERDP_EXTENSION_HOOK hook); struct _FREERDP_EXTENSION_ENTRY_POINTS { @@ -59,6 +54,6 @@ struct _FREERDP_EXTENSION_ENTRY_POINTS typedef struct _FREERDP_EXTENSION_ENTRY_POINTS FREERDP_EXTENSION_ENTRY_POINTS; typedef FREERDP_EXTENSION_ENTRY_POINTS * PFREERDP_EXTENSION_ENTRY_POINTS; -typedef int (RDPEXT_CC * PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); +typedef int (FREERDP_CC * PFREERDP_EXTENSION_ENTRY)(PFREERDP_EXTENSION_ENTRY_POINTS pEntryPoints); #endif /* __RDP_EXTENSION_H */ diff --git a/include/freerdp/freerdp.h b/include/freerdp/freerdp.h index 22310cd61..7e8eb09fd 100644 --- a/include/freerdp/freerdp.h +++ b/include/freerdp/freerdp.h @@ -20,33 +20,10 @@ #ifndef __FREERDP_H #define __FREERDP_H -#include "types/ui.h" -#include "settings.h" -#include "extension.h" - -#define FREERDP_INTERFACE_VERSION 4 - -#if defined _WIN32 || defined __CYGWIN__ - #ifdef FREERDP_EXPORTS - #ifdef __GNUC__ - #define FREERDP_API __attribute__((dllexport)) - #else - #define FREERDP_API __declspec(dllexport) - #endif - #else - #ifdef __GNUC__ - #define FREERDP_API __attribute__((dllimport)) - #else - #define FREERDP_API __declspec(dllimport) - #endif - #endif -#else - #if __GNUC__ >= 4 - #define FREERDP_API __attribute__ ((visibility("default"))) - #else - #define FREERDP_API - #endif -#endif +#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/freerdp/kbd.h b/include/freerdp/kbd.h index c7c341b6c..58c3f6281 100644 --- a/include/freerdp/kbd.h +++ b/include/freerdp/kbd.h @@ -20,13 +20,13 @@ #ifndef __FREERDP_KBD_H #define __FREERDP_KBD_H -#include "types/base.h" +#include -#define RDP_KEYBOAFRDP_LAYOUT_TYPE_STANDARD 1 -#define RDP_KEYBOAFRDP_LAYOUT_TYPE_VARIANT 2 -#define RDP_KEYBOAFRDP_LAYOUT_TYPE_IME 4 +#define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1 +#define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2 +#define RDP_KEYBOARD_LAYOUT_TYPE_IME 4 -typedef struct rdp_keyboaFRDP_layout +typedef struct rdp_keyboard_layout { uint32 code; char name[50]; @@ -35,7 +35,7 @@ typedef struct rdp_keyboaFRDP_layout rdpKeyboardLayout * freerdp_kbd_get_layouts(int types); unsigned int -freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id); +freerdp_kbd_init(void *dpy, unsigned int keyboard_layout_id); uint8 freerdp_kbd_get_scancode_by_keycode(uint8 keycode, boolean * extended); uint8 diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index af989b254..566cb96e3 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -20,7 +20,7 @@ #ifndef __RDP_SETTINGS_H #define __RDP_SETTINGS_H -#include +#include struct rdp_chan { diff --git a/libfreerdp-core/transport.h b/libfreerdp-core/transport.h index 12f274798..2e099a333 100644 --- a/libfreerdp-core/transport.h +++ b/libfreerdp-core/transport.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include enum _TRANSPORT_STATE diff --git a/libfreerdp-kbd/keyboard.h b/libfreerdp-kbd/keyboard.h index 6b5fa387d..7fe974e01 100644 --- a/libfreerdp-kbd/keyboard.h +++ b/libfreerdp-kbd/keyboard.h @@ -19,8 +19,8 @@ /* Microsoft Windows Virtual Key Codes: http://msdn.microsoft.com/en-us/library/ms645540.aspx */ -#ifndef __KEYBOAFRDP_H -#define __KEYBOAFRDP_H +#ifndef __KEYBOARD_H +#define __KEYBOARD_H #include @@ -584,4 +584,4 @@ static const virtualKey virtualKeyboard[256 + 2] = { 0x1C, 1, "" , "KPEN" }, }; -#endif /* __KEYBOAFRDP_H */ +#endif /* __KEYBOARD_H */ diff --git a/libfreerdp-kbd/layout_ids.c b/libfreerdp-kbd/layout_ids.c index fbb22f5e0..6fcecc221 100644 --- a/libfreerdp-kbd/layout_ids.c +++ b/libfreerdp-kbd/layout_ids.c @@ -230,7 +230,7 @@ keyboardIME keyboardIMEs[] = rdpKeyboardLayout * -get_keyboaFRDP_layouts(int types) +get_keyboard_layouts(int types) { rdpKeyboardLayout * layouts; int num; @@ -240,7 +240,7 @@ get_keyboaFRDP_layouts(int types) num = 0; layouts = (rdpKeyboardLayout *) malloc((num + 1) * sizeof(rdpKeyboardLayout)); - if ((types & RDP_KEYBOAFRDP_LAYOUT_TYPE_STANDARD) != 0) + if ((types & RDP_KEYBOARD_LAYOUT_TYPE_STANDARD) != 0) { len = sizeof(keyboardLayouts) / sizeof(keyboardLayout); layouts = (rdpKeyboardLayout *) realloc(layouts, (num + len + 1) * sizeof(rdpKeyboardLayout)); @@ -250,7 +250,7 @@ get_keyboaFRDP_layouts(int types) strcpy(layouts[num].name, keyboardLayouts[i].name); } } - if ((types & RDP_KEYBOAFRDP_LAYOUT_TYPE_VARIANT) != 0) + if ((types & RDP_KEYBOARD_LAYOUT_TYPE_VARIANT) != 0) { len = sizeof(keyboardLayoutVariants) / sizeof(keyboardLayoutVariant); layouts = (rdpKeyboardLayout *) realloc(layouts, (num + len + 1) * sizeof(rdpKeyboardLayout)); @@ -260,7 +260,7 @@ get_keyboaFRDP_layouts(int types) strcpy(layouts[num].name, keyboardLayoutVariants[i].name); } } - if ((types & RDP_KEYBOAFRDP_LAYOUT_TYPE_IME) != 0) + if ((types & RDP_KEYBOARD_LAYOUT_TYPE_IME) != 0) { len = sizeof(keyboardIMEs) / sizeof(keyboardIME); layouts = (rdpKeyboardLayout *) realloc(layouts, (num + len + 1) * sizeof(rdpKeyboardLayout)); diff --git a/libfreerdp-kbd/layout_ids.h b/libfreerdp-kbd/layout_ids.h index 6680493b2..8af8cc636 100644 --- a/libfreerdp-kbd/layout_ids.h +++ b/libfreerdp-kbd/layout_ids.h @@ -178,7 +178,7 @@ #define KBD_CHINESE_TRADITIONAL_ALPHANUMERIC 0xE00F0404 rdpKeyboardLayout * -get_keyboaFRDP_layouts(int types); +get_keyboard_layouts(int types); char * get_layout_name(unsigned int keyboardLayoutID); diff --git a/libfreerdp-kbd/layouts_xkb.c b/libfreerdp-kbd/layouts_xkb.c index cf79d5b0a..f627ff62f 100644 --- a/libfreerdp-kbd/layouts_xkb.c +++ b/libfreerdp-kbd/layouts_xkb.c @@ -57,10 +57,10 @@ comma_substring(char *s, int n) } unsigned int -detect_keyboaFRDP_layout_from_xkb(void *dpy) +detect_keyboard_layout_from_xkb(void *dpy) { char *layout, *variant; - unsigned int keyboaFRDP_layout = 0, group = 0; + unsigned int keyboard_layout = 0, group = 0; XkbRF_VarDefsRec rules_names; XKeyboardState coreKbdState; XkbStateRec state; @@ -82,7 +82,7 @@ detect_keyboaFRDP_layout_from_xkb(void *dpy) DEBUG_KBD("layout: %s", layout); DEBUG_KBD("variant: %s", variant); - keyboaFRDP_layout = find_keyboaFRDP_layout_in_xorg_rules(layout, variant); + keyboard_layout = find_keyboard_layout_in_xorg_rules(layout, variant); free(rules_names.model); free(rules_names.layout); @@ -90,7 +90,7 @@ detect_keyboaFRDP_layout_from_xkb(void *dpy) free(rules_names.options); } - return keyboaFRDP_layout; + return keyboard_layout; } int @@ -358,7 +358,7 @@ load_xkb_keyboard(KeycodeToVkcode map, char* kbd) } void -load_keyboaFRDP_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile) +load_keyboard_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile) { char* kbd; char* xkbfileEnd; diff --git a/libfreerdp-kbd/layouts_xkb.h b/libfreerdp-kbd/layouts_xkb.h index 92d32b6bf..d714e62ab 100644 --- a/libfreerdp-kbd/layouts_xkb.h +++ b/libfreerdp-kbd/layouts_xkb.h @@ -37,7 +37,7 @@ int init_xkb(void *dpy); unsigned int -detect_keyboaFRDP_layout_from_xkb(void *dpy); +detect_keyboard_layout_from_xkb(void *dpy); int init_keycodes_from_xkb(void *dpy, RdpKeycodes x_keycode_to_rdp_keycode); @@ -45,7 +45,7 @@ init_keycodes_from_xkb(void *dpy, RdpKeycodes x_keycode_to_rdp_keycode); #else void -load_keyboaFRDP_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile); +load_keyboard_map(KeycodeToVkcode keycodeToVkcode, char *xkbfile); #endif diff --git a/libfreerdp-kbd/libkbd.c b/libfreerdp-kbd/libkbd.c index 9d7225d7e..97c2bdb31 100644 --- a/libfreerdp-kbd/libkbd.c +++ b/libfreerdp-kbd/libkbd.c @@ -52,15 +52,15 @@ detect_keyboard(void *dpy, unsigned int keyboardLayoutID, char *xkbfile, size_t #if defined(sun) if(keyboardLayoutID == 0) { - keyboardLayoutID = detect_keyboaFRDP_type_and_layout_sunos(xkbfile, xkbfilelength); - DEBUG_KBD("detect_keyboaFRDP_type_and_layout_sunos: %X %s", keyboardLayoutID, xkbfile); + keyboardLayoutID = detect_keyboard_type_and_layout_sunos(xkbfile, xkbfilelength); + DEBUG_KBD("detect_keyboard_type_and_layout_sunos: %X %s", keyboardLayoutID, xkbfile); } #endif if(keyboardLayoutID == 0) { - keyboardLayoutID = detect_keyboaFRDP_layout_from_locale(); - DEBUG_KBD("detect_keyboaFRDP_layout_from_locale: %X", keyboardLayoutID); + keyboardLayoutID = detect_keyboard_layout_from_locale(); + DEBUG_KBD("detect_keyboard_layout_from_locale: %X", keyboardLayoutID); } if (keyboardLayoutID == 0) @@ -86,7 +86,7 @@ detect_keyboard(void *dpy, unsigned int keyboardLayoutID, char *xkbfile, size_t */ unsigned int -freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id) +freerdp_kbd_init(void *dpy, unsigned int keyboard_layout_id) { #ifdef WITH_XKBFILE if (!init_xkb(dpy)) @@ -94,10 +94,10 @@ freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id) DEBUG_KBD("Error initializing xkb"); return 0; } - if (!keyboaFRDP_layout_id) + if (!keyboard_layout_id) { - keyboaFRDP_layout_id = detect_keyboaFRDP_layout_from_xkb(dpy); - DEBUG_KBD("detect_keyboaFRDP_layout_from_xkb: %X", keyboaFRDP_layout_id); + keyboard_layout_id = detect_keyboard_layout_from_xkb(dpy); + DEBUG_KBD("detect_keyboard_layout_from_xkb: %X", keyboard_layout_id); } init_keycodes_from_xkb(dpy, x_keycode_to_rdp_keycode); #else @@ -105,11 +105,11 @@ freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id) KeycodeToVkcode keycodeToVkcode; int keycode; - keyboaFRDP_layout_id = detect_keyboard(dpy, keyboaFRDP_layout_id, xkbfile, sizeof(xkbfile)); + keyboard_layout_id = detect_keyboard(dpy, keyboard_layout_id, xkbfile, sizeof(xkbfile)); DEBUG_KBD("Using keyboard layout 0x%X with xkb name %s and xkbfile %s", - keyboaFRDP_layout_id, get_layout_name(keyboaFRDP_layout_id), xkbfile); + keyboard_layout_id, get_layout_name(keyboard_layout_id), xkbfile); - load_keyboaFRDP_map(keycodeToVkcode, xkbfile); + load_keyboard_map(keycodeToVkcode, xkbfile); for (keycode=0; keycode<256; keycode++) { @@ -126,13 +126,13 @@ freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id) } #endif - return keyboaFRDP_layout_id; + return keyboard_layout_id; } rdpKeyboardLayout * freerdp_kbd_get_layouts(int types) { - return get_keyboaFRDP_layouts(types); + return get_keyboard_layouts(types); } uint8 diff --git a/libfreerdp-kbd/locales.c b/libfreerdp-kbd/locales.c index cd0041a5a..32b0f3a89 100644 --- a/libfreerdp-kbd/locales.c +++ b/libfreerdp-kbd/locales.c @@ -422,7 +422,7 @@ static const localeAndKeyboardLayout defaultKeyboardLayouts[] = }; unsigned int -detect_keyboaFRDP_layout_from_locale() +detect_keyboard_layout_from_locale() { int i; int j; diff --git a/libfreerdp-kbd/locales.h b/libfreerdp-kbd/locales.h index 96a876125..60e6d6407 100644 --- a/libfreerdp-kbd/locales.h +++ b/libfreerdp-kbd/locales.h @@ -321,6 +321,6 @@ Time zones, taken from Windows Server 2008 */ unsigned int -detect_keyboaFRDP_layout_from_locale(); +detect_keyboard_layout_from_locale(); #endif /* __LOCALES_H */ diff --git a/libfreerdp-kbd/x_layout_id_table.c b/libfreerdp-kbd/x_layout_id_table.c index 3b083f2fa..59e6a3625 100644 --- a/libfreerdp-kbd/x_layout_id_table.c +++ b/libfreerdp-kbd/x_layout_id_table.c @@ -1076,7 +1076,7 @@ SunOSKeyboard SunOSKeyboards[] = }; unsigned int -find_keyboaFRDP_layout_in_xorg_rules(char* layout, char* variant) +find_keyboard_layout_in_xorg_rules(char* layout, char* variant) { int i; int j; @@ -1108,7 +1108,7 @@ find_keyboaFRDP_layout_in_xorg_rules(char* layout, char* variant) #if defined(sun) unsigned int -detect_keyboaFRDP_type_and_layout_sunos(char* xkbfile, int length) +detect_keyboard_type_and_layout_sunos(char* xkbfile, int length) { FILE* kbd; diff --git a/libfreerdp-kbd/x_layout_id_table.h b/libfreerdp-kbd/x_layout_id_table.h index bfc54e339..440a9e86e 100644 --- a/libfreerdp-kbd/x_layout_id_table.h +++ b/libfreerdp-kbd/x_layout_id_table.h @@ -23,11 +23,11 @@ #define __LAYOUTS_X_H unsigned int -find_keyboaFRDP_layout_in_xorg_rules(char* layout, char* variant); +find_keyboard_layout_in_xorg_rules(char* layout, char* variant); #if defined(sun) unsigned int -detect_keyboaFRDP_type_and_layout_sunos(char* xkbfile, int length); +detect_keyboard_type_and_layout_sunos(char* xkbfile, int length); #endif #endif