2013-03-19 04:12:51 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
* Windows Client
|
|
|
|
*
|
|
|
|
* Copyright 2009-2011 Jay Sorg
|
|
|
|
* Copyright 2010-2011 Vic Lee
|
|
|
|
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2013-03-19 05:54:50 +04:00
|
|
|
#ifndef __WF_INTERFACE_H
|
|
|
|
#define __WF_INTERFACE_H
|
2013-03-19 04:12:51 +04:00
|
|
|
|
|
|
|
#include <winpr/windows.h>
|
|
|
|
|
2013-03-19 05:54:50 +04:00
|
|
|
#include <freerdp/api.h>
|
2013-03-19 04:12:51 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
|
|
|
#include <freerdp/gdi/gdi.h>
|
|
|
|
#include <freerdp/gdi/dc.h>
|
|
|
|
#include <freerdp/gdi/region.h>
|
|
|
|
#include <freerdp/cache/cache.h>
|
|
|
|
#include <freerdp/codec/color.h>
|
|
|
|
#include <freerdp/utils/debug.h>
|
|
|
|
#include <freerdp/channels/channels.h>
|
|
|
|
#include <freerdp/codec/rfx.h>
|
|
|
|
#include <freerdp/codec/nsc.h>
|
|
|
|
|
|
|
|
#include "wf_event.h"
|
|
|
|
|
2013-04-09 02:27:59 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 04:12:51 +04:00
|
|
|
struct wf_bitmap
|
|
|
|
{
|
|
|
|
rdpBitmap _bitmap;
|
|
|
|
HDC hdc;
|
|
|
|
HBITMAP bitmap;
|
|
|
|
HBITMAP org_bitmap;
|
|
|
|
BYTE* pdata;
|
|
|
|
};
|
|
|
|
typedef struct wf_bitmap wfBitmap;
|
|
|
|
|
|
|
|
struct wf_pointer
|
|
|
|
{
|
|
|
|
rdpPointer pointer;
|
|
|
|
HCURSOR cursor;
|
|
|
|
};
|
|
|
|
typedef struct wf_pointer wfPointer;
|
|
|
|
|
|
|
|
typedef struct wf_info wfInfo;
|
|
|
|
|
|
|
|
struct wf_context
|
|
|
|
{
|
|
|
|
rdpContext _p;
|
|
|
|
|
|
|
|
wfInfo* wfi;
|
|
|
|
};
|
|
|
|
typedef struct wf_context wfContext;
|
|
|
|
|
|
|
|
struct wf_info
|
|
|
|
{
|
2013-04-09 06:10:59 +04:00
|
|
|
rdpClient* client;
|
|
|
|
|
2013-03-19 04:12:51 +04:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
int offset_x;
|
|
|
|
int offset_y;
|
|
|
|
int fs_toggle;
|
|
|
|
int fullscreen;
|
|
|
|
int percentscreen;
|
|
|
|
char window_title[64];
|
2013-04-11 00:58:14 +04:00
|
|
|
int client_width;
|
|
|
|
int client_height;
|
2013-03-19 04:12:51 +04:00
|
|
|
|
2013-03-19 05:54:50 +04:00
|
|
|
HANDLE thread;
|
|
|
|
HANDLE keyboardThread;
|
|
|
|
|
|
|
|
HICON icon;
|
2013-03-19 21:17:30 +04:00
|
|
|
HWND hWndParent;
|
2013-03-19 05:54:50 +04:00
|
|
|
HINSTANCE hInstance;
|
|
|
|
WNDCLASSEX wndClass;
|
|
|
|
LPCTSTR wndClassName;
|
|
|
|
HCURSOR hDefaultCursor;
|
|
|
|
|
2013-03-19 04:12:51 +04:00
|
|
|
HWND hwnd;
|
|
|
|
POINT diff;
|
|
|
|
HGDI_DC hdc;
|
|
|
|
UINT16 srcBpp;
|
|
|
|
UINT16 dstBpp;
|
|
|
|
freerdp* instance;
|
|
|
|
wfBitmap* primary;
|
|
|
|
wfBitmap* drawing;
|
|
|
|
HCLRCONV clrconv;
|
|
|
|
HCURSOR cursor;
|
|
|
|
HBRUSH brush;
|
|
|
|
HBRUSH org_brush;
|
|
|
|
RECT update_rect;
|
2013-04-11 00:58:14 +04:00
|
|
|
RECT scale_update_rect;
|
2013-03-19 04:12:51 +04:00
|
|
|
|
|
|
|
wfBitmap* tile;
|
2013-04-11 00:58:14 +04:00
|
|
|
DWORD mainThreadId;
|
2013-03-19 04:12:51 +04:00
|
|
|
RFX_CONTEXT* rfx_context;
|
|
|
|
NSC_CONTEXT* nsc_context;
|
|
|
|
|
|
|
|
BOOL sw_gdi;
|
|
|
|
};
|
|
|
|
|
2013-04-09 02:27:59 +04:00
|
|
|
/**
|
|
|
|
* Client Interface
|
|
|
|
*/
|
|
|
|
|
2013-04-09 06:10:59 +04:00
|
|
|
#define cfInfo wfInfo
|
|
|
|
|
|
|
|
FREERDP_API int freerdp_client_global_init();
|
|
|
|
FREERDP_API int freerdp_client_global_uninit();
|
2013-03-19 04:12:51 +04:00
|
|
|
|
2013-04-09 06:10:59 +04:00
|
|
|
FREERDP_API int freerdp_client_start(wfInfo* cfi);
|
|
|
|
FREERDP_API int freerdp_client_stop(wfInfo* cfi);
|
2013-03-19 04:12:51 +04:00
|
|
|
|
2013-04-11 00:58:14 +04:00
|
|
|
FREERDP_API int freerdp_client_focus_in(wfInfo* cfi);
|
|
|
|
FREERDP_API int freerdp_client_focus_out(wfInfo* cfi);
|
|
|
|
|
|
|
|
FREERDP_API int freerdp_client_set_window_size(wfInfo* cfi, int width, int height);
|
|
|
|
|
2013-04-09 06:10:59 +04:00
|
|
|
FREERDP_API cfInfo* freerdp_client_new(int argc, char** argv);
|
|
|
|
FREERDP_API int freerdp_client_free(wfInfo* cfi);
|
2013-03-19 04:12:51 +04:00
|
|
|
|
2013-04-09 02:27:59 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-03-19 04:12:51 +04:00
|
|
|
#endif
|