FreeRDP
xf_client.c File Reference
#include <assert.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/XKBlib.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
#include <string.h>
#include <termios.h>
#include <pthread.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/select.h>
#include <freerdp/freerdp.h>
#include <freerdp/constants.h>
#include <freerdp/codec/nsc.h>
#include <freerdp/codec/rfx.h>
#include <freerdp/codec/color.h>
#include <freerdp/codec/bitmap.h>
#include <freerdp/utils/signal.h>
#include <freerdp/utils/passphrase.h>
#include <freerdp/client/cliprdr.h>
#include <freerdp/client/channels.h>
#include <freerdp/client/file.h>
#include <freerdp/client/cmdline.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/file.h>
#include <winpr/print.h>
#include <winpr/sysinfo.h>
#include "xf_gdi.h"
#include "xf_rail.h"
#include "xf_tsmf.h"
#include "xf_event.h"
#include "xf_input.h"
#include "xf_cliprdr.h"
#include "xf_disp.h"
#include "xf_video.h"
#include "xf_monitor.h"
#include "xf_graphics.h"
#include "xf_keyboard.h"
#include "xf_channels.h"
#include "xfreerdp.h"
#include <freerdp/log.h>

Macros

#define TAG   CLIENT_TAG("x11")
 

Functions

static int _xf_error_handler (Display *d, XErrorEvent *ev)
 
static void xf_check_extensions (xfContext *context)
 
static void xf_window_free (xfContext *xfc)
 
static BOOL xf_get_pixmap_info (xfContext *xfc)
 
void xf_draw_screen (xfContext *xfc, int x, int y, int w, int h)
 
static BOOL xf_desktop_resize (rdpContext *context)
 
static BOOL xf_sw_end_paint (rdpContext *context)
 
static BOOL xf_sw_desktop_resize (rdpContext *context)
 
static BOOL xf_hw_end_paint (rdpContext *context)
 
static BOOL xf_hw_desktop_resize (rdpContext *context)
 
static BOOL xf_process_x_events (freerdp *instance)
 
static char * xf_window_get_title (rdpSettings *settings)
 
BOOL xf_create_window (xfContext *xfc)
 
void xf_toggle_fullscreen (xfContext *xfc)
 
void xf_toggle_control (xfContext *xfc)
 
static UINT xf_encomsp_participant_created (EncomspClientContext *context, ENCOMSP_PARTICIPANT_CREATED_PDU *participantCreated)
 
void xf_encomsp_init (xfContext *xfc, EncomspClientContext *encomsp)
 
void xf_encomsp_uninit (xfContext *xfc, EncomspClientContext *encomsp)
 
void xf_lock_x11 (xfContext *xfc, BOOL display)
 
void xf_unlock_x11 (xfContext *xfc, BOOL display)
 
static int xf_error_handler (Display *d, XErrorEvent *ev)
 
static BOOL xf_play_sound (rdpContext *context, const PLAY_SOUND_UPDATE *play_sound)
 
static void xf_get_x11_button_map (xfContext *xfc, unsigned char *x11_map)
 
static UINT16 get_flags_for_button (int button)
 
static void xf_button_map_init (xfContext *xfc)
 
static BOOL xf_pre_connect (freerdp *instance)
 
static BOOL xf_post_connect (freerdp *instance)
 
static void xf_post_disconnect (freerdp *instance)
 
static int xf_logon_error_info (freerdp *instance, UINT32 data, UINT32 type)
 
static DWORD WINAPI xf_input_thread (LPVOID arg)
 
static BOOL handle_window_events (freerdp *instance)
 
static DWORD WINAPI xf_client_thread (LPVOID param)
 
DWORD xf_exit_code_from_disconnect_reason (DWORD reason)
 
static void xf_TerminateEventHandler (void *context, TerminateEventArgs *e)
 
static BOOL xfreerdp_client_global_init ()
 
static void xfreerdp_client_global_uninit ()
 
static int xfreerdp_client_start (rdpContext *context)
 
static int xfreerdp_client_stop (rdpContext *context)
 
static Atom get_supported_atom (xfContext *xfc, const char *atomName)
 
static BOOL xfreerdp_client_new (freerdp *instance, rdpContext *context)
 
static void xfreerdp_client_free (freerdp *instance, rdpContext *context)
 
int RdpClientEntry (RDP_CLIENT_ENTRY_POINTS *pEntryPoints)
 

Variables

static int(* _def_error_handler )(Display *, XErrorEvent *)
 
static const button_map xf_button_flags [NUM_BUTTONS_MAPPED]
 

Macro Definition Documentation

#define TAG   CLIENT_TAG("x11")

FreeRDP: A Remote Desktop Protocol Implementation X11 Client Interface

Copyright 2013 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2013 Corey Clayton can.o.nosp@m.f.tu.nosp@m.na@gm.nosp@m.ail..nosp@m.com Copyright 2014 Thincast Technologies GmbH Copyright 2014 Norbert Federa norbe.nosp@m.rt.f.nosp@m.edera.nosp@m.@thi.nosp@m.ncast.nosp@m..com Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2016 Thincast Technologies GmbH

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.

Function Documentation

static int _xf_error_handler ( Display *  d,
XErrorEvent *  ev 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT16 get_flags_for_button ( int  button)
static

Here is the caller graph for this function:

static Atom get_supported_atom ( xfContext *  xfc,
const char *  atomName 
)
static

Here is the caller graph for this function:

static BOOL handle_window_events ( freerdp *  instance)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int RdpClientEntry ( RDP_CLIENT_ENTRY_POINTS pEntryPoints)

Client Interface

Here is the call graph for this function:

static void xf_button_map_init ( xfContext *  xfc)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_check_extensions ( xfContext *  context)
static

Here is the caller graph for this function:

static DWORD WINAPI xf_client_thread ( LPVOID  param)
static

Main loop for the rdp connection. It will be run from the thread's entry point (thread_func()). It initiates the connection, and will continue to run until the session ends, processing events as they are received.

Parameters
instance- pointer to the rdp_freerdp structure that contains the session's settings
Returns
A code from the enum XF_EXIT_CODE (0 if successful)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL xf_create_window ( xfContext *  xfc)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_desktop_resize ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_draw_screen ( xfContext *  xfc,
int  x,
int  y,
int  w,
int  h 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_encomsp_init ( xfContext *  xfc,
EncomspClientContext *  encomsp 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT xf_encomsp_participant_created ( EncomspClientContext *  context,
ENCOMSP_PARTICIPANT_CREATED_PDU *  participantCreated 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

void xf_encomsp_uninit ( xfContext *  xfc,
EncomspClientContext *  encomsp 
)

Here is the caller graph for this function:

static int xf_error_handler ( Display *  d,
XErrorEvent *  ev 
)
static

Here is the caller graph for this function:

DWORD xf_exit_code_from_disconnect_reason ( DWORD  reason)

Here is the caller graph for this function:

static BOOL xf_get_pixmap_info ( xfContext *  xfc)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_get_x11_button_map ( xfContext *  xfc,
unsigned char *  x11_map 
)
static

Here is the caller graph for this function:

static BOOL xf_hw_desktop_resize ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_hw_end_paint ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD WINAPI xf_input_thread ( LPVOID  arg)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_lock_x11 ( xfContext *  xfc,
BOOL  display 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int xf_logon_error_info ( freerdp *  instance,
UINT32  data,
UINT32  type 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_play_sound ( rdpContext *  context,
const PLAY_SOUND_UPDATE *  play_sound 
)
static

Here is the caller graph for this function:

static BOOL xf_post_connect ( freerdp *  instance)
static

Callback given to freerdp_connect() to perform post-connection operations. It will be called only if the connection was initialized properly, and will continue the initialization based on the newly created connection.

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_post_disconnect ( freerdp *  instance)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_pre_connect ( freerdp *  instance)
static

Callback given to freerdp_connect() to process the pre-connect operations. It will fill the rdp_freerdp structure (instance) with the appropriate options to use for the connection.

Parameters
instance- pointer to the rdp_freerdp structure that contains the connection's parameters, and will be filled with the appropriate informations.
Returns
TRUE if successful. FALSE otherwise. Can exit with error code XF_EXIT_PARSE_ARGUMENTS if there is an error in the parameters.

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_process_x_events ( freerdp *  instance)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_sw_desktop_resize ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_sw_end_paint ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_TerminateEventHandler ( void context,
TerminateEventArgs *  e 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_toggle_control ( xfContext *  xfc)

Here is the caller graph for this function:

void xf_toggle_fullscreen ( xfContext *  xfc)

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_unlock_x11 ( xfContext *  xfc,
BOOL  display 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_window_free ( xfContext *  xfc)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static char* xf_window_get_title ( rdpSettings *  settings)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xfreerdp_client_free ( freerdp *  instance,
rdpContext *  context 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xfreerdp_client_global_init ( )
static

Client Interface

Here is the call graph for this function:

Here is the caller graph for this function:

static void xfreerdp_client_global_uninit ( )
static

Here is the caller graph for this function:

static BOOL xfreerdp_client_new ( freerdp *  instance,
rdpContext *  context 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int xfreerdp_client_start ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int xfreerdp_client_stop ( rdpContext *  context)
static

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int(* _def_error_handler) (Display *, XErrorEvent *)
static
const button_map xf_button_flags[NUM_BUTTONS_MAPPED]
static
Initial value:
=
{
{Button1, PTR_FLAGS_BUTTON1},
{Button2, PTR_FLAGS_BUTTON3},
{Button3, PTR_FLAGS_BUTTON2},
{Button4, PTR_FLAGS_WHEEL | 0x78},
{6, PTR_FLAGS_HWHEEL | 0x78},
}
#define PTR_FLAGS_BUTTON2
Definition: MRDPView.h:81
#define PTR_FLAGS_WHEEL_NEGATIVE
Definition: MRDPView.h:77
#define PTR_XFLAGS_BUTTON1
Definition: include/freerdp/input.h:50
#define PTR_FLAGS_WHEEL
Definition: MRDPView.h:76
#define PTR_XFLAGS_BUTTON2
Definition: include/freerdp/input.h:51
#define PTR_FLAGS_BUTTON1
Definition: MRDPView.h:80
#define PTR_FLAGS_HWHEEL
Definition: include/freerdp/input.h:38
#define PTR_FLAGS_BUTTON3
Definition: MRDPView.h:82