libfreerdp-gdi: fix compilation

This commit is contained in:
Marc-André Moreau
2011-06-30 21:23:36 -04:00
parent e038b068b8
commit 32cfd0f325
30 changed files with 2817 additions and 86 deletions

157
include/freerdp/freerdp.h Normal file
View File

@@ -0,0 +1,157 @@
/**
* 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_H
#define __FREERDP_H
#include "rdpset.h"
#include "types/ui.h"
#include "rdpext.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 __cplusplus
extern "C" {
#endif
FREERDP_API FRDP_BOOL
freerdp_global_init(void);
FREERDP_API void
freerdp_global_finish(void);
struct rdp_inst
{
int version;
int size;
rdpSet * settings;
void * rdp;
void * param1;
void * param2;
void * param3;
void * param4;
uint32 disc_reason;
/* calls from ui to library */
int (* rdp_connect)(rdpInst * inst);
int (* rdp_get_fds)(rdpInst * inst, void ** read_fds, int * read_count,
void ** write_fds, int * write_count);
int (* rdp_check_fds)(rdpInst * inst);
int (* rdp_send_input_scancode)(rdpInst * inst, FRDP_BOOL up, FRDP_BOOL extended, uint8 keyCode);
int (* rdp_send_input_unicode)(rdpInst * inst, uint16 character);
int (* rdp_send_input_mouse)(rdpInst * inst, uint16 pointerFlags, uint16 xPos, uint16 yPos);
int (* rdp_sync_input)(rdpInst * inst, int toggle_flags);
int (* rdp_channel_data)(rdpInst * inst, int chan_id, char * data, int data_size);
void (*rdp_suppress_output)(rdpInst * inst, int allow_display_updates);
void (* rdp_disconnect)(rdpInst * inst);
int (* rdp_send_frame_ack)(rdpInst * inst, int frame_id);
/* calls from library to ui */
void (* ui_error)(rdpInst * inst, const char * text);
void (* ui_warning)(rdpInst * inst, const char * text);
void (* ui_unimpl)(rdpInst * inst, const char * text);
void (* ui_begin_update)(rdpInst * inst);
void (* ui_end_update)(rdpInst * inst);
void (* ui_desktop_save)(rdpInst * inst, int offset, int x, int y,
int cx, int cy);
void (* ui_desktop_restore)(rdpInst * inst, int offset, int x, int y,
int cx, int cy);
FRDP_HBITMAP (* ui_create_bitmap)(rdpInst * inst, int width, int height, uint8 * data);
void (* ui_paint_bitmap)(rdpInst * inst, int x, int y, int cx, int cy, int width,
int height, uint8 * data);
void (* ui_destroy_bitmap)(rdpInst * inst, FRDP_HBITMAP bmp);
void (* ui_line)(rdpInst * inst, uint8 opcode, int startx, int starty, int endx,
int endy, FRDP_PEN * pen);
void (* ui_rect)(rdpInst * inst, int x, int y, int cx, int cy, uint32 color);
void (* ui_polygon)(rdpInst * inst, uint8 opcode, uint8 fillmode, FRDP_POINT * point,
int npoints, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor);
void (* ui_polyline)(rdpInst * inst, uint8 opcode, FRDP_POINT * points, int npoints,
FRDP_PEN * pen);
void (* ui_ellipse)(rdpInst * inst, uint8 opcode, uint8 fillmode, int x, int y,
int cx, int cy, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor);
void (* ui_start_draw_glyphs)(rdpInst * inst, uint32 bgcolor, uint32 fgcolor);
void (* ui_draw_glyph)(rdpInst * inst, int x, int y, int cx, int cy,
FRDP_HGLYPH glyph);
void (* ui_end_draw_glyphs)(rdpInst * inst, int x, int y, int cx, int cy);
uint32 (* ui_get_toggle_keys_state)(rdpInst * inst);
void (* ui_bell)(rdpInst * inst);
void (* ui_destblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy);
void (* ui_patblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor);
void (* ui_screenblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
int srcx, int srcy);
void (* ui_memblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
FRDP_HBITMAP src, int srcx, int srcy);
void (* ui_triblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
FRDP_HBITMAP src, int srcx, int srcy, FRDP_BRUSH * brush, uint32 bgcolor, uint32 fgcolor);
FRDP_HGLYPH (* ui_create_glyph)(rdpInst * inst, int width, int height, uint8 * data);
void (* ui_destroy_glyph)(rdpInst * inst, FRDP_HGLYPH glyph);
int (* ui_select)(rdpInst * inst, int rdp_socket);
void (* ui_set_clip)(rdpInst * inst, int x, int y, int cx, int cy);
void (* ui_reset_clip)(rdpInst * inst);
void (* ui_resize_window)(rdpInst * inst);
void (* ui_set_cursor)(rdpInst * inst, FRDP_HCURSOR cursor);
void (* ui_destroy_cursor)(rdpInst * inst, FRDP_HCURSOR cursor);
FRDP_HCURSOR (* ui_create_cursor)(rdpInst * inst, unsigned int x, unsigned int y,
int width, int height, uint8 * andmask, uint8 * xormask, int bpp);
void (* ui_set_null_cursor)(rdpInst * inst);
void (* ui_set_default_cursor)(rdpInst * inst);
FRDP_HPALETTE (* ui_create_palette)(rdpInst * inst, FRDP_PALETTE * palette);
void (* ui_set_palette)(rdpInst * inst, FRDP_HPALETTE palette);
void (* ui_move_pointer)(rdpInst * inst, int x, int y);
FRDP_HBITMAP (* ui_create_surface)(rdpInst * inst, int width, int height, FRDP_HBITMAP old);
void (* ui_set_surface)(rdpInst * inst, FRDP_HBITMAP surface);
void (* ui_destroy_surface)(rdpInst * inst, FRDP_HBITMAP surface);
void (* ui_channel_data)(rdpInst * inst, int chan_id, char * data, int data_size,
int flags, int total_size);
FRDP_BOOL (* ui_authenticate)(rdpInst * inst);
int (* ui_decode)(rdpInst * inst, uint8 * data, int data_size);
FRDP_BOOL (* ui_check_certificate)(rdpInst * inst, const char * fingerprint,
const char * subject, const char * issuer, FRDP_BOOL verified);
};
FREERDP_API rdpInst *
freerdp_new(rdpSet * settings);
FREERDP_API void
freerdp_free(rdpInst * inst);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -22,11 +22,11 @@
#include "types/base.h"
#define RDP_KEYBOARD_LAYOUT_TYPE_STANDARD 1
#define RDP_KEYBOARD_LAYOUT_TYPE_VARIANT 2
#define RDP_KEYBOARD_LAYOUT_TYPE_IME 4
#define RDP_KEYBOAFRDP_LAYOUT_TYPE_STANDARD 1
#define RDP_KEYBOAFRDP_LAYOUT_TYPE_VARIANT 2
#define RDP_KEYBOAFRDP_LAYOUT_TYPE_IME 4
typedef struct rdp_keyboard_layout
typedef struct rdp_keyboaFRDP_layout
{
uint32 code;
char name[50];
@@ -35,10 +35,10 @@ typedef struct rdp_keyboard_layout
rdpKeyboardLayout *
freerdp_kbd_get_layouts(int types);
unsigned int
freerdp_kbd_init(void *dpy, unsigned int keyboard_layout_id);
freerdp_kbd_init(void *dpy, unsigned int keyboaFRDP_layout_id);
uint8
freerdp_kbd_get_scancode_by_keycode(uint8 keycode, fbool * extended);
freerdp_kbd_get_scancode_by_keycode(uint8 keycode, FRDP_BOOL * extended);
uint8
freerdp_kbd_get_scancode_by_virtualkey(int vkcode, fbool * extended);
freerdp_kbd_get_scancode_by_virtualkey(int vkcode, FRDP_BOOL * extended);
#endif /* __FREERDP_KBD_H */

64
include/freerdp/rdpext.h Normal file
View File

@@ -0,0 +1,64 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* RDP Extensions
*
* Copyright 2010-2011 Vic Lee
*
* 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 __RDPEXT_H
#define __RDPEXT_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
#define RDPEXT_EXPORT_FUNC_NAME "FreeRDPExtensionEntry"
typedef struct rdp_ext_plugin rdpExtPlugin;
struct rdp_ext_plugin
{
void * ext;
int (*init) (rdpExtPlugin * plugin, rdpInst * inst);
int (*uninit) (rdpExtPlugin * plugin, rdpInst * inst);
};
typedef uint32 (RDPEXT_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);
struct _FREERDP_EXTENSION_ENTRY_POINTS
{
void * ext; /* Reference to internal instance */
PREGISTEREXTENSION pRegisterExtension;
PREGISTERPRECONNECTHOOK pRegisterPreConnectHook;
PREGISTERPOSTCONNECTHOOK pRegisterPostConnectHook;
void * data;
};
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);
#endif

98
include/freerdp/rdpset.h Normal file
View File

@@ -0,0 +1,98 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* RDP Settings
*
* 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 __RDPSET_H
#define __RDPSET_H
struct rdp_chan
{
char name[8]; /* ui sets */
int flags; /* ui sets */
int chan_id; /* core sets */
void * handle; /* just for ui */
};
struct rdp_ext_set
{
char name[256]; /* plugin name or path */
void * data; /* plugin data */
};
struct rdp_monitor
{
int x;
int y;
int width;
int height;
int is_primary;
};
struct rdp_set
{
int width;
int height;
char hostname[16];
char server[64];
char domain[16];
char password[64];
char shell[256];
char directory[256];
char username[256];
int tcp_port_rdp;
int keyboard_layout;
int keyboard_type;
int keyboard_subtype;
int keyboard_functionkeys;
char xkb_layout[32];
char xkb_variant[32];
int tls_security;
int nla_security;
int rdp_security;
int encryption;
int rdp_version;
int remote_app;
char app_name[64];
int console_session;
int server_depth;
int bitmap_cache;
int bitmap_cache_persist_enable;
int bitmap_cache_precache;
int bitmap_compression;
int performanceflags;
int desktop_save;
int polygon_ellipse_orders;
int autologin;
int console_audio;
int off_screen_bitmaps;
int triblt;
int new_cursors;
int mouse_motion;
int bulk_compression;
int rfx_flags;
int ui_decode_flags;
int use_frame_ack;
int num_channels;
int software_gdi;
struct rdp_chan channels[16];
struct rdp_ext_set extensions[16];
int num_monitors;
struct rdp_monitor monitors[16];
};
#endif /* __RDPSET_H */

View File

@@ -42,6 +42,6 @@ typedef signed long long sint64;
#define False (0)
#endif
typedef int fbool;
typedef int FRDP_BOOL;
#endif

140
include/freerdp/types/ui.h Normal file
View File

@@ -0,0 +1,140 @@
/**
* FreeRDP: A Remote Desktop Protocol Client
* User Interface Types
*
* 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 __TYPES_UI_H
#define __TYPES_UI_H
#include <freerdp/types/base.h>
typedef void *FRDP_HBITMAP;
typedef void *FRDP_HGLYPH;
typedef void *FRDP_HPALETTE;
typedef void *FRDP_HCURSOR;
typedef struct _FRDP_POINT
{
sint16 x, y;
}
FRDP_POINT;
typedef struct _FRDP_PALETTEENTRY
{
uint8 red;
uint8 green;
uint8 blue;
}
FRDP_PALETTEENTRY;
typedef struct _FRDP_PALETTE
{
uint16 count;
FRDP_PALETTEENTRY *entries;
}
FRDP_PALETTE;
typedef struct _FRDP_PEN
{
uint8 style;
uint8 width;
uint32 color;
}
FRDP_PEN;
/* this is whats in the brush cache */
typedef struct _FRDP_BRUSHDATA
{
uint32 color_code;
uint32 data_size;
uint8 *data;
}
FRDP_BRUSHDATA;
typedef struct _FRDP_BRUSH
{
uint8 xorigin;
uint8 yorigin;
uint8 style;
uint8 pattern[8];
FRDP_BRUSHDATA *bd;
}
FRDP_BRUSH;
typedef struct _FRDP_PLUGIN_DATA
{
uint16 size;
void * data[4];
}
FRDP_PLUGIN_DATA;
typedef struct _FRDP_RECT
{
sint16 x;
sint16 y;
sint16 width;
sint16 height;
}
FRDP_RECT;
typedef struct _FRDP_EVENT FRDP_EVENT;
typedef void (*FRDP_EVENT_CALLBACK) (FRDP_EVENT * event);
struct _FRDP_EVENT
{
uint16 event_type;
FRDP_EVENT_CALLBACK event_callback;
void * user_data;
};
struct _FRDP_VIDEO_FRAME_EVENT
{
FRDP_EVENT event;
uint8 * frame_data;
uint32 frame_size;
uint32 frame_pixfmt;
sint16 frame_width;
sint16 frame_height;
sint16 x;
sint16 y;
sint16 width;
sint16 height;
uint16 num_visible_rects;
FRDP_RECT * visible_rects;
};
typedef struct _FRDP_VIDEO_FRAME_EVENT FRDP_VIDEO_FRAME_EVENT;
struct _FRDP_REDRAW_EVENT
{
FRDP_EVENT event;
sint16 x;
sint16 y;
sint16 width;
sint16 height;
};
typedef struct _FRDP_REDRAW_EVENT FRDP_REDRAW_EVENT;
/* defined in include/freerdp/freerdp.h */
struct rdp_inst;
typedef struct rdp_inst rdpInst;
/* defined in include/freerdp/rdpset.h */
struct rdp_set;
typedef struct rdp_set rdpSet;
#endif