From 3e111537b52590b001ee60afb7a38d1f7a8632b1 Mon Sep 17 00:00:00 2001 From: george82 Date: Mon, 5 Nov 2007 14:28:40 +0000 Subject: [PATCH] Removed the possibility to choose the scale filter in the options dialog of vncviewer. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2366 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/ScaledPixelBuffer.cxx | 4 ++-- win/vncviewer/CConn.cxx | 1 - win/vncviewer/CConnOptions.cxx | 14 +------------- win/vncviewer/CConnOptions.h | 1 - win/vncviewer/OptionsDialog.cxx | 16 ---------------- win/vncviewer/resource.h | 2 -- win/vncviewer/vncviewer.rc | 4 ---- 7 files changed, 3 insertions(+), 39 deletions(-) diff --git a/common/rfb/ScaledPixelBuffer.cxx b/common/rfb/ScaledPixelBuffer.cxx index 12658f7b..e45274e4 100644 --- a/common/rfb/ScaledPixelBuffer.cxx +++ b/common/rfb/ScaledPixelBuffer.cxx @@ -30,7 +30,7 @@ using namespace rfb; ScaledPixelBuffer::ScaledPixelBuffer(U8 **src_data_, int src_width_, int src_height_, int scale_, PixelFormat pf_) - : scale(scale_), scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBicubic), + : scale(scale_), scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBilinear), xWeightTabs(0), yWeightTabs(0), scaled_data(0), raccum(0), gaccum(0), baccum(0) { setSourceBuffer(src_data_, src_width_, src_height_); @@ -39,7 +39,7 @@ ScaledPixelBuffer::ScaledPixelBuffer(U8 **src_data_, int src_width_, ScaledPixelBuffer::ScaledPixelBuffer() : src_width(0), src_height(0), scaled_width(0), scaled_height(0), scale(100), - scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBicubic), + scale_ratio_x(1), scale_ratio_y(1), scaleFilterID(scaleFilterBilinear), xWeightTabs(0), yWeightTabs(0), src_data(0), scaled_data(0), raccum(0), gaccum(0), baccum(0) { memset(&pf, 0, sizeof(pf)); diff --git a/win/vncviewer/CConn.cxx b/win/vncviewer/CConn.cxx index 53a16d06..4a9b341a 100644 --- a/win/vncviewer/CConn.cxx +++ b/win/vncviewer/CConn.cxx @@ -158,7 +158,6 @@ CConn::applyOptions(CConnOptions& opt) { window->setDisableWinKeys(options.disableWinKeys); window->setShowToolbar(options.showToolbar); window->printScale(); - window->setDesktopScaleFilter(options.scaleFilter); if (options.autoScaling) { window->setAutoScaling(true); } else { diff --git a/win/vncviewer/CConnOptions.cxx b/win/vncviewer/CConnOptions.cxx index 3af422ee..ea0941e5 100644 --- a/win/vncviewer/CConnOptions.cxx +++ b/win/vncviewer/CConnOptions.cxx @@ -123,10 +123,6 @@ static BoolParameter autoScaling("AutoScaling", static IntParameter scale("Scale", "Scale local copy of the remote desktop, in percent", 100); -static IntParameter scaleFilter("ScaleFilter", - "Filter used for the remote desktop scaling. " - "0 = Nearest Neighbor, 1 = Bilinear, 2 = Bicubic, 3 = Sinc.", - rfb::defaultScaleFilter); CConnOptions::CConnOptions() : useLocalCursor(::useLocalCursor), useDesktopResize(::useDesktopResize), @@ -138,7 +134,7 @@ lowColourLevel(::lowColourLevel), pointerEventInterval(ptrEventInterval), emulate3(::emulate3), monitor(::monitor.getData()), showToolbar(::showToolbar), customCompressLevel(::customCompressLevel), compressLevel(::compressLevel), noJpeg(::noJpeg), qualityLevel(::qualityLevel), passwordFile(::passwordFile.getData()), -autoReconnect(::autoReconnect), autoScaling(::autoScaling), scale(::scale), scaleFilter(::scaleFilter) +autoReconnect(::autoReconnect), autoScaling(::autoScaling), scale(::scale) { if (autoSelect) { preferredEncoding = encodingZRLE; @@ -280,11 +276,6 @@ void CConnOptions::readFromFile(const char* filename) { autoScaling = atoi(value.buf); } else if (stricmp(name.buf, "Scale") == 0) { scale = atoi(value.buf); - } else if (stricmp(name.buf, "ScaleFilter") == 0) { - int scaleFilterID = atoi(value.buf); - if (scaleFilterID > rfb::scaleFilterMaxNumber || scaleFilterID < 0 ) { - scaleFilter = rfb::defaultScaleFilter; - } else scaleFilter = scaleFilterID; } } } @@ -368,7 +359,6 @@ void CConnOptions::writeToFile(const char* filename) { fprintf(f, "QualityLevel=%d\n", qualityLevel); fprintf(f, "AutoScaling=%d\n", (int)autoScaling); fprintf(f, "Scale=%d\n", scale); - fprintf(f, "ScaleFilter=%d\n", scaleFilter); fclose(f); f=0; setConfigFileName(filename); @@ -410,7 +400,6 @@ void CConnOptions::writeDefaults() { key.setInt(_T("QualityLevel"), qualityLevel); key.setBool(_T("AutoScaling"), autoScaling); key.setInt(_T("Scale"), scale); - key.setInt(_T("ScaleFilter"), scaleFilter); } @@ -474,7 +463,6 @@ CConnOptions& CConnOptions::operator=(const CConnOptions& o) { qualityLevel = o.qualityLevel; autoScaling = o.autoScaling; scale = o.scale; - scaleFilter = o.scaleFilter; return *this; } diff --git a/win/vncviewer/CConnOptions.h b/win/vncviewer/CConnOptions.h index 0b8b2bfe..51ab78af 100644 --- a/win/vncviewer/CConnOptions.h +++ b/win/vncviewer/CConnOptions.h @@ -68,7 +68,6 @@ namespace rfb { bool acceptBell; bool autoScaling; int scale; - unsigned int scaleFilter; CharArray userName; void setUserName(const char* user); PlainPasswd password; diff --git a/win/vncviewer/OptionsDialog.cxx b/win/vncviewer/OptionsDialog.cxx index 962767fd..826781d6 100644 --- a/win/vncviewer/OptionsDialog.cxx +++ b/win/vncviewer/OptionsDialog.cxx @@ -176,14 +176,6 @@ public: } else { SetDlgItemInt(handle, IDC_COMBO_SCALE, dlg->options.scale, FALSE); } - HWND hScaleFilterCombo = GetDlgItem(handle, IDC_COMBO_SCALE_FILTER); - SendMessage(hScaleFilterCombo, CB_RESETCONTENT, 0, 0); - ScaleFilters scaleFilters; - for (i = 0; i <= rfb::scaleFilterMaxNumber; i++) { - SendMessage(hScaleFilterCombo, CB_ADDSTRING, (WPARAM)0, (LPARAM)(int FAR*)scaleFilters[i].name); - } - SendMessage(hScaleFilterCombo, CB_SETCURSEL, (WPARAM)dlg->options.scaleFilter, (LPARAM)0); - if (dlg->options.scale == 100 && !dlg->options.autoScaling) enableItem(IDC_COMBO_SCALE_FILTER, 0); } virtual bool onOk() { dlg->options.shared = isItemChecked(IDC_CONN_SHARED); @@ -205,12 +197,6 @@ public: dlg->options.autoScaling = true; } } - int scaleFilterID = SendMessage(GetDlgItem(handle, IDC_COMBO_SCALE_FILTER), CB_GETCURSEL, 0, 0); - if (scaleFilterID != rfb::scaleFilterBilinear && scaleFilterID != rfb::scaleFilterBicubic) { - MsgBox(handle, "Now supported only bilinear and bicubic scale filters.", MB_OK); - } else { - dlg->options.scaleFilter = SendMessage(GetDlgItem(handle, IDC_COMBO_SCALE_FILTER), CB_GETCURSEL, 0, 0); - } ((ViewerOptions*)propSheet)->setChanged(); return true; } @@ -225,8 +211,6 @@ public: } else { GetDlgItemText(handle, IDC_COMBO_SCALE, scaleStr, 20); } - if (strcmp(scaleStr, "100") == 0) enableItem(IDC_COMBO_SCALE_FILTER, 0); - else enableItem(IDC_COMBO_SCALE_FILTER, 1); return true; } } diff --git a/win/vncviewer/resource.h b/win/vncviewer/resource.h index 362d56ec..5bc4bdc0 100644 --- a/win/vncviewer/resource.h +++ b/win/vncviewer/resource.h @@ -123,8 +123,6 @@ #define IDC_STATIC_SCALE 1097 #define IDC_COMBO_SCALE 1098 #define IDC_STATIC_PERCENT 1099 -#define IDC_COMBO_SCALE_FILTER 1100 -#define IDC_SCALE_FILTER 1101 #define ID_TOOLBAR 40002 #define ID_CLOSE 40003 #define ID_OPTIONS 40004 diff --git a/win/vncviewer/vncviewer.rc b/win/vncviewer/vncviewer.rc index ae479c1d..e2064b31 100644 --- a/win/vncviewer/vncviewer.rc +++ b/win/vncviewer/vncviewer.rc @@ -234,12 +234,8 @@ BEGIN WS_TABSTOP,106,25,103,15 COMBOBOX IDC_COMBO_SCALE,138,40,42,134,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO_SCALE_FILTER,138,70,71,113,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP LTEXT "Scale by:",IDC_STATIC_SCALE,106,40,32,15,SS_CENTERIMAGE LTEXT "%",IDC_STATIC_PERCENT,185,40,24,15,SS_CENTERIMAGE - LTEXT "With filter:",IDC_SCALE_FILTER,138,55,71,15, - SS_CENTERIMAGE END IDD_INPUTS DIALOG DISCARDABLE 0, 0, 186, 162 -- 2.39.5