Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7737edff47 | ||
|
|
b7e7743b21 | ||
|
|
7232feee5a | ||
|
|
6b127f9661 | ||
|
|
e2641092b8 | ||
|
|
49e7f54d2f | ||
|
|
0f00212c58 | ||
|
|
dba0e66646 | ||
|
|
2ed7ecb08d | ||
|
|
f9cb16a0f0 | ||
|
|
06bcb3f2da | ||
|
|
03b86f5f2c | ||
|
|
b56147efb7 | ||
|
|
ca3588cab0 | ||
|
|
795302fbaf | ||
|
|
60ee870ae5 | ||
|
|
975149642f | ||
|
|
bba945b3b9 | ||
|
|
5b3f9c4662 | ||
|
|
3bdb0e03f2 | ||
|
|
27a8ea013e |
13
ChangeLog
13
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2021-04-18 17.0
|
||||||
|
- Fixes:
|
||||||
|
- Crash when a window icon is large (issue #786) (santouits)
|
||||||
|
- Minute clock doesn't update (issue #786)
|
||||||
|
- Scrollbars in tint2conf (issue #796)
|
||||||
|
- Preserve item order when skipping executors (issue #799)
|
||||||
|
- Image memory leak (issues #704, #721) (Adam M. Trofa)
|
||||||
|
- Incorrect timeout microsecond computation leading to high CPU usage (issue #800)
|
||||||
|
- Enhancements:
|
||||||
|
- Port tint2conf to gtk3 (issue #380)
|
||||||
|
- execp_monitor config (issue #799)
|
||||||
|
- Improved executor examples (Nikita Zlobin)
|
||||||
2019-07-14 16.7
|
2019-07-14 16.7
|
||||||
- Fixes:
|
- Fixes:
|
||||||
- Fix spacing around icons in executor without text in vertical panels (issue #716)
|
- Fix spacing around icons in executor without text in vertical panels (issue #716)
|
||||||
@@ -1031,3 +1043,4 @@ released tint-0.2
|
|||||||
.
|
.
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
|
.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Latest stable release: 16.7
|
# Latest stable release: 17.0
|
||||||
Changes: https://gitlab.com/o9000/tint2/blob/16.7/ChangeLog
|
Changes: https://gitlab.com/o9000/tint2/blob/17.0/ChangeLog
|
||||||
|
|
||||||
Documentation: [doc/tint2.md](doc/tint2.md)
|
Documentation: [doc/tint2.md](doc/tint2.md)
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ Compile it with (after you install the [dependencies](https://gitlab.com/o9000/t
|
|||||||
```
|
```
|
||||||
git clone https://gitlab.com/o9000/tint2.git
|
git clone https://gitlab.com/o9000/tint2.git
|
||||||
cd tint2
|
cd tint2
|
||||||
git checkout 16.7
|
git checkout 17.0
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
|
|||||||
@@ -609,6 +609,7 @@ panel_size = 94% 30
|
|||||||
<li><p><code>execp_background_id = integer</code> : Which background to use. <em>(since 0.12.4)</em></p></li>
|
<li><p><code>execp_background_id = integer</code> : Which background to use. <em>(since 0.12.4)</em></p></li>
|
||||||
<li><p><code>execp_centered = boolean (0 or 1)</code> : Whether to center the text. <em>(since 0.12.4)</em></p></li>
|
<li><p><code>execp_centered = boolean (0 or 1)</code> : Whether to center the text. <em>(since 0.12.4)</em></p></li>
|
||||||
<li><p><code>execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text</code> <em>(since 0.12.4)</em></p></li>
|
<li><p><code>execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text</code> <em>(since 0.12.4)</em></p></li>
|
||||||
|
<li><p><code>execp_monitor = integer (1, 2, ...), primary or all</code> : On which monitor to draw the executor. The first monitor is <code>1</code>. <em>(since 17.0)</em></p></li>
|
||||||
<li><p><code>execp_lclick_command = text</code> : Command to execute on left click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
<li><p><code>execp_lclick_command = text</code> : Command to execute on left click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
||||||
<li><p><code>execp_mclick_command = text</code> : Command to execute on right click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
<li><p><code>execp_mclick_command = text</code> : Command to execute on right click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
||||||
<li><p><code>execp_rclick_command = text</code> : Command to execute on middle click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
<li><p><code>execp_rclick_command = text</code> : Command to execute on middle click. If not defined, <code>execp_command</code> is executed immediately, unless it is currently running. <em>(since 0.12.4)</em></p></li>
|
||||||
@@ -647,13 +648,13 @@ execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep vi
|
|||||||
execp_continuous = 0
|
execp_continuous = 0
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_markup = 1
|
execp_markup = 1
|
||||||
</code></pre></div><h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code>execp = new
|
</code></pre></div><h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
||||||
execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }'
|
|
||||||
execp_interval = 5
|
|
||||||
execp_continuous = 0
|
|
||||||
</code></pre></div><h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
|
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
|
||||||
|
execp_interval = 1
|
||||||
|
execp_continuous = 1
|
||||||
|
</code></pre></div><h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><div class="highlight"><pre class="highlight plaintext"><code>execp = new
|
||||||
|
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | stdbuf -oL awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }'
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
</code></pre></div><h3 id="button">Button<a name="button" href="#button" class="md2man-permalink" title="permalink"></a></h3>
|
</code></pre></div><h3 id="button">Button<a name="button" href="#button" class="md2man-permalink" title="permalink"></a></h3>
|
||||||
|
|||||||
@@ -199,9 +199,9 @@ pre {
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="latest-stable-release-16-7"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">16.7</span><a name="latest-stable-release-16-7" href="#latest-stable-release-16-7" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/16.7/ChangeLog">https://gitlab.com/o9000/tint2/blob/16.7/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (after you install the <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><div class="highlight"><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git
|
<h1 id="latest-stable-release-17-0"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">17.0</span><a name="latest-stable-release-17-0" href="#latest-stable-release-17-0" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/17.0/ChangeLog">https://gitlab.com/o9000/tint2/blob/17.0/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (after you install the <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><div class="highlight"><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git
|
||||||
cd tint2
|
cd tint2
|
||||||
git checkout 16.7
|
git checkout 17.0
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
|
|||||||
14
doc/tint2.1
14
doc/tint2.1
@@ -1,4 +1,4 @@
|
|||||||
.TH TINT2 1 "2019\-07\-14" 16.7
|
.TH TINT2 1 "2021\-04\-18" 17.0
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
tint2 \- lightweight panel/taskbar
|
tint2 \- lightweight panel/taskbar
|
||||||
@@ -748,6 +748,8 @@ To hide the clock, comment \fB\fCtime1_format\fR and \fB\fCtime2_format\fR\&.
|
|||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCexecp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text\fR \fI(since 0.12.4)\fP
|
\fB\fCexecp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text\fR \fI(since 0.12.4)\fP
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
|
\fB\fCexecp_monitor = integer (1, 2, ...), primary or all\fR : On which monitor to draw the executor. The first monitor is \fB\fC1\fR\&. \fI(since 17.0)\fP
|
||||||
|
.IP \(bu 2
|
||||||
\fB\fCexecp_lclick_command = text\fR : Command to execute on left click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
|
\fB\fCexecp_lclick_command = text\fR : Command to execute on left click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCexecp_mclick_command = text\fR : Command to execute on right click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
|
\fB\fCexecp_mclick_command = text\fR : Command to execute on right click. If not defined, \fB\fCexecp_command\fR is executed immediately, unless it is currently running. \fI(since 0.12.4)\fP
|
||||||
@@ -831,19 +833,19 @@ execp_markup = 1
|
|||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
.nf
|
.nf
|
||||||
|
# Note the use of "stdbuf \-oL" to force the program to flush the output line by line.
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = free | awk '/^\-/ { printf "Mem: '$(free \-h | awk '/^Mem:/ { print $2 }')' %.0f%%\\n", 100*$3/($3+$4); fflush(stdout) }'
|
execp_command = free \-b \-s1 | stdbuf \-oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\\n", $2, 100 * ($2 \- $7) / $2 }' | stdbuf \-oL numfmt \-\-to=iec\-i \-\-field=2 \-d' '
|
||||||
execp_interval = 5
|
execp_interval = 1
|
||||||
execp_continuous = 0
|
execp_continuous = 1
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.SS Network load
|
.SS Network load
|
||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
.nf
|
.nf
|
||||||
# Note the use of "stdbuf \-oL" to force the program to flush the output line by line.
|
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = stdbuf \-oL bwm\-ng \-o csv \-t 1000 | awk \-F ';' '/total/ { printf "Net: %.0f Mb/s\\n", ($5*8/1.0e6) }; fflush(stdout)'
|
execp_command = stdbuf \-oL bwm\-ng \-o csv \-t 1000 | stdbuf \-oL awk \-F ';' '/total/ { printf "Net: %.0f Mb/s\\n", ($5*8/1.0e6) }'
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
.fi
|
.fi
|
||||||
|
|||||||
@@ -372,14 +372,14 @@ execp_continuous = 1
|
|||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_markup = 1
|
execp_markup = 1
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new
|
<h5 id="memory-usage">Memory usage<a name="memory-usage" href="#memory-usage" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
||||||
execp_command = free -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
|
execp = new
|
||||||
|
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
<h5 id="network-load">Network load<a name="network-load" href="#network-load" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new
|
||||||
execp = new
|
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | stdbuf -oL awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }'
|
||||||
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
|
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|||||||
14
doc/tint2.md
14
doc/tint2.md
@@ -1,4 +1,4 @@
|
|||||||
# TINT2 1 "2019-07-14" 16.7
|
# TINT2 1 "2021-04-18" 17.0
|
||||||
|
|
||||||
## NAME
|
## NAME
|
||||||
tint2 - lightweight panel/taskbar
|
tint2 - lightweight panel/taskbar
|
||||||
@@ -621,6 +621,8 @@ The action semantics:
|
|||||||
|
|
||||||
* `execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text` *(since 0.12.4)*
|
* `execp_padding = horizontal_padding vertical_padding spacing_between_icon_and_text` *(since 0.12.4)*
|
||||||
|
|
||||||
|
* `execp_monitor = integer (1, 2, ...), primary or all` : On which monitor to draw the executor. The first monitor is `1`. *(since 17.0)*
|
||||||
|
|
||||||
* `execp_lclick_command = text` : Command to execute on left click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
* `execp_lclick_command = text` : Command to execute on left click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
||||||
* `execp_mclick_command = text` : Command to execute on right click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
* `execp_mclick_command = text` : Command to execute on right click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
||||||
* `execp_rclick_command = text` : Command to execute on middle click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
* `execp_rclick_command = text` : Command to execute on middle click. If not defined, `execp_command` is executed immediately, unless it is currently running. *(since 0.12.4)*
|
||||||
@@ -694,18 +696,18 @@ execp_markup = 1
|
|||||||
##### Memory usage
|
##### Memory usage
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = free | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%%\n", 100*$3/($3+$4); fflush(stdout) }'
|
execp_command = free -b -s1 | stdbuf -oL awk '/^Mem:/ { printf "Mem: %s %.0f%%\n", $2, 100 * ($2 - $7) / $2 }' | stdbuf -oL numfmt --to=iec-i --field=2 -d' '
|
||||||
execp_interval = 5
|
execp_interval = 1
|
||||||
execp_continuous = 0
|
execp_continuous = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Network load
|
##### Network load
|
||||||
|
|
||||||
```
|
```
|
||||||
# Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }; fflush(stdout)'
|
execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | stdbuf -oL awk -F ';' '/total/ { printf "Net: %.0f Mb/s\n", ($5*8/1.0e6) }'
|
||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Build-Depends: cmake,
|
|||||||
debhelper (>= 9),
|
debhelper (>= 9),
|
||||||
libcairo2-dev,
|
libcairo2-dev,
|
||||||
libglib2.0-dev,
|
libglib2.0-dev,
|
||||||
libgtk2.0-dev,
|
libgtk-3-dev,
|
||||||
libimlib2-dev,
|
libimlib2-dev,
|
||||||
libpango1.0-dev,
|
libpango1.0-dev,
|
||||||
librsvg2-dev,
|
librsvg2-dev,
|
||||||
|
|||||||
@@ -129,17 +129,28 @@ struct tm *clock_gettime_for_tz(const char *timezone)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void update_clock_text(char *dst, size_t size, const char *format,
|
||||||
|
const char *timezone, bool *changed)
|
||||||
|
{
|
||||||
|
if (!dst || !format) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
char tmp[256] = "";
|
||||||
|
strncpy(tmp, dst, sizeof(tmp) - 1);
|
||||||
|
strftime(dst, size, format, clock_gettime_for_tz(timezone));
|
||||||
|
*changed = *changed || strcmp(dst, tmp) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
void update_clocks()
|
void update_clocks()
|
||||||
{
|
{
|
||||||
if (time1_format)
|
bool changed = false;
|
||||||
strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone));
|
update_clock_text(buf_time, sizeof(buf_time), time1_format, time1_timezone, &changed);
|
||||||
if (time2_format)
|
update_clock_text(buf_date, sizeof(buf_date), time2_format, time2_timezone, &changed);
|
||||||
strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone));
|
if (changed) {
|
||||||
if (time1_format || time2_format) {
|
|
||||||
for (int i = 0; i < num_panels; i++)
|
for (int i = 0; i < num_panels; i++)
|
||||||
panels[i].clock.area.resize_needed = 1;
|
panels[i].clock.area.resize_needed = 1;
|
||||||
|
schedule_panel_redraw();
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ms_until_second_change(struct timeval* tm)
|
int ms_until_second_change(struct timeval* tm)
|
||||||
@@ -157,33 +168,6 @@ void update_clocks_sec(void *arg)
|
|||||||
change_timer(&clock_timer, true, ms_until_second_change(&time_clock), 0, update_clocks_sec, 0);
|
change_timer(&clock_timer, true, ms_until_second_change(&time_clock), 0, update_clocks_sec, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_clocks_min(void *arg)
|
|
||||||
{
|
|
||||||
// remember old_sec because after suspend/hibernate the clock should be updated directly, and not
|
|
||||||
// on next minute change
|
|
||||||
static time_t old_sec = 0;
|
|
||||||
gettimeofday(&time_clock, 0);
|
|
||||||
if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60 || (time1_format && !buf_time[0]) || (time2_format && !buf_date[0]))
|
|
||||||
update_clocks();
|
|
||||||
old_sec = time_clock.tv_sec;
|
|
||||||
change_timer(&clock_timer, true, ms_until_second_change(&time_clock), 0, update_clocks_min, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean time_format_needs_sec_ticks(char *time_format)
|
|
||||||
{
|
|
||||||
if (!time_format)
|
|
||||||
return FALSE;
|
|
||||||
if (strchr(time_format, 'c') ||
|
|
||||||
strchr(time_format, 'r') ||
|
|
||||||
strchr(time_format, 's') ||
|
|
||||||
strchr(time_format, 'S') ||
|
|
||||||
strchr(time_format, 'T') ||
|
|
||||||
strchr(time_format, 'X') ||
|
|
||||||
strchr(time_format, '+'))
|
|
||||||
return TRUE;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_clock()
|
void init_clock()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -222,11 +206,7 @@ void init_clock_panel(void *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!clock_timer.enabled_) {
|
if (!clock_timer.enabled_) {
|
||||||
if (time_format_needs_sec_ticks(time1_format) || time_format_needs_sec_ticks(time2_format)) {
|
update_clocks_sec(NULL);
|
||||||
update_clocks_sec(NULL);
|
|
||||||
} else {
|
|
||||||
update_clocks_min(NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -697,6 +697,9 @@ void add_entry(char *key, char *value)
|
|||||||
} else {
|
} else {
|
||||||
execp->backend->interval = v;
|
execp->backend->interval = v;
|
||||||
}
|
}
|
||||||
|
} else if (strcmp(key, "execp_monitor") == 0) {
|
||||||
|
Execp *execp = get_or_create_last_execp();
|
||||||
|
execp->backend->monitor = config_get_monitor(value);
|
||||||
} else if (strcmp(key, "execp_has_icon") == 0) {
|
} else if (strcmp(key, "execp_has_icon") == 0) {
|
||||||
Execp *execp = get_or_create_last_execp();
|
Execp *execp = get_or_create_last_execp();
|
||||||
execp->backend->has_icon = atoi(value);
|
execp->backend->has_icon = atoi(value);
|
||||||
|
|||||||
@@ -43,13 +43,35 @@ Execp *create_execp()
|
|||||||
execp->backend->cache_icon = TRUE;
|
execp->backend->cache_icon = TRUE;
|
||||||
execp->backend->centered = TRUE;
|
execp->backend->centered = TRUE;
|
||||||
execp->backend->font_color.alpha = 0.5;
|
execp->backend->font_color.alpha = 0.5;
|
||||||
|
execp->backend->monitor = -1;
|
||||||
INIT_TIMER(execp->backend->timer);
|
INIT_TIMER(execp->backend->timer);
|
||||||
|
execp->backend->bg = &g_array_index(backgrounds, Background, 0);
|
||||||
|
execp->backend->buf_stdout_capacity = 1024;
|
||||||
|
execp->backend->buf_stdout = calloc(execp->backend->buf_stdout_capacity, 1);
|
||||||
|
execp->backend->buf_stderr_capacity = 1024;
|
||||||
|
execp->backend->buf_stderr = calloc(execp->backend->buf_stderr_capacity, 1);
|
||||||
|
execp->backend->text = strdup("");
|
||||||
|
execp->backend->icon_path = NULL;
|
||||||
return execp;
|
return execp;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpointer create_execp_frontend(gconstpointer arg, gpointer data)
|
gpointer create_execp_frontend(gconstpointer arg, gpointer data)
|
||||||
{
|
{
|
||||||
Execp *execp_backend = (Execp *)arg;
|
Execp *execp_backend = (Execp *)arg;
|
||||||
|
Panel *panel = data;
|
||||||
|
if (execp_backend->backend->monitor >= 0 &&
|
||||||
|
panel->monitor != execp_backend->backend->monitor) {
|
||||||
|
printf("Skipping executor '%s' with monitor %d for panel on monitor %d\n",
|
||||||
|
execp_backend->backend->command,
|
||||||
|
execp_backend->backend->monitor, panel->monitor);
|
||||||
|
Execp *dummy = create_execp();
|
||||||
|
dummy->frontend = (ExecpFrontend *)calloc(1, sizeof(ExecpFrontend));
|
||||||
|
dummy->backend->instances = g_list_append(execp_backend->backend->instances, dummy);
|
||||||
|
return dummy;
|
||||||
|
}
|
||||||
|
printf("Creating executor '%s' with monitor %d for panel on monitor %d\n",
|
||||||
|
execp_backend->backend->command,
|
||||||
|
execp_backend->backend->monitor, panel->monitor);
|
||||||
|
|
||||||
Execp *execp_frontend = (Execp *)calloc(1, sizeof(Execp));
|
Execp *execp_frontend = (Execp *)calloc(1, sizeof(Execp));
|
||||||
execp_frontend->backend = execp_backend->backend;
|
execp_frontend->backend = execp_backend->backend;
|
||||||
@@ -144,12 +166,6 @@ void init_execp()
|
|||||||
// Set missing config options
|
// Set missing config options
|
||||||
if (!execp->backend->bg)
|
if (!execp->backend->bg)
|
||||||
execp->backend->bg = &g_array_index(backgrounds, Background, 0);
|
execp->backend->bg = &g_array_index(backgrounds, Background, 0);
|
||||||
execp->backend->buf_stdout_capacity = 1024;
|
|
||||||
execp->backend->buf_stdout = calloc(execp->backend->buf_stdout_capacity, 1);
|
|
||||||
execp->backend->buf_stderr_capacity = 1024;
|
|
||||||
execp->backend->buf_stderr = calloc(execp->backend->buf_stderr_capacity, 1);
|
|
||||||
execp->backend->text = strdup("");
|
|
||||||
execp->backend->icon_path = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +179,7 @@ void init_execp_panel(void *p)
|
|||||||
|
|
||||||
// panel->execp_list is now a copy of the pointer panel_config.execp_list
|
// panel->execp_list is now a copy of the pointer panel_config.execp_list
|
||||||
// We make it a deep copy
|
// We make it a deep copy
|
||||||
panel->execp_list = g_list_copy_deep(panel_config.execp_list, create_execp_frontend, NULL);
|
panel->execp_list = g_list_copy_deep(panel_config.execp_list, create_execp_frontend, panel);
|
||||||
|
|
||||||
for (GList *l = panel->execp_list; l; l = l->next) {
|
for (GList *l = panel->execp_list; l; l = l->next) {
|
||||||
Execp *execp = l->data;
|
Execp *execp = l->data;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ typedef struct ExecpBackend {
|
|||||||
char *command;
|
char *command;
|
||||||
// Interval in seconds
|
// Interval in seconds
|
||||||
int interval;
|
int interval;
|
||||||
|
int monitor;
|
||||||
// 1 if first line of output is an icon path
|
// 1 if first line of output is an icon path
|
||||||
gboolean has_icon;
|
gboolean has_icon;
|
||||||
gboolean cache_icon;
|
gboolean cache_icon;
|
||||||
|
|||||||
@@ -389,9 +389,9 @@ gboolean handle_x_event_autohide(XEvent *e)
|
|||||||
Panel *panel = get_panel(e->xany.window);
|
Panel *panel = get_panel(e->xany.window);
|
||||||
if (panel && panel_autohide) {
|
if (panel && panel_autohide) {
|
||||||
if (e->type == EnterNotify)
|
if (e->type == EnterNotify)
|
||||||
autohide_trigger_show(panel);
|
autohide_trigger_show(panel, e->xany.send_event);
|
||||||
else if (e->type == LeaveNotify)
|
else if (e->type == LeaveNotify)
|
||||||
autohide_trigger_hide(panel);
|
autohide_trigger_hide(panel, e->xany.send_event);
|
||||||
if (panel->is_hidden) {
|
if (panel->is_hidden) {
|
||||||
if (e->type == ClientMessage && e->xclient.message_type == server.atom.XdndPosition) {
|
if (e->type == ClientMessage && e->xclient.message_type == server.atom.XdndPosition) {
|
||||||
hidden_panel_shown_for_dnd = TRUE;
|
hidden_panel_shown_for_dnd = TRUE;
|
||||||
|
|||||||
28
src/panel.c
28
src/panel.c
@@ -269,8 +269,9 @@ void init_panel()
|
|||||||
init_freespace_panel(p);
|
init_freespace_panel(p);
|
||||||
if (panel_items_order[k] == ':')
|
if (panel_items_order[k] == ':')
|
||||||
init_separator_panel(p);
|
init_separator_panel(p);
|
||||||
if (panel_items_order[k] == 'E')
|
if (panel_items_order[k] == 'E') {
|
||||||
init_execp_panel(p);
|
init_execp_panel(p);
|
||||||
|
}
|
||||||
if (panel_items_order[k] == 'P')
|
if (panel_items_order[k] == 'P')
|
||||||
init_button_panel(p);
|
init_button_panel(p);
|
||||||
}
|
}
|
||||||
@@ -316,7 +317,7 @@ void init_panel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (panel_autohide)
|
if (panel_autohide)
|
||||||
autohide_trigger_hide(p);
|
autohide_trigger_hide(p, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
taskbar_refresh_tasklist();
|
taskbar_refresh_tasklist();
|
||||||
@@ -1139,26 +1140,27 @@ void autohide_hide(void *p)
|
|||||||
schedule_panel_redraw();
|
schedule_panel_redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void autohide_trigger_show(Panel *p)
|
void autohide_trigger_show(Panel *p, bool forced)
|
||||||
{
|
{
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
change_timer(&p->autohide_timer, true, panel_autohide_show_timeout, 0, autohide_show, p);
|
change_timer(&p->autohide_timer, true, forced ? 0 : panel_autohide_show_timeout, 0, autohide_show, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void autohide_trigger_hide(Panel *p)
|
void autohide_trigger_hide(Panel *p, bool forced)
|
||||||
{
|
{
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Window root, child;
|
if (!forced) {
|
||||||
int xr, yr, xw, yw;
|
Window root, child;
|
||||||
unsigned int mask;
|
int xr, yr, xw, yw;
|
||||||
if (XQueryPointer(server.display, p->main_win, &root, &child, &xr, &yr, &xw, &yw, &mask))
|
unsigned int mask;
|
||||||
if (child)
|
if (XQueryPointer(server.display, p->main_win, &root, &child, &xr, &yr, &xw, &yw, &mask))
|
||||||
return; // mouse over one of the system tray icons
|
if (child)
|
||||||
|
return; // mouse over one of the system tray icons
|
||||||
change_timer(&p->autohide_timer, true, panel_autohide_hide_timeout, 0, autohide_hide, p);
|
}
|
||||||
|
change_timer(&p->autohide_timer, true, forced ? 0 : panel_autohide_hide_timeout, 0, autohide_hide, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void shrink_panel(Panel *panel)
|
void shrink_panel(Panel *panel)
|
||||||
|
|||||||
@@ -203,8 +203,8 @@ Button *click_button(Panel *panel, int x, int y);
|
|||||||
|
|
||||||
void autohide_show(void *p);
|
void autohide_show(void *p);
|
||||||
void autohide_hide(void *p);
|
void autohide_hide(void *p);
|
||||||
void autohide_trigger_show(Panel *p);
|
void autohide_trigger_show(Panel *p, bool forced);
|
||||||
void autohide_trigger_hide(Panel *p);
|
void autohide_trigger_hide(Panel *p, bool forced);
|
||||||
|
|
||||||
const char *get_default_font();
|
const char *get_default_font();
|
||||||
|
|
||||||
|
|||||||
@@ -312,10 +312,16 @@ Imlib_Image task_get_icon(Window win, int icon_size)
|
|||||||
int w, h;
|
int w, h;
|
||||||
gulong *tmp_data = get_best_icon(data, get_icon_count(data, len), len, &w, &h, icon_size);
|
gulong *tmp_data = get_best_icon(data, get_icon_count(data, len), len, &w, &h, icon_size);
|
||||||
if (tmp_data) {
|
if (tmp_data) {
|
||||||
DATA32 icon_data[w * h];
|
int array_size = w * h;
|
||||||
for (int j = 0; j < w * h; ++j)
|
// imlib needs the array in DATA32 type
|
||||||
icon_data[j] = tmp_data[j];
|
// using malloc for the array to protect from stack overflow
|
||||||
img = imlib_create_image_using_copied_data(w, h, icon_data);
|
DATA32 *icon_data = (DATA32*) g_try_malloc(sizeof(*icon_data) * array_size);
|
||||||
|
if (icon_data) {
|
||||||
|
for (int j = 0; j < array_size; ++j)
|
||||||
|
icon_data[j] = tmp_data[j];
|
||||||
|
img = imlib_create_image_using_copied_data(w, h, icon_data);
|
||||||
|
g_free(icon_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFree(data);
|
XFree(data);
|
||||||
|
|||||||
12
src/tint2-send/Makefile
Normal file
12
src/tint2-send/Makefile
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
ifeq ($(PREFIX),)
|
||||||
|
PREFIX := /usr/local
|
||||||
|
endif
|
||||||
|
|
||||||
|
tint2-send: tint2-send.c
|
||||||
|
$(CC) tint2-send.c -lX11 -o tint2-send
|
||||||
|
|
||||||
|
install: tint2-send
|
||||||
|
install -m 755 tint2-send $(DESTDIR)/$(PREFIX)/bin/
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f tint2-send
|
||||||
128
src/tint2-send/tint2-send.c
Normal file
128
src/tint2-send/tint2-send.c
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xutil.h>
|
||||||
|
#include <X11/Xatom.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
static Display *display = 0;
|
||||||
|
|
||||||
|
/* From wmctrl */
|
||||||
|
char *get_property(Window window, Atom xa_prop_type, const char *prop_name) {
|
||||||
|
Atom xa_prop_name = XInternAtom(display, prop_name, False);
|
||||||
|
|
||||||
|
Atom xa_ret_type;
|
||||||
|
int ret_format;
|
||||||
|
unsigned long ret_nitems;
|
||||||
|
unsigned long ret_bytes_after;
|
||||||
|
unsigned long tmp_size;
|
||||||
|
unsigned char *ret_prop;
|
||||||
|
if (XGetWindowProperty(display, window, xa_prop_name, 0, 1024,
|
||||||
|
False, xa_prop_type, &xa_ret_type, &ret_format,
|
||||||
|
&ret_nitems, &ret_bytes_after, &ret_prop) != Success) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (xa_ret_type != xa_prop_type) {
|
||||||
|
XFree(ret_prop);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Correct 64 Architecture implementation of 32 bit data */
|
||||||
|
tmp_size = (ret_format / 8) * ret_nitems;
|
||||||
|
if (ret_format == 32)
|
||||||
|
tmp_size *= sizeof(long) / 4;
|
||||||
|
|
||||||
|
char *ret = (char *)calloc(1, tmp_size + 1);
|
||||||
|
memcpy(ret, ret_prop, tmp_size);
|
||||||
|
|
||||||
|
XFree(ret_prop);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int is_tint2(Window window)
|
||||||
|
{
|
||||||
|
XWindowAttributes attr = {};
|
||||||
|
if (!XGetWindowAttributes(display, window, &attr))
|
||||||
|
return 0;
|
||||||
|
if (attr.map_state != IsViewable)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
char *wm_class = get_property(window, XA_STRING, "WM_NAME");
|
||||||
|
if (!wm_class) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int class_match = 0;
|
||||||
|
if (strcmp(wm_class, "tint2") == 0) {
|
||||||
|
class_match = 1;
|
||||||
|
}
|
||||||
|
free(wm_class);
|
||||||
|
return class_match;
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_tint2_window(Window window, void *arg)
|
||||||
|
{
|
||||||
|
if (!is_tint2(window))
|
||||||
|
return;
|
||||||
|
char *action = (char *)arg;
|
||||||
|
if (strcmp(action, "show") == 0) {
|
||||||
|
fprintf(stderr, "Showing tint2 window: %lx\n", window);
|
||||||
|
XEvent event = {};
|
||||||
|
event.xcrossing.type = EnterNotify;
|
||||||
|
event.xcrossing.window = window;
|
||||||
|
event.xcrossing.mode = NotifyNormal;
|
||||||
|
event.xcrossing.detail = NotifyVirtual;
|
||||||
|
event.xcrossing.same_screen = True;
|
||||||
|
XSendEvent(display, window, False, 0, &event);
|
||||||
|
XFlush(display);
|
||||||
|
} else if (strcmp(action, "hide") == 0) {
|
||||||
|
fprintf(stderr, "Hiding tint2 window: %lx\n", window);
|
||||||
|
XEvent event = {};
|
||||||
|
event.xcrossing.type = LeaveNotify;
|
||||||
|
event.xcrossing.window = window;
|
||||||
|
event.xcrossing.mode = NotifyNormal;
|
||||||
|
event.xcrossing.detail = NotifyVirtual;
|
||||||
|
event.xcrossing.same_screen = True;
|
||||||
|
XSendEvent(display, window, False, 0, &event);
|
||||||
|
XFlush(display);
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Error: unknown action %s\n", action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef void window_callback_t(Window window, void *arg);
|
||||||
|
|
||||||
|
void walk_windows(Window node, window_callback_t *callback, void *arg)
|
||||||
|
{
|
||||||
|
callback(node, arg);
|
||||||
|
Window root = 0;
|
||||||
|
Window parent = 0;
|
||||||
|
Window *children = 0;
|
||||||
|
unsigned int nchildren = 0;
|
||||||
|
if (!XQueryTree(display, node,
|
||||||
|
&root, &parent, &children, &nchildren)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (unsigned int i = 0; i < nchildren; i++) {
|
||||||
|
walk_windows(children[i], callback, arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
display = XOpenDisplay(NULL);
|
||||||
|
if (!display ) {
|
||||||
|
fprintf(stderr, "Failed to open X11 connection\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
argc--, argv++;
|
||||||
|
if (!argc) {
|
||||||
|
fprintf(stderr, "Usage: tint2-show [show|hide]\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
char *action = argv[0];
|
||||||
|
walk_windows(DefaultRootWindow(display), handle_tint2_window, action);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ pkg_check_modules( GLIB2 REQUIRED glib-2.0 )
|
|||||||
pkg_check_modules( GOBJECT2 REQUIRED gobject-2.0 )
|
pkg_check_modules( GOBJECT2 REQUIRED gobject-2.0 )
|
||||||
pkg_check_modules( IMLIB2 REQUIRED imlib2 )
|
pkg_check_modules( IMLIB2 REQUIRED imlib2 )
|
||||||
pkg_check_modules( GTHREAD2 REQUIRED gthread-2.0 )
|
pkg_check_modules( GTHREAD2 REQUIRED gthread-2.0 )
|
||||||
pkg_check_modules( GTK2 REQUIRED gtk+-x11-2.0 )
|
pkg_check_modules( GTK3 REQUIRED gtk+-x11-3.0 )
|
||||||
pkg_check_modules( RSVG librsvg-2.0>=2.36.0 )
|
pkg_check_modules( RSVG librsvg-2.0>=2.36.0 )
|
||||||
|
|
||||||
include_directories( ../util
|
include_directories( ../util
|
||||||
@@ -16,7 +16,7 @@ include_directories( ../util
|
|||||||
${GOBJECT2_INCLUDE_DIRS}
|
${GOBJECT2_INCLUDE_DIRS}
|
||||||
${IMLIB2_INCLUDE_DIRS}
|
${IMLIB2_INCLUDE_DIRS}
|
||||||
${GTHREAD2_INCLUDE_DIRS}
|
${GTHREAD2_INCLUDE_DIRS}
|
||||||
${GTK2_INCLUDE_DIRS}
|
${GTK3_INCLUDE_DIRS}
|
||||||
${RSVG_INCLUDE_DIRS} )
|
${RSVG_INCLUDE_DIRS} )
|
||||||
|
|
||||||
set(SOURCES ../util/common.c
|
set(SOURCES ../util/common.c
|
||||||
@@ -55,7 +55,7 @@ link_directories( ${X11_T2C_LIBRARY_DIRS}
|
|||||||
${GOBJECT2_LIBRARY_DIRS}
|
${GOBJECT2_LIBRARY_DIRS}
|
||||||
${IMLIB2_LIBRARY_DIRS}
|
${IMLIB2_LIBRARY_DIRS}
|
||||||
${GTHREAD2_LIBRARY_DIRS}
|
${GTHREAD2_LIBRARY_DIRS}
|
||||||
${GTK2_LIBRARY_DIRS}
|
${GTK3_LIBRARY_DIRS}
|
||||||
${RSVG_LIBRARY_DIRS} )
|
${RSVG_LIBRARY_DIRS} )
|
||||||
add_executable( tint2conf ${SOURCES} )
|
add_executable( tint2conf ${SOURCES} )
|
||||||
target_link_libraries( tint2conf ${X11_T2C_LIBRARIES}
|
target_link_libraries( tint2conf ${X11_T2C_LIBRARIES}
|
||||||
@@ -63,13 +63,14 @@ target_link_libraries( tint2conf ${X11_T2C_LIBRARIES}
|
|||||||
${GOBJECT2_LIBRARIES}
|
${GOBJECT2_LIBRARIES}
|
||||||
${IMLIB2_LIBRARIES}
|
${IMLIB2_LIBRARIES}
|
||||||
${GTHREAD2_LIBRARIES}
|
${GTHREAD2_LIBRARIES}
|
||||||
${GTK2_LIBRARIES}
|
${GTK3_LIBRARIES}
|
||||||
${RSVG_LIBRARIES} )
|
${RSVG_LIBRARIES} )
|
||||||
|
|
||||||
add_definitions( -DINSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" )
|
add_definitions( -DINSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" )
|
||||||
add_definitions( -DLOCALEDIR=\"${CMAKE_INSTALL_FULL_LOCALEDIR}\" )
|
add_definitions( -DLOCALEDIR=\"${CMAKE_INSTALL_FULL_LOCALEDIR}\" )
|
||||||
add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" )
|
add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" )
|
||||||
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -pthread -std=c99" )
|
add_definitions( -DDGLIB_DISABLE_DEPRECATION_WARNINGS=1 )
|
||||||
|
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -Wpointer-arith -fno-strict-aliasing -pthread -std=c99 -Werror-implicit-function-declaration -Wno-deprecated -Wno-deprecated-declarations" )
|
||||||
set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
|
set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
|
||||||
|
|
||||||
add_subdirectory(po)
|
add_subdirectory(po)
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ void create_background(GtkWidget *parent)
|
|||||||
backgrounds = gtk_list_store_new(bgNumCols,
|
backgrounds = gtk_list_store_new(bgNumCols,
|
||||||
GDK_TYPE_PIXBUF,
|
GDK_TYPE_PIXBUF,
|
||||||
GDK_TYPE_COLOR,
|
GDK_TYPE_COLOR,
|
||||||
GTK_TYPE_INT,
|
GTK_TYPE_SHADOW_TYPE,
|
||||||
GDK_TYPE_COLOR,
|
GDK_TYPE_COLOR,
|
||||||
GTK_TYPE_INT,
|
GTK_TYPE_INT,
|
||||||
GTK_TYPE_INT,
|
GTK_TYPE_INT,
|
||||||
@@ -121,7 +121,6 @@ void create_background(GtkWidget *parent)
|
|||||||
|
|
||||||
GtkWidget *table, *label, *button;
|
GtkWidget *table, *label, *button;
|
||||||
int row, col;
|
int row, col;
|
||||||
GtkTooltips *tooltips = gtk_tooltips_new();
|
|
||||||
|
|
||||||
table = gtk_table_new(1, 4, FALSE);
|
table = gtk_table_new(1, 4, FALSE);
|
||||||
gtk_widget_show(table);
|
gtk_widget_show(table);
|
||||||
@@ -141,21 +140,21 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(current_background);
|
gtk_widget_show(current_background);
|
||||||
gtk_table_attach(GTK_TABLE(table), current_background, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), current_background, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, current_background, _("Selects the background you would like to modify"), NULL);
|
gtk_widget_set_tooltip_text(current_background, _("Selects the background you would like to modify"));
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-add");
|
button = gtk_button_new_from_stock("gtk-add");
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(background_duplicate), NULL);
|
g_signal_connect(button, "clicked", G_CALLBACK(background_duplicate), NULL);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, button, _("Creates a copy of the current background"), NULL);
|
gtk_widget_set_tooltip_text(button, _("Creates a copy of the current background"));
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-remove");
|
button = gtk_button_new_from_stock("gtk-remove");
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(background_delete), NULL);
|
g_signal_connect(button, "clicked", G_CALLBACK(background_delete), NULL);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, button, _("Deletes the current background"), NULL);
|
gtk_widget_set_tooltip_text(button, _("Deletes the current background"));
|
||||||
|
|
||||||
table = gtk_table_new(4, 4, FALSE);
|
table = gtk_table_new(4, 4, FALSE);
|
||||||
gtk_widget_show(table);
|
gtk_widget_show(table);
|
||||||
@@ -175,7 +174,7 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_fill_color);
|
gtk_widget_show(background_fill_color);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_fill_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_fill_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, background_fill_color, _("The fill color of the current background"), NULL);
|
gtk_widget_set_tooltip_text(background_fill_color, _("The fill color of the current background"));
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Fill tint"));
|
label = gtk_label_new(_("Fill tint"));
|
||||||
@@ -188,7 +187,7 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_fill_content_tint_weight);
|
gtk_widget_show(background_fill_content_tint_weight);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_fill_content_tint_weight, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_fill_content_tint_weight, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, background_fill_content_tint_weight, _("How much the border color should be tinted with the content color"), NULL);
|
gtk_widget_set_tooltip_text(background_fill_content_tint_weight, _("How much the border color should be tinted with the content color"));
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Border color"));
|
label = gtk_label_new(_("Border color"));
|
||||||
@@ -202,7 +201,7 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_border_color);
|
gtk_widget_show(background_border_color);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_border_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_border_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, background_border_color, _("The border color of the current background"), NULL);
|
gtk_widget_set_tooltip_text(background_border_color, _("The border color of the current background"));
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Border tint"));
|
label = gtk_label_new(_("Border tint"));
|
||||||
@@ -215,7 +214,7 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_border_content_tint_weight);
|
gtk_widget_show(background_border_content_tint_weight);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_border_content_tint_weight, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_border_content_tint_weight, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, background_border_content_tint_weight, _("How much the border color should be tinted with the content color"), NULL);
|
gtk_widget_set_tooltip_text(background_border_content_tint_weight, _("How much the border color should be tinted with the content color"));
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Gradient"));
|
label = gtk_label_new(_("Gradient"));
|
||||||
@@ -241,10 +240,8 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_fill_color_over);
|
gtk_widget_show(background_fill_color_over);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_fill_color_over, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_fill_color_over, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips,
|
gtk_widget_set_tooltip_text(background_fill_color_over,
|
||||||
background_fill_color_over,
|
_("The fill color of the current background on mouse over"));
|
||||||
_("The fill color of the current background on mouse over"),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Border color (mouse over)"));
|
label = gtk_label_new(_("Border color (mouse over)"));
|
||||||
@@ -258,10 +255,9 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_border_color_over);
|
gtk_widget_show(background_border_color_over);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_border_color_over, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_border_color_over, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips,
|
gtk_widget_set_tooltip_text(
|
||||||
background_border_color_over,
|
background_border_color_over,
|
||||||
_("The border color of the current background on mouse over"),
|
_("The border color of the current background on mouse over"));
|
||||||
NULL);
|
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Gradient (mouse over)"));
|
label = gtk_label_new(_("Gradient (mouse over)"));
|
||||||
@@ -287,10 +283,8 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_fill_color_press);
|
gtk_widget_show(background_fill_color_press);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_fill_color_press, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_fill_color_press, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips,
|
gtk_widget_set_tooltip_text(background_fill_color_press,
|
||||||
background_fill_color_press,
|
_("The fill color of the current background on mouse button press"));
|
||||||
_("The fill color of the current background on mouse button press"),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Border color (pressed)"));
|
label = gtk_label_new(_("Border color (pressed)"));
|
||||||
@@ -304,10 +298,8 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_border_color_press);
|
gtk_widget_show(background_border_color_press);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_border_color_press, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_border_color_press, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips,
|
gtk_widget_set_tooltip_text(background_border_color_press,
|
||||||
background_border_color_press,
|
_("The border color of the current background on mouse button press"));
|
||||||
_("The border color of the current background on mouse button press"),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Gradient (pressed)"));
|
label = gtk_label_new(_("Gradient (pressed)"));
|
||||||
@@ -332,10 +324,8 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_border_width);
|
gtk_widget_show(background_border_width);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_border_width, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_border_width, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips,
|
gtk_widget_set_tooltip_text(background_border_width,
|
||||||
background_border_width,
|
_("The width of the border of the current background, in pixels"));
|
||||||
_("The width of the border of the current background, in pixels"),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
label = gtk_label_new(_("Corner radius"));
|
label = gtk_label_new(_("Corner radius"));
|
||||||
@@ -348,7 +338,7 @@ void create_background(GtkWidget *parent)
|
|||||||
gtk_widget_show(background_corner_radius);
|
gtk_widget_show(background_corner_radius);
|
||||||
gtk_table_attach(GTK_TABLE(table), background_corner_radius, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), background_corner_radius, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_tooltips_set_tip(tooltips, background_corner_radius, _("The corner radius of the current background"), NULL);
|
gtk_widget_set_tooltip_text(background_corner_radius, _("The corner radius of the current background"));
|
||||||
|
|
||||||
row++;
|
row++;
|
||||||
col = 2;
|
col = 2;
|
||||||
@@ -712,9 +702,8 @@ void background_update_image(int index)
|
|||||||
g_boxed_free(GDK_TYPE_COLOR, fillColor);
|
g_boxed_free(GDK_TYPE_COLOR, fillColor);
|
||||||
g_boxed_free(GDK_TYPE_COLOR, borderColor);
|
g_boxed_free(GDK_TYPE_COLOR, borderColor);
|
||||||
|
|
||||||
GdkPixmap *pixmap = gdk_pixmap_new(NULL, w, h, 24);
|
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_RGB24, w, h);
|
||||||
|
cairo_t *cr = cairo_create(s);
|
||||||
cairo_t *cr = gdk_cairo_create(pixmap);
|
|
||||||
cairo_set_line_width(cr, b);
|
cairo_set_line_width(cr, b);
|
||||||
|
|
||||||
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
|
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
|
||||||
@@ -744,13 +733,12 @@ void background_update_image(int index)
|
|||||||
cairo_destroy(cr);
|
cairo_destroy(cr);
|
||||||
cr = NULL;
|
cr = NULL;
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, gdk_colormap_get_system(), 0, 0, 0, 0, w, h);
|
pixbuf = gdk_pixbuf_get_from_surface(s, 0, 0, w, h);
|
||||||
if (pixmap)
|
|
||||||
g_object_unref(pixmap);
|
|
||||||
|
|
||||||
gtk_list_store_set(backgrounds, &iter, bgColPixbuf, pixbuf, -1);
|
gtk_list_store_set(backgrounds, &iter, bgColPixbuf, pixbuf, -1);
|
||||||
if (pixbuf)
|
if (pixbuf)
|
||||||
g_object_unref(pixbuf);
|
g_object_unref(pixbuf);
|
||||||
|
cairo_surface_destroy(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void background_force_update()
|
void background_force_update()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ GtkWidget *create_gradient_combo()
|
|||||||
|
|
||||||
void create_gradient(GtkWidget *parent)
|
void create_gradient(GtkWidget *parent)
|
||||||
{
|
{
|
||||||
gradient_ids = gtk_list_store_new(grNumCols, GDK_TYPE_PIXBUF, GTK_TYPE_INT, GTK_TYPE_STRING);
|
gradient_ids = gtk_list_store_new(grNumCols, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_STRING);
|
||||||
gradients = NULL;
|
gradients = NULL;
|
||||||
|
|
||||||
gradient_stop_ids = gtk_list_store_new(grStopNumCols, GDK_TYPE_PIXBUF);
|
gradient_stop_ids = gtk_list_store_new(grStopNumCols, GDK_TYPE_PIXBUF);
|
||||||
@@ -61,13 +61,13 @@ void create_gradient(GtkWidget *parent)
|
|||||||
col++;
|
col++;
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-add");
|
button = gtk_button_new_from_stock("gtk-add");
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_duplicate), NULL);
|
g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_duplicate), NULL);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-remove");
|
button = gtk_button_new_from_stock("gtk-remove");
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_delete), NULL);
|
g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_delete), NULL);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
@@ -85,13 +85,13 @@ void create_gradient(GtkWidget *parent)
|
|||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
gradient_combo_type = gtk_combo_box_new_text();
|
gradient_combo_type = gtk_combo_box_text_new();
|
||||||
gtk_widget_show(gradient_combo_type);
|
gtk_widget_show(gradient_combo_type);
|
||||||
gtk_table_attach(GTK_TABLE(table), gradient_combo_type, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), gradient_combo_type, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(gradient_combo_type), _("Vertical"));
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gradient_combo_type), _("Vertical"));
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(gradient_combo_type), _("Horizontal"));
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gradient_combo_type), _("Horizontal"));
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(gradient_combo_type), _("Radial"));
|
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gradient_combo_type), _("Radial"));
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(gradient_combo_type), 0);
|
gtk_combo_box_set_active(GTK_COMBO_BOX(gradient_combo_type), 0);
|
||||||
|
|
||||||
row++, col = 2;
|
row++, col = 2;
|
||||||
@@ -142,13 +142,13 @@ void create_gradient(GtkWidget *parent)
|
|||||||
col++;
|
col++;
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-add");
|
button = gtk_button_new_from_stock("gtk-add");
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_stop_duplicate), NULL);
|
g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_stop_duplicate), NULL);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-remove");
|
button = gtk_button_new_from_stock("gtk-remove");
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_stop_delete), NULL);
|
g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_stop_delete), NULL);
|
||||||
gtk_widget_show(button);
|
gtk_widget_show(button);
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
||||||
col++;
|
col++;
|
||||||
@@ -327,18 +327,17 @@ void gradient_update_image(int index)
|
|||||||
|
|
||||||
int w = 70;
|
int w = 70;
|
||||||
int h = 30;
|
int h = 30;
|
||||||
GdkPixmap *pixmap = gdk_pixmap_new(NULL, w, h, 24);
|
cairo_surface_t *pixmap = cairo_image_surface_create(CAIRO_FORMAT_RGB24, w, h);
|
||||||
|
|
||||||
cairo_t *cr = gdk_cairo_create(pixmap);
|
cairo_t *cr = cairo_create(pixmap);
|
||||||
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
|
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
|
||||||
cairo_rectangle(cr, 0, 0, w, h);
|
cairo_rectangle(cr, 0, 0, w, h);
|
||||||
cairo_fill(cr);
|
cairo_fill(cr);
|
||||||
|
|
||||||
gradient_draw(cr, g, w, h, FALSE);
|
gradient_draw(cr, g, w, h, FALSE);
|
||||||
|
|
||||||
GdkPixbuf *pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, gdk_colormap_get_system(), 0, 0, 0, 0, w, h);
|
GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface(pixmap, 0, 0, w, h);
|
||||||
if (pixmap)
|
cairo_surface_destroy(pixmap);
|
||||||
g_object_unref(pixmap);
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
@@ -528,16 +527,14 @@ void gradient_stop_update_image(int index)
|
|||||||
|
|
||||||
int w = 70;
|
int w = 70;
|
||||||
int h = 30;
|
int h = 30;
|
||||||
GdkPixmap *pixmap = gdk_pixmap_new(NULL, w, h, 24);
|
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_RGB24, w, h);
|
||||||
|
cairo_t *cr = cairo_create(s);
|
||||||
cairo_t *cr = gdk_cairo_create(pixmap);
|
|
||||||
cairo_set_source_rgba(cr, stop->color.rgb[0], stop->color.rgb[1], stop->color.rgb[2], stop->color.alpha);
|
cairo_set_source_rgba(cr, stop->color.rgb[0], stop->color.rgb[1], stop->color.rgb[2], stop->color.alpha);
|
||||||
cairo_rectangle(cr, 0, 0, w, h);
|
cairo_rectangle(cr, 0, 0, w, h);
|
||||||
cairo_fill(cr);
|
cairo_fill(cr);
|
||||||
|
|
||||||
GdkPixbuf *pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, gdk_colormap_get_system(), 0, 0, 0, 0, w, h);
|
GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface(s, 0, 0, w, h);
|
||||||
if (pixmap)
|
cairo_surface_destroy(s);
|
||||||
g_object_unref(pixmap);
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
|
|||||||
@@ -14,6 +14,27 @@
|
|||||||
#define GETTEXT_PACKAGE "tint2conf"
|
#define GETTEXT_PACKAGE "tint2conf"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GTK_TYPE_INT
|
||||||
|
#define GTK_TYPE_INT G_TYPE_INT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GTK_TYPE_STRING
|
||||||
|
#define GTK_TYPE_STRING G_TYPE_STRING
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GTK_TYPE_BOOL
|
||||||
|
#define GTK_TYPE_BOOL G_TYPE_BOOLEAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GTK_TYPE_DOUBLE
|
||||||
|
#define GTK_TYPE_DOUBLE G_TYPE_DOUBLE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define gtk_tooltips_set_tip(t, widget, txt, arg) gtk_widget_set_tooltip_text(widget, txt)
|
||||||
|
|
||||||
|
#define GTK_OBJECT(x) (x)
|
||||||
|
#define GTK_SIGNAL_FUNC G_CALLBACK
|
||||||
|
|
||||||
#define SNAPSHOT_TICK 190
|
#define SNAPSHOT_TICK 190
|
||||||
gboolean update_snapshot(gpointer ignored);
|
gboolean update_snapshot(gpointer ignored);
|
||||||
void menuApply();
|
void menuApply();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -133,7 +133,7 @@ typedef struct Executor {
|
|||||||
GtkWidget *page_execp;
|
GtkWidget *page_execp;
|
||||||
GtkWidget *page_label;
|
GtkWidget *page_label;
|
||||||
GtkWidget *execp_command, *execp_interval, *execp_has_icon, *execp_cache_icon, *execp_show_tooltip;
|
GtkWidget *execp_command, *execp_interval, *execp_has_icon, *execp_cache_icon, *execp_show_tooltip;
|
||||||
GtkWidget *execp_continuous, *execp_markup, *execp_tooltip;
|
GtkWidget *execp_continuous, *execp_markup, *execp_tooltip, *execp_monitor;
|
||||||
GtkWidget *execp_left_command, *execp_right_command;
|
GtkWidget *execp_left_command, *execp_right_command;
|
||||||
GtkWidget *execp_mclick_command, *execp_rclick_command, *execp_uwheel_command, *execp_dwheel_command;
|
GtkWidget *execp_mclick_command, *execp_rclick_command, *execp_uwheel_command, *execp_dwheel_command;
|
||||||
GtkWidget *execp_font, *execp_font_set, *execp_font_color, *execp_padding_x, *execp_padding_y, *execp_centered;
|
GtkWidget *execp_font, *execp_font_set, *execp_font_color, *execp_padding_x, *execp_padding_y, *execp_centered;
|
||||||
|
|||||||
@@ -871,6 +871,16 @@ void config_write_execp(FILE *fp)
|
|||||||
fprintf(fp,
|
fprintf(fp,
|
||||||
"execp_markup = %d\n",
|
"execp_markup = %d\n",
|
||||||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_markup)) ? 1 : 0);
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_markup)) ? 1 : 0);
|
||||||
|
fprintf(fp, "execp_monitor = ");
|
||||||
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_monitor)) <= 0) {
|
||||||
|
fprintf(fp, "all");
|
||||||
|
} else if (gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_monitor)) == 1) {
|
||||||
|
fprintf(fp, "primary");
|
||||||
|
} else {
|
||||||
|
fprintf(fp, "%d", MAX(1, gtk_combo_box_get_active(GTK_COMBO_BOX(executor->execp_monitor)) - 1));
|
||||||
|
}
|
||||||
|
fprintf(fp, "\n");
|
||||||
|
|
||||||
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_show_tooltip))) {
|
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(executor->execp_show_tooltip))) {
|
||||||
fprintf(fp, "execp_tooltip = \n");
|
fprintf(fp, "execp_tooltip = \n");
|
||||||
} else {
|
} else {
|
||||||
@@ -1855,10 +1865,12 @@ void add_entry(char *key, char *value)
|
|||||||
} else if (strcmp(key, "launcher_apps_dir") == 0) {
|
} else if (strcmp(key, "launcher_apps_dir") == 0) {
|
||||||
char *path = expand_tilde(value);
|
char *path = expand_tilde(value);
|
||||||
|
|
||||||
if (gtk_entry_get_text_length(GTK_ENTRY(launcher_apps_dirs)) > 0) {
|
int position = gtk_entry_get_text_length(GTK_ENTRY(launcher_apps_dirs));
|
||||||
gtk_entry_append_text(GTK_ENTRY(launcher_apps_dirs), ",");
|
if (position > 0) {
|
||||||
|
gtk_editable_insert_text(GTK_EDITABLE(launcher_apps_dirs), ",", 1, &position);
|
||||||
}
|
}
|
||||||
gtk_entry_append_text(GTK_ENTRY(launcher_apps_dirs), path);
|
position = gtk_entry_get_text_length(GTK_ENTRY(launcher_apps_dirs));
|
||||||
|
gtk_editable_insert_text(GTK_EDITABLE(launcher_apps_dirs), path, strlen(path), &position);
|
||||||
|
|
||||||
free(path);
|
free(path);
|
||||||
} else if (strcmp(key, "launcher_icon_theme") == 0) {
|
} else if (strcmp(key, "launcher_icon_theme") == 0) {
|
||||||
@@ -1962,6 +1974,23 @@ void add_entry(char *key, char *value)
|
|||||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_continuous), atoi(value));
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(execp_get_last()->execp_continuous), atoi(value));
|
||||||
} else if (strcmp(key, "execp_markup") == 0) {
|
} else if (strcmp(key, "execp_markup") == 0) {
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_markup), atoi(value));
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_markup), atoi(value));
|
||||||
|
} else if (strcmp(key, "execp_monitor") == 0) {
|
||||||
|
if (strcmp(value, "all") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 0);
|
||||||
|
else if (strcmp(value, "primary") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 1);
|
||||||
|
else if (strcmp(value, "1") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 2);
|
||||||
|
else if (strcmp(value, "2") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 3);
|
||||||
|
else if (strcmp(value, "3") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 4);
|
||||||
|
else if (strcmp(value, "4") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 5);
|
||||||
|
else if (strcmp(value, "5") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 6);
|
||||||
|
else if (strcmp(value, "6") == 0)
|
||||||
|
gtk_combo_box_set_active(GTK_COMBO_BOX(execp_get_last()->execp_monitor), 7);
|
||||||
} else if (strcmp(key, "execp_tooltip") == 0) {
|
} else if (strcmp(key, "execp_tooltip") == 0) {
|
||||||
if (strlen(value) > 0) {
|
if (strlen(value) > 0) {
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_show_tooltip), 1);
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(execp_get_last()->execp_show_tooltip), 1);
|
||||||
|
|||||||
@@ -794,8 +794,8 @@ Imlib_Image load_image(const char *path, int cached)
|
|||||||
static unsigned long counter = 0;
|
static unsigned long counter = 0;
|
||||||
if (debug_icons)
|
if (debug_icons)
|
||||||
fprintf(stderr, "tint2: loading icon %s\n", path);
|
fprintf(stderr, "tint2: loading icon %s\n", path);
|
||||||
#ifdef HAVE_RSVG
|
|
||||||
image = imlib_load_image(path);
|
image = imlib_load_image(path);
|
||||||
|
#ifdef HAVE_RSVG
|
||||||
if (!image && g_str_has_suffix(path, ".svg")) {
|
if (!image && g_str_has_suffix(path, ".svg")) {
|
||||||
char tmp_filename[128];
|
char tmp_filename[128];
|
||||||
snprintf(tmp_filename, sizeof(tmp_filename), "/tmp/tint2-%d-%lu.png", (int)getpid(), counter);
|
snprintf(tmp_filename, sizeof(tmp_filename), "/tmp/tint2-%d-%lu.png", (int)getpid(), counter);
|
||||||
@@ -825,11 +825,8 @@ Imlib_Image load_image(const char *path, int cached)
|
|||||||
unlink(tmp_filename);
|
unlink(tmp_filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
image = imlib_load_image(path);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
imlib_context_set_image(image);
|
imlib_context_set_image(image);
|
||||||
imlib_image_set_changes_on_disk();
|
imlib_image_set_changes_on_disk();
|
||||||
return image;
|
return image;
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ struct timeval *get_duration_to_next_timer_expiration()
|
|||||||
next_timer->expiration_time_ms_,
|
next_timer->expiration_time_ms_,
|
||||||
next_timer->period_ms_);
|
next_timer->period_ms_);
|
||||||
result.tv_sec = duration / 1000;
|
result.tv_sec = duration / 1000;
|
||||||
result.tv_usec = 1000 * (duration - result.tv_sec);
|
duration -= result.tv_sec * 1000;
|
||||||
|
result.tv_usec = 1000 * duration;
|
||||||
return &result;
|
return &result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
/usr/include/librsvg-2.0
|
/usr/include/librsvg-2.0
|
||||||
/usr/include/gdk-pixbuf-2.0
|
/usr/include/gdk-pixbuf-2.0
|
||||||
/usr/include/startup-notification-1.0
|
/usr/include/startup-notification-1.0
|
||||||
/usr/include/gtk-2.0
|
/usr/include/gtk-3.0
|
||||||
/usr/lib/x86_64-linux-gnu/gtk-2.0/include
|
/usr/lib/x86_64-linux-gnu/gtk-2.0/include
|
||||||
/usr/include/atk-1.0
|
/usr/include/atk-1.0
|
||||||
/usr/include/gio-unix-2.0
|
/usr/include/gio-unix-2.0
|
||||||
|
|||||||
Reference in New Issue
Block a user