virtual void framebufferUpdateEnd() {};
FbsInputStream* is;
- CMsgReader* reader;
+ CMsgReaderV3* reader;
stateEnum state_;
private:
--- /dev/null
+/* Copyright (C) 2004 TightVNC Team. All Rights Reserved.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ */
+
+// -=- SessionInfoDialog.h
+
+#include <math.h>
+
+#include <rfb/ConnParams.h>
+
+#include <rfb_win32/Dialog.h>
+
+#define log2(n) log(n) / 0.693147180559945
+
+int max3(int v1, int v2, int v3) {
+ return max(v1, max(v2, v3));
+}
+
+class SessionInfoDialog : public rfb::win32::Dialog {
+public:
+ SessionInfoDialog(ConnParams *_cp, int _currentEncoding)
+ : Dialog(GetModuleHandle(0)), cp(_cp), currentEncoding(_currentEncoding) {}
+ // - Show the dialog and return true if OK was clicked,
+ // false in case of error or Cancel
+ virtual bool showDialog(HWND parent = 0) {
+ return Dialog::showDialog(MAKEINTRESOURCE(IDD_SESSION_INFO), parent);
+ }
+protected:
+ // Dialog methods (protected)
+ virtual void initDialog() {
+ char strValue[255] = "\0";
+ setItemString(IDC_DESKTOP_NAME, cp->name());
+
+ sprintf(strValue, "%ix%i", cp->width, cp->height);
+ setItemString(IDC_DESKTOP_SIZE, strValue);
+
+ int r = cp->pf().redShift, g = cp->pf().greenShift, b = cp->pf().blueShift;
+ int i = 3;
+ char buffer[10];
+ sprintf(strValue, "depth %i(%ibpp), ", cp->pf().depth, cp->pf().bpp);
+ while (i) {
+ if (r == max3(r, g, b)) {
+ strcat(strValue, "r");
+ _itoa(ceil(log2(cp->pf().redMax)), buffer, 10);
+ strcat(strValue, buffer);
+ r = -1;
+ i--;
+ continue;
+ } else if (g == max3(r, g, b)) {
+ strcat(strValue, "g");
+ _itoa(ceil(log2(cp->pf().greenMax)), buffer, 10);
+ strcat(strValue, buffer);
+ g = -1;
+ i--;
+ continue;
+ } else if (b == max3(r, g, b)) {
+ strcat(strValue, "b");
+ _itoa(ceil(log2(cp->pf().blueMax)), buffer, 10);
+ strcat(strValue, buffer);
+ b = -1;
+ i--;
+ continue;
+ } else break;
+ }
+ if (cp->pf().bigEndian) strcat(strValue, ", big-endian");
+ else strcat(strValue, ", little-endian");
+ setItemString(IDC_PIXEL_FORMAT, strValue);
+
+ switch (currentEncoding) {
+ case encodingRaw: strcpy(strValue, "Raw"); break;
+ case encodingCopyRect: strcpy(strValue, "CopyRect"); break;
+ case encodingRRE: strcpy(strValue, "RRE"); break;
+ case encodingCoRRE: strcpy(strValue, "CoRRE"); break;
+ case encodingHextile: strcpy(strValue, "Hextile"); break;
+ case encodingTight: strcpy(strValue, "Tight"); break;
+ case encodingZRLE: strcpy(strValue, "ZRLE"); break;
+ default: strcpy(strValue, "Unknown");
+ }
+ setItemString(IDC_CURRENT_ENCODING, strValue);
+
+ sprintf(strValue, "%i.%i", cp->majorVersion, cp->minorVersion);
+ setItemString(IDC_VERSION, strValue);
+ }
+ ConnParams *cp;
+ int currentEncoding;
+};
\ No newline at end of file
#define IDD_USERPF_LIST 139
#define IDD_UPF_EDIT 140
#define IDD_INFO 141
+#define IDD_SESSION_INFO 142
#define IDC_GOTO_EDIT 1003
#define IDC_PIXELFORMAT 1004
#define IDC_ASK_PF 1006
#define IDC_GREENMAX_EDIT 1024
#define IDC_BLUEMAX_EDIT 1025
#define IDC_REDSHIFT_EDIT 1026
+#define IDC_DESKTOP_NAME 1026
#define IDC_GREENSHIFT_EDIT 1027
+#define IDC_DESKTOP_SIZE 1027
#define IDC_BLUESHIFT_EDIT 1028
+#define IDC_CURRENT_ENCODING 1029
+#define IDC_PIXEL_FORMAT 1030
#define IDC_INFO_EDIT 1076
#define ID_OPENFILE 40011
#define ID_CLOSEFILE 40012
#define ID_ABOUT 40027
#define ID_OPTIONS 40029
#define ID_RETURN 40044
+#define ID_SESSION_INFO 40045
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 142
-#define _APS_NEXT_COMMAND_VALUE 40045
+#define _APS_NEXT_RESOURCE_VALUE 143
+#define _APS_NEXT_COMMAND_VALUE 40046
#define _APS_NEXT_CONTROL_VALUE 1031
#define _APS_NEXT_SYMED_VALUE 101
#endif
window_size(0, 0, 32, 32), cutText(0), seekMode(false), lastPos(0),
timeStatic(0), speedEdit(0), posTrackBar(0), speedUpDown(0),
rfbReader(0), sessionTimeMs(0), sliderDraging(false), sliderStepMs(0),
- imageDataStartTime(0), rewindFlag(false), stopped(false) {
+ imageDataStartTime(0), rewindFlag(false), stopped(false),
+ currentEncoding(-1) {
// Save the player options
memcpy(&options, _options, sizeof(options));
case ID_CLOSEFILE:
closeSessionFile();
break;
+ case ID_SESSION_INFO:
+ {
+ SessionInfoDialog sessionInfo(&cp, currentEncoding);
+ sessionInfo.showDialog(getMainHandle());
+ }
+ break;
case ID_PLAY:
setPaused(false);
break;
void RfbPlayer::disableTBandMenuItems() {
// Disable the menu items
EnableMenuItem(hMenu, ID_CLOSEFILE, MF_GRAYED | MF_BYCOMMAND);
+ EnableMenuItem(hMenu, ID_SESSION_INFO, MF_GRAYED | MF_BYCOMMAND);
///EnableMenuItem(hMenu, ID_FULLSCREEN, MF_GRAYED | MF_BYCOMMAND);
///EnableMenuItem(GetSubMenu(hMenu, 1), 1, MF_GRAYED | MF_BYPOSITION);
EnableMenuItem(hMenu, ID_PLAYPAUSE, MF_GRAYED | MF_BYCOMMAND);
void RfbPlayer::enableTBandMenuItems() {
// Enable the menu items
EnableMenuItem(hMenu, ID_CLOSEFILE, MF_ENABLED | MF_BYCOMMAND);
+ EnableMenuItem(hMenu, ID_SESSION_INFO, MF_ENABLED | MF_BYCOMMAND);
///EnableMenuItem(hMenu, ID_FULLSCREEN, MF_ENABLED | MF_BYCOMMAND);
///EnableMenuItem(GetSubMenu(hMenu, 1), 1, MF_ENABLED | MF_BYPOSITION);
EnableMenuItem(hMenu, ID_PLAYPAUSE, MF_ENABLED | MF_BYCOMMAND);
};
void RfbPlayer::beginRect(const Rect& r, unsigned int encoding) {
+ currentEncoding = encoding;
}
void RfbPlayer::endRect(const Rect& r, unsigned int encoding) {
# End Source File\r
# Begin Source File\r
\r
+SOURCE=.\SessionInfoDialog.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=.\ToolBar.h\r
# End Source File\r
# Begin Source File\r
#include <rfbplayer/ChoosePixelFormatDialog.h>
#include <rfbplayer/OptionsDialog.h>
#include <rfbplayer/InfoDialog.h>
+#include <rfbplayer/SessionInfoDialog.h>
using namespace rfb;
using namespace rfb::win32;
PixelFormatList supportedPF;
long imageDataStartTime;
long sessionTimeMs;
+ int currentEncoding;
};
// -=- sessionTerminateThread class
MENUITEM "Open File...\tCtrl+O", ID_OPENFILE
MENUITEM "Close File...\tCtrl+Q", ID_CLOSEFILE
MENUITEM SEPARATOR
+ MENUITEM "Info...\tCtrl+I", ID_SESSION_INFO
+ MENUITEM SEPARATOR
MENUITEM "Exit\tAlt+X", ID_EXIT
END
POPUP "Play"
"C", ID_COPYTOCLIPBOARD, VIRTKEY, CONTROL, NOINVERT
"C", ID_FRAMEEXTRACT, VIRTKEY, ALT, NOINVERT
"G", ID_GOTO, VIRTKEY, CONTROL, NOINVERT
+ "I", ID_SESSION_INFO, VIRTKEY, CONTROL, NOINVERT
"L", ID_LOOP, VIRTKEY, CONTROL, NOINVERT
"O", ID_OPENFILE, VIRTKEY, CONTROL, NOINVERT
"P", ID_OPTIONS, VIRTKEY, CONTROL, NOINVERT
WS_VSCROLL | WS_HSCROLL
END
+IDD_SESSION_INFO DIALOG DISCARDABLE 0, 0, 239, 106
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "RFB Session Info"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,182,85,50,14
+ LTEXT "Desktop Name:",IDC_STATIC,7,10,73,15
+ LTEXT "Desktop Size:",IDC_STATIC,7,25,73,15
+ LTEXT "Pixel Format:",IDC_STATIC,7,40,73,15
+ LTEXT "Current Encoding:",IDC_STATIC,7,55,73,15
+ LTEXT "RFB Protocol Version:",IDC_STATIC,7,70,73,15
+ LTEXT "",IDC_DESKTOP_NAME,80,10,152,15
+ LTEXT "",IDC_DESKTOP_SIZE,80,25,152,15
+ LTEXT "",IDC_CURRENT_ENCODING,80,55,152,15
+ LTEXT "",IDC_VERSION,80,70,152,15
+ LTEXT "",IDC_PIXEL_FORMAT,80,40,152,15
+END
+
/////////////////////////////////////////////////////////////////////////////
//
TOPMARGIN, 7
BOTTOMMARGIN, 200
END
+
+ IDD_SESSION_INFO, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 232
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 99
+ HORZGUIDE, 10
+ HORZGUIDE, 25
+ HORZGUIDE, 40
+ HORZGUIDE, 55
+ HORZGUIDE, 70
+ HORZGUIDE, 85
+ END
END
#endif // APSTUDIO_INVOKED