GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
gui-utils.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1993-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_gui_utils_h)
27 #define octave_gui_utils_h 1
28 
29 #include "octave-config.h"
30 
31 #include <QColor>
32 #include <QRect>
33 
35 
36 /*!
37  Deterimine an alternative color to @p col1 with less contrast
38  to @p col2. The HSV representation of the new color is calculated by
39  \f{eqnarray*}{
40  H &=& H_1\\
41  S &=& f_s S_1\\
42  V &=& V_1 + f_s (V_2 - V_1)
43  \f}
44 
45  @param col1 Base color to which the alternative has to be computed
46  @param col2 Color to which the the new color should have less contrast
47  @param fs Factor for changing the saturation \f$(0\ldots\infty)\f$
48  @param fv Factor for interpolating the brightness \f$(0\ldots 1)\f$.
49  For 0, \f$V = V_1\f$ and for 1, \f$V = V_2\f$.
50 
51  @return New color as QColor
52 */
53 
54  extern OCTGUI_API QColor
55  interpolate_color (const QColor& col1, const QColor& col2,
56  double fs, double fv);
57 
58 /*!
59  Get the screen geometry of the actual screen.
60 
61  @param width integer variable for storing the screen width
62  @param height integer variable for storing the screen height
63 */
64 
65 extern OCTGUI_API void
66 get_screen_geometry (int& width, int& height);
67 
68 /*!
69  Adjust geometry to be completely on a screen
70 
71  @param actual_geometry QRect with actual widget geometry; this is
72  changed to the updated geometry which is on the screen.
73  @param default_geometry the default geometry that is used in case
74  the actual geometry os on no available screen.
75 */
76 extern OCTGUI_API void
77 adjust_to_screen (QRect& actual_geometry, const QRect& default_geometry);
78 
80 
81 #endif
OCTAVE_END_NAMESPACE(octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTGUI_API void get_screen_geometry(int &width, int &height)
Definition: gui-utils.cc:51
OCTGUI_API QColor interpolate_color(const QColor &col1, const QColor &col2, double fs, double fv)
Definition: gui-utils.cc:39
OCTGUI_API void adjust_to_screen(QRect &actual_geometry, const QRect &default_geometry)
Definition: gui-utils.cc:60