~paulliu/ubuntu/quantal/freerdp/fixext

« back to all changes in this revision

Viewing changes to include/freerdp/freerdp.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, Jeremy Bicha, Jean-Louis Dupond, Martin Pitt
  • Date: 2012-01-31 10:02:14 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120131100214-jaok3uwvni7sqxth
Tags: 1.0.0-0git1
Upload current Debian packaging git to get this rolling for precise.

[ Jeremy Bicha ]
* New upstream release. Closes: #647498.
* Updated symbols and bumped soname
* debian/control:
  - Added new build dependencies
  - Bump Standards-Version to 3.9.2
* debian/source/format: Set to 3.0 (quilt)
* debian/rules: Turn on strict symbols checking
* debian/watch: Watch github

[ Jean-Louis Dupond ]
* debian/control: Updated homepage
* debian/copyright: Reflect upstream switch to the Apache license

[ Martin Pitt ]
* debian/libfreerdp0.symbols: Fix version number, should
  be 1.0~beta5, not 1.0-beta5.
* debian/control: Add libavcodec-dev build dependency, upstream build system
  checks for that. Thanks Jean-Louis Dupond!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
   Copyright (c) 2009-2010 Jay Sorg
3
 
 
4
 
   Permission is hereby granted, free of charge, to any person obtaining a
5
 
   copy of this software and associated documentation files (the "Software"),
6
 
   to deal in the Software without restriction, including without limitation
7
 
   the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
 
   and/or sell copies of the Software, and to permit persons to whom the
9
 
   Software is furnished to do so, subject to the following conditions:
10
 
 
11
 
   The above copyright notice and this permission notice shall be included
12
 
   in all copies or substantial portions of the Software.
13
 
 
14
 
   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
 
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
 
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
 
   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
 
   DEALINGS IN THE SOFTWARE.
21
 
*/
 
1
/**
 
2
 * FreeRDP: A Remote Desktop Protocol Client
 
3
 * FreeRDP Interface
 
4
 *
 
5
 * Copyright 2009-2011 Jay Sorg
 
6
 *
 
7
 * Licensed under the Apache License, Version 2.0 (the "License");
 
8
 * you may not use this file except in compliance with the License.
 
9
 * You may obtain a copy of the License at
 
10
 *
 
11
 *     http://www.apache.org/licenses/LICENSE-2.0
 
12
 *
 
13
 * Unless required by applicable law or agreed to in writing, software
 
14
 * distributed under the License is distributed on an "AS IS" BASIS,
 
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
16
 * See the License for the specific language governing permissions and
 
17
 * limitations under the License.
 
18
 */
22
19
 
23
20
#ifndef __FREERDP_H
24
21
#define __FREERDP_H
25
22
 
26
 
#include <freerdp/rdpset.h>
27
 
#include <freerdp/types_ui.h>
28
 
#include <freerdp/constants_ui.h>
29
 
 
30
 
#define FREERDP_INTERFACE_VERSION 3
31
 
 
32
 
#if defined _WIN32 || defined __CYGWIN__
33
 
  #ifdef FREERDP_EXPORTS
34
 
    #ifdef __GNUC__
35
 
      #define FREERDP_API __attribute__((dllexport))
36
 
    #else
37
 
      #define FREERDP_API __declspec(dllexport)
38
 
    #endif
39
 
  #else
40
 
    #ifdef __GNUC__
41
 
      #define FREERDP_API __attribute__((dllimport))
42
 
    #else
43
 
      #define FREERDP_API __declspec(dllimport)
44
 
    #endif
45
 
  #endif
46
 
#else
47
 
  #if __GNUC__ >= 4
48
 
    #define FREERDP_API   __attribute__ ((visibility("default")))
49
 
  #else
50
 
    #define FREERDP_API
51
 
  #endif
52
 
#endif
 
23
typedef struct rdp_rdp rdpRdp;
 
24
typedef struct rdp_gdi rdpGdi;
 
25
typedef struct rdp_rail rdpRail;
 
26
typedef struct rdp_cache rdpCache;
 
27
typedef struct rdp_channels rdpChannels;
 
28
typedef struct rdp_graphics rdpGraphics;
 
29
 
 
30
typedef struct rdp_freerdp freerdp;
 
31
typedef struct rdp_context rdpContext;
 
32
typedef struct rdp_freerdp_peer freerdp_peer;
 
33
 
 
34
#include <freerdp/api.h>
 
35
#include <freerdp/types.h>
 
36
#include <freerdp/settings.h>
 
37
#include <freerdp/extension.h>
 
38
 
 
39
#include <freerdp/input.h>
 
40
#include <freerdp/update.h>
53
41
 
54
42
#ifdef __cplusplus
55
43
extern "C" {
56
44
#endif
57
45
 
58
 
RD_BOOL
59
 
freerdp_global_init(void);
60
 
void
61
 
freerdp_global_finish(void);
62
 
 
63
 
struct rdp_inst
64
 
{
65
 
        int version;
66
 
        int size;
67
 
        rdpSet * settings;
68
 
        void * rdp;
69
 
        void * param1;
70
 
        void * param2;
71
 
        void * param3;
72
 
        void * param4;
73
 
        uint32 disc_reason;
74
 
        /* calls from ui to library */
75
 
        int (* rdp_connect)(rdpInst * inst);
76
 
        int (* rdp_get_fds)(rdpInst * inst, void ** read_fds, int * read_count,
77
 
                void ** write_fds, int * write_count);
78
 
        int (* rdp_check_fds)(rdpInst * inst);
79
 
        int (* rdp_send_input)(rdpInst * inst, int message_type, int device_flags,
80
 
                int param1, int param2);
81
 
        int (* rdp_sync_input)(rdpInst * inst, int toggle_flags);
82
 
        int (* rdp_channel_data)(rdpInst * inst, int chan_id, char * data, int data_size);
83
 
        void (* rdp_disconnect)(rdpInst * inst);
84
 
        /* calls from library to ui */
85
 
        void (* ui_error)(rdpInst * inst, const char * text);
86
 
        void (* ui_warning)(rdpInst * inst, const char * text);
87
 
        void (* ui_unimpl)(rdpInst * inst, const char * text);
88
 
        void (* ui_begin_update)(rdpInst * inst);
89
 
        void (* ui_end_update)(rdpInst * inst);
90
 
        void (* ui_desktop_save)(rdpInst * inst, int offset, int x, int y,
91
 
                int cx, int cy);
92
 
        void (* ui_desktop_restore)(rdpInst * inst, int offset, int x, int y,
93
 
                int cx, int cy);
94
 
        RD_HBITMAP (* ui_create_bitmap)(rdpInst * inst, int width, int height, uint8 * data);
95
 
        void (* ui_paint_bitmap)(rdpInst * inst, int x, int y, int cx, int cy, int width,
96
 
                int height, uint8 * data);
97
 
        void (* ui_destroy_bitmap)(rdpInst * inst, RD_HBITMAP bmp);
98
 
        void (* ui_line)(rdpInst * inst, uint8 opcode, int startx, int starty, int endx,
99
 
                int endy, RD_PEN * pen);
100
 
        void (* ui_rect)(rdpInst * inst, int x, int y, int cx, int cy, int color);
101
 
        void (* ui_polygon)(rdpInst * inst, uint8 opcode, uint8 fillmode, RD_POINT * point,
102
 
                int npoints, RD_BRUSH * brush, int bgcolor, int fgcolor);
103
 
        void (* ui_polyline)(rdpInst * inst, uint8 opcode, RD_POINT * points, int npoints,
104
 
                RD_PEN * pen);
105
 
        void (* ui_ellipse)(rdpInst * inst, uint8 opcode, uint8 fillmode, int x, int y,
106
 
                int cx, int cy, RD_BRUSH * brush, int bgcolor, int fgcolor);
107
 
        void (* ui_start_draw_glyphs)(rdpInst * inst, int bgcolor, int fgcolor);
108
 
        void (* ui_draw_glyph)(rdpInst * inst, int x, int y, int cx, int cy,
109
 
                RD_HGLYPH glyph);
110
 
        void (* ui_end_draw_glyphs)(rdpInst * inst, int x, int y, int cx, int cy);
111
 
        uint32 (* ui_get_toggle_keys_state)(rdpInst * inst);
112
 
        void (* ui_bell)(rdpInst * inst);
113
 
        void (* ui_destblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy);
114
 
        void (* ui_patblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
115
 
                RD_BRUSH * brush, int bgcolor, int fgcolor);
116
 
        void (* ui_screenblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
117
 
                int srcx, int srcy);
118
 
        void (* ui_memblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
119
 
                RD_HBITMAP src, int srcx, int srcy);
120
 
        void (* ui_triblt)(rdpInst * inst, uint8 opcode, int x, int y, int cx, int cy,
121
 
                RD_HBITMAP src, int srcx, int srcy, RD_BRUSH * brush, int bgcolor, int fgcolor);
122
 
        RD_HGLYPH (* ui_create_glyph)(rdpInst * inst, int width, int height, uint8 * data);
123
 
        void (* ui_destroy_glyph)(rdpInst * inst, RD_HGLYPH glyph);
124
 
        int (* ui_select)(rdpInst * inst, int rdp_socket);
125
 
        void (* ui_set_clip)(rdpInst * inst, int x, int y, int cx, int cy);
126
 
        void (* ui_reset_clip)(rdpInst * inst);
127
 
        void (* ui_resize_window)(rdpInst * inst);
128
 
        void (* ui_set_cursor)(rdpInst * inst, RD_HCURSOR cursor);
129
 
        void (* ui_destroy_cursor)(rdpInst * inst, RD_HCURSOR cursor);
130
 
        RD_HCURSOR (* ui_create_cursor)(rdpInst * inst, unsigned int x, unsigned int y,
131
 
                int width, int height, uint8 * andmask, uint8 * xormask, int bpp);
132
 
        void (* ui_set_null_cursor)(rdpInst * inst);
133
 
        void (* ui_set_default_cursor)(rdpInst * inst);
134
 
        RD_HPALETTE (* ui_create_colormap)(rdpInst * inst, RD_PALETTE * colors);
135
 
        void (* ui_move_pointer)(rdpInst * inst, int x, int y);
136
 
        void (* ui_set_colormap)(rdpInst * inst, RD_HPALETTE map);
137
 
        RD_HBITMAP (* ui_create_surface)(rdpInst * inst, int width, int height, RD_HBITMAP old);
138
 
        void (* ui_set_surface)(rdpInst * inst, RD_HBITMAP surface);
139
 
        void (* ui_destroy_surface)(rdpInst * inst, RD_HBITMAP surface);
140
 
        void (* ui_channel_data)(rdpInst * inst, int chan_id, char * data, int data_size,
141
 
                int flags, int total_size);
142
 
};
143
 
 
144
 
FREERDP_API rdpInst *
145
 
freerdp_new(rdpSet * settings);
146
 
FREERDP_API void
147
 
freerdp_free(rdpInst * inst);
 
46
typedef void (*pContextNew)(freerdp* instance, rdpContext* context);
 
47
typedef void (*pContextFree)(freerdp* instance, rdpContext* context);
 
48
 
 
49
typedef boolean (*pPreConnect)(freerdp* instance);
 
50
typedef boolean (*pPostConnect)(freerdp* instance);
 
51
typedef boolean (*pAuthenticate)(freerdp* instance, char** username, char** password, char** domain);
 
52
typedef boolean (*pVerifyCertificate)(freerdp* instance, char* subject, char* issuer, char* fingerprint);
 
53
 
 
54
typedef int (*pSendChannelData)(freerdp* instance, int channelId, uint8* data, int size);
 
55
typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size);
 
56
 
 
57
struct rdp_context
 
58
{
 
59
        freerdp* instance; /* 0 */
 
60
        freerdp_peer* peer; /* 1 */
 
61
        uint32 paddingA[16 - 2]; /* 2 */
 
62
 
 
63
        int argc; /* 16 */
 
64
        char** argv; /* 17 */
 
65
        uint32 paddingB[32 - 18]; /* 18 */
 
66
 
 
67
        rdpRdp* rdp; /* 32 */
 
68
        rdpGdi* gdi; /* 33 */
 
69
        rdpRail* rail; /* 34 */
 
70
        rdpCache* cache; /* 35 */
 
71
        rdpChannels* channels; /* 36 */
 
72
        rdpGraphics* graphics; /* 37 */
 
73
        uint32 paddingC[64 - 38]; /* 38 */
 
74
};
 
75
 
 
76
struct rdp_freerdp
 
77
{
 
78
        rdpContext* context; /* 0 */
 
79
        uint32 paddingA[16 - 1]; /* 1 */
 
80
 
 
81
        rdpInput* input; /* 16 */
 
82
        rdpUpdate* update; /* 17 */
 
83
        rdpSettings* settings; /* 18 */
 
84
        uint32 paddingB[32 - 19]; /* 19 */
 
85
 
 
86
        size_t context_size; /* 32 */
 
87
        pContextNew ContextNew; /* 33 */
 
88
        pContextFree ContextFree; /* 34 */
 
89
        uint32 paddingC[48 - 35]; /* 35 */
 
90
 
 
91
        pPreConnect PreConnect; /* 48 */
 
92
        pPostConnect PostConnect; /* 49 */
 
93
        pAuthenticate Authenticate; /* 50 */
 
94
        pVerifyCertificate VerifyCertificate; /* 51 */
 
95
        uint32 paddingD[64 - 52]; /* 52 */
 
96
 
 
97
        pSendChannelData SendChannelData; /* 64 */
 
98
        pReceiveChannelData ReceiveChannelData; /* 65 */
 
99
        uint32 paddingE[80 - 66]; /* 66 */
 
100
};
 
101
 
 
102
FREERDP_API void freerdp_context_new(freerdp* instance);
 
103
FREERDP_API void freerdp_context_free(freerdp* instance);
 
104
 
 
105
FREERDP_API boolean freerdp_connect(freerdp* instance);
 
106
FREERDP_API boolean freerdp_disconnect(freerdp* instance);
 
107
 
 
108
FREERDP_API boolean freerdp_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount);
 
109
FREERDP_API boolean freerdp_check_fds(freerdp* instance);
 
110
 
 
111
FREERDP_API void freerdp_send_keep_alive(freerdp* instance);
 
112
FREERDP_API uint32 freerdp_error_info(freerdp* instance);
 
113
 
 
114
FREERDP_API void freerdp_get_version(int* major, int* minor, int* revision);
 
115
 
 
116
FREERDP_API freerdp* freerdp_new();
 
117
FREERDP_API void freerdp_free(freerdp* instance);
148
118
 
149
119
#ifdef __cplusplus
150
120
}