Commit Graph

158 Commits

Author SHA1 Message Date
Emmanuel Lepage Vallee 2e827202ec doc: Fix a matrix copy paste mistake 2016-07-22 21:55:23 -04:00
Emmanuel Lepage Vallee 441587a4de shape: Use an explicit move_to to set rounded_rect position
All other shape did it. While it usually have no side effects,
as seen in #920 screenshot from @actionless, there is instances
where this produce a invalid rectangle.
2016-07-04 14:34:41 -04:00
Uli Schlachter 2d511e2ab5 gears.object.properties: Implement read-only properties
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-08 20:28:31 +02:00
Uli Schlachter 6956b9f6fa gears.object: Implement read-only properties
If a getter exists, but there is no setter, then this means that the property is
read-only.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-08 20:28:30 +02:00
Uli Schlachter 0857f6f1b5 Lua: Remove calls to add_signal()
The requirement to call add_signal() was added to catch typos. However, this
requirement became increasingly annoying with property::<name> signals and e.g.
gears.object allowing arbitrary properties to be changed.

All of this ended up in a single commit because tests/examples fails if I first
let add_signal() emit a deprecation warning.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-04 18:23:48 +02:00
Emmanuel Lepage Vallee 490306a5fc shape: Add default rounded_rect radius
Add an arbitrary value to avoid all caller setting extra arguments.
2016-05-30 18:00:58 -04:00
Emmanuel Lepage Vallee 44a4eca40e doc: Port the shape images to the doc example system 2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee d85588babe wibox: Create a container module
Previously, the "containers" were placed in layout or widget.

They all have similar APIs and usage, so lets bring them together.
2016-05-30 17:51:19 -04:00
Emmanuel Lepage Vallee d6a7b6c645 object: Add a dynamic property example 2016-05-18 01:23:53 -04:00
Emmanuel Lepage Vallee f810d78e7b object: Add a signal example 2016-05-18 01:23:53 -04:00
Emmanuel Lepage Vallee adebef629b object: Add an header description 2016-05-18 01:23:53 -04:00
Emmanuel Lepage Vallee b1c33fbd09 object: Add type information to documentation 2016-05-18 01:23:53 -04:00
Emmanuel Lepage Vallee 4b21ca9184 object: Add dynamic properties support.
Similar systems already exist un luaobject, wibox and the declarative
widget system. This close the gap and also bring the property based
syntax to wibox and other gears.object users.

While this need to be enabled explicitly for legacy reasons, it
doesn't break the API.

Once widespread, this implementation will replace the one found
in wibox.widget.base_widget.
2016-05-18 01:23:53 -04:00
Emmanuel Lepage Vallee 11e77d5191 gears: Remove `screen`
It has been deprecated for a while and was never part of a release.
2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee aa46b96369 gears.geometry: Add area_remove 2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee 1ce92bb550 get_rect_by_dir: Move to `gears.geometry`
Begin to break down `awful.util`
2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee dd121623b5 gears.geometry: Mutualize getbycoord 2016-05-16 14:03:00 -04:00
Emmanuel Lepage Vallee 9d13e08c63 gears: Add a geometry modules
Add an abstract geometry module to `gears`
2016-05-16 01:18:19 -04:00
Uli Schlachter 8b3f263de3 Merge branch 'traceback-with-failed-to-load-error' of https://github.com/blueyed/awesome 2016-05-15 16:31:14 +02:00
Daniel Hahler c25c0527a6 gears.surface: add a traceback for "Failed to load" errors
This is useful to see where the error is coming from.
2016-05-11 21:50:02 +02:00
Uli Schlachter aed571eb48 gears.wallpaper: Handle concurrent screen changes
The code in gears.wallpaper currently sets a wallpaper in a deferred fashion.
Only a while after it is told to do something does it actually do the wallpaper
change. This is to incorporate many wallpaper changes right after another. These
changes happens during startup where the wallpaper for each screen is set one
after another.

However, since we no longer restart on RandR changes, the screen configuration
could change while we have a pending wallpaper. In this case, part of the
wallpaper could be "chopped off", because the surface that we draw the wallpaper
to is too small.

This commit makes gears.wallpaper track the size of the pending wallpaper and
create a new surface if the already-pending one is too small.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-05-08 17:48:40 +02:00
Uli Schlachter cd55c57937 Merge branch 'root-size' of https://github.com/psychon/awesome 2016-04-15 19:35:12 +02:00
Emmanuel Lepage Vallee 00d782f3d3 awful.screen: Deprecate functions, add methods 2016-04-11 23:54:28 -04:00
Emmanuel Lepage Vallee 828543c838 gears.object.properties: Support 'obj.is_something'
Used when there a property is set by mutators instead of accessors.
2016-04-11 23:46:10 -04:00
Uli Schlachter 7863a5e65b gears.wallpaper: Use root.size()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-04-09 15:19:46 +02:00
Emmanuel Lepage Vallee 8a0738a4bc gears.screen: Merge into awful.screen
gears modules usually don't depend on Awesome C-API. This code has
been placed there for unclear reasons.

Also, there is ongoing work to unify each "concepts" API into one
single page. Having `gears.screen` go against this effort.
2016-04-06 23:32:44 -04:00
Emmanuel Lepage Vallee e24cb901cb Typo: Ajust -> Adjust 2016-04-04 00:56:11 -04:00
Daniel Hahler 3ad0a9d8d2 Merge pull request #780 from psychon/screen-add-signal
Add screen add signal
2016-04-03 18:35:08 +02:00
Emmanuel Lepage Vallee 9da40d010c gears.surface: Add methods to convert widgets to surfaces
It can be saved directly to a PNG or SVG file or used as a cairo
surface or pattern.
2016-03-31 04:45:45 -04:00
Emmanuel Lepage Vallee a77e650c5f gears.object: Add a new "property fallback" object type 2016-03-30 03:27:19 -04:00
Uli Schlachter 3233eb6cce gears.wallpaper: Use connect_for_each_screen()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-27 10:51:28 +02:00
Uli Schlachter 94dede7511 Add functions for calling something for every screen
This adds gears.screen which contains a wrapper around
screen.connect_signal("added", func) that also calls the callback function for
each screen that already exists. This is added in gears.screen so that it can
also be used from e.g. wibox, if needed. Feel free to move this elsewhere if
that's a bad idea (I'm not really convinced of it).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-27 10:51:28 +02:00
Uli Schlachter 8ef96bcde7 gears.matrix: Remove (now-)unused code
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-26 19:37:21 +01:00
Uli Schlachter 96055fc86b gears.shape: Stop using _call on a matrix
Instead of using a special _call field on gears.matrix instances which has to be
copied around suitably, this commit changes the code so that the magic is
restricted to a single function in gears.shape.transform. With some metatable
magic, suitable redirection to everything is added.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-26 19:33:10 +01:00
Uli Schlachter 19f146de5f Add missing modeline to gears.shape
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-26 19:32:40 +01:00
Emmanuel Lepage Vallee f6556b145f gears.shape: Improve documentation 2016-03-16 18:02:41 -04:00
Emmanuel Lepage Vallee 9bd150f39a shape: Add radial_progress shape 2016-03-16 17:45:11 -04:00
Emmanuel Lepage Vallee 650d8d0cb5 shape: Add partially_rounded_rect shape 2016-03-16 17:44:37 -04:00
Emmanuel Lepage Vallee 57e370700f shape: Add losange shape 2016-03-16 17:44:37 -04:00
Emmanuel Lepage Vallee bc16b75ff5 shape: Add parallelogram shape 2016-03-16 17:44:30 -04:00
Emmanuel Lepage Vallee 7b4109265e shape: Add rectangle shape 2016-03-16 05:57:44 -04:00
Emmanuel Lepage Vallee 990619db5a shape: Add circle shape 2016-03-16 05:57:44 -04:00
Emmanuel Lepage Vallee 3b95d2467f shape: Add octogon shape 2016-03-16 05:57:44 -04:00
Emmanuel Lepage Vallee f0bf642f32 shape: Add cross shape 2016-03-16 05:57:44 -04:00
Emmanuel Lepage Vallee 5dbffc73c1 shape: Minor fixes 2016-03-16 05:57:44 -04:00
Uli Schlachter 95e5bdf5d2 Use the new way to iterate over screens in Lua
This gets us one step closer to removing screen indices.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-06 14:05:28 +01:00
Emmanuel Lepage Vallee 2aa15c9454 gears.color: Add transparent constant
Avoid repetitive "#00000000" for transparent wiboxes and such
elements.
2016-03-04 03:16:56 -05:00
Daniel Hahler 7c7295a282 Merge pull request #716 from psychon/wallpaper_cleanup
Wallpaper cleanup
2016-03-03 22:16:48 +01:00
Uli Schlachter b05b699129 gears.wallpaper: Free wallpaper from memory when done
Wallpapers are usually big images that use up a lot of memory. This commit makes
gears.wallpaper call :finish() on all involved surface to make them free their
memory.

This is a lot faster than waiting for the garbage collector to collect these
surfaces. Due to the large size of wallpapers, such a special case makes sense
for this code.

Hopefully-helps: https://github.com/awesomeWM/awesome/issues/368
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-28 17:24:24 +01:00
Uli Schlachter 2ad147d740 gears.surface: Change the way that caching works
Loading a file normally has the same behaviour as before. First the cache is
checked and if nothing is found, the file is loaded and cached.

This commit changes the behaviour of loading a file uncached. This no longer
removes the file from the cache if it is cached (why should it?) and also does
not put it in the cache.

This means that users of load_uncached and load_uncached_silently can now freely
modify the resulting surface without interfering with other API users.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-02-28 17:21:10 +01:00