Debian Codegraph @

Qt/Qt_SliderPainterPainter.h

raw symbols SCIP
1 /* Copyright 2012 Kjetil S. Matheussen
2
3 This program is free software; you can redistribute it and/or
4 modify it under the terms of the GNU General Public License
5 as published by the Free Software Foundation; either version 2
6 of the License, or (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
16
17
18
19 #ifdef COMPILING_RADIUM
20 extern struct Root *root;
21 #else
22 extern QColorcxx . . $ QColor# *g_colorscxx . . $ g_colors.;
23 #endif
24
25
26 static inline QColorcxx . . $ QColor# mix_colorscxx . . $ mix_colors(79a36d4b1e5ae7b0).(const QColorcxx . . $ QColor# &c1, const QColorcxx . . $ QColor# &c2, float how_much){
27
28 float a1 = how_much;
29 float a2 = 1.0f-a1;
30
31 if(c1.redcxx . . $ QColor#red(ea6fe5115c70a13f).()==0 && c1.greencxx . . $ QColor#green(ea6fe5115c70a13f).()==0 && c1.bluecxx . . $ QColor#blue(ea6fe5115c70a13f).()==0){ // some of the black lines doesn't look look very good.
32 int r = 74*a1 + c2.redcxx . . $ QColor#red(ea6fe5115c70a13f).()*a2;
33 int g = 74*a1 + c2.greencxx . . $ QColor#green(ea6fe5115c70a13f).()*a2;
34 int b = 74*a1 + c2.bluecxx . . $ QColor#blue(ea6fe5115c70a13f).()*a2;
35
36 return QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(r,g,b);
37 }else{
38
39 int r = c1.redcxx . . $ QColor#red(ea6fe5115c70a13f).()*a1 + c2.redcxx . . $ QColor#red(ea6fe5115c70a13f).()*a2;
40 int g = c1.greencxx . . $ QColor#green(ea6fe5115c70a13f).()*a1 + c2.greencxx . . $ QColor#green(ea6fe5115c70a13f).()*a2;
41 int b = c1.bluecxx . . $ QColor#blue(ea6fe5115c70a13f).()*a1 + c2.bluecxx . . $ QColor#blue(ea6fe5115c70a13f).()*a2;
42
43 return QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(r,g,b);
44 }
45 }
46
47
48 static inline void SLIDERPAINTERPAINTER_paintcxx . . $ SLIDERPAINTERPAINTER_paint(b27d8cf3279c2e1b).(QPaintercxx . . $ QPainter# *p, int x1, int y1, int x2, int y2, bool is_enabled, float val, QStringcxx . . $ QString# text, bool alternative_color){
49 #ifdef COMPILING_RADIUM
50 QColor *colors = static_cast<EditorWidget*>(root->song->tracker_windows->os_visual.widget)->colors;
51 #else
52 QColorcxx . . $ QColor# *colors = g_colorscxx . . $ g_colors.;
53 #endif
54
55 int height = y2-y1;
56 int width = x2-x1;
57
58 QColorcxx . . $ QColor# col1cxx . . $ QColor#QColor(ced63f7c635d850d).;
59 QColorcxx . . $ QColor# col1bcxx . . $ QColor#QColor(ced63f7c635d850d).;
60
61 int col1num = 11;
62
63 if(is_enabled){
64 QColorcxx . . $ QColor# ccxx . . $ QColor#QColor(2261ffe5112eab06).(98,59,33);
65
66 col1 =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). c.lightcxx . . $ QColor#light(a312dab4e0811e0).(90);
67 col1b =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). colors[13].lightcxx . . $ QColor#light(a312dab4e0811e0).(100);
68 }else{
69 col1 =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). mix_colorscxx . . $ mix_colors(79a36d4b1e5ae7b0).(colors[col1num], Qtcxx . . $ QColor#QColor(408ec4d5924bfb00).::graycxx . . $ Qt/gray., 0.8f);
70 col1b =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). mix_colorscxx . . $ mix_colors(79a36d4b1e5ae7b0).(colors[col1num].lightcxx . . $ QColor#light(a312dab4e0811e0).(110), Qtcxx . . $ QColor#QColor(408ec4d5924bfb00).::graycxx . . $ Qt/gray., 0.8f);
71 }
72
73 if(alternative_color==true)
74 col1 =cxx . . $ QColor#`operator=`(fd1b853fb77c9003). QColorcxx . . $ QColor#QColor(2261ffe5112eab06).(200,200,200);
75
76 if(alternative_color==false){
77 col1.setAlphacxx . . $ QColor#setAlpha(d4f767463ce0a6b3).(80);
78 col1b.setAlphacxx . . $ QColor#setAlpha(d4f767463ce0a6b3).(100);
79 }else{
80 col1.setAlphacxx . . $ QColor#setAlpha(d4f767463ce0a6b3).(120);
81 col1b.setAlphacxx . . $ QColor#setAlpha(d4f767463ce0a6b3).(120);
82 }
83
84 if(height > width){ // i.e. vertical
85 int pos=scalecxx . . $ scale(a4708ef16e45b76e).(val,0,1,0,height);
86 p->fillRectcxx . . $ QPainter#fillRect(b6f7dd7f1bbb6c84).(0,pos,width,height-pos,col1);
87 }else{
88 int pos=scalecxx . . $ scale(a4708ef16e45b76e).(val,0,1,0,width);
89 QLinearGradientcxx . . $ QLinearGradient# gradientcxx . . $ QLinearGradient#QLinearGradient(52a61fa14d44b641).(0,0,width,height*3/4);
90 if(alternative_color==false)
91 gradient.setColorAtcxx . . $ QGradient#setColorAt(e8a5895791b6fa8c).(0,col1.lightcxx . . $ QColor#light(a312dab4e0811e0).(100));
92 else
93 gradient.setColorAtcxx . . $ QGradient#setColorAt(e8a5895791b6fa8c).(0,col1.lightcxx . . $ QColor#light(a312dab4e0811e0).(150));
94 gradient.setColorAtcxx . . $ QGradient#setColorAt(e8a5895791b6fa8c).(1,col1b);
95
96 p->setPencxx . . $ QPainter#setPen(af0a25dfda3214db).(QPencxx . . $ QPen#QPen(c1f9b1cc0228302b).(QColorcxx . . $ QBrush#QBrush(b50947b0752ea6ac).(Qtcxx . . $ Qt/::graycxx . . $ Qt/gray.).lightcxx . . $ QColor#light(a312dab4e0811e0).(50),1));
97 p->setBrushcxx . . $ QPainter#setBrush(ffc9f5d0bda78261).(gradientcxx . . $ QBrush#QBrush(cbd511d3bf8d464c).);
98 p->drawRectcxx . . $ QPainter#drawRect(748afa4755bc9595).(0 ,0, pos, height);
99 p->setBrushcxx . . $ QPainter#setBrush(ffc9f5d0bda78261).(QBrushcxx . . $ QBrush#QBrush(49f6e7a06ebc5aa8).());
100 }
101
102 p->setPencxx . . $ QPainter#setPen(af0a25dfda3214db).(QPencxx . . $ QPen#QPen(c1f9b1cc0228302b).(colorscxx . . $ QBrush#QBrush(b50947b0752ea6ac).[11].lightcxx . . $ QColor#light(a312dab4e0811e0).(110),1));
103 p->drawRectcxx . . $ QPainter#drawRect(748afa4755bc9595).(0,0,width,height);
104
105 QRectcxx . . $ QRect# rectcxx . . $ QRect#QRect(2261ffe5112eab06).(5,2,width-5,height-2);
106
107 if(text!=cxx . . $ QString#`operator!=`(7d4bdb1abc417636).""){
108 QColorcxx . . $ QColor# ccxx . . $ QColor#QColor(c396aab421781ee8).(colors[1]);
109 if(is_enabled){
110 c.setAlphacxx . . $ QColor#setAlpha(d4f767463ce0a6b3).(160);
111 p->setPencxx . . $ QPainter#setPen(af0a25dfda3214db).(QPencxx . . $ QPen#QPen(c1f9b1cc0228302b).(ccxx . . $ QBrush#QBrush(b50947b0752ea6ac).,1));
112 }else{
113 c.setAlphacxx . . $ QColor#setAlpha(d4f767463ce0a6b3).(60);
114 p->setPencxx . . $ QPainter#setPen(af0a25dfda3214db).(QPencxx . . $ QPen#QPen(c1f9b1cc0228302b).(ccxx . . $ QBrush#QBrush(b50947b0752ea6ac).,1));
115 }
116 p->drawTextcxx . . $ QPainter#drawText(5e6899f7fbe08e9d).(rect, Qtcxx . . $ Qt/::AlignLeftcxx . . $ Qt/AlignLeft., text);
117 }
118
119 }
120