FreeRDP-WebConnect WebSockets gateway  1.0.0.167
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
Update.hpp
1 /* vim: set et ts=4 sw=4 cindent:
2  *
3  * FreeRDP-WebConnect,
4  * A gateway for seamless access to your RDP-Sessions in any HTML5-compliant browser.
5  *
6  * Copyright 2012 Fritz Elfert <wsgate@fritz-elfert.de>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 #ifndef _WSGATE_UPDATE_H_
21 #define _WSGATE_UPDATE_H_
22 
23 #include "wshandler.hpp"
24 
25 typedef struct rdp_freerdp freerdp;
26 typedef struct rdp_context rdpContext;
27 typedef struct rdp_input rdpInput;
28 typedef struct rdp_settings rdpSettings;
29 
30 namespace wsgate {
31 
36  class Update {
37 
38  public:
44 
46  virtual ~Update();
47 
52  void Register(freerdp *rdp);
53 
54  private:
55  wspp::wshandler *m_wshandler;
56 
57  // Non-copyable
58  Update(const Update &);
59  Update & operator=(const Update &);
60 
61  void BeginPaint(rdpContext* context);
62  void EndPaint(rdpContext* context);
63  void SetBounds(rdpContext* context, rdpBounds* bounds);
64  void Synchronize(rdpContext* context);
65  void DesktopResize(rdpContext* context);
66  void BitmapUpdate(rdpContext* context, BITMAP_UPDATE* bitmap);
67  void Palette(rdpContext* context, PALETTE_UPDATE* palette);
68  void PlaySound(rdpContext* context, PLAY_SOUND_UPDATE* play_sound);
69  void RefreshRect(rdpContext* context, uint8 count, RECTANGLE_16* areas);
70  void SuppressOutput(rdpContext* context, uint8 allow, RECTANGLE_16* area);
71  void SurfaceCommand(rdpContext* context, STREAM* s);
72  void SurfaceBits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command);
73  void SurfaceFrameMarker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker);
74 
75  // Callbacks from C - Must be static in order t be assigned to C fnPtrs.
76  static void cbBeginPaint(rdpContext* context);
77  static void cbEndPaint(rdpContext* context);
78  static void cbSetBounds(rdpContext* context, rdpBounds* bounds);
79  static void cbSynchronize(rdpContext* context);
80  static void cbDesktopResize(rdpContext* context);
81  static void cbBitmapUpdate(rdpContext* context, BITMAP_UPDATE* bitmap);
82  static void cbPalette(rdpContext* context, PALETTE_UPDATE* palette);
83  static void cbPlaySound(rdpContext* context, PLAY_SOUND_UPDATE* play_sound);
84  static void cbRefreshRect(rdpContext* context, uint8 count, RECTANGLE_16* areas);
85  static void cbSuppressOutput(rdpContext* context, uint8 allow, RECTANGLE_16* area);
86  static void cbSurfaceCommand(rdpContext* context, STREAM* s);
87  static void cbSurfaceBits(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command);
88  static void cbSurfaceFrameMarker(rdpContext* context, SURFACE_FRAME_MARKER* surface_frame_marker);
89 
90  };
91 }
92 
93 #endif