diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-01-03 10:28:39 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2025-02-25 17:18:35 +0100 |
commit | e0e4f4ca67dbb2db2cf547431fc1c60192aad21a (patch) | |
tree | 4d35b90f0800744dc62de028f6cd45a5564448f4 /unix | |
parent | fc215c8c1dc5c8d70e476e6cc0a574b8e2edf842 (diff) | |
download | tigervnc-e0e4f4ca67dbb2db2cf547431fc1c60192aad21a.tar.gz tigervnc-e0e4f4ca67dbb2db2cf547431fc1c60192aad21a.zip |
Get rid of __rfbmax()/__rfbmin()
They weren't that well used, and were mostly just confusing special
functions anyway.
Allows us to move away from generic and ambigious headers such as
"util".
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tx/TXButton.h | 7 | ||||
-rw-r--r-- | unix/tx/TXCheckbox.h | 7 | ||||
-rw-r--r-- | unix/tx/TXLabel.h | 7 | ||||
-rw-r--r-- | unix/vncconfig/QueryConnectDialog.cxx | 10 |
4 files changed, 19 insertions, 12 deletions
diff --git a/unix/tx/TXButton.h b/unix/tx/TXButton.h index 579d011f..f94561e3 100644 --- a/unix/tx/TXButton.h +++ b/unix/tx/TXButton.h @@ -26,8 +26,9 @@ #ifndef __TXBUTTON_H__ #define __TXBUTTON_H__ +#include <algorithm> + #include "TXWindow.h" -#include <core/util.h> // TXButtonCallback's buttonActivate() method is called when a button is // activated. @@ -63,8 +64,8 @@ public: text = text_; int textWidth = XTextWidth(defaultFS, text.data(), text.size()); int textHeight = (defaultFS->ascent + defaultFS->descent); - int newWidth = __rfbmax(width(), textWidth + xPad*2 + bevel*2); - int newHeight = __rfbmax(height(), textHeight + yPad*2 + bevel*2); + int newWidth = std::max(width(), textWidth + xPad*2 + bevel*2); + int newHeight = std::max(height(), textHeight + yPad*2 + bevel*2); if (width() < newWidth || height() < newHeight) { resize(newWidth, newHeight); } diff --git a/unix/tx/TXCheckbox.h b/unix/tx/TXCheckbox.h index e9debce4..64d56074 100644 --- a/unix/tx/TXCheckbox.h +++ b/unix/tx/TXCheckbox.h @@ -33,8 +33,9 @@ #ifndef __TXCHECKBOX_H__ #define __TXCHECKBOX_H__ +#include <algorithm> + #include "TXWindow.h" -#include <core/util.h> // TXCheckboxCallback's checkboxSelect() method is called when the state of a // checkbox changes. @@ -72,8 +73,8 @@ public: text = strdup((char*)text_); int textWidth = XTextWidth(defaultFS, text, strlen(text)); int textHeight = (defaultFS->ascent + defaultFS->descent); - int newWidth = __rfbmax(width(), textWidth + xPad*2 + boxPad*2 + boxSize); - int newHeight = __rfbmax(height(), textHeight + yPad*2); + int newWidth = std::max(width(), textWidth + xPad*2 + boxPad*2 + boxSize); + int newHeight = std::max(height(), textHeight + yPad*2); if (width() < newWidth || height() < newHeight) { resize(newWidth, newHeight); } diff --git a/unix/tx/TXLabel.h b/unix/tx/TXLabel.h index 85bce5bf..053433c8 100644 --- a/unix/tx/TXLabel.h +++ b/unix/tx/TXLabel.h @@ -27,6 +27,9 @@ #define __TXLABEL_H__ #include <stdlib.h> + +#include <algorithm> + #include "TXWindow.h" #include <core/util.h> @@ -63,8 +66,8 @@ public: } while (i < text.size()); int textHeight = ((defaultFS->ascent + defaultFS->descent + lineSpacing) * lines); - int newWidth = __rfbmax(width(), textWidth + xPad*2); - int newHeight = __rfbmax(height(), textHeight + yPad*2); + int newWidth = std::max(width(), textWidth + xPad*2); + int newHeight = std::max(height(), textHeight + yPad*2); if (width() < newWidth || height() < newHeight) { resize(newWidth, newHeight); } diff --git a/unix/vncconfig/QueryConnectDialog.cxx b/unix/vncconfig/QueryConnectDialog.cxx index 7beee5f4..1d495ea5 100644 --- a/unix/vncconfig/QueryConnectDialog.cxx +++ b/unix/vncconfig/QueryConnectDialog.cxx @@ -22,6 +22,8 @@ #include <stdio.h> +#include <algorithm> + #include "QueryConnectDialog.h" #include "vncExt.h" @@ -43,7 +45,7 @@ QueryConnectDialog::QueryConnectDialog(Display* dpy_, { const int pad = 4; int y=pad; - int lblWidth = __rfbmax(addressLbl.width(), userLbl.width()); + int lblWidth = std::max(addressLbl.width(), userLbl.width()); userLbl.move(pad+lblWidth-userLbl.width(), y); user.move(pad+lblWidth, y); addressLbl.move(pad+lblWidth-addressLbl.width(), y+=userLbl.height()); @@ -51,9 +53,9 @@ QueryConnectDialog::QueryConnectDialog(Display* dpy_, timeoutLbl.move(pad, y+=addressLbl.height()); timeout.move(pad+timeoutLbl.width(), y); accept.move(pad, y+=addressLbl.height()); - int maxWidth = __rfbmax(user.width(), address.width()+pad+lblWidth); - maxWidth = __rfbmax(maxWidth, accept.width()*3); - maxWidth = __rfbmax(maxWidth, timeoutLbl.width()+timeout.width()+pad); + int maxWidth = std::max(user.width(), address.width()+pad+lblWidth); + maxWidth = std::max(maxWidth, accept.width()*3); + maxWidth = std::max(maxWidth, timeoutLbl.width()+timeout.width()+pad); reject.move(maxWidth-reject.width(), y); resize(maxWidth + pad, y+reject.height()+pad); setBorderWidth(1); |