From 65c820867dfc7b704a0b46de03fb4386a7173d7e Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 7 Sep 2022 10:49:43 +0200 Subject: [PATCH] Rename MonitorArrangement to Fl_Monitor_Arrangement Follow upstream FLTK naming to more clearly indicate that this is a general widget and not TigerVNC specific. --- vncviewer/CMakeLists.txt | 2 +- vncviewer/OptionsDialog.cxx | 4 +- vncviewer/OptionsDialog.h | 4 +- ...ngement.cxx => Fl_Monitor_Arrangement.cxx} | 42 +++++++++---------- ...Arrangement.h => Fl_Monitor_Arrangement.h} | 10 ++--- 5 files changed, 31 insertions(+), 31 deletions(-) rename vncviewer/fltk/{MonitorArrangement.cxx => Fl_Monitor_Arrangement.cxx} (92%) rename vncviewer/fltk/{MonitorArrangement.h => Fl_Monitor_Arrangement.h} (92%) diff --git a/vncviewer/CMakeLists.txt b/vncviewer/CMakeLists.txt index 2596b10b..0e1b27b8 100644 --- a/vncviewer/CMakeLists.txt +++ b/vncviewer/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories(${GETTEXT_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/common) add_executable(vncviewer - fltk/MonitorArrangement.cxx + fltk/Fl_Monitor_Arrangement.cxx fltk/theme.cxx menukey.cxx BaseTouchHandler.cxx diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx index 9ce00316..9dd00c33 100644 --- a/vncviewer/OptionsDialog.cxx +++ b/vncviewer/OptionsDialog.cxx @@ -42,7 +42,7 @@ #include "fltk/layout.h" #include "fltk/util.h" -#include "fltk/MonitorArrangement.h" +#include "fltk/Fl_Monitor_Arrangement.h" #include #include @@ -984,7 +984,7 @@ void OptionsDialog::createDisplayPage(int tx, int ty, int tw, int th) selectedMonitorsButton->callback(handleFullScreenMode, this); ty += RADIO_HEIGHT + TIGHT_MARGIN; - monitorArrangement = new MonitorArrangement( + monitorArrangement = new Fl_Monitor_Arrangement( tx + INDENT, ty, width - INDENT, 150); ty += 150 + TIGHT_MARGIN; diff --git a/vncviewer/OptionsDialog.h b/vncviewer/OptionsDialog.h index 14cfe619..be08620d 100644 --- a/vncviewer/OptionsDialog.h +++ b/vncviewer/OptionsDialog.h @@ -30,7 +30,7 @@ class Fl_Round_Button; class Fl_Input; class Fl_Int_Input; class Fl_Choice; -class MonitorArrangement; +class Fl_Monitor_Arrangement; typedef void (OptionsCallback)(void*); @@ -135,7 +135,7 @@ protected: Fl_Round_Button *currentMonitorButton; Fl_Round_Button *allMonitorsButton; Fl_Round_Button *selectedMonitorsButton; - MonitorArrangement *monitorArrangement; + Fl_Monitor_Arrangement *monitorArrangement; /* Misc. */ Fl_Check_Button *sharedCheckbox; diff --git a/vncviewer/fltk/MonitorArrangement.cxx b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx similarity index 92% rename from vncviewer/fltk/MonitorArrangement.cxx rename to vncviewer/fltk/Fl_Monitor_Arrangement.cxx index 7910ab88..062a5051 100644 --- a/vncviewer/fltk/MonitorArrangement.cxx +++ b/vncviewer/fltk/Fl_Monitor_Arrangement.cxx @@ -53,12 +53,12 @@ #include #endif -#include "MonitorArrangement.h" +#include "Fl_Monitor_Arrangement.h" -static std::set instances; +static std::set instances; static const Fl_Boxtype FL_CHECKERED_BOX = FL_FREE_BOXTYPE; -MonitorArrangement::MonitorArrangement( +Fl_Monitor_Arrangement::Fl_Monitor_Arrangement( int x, int y, int w, int h) : Fl_Group(x, y, w, h), SELECTION_COLOR(fl_lighter(FL_BLUE)), @@ -77,7 +77,7 @@ MonitorArrangement::MonitorArrangement( end(); } -MonitorArrangement::~MonitorArrangement() +Fl_Monitor_Arrangement::~Fl_Monitor_Arrangement() { instances.erase(this); @@ -85,7 +85,7 @@ MonitorArrangement::~MonitorArrangement() Fl::remove_handler(fltk_event_handler); } -std::set MonitorArrangement::get() +std::set Fl_Monitor_Arrangement::get() { std::set indices; MonitorMap::const_iterator iter; @@ -98,7 +98,7 @@ std::set MonitorArrangement::get() return indices; } -void MonitorArrangement::set(std::set indices) +void Fl_Monitor_Arrangement::set(std::set indices) { MonitorMap::const_iterator iter; @@ -109,7 +109,7 @@ void MonitorArrangement::set(std::set indices) } } -void MonitorArrangement::draw() +void Fl_Monitor_Arrangement::draw() { MonitorMap::const_iterator iter; @@ -129,7 +129,7 @@ void MonitorArrangement::draw() Fl_Group::draw(); } -void MonitorArrangement::layout() +void Fl_Monitor_Arrangement::layout() { int x, y, w, h; double scale = this->scale(); @@ -173,7 +173,7 @@ void MonitorArrangement::layout() } } -void MonitorArrangement::refresh() +void Fl_Monitor_Arrangement::refresh() { // The selection state is only saved persistently when "OK" is // pressed. We need to manually restore the current selection @@ -192,7 +192,7 @@ void MonitorArrangement::refresh() redraw(); } -bool MonitorArrangement::is_required(int m) +bool Fl_Monitor_Arrangement::is_required(int m) { // A selected monitor is never required. if (monitors[m]->value() == 1) @@ -258,7 +258,7 @@ bool MonitorArrangement::is_required(int m) return true; } -double MonitorArrangement::scale() +double Fl_Monitor_Arrangement::scale() { const int MARGIN = 20; std::pair size = this->size(); @@ -274,7 +274,7 @@ double MonitorArrangement::scale() return s_w; } -std::pair MonitorArrangement::size() +std::pair Fl_Monitor_Arrangement::size() { int x, y, w, h; int top, bottom, left, right; @@ -305,7 +305,7 @@ std::pair MonitorArrangement::size() return std::make_pair(x_max - x_min, y_max - y_min); } -std::pair MonitorArrangement::offset() +std::pair Fl_Monitor_Arrangement::offset() { double scale = this->scale(); std::pair size = this->size(); @@ -317,7 +317,7 @@ std::pair MonitorArrangement::offset() return std::make_pair(offset_x + abs(origin.first)*scale, offset_y + abs(origin.second)*scale); } -std::pair MonitorArrangement::origin() +std::pair Fl_Monitor_Arrangement::origin() { int x, y, w, h, ox, oy; ox = oy = 0; @@ -335,7 +335,7 @@ std::pair MonitorArrangement::origin() return std::make_pair(ox, oy); } -std::string MonitorArrangement::description(int m) +std::string Fl_Monitor_Arrangement::description(int m) { std::string name; int x, y, w, h; @@ -364,7 +364,7 @@ static BOOL CALLBACK EnumDisplayMonitorsCallback( } #endif -std::string MonitorArrangement::get_monitor_name(int m) +std::string Fl_Monitor_Arrangement::get_monitor_name(int m) { #if defined(WIN32) std::set sys_monitors; @@ -530,9 +530,9 @@ std::string MonitorArrangement::get_monitor_name(int m) #endif } -int MonitorArrangement::fltk_event_handler(int event) +int Fl_Monitor_Arrangement::fltk_event_handler(int event) { - std::set::iterator it; + std::set::iterator it; if (event != FL_SCREEN_CONFIGURATION_CHANGED) return 0; @@ -543,9 +543,9 @@ int MonitorArrangement::fltk_event_handler(int event) return 0; } -void MonitorArrangement::monitor_pressed(Fl_Widget *widget, void *user_data) +void Fl_Monitor_Arrangement::monitor_pressed(Fl_Widget *widget, void *user_data) { - MonitorArrangement *self = (MonitorArrangement *) user_data; + Fl_Monitor_Arrangement *self = (Fl_Monitor_Arrangement *) user_data; // When a monitor is selected, FLTK changes the state of it for us. // However, selecting a monitor might implicitly change the state of @@ -555,7 +555,7 @@ void MonitorArrangement::monitor_pressed(Fl_Widget *widget, void *user_data) self->redraw(); } -void MonitorArrangement::checkered_pattern_draw( +void Fl_Monitor_Arrangement::checkered_pattern_draw( int x, int y, int width, int height, Fl_Color color) { bool draw_checker = false; diff --git a/vncviewer/fltk/MonitorArrangement.h b/vncviewer/fltk/Fl_Monitor_Arrangement.h similarity index 92% rename from vncviewer/fltk/MonitorArrangement.h rename to vncviewer/fltk/Fl_Monitor_Arrangement.h index d6db2677..770503bf 100644 --- a/vncviewer/fltk/MonitorArrangement.h +++ b/vncviewer/fltk/Fl_Monitor_Arrangement.h @@ -22,8 +22,8 @@ * SOFTWARE. */ -#ifndef __MONITOR_ARRANGEMENT_H__ -#define __MONITOR_ARRANGEMENT_H__ +#ifndef __FL_MONITOR_ARRANGEMENT_H__ +#define __FL_MONITOR_ARRANGEMENT_H__ #include #include @@ -33,10 +33,10 @@ class Fl_Button; -class MonitorArrangement: public Fl_Group { +class Fl_Monitor_Arrangement: public Fl_Group { public: - MonitorArrangement(int x, int y, int w, int h); - ~MonitorArrangement(); + Fl_Monitor_Arrangement(int x, int y, int w, int h); + ~Fl_Monitor_Arrangement(); // Get selected indices. std::set get(); -- 2.39.5