Merge branch 'master' of github.com:FreeRDP/FreeRDP-1.0

This commit is contained in:
Marc-André Moreau 2011-07-07 10:33:46 -04:00
commit 337a328342
17 changed files with 110 additions and 80 deletions

53
include/freerdp/api.h Normal file
View File

@ -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

View File

@ -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

View File

@ -20,14 +20,9 @@
#ifndef __RDP_EXTENSION_H
#define __RDP_EXTENSION_H
#include <freerdp/api.h>
#include <freerdp/types/ui.h>
#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 */

View File

@ -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 <freerdp/api.h>
#include <freerdp/types/ui.h>
#include <freerdp/settings.h>
#include <freerdp/extension.h>
#ifdef __cplusplus
extern "C" {

View File

@ -20,13 +20,13 @@
#ifndef __FREERDP_KBD_H
#define __FREERDP_KBD_H
#include "types/base.h"
#include <freerdp/types/base.h>
#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

View File

@ -20,7 +20,7 @@
#ifndef __RDP_SETTINGS_H
#define __RDP_SETTINGS_H
#include <freerdp/freerdp.h>
#include <freerdp/types/base.h>
struct rdp_chan
{

View File

@ -25,7 +25,7 @@
#include <time.h>
#include <freerdp/settings.h>
#include <freerdp/types/base.h>
#include <freerdp/types/ui.h>
#include <freerdp/utils/stream.h>
enum _TRANSPORT_STATE

View File

@ -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 <stddef.h>
@ -584,4 +584,4 @@ static const virtualKey virtualKeyboard[256 + 2] =
{ 0x1C, 1, "" , "KPEN" },
};
#endif /* __KEYBOAFRDP_H */
#endif /* __KEYBOARD_H */

View File

@ -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));

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -422,7 +422,7 @@ static const localeAndKeyboardLayout defaultKeyboardLayouts[] =
};
unsigned int
detect_keyboaFRDP_layout_from_locale()
detect_keyboard_layout_from_locale()
{
int i;
int j;

View File

@ -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 */

View File

@ -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;

View File

@ -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