Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
187e7f294e |
@@ -24,11 +24,6 @@ Contributors:
|
|||||||
Jeff Blake (https://gitlab.com/u/berkley4) : more mouse event handlers
|
Jeff Blake (https://gitlab.com/u/berkley4) : more mouse event handlers
|
||||||
Vladimir <vladimir-csp@yandex.ru> : translations, bug reports
|
Vladimir <vladimir-csp@yandex.ru> : translations, bug reports
|
||||||
Christophe D. <stophe72.d@gmail.com> : non-rectangular borders
|
Christophe D. <stophe72.d@gmail.com> : non-rectangular borders
|
||||||
Benoit Averty : taskbar enhancements
|
|
||||||
Justin Jacobs : tint2conf fixes
|
|
||||||
Oskari Rauta : separator plugin, gradients
|
|
||||||
Michael Messmore : Support for Path in .desktop files
|
|
||||||
Matthew Otnel : config option systray_name_filter
|
|
||||||
|
|
||||||
Translations:
|
Translations:
|
||||||
Bosnian:
|
Bosnian:
|
||||||
|
|||||||
+16
-24
@@ -1,5 +1,5 @@
|
|||||||
project( tint2 )
|
project( tint2 )
|
||||||
cmake_minimum_required( VERSION 2.8.5 )
|
cmake_minimum_required( VERSION 2.6 )
|
||||||
|
|
||||||
option( ENABLE_BATTERY "Enable battery status plugin" ON )
|
option( ENABLE_BATTERY "Enable battery status plugin" ON )
|
||||||
option( ENABLE_TINT2CONF "Enable tint2conf build, a GTK+2 theme configurator for tint2" ON )
|
option( ENABLE_TINT2CONF "Enable tint2conf build, a GTK+2 theme configurator for tint2" ON )
|
||||||
@@ -13,14 +13,6 @@ if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
|
|||||||
option( ENABLE_UEVENT "Kernel event handling support" ON )
|
option( ENABLE_UEVENT "Kernel event handling support" ON )
|
||||||
endif( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
|
endif( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
|
||||||
|
|
||||||
include( GNUInstallDirs )
|
|
||||||
if(NOT docdir)
|
|
||||||
set(docdir ${CMAKE_INSTALL_DOCDIR})
|
|
||||||
endif()
|
|
||||||
if(NOT htmldir)
|
|
||||||
set(htmldir ${docdir}/html)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include( FindPkgConfig )
|
include( FindPkgConfig )
|
||||||
include( CheckLibraryExists )
|
include( CheckLibraryExists )
|
||||||
include( CheckCSourceCompiles )
|
include( CheckCSourceCompiles )
|
||||||
@@ -82,7 +74,7 @@ if( NOT IMLIB_BUILD_WITH_X )
|
|||||||
message( FATAL_ERROR "Imlib is not built with X support" )
|
message( FATAL_ERROR "Imlib is not built with X support" )
|
||||||
endif( NOT IMLIB_BUILD_WITH_X )
|
endif( NOT IMLIB_BUILD_WITH_X )
|
||||||
|
|
||||||
add_definitions( -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -D_DEFAULT_SOURCE )
|
add_definitions( -D_GNU_SOURCE )
|
||||||
|
|
||||||
include_directories( ${PROJECT_BINARY_DIR}
|
include_directories( ${PROJECT_BINARY_DIR}
|
||||||
src
|
src
|
||||||
@@ -95,7 +87,6 @@ include_directories( ${PROJECT_BINARY_DIR}
|
|||||||
src/util
|
src/util
|
||||||
src/execplugin
|
src/execplugin
|
||||||
src/freespace
|
src/freespace
|
||||||
src/separator
|
|
||||||
${X11_INCLUDE_DIRS}
|
${X11_INCLUDE_DIRS}
|
||||||
${PANGOCAIRO_INCLUDE_DIRS}
|
${PANGOCAIRO_INCLUDE_DIRS}
|
||||||
${PANGO_INCLUDE_DIRS}
|
${PANGO_INCLUDE_DIRS}
|
||||||
@@ -123,15 +114,11 @@ set( SOURCES src/config.c
|
|||||||
src/tooltip/tooltip.c
|
src/tooltip/tooltip.c
|
||||||
src/execplugin/execplugin.c
|
src/execplugin/execplugin.c
|
||||||
src/freespace/freespace.c
|
src/freespace/freespace.c
|
||||||
src/separator/separator.c
|
|
||||||
src/tint2rc.c
|
|
||||||
src/util/area.c
|
src/util/area.c
|
||||||
src/util/common.c
|
src/util/common.c
|
||||||
src/util/strnatcmp.c
|
src/util/strnatcmp.c
|
||||||
src/util/timer.c
|
src/util/timer.c
|
||||||
src/util/cache.c
|
src/util/cache.c
|
||||||
src/util/color.c
|
|
||||||
src/util/gradient.c
|
|
||||||
src/util/window.c )
|
src/util/window.c )
|
||||||
|
|
||||||
if( ENABLE_BATTERY )
|
if( ENABLE_BATTERY )
|
||||||
@@ -203,12 +190,17 @@ endif( ENABLE_TINT2CONF )
|
|||||||
|
|
||||||
if( ENABLE_ASAN )
|
if( ENABLE_ASAN )
|
||||||
SET(ASAN_C_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic -Wshadow")
|
SET(ASAN_C_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic -Wshadow")
|
||||||
SET(ASAN_L_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic -fuse-ld=gold ")
|
SET(ASAN_L_FLAGS " -O0 -g3 -gdwarf-2 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic ")
|
||||||
else()
|
else()
|
||||||
SET(ASAN_C_FLAGS "")
|
SET(ASAN_C_FLAGS "")
|
||||||
SET(ASAN_L_FLAGS "")
|
SET(ASAN_L_FLAGS "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set( MANDIR share/man CACHE PATH "Directory for man pages" )
|
||||||
|
set( DATADIR share CACHE PATH "Directory for shared data" )
|
||||||
|
set( SYSCONFDIR /etc CACHE PATH "Directory for configuration files" )
|
||||||
|
set( DOCDIR share/doc/tint2 CACHE PATH "Directory for documentation files" )
|
||||||
|
|
||||||
add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" )
|
add_custom_target( version ALL "${PROJECT_SOURCE_DIR}/get_version.sh" "\"${PROJECT_SOURCE_DIR}\"" )
|
||||||
|
|
||||||
link_directories( ${X11_LIBRARY_DIRS}
|
link_directories( ${X11_LIBRARY_DIRS}
|
||||||
@@ -247,14 +239,14 @@ set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -Wpointer-arith -fn
|
|||||||
set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread -fno-strict-aliasing ${ASAN_L_FLAGS} ${BACKTRACE_L_FLAGS}" )
|
set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread -fno-strict-aliasing ${ASAN_L_FLAGS} ${BACKTRACE_L_FLAGS}" )
|
||||||
|
|
||||||
install( TARGETS tint2 DESTINATION bin )
|
install( TARGETS tint2 DESTINATION bin )
|
||||||
install( FILES tint2.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps )
|
install( FILES tint2.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps )
|
||||||
install( FILES tint2.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )
|
install( FILES tint2.desktop DESTINATION ${DATADIR}/applications )
|
||||||
install( FILES themes/tint2rc DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/tint2 )
|
install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" )
|
||||||
install( FILES default_icon.png DESTINATION ${CMAKE_INSTALL_DATADIR}/tint2 )
|
install( FILES themes/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )
|
||||||
install( FILES AUTHORS ChangeLog README.md doc/tint2.md DESTINATION ${docdir} )
|
install( FILES default_icon.png DESTINATION ${DATADIR}/tint2 )
|
||||||
install( FILES doc/manual.html doc/readme.html DESTINATION ${htmldir} )
|
install( FILES AUTHORS ChangeLog README.md doc/tint2.md doc/manual.html doc/readme.html DESTINATION ${DOCDIR} )
|
||||||
install( DIRECTORY doc/images DESTINATION ${htmldir} )
|
install( DIRECTORY doc/images DESTINATION ${DOCDIR} )
|
||||||
install( FILES doc/tint2.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
|
install( FILES doc/tint2.1 DESTINATION ${MANDIR}/man1 )
|
||||||
if( ENABLE_EXTRA_THEMES )
|
if( ENABLE_EXTRA_THEMES )
|
||||||
add_subdirectory(themes)
|
add_subdirectory(themes)
|
||||||
endif( ENABLE_EXTRA_THEMES )
|
endif( ENABLE_EXTRA_THEMES )
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
Please read https://gitlab.com/o9000/tint2/wikis/Development
|
|
||||||
@@ -1,26 +1,6 @@
|
|||||||
2017-03-12 0.13.1
|
2016-08-07 master
|
||||||
- Fixes:
|
|
||||||
- Fixed compilation with new glibc (issue #625)
|
|
||||||
- Fixed regression in distributing size between taskbars (issue #628)
|
|
||||||
- Create ~/.config dir if it does not exist (issue #629)
|
|
||||||
- Enhancements:
|
|
||||||
- New config option systray_name_filter to hide hide specific apps from the system tray (contributed by Matthew Otnel)
|
|
||||||
- Tint2conf: minor improvements
|
|
||||||
|
|
||||||
2017-03-04 0.13
|
|
||||||
- Fixes:
|
|
||||||
- Ignore monitors with size 0, fixing crash (issue #618)
|
|
||||||
- Battery: support Asus Chromebook Flip C100PA (issue #616)
|
|
||||||
- Panel: do not change struts (available screen size) when shown in autohide mode (issue #619)
|
|
||||||
- tint2conf: executor tooltips are now correctly disabled when text config value is empty (contributed by Justin Jacobs)
|
|
||||||
- Enhancements:
|
- Enhancements:
|
||||||
- Desktop files (shortcuts) used in launcher are reloaded on click, in case the file has changed
|
- Desktop files (shortcuts) used in launcher are reloaded on click, in case the file has changed
|
||||||
- New config option taskbar_hide_if_empty to hide an empty taskbar in multi_desktop mode (contributed by Benoit Averty)
|
|
||||||
- Gradient backgrounds (contributed by Oskari Rauta)
|
|
||||||
- New option: panel_shrink (fixes issue #333)
|
|
||||||
- Support for Path in .desktop files (contributed by Michael Messmore)
|
|
||||||
- Tint2conf start up is much faster
|
|
||||||
- New plugin: separator (contributed by Oskari Rauta)
|
|
||||||
|
|
||||||
2016-08-02 0.12.12
|
2016-08-02 0.12.12
|
||||||
- Fixes:
|
- Fixes:
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# Latest stable release: 0.13.1
|
# Latest stable release: 0.12.12
|
||||||
Changes: https://gitlab.com/o9000/tint2/blob/0.13.1/ChangeLog
|
Changes: https://gitlab.com/o9000/tint2/blob/0.12.12/ChangeLog
|
||||||
|
|
||||||
Documentation: [doc/tint2.md](doc/tint2.md)
|
Documentation: [doc/tint2.md](doc/tint2.md)
|
||||||
|
|
||||||
Compile it with (after you install the [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)):
|
Compile it with (see also [dependencies](https://gitlab.com/o9000/tint2/wikis/Install#dependencies)):
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://gitlab.com/o9000/tint2.git
|
git clone https://gitlab.com/o9000/tint2.git
|
||||||
cd tint2
|
cd tint2
|
||||||
git checkout 0.13.1
|
git checkout 0.12.12
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
@@ -57,16 +57,10 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
|
|||||||
* [Other frequently asked questions](https://gitlab.com/o9000/tint2/wikis/FAQ)
|
* [Other frequently asked questions](https://gitlab.com/o9000/tint2/wikis/FAQ)
|
||||||
* [Obtain a stack trace when tint2 crashes](https://gitlab.com/o9000/tint2/wikis/Debug)
|
* [Obtain a stack trace when tint2 crashes](https://gitlab.com/o9000/tint2/wikis/Debug)
|
||||||
|
|
||||||
# Known issues
|
|
||||||
|
|
||||||
* Graphic glitches on Intel graphics cards can be avoided by changing the acceleration method to UXA ([issue 595](https://gitlab.com/o9000/tint2/issues/595))
|
|
||||||
* Window managers that do not follow exactly the EWMH specification might not interact well with tint2 (known issues for [awesome](https://gitlab.com/o9000/tint2/issues/385), [bspwm](https://gitlab.com/o9000/tint2/issues/524). [openbox-multihead](https://gitlab.com/o9000/tint2/issues/456))
|
|
||||||
* Full transparency requires a compositor such as Compton (if not provided already by the window manager, as in Compiz/Unity, KDE or XFCE)
|
|
||||||
|
|
||||||
# How can I help out?
|
# How can I help out?
|
||||||
|
|
||||||
* Report bugs and ask questions on the [issue tracker](https://gitlab.com/o9000/tint2/issues);
|
* Report bugs and ask questions on the [issue tracker](https://gitlab.com/o9000/tint2/issues);
|
||||||
* Contribute to the development by helping us fix bugs and suggesting new features. Please read the contribution guide: [CONTRIBUTING.md](CONTRIBUTING.md)
|
* Contribute to the development by helping us fix bugs and suggesting new features.
|
||||||
|
|
||||||
# Links
|
# Links
|
||||||
* Home page: https://gitlab.com/o9000/tint2
|
* Home page: https://gitlab.com/o9000/tint2
|
||||||
@@ -84,10 +78,3 @@ tint2 is a simple panel/taskbar made for modern X window managers. It was specif
|
|||||||
## Various configs:
|
## Various configs:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Demos
|
|
||||||
|
|
||||||
* 0.13.1: [Compact panel, separator, color gradients](https://gitlab.com/o9000/tint2/wikis/whats-new-0.13.1.0.gif)
|
|
||||||
* 0.12.4: [Executor](https://gitlab.com/o9000/tint2/wikis/whats-new-0.12.4.gif)
|
|
||||||
* 0.12.3: [Mouse over effects](https://gitlab.com/o9000/tint2/wikis/whats-new-0.12.3.gif)
|
|
||||||
* 0.12: [Distribute size between taskbars, freespace](https://gitlab.com/o9000/tint2/wikis/whats-new-0.12.gif)
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
DEPENDENCIES:
|
||||||
|
cairo (with X support), pango, glib2, libX11, libXinerama, libXrandr, libXrender, libXcomposite, libXdamage, imlib2 (with X support)
|
||||||
|
you might need -dev packages on Debian
|
||||||
+11
-86
@@ -218,7 +218,6 @@ It was specifically made for Openbox but it should also work with other window m
|
|||||||
<ul>
|
<ul>
|
||||||
<li><p><a href="#introduction">Introduction</a></p></li>
|
<li><p><a href="#introduction">Introduction</a></p></li>
|
||||||
<li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li>
|
<li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li>
|
||||||
<li><p><a href="#gradients">Gradients</a></p></li>
|
|
||||||
<li><p><a href="#panel">Panel</a></p></li>
|
<li><p><a href="#panel">Panel</a></p></li>
|
||||||
<li><p><a href="#launcher">Launcher</a></p></li>
|
<li><p><a href="#launcher">Launcher</a></p></li>
|
||||||
<li><p><a href="#taskbar-pager">Taskbar/Pager</a></p></li>
|
<li><p><a href="#taskbar-pager">Taskbar/Pager</a></p></li>
|
||||||
@@ -229,7 +228,6 @@ It was specifically made for Openbox but it should also work with other window m
|
|||||||
<li><p><a href="#tooltip">Tooltip</a></p></li>
|
<li><p><a href="#tooltip">Tooltip</a></p></li>
|
||||||
<li><p><a href="#battery">Battery</a></p></li>
|
<li><p><a href="#battery">Battery</a></p></li>
|
||||||
<li><p><a href="#executor">Executor</a></p></li>
|
<li><p><a href="#executor">Executor</a></p></li>
|
||||||
<li><p><a href="#separator">Separator</a></p></li>
|
|
||||||
<li><p><a href="#example-configuration">Example configuration</a></p></li>
|
<li><p><a href="#example-configuration">Example configuration</a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3 id="introduction">Introduction<a name="introduction" href="#introduction" class="md2man-permalink" title="permalink"></a></h3><p>These are instructions for configuring tint2 directly by editing its config file.
|
<h3 id="introduction">Introduction<a name="introduction" href="#introduction" class="md2man-permalink" title="permalink"></a></h3><p>These are instructions for configuring tint2 directly by editing its config file.
|
||||||
@@ -288,67 +286,7 @@ task_active_background_id = 2
|
|||||||
systray_background_id = 0
|
systray_background_id = 0
|
||||||
clock_background_id = 0
|
clock_background_id = 0
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.</p><h3 id="gradients">Gradients<a name="gradients" href="#gradients" class="md2man-permalink" title="permalink"></a></h3><p>(Available since 0.13.0)</p><p>Backgrounds also allow specifying gradient layers
|
<p>Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.</p><h3 id="panel">Panel<a name="panel" href="#panel" class="md2man-permalink" title="permalink"></a></h3>
|
||||||
that are drawn on top of the solid color background.</p><p>First the user must define one or more gradients in the config file,
|
|
||||||
each starting with <code>gradient = TYPE</code>. These must be added before backgrounds.</p><p>Then gradients can be added by index to backgrounds,
|
|
||||||
using the <code>gradient_id = INDEX</code>, <code>gradient_id_hover = INDEX</code> and
|
|
||||||
<code>gradient_id_pressed = INDEX</code>, where <code>INDEX</code> is
|
|
||||||
the gradient index, starting from 1.</p><h4 id="gradient-types">Gradient types<a name="gradient-types" href="#gradient-types" class="md2man-permalink" title="permalink"></a></h4><p>Gradients vary the color between fixed control points:
|
|
||||||
* vertical gradients: top-to-bottom;
|
|
||||||
* horizontal gradients: left-to-right;
|
|
||||||
* radial gradients: center-to-corners.</p><p>The user must specify the start and end colors, and can optionally add extra color stops in between
|
|
||||||
using the <code>color_stop</code> option, as explained below.</p><h5 id="vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors">Vertical gradient, with color varying from the top edge to the bottom edge, two colors<a name="vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors" href="#vertical-gradient-with-color-varying-from-the-top-edge-to-the-bottom-edge-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>gradient = vertical
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
</code></pre>
|
|
||||||
<h5 id="horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors">Horizontal gradient, with color varying from the left edge to the right edge, two colors<a name="horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors" href="#horizontal-gradient-with-color-varying-from-the-left-edge-to-the-right-edge-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>gradient = horizontal
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
</code></pre>
|
|
||||||
<h5 id="radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors">Radial gradient, with color varying from the center to the corner, two colors:<a name="radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors" href="#radial-gradient-with-color-varying-from-the-center-to-the-corner-two-colors" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>gradient = radial
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
</code></pre>
|
|
||||||
<h5 id="adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points">Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)<a name="adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points" href="#adding-extra-color-stops-0-and-100-remain-fixed-more-colors-at-x-between-the-start-and-end-control-points" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>color_stop = percentage #rrggbb opacity
|
|
||||||
</code></pre>
|
|
||||||
<h4 id="gradient-examples">Gradient examples<a name="gradient-examples" href="#gradient-examples" class="md2man-permalink" title="permalink"></a></h4><pre class="highlight plaintext"><code># Gradient 1: thin film effect
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #111122 30
|
|
||||||
end_color = #112211 30
|
|
||||||
color_stop = 60 #221111 30
|
|
||||||
|
|
||||||
# Gradient 2: radial glow
|
|
||||||
gradient = radial
|
|
||||||
start_color = #ffffff 20
|
|
||||||
end_color = #ffffff 0
|
|
||||||
|
|
||||||
# Gradient 3: elegant black
|
|
||||||
gradient = vertical
|
|
||||||
start_color = #444444 100
|
|
||||||
end_color = #222222 100
|
|
||||||
|
|
||||||
# Gradient 4: elegant black
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #111111 100
|
|
||||||
end_color = #222222 100
|
|
||||||
|
|
||||||
# Background 1: Active desktop name
|
|
||||||
rounded = 2
|
|
||||||
border_width = 1
|
|
||||||
border_sides = TBLR
|
|
||||||
background_color = #555555 10
|
|
||||||
border_color = #ffffff 60
|
|
||||||
background_color_hover = #555555 10
|
|
||||||
border_color_hover = #ffffff 60
|
|
||||||
background_color_pressed = #555555 10
|
|
||||||
border_color_pressed = #ffffff 60
|
|
||||||
gradient_id = 3
|
|
||||||
gradient_id_hover = 4
|
|
||||||
gradient_id_pressed = 2
|
|
||||||
|
|
||||||
[...]
|
|
||||||
</code></pre>
|
|
||||||
<h3 id="panel">Panel<a name="panel" href="#panel" class="md2man-permalink" title="permalink"></a></h3>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><code>panel_items = LTSBC</code> defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:</p>
|
<li><p><code>panel_items = LTSBC</code> defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:</p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -357,9 +295,8 @@ gradient_id_pressed = 2
|
|||||||
<li><code>S</code> shows the Systray (also called notification area)</li>
|
<li><code>S</code> shows the Systray (also called notification area)</li>
|
||||||
<li><code>B</code> shows the Battery status</li>
|
<li><code>B</code> shows the Battery status</li>
|
||||||
<li><code>C</code> shows the Clock</li>
|
<li><code>C</code> shows the Clock</li>
|
||||||
<li><code>F</code> adds an extensible spacer (freespace). You can specify more than one. Has no effect if <code>T</code> is also present. <em>(since 0.12)</em></li>
|
<li><code>F</code> adds an extensible spacer (freespace). Has no effect if <code>T</code> is also present. <em>(since 0.12)</em></li>
|
||||||
<li><code>E</code> adds an executor plugin. You can specify more than one. <em>(since 0.12.4)</em></li>
|
<li><code>E</code> adds an executor plugin. You can specify more than one. <em>(since 0.12.4)</em></li>
|
||||||
<li><code>:</code> adds a separator. You can specify more than one. <em>(since 0.13.0)</em></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<p>For example, <code>panel_items = STC</code> will show the systray, the taskbar and the clock (from left to right).</p></li>
|
<p>For example, <code>panel_items = STC</code> will show the systray, the taskbar and the clock (from left to right).</p></li>
|
||||||
<li><p><code>panel_monitor = monitor (all or 1 or 2 or ...)</code> : Which monitor tint2 draws the panel on</p>
|
<li><p><code>panel_monitor = monitor (all or 1 or 2 or ...)</code> : Which monitor tint2 draws the panel on</p>
|
||||||
@@ -388,8 +325,7 @@ panel_size = 94% 30
|
|||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><code>panel_shrink = boolean (0 or 1)</code> : If set to 1, the panel will shrink to a compact size dynamically. <em>(since 0.13)</em></p></li>
|
<li><code>panel_margin = horizontal_margin vertical_margin</code> : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use <code>0</code> to obtain a panel with the same size as the edge of the monitor (no margin).</li>
|
||||||
<li><p><code>panel_margin = horizontal_margin vertical_margin</code> : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use <code>0</code> to obtain a panel with the same size as the edge of the monitor (no margin).</p></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<p><img src="images/panel_size_margin.jpg" alt=""></p>
|
<p><img src="images/panel_size_margin.jpg" alt=""></p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -444,8 +380,7 @@ panel_size = 94% 30
|
|||||||
<li>You can switch between virtual desktops.</li>
|
<li>You can switch between virtual desktops.</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><p><code>taskbar_hide_if_empty = boolean (0 or 1)</code> : If enabled, in multi-desktop mode the taskbars corresponding to empty desktops different from the current desktop are hidden. <em>(since 0.13)</em></p></li>
|
<li><p><code>taskbar_distribute_size = boolean (0 or 1)</code> : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. <em>(since 0.12)</em></p></li>
|
||||||
<li><p><code>taskbar_distribute_size = boolean (0 or 1)</code> : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. <em>(since 0.12)</em></p></li>
|
|
||||||
<li><p><code>taskbar_padding = horizontal_padding vertical_padding spacing</code></p></li>
|
<li><p><code>taskbar_padding = horizontal_padding vertical_padding spacing</code></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><img src="images/taskbar_padding.jpg" alt=""></p>
|
<p><img src="images/taskbar_padding.jpg" alt=""></p>
|
||||||
@@ -474,7 +409,7 @@ panel_size = 94% 30
|
|||||||
</ul>
|
</ul>
|
||||||
<h1 id="taskbar-buttons">Taskbar buttons<a name="taskbar-buttons" href="#taskbar-buttons" class="md2man-permalink" title="permalink"></a></h1><p>The following options configure the task buttons in the taskbar:</p>
|
<h1 id="taskbar-buttons">Taskbar buttons<a name="taskbar-buttons" href="#taskbar-buttons" class="md2man-permalink" title="permalink"></a></h1><p>The following options configure the task buttons in the taskbar:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><p><code>task_icon = boolean (0 or 1)</code> : Whether to display the task icon. There is no explicit option to control the task icon size; it depends on the vertical padding set with <code>task_padding</code>.</p></li>
|
<li><p><code>task_icon = boolean (0 or 1)</code> : Whether to display the task icon.</p></li>
|
||||||
<li><p><code>task_text = boolean (0 or 1)</code> : Whether to display the task text.</p></li>
|
<li><p><code>task_text = boolean (0 or 1)</code> : Whether to display the task text.</p></li>
|
||||||
<li><p><code>task_centered = boolean (0 or 1)</code> : Whether the task text is centered.</p></li>
|
<li><p><code>task_centered = boolean (0 or 1)</code> : Whether the task text is centered.</p></li>
|
||||||
<li><p><code>task_tooltip = boolean (0 or 1)</code> : Whether to show tooltips for tasks.</p></li>
|
<li><p><code>task_tooltip = boolean (0 or 1)</code> : Whether to show tooltips for tasks.</p></li>
|
||||||
@@ -522,7 +457,6 @@ panel_size = 94% 30
|
|||||||
<li><p><code>systray_icon_size = max_icon_size</code> : Set the maximum system tray icon size to <code>number</code>. Set to <code>0</code> for automatic icon sizing.</p></li>
|
<li><p><code>systray_icon_size = max_icon_size</code> : Set the maximum system tray icon size to <code>number</code>. Set to <code>0</code> for automatic icon sizing.</p></li>
|
||||||
<li><p><code>systray_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjust the systray icons color and transparency.</p></li>
|
<li><p><code>systray_icon_asb = alpha (0 to 100) saturation (-100 to 100) brightness (-100 to 100)</code> : Adjust the systray icons color and transparency.</p></li>
|
||||||
<li><p><code>systray_monitor = integer (1, 2, ...)</code> : On which monitor to draw the systray. The first monitor is <code>1</code>. <em>(since 0.12)</em></p></li>
|
<li><p><code>systray_monitor = integer (1, 2, ...)</code> : On which monitor to draw the systray. The first monitor is <code>1</code>. <em>(since 0.12)</em></p></li>
|
||||||
<li><p><code>systray_name_filter = string</code> : Regular expression to identify icon names to be hidden. For example, <code>^audacious$</code> will hide icons with the exact name <code>audacious</code>, while <code>aud</code> will hide any icons having <code>aud</code> in the name. <em>(since 0.13.1)</em></p></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<h3 id="clock">Clock<a name="clock" href="#clock" class="md2man-permalink" title="permalink"></a></h3>
|
<h3 id="clock">Clock<a name="clock" href="#clock" class="md2man-permalink" title="permalink"></a></h3>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -634,15 +568,15 @@ execp_cache_icon = 1
|
|||||||
execp_continuous = 2
|
execp_continuous = 2
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h5 id="round-trip-time-to-the-gateway-refreshed-every-second">Round-trip time to the gateway, refreshed every second<a name="round-trip-time-to-the-gateway-refreshed-every-second" href="#round-trip-time-to-the-gateway-refreshed-every-second" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new
|
<h5 id="round-trip-time-to-the-gateway-refreshed-every-second">Round-trip time to the gateway, refreshed every second<a name="round-trip-time-to-the-gateway-refreshed-every-second" href="#round-trip-time-to-the-gateway-refreshed-every-second" class="md2man-permalink" title="permalink"></a></h5><pre class="highlight plaintext"><code>execp = new
|
||||||
execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
|
execp_command = ping -i 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
|
||||||
execp_continuous = 0
|
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>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 -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
|
||||||
execp_interval = 5
|
execp_interval = 1
|
||||||
execp_continuous = 0
|
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># Note the use of "stdbuf -oL" to force the program to flush the output line by line.
|
||||||
execp = new
|
execp = new
|
||||||
@@ -650,15 +584,6 @@ execp_command = stdbuf -oL bwm-ng -o csv -t 1000 | awk -F ';' '/total/ { printf
|
|||||||
execp_continuous = 1
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<h3 id="separator">Separator<a name="separator" href="#separator" class="md2man-permalink" title="permalink"></a></h3>
|
|
||||||
<ul>
|
|
||||||
<li><p><code>separator = new</code> : Begins the configuration of a new separator. Multiple such plugins are supported; just use multiple <code>:</code>s in <code>panel_items</code>. <em>(since 0.13.0)</em></p></li>
|
|
||||||
<li><p><code>separator_background_id = integer</code> : Which background to use. <em>(since 0.13.0)</em></p></li>
|
|
||||||
<li><p><code>separator_color = color opacity</code> : The foreground color. <em>(since 0.13.0)</em></p></li>
|
|
||||||
<li><p><code>separator_style = [empty | line | dots]</code> : The separator style. <em>(since 0.13.0)</em></p></li>
|
|
||||||
<li><p><code>separator_size = integer</code> : The thickness of the separator. Does not include the border and padding. For example, if the style is <code>line</code>, this is the line thickness; if the style is <code>dots</code>, this is the dot's diameter. <em>(since 0.13.0)</em></p></li>
|
|
||||||
<li><p><code>separator_padding = side_padding cap_padding</code> : The padding to add to the sides of the separator, in pixels. <em>(since 0.13.0)</em></p></li>
|
|
||||||
</ul>
|
|
||||||
<h3 id="example-configuration">Example configuration<a name="example-configuration" href="#example-configuration" class="md2man-permalink" title="permalink"></a></h3><pre class="highlight plaintext"><code>#---------------------------------------------
|
<h3 id="example-configuration">Example configuration<a name="example-configuration" href="#example-configuration" class="md2man-permalink" title="permalink"></a></h3><pre class="highlight plaintext"><code>#---------------------------------------------
|
||||||
## TINT2 CONFIG FILE
|
## TINT2 CONFIG FILE
|
||||||
#---------------------------------------------
|
#---------------------------------------------
|
||||||
@@ -716,7 +641,7 @@ task_font = sans 7
|
|||||||
task_font_color = #ffffff 70
|
task_font_color = #ffffff 70
|
||||||
task_background_id = 3
|
task_background_id = 3
|
||||||
task_icon_asb = 100 0 0
|
task_icon_asb = 100 0 0
|
||||||
## replace STATUS by 'urgent', 'active' or 'iconified'
|
## replace STATUS by 'urgent', 'active' or 'iconfied'
|
||||||
#task_STATUS_background_id = 2
|
#task_STATUS_background_id = 2
|
||||||
#task_STATUS_font_color = #ffffff 85
|
#task_STATUS_font_color = #ffffff 85
|
||||||
#task_STATUS_icon_asb = 100 0 0
|
#task_STATUS_icon_asb = 100 0 0
|
||||||
|
|||||||
+4
-16
@@ -199,9 +199,9 @@ pre {
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1 id="latest-stable-release-0-13-1"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">0.13.1</span><a name="latest-stable-release-0-13-1" href="#latest-stable-release-0-13-1" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/0.13.1/ChangeLog">https://gitlab.com/o9000/tint2/blob/0.13.1/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><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git
|
<h1 id="latest-stable-release-0-12-11"><span class="md2man-title">Latest</span> <span class="md2man-section">stable</span> <span class="md2man-date">release:</span> <span class="md2man-source">0.12.11</span><a name="latest-stable-release-0-12-11" href="#latest-stable-release-0-12-11" class="md2man-permalink" title="permalink"></a></h1><p>Changes: <a href="https://gitlab.com/o9000/tint2/blob/0.12.11/ChangeLog">https://gitlab.com/o9000/tint2/blob/0.12.11/ChangeLog</a></p><p>Documentation: <a href="manual.html">manual.html</a></p><p>Compile it with (see also <a href="https://gitlab.com/o9000/tint2/wikis/Install#dependencies">dependencies</a>):</p><pre class="highlight plaintext"><code>git clone https://gitlab.com/o9000/tint2.git
|
||||||
cd tint2
|
cd tint2
|
||||||
git checkout 0.13.1
|
git checkout 0.12.11
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
@@ -235,16 +235,10 @@ make -j4
|
|||||||
<li><a href="https://gitlab.com/o9000/tint2/wikis/FAQ">Other frequently asked questions</a></li>
|
<li><a href="https://gitlab.com/o9000/tint2/wikis/FAQ">Other frequently asked questions</a></li>
|
||||||
<li><a href="https://gitlab.com/o9000/tint2/wikis/Debug">Obtain a stack trace when tint2 crashes</a></li>
|
<li><a href="https://gitlab.com/o9000/tint2/wikis/Debug">Obtain a stack trace when tint2 crashes</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1 id="known-issues">Known issues<a name="known-issues" href="#known-issues" class="md2man-permalink" title="permalink"></a></h1>
|
|
||||||
<ul>
|
|
||||||
<li>Graphic glitches on Intel graphics cards can be avoided by changing the acceleration method to UXA (<a href="https://gitlab.com/o9000/tint2/issues/595">issue 595</a>)</li>
|
|
||||||
<li>Window managers that do not follow exactly the EWMH specification might not interact well with tint2 (known issues for <a href="https://gitlab.com/o9000/tint2/issues/385">awesome</a>, <a href="https://gitlab.com/o9000/tint2/issues/524">bspwm</a>. <a href="https://gitlab.com/o9000/tint2/issues/456">openbox-multihead</a>)</li>
|
|
||||||
<li>Full transparency requires a compositor such as Compton (if not provided already by the window manager, as in Compiz/Unity, KDE or XFCE)</li>
|
|
||||||
</ul>
|
|
||||||
<h1 id="how-can-i-help-out">How can I help out?<a name="how-can-i-help-out" href="#how-can-i-help-out" class="md2man-permalink" title="permalink"></a></h1>
|
<h1 id="how-can-i-help-out">How can I help out?<a name="how-can-i-help-out" href="#how-can-i-help-out" class="md2man-permalink" title="permalink"></a></h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Report bugs and ask questions on the <a href="https://gitlab.com/o9000/tint2/issues">issue tracker</a>;</li>
|
<li>Report bugs and ask questions on the <a href="https://gitlab.com/o9000/tint2/issues">issue tracker</a>;</li>
|
||||||
<li>Contribute to the development by helping us fix bugs and suggesting new features. Please read the contribution guide: <a href="CONTRIBUTING.md">CONTRIBUTING.md</a></li>
|
<li>Contribute to the development by helping us fix bugs and suggesting new features.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1 id="links">Links<a name="links" href="#links" class="md2man-permalink" title="permalink"></a></h1>
|
<h1 id="links">Links<a name="links" href="#links" class="md2man-permalink" title="permalink"></a></h1>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -254,12 +248,6 @@ make -j4
|
|||||||
<li>Downloads: <a href="https://gitlab.com/o9000/tint2-archive/tree/master">https://gitlab.com/o9000/tint2-archive/tree/master</a> or <a href="https://code.google.com/p/tint2/downloads/list">https://code.google.com/p/tint2/downloads/list</a></li>
|
<li>Downloads: <a href="https://gitlab.com/o9000/tint2-archive/tree/master">https://gitlab.com/o9000/tint2-archive/tree/master</a> or <a href="https://code.google.com/p/tint2/downloads/list">https://code.google.com/p/tint2/downloads/list</a></li>
|
||||||
<li>Old project location (inactive): <a href="https://code.google.com/p/tint2">https://code.google.com/p/tint2</a></li>
|
<li>Old project location (inactive): <a href="https://code.google.com/p/tint2">https://code.google.com/p/tint2</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1 id="screenshots">Screenshots<a name="screenshots" href="#screenshots" class="md2man-permalink" title="permalink"></a></h1><h2 id="default-config">Default config:<a name="default-config" href="#default-config" class="md2man-permalink" title="permalink"></a></h2><p><img src="https://gitlab.com/o9000/tint2/uploads/948fa74eca60864352a033580350b4c3/Screenshot_2016-01-23_14-42-57.png" alt="Screenshot_2016-01-23_14-42-57"></p><h2 id="various-configs">Various configs:<a name="various-configs" href="#various-configs" class="md2man-permalink" title="permalink"></a></h2><p><img src="https://gitlab.com/o9000/tint2/wikis/screenshot.png" alt="screenshot"></p><h2 id="demos">Demos<a name="demos" href="#demos" class="md2man-permalink" title="permalink"></a></h2>
|
<h1 id="screenshots">Screenshots<a name="screenshots" href="#screenshots" class="md2man-permalink" title="permalink"></a></h1><h2 id="default-config">Default config:<a name="default-config" href="#default-config" class="md2man-permalink" title="permalink"></a></h2><p><img src="https://gitlab.com/o9000/tint2/uploads/948fa74eca60864352a033580350b4c3/Screenshot_2016-01-23_14-42-57.png" alt="Screenshot_2016-01-23_14-42-57"></p><h2 id="various-configs">Various configs:<a name="various-configs" href="#various-configs" class="md2man-permalink" title="permalink"></a></h2><p><img src="https://gitlab.com/o9000/tint2/wikis/screenshot.png" alt="screenshot"></p>
|
||||||
<ul>
|
|
||||||
<li>0.13.1: <a href="https://gitlab.com/o9000/tint2/wikis/whats-new-0.13.1.0.gif">Compact panel, separator, color gradients</a></li>
|
|
||||||
<li>0.12.4: <a href="https://gitlab.com/o9000/tint2/wikis/whats-new-0.12.4.gif">Executor</a></li>
|
|
||||||
<li>0.12.3: <a href="https://gitlab.com/o9000/tint2/wikis/whats-new-0.12.3.gif">Mouse over effects</a></li>
|
|
||||||
<li>0.12: <a href="https://gitlab.com/o9000/tint2/wikis/whats-new-0.12.gif">Distribute size between taskbars, freespace</a></li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+10
-136
@@ -1,4 +1,4 @@
|
|||||||
.TH TINT2 1 "2017\-03\-12"
|
.TH TINT2 1 "2016\-05\-22"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.PP
|
.PP
|
||||||
tint2 \- lightweight panel/taskbar
|
tint2 \- lightweight panel/taskbar
|
||||||
@@ -45,8 +45,6 @@ Introduction \[la]#introduction\[ra]
|
|||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
Backgrounds and borders \[la]#backgrounds-and-borders\[ra]
|
Backgrounds and borders \[la]#backgrounds-and-borders\[ra]
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
Gradients \[la]#gradients\[ra]
|
|
||||||
.IP \(bu 2
|
|
||||||
Panel \[la]#panel\[ra]
|
Panel \[la]#panel\[ra]
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
Launcher \[la]#launcher\[ra]
|
Launcher \[la]#launcher\[ra]
|
||||||
@@ -67,8 +65,6 @@ Battery \[la]#battery\[ra]
|
|||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
Executor \[la]#executor\[ra]
|
Executor \[la]#executor\[ra]
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
Separator \[la]#separator\[ra]
|
|
||||||
.IP \(bu 2
|
|
||||||
Example configuration \[la]#example-configuration\[ra]
|
Example configuration \[la]#example-configuration\[ra]
|
||||||
.RE
|
.RE
|
||||||
.SS Introduction
|
.SS Introduction
|
||||||
@@ -175,105 +171,6 @@ clock_background_id = 0
|
|||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.
|
Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.
|
||||||
.SS Gradients
|
|
||||||
.PP
|
|
||||||
(Available since 0.13.0)
|
|
||||||
.PP
|
|
||||||
Backgrounds also allow specifying gradient layers
|
|
||||||
that are drawn on top of the solid color background.
|
|
||||||
.PP
|
|
||||||
First the user must define one or more gradients in the config file,
|
|
||||||
each starting with \fB\fCgradient = TYPE\fR\&. These must be added before backgrounds.
|
|
||||||
.PP
|
|
||||||
Then gradients can be added by index to backgrounds,
|
|
||||||
using the \fB\fCgradient_id = INDEX\fR, \fB\fCgradient_id_hover = INDEX\fR and
|
|
||||||
\fB\fCgradient_id_pressed = INDEX\fR, where \fB\fCINDEX\fR is
|
|
||||||
the gradient index, starting from 1.
|
|
||||||
.SS Gradient types
|
|
||||||
.PP
|
|
||||||
Gradients vary the color between fixed control points:
|
|
||||||
* vertical gradients: top\-to\-bottom;
|
|
||||||
* horizontal gradients: left\-to\-right;
|
|
||||||
* radial gradients: center\-to\-corners.
|
|
||||||
.PP
|
|
||||||
The user must specify the start and end colors, and can optionally add extra color stops in between
|
|
||||||
using the \fB\fCcolor_stop\fR option, as explained below.
|
|
||||||
.SS Vertical gradient, with color varying from the top edge to the bottom edge, two colors
|
|
||||||
.PP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
gradient = vertical
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.SS Horizontal gradient, with color varying from the left edge to the right edge, two colors
|
|
||||||
.PP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.SS Radial gradient, with color varying from the center to the corner, two colors:
|
|
||||||
.PP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
gradient = radial
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.SS Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)
|
|
||||||
.PP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
color_stop = percentage #rrggbb opacity
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.SS Gradient examples
|
|
||||||
.PP
|
|
||||||
.RS
|
|
||||||
.nf
|
|
||||||
# Gradient 1: thin film effect
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #111122 30
|
|
||||||
end_color = #112211 30
|
|
||||||
color_stop = 60 #221111 30
|
|
||||||
|
|
||||||
# Gradient 2: radial glow
|
|
||||||
gradient = radial
|
|
||||||
start_color = #ffffff 20
|
|
||||||
end_color = #ffffff 0
|
|
||||||
|
|
||||||
# Gradient 3: elegant black
|
|
||||||
gradient = vertical
|
|
||||||
start_color = #444444 100
|
|
||||||
end_color = #222222 100
|
|
||||||
|
|
||||||
# Gradient 4: elegant black
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #111111 100
|
|
||||||
end_color = #222222 100
|
|
||||||
|
|
||||||
# Background 1: Active desktop name
|
|
||||||
rounded = 2
|
|
||||||
border_width = 1
|
|
||||||
border_sides = TBLR
|
|
||||||
background_color = #555555 10
|
|
||||||
border_color = #ffffff 60
|
|
||||||
background_color_hover = #555555 10
|
|
||||||
border_color_hover = #ffffff 60
|
|
||||||
background_color_pressed = #555555 10
|
|
||||||
border_color_pressed = #ffffff 60
|
|
||||||
gradient_id = 3
|
|
||||||
gradient_id_hover = 4
|
|
||||||
gradient_id_pressed = 2
|
|
||||||
|
|
||||||
[...]
|
|
||||||
.fi
|
|
||||||
.RE
|
|
||||||
.SS Panel
|
.SS Panel
|
||||||
.RS
|
.RS
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
@@ -290,11 +187,9 @@ gradient_id_pressed = 2
|
|||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCC\fR shows the Clock
|
\fB\fCC\fR shows the Clock
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCF\fR adds an extensible spacer (freespace). You can specify more than one. Has no effect if \fB\fCT\fR is also present. \fI(since 0.12)\fP
|
\fB\fCF\fR adds an extensible spacer (freespace). Has no effect if \fB\fCT\fR is also present. \fI(since 0.12)\fP
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCE\fR adds an executor plugin. You can specify more than one. \fI(since 0.12.4)\fP
|
\fB\fCE\fR adds an executor plugin. You can specify more than one. \fI(since 0.12.4)\fP
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fC:\fR adds a separator. You can specify more than one. \fI(since 0.13.0)\fP
|
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
For example, \fB\fCpanel_items = STC\fR will show the systray, the taskbar and the clock (from left to right).
|
For example, \fB\fCpanel_items = STC\fR will show the systray, the taskbar and the clock (from left to right).
|
||||||
@@ -339,8 +234,6 @@ panel_size = 94% 30
|
|||||||
.RE
|
.RE
|
||||||
.RS
|
.RS
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCpanel_shrink = boolean (0 or 1)\fR : If set to 1, the panel will shrink to a compact size dynamically. \fI(since 0.13)\fP
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCpanel_margin = horizontal_margin vertical_margin\fR : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use \fB\fC0\fR to obtain a panel with the same size as the edge of the monitor (no margin).
|
\fB\fCpanel_margin = horizontal_margin vertical_margin\fR : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use \fB\fC0\fR to obtain a panel with the same size as the edge of the monitor (no margin).
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
@@ -433,9 +326,7 @@ You can switch between virtual desktops.
|
|||||||
.RE
|
.RE
|
||||||
.RE
|
.RE
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCtaskbar_hide_if_empty = boolean (0 or 1)\fR : If enabled, in multi\-desktop mode the taskbars corresponding to empty desktops different from the current desktop are hidden. \fI(since 0.13)\fP
|
\fB\fCtaskbar_distribute_size = boolean (0 or 1)\fR : If enabled, in multi\-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. \fI(since 0.12)\fP
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCtaskbar_distribute_size = boolean (0 or 1)\fR : If enabled, in multi\-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. \fI(since 0.12)\fP
|
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCtaskbar_padding = horizontal_padding vertical_padding spacing\fR
|
\fB\fCtaskbar_padding = horizontal_padding vertical_padding spacing\fR
|
||||||
.RE
|
.RE
|
||||||
@@ -488,7 +379,7 @@ You can switch between virtual desktops.
|
|||||||
The following options configure the task buttons in the taskbar:
|
The following options configure the task buttons in the taskbar:
|
||||||
.RS
|
.RS
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCtask_icon = boolean (0 or 1)\fR : Whether to display the task icon. There is no explicit option to control the task icon size; it depends on the vertical padding set with \fB\fCtask_padding\fR\&.
|
\fB\fCtask_icon = boolean (0 or 1)\fR : Whether to display the task icon.
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCtask_text = boolean (0 or 1)\fR : Whether to display the task text.
|
\fB\fCtask_text = boolean (0 or 1)\fR : Whether to display the task text.
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
@@ -569,8 +460,6 @@ The action semantics:
|
|||||||
\fB\fCsystray_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjust the systray icons color and transparency.
|
\fB\fCsystray_icon_asb = alpha (0 to 100) saturation (\-100 to 100) brightness (\-100 to 100)\fR : Adjust the systray icons color and transparency.
|
||||||
.IP \(bu 2
|
.IP \(bu 2
|
||||||
\fB\fCsystray_monitor = integer (1, 2, ...)\fR : On which monitor to draw the systray. The first monitor is \fB\fC1\fR\&. \fI(since 0.12)\fP
|
\fB\fCsystray_monitor = integer (1, 2, ...)\fR : On which monitor to draw the systray. The first monitor is \fB\fC1\fR\&. \fI(since 0.12)\fP
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCsystray_name_filter = string\fR : Regular expression to identify icon names to be hidden. For example, \fB\fC^audacious$\fR will hide icons with the exact name \fB\fCaudacious\fR, while \fB\fCaud\fR will hide any icons having \fB\fCaud\fR in the name. \fI(since 0.13.1)\fP
|
|
||||||
.RE
|
.RE
|
||||||
.SS Clock
|
.SS Clock
|
||||||
.RS
|
.RS
|
||||||
@@ -773,8 +662,8 @@ execp_continuous = 2
|
|||||||
.RS
|
.RS
|
||||||
.nf
|
.nf
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = ping \-i 1 \-c 1 \-W 1 \-O \-D \-n $(ip route | grep default | grep via | grep \-o '[0\-9]*\\.[0\-9]*\\.[0\-9]*\\.[0\-9]*') | awk '/no/ { print "<span foreground=\\"#faa\\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\\"#7af\\">%3.0f %s</span>\\n", $8, $9; fflush(); } '
|
execp_command = ping \-i 1 \-W 1 \-O \-D \-n $(ip route | grep default | grep via | grep \-o '[0\-9]*\\.[0\-9]*\\.[0\-9]*\\.[0\-9]*') | awk '/no/ { print "<span foreground=\\"#faa\\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\\"#7af\\">%3.0f %s</span>\\n", $8, $9; fflush(); } '
|
||||||
execp_continuous = 0
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_markup = 1
|
execp_markup = 1
|
||||||
.fi
|
.fi
|
||||||
@@ -784,9 +673,9 @@ execp_markup = 1
|
|||||||
.RS
|
.RS
|
||||||
.nf
|
.nf
|
||||||
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 \-s 2 | awk '/^\-/ { printf "Mem: '$(free \-h | awk '/^Mem:/ { print $2 }')' %.0f%\\n", 100*$3/($3+$4); fflush(stdout) }'
|
||||||
execp_interval = 5
|
execp_interval = 1
|
||||||
execp_continuous = 0
|
execp_continuous = 1
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.SS Network load
|
.SS Network load
|
||||||
@@ -800,21 +689,6 @@ execp_continuous = 1
|
|||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.SS Separator
|
|
||||||
.RS
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCseparator = new\fR : Begins the configuration of a new separator. Multiple such plugins are supported; just use multiple \fB\fC:\fRs in \fB\fCpanel_items\fR\&. \fI(since 0.13.0)\fP
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCseparator_background_id = integer\fR : Which background to use. \fI(since 0.13.0)\fP
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCseparator_color = color opacity\fR : The foreground color. \fI(since 0.13.0)\fP
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCseparator_style = [empty | line | dots]\fR : The separator style. \fI(since 0.13.0)\fP
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCseparator_size = integer\fR : The thickness of the separator. Does not include the border and padding. For example, if the style is \fB\fCline\fR, this is the line thickness; if the style is \fB\fCdots\fR, this is the dot's diameter. \fI(since 0.13.0)\fP
|
|
||||||
.IP \(bu 2
|
|
||||||
\fB\fCseparator_padding = side_padding cap_padding\fR : The padding to add to the sides of the separator, in pixels. \fI(since 0.13.0)\fP
|
|
||||||
.RE
|
|
||||||
.SS Example configuration
|
.SS Example configuration
|
||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
@@ -876,7 +750,7 @@ task_font = sans 7
|
|||||||
task_font_color = #ffffff 70
|
task_font_color = #ffffff 70
|
||||||
task_background_id = 3
|
task_background_id = 3
|
||||||
task_icon_asb = 100 0 0
|
task_icon_asb = 100 0 0
|
||||||
## replace STATUS by 'urgent', 'active' or 'iconified'
|
## replace STATUS by 'urgent', 'active' or 'iconfied'
|
||||||
#task_STATUS_background_id = 2
|
#task_STATUS_background_id = 2
|
||||||
#task_STATUS_font_color = #ffffff 85
|
#task_STATUS_font_color = #ffffff 85
|
||||||
#task_STATUS_icon_asb = 100 0 0
|
#task_STATUS_icon_asb = 100 0 0
|
||||||
|
|||||||
+10
-131
@@ -1,4 +1,4 @@
|
|||||||
# TINT2 1 "2017-03-12"
|
# TINT2 1 "2016-05-22"
|
||||||
|
|
||||||
## NAME
|
## NAME
|
||||||
tint2 - lightweight panel/taskbar
|
tint2 - lightweight panel/taskbar
|
||||||
@@ -36,8 +36,6 @@ Goals:
|
|||||||
|
|
||||||
* [Backgrounds and borders](#backgrounds-and-borders)
|
* [Backgrounds and borders](#backgrounds-and-borders)
|
||||||
|
|
||||||
* [Gradients](#gradients)
|
|
||||||
|
|
||||||
* [Panel](#panel)
|
* [Panel](#panel)
|
||||||
|
|
||||||
* [Launcher](#launcher)
|
* [Launcher](#launcher)
|
||||||
@@ -58,8 +56,6 @@ Goals:
|
|||||||
|
|
||||||
* [Executor](#executor)
|
* [Executor](#executor)
|
||||||
|
|
||||||
* [Separator](#separator)
|
|
||||||
|
|
||||||
* [Example configuration](#example-configuration)
|
* [Example configuration](#example-configuration)
|
||||||
|
|
||||||
### Introduction
|
### Introduction
|
||||||
@@ -138,102 +134,6 @@ clock_background_id = 0
|
|||||||
|
|
||||||
Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.
|
Identifier 0 refers to a special background which is fully transparent, identifier 1 applies the first background defined in the config file etc.
|
||||||
|
|
||||||
### Gradients
|
|
||||||
|
|
||||||
(Available since 0.13.0)
|
|
||||||
|
|
||||||
Backgrounds also allow specifying gradient layers
|
|
||||||
that are drawn on top of the solid color background.
|
|
||||||
|
|
||||||
First the user must define one or more gradients in the config file,
|
|
||||||
each starting with `gradient = TYPE`. These must be added before backgrounds.
|
|
||||||
|
|
||||||
Then gradients can be added by index to backgrounds,
|
|
||||||
using the `gradient_id = INDEX`, `gradient_id_hover = INDEX` and
|
|
||||||
`gradient_id_pressed = INDEX`, where `INDEX` is
|
|
||||||
the gradient index, starting from 1.
|
|
||||||
|
|
||||||
#### Gradient types
|
|
||||||
|
|
||||||
Gradients vary the color between fixed control points:
|
|
||||||
* vertical gradients: top-to-bottom;
|
|
||||||
* horizontal gradients: left-to-right;
|
|
||||||
* radial gradients: center-to-corners.
|
|
||||||
|
|
||||||
The user must specify the start and end colors, and can optionally add extra color stops in between
|
|
||||||
using the `color_stop` option, as explained below.
|
|
||||||
|
|
||||||
##### Vertical gradient, with color varying from the top edge to the bottom edge, two colors
|
|
||||||
|
|
||||||
```
|
|
||||||
gradient = vertical
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Horizontal gradient, with color varying from the left edge to the right edge, two colors
|
|
||||||
|
|
||||||
```
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Radial gradient, with color varying from the center to the corner, two colors:
|
|
||||||
|
|
||||||
```
|
|
||||||
gradient = radial
|
|
||||||
start_color = #rrggbb opacity
|
|
||||||
end_color = #rrggbb opacity
|
|
||||||
```
|
|
||||||
|
|
||||||
##### Adding extra color stops (0% and 100% remain fixed, more colors at x% between the start and end control points)
|
|
||||||
|
|
||||||
```
|
|
||||||
color_stop = percentage #rrggbb opacity
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Gradient examples
|
|
||||||
|
|
||||||
```
|
|
||||||
# Gradient 1: thin film effect
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #111122 30
|
|
||||||
end_color = #112211 30
|
|
||||||
color_stop = 60 #221111 30
|
|
||||||
|
|
||||||
# Gradient 2: radial glow
|
|
||||||
gradient = radial
|
|
||||||
start_color = #ffffff 20
|
|
||||||
end_color = #ffffff 0
|
|
||||||
|
|
||||||
# Gradient 3: elegant black
|
|
||||||
gradient = vertical
|
|
||||||
start_color = #444444 100
|
|
||||||
end_color = #222222 100
|
|
||||||
|
|
||||||
# Gradient 4: elegant black
|
|
||||||
gradient = horizontal
|
|
||||||
start_color = #111111 100
|
|
||||||
end_color = #222222 100
|
|
||||||
|
|
||||||
# Background 1: Active desktop name
|
|
||||||
rounded = 2
|
|
||||||
border_width = 1
|
|
||||||
border_sides = TBLR
|
|
||||||
background_color = #555555 10
|
|
||||||
border_color = #ffffff 60
|
|
||||||
background_color_hover = #555555 10
|
|
||||||
border_color_hover = #ffffff 60
|
|
||||||
background_color_pressed = #555555 10
|
|
||||||
border_color_pressed = #ffffff 60
|
|
||||||
gradient_id = 3
|
|
||||||
gradient_id_hover = 4
|
|
||||||
gradient_id_pressed = 2
|
|
||||||
|
|
||||||
[...]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Panel
|
### Panel
|
||||||
|
|
||||||
* `panel_items = LTSBC` defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:
|
* `panel_items = LTSBC` defines the items tint2 will show and the order of those items. Each letter refers to an item, defined as:
|
||||||
@@ -242,9 +142,8 @@ gradient_id_pressed = 2
|
|||||||
* `S` shows the Systray (also called notification area)
|
* `S` shows the Systray (also called notification area)
|
||||||
* `B` shows the Battery status
|
* `B` shows the Battery status
|
||||||
* `C` shows the Clock
|
* `C` shows the Clock
|
||||||
* `F` adds an extensible spacer (freespace). You can specify more than one. Has no effect if `T` is also present. *(since 0.12)*
|
* `F` adds an extensible spacer (freespace). Has no effect if `T` is also present. *(since 0.12)*
|
||||||
* `E` adds an executor plugin. You can specify more than one. *(since 0.12.4)*
|
* `E` adds an executor plugin. You can specify more than one. *(since 0.12.4)*
|
||||||
* `:` adds a separator. You can specify more than one. *(since 0.13.0)*
|
|
||||||
|
|
||||||
For example, `panel_items = STC` will show the systray, the taskbar and the clock (from left to right).
|
For example, `panel_items = STC` will show the systray, the taskbar and the clock (from left to right).
|
||||||
|
|
||||||
@@ -270,8 +169,6 @@ gradient_id_pressed = 2
|
|||||||
panel_size = 94% 30
|
panel_size = 94% 30
|
||||||
```
|
```
|
||||||
|
|
||||||
* `panel_shrink = boolean (0 or 1)` : If set to 1, the panel will shrink to a compact size dynamically. *(since 0.13)*
|
|
||||||
|
|
||||||
* `panel_margin = horizontal_margin vertical_margin` : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use `0` to obtain a panel with the same size as the edge of the monitor (no margin).
|
* `panel_margin = horizontal_margin vertical_margin` : The margins define the distance between the panel and the horizontal/vertical monitor edge. Use `0` to obtain a panel with the same size as the edge of the monitor (no margin).
|
||||||
|
|
||||||

|

|
||||||
@@ -344,9 +241,7 @@ panel_size = 94% 30
|
|||||||
* You can drag-and-drop tasks between virtual desktops;
|
* You can drag-and-drop tasks between virtual desktops;
|
||||||
* You can switch between virtual desktops.
|
* You can switch between virtual desktops.
|
||||||
|
|
||||||
* `taskbar_hide_if_empty = boolean (0 or 1)` : If enabled, in multi-desktop mode the taskbars corresponding to empty desktops different from the current desktop are hidden. *(since 0.13)*
|
* `taskbar_distribute_size = boolean (0 or 1)` : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. *(since 0.12)*
|
||||||
|
|
||||||
* `taskbar_distribute_size = boolean (0 or 1)` : If enabled, in multi-desktop mode distributes between taskbars the available size proportionally to the number of tasks. Default: disabled. *(since 0.12)*
|
|
||||||
|
|
||||||
* `taskbar_padding = horizontal_padding vertical_padding spacing`
|
* `taskbar_padding = horizontal_padding vertical_padding spacing`
|
||||||
|
|
||||||
@@ -389,7 +284,7 @@ panel_size = 94% 30
|
|||||||
|
|
||||||
The following options configure the task buttons in the taskbar:
|
The following options configure the task buttons in the taskbar:
|
||||||
|
|
||||||
* `task_icon = boolean (0 or 1)` : Whether to display the task icon. There is no explicit option to control the task icon size; it depends on the vertical padding set with `task_padding`.
|
* `task_icon = boolean (0 or 1)` : Whether to display the task icon.
|
||||||
|
|
||||||
* `task_text = boolean (0 or 1)` : Whether to display the task text.
|
* `task_text = boolean (0 or 1)` : Whether to display the task text.
|
||||||
|
|
||||||
@@ -463,8 +358,6 @@ The action semantics:
|
|||||||
|
|
||||||
* `systray_monitor = integer (1, 2, ...)` : On which monitor to draw the systray. The first monitor is `1`. *(since 0.12)*
|
* `systray_monitor = integer (1, 2, ...)` : On which monitor to draw the systray. The first monitor is `1`. *(since 0.12)*
|
||||||
|
|
||||||
* `systray_name_filter = string` : Regular expression to identify icon names to be hidden. For example, `^audacious$` will hide icons with the exact name `audacious`, while `aud` will hide any icons having `aud` in the name. *(since 0.13.1)*
|
|
||||||
|
|
||||||
### Clock
|
### Clock
|
||||||
|
|
||||||
* `time1_format = %H:%M` : The format used by the first line of the clock.
|
* `time1_format = %H:%M` : The format used by the first line of the clock.
|
||||||
@@ -646,8 +539,8 @@ execp_continuous = 2
|
|||||||
|
|
||||||
```
|
```
|
||||||
execp = new
|
execp = new
|
||||||
execp_command = ping -i 1 -c 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
|
execp_command = ping -i 1 -W 1 -O -D -n $(ip route | grep default | grep via | grep -o '[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*') | awk '/no/ { print "<span foreground=\"#faa\">timeout</span>"; fflush(); }; /time=/ { gsub(/time=/, "", $8); printf "<span foreground=\"#7af\">%3.0f %s</span>\n", $8, $9; fflush(); } '
|
||||||
execp_continuous = 0
|
execp_continuous = 1
|
||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
execp_markup = 1
|
execp_markup = 1
|
||||||
```
|
```
|
||||||
@@ -656,9 +549,9 @@ execp_markup = 1
|
|||||||
|
|
||||||
```
|
```
|
||||||
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 -s 2 | awk '/^-/ { printf "Mem: '$(free -h | awk '/^Mem:/ { print $2 }')' %.0f%\n", 100*$3/($3+$4); fflush(stdout) }'
|
||||||
execp_interval = 5
|
execp_interval = 1
|
||||||
execp_continuous = 0
|
execp_continuous = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Network load
|
##### Network load
|
||||||
@@ -671,20 +564,6 @@ execp_continuous = 1
|
|||||||
execp_interval = 1
|
execp_interval = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
### Separator
|
|
||||||
|
|
||||||
* `separator = new` : Begins the configuration of a new separator. Multiple such plugins are supported; just use multiple `:`s in `panel_items`. *(since 0.13.0)*
|
|
||||||
|
|
||||||
* `separator_background_id = integer` : Which background to use. *(since 0.13.0)*
|
|
||||||
|
|
||||||
* `separator_color = color opacity` : The foreground color. *(since 0.13.0)*
|
|
||||||
|
|
||||||
* `separator_style = [empty | line | dots]` : The separator style. *(since 0.13.0)*
|
|
||||||
|
|
||||||
* `separator_size = integer` : The thickness of the separator. Does not include the border and padding. For example, if the style is `line`, this is the line thickness; if the style is `dots`, this is the dot's diameter. *(since 0.13.0)*
|
|
||||||
|
|
||||||
* `separator_padding = side_padding cap_padding` : The padding to add to the sides of the separator, in pixels. *(since 0.13.0)*
|
|
||||||
|
|
||||||
### Example configuration
|
### Example configuration
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -745,7 +624,7 @@ task_font = sans 7
|
|||||||
task_font_color = #ffffff 70
|
task_font_color = #ffffff 70
|
||||||
task_background_id = 3
|
task_background_id = 3
|
||||||
task_icon_asb = 100 0 0
|
task_icon_asb = 100 0 0
|
||||||
## replace STATUS by 'urgent', 'active' or 'iconified'
|
## replace STATUS by 'urgent', 'active' or 'iconfied'
|
||||||
#task_STATUS_background_id = 2
|
#task_STATUS_background_id = 2
|
||||||
#task_STATUS_font_color = #ffffff 85
|
#task_STATUS_font_color = #ffffff 85
|
||||||
#task_STATUS_icon_asb = 100 0 0
|
#task_STATUS_icon_asb = 100 0 0
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
MAJOR=0.13
|
MAJOR=0.12
|
||||||
DIRTY=""
|
DIRTY=""
|
||||||
|
|
||||||
if git status 1>/dev/null 2>/dev/null
|
if git status 1>/dev/null 2>/dev/null
|
||||||
|
|||||||
+21
-63
@@ -56,11 +56,8 @@ char *battery_uwheel_command;
|
|||||||
char *battery_dwheel_command;
|
char *battery_dwheel_command;
|
||||||
gboolean battery_found;
|
gboolean battery_found;
|
||||||
|
|
||||||
char *battery_sys_prefix = (char*)"";
|
|
||||||
|
|
||||||
void battery_init_fonts();
|
void battery_init_fonts();
|
||||||
char *battery_get_tooltip(void *obj);
|
char *battery_get_tooltip(void *obj);
|
||||||
int battery_compute_desired_size(void *obj);
|
|
||||||
void battery_dump_geometry(void *obj, int indent);
|
void battery_dump_geometry(void *obj, int indent);
|
||||||
|
|
||||||
void default_battery()
|
void default_battery()
|
||||||
@@ -158,7 +155,6 @@ void init_battery_panel(void *p)
|
|||||||
battery->area._draw_foreground = draw_battery;
|
battery->area._draw_foreground = draw_battery;
|
||||||
battery->area.size_mode = LAYOUT_FIXED;
|
battery->area.size_mode = LAYOUT_FIXED;
|
||||||
battery->area._resize = resize_battery;
|
battery->area._resize = resize_battery;
|
||||||
battery->area._compute_desired_size = battery_compute_desired_size;
|
|
||||||
battery->area._is_under_mouse = full_width_area_is_under_mouse;
|
battery->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||||
battery->area.on_screen = TRUE;
|
battery->area.on_screen = TRUE;
|
||||||
battery->area.resize_needed = 1;
|
battery->area.resize_needed = 1;
|
||||||
@@ -168,7 +164,6 @@ void init_battery_panel(void *p)
|
|||||||
battery->area.has_mouse_press_effect = battery->area.has_mouse_over_effect;
|
battery->area.has_mouse_press_effect = battery->area.has_mouse_over_effect;
|
||||||
if (battery_tooltip_enabled)
|
if (battery_tooltip_enabled)
|
||||||
battery->area._get_tooltip_text = battery_get_tooltip;
|
battery->area._get_tooltip_text = battery_get_tooltip;
|
||||||
instantiate_area_gradients(&battery->area);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void battery_init_fonts()
|
void battery_init_fonts()
|
||||||
@@ -202,7 +197,7 @@ void battery_default_font_changed()
|
|||||||
panels[i].battery.area.resize_needed = TRUE;
|
panels[i].battery.area.resize_needed = TRUE;
|
||||||
schedule_redraw(&panels[i].battery.area);
|
schedule_redraw(&panels[i].battery.area);
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_battery_tick(void *arg)
|
void update_battery_tick(void *arg)
|
||||||
@@ -245,19 +240,29 @@ void update_battery_tick(void *arg)
|
|||||||
for (int i = 0; i < num_panels; i++) {
|
for (int i = 0; i < num_panels; i++) {
|
||||||
// Show/hide if needed
|
// Show/hide if needed
|
||||||
if (!battery_found) {
|
if (!battery_found) {
|
||||||
hide(&panels[i].battery.area);
|
if (panels[i].battery.area.on_screen) {
|
||||||
} else {
|
|
||||||
if (battery_state.percentage >= percentage_hide)
|
|
||||||
hide(&panels[i].battery.area);
|
hide(&panels[i].battery.area);
|
||||||
else
|
panel_refresh = TRUE;
|
||||||
show(&panels[i].battery.area);
|
}
|
||||||
|
} else {
|
||||||
|
if (battery_state.percentage >= percentage_hide) {
|
||||||
|
if (panels[i].battery.area.on_screen) {
|
||||||
|
hide(&panels[i].battery.area);
|
||||||
|
panel_refresh = TRUE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!panels[i].battery.area.on_screen) {
|
||||||
|
show(&panels[i].battery.area);
|
||||||
|
panel_refresh = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Redraw if needed
|
// Redraw if needed
|
||||||
if (panels[i].battery.area.on_screen) {
|
if (panels[i].battery.area.on_screen) {
|
||||||
if (old_found != battery_found || old_percentage != battery_state.percentage ||
|
if (old_found != battery_found || old_percentage != battery_state.percentage ||
|
||||||
old_hours != battery_state.time.hours || old_minutes != battery_state.time.minutes) {
|
old_hours != battery_state.time.hours || old_minutes != battery_state.time.minutes) {
|
||||||
panels[i].battery.area.resize_needed = TRUE;
|
panels[i].battery.area.resize_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -281,61 +286,16 @@ int update_battery()
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int battery_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Battery *battery = (Battery *)obj;
|
|
||||||
Panel *panel = (Panel *)battery->area.panel;
|
|
||||||
int bat_percentage_height, bat_percentage_width, bat_percentage_height_ink;
|
|
||||||
int bat_time_height, bat_time_width, bat_time_height_ink;
|
|
||||||
|
|
||||||
snprintf(buf_bat_percentage, sizeof(buf_bat_percentage), "%d%%", battery_state.percentage);
|
|
||||||
if (battery_state.state == BATTERY_FULL) {
|
|
||||||
strcpy(buf_bat_time, "Full");
|
|
||||||
} else {
|
|
||||||
snprintf(buf_bat_time, sizeof(buf_bat_time), "%02d:%02d", battery_state.time.hours, battery_state.time.minutes);
|
|
||||||
}
|
|
||||||
get_text_size2(bat1_font_desc,
|
|
||||||
&bat_percentage_height_ink,
|
|
||||||
&bat_percentage_height,
|
|
||||||
&bat_percentage_width,
|
|
||||||
panel->area.height,
|
|
||||||
panel->area.width,
|
|
||||||
buf_bat_percentage,
|
|
||||||
strlen(buf_bat_percentage),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
FALSE);
|
|
||||||
get_text_size2(bat2_font_desc,
|
|
||||||
&bat_time_height_ink,
|
|
||||||
&bat_time_height,
|
|
||||||
&bat_time_width,
|
|
||||||
panel->area.height,
|
|
||||||
panel->area.width,
|
|
||||||
buf_bat_time,
|
|
||||||
strlen(buf_bat_time),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
FALSE);
|
|
||||||
|
|
||||||
if (panel_horizontal) {
|
|
||||||
int new_size = (bat_percentage_width > bat_time_width) ? bat_percentage_width : bat_time_width;
|
|
||||||
new_size += 2 * battery->area.paddingxlr + left_right_border_width(&battery->area);
|
|
||||||
return new_size;
|
|
||||||
} else {
|
|
||||||
int new_size = bat_percentage_height + bat_time_height + 2 * battery->area.paddingxlr +
|
|
||||||
top_bottom_border_width(&battery->area);
|
|
||||||
return new_size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_battery(void *obj)
|
gboolean resize_battery(void *obj)
|
||||||
{
|
{
|
||||||
Battery *battery = (Battery *)obj;
|
Battery *battery = obj;
|
||||||
Panel *panel = (Panel *)battery->area.panel;
|
Panel *panel = battery->area.panel;
|
||||||
int bat_percentage_height, bat_percentage_width, bat_percentage_height_ink;
|
int bat_percentage_height, bat_percentage_width, bat_percentage_height_ink;
|
||||||
int bat_time_height, bat_time_width, bat_time_height_ink;
|
int bat_time_height, bat_time_width, bat_time_height_ink;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
schedule_redraw(&battery->area);
|
||||||
|
|
||||||
snprintf(buf_bat_percentage, sizeof(buf_bat_percentage), "%d%%", battery_state.percentage);
|
snprintf(buf_bat_percentage, sizeof(buf_bat_percentage), "%d%%", battery_state.percentage);
|
||||||
if (battery_state.state == BATTERY_FULL) {
|
if (battery_state.state == BATTERY_FULL) {
|
||||||
strcpy(buf_bat_time, "Full");
|
strcpy(buf_bat_time, "Full");
|
||||||
@@ -385,8 +345,6 @@ gboolean resize_battery(void *obj)
|
|||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
schedule_redraw(&battery->area);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,8 +64,6 @@ extern char *battery_rclick_command;
|
|||||||
extern char *battery_uwheel_command;
|
extern char *battery_uwheel_command;
|
||||||
extern char *battery_dwheel_command;
|
extern char *battery_dwheel_command;
|
||||||
|
|
||||||
extern char *battery_sys_prefix;
|
|
||||||
|
|
||||||
static inline gchar *chargestate2str(ChargeState state)
|
static inline gchar *chargestate2str(ChargeState state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
|||||||
+123
-120
@@ -38,16 +38,18 @@ struct psy_battery {
|
|||||||
gint64 timestamp;
|
gint64 timestamp;
|
||||||
/* sysfs files */
|
/* sysfs files */
|
||||||
gchar *path_present;
|
gchar *path_present;
|
||||||
gchar *path_level_now;
|
gchar *path_energy_now;
|
||||||
gchar *path_level_full;
|
gchar *path_energy_full;
|
||||||
gchar *path_rate_now;
|
gchar *path_power_now;
|
||||||
gchar *path_status;
|
gchar *path_status;
|
||||||
|
/* sysfs hints */
|
||||||
|
gboolean energy_in_uamp;
|
||||||
|
gboolean power_in_uamp;
|
||||||
/* values */
|
/* values */
|
||||||
gboolean present;
|
gboolean present;
|
||||||
gint level_now;
|
gint energy_now;
|
||||||
gint level_full;
|
gint energy_full;
|
||||||
gint rate_now;
|
gint power_now;
|
||||||
gchar unit;
|
|
||||||
ChargeState status;
|
ChargeState status;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -74,23 +76,22 @@ static void uevent_battery_plug()
|
|||||||
static struct uevent_notify psy_plug = {UEVENT_ADD | UEVENT_REMOVE, "power_supply", NULL, uevent_battery_plug};
|
static struct uevent_notify psy_plug = {UEVENT_ADD | UEVENT_REMOVE, "power_supply", NULL, uevent_battery_plug};
|
||||||
|
|
||||||
#define RETURN_ON_ERROR(err) \
|
#define RETURN_ON_ERROR(err) \
|
||||||
if (err) { \
|
if (error) { \
|
||||||
g_error_free(err); \
|
g_error_free(err); \
|
||||||
fprintf(stderr, RED "%s:%d: errror" RESET "\n", __FILE__, __LINE__); \
|
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
}
|
}
|
||||||
|
|
||||||
static GList *batteries = NULL;
|
static GList *batteries = NULL;
|
||||||
static GList *mains = NULL;
|
static GList *mains = NULL;
|
||||||
|
|
||||||
static guint8 level_to_percent(gint level_now, gint level_full)
|
static guint8 energy_to_percent(gint energy_now, gint energy_full)
|
||||||
{
|
{
|
||||||
return 0.5 + ((level_now <= level_full ? level_now : level_full) * 100.0) / level_full;
|
return 0.5 + ((energy_now <= energy_full ? energy_now : energy_full) * 100.0) / energy_full;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum psy_type power_supply_get_type(const gchar *entryname)
|
static enum psy_type power_supply_get_type(const gchar *entryname)
|
||||||
{
|
{
|
||||||
gchar *path_type = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "type", NULL);
|
gchar *path_type = g_build_filename("/sys/class/power_supply", entryname, "type", NULL);
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gchar *type;
|
gchar *type;
|
||||||
gsize typelen;
|
gsize typelen;
|
||||||
@@ -98,7 +99,6 @@ static enum psy_type power_supply_get_type(const gchar *entryname)
|
|||||||
g_file_get_contents(path_type, &type, &typelen, &error);
|
g_file_get_contents(path_type, &type, &typelen, &error);
|
||||||
g_free(path_type);
|
g_free(path_type);
|
||||||
if (error) {
|
if (error) {
|
||||||
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
|
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
return PSY_UNKNOWN;
|
return PSY_UNKNOWN;
|
||||||
}
|
}
|
||||||
@@ -122,53 +122,59 @@ static gboolean init_linux_battery(struct psy_battery *bat)
|
|||||||
{
|
{
|
||||||
const gchar *entryname = bat->name;
|
const gchar *entryname = bat->name;
|
||||||
|
|
||||||
bat->path_present = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "present", NULL);
|
bat->energy_in_uamp = FALSE;
|
||||||
|
bat->power_in_uamp = FALSE;
|
||||||
|
|
||||||
|
bat->path_present = g_build_filename("/sys/class/power_supply", entryname, "present", NULL);
|
||||||
if (!g_file_test(bat->path_present, G_FILE_TEST_EXISTS)) {
|
if (!g_file_test(bat->path_present, G_FILE_TEST_EXISTS)) {
|
||||||
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
|
|
||||||
goto err0;
|
goto err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bat->path_level_now = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "energy_now", NULL);
|
bat->path_energy_now = g_build_filename("/sys/class/power_supply", entryname, "energy_now", NULL);
|
||||||
bat->path_level_full =
|
if (!g_file_test(bat->path_energy_now, G_FILE_TEST_EXISTS)) {
|
||||||
g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "energy_full", NULL);
|
g_free(bat->path_energy_now);
|
||||||
bat->path_rate_now = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "power_now", NULL);
|
bat->path_energy_now = g_build_filename("/sys/class/power_supply", entryname, "charge_now", NULL);
|
||||||
bat->unit = 'W';
|
bat->energy_in_uamp = TRUE;
|
||||||
|
|
||||||
if (!g_file_test(bat->path_level_now, G_FILE_TEST_EXISTS) ||
|
|
||||||
!g_file_test(bat->path_level_full, G_FILE_TEST_EXISTS) ||
|
|
||||||
!g_file_test(bat->path_rate_now, G_FILE_TEST_EXISTS)) {
|
|
||||||
g_free(bat->path_level_now);
|
|
||||||
g_free(bat->path_level_full);
|
|
||||||
g_free(bat->path_rate_now);
|
|
||||||
bat->path_level_now =
|
|
||||||
g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "charge_now", NULL);
|
|
||||||
bat->path_level_full =
|
|
||||||
g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "charge_full", NULL);
|
|
||||||
bat->path_rate_now =
|
|
||||||
g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "current_now", NULL);
|
|
||||||
bat->unit = 'A';
|
|
||||||
}
|
}
|
||||||
if (!g_file_test(bat->path_level_now, G_FILE_TEST_EXISTS) ||
|
if (!g_file_test(bat->path_energy_now, G_FILE_TEST_EXISTS)) {
|
||||||
!g_file_test(bat->path_level_full, G_FILE_TEST_EXISTS) ||
|
|
||||||
!g_file_test(bat->path_rate_now, G_FILE_TEST_EXISTS)) {
|
|
||||||
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
|
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bat->path_status = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "status", NULL);
|
if (!bat->energy_in_uamp) {
|
||||||
|
bat->path_energy_full = g_build_filename("/sys/class/power_supply", entryname, "energy_full", NULL);
|
||||||
|
if (!g_file_test(bat->path_energy_full, G_FILE_TEST_EXISTS))
|
||||||
|
goto err2;
|
||||||
|
} else {
|
||||||
|
bat->path_energy_full = g_build_filename("/sys/class/power_supply", entryname, "charge_full", NULL);
|
||||||
|
if (!g_file_test(bat->path_energy_full, G_FILE_TEST_EXISTS))
|
||||||
|
goto err2;
|
||||||
|
}
|
||||||
|
|
||||||
|
bat->path_power_now = g_build_filename("/sys/class/power_supply", entryname, "power_now", NULL);
|
||||||
|
if (!g_file_test(bat->path_power_now, G_FILE_TEST_EXISTS)) {
|
||||||
|
g_free(bat->path_power_now);
|
||||||
|
bat->path_power_now = g_build_filename("/sys/class/power_supply", entryname, "current_now", NULL);
|
||||||
|
bat->power_in_uamp = TRUE;
|
||||||
|
}
|
||||||
|
if (!g_file_test(bat->path_power_now, G_FILE_TEST_EXISTS)) {
|
||||||
|
goto err3;
|
||||||
|
}
|
||||||
|
|
||||||
|
bat->path_status = g_build_filename("/sys/class/power_supply", entryname, "status", NULL);
|
||||||
if (!g_file_test(bat->path_status, G_FILE_TEST_EXISTS)) {
|
if (!g_file_test(bat->path_status, G_FILE_TEST_EXISTS)) {
|
||||||
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
|
goto err4;
|
||||||
goto err2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
err2:
|
err4:
|
||||||
g_free(bat->path_status);
|
g_free(bat->path_status);
|
||||||
|
err3:
|
||||||
|
g_free(bat->path_power_now);
|
||||||
|
err2:
|
||||||
|
g_free(bat->path_energy_full);
|
||||||
err1:
|
err1:
|
||||||
g_free(bat->path_level_now);
|
g_free(bat->path_energy_now);
|
||||||
g_free(bat->path_level_full);
|
|
||||||
g_free(bat->path_rate_now);
|
|
||||||
err0:
|
err0:
|
||||||
g_free(bat->path_present);
|
g_free(bat->path_present);
|
||||||
|
|
||||||
@@ -179,9 +185,8 @@ static gboolean init_linux_mains(struct psy_mains *ac)
|
|||||||
{
|
{
|
||||||
const gchar *entryname = ac->name;
|
const gchar *entryname = ac->name;
|
||||||
|
|
||||||
ac->path_online = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", entryname, "online", NULL);
|
ac->path_online = g_build_filename("/sys/class/power_supply", entryname, "online", NULL);
|
||||||
if (!g_file_test(ac->path_online, G_FILE_TEST_EXISTS)) {
|
if (!g_file_test(ac->path_online, G_FILE_TEST_EXISTS)) {
|
||||||
fprintf(stderr, RED "%s:%d: read failed" RESET "\n", __FILE__, __LINE__);
|
|
||||||
g_free(ac->path_online);
|
g_free(ac->path_online);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -194,9 +199,9 @@ static void psy_battery_free(gpointer data)
|
|||||||
struct psy_battery *bat = data;
|
struct psy_battery *bat = data;
|
||||||
g_free(bat->name);
|
g_free(bat->name);
|
||||||
g_free(bat->path_status);
|
g_free(bat->path_status);
|
||||||
g_free(bat->path_rate_now);
|
g_free(bat->path_power_now);
|
||||||
g_free(bat->path_level_full);
|
g_free(bat->path_energy_full);
|
||||||
g_free(bat->path_level_now);
|
g_free(bat->path_energy_now);
|
||||||
g_free(bat->path_present);
|
g_free(bat->path_present);
|
||||||
g_free(bat);
|
g_free(bat);
|
||||||
}
|
}
|
||||||
@@ -227,10 +232,10 @@ static void add_battery(const char *entryname)
|
|||||||
|
|
||||||
if (init_linux_battery(bat)) {
|
if (init_linux_battery(bat)) {
|
||||||
batteries = g_list_append(batteries, bat);
|
batteries = g_list_append(batteries, bat);
|
||||||
fprintf(stdout, GREEN "Found battery \"%s\"" RESET "\n", bat->name);
|
fprintf(stdout, "found battery \"%s\"\n", bat->name);
|
||||||
} else {
|
} else {
|
||||||
g_free(bat);
|
g_free(bat);
|
||||||
fprintf(stderr, RED "Failed to initialize battery \"%s\"" RESET "\n", entryname);
|
fprintf(stderr, RED "failed to initialize battery \"%s\"" RESET "\n", entryname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,10 +246,10 @@ static void add_mains(const char *entryname)
|
|||||||
|
|
||||||
if (init_linux_mains(ac)) {
|
if (init_linux_mains(ac)) {
|
||||||
mains = g_list_append(mains, ac);
|
mains = g_list_append(mains, ac);
|
||||||
fprintf(stdout, GREEN "Found mains \"%s\"" RESET "\n", ac->name);
|
fprintf(stdout, "found mains \"%s\"\n", ac->name);
|
||||||
} else {
|
} else {
|
||||||
g_free(ac);
|
g_free(ac);
|
||||||
fprintf(stderr, RED "Failed to initialize mains \"%s\"" RESET "\n", entryname);
|
fprintf(stderr, RED "failed to initialize mains \"%s\"" RESET "\n", entryname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,13 +261,10 @@ gboolean battery_os_init()
|
|||||||
|
|
||||||
battery_os_free();
|
battery_os_free();
|
||||||
|
|
||||||
gchar *dir_path = g_build_filename(battery_sys_prefix, "/sys/class/power_supply", NULL);
|
directory = g_dir_open("/sys/class/power_supply", 0, &error);
|
||||||
directory = g_dir_open(dir_path, 0, &error);
|
|
||||||
g_free(dir_path);
|
|
||||||
RETURN_ON_ERROR(error);
|
RETURN_ON_ERROR(error);
|
||||||
|
|
||||||
while ((entryname = g_dir_read_name(directory))) {
|
while ((entryname = g_dir_read_name(directory))) {
|
||||||
fprintf(stderr, GREEN "Found power device %s" RESET "\n", entryname);
|
|
||||||
enum psy_type type = power_supply_get_type(entryname);
|
enum psy_type type = power_supply_get_type(entryname);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@@ -285,15 +287,15 @@ gboolean battery_os_init()
|
|||||||
return batteries != NULL;
|
return batteries != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint estimate_rate_usage(struct psy_battery *bat, gint old_level_now, gint64 old_timestamp)
|
static gint estimate_power_usage(struct psy_battery *bat, gint old_energy_now, gint64 old_timestamp)
|
||||||
{
|
{
|
||||||
gint64 diff_level = ABS(bat->level_now - old_level_now);
|
gint64 diff_power = ABS(bat->energy_now - old_energy_now);
|
||||||
gint64 diff_time = bat->timestamp - old_timestamp;
|
gint64 diff_time = bat->timestamp - old_timestamp;
|
||||||
|
|
||||||
/* µW = (µWh * 3600) / (µs / 1000000) */
|
/* µW = (µWh * 3600) / (µs / 1000000) */
|
||||||
gint rate = diff_level * 3600 * 1000000 / MAX(1, diff_time);
|
gint power = diff_power * 3600 * 1000000 / MAX(1, diff_time);
|
||||||
|
|
||||||
return rate;
|
return power;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean update_linux_battery(struct psy_battery *bat)
|
static gboolean update_linux_battery(struct psy_battery *bat)
|
||||||
@@ -303,15 +305,15 @@ static gboolean update_linux_battery(struct psy_battery *bat)
|
|||||||
gsize datalen;
|
gsize datalen;
|
||||||
|
|
||||||
gint64 old_timestamp = bat->timestamp;
|
gint64 old_timestamp = bat->timestamp;
|
||||||
int old_level_now = bat->level_now;
|
int old_energy_now = bat->energy_now;
|
||||||
gint old_rate_now = bat->rate_now;
|
gint old_power_now = bat->power_now;
|
||||||
|
|
||||||
/* reset values */
|
/* reset values */
|
||||||
bat->present = 0;
|
bat->present = 0;
|
||||||
bat->status = BATTERY_UNKNOWN;
|
bat->status = BATTERY_UNKNOWN;
|
||||||
bat->level_now = 0;
|
bat->energy_now = 0;
|
||||||
bat->level_full = 0;
|
bat->energy_full = 0;
|
||||||
bat->rate_now = 0;
|
bat->power_now = 0;
|
||||||
bat->timestamp = g_get_monotonic_time();
|
bat->timestamp = g_get_monotonic_time();
|
||||||
|
|
||||||
/* present */
|
/* present */
|
||||||
@@ -337,35 +339,35 @@ static gboolean update_linux_battery(struct psy_battery *bat)
|
|||||||
}
|
}
|
||||||
g_free(data);
|
g_free(data);
|
||||||
|
|
||||||
/* level now */
|
/* energy now */
|
||||||
g_file_get_contents(bat->path_level_now, &data, &datalen, &error);
|
g_file_get_contents(bat->path_energy_now, &data, &datalen, &error);
|
||||||
RETURN_ON_ERROR(error);
|
RETURN_ON_ERROR(error);
|
||||||
bat->level_now = atoi(data);
|
bat->energy_now = atoi(data);
|
||||||
g_free(data);
|
g_free(data);
|
||||||
|
|
||||||
/* level full */
|
/* energy full */
|
||||||
g_file_get_contents(bat->path_level_full, &data, &datalen, &error);
|
g_file_get_contents(bat->path_energy_full, &data, &datalen, &error);
|
||||||
RETURN_ON_ERROR(error);
|
RETURN_ON_ERROR(error);
|
||||||
bat->level_full = atoi(data);
|
bat->energy_full = atoi(data);
|
||||||
g_free(data);
|
g_free(data);
|
||||||
|
|
||||||
/* rate now */
|
/* power now */
|
||||||
g_file_get_contents(bat->path_rate_now, &data, &datalen, &error);
|
g_file_get_contents(bat->path_power_now, &data, &datalen, &error);
|
||||||
if (g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NODEV)) {
|
if (g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NODEV)) {
|
||||||
/* some hardware does not support reading current rate consumption */
|
/* some hardware does not support reading current power consumption */
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
bat->rate_now = estimate_rate_usage(bat, old_level_now, old_timestamp);
|
bat->power_now = estimate_power_usage(bat, old_energy_now, old_timestamp);
|
||||||
if (bat->rate_now == 0 && bat->status != BATTERY_FULL) {
|
if (bat->power_now == 0 && bat->status != BATTERY_FULL) {
|
||||||
/* If the hardware updates the level slower than our sampling period,
|
/* If the hardware updates the level slower than our sampling period,
|
||||||
* we need to sample more rarely */
|
* we need to sample more rarely */
|
||||||
bat->rate_now = old_rate_now;
|
bat->power_now = old_power_now;
|
||||||
bat->timestamp = old_timestamp;
|
bat->timestamp = old_timestamp;
|
||||||
}
|
}
|
||||||
} else if (error) {
|
} else if (error) {
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
bat->rate_now = atoi(data);
|
bat->power_now = atoi(data);
|
||||||
g_free(data);
|
g_free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,9 +394,9 @@ int battery_os_update(BatteryState *state)
|
|||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
gint64 total_level_now = 0;
|
gint64 total_energy_now = 0;
|
||||||
gint64 total_level_full = 0;
|
gint64 total_energy_full = 0;
|
||||||
gint64 total_rate_now = 0;
|
gint64 total_power_now = 0;
|
||||||
gint seconds = 0;
|
gint seconds = 0;
|
||||||
|
|
||||||
gboolean charging = FALSE;
|
gboolean charging = FALSE;
|
||||||
@@ -406,9 +408,9 @@ int battery_os_update(BatteryState *state)
|
|||||||
struct psy_battery *bat = l->data;
|
struct psy_battery *bat = l->data;
|
||||||
update_linux_battery(bat);
|
update_linux_battery(bat);
|
||||||
|
|
||||||
total_level_now += bat->level_now;
|
total_energy_now += bat->energy_now;
|
||||||
total_level_full += bat->level_full;
|
total_energy_full += bat->energy_full;
|
||||||
total_rate_now += bat->rate_now;
|
total_power_now += bat->power_now;
|
||||||
|
|
||||||
charging |= (bat->status == BATTERY_CHARGING);
|
charging |= (bat->status == BATTERY_CHARGING);
|
||||||
discharging |= (bat->status == BATTERY_DISCHARGING);
|
discharging |= (bat->status == BATTERY_DISCHARGING);
|
||||||
@@ -430,17 +432,17 @@ int battery_os_update(BatteryState *state)
|
|||||||
state->state = BATTERY_FULL;
|
state->state = BATTERY_FULL;
|
||||||
|
|
||||||
/* calculate seconds */
|
/* calculate seconds */
|
||||||
if (total_rate_now > 0) {
|
if (total_power_now > 0) {
|
||||||
if (state->state == BATTERY_CHARGING)
|
if (state->state == BATTERY_CHARGING)
|
||||||
seconds = 3600 * (total_level_full - total_level_now) / total_rate_now;
|
seconds = 3600 * (total_energy_full - total_energy_now) / total_power_now;
|
||||||
else if (state->state == BATTERY_DISCHARGING)
|
else if (state->state == BATTERY_DISCHARGING)
|
||||||
seconds = 3600 * total_level_now / total_rate_now;
|
seconds = 3600 * total_energy_now / total_power_now;
|
||||||
seconds = MAX(0, seconds);
|
seconds = MAX(0, seconds);
|
||||||
}
|
}
|
||||||
battery_state_set_time(state, seconds);
|
battery_state_set_time(state, seconds);
|
||||||
|
|
||||||
/* calculate percentage */
|
/* calculate percentage */
|
||||||
state->percentage = level_to_percent(total_level_now, total_level_full);
|
state->percentage = energy_to_percent(total_energy_now, total_energy_full);
|
||||||
|
|
||||||
/* AC state */
|
/* AC state */
|
||||||
state->ac_connected = ac_connected;
|
state->ac_connected = ac_connected;
|
||||||
@@ -448,41 +450,42 @@ int battery_os_update(BatteryState *state)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *level_human_readable(struct psy_battery *bat)
|
static gchar *energy_human_readable(struct psy_battery *bat)
|
||||||
{
|
{
|
||||||
gint now = bat->level_now;
|
gint now = bat->energy_now;
|
||||||
gint full = bat->level_full;
|
gint full = bat->energy_full;
|
||||||
|
gchar unit = bat->energy_in_uamp ? 'A' : 'W';
|
||||||
|
|
||||||
if (full >= 1000000) {
|
if (full >= 1000000) {
|
||||||
return g_strdup_printf("%d.%d / %d.%d %ch",
|
return g_strdup_printf("%d.%d / %d.%d %ch",
|
||||||
now / 1000000,
|
now / 1000000,
|
||||||
(now % 1000000) / 100000,
|
(now % 1000000) / 100000,
|
||||||
full / 1000000,
|
full / 1000000,
|
||||||
(full % 1000000) / 100000,
|
(full % 1000000) / 100000,
|
||||||
bat->unit);
|
unit);
|
||||||
} else if (full >= 1000) {
|
} else if (full >= 1000) {
|
||||||
return g_strdup_printf("%d.%d / %d.%d m%ch",
|
return g_strdup_printf("%d.%d / %d.%d m%ch",
|
||||||
now / 1000,
|
now / 1000,
|
||||||
(now % 1000) / 100,
|
(now % 1000) / 100,
|
||||||
full / 1000,
|
full / 1000,
|
||||||
(full % 1000) / 100,
|
(full % 1000) / 100,
|
||||||
bat->unit);
|
unit);
|
||||||
} else {
|
} else {
|
||||||
return g_strdup_printf("%d / %d µ%ch", now, full, bat->unit);
|
return g_strdup_printf("%d / %d µ%ch", now, full, unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar *rate_human_readable(struct psy_battery *bat)
|
static gchar *power_human_readable(struct psy_battery *bat)
|
||||||
{
|
{
|
||||||
gint rate = bat->rate_now;
|
gint power = bat->power_now;
|
||||||
gchar unit = bat->unit;
|
gchar unit = bat->power_in_uamp ? 'A' : 'W';
|
||||||
|
|
||||||
if (rate >= 1000000) {
|
if (power >= 1000000) {
|
||||||
return g_strdup_printf("%d.%d %c", rate / 1000000, (rate % 1000000) / 100000, unit);
|
return g_strdup_printf("%d.%d %c", power / 1000000, (power % 1000000) / 100000, unit);
|
||||||
} else if (rate >= 1000) {
|
} else if (power >= 1000) {
|
||||||
return g_strdup_printf("%d.%d m%c", rate / 1000, (rate % 1000) / 100, unit);
|
return g_strdup_printf("%d.%d m%c", power / 1000, (power % 1000) / 100, unit);
|
||||||
} else if (rate > 0) {
|
} else if (power > 0) {
|
||||||
return g_strdup_printf("%d µ%c", rate, unit);
|
return g_strdup_printf("%d µ%c", power, unit);
|
||||||
} else {
|
} else {
|
||||||
return g_strdup_printf("0 %c", unit);
|
return g_strdup_printf("0 %c", unit);
|
||||||
}
|
}
|
||||||
@@ -507,16 +510,16 @@ char *battery_os_tooltip()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *rate = rate_human_readable(bat);
|
gchar *power = power_human_readable(bat);
|
||||||
gchar *level = level_human_readable(bat);
|
gchar *energy = energy_human_readable(bat);
|
||||||
gchar *state = (bat->status == BATTERY_UNKNOWN) ? "energy" : chargestate2str(bat->status);
|
gchar *state = (bat->status == BATTERY_UNKNOWN) ? "Level" : chargestate2str(bat->status);
|
||||||
|
|
||||||
guint8 percentage = level_to_percent(bat->level_now, bat->level_full);
|
guint8 percentage = energy_to_percent(bat->energy_now, bat->energy_full);
|
||||||
|
|
||||||
g_string_append_printf(tooltip, "\t%s: %s (%u %%)\n\trate: %s", state, level, percentage, rate);
|
g_string_append_printf(tooltip, "\t%s: %s (%u %%)\n\tPower: %s", state, energy, percentage, power);
|
||||||
|
|
||||||
g_free(rate);
|
g_free(power);
|
||||||
g_free(level);
|
g_free(energy);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = mains; l != NULL; l = l->next) {
|
for (l = mains; l != NULL; l = l->next) {
|
||||||
|
|||||||
+57
-88
@@ -55,7 +55,6 @@ static timeout *clock_timeout;
|
|||||||
|
|
||||||
void clock_init_fonts();
|
void clock_init_fonts();
|
||||||
char *clock_get_tooltip(void *obj);
|
char *clock_get_tooltip(void *obj);
|
||||||
int clock_compute_desired_size(void *obj);
|
|
||||||
void clock_dump_geometry(void *obj, int indent);
|
void clock_dump_geometry(void *obj, int indent);
|
||||||
|
|
||||||
void default_clock()
|
void default_clock()
|
||||||
@@ -118,7 +117,7 @@ void update_clocks_sec(void *arg)
|
|||||||
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();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_clocks_min(void *arg)
|
void update_clocks_min(void *arg)
|
||||||
@@ -132,7 +131,7 @@ void update_clocks_min(void *arg)
|
|||||||
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();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,13 +162,6 @@ gboolean time_format_needs_sec_ticks(char *time_format)
|
|||||||
|
|
||||||
void init_clock()
|
void init_clock()
|
||||||
{
|
{
|
||||||
}
|
|
||||||
|
|
||||||
void init_clock_panel(void *p)
|
|
||||||
{
|
|
||||||
Panel *panel = (Panel *)p;
|
|
||||||
Clock *clock = &panel->clock;
|
|
||||||
|
|
||||||
if (!clock_timeout) {
|
if (!clock_timeout) {
|
||||||
if (time_format_needs_sec_ticks(time1_format) || time_format_needs_sec_ticks(time2_format)) {
|
if (time_format_needs_sec_ticks(time1_format) || time_format_needs_sec_ticks(time2_format)) {
|
||||||
clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0, &clock_timeout);
|
clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0, &clock_timeout);
|
||||||
@@ -177,6 +169,12 @@ void init_clock_panel(void *p)
|
|||||||
clock_timeout = add_timeout(10, 1000, update_clocks_min, 0, &clock_timeout);
|
clock_timeout = add_timeout(10, 1000, update_clocks_min, 0, &clock_timeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void init_clock_panel(void *p)
|
||||||
|
{
|
||||||
|
Panel *panel = (Panel *)p;
|
||||||
|
Clock *clock = &panel->clock;
|
||||||
|
|
||||||
if (!clock->area.bg)
|
if (!clock->area.bg)
|
||||||
clock->area.bg = &g_array_index(backgrounds, Background, 0);
|
clock->area.bg = &g_array_index(backgrounds, Background, 0);
|
||||||
@@ -186,12 +184,11 @@ void init_clock_panel(void *p)
|
|||||||
snprintf(clock->area.name, sizeof(clock->area.name), "Clock");
|
snprintf(clock->area.name, sizeof(clock->area.name), "Clock");
|
||||||
clock->area._is_under_mouse = full_width_area_is_under_mouse;
|
clock->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||||
clock->area.has_mouse_press_effect = clock->area.has_mouse_over_effect =
|
clock->area.has_mouse_press_effect = clock->area.has_mouse_over_effect =
|
||||||
panel_config.mouse_effects && (clock_lclick_command || clock_mclick_command || clock_rclick_command ||
|
panel_config.mouse_effects && (clock_lclick_command || clock_mclick_command || clock_rclick_command ||
|
||||||
clock_uwheel_command || clock_dwheel_command);
|
clock_uwheel_command || clock_dwheel_command);
|
||||||
clock->area._draw_foreground = draw_clock;
|
clock->area._draw_foreground = draw_clock;
|
||||||
clock->area.size_mode = LAYOUT_FIXED;
|
clock->area.size_mode = LAYOUT_FIXED;
|
||||||
clock->area._resize = resize_clock;
|
clock->area._resize = resize_clock;
|
||||||
clock->area._compute_desired_size = clock_compute_desired_size;
|
|
||||||
clock->area._dump_geometry = clock_dump_geometry;
|
clock->area._dump_geometry = clock_dump_geometry;
|
||||||
// check consistency
|
// check consistency
|
||||||
if (!time1_format)
|
if (!time1_format)
|
||||||
@@ -199,7 +196,6 @@ void init_clock_panel(void *p)
|
|||||||
|
|
||||||
clock->area.resize_needed = 1;
|
clock->area.resize_needed = 1;
|
||||||
clock->area.on_screen = TRUE;
|
clock->area.on_screen = TRUE;
|
||||||
instantiate_area_gradients(&clock->area);
|
|
||||||
|
|
||||||
if (time_tooltip_format) {
|
if (time_tooltip_format) {
|
||||||
clock->area._get_tooltip_text = clock_get_tooltip;
|
clock->area._get_tooltip_text = clock_get_tooltip;
|
||||||
@@ -240,88 +236,49 @@ void clock_default_font_changed()
|
|||||||
panels[i].clock.area.resize_needed = TRUE;
|
panels[i].clock.area.resize_needed = TRUE;
|
||||||
schedule_redraw(&panels[i].clock.area);
|
schedule_redraw(&panels[i].clock.area);
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
void clock_compute_text_geometry(Panel *panel,
|
|
||||||
int *time_height_ink,
|
|
||||||
int *time_height,
|
|
||||||
int *time_width,
|
|
||||||
int *date_height_ink,
|
|
||||||
int *date_height,
|
|
||||||
int *date_width)
|
|
||||||
{
|
|
||||||
*date_height = *date_width = 0;
|
|
||||||
strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone));
|
|
||||||
get_text_size2(time1_font_desc,
|
|
||||||
time_height_ink,
|
|
||||||
time_height,
|
|
||||||
time_width,
|
|
||||||
panel->area.height,
|
|
||||||
panel->area.width,
|
|
||||||
buf_time,
|
|
||||||
strlen(buf_time),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
FALSE);
|
|
||||||
if (time2_format) {
|
|
||||||
strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone));
|
|
||||||
get_text_size2(time2_font_desc,
|
|
||||||
date_height_ink,
|
|
||||||
date_height,
|
|
||||||
date_width,
|
|
||||||
panel->area.height,
|
|
||||||
panel->area.width,
|
|
||||||
buf_date,
|
|
||||||
strlen(buf_date),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int clock_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Clock *clock = (Clock *)obj;
|
|
||||||
Panel *panel = (Panel *)clock->area.panel;
|
|
||||||
int time_height_ink, time_height, time_width, date_height_ink, date_height, date_width;
|
|
||||||
clock_compute_text_geometry(panel,
|
|
||||||
&time_height_ink,
|
|
||||||
&time_height,
|
|
||||||
&time_width,
|
|
||||||
&date_height_ink,
|
|
||||||
&date_height,
|
|
||||||
&date_width);
|
|
||||||
|
|
||||||
if (panel_horizontal) {
|
|
||||||
int new_size = (time_width > date_width) ? time_width : date_width;
|
|
||||||
new_size += 2 * clock->area.paddingxlr + left_right_border_width(&clock->area);
|
|
||||||
return new_size;
|
|
||||||
} else {
|
|
||||||
int new_size = time_height + date_height + 2 * clock->area.paddingxlr + top_bottom_border_width(&clock->area);
|
|
||||||
return new_size;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean resize_clock(void *obj)
|
gboolean resize_clock(void *obj)
|
||||||
{
|
{
|
||||||
Clock *clock = (Clock *)obj;
|
Clock *clock = obj;
|
||||||
Panel *panel = (Panel *)clock->area.panel;
|
Panel *panel = clock->area.panel;
|
||||||
|
int time_height_ink, time_height, time_width, date_height_ink, date_height, date_width;
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
|
|
||||||
schedule_redraw(&clock->area);
|
schedule_redraw(&clock->area);
|
||||||
|
|
||||||
int time_height_ink, time_height, time_width, date_height_ink, date_height, date_width;
|
date_height = date_width = 0;
|
||||||
clock_compute_text_geometry(panel,
|
strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone));
|
||||||
&time_height_ink,
|
get_text_size2(time1_font_desc,
|
||||||
&time_height,
|
&time_height_ink,
|
||||||
&time_width,
|
&time_height,
|
||||||
&date_height_ink,
|
&time_width,
|
||||||
&date_height,
|
panel->area.height,
|
||||||
&date_width);
|
panel->area.width,
|
||||||
|
buf_time,
|
||||||
|
strlen(buf_time),
|
||||||
|
PANGO_WRAP_WORD_CHAR,
|
||||||
|
PANGO_ELLIPSIZE_NONE,
|
||||||
|
FALSE);
|
||||||
|
if (time2_format) {
|
||||||
|
strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone));
|
||||||
|
get_text_size2(time2_font_desc,
|
||||||
|
&date_height_ink,
|
||||||
|
&date_height,
|
||||||
|
&date_width,
|
||||||
|
panel->area.height,
|
||||||
|
panel->area.width,
|
||||||
|
buf_date,
|
||||||
|
strlen(buf_date),
|
||||||
|
PANGO_WRAP_WORD_CHAR,
|
||||||
|
PANGO_ELLIPSIZE_NONE,
|
||||||
|
FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
int new_size = clock_compute_desired_size(clock);
|
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
|
int new_size = (time_width > date_width) ? time_width : date_width;
|
||||||
|
new_size += 2 * clock->area.paddingxlr + left_right_border_width(&clock->area);
|
||||||
if (new_size > clock->area.width || new_size < (clock->area.width - 6)) {
|
if (new_size > clock->area.width || new_size < (clock->area.width - 6)) {
|
||||||
// we try to limit the number of resizes
|
// we try to limit the number of resizes
|
||||||
clock->area.width = new_size + 1;
|
clock->area.width = new_size + 1;
|
||||||
@@ -333,6 +290,7 @@ gboolean resize_clock(void *obj)
|
|||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
int new_size = time_height + date_height + 2 * clock->area.paddingxlr + top_bottom_border_width(&clock->area);
|
||||||
if (new_size != clock->area.height) {
|
if (new_size != clock->area.height) {
|
||||||
// we try to limit the number of resizes
|
// we try to limit the number of resizes
|
||||||
clock->area.height = new_size;
|
clock->area.height = new_size;
|
||||||
@@ -381,10 +339,21 @@ void draw_clock(void *obj, cairo_t *c)
|
|||||||
void clock_dump_geometry(void *obj, int indent)
|
void clock_dump_geometry(void *obj, int indent)
|
||||||
{
|
{
|
||||||
Clock *clock = (Clock *)obj;
|
Clock *clock = (Clock *)obj;
|
||||||
fprintf(stderr, "%*sText 1: y = %d, text = %s\n", indent, "", clock->time1_posy, buf_time);
|
fprintf(stderr,
|
||||||
|
"%*sText 1: y = %d, text = %s\n",
|
||||||
|
indent,
|
||||||
|
"",
|
||||||
|
clock->time1_posy,
|
||||||
|
buf_time);
|
||||||
if (time2_format) {
|
if (time2_format) {
|
||||||
fprintf(stderr, "%*sText 2: y = %d, text = %s\n", indent, "", clock->time2_posy, buf_date);
|
fprintf(stderr,
|
||||||
|
"%*sText 2: y = %d, text = %s\n",
|
||||||
|
indent,
|
||||||
|
"",
|
||||||
|
clock->time2_posy,
|
||||||
|
buf_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *clock_get_tooltip(void *obj)
|
char *clock_get_tooltip(void *obj)
|
||||||
|
|||||||
+9
-129
@@ -31,14 +31,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
#include <pango/pango-font.h>
|
#include <pango/pangocairo.h>
|
||||||
|
#include <pango/pangoxft.h>
|
||||||
#include <Imlib2.h>
|
#include <Imlib2.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifndef TINT2CONF
|
#ifndef TINT2CONF
|
||||||
|
|
||||||
#include "tint2rc.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "strnatcmp.h"
|
#include "strnatcmp.h"
|
||||||
@@ -52,7 +52,6 @@
|
|||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "tooltip.h"
|
#include "tooltip.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "separator.h"
|
|
||||||
#include "execplugin.h"
|
#include "execplugin.h"
|
||||||
|
|
||||||
#ifdef ENABLE_BATTERY
|
#ifdef ENABLE_BATTERY
|
||||||
@@ -203,15 +202,6 @@ void load_launcher_app_dir(const char *path)
|
|||||||
g_list_free(files);
|
g_list_free(files);
|
||||||
}
|
}
|
||||||
|
|
||||||
Separator *get_or_create_last_separator()
|
|
||||||
{
|
|
||||||
if (!panel_config.separator_list) {
|
|
||||||
fprintf(stderr, "Warning: separator items should shart with 'separator = new'\n");
|
|
||||||
panel_config.separator_list = g_list_append(panel_config.separator_list, create_separator());
|
|
||||||
}
|
|
||||||
return (Separator *)g_list_last(panel_config.separator_list)->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
Execp *get_or_create_last_execp()
|
Execp *get_or_create_last_execp()
|
||||||
{
|
{
|
||||||
if (!panel_config.execp_list) {
|
if (!panel_config.execp_list) {
|
||||||
@@ -243,10 +233,10 @@ void add_entry(char *key, char *value)
|
|||||||
init_background(&bg);
|
init_background(&bg);
|
||||||
bg.border.radius = atoi(value);
|
bg.border.radius = atoi(value);
|
||||||
g_array_append_val(backgrounds, bg);
|
g_array_append_val(backgrounds, bg);
|
||||||
read_bg_color_hover = FALSE;
|
read_bg_color_hover = 0;
|
||||||
read_border_color_hover = FALSE;
|
read_border_color_hover = 0;
|
||||||
read_bg_color_press = FALSE;
|
read_bg_color_press = 0;
|
||||||
read_border_color_press = FALSE;
|
read_border_color_press = 0;
|
||||||
} else if (strcmp(key, "border_width") == 0) {
|
} else if (strcmp(key, "border_width") == 0) {
|
||||||
g_array_index(backgrounds, Background, backgrounds->len - 1).border.width = atoi(value);
|
g_array_index(backgrounds, Background, backgrounds->len - 1).border.width = atoi(value);
|
||||||
} else if (strcmp(key, "border_sides") == 0) {
|
} else if (strcmp(key, "border_sides") == 0) {
|
||||||
@@ -314,59 +304,6 @@ void add_entry(char *key, char *value)
|
|||||||
else
|
else
|
||||||
bg->border_color_pressed.alpha = 0.5;
|
bg->border_color_pressed.alpha = 0.5;
|
||||||
read_border_color_press = 1;
|
read_border_color_press = 1;
|
||||||
} else if (strcmp(key, "gradient_id") == 0) {
|
|
||||||
Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
|
|
||||||
int id = atoi(value);
|
|
||||||
id = (id < gradients->len && id >= 0) ? id : -1;
|
|
||||||
if (id >= 0)
|
|
||||||
bg->gradients[MOUSE_NORMAL] = &g_array_index(gradients, GradientClass, id);
|
|
||||||
} else if (strcmp(key, "gradient_id_hover") == 0 || strcmp(key, "hover_gradient_id") == 0) {
|
|
||||||
Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
|
|
||||||
int id = atoi(value);
|
|
||||||
id = (id < gradients->len && id >= 0) ? id : -1;
|
|
||||||
if (id >= 0)
|
|
||||||
bg->gradients[MOUSE_OVER] = &g_array_index(gradients, GradientClass, id);
|
|
||||||
} else if (strcmp(key, "gradient_id_pressed") == 0 || strcmp(key, "pressed_gradient_id") == 0) {
|
|
||||||
Background *bg = &g_array_index(backgrounds, Background, backgrounds->len - 1);
|
|
||||||
int id = atoi(value);
|
|
||||||
id = (id < gradients->len && id >= 0) ? id : -1;
|
|
||||||
if (id >= 0)
|
|
||||||
bg->gradients[MOUSE_DOWN] = &g_array_index(gradients, GradientClass, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Gradients */
|
|
||||||
else if (strcmp(key, "gradient") == 0) {
|
|
||||||
// Create a new gradient
|
|
||||||
GradientClass g;
|
|
||||||
init_gradient(&g, gradient_type_from_string(value));
|
|
||||||
g_array_append_val(gradients, g);
|
|
||||||
} else if (strcmp(key, "start_color") == 0) {
|
|
||||||
GradientClass *g = &g_array_index(gradients, GradientClass, gradients->len - 1);
|
|
||||||
extract_values(value, &value1, &value2, &value3);
|
|
||||||
get_color(value1, g->start_color.rgb);
|
|
||||||
if (value2)
|
|
||||||
g->start_color.alpha = (atoi(value2) / 100.0);
|
|
||||||
else
|
|
||||||
g->start_color.alpha = 0.5;
|
|
||||||
} else if (strcmp(key, "end_color") == 0) {
|
|
||||||
GradientClass *g = &g_array_index(gradients, GradientClass, gradients->len - 1);
|
|
||||||
extract_values(value, &value1, &value2, &value3);
|
|
||||||
get_color(value1, g->end_color.rgb);
|
|
||||||
if (value2)
|
|
||||||
g->end_color.alpha = (atoi(value2) / 100.0);
|
|
||||||
else
|
|
||||||
g->end_color.alpha = 0.5;
|
|
||||||
} else if (strcmp(key, "color_stop") == 0) {
|
|
||||||
GradientClass *g = &g_array_index(gradients, GradientClass, gradients->len - 1);
|
|
||||||
extract_values(value, &value1, &value2, &value3);
|
|
||||||
ColorStop *color_stop = (ColorStop *) calloc(1, sizeof(ColorStop));
|
|
||||||
color_stop->offset = atof(value1) / 100.0;
|
|
||||||
get_color(value2, color_stop->color.rgb);
|
|
||||||
if (value3)
|
|
||||||
color_stop->color.alpha = (atoi(value3) / 100.0);
|
|
||||||
else
|
|
||||||
color_stop->color.alpha = 0.5;
|
|
||||||
g->extra_color_stops = g_list_append(g->extra_color_stops, color_stop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Panel */
|
/* Panel */
|
||||||
@@ -374,8 +311,6 @@ void add_entry(char *key, char *value)
|
|||||||
panel_config.monitor = config_get_monitor(value);
|
panel_config.monitor = config_get_monitor(value);
|
||||||
} else if (strcmp(key, "primary_monitor_first") == 0) {
|
} else if (strcmp(key, "primary_monitor_first") == 0) {
|
||||||
primary_monitor_first = atoi(value);
|
primary_monitor_first = atoi(value);
|
||||||
} else if (strcmp(key, "panel_shrink") == 0) {
|
|
||||||
panel_shrink = atoi(value);
|
|
||||||
} else if (strcmp(key, "panel_size") == 0) {
|
} else if (strcmp(key, "panel_size") == 0) {
|
||||||
extract_values(value, &value1, &value2, &value3);
|
extract_values(value, &value1, &value2, &value3);
|
||||||
|
|
||||||
@@ -592,45 +527,6 @@ void add_entry(char *key, char *value)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Separator */
|
|
||||||
else if (strcmp(key, "separator") == 0) {
|
|
||||||
panel_config.separator_list = g_list_append(panel_config.separator_list, create_separator());
|
|
||||||
} else if (strcmp(key, "separator_background_id") == 0) {
|
|
||||||
Separator *separator = get_or_create_last_separator();
|
|
||||||
int id = atoi(value);
|
|
||||||
id = (id < backgrounds->len && id >= 0) ? id : 0;
|
|
||||||
separator->area.bg = &g_array_index(backgrounds, Background, id);
|
|
||||||
} else if (strcmp(key, "separator_color") == 0) {
|
|
||||||
Separator *separator = get_or_create_last_separator();
|
|
||||||
extract_values(value, &value1, &value2, &value3);
|
|
||||||
get_color(value1, separator->color.rgb);
|
|
||||||
if (value2)
|
|
||||||
separator->color.alpha = (atoi(value2) / 100.0);
|
|
||||||
else
|
|
||||||
separator->color.alpha = 0.5;
|
|
||||||
} else if (strcmp(key, "separator_style") == 0) {
|
|
||||||
Separator *separator = get_or_create_last_separator();
|
|
||||||
if (g_str_equal(value, "empty"))
|
|
||||||
separator->style = SEPARATOR_EMPTY;
|
|
||||||
else if (g_str_equal(value, "line"))
|
|
||||||
separator->style = SEPARATOR_LINE;
|
|
||||||
else if (g_str_equal(value, "dots"))
|
|
||||||
separator->style = SEPARATOR_DOTS;
|
|
||||||
else
|
|
||||||
fprintf(stderr, RED "Invalid separator_style value: %s" RESET "\n", value);
|
|
||||||
} else if (strcmp(key, "separator_size") == 0) {
|
|
||||||
Separator *separator = get_or_create_last_separator();
|
|
||||||
separator->thickness = atoi(value);
|
|
||||||
} else if (strcmp(key, "separator_padding") == 0) {
|
|
||||||
Separator *separator = get_or_create_last_separator();
|
|
||||||
extract_values(value, &value1, &value2, &value3);
|
|
||||||
separator->area.paddingxlr = separator->area.paddingx = atoi(value1);
|
|
||||||
if (value2)
|
|
||||||
separator->area.paddingy = atoi(value2);
|
|
||||||
if (value3)
|
|
||||||
separator->area.paddingx = atoi(value3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Execp */
|
/* Execp */
|
||||||
else if (strcmp(key, "execp") == 0) {
|
else if (strcmp(key, "execp") == 0) {
|
||||||
panel_config.execp_list = g_list_append(panel_config.execp_list, create_execp());
|
panel_config.execp_list = g_list_append(panel_config.execp_list, create_execp());
|
||||||
@@ -875,8 +771,6 @@ void add_entry(char *key, char *value)
|
|||||||
hide_inactive_tasks = atoi(value);
|
hide_inactive_tasks = atoi(value);
|
||||||
} else if (strcmp(key, "taskbar_hide_different_monitor") == 0) {
|
} else if (strcmp(key, "taskbar_hide_different_monitor") == 0) {
|
||||||
hide_task_diff_monitor = atoi(value);
|
hide_task_diff_monitor = atoi(value);
|
||||||
} else if (strcmp(key, "taskbar_hide_if_empty") == 0) {
|
|
||||||
hide_taskbar_if_empty = atoi(value);
|
|
||||||
} else if (strcmp(key, "taskbar_always_show_all_desktop_tasks") == 0) {
|
} else if (strcmp(key, "taskbar_always_show_all_desktop_tasks") == 0) {
|
||||||
always_show_all_desktop_tasks = atoi(value);
|
always_show_all_desktop_tasks = atoi(value);
|
||||||
} else if (strcmp(key, "taskbar_sort_order") == 0) {
|
} else if (strcmp(key, "taskbar_sort_order") == 0) {
|
||||||
@@ -1010,10 +904,6 @@ void add_entry(char *key, char *value)
|
|||||||
systray.brightness = atoi(value3);
|
systray.brightness = atoi(value3);
|
||||||
} else if (strcmp(key, "systray_monitor") == 0) {
|
} else if (strcmp(key, "systray_monitor") == 0) {
|
||||||
systray_monitor = atoi(value) - 1;
|
systray_monitor = atoi(value) - 1;
|
||||||
} else if (strcmp(key, "systray_name_filter") == 0) {
|
|
||||||
if (systray_hide_name_filter)
|
|
||||||
free(systray_hide_name_filter);
|
|
||||||
systray_hide_name_filter = strdup(value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Launcher */
|
/* Launcher */
|
||||||
@@ -1244,13 +1134,6 @@ gboolean config_read_default_path()
|
|||||||
g_free(path1);
|
g_free(path1);
|
||||||
|
|
||||||
// copy tint2rc from system directory to user directory
|
// copy tint2rc from system directory to user directory
|
||||||
|
|
||||||
fprintf(stderr, "tint2 warning: could not find a config file! Creating a default one.\n");
|
|
||||||
// According to the XDG Base Directory Specification (https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html)
|
|
||||||
// if the user's config directory does not exist, we should create it with permissions set to 0700.
|
|
||||||
if (!g_file_test(g_get_user_config_dir(), G_FILE_TEST_IS_DIR))
|
|
||||||
g_mkdir(g_get_user_config_dir(), 0700);
|
|
||||||
|
|
||||||
gchar *path2 = 0;
|
gchar *path2 = 0;
|
||||||
system_dirs = g_get_system_config_dirs();
|
system_dirs = g_get_system_config_dirs();
|
||||||
for (int i = 0; system_dirs[i]; i++) {
|
for (int i = 0; system_dirs[i]; i++) {
|
||||||
@@ -1279,18 +1162,15 @@ gboolean config_read_default_path()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate config file
|
// generate empty config file
|
||||||
|
fprintf(stderr, "tint2 warning: could not find a config file!\n");
|
||||||
gchar *dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL);
|
gchar *dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL);
|
||||||
if (!g_file_test(dir, G_FILE_TEST_IS_DIR))
|
if (!g_file_test(dir, G_FILE_TEST_IS_DIR))
|
||||||
g_mkdir(dir, 0700);
|
g_mkdir(dir, 0700);
|
||||||
g_free(dir);
|
g_free(dir);
|
||||||
|
|
||||||
path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL);
|
path1 = g_build_filename(g_get_user_config_dir(), "tint2", "tint2rc", NULL);
|
||||||
FILE *f = fopen(path1, "w");
|
copy_file("/dev/null", path1);
|
||||||
if (f) {
|
|
||||||
fwrite(themes_tint2rc, 1, themes_tint2rc_len, f);
|
|
||||||
fclose(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean result = config_read_file(path1);
|
gboolean result = config_read_file(path1);
|
||||||
config_path = strdup(path1);
|
config_path = strdup(path1);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
void execp_timer_callback(void *arg);
|
void execp_timer_callback(void *arg);
|
||||||
char *execp_get_tooltip(void *obj);
|
char *execp_get_tooltip(void *obj);
|
||||||
void execp_init_fonts();
|
void execp_init_fonts();
|
||||||
int execp_compute_desired_size(void *obj);
|
|
||||||
void execp_dump_geometry(void *obj, int indent);
|
void execp_dump_geometry(void *obj, int indent);
|
||||||
|
|
||||||
void default_execp()
|
void default_execp()
|
||||||
@@ -166,7 +165,6 @@ void init_execp_panel(void *p)
|
|||||||
execp->area.parent = panel;
|
execp->area.parent = panel;
|
||||||
execp->area.panel = panel;
|
execp->area.panel = panel;
|
||||||
execp->area._dump_geometry = execp_dump_geometry;
|
execp->area._dump_geometry = execp_dump_geometry;
|
||||||
execp->area._compute_desired_size = execp_compute_desired_size;
|
|
||||||
snprintf(execp->area.name,
|
snprintf(execp->area.name,
|
||||||
sizeof(execp->area.name),
|
sizeof(execp->area.name),
|
||||||
"Execp %s",
|
"Execp %s",
|
||||||
@@ -184,7 +182,6 @@ void init_execp_panel(void *p)
|
|||||||
|
|
||||||
execp->area.resize_needed = TRUE;
|
execp->area.resize_needed = TRUE;
|
||||||
execp->area.on_screen = TRUE;
|
execp->area.on_screen = TRUE;
|
||||||
instantiate_area_gradients(&execp->area);
|
|
||||||
|
|
||||||
if (!execp->backend->timer)
|
if (!execp->backend->timer)
|
||||||
execp->backend->timer = add_timeout(10, 0, execp_timer_callback, execp, &execp->backend->timer);
|
execp->backend->timer = add_timeout(10, 0, execp_timer_callback, execp, &execp->backend->timer);
|
||||||
@@ -226,7 +223,7 @@ void execp_default_font_changed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup_execp()
|
void cleanup_execp()
|
||||||
@@ -290,86 +287,16 @@ gboolean reload_icon(Execp *execp)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int execp_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Execp *execp = (Execp *)obj;
|
|
||||||
Panel *panel = (Panel *)execp->area.panel;
|
|
||||||
int horiz_padding = (panel_horizontal ? execp->area.paddingxlr : execp->area.paddingy);
|
|
||||||
int vert_padding = (panel_horizontal ? execp->area.paddingy : execp->area.paddingxlr);
|
|
||||||
int interior_padding = execp->area.paddingx;
|
|
||||||
|
|
||||||
int icon_w, icon_h;
|
|
||||||
if (reload_icon(execp)) {
|
|
||||||
if (execp->backend->icon) {
|
|
||||||
imlib_context_set_image(execp->backend->icon);
|
|
||||||
icon_w = imlib_image_get_width();
|
|
||||||
icon_h = imlib_image_get_height();
|
|
||||||
} else {
|
|
||||||
icon_w = icon_h = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
icon_w = icon_h = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int text_next_line = !panel_horizontal && icon_w > execp->area.width / 2;
|
|
||||||
|
|
||||||
int txt_height_ink, txt_height, txt_width;
|
|
||||||
if (panel_horizontal) {
|
|
||||||
get_text_size2(execp->backend->font_desc,
|
|
||||||
&txt_height_ink,
|
|
||||||
&txt_height,
|
|
||||||
&txt_width,
|
|
||||||
panel->area.height,
|
|
||||||
panel->area.width,
|
|
||||||
execp->backend->text,
|
|
||||||
strlen(execp->backend->text),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
execp->backend->has_markup);
|
|
||||||
} else {
|
|
||||||
get_text_size2(execp->backend->font_desc,
|
|
||||||
&txt_height_ink,
|
|
||||||
&txt_height,
|
|
||||||
&txt_width,
|
|
||||||
panel->area.height,
|
|
||||||
!text_next_line
|
|
||||||
? execp->area.width - icon_w - (icon_w ? interior_padding : 0) - 2 * horiz_padding -
|
|
||||||
left_right_border_width(&execp->area)
|
|
||||||
: execp->area.width - 2 * horiz_padding - left_right_border_width(&execp->area),
|
|
||||||
execp->backend->text,
|
|
||||||
strlen(execp->backend->text),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
execp->backend->has_markup);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel_horizontal) {
|
|
||||||
int new_size = txt_width;
|
|
||||||
if (icon_w)
|
|
||||||
new_size += interior_padding + icon_w;
|
|
||||||
new_size += 2 * horiz_padding + left_right_border_width(&execp->area);
|
|
||||||
return new_size;
|
|
||||||
} else {
|
|
||||||
int new_size;
|
|
||||||
if (!text_next_line) {
|
|
||||||
new_size = txt_height + 2 * vert_padding + top_bottom_border_width(&execp->area);
|
|
||||||
new_size = MAX(new_size, icon_h + 2 * vert_padding + top_bottom_border_width(&execp->area));
|
|
||||||
} else {
|
|
||||||
new_size =
|
|
||||||
icon_h + interior_padding + txt_height + 2 * vert_padding + top_bottom_border_width(&execp->area);
|
|
||||||
}
|
|
||||||
return new_size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_execp(void *obj)
|
gboolean resize_execp(void *obj)
|
||||||
{
|
{
|
||||||
Execp *execp = (Execp *)obj;
|
Execp *execp = obj;
|
||||||
Panel *panel = (Panel *)execp->area.panel;
|
Panel *panel = execp->area.panel;
|
||||||
int horiz_padding = (panel_horizontal ? execp->area.paddingxlr : execp->area.paddingy);
|
int horiz_padding = (panel_horizontal ? execp->area.paddingxlr : execp->area.paddingy);
|
||||||
int vert_padding = (panel_horizontal ? execp->area.paddingy : execp->area.paddingxlr);
|
int vert_padding = (panel_horizontal ? execp->area.paddingy : execp->area.paddingxlr);
|
||||||
int interior_padding = execp->area.paddingx;
|
int interior_padding = execp->area.paddingx;
|
||||||
|
|
||||||
|
schedule_redraw(&execp->area);
|
||||||
|
|
||||||
int icon_w, icon_h;
|
int icon_w, icon_h;
|
||||||
if (reload_icon(execp)) {
|
if (reload_icon(execp)) {
|
||||||
if (execp->backend->icon) {
|
if (execp->backend->icon) {
|
||||||
@@ -478,8 +405,6 @@ gboolean resize_execp(void *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
schedule_redraw(&execp->area);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-45
@@ -30,57 +30,31 @@
|
|||||||
#include "freespace.h"
|
#include "freespace.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
int freespace_area_compute_desired_size(void *obj);
|
|
||||||
|
|
||||||
void init_freespace_panel(void *p)
|
void init_freespace_panel(void *p)
|
||||||
{
|
{
|
||||||
Panel *panel = (Panel *)p;
|
Panel *panel = (Panel *)p;
|
||||||
|
FreeSpace *freespace = &panel->freespace;
|
||||||
|
|
||||||
// Make sure this is only done once if there are multiple items
|
if (!freespace->area.bg)
|
||||||
if (panel->freespace_list)
|
freespace->area.bg = &g_array_index(backgrounds, Background, 0);
|
||||||
return;
|
freespace->area.parent = p;
|
||||||
|
freespace->area.panel = p;
|
||||||
for (size_t k = 0; k < strlen(panel_items_order); k++) {
|
snprintf(freespace->area.name, sizeof(freespace->area.name), "Freespace");
|
||||||
if (panel_items_order[k] == 'F') {
|
freespace->area.size_mode = LAYOUT_FIXED;
|
||||||
FreeSpace *freespace = (FreeSpace *) calloc(1, sizeof(FreeSpace));
|
freespace->area.resize_needed = 1;
|
||||||
panel->freespace_list = g_list_append(panel->freespace_list, freespace);
|
freespace->area.on_screen = TRUE;
|
||||||
if (!freespace->area.bg)
|
freespace->area._resize = resize_freespace;
|
||||||
freespace->area.bg = &g_array_index(backgrounds, Background, 0);
|
|
||||||
freespace->area.parent = p;
|
|
||||||
freespace->area.panel = p;
|
|
||||||
snprintf(freespace->area.name, sizeof(freespace->area.name), "Freespace");
|
|
||||||
freespace->area.size_mode = LAYOUT_FIXED;
|
|
||||||
freespace->area.resize_needed = 1;
|
|
||||||
freespace->area.on_screen = TRUE;
|
|
||||||
freespace->area._resize = resize_freespace;
|
|
||||||
freespace->area._compute_desired_size = freespace_area_compute_desired_size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cleanup_freespace(Panel *panel)
|
|
||||||
{
|
|
||||||
if (panel->freespace_list)
|
|
||||||
g_list_free_full(panel->freespace_list, free);
|
|
||||||
panel->freespace_list = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int freespace_get_max_size(Panel *p)
|
int freespace_get_max_size(Panel *p)
|
||||||
{
|
{
|
||||||
if (panel_shrink)
|
|
||||||
return 0;
|
|
||||||
// Get space used by every element except the freespace
|
// Get space used by every element except the freespace
|
||||||
int size = 0;
|
int size = 0;
|
||||||
int spacers = 0;
|
|
||||||
for (GList *walk = p->area.children; walk; walk = g_list_next(walk)) {
|
for (GList *walk = p->area.children; walk; walk = g_list_next(walk)) {
|
||||||
Area *a = (Area *)walk->data;
|
Area *a = (Area *)walk->data;
|
||||||
|
|
||||||
if (!a->on_screen)
|
if (a->_resize == resize_freespace || !a->on_screen)
|
||||||
continue;
|
continue;
|
||||||
if (a->_resize == resize_freespace) {
|
|
||||||
spacers++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel_horizontal)
|
if (panel_horizontal)
|
||||||
size += a->width + p->area.paddingx;
|
size += a->width + p->area.paddingx;
|
||||||
@@ -93,13 +67,7 @@ int freespace_get_max_size(Panel *p)
|
|||||||
else
|
else
|
||||||
size = p->area.height - size - top_bottom_border_width(&p->area) - p->area.paddingxlr;
|
size = p->area.height - size - top_bottom_border_width(&p->area) - p->area.paddingxlr;
|
||||||
|
|
||||||
return size / spacers;
|
return size;
|
||||||
}
|
|
||||||
|
|
||||||
int freespace_area_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
FreeSpace *freespace = (FreeSpace *) obj;
|
|
||||||
return freespace_get_max_size((Panel *)freespace->area.panel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean resize_freespace(void *obj)
|
gboolean resize_freespace(void *obj)
|
||||||
@@ -121,6 +89,6 @@ gboolean resize_freespace(void *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
schedule_redraw(&freespace->area);
|
schedule_redraw(&freespace->area);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ typedef struct FreeSpace {
|
|||||||
Area area;
|
Area area;
|
||||||
} FreeSpace;
|
} FreeSpace;
|
||||||
|
|
||||||
struct Panel;
|
void cleanup_freespace();
|
||||||
|
|
||||||
void cleanup_freespace(struct Panel *panel);
|
|
||||||
void init_freespace_panel(void *panel);
|
void init_freespace_panel(void *panel);
|
||||||
|
|
||||||
gboolean resize_freespace(void *obj);
|
gboolean resize_freespace(void *obj);
|
||||||
|
|||||||
+13
-15
@@ -110,7 +110,7 @@ void expand_exec(DesktopEntry *entry, const char *path)
|
|||||||
|
|
||||||
gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
|
gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
|
||||||
{
|
{
|
||||||
entry->name = entry->generic_name = entry->icon = entry->exec = entry->cwd = NULL;
|
entry->name = entry->generic_name = entry->icon = entry->exec = NULL;
|
||||||
entry->hidden_from_menus = FALSE;
|
entry->hidden_from_menus = FALSE;
|
||||||
|
|
||||||
FILE *fp = fopen(path, "rt");
|
FILE *fp = fopen(path, "rt");
|
||||||
@@ -185,8 +185,6 @@ gboolean read_desktop_file_full_path(const char *path, DesktopEntry *entry)
|
|||||||
}
|
}
|
||||||
} else if (!entry->exec && strcmp(key, "Exec") == 0) {
|
} else if (!entry->exec && strcmp(key, "Exec") == 0) {
|
||||||
entry->exec = strdup(value);
|
entry->exec = strdup(value);
|
||||||
} else if (!entry->cwd && strcmp(key, "Path") == 0) {
|
|
||||||
entry->cwd = strdup(value);
|
|
||||||
} else if (!entry->icon && strcmp(key, "Icon") == 0) {
|
} else if (!entry->icon && strcmp(key, "Icon") == 0) {
|
||||||
entry->icon = strdup(value);
|
entry->icon = strdup(value);
|
||||||
} else if (strcmp(key, "NoDisplay") == 0) {
|
} else if (strcmp(key, "NoDisplay") == 0) {
|
||||||
@@ -211,11 +209,11 @@ gboolean read_desktop_file_from_dir(const char *path, const char *file_name, Des
|
|||||||
g_free(full_path);
|
g_free(full_path);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
free_and_null(entry->name);
|
free(entry->name);
|
||||||
free_and_null(entry->generic_name);
|
free(entry->generic_name);
|
||||||
free_and_null(entry->icon);
|
free(entry->icon);
|
||||||
free_and_null(entry->exec);
|
free(entry->exec);
|
||||||
free_and_null(entry->cwd);
|
entry->name = entry->generic_name = entry->icon = entry->exec = NULL;
|
||||||
|
|
||||||
GList *subdirs = NULL;
|
GList *subdirs = NULL;
|
||||||
|
|
||||||
@@ -254,7 +252,7 @@ gboolean read_desktop_file_from_dir(const char *path, const char *file_name, Des
|
|||||||
gboolean read_desktop_file(const char *path, DesktopEntry *entry)
|
gboolean read_desktop_file(const char *path, DesktopEntry *entry)
|
||||||
{
|
{
|
||||||
entry->path = strdup(path);
|
entry->path = strdup(path);
|
||||||
entry->name = entry->generic_name = entry->icon = entry->exec = entry->cwd = NULL;
|
entry->name = entry->generic_name = entry->icon = entry->exec = NULL;
|
||||||
|
|
||||||
if (strchr(path, '/'))
|
if (strchr(path, '/'))
|
||||||
return read_desktop_file_full_path(path, entry);
|
return read_desktop_file_full_path(path, entry);
|
||||||
@@ -267,12 +265,12 @@ gboolean read_desktop_file(const char *path, DesktopEntry *entry)
|
|||||||
|
|
||||||
void free_desktop_entry(DesktopEntry *entry)
|
void free_desktop_entry(DesktopEntry *entry)
|
||||||
{
|
{
|
||||||
free_and_null(entry->name);
|
free(entry->name);
|
||||||
free_and_null(entry->generic_name);
|
free(entry->generic_name);
|
||||||
free_and_null(entry->icon);
|
free(entry->icon);
|
||||||
free_and_null(entry->exec);
|
free(entry->exec);
|
||||||
free_and_null(entry->path);
|
free(entry->path);
|
||||||
free_and_null(entry->cwd);
|
entry->name = entry->generic_name = entry->icon = entry->exec = entry->path = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_read_desktop_file()
|
void test_read_desktop_file()
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ typedef struct DesktopEntry {
|
|||||||
char *exec;
|
char *exec;
|
||||||
char *icon;
|
char *icon;
|
||||||
char *path;
|
char *path;
|
||||||
char *cwd;
|
|
||||||
gboolean hidden_from_menus;
|
gboolean hidden_from_menus;
|
||||||
} DesktopEntry;
|
} DesktopEntry;
|
||||||
|
|
||||||
|
|||||||
+57
-127
@@ -30,6 +30,7 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
@@ -52,7 +53,6 @@ char *icon_theme_name_xsettings;
|
|||||||
int launcher_icon_theme_override;
|
int launcher_icon_theme_override;
|
||||||
int startup_notifications;
|
int startup_notifications;
|
||||||
Background *launcher_icon_bg;
|
Background *launcher_icon_bg;
|
||||||
GList *launcher_icon_gradients;
|
|
||||||
|
|
||||||
Imlib_Image scale_icon(Imlib_Image original, int icon_size);
|
Imlib_Image scale_icon(Imlib_Image original, int icon_size);
|
||||||
void free_icon(Imlib_Image icon);
|
void free_icon(Imlib_Image icon);
|
||||||
@@ -61,7 +61,6 @@ void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon);
|
|||||||
void launcher_reload_icon_image(Launcher *launcher, LauncherIcon *launcherIcon);
|
void launcher_reload_icon_image(Launcher *launcher, LauncherIcon *launcherIcon);
|
||||||
void launcher_reload_hidden_icons(Launcher *launcher);
|
void launcher_reload_hidden_icons(Launcher *launcher);
|
||||||
void launcher_icon_on_change_layout(void *obj);
|
void launcher_icon_on_change_layout(void *obj);
|
||||||
int launcher_compute_desired_size(void *obj);
|
|
||||||
|
|
||||||
void default_launcher()
|
void default_launcher()
|
||||||
{
|
{
|
||||||
@@ -76,7 +75,6 @@ void default_launcher()
|
|||||||
launcher_icon_theme_override = 0;
|
launcher_icon_theme_override = 0;
|
||||||
startup_notifications = 0;
|
startup_notifications = 0;
|
||||||
launcher_icon_bg = NULL;
|
launcher_icon_bg = NULL;
|
||||||
launcher_icon_gradients = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_launcher()
|
void init_launcher()
|
||||||
@@ -94,7 +92,6 @@ void init_launcher_panel(void *p)
|
|||||||
launcher->area._draw_foreground = NULL;
|
launcher->area._draw_foreground = NULL;
|
||||||
launcher->area.size_mode = LAYOUT_FIXED;
|
launcher->area.size_mode = LAYOUT_FIXED;
|
||||||
launcher->area._resize = resize_launcher;
|
launcher->area._resize = resize_launcher;
|
||||||
launcher->area._compute_desired_size = launcher_compute_desired_size;
|
|
||||||
launcher->area.resize_needed = 1;
|
launcher->area.resize_needed = 1;
|
||||||
schedule_redraw(&launcher->area);
|
schedule_redraw(&launcher->area);
|
||||||
if (!launcher->area.bg)
|
if (!launcher->area.bg)
|
||||||
@@ -107,12 +104,8 @@ void init_launcher_panel(void *p)
|
|||||||
if (launcher->list_apps == NULL)
|
if (launcher->list_apps == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// This will be recomputed on resize, we just initialize to a non-zero value
|
|
||||||
launcher->icon_size = launcher_max_icon_size > 0 ? launcher_max_icon_size : 24;
|
|
||||||
|
|
||||||
launcher->area.on_screen = TRUE;
|
launcher->area.on_screen = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
instantiate_area_gradients(&launcher->area);
|
|
||||||
|
|
||||||
launcher_load_themes(launcher);
|
launcher_load_themes(launcher);
|
||||||
launcher_load_icons(launcher);
|
launcher_load_icons(launcher);
|
||||||
@@ -165,82 +158,27 @@ void cleanup_launcher_theme(Launcher *launcher)
|
|||||||
launcher->icon_theme_wrapper = NULL;
|
launcher->icon_theme_wrapper = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int launcher_compute_icon_size(Launcher *launcher)
|
gboolean resize_launcher(void *obj)
|
||||||
{
|
{
|
||||||
int icon_size = panel_horizontal ? launcher->area.height : launcher->area.width;
|
Launcher *launcher = obj;
|
||||||
|
int icons_per_column = 1, icons_per_row = 1, margin = 0;
|
||||||
|
|
||||||
|
int icon_size;
|
||||||
|
if (panel_horizontal) {
|
||||||
|
icon_size = launcher->area.height;
|
||||||
|
} else {
|
||||||
|
icon_size = launcher->area.width;
|
||||||
|
}
|
||||||
icon_size = icon_size - MAX(left_right_border_width(&launcher->area), top_bottom_border_width(&launcher->area)) -
|
icon_size = icon_size - MAX(left_right_border_width(&launcher->area), top_bottom_border_width(&launcher->area)) -
|
||||||
(2 * launcher->area.paddingy);
|
(2 * launcher->area.paddingy);
|
||||||
if (launcher_max_icon_size > 0 && icon_size > launcher_max_icon_size)
|
if (launcher_max_icon_size > 0 && icon_size > launcher_max_icon_size)
|
||||||
icon_size = launcher_max_icon_size;
|
icon_size = launcher_max_icon_size;
|
||||||
return icon_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
void launcher_compute_geometry(Launcher *launcher,
|
|
||||||
int *size,
|
|
||||||
int *icon_size,
|
|
||||||
int *icons_per_column,
|
|
||||||
int *icons_per_row,
|
|
||||||
int *margin)
|
|
||||||
{
|
|
||||||
int count = 0;
|
|
||||||
for (GSList *l = launcher->list_icons; l; l = l->next) {
|
|
||||||
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
|
|
||||||
if (launcherIcon->area.on_screen)
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*icon_size = launcher_compute_icon_size(launcher);
|
|
||||||
*icons_per_column = 1;
|
|
||||||
*icons_per_row = 1;
|
|
||||||
*margin = 0;
|
|
||||||
if (panel_horizontal) {
|
|
||||||
if (!count) {
|
|
||||||
*size = 0;
|
|
||||||
} else {
|
|
||||||
int height = launcher->area.height - top_bottom_border_width(&launcher->area) - 2 * launcher->area.paddingy;
|
|
||||||
// here icons_per_column always higher than 0
|
|
||||||
*icons_per_column = (height + launcher->area.paddingx) / (*icon_size + launcher->area.paddingx);
|
|
||||||
*margin = height - (*icons_per_column - 1) * (*icon_size + launcher->area.paddingx) - *icon_size;
|
|
||||||
*icons_per_row = count / *icons_per_column + (count % *icons_per_column != 0);
|
|
||||||
*size = left_right_border_width(&launcher->area) + 2 * launcher->area.paddingxlr +
|
|
||||||
(*icon_size * *icons_per_row) + ((*icons_per_row - 1) * launcher->area.paddingx);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!count) {
|
|
||||||
*size = 0;
|
|
||||||
} else {
|
|
||||||
int width = launcher->area.width - top_bottom_border_width(&launcher->area) - 2 * launcher->area.paddingy;
|
|
||||||
// here icons_per_row always higher than 0
|
|
||||||
*icons_per_row = (width + launcher->area.paddingx) / (*icon_size + launcher->area.paddingx);
|
|
||||||
*margin = width - (*icons_per_row - 1) * (*icon_size + launcher->area.paddingx) - *icon_size;
|
|
||||||
*icons_per_column = count / *icons_per_row + (count % *icons_per_row != 0);
|
|
||||||
*size = top_bottom_border_width(&launcher->area) + 2 * launcher->area.paddingxlr +
|
|
||||||
(*icon_size * *icons_per_column) + ((*icons_per_column - 1) * launcher->area.paddingx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int launcher_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Launcher *launcher = (Launcher *)obj;
|
|
||||||
|
|
||||||
int size, icon_size, icons_per_column, icons_per_row, margin;
|
|
||||||
launcher_compute_geometry(launcher, &size, &icon_size, &icons_per_column, &icons_per_row, &margin);
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_launcher(void *obj)
|
|
||||||
{
|
|
||||||
Launcher *launcher = (Launcher *)obj;
|
|
||||||
|
|
||||||
int size, icons_per_column, icons_per_row, margin;
|
|
||||||
launcher_compute_geometry(launcher, &size, &launcher->icon_size, &icons_per_column, &icons_per_row, &margin);
|
|
||||||
|
|
||||||
// Resize icons if necessary
|
// Resize icons if necessary
|
||||||
for (GSList *l = launcher->list_icons; l; l = l->next) {
|
for (GSList *l = launcher->list_icons; l; l = l->next) {
|
||||||
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
|
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
|
||||||
if (launcherIcon->icon_size != launcher->icon_size || !launcherIcon->image) {
|
if (launcherIcon->icon_size != icon_size || !launcherIcon->image) {
|
||||||
launcherIcon->icon_size = launcher->icon_size;
|
launcherIcon->icon_size = icon_size;
|
||||||
launcherIcon->area.width = launcherIcon->icon_size;
|
launcherIcon->area.width = launcherIcon->icon_size;
|
||||||
launcherIcon->area.height = launcherIcon->icon_size;
|
launcherIcon->area.height = launcherIcon->icon_size;
|
||||||
launcher_reload_icon_image(launcher, launcherIcon);
|
launcher_reload_icon_image(launcher, launcherIcon);
|
||||||
@@ -249,25 +187,35 @@ gboolean resize_launcher(void *obj)
|
|||||||
save_icon_cache(launcher->icon_theme_wrapper);
|
save_icon_cache(launcher->icon_theme_wrapper);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
gboolean needs_repositioning = FALSE;
|
|
||||||
for (GSList *l = launcher->list_icons; l; l = l->next) {
|
for (GSList *l = launcher->list_icons; l; l = l->next) {
|
||||||
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
|
LauncherIcon *launcherIcon = (LauncherIcon *)l->data;
|
||||||
if (launcherIcon->area.on_screen) {
|
if (launcherIcon->area.on_screen)
|
||||||
count++;
|
count++;
|
||||||
if (launcherIcon->area.posx < 0 || launcherIcon->area.posy < 0)
|
|
||||||
needs_repositioning = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!needs_repositioning) {
|
if (panel_horizontal) {
|
||||||
if (panel_horizontal) {
|
if (!count) {
|
||||||
if (launcher->area.width == size)
|
launcher->area.width = 0;
|
||||||
return FALSE;
|
|
||||||
launcher->area.width = size;
|
|
||||||
} else {
|
} else {
|
||||||
if (launcher->area.height == size)
|
int height = launcher->area.height - top_bottom_border_width(&launcher->area) - 2 * launcher->area.paddingy;
|
||||||
return FALSE;
|
// here icons_per_column always higher than 0
|
||||||
launcher->area.height = size;
|
icons_per_column = (height + launcher->area.paddingx) / (icon_size + launcher->area.paddingx);
|
||||||
|
margin = height - (icons_per_column - 1) * (icon_size + launcher->area.paddingx) - icon_size;
|
||||||
|
icons_per_row = count / icons_per_column + (count % icons_per_column != 0);
|
||||||
|
launcher->area.width = left_right_border_width(&launcher->area) + 2 * launcher->area.paddingxlr +
|
||||||
|
(icon_size * icons_per_row) + ((icons_per_row - 1) * launcher->area.paddingx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!count) {
|
||||||
|
launcher->area.height = 0;
|
||||||
|
} else {
|
||||||
|
int width = launcher->area.width - top_bottom_border_width(&launcher->area) - 2 * launcher->area.paddingy;
|
||||||
|
// here icons_per_row always higher than 0
|
||||||
|
icons_per_row = (width + launcher->area.paddingx) / (icon_size + launcher->area.paddingx);
|
||||||
|
margin = width - (icons_per_row - 1) * (icon_size + launcher->area.paddingx) - icon_size;
|
||||||
|
icons_per_column = count / icons_per_row + (count % icons_per_row != 0);
|
||||||
|
launcher->area.height = top_bottom_border_width(&launcher->area) + 2 * launcher->area.paddingxlr +
|
||||||
|
(icon_size * icons_per_column) + ((icons_per_column - 1) * launcher->area.paddingx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,17 +241,17 @@ gboolean resize_launcher(void *obj)
|
|||||||
// printf("launcher %d : %d,%d\n", i, posx, posy);
|
// printf("launcher %d : %d,%d\n", i, posx, posy);
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
if (i % icons_per_column) {
|
if (i % icons_per_column) {
|
||||||
posy += launcher->icon_size + launcher->area.paddingx;
|
posy += icon_size + launcher->area.paddingx;
|
||||||
} else {
|
} else {
|
||||||
posy = start;
|
posy = start;
|
||||||
posx += (launcher->icon_size + launcher->area.paddingx);
|
posx += (icon_size + launcher->area.paddingx);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (i % icons_per_row) {
|
if (i % icons_per_row) {
|
||||||
posx += launcher->icon_size + launcher->area.paddingx;
|
posx += icon_size + launcher->area.paddingx;
|
||||||
} else {
|
} else {
|
||||||
posx = start;
|
posx = start;
|
||||||
posy += (launcher->icon_size + launcher->area.paddingx);
|
posy += (icon_size + launcher->area.paddingx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -332,12 +280,6 @@ void launcher_icon_on_change_layout(void *obj)
|
|||||||
launcherIcon->area.height = launcherIcon->icon_size;
|
launcherIcon->area.height = launcherIcon->icon_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int launcher_icon_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
LauncherIcon *icon = (LauncherIcon *)obj;
|
|
||||||
return icon->icon_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *launcher_icon_get_tooltip_text(void *obj)
|
char *launcher_icon_get_tooltip_text(void *obj)
|
||||||
{
|
{
|
||||||
LauncherIcon *launcherIcon = (LauncherIcon *)obj;
|
LauncherIcon *launcherIcon = (LauncherIcon *)obj;
|
||||||
@@ -367,7 +309,12 @@ void draw_launcher_icon(void *obj, cairo_t *c)
|
|||||||
void launcher_icon_dump_geometry(void *obj, int indent)
|
void launcher_icon_dump_geometry(void *obj, int indent)
|
||||||
{
|
{
|
||||||
LauncherIcon *launcherIcon = (LauncherIcon *)obj;
|
LauncherIcon *launcherIcon = (LauncherIcon *)obj;
|
||||||
fprintf(stderr, "%*sIcon: w = h = %d, name = %s\n", indent, "", launcherIcon->icon_size, launcherIcon->icon_name);
|
fprintf(stderr,
|
||||||
|
"%*sIcon: w = h = %d, name = %s\n",
|
||||||
|
indent,
|
||||||
|
"",
|
||||||
|
launcherIcon->icon_size,
|
||||||
|
launcherIcon->icon_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Imlib_Image scale_icon(Imlib_Image original, int icon_size)
|
Imlib_Image scale_icon(Imlib_Image original, int icon_size)
|
||||||
@@ -450,8 +397,6 @@ void launcher_action(LauncherIcon *icon, XEvent *evt)
|
|||||||
// Allow children to exist after parent destruction
|
// Allow children to exist after parent destruction
|
||||||
setsid();
|
setsid();
|
||||||
// Run the command
|
// Run the command
|
||||||
if (icon->cwd)
|
|
||||||
chdir(icon->cwd);
|
|
||||||
execl("/bin/sh", "/bin/sh", "-c", icon->cmd, NULL);
|
execl("/bin/sh", "/bin/sh", "-c", icon->cmd, NULL);
|
||||||
fprintf(stderr, "Failed to execlp %s\n", icon->cmd);
|
fprintf(stderr, "Failed to execlp %s\n", icon->cmd);
|
||||||
#if HAVE_SN
|
#if HAVE_SN
|
||||||
@@ -471,29 +416,22 @@ void launcher_action(LauncherIcon *icon, XEvent *evt)
|
|||||||
free(cmd);
|
free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Populates the list_icons list from the list_apps list
|
// Populates the list_icons list from the list_apps list
|
||||||
void launcher_load_icons(Launcher *launcher)
|
void launcher_load_icons(Launcher *launcher)
|
||||||
{
|
{
|
||||||
// Load apps (.desktop style launcher items)
|
// Load apps (.desktop style launcher items)
|
||||||
GSList *app = launcher->list_apps;
|
GSList *app = launcher->list_apps;
|
||||||
int index = 0;
|
|
||||||
while (app != NULL) {
|
while (app != NULL) {
|
||||||
index++;
|
LauncherIcon *launcherIcon = calloc(1, sizeof(LauncherIcon));
|
||||||
LauncherIcon *launcherIcon = (LauncherIcon *)calloc(1, sizeof(LauncherIcon));
|
|
||||||
launcherIcon->area.panel = launcher->area.panel;
|
launcherIcon->area.panel = launcher->area.panel;
|
||||||
launcherIcon->area._draw_foreground = draw_launcher_icon;
|
launcherIcon->area._draw_foreground = draw_launcher_icon;
|
||||||
launcherIcon->area.size_mode = LAYOUT_FIXED;
|
launcherIcon->area.size_mode = LAYOUT_FIXED;
|
||||||
launcherIcon->area._resize = NULL;
|
launcherIcon->area._resize = NULL;
|
||||||
launcherIcon->area._compute_desired_size = launcher_icon_compute_desired_size;
|
|
||||||
sprintf(launcherIcon->area.name, "LauncherIcon %d", index);
|
|
||||||
launcherIcon->area.resize_needed = 0;
|
launcherIcon->area.resize_needed = 0;
|
||||||
launcherIcon->area.has_mouse_over_effect = panel_config.mouse_effects;
|
launcherIcon->area.has_mouse_over_effect = panel_config.mouse_effects;
|
||||||
launcherIcon->area.has_mouse_press_effect = launcherIcon->area.has_mouse_over_effect;
|
launcherIcon->area.has_mouse_press_effect = launcherIcon->area.has_mouse_over_effect;
|
||||||
launcherIcon->area.bg = launcher_icon_bg;
|
launcherIcon->area.bg = launcher_icon_bg;
|
||||||
launcherIcon->area.on_screen = TRUE;
|
launcherIcon->area.on_screen = TRUE;
|
||||||
launcherIcon->area.posx = -1;
|
|
||||||
launcherIcon->area._on_change_layout = launcher_icon_on_change_layout;
|
launcherIcon->area._on_change_layout = launcher_icon_on_change_layout;
|
||||||
launcherIcon->area._dump_geometry = launcher_icon_dump_geometry;
|
launcherIcon->area._dump_geometry = launcher_icon_dump_geometry;
|
||||||
if (launcher_tooltip_enabled) {
|
if (launcher_tooltip_enabled) {
|
||||||
@@ -504,9 +442,7 @@ void launcher_load_icons(Launcher *launcher)
|
|||||||
launcherIcon->config_path = strdup(app->data);
|
launcherIcon->config_path = strdup(app->data);
|
||||||
add_area(&launcherIcon->area, (Area *)launcher);
|
add_area(&launcherIcon->area, (Area *)launcher);
|
||||||
launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon);
|
launcher->list_icons = g_slist_append(launcher->list_icons, launcherIcon);
|
||||||
launcherIcon->icon_size = launcher->icon_size;
|
|
||||||
launcher_reload_icon(launcher, launcherIcon);
|
launcher_reload_icon(launcher, launcherIcon);
|
||||||
instantiate_area_gradients(&launcherIcon->area);
|
|
||||||
app = g_slist_next(app);
|
app = g_slist_next(app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -519,12 +455,6 @@ void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon)
|
|||||||
if (launcherIcon->cmd)
|
if (launcherIcon->cmd)
|
||||||
free(launcherIcon->cmd);
|
free(launcherIcon->cmd);
|
||||||
launcherIcon->cmd = strdup(entry.exec);
|
launcherIcon->cmd = strdup(entry.exec);
|
||||||
if (launcherIcon->cwd)
|
|
||||||
free(launcherIcon->cwd);
|
|
||||||
if (entry.cwd)
|
|
||||||
launcherIcon->cwd = strdup(entry.cwd);
|
|
||||||
else
|
|
||||||
launcherIcon->cwd = NULL;
|
|
||||||
if (launcherIcon->icon_name)
|
if (launcherIcon->icon_name)
|
||||||
free(launcherIcon->icon_name);
|
free(launcherIcon->icon_name);
|
||||||
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
|
launcherIcon->icon_name = entry.icon ? strdup(entry.icon) : strdup(DEFAULT_ICON);
|
||||||
@@ -542,7 +472,8 @@ void launcher_reload_icon(Launcher *launcher, LauncherIcon *launcherIcon)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
launcher_reload_icon_image(launcher, launcherIcon);
|
launcher_reload_icon_image(launcher, launcherIcon);
|
||||||
show(&launcherIcon->area);
|
if (!launcherIcon->area.on_screen)
|
||||||
|
show(&launcherIcon->area);
|
||||||
} else {
|
} else {
|
||||||
hide(&launcherIcon->area);
|
hide(&launcherIcon->area);
|
||||||
}
|
}
|
||||||
@@ -584,15 +515,14 @@ void launcher_reload_icon_image(Launcher *launcher, LauncherIcon *launcherIcon)
|
|||||||
|
|
||||||
if (panel_config.mouse_effects) {
|
if (panel_config.mouse_effects) {
|
||||||
launcherIcon->image_hover = adjust_icon(launcherIcon->image,
|
launcherIcon->image_hover = adjust_icon(launcherIcon->image,
|
||||||
panel_config.mouse_over_alpha,
|
panel_config.mouse_over_alpha,
|
||||||
panel_config.mouse_over_saturation,
|
panel_config.mouse_over_saturation,
|
||||||
panel_config.mouse_over_brightness);
|
panel_config.mouse_over_brightness);
|
||||||
launcherIcon->image_pressed = adjust_icon(launcherIcon->image,
|
launcherIcon->image_pressed = adjust_icon(launcherIcon->image,
|
||||||
panel_config.mouse_pressed_alpha,
|
panel_config.mouse_pressed_alpha,
|
||||||
panel_config.mouse_pressed_saturation,
|
panel_config.mouse_pressed_saturation,
|
||||||
panel_config.mouse_pressed_brightness);
|
panel_config.mouse_pressed_brightness);
|
||||||
}
|
}
|
||||||
schedule_redraw(&launcherIcon->area);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populates the icon_theme_wrapper list
|
// Populates the icon_theme_wrapper list
|
||||||
@@ -619,5 +549,5 @@ void launcher_default_icon_theme_changed()
|
|||||||
launcher_load_icons(launcher);
|
launcher_load_icons(launcher);
|
||||||
launcher->area.resize_needed = 1;
|
launcher->area.resize_needed = 1;
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ typedef struct Launcher {
|
|||||||
GSList *list_apps; // List of char*, each is a path to a app.desktop file
|
GSList *list_apps; // List of char*, each is a path to a app.desktop file
|
||||||
GSList *list_icons; // List of LauncherIcon*
|
GSList *list_icons; // List of LauncherIcon*
|
||||||
IconThemeWrapper *icon_theme_wrapper;
|
IconThemeWrapper *icon_theme_wrapper;
|
||||||
int icon_size;
|
|
||||||
} Launcher;
|
} Launcher;
|
||||||
|
|
||||||
typedef struct LauncherIcon {
|
typedef struct LauncherIcon {
|
||||||
@@ -29,7 +28,6 @@ typedef struct LauncherIcon {
|
|||||||
Imlib_Image image_hover;
|
Imlib_Image image_hover;
|
||||||
Imlib_Image image_pressed;
|
Imlib_Image image_pressed;
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char *cwd;
|
|
||||||
char *icon_name;
|
char *icon_name;
|
||||||
char *icon_path;
|
char *icon_path;
|
||||||
char *icon_tooltip;
|
char *icon_tooltip;
|
||||||
@@ -48,7 +46,6 @@ extern char *icon_theme_name_config;
|
|||||||
extern int launcher_icon_theme_override;
|
extern int launcher_icon_theme_override;
|
||||||
extern int startup_notifications;
|
extern int startup_notifications;
|
||||||
extern Background *launcher_icon_bg;
|
extern Background *launcher_icon_bg;
|
||||||
extern GList *launcher_icon_gradients;
|
|
||||||
|
|
||||||
// default global data
|
// default global data
|
||||||
void default_launcher();
|
void default_launcher();
|
||||||
|
|||||||
+144
-240
@@ -56,13 +56,11 @@ gboolean panel_refresh;
|
|||||||
gboolean task_dragged;
|
gboolean task_dragged;
|
||||||
char *panel_window_name = NULL;
|
char *panel_window_name = NULL;
|
||||||
gboolean debug_geometry;
|
gboolean debug_geometry;
|
||||||
gboolean debug_gradients;
|
|
||||||
|
|
||||||
gboolean panel_autohide;
|
gboolean panel_autohide;
|
||||||
int panel_autohide_show_timeout;
|
int panel_autohide_show_timeout;
|
||||||
int panel_autohide_hide_timeout;
|
int panel_autohide_hide_timeout;
|
||||||
int panel_autohide_height;
|
int panel_autohide_height;
|
||||||
gboolean panel_shrink;
|
|
||||||
Strut panel_strut_policy;
|
Strut panel_strut_policy;
|
||||||
char *panel_items_order;
|
char *panel_items_order;
|
||||||
|
|
||||||
@@ -75,7 +73,6 @@ Panel *panels;
|
|||||||
int num_panels;
|
int num_panels;
|
||||||
|
|
||||||
GArray *backgrounds;
|
GArray *backgrounds;
|
||||||
GArray *gradients;
|
|
||||||
|
|
||||||
Imlib_Image default_icon;
|
Imlib_Image default_icon;
|
||||||
char *default_font = NULL;
|
char *default_font = NULL;
|
||||||
@@ -93,7 +90,6 @@ void default_panel()
|
|||||||
panel_autohide_show_timeout = 0;
|
panel_autohide_show_timeout = 0;
|
||||||
panel_autohide_hide_timeout = 0;
|
panel_autohide_hide_timeout = 0;
|
||||||
panel_autohide_height = 5; // for vertical panels this is of course the width
|
panel_autohide_height = 5; // for vertical panels this is of course the width
|
||||||
panel_shrink = FALSE;
|
|
||||||
panel_strut_policy = STRUT_FOLLOW_SIZE;
|
panel_strut_policy = STRUT_FOLLOW_SIZE;
|
||||||
panel_dock = FALSE; // default not in the dock
|
panel_dock = FALSE; // default not in the dock
|
||||||
panel_layer = BOTTOM_LAYER; // default is bottom layer
|
panel_layer = BOTTOM_LAYER; // default is bottom layer
|
||||||
@@ -102,7 +98,6 @@ void default_panel()
|
|||||||
max_tick_urgent = 14;
|
max_tick_urgent = 14;
|
||||||
mouse_left = TOGGLE_ICONIFY;
|
mouse_left = TOGGLE_ICONIFY;
|
||||||
backgrounds = g_array_new(0, 0, sizeof(Background));
|
backgrounds = g_array_new(0, 0, sizeof(Background));
|
||||||
gradients = g_array_new(0, 0, sizeof(GradientClass));
|
|
||||||
|
|
||||||
memset(&panel_config, 0, sizeof(Panel));
|
memset(&panel_config, 0, sizeof(Panel));
|
||||||
snprintf(panel_config.area.name, sizeof(panel_config.area.name), "Panel");
|
snprintf(panel_config.area.name, sizeof(panel_config.area.name), "Panel");
|
||||||
@@ -118,9 +113,6 @@ void default_panel()
|
|||||||
Background transparent_bg;
|
Background transparent_bg;
|
||||||
init_background(&transparent_bg);
|
init_background(&transparent_bg);
|
||||||
g_array_append_val(backgrounds, transparent_bg);
|
g_array_append_val(backgrounds, transparent_bg);
|
||||||
GradientClass transparent_gradient;
|
|
||||||
init_gradient(&transparent_gradient, GRADIENT_VERTICAL);
|
|
||||||
g_array_append_val(gradients, transparent_gradient);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup_panel()
|
void cleanup_panel()
|
||||||
@@ -144,7 +136,6 @@ void cleanup_panel()
|
|||||||
XDestroyWindow(server.display, p->main_win);
|
XDestroyWindow(server.display, p->main_win);
|
||||||
p->main_win = 0;
|
p->main_win = 0;
|
||||||
stop_timeout(p->autohide_timeout);
|
stop_timeout(p->autohide_timeout);
|
||||||
cleanup_freespace(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(panel_items_order);
|
free(panel_items_order);
|
||||||
@@ -153,17 +144,9 @@ void cleanup_panel()
|
|||||||
panel_window_name = NULL;
|
panel_window_name = NULL;
|
||||||
free(panels);
|
free(panels);
|
||||||
panels = NULL;
|
panels = NULL;
|
||||||
|
if (backgrounds)
|
||||||
free_area(&panel_config.area);
|
g_array_free(backgrounds, 1);
|
||||||
|
|
||||||
g_array_free(backgrounds, TRUE);
|
|
||||||
backgrounds = NULL;
|
backgrounds = NULL;
|
||||||
if (gradients) {
|
|
||||||
for (guint i = 0; i < gradients->len; i++)
|
|
||||||
cleanup_gradient(&g_array_index(gradients, GradientClass, i));
|
|
||||||
g_array_free(gradients, TRUE);
|
|
||||||
}
|
|
||||||
gradients = NULL;
|
|
||||||
pango_font_description_free(panel_config.g_task.font_desc);
|
pango_font_description_free(panel_config.g_task.font_desc);
|
||||||
panel_config.g_task.font_desc = NULL;
|
panel_config.g_task.font_desc = NULL;
|
||||||
pango_font_description_free(panel_config.taskbarname_font_desc);
|
pango_font_description_free(panel_config.taskbarname_font_desc);
|
||||||
@@ -188,7 +171,6 @@ void init_panel()
|
|||||||
init_battery();
|
init_battery();
|
||||||
#endif
|
#endif
|
||||||
init_taskbar();
|
init_taskbar();
|
||||||
init_separator();
|
|
||||||
init_execp();
|
init_execp();
|
||||||
|
|
||||||
// number of panels (one monitor or 'all' monitors)
|
// number of panels (one monitor or 'all' monitors)
|
||||||
@@ -222,9 +204,7 @@ void init_panel()
|
|||||||
p->area.size_mode = LAYOUT_DYNAMIC;
|
p->area.size_mode = LAYOUT_DYNAMIC;
|
||||||
p->area._resize = resize_panel;
|
p->area._resize = resize_panel;
|
||||||
p->area._clear = panel_clear_background;
|
p->area._clear = panel_clear_background;
|
||||||
p->separator_list = NULL;
|
|
||||||
init_panel_size_and_position(p);
|
init_panel_size_and_position(p);
|
||||||
instantiate_area_gradients(&p->area);
|
|
||||||
// add children according to panel_items
|
// add children according to panel_items
|
||||||
for (int k = 0; k < strlen(panel_items_order); k++) {
|
for (int k = 0; k < strlen(panel_items_order); k++) {
|
||||||
if (panel_items_order[k] == 'L')
|
if (panel_items_order[k] == 'L')
|
||||||
@@ -243,8 +223,6 @@ void init_panel()
|
|||||||
init_clock_panel(p);
|
init_clock_panel(p);
|
||||||
if (panel_items_order[k] == 'F' && !strstr(panel_items_order, "T"))
|
if (panel_items_order[k] == 'F' && !strstr(panel_items_order, "T"))
|
||||||
init_freespace_panel(p);
|
init_freespace_panel(p);
|
||||||
if (panel_items_order[k] == ':')
|
|
||||||
init_separator_panel(p);
|
|
||||||
if (panel_items_order[k] == 'E')
|
if (panel_items_order[k] == 'E')
|
||||||
init_execp_panel(p);
|
init_execp_panel(p);
|
||||||
}
|
}
|
||||||
@@ -298,8 +276,9 @@ void init_panel()
|
|||||||
update_all_taskbars_visibility();
|
update_all_taskbars_visibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void panel_compute_size(Panel *panel)
|
void init_panel_size_and_position(Panel *panel)
|
||||||
{
|
{
|
||||||
|
// detect panel size
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
if (panel->area.width == 0) {
|
if (panel->area.width == 0) {
|
||||||
panel->fractional_width = TRUE;
|
panel->fractional_width = TRUE;
|
||||||
@@ -352,11 +331,6 @@ void panel_compute_size(Panel *panel)
|
|||||||
if (panel->area.height + panel->marginy > server.monitors[panel->monitor].height)
|
if (panel->area.height + panel->marginy > server.monitors[panel->monitor].height)
|
||||||
panel->area.height = server.monitors[panel->monitor].height - panel->marginy;
|
panel->area.height = server.monitors[panel->monitor].height - panel->marginy;
|
||||||
|
|
||||||
panel->max_size = panel_horizontal ? panel->area.width : panel->area.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
void panel_compute_position(Panel *panel)
|
|
||||||
{
|
|
||||||
// panel position determined here
|
// panel position determined here
|
||||||
if (panel_position & LEFT) {
|
if (panel_position & LEFT) {
|
||||||
panel->posx = server.monitors[panel->monitor].x + panel->marginx;
|
panel->posx = server.monitors[panel->monitor].x + panel->marginx;
|
||||||
@@ -397,12 +371,6 @@ void panel_compute_position(Panel *panel)
|
|||||||
// panel->area.height);
|
// panel->area.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_panel_size_and_position(Panel *panel)
|
|
||||||
{
|
|
||||||
panel_compute_size(panel);
|
|
||||||
panel_compute_position(panel);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_panel(void *obj)
|
gboolean resize_panel(void *obj)
|
||||||
{
|
{
|
||||||
Panel *panel = (Panel *)obj;
|
Panel *panel = (Panel *)obj;
|
||||||
@@ -414,117 +382,100 @@ gboolean resize_panel(void *obj)
|
|||||||
int width = panel->taskbar[server.desktop].area.width;
|
int width = panel->taskbar[server.desktop].area.width;
|
||||||
int height = panel->taskbar[server.desktop].area.height;
|
int height = panel->taskbar[server.desktop].area.height;
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
for (int i = 0; i < panel->num_desktops; i++) {
|
||||||
panel->taskbar[i].area.resize_needed =
|
|
||||||
panel->taskbar[i].area.width != width || panel->taskbar[i].area.height != height;
|
|
||||||
panel->taskbar[i].area.width = width;
|
panel->taskbar[i].area.width = width;
|
||||||
panel->taskbar[i].area.height = height;
|
panel->taskbar[i].area.height = height;
|
||||||
|
panel->taskbar[i].area.resize_needed = 1;
|
||||||
}
|
}
|
||||||
} else if (taskbar_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) {
|
}
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
if (taskbar_mode == MULTI_DESKTOP && taskbar_enabled && taskbar_distribute_size) {
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
// Distribute the available space between taskbars
|
||||||
taskbar->area.old_width = taskbar->area.width;
|
|
||||||
taskbar->area.old_height = taskbar->area.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The total available size
|
// Compute the total available size, and the total size requested by the taskbars
|
||||||
int total_size = 0;
|
int total_size = 0;
|
||||||
|
int total_name_size = 0;
|
||||||
|
int total_items = 0;
|
||||||
|
int visible_taskbars = 0;
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
for (int i = 0; i < panel->num_desktops; i++) {
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
if (!panel->taskbar[i].area.on_screen)
|
||||||
if (!taskbar->area.on_screen)
|
|
||||||
continue;
|
continue;
|
||||||
total_size += panel_horizontal ? taskbar->area.width : taskbar->area.height;
|
visible_taskbars++;
|
||||||
}
|
if (panel_horizontal) {
|
||||||
|
total_size += panel->taskbar[i].area.width;
|
||||||
// Reserve size for padding, taskbarname and spacings
|
} else {
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
total_size += panel->taskbar[i].area.height;
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
|
||||||
if (!taskbar->area.on_screen)
|
|
||||||
continue;
|
|
||||||
if (panel_horizontal)
|
|
||||||
taskbar->area.width = 2 * taskbar->area.paddingxlr;
|
|
||||||
else
|
|
||||||
taskbar->area.height = 2 * taskbar->area.paddingxlr;
|
|
||||||
if (taskbarname_enabled && taskbar->area.children) {
|
|
||||||
Area *name = (Area *)taskbar->area.children->data;
|
|
||||||
if (name->on_screen) {
|
|
||||||
if (panel_horizontal)
|
|
||||||
taskbar->area.width += name->width;
|
|
||||||
else
|
|
||||||
taskbar->area.height += name->height;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gboolean first_child = TRUE;
|
|
||||||
for (GList *l = taskbar->area.children; l; l = l->next) {
|
Taskbar *taskbar = &panel->taskbar[i];
|
||||||
|
GList *l;
|
||||||
|
for (l = taskbar->area.children; l; l = l->next) {
|
||||||
Area *child = (Area *)l->data;
|
Area *child = (Area *)l->data;
|
||||||
if (!child->on_screen)
|
if (!child->on_screen)
|
||||||
continue;
|
continue;
|
||||||
if (!first_child) {
|
total_items++;
|
||||||
if (panel_horizontal)
|
}
|
||||||
taskbar->area.width += taskbar->area.paddingx;
|
if (taskbarname_enabled) {
|
||||||
else
|
if (taskbar->area.children) {
|
||||||
taskbar->area.height += taskbar->area.paddingy;
|
total_items--;
|
||||||
|
Area *name = (Area *)taskbar->area.children->data;
|
||||||
|
if (panel_horizontal) {
|
||||||
|
total_name_size += name->width;
|
||||||
|
} else {
|
||||||
|
total_name_size += name->height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
first_child = FALSE;
|
|
||||||
}
|
|
||||||
total_size -= panel_horizontal ? taskbar->area.width : taskbar->area.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compute the total number of tasks
|
|
||||||
int num_tasks = 0;
|
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
|
||||||
if (!taskbar->area.on_screen)
|
|
||||||
continue;
|
|
||||||
for (GList *l = taskbar->area.children; l; l = l->next) {
|
|
||||||
Area *child = (Area *)l->data;
|
|
||||||
if (!child->on_screen)
|
|
||||||
continue;
|
|
||||||
if (taskbarname_enabled && l == taskbar->area.children)
|
|
||||||
continue;
|
|
||||||
num_tasks++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Distribute the space proportionally to the requested size (that is, to the
|
||||||
|
// number of tasks in each taskbar)
|
||||||
|
if (total_items) {
|
||||||
|
int actual_name_size;
|
||||||
|
if (total_name_size <= total_size) {
|
||||||
|
actual_name_size = total_name_size / visible_taskbars;
|
||||||
|
} else {
|
||||||
|
actual_name_size = total_size / visible_taskbars;
|
||||||
|
}
|
||||||
|
total_size -= total_name_size;
|
||||||
|
|
||||||
// Distribute the remaining size between tasks
|
|
||||||
if (num_tasks > 0) {
|
|
||||||
int task_size = total_size / num_tasks;
|
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
for (int i = 0; i < panel->num_desktops; i++) {
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
Taskbar *taskbar = &panel->taskbar[i];
|
||||||
if (!taskbar->area.on_screen)
|
if (!taskbar->area.on_screen)
|
||||||
continue;
|
continue;
|
||||||
for (GList *l = taskbar->area.children; l; l = l->next) {
|
|
||||||
|
int requested_size = (panel_horizontal ? left_right_border_width(&taskbar->area)
|
||||||
|
: top_bottom_border_width(&taskbar->area)) +
|
||||||
|
2 * taskbar->area.paddingxlr;
|
||||||
|
int items = 0;
|
||||||
|
GList *l = taskbar->area.children;
|
||||||
|
if (taskbarname_enabled)
|
||||||
|
l = l->next;
|
||||||
|
for (; l; l = l->next) {
|
||||||
Area *child = (Area *)l->data;
|
Area *child = (Area *)l->data;
|
||||||
if (!child->on_screen)
|
if (!child->on_screen)
|
||||||
continue;
|
continue;
|
||||||
if (taskbarname_enabled && l == taskbar->area.children)
|
items++;
|
||||||
continue;
|
if (panel_horizontal) {
|
||||||
if (panel_horizontal)
|
requested_size += child->width + taskbar->area.paddingy;
|
||||||
taskbar->area.width += task_size;
|
} else {
|
||||||
else
|
requested_size += child->height + taskbar->area.paddingx;
|
||||||
taskbar->area.height += task_size;
|
}
|
||||||
}
|
}
|
||||||
|
if (panel_horizontal) {
|
||||||
|
requested_size -= taskbar->area.paddingy;
|
||||||
|
} else {
|
||||||
|
requested_size -= taskbar->area.paddingx;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (panel_horizontal) {
|
||||||
|
taskbar->area.width = actual_name_size + items / (float)total_items * total_size;
|
||||||
|
} else {
|
||||||
|
taskbar->area.height = actual_name_size + items / (float)total_items * total_size;
|
||||||
|
}
|
||||||
|
taskbar->area.resize_needed = 1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// No tasks => expand the first visible taskbar
|
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
|
||||||
if (!taskbar->area.on_screen)
|
|
||||||
continue;
|
|
||||||
if (panel_horizontal)
|
|
||||||
taskbar->area.width += total_size;
|
|
||||||
else
|
|
||||||
taskbar->area.height += total_size;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
|
||||||
Taskbar *taskbar = &panel->taskbar[i];
|
|
||||||
taskbar->area.resize_needed =
|
|
||||||
taskbar->area.old_width != taskbar->area.width || taskbar->area.old_height != taskbar->area.height;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (GList *l = panel->freespace_list; l; l = g_list_next(l))
|
if (panel->freespace.area.on_screen)
|
||||||
resize_freespace(l->data);
|
resize_freespace(&panel->freespace);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -545,7 +496,7 @@ void update_strut(Panel *p)
|
|||||||
long struts[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
long struts[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
int height = p->area.height + p->marginy;
|
int height = p->area.height + p->marginy;
|
||||||
if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && panel_autohide))
|
if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden))
|
||||||
height = p->hidden_height;
|
height = p->hidden_height;
|
||||||
if (panel_position & TOP) {
|
if (panel_position & TOP) {
|
||||||
struts[2] = height + monitor.y;
|
struts[2] = height + monitor.y;
|
||||||
@@ -560,7 +511,7 @@ void update_strut(Panel *p)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int width = p->area.width + p->marginx;
|
int width = p->area.width + p->marginx;
|
||||||
if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && panel_autohide))
|
if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden))
|
||||||
width = p->hidden_width;
|
width = p->hidden_width;
|
||||||
if (panel_position & LEFT) {
|
if (panel_position & LEFT) {
|
||||||
struts[0] = width + monitor.x;
|
struts[0] = width + monitor.x;
|
||||||
@@ -601,8 +552,6 @@ void set_panel_items_order(Panel *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int i_execp = 0;
|
int i_execp = 0;
|
||||||
int i_separator = 0;
|
|
||||||
int i_freespace = 0;
|
|
||||||
for (int k = 0; k < strlen(panel_items_order); k++) {
|
for (int k = 0; k < strlen(panel_items_order); k++) {
|
||||||
if (panel_items_order[k] == 'L') {
|
if (panel_items_order[k] == 'L') {
|
||||||
p->area.children = g_list_append(p->area.children, &p->launcher);
|
p->area.children = g_list_append(p->area.children, &p->launcher);
|
||||||
@@ -622,18 +571,8 @@ void set_panel_items_order(Panel *p)
|
|||||||
}
|
}
|
||||||
if (panel_items_order[k] == 'C')
|
if (panel_items_order[k] == 'C')
|
||||||
p->area.children = g_list_append(p->area.children, &p->clock);
|
p->area.children = g_list_append(p->area.children, &p->clock);
|
||||||
if (panel_items_order[k] == 'F') {
|
if (panel_items_order[k] == 'F')
|
||||||
GList *item = g_list_nth(p->freespace_list, i_freespace);
|
p->area.children = g_list_append(p->area.children, &p->freespace);
|
||||||
i_freespace++;
|
|
||||||
if (item)
|
|
||||||
p->area.children = g_list_append(p->area.children, (Area *)item->data);
|
|
||||||
}
|
|
||||||
if (panel_items_order[k] == ':') {
|
|
||||||
GList *item = g_list_nth(p->separator_list, i_separator);
|
|
||||||
i_separator++;
|
|
||||||
if (item)
|
|
||||||
p->area.children = g_list_append(p->area.children, (Area *)item->data);
|
|
||||||
}
|
|
||||||
if (panel_items_order[k] == 'E') {
|
if (panel_items_order[k] == 'E') {
|
||||||
GList *item = g_list_nth(p->execp_list, i_execp);
|
GList *item = g_list_nth(p->execp_list, i_execp);
|
||||||
i_execp++;
|
i_execp++;
|
||||||
@@ -655,16 +594,13 @@ void place_panel_all_desktops(Panel *p)
|
|||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char *)&val,
|
(unsigned char *)&val,
|
||||||
1);
|
1);
|
||||||
}
|
|
||||||
|
|
||||||
void set_panel_layer(Panel *p, Layer layer)
|
|
||||||
{
|
|
||||||
Atom state[4];
|
Atom state[4];
|
||||||
state[0] = server.atom._NET_WM_STATE_SKIP_PAGER;
|
state[0] = server.atom._NET_WM_STATE_SKIP_PAGER;
|
||||||
state[1] = server.atom._NET_WM_STATE_SKIP_TASKBAR;
|
state[1] = server.atom._NET_WM_STATE_SKIP_TASKBAR;
|
||||||
state[2] = server.atom._NET_WM_STATE_STICKY;
|
state[2] = server.atom._NET_WM_STATE_STICKY;
|
||||||
state[3] = layer == BOTTOM_LAYER ? server.atom._NET_WM_STATE_BELOW : server.atom._NET_WM_STATE_ABOVE;
|
state[3] = panel_layer == BOTTOM_LAYER ? server.atom._NET_WM_STATE_BELOW : server.atom._NET_WM_STATE_ABOVE;
|
||||||
int num_atoms = layer == NORMAL_LAYER ? 3 : 4;
|
int num_atoms = panel_layer == NORMAL_LAYER ? 3 : 4;
|
||||||
XChangeProperty(server.display,
|
XChangeProperty(server.display,
|
||||||
p->main_win,
|
p->main_win,
|
||||||
server.atom._NET_WM_STATE,
|
server.atom._NET_WM_STATE,
|
||||||
@@ -690,58 +626,6 @@ void replace_panel_all_desktops(Panel *p)
|
|||||||
XSync(server.display, False);
|
XSync(server.display, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_panel_window_geometry(Panel *panel)
|
|
||||||
{
|
|
||||||
update_strut(panel);
|
|
||||||
|
|
||||||
// Fixed position and non-resizable window
|
|
||||||
// Allow panel move and resize when tint2 reload config file
|
|
||||||
int minwidth = panel_autohide ? panel->hidden_width : panel->area.width;
|
|
||||||
int minheight = panel_autohide ? panel->hidden_height : panel->area.height;
|
|
||||||
XSizeHints size_hints;
|
|
||||||
size_hints.flags = PPosition | PMinSize | PMaxSize;
|
|
||||||
size_hints.min_width = minwidth;
|
|
||||||
size_hints.max_width = panel->area.width;
|
|
||||||
size_hints.min_height = minheight;
|
|
||||||
size_hints.max_height = panel->area.height;
|
|
||||||
XSetWMNormalHints(server.display, panel->main_win, &size_hints);
|
|
||||||
|
|
||||||
if (!panel->is_hidden) {
|
|
||||||
if (panel_horizontal) {
|
|
||||||
XMoveResizeWindow(server.display,
|
|
||||||
panel->main_win,
|
|
||||||
panel->posx,
|
|
||||||
panel->posy,
|
|
||||||
panel->area.width,
|
|
||||||
panel->area.height);
|
|
||||||
} else {
|
|
||||||
XMoveResizeWindow(server.display,
|
|
||||||
panel->main_win,
|
|
||||||
panel->posx,
|
|
||||||
panel->posy,
|
|
||||||
panel->area.width,
|
|
||||||
panel->area.height);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height;
|
|
||||||
if (panel_horizontal) {
|
|
||||||
XMoveResizeWindow(server.display,
|
|
||||||
panel->main_win,
|
|
||||||
panel->posx,
|
|
||||||
panel->posy + diff,
|
|
||||||
panel->hidden_width,
|
|
||||||
panel->hidden_height);
|
|
||||||
} else {
|
|
||||||
XMoveResizeWindow(server.display,
|
|
||||||
panel->main_win,
|
|
||||||
panel->posx + diff,
|
|
||||||
panel->posy,
|
|
||||||
panel->hidden_width,
|
|
||||||
panel->hidden_height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_panel_properties(Panel *p)
|
void set_panel_properties(Panel *p)
|
||||||
{
|
{
|
||||||
XStoreName(server.display, p->main_win, panel_window_name);
|
XStoreName(server.display, p->main_win, panel_window_name);
|
||||||
@@ -781,7 +665,6 @@ void set_panel_properties(Panel *p)
|
|||||||
1);
|
1);
|
||||||
|
|
||||||
place_panel_all_desktops(p);
|
place_panel_all_desktops(p);
|
||||||
set_panel_layer(p, panel_layer);
|
|
||||||
|
|
||||||
XWMHints wmhints;
|
XWMHints wmhints;
|
||||||
memset(&wmhints, 0, sizeof(wmhints));
|
memset(&wmhints, 0, sizeof(wmhints));
|
||||||
@@ -819,14 +702,26 @@ void set_panel_properties(Panel *p)
|
|||||||
(unsigned char *)&version,
|
(unsigned char *)&version,
|
||||||
1);
|
1);
|
||||||
|
|
||||||
|
update_strut(p);
|
||||||
|
|
||||||
|
// Fixed position and non-resizable window
|
||||||
|
// Allow panel move and resize when tint2 reload config file
|
||||||
|
int minwidth = panel_autohide ? p->hidden_width : p->area.width;
|
||||||
|
int minheight = panel_autohide ? p->hidden_height : p->area.height;
|
||||||
|
XSizeHints size_hints;
|
||||||
|
size_hints.flags = PPosition | PMinSize | PMaxSize;
|
||||||
|
size_hints.min_width = minwidth;
|
||||||
|
size_hints.max_width = p->area.width;
|
||||||
|
size_hints.min_height = minheight;
|
||||||
|
size_hints.max_height = p->area.height;
|
||||||
|
XSetWMNormalHints(server.display, p->main_win, &size_hints);
|
||||||
|
|
||||||
// Set WM_CLASS
|
// Set WM_CLASS
|
||||||
XClassHint *classhint = XAllocClassHint();
|
XClassHint *classhint = XAllocClassHint();
|
||||||
classhint->res_name = (char *)"tint2";
|
classhint->res_name = (char *)"tint2";
|
||||||
classhint->res_class = (char *)"Tint2";
|
classhint->res_class = (char *)"Tint2";
|
||||||
XSetClassHint(server.display, p->main_win, classhint);
|
XSetClassHint(server.display, p->main_win, classhint);
|
||||||
XFree(classhint);
|
XFree(classhint);
|
||||||
|
|
||||||
set_panel_window_geometry(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void panel_clear_background(void *obj)
|
void panel_clear_background(void *obj)
|
||||||
@@ -964,22 +859,68 @@ void autohide_show(void *p)
|
|||||||
Panel *panel = (Panel *)p;
|
Panel *panel = (Panel *)p;
|
||||||
stop_autohide_timeout(panel);
|
stop_autohide_timeout(panel);
|
||||||
panel->is_hidden = 0;
|
panel->is_hidden = 0;
|
||||||
|
|
||||||
XMapSubwindows(server.display, panel->main_win); // systray windows
|
XMapSubwindows(server.display, panel->main_win); // systray windows
|
||||||
set_panel_window_geometry(panel);
|
if (panel_horizontal) {
|
||||||
set_panel_layer(panel, TOP_LAYER);
|
if (panel_position & TOP)
|
||||||
|
XResizeWindow(server.display, panel->main_win, panel->area.width, panel->area.height);
|
||||||
|
else
|
||||||
|
XMoveResizeWindow(server.display,
|
||||||
|
panel->main_win,
|
||||||
|
panel->posx,
|
||||||
|
panel->posy,
|
||||||
|
panel->area.width,
|
||||||
|
panel->area.height);
|
||||||
|
} else {
|
||||||
|
if (panel_position & LEFT)
|
||||||
|
XResizeWindow(server.display, panel->main_win, panel->area.width, panel->area.height);
|
||||||
|
else
|
||||||
|
XMoveResizeWindow(server.display,
|
||||||
|
panel->main_win,
|
||||||
|
panel->posx,
|
||||||
|
panel->posy,
|
||||||
|
panel->area.width,
|
||||||
|
panel->area.height);
|
||||||
|
}
|
||||||
|
if (panel_strut_policy == STRUT_FOLLOW_SIZE)
|
||||||
|
update_strut(panel);
|
||||||
refresh_systray = TRUE; // ugly hack, because we actually only need to call XSetBackgroundPixmap
|
refresh_systray = TRUE; // ugly hack, because we actually only need to call XSetBackgroundPixmap
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void autohide_hide(void *p)
|
void autohide_hide(void *p)
|
||||||
{
|
{
|
||||||
Panel *panel = (Panel *)p;
|
Panel *panel = (Panel *)p;
|
||||||
stop_autohide_timeout(panel);
|
stop_autohide_timeout(panel);
|
||||||
set_panel_layer(panel, panel_layer);
|
|
||||||
panel->is_hidden = TRUE;
|
panel->is_hidden = TRUE;
|
||||||
|
if (panel_strut_policy == STRUT_FOLLOW_SIZE)
|
||||||
|
update_strut(panel);
|
||||||
|
|
||||||
XUnmapSubwindows(server.display, panel->main_win); // systray windows
|
XUnmapSubwindows(server.display, panel->main_win); // systray windows
|
||||||
set_panel_window_geometry(panel);
|
int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height;
|
||||||
schedule_panel_redraw();
|
// printf("autohide_hide : diff %d, w %d, h %d\n", diff, panel->hidden_width, panel->hidden_height);
|
||||||
|
if (panel_horizontal) {
|
||||||
|
if (panel_position & TOP)
|
||||||
|
XResizeWindow(server.display, panel->main_win, panel->hidden_width, panel->hidden_height);
|
||||||
|
else
|
||||||
|
XMoveResizeWindow(server.display,
|
||||||
|
panel->main_win,
|
||||||
|
panel->posx,
|
||||||
|
panel->posy + diff,
|
||||||
|
panel->hidden_width,
|
||||||
|
panel->hidden_height);
|
||||||
|
} else {
|
||||||
|
if (panel_position & LEFT)
|
||||||
|
XResizeWindow(server.display, panel->main_win, panel->hidden_width, panel->hidden_height);
|
||||||
|
else
|
||||||
|
XMoveResizeWindow(server.display,
|
||||||
|
panel->main_win,
|
||||||
|
panel->posx + diff,
|
||||||
|
panel->posy,
|
||||||
|
panel->hidden_width,
|
||||||
|
panel->hidden_height);
|
||||||
|
}
|
||||||
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void autohide_trigger_show(Panel *p)
|
void autohide_trigger_show(Panel *p)
|
||||||
@@ -1004,40 +945,11 @@ void autohide_trigger_hide(Panel *p)
|
|||||||
change_timeout(&p->autohide_timeout, panel_autohide_hide_timeout, 0, autohide_hide, p);
|
change_timeout(&p->autohide_timeout, panel_autohide_hide_timeout, 0, autohide_hide, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void shrink_panel(Panel *panel)
|
|
||||||
{
|
|
||||||
if (!panel_shrink)
|
|
||||||
return;
|
|
||||||
int size = MIN(compute_desired_size(&panel->area), panel->max_size);
|
|
||||||
gboolean update = FALSE;
|
|
||||||
if (panel_horizontal) {
|
|
||||||
if (panel->area.width != size) {
|
|
||||||
panel->area.width = size;
|
|
||||||
update = TRUE;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (panel->area.height != size) {
|
|
||||||
panel->area.height = size;
|
|
||||||
update = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (update) {
|
|
||||||
panel_compute_position(panel);
|
|
||||||
set_panel_window_geometry(panel);
|
|
||||||
set_panel_background(panel);
|
|
||||||
panel->area.resize_needed = TRUE;
|
|
||||||
systray.area.resize_needed = TRUE;
|
|
||||||
schedule_redraw(&systray.area);
|
|
||||||
refresh_systray = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void render_panel(Panel *panel)
|
void render_panel(Panel *panel)
|
||||||
{
|
{
|
||||||
relayout(&panel->area);
|
relayout(&panel->area);
|
||||||
if (debug_geometry)
|
if (debug_geometry)
|
||||||
area_dump_geometry(&panel->area, 0);
|
area_dump_geometry(&panel->area, 0);
|
||||||
update_dependent_gradients(&panel->area);
|
|
||||||
draw_tree(&panel->area);
|
draw_tree(&panel->area);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1064,11 +976,3 @@ void default_font_changed()
|
|||||||
taskbarname_default_font_changed();
|
taskbarname_default_font_changed();
|
||||||
tooltip_default_font_changed();
|
tooltip_default_font_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _schedule_panel_redraw(const char *file, const char *function, const int line)
|
|
||||||
{
|
|
||||||
panel_refresh = TRUE;
|
|
||||||
if (debug_fps) {
|
|
||||||
fprintf(stderr, YELLOW "%s %s %d: triggering panel redraw" RESET "\n", file, function, line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-13
@@ -22,7 +22,6 @@
|
|||||||
#include "launcher.h"
|
#include "launcher.h"
|
||||||
#include "freespace.h"
|
#include "freespace.h"
|
||||||
#include "execplugin.h"
|
#include "execplugin.h"
|
||||||
#include "separator.h"
|
|
||||||
|
|
||||||
#ifdef ENABLE_BATTERY
|
#ifdef ENABLE_BATTERY
|
||||||
#include "battery.h"
|
#include "battery.h"
|
||||||
@@ -79,19 +78,15 @@ extern gboolean panel_autohide;
|
|||||||
extern int panel_autohide_show_timeout;
|
extern int panel_autohide_show_timeout;
|
||||||
extern int panel_autohide_hide_timeout;
|
extern int panel_autohide_hide_timeout;
|
||||||
extern int panel_autohide_height; // for vertical panels this is of course the width
|
extern int panel_autohide_height; // for vertical panels this is of course the width
|
||||||
extern gboolean panel_shrink;
|
|
||||||
extern Strut panel_strut_policy;
|
extern Strut panel_strut_policy;
|
||||||
extern char *panel_items_order;
|
extern char *panel_items_order;
|
||||||
extern int max_tick_urgent;
|
extern int max_tick_urgent;
|
||||||
extern GArray *backgrounds;
|
extern GArray *backgrounds;
|
||||||
extern GArray *gradients;
|
|
||||||
extern Imlib_Image default_icon;
|
extern Imlib_Image default_icon;
|
||||||
#define DEFAULT_FONT "sans 10"
|
#define DEFAULT_FONT "sans 10"
|
||||||
extern char *default_font;
|
extern char *default_font;
|
||||||
extern XSettingsClient *xsettings_client;
|
extern XSettingsClient *xsettings_client;
|
||||||
extern gboolean debug_geometry;
|
extern gboolean debug_geometry;
|
||||||
extern gboolean debug_fps;
|
|
||||||
extern gboolean debug_frames;
|
|
||||||
|
|
||||||
typedef struct Panel {
|
typedef struct Panel {
|
||||||
Area area;
|
Area area;
|
||||||
@@ -103,7 +98,6 @@ typedef struct Panel {
|
|||||||
int posx, posy;
|
int posx, posy;
|
||||||
int marginx, marginy;
|
int marginx, marginy;
|
||||||
gboolean fractional_width, fractional_height;
|
gboolean fractional_width, fractional_height;
|
||||||
int max_size;
|
|
||||||
int monitor;
|
int monitor;
|
||||||
int font_shadow;
|
int font_shadow;
|
||||||
gboolean mouse_effects;
|
gboolean mouse_effects;
|
||||||
@@ -132,8 +126,7 @@ typedef struct Panel {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Launcher launcher;
|
Launcher launcher;
|
||||||
GList *freespace_list;
|
FreeSpace freespace;
|
||||||
GList *separator_list;
|
|
||||||
GList *execp_list;
|
GList *execp_list;
|
||||||
|
|
||||||
// Autohide
|
// Autohide
|
||||||
@@ -160,16 +153,11 @@ void init_panel();
|
|||||||
void init_panel_size_and_position(Panel *panel);
|
void init_panel_size_and_position(Panel *panel);
|
||||||
gboolean resize_panel(void *obj);
|
gboolean resize_panel(void *obj);
|
||||||
void render_panel(Panel *panel);
|
void render_panel(Panel *panel);
|
||||||
void shrink_panel(Panel *panel);
|
|
||||||
void _schedule_panel_redraw(const char *file, const char *function, const int line);
|
|
||||||
#define schedule_panel_redraw() _schedule_panel_redraw(__FILE__, __FUNCTION__, __LINE__)
|
|
||||||
|
|
||||||
void set_panel_items_order(Panel *p);
|
void set_panel_items_order(Panel *p);
|
||||||
void place_panel_all_desktops(Panel *p);
|
void place_panel_all_desktops(Panel *p);
|
||||||
void replace_panel_all_desktops(Panel *p);
|
void replace_panel_all_desktops(Panel *p);
|
||||||
void set_panel_properties(Panel *p);
|
void set_panel_properties(Panel *p);
|
||||||
void set_panel_window_geometry(Panel *panel);
|
|
||||||
void set_panel_layer(Panel *p, Layer layer);
|
|
||||||
|
|
||||||
// draw background panel
|
// draw background panel
|
||||||
void set_panel_background(Panel *p);
|
void set_panel_background(Panel *p);
|
||||||
|
|||||||
@@ -1,231 +0,0 @@
|
|||||||
// Tint2 : Separator plugin
|
|
||||||
// Author: Oskari Rauta
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <cairo.h>
|
|
||||||
#include <cairo-xlib.h>
|
|
||||||
#include <pango/pangocairo.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "window.h"
|
|
||||||
#include "server.h"
|
|
||||||
#include "panel.h"
|
|
||||||
#include "common.h"
|
|
||||||
#include "separator.h"
|
|
||||||
|
|
||||||
int separator_compute_desired_size(void *obj);
|
|
||||||
|
|
||||||
Separator *create_separator()
|
|
||||||
{
|
|
||||||
Separator *separator = (Separator *)calloc(1, sizeof(Separator));
|
|
||||||
separator->color.rgb[0] = 0.5;
|
|
||||||
separator->color.rgb[1] = 0.5;
|
|
||||||
separator->color.rgb[2] = 0.5;
|
|
||||||
separator->color.alpha = 0.9;
|
|
||||||
separator->style = SEPARATOR_DOTS;
|
|
||||||
separator->thickness = 3;
|
|
||||||
separator->area.paddingxlr = 1;
|
|
||||||
return separator;
|
|
||||||
}
|
|
||||||
|
|
||||||
void destroy_separator(void *obj)
|
|
||||||
{
|
|
||||||
Separator *separator = (Separator *)obj;
|
|
||||||
remove_area(&separator->area);
|
|
||||||
free_area(&separator->area);
|
|
||||||
free_and_null(separator);
|
|
||||||
}
|
|
||||||
|
|
||||||
gpointer copy_separator(gconstpointer arg, gpointer data)
|
|
||||||
{
|
|
||||||
Separator *old = (Separator *)arg;
|
|
||||||
Separator *copy = (Separator *)calloc(1, sizeof(Separator));
|
|
||||||
memcpy(copy, old, sizeof(Separator));
|
|
||||||
return copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_separator()
|
|
||||||
{
|
|
||||||
GList *to_remove = panel_config.separator_list;
|
|
||||||
for (int k = 0; k < strlen(panel_items_order) && to_remove; k++) {
|
|
||||||
if (panel_items_order[k] == ':') {
|
|
||||||
to_remove = to_remove->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (to_remove) {
|
|
||||||
if (to_remove == panel_config.separator_list) {
|
|
||||||
g_list_free_full(to_remove, destroy_separator);
|
|
||||||
panel_config.separator_list = NULL;
|
|
||||||
} else {
|
|
||||||
// Cut panel_config.separator_list
|
|
||||||
if (to_remove->prev)
|
|
||||||
to_remove->prev->next = NULL;
|
|
||||||
to_remove->prev = NULL;
|
|
||||||
// Remove all elements of to_remove and to_remove itself
|
|
||||||
g_list_free_full(to_remove, destroy_separator);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_separator_panel(void *p)
|
|
||||||
{
|
|
||||||
Panel *panel = (Panel *)p;
|
|
||||||
|
|
||||||
// Make sure this is only done once if there are multiple items
|
|
||||||
if (panel->separator_list)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// panel->separator_list is now a copy of the pointer panel_config.separator_list
|
|
||||||
// We make it a deep copy
|
|
||||||
panel->separator_list = g_list_copy_deep(panel_config.separator_list, copy_separator, NULL);
|
|
||||||
|
|
||||||
for (GList *l = panel->separator_list; l; l = l->next) {
|
|
||||||
Separator *separator = (Separator *)l->data;
|
|
||||||
if (!separator->area.bg)
|
|
||||||
separator->area.bg = &g_array_index(backgrounds, Background, 0);
|
|
||||||
separator->area.parent = p;
|
|
||||||
separator->area.panel = p;
|
|
||||||
snprintf(separator->area.name, sizeof(separator->area.name), "separator");
|
|
||||||
separator->area.size_mode = LAYOUT_FIXED;
|
|
||||||
separator->area.resize_needed = 1;
|
|
||||||
separator->area.on_screen = TRUE;
|
|
||||||
separator->area._resize = resize_separator;
|
|
||||||
separator->area._compute_desired_size = separator_compute_desired_size;
|
|
||||||
separator->area._draw_foreground = draw_separator;
|
|
||||||
instantiate_area_gradients(&separator->area);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cleanup_separator()
|
|
||||||
{
|
|
||||||
// Cleanup frontends
|
|
||||||
for (int i = 0; i < num_panels; i++) {
|
|
||||||
g_list_free_full(panels[i].separator_list, destroy_separator);
|
|
||||||
panels[i].separator_list = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cleanup backends
|
|
||||||
g_list_free_full(panel_config.separator_list, destroy_separator);
|
|
||||||
panel_config.separator_list = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int separator_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Separator *separator = (Separator *)obj;
|
|
||||||
if (!separator->area.on_screen)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (panel_horizontal)
|
|
||||||
return separator->thickness + 2 * separator->area.paddingxlr + left_right_border_width(&separator->area);
|
|
||||||
else
|
|
||||||
return separator->thickness + 2 * separator->area.paddingxlr + top_bottom_border_width(&separator->area);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_separator(void *obj)
|
|
||||||
{
|
|
||||||
Separator *separator = (Separator *)obj;
|
|
||||||
if (!separator->area.on_screen)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (panel_horizontal) {
|
|
||||||
separator->area.width =
|
|
||||||
separator->thickness + 2 * separator->area.paddingxlr + left_right_border_width(&separator->area);
|
|
||||||
separator->length =
|
|
||||||
separator->area.height - 2 * separator->area.paddingy - top_bottom_border_width(&separator->area);
|
|
||||||
} else {
|
|
||||||
separator->area.height =
|
|
||||||
separator->thickness + 2 * separator->area.paddingxlr + top_bottom_border_width(&separator->area);
|
|
||||||
separator->length =
|
|
||||||
separator->area.width - 2 * separator->area.paddingy - left_right_border_width(&separator->area);
|
|
||||||
}
|
|
||||||
|
|
||||||
schedule_redraw(&separator->area);
|
|
||||||
schedule_panel_redraw();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_separator_line(void *obj, cairo_t *c);
|
|
||||||
void draw_separator_dots(void *obj, cairo_t *c);
|
|
||||||
|
|
||||||
void draw_separator(void *obj, cairo_t *c)
|
|
||||||
{
|
|
||||||
Separator *separator = (Separator *)obj;
|
|
||||||
|
|
||||||
if (separator->style == SEPARATOR_EMPTY)
|
|
||||||
return;
|
|
||||||
else if (separator->style == SEPARATOR_LINE)
|
|
||||||
draw_separator_line(separator, c);
|
|
||||||
else if (separator->style == SEPARATOR_DOTS)
|
|
||||||
draw_separator_dots(separator, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_separator_line(void *obj, cairo_t *c)
|
|
||||||
{
|
|
||||||
Separator *separator = (Separator *)obj;
|
|
||||||
|
|
||||||
if (separator->thickness <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
cairo_set_source_rgba(c,
|
|
||||||
separator->color.rgb[0],
|
|
||||||
separator->color.rgb[1],
|
|
||||||
separator->color.rgb[2],
|
|
||||||
separator->color.alpha);
|
|
||||||
cairo_set_line_width(c, separator->thickness);
|
|
||||||
cairo_set_line_cap(c, CAIRO_LINE_CAP_ROUND);
|
|
||||||
if (panel_horizontal) {
|
|
||||||
cairo_move_to(c, separator->area.width / 2.0, separator->area.height / 2.0 - separator->length / 2.0);
|
|
||||||
cairo_line_to(c, separator->area.width / 2.0, separator->area.height / 2.0 + separator->length / 2.0);
|
|
||||||
} else {
|
|
||||||
cairo_move_to(c, separator->area.width / 2.0 - separator->length / 2.0, separator->area.height / 2.0);
|
|
||||||
cairo_line_to(c, separator->area.width / 2.0 + separator->length / 2.0, separator->area.height / 2.0);
|
|
||||||
}
|
|
||||||
cairo_stroke(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void draw_separator_dots(void *obj, cairo_t *c)
|
|
||||||
{
|
|
||||||
const double PI = 3.14159265359;
|
|
||||||
Separator *separator = (Separator *)obj;
|
|
||||||
if (separator->thickness <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
cairo_set_source_rgba(c,
|
|
||||||
separator->color.rgb[0],
|
|
||||||
separator->color.rgb[1],
|
|
||||||
separator->color.rgb[2],
|
|
||||||
separator->color.alpha);
|
|
||||||
cairo_set_line_width(c, 0);
|
|
||||||
|
|
||||||
int num_circles = separator->length / (1.618 * separator->thickness - 1);
|
|
||||||
double spacing = (separator->length - num_circles * separator->thickness) / MAX(1.0, num_circles - 1.0);
|
|
||||||
if (spacing > separator->thickness)
|
|
||||||
num_circles++;
|
|
||||||
spacing = (separator->length - num_circles * separator->thickness) / MAX(1.0, num_circles - 1.0);
|
|
||||||
double offset = (panel_horizontal ? separator->area.height : separator->area.width) / 2.0 - separator->length / 2.0;
|
|
||||||
if (num_circles == 1)
|
|
||||||
offset += spacing / 2.0;
|
|
||||||
for (int i = 0; i < num_circles; i++) {
|
|
||||||
if (panel_horizontal) {
|
|
||||||
cairo_arc(c,
|
|
||||||
separator->area.width / 2.0,
|
|
||||||
offset + separator->thickness / 2.0,
|
|
||||||
separator->thickness / 2.0,
|
|
||||||
0,
|
|
||||||
2 * PI);
|
|
||||||
} else {
|
|
||||||
cairo_arc(c,
|
|
||||||
offset + separator->thickness / 2.0,
|
|
||||||
separator->area.height / 2.0,
|
|
||||||
separator->thickness / 2.0,
|
|
||||||
0,
|
|
||||||
2 * PI);
|
|
||||||
}
|
|
||||||
cairo_stroke_preserve(c);
|
|
||||||
cairo_fill(c);
|
|
||||||
offset += separator->thickness + spacing;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
// Tint2 : Separator
|
|
||||||
// Author: Oskari Rauta <oskari.rauta@gmail.com>
|
|
||||||
|
|
||||||
#ifndef SEPARATOR_H
|
|
||||||
#define SEPARATOR_H
|
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "area.h"
|
|
||||||
|
|
||||||
typedef enum SeparatorStyle {
|
|
||||||
SEPARATOR_EMPTY = 0,
|
|
||||||
SEPARATOR_LINE,
|
|
||||||
SEPARATOR_DOTS
|
|
||||||
} SeparatorStyle;
|
|
||||||
|
|
||||||
typedef struct Separator {
|
|
||||||
Area area;
|
|
||||||
SeparatorStyle style;
|
|
||||||
Color color;
|
|
||||||
int thickness;
|
|
||||||
int length;
|
|
||||||
} Separator;
|
|
||||||
|
|
||||||
Separator *create_separator();
|
|
||||||
void destroy_separator(void *obj);
|
|
||||||
void init_separator();
|
|
||||||
void init_separator_panel(void *p);
|
|
||||||
void cleanup_separator();
|
|
||||||
gboolean resize_separator(void *obj);
|
|
||||||
void draw_separator(void *obj, cairo_t *c);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+23
-24
@@ -256,7 +256,7 @@ void get_root_pixmap()
|
|||||||
gcv.ts_x_origin = 0;
|
gcv.ts_x_origin = 0;
|
||||||
gcv.ts_y_origin = 0;
|
gcv.ts_y_origin = 0;
|
||||||
gcv.fill_style = FillTiled;
|
gcv.fill_style = FillTiled;
|
||||||
unsigned mask = GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle | GCTile;
|
uint mask = GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle | GCTile;
|
||||||
|
|
||||||
gcv.tile = server.root_pmap;
|
gcv.tile = server.root_pmap;
|
||||||
XChangeGC(server.display, server.gc, mask, &gcv);
|
XChangeGC(server.display, server.gc, mask, &gcv);
|
||||||
@@ -302,11 +302,6 @@ int monitor_includes_monitor(const void *monitor1, const void *monitor2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sort_monitors()
|
|
||||||
{
|
|
||||||
qsort(server.monitors, server.num_monitors, sizeof(Monitor), compare_monitor_pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void get_monitors()
|
void get_monitors()
|
||||||
{
|
{
|
||||||
if (XineramaIsActive(server.display)) {
|
if (XineramaIsActive(server.display)) {
|
||||||
@@ -317,34 +312,38 @@ void get_monitors()
|
|||||||
|
|
||||||
if (res && res->ncrtc >= num_monitors) {
|
if (res && res->ncrtc >= num_monitors) {
|
||||||
// use xrandr to identify monitors (does not work with proprietery nvidia drivers)
|
// use xrandr to identify monitors (does not work with proprietery nvidia drivers)
|
||||||
|
|
||||||
|
// Workaround for issue https://gitlab.com/o9000/tint2/issues/353
|
||||||
|
// on some recent configs, XRRGetScreenResourcesCurrent returns a fantom monitor at last position
|
||||||
|
{
|
||||||
|
int i = res->ncrtc - 1;
|
||||||
|
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(server.display, res, res->crtcs[i]);
|
||||||
|
if (!(crtc_info->x || crtc_info->y || crtc_info->width || crtc_info->height)) {
|
||||||
|
res->ncrtc -= 1;
|
||||||
|
}
|
||||||
|
XRRFreeCrtcInfo(crtc_info);
|
||||||
|
}
|
||||||
|
|
||||||
printf("xRandr: Found crtc's: %d\n", res->ncrtc);
|
printf("xRandr: Found crtc's: %d\n", res->ncrtc);
|
||||||
server.monitors = calloc(res->ncrtc, sizeof(Monitor));
|
server.monitors = calloc(res->ncrtc, sizeof(Monitor));
|
||||||
num_monitors = 0;
|
|
||||||
for (int i = 0; i < res->ncrtc; ++i) {
|
for (int i = 0; i < res->ncrtc; ++i) {
|
||||||
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(server.display, res, res->crtcs[i]);
|
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(server.display, res, res->crtcs[i]);
|
||||||
// Ignore empty crtc
|
server.monitors[i].x = crtc_info->x;
|
||||||
if (!crtc_info->width || !crtc_info->height) {
|
server.monitors[i].y = crtc_info->y;
|
||||||
printf("xRandr: crtc %d seems disabled\n", i);
|
server.monitors[i].width = crtc_info->width;
|
||||||
XRRFreeCrtcInfo(crtc_info);
|
server.monitors[i].height = crtc_info->height;
|
||||||
continue;
|
server.monitors[i].names = calloc((crtc_info->noutput + 1), sizeof(gchar *));
|
||||||
}
|
|
||||||
int i_monitor = num_monitors;
|
|
||||||
num_monitors++;
|
|
||||||
server.monitors[i_monitor].x = crtc_info->x;
|
|
||||||
server.monitors[i_monitor].y = crtc_info->y;
|
|
||||||
server.monitors[i_monitor].width = crtc_info->width;
|
|
||||||
server.monitors[i_monitor].height = crtc_info->height;
|
|
||||||
server.monitors[i_monitor].names = calloc((crtc_info->noutput + 1), sizeof(gchar *));
|
|
||||||
for (int j = 0; j < crtc_info->noutput; ++j) {
|
for (int j = 0; j < crtc_info->noutput; ++j) {
|
||||||
XRROutputInfo *output_info = XRRGetOutputInfo(server.display, res, crtc_info->outputs[j]);
|
XRROutputInfo *output_info = XRRGetOutputInfo(server.display, res, crtc_info->outputs[j]);
|
||||||
printf("xRandr: Linking output %s with crtc %d\n", output_info->name, i);
|
printf("xRandr: Linking output %s with crtc %d\n", output_info->name, i);
|
||||||
server.monitors[i_monitor].names[j] = g_strdup(output_info->name);
|
server.monitors[i].names[j] = g_strdup(output_info->name);
|
||||||
XRRFreeOutputInfo(output_info);
|
XRRFreeOutputInfo(output_info);
|
||||||
server.monitors[i_monitor].primary = crtc_info->outputs[j] == primary_output;
|
server.monitors[i].primary = crtc_info->outputs[j] == primary_output;
|
||||||
}
|
}
|
||||||
server.monitors[i_monitor].names[crtc_info->noutput] = NULL;
|
server.monitors[i].names[crtc_info->noutput] = NULL;
|
||||||
XRRFreeCrtcInfo(crtc_info);
|
XRRFreeCrtcInfo(crtc_info);
|
||||||
}
|
}
|
||||||
|
num_monitors = res->ncrtc;
|
||||||
} else if (info && num_monitors > 0) {
|
} else if (info && num_monitors > 0) {
|
||||||
server.monitors = calloc(num_monitors, sizeof(Monitor));
|
server.monitors = calloc(num_monitors, sizeof(Monitor));
|
||||||
for (int i = 0; i < num_monitors; i++) {
|
for (int i = 0; i < num_monitors; i++) {
|
||||||
@@ -352,7 +351,7 @@ void get_monitors()
|
|||||||
server.monitors[i].y = info[i].y_org;
|
server.monitors[i].y = info[i].y_org;
|
||||||
server.monitors[i].width = info[i].width;
|
server.monitors[i].width = info[i].width;
|
||||||
server.monitors[i].height = info[i].height;
|
server.monitors[i].height = info[i].height;
|
||||||
server.monitors[i].names = NULL;
|
server.monitors[i].names = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,6 @@ void get_root_pixmap();
|
|||||||
|
|
||||||
// detect monitors and desktops
|
// detect monitors and desktops
|
||||||
void get_monitors();
|
void get_monitors();
|
||||||
void sort_monitors();
|
|
||||||
void print_monitors();
|
void print_monitors();
|
||||||
void get_desktops();
|
void get_desktops();
|
||||||
void server_get_number_of_desktops();
|
void server_get_number_of_desktops();
|
||||||
|
|||||||
+58
-121
@@ -20,7 +20,6 @@
|
|||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <regex.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -55,8 +54,6 @@ int systray_monitor;
|
|||||||
int chrono;
|
int chrono;
|
||||||
int systray_composited;
|
int systray_composited;
|
||||||
int systray_profile;
|
int systray_profile;
|
||||||
char *systray_hide_name_filter;
|
|
||||||
regex_t *systray_hide_name_regex;
|
|
||||||
// background pixmap if we render ourselves the icons
|
// background pixmap if we render ourselves the icons
|
||||||
static Pixmap render_background;
|
static Pixmap render_background;
|
||||||
|
|
||||||
@@ -68,7 +65,6 @@ const int slow_resize_period = 5000;
|
|||||||
const int min_bad_resize_events = 3;
|
const int min_bad_resize_events = 3;
|
||||||
const int max_bad_resize_events = 10;
|
const int max_bad_resize_events = 10;
|
||||||
|
|
||||||
int systray_compute_desired_size(void *obj);
|
|
||||||
void systray_dump_geometry(void *obj, int indent);
|
void systray_dump_geometry(void *obj, int indent);
|
||||||
|
|
||||||
void default_systray()
|
void default_systray()
|
||||||
@@ -84,8 +80,6 @@ void default_systray()
|
|||||||
systray.area.size_mode = LAYOUT_FIXED;
|
systray.area.size_mode = LAYOUT_FIXED;
|
||||||
systray.area._resize = resize_systray;
|
systray.area._resize = resize_systray;
|
||||||
systray_profile = getenv("SYSTRAY_PROFILING") != NULL;
|
systray_profile = getenv("SYSTRAY_PROFILING") != NULL;
|
||||||
systray_hide_name_filter = NULL;
|
|
||||||
systray_hide_name_regex = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup_systray()
|
void cleanup_systray()
|
||||||
@@ -100,12 +94,6 @@ void cleanup_systray()
|
|||||||
XFreePixmap(server.display, render_background);
|
XFreePixmap(server.display, render_background);
|
||||||
render_background = 0;
|
render_background = 0;
|
||||||
}
|
}
|
||||||
if (systray_hide_name_regex) {
|
|
||||||
regfree(systray_hide_name_regex);
|
|
||||||
free_and_null(systray_hide_name_regex);
|
|
||||||
}
|
|
||||||
if (systray_hide_name_filter)
|
|
||||||
free_and_null(systray_hide_name_filter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_systray()
|
void init_systray()
|
||||||
@@ -129,57 +117,12 @@ void init_systray_panel(void *p)
|
|||||||
systray.area.parent = panel;
|
systray.area.parent = panel;
|
||||||
systray.area.panel = panel;
|
systray.area.panel = panel;
|
||||||
systray.area._dump_geometry = systray_dump_geometry;
|
systray.area._dump_geometry = systray_dump_geometry;
|
||||||
systray.area._compute_desired_size = systray_compute_desired_size;
|
|
||||||
snprintf(systray.area.name, sizeof(systray.area.name), "Systray");
|
snprintf(systray.area.name, sizeof(systray.area.name), "Systray");
|
||||||
if (!systray.area.bg)
|
if (!systray.area.bg)
|
||||||
systray.area.bg = &g_array_index(backgrounds, Background, 0);
|
systray.area.bg = &g_array_index(backgrounds, Background, 0);
|
||||||
show(&systray.area);
|
show(&systray.area);
|
||||||
schedule_redraw(&systray.area);
|
schedule_redraw(&systray.area);
|
||||||
refresh_systray = TRUE;
|
refresh_systray = TRUE;
|
||||||
instantiate_area_gradients(&systray.area);
|
|
||||||
}
|
|
||||||
|
|
||||||
void systray_compute_geometry(int *size)
|
|
||||||
{
|
|
||||||
systray.icon_size = panel_horizontal ? systray.area.height : systray.area.width;
|
|
||||||
systray.icon_size -= MAX(left_right_border_width(&systray.area), top_bottom_border_width(&systray.area)) +
|
|
||||||
2 * systray.area.paddingy;
|
|
||||||
if (systray_max_icon_size > 0)
|
|
||||||
systray.icon_size = MIN(systray.icon_size, systray_max_icon_size);
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
for (GSList *l = systray.list_icons; l; l = l->next) {
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel_horizontal) {
|
|
||||||
int height = systray.area.height - top_bottom_border_width(&systray.area) - 2 * systray.area.paddingy;
|
|
||||||
// here icons_per_column always higher than 0
|
|
||||||
systray.icons_per_column = (height + systray.area.paddingx) / (systray.icon_size + systray.area.paddingx);
|
|
||||||
systray.margin =
|
|
||||||
height - (systray.icons_per_column - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
|
|
||||||
systray.icons_per_row = count / systray.icons_per_column + (count % systray.icons_per_column != 0);
|
|
||||||
*size = left_right_border_width(&systray.area) + 2 * systray.area.paddingxlr +
|
|
||||||
(systray.icon_size * systray.icons_per_row) +
|
|
||||||
((systray.icons_per_row - 1) * systray.area.paddingx);
|
|
||||||
} else {
|
|
||||||
int width = systray.area.width - left_right_border_width(&systray.area) - 2 * systray.area.paddingy;
|
|
||||||
// here icons_per_row always higher than 0
|
|
||||||
systray.icons_per_row = (width + systray.area.paddingx) / (systray.icon_size + systray.area.paddingx);
|
|
||||||
systray.margin =
|
|
||||||
width - (systray.icons_per_row - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
|
|
||||||
systray.icons_per_column = count / systray.icons_per_row + (count % systray.icons_per_row != 0);
|
|
||||||
*size = top_bottom_border_width(&systray.area) + (2 * systray.area.paddingxlr) +
|
|
||||||
(systray.icon_size * systray.icons_per_column) +
|
|
||||||
((systray.icons_per_column - 1) * systray.area.paddingx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int systray_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
int size;
|
|
||||||
systray_compute_geometry(&size);
|
|
||||||
return size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean resize_systray(void *obj)
|
gboolean resize_systray(void *obj)
|
||||||
@@ -187,8 +130,14 @@ gboolean resize_systray(void *obj)
|
|||||||
if (systray_profile)
|
if (systray_profile)
|
||||||
fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
fprintf(stderr, "[%f] %s:%d\n", profiling_get_time(), __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
int size;
|
if (panel_horizontal)
|
||||||
systray_compute_geometry(&size);
|
systray.icon_size = systray.area.height;
|
||||||
|
else
|
||||||
|
systray.icon_size = systray.area.width;
|
||||||
|
systray.icon_size -= MAX(left_right_border_width(&systray.area), top_bottom_border_width(&systray.area)) +
|
||||||
|
2 * systray.area.paddingy;
|
||||||
|
if (systray_max_icon_size > 0)
|
||||||
|
systray.icon_size = MIN(systray.icon_size, systray_max_icon_size);
|
||||||
|
|
||||||
if (systray.icon_size > 0) {
|
if (systray.icon_size > 0) {
|
||||||
long icon_size = systray.icon_size;
|
long icon_size = systray.icon_size;
|
||||||
@@ -202,27 +151,40 @@ gboolean resize_systray(void *obj)
|
|||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean result = refresh_systray;
|
int count = 0;
|
||||||
if (net_sel_win == None) {
|
for (GSList *l = systray.list_icons; l; l = l->next) {
|
||||||
start_net();
|
count++;
|
||||||
result = TRUE;
|
|
||||||
}
|
}
|
||||||
|
if (systray_profile)
|
||||||
|
fprintf(stderr, BLUE "%s:%d number of icons = %d" RESET "\n", __FUNCTION__, __LINE__, count);
|
||||||
|
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
if (systray.area.width != size) {
|
int height = systray.area.height - top_bottom_border_width(&systray.area) - 2 * systray.area.paddingy;
|
||||||
systray.area.width = size;
|
// here icons_per_column always higher than 0
|
||||||
result = TRUE;
|
systray.icons_per_column = (height + systray.area.paddingx) / (systray.icon_size + systray.area.paddingx);
|
||||||
}
|
systray.margin =
|
||||||
|
height - (systray.icons_per_column - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
|
||||||
|
systray.icons_per_row = count / systray.icons_per_column + (count % systray.icons_per_column != 0);
|
||||||
|
systray.area.width = left_right_border_width(&systray.area) + 2 * systray.area.paddingxlr +
|
||||||
|
(systray.icon_size * systray.icons_per_row) +
|
||||||
|
((systray.icons_per_row - 1) * systray.area.paddingx);
|
||||||
} else {
|
} else {
|
||||||
if (systray.area.height != size) {
|
int width = systray.area.width - left_right_border_width(&systray.area) - 2 * systray.area.paddingy;
|
||||||
systray.area.height = size;
|
// here icons_per_row always higher than 0
|
||||||
result = TRUE;
|
systray.icons_per_row = (width + systray.area.paddingx) / (systray.icon_size + systray.area.paddingx);
|
||||||
}
|
systray.margin =
|
||||||
|
width - (systray.icons_per_row - 1) * (systray.icon_size + systray.area.paddingx) - systray.icon_size;
|
||||||
|
systray.icons_per_column = count / systray.icons_per_row + (count % systray.icons_per_row != 0);
|
||||||
|
systray.area.height = top_bottom_border_width(&systray.area) + (2 * systray.area.paddingxlr) +
|
||||||
|
(systray.icon_size * systray.icons_per_column) +
|
||||||
|
((systray.icons_per_column - 1) * systray.area.paddingx);
|
||||||
}
|
}
|
||||||
|
|
||||||
on_change_systray(&systray.area);
|
if (net_sel_win == None) {
|
||||||
|
start_net();
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_systray(void *obj, cairo_t *c)
|
void draw_systray(void *obj, cairo_t *c)
|
||||||
@@ -584,26 +546,6 @@ void print_icons()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean reject_icon(Window win)
|
|
||||||
{
|
|
||||||
if (systray_hide_name_filter && strlen(systray_hide_name_filter)) {
|
|
||||||
if (!systray_hide_name_regex) {
|
|
||||||
systray_hide_name_regex = (regex_t *) calloc(1, sizeof(*systray_hide_name_regex));
|
|
||||||
if (regcomp(systray_hide_name_regex, systray_hide_name_filter, 0) != 0) {
|
|
||||||
fprintf(stderr, RED "Could not compile regex %s" RESET "\n", systray_hide_name_filter);
|
|
||||||
free_and_null(systray_hide_name_regex);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char *name = get_window_name(win);
|
|
||||||
if (regexec(systray_hide_name_regex, name, 0, NULL, 0) == 0) {
|
|
||||||
fprintf(stderr, GREEN "Filtering out systray icon '%s'" RESET "\n", name);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean add_icon(Window win)
|
gboolean add_icon(Window win)
|
||||||
{
|
{
|
||||||
// Avoid duplicates
|
// Avoid duplicates
|
||||||
@@ -614,10 +556,6 @@ gboolean add_icon(Window win)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out systray_hide_by_icon_name
|
|
||||||
if (reject_icon(win))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
// Dangerous actions begin
|
// Dangerous actions begin
|
||||||
XSync(server.display, False);
|
XSync(server.display, False);
|
||||||
error = FALSE;
|
error = FALSE;
|
||||||
@@ -736,7 +674,8 @@ gboolean add_icon(Window win)
|
|||||||
traywin->chrono = chrono;
|
traywin->chrono = chrono;
|
||||||
chrono++;
|
chrono++;
|
||||||
|
|
||||||
show(&systray.area);
|
if (!systray.area.on_screen)
|
||||||
|
show(&systray.area);
|
||||||
|
|
||||||
if (systray.sort == SYSTRAY_SORT_RIGHT2LEFT)
|
if (systray.sort == SYSTRAY_SORT_RIGHT2LEFT)
|
||||||
systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
|
systray.list_icons = g_slist_prepend(systray.list_icons, traywin);
|
||||||
@@ -1141,7 +1080,7 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
|
|||||||
profiling_get_time(),
|
profiling_get_time(),
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
refresh_systray = TRUE;
|
refresh_systray = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1220,7 +1159,7 @@ void systray_resize_request_event(TrayWindow *traywin, XEvent *e)
|
|||||||
profiling_get_time(),
|
profiling_get_time(),
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
refresh_systray = TRUE;
|
refresh_systray = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1428,7 +1367,7 @@ void systray_render_icon_composited(void *t)
|
|||||||
if (error)
|
if (error)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
|
|
||||||
if (systray_profile)
|
if (systray_profile)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@@ -1467,31 +1406,29 @@ on_systray_error:
|
|||||||
void systray_render_icon(void *t)
|
void systray_render_icon(void *t)
|
||||||
{
|
{
|
||||||
TrayWindow *traywin = t;
|
TrayWindow *traywin = t;
|
||||||
|
if (systray_profile)
|
||||||
|
fprintf(stderr,
|
||||||
|
"[%f] %s:%d win = %lu (%s)\n",
|
||||||
|
profiling_get_time(),
|
||||||
|
__FUNCTION__,
|
||||||
|
__LINE__,
|
||||||
|
traywin->win,
|
||||||
|
traywin->name);
|
||||||
if (!traywin->reparented || !traywin->embedded) {
|
if (!traywin->reparented || !traywin->embedded) {
|
||||||
// if (systray_profile)
|
if (systray_profile)
|
||||||
// fprintf(stderr,
|
fprintf(stderr,
|
||||||
// YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
YELLOW "[%f] %s:%d win = %lu (%s) delaying rendering" RESET "\n",
|
||||||
// profiling_get_time(),
|
profiling_get_time(),
|
||||||
// __FUNCTION__,
|
__FUNCTION__,
|
||||||
// __LINE__,
|
__LINE__,
|
||||||
// traywin->win,
|
traywin->win,
|
||||||
// traywin->name);
|
traywin->name);
|
||||||
stop_timeout(traywin->render_timeout);
|
stop_timeout(traywin->render_timeout);
|
||||||
traywin->render_timeout =
|
traywin->render_timeout =
|
||||||
add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout);
|
add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (systray_profile)
|
|
||||||
fprintf(stderr,
|
|
||||||
"[%f] %s:%d win = %lu (%s)\n",
|
|
||||||
profiling_get_time(),
|
|
||||||
__FUNCTION__,
|
|
||||||
__LINE__,
|
|
||||||
traywin->win,
|
|
||||||
traywin->name);
|
|
||||||
|
|
||||||
|
|
||||||
if (systray_composited) {
|
if (systray_composited) {
|
||||||
XSync(server.display, False);
|
XSync(server.display, False);
|
||||||
error = FALSE;
|
error = FALSE;
|
||||||
@@ -1563,9 +1500,9 @@ void refresh_systray_icons()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean systray_on_monitor(int i_monitor, int n_panels)
|
gboolean systray_on_monitor(int i_monitor, int num_panels)
|
||||||
{
|
{
|
||||||
return (i_monitor == systray_monitor) || (i_monitor == 0 && (systray_monitor >= n_panels || systray_monitor < 0));
|
return (i_monitor == systray_monitor) || (i_monitor == 0 && (systray_monitor >= num_panels || systray_monitor < 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
TrayWindow *systray_find_icon(Window win)
|
TrayWindow *systray_find_icon(Window win)
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ extern gboolean systray_enabled;
|
|||||||
extern int systray_max_icon_size;
|
extern int systray_max_icon_size;
|
||||||
extern int systray_monitor;
|
extern int systray_monitor;
|
||||||
extern gboolean systray_profile;
|
extern gboolean systray_profile;
|
||||||
extern char *systray_hide_name_filter;
|
|
||||||
|
|
||||||
// default global data
|
// default global data
|
||||||
void default_systray();
|
void default_systray();
|
||||||
|
|||||||
+4
-21
@@ -39,7 +39,6 @@ timeout *urgent_timeout;
|
|||||||
GSList *urgent_list;
|
GSList *urgent_list;
|
||||||
|
|
||||||
void task_dump_geometry(void *obj, int indent);
|
void task_dump_geometry(void *obj, int indent);
|
||||||
int task_compute_desired_size(void *obj);
|
|
||||||
|
|
||||||
char *task_get_tooltip(void *obj)
|
char *task_get_tooltip(void *obj)
|
||||||
{
|
{
|
||||||
@@ -109,7 +108,6 @@ Task *add_task(Window win)
|
|||||||
task_instance->area.has_mouse_press_effect = panel_config.mouse_effects;
|
task_instance->area.has_mouse_press_effect = panel_config.mouse_effects;
|
||||||
task_instance->area._dump_geometry = task_dump_geometry;
|
task_instance->area._dump_geometry = task_dump_geometry;
|
||||||
task_instance->area._is_under_mouse = full_width_area_is_under_mouse;
|
task_instance->area._is_under_mouse = full_width_area_is_under_mouse;
|
||||||
task_instance->area._compute_desired_size = task_compute_desired_size;
|
|
||||||
task_instance->win = task_template.win;
|
task_instance->win = task_template.win;
|
||||||
task_instance->desktop = task_template.desktop;
|
task_instance->desktop = task_template.desktop;
|
||||||
task_instance->win_x = task_template.win_x;
|
task_instance->win_x = task_template.win_x;
|
||||||
@@ -152,9 +150,6 @@ Task *add_task(Window win)
|
|||||||
add_urgent((Task *)g_ptr_array_index(task_buttons, 0));
|
add_urgent((Task *)g_ptr_array_index(task_buttons, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hide_taskbar_if_empty)
|
|
||||||
update_all_taskbars_visibility();
|
|
||||||
|
|
||||||
return (Task *)g_ptr_array_index(task_buttons, 0);
|
return (Task *)g_ptr_array_index(task_buttons, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,8 +204,6 @@ void remove_task(Task *task)
|
|||||||
free(task2);
|
free(task2);
|
||||||
}
|
}
|
||||||
g_hash_table_remove(win_to_task, &win);
|
g_hash_table_remove(win_to_task, &win);
|
||||||
if (hide_taskbar_if_empty)
|
|
||||||
update_all_taskbars_visibility();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean task_update_title(Task *task)
|
gboolean task_update_title(Task *task)
|
||||||
@@ -301,8 +294,8 @@ void task_update_icon(Task *task)
|
|||||||
// get width, height and depth for the pixmap
|
// get width, height and depth for the pixmap
|
||||||
Window root;
|
Window root;
|
||||||
int icon_x, icon_y;
|
int icon_x, icon_y;
|
||||||
unsigned border_width, bpp;
|
uint border_width, bpp;
|
||||||
unsigned w, h;
|
uint w, h;
|
||||||
|
|
||||||
XGetGeometry(server.display, hints->icon_pixmap, &root, &icon_x, &icon_y, &w, &h, &border_width, &bpp);
|
XGetGeometry(server.display, hints->icon_pixmap, &root, &icon_x, &icon_y, &w, &h, &border_width, &bpp);
|
||||||
imlib_context_set_drawable(hints->icon_pixmap);
|
imlib_context_set_drawable(hints->icon_pixmap);
|
||||||
@@ -472,14 +465,6 @@ void task_dump_geometry(void *obj, int indent)
|
|||||||
panel->g_task.icon_size1);
|
panel->g_task.icon_size1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int task_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Task *task = (Task *)obj;
|
|
||||||
Panel *panel = (Panel *)task->area.panel;
|
|
||||||
int size = panel_horizontal ? panel->g_task.maximum_width : panel->g_task.maximum_height;
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_change_task(void *obj)
|
void on_change_task(void *obj)
|
||||||
{
|
{
|
||||||
Task *task = (Task *)obj;
|
Task *task = (Task *)obj;
|
||||||
@@ -610,8 +595,6 @@ void set_task_state(Task *task, TaskState state)
|
|||||||
Task *task1 = g_ptr_array_index(task_buttons, i);
|
Task *task1 = g_ptr_array_index(task_buttons, i);
|
||||||
task1->current_state = state;
|
task1->current_state = state;
|
||||||
task1->area.bg = panels[0].g_task.background[state];
|
task1->area.bg = panels[0].g_task.background[state];
|
||||||
free_area_gradient_instances(&task1->area);
|
|
||||||
instantiate_area_gradients(&task1->area);
|
|
||||||
schedule_redraw(&task1->area);
|
schedule_redraw(&task1->area);
|
||||||
if (state == TASK_ACTIVE && g_slist_find(urgent_list, task1))
|
if (state == TASK_ACTIVE && g_slist_find(urgent_list, task1))
|
||||||
del_urgent(task1);
|
del_urgent(task1);
|
||||||
@@ -640,7 +623,7 @@ void set_task_state(Task *task, TaskState state)
|
|||||||
p->area.resize_needed = TRUE;
|
p->area.resize_needed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -658,7 +641,7 @@ void blink_urgent(void *arg)
|
|||||||
}
|
}
|
||||||
urgent_task = urgent_task->next;
|
urgent_task = urgent_task->next;
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_urgent(Task *task)
|
void add_urgent(Task *task)
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ typedef struct GlobalTask {
|
|||||||
int brightness[TASK_STATE_COUNT];
|
int brightness[TASK_STATE_COUNT];
|
||||||
int config_asb_mask;
|
int config_asb_mask;
|
||||||
Background *background[TASK_STATE_COUNT];
|
Background *background[TASK_STATE_COUNT];
|
||||||
GList *gradient[TASK_STATE_COUNT];
|
|
||||||
int config_background_mask;
|
int config_background_mask;
|
||||||
// starting position for text ~ task_padding + task_border + icon_size
|
// starting position for text ~ task_padding + task_border + icon_size
|
||||||
double text_posx, text_height;
|
double text_posx, text_height;
|
||||||
|
|||||||
+14
-61
@@ -41,13 +41,11 @@ gboolean taskbar_enabled;
|
|||||||
gboolean taskbar_distribute_size;
|
gboolean taskbar_distribute_size;
|
||||||
gboolean hide_inactive_tasks;
|
gboolean hide_inactive_tasks;
|
||||||
gboolean hide_task_diff_monitor;
|
gboolean hide_task_diff_monitor;
|
||||||
gboolean hide_taskbar_if_empty;
|
|
||||||
gboolean always_show_all_desktop_tasks;
|
gboolean always_show_all_desktop_tasks;
|
||||||
TaskbarSortMethod taskbar_sort_method;
|
TaskbarSortMethod taskbar_sort_method;
|
||||||
Alignment taskbar_alignment;
|
Alignment taskbar_alignment;
|
||||||
|
|
||||||
void taskbar_init_fonts();
|
void taskbar_init_fonts();
|
||||||
int taskbar_compute_desired_size(void *obj);
|
|
||||||
|
|
||||||
// Removes the task with &win = key. The other args are ignored.
|
// Removes the task with &win = key. The other args are ignored.
|
||||||
void taskbar_remove_task(Window *win);
|
void taskbar_remove_task(Window *win);
|
||||||
@@ -76,7 +74,6 @@ void default_taskbar()
|
|||||||
taskbar_distribute_size = FALSE;
|
taskbar_distribute_size = FALSE;
|
||||||
hide_inactive_tasks = FALSE;
|
hide_inactive_tasks = FALSE;
|
||||||
hide_task_diff_monitor = FALSE;
|
hide_task_diff_monitor = FALSE;
|
||||||
hide_taskbar_if_empty = FALSE;
|
|
||||||
always_show_all_desktop_tasks = FALSE;
|
always_show_all_desktop_tasks = FALSE;
|
||||||
taskbar_sort_method = TASKBAR_NOSORT;
|
taskbar_sort_method = TASKBAR_NOSORT;
|
||||||
taskbar_alignment = ALIGN_LEFT;
|
taskbar_alignment = ALIGN_LEFT;
|
||||||
@@ -85,6 +82,7 @@ void default_taskbar()
|
|||||||
|
|
||||||
void cleanup_taskbar()
|
void cleanup_taskbar()
|
||||||
{
|
{
|
||||||
|
cleanup_taskbarname();
|
||||||
if (win_to_task) {
|
if (win_to_task) {
|
||||||
while (g_hash_table_size(win_to_task)) {
|
while (g_hash_table_size(win_to_task)) {
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
@@ -98,7 +96,6 @@ void cleanup_taskbar()
|
|||||||
g_hash_table_destroy(win_to_task);
|
g_hash_table_destroy(win_to_task);
|
||||||
win_to_task = NULL;
|
win_to_task = NULL;
|
||||||
}
|
}
|
||||||
cleanup_taskbarname();
|
|
||||||
for (int i = 0; i < num_panels; i++) {
|
for (int i = 0; i < num_panels; i++) {
|
||||||
Panel *panel = &panels[i];
|
Panel *panel = &panels[i];
|
||||||
for (int j = 0; j < panel->num_desktops; j++) {
|
for (int j = 0; j < panel->num_desktops; j++) {
|
||||||
@@ -117,15 +114,6 @@ void cleanup_taskbar()
|
|||||||
urgent_list = NULL;
|
urgent_list = NULL;
|
||||||
|
|
||||||
stop_timeout(urgent_timeout);
|
stop_timeout(urgent_timeout);
|
||||||
|
|
||||||
for (int state = 0; state < TASK_STATE_COUNT; state++) {
|
|
||||||
g_list_free(panel_config.g_task.gradient[state]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int state = 0; state < TASKBAR_STATE_COUNT; state++) {
|
|
||||||
g_list_free(panel_config.g_taskbar.gradient[state]);
|
|
||||||
g_list_free(panel_config.g_taskbar.gradient_name[state]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_taskbar()
|
void init_taskbar()
|
||||||
@@ -175,7 +163,6 @@ void init_taskbar_panel(void *p)
|
|||||||
panel->g_taskbar.area.size_mode = LAYOUT_DYNAMIC;
|
panel->g_taskbar.area.size_mode = LAYOUT_DYNAMIC;
|
||||||
panel->g_taskbar.area.alignment = taskbar_alignment;
|
panel->g_taskbar.area.alignment = taskbar_alignment;
|
||||||
panel->g_taskbar.area._resize = resize_taskbar;
|
panel->g_taskbar.area._resize = resize_taskbar;
|
||||||
panel->g_taskbar.area._compute_desired_size = taskbar_compute_desired_size;
|
|
||||||
panel->g_taskbar.area._is_under_mouse = full_width_area_is_under_mouse;
|
panel->g_taskbar.area._is_under_mouse = full_width_area_is_under_mouse;
|
||||||
panel->g_taskbar.area.resize_needed = 1;
|
panel->g_taskbar.area.resize_needed = 1;
|
||||||
panel->g_taskbar.area.on_screen = TRUE;
|
panel->g_taskbar.area.on_screen = TRUE;
|
||||||
@@ -315,16 +302,10 @@ void init_taskbar_panel(void *p)
|
|||||||
taskbar = &panel->taskbar[j];
|
taskbar = &panel->taskbar[j];
|
||||||
memcpy(&taskbar->area, &panel->g_taskbar.area, sizeof(Area));
|
memcpy(&taskbar->area, &panel->g_taskbar.area, sizeof(Area));
|
||||||
taskbar->desktop = j;
|
taskbar->desktop = j;
|
||||||
if (j == server.desktop) {
|
if (j == server.desktop)
|
||||||
taskbar->area.bg = panel->g_taskbar.background[TASKBAR_ACTIVE];
|
taskbar->area.bg = panel->g_taskbar.background[TASKBAR_ACTIVE];
|
||||||
free_area_gradient_instances(&taskbar->area);
|
else
|
||||||
instantiate_area_gradients(&taskbar->area);
|
|
||||||
} else {
|
|
||||||
taskbar->area.bg = panel->g_taskbar.background[TASKBAR_NORMAL];
|
taskbar->area.bg = panel->g_taskbar.background[TASKBAR_NORMAL];
|
||||||
free_area_gradient_instances(&taskbar->area);
|
|
||||||
instantiate_area_gradients(&taskbar->area);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
init_taskbarname_panel(panel);
|
init_taskbarname_panel(panel);
|
||||||
}
|
}
|
||||||
@@ -366,7 +347,7 @@ void taskbar_default_font_changed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void taskbar_remove_task(Window *win)
|
void taskbar_remove_task(Window *win)
|
||||||
@@ -419,22 +400,6 @@ void taskbar_refresh_tasklist()
|
|||||||
XFree(win);
|
XFree(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
int taskbar_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
Taskbar *taskbar = (Taskbar *)obj;
|
|
||||||
Panel *panel = (Panel *)taskbar->area.panel;
|
|
||||||
|
|
||||||
if (taskbar_mode == MULTI_DESKTOP && !taskbar_distribute_size) {
|
|
||||||
int result = 0;
|
|
||||||
for (int i = 0; i < panel->num_desktops; i++) {
|
|
||||||
Taskbar *t = &panel->taskbar[i];
|
|
||||||
result = MAX(result, container_compute_desired_size(&t->area));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
return container_compute_desired_size(&taskbar->area);
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_taskbar(void *obj)
|
gboolean resize_taskbar(void *obj)
|
||||||
{
|
{
|
||||||
Taskbar *taskbar = (Taskbar *)obj;
|
Taskbar *taskbar = (Taskbar *)obj;
|
||||||
@@ -472,27 +437,20 @@ gboolean taskbar_is_empty(Taskbar *taskbar)
|
|||||||
l = l->next;
|
l = l->next;
|
||||||
for (; l != NULL; l = l->next) {
|
for (; l != NULL; l = l->next) {
|
||||||
if (((Task *)l->data)->area.on_screen) {
|
if (((Task *)l->data)->area.on_screen) {
|
||||||
return FALSE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_taskbar_visibility(Taskbar *taskbar)
|
void update_one_taskbar_visibility(Taskbar *taskbar)
|
||||||
{
|
{
|
||||||
if (taskbar->desktop == server.desktop) {
|
if (taskbar->desktop == server.desktop) {
|
||||||
// Taskbar for current desktop is always shown
|
// Taskbar for current desktop is always shown
|
||||||
show(&taskbar->area);
|
show(&taskbar->area);
|
||||||
} else if (taskbar_mode == MULTI_DESKTOP) {
|
} else if (taskbar_mode == MULTI_DESKTOP && taskbar_is_empty(taskbar)) {
|
||||||
if (hide_taskbar_if_empty) {
|
// MULTI_DESKTOP : show non-empty taskbars
|
||||||
if (taskbar_is_empty(taskbar)) {
|
show(&taskbar->area);
|
||||||
hide(&taskbar->area);
|
|
||||||
} else {
|
|
||||||
show(&taskbar->area);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
show(&taskbar->area);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
hide(&taskbar->area);
|
hide(&taskbar->area);
|
||||||
}
|
}
|
||||||
@@ -503,7 +461,7 @@ void update_all_taskbars_visibility()
|
|||||||
for (int i = 0; i < num_panels; i++) {
|
for (int i = 0; i < num_panels; i++) {
|
||||||
Panel *panel = &panels[i];
|
Panel *panel = &panels[i];
|
||||||
for (int j = 0; j < panel->num_desktops; j++) {
|
for (int j = 0; j < panel->num_desktops; j++) {
|
||||||
update_taskbar_visibility(&panel->taskbar[j]);
|
update_one_taskbar_visibility(&panel->taskbar[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,16 +469,11 @@ void update_all_taskbars_visibility()
|
|||||||
void set_taskbar_state(Taskbar *taskbar, TaskbarState state)
|
void set_taskbar_state(Taskbar *taskbar, TaskbarState state)
|
||||||
{
|
{
|
||||||
taskbar->area.bg = panels[0].g_taskbar.background[state];
|
taskbar->area.bg = panels[0].g_taskbar.background[state];
|
||||||
free_area_gradient_instances(&taskbar->area);
|
|
||||||
instantiate_area_gradients(&taskbar->area);
|
|
||||||
|
|
||||||
if (taskbarname_enabled) {
|
if (taskbarname_enabled) {
|
||||||
taskbar->bar_name.area.bg = panels[0].g_taskbar.background_name[state];
|
taskbar->bar_name.area.bg = panels[0].g_taskbar.background_name[state];
|
||||||
free_area_gradient_instances(&taskbar->bar_name.area);
|
|
||||||
instantiate_area_gradients(&taskbar->bar_name.area);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_taskbar_visibility(taskbar);
|
update_one_taskbar_visibility(taskbar);
|
||||||
|
|
||||||
if (taskbar->area.on_screen) {
|
if (taskbar->area.on_screen) {
|
||||||
schedule_redraw(&taskbar->area);
|
schedule_redraw(&taskbar->area);
|
||||||
@@ -536,7 +489,7 @@ void set_taskbar_state(Taskbar *taskbar, TaskbarState state)
|
|||||||
schedule_redraw((Area *)l->data);
|
schedule_redraw((Area *)l->data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NONTRIVIAL 2
|
#define NONTRIVIAL 2
|
||||||
@@ -649,7 +602,7 @@ void sort_tasks(Taskbar *taskbar)
|
|||||||
|
|
||||||
taskbar->area.children = g_list_sort_with_data(taskbar->area.children, (GCompareDataFunc)compare_tasks, taskbar);
|
taskbar->area.children = g_list_sort_with_data(taskbar->area.children, (GCompareDataFunc)compare_tasks, taskbar);
|
||||||
taskbar->area.resize_needed = TRUE;
|
taskbar->area.resize_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
((Panel *)taskbar->area.panel)->area.resize_needed = TRUE;
|
((Panel *)taskbar->area.panel)->area.resize_needed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,15 +43,12 @@ typedef struct GlobalTaskbar {
|
|||||||
Area area_name;
|
Area area_name;
|
||||||
Background *background[TASKBAR_STATE_COUNT];
|
Background *background[TASKBAR_STATE_COUNT];
|
||||||
Background *background_name[TASKBAR_STATE_COUNT];
|
Background *background_name[TASKBAR_STATE_COUNT];
|
||||||
GList *gradient[TASKBAR_STATE_COUNT];
|
|
||||||
GList *gradient_name[TASKBAR_STATE_COUNT];
|
|
||||||
} GlobalTaskbar;
|
} GlobalTaskbar;
|
||||||
|
|
||||||
extern gboolean taskbar_enabled;
|
extern gboolean taskbar_enabled;
|
||||||
extern gboolean taskbar_distribute_size;
|
extern gboolean taskbar_distribute_size;
|
||||||
extern gboolean hide_inactive_tasks;
|
extern gboolean hide_inactive_tasks;
|
||||||
extern gboolean hide_task_diff_monitor;
|
extern gboolean hide_task_diff_monitor;
|
||||||
extern gboolean hide_taskbar_if_empty;
|
|
||||||
extern gboolean always_show_all_desktop_tasks;
|
extern gboolean always_show_all_desktop_tasks;
|
||||||
extern TaskbarSortMethod taskbar_sort_method;
|
extern TaskbarSortMethod taskbar_sort_method;
|
||||||
extern Alignment taskbar_alignment;
|
extern Alignment taskbar_alignment;
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ Color taskbarname_font;
|
|||||||
Color taskbarname_active_font;
|
Color taskbarname_active_font;
|
||||||
|
|
||||||
void taskbarname_init_fonts();
|
void taskbarname_init_fonts();
|
||||||
int taskbarname_compute_desired_size(void *obj);
|
|
||||||
|
|
||||||
void default_taskbarname()
|
void default_taskbarname()
|
||||||
{
|
{
|
||||||
@@ -61,12 +60,10 @@ void init_taskbarname_panel(void *p)
|
|||||||
taskbar->bar_name.area.parent = taskbar;
|
taskbar->bar_name.area.parent = taskbar;
|
||||||
taskbar->bar_name.area.has_mouse_over_effect = panel_config.mouse_effects;
|
taskbar->bar_name.area.has_mouse_over_effect = panel_config.mouse_effects;
|
||||||
taskbar->bar_name.area.has_mouse_press_effect = panel_config.mouse_effects;
|
taskbar->bar_name.area.has_mouse_press_effect = panel_config.mouse_effects;
|
||||||
taskbar->bar_name.area._compute_desired_size = taskbarname_compute_desired_size;
|
if (j == server.desktop)
|
||||||
if (j == server.desktop) {
|
|
||||||
taskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_ACTIVE];
|
taskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_ACTIVE];
|
||||||
} else {
|
else
|
||||||
taskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_NORMAL];
|
taskbar->bar_name.area.bg = panel->g_taskbar.background_name[TASKBAR_NORMAL];
|
||||||
}
|
|
||||||
|
|
||||||
// use desktop number if name is missing
|
// use desktop number if name is missing
|
||||||
if (l) {
|
if (l) {
|
||||||
@@ -78,7 +75,6 @@ void init_taskbarname_panel(void *p)
|
|||||||
|
|
||||||
// append the name at the beginning of taskbar
|
// append the name at the beginning of taskbar
|
||||||
taskbar->area.children = g_list_append(taskbar->area.children, &taskbar->bar_name);
|
taskbar->area.children = g_list_append(taskbar->area.children, &taskbar->bar_name);
|
||||||
instantiate_area_gradients(&taskbar->bar_name.area);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = list; l; l = l->next)
|
for (l = list; l; l = l->next)
|
||||||
@@ -113,7 +109,7 @@ void taskbarname_default_font_changed()
|
|||||||
schedule_redraw(&taskbar->bar_name.area);
|
schedule_redraw(&taskbar->bar_name.area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cleanup_taskbarname()
|
void cleanup_taskbarname()
|
||||||
@@ -130,38 +126,14 @@ void cleanup_taskbarname()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int taskbarname_compute_desired_size(void *obj)
|
|
||||||
{
|
|
||||||
TaskbarName *taskbar_name = (TaskbarName *)obj;
|
|
||||||
Panel *panel = (Panel *)taskbar_name->area.panel;
|
|
||||||
int name_height, name_width, name_height_ink;
|
|
||||||
get_text_size2(panel_config.taskbarname_font_desc,
|
|
||||||
&name_height_ink,
|
|
||||||
&name_height,
|
|
||||||
&name_width,
|
|
||||||
panel->area.height,
|
|
||||||
panel->area.width,
|
|
||||||
taskbar_name->name,
|
|
||||||
strlen(taskbar_name->name),
|
|
||||||
PANGO_WRAP_WORD_CHAR,
|
|
||||||
PANGO_ELLIPSIZE_NONE,
|
|
||||||
FALSE);
|
|
||||||
|
|
||||||
if (panel_horizontal) {
|
|
||||||
return name_width + 2 * taskbar_name->area.paddingxlr + left_right_border_width(&taskbar_name->area);
|
|
||||||
} else {
|
|
||||||
return name_height + 2 * taskbar_name->area.paddingxlr + top_bottom_border_width(&taskbar_name->area);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean resize_taskbarname(void *obj)
|
gboolean resize_taskbarname(void *obj)
|
||||||
{
|
{
|
||||||
TaskbarName *taskbar_name = (TaskbarName *)obj;
|
TaskbarName *taskbar_name = obj;
|
||||||
Panel *panel = (Panel *)taskbar_name->area.panel;
|
Panel *panel = taskbar_name->area.panel;
|
||||||
|
int name_height, name_width, name_height_ink;
|
||||||
|
gboolean result = FALSE;
|
||||||
|
|
||||||
schedule_redraw(&taskbar_name->area);
|
schedule_redraw(&taskbar_name->area);
|
||||||
|
|
||||||
int name_height, name_width, name_height_ink;
|
|
||||||
get_text_size2(panel_config.taskbarname_font_desc,
|
get_text_size2(panel_config.taskbarname_font_desc,
|
||||||
&name_height_ink,
|
&name_height_ink,
|
||||||
&name_height,
|
&name_height,
|
||||||
@@ -174,15 +146,15 @@ gboolean resize_taskbarname(void *obj)
|
|||||||
PANGO_ELLIPSIZE_NONE,
|
PANGO_ELLIPSIZE_NONE,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
gboolean result = FALSE;
|
|
||||||
int new_size = taskbarname_compute_desired_size(obj);
|
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
|
int new_size = name_width + 2 * taskbar_name->area.paddingxlr + left_right_border_width(&taskbar_name->area);
|
||||||
if (new_size != taskbar_name->area.width) {
|
if (new_size != taskbar_name->area.width) {
|
||||||
taskbar_name->area.width = new_size;
|
taskbar_name->area.width = new_size;
|
||||||
taskbar_name->posy = (taskbar_name->area.height - name_height) / 2;
|
taskbar_name->posy = (taskbar_name->area.height - name_height) / 2;
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
int new_size = name_height + 2 * taskbar_name->area.paddingxlr + top_bottom_border_width(&taskbar_name->area);
|
||||||
if (new_size != taskbar_name->area.height) {
|
if (new_size != taskbar_name->area.height) {
|
||||||
taskbar_name->area.height = new_size;
|
taskbar_name->area.height = new_size;
|
||||||
taskbar_name->posy = (taskbar_name->area.height - name_height) / 2;
|
taskbar_name->posy = (taskbar_name->area.height - name_height) / 2;
|
||||||
|
|||||||
+151
-314
@@ -79,86 +79,6 @@ XSettingsClient *xsettings_client = NULL;
|
|||||||
timeout *detect_compositor_timer = NULL;
|
timeout *detect_compositor_timer = NULL;
|
||||||
int detect_compositor_timer_counter = 0;
|
int detect_compositor_timer_counter = 0;
|
||||||
|
|
||||||
gboolean debug_fps = FALSE;
|
|
||||||
gboolean debug_frames = FALSE;
|
|
||||||
float *fps_distribution = NULL;
|
|
||||||
int frame = 0;
|
|
||||||
|
|
||||||
void create_fps_distribution()
|
|
||||||
{
|
|
||||||
// measure FPS with resolution:
|
|
||||||
// 0-59: 1 (60 samples)
|
|
||||||
// 60-199: 10 (14)
|
|
||||||
// 200-1,999: 25 (72)
|
|
||||||
// 1k-19,999: 1000 (19)
|
|
||||||
// 20x+: inf (1)
|
|
||||||
// => 166 samples
|
|
||||||
if (fps_distribution)
|
|
||||||
return;
|
|
||||||
fps_distribution = calloc(170, sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
void cleanup_fps_distribution()
|
|
||||||
{
|
|
||||||
free(fps_distribution);
|
|
||||||
fps_distribution = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void sample_fps(double fps)
|
|
||||||
{
|
|
||||||
int fps_rounded = (int)(fps + 0.5);
|
|
||||||
int i = 1;
|
|
||||||
if (fps_rounded < 60) {
|
|
||||||
i += fps_rounded;
|
|
||||||
} else {
|
|
||||||
i += 60;
|
|
||||||
if (fps_rounded < 200) {
|
|
||||||
i += (fps_rounded - 60) / 10;
|
|
||||||
} else {
|
|
||||||
i += 14;
|
|
||||||
if (fps_rounded < 2000) {
|
|
||||||
i += (fps_rounded - 200) / 25;
|
|
||||||
} else {
|
|
||||||
i += 72;
|
|
||||||
if (fps_rounded < 20000) {
|
|
||||||
i += (fps_rounded - 2000) / 1000;
|
|
||||||
} else {
|
|
||||||
i += 20;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// fprintf(stderr, "fps = %.0f => i = %d\n", fps, i);
|
|
||||||
fps_distribution[i] += 1.;
|
|
||||||
fps_distribution[0] += 1.;
|
|
||||||
}
|
|
||||||
|
|
||||||
void fps_compute_stats(double *low, double *median, double *high, double *samples)
|
|
||||||
{
|
|
||||||
*median = *low = *high = *samples = -1;
|
|
||||||
if (!fps_distribution || fps_distribution[0] < 1)
|
|
||||||
return;
|
|
||||||
float total = fps_distribution[0];
|
|
||||||
*samples = (double) fps_distribution[0];
|
|
||||||
float cum_low = 0.05f * total;
|
|
||||||
float cum_median = 0.5f * total;
|
|
||||||
float cum_high = 0.95f * total;
|
|
||||||
float cum = 0;
|
|
||||||
for (int i = 1; i <= 166; i++) {
|
|
||||||
double value =
|
|
||||||
(i < 60) ? i : (i < 74) ? (60 + (i - 60) * 10) : (i < 146) ? (200 + (i - 74) * 25)
|
|
||||||
: (i < 165) ? (2000 + (i - 146) * 1000) : 20000;
|
|
||||||
// fprintf(stderr, "%6.0f (i = %3d) : %.0f | ", value, i, (double)fps_distribution[i]);
|
|
||||||
cum += fps_distribution[i];
|
|
||||||
if (*low < 0 && cum >= cum_low)
|
|
||||||
*low = value;
|
|
||||||
if (*median < 0 && cum >= cum_median)
|
|
||||||
*median = value;
|
|
||||||
if (*high < 0 && cum >= cum_high)
|
|
||||||
*high = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void detect_compositor(void *arg)
|
void detect_compositor(void *arg)
|
||||||
{
|
{
|
||||||
if (server.composite_manager) {
|
if (server.composite_manager) {
|
||||||
@@ -424,20 +344,7 @@ void init(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
} else if (i + 1 == argc) {
|
} else if (i + 1 == argc) {
|
||||||
config_path = strdup(argv[i]);
|
config_path = strdup(argv[i]);
|
||||||
}
|
} else {
|
||||||
#ifdef ENABLE_BATTERY
|
|
||||||
else if (strcmp(argv[i], "--battery-sys-prefix") == 0) {
|
|
||||||
if (i + 1 < argc) {
|
|
||||||
i++;
|
|
||||||
battery_sys_prefix = strdup(argv[i]);
|
|
||||||
} else {
|
|
||||||
error = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
else {
|
|
||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
@@ -468,11 +375,6 @@ void init(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
debug_geometry = getenv("DEBUG_GEOMETRY") != NULL;
|
debug_geometry = getenv("DEBUG_GEOMETRY") != NULL;
|
||||||
debug_gradients = getenv("DEBUG_GRADIENTS") != NULL;
|
|
||||||
debug_fps = getenv("DEBUG_FPS") != NULL;
|
|
||||||
debug_frames = getenv("DEBUG_FRAMES") != NULL;
|
|
||||||
if (debug_fps)
|
|
||||||
create_fps_distribution();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sigchild_pipe_valid = FALSE;
|
static int sigchild_pipe_valid = FALSE;
|
||||||
@@ -563,9 +465,6 @@ void init_X11_pre_config()
|
|||||||
|
|
||||||
void init_X11_post_config()
|
void init_X11_post_config()
|
||||||
{
|
{
|
||||||
if (primary_monitor_first)
|
|
||||||
sort_monitors();
|
|
||||||
|
|
||||||
server_init_visual();
|
server_init_visual();
|
||||||
|
|
||||||
gboolean need_sigchld = FALSE;
|
gboolean need_sigchld = FALSE;
|
||||||
@@ -609,8 +508,8 @@ void init_X11_post_config()
|
|||||||
}
|
}
|
||||||
if (!default_icon) {
|
if (!default_icon) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
RED "Could not load default_icon.png. Please check that tint2 has been installed correctly!" RESET
|
RED "Could not load default_icon.png. Please check that tint2 has been installed correctly!" RESET
|
||||||
"\n");
|
"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,11 +549,21 @@ void cleanup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
uevent_cleanup();
|
uevent_cleanup();
|
||||||
cleanup_fps_distribution();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump_panel_to_file(const Panel *panel, const char *path)
|
void get_snapshot(const char *path)
|
||||||
{
|
{
|
||||||
|
Panel *panel = &panels[0];
|
||||||
|
|
||||||
|
if (panel->area.width > server.monitors[0].width)
|
||||||
|
panel->area.width = server.monitors[0].width;
|
||||||
|
|
||||||
|
panel->temp_pmap =
|
||||||
|
XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth);
|
||||||
|
render_panel(panel);
|
||||||
|
|
||||||
|
XSync(server.display, False);
|
||||||
|
|
||||||
imlib_context_set_drawable(panel->temp_pmap);
|
imlib_context_set_drawable(panel->temp_pmap);
|
||||||
Imlib_Image img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 1);
|
Imlib_Image img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 1);
|
||||||
|
|
||||||
@@ -663,7 +572,7 @@ void dump_panel_to_file(const Panel *panel, const char *path)
|
|||||||
XGetImage(server.display, panel->temp_pmap, 0, 0, panel->area.width, panel->area.height, AllPlanes, ZPixmap);
|
XGetImage(server.display, panel->temp_pmap, 0, 0, panel->area.width, panel->area.height, AllPlanes, ZPixmap);
|
||||||
|
|
||||||
if (ximg) {
|
if (ximg) {
|
||||||
DATA32 *pixels = (DATA32 *)calloc(panel->area.width * panel->area.height, sizeof(DATA32));
|
DATA32 *pixels = calloc(panel->area.width * panel->area.height, sizeof(DATA32));
|
||||||
for (int x = 0; x < panel->area.width; x++) {
|
for (int x = 0; x < panel->area.width; x++) {
|
||||||
for (int y = 0; y < panel->area.height; y++) {
|
for (int y = 0; y < panel->area.height; y++) {
|
||||||
DATA32 xpixel = XGetPixel(ximg, x, y);
|
DATA32 xpixel = XGetPixel(ximg, x, y);
|
||||||
@@ -694,22 +603,6 @@ void dump_panel_to_file(const Panel *panel, const char *path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_snapshot(const char *path)
|
|
||||||
{
|
|
||||||
Panel *panel = &panels[0];
|
|
||||||
|
|
||||||
if (panel->area.width > server.monitors[0].width)
|
|
||||||
panel->area.width = server.monitors[0].width;
|
|
||||||
|
|
||||||
panel->temp_pmap =
|
|
||||||
XCreatePixmap(server.display, server.root_win, panel->area.width, panel->area.height, server.depth);
|
|
||||||
render_panel(panel);
|
|
||||||
|
|
||||||
XSync(server.display, False);
|
|
||||||
|
|
||||||
dump_panel_to_file(panel, path);
|
|
||||||
}
|
|
||||||
|
|
||||||
void window_action(Task *task, MouseAction action)
|
void window_action(Task *task, MouseAction action)
|
||||||
{
|
{
|
||||||
if (!task)
|
if (!task)
|
||||||
@@ -778,8 +671,8 @@ int tint2_handles_click(Panel *panel, XButtonEvent *e)
|
|||||||
Task *task = click_task(panel, e->x, e->y);
|
Task *task = click_task(panel, e->x, e->y);
|
||||||
if (task) {
|
if (task) {
|
||||||
if ((e->button == 1 && mouse_left != 0) || (e->button == 2 && mouse_middle != 0) ||
|
if ((e->button == 1 && mouse_left != 0) || (e->button == 2 && mouse_middle != 0) ||
|
||||||
(e->button == 3 && mouse_right != 0) || (e->button == 4 && mouse_scroll_up != 0) ||
|
(e->button == 3 && mouse_right != 0) || (e->button == 4 && mouse_scroll_up != 0) ||
|
||||||
(e->button == 5 && mouse_scroll_down != 0)) {
|
(e->button == 5 && mouse_scroll_down != 0)) {
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
@@ -798,8 +691,8 @@ int tint2_handles_click(Panel *panel, XButtonEvent *e)
|
|||||||
return 1;
|
return 1;
|
||||||
if (click_clock(panel, e->x, e->y)) {
|
if (click_clock(panel, e->x, e->y)) {
|
||||||
if ((e->button == 1 && clock_lclick_command) || (e->button == 2 && clock_mclick_command) ||
|
if ((e->button == 1 && clock_lclick_command) || (e->button == 2 && clock_mclick_command) ||
|
||||||
(e->button == 3 && clock_rclick_command) || (e->button == 4 && clock_uwheel_command) ||
|
(e->button == 3 && clock_rclick_command) || (e->button == 4 && clock_uwheel_command) ||
|
||||||
(e->button == 5 && clock_dwheel_command))
|
(e->button == 5 && clock_dwheel_command))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
@@ -807,8 +700,8 @@ int tint2_handles_click(Panel *panel, XButtonEvent *e)
|
|||||||
#ifdef ENABLE_BATTERY
|
#ifdef ENABLE_BATTERY
|
||||||
if (click_battery(panel, e->x, e->y)) {
|
if (click_battery(panel, e->x, e->y)) {
|
||||||
if ((e->button == 1 && battery_lclick_command) || (e->button == 2 && battery_mclick_command) ||
|
if ((e->button == 1 && battery_lclick_command) || (e->button == 2 && battery_mclick_command) ||
|
||||||
(e->button == 3 && battery_rclick_command) || (e->button == 4 && battery_uwheel_command) ||
|
(e->button == 3 && battery_rclick_command) || (e->button == 4 && battery_uwheel_command) ||
|
||||||
(e->button == 5 && battery_dwheel_command))
|
(e->button == 5 && battery_dwheel_command))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
@@ -877,7 +770,7 @@ void event_button_motion_notify(XEvent *e)
|
|||||||
task_iter->data = drag_iter->data;
|
task_iter->data = drag_iter->data;
|
||||||
drag_iter->data = temp;
|
drag_iter->data = temp;
|
||||||
event_taskbar->area.resize_needed = 1;
|
event_taskbar->area.resize_needed = 1;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
task_dragged = 1;
|
task_dragged = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -908,7 +801,7 @@ void event_button_motion_notify(XEvent *e)
|
|||||||
event_taskbar->area.resize_needed = 1;
|
event_taskbar->area.resize_needed = 1;
|
||||||
drag_taskbar->area.resize_needed = 1;
|
drag_taskbar->area.resize_needed = 1;
|
||||||
task_dragged = 1;
|
task_dragged = 1;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
panel->area.resize_needed = 1;
|
panel->area.resize_needed = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1008,7 +901,7 @@ void event_button_release(XEvent *e)
|
|||||||
if (taskbar_mode == MULTI_DESKTOP) {
|
if (taskbar_mode == MULTI_DESKTOP) {
|
||||||
gboolean diff_desktop = FALSE;
|
gboolean diff_desktop = FALSE;
|
||||||
if (taskbar->desktop != server.desktop && action != CLOSE && action != DESKTOP_LEFT &&
|
if (taskbar->desktop != server.desktop && action != CLOSE && action != DESKTOP_LEFT &&
|
||||||
action != DESKTOP_RIGHT) {
|
action != DESKTOP_RIGHT) {
|
||||||
diff_desktop = TRUE;
|
diff_desktop = TRUE;
|
||||||
change_desktop(taskbar->desktop);
|
change_desktop(taskbar->desktop);
|
||||||
}
|
}
|
||||||
@@ -1063,7 +956,7 @@ void update_desktop_names()
|
|||||||
for (GSList *l = list; l; l = l->next)
|
for (GSList *l = list; l; l = l->next)
|
||||||
g_free(l->data);
|
g_free(l->data);
|
||||||
g_slist_free(list);
|
g_slist_free(list);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_task_desktop(Task *task)
|
void update_task_desktop(Task *task)
|
||||||
@@ -1073,7 +966,7 @@ void update_task_desktop(Task *task)
|
|||||||
remove_task(task);
|
remove_task(task);
|
||||||
task = add_task(win);
|
task = add_task(win);
|
||||||
reset_active_task();
|
reset_active_task();
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void event_property_notify(XEvent *e)
|
void event_property_notify(XEvent *e)
|
||||||
@@ -1107,8 +1000,8 @@ void event_property_notify(XEvent *e)
|
|||||||
}
|
}
|
||||||
// Change desktops
|
// Change desktops
|
||||||
else if (at == server.atom._NET_NUMBER_OF_DESKTOPS || at == server.atom._NET_DESKTOP_GEOMETRY ||
|
else if (at == server.atom._NET_NUMBER_OF_DESKTOPS || at == server.atom._NET_DESKTOP_GEOMETRY ||
|
||||||
at == server.atom._NET_DESKTOP_VIEWPORT || at == server.atom._NET_WORKAREA ||
|
at == server.atom._NET_DESKTOP_VIEWPORT || at == server.atom._NET_WORKAREA ||
|
||||||
at == server.atom._NET_CURRENT_DESKTOP) {
|
at == server.atom._NET_CURRENT_DESKTOP) {
|
||||||
if (debug)
|
if (debug)
|
||||||
fprintf(stderr, "%s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__);
|
fprintf(stderr, "%s %d: win = root, atom = ?? desktops changed\n", __FUNCTION__, __LINE__);
|
||||||
if (!taskbar_enabled)
|
if (!taskbar_enabled)
|
||||||
@@ -1131,11 +1024,8 @@ void event_property_notify(XEvent *e)
|
|||||||
taskbar_refresh_tasklist();
|
taskbar_refresh_tasklist();
|
||||||
reset_active_task();
|
reset_active_task();
|
||||||
update_all_taskbars_visibility();
|
update_all_taskbars_visibility();
|
||||||
if (old_desktop != server.desktop)
|
panel_refresh = TRUE;
|
||||||
tooltip_trigger_hide();
|
|
||||||
schedule_panel_redraw();
|
|
||||||
} else if (old_desktop != server.desktop) {
|
} else if (old_desktop != server.desktop) {
|
||||||
tooltip_trigger_hide();
|
|
||||||
for (int i = 0; i < num_panels; i++) {
|
for (int i = 0; i < num_panels; i++) {
|
||||||
Panel *panel = &panels[i];
|
Panel *panel = &panels[i];
|
||||||
set_taskbar_state(&panel->taskbar[old_desktop], TASKBAR_NORMAL);
|
set_taskbar_state(&panel->taskbar[old_desktop], TASKBAR_NORMAL);
|
||||||
@@ -1152,7 +1042,7 @@ void event_property_notify(XEvent *e)
|
|||||||
if (task->desktop == ALL_DESKTOPS) {
|
if (task->desktop == ALL_DESKTOPS) {
|
||||||
task->area.on_screen = always_show_all_desktop_tasks;
|
task->area.on_screen = always_show_all_desktop_tasks;
|
||||||
taskbar->area.resize_needed = 1;
|
taskbar->area.resize_needed = 1;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
if (taskbar_mode == MULTI_DESKTOP)
|
if (taskbar_mode == MULTI_DESKTOP)
|
||||||
panel->area.resize_needed = 1;
|
panel->area.resize_needed = 1;
|
||||||
}
|
}
|
||||||
@@ -1203,14 +1093,14 @@ void event_property_notify(XEvent *e)
|
|||||||
fprintf(stderr, "%s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__);
|
fprintf(stderr, "%s %d: win = root, atom = _NET_CLIENT_LIST\n", __FUNCTION__, __LINE__);
|
||||||
taskbar_refresh_tasklist();
|
taskbar_refresh_tasklist();
|
||||||
update_all_taskbars_visibility();
|
update_all_taskbars_visibility();
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
// Change active
|
// Change active
|
||||||
else if (at == server.atom._NET_ACTIVE_WINDOW) {
|
else if (at == server.atom._NET_ACTIVE_WINDOW) {
|
||||||
if (debug)
|
if (debug)
|
||||||
fprintf(stderr, "%s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __FUNCTION__, __LINE__);
|
fprintf(stderr, "%s %d: win = root, atom = _NET_ACTIVE_WINDOW\n", __FUNCTION__, __LINE__);
|
||||||
reset_active_task();
|
reset_active_task();
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
} else if (at == server.atom._XROOTPMAP_ID || at == server.atom._XROOTMAP_ID) {
|
} else if (at == server.atom._XROOTPMAP_ID || at == server.atom._XROOTMAP_ID) {
|
||||||
if (debug)
|
if (debug)
|
||||||
fprintf(stderr, "%s %d: win = root, atom = _XROOTPMAP_ID\n", __FUNCTION__, __LINE__);
|
fprintf(stderr, "%s %d: win = root, atom = _XROOTPMAP_ID\n", __FUNCTION__, __LINE__);
|
||||||
@@ -1218,7 +1108,7 @@ void event_property_notify(XEvent *e)
|
|||||||
for (int i = 0; i < num_panels; i++) {
|
for (int i = 0; i < num_panels; i++) {
|
||||||
set_panel_background(&panels[i]);
|
set_panel_background(&panels[i]);
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TrayWindow *traywin = systray_find_icon(win);
|
TrayWindow *traywin = systray_find_icon(win);
|
||||||
@@ -1231,12 +1121,12 @@ void event_property_notify(XEvent *e)
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
char *atom_name = XGetAtomName(server.display, at);
|
char *atom_name = XGetAtomName(server.display, at);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s %d: win = %ld, task = %s, atom = %s\n",
|
"%s %d: win = %ld, task = %s, atom = %s\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
win,
|
win,
|
||||||
task ? (task->title ? task->title : "??") : "null",
|
task ? (task->title ? task->title : "??") : "null",
|
||||||
atom_name);
|
atom_name);
|
||||||
XFree(atom_name);
|
XFree(atom_name);
|
||||||
}
|
}
|
||||||
if (!task) {
|
if (!task) {
|
||||||
@@ -1249,7 +1139,7 @@ void event_property_notify(XEvent *e)
|
|||||||
XGetWindowAttributes(server.display, win, &wa);
|
XGetWindowAttributes(server.display, win, &wa);
|
||||||
if (wa.map_state == IsViewable && !window_is_skip_taskbar(win)) {
|
if (wa.map_state == IsViewable && !window_is_skip_taskbar(win)) {
|
||||||
if ((task = add_task(win)))
|
if ((task = add_task(win)))
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -1265,7 +1155,7 @@ void event_property_notify(XEvent *e)
|
|||||||
}
|
}
|
||||||
if (taskbar_sort_method == TASKBAR_SORT_TITLE)
|
if (taskbar_sort_method == TASKBAR_SORT_TITLE)
|
||||||
sort_taskbar_for_win(win);
|
sort_taskbar_for_win(win);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Demand attention
|
// Demand attention
|
||||||
@@ -1285,7 +1175,7 @@ void event_property_notify(XEvent *e)
|
|||||||
}
|
}
|
||||||
if (window_is_skip_taskbar(win)) {
|
if (window_is_skip_taskbar(win)) {
|
||||||
remove_task(task);
|
remove_task(task);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
} else if (at == server.atom.WM_STATE) {
|
} else if (at == server.atom.WM_STATE) {
|
||||||
// Iconic state
|
// Iconic state
|
||||||
@@ -1293,12 +1183,12 @@ void event_property_notify(XEvent *e)
|
|||||||
if (window_is_iconified(win))
|
if (window_is_iconified(win))
|
||||||
state = TASK_ICONIFIED;
|
state = TASK_ICONIFIED;
|
||||||
set_task_state(task, state);
|
set_task_state(task, state);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
// Window icon changed
|
// Window icon changed
|
||||||
else if (at == server.atom._NET_WM_ICON) {
|
else if (at == server.atom._NET_WM_ICON) {
|
||||||
task_update_icon(task);
|
task_update_icon(task);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
// Window desktop changed
|
// Window desktop changed
|
||||||
else if (at == server.atom._NET_WM_DESKTOP) {
|
else if (at == server.atom._NET_WM_DESKTOP) {
|
||||||
@@ -1315,7 +1205,7 @@ void event_property_notify(XEvent *e)
|
|||||||
}
|
}
|
||||||
XFree(wmhints);
|
XFree(wmhints);
|
||||||
task_update_icon(task);
|
task_update_icon(task);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!server.got_root_win)
|
if (!server.got_root_win)
|
||||||
@@ -1330,7 +1220,7 @@ void event_expose(XEvent *e)
|
|||||||
if (!panel)
|
if (!panel)
|
||||||
return;
|
return;
|
||||||
// TODO : one panel_refresh per panel ?
|
// TODO : one panel_refresh per panel ?
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void event_configure_notify(XEvent *e)
|
void event_configure_notify(XEvent *e)
|
||||||
@@ -1340,19 +1230,19 @@ void event_configure_notify(XEvent *e)
|
|||||||
if (0) {
|
if (0) {
|
||||||
Task *task = get_task(win);
|
Task *task = get_task(win);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s %d: win = %ld, task = %s\n",
|
"%s %d: win = %ld, task = %s\n",
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
win,
|
win,
|
||||||
task ? (task->title ? task->title : "??") : "null");
|
task ? (task->title ? task->title : "??") : "null");
|
||||||
}
|
}
|
||||||
|
|
||||||
// change in root window (xrandr)
|
// change in root window (xrandr)
|
||||||
if (win == server.root_win) {
|
if (win == server.root_win) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window" RESET "\n",
|
YELLOW "%s %d: triggering tint2 restart due to configuration change in the root window" RESET "\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
signal_pending = SIGUSR1;
|
signal_pending = SIGUSR1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1370,15 +1260,15 @@ void event_configure_notify(XEvent *e)
|
|||||||
Panel *p = task->area.panel;
|
Panel *p = task->area.panel;
|
||||||
int monitor = get_window_monitor(win);
|
int monitor = get_window_monitor(win);
|
||||||
if ((hide_task_diff_monitor && p->monitor != monitor && task->area.on_screen) ||
|
if ((hide_task_diff_monitor && p->monitor != monitor && task->area.on_screen) ||
|
||||||
(hide_task_diff_monitor && p->monitor == monitor && !task->area.on_screen) ||
|
(hide_task_diff_monitor && p->monitor == monitor && !task->area.on_screen) ||
|
||||||
(p->monitor != monitor && num_panels > 1)) {
|
(p->monitor != monitor && num_panels > 1)) {
|
||||||
remove_task(task);
|
remove_task(task);
|
||||||
task = add_task(win);
|
task = add_task(win);
|
||||||
if (win == get_active_window()) {
|
if (win == get_active_window()) {
|
||||||
set_task_state(task, TASK_ACTIVE);
|
set_task_state(task, TASK_ACTIVE);
|
||||||
active_task = task;
|
active_task = task;
|
||||||
}
|
}
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1427,17 +1317,17 @@ struct Property read_property(Display *disp, Window w, Atom property)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
XFree(ret);
|
XFree(ret);
|
||||||
XGetWindowProperty(disp,
|
XGetWindowProperty(disp,
|
||||||
w,
|
w,
|
||||||
property,
|
property,
|
||||||
0,
|
0,
|
||||||
read_bytes,
|
read_bytes,
|
||||||
False,
|
False,
|
||||||
AnyPropertyType,
|
AnyPropertyType,
|
||||||
&actual_type,
|
&actual_type,
|
||||||
&actual_format,
|
&actual_format,
|
||||||
&nitems,
|
&nitems,
|
||||||
&bytes_after,
|
&bytes_after,
|
||||||
&ret);
|
&ret);
|
||||||
read_bytes *= 2;
|
read_bytes *= 2;
|
||||||
} while (bytes_after != 0);
|
} while (bytes_after != 0);
|
||||||
|
|
||||||
@@ -1593,18 +1483,18 @@ void dnd_drop(XClientMessageEvent *e)
|
|||||||
if (dnd_target_window && dnd_launcher_exec) {
|
if (dnd_target_window && dnd_launcher_exec) {
|
||||||
if (dnd_version >= 1) {
|
if (dnd_version >= 1) {
|
||||||
XConvertSelection(server.display,
|
XConvertSelection(server.display,
|
||||||
server.atom.XdndSelection,
|
server.atom.XdndSelection,
|
||||||
XA_STRING,
|
XA_STRING,
|
||||||
dnd_selection,
|
dnd_selection,
|
||||||
dnd_target_window,
|
dnd_target_window,
|
||||||
e->data.l[2]);
|
e->data.l[2]);
|
||||||
} else {
|
} else {
|
||||||
XConvertSelection(server.display,
|
XConvertSelection(server.display,
|
||||||
server.atom.XdndSelection,
|
server.atom.XdndSelection,
|
||||||
XA_STRING,
|
XA_STRING,
|
||||||
dnd_selection,
|
dnd_selection,
|
||||||
dnd_target_window,
|
dnd_target_window,
|
||||||
CurrentTime);
|
CurrentTime);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// The source is sending anyway, despite instructions to the contrary.
|
// The source is sending anyway, despite instructions to the contrary.
|
||||||
@@ -1632,8 +1522,8 @@ start:
|
|||||||
|
|
||||||
if (!config_read()) {
|
if (!config_read()) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Could not read config file.\n"
|
"Could not read config file.\n"
|
||||||
"Usage: tint2 [[-c] <config_file>]\n");
|
"Usage: tint2 [[-c] <config_file>]\n");
|
||||||
cleanup();
|
cleanup();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -1666,74 +1556,69 @@ start:
|
|||||||
int ufd = uevent_init();
|
int ufd = uevent_init();
|
||||||
int hidden_dnd = 0;
|
int hidden_dnd = 0;
|
||||||
|
|
||||||
double ts_event_read = 0;
|
|
||||||
double ts_event_processed = 0;
|
|
||||||
double ts_render_finished = 0;
|
|
||||||
double ts_flush_finished = 0;
|
|
||||||
gboolean first_render = TRUE;
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (panel_refresh) {
|
if (panel_refresh) {
|
||||||
if (debug_fps)
|
|
||||||
ts_event_processed = get_time();
|
|
||||||
if (systray_profile)
|
if (systray_profile)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
BLUE "[%f] %s:%d redrawing panel" RESET "\n",
|
BLUE "[%f] %s:%d redrawing panel" RESET "\n",
|
||||||
profiling_get_time(),
|
profiling_get_time(),
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
panel_refresh = FALSE;
|
panel_refresh = FALSE;
|
||||||
|
|
||||||
for (int i = 0; i < num_panels; i++) {
|
for (int i = 0; i < num_panels; i++) {
|
||||||
Panel *panel = &panels[i];
|
Panel *panel = &panels[i];
|
||||||
if (!first_render)
|
|
||||||
shrink_panel(panel);
|
|
||||||
|
|
||||||
if (!panel->is_hidden || panel->area.resize_needed) {
|
|
||||||
if (panel->temp_pmap)
|
|
||||||
XFreePixmap(server.display, panel->temp_pmap);
|
|
||||||
panel->temp_pmap = XCreatePixmap(server.display,
|
|
||||||
server.root_win,
|
|
||||||
panel->area.width,
|
|
||||||
panel->area.height,
|
|
||||||
server.depth);
|
|
||||||
render_panel(panel);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel->is_hidden) {
|
if (panel->is_hidden) {
|
||||||
if (!panel->hidden_pixmap) {
|
if (!panel->hidden_pixmap) {
|
||||||
panel->hidden_pixmap = XCreatePixmap(server.display,
|
panel->hidden_pixmap = XCreatePixmap(server.display,
|
||||||
server.root_win,
|
server.root_win,
|
||||||
panel->hidden_width,
|
panel->hidden_width,
|
||||||
panel->hidden_height,
|
panel->hidden_height,
|
||||||
server.depth);
|
server.depth);
|
||||||
int xoff = 0, yoff = 0;
|
int xoff = 0, yoff = 0;
|
||||||
if (panel_horizontal && panel_position & BOTTOM)
|
if (panel_horizontal && panel_position & BOTTOM)
|
||||||
yoff = panel->area.height - panel->hidden_height;
|
yoff = panel->area.height - panel->hidden_height;
|
||||||
else if (!panel_horizontal && panel_position & RIGHT)
|
else if (!panel_horizontal && panel_position & RIGHT)
|
||||||
xoff = panel->area.width - panel->hidden_width;
|
xoff = panel->area.width - panel->hidden_width;
|
||||||
XCopyArea(server.display,
|
XCopyArea(server.display,
|
||||||
panel->area.pix,
|
panel->area.pix,
|
||||||
panel->hidden_pixmap,
|
panel->hidden_pixmap,
|
||||||
server.gc,
|
server.gc,
|
||||||
xoff,
|
xoff,
|
||||||
yoff,
|
yoff,
|
||||||
panel->hidden_width,
|
panel->hidden_width,
|
||||||
panel->hidden_height,
|
panel->hidden_height,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
XCopyArea(server.display,
|
XCopyArea(server.display,
|
||||||
panel->hidden_pixmap,
|
panel->hidden_pixmap,
|
||||||
panel->main_win,
|
panel->main_win,
|
||||||
server.gc,
|
server.gc,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
panel->hidden_width,
|
panel->hidden_width,
|
||||||
panel->hidden_height,
|
panel->hidden_height,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
XSetWindowBackgroundPixmap(server.display, panel->main_win, panel->hidden_pixmap);
|
XSetWindowBackgroundPixmap(server.display, panel->main_win, panel->hidden_pixmap);
|
||||||
} else {
|
} else {
|
||||||
|
if (panel->temp_pmap)
|
||||||
|
XFreePixmap(server.display, panel->temp_pmap);
|
||||||
|
panel->temp_pmap = XCreatePixmap(server.display,
|
||||||
|
server.root_win,
|
||||||
|
panel->area.width,
|
||||||
|
panel->area.height,
|
||||||
|
server.depth);
|
||||||
|
render_panel(panel);
|
||||||
|
if (panel == (Panel *)systray.area.panel) {
|
||||||
|
if (refresh_systray && panel && !panel->is_hidden) {
|
||||||
|
refresh_systray = FALSE;
|
||||||
|
XSetWindowBackgroundPixmap(server.display, panel->main_win, panel->temp_pmap);
|
||||||
|
refresh_systray_icons();
|
||||||
|
}
|
||||||
|
}
|
||||||
XCopyArea(server.display,
|
XCopyArea(server.display,
|
||||||
panel->temp_pmap,
|
panel->temp_pmap,
|
||||||
panel->main_win,
|
panel->main_win,
|
||||||
@@ -1744,54 +1629,9 @@ start:
|
|||||||
panel->area.height,
|
panel->area.height,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
if (panel == (Panel *)systray.area.panel) {
|
|
||||||
if (refresh_systray && panel && !panel->is_hidden) {
|
|
||||||
refresh_systray = FALSE;
|
|
||||||
XSetWindowBackgroundPixmap(server.display, panel->main_win, panel->temp_pmap);
|
|
||||||
refresh_systray_icons();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (first_render) {
|
|
||||||
first_render = FALSE;
|
|
||||||
if (panel_shrink)
|
|
||||||
schedule_panel_redraw();
|
|
||||||
}
|
|
||||||
if (debug_fps)
|
|
||||||
ts_render_finished = get_time();
|
|
||||||
XFlush(server.display);
|
XFlush(server.display);
|
||||||
if (debug_fps && ts_event_read > 0) {
|
|
||||||
ts_flush_finished = get_time();
|
|
||||||
double period = ts_flush_finished - ts_event_read;
|
|
||||||
double fps = 1.0 / period;
|
|
||||||
sample_fps(fps);
|
|
||||||
double proc_ratio = (ts_event_processed - ts_event_read) / period;
|
|
||||||
double render_ratio = (ts_render_finished - ts_event_processed) / period;
|
|
||||||
double flush_ratio = (ts_flush_finished - ts_render_finished) / period;
|
|
||||||
double fps_low, fps_median, fps_high, fps_samples;
|
|
||||||
fps_compute_stats(&fps_low, &fps_median, &fps_high, &fps_samples);
|
|
||||||
fprintf(stderr,
|
|
||||||
BLUE "frame %d: fps = %.0f (low %.0f, med %.0f, high %.0f, samples %.0f) : processing %.0f%%, rendering %.0f%%, "
|
|
||||||
"flushing %.0f%%" RESET "\n",
|
|
||||||
frame,
|
|
||||||
fps,
|
|
||||||
fps_low,
|
|
||||||
fps_median,
|
|
||||||
fps_high,
|
|
||||||
fps_samples,
|
|
||||||
proc_ratio * 100,
|
|
||||||
render_ratio * 100,
|
|
||||||
flush_ratio * 100);
|
|
||||||
}
|
|
||||||
if (debug_frames) {
|
|
||||||
for (int i = 0; i < num_panels; i++) {
|
|
||||||
char path[256];
|
|
||||||
sprintf(path, "tint2-%d-panel-%d-frame-%d.png", getpid(), i, frame);
|
|
||||||
dump_panel_to_file(&panels[i], path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
frame++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a File Description Set containing x11_fd
|
// Create a File Description Set containing x11_fd
|
||||||
@@ -1819,7 +1659,6 @@ start:
|
|||||||
struct timeval *select_timeout = (next_timeout.tv_sec >= 0 && next_timeout.tv_usec >= 0) ? &next_timeout : NULL;
|
struct timeval *select_timeout = (next_timeout.tv_sec >= 0 && next_timeout.tv_usec >= 0) ? &next_timeout : NULL;
|
||||||
|
|
||||||
// Wait for X Event or a Timer
|
// Wait for X Event or a Timer
|
||||||
ts_event_read = 0;
|
|
||||||
if (XPending(server.display) > 0 || select(maxfd + 1, &fdset, 0, 0, select_timeout) >= 0) {
|
if (XPending(server.display) > 0 || select(maxfd + 1, &fdset, 0, 0, select_timeout) >= 0) {
|
||||||
uevent_handler();
|
uevent_handler();
|
||||||
|
|
||||||
@@ -1836,15 +1675,13 @@ start:
|
|||||||
for (l_instance = execp->backend->instances; l_instance; l_instance = l_instance->next) {
|
for (l_instance = execp->backend->instances; l_instance; l_instance = l_instance->next) {
|
||||||
Execp *instance = l_instance->data;
|
Execp *instance = l_instance->data;
|
||||||
instance->area.resize_needed = TRUE;
|
instance->area.resize_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (XPending(server.display) > 0) {
|
if (XPending(server.display) > 0) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
XNextEvent(server.display, &e);
|
XNextEvent(server.display, &e);
|
||||||
if (debug_fps)
|
|
||||||
ts_event_read = get_time();
|
|
||||||
#if HAVE_SN
|
#if HAVE_SN
|
||||||
if (startup_notifications)
|
if (startup_notifications)
|
||||||
sn_display_process_event(server.sn_display, &e);
|
sn_display_process_event(server.sn_display, &e);
|
||||||
@@ -1863,7 +1700,7 @@ start:
|
|||||||
} else
|
} else
|
||||||
continue; // discard further processing of this event because the panel is not visible yet
|
continue; // discard further processing of this event because the panel is not visible yet
|
||||||
} else if (hidden_dnd && e.type == ClientMessage &&
|
} else if (hidden_dnd && e.type == ClientMessage &&
|
||||||
e.xclient.message_type == server.atom.XdndLeave) {
|
e.xclient.message_type == server.atom.XdndLeave) {
|
||||||
hidden_dnd = 0;
|
hidden_dnd = 0;
|
||||||
autohide_hide(panel);
|
autohide_hide(panel);
|
||||||
}
|
}
|
||||||
@@ -1961,9 +1798,9 @@ start:
|
|||||||
if (e.xany.window == server.composite_manager) {
|
if (e.xany.window == server.composite_manager) {
|
||||||
// Stop real_transparency
|
// Stop real_transparency
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
YELLOW "%s %d: triggering tint2 restart due to compositor shutdown" RESET "\n",
|
YELLOW "%s %d: triggering tint2 restart due to compositor shutdown" RESET "\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
signal_pending = SIGUSR1;
|
signal_pending = SIGUSR1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1983,21 +1820,21 @@ start:
|
|||||||
if (ev->data.l[2] == None) {
|
if (ev->data.l[2] == None) {
|
||||||
// Stop real_transparency
|
// Stop real_transparency
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n",
|
YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
signal_pending = SIGUSR1;
|
signal_pending = SIGUSR1;
|
||||||
} else {
|
} else {
|
||||||
// Start real_transparency
|
// Start real_transparency
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n",
|
YELLOW "%s %d: triggering tint2 restart due to change in transparency" RESET "\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__);
|
__LINE__);
|
||||||
signal_pending = SIGUSR1;
|
signal_pending = SIGUSR1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (systray_enabled && e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE &&
|
if (systray_enabled && e.xclient.message_type == server.atom._NET_SYSTEM_TRAY_OPCODE &&
|
||||||
e.xclient.format == 32 && e.xclient.window == net_sel_win) {
|
e.xclient.format == 32 && e.xclient.window == net_sel_win) {
|
||||||
net_message(&e.xclient);
|
net_message(&e.xclient);
|
||||||
} else if (e.xclient.message_type == server.atom.XdndEnter) {
|
} else if (e.xclient.message_type == server.atom.XdndEnter) {
|
||||||
dnd_enter(&e.xclient);
|
dnd_enter(&e.xclient);
|
||||||
@@ -2015,20 +1852,20 @@ start:
|
|||||||
fprintf(stderr, "DnD %s:%d: A selection notify has arrived!\n", __FILE__, __LINE__);
|
fprintf(stderr, "DnD %s:%d: A selection notify has arrived!\n", __FILE__, __LINE__);
|
||||||
fprintf(stderr, "DnD %s:%d: Requestor = %lu\n", __FILE__, __LINE__, e.xselectionrequest.requestor);
|
fprintf(stderr, "DnD %s:%d: Requestor = %lu\n", __FILE__, __LINE__, e.xselectionrequest.requestor);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"DnD %s:%d: Selection atom = %s\n",
|
"DnD %s:%d: Selection atom = %s\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
GetAtomName(server.display, e.xselection.selection));
|
GetAtomName(server.display, e.xselection.selection));
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"DnD %s:%d: Target atom = %s\n",
|
"DnD %s:%d: Target atom = %s\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
GetAtomName(server.display, target));
|
GetAtomName(server.display, target));
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"DnD %s:%d: Property atom = %s\n",
|
"DnD %s:%d: Property atom = %s\n",
|
||||||
__FILE__,
|
__FILE__,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
GetAtomName(server.display, e.xselection.property));
|
GetAtomName(server.display, e.xselection.property));
|
||||||
|
|
||||||
if (e.xselection.property != None && dnd_launcher_exec) {
|
if (e.xselection.property != None && dnd_launcher_exec) {
|
||||||
Property prop = read_property(server.display, dnd_target_window, dnd_selection);
|
Property prop = read_property(server.display, dnd_target_window, dnd_selection);
|
||||||
@@ -2044,11 +1881,11 @@ start:
|
|||||||
// Request the data type we are able to select
|
// Request the data type we are able to select
|
||||||
fprintf(stderr, "Now requsting type %s", GetAtomName(server.display, dnd_atom));
|
fprintf(stderr, "Now requsting type %s", GetAtomName(server.display, dnd_atom));
|
||||||
XConvertSelection(server.display,
|
XConvertSelection(server.display,
|
||||||
dnd_selection,
|
dnd_selection,
|
||||||
dnd_atom,
|
dnd_atom,
|
||||||
dnd_selection,
|
dnd_selection,
|
||||||
dnd_target_window,
|
dnd_target_window,
|
||||||
CurrentTime);
|
CurrentTime);
|
||||||
}
|
}
|
||||||
} else if (target == dnd_atom) {
|
} else if (target == dnd_atom) {
|
||||||
// Dump the binary data
|
// Dump the binary data
|
||||||
|
|||||||
@@ -26,13 +26,10 @@ set(SOURCES ../util/common.c
|
|||||||
../server.c
|
../server.c
|
||||||
../launcher/apps-common.c
|
../launcher/apps-common.c
|
||||||
../launcher/icon-theme-common.c
|
../launcher/icon-theme-common.c
|
||||||
md4.c
|
|
||||||
main.c
|
main.c
|
||||||
properties.c
|
properties.c
|
||||||
properties_rw.c
|
properties_rw.c
|
||||||
theme_view.c
|
theme_view.c )
|
||||||
background_gui.c
|
|
||||||
gradient_gui.c )
|
|
||||||
|
|
||||||
add_definitions( -DTINT2CONF )
|
add_definitions( -DTINT2CONF )
|
||||||
|
|
||||||
@@ -60,8 +57,12 @@ target_link_libraries( tint2conf ${X11_T2C_LIBRARIES}
|
|||||||
${GTK2_LIBRARIES}
|
${GTK2_LIBRARIES}
|
||||||
${RSVG_LIBRARIES} )
|
${RSVG_LIBRARIES} )
|
||||||
|
|
||||||
|
if ( NOT DATADIR )
|
||||||
|
set(DATADIR share)
|
||||||
|
endif( NOT DATADIR )
|
||||||
|
|
||||||
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_PREFIX}/${DATADIR}/locale\" )
|
||||||
add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" )
|
add_definitions( -DGETTEXT_PACKAGE=\"tint2conf\" )
|
||||||
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -pthread -std=c99" )
|
set_target_properties( tint2conf PROPERTIES COMPILE_FLAGS "-Wall -pthread -std=c99" )
|
||||||
set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
|
set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
|
||||||
@@ -69,5 +70,6 @@ set_target_properties( tint2conf PROPERTIES LINK_FLAGS "-pthread" )
|
|||||||
add_subdirectory(po)
|
add_subdirectory(po)
|
||||||
|
|
||||||
install( TARGETS tint2conf DESTINATION bin )
|
install( TARGETS tint2conf DESTINATION bin )
|
||||||
install( FILES tint2conf.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps )
|
install( FILES tint2conf.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/apps )
|
||||||
install( FILES tint2conf.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )
|
install( FILES tint2conf.desktop DESTINATION ${DATADIR}/applications )
|
||||||
|
install( CODE "execute_process(COMMAND gtk-update-icon-cache -f -t ${DATADIR}/icons/hicolor WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})" )
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +0,0 @@
|
|||||||
#ifndef BACKGROUND_GUI_H
|
|
||||||
#define BACKGROUND_GUI_H
|
|
||||||
|
|
||||||
#include "gui.h"
|
|
||||||
|
|
||||||
void create_background(GtkWidget *parent);
|
|
||||||
void background_duplicate(GtkWidget *widget, gpointer data);
|
|
||||||
void background_delete(GtkWidget *widget, gpointer data);
|
|
||||||
void background_update_image(int index);
|
|
||||||
void background_update(GtkWidget *widget, gpointer data);
|
|
||||||
void current_background_changed(GtkWidget *widget, gpointer data);
|
|
||||||
void background_combo_changed(GtkWidget *widget, gpointer data);
|
|
||||||
GtkWidget *create_background_combo(const char *label);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,612 +0,0 @@
|
|||||||
#include "gradient_gui.h"
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
GtkListStore *gradient_ids, *gradient_stop_ids;
|
|
||||||
GList *gradients;
|
|
||||||
GtkWidget *current_gradient, *gradient_combo_type, *gradient_start_color, *gradient_end_color, *current_gradient_stop,
|
|
||||||
*gradient_stop_color, *gradient_stop_offset;
|
|
||||||
|
|
||||||
int gradient_index_safe(int index)
|
|
||||||
{
|
|
||||||
if (index <= 0)
|
|
||||||
index = 0;
|
|
||||||
if (index >= get_model_length(GTK_TREE_MODEL(gradient_ids)))
|
|
||||||
index = 0;
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkWidget *create_gradient_combo()
|
|
||||||
{
|
|
||||||
GtkWidget *combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(gradient_ids));
|
|
||||||
GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
|
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE);
|
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "pixbuf", grColPixbuf, NULL);
|
|
||||||
renderer = gtk_cell_renderer_text_new();
|
|
||||||
g_object_set(renderer, "wrap-mode", PANGO_WRAP_WORD, NULL);
|
|
||||||
g_object_set(renderer, "wrap-width", 300, NULL);
|
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE);
|
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "text", grColText, NULL);
|
|
||||||
return combo;
|
|
||||||
}
|
|
||||||
|
|
||||||
void create_gradient(GtkWidget *parent)
|
|
||||||
{
|
|
||||||
gradient_ids = gtk_list_store_new(grNumCols, GDK_TYPE_PIXBUF, GTK_TYPE_INT, GTK_TYPE_STRING);
|
|
||||||
gradients = NULL;
|
|
||||||
|
|
||||||
gradient_stop_ids = gtk_list_store_new(grStopNumCols, GDK_TYPE_PIXBUF);
|
|
||||||
|
|
||||||
GtkWidget *table, *label, *button;
|
|
||||||
int row, col;
|
|
||||||
// GtkTooltips *tooltips = gtk_tooltips_new();
|
|
||||||
|
|
||||||
table = gtk_table_new(1, 4, FALSE);
|
|
||||||
gtk_widget_show(table);
|
|
||||||
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
|
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
|
|
||||||
gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING);
|
|
||||||
|
|
||||||
row = 0, col = 0;
|
|
||||||
label = gtk_label_new(_("<b>Gradient</b>"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
current_gradient = create_gradient_combo();
|
|
||||||
gtk_widget_show(current_gradient);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), current_gradient, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-add");
|
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_duplicate), NULL);
|
|
||||||
gtk_widget_show(button);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-remove");
|
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_delete), NULL);
|
|
||||||
gtk_widget_show(button);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
table = gtk_table_new(3, 4, FALSE);
|
|
||||||
gtk_widget_show(table);
|
|
||||||
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
|
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
|
|
||||||
gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING);
|
|
||||||
|
|
||||||
row = 0, col = 2;
|
|
||||||
label = gtk_label_new(_("Type"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
gradient_combo_type = gtk_combo_box_new_text();
|
|
||||||
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);
|
|
||||||
col++;
|
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(gradient_combo_type), _("Vertical"));
|
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(gradient_combo_type), _("Horizontal"));
|
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(gradient_combo_type), _("Radial"));
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(gradient_combo_type), 0);
|
|
||||||
|
|
||||||
row++, col = 2;
|
|
||||||
label = gtk_label_new(_("Start color"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
gradient_start_color = gtk_color_button_new();
|
|
||||||
gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(gradient_start_color), TRUE);
|
|
||||||
gtk_widget_show(gradient_start_color);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), gradient_start_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
row++, col = 2;
|
|
||||||
label = gtk_label_new(_("End color"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
gradient_end_color = gtk_color_button_new();
|
|
||||||
gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(gradient_end_color), TRUE);
|
|
||||||
gtk_widget_show(gradient_end_color);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), gradient_end_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
change_paragraph(parent);
|
|
||||||
|
|
||||||
table = gtk_table_new(1, 4, FALSE);
|
|
||||||
gtk_widget_show(table);
|
|
||||||
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
|
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
|
|
||||||
gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING);
|
|
||||||
|
|
||||||
row = 0, col = 0;
|
|
||||||
label = gtk_label_new(_("<b>Color stop</b>"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
current_gradient_stop = create_gradient_stop_combo(NULL);
|
|
||||||
gtk_widget_show(current_gradient_stop);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), current_gradient_stop, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-add");
|
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_stop_duplicate), NULL);
|
|
||||||
gtk_widget_show(button);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
button = gtk_button_new_from_stock("gtk-remove");
|
|
||||||
gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gradient_stop_delete), NULL);
|
|
||||||
gtk_widget_show(button);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), button, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
table = gtk_table_new(3, 4, FALSE);
|
|
||||||
gtk_widget_show(table);
|
|
||||||
gtk_box_pack_start(GTK_BOX(parent), table, FALSE, FALSE, 0);
|
|
||||||
gtk_table_set_row_spacings(GTK_TABLE(table), ROW_SPACING);
|
|
||||||
gtk_table_set_col_spacings(GTK_TABLE(table), COL_SPACING);
|
|
||||||
|
|
||||||
row = 0, col = 2;
|
|
||||||
label = gtk_label_new(_("Color"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
gradient_stop_color = gtk_color_button_new();
|
|
||||||
gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(gradient_stop_color), TRUE);
|
|
||||||
gtk_widget_show(gradient_stop_color);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), gradient_stop_color, col, col + 1, row, row + 1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
row++, col = 2;
|
|
||||||
label = gtk_label_new(_("Position"));
|
|
||||||
gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
|
|
||||||
gtk_widget_show(label);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), label, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
gradient_stop_offset = gtk_spin_button_new_with_range(0, 100, 1);
|
|
||||||
gtk_widget_show(gradient_stop_offset);
|
|
||||||
gtk_table_attach(GTK_TABLE(table), gradient_stop_offset, col, col+1, row, row+1, GTK_FILL, 0, 0, 0);
|
|
||||||
col++;
|
|
||||||
|
|
||||||
g_signal_connect(G_OBJECT(current_gradient), "changed", G_CALLBACK(current_gradient_changed), NULL);
|
|
||||||
g_signal_connect(G_OBJECT(gradient_combo_type), "changed", G_CALLBACK(gradient_update), NULL);
|
|
||||||
g_signal_connect(G_OBJECT(gradient_start_color), "color-set", G_CALLBACK(gradient_update), NULL);
|
|
||||||
g_signal_connect(G_OBJECT(gradient_end_color), "color-set", G_CALLBACK(gradient_update), NULL);
|
|
||||||
|
|
||||||
g_signal_connect(G_OBJECT(current_gradient_stop), "changed", G_CALLBACK(current_gradient_stop_changed), NULL);
|
|
||||||
g_signal_connect(G_OBJECT(gradient_stop_color), "color-set", G_CALLBACK(gradient_stop_update), NULL);
|
|
||||||
g_signal_connect(G_OBJECT(gradient_stop_offset), "value-changed", G_CALLBACK(gradient_stop_update), NULL);
|
|
||||||
|
|
||||||
change_paragraph(parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_create_new(GradientConfigType t)
|
|
||||||
{
|
|
||||||
int index = get_model_length(GTK_TREE_MODEL(gradient_ids));
|
|
||||||
|
|
||||||
GradientConfig *g = (GradientConfig *)calloc(1, sizeof(GradientConfig));
|
|
||||||
g->type = t;
|
|
||||||
gradients = g_list_append(gradients, g);
|
|
||||||
GtkTreeIter iter;
|
|
||||||
gtk_list_store_append(gradient_ids, &iter);
|
|
||||||
gtk_list_store_set(gradient_ids, &iter,
|
|
||||||
grColPixbuf, NULL,
|
|
||||||
grColId, &index,
|
|
||||||
grColText, index == 0 ? _("None") : "",
|
|
||||||
-1);
|
|
||||||
|
|
||||||
gradient_update_image(index);
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient), index);
|
|
||||||
current_gradient_changed(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
gpointer copy_GradientConfigColorStop(gconstpointer arg, gpointer data)
|
|
||||||
{
|
|
||||||
GradientConfigColorStop *old = (GradientConfigColorStop *)arg;
|
|
||||||
|
|
||||||
GradientConfigColorStop *copy = (GradientConfigColorStop *)calloc(1, sizeof(GradientConfigColorStop));
|
|
||||||
memcpy(copy, old, sizeof(GradientConfigColorStop));
|
|
||||||
return copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_duplicate(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
int old_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (old_index < 0) {
|
|
||||||
gradient_create_new(GRADIENT_CONFIG_VERTICAL);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientConfig *g_old = (GradientConfig*)g_list_nth(gradients, (guint)old_index)->data;
|
|
||||||
|
|
||||||
int index = get_model_length(GTK_TREE_MODEL(gradient_ids));
|
|
||||||
|
|
||||||
GradientConfig *g = (GradientConfig *)calloc(1, sizeof(GradientConfig));
|
|
||||||
g->type = g_old->type;
|
|
||||||
g->start_color = g_old->start_color;
|
|
||||||
g->end_color = g_old->end_color;
|
|
||||||
g->extra_color_stops = g_list_copy_deep(g->extra_color_stops, copy_GradientConfigColorStop, NULL);
|
|
||||||
gradients = g_list_append(gradients, g);
|
|
||||||
GtkTreeIter iter;
|
|
||||||
gtk_list_store_append(gradient_ids, &iter);
|
|
||||||
gtk_list_store_set(gradient_ids, &iter,
|
|
||||||
grColPixbuf, NULL,
|
|
||||||
grColId, &index,
|
|
||||||
grColText, "",
|
|
||||||
-1);
|
|
||||||
|
|
||||||
gradient_update_image(index);
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient), index);
|
|
||||||
current_gradient_changed(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_delete(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (get_model_length(GTK_TREE_MODEL(gradient_ids)) <= 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_indices(index, -1);
|
|
||||||
gtk_tree_model_get_iter(GTK_TREE_MODEL(gradient_ids), &iter, path);
|
|
||||||
gtk_tree_path_free(path);
|
|
||||||
|
|
||||||
gradients = g_list_remove(gradients, g_list_nth(gradients, (guint)index)->data);
|
|
||||||
gtk_list_store_remove(gradient_ids, &iter);
|
|
||||||
|
|
||||||
background_update_for_gradient(index);
|
|
||||||
|
|
||||||
if (index >= get_model_length(GTK_TREE_MODEL(gradient_ids)))
|
|
||||||
index--;
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient), index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_draw(cairo_t *c, GradientConfig *g, int w, int h, gboolean preserve)
|
|
||||||
{
|
|
||||||
cairo_pattern_t *gpat;
|
|
||||||
if (g->type == GRADIENT_CONFIG_VERTICAL)
|
|
||||||
gpat = cairo_pattern_create_linear(0, 0, 0, h);
|
|
||||||
else if (g->type == GRADIENT_CONFIG_HORIZONTAL)
|
|
||||||
gpat = cairo_pattern_create_linear(0, 0, w, 0);
|
|
||||||
else gpat = cairo_pattern_create_radial(w/2, h/2, 0, w/2, h/2, sqrt(w * w + h * h) / 2);
|
|
||||||
cairo_pattern_add_color_stop_rgba(gpat, 0.0, g->start_color.color.rgb[0], g->start_color.color.rgb[1], g->start_color.color.rgb[2], g->start_color.color.alpha);
|
|
||||||
for (GList *l = g->extra_color_stops; l; l = l->next) {
|
|
||||||
GradientConfigColorStop *stop = (GradientConfigColorStop *)l->data;
|
|
||||||
cairo_pattern_add_color_stop_rgba(gpat,
|
|
||||||
stop->offset,
|
|
||||||
stop->color.rgb[0],
|
|
||||||
stop->color.rgb[1],
|
|
||||||
stop->color.rgb[2],
|
|
||||||
stop->color.alpha);
|
|
||||||
}
|
|
||||||
cairo_pattern_add_color_stop_rgba(gpat, 1.0, g->end_color.color.rgb[0], g->end_color.color.rgb[1], g->end_color.color.rgb[2], g->end_color.color.alpha);
|
|
||||||
cairo_set_source(c, gpat);
|
|
||||||
cairo_rectangle(c, 0, 0, w, h);
|
|
||||||
if (preserve)
|
|
||||||
cairo_fill_preserve(c);
|
|
||||||
else
|
|
||||||
cairo_fill(c);
|
|
||||||
cairo_pattern_destroy(gpat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_update_image(int index)
|
|
||||||
{
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)index)->data;
|
|
||||||
|
|
||||||
int w = 70;
|
|
||||||
int h = 30;
|
|
||||||
GdkPixmap *pixmap = gdk_pixmap_new(NULL, w, h, 24);
|
|
||||||
|
|
||||||
cairo_t *cr = gdk_cairo_create(pixmap);
|
|
||||||
cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
|
|
||||||
cairo_rectangle(cr, 0, 0, w, h);
|
|
||||||
cairo_fill(cr);
|
|
||||||
|
|
||||||
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);
|
|
||||||
if (pixmap)
|
|
||||||
g_object_unref(pixmap);
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_indices(index, -1);
|
|
||||||
gtk_tree_model_get_iter(GTK_TREE_MODEL(gradient_ids), &iter, path);
|
|
||||||
gtk_tree_path_free(path);
|
|
||||||
|
|
||||||
gtk_list_store_set(gradient_ids, &iter,
|
|
||||||
grColPixbuf, pixbuf,
|
|
||||||
-1);
|
|
||||||
if (pixbuf)
|
|
||||||
g_object_unref(pixbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_force_update()
|
|
||||||
{
|
|
||||||
gradient_update(NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean gradient_updates_disabled = FALSE;
|
|
||||||
void gradient_update(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
if (gradient_updates_disabled)
|
|
||||||
return;
|
|
||||||
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (index <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_indices(index, -1);
|
|
||||||
gtk_tree_model_get_iter(GTK_TREE_MODEL(gradient_ids), &iter, path);
|
|
||||||
gtk_tree_path_free(path);
|
|
||||||
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)index)->data;
|
|
||||||
|
|
||||||
g->type = (GradientConfigType)MAX(0, gtk_combo_box_get_active(GTK_COMBO_BOX(gradient_combo_type)));
|
|
||||||
|
|
||||||
GdkColor color;
|
|
||||||
int opacity;
|
|
||||||
|
|
||||||
gtk_color_button_get_color(GTK_COLOR_BUTTON(gradient_start_color), &color);
|
|
||||||
opacity = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(gradient_start_color)) * 100.0 / 0xffff);
|
|
||||||
gdkColor2CairoColor(color, &g->start_color.color.rgb[0], &g->start_color.color.rgb[1], &g->start_color.color.rgb[2]);
|
|
||||||
g->start_color.color.alpha = opacity / 100.0;
|
|
||||||
|
|
||||||
gtk_color_button_get_color(GTK_COLOR_BUTTON(gradient_end_color), &color);
|
|
||||||
opacity = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(gradient_end_color)) * 100.0 / 0xffff);
|
|
||||||
gdkColor2CairoColor(color, &g->end_color.color.rgb[0], &g->end_color.color.rgb[1], &g->end_color.color.rgb[2]);
|
|
||||||
g->end_color.color.alpha = opacity / 100.0;
|
|
||||||
|
|
||||||
gtk_list_store_set(gradient_ids, &iter,
|
|
||||||
grColPixbuf, NULL,
|
|
||||||
grColId, &index,
|
|
||||||
grColText, "",
|
|
||||||
-1);
|
|
||||||
gradient_update_image(index);
|
|
||||||
background_update_for_gradient(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void current_gradient_changed(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
gtk_widget_set_sensitive(gradient_combo_type, index > 0);
|
|
||||||
gtk_widget_set_sensitive(gradient_start_color, index > 0);
|
|
||||||
gtk_widget_set_sensitive(gradient_end_color, index > 0);
|
|
||||||
gtk_widget_set_sensitive(current_gradient_stop, index > 0);
|
|
||||||
gtk_widget_set_sensitive(gradient_stop_color, index > 0);
|
|
||||||
gtk_widget_set_sensitive(gradient_stop_offset, index > 0);
|
|
||||||
|
|
||||||
gradient_updates_disabled = TRUE;
|
|
||||||
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)index)->data;
|
|
||||||
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(gradient_combo_type), g->type);
|
|
||||||
|
|
||||||
GdkColor color;
|
|
||||||
int opacity;
|
|
||||||
|
|
||||||
cairoColor2GdkColor(g->start_color.color.rgb[0], g->start_color.color.rgb[1], g->start_color.color.rgb[2], &color);
|
|
||||||
opacity = g->start_color.color.alpha * 65535;
|
|
||||||
gtk_color_button_set_color(GTK_COLOR_BUTTON(gradient_start_color), &color);
|
|
||||||
gtk_color_button_set_alpha(GTK_COLOR_BUTTON(gradient_start_color), opacity);
|
|
||||||
|
|
||||||
cairoColor2GdkColor(g->end_color.color.rgb[0], g->end_color.color.rgb[1], g->end_color.color.rgb[2], &color);
|
|
||||||
opacity = g->end_color.color.alpha * 65535;
|
|
||||||
gtk_color_button_set_color(GTK_COLOR_BUTTON(gradient_end_color), &color);
|
|
||||||
gtk_color_button_set_alpha(GTK_COLOR_BUTTON(gradient_end_color), opacity);
|
|
||||||
|
|
||||||
int old_stop_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient_stop));
|
|
||||||
gtk_list_store_clear(gradient_stop_ids);
|
|
||||||
int stop_index = 0;
|
|
||||||
for (GList *l = g->extra_color_stops; l; l = l->next, stop_index++) {
|
|
||||||
GtkTreeIter iter;
|
|
||||||
gtk_list_store_append(gradient_stop_ids, &iter);
|
|
||||||
gtk_list_store_set(gradient_stop_ids, &iter,
|
|
||||||
grStopColPixbuf, NULL,
|
|
||||||
-1);
|
|
||||||
gradient_stop_update_image(stop_index);
|
|
||||||
}
|
|
||||||
if (old_stop_index >= 0 && old_stop_index < stop_index)
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient_stop), old_stop_index);
|
|
||||||
else
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient_stop), stop_index - 1);
|
|
||||||
|
|
||||||
gradient_updates_disabled = FALSE;
|
|
||||||
gradient_update_image(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
//////// Gradient stops
|
|
||||||
|
|
||||||
GtkWidget *create_gradient_stop_combo()
|
|
||||||
{
|
|
||||||
GtkWidget *combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(gradient_stop_ids));
|
|
||||||
GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
|
|
||||||
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE);
|
|
||||||
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), renderer, "pixbuf", grStopColPixbuf, NULL);
|
|
||||||
return combo;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_stop_create_new()
|
|
||||||
{
|
|
||||||
int g_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (g_index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)g_index)->data;
|
|
||||||
GradientConfigColorStop *stop = (GradientConfigColorStop *)calloc(1, sizeof(GradientConfigColorStop));
|
|
||||||
if (g->extra_color_stops)
|
|
||||||
memcpy(stop, g_list_last(g->extra_color_stops)->data, sizeof(GradientConfigColorStop));
|
|
||||||
else
|
|
||||||
memcpy(stop, &g->start_color, sizeof(GradientConfigColorStop));
|
|
||||||
g->extra_color_stops = g_list_append(g->extra_color_stops, stop);
|
|
||||||
GtkTreeIter iter;
|
|
||||||
gtk_list_store_append(gradient_stop_ids, &iter);
|
|
||||||
gtk_list_store_set(gradient_stop_ids, &iter,
|
|
||||||
grStopColPixbuf, NULL,
|
|
||||||
-1);
|
|
||||||
|
|
||||||
int stop_index = g_list_length(g->extra_color_stops) - 1;
|
|
||||||
gradient_stop_update_image(stop_index);
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient_stop), stop_index);
|
|
||||||
current_gradient_stop_changed(0, 0);
|
|
||||||
gradient_update_image(g_index);
|
|
||||||
background_update_for_gradient(g_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_stop_duplicate(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
gradient_stop_create_new();
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_stop_delete(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
int g_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (g_index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)g_index)->data;
|
|
||||||
if (!g->extra_color_stops)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient_stop));
|
|
||||||
if (index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_indices(index, -1);
|
|
||||||
gtk_tree_model_get_iter(GTK_TREE_MODEL(gradient_stop_ids), &iter, path);
|
|
||||||
gtk_tree_path_free(path);
|
|
||||||
|
|
||||||
g->extra_color_stops = g_list_remove(g->extra_color_stops, g_list_nth(g->extra_color_stops, (guint)index)->data);
|
|
||||||
gtk_list_store_remove(gradient_stop_ids, &iter);
|
|
||||||
|
|
||||||
if (index >= get_model_length(GTK_TREE_MODEL(gradient_stop_ids)))
|
|
||||||
index--;
|
|
||||||
gtk_combo_box_set_active(GTK_COMBO_BOX(current_gradient_stop), index);
|
|
||||||
|
|
||||||
gradient_update_image(g_index);
|
|
||||||
background_update_for_gradient(g_index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_stop_update_image(int index)
|
|
||||||
{
|
|
||||||
int g_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (g_index < 0)
|
|
||||||
return;
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)g_index)->data;
|
|
||||||
GradientConfigColorStop *stop = (GradientConfigColorStop *)g_list_nth(g->extra_color_stops, (guint)index)->data;
|
|
||||||
|
|
||||||
int w = 70;
|
|
||||||
int h = 30;
|
|
||||||
GdkPixmap *pixmap = gdk_pixmap_new(NULL, w, h, 24);
|
|
||||||
|
|
||||||
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_rectangle(cr, 0, 0, w, h);
|
|
||||||
cairo_fill(cr);
|
|
||||||
|
|
||||||
GdkPixbuf *pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, gdk_colormap_get_system(), 0, 0, 0, 0, w, h);
|
|
||||||
if (pixmap)
|
|
||||||
g_object_unref(pixmap);
|
|
||||||
|
|
||||||
GtkTreePath *path;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_indices(index, -1);
|
|
||||||
gtk_tree_model_get_iter(GTK_TREE_MODEL(gradient_stop_ids), &iter, path);
|
|
||||||
gtk_tree_path_free(path);
|
|
||||||
|
|
||||||
gtk_list_store_set(gradient_stop_ids, &iter,
|
|
||||||
grStopColPixbuf, pixbuf,
|
|
||||||
-1);
|
|
||||||
if (pixbuf)
|
|
||||||
g_object_unref(pixbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void current_gradient_stop_changed(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
int g_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (g_index < 0)
|
|
||||||
return;
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)g_index)->data;
|
|
||||||
|
|
||||||
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient_stop));
|
|
||||||
if (index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GradientConfigColorStop *stop = (GradientConfigColorStop *)g_list_nth(g->extra_color_stops, (guint)index)->data;
|
|
||||||
|
|
||||||
gradient_updates_disabled = TRUE;
|
|
||||||
|
|
||||||
GdkColor color;
|
|
||||||
int opacity;
|
|
||||||
|
|
||||||
cairoColor2GdkColor(stop->color.rgb[0], stop->color.rgb[1], stop->color.rgb[2], &color);
|
|
||||||
opacity = stop->color.alpha * 65535;
|
|
||||||
gtk_color_button_set_color(GTK_COLOR_BUTTON(gradient_stop_color), &color);
|
|
||||||
gtk_color_button_set_alpha(GTK_COLOR_BUTTON(gradient_stop_color), opacity);
|
|
||||||
|
|
||||||
gtk_spin_button_set_value(GTK_SPIN_BUTTON(gradient_stop_offset), stop->offset * 100);
|
|
||||||
|
|
||||||
gradient_updates_disabled = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void gradient_stop_update(GtkWidget *widget, gpointer data)
|
|
||||||
{
|
|
||||||
if (gradient_updates_disabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int g_index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient));
|
|
||||||
if (g_index < 0)
|
|
||||||
return;
|
|
||||||
GradientConfig *g = (GradientConfig *)g_list_nth(gradients, (guint)g_index)->data;
|
|
||||||
|
|
||||||
int index = gtk_combo_box_get_active(GTK_COMBO_BOX(current_gradient_stop));
|
|
||||||
if (index < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GradientConfigColorStop *stop = (GradientConfigColorStop *)g_list_nth(g->extra_color_stops, (guint)index)->data;
|
|
||||||
|
|
||||||
GdkColor color;
|
|
||||||
int opacity;
|
|
||||||
|
|
||||||
gtk_color_button_get_color(GTK_COLOR_BUTTON(gradient_stop_color), &color);
|
|
||||||
opacity = MIN(100, 0.5 + gtk_color_button_get_alpha(GTK_COLOR_BUTTON(gradient_stop_color)) * 100.0 / 0xffff);
|
|
||||||
gdkColor2CairoColor(color, &stop->color.rgb[0], &stop->color.rgb[1], &stop->color.rgb[2]);
|
|
||||||
stop->color.alpha = opacity / 100.0;
|
|
||||||
|
|
||||||
stop->offset = gtk_spin_button_get_value(GTK_SPIN_BUTTON(gradient_stop_offset)) / 100.;
|
|
||||||
|
|
||||||
gradient_stop_update_image(index);
|
|
||||||
gradient_update_image(g_index);
|
|
||||||
background_update_for_gradient(g_index);
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
#ifndef GRADIENT_GUI_H
|
|
||||||
#define GRADIENT_GUI_H
|
|
||||||
|
|
||||||
#include "gui.h"
|
|
||||||
|
|
||||||
int gradient_index_safe(int index);
|
|
||||||
void create_gradient(GtkWidget *parent);
|
|
||||||
GtkWidget *create_gradient_combo();
|
|
||||||
void gradient_duplicate(GtkWidget *widget, gpointer data);
|
|
||||||
void gradient_delete(GtkWidget *widget, gpointer data);
|
|
||||||
void gradient_update_image(int index);
|
|
||||||
void gradient_update(GtkWidget *widget, gpointer data);
|
|
||||||
void gradient_force_update();
|
|
||||||
void current_gradient_changed(GtkWidget *widget, gpointer data);
|
|
||||||
void background_update_for_gradient(int gradient_id);
|
|
||||||
|
|
||||||
GtkWidget *create_gradient_stop_combo();
|
|
||||||
void gradient_stop_duplicate(GtkWidget *widget, gpointer data);
|
|
||||||
void gradient_stop_delete(GtkWidget *widget, gpointer data);
|
|
||||||
void gradient_stop_update(GtkWidget *widget, gpointer data);
|
|
||||||
void gradient_stop_update_image(int index);
|
|
||||||
void current_gradient_stop_changed(GtkWidget *widget, gpointer data);
|
|
||||||
|
|
||||||
typedef enum GradientConfigType {
|
|
||||||
GRADIENT_CONFIG_VERTICAL = 0,
|
|
||||||
GRADIENT_CONFIG_HORIZONTAL,
|
|
||||||
GRADIENT_CONFIG_RADIAL
|
|
||||||
} GradientConfigType;
|
|
||||||
|
|
||||||
typedef struct GradientConfigColorStop {
|
|
||||||
Color color;
|
|
||||||
// offset in 0-1
|
|
||||||
double offset;
|
|
||||||
} GradientConfigColorStop;
|
|
||||||
|
|
||||||
typedef struct GradientConfig {
|
|
||||||
GradientConfigType type;
|
|
||||||
GradientConfigColorStop start_color;
|
|
||||||
GradientConfigColorStop end_color;
|
|
||||||
// Each element is a GradientConfigColorStop
|
|
||||||
GList *extra_color_stops;
|
|
||||||
} GradientConfig;
|
|
||||||
|
|
||||||
void gradient_create_new(GradientConfigType t);
|
|
||||||
void gradient_draw(cairo_t *c, GradientConfig *g, int w, int h, gboolean preserve);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#include <limits.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "main.h"
|
|
||||||
#include "properties.h"
|
|
||||||
#include "properties_rw.h"
|
|
||||||
#include "../launcher/apps-common.h"
|
|
||||||
#include "../launcher/icon-theme-common.h"
|
|
||||||
#include "../util/common.h"
|
|
||||||
#include "strnatcmp.h"
|
|
||||||
|
|
||||||
#define ROW_SPACING 10
|
|
||||||
#define COL_SPACING 8
|
|
||||||
#define DEFAULT_HOR_SPACING 5
|
|
||||||
|
|
||||||
gint compare_strings(gconstpointer a, gconstpointer b);
|
|
||||||
void change_paragraph(GtkWidget *widget);
|
|
||||||
int get_model_length(GtkTreeModel *model);
|
|
||||||
void gdkColor2CairoColor(GdkColor color, double *red, double *green, double *blue);
|
|
||||||
void cairoColor2GdkColor(double red, double green, double blue, GdkColor *color);
|
|
||||||
+5
-78
@@ -34,7 +34,6 @@ void refresh_theme(const char *given_path);
|
|||||||
void remove_theme(const char *given_path);
|
void remove_theme(const char *given_path);
|
||||||
static void theme_selection_changed(GtkWidget *treeview, gpointer userdata);
|
static void theme_selection_changed(GtkWidget *treeview, gpointer userdata);
|
||||||
static gchar *find_theme_in_system_dirs(const gchar *given_name);
|
static gchar *find_theme_in_system_dirs(const gchar *given_name);
|
||||||
static void load_specific_themes(char **paths, int count);
|
|
||||||
|
|
||||||
// ====== Utilities ======
|
// ====== Utilities ======
|
||||||
|
|
||||||
@@ -167,7 +166,6 @@ static void viewRowActivated(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeV
|
|||||||
|
|
||||||
static void select_first_theme();
|
static void select_first_theme();
|
||||||
static void load_all_themes();
|
static void load_all_themes();
|
||||||
static void reload_all_themes();
|
|
||||||
|
|
||||||
// ====== Globals ======
|
// ====== Globals ======
|
||||||
|
|
||||||
@@ -227,12 +225,12 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
gchar *tint2_config_dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL);
|
gchar *tint2_config_dir = g_build_filename(g_get_user_config_dir(), "tint2", NULL);
|
||||||
if (!g_file_test(tint2_config_dir, G_FILE_TEST_IS_DIR))
|
if (!g_file_test(tint2_config_dir, G_FILE_TEST_IS_DIR))
|
||||||
g_mkdir(tint2_config_dir, 0700);
|
g_mkdir(tint2_config_dir, 0777);
|
||||||
g_free(tint2_config_dir);
|
g_free(tint2_config_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_set_application_name(_("tint2conf"));
|
g_set_application_name(_("tint2conf"));
|
||||||
gtk_window_set_default_icon_name("tint2conf");
|
gtk_window_set_default_icon_name("taskbar");
|
||||||
|
|
||||||
// config file uses '.' as decimal separator
|
// config file uses '.' as decimal separator
|
||||||
setlocale(LC_NUMERIC, "POSIX");
|
setlocale(LC_NUMERIC, "POSIX");
|
||||||
@@ -257,7 +255,7 @@ int main(int argc, char **argv)
|
|||||||
{"ThemeEdit", GTK_STOCK_PROPERTIES, _("_Edit theme..."), NULL, _("Edit the selected theme"), G_CALLBACK(edit_theme)},
|
{"ThemeEdit", GTK_STOCK_PROPERTIES, _("_Edit theme..."), NULL, _("Edit the selected theme"), G_CALLBACK(edit_theme)},
|
||||||
{"ThemeMakeDefault", GTK_STOCK_APPLY, _("_Make default"), NULL, _("Replace the default theme with the selected one"), G_CALLBACK(make_selected_theme_default)},
|
{"ThemeMakeDefault", GTK_STOCK_APPLY, _("_Make default"), NULL, _("Replace the default theme with the selected one"), G_CALLBACK(make_selected_theme_default)},
|
||||||
{"ThemeRefresh", GTK_STOCK_REFRESH, _("Refresh"), NULL, _("Redraw the selected theme"), G_CALLBACK(refresh_current_theme)},
|
{"ThemeRefresh", GTK_STOCK_REFRESH, _("Refresh"), NULL, _("Redraw the selected theme"), G_CALLBACK(refresh_current_theme)},
|
||||||
{"RefreshAll", GTK_STOCK_REFRESH, _("Refresh all"), NULL, _("Redraw all themes"), G_CALLBACK(reload_all_themes)},
|
{"RefreshAll", GTK_STOCK_REFRESH, _("Refresh all"), NULL, _("Redraw all themes"), G_CALLBACK(load_all_themes)},
|
||||||
{"Quit", GTK_STOCK_QUIT, _("_Quit"), "<control>Q", _("Quit"), G_CALLBACK(gtk_main_quit)},
|
{"Quit", GTK_STOCK_QUIT, _("_Quit"), "<control>Q", _("Quit"), G_CALLBACK(gtk_main_quit)},
|
||||||
{"HelpMenu", NULL, _("_Help"), NULL, NULL, NULL},
|
{"HelpMenu", NULL, _("_Help"), NULL, NULL, NULL},
|
||||||
{"HelpAbout", GTK_STOCK_ABOUT, _("_About"), "<Control>A", _("About"), G_CALLBACK(menuAbout)}};
|
{"HelpAbout", GTK_STOCK_ABOUT, _("_About"), "<Control>A", _("About"), G_CALLBACK(menuAbout)}};
|
||||||
@@ -306,15 +304,9 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
// load themes
|
// load themes
|
||||||
load_all_themes();
|
load_all_themes();
|
||||||
argc--, argv++;
|
|
||||||
if (argc > 0) {
|
|
||||||
load_specific_themes(argv, argc);
|
|
||||||
g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)edit_theme, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_show_all(g_window);
|
gtk_widget_show_all(g_window);
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,10 +326,10 @@ static void menuAbout()
|
|||||||
"version",
|
"version",
|
||||||
VERSION_STRING,
|
VERSION_STRING,
|
||||||
"copyright",
|
"copyright",
|
||||||
_("Copyright 2009-2017 tint2 team\nTint2 License GNU GPL version 2\nTintwizard License GNU "
|
_("Copyright 2009-2015 tint2 team\nTint2 License GNU GPL version 2\nTintwizard License GNU "
|
||||||
"GPL version 3"),
|
"GPL version 3"),
|
||||||
"logo-icon-name",
|
"logo-icon-name",
|
||||||
"tint2conf",
|
"taskbar",
|
||||||
"authors",
|
"authors",
|
||||||
authors,
|
authors,
|
||||||
/* Translators: translate "translator-credits" as your name to have it appear in the credits
|
/* Translators: translate "translator-credits" as your name to have it appear in the credits
|
||||||
@@ -838,71 +830,6 @@ static void load_all_themes()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reload_all_themes()
|
|
||||||
{
|
|
||||||
ensure_default_theme_exists();
|
|
||||||
|
|
||||||
gtk_list_store_clear(GTK_LIST_STORE(theme_list_store));
|
|
||||||
theme_selection_changed(NULL, NULL);
|
|
||||||
|
|
||||||
gboolean found_themes = FALSE;
|
|
||||||
if (load_user_themes())
|
|
||||||
found_themes = TRUE;
|
|
||||||
if (load_system_themes())
|
|
||||||
found_themes = TRUE;
|
|
||||||
|
|
||||||
if (found_themes) {
|
|
||||||
select_first_theme();
|
|
||||||
|
|
||||||
GtkTreeIter iter;
|
|
||||||
GtkTreeModel *model;
|
|
||||||
gboolean have_iter;
|
|
||||||
|
|
||||||
model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
|
||||||
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
|
||||||
while (have_iter) {
|
|
||||||
gtk_list_store_set(theme_list_store, &iter, COL_SNAPSHOT, NULL, COL_FORCE_REFRESH, TRUE, -1);
|
|
||||||
have_iter = gtk_tree_model_iter_next(model, &iter);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void load_specific_themes(char **paths, int count)
|
|
||||||
{
|
|
||||||
ensure_default_theme_exists();
|
|
||||||
|
|
||||||
gboolean found_themes = FALSE;
|
|
||||||
while (count > 0) {
|
|
||||||
// Load configs
|
|
||||||
const char *file_name = paths[0];
|
|
||||||
paths++, count--;
|
|
||||||
if (g_file_test(file_name, G_FILE_TEST_IS_REGULAR) || g_file_test(file_name, G_FILE_TEST_IS_SYMLINK) ) {
|
|
||||||
theme_list_append(file_name);
|
|
||||||
if (!found_themes) {
|
|
||||||
select_theme(file_name);
|
|
||||||
found_themes = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found_themes) {
|
|
||||||
GtkTreeIter iter;
|
|
||||||
GtkTreeModel *model;
|
|
||||||
gboolean have_iter;
|
|
||||||
|
|
||||||
model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
|
||||||
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
|
||||||
while (have_iter) {
|
|
||||||
gtk_list_store_set(theme_list_store, &iter, COL_SNAPSHOT, NULL, -1);
|
|
||||||
have_iter = gtk_tree_model_iter_next(model, &iter);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_timeout_add(SNAPSHOT_TICK, (GSourceFunc)update_snapshot, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void refresh_current_theme()
|
void refresh_current_theme()
|
||||||
{
|
{
|
||||||
GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view));
|
GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(g_theme_view));
|
||||||
|
|||||||
@@ -1,274 +0,0 @@
|
|||||||
/*
|
|
||||||
* Cryptographic API.
|
|
||||||
*
|
|
||||||
* MD4 Message Digest Algorithm (RFC1320).
|
|
||||||
*
|
|
||||||
* Implementation derived from Andrew Tridgell and Steve French's
|
|
||||||
* CIFS MD4 implementation, and the cryptoapi implementation
|
|
||||||
* originally based on the public domain implementation written
|
|
||||||
* by Colin Plumb in 1993.
|
|
||||||
*
|
|
||||||
* Copyright (c) Andrew Tridgell 1997-1998.
|
|
||||||
* Modified by Steve French (sfrench@us.ibm.com) 2002
|
|
||||||
* Copyright (c) Cryptoapi developers.
|
|
||||||
* Copyright (c) 2002 David S. Miller (davem@redhat.com)
|
|
||||||
* Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
typedef u_int8_t u8;
|
|
||||||
typedef u_int32_t u32;
|
|
||||||
typedef u_int64_t u64;
|
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define shash_desc md4_ctx
|
|
||||||
#define shash_desc_ctx(x) (x)
|
|
||||||
|
|
||||||
#define MD4_DIGEST_SIZE 16
|
|
||||||
#define MD4_HMAC_BLOCK_SIZE 64
|
|
||||||
#define MD4_BLOCK_WORDS 16
|
|
||||||
#define MD4_HASH_WORDS 4
|
|
||||||
|
|
||||||
struct md4_ctx {
|
|
||||||
u32 hash[MD4_HASH_WORDS];
|
|
||||||
u32 block[MD4_BLOCK_WORDS];
|
|
||||||
u64 byte_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline u32 lshift(u32 x, unsigned int s)
|
|
||||||
{
|
|
||||||
x &= 0xFFFFFFFF;
|
|
||||||
return ((x << s) & 0xFFFFFFFF) | (x >> (32 - s));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline u32 F(u32 x, u32 y, u32 z)
|
|
||||||
{
|
|
||||||
return (x & y) | ((~x) & z);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline u32 G(u32 x, u32 y, u32 z)
|
|
||||||
{
|
|
||||||
return (x & y) | (x & z) | (y & z);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline u32 H(u32 x, u32 y, u32 z)
|
|
||||||
{
|
|
||||||
return x ^ y ^ z;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ROUND1(a,b,c,d,k,s) (a = lshift(a + F(b,c,d) + k, s))
|
|
||||||
#define ROUND2(a,b,c,d,k,s) (a = lshift(a + G(b,c,d) + k + (u32)0x5A827999,s))
|
|
||||||
#define ROUND3(a,b,c,d,k,s) (a = lshift(a + H(b,c,d) + k + (u32)0x6ED9EBA1,s))
|
|
||||||
|
|
||||||
/* XXX: this stuff can be optimized */
|
|
||||||
static inline void le32_to_cpu_array(u32 *buf, unsigned int words)
|
|
||||||
{
|
|
||||||
while (words--) {
|
|
||||||
*buf = ntohl(*buf);
|
|
||||||
buf++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void cpu_to_le32_array(u32 *buf, unsigned int words)
|
|
||||||
{
|
|
||||||
while (words--) {
|
|
||||||
*buf = htonl(*buf);
|
|
||||||
buf++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void md4_transform(u32 *hash, u32 const *in)
|
|
||||||
{
|
|
||||||
u32 a, b, c, d;
|
|
||||||
|
|
||||||
a = hash[0];
|
|
||||||
b = hash[1];
|
|
||||||
c = hash[2];
|
|
||||||
d = hash[3];
|
|
||||||
|
|
||||||
ROUND1(a, b, c, d, in[0], 3);
|
|
||||||
ROUND1(d, a, b, c, in[1], 7);
|
|
||||||
ROUND1(c, d, a, b, in[2], 11);
|
|
||||||
ROUND1(b, c, d, a, in[3], 19);
|
|
||||||
ROUND1(a, b, c, d, in[4], 3);
|
|
||||||
ROUND1(d, a, b, c, in[5], 7);
|
|
||||||
ROUND1(c, d, a, b, in[6], 11);
|
|
||||||
ROUND1(b, c, d, a, in[7], 19);
|
|
||||||
ROUND1(a, b, c, d, in[8], 3);
|
|
||||||
ROUND1(d, a, b, c, in[9], 7);
|
|
||||||
ROUND1(c, d, a, b, in[10], 11);
|
|
||||||
ROUND1(b, c, d, a, in[11], 19);
|
|
||||||
ROUND1(a, b, c, d, in[12], 3);
|
|
||||||
ROUND1(d, a, b, c, in[13], 7);
|
|
||||||
ROUND1(c, d, a, b, in[14], 11);
|
|
||||||
ROUND1(b, c, d, a, in[15], 19);
|
|
||||||
|
|
||||||
ROUND2(a, b, c, d,in[ 0], 3);
|
|
||||||
ROUND2(d, a, b, c, in[4], 5);
|
|
||||||
ROUND2(c, d, a, b, in[8], 9);
|
|
||||||
ROUND2(b, c, d, a, in[12], 13);
|
|
||||||
ROUND2(a, b, c, d, in[1], 3);
|
|
||||||
ROUND2(d, a, b, c, in[5], 5);
|
|
||||||
ROUND2(c, d, a, b, in[9], 9);
|
|
||||||
ROUND2(b, c, d, a, in[13], 13);
|
|
||||||
ROUND2(a, b, c, d, in[2], 3);
|
|
||||||
ROUND2(d, a, b, c, in[6], 5);
|
|
||||||
ROUND2(c, d, a, b, in[10], 9);
|
|
||||||
ROUND2(b, c, d, a, in[14], 13);
|
|
||||||
ROUND2(a, b, c, d, in[3], 3);
|
|
||||||
ROUND2(d, a, b, c, in[7], 5);
|
|
||||||
ROUND2(c, d, a, b, in[11], 9);
|
|
||||||
ROUND2(b, c, d, a, in[15], 13);
|
|
||||||
|
|
||||||
ROUND3(a, b, c, d,in[ 0], 3);
|
|
||||||
ROUND3(d, a, b, c, in[8], 9);
|
|
||||||
ROUND3(c, d, a, b, in[4], 11);
|
|
||||||
ROUND3(b, c, d, a, in[12], 15);
|
|
||||||
ROUND3(a, b, c, d, in[2], 3);
|
|
||||||
ROUND3(d, a, b, c, in[10], 9);
|
|
||||||
ROUND3(c, d, a, b, in[6], 11);
|
|
||||||
ROUND3(b, c, d, a, in[14], 15);
|
|
||||||
ROUND3(a, b, c, d, in[1], 3);
|
|
||||||
ROUND3(d, a, b, c, in[9], 9);
|
|
||||||
ROUND3(c, d, a, b, in[5], 11);
|
|
||||||
ROUND3(b, c, d, a, in[13], 15);
|
|
||||||
ROUND3(a, b, c, d, in[3], 3);
|
|
||||||
ROUND3(d, a, b, c, in[11], 9);
|
|
||||||
ROUND3(c, d, a, b, in[7], 11);
|
|
||||||
ROUND3(b, c, d, a, in[15], 15);
|
|
||||||
|
|
||||||
hash[0] += a;
|
|
||||||
hash[1] += b;
|
|
||||||
hash[2] += c;
|
|
||||||
hash[3] += d;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void md4_transform_helper(struct md4_ctx *ctx)
|
|
||||||
{
|
|
||||||
le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block));
|
|
||||||
md4_transform(ctx->hash, ctx->block);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int md4_init(struct shash_desc *desc)
|
|
||||||
{
|
|
||||||
struct md4_ctx *mctx = shash_desc_ctx(desc);
|
|
||||||
|
|
||||||
mctx->hash[0] = 0x67452301;
|
|
||||||
mctx->hash[1] = 0xefcdab89;
|
|
||||||
mctx->hash[2] = 0x98badcfe;
|
|
||||||
mctx->hash[3] = 0x10325476;
|
|
||||||
mctx->byte_count = 0;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int md4_update(struct shash_desc *desc, const u8 *data, unsigned int len)
|
|
||||||
{
|
|
||||||
struct md4_ctx *mctx = shash_desc_ctx(desc);
|
|
||||||
const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);
|
|
||||||
|
|
||||||
mctx->byte_count += len;
|
|
||||||
|
|
||||||
if (avail > len) {
|
|
||||||
memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
|
|
||||||
data, len);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
|
|
||||||
data, avail);
|
|
||||||
|
|
||||||
md4_transform_helper(mctx);
|
|
||||||
data += avail;
|
|
||||||
len -= avail;
|
|
||||||
|
|
||||||
while (len >= sizeof(mctx->block)) {
|
|
||||||
memcpy(mctx->block, data, sizeof(mctx->block));
|
|
||||||
md4_transform_helper(mctx);
|
|
||||||
data += sizeof(mctx->block);
|
|
||||||
len -= sizeof(mctx->block);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(mctx->block, data, len);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int md4_final(struct shash_desc *desc, u8 *out)
|
|
||||||
{
|
|
||||||
struct md4_ctx *mctx = shash_desc_ctx(desc);
|
|
||||||
const unsigned int offset = mctx->byte_count & 0x3f;
|
|
||||||
char *p = (char *)mctx->block + offset;
|
|
||||||
int padding = 56 - (offset + 1);
|
|
||||||
|
|
||||||
*p++ = 0x80;
|
|
||||||
if (padding < 0) {
|
|
||||||
memset(p, 0x00, padding + sizeof (u64));
|
|
||||||
md4_transform_helper(mctx);
|
|
||||||
p = (char *)mctx->block;
|
|
||||||
padding = 56;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(p, 0, padding);
|
|
||||||
mctx->block[14] = mctx->byte_count << 3;
|
|
||||||
mctx->block[15] = mctx->byte_count >> 29;
|
|
||||||
le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
|
|
||||||
sizeof(u64)) / sizeof(u32));
|
|
||||||
md4_transform(mctx->hash, mctx->block);
|
|
||||||
cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash));
|
|
||||||
memcpy(out, mctx->hash, sizeof(mctx->hash));
|
|
||||||
memset(mctx, 0, sizeof(*mctx));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char to_hex(u8 v)
|
|
||||||
{
|
|
||||||
v = v & 0xf;
|
|
||||||
if (v < 0xa)
|
|
||||||
return '0' + v;
|
|
||||||
return 'a' + v - 0xa;
|
|
||||||
}
|
|
||||||
|
|
||||||
void md4hexf(const char *path, char *hash)
|
|
||||||
{
|
|
||||||
struct md4_ctx mctx;
|
|
||||||
md4_init(&mctx);
|
|
||||||
|
|
||||||
int fd = open(path, O_RDONLY);
|
|
||||||
if (fd >= 0) {
|
|
||||||
u8 buffer[MD4_HMAC_BLOCK_SIZE];
|
|
||||||
while (1) {
|
|
||||||
ssize_t count = read(fd, buffer, sizeof(buffer));
|
|
||||||
if (count <= 0)
|
|
||||||
break;
|
|
||||||
md4_update(&mctx, buffer, (unsigned)count);
|
|
||||||
}
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
u8 out[MD4_DIGEST_SIZE];
|
|
||||||
md4_final(&mctx, out);
|
|
||||||
|
|
||||||
for (int i = 0; i < MD4_DIGEST_SIZE; i++) {
|
|
||||||
hash[2*i+0] = to_hex(out[i] >> 4);
|
|
||||||
hash[2*i+1] = to_hex(out[i] & 0xf);
|
|
||||||
}
|
|
||||||
hash[2*MD4_DIGEST_SIZE] = 0;
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#ifndef MD4_H
|
|
||||||
#define MD4_H
|
|
||||||
|
|
||||||
#define MD4_HEX_SIZE 33
|
|
||||||
void md4hexf(const char *path, char *hash);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -11,7 +11,7 @@ if (GETTEXT_FOUND)
|
|||||||
foreach(LANG ${LANGUAGES})
|
foreach(LANG ${LANGUAGES})
|
||||||
GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${LANG}.po)
|
GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES ${LANG}.po)
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo"
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo"
|
||||||
DESTINATION "${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES"
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${DATADIR}/locale/${LANG}/LC_MESSAGES"
|
||||||
RENAME "${GETTEXT_PACKAGE}.mo")
|
RENAME "${GETTEXT_PACKAGE}.mo")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+500
-605
File diff suppressed because it is too large
Load Diff
+494
-588
File diff suppressed because it is too large
Load Diff
+498
-602
File diff suppressed because it is too large
Load Diff
+565
-636
File diff suppressed because it is too large
Load Diff
+489
-593
File diff suppressed because it is too large
Load Diff
+498
-602
File diff suppressed because it is too large
Load Diff
+493
-575
File diff suppressed because it is too large
Load Diff
+789
-311
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@ extern GtkWidget *panel_window_name, *disable_transparency;
|
|||||||
extern GtkWidget *panel_mouse_effects;
|
extern GtkWidget *panel_mouse_effects;
|
||||||
extern GtkWidget *mouse_hover_icon_opacity, *mouse_hover_icon_saturation, *mouse_hover_icon_brightness;
|
extern GtkWidget *mouse_hover_icon_opacity, *mouse_hover_icon_saturation, *mouse_hover_icon_brightness;
|
||||||
extern GtkWidget *mouse_pressed_icon_opacity, *mouse_pressed_icon_saturation, *mouse_pressed_icon_brightness;
|
extern GtkWidget *mouse_pressed_icon_opacity, *mouse_pressed_icon_saturation, *mouse_pressed_icon_brightness;
|
||||||
extern GtkWidget *panel_primary_monitor_first, *panel_shrink;
|
extern GtkWidget *panel_primary_monitor_first;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
itemsColName = 0,
|
itemsColName = 0,
|
||||||
@@ -57,7 +57,6 @@ extern GtkWidget *taskbar_name_font, *taskbar_name_font_set;
|
|||||||
extern GtkWidget *taskbar_active_background, *taskbar_inactive_background;
|
extern GtkWidget *taskbar_active_background, *taskbar_inactive_background;
|
||||||
extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
|
extern GtkWidget *taskbar_name_active_background, *taskbar_name_inactive_background;
|
||||||
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks;
|
extern GtkWidget *taskbar_distribute_size, *taskbar_sort_order, *taskbar_alignment, *taskbar_always_show_all_desktop_tasks;
|
||||||
extern GtkWidget *taskbar_hide_empty;
|
|
||||||
|
|
||||||
// task
|
// task
|
||||||
extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
|
extern GtkWidget *task_mouse_left, *task_mouse_middle, *task_mouse_right, *task_mouse_scroll_up, *task_mouse_scroll_down;
|
||||||
@@ -111,7 +110,7 @@ extern GtkWidget *ac_connected_cmd, *ac_disconnected_cmd;
|
|||||||
// systray
|
// systray
|
||||||
extern GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing;
|
extern GtkWidget *systray_icon_order, *systray_padding_x, *systray_padding_y, *systray_spacing;
|
||||||
extern GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_saturation, *systray_icon_brightness;
|
extern GtkWidget *systray_icon_size, *systray_icon_opacity, *systray_icon_saturation, *systray_icon_brightness;
|
||||||
extern GtkWidget *systray_background, *systray_monitor, *systray_name_filter;
|
extern GtkWidget *systray_background, *systray_monitor;
|
||||||
|
|
||||||
// tooltip
|
// tooltip
|
||||||
extern GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_set, *tooltip_font_color;
|
extern GtkWidget *tooltip_padding_x, *tooltip_padding_y, *tooltip_font, *tooltip_font_set, *tooltip_font_color;
|
||||||
@@ -119,22 +118,6 @@ extern GtkWidget *tooltip_task_show, *tooltip_show_after, *tooltip_hide_after;
|
|||||||
extern GtkWidget *clock_format_tooltip, *clock_tmz_tooltip;
|
extern GtkWidget *clock_format_tooltip, *clock_tmz_tooltip;
|
||||||
extern GtkWidget *tooltip_background;
|
extern GtkWidget *tooltip_background;
|
||||||
|
|
||||||
// Separator
|
|
||||||
typedef struct Separator {
|
|
||||||
char name[256];
|
|
||||||
GtkWidget *container;
|
|
||||||
GtkWidget *page_separator;
|
|
||||||
GtkWidget *page_label;
|
|
||||||
GtkWidget *separator_background;
|
|
||||||
GtkWidget *separator_color;
|
|
||||||
GtkWidget *separator_style;
|
|
||||||
GtkWidget *separator_size;
|
|
||||||
GtkWidget *separator_padding_x;
|
|
||||||
GtkWidget *separator_padding_y;
|
|
||||||
} Separator;
|
|
||||||
|
|
||||||
extern GArray *separators;
|
|
||||||
|
|
||||||
// Executor
|
// Executor
|
||||||
typedef struct Executor {
|
typedef struct Executor {
|
||||||
char name[256];
|
char name[256];
|
||||||
@@ -185,7 +168,6 @@ enum {
|
|||||||
bgColFillOpacity,
|
bgColFillOpacity,
|
||||||
bgColBorderColor,
|
bgColBorderColor,
|
||||||
bgColBorderOpacity,
|
bgColBorderOpacity,
|
||||||
bgColGradientId,
|
|
||||||
bgColBorderWidth,
|
bgColBorderWidth,
|
||||||
bgColCornerRadius,
|
bgColCornerRadius,
|
||||||
bgColText,
|
bgColText,
|
||||||
@@ -193,12 +175,10 @@ enum {
|
|||||||
bgColFillOpacityOver,
|
bgColFillOpacityOver,
|
||||||
bgColBorderColorOver,
|
bgColBorderColorOver,
|
||||||
bgColBorderOpacityOver,
|
bgColBorderOpacityOver,
|
||||||
bgColGradientIdOver,
|
|
||||||
bgColFillColorPress,
|
bgColFillColorPress,
|
||||||
bgColFillOpacityPress,
|
bgColFillOpacityPress,
|
||||||
bgColBorderColorPress,
|
bgColBorderColorPress,
|
||||||
bgColBorderOpacityPress,
|
bgColBorderOpacityPress,
|
||||||
bgColGradientIdPress,
|
|
||||||
bgColBorderSidesTop,
|
bgColBorderSidesTop,
|
||||||
bgColBorderSidesBottom,
|
bgColBorderSidesBottom,
|
||||||
bgColBorderSidesLeft,
|
bgColBorderSidesLeft,
|
||||||
@@ -210,13 +190,10 @@ extern GtkListStore *backgrounds;
|
|||||||
extern GtkWidget *current_background,
|
extern GtkWidget *current_background,
|
||||||
*background_fill_color,
|
*background_fill_color,
|
||||||
*background_border_color,
|
*background_border_color,
|
||||||
*background_gradient,
|
|
||||||
*background_fill_color_over,
|
*background_fill_color_over,
|
||||||
*background_border_color_over,
|
*background_border_color_over,
|
||||||
*background_gradient_over,
|
|
||||||
*background_fill_color_press,
|
*background_fill_color_press,
|
||||||
*background_border_color_press,
|
*background_border_color_press,
|
||||||
*background_gradient_press,
|
|
||||||
*background_border_width,
|
*background_border_width,
|
||||||
*background_border_sides_top,
|
*background_border_sides_top,
|
||||||
*background_border_sides_bottom,
|
*background_border_sides_bottom,
|
||||||
@@ -224,41 +201,12 @@ extern GtkWidget *current_background,
|
|||||||
*background_border_sides_right,
|
*background_border_sides_right,
|
||||||
*background_corner_radius;
|
*background_corner_radius;
|
||||||
|
|
||||||
// gradients
|
|
||||||
enum {
|
|
||||||
grColPixbuf = 0,
|
|
||||||
grColId,
|
|
||||||
grColText,
|
|
||||||
grNumCols
|
|
||||||
};
|
|
||||||
|
|
||||||
// gradient color stops
|
|
||||||
enum {
|
|
||||||
grStopColPixbuf = 0,
|
|
||||||
grStopNumCols
|
|
||||||
};
|
|
||||||
extern GtkListStore *gradient_ids, *gradient_stop_ids;
|
|
||||||
extern GList *gradients;
|
|
||||||
|
|
||||||
extern GtkWidget *current_gradient,
|
|
||||||
*gradient_combo_type,
|
|
||||||
*gradient_start_color,
|
|
||||||
*gradient_end_color,
|
|
||||||
*current_gradient_stop,
|
|
||||||
*gradient_stop_color,
|
|
||||||
*gradient_stop_offset;
|
|
||||||
|
|
||||||
void background_create_new();
|
void background_create_new();
|
||||||
void background_force_update();
|
void background_force_update();
|
||||||
int background_index_safe(int index);
|
int background_index_safe(int index);
|
||||||
|
|
||||||
GtkWidget *create_properties();
|
GtkWidget *create_properties();
|
||||||
|
|
||||||
void separator_create_new();
|
|
||||||
Separator *separator_get_last();
|
|
||||||
void separator_remove(int i);
|
|
||||||
void separator_update_indices();
|
|
||||||
|
|
||||||
void execp_create_new();
|
void execp_create_new();
|
||||||
Executor *execp_get_last();
|
Executor *execp_get_last();
|
||||||
void execp_remove(int i);
|
void execp_remove(int i);
|
||||||
@@ -268,6 +216,4 @@ void create_please_wait(GtkWindow *parent);
|
|||||||
void process_events();
|
void process_events();
|
||||||
void destroy_please_wait();
|
void destroy_please_wait();
|
||||||
|
|
||||||
void hex2gdk(char *hex, GdkColor *color);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+503
-650
File diff suppressed because it is too large
Load Diff
+30
-31
@@ -22,7 +22,6 @@
|
|||||||
#include "strnatcmp.h"
|
#include "strnatcmp.h"
|
||||||
#include "theme_view.h"
|
#include "theme_view.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "md4.h"
|
|
||||||
|
|
||||||
// The data columns that we export via the tree model interface
|
// The data columns that we export via the tree model interface
|
||||||
GtkWidget *g_theme_view;
|
GtkWidget *g_theme_view;
|
||||||
@@ -38,7 +37,7 @@ GtkWidget *create_view()
|
|||||||
GtkCellRenderer *renderer;
|
GtkCellRenderer *renderer;
|
||||||
|
|
||||||
theme_list_store =
|
theme_list_store =
|
||||||
gtk_list_store_new(NB_COL, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT, G_TYPE_BOOLEAN);
|
gtk_list_store_new(NB_COL, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_INT, G_TYPE_INT);
|
||||||
|
|
||||||
GtkWidget *view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(theme_list_store));
|
GtkWidget *view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(theme_list_store));
|
||||||
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
|
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
|
||||||
@@ -148,20 +147,13 @@ void theme_list_append(const gchar *path)
|
|||||||
g_free(dir);
|
g_free(dir);
|
||||||
|
|
||||||
gchar *display_name = g_strdup_printf("%s\n(%s)", name, suffix);
|
gchar *display_name = g_strdup_printf("%s\n(%s)", name, suffix);
|
||||||
gtk_list_store_set(theme_list_store, &iter, COL_THEME_FILE, path, COL_THEME_NAME, display_name, COL_FORCE_REFRESH, FALSE, -1);
|
gtk_list_store_set(theme_list_store, &iter, COL_THEME_FILE, path, COL_THEME_NAME, display_name, -1);
|
||||||
g_free(display_name);
|
g_free(display_name);
|
||||||
g_free(suffix);
|
g_free(suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean update_snapshot()
|
gboolean update_snapshot()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
gchar *tint2_cache_dir = g_build_filename(g_get_user_cache_dir(), "tint2", NULL);
|
|
||||||
if (!g_file_test(tint2_cache_dir, G_FILE_TEST_IS_DIR))
|
|
||||||
g_mkdir(tint2_cache_dir, 0700);
|
|
||||||
g_free(tint2_cache_dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
const gint PADDING = 20;
|
const gint PADDING = 20;
|
||||||
|
|
||||||
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(g_theme_view));
|
||||||
@@ -170,7 +162,19 @@ gboolean update_snapshot()
|
|||||||
gboolean have_iter;
|
gboolean have_iter;
|
||||||
|
|
||||||
int num_updates = 0;
|
int num_updates = 0;
|
||||||
gboolean need_pls_wait = FALSE;
|
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
||||||
|
while (have_iter) {
|
||||||
|
GdkPixbuf *pixbuf;
|
||||||
|
gtk_tree_model_get(model, &iter, COL_SNAPSHOT, &pixbuf, -1);
|
||||||
|
if (pixbuf)
|
||||||
|
g_object_unref(pixbuf);
|
||||||
|
else
|
||||||
|
num_updates++;
|
||||||
|
have_iter = gtk_tree_model_iter_next(model, &iter);
|
||||||
|
}
|
||||||
|
gboolean need_pls_wait = num_updates > 3;
|
||||||
|
if (need_pls_wait)
|
||||||
|
create_please_wait(GTK_WINDOW(g_window));
|
||||||
|
|
||||||
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
have_iter = gtk_tree_model_get_iter_first(model, &iter);
|
||||||
while (have_iter) {
|
while (have_iter) {
|
||||||
@@ -182,30 +186,27 @@ gboolean update_snapshot()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// build panel's snapshot
|
||||||
gchar *path;
|
gchar *path;
|
||||||
gboolean force_refresh;
|
gtk_tree_model_get(model, &iter, COL_THEME_FILE, &path, -1);
|
||||||
gtk_tree_model_get(model, &iter, COL_THEME_FILE, &path, COL_FORCE_REFRESH, &force_refresh, -1);
|
|
||||||
|
|
||||||
char hash[MD4_HEX_SIZE + 4];
|
char fname[128];
|
||||||
md4hexf(path, hash);
|
sprintf(fname, "tint2-%d.jpg", (int)getpid());
|
||||||
strcat(hash, ".png");
|
|
||||||
|
|
||||||
gchar *snap = g_build_filename(g_get_user_cache_dir(), "tint2", hash, NULL);
|
gchar *snap = g_build_filename(g_get_tmp_dir(), fname, NULL);
|
||||||
pixbuf = force_refresh ? NULL : gdk_pixbuf_new_from_file(snap, NULL);
|
g_remove(snap);
|
||||||
if (!pixbuf) {
|
|
||||||
gchar *cmd = g_strdup_printf("tint2 -c \'%s\' -s \'%s\' 1>/dev/null 2>/dev/null", path, snap);
|
gchar *cmd = g_strdup_printf("tint2 -c \'%s\' -s \'%s\' 1>/dev/null 2>/dev/null", path, snap);
|
||||||
num_updates++;
|
if (system(cmd) == 0) {
|
||||||
if (num_updates > 3 && !need_pls_wait) {
|
// load
|
||||||
need_pls_wait = TRUE;
|
pixbuf = gdk_pixbuf_new_from_file(snap, NULL);
|
||||||
create_please_wait(GTK_WINDOW(g_window));
|
if (pixbuf == NULL) {
|
||||||
|
printf("snapshot NULL : %s\n", cmd);
|
||||||
}
|
}
|
||||||
if (system(cmd) == 0) {
|
|
||||||
// load
|
|
||||||
pixbuf = gdk_pixbuf_new_from_file(snap, NULL);
|
|
||||||
}
|
|
||||||
g_free(cmd);
|
|
||||||
}
|
}
|
||||||
|
g_free(cmd);
|
||||||
|
|
||||||
|
g_remove(snap);
|
||||||
g_free(snap);
|
g_free(snap);
|
||||||
g_free(path);
|
g_free(path);
|
||||||
|
|
||||||
@@ -217,8 +218,6 @@ gboolean update_snapshot()
|
|||||||
gdk_pixbuf_get_width(pixbuf) + PADDING,
|
gdk_pixbuf_get_width(pixbuf) + PADDING,
|
||||||
COL_HEIGHT,
|
COL_HEIGHT,
|
||||||
gdk_pixbuf_get_height(pixbuf) + PADDING,
|
gdk_pixbuf_get_height(pixbuf) + PADDING,
|
||||||
COL_FORCE_REFRESH,
|
|
||||||
FALSE,
|
|
||||||
-1);
|
-1);
|
||||||
if (pixbuf)
|
if (pixbuf)
|
||||||
g_object_unref(pixbuf);
|
g_object_unref(pixbuf);
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ enum { COL_THEME_FILE = 0,
|
|||||||
COL_SNAPSHOT,
|
COL_SNAPSHOT,
|
||||||
COL_WIDTH,
|
COL_WIDTH,
|
||||||
COL_HEIGHT,
|
COL_HEIGHT,
|
||||||
COL_FORCE_REFRESH,
|
|
||||||
NB_COL, };
|
NB_COL, };
|
||||||
|
|
||||||
GtkWidget *create_view();
|
GtkWidget *create_view();
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Name[nb]=Panelbehandler
|
|||||||
Name[nl]=Paneel Manager
|
Name[nl]=Paneel Manager
|
||||||
Name[nn]=Panelhandsamar
|
Name[nn]=Panelhandsamar
|
||||||
Name[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
|
Name[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
|
||||||
Name[pl]=Ustawienia panelu tint2
|
Name[pl]=Ustawienia panelu
|
||||||
Name[pt]=Gestor do Painel
|
Name[pt]=Gestor do Painel
|
||||||
Name[pt_BR]=Gerenciador do painel
|
Name[pt_BR]=Gerenciador do painel
|
||||||
Name[ro]=Manager de panouri
|
Name[ro]=Manager de panouri
|
||||||
@@ -86,7 +86,7 @@ GenericName[nb]=Panelbehandler
|
|||||||
GenericName[nl]=Paneel Manager
|
GenericName[nl]=Paneel Manager
|
||||||
GenericName[nn]=Panelhandsamar
|
GenericName[nn]=Panelhandsamar
|
||||||
GenericName[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
|
GenericName[pa]=ਪੈਨਲ ਮੈਨੇਜਰ
|
||||||
GenericName[pl]=Ustawienia panelu tint2
|
GenericName[pl]=Ustawienia panelu
|
||||||
GenericName[pt]=Gestor do Painel
|
GenericName[pt]=Gestor do Painel
|
||||||
GenericName[pt_BR]=Gerenciador do painel
|
GenericName[pt_BR]=Gerenciador do painel
|
||||||
GenericName[ro]=Manager de panouri
|
GenericName[ro]=Manager de panouri
|
||||||
@@ -106,7 +106,6 @@ GenericName[zh_CN]=面板管理器
|
|||||||
GenericName[zh_TW]=面板管理程式
|
GenericName[zh_TW]=面板管理程式
|
||||||
|
|
||||||
Comment=Tool to configure the tint2 panel
|
Comment=Tool to configure the tint2 panel
|
||||||
Comment[pl]=Narzędzie do konfiguracji panelu tint2 configure the tint2 panel
|
|
||||||
Comment[ru]=Инструмент конфигурирования панели tint2
|
Comment[ru]=Инструмент конфигурирования панели tint2
|
||||||
|
|
||||||
Exec=tint2conf
|
Exec=tint2conf
|
||||||
|
|||||||
-411
@@ -1,411 +0,0 @@
|
|||||||
#include "tint2rc.h"
|
|
||||||
|
|
||||||
unsigned char themes_tint2rc[] = {
|
|
||||||
0x23, 0x2d, 0x2d, 0x2d, 0x2d, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
|
|
||||||
0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x69, 0x6e, 0x74, 0x32,
|
|
||||||
0x63, 0x6f, 0x6e, 0x66, 0x20, 0x32, 0x36, 0x34, 0x31, 0x20, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x65, 0x20, 0x68, 0x74, 0x74,
|
|
||||||
0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e,
|
|
||||||
0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x39, 0x30, 0x30, 0x30, 0x2f, 0x74, 0x69,
|
|
||||||
0x6e, 0x74, 0x32, 0x2f, 0x77, 0x69, 0x6b, 0x69, 0x73, 0x2f, 0x43, 0x6f,
|
|
||||||
0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20,
|
|
||||||
0x0a, 0x23, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x64, 0x6f, 0x63, 0x75,
|
|
||||||
0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66,
|
|
||||||
0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75,
|
|
||||||
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x73, 0x2e, 0x0a, 0x23, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23, 0x20, 0x42, 0x61, 0x63,
|
|
||||||
0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x0a, 0x23, 0x20, 0x42,
|
|
||||||
0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x31, 0x3a,
|
|
||||||
0x20, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x0a, 0x72, 0x6f, 0x75, 0x6e, 0x64,
|
|
||||||
0x65, 0x64, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65,
|
|
||||||
0x72, 0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x30, 0x0a,
|
|
||||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x20, 0x36, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
|
||||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x30, 0x30, 0x20, 0x33, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b,
|
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
|
||||||
0x5f, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x30, 0x30, 0x20, 0x36, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64,
|
|
||||||
0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x76,
|
|
||||||
0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
|
|
||||||
0x20, 0x33, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75,
|
|
||||||
0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x65,
|
|
||||||
0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x20, 0x36, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
|
||||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x73,
|
|
||||||
0x65, 0x64, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
|
|
||||||
0x20, 0x33, 0x30, 0x0a, 0x0a, 0x23, 0x20, 0x42, 0x61, 0x63, 0x6b, 0x67,
|
|
||||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x32, 0x3a, 0x20, 0x44, 0x65, 0x66,
|
|
||||||
0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x61, 0x73, 0x6b, 0x2c, 0x20, 0x49,
|
|
||||||
0x63, 0x6f, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x74, 0x61, 0x73,
|
|
||||||
0x6b, 0x0a, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x34, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x77, 0x69, 0x64,
|
|
||||||
0x74, 0x68, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
|
||||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20,
|
|
||||||
0x3d, 0x20, 0x23, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x20, 0x32, 0x30,
|
|
||||||
0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f,
|
|
||||||
0x72, 0x20, 0x3d, 0x20, 0x23, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x20,
|
|
||||||
0x33, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e,
|
|
||||||
0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x76, 0x65,
|
|
||||||
0x72, 0x20, 0x3d, 0x20, 0x23, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x20,
|
|
||||||
0x32, 0x32, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f,
|
|
||||||
0x6c, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x3d, 0x20,
|
|
||||||
0x23, 0x65, 0x61, 0x65, 0x61, 0x65, 0x61, 0x20, 0x34, 0x34, 0x0a, 0x62,
|
|
||||||
0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f,
|
|
||||||
0x6c, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20,
|
|
||||||
0x3d, 0x20, 0x23, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x20, 0x34, 0x0a,
|
|
||||||
0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
|
||||||
0x5f, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x23,
|
|
||||||
0x65, 0x61, 0x65, 0x61, 0x65, 0x61, 0x20, 0x34, 0x34, 0x0a, 0x0a, 0x23,
|
|
||||||
0x20, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20,
|
|
||||||
0x33, 0x3a, 0x20, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x61,
|
|
||||||
0x73, 0x6b, 0x0a, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x3d,
|
|
||||||
0x20, 0x34, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x77, 0x69,
|
|
||||||
0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x62, 0x61, 0x63, 0x6b,
|
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
|
||||||
0x20, 0x3d, 0x20, 0x23, 0x37, 0x37, 0x37, 0x37, 0x37, 0x37, 0x20, 0x32,
|
|
||||||
0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c,
|
|
||||||
0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
|
||||||
0x20, 0x34, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75,
|
|
||||||
0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x76,
|
|
||||||
0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61,
|
|
||||||
0x20, 0x32, 0x32, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x3d,
|
|
||||||
0x20, 0x23, 0x65, 0x61, 0x65, 0x61, 0x65, 0x61, 0x20, 0x34, 0x34, 0x0a,
|
|
||||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64,
|
|
||||||
0x20, 0x3d, 0x20, 0x23, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x20, 0x34,
|
|
||||||
0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f,
|
|
||||||
0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x23, 0x65, 0x61, 0x65, 0x61, 0x65, 0x61, 0x20, 0x34, 0x34, 0x0a, 0x0a,
|
|
||||||
0x23, 0x20, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64,
|
|
||||||
0x20, 0x34, 0x3a, 0x20, 0x55, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x20, 0x74,
|
|
||||||
0x61, 0x73, 0x6b, 0x0a, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x20,
|
|
||||||
0x3d, 0x20, 0x34, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x77,
|
|
||||||
0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x62, 0x61, 0x63,
|
|
||||||
0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f,
|
|
||||||
0x72, 0x20, 0x3d, 0x20, 0x23, 0x61, 0x61, 0x34, 0x34, 0x30, 0x30, 0x20,
|
|
||||||
0x31, 0x30, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x61, 0x61, 0x37, 0x37,
|
|
||||||
0x33, 0x33, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
|
||||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f,
|
|
||||||
0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x63, 0x63, 0x37,
|
|
||||||
0x37, 0x30, 0x30, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64,
|
|
||||||
0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x68, 0x6f, 0x76,
|
|
||||||
0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x61, 0x61, 0x37, 0x37, 0x33, 0x33,
|
|
||||||
0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
|
|
||||||
0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x70, 0x72,
|
|
||||||
0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x23, 0x35, 0x35, 0x35,
|
|
||||||
0x35, 0x35, 0x35, 0x20, 0x34, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
|
||||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x73,
|
|
||||||
0x65, 0x64, 0x20, 0x3d, 0x20, 0x23, 0x61, 0x61, 0x37, 0x37, 0x33, 0x33,
|
|
||||||
0x20, 0x31, 0x30, 0x30, 0x0a, 0x0a, 0x23, 0x20, 0x42, 0x61, 0x63, 0x6b,
|
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x35, 0x3a, 0x20, 0x54, 0x6f,
|
|
||||||
0x6f, 0x6c, 0x74, 0x69, 0x70, 0x0a, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
|
||||||
0x5f, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x62,
|
|
||||||
0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f,
|
|
||||||
0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x66, 0x66, 0x66, 0x66, 0x61,
|
|
||||||
0x61, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
|
||||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x30, 0x30, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x61, 0x63,
|
|
||||||
0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f,
|
|
||||||
0x72, 0x5f, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x66,
|
|
||||||
0x66, 0x66, 0x66, 0x61, 0x61, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x6f,
|
|
||||||
0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x68,
|
|
||||||
0x6f, 0x76, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
|
||||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f,
|
|
||||||
0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x23, 0x66,
|
|
||||||
0x66, 0x66, 0x66, 0x61, 0x61, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x62, 0x6f,
|
|
||||||
0x72, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x70,
|
|
||||||
0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x23, 0x30, 0x30,
|
|
||||||
0x30, 0x30, 0x30, 0x30, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x0a, 0x23, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x0a, 0x23, 0x20, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x0a, 0x70, 0x61, 0x6e,
|
|
||||||
0x65, 0x6c, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x3d, 0x20, 0x4c,
|
|
||||||
0x54, 0x53, 0x43, 0x0a, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x69,
|
|
||||||
0x7a, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x25, 0x20, 0x33, 0x30,
|
|
||||||
0x0a, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x5f, 0x6d, 0x61, 0x72, 0x67, 0x69,
|
|
||||||
0x6e, 0x20, 0x3d, 0x20, 0x30, 0x20, 0x30, 0x0a, 0x70, 0x61, 0x6e, 0x65,
|
|
||||||
0x6c, 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20,
|
|
||||||
0x32, 0x20, 0x30, 0x20, 0x32, 0x0a, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x5f,
|
|
||||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x77, 0x6d, 0x5f, 0x6d, 0x65, 0x6e,
|
|
||||||
0x75, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x5f,
|
|
||||||
0x64, 0x6f, 0x63, 0x6b, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x70, 0x61, 0x6e,
|
|
||||||
0x65, 0x6c, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,
|
|
||||||
0x3d, 0x20, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x20, 0x63, 0x65, 0x6e,
|
|
||||||
0x74, 0x65, 0x72, 0x20, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74,
|
|
||||||
0x61, 0x6c, 0x0a, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x5f, 0x6c, 0x61, 0x79,
|
|
||||||
0x65, 0x72, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x70, 0x0a, 0x70, 0x61, 0x6e,
|
|
||||||
0x65, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x20, 0x3d,
|
|
||||||
0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79,
|
|
||||||
0x5f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x5f, 0x66, 0x69, 0x72,
|
|
||||||
0x73, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x68,
|
|
||||||
0x69, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x61, 0x75, 0x74, 0x6f,
|
|
||||||
0x68, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x69,
|
|
||||||
0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x61, 0x75,
|
|
||||||
0x74, 0x6f, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x5f,
|
|
||||||
0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x2e,
|
|
||||||
0x35, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x68,
|
|
||||||
0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 0x20, 0x32, 0x0a, 0x73, 0x74,
|
|
||||||
0x72, 0x75, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x20, 0x3d,
|
|
||||||
0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x7a, 0x65,
|
|
||||||
0x0a, 0x70, 0x61, 0x6e, 0x65, 0x6c, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f,
|
|
||||||
0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x74, 0x69, 0x6e,
|
|
||||||
0x74, 0x32, 0x0a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74,
|
|
||||||
0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x20,
|
|
||||||
0x3d, 0x20, 0x31, 0x0a, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x65, 0x66,
|
|
||||||
0x66, 0x65, 0x63, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x66, 0x6f,
|
|
||||||
0x6e, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20,
|
|
||||||
0x30, 0x0a, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x68, 0x6f, 0x76, 0x65,
|
|
||||||
0x72, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x62, 0x20, 0x3d,
|
|
||||||
0x20, 0x31, 0x30, 0x30, 0x20, 0x30, 0x20, 0x31, 0x30, 0x0a, 0x6d, 0x6f,
|
|
||||||
0x75, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f,
|
|
||||||
0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x62, 0x20, 0x3d, 0x20, 0x31,
|
|
||||||
0x30, 0x30, 0x20, 0x30, 0x20, 0x30, 0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23,
|
|
||||||
0x20, 0x54, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x0a, 0x74, 0x61, 0x73,
|
|
||||||
0x6b, 0x62, 0x61, 0x72, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20,
|
|
||||||
0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x6b, 0x74,
|
|
||||||
0x6f, 0x70, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x70,
|
|
||||||
0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x30, 0x20, 0x30,
|
|
||||||
0x20, 0x32, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x62,
|
|
||||||
0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64,
|
|
||||||
0x20, 0x3d, 0x20, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72,
|
|
||||||
0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b,
|
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x6e, 0x61,
|
|
||||||
0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62,
|
|
||||||
0x61, 0x72, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x61, 0x63,
|
|
||||||
0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x20, 0x3d,
|
|
||||||
0x20, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x68,
|
|
||||||
0x69, 0x64, 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e,
|
|
||||||
0x74, 0x5f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x20, 0x3d, 0x20,
|
|
||||||
0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x61, 0x6c,
|
|
||||||
0x77, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x61, 0x6c,
|
|
||||||
0x6c, 0x5f, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x5f, 0x74, 0x61,
|
|
||||||
0x73, 0x6b, 0x73, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b,
|
|
||||||
0x62, 0x61, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x64,
|
|
||||||
0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x34, 0x20, 0x32, 0x0a, 0x74,
|
|
||||||
0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f,
|
|
||||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62, 0x61,
|
|
||||||
0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76,
|
|
||||||
0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64,
|
|
||||||
0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b,
|
|
||||||
0x62, 0x61, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, 0x6f, 0x6e,
|
|
||||||
0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x65,
|
|
||||||
0x33, 0x65, 0x33, 0x65, 0x33, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x74, 0x61,
|
|
||||||
0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61,
|
|
||||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x66, 0x66, 0x66, 0x66,
|
|
||||||
0x66, 0x66, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x62,
|
|
||||||
0x61, 0x72, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
|
|
||||||
0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x74,
|
|
||||||
0x61, 0x73, 0x6b, 0x62, 0x61, 0x72, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x5f,
|
|
||||||
0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x6e, 0x65,
|
|
||||||
0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x20,
|
|
||||||
0x3d, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23,
|
|
||||||
0x20, 0x54, 0x61, 0x73, 0x6b, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74,
|
|
||||||
0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x74, 0x61, 0x73, 0x6b,
|
|
||||||
0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x74, 0x61,
|
|
||||||
0x73, 0x6b, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20,
|
|
||||||
0x3d, 0x20, 0x31, 0x0a, 0x75, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x6e,
|
|
||||||
0x62, 0x5f, 0x6f, 0x66, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x3d,
|
|
||||||
0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b,
|
|
||||||
0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x73, 0x69, 0x7a,
|
|
||||||
0x65, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x30, 0x20, 0x33, 0x35, 0x0a, 0x74,
|
|
||||||
0x61, 0x73, 0x6b, 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20,
|
|
||||||
0x3d, 0x20, 0x32, 0x20, 0x32, 0x20, 0x34, 0x0a, 0x74, 0x61, 0x73, 0x6b,
|
|
||||||
0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x20, 0x3d, 0x20, 0x31,
|
|
||||||
0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 0x63,
|
|
||||||
0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x66, 0x66, 0x66, 0x66,
|
|
||||||
0x66, 0x66, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f,
|
|
||||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x32, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x61,
|
|
||||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72,
|
|
||||||
0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20, 0x33, 0x0a,
|
|
||||||
0x74, 0x61, 0x73, 0x6b, 0x5f, 0x75, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x5f,
|
|
||||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x34, 0x0a, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69,
|
|
||||||
0x63, 0x6f, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x63,
|
|
||||||
0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d,
|
|
||||||
0x20, 0x32, 0x0a, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x6c, 0x65, 0x66,
|
|
||||||
0x74, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x5f, 0x69,
|
|
||||||
0x63, 0x6f, 0x6e, 0x69, 0x66, 0x79, 0x0a, 0x6d, 0x6f, 0x75, 0x73, 0x65,
|
|
||||||
0x5f, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x6e, 0x6f,
|
|
||||||
0x6e, 0x65, 0x0a, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x72, 0x69, 0x67,
|
|
||||||
0x68, 0x74, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x0a, 0x6d,
|
|
||||||
0x6f, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x5f,
|
|
||||||
0x75, 0x70, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x0a,
|
|
||||||
0x6d, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c,
|
|
||||||
0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x3d, 0x20, 0x69, 0x63, 0x6f, 0x6e,
|
|
||||||
0x69, 0x66, 0x79, 0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23, 0x20, 0x53, 0x79,
|
|
||||||
0x73, 0x74, 0x65, 0x6d, 0x20, 0x74, 0x72, 0x61, 0x79, 0x20, 0x28, 0x6e,
|
|
||||||
0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,
|
|
||||||
0x61, 0x72, 0x65, 0x61, 0x29, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x72, 0x61,
|
|
||||||
0x79, 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20,
|
|
||||||
0x30, 0x20, 0x34, 0x20, 0x32, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x72, 0x61,
|
|
||||||
0x79, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64,
|
|
||||||
0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x73, 0x79, 0x73, 0x74,
|
|
||||||
0x72, 0x61, 0x79, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x61,
|
|
||||||
0x73, 0x63, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x0a, 0x73, 0x79, 0x73,
|
|
||||||
0x74, 0x72, 0x61, 0x79, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x69,
|
|
||||||
0x7a, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x34, 0x0a, 0x73, 0x79, 0x73, 0x74,
|
|
||||||
0x72, 0x61, 0x79, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x61, 0x73, 0x62,
|
|
||||||
0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x20, 0x30, 0x20, 0x30, 0x0a, 0x73,
|
|
||||||
0x79, 0x73, 0x74, 0x72, 0x61, 0x79, 0x5f, 0x6d, 0x6f, 0x6e, 0x69, 0x74,
|
|
||||||
0x6f, 0x72, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23,
|
|
||||||
0x20, 0x4c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x0a, 0x6c, 0x61,
|
|
||||||
0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69,
|
|
||||||
0x6e, 0x67, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x34, 0x20, 0x32, 0x0a, 0x6c,
|
|
||||||
0x61, 0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x63, 0x6b,
|
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x30, 0x0a, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69,
|
|
||||||
0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75,
|
|
||||||
0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x6c, 0x61,
|
|
||||||
0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x5f,
|
|
||||||
0x73, 0x69, 0x7a, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x34, 0x0a, 0x6c, 0x61,
|
|
||||||
0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x63, 0x6f, 0x6e, 0x5f,
|
|
||||||
0x61, 0x73, 0x62, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x20, 0x30, 0x20,
|
|
||||||
0x30, 0x0a, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69,
|
|
||||||
0x63, 0x6f, 0x6e, 0x5f, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x5f, 0x6f, 0x76,
|
|
||||||
0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x73,
|
|
||||||
0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66,
|
|
||||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x31,
|
|
||||||
0x0a, 0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x6f,
|
|
||||||
0x6f, 0x6c, 0x74, 0x69, 0x70, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x6c, 0x61,
|
|
||||||
0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f,
|
|
||||||
0x61, 0x70, 0x70, 0x20, 0x3d, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x2f, 0x73,
|
|
||||||
0x68, 0x61, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
|
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x74, 0x69, 0x6e, 0x74, 0x32, 0x63,
|
|
||||||
0x6f, 0x6e, 0x66, 0x2e, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x0a,
|
|
||||||
0x6c, 0x61, 0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x74, 0x65,
|
|
||||||
0x6d, 0x5f, 0x61, 0x70, 0x70, 0x20, 0x3d, 0x20, 0x2f, 0x75, 0x73, 0x72,
|
|
||||||
0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65,
|
|
||||||
0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
|
||||||
0x73, 0x2f, 0x74, 0x69, 0x6e, 0x74, 0x32, 0x63, 0x6f, 0x6e, 0x66, 0x2e,
|
|
||||||
0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x0a, 0x6c, 0x61, 0x75, 0x6e,
|
|
||||||
0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x61, 0x70,
|
|
||||||
0x70, 0x20, 0x3d, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x2f, 0x73, 0x68, 0x61,
|
|
||||||
0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
|
|
||||||
0x6f, 0x6e, 0x73, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x66, 0x6f, 0x78, 0x2e,
|
|
||||||
0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x0a, 0x6c, 0x61, 0x75, 0x6e,
|
|
||||||
0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x61, 0x70,
|
|
||||||
0x70, 0x20, 0x3d, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x2f, 0x73, 0x68, 0x61,
|
|
||||||
0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69,
|
|
||||||
0x6f, 0x6e, 0x73, 0x2f, 0x69, 0x63, 0x65, 0x77, 0x65, 0x61, 0x73, 0x65,
|
|
||||||
0x6c, 0x2e, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x0a, 0x6c, 0x61,
|
|
||||||
0x75, 0x6e, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f,
|
|
||||||
0x61, 0x70, 0x70, 0x20, 0x3d, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x2f, 0x73,
|
|
||||||
0x68, 0x61, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61,
|
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69,
|
|
||||||
0x75, 0x6d, 0x2d, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x2e, 0x64,
|
|
||||||
0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x0a, 0x6c, 0x61, 0x75, 0x6e, 0x63,
|
|
||||||
0x68, 0x65, 0x72, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x61, 0x70, 0x70,
|
|
||||||
0x20, 0x3d, 0x20, 0x2f, 0x75, 0x73, 0x72, 0x2f, 0x73, 0x68, 0x61, 0x72,
|
|
||||||
0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x73, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2d, 0x63, 0x68,
|
|
||||||
0x72, 0x6f, 0x6d, 0x65, 0x2e, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70,
|
|
||||||
0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23, 0x20, 0x43, 0x6c, 0x6f, 0x63, 0x6b,
|
|
||||||
0x0a, 0x74, 0x69, 0x6d, 0x65, 0x31, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61,
|
|
||||||
0x74, 0x20, 0x3d, 0x20, 0x25, 0x48, 0x3a, 0x25, 0x4d, 0x0a, 0x74, 0x69,
|
|
||||||
0x6d, 0x65, 0x32, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d,
|
|
||||||
0x20, 0x25, 0x41, 0x20, 0x25, 0x64, 0x20, 0x25, 0x42, 0x0a, 0x74, 0x69,
|
|
||||||
0x6d, 0x65, 0x31, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65,
|
|
||||||
0x20, 0x3d, 0x20, 0x0a, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x5f, 0x74, 0x69,
|
|
||||||
0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x20, 0x3d, 0x20, 0x0a, 0x63, 0x6c,
|
|
||||||
0x6f, 0x63, 0x6b, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6c,
|
|
||||||
0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
|
|
||||||
0x20, 0x31, 0x30, 0x30, 0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x70,
|
|
||||||
0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x30,
|
|
||||||
0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
|
||||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20, 0x30,
|
|
||||||
0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x74,
|
|
||||||
0x69, 0x70, 0x20, 0x3d, 0x20, 0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f,
|
|
||||||
0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x5f, 0x74, 0x69, 0x6d, 0x65,
|
|
||||||
0x7a, 0x6f, 0x6e, 0x65, 0x20, 0x3d, 0x20, 0x0a, 0x63, 0x6c, 0x6f, 0x63,
|
|
||||||
0x6b, 0x5f, 0x6c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6d,
|
|
||||||
0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x0a, 0x63, 0x6c, 0x6f, 0x63,
|
|
||||||
0x6b, 0x5f, 0x72, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6d,
|
|
||||||
0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x6f, 0x72, 0x61, 0x67, 0x65,
|
|
||||||
0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6d, 0x63, 0x6c, 0x69, 0x63,
|
|
||||||
0x6b, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x75, 0x77, 0x68, 0x65, 0x65,
|
|
||||||
0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x0a, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x77, 0x68, 0x65, 0x65,
|
|
||||||
0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23, 0x20, 0x42, 0x61, 0x74, 0x74, 0x65,
|
|
||||||
0x72, 0x79, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x74,
|
|
||||||
0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x62,
|
|
||||||
0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x73,
|
|
||||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x0a, 0x62,
|
|
||||||
0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x63,
|
|
||||||
0x6d, 0x64, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2d,
|
|
||||||
0x73, 0x65, 0x6e, 0x64, 0x20, 0x22, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72,
|
|
||||||
0x79, 0x20, 0x6c, 0x6f, 0x77, 0x22, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65,
|
|
||||||
0x72, 0x79, 0x5f, 0x66, 0x6f, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x6f,
|
|
||||||
0x72, 0x20, 0x3d, 0x20, 0x23, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x20,
|
|
||||||
0x31, 0x30, 0x30, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f,
|
|
||||||
0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x31, 0x20,
|
|
||||||
0x30, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x62, 0x61,
|
|
||||||
0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20,
|
|
||||||
0x3d, 0x20, 0x30, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f,
|
|
||||||
0x68, 0x69, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x31, 0x0a, 0x62,
|
|
||||||
0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x6c, 0x63, 0x6c, 0x69, 0x63,
|
|
||||||
0x6b, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20,
|
|
||||||
0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x63, 0x6c,
|
|
||||||
0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20,
|
|
||||||
0x3d, 0x20, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x5f, 0x6d,
|
|
||||||
0x63, 0x6c, 0x69, 0x63, 0x6b, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79,
|
|
||||||
0x5f, 0x75, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d,
|
|
||||||
0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x0a, 0x62, 0x61, 0x74, 0x74, 0x65,
|
|
||||||
0x72, 0x79, 0x5f, 0x64, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x5f, 0x63, 0x6f,
|
|
||||||
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x0a, 0x61, 0x63, 0x5f,
|
|
||||||
0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6d,
|
|
||||||
0x64, 0x20, 0x3d, 0x20, 0x0a, 0x61, 0x63, 0x5f, 0x64, 0x69, 0x73, 0x63,
|
|
||||||
0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6d, 0x64,
|
|
||||||
0x20, 0x3d, 0x20, 0x0a, 0x0a, 0x23, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
|
|
||||||
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x23, 0x20, 0x54, 0x6f,
|
|
||||||
0x6f, 0x6c, 0x74, 0x69, 0x70, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69,
|
|
||||||
0x70, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f,
|
|
||||||
0x75, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x35, 0x0a, 0x74, 0x6f, 0x6f,
|
|
||||||
0x6c, 0x74, 0x69, 0x70, 0x5f, 0x68, 0x69, 0x64, 0x65, 0x5f, 0x74, 0x69,
|
|
||||||
0x6d, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x31, 0x0a,
|
|
||||||
0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x5f, 0x70, 0x61, 0x64, 0x64,
|
|
||||||
0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x32, 0x0a, 0x74, 0x6f,
|
|
||||||
0x6f, 0x6c, 0x74, 0x69, 0x70, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72,
|
|
||||||
0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x20, 0x3d, 0x20, 0x35, 0x0a,
|
|
||||||
0x74, 0x6f, 0x6f, 0x6c, 0x74, 0x69, 0x70, 0x5f, 0x66, 0x6f, 0x6e, 0x74,
|
|
||||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x23, 0x32, 0x32,
|
|
||||||
0x32, 0x32, 0x32, 0x32, 0x20, 0x31, 0x30, 0x30, 0x0a, 0x0a
|
|
||||||
};
|
|
||||||
unsigned int themes_tint2rc_len = 4870;
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#ifndef TINT2RC_H
|
|
||||||
#define TINT2RC_H
|
|
||||||
|
|
||||||
// Content of .c file generated with xxd from the vim package:
|
|
||||||
// echo '#include "tint2rc.h"' > src/tint2rc.c && xxd -i themes/tint2rc >> src/tint2rc.c
|
|
||||||
|
|
||||||
extern unsigned char themes_tint2rc[];
|
|
||||||
extern unsigned int themes_tint2rc_len;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+51
-372
@@ -17,12 +17,10 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/extensions/Xrender.h>
|
#include <X11/extensions/Xrender.h>
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -217,41 +215,38 @@ void relayout_dynamic(Area *a, int level)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int compute_desired_size(Area *a)
|
|
||||||
{
|
|
||||||
if (!a->on_screen)
|
|
||||||
return 0;
|
|
||||||
if (a->_compute_desired_size)
|
|
||||||
return a->_compute_desired_size(a);
|
|
||||||
if (a->size_mode == LAYOUT_FIXED)
|
|
||||||
fprintf(stderr, YELLOW "Area %s does not set desired size!" RESET "\n", a->name);
|
|
||||||
return container_compute_desired_size(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
int container_compute_desired_size(Area *a)
|
|
||||||
{
|
|
||||||
if (!a->on_screen)
|
|
||||||
return 0;
|
|
||||||
int result = 2 * a->paddingxlr + (panel_horizontal ? left_right_border_width(a) : top_bottom_border_width(a));
|
|
||||||
int children_count = 0;
|
|
||||||
for (GList *l = a->children; l != NULL; l = l->next) {
|
|
||||||
Area *child = (Area *)l->data;
|
|
||||||
if (child->on_screen) {
|
|
||||||
result += compute_desired_size(child);
|
|
||||||
children_count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (children_count > 0)
|
|
||||||
result += (children_count - 1) * a->paddingx;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void relayout(Area *a)
|
void relayout(Area *a)
|
||||||
{
|
{
|
||||||
relayout_fixed(a);
|
relayout_fixed(a);
|
||||||
relayout_dynamic(a, 1);
|
relayout_dynamic(a, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void draw_tree(Area *a)
|
||||||
|
{
|
||||||
|
if (!a->on_screen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (a->_redraw_needed) {
|
||||||
|
a->_redraw_needed = FALSE;
|
||||||
|
draw(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (a->pix)
|
||||||
|
XCopyArea(server.display,
|
||||||
|
a->pix,
|
||||||
|
((Panel *)a->panel)->temp_pmap,
|
||||||
|
server.gc,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
a->width,
|
||||||
|
a->height,
|
||||||
|
a->posx,
|
||||||
|
a->posy);
|
||||||
|
|
||||||
|
for (GList *l = a->children; l; l = l->next)
|
||||||
|
draw_tree((Area *)l->data);
|
||||||
|
}
|
||||||
|
|
||||||
int relayout_with_constraint(Area *a, int maximum_size)
|
int relayout_with_constraint(Area *a, int maximum_size)
|
||||||
{
|
{
|
||||||
int fixed_children_count = 0;
|
int fixed_children_count = 0;
|
||||||
@@ -360,43 +355,13 @@ void schedule_redraw(Area *a)
|
|||||||
|
|
||||||
for (GList *l = a->children; l; l = l->next)
|
for (GList *l = a->children; l; l = l->next)
|
||||||
schedule_redraw((Area *)l->data);
|
schedule_redraw((Area *)l->data);
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
void draw_tree(Area *a)
|
|
||||||
{
|
|
||||||
if (!a->on_screen)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (a->_redraw_needed) {
|
|
||||||
a->_redraw_needed = FALSE;
|
|
||||||
draw(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a->pix)
|
|
||||||
XCopyArea(server.display,
|
|
||||||
a->pix,
|
|
||||||
((Panel *)a->panel)->temp_pmap,
|
|
||||||
server.gc,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
a->width,
|
|
||||||
a->height,
|
|
||||||
a->posx,
|
|
||||||
a->posy);
|
|
||||||
else
|
|
||||||
fprintf(stderr, RED "%s %d: area %s has no pixmap!!!" RESET "\n", __FILE__, __LINE__, a->name);
|
|
||||||
|
|
||||||
for (GList *l = a->children; l; l = l->next)
|
|
||||||
draw_tree((Area *)l->data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void hide(Area *a)
|
void hide(Area *a)
|
||||||
{
|
{
|
||||||
Area *parent = (Area *)a->parent;
|
Area *parent = (Area *)a->parent;
|
||||||
|
|
||||||
if (!a->on_screen)
|
|
||||||
return;
|
|
||||||
a->on_screen = FALSE;
|
a->on_screen = FALSE;
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->resize_needed = TRUE;
|
parent->resize_needed = TRUE;
|
||||||
@@ -410,29 +375,10 @@ void show(Area *a)
|
|||||||
{
|
{
|
||||||
Area *parent = (Area *)a->parent;
|
Area *parent = (Area *)a->parent;
|
||||||
|
|
||||||
if (a->on_screen)
|
|
||||||
return;
|
|
||||||
a->on_screen = TRUE;
|
a->on_screen = TRUE;
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->resize_needed = TRUE;
|
parent->resize_needed = TRUE;
|
||||||
a->resize_needed = TRUE;
|
a->resize_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
void update_dependent_gradients(Area *a)
|
|
||||||
{
|
|
||||||
if (!a->on_screen)
|
|
||||||
return;
|
|
||||||
if (a->_changed) {
|
|
||||||
for (GList *l = a->dependent_gradients; l; l = l->next) {
|
|
||||||
GradientInstance *gi = (GradientInstance *)l->data;
|
|
||||||
update_gradient(gi);
|
|
||||||
if (gi->area != a)
|
|
||||||
schedule_redraw(gi->area);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (GList *l = a->children; l; l = l->next)
|
|
||||||
update_dependent_gradients((Area *)l->data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw(Area *a)
|
void draw(Area *a)
|
||||||
@@ -492,7 +438,7 @@ void draw(Area *a)
|
|||||||
|
|
||||||
void draw_background(Area *a, cairo_t *c)
|
void draw_background(Area *a, cairo_t *c)
|
||||||
{
|
{
|
||||||
if ((a->bg->fill_color.alpha > 0.0) ||
|
if (a->bg->fill_color.alpha > 0.0 ||
|
||||||
(panel_config.mouse_effects && (a->has_mouse_over_effect || a->has_mouse_press_effect))) {
|
(panel_config.mouse_effects && (a->has_mouse_over_effect || a->has_mouse_press_effect))) {
|
||||||
if (a->mouse_state == MOUSE_OVER)
|
if (a->mouse_state == MOUSE_OVER)
|
||||||
cairo_set_source_rgba(c,
|
cairo_set_source_rgba(c,
|
||||||
@@ -522,19 +468,6 @@ void draw_background(Area *a, cairo_t *c)
|
|||||||
|
|
||||||
cairo_fill(c);
|
cairo_fill(c);
|
||||||
}
|
}
|
||||||
for (GList *l = a->gradient_instances_by_state[a->mouse_state]; l; l = l->next) {
|
|
||||||
GradientInstance *gi = (GradientInstance *)l->data;
|
|
||||||
if (!gi->pattern)
|
|
||||||
update_gradient(gi);
|
|
||||||
cairo_set_source(c, gi->pattern);
|
|
||||||
draw_rect(c,
|
|
||||||
left_border_width(a),
|
|
||||||
top_border_width(a),
|
|
||||||
a->width - left_right_border_width(a),
|
|
||||||
a->height - top_bottom_border_width(a),
|
|
||||||
a->bg->border.radius - a->bg->border.width / 1.571);
|
|
||||||
cairo_fill(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a->bg->border.width > 0) {
|
if (a->bg->border.width > 0) {
|
||||||
cairo_set_line_width(c, a->bg->border.width);
|
cairo_set_line_width(c, a->bg->border.width);
|
||||||
@@ -575,12 +508,10 @@ void remove_area(Area *a)
|
|||||||
Area *area = (Area *)a;
|
Area *area = (Area *)a;
|
||||||
Area *parent = (Area *)area->parent;
|
Area *parent = (Area *)area->parent;
|
||||||
|
|
||||||
free_area_gradient_instances(a);
|
|
||||||
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
parent->children = g_list_remove(parent->children, area);
|
parent->children = g_list_remove(parent->children, area);
|
||||||
parent->resize_needed = TRUE;
|
parent->resize_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
schedule_redraw(parent);
|
schedule_redraw(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -598,6 +529,7 @@ void add_area(Area *a, Area *parent)
|
|||||||
parent->children = g_list_append(parent->children, a);
|
parent->children = g_list_append(parent->children, a);
|
||||||
parent->resize_needed = TRUE;
|
parent->resize_needed = TRUE;
|
||||||
schedule_redraw(parent);
|
schedule_redraw(parent);
|
||||||
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,7 +559,6 @@ void free_area(Area *a)
|
|||||||
if (mouse_over_area == a) {
|
if (mouse_over_area == a) {
|
||||||
mouse_over_area = NULL;
|
mouse_over_area = NULL;
|
||||||
}
|
}
|
||||||
free_area_gradient_instances(a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mouse_over(Area *area, int pressed)
|
void mouse_over(Area *area, int pressed)
|
||||||
@@ -653,10 +584,11 @@ void mouse_over(Area *area, int pressed)
|
|||||||
mouse_over_area = area;
|
mouse_over_area = area;
|
||||||
|
|
||||||
mouse_over_area->mouse_state = new_state;
|
mouse_over_area->mouse_state = new_state;
|
||||||
mouse_over_area->pix = mouse_over_area->pix_by_state[mouse_over_area->mouse_state];
|
mouse_over_area->pix =
|
||||||
|
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
|
||||||
if (!mouse_over_area->pix)
|
if (!mouse_over_area->pix)
|
||||||
mouse_over_area->_redraw_needed = TRUE;
|
mouse_over_area->_redraw_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mouse_out()
|
void mouse_out()
|
||||||
@@ -664,10 +596,11 @@ void mouse_out()
|
|||||||
if (!mouse_over_area)
|
if (!mouse_over_area)
|
||||||
return;
|
return;
|
||||||
mouse_over_area->mouse_state = MOUSE_NORMAL;
|
mouse_over_area->mouse_state = MOUSE_NORMAL;
|
||||||
mouse_over_area->pix = mouse_over_area->pix_by_state[mouse_over_area->mouse_state];
|
mouse_over_area->pix =
|
||||||
|
mouse_over_area->pix_by_state[mouse_over_area->has_mouse_over_effect ? mouse_over_area->mouse_state : 0];
|
||||||
if (!mouse_over_area->pix)
|
if (!mouse_over_area->pix)
|
||||||
mouse_over_area->_redraw_needed = TRUE;
|
mouse_over_area->_redraw_needed = TRUE;
|
||||||
schedule_panel_redraw();
|
panel_refresh = TRUE;
|
||||||
mouse_over_area = NULL;
|
mouse_over_area = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -850,29 +783,28 @@ void area_dump_geometry(Area *area, int indent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%*sBox: x = %d, y = %d, w = %d, h = %d, desired size = %d\n",
|
"%*sBox: x = %d, y = %d, w = %d, h = %d\n",
|
||||||
indent,
|
indent,
|
||||||
"",
|
"",
|
||||||
area->posx,
|
area->posx,
|
||||||
area->posy,
|
area->posy,
|
||||||
area->width,
|
area->width,
|
||||||
area->height,
|
area->height);
|
||||||
compute_desired_size(area));
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%*sBorder: left = %d, right = %d, top = %d, bottom = %d\n",
|
"%*sBorder: left = %d, right = %d, top = %d, bottom = %d\n",
|
||||||
indent,
|
indent,
|
||||||
"",
|
"",
|
||||||
left_border_width(area),
|
left_border_width(area),
|
||||||
right_border_width(area),
|
right_border_width(area),
|
||||||
top_border_width(area),
|
top_border_width(area),
|
||||||
bottom_border_width(area));
|
bottom_border_width(area));
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%*sPadding: left = right = %d, top = bottom = %d, spacing = %d\n",
|
"%*sPadding: left = right = %d, top = bottom = %d, spacing = %d\n",
|
||||||
indent,
|
indent,
|
||||||
"",
|
"",
|
||||||
area->paddingxlr,
|
area->paddingxlr,
|
||||||
area->paddingy,
|
area->paddingy,
|
||||||
area->paddingx);
|
area->paddingx);
|
||||||
if (area->_dump_geometry)
|
if (area->_dump_geometry)
|
||||||
area->_dump_geometry(area, indent);
|
area->_dump_geometry(area, indent);
|
||||||
if (area->children) {
|
if (area->children) {
|
||||||
@@ -882,256 +814,3 @@ void area_dump_geometry(Area *area, int indent)
|
|||||||
area_dump_geometry((Area *)l->data, indent);
|
area_dump_geometry((Area *)l->data, indent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Area *compute_element_area(Area *area, Element element)
|
|
||||||
{
|
|
||||||
if (element == ELEMENT_SELF)
|
|
||||||
return area;
|
|
||||||
if (element == ELEMENT_PARENT)
|
|
||||||
return (Area *)area->parent;
|
|
||||||
if (element == ELEMENT_PANEL)
|
|
||||||
return (Area *)area->panel;
|
|
||||||
g_assert_not_reached();
|
|
||||||
return area;
|
|
||||||
}
|
|
||||||
|
|
||||||
void instantiate_gradient_offsets(GradientInstance *gi, GList *offsets)
|
|
||||||
{
|
|
||||||
for (GList *l = offsets; l; l = l->next) {
|
|
||||||
Offset *offset = (Offset *)l->data;
|
|
||||||
if (!offset->constant) {
|
|
||||||
Area *element_area = compute_element_area(gi->area, offset->element);
|
|
||||||
element_area->dependent_gradients = g_list_append(element_area->dependent_gradients, gi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_gradient_offsets(GradientInstance *gi, GList **offsets)
|
|
||||||
{
|
|
||||||
for (GList *l = *offsets; l; l = l->next) {
|
|
||||||
Offset *offset = (Offset *)l->data;
|
|
||||||
if (!offset->constant) {
|
|
||||||
Area *element_area = compute_element_area(gi->area, offset->element);
|
|
||||||
element_area->dependent_gradients = g_list_remove_all(element_area->dependent_gradients, gi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void instantiate_gradient_point(GradientInstance *gi, ControlPoint *control)
|
|
||||||
{
|
|
||||||
instantiate_gradient_offsets(gi, control->offsets_x);
|
|
||||||
instantiate_gradient_offsets(gi, control->offsets_y);
|
|
||||||
instantiate_gradient_offsets(gi, control->offsets_r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_gradient_instance_point(GradientInstance *gi, ControlPoint *control)
|
|
||||||
{
|
|
||||||
free_gradient_offsets(gi, &control->offsets_x);
|
|
||||||
free_gradient_offsets(gi, &control->offsets_y);
|
|
||||||
free_gradient_offsets(gi, &control->offsets_r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void instantiate_gradient(Area *area, GradientClass *g, GradientInstance *gi)
|
|
||||||
{
|
|
||||||
g_assert_nonnull(area);
|
|
||||||
g_assert_nonnull(g);
|
|
||||||
gi->area = area;
|
|
||||||
gi->gradient_class = g;
|
|
||||||
instantiate_gradient_point(gi, &g->from);
|
|
||||||
instantiate_gradient_point(gi, &g->to);
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_gradient_instance(GradientInstance *gi)
|
|
||||||
{
|
|
||||||
if (gi->pattern) {
|
|
||||||
cairo_pattern_destroy(gi->pattern);
|
|
||||||
gi->pattern = NULL;
|
|
||||||
}
|
|
||||||
free_gradient_instance_point(gi, &gi->gradient_class->from);
|
|
||||||
free_gradient_instance_point(gi, &gi->gradient_class->to);
|
|
||||||
gi->gradient_class = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void instantiate_area_gradients(Area *area)
|
|
||||||
{
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr, "Initializing gradients for area %s\n", area->name);
|
|
||||||
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
|
||||||
g_assert_null(area->gradient_instances_by_state[i]);
|
|
||||||
GradientClass *g = area->bg->gradients[i];
|
|
||||||
if (!g)
|
|
||||||
continue;
|
|
||||||
GradientInstance *gi = (GradientInstance *)calloc(1, sizeof(GradientInstance));
|
|
||||||
instantiate_gradient(area, g, gi);
|
|
||||||
area->gradient_instances_by_state[i] = g_list_append(area->gradient_instances_by_state[i], gi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void free_area_gradient_instances(Area *area)
|
|
||||||
{
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr, "Freeing gradients for area %s\n", area->name);
|
|
||||||
for (int i = 0; i < MOUSE_STATE_COUNT; i++) {
|
|
||||||
for (GList *l = area->gradient_instances_by_state[i]; l; l = l->next) {
|
|
||||||
GradientInstance *gi = (GradientInstance *)l->data;
|
|
||||||
free_gradient_instance(gi);
|
|
||||||
}
|
|
||||||
g_list_free_full(area->gradient_instances_by_state[i], free);
|
|
||||||
area->gradient_instances_by_state[i] = NULL;
|
|
||||||
}
|
|
||||||
g_assert_null(area->dependent_gradients);
|
|
||||||
}
|
|
||||||
|
|
||||||
double compute_control_point_offset(Area *area, Offset *offset)
|
|
||||||
{
|
|
||||||
if (offset->constant)
|
|
||||||
return offset->constant_value;
|
|
||||||
|
|
||||||
Area *element_area = compute_element_area(area, offset->element);
|
|
||||||
Area *parent_area = ((Area *)area->parent);
|
|
||||||
g_assert_nonnull(element_area);
|
|
||||||
g_assert_nonnull(parent_area);
|
|
||||||
|
|
||||||
double width = element_area->width;
|
|
||||||
double height = element_area->height;
|
|
||||||
double radius = sqrt(element_area->width * element_area->width + element_area->height * element_area->height) / 2.0;
|
|
||||||
|
|
||||||
double left, top;
|
|
||||||
if (offset->element == ELEMENT_SELF) {
|
|
||||||
left = 0;
|
|
||||||
top = 0;
|
|
||||||
} else if (offset->element == ELEMENT_PARENT) {
|
|
||||||
left = parent_area->posx - area->posx;
|
|
||||||
top = parent_area->posy - area->posy;
|
|
||||||
} else if (offset->element == ELEMENT_PANEL) {
|
|
||||||
left = 0 - area->posx;
|
|
||||||
top = 0 - area->posy;
|
|
||||||
}
|
|
||||||
|
|
||||||
double right = left + width;
|
|
||||||
double bottom = top + height;
|
|
||||||
double center_x = left + 0.5 * width;
|
|
||||||
double center_y = top + 0.5 * height;
|
|
||||||
|
|
||||||
if (offset->variable == SIZE_WIDTH)
|
|
||||||
return width * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_HEIGHT)
|
|
||||||
return height * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_RADIUS)
|
|
||||||
return radius * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_LEFT)
|
|
||||||
return left * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_RIGHT)
|
|
||||||
return right * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_TOP)
|
|
||||||
return top * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_BOTTOM)
|
|
||||||
return bottom * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_CENTERX)
|
|
||||||
return center_x * offset->multiplier;
|
|
||||||
if (offset->variable == SIZE_CENTERY)
|
|
||||||
return center_y * offset->multiplier;
|
|
||||||
|
|
||||||
g_assert_not_reached();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
double compute_control_point_offsets(GradientInstance *gi, GList *offsets)
|
|
||||||
{
|
|
||||||
double result = 0;
|
|
||||||
for (GList *l = offsets; l; l = l->next) {
|
|
||||||
Offset *offset = (Offset *)l->data;
|
|
||||||
result += compute_control_point_offset(gi->area, offset);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void compute_control_point(GradientInstance *gi, ControlPoint *control, double *x, double *y, double *r)
|
|
||||||
{
|
|
||||||
*x = compute_control_point_offsets(gi, control->offsets_x);
|
|
||||||
*y = compute_control_point_offsets(gi, control->offsets_y);
|
|
||||||
*r = compute_control_point_offsets(gi, control->offsets_r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void update_gradient(GradientInstance *gi)
|
|
||||||
{
|
|
||||||
if (gi->pattern) {
|
|
||||||
return;
|
|
||||||
cairo_pattern_destroy(gi->pattern);
|
|
||||||
gi->pattern = NULL;
|
|
||||||
}
|
|
||||||
double from_x, from_y, from_r;
|
|
||||||
compute_control_point(gi, &gi->gradient_class->from, &from_x, &from_y, &from_r);
|
|
||||||
double to_x, to_y, to_r;
|
|
||||||
compute_control_point(gi, &gi->gradient_class->to, &to_x, &to_y, &to_r);
|
|
||||||
if (gi->gradient_class->type == GRADIENT_VERTICAL || gi->gradient_class->type == GRADIENT_HORIZONTAL) {
|
|
||||||
gi->pattern = cairo_pattern_create_linear(from_x, from_y, to_x, to_y);
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr,
|
|
||||||
"Creating linear gradient for area %s: %f %f, %f %f\n",
|
|
||||||
gi->area->name,
|
|
||||||
from_x,
|
|
||||||
from_y,
|
|
||||||
to_x,
|
|
||||||
to_y);
|
|
||||||
} else if (gi->gradient_class->type == GRADIENT_CENTERED) {
|
|
||||||
gi->pattern = cairo_pattern_create_radial(from_x, from_y, from_r, to_x, to_y, to_r);
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr,
|
|
||||||
"Creating radial gradient for area %s: %f %f %f, %f %f %f\n",
|
|
||||||
gi->area->name,
|
|
||||||
from_x,
|
|
||||||
from_y,
|
|
||||||
from_r,
|
|
||||||
to_x,
|
|
||||||
to_y,
|
|
||||||
to_r);
|
|
||||||
} else {
|
|
||||||
g_assert_not_reached();
|
|
||||||
}
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr,
|
|
||||||
"Adding color stop at offset %f: %f %f %f %f\n",
|
|
||||||
0.0,
|
|
||||||
gi->gradient_class->start_color.rgb[0],
|
|
||||||
gi->gradient_class->start_color.rgb[1],
|
|
||||||
gi->gradient_class->start_color.rgb[2],
|
|
||||||
gi->gradient_class->start_color.alpha);
|
|
||||||
cairo_pattern_add_color_stop_rgba(gi->pattern,
|
|
||||||
0,
|
|
||||||
gi->gradient_class->start_color.rgb[0],
|
|
||||||
gi->gradient_class->start_color.rgb[1],
|
|
||||||
gi->gradient_class->start_color.rgb[2],
|
|
||||||
gi->gradient_class->start_color.alpha);
|
|
||||||
for (GList *l = gi->gradient_class->extra_color_stops; l; l = l->next) {
|
|
||||||
ColorStop *color_stop = (ColorStop *)l->data;
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr,
|
|
||||||
"Adding color stop at offset %f: %f %f %f %f\n",
|
|
||||||
color_stop->offset,
|
|
||||||
color_stop->color.rgb[0],
|
|
||||||
color_stop->color.rgb[1],
|
|
||||||
color_stop->color.rgb[2],
|
|
||||||
color_stop->color.alpha);
|
|
||||||
cairo_pattern_add_color_stop_rgba(gi->pattern,
|
|
||||||
color_stop->offset,
|
|
||||||
color_stop->color.rgb[0],
|
|
||||||
color_stop->color.rgb[1],
|
|
||||||
color_stop->color.rgb[2],
|
|
||||||
color_stop->color.alpha);
|
|
||||||
}
|
|
||||||
if (debug_gradients)
|
|
||||||
fprintf(stderr,
|
|
||||||
"Adding color stop at offset %f: %f %f %f %f\n",
|
|
||||||
1.0,
|
|
||||||
gi->gradient_class->end_color.rgb[0],
|
|
||||||
gi->gradient_class->end_color.rgb[1],
|
|
||||||
gi->gradient_class->end_color.rgb[2],
|
|
||||||
gi->gradient_class->end_color.alpha);
|
|
||||||
cairo_pattern_add_color_stop_rgba(gi->pattern,
|
|
||||||
1.0,
|
|
||||||
gi->gradient_class->end_color.rgb[0],
|
|
||||||
gi->gradient_class->end_color.rgb[1],
|
|
||||||
gi->gradient_class->end_color.rgb[2],
|
|
||||||
gi->gradient_class->end_color.alpha);
|
|
||||||
}
|
|
||||||
|
|||||||
+9
-25
@@ -11,9 +11,6 @@
|
|||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <cairo-xlib.h>
|
#include <cairo-xlib.h>
|
||||||
|
|
||||||
#include "color.h"
|
|
||||||
#include "gradient.h"
|
|
||||||
|
|
||||||
// DATA ORGANISATION
|
// DATA ORGANISATION
|
||||||
//
|
//
|
||||||
// Areas in tint2 are similar to widgets in a GUI.
|
// Areas in tint2 are similar to widgets in a GUI.
|
||||||
@@ -120,6 +117,13 @@
|
|||||||
// The caller takes ownership of the pointer.
|
// The caller takes ownership of the pointer.
|
||||||
// The Area's _get_tooltip_text member must point to this function.
|
// The Area's _get_tooltip_text member must point to this function.
|
||||||
|
|
||||||
|
typedef struct Color {
|
||||||
|
// Values are in [0, 1], with 0 meaning no intensity.
|
||||||
|
double rgb[3];
|
||||||
|
// Values are in [0, 1], with 0 meaning fully transparent, 1 meaning fully opaque.
|
||||||
|
double alpha;
|
||||||
|
} Color;
|
||||||
|
|
||||||
typedef enum BorderMask {
|
typedef enum BorderMask {
|
||||||
BORDER_TOP = 1 << 0,
|
BORDER_TOP = 1 << 0,
|
||||||
BORDER_BOTTOM = 1 << 1,
|
BORDER_BOTTOM = 1 << 1,
|
||||||
@@ -140,8 +144,6 @@ typedef struct Border {
|
|||||||
int mask;
|
int mask;
|
||||||
} Border;
|
} Border;
|
||||||
|
|
||||||
typedef enum MouseState { MOUSE_NORMAL = 0, MOUSE_OVER = 1, MOUSE_DOWN = 2, MOUSE_STATE_COUNT } MouseState;
|
|
||||||
|
|
||||||
typedef struct Background {
|
typedef struct Background {
|
||||||
// Normal state
|
// Normal state
|
||||||
Color fill_color;
|
Color fill_color;
|
||||||
@@ -152,8 +154,6 @@ typedef struct Background {
|
|||||||
// On mouse press
|
// On mouse press
|
||||||
Color fill_color_pressed;
|
Color fill_color_pressed;
|
||||||
Color border_color_pressed;
|
Color border_color_pressed;
|
||||||
// Pointer to a GradientClass or NULL, no ownership
|
|
||||||
GradientClass *gradients[MOUSE_STATE_COUNT];
|
|
||||||
} Background;
|
} Background;
|
||||||
|
|
||||||
typedef enum Layout {
|
typedef enum Layout {
|
||||||
@@ -167,6 +167,8 @@ typedef enum Alignment {
|
|||||||
ALIGN_RIGHT = 2,
|
ALIGN_RIGHT = 2,
|
||||||
} Alignment;
|
} Alignment;
|
||||||
|
|
||||||
|
typedef enum MouseState { MOUSE_NORMAL = 0, MOUSE_OVER = 1, MOUSE_DOWN = 2, MOUSE_STATE_COUNT } MouseState;
|
||||||
|
|
||||||
struct Panel;
|
struct Panel;
|
||||||
|
|
||||||
typedef struct Area {
|
typedef struct Area {
|
||||||
@@ -174,12 +176,7 @@ typedef struct Area {
|
|||||||
int posx, posy;
|
int posx, posy;
|
||||||
// Size, including borders
|
// Size, including borders
|
||||||
int width, height;
|
int width, height;
|
||||||
int old_width, old_height;
|
|
||||||
Background *bg;
|
Background *bg;
|
||||||
// Each element is a GradientInstance attached to this Area (list can be empty)
|
|
||||||
GList *gradient_instances_by_state[MOUSE_STATE_COUNT];
|
|
||||||
// Each element is a GradientInstance that depends on this Area's geometry (position or size)
|
|
||||||
GList *dependent_gradients;
|
|
||||||
// List of children, each one a pointer to Area
|
// List of children, each one a pointer to Area
|
||||||
GList *children;
|
GList *children;
|
||||||
// Pointer to the parent Area or NULL
|
// Pointer to the parent Area or NULL
|
||||||
@@ -222,10 +219,6 @@ typedef struct Area {
|
|||||||
// Returns 1 if the new size is different than the previous size.
|
// Returns 1 if the new size is different than the previous size.
|
||||||
gboolean (*_resize)(void *obj);
|
gboolean (*_resize)(void *obj);
|
||||||
|
|
||||||
// Called before resize, obj = pointer to the Area
|
|
||||||
// Returns the desired size of the Area
|
|
||||||
int (*_compute_desired_size)(void *obj);
|
|
||||||
|
|
||||||
// Implemented only to override the default layout algorithm for this widget.
|
// Implemented only to override the default layout algorithm for this widget.
|
||||||
// For example, if this widget is a cell in a table, its position and size should be computed here.
|
// For example, if this widget is a cell in a table, its position and size should be computed here.
|
||||||
void (*_on_change_layout)(void *obj);
|
void (*_on_change_layout)(void *obj);
|
||||||
@@ -260,9 +253,6 @@ void relayout(Area *a);
|
|||||||
// If maximum_size > 0, it is an upper limit for the child size.
|
// If maximum_size > 0, it is an upper limit for the child size.
|
||||||
int relayout_with_constraint(Area *a, int maximum_size);
|
int relayout_with_constraint(Area *a, int maximum_size);
|
||||||
|
|
||||||
int compute_desired_size(Area *a);
|
|
||||||
int container_compute_desired_size(Area *a);
|
|
||||||
|
|
||||||
int left_border_width(Area *a);
|
int left_border_width(Area *a);
|
||||||
int right_border_width(Area *a);
|
int right_border_width(Area *a);
|
||||||
int left_right_border_width(Area *a);
|
int left_right_border_width(Area *a);
|
||||||
@@ -319,15 +309,9 @@ gboolean area_is_under_mouse(void *obj, int x, int y);
|
|||||||
// they are outside the drawing area of the button.
|
// they are outside the drawing area of the button.
|
||||||
gboolean full_width_area_is_under_mouse(void *obj, int x, int y);
|
gboolean full_width_area_is_under_mouse(void *obj, int x, int y);
|
||||||
|
|
||||||
void instantiate_area_gradients(Area *area);
|
|
||||||
void free_area_gradient_instances(Area *area);
|
|
||||||
|
|
||||||
void area_dump_geometry(Area *area, int indent);
|
void area_dump_geometry(Area *area, int indent);
|
||||||
|
|
||||||
void mouse_over(Area *area, int pressed);
|
void mouse_over(Area *area, int pressed);
|
||||||
void mouse_out();
|
void mouse_out();
|
||||||
|
|
||||||
void update_gradient(GradientInstance *gi);
|
|
||||||
void update_dependent_gradients(Area *a);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
#include "color.h"
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#ifndef COLOR_H
|
|
||||||
#define COLOR_H
|
|
||||||
|
|
||||||
typedef struct Color {
|
|
||||||
// Values are in [0, 1], with 0 meaning no intensity.
|
|
||||||
double rgb[3];
|
|
||||||
// Values are in [0, 1], with 0 meaning fully transparent, 1 meaning fully opaque.
|
|
||||||
double alpha;
|
|
||||||
} Color;
|
|
||||||
|
|
||||||
#endif // COLOR_H
|
|
||||||
+39
-42
@@ -199,44 +199,43 @@ void get_color(char *hex, double *rgb)
|
|||||||
rgb[2] = (b / 255.0);
|
rgb[2] = (b / 255.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void extract_values(const char *str, char **value1, char **value2, char **value3)
|
void extract_values(const char *value, char **value1, char **value2, char **value3)
|
||||||
{
|
{
|
||||||
*value1 = NULL;
|
char *b = 0, *c = 0;
|
||||||
*value2 = NULL;
|
|
||||||
*value3 = NULL;
|
|
||||||
char **tokens = g_strsplit(str, " ", 3);
|
|
||||||
if (tokens[0]) {
|
|
||||||
*value1 = strdup(tokens[0]);
|
|
||||||
if (tokens[1]) {
|
|
||||||
*value2 = strdup(tokens[1]);
|
|
||||||
if (tokens[2]) {
|
|
||||||
*value3 = strdup(tokens[2]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g_strfreev(tokens);
|
|
||||||
}
|
|
||||||
|
|
||||||
void extract_values_4(const char *str, char **value1, char **value2, char **value3, char **value4)
|
if (*value1)
|
||||||
{
|
free(*value1);
|
||||||
*value1 = NULL;
|
if (*value2)
|
||||||
*value2 = NULL;
|
free(*value2);
|
||||||
*value3 = NULL;
|
if (*value3)
|
||||||
*value4 = NULL;
|
free(*value3);
|
||||||
char **tokens = g_strsplit(str, " ", 4);
|
|
||||||
if (tokens[0]) {
|
if ((b = strchr(value, ' '))) {
|
||||||
*value1 = strdup(tokens[0]);
|
b[0] = '\0';
|
||||||
if (tokens[1]) {
|
b++;
|
||||||
*value2 = strdup(tokens[1]);
|
} else {
|
||||||
if (tokens[2]) {
|
*value2 = 0;
|
||||||
*value3 = strdup(tokens[2]);
|
*value3 = 0;
|
||||||
if (tokens[3]) {
|
}
|
||||||
*value4 = strdup(tokens[3]);
|
*value1 = strdup(value);
|
||||||
}
|
g_strstrip(*value1);
|
||||||
}
|
|
||||||
}
|
if (b) {
|
||||||
|
if ((c = strchr(b, ' '))) {
|
||||||
|
c[0] = '\0';
|
||||||
|
c++;
|
||||||
|
} else {
|
||||||
|
c = 0;
|
||||||
|
*value3 = 0;
|
||||||
|
}
|
||||||
|
*value2 = strdup(b);
|
||||||
|
g_strstrip(*value2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c) {
|
||||||
|
*value3 = strdup(c);
|
||||||
|
g_strstrip(*value3);
|
||||||
}
|
}
|
||||||
g_strfreev(tokens);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void adjust_asb(DATA32 *data, int w, int h, float alpha_adjust, float satur_adjust, float bright_adjust)
|
void adjust_asb(DATA32 *data, int w, int h, float alpha_adjust, float satur_adjust, float bright_adjust)
|
||||||
@@ -449,9 +448,9 @@ Imlib_Image load_image(const char *path, int cached)
|
|||||||
}
|
}
|
||||||
if (!image && g_str_has_suffix(path, ".svg")) {
|
if (!image && g_str_has_suffix(path, ".svg")) {
|
||||||
char tmp_filename[128];
|
char tmp_filename[128];
|
||||||
sprintf(tmp_filename, "/tmp/tint2-%d.png", (int)getpid());
|
sprintf(tmp_filename, "/tmp/tint2-%d-XXXXXX.png", (int)getpid());
|
||||||
int fd = open(tmp_filename, O_CREAT | O_EXCL, 0600);
|
int fd = mkstemps(tmp_filename, 4);
|
||||||
if (fd >= 0) {
|
if (fd) {
|
||||||
// We fork here because librsvg allocates memory like crazy
|
// We fork here because librsvg allocates memory like crazy
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
@@ -469,7 +468,6 @@ Imlib_Image load_image(const char *path, int cached)
|
|||||||
exit(0);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
// Parent
|
// Parent
|
||||||
close(fd);
|
|
||||||
waitpid(pid, 0, 0);
|
waitpid(pid, 0, 0);
|
||||||
image = imlib_load_image_immediately_without_cache(tmp_filename);
|
image = imlib_load_image_immediately_without_cache(tmp_filename);
|
||||||
unlink(tmp_filename);
|
unlink(tmp_filename);
|
||||||
@@ -619,7 +617,7 @@ void get_text_size2(PangoFontDescription *font,
|
|||||||
XFreePixmap(server.display, pmap);
|
XFreePixmap(server.display, pmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !GLIB_CHECK_VERSION(2, 34, 0)
|
#if !GLIB_CHECK_VERSION(2, 33, 4)
|
||||||
GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data)
|
GList *g_list_copy_deep(GList *list, GCopyFunc func, gpointer user_data)
|
||||||
{
|
{
|
||||||
list = g_list_copy(list);
|
list = g_list_copy(list);
|
||||||
@@ -640,8 +638,7 @@ GSList *load_locations_from_env(GSList *locations, const char *var, ...)
|
|||||||
if (value) {
|
if (value) {
|
||||||
value = strdup(value);
|
value = strdup(value);
|
||||||
char *p = value;
|
char *p = value;
|
||||||
char *t;
|
for (char *token = strsep(&value, ":"); token; token = strsep(&value, ":")) {
|
||||||
for (char *token = strtok_r(value, ":", &t); token; token = strtok_r(NULL, ":", &t)) {
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, var);
|
va_start(ap, var);
|
||||||
for (const char *suffix = va_arg(ap, const char *); suffix; suffix = va_arg(ap, const char *)) {
|
for (const char *suffix = va_arg(ap, const char *); suffix; suffix = va_arg(ap, const char *)) {
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ void copy_file(const char *path_src, const char *path_dest);
|
|||||||
gboolean parse_line(const char *line, char **key, char **value);
|
gboolean parse_line(const char *line, char **key, char **value);
|
||||||
|
|
||||||
void extract_values(const char *value, char **value1, char **value2, char **value3);
|
void extract_values(const char *value, char **value1, char **value2, char **value3);
|
||||||
void extract_values_4(const char *value, char **value1, char **value2, char **value3, char **value4);
|
|
||||||
|
|
||||||
// Executes a command in a shell.
|
// Executes a command in a shell.
|
||||||
void tint_exec(const char *command);
|
void tint_exec(const char *command);
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
#include "gradient.h"
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
gboolean read_double(const char *str, double *value)
|
|
||||||
{
|
|
||||||
if (!str[0])
|
|
||||||
return FALSE;
|
|
||||||
char *end;
|
|
||||||
*value = strtod(str, &end);
|
|
||||||
if (end[0])
|
|
||||||
return FALSE;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean read_double_with_percent(const char *str, double *value)
|
|
||||||
{
|
|
||||||
if (!str[0])
|
|
||||||
return FALSE;
|
|
||||||
char *end;
|
|
||||||
*value = strtod(str, &end);
|
|
||||||
if (end[0] == '%' && !end[1]) {
|
|
||||||
*value *= 0.01;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
if (end[0])
|
|
||||||
return FALSE;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
GradientType gradient_type_from_string(const char *str)
|
|
||||||
{
|
|
||||||
if (g_str_equal(str, "horizontal"))
|
|
||||||
return GRADIENT_HORIZONTAL;
|
|
||||||
if (g_str_equal(str, "vertical"))
|
|
||||||
return GRADIENT_VERTICAL;
|
|
||||||
if (g_str_equal(str, "radial"))
|
|
||||||
return GRADIENT_CENTERED;
|
|
||||||
fprintf(stderr, RED "Invalid gradient type: %s" RESET "\n", str);
|
|
||||||
return GRADIENT_VERTICAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_gradient(GradientClass *g, GradientType type)
|
|
||||||
{
|
|
||||||
memset(g, 0, sizeof(*g));
|
|
||||||
g->type = type;
|
|
||||||
if (g->type == GRADIENT_VERTICAL) {
|
|
||||||
Offset *offset_top = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_top->constant = TRUE;
|
|
||||||
offset_top->constant_value = 0;
|
|
||||||
g->from.offsets_y = g_list_append(g->from.offsets_y, offset_top);
|
|
||||||
Offset *offset_bottom = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_bottom->constant = FALSE;
|
|
||||||
offset_bottom->element = ELEMENT_SELF;
|
|
||||||
offset_bottom->variable = SIZE_HEIGHT;
|
|
||||||
offset_bottom->multiplier = 1.0;
|
|
||||||
g->to.offsets_y = g_list_append(g->to.offsets_y, offset_bottom);
|
|
||||||
} else if (g->type == GRADIENT_HORIZONTAL) {
|
|
||||||
Offset *offset_left = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_left->constant = TRUE;
|
|
||||||
offset_left->constant_value = 0;
|
|
||||||
g->from.offsets_x = g_list_append(g->from.offsets_x, offset_left);
|
|
||||||
Offset *offset_right = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_right->constant = FALSE;
|
|
||||||
offset_right->element = ELEMENT_SELF;
|
|
||||||
offset_right->variable = SIZE_WIDTH;
|
|
||||||
offset_right->multiplier = 1.0;
|
|
||||||
g->to.offsets_x = g_list_append(g->to.offsets_x, offset_right);
|
|
||||||
} else if (g->type == GRADIENT_CENTERED) {
|
|
||||||
// from
|
|
||||||
Offset *offset_center_x = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_center_x->constant = FALSE;
|
|
||||||
offset_center_x->element = ELEMENT_SELF;
|
|
||||||
offset_center_x->variable = SIZE_CENTERX;
|
|
||||||
offset_center_x->multiplier = 1.0;
|
|
||||||
g->from.offsets_x = g_list_append(g->from.offsets_x, offset_center_x);
|
|
||||||
Offset *offset_center_y = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_center_y->constant = FALSE;
|
|
||||||
offset_center_y->element = ELEMENT_SELF;
|
|
||||||
offset_center_y->variable = SIZE_CENTERY;
|
|
||||||
offset_center_y->multiplier = 1.0;
|
|
||||||
g->from.offsets_y = g_list_append(g->from.offsets_y, offset_center_y);
|
|
||||||
Offset *offset_center_r = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_center_r->constant = TRUE;
|
|
||||||
offset_center_r->constant_value = 0;
|
|
||||||
g->from.offsets_r = g_list_append(g->from.offsets_r, offset_center_r);
|
|
||||||
// to
|
|
||||||
offset_center_x = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_center_x->constant = FALSE;
|
|
||||||
offset_center_x->element = ELEMENT_SELF;
|
|
||||||
offset_center_x->variable = SIZE_CENTERX;
|
|
||||||
offset_center_x->multiplier = 1.0;
|
|
||||||
g->to.offsets_x = g_list_append(g->to.offsets_x, offset_center_x);
|
|
||||||
offset_center_y = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_center_y->constant = FALSE;
|
|
||||||
offset_center_y->element = ELEMENT_SELF;
|
|
||||||
offset_center_y->variable = SIZE_CENTERY;
|
|
||||||
offset_center_y->multiplier = 1.0;
|
|
||||||
g->to.offsets_y = g_list_append(g->to.offsets_y, offset_center_y);
|
|
||||||
offset_center_r = (Offset *)calloc(1, sizeof(Offset));
|
|
||||||
offset_center_r->constant = FALSE;
|
|
||||||
offset_center_r->element = ELEMENT_SELF;
|
|
||||||
offset_center_r->variable = SIZE_RADIUS;
|
|
||||||
offset_center_r->multiplier = 1.0;
|
|
||||||
g->to.offsets_r = g_list_append(g->to.offsets_r, offset_center_r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void cleanup_gradient(GradientClass *g)
|
|
||||||
{
|
|
||||||
g_list_free_full(g->extra_color_stops, free);
|
|
||||||
g_list_free_full(g->from.offsets_x, free);
|
|
||||||
g_list_free_full(g->from.offsets_y, free);
|
|
||||||
g_list_free_full(g->from.offsets_r, free);
|
|
||||||
g_list_free_full(g->to.offsets_x, free);
|
|
||||||
g_list_free_full(g->to.offsets_y, free);
|
|
||||||
g_list_free_full(g->to.offsets_r, free);
|
|
||||||
bzero(g, sizeof(*g));
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
#ifndef GRADIENT_H
|
|
||||||
#define GRADIENT_H
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
#include <cairo.h>
|
|
||||||
|
|
||||||
#include "color.h"
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
|
||||||
// Gradient types read from config options, not associated to any area
|
|
||||||
|
|
||||||
typedef enum GradientType {
|
|
||||||
GRADIENT_VERTICAL = 0,
|
|
||||||
GRADIENT_HORIZONTAL,
|
|
||||||
GRADIENT_CENTERED
|
|
||||||
} GradientType;
|
|
||||||
|
|
||||||
typedef struct ColorStop {
|
|
||||||
Color color;
|
|
||||||
// offset in 0-1
|
|
||||||
double offset;
|
|
||||||
} ColorStop;
|
|
||||||
|
|
||||||
typedef enum Element {
|
|
||||||
ELEMENT_SELF = 0,
|
|
||||||
ELEMENT_PARENT,
|
|
||||||
ELEMENT_PANEL
|
|
||||||
} Element;
|
|
||||||
|
|
||||||
typedef enum SizeVariable {
|
|
||||||
SIZE_WIDTH = 0,
|
|
||||||
SIZE_HEIGHT,
|
|
||||||
SIZE_RADIUS,
|
|
||||||
SIZE_LEFT,
|
|
||||||
SIZE_RIGHT,
|
|
||||||
SIZE_TOP,
|
|
||||||
SIZE_BOTTOM,
|
|
||||||
SIZE_CENTERX,
|
|
||||||
SIZE_CENTERY
|
|
||||||
} SizeVariable;
|
|
||||||
|
|
||||||
typedef struct Offset {
|
|
||||||
gboolean constant;
|
|
||||||
// if constant == true
|
|
||||||
double constant_value;
|
|
||||||
// else
|
|
||||||
Element element;
|
|
||||||
SizeVariable variable;
|
|
||||||
double multiplier;
|
|
||||||
} Offset;
|
|
||||||
|
|
||||||
typedef struct ControlPoint {
|
|
||||||
// Each element is an Offset
|
|
||||||
GList *offsets_x;
|
|
||||||
GList *offsets_y;
|
|
||||||
// Defined only for radial gradients
|
|
||||||
GList *offsets_r;
|
|
||||||
} ControlPoint;
|
|
||||||
|
|
||||||
typedef struct GradientClass {
|
|
||||||
GradientType type;
|
|
||||||
Color start_color;
|
|
||||||
Color end_color;
|
|
||||||
// Each element is a ColorStop
|
|
||||||
GList *extra_color_stops;
|
|
||||||
ControlPoint from;
|
|
||||||
ControlPoint to;
|
|
||||||
} GradientClass;
|
|
||||||
|
|
||||||
GradientType gradient_type_from_string(const char *str);
|
|
||||||
void init_gradient(GradientClass *g, GradientType type);
|
|
||||||
void cleanup_gradient(GradientClass *g);
|
|
||||||
|
|
||||||
/////////////////////////////////////////
|
|
||||||
// Gradient instances associated to Areas
|
|
||||||
|
|
||||||
struct Area;
|
|
||||||
typedef struct Area Area;
|
|
||||||
|
|
||||||
typedef struct GradientInstance {
|
|
||||||
GradientClass *gradient_class;
|
|
||||||
Area *area;
|
|
||||||
cairo_pattern_t *pattern;
|
|
||||||
} GradientInstance;
|
|
||||||
|
|
||||||
extern gboolean debug_gradients;
|
|
||||||
|
|
||||||
#endif // GRADIENT_H
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
/sys/class/power_supply/bq27500-0/
|
|
||||||
cat: /sys/class/power_supply/bq27500-0/: Is a directory
|
|
||||||
/sys/class/power_supply/bq27500-0/temp
|
|
||||||
236
|
|
||||||
/sys/class/power_supply/bq27500-0/type
|
|
||||||
Battery
|
|
||||||
/sys/class/power_supply/bq27500-0/power_avg
|
|
||||||
65324
|
|
||||||
/sys/class/power_supply/bq27500-0/power
|
|
||||||
cat: /sys/class/power_supply/bq27500-0/power: Is a directory
|
|
||||||
/sys/class/power_supply/bq27500-0/power/control
|
|
||||||
auto
|
|
||||||
/sys/class/power_supply/bq27500-0/power/async
|
|
||||||
disabled
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_abort_count
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_active
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_type
|
|
||||||
unknown
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_total_time_ms
|
|
||||||
46
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_active_count
|
|
||||||
3
|
|
||||||
/sys/class/power_supply/bq27500-0/power/runtime_enabled
|
|
||||||
disabled
|
|
||||||
/sys/class/power_supply/bq27500-0/power/runtime_active_kids
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/power/runtime_active_time
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_max_time_ms
|
|
||||||
16
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_count
|
|
||||||
3
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_last_time_ms
|
|
||||||
264291
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup
|
|
||||||
enabled
|
|
||||||
/sys/class/power_supply/bq27500-0/power/autosuspend_delay_ms
|
|
||||||
cat: /sys/class/power_supply/bq27500-0/power/autosuspend_delay_ms: Input/output error
|
|
||||||
/sys/class/power_supply/bq27500-0/power/runtime_status
|
|
||||||
unsupported
|
|
||||||
/sys/class/power_supply/bq27500-0/power/runtime_usage
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/power/wakeup_expire_count
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/power/runtime_suspended_time
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/charge_full_design
|
|
||||||
8180000
|
|
||||||
/sys/class/power_supply/bq27500-0/current_now
|
|
||||||
-498000
|
|
||||||
/sys/class/power_supply/bq27500-0/charge_now
|
|
||||||
7253000
|
|
||||||
/sys/class/power_supply/bq27500-0/charge_full
|
|
||||||
7323000
|
|
||||||
/sys/class/power_supply/bq27500-0/device
|
|
||||||
cat: /sys/class/power_supply/bq27500-0/device: Is a directory
|
|
||||||
/sys/class/power_supply/bq27500-0/capacity
|
|
||||||
98
|
|
||||||
/sys/class/power_supply/bq27500-0/health
|
|
||||||
Good
|
|
||||||
/sys/class/power_supply/bq27500-0/subsystem
|
|
||||||
cat: /sys/class/power_supply/bq27500-0/subsystem: Is a directory
|
|
||||||
/sys/class/power_supply/bq27500-0/capacity_level
|
|
||||||
Normal
|
|
||||||
/sys/class/power_supply/bq27500-0/status
|
|
||||||
Discharging
|
|
||||||
/sys/class/power_supply/bq27500-0/voltage_now
|
|
||||||
4260000
|
|
||||||
/sys/class/power_supply/bq27500-0/uevent
|
|
||||||
POWER_SUPPLY_NAME=bq27500-0
|
|
||||||
POWER_SUPPLY_STATUS=Discharging
|
|
||||||
POWER_SUPPLY_PRESENT=1
|
|
||||||
POWER_SUPPLY_VOLTAGE_NOW=4260000
|
|
||||||
POWER_SUPPLY_CURRENT_NOW=-498000
|
|
||||||
POWER_SUPPLY_CAPACITY=98
|
|
||||||
POWER_SUPPLY_CAPACITY_LEVEL=Normal
|
|
||||||
POWER_SUPPLY_TEMP=236
|
|
||||||
POWER_SUPPLY_TIME_TO_EMPTY_NOW=40980
|
|
||||||
POWER_SUPPLY_TIME_TO_EMPTY_AVG=0
|
|
||||||
POWER_SUPPLY_TIME_TO_FULL_NOW=441780
|
|
||||||
POWER_SUPPLY_TECHNOLOGY=Li-ion
|
|
||||||
POWER_SUPPLY_CHARGE_FULL=7323000
|
|
||||||
POWER_SUPPLY_CHARGE_NOW=7253000
|
|
||||||
POWER_SUPPLY_CHARGE_FULL_DESIGN=8180000
|
|
||||||
POWER_SUPPLY_CYCLE_COUNT=46
|
|
||||||
POWER_SUPPLY_ENERGY_NOW=7253000
|
|
||||||
POWER_SUPPLY_POWER_AVG=65324
|
|
||||||
POWER_SUPPLY_HEALTH=Good
|
|
||||||
POWER_SUPPLY_MANUFACTURER=Texas Instruments
|
|
||||||
POWER_SUPPLY_MODEL_NAME=C100-80
|
|
||||||
/sys/class/power_supply/bq27500-0/energy_now
|
|
||||||
7253000
|
|
||||||
/sys/class/power_supply/bq27500-0/model_name
|
|
||||||
C100-80
|
|
||||||
/sys/class/power_supply/bq27500-0/manufacturer
|
|
||||||
Texas Instruments
|
|
||||||
/sys/class/power_supply/bq27500-0/technology
|
|
||||||
Li-ion
|
|
||||||
/sys/class/power_supply/bq27500-0/cycle_count
|
|
||||||
46
|
|
||||||
/sys/class/power_supply/bq27500-0/time_to_full_now
|
|
||||||
441780
|
|
||||||
/sys/class/power_supply/bq27500-0/time_to_empty_avg
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/bq27500-0/time_to_empty_now
|
|
||||||
40980
|
|
||||||
/sys/class/power_supply/bq27500-0/present
|
|
||||||
1
|
|
||||||
/sys/class/power_supply/gpio-charger/
|
|
||||||
cat: /sys/class/power_supply/gpio-charger/: Is a directory
|
|
||||||
/sys/class/power_supply/gpio-charger/type
|
|
||||||
Mains
|
|
||||||
/sys/class/power_supply/gpio-charger/power
|
|
||||||
cat: /sys/class/power_supply/gpio-charger/power: Is a directory
|
|
||||||
/sys/class/power_supply/gpio-charger/power/control
|
|
||||||
auto
|
|
||||||
/sys/class/power_supply/gpio-charger/power/async
|
|
||||||
disabled
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_abort_count
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_active
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_type
|
|
||||||
unknown
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_total_time_ms
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_active_count
|
|
||||||
1
|
|
||||||
/sys/class/power_supply/gpio-charger/power/runtime_enabled
|
|
||||||
disabled
|
|
||||||
/sys/class/power_supply/gpio-charger/power/runtime_active_kids
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/runtime_active_time
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_max_time_ms
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_count
|
|
||||||
1
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_last_time_ms
|
|
||||||
349
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup
|
|
||||||
enabled
|
|
||||||
/sys/class/power_supply/gpio-charger/power/autosuspend_delay_ms
|
|
||||||
cat: /sys/class/power_supply/gpio-charger/power/autosuspend_delay_ms: Input/output error
|
|
||||||
/sys/class/power_supply/gpio-charger/power/runtime_status
|
|
||||||
unsupported
|
|
||||||
/sys/class/power_supply/gpio-charger/power/runtime_usage
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/wakeup_expire_count
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/power/runtime_suspended_time
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/device
|
|
||||||
cat: /sys/class/power_supply/gpio-charger/device: Is a directory
|
|
||||||
/sys/class/power_supply/gpio-charger/subsystem
|
|
||||||
cat: /sys/class/power_supply/gpio-charger/subsystem: Is a directory
|
|
||||||
/sys/class/power_supply/gpio-charger/online
|
|
||||||
0
|
|
||||||
/sys/class/power_supply/gpio-charger/uevent
|
|
||||||
POWER_SUPPLY_NAME=gpio-charger
|
|
||||||
POWER_SUPPLY_ONLINE=0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
98
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Normal
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
7323000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
8180000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
7253000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
-498000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
46
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
7253000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Good
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Texas Instruments
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
C100-80
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
disabled
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
auto
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
disabled
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
unsupported
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
enabled
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
3
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
0
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
264291
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
16
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
46
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user