Commit Graph

144 Commits

Author SHA1 Message Date
Julien Danjou 4a7e52cc27 Change draw_rotate() proto to directly render on the right Pixmap 2008-03-23 15:52:22 +01:00
Julien Danjou a3f9eb7af9 Revert "Add preliminary support for XPM format"
This reverts commit 5f8b538a5e4eeea159b26c3d0b943cac745ffdce.
2008-03-23 15:52:22 +01:00
Julien Danjou df2555d9fe Add preliminary support for XPM format
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:22 +01:00
Julien Danjou accf223bb1 Use warn() instead of perror()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
Julien Danjou 19656fc36d Add a CFG_ALIGNMENT type and use it
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
marco candrian 214a5c4bfa new graph-widget option: grow = <{right, left}>
Signed-off-by: Marco Candrian <mac@calmar.ws>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
Julien Danjou 44824e9ac7 Draw buf, not text
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
Arnaud Fontaine f75f16c325 Don't get ascent/descent informations about a font because it's not
useful at the moment (commented out).
2008-03-23 15:52:21 +01:00
Arnaud Fontaine 542a944361 Use Pango for fonts instead of Xft (which hasn't been ported yet to
XCB) to measure text.
2008-03-23 15:52:21 +01:00
Julien Danjou c6eec955c8 Rename Area to area_t 2008-03-23 15:52:18 +01:00
Julien Danjou fa47024714 Change colors infrastructure to style: rename colors_ctx_t to style_t and add font in it 2008-03-23 15:52:18 +01:00
Julien Danjou 9dfd488dda Change colors handling 2008-03-23 15:52:18 +01:00
marco candrian 2e935ae1f6 vertical_gradient option for the graph widget
if true, the color values (fg, fg_center, fg_end) create a color gradient
from 0 to full value, instead of new values to old values.

each data{} can have it's own setting
2008-03-23 15:52:17 +01:00
Julien Danjou 0a980095b3 Rework colors stuff, add a common colors_ctx_t containing colors and shadow options 2008-03-23 15:52:17 +01:00
Julien Danjou f3652aaca6 Add a pointer to SLIST struct to store previous element
This will make back cycling faster
2008-03-23 15:52:17 +01:00
marco candrian 04ff373a63 New progressbar option: vertical=<boolean>
if 'true', draws the whole progressbar-block vertically
instead of horizontally.
2008-03-23 15:52:16 +01:00
marco candrian 6216d25bc6 new progressbar option for reversing the drawing
inside a data section, with reverse=<boolean> it's possible to reverse the
drawing i.e instead of left to right, from right to left. etc.
2008-03-23 15:52:16 +01:00
Julien Danjou 4451e9099e Add support for text shadow, add new text_shadow_offset option. 2008-03-23 15:52:15 +01:00
Julien Danjou 46b80552c6 add support for flex -> AlignFlex 2008-02-28 16:19:26 +01:00
Julien Danjou 46742a56e4 documentation update and some cosmetic 2008-02-27 09:32:45 +01:00
Julien Danjou 328e5d0d4e rename screen to phys_screen to avoid confusion 2008-02-25 13:33:29 +01:00
marco candrian 73696a26a9 cairo_destroy() added
(at least partly related to: FS#68 - awesome eats cpu time)

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-25 10:01:42 +01:00
Julien Danjou ae75f55acd change draw_color_new() proto to fill the struct and return status 2008-02-13 08:58:21 +01:00
Julien Danjou 9390abcfb4 fix memory leak in smart_placement (with area_list_remove) and fix the algo 2008-02-11 17:15:28 +01:00
Julien Danjou e244210943 return the right buffer, iconv modify one 2008-02-11 10:52:05 +01:00
Julien Danjou 1a643a20bd simplify buf handling 2008-02-11 10:40:38 +01:00
Julien Danjou 321a481dce return good pointer and free good pointer 2008-02-11 09:21:09 +01:00
Julien Danjou fbce780003 check iso2utf8 return 2008-02-11 08:49:10 +01:00
Julien Danjou 44a0a1ee4e make draw_text multibyte UTF-8 aware 2008-02-09 16:23:16 +01:00
Julien Danjou 0bfa880b0f add align option to widget to specify their alignment 2008-02-08 10:59:55 +01:00
marco candrian 8567009d22 rename of fg_middle/fg_half to fg_center and fg_full to fg_end
A hint from maxauthority. The names would be unified now in the progressbar
and the graph widget. And (hopefully) it's easier to guess what they mean now.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-06 07:32:22 +01:00
marco candrian ff753f1f14 Adds fg_middle + fg_end color option for the graph widget
Draws a color-gradient beginning from fg and
if either fg_middle or fg_end is set, through them.

example config:

    graph gr_cpu
    {
      data { scale = false max = 100  style = bottom
             fg = "#cc6666" fg_half = "#cc6666" fg_full = "#998888"}
      ...
      ...
    }

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-05 15:37:21 +01:00
marco candrian 09e60cb95e adds fg_half as an option to the progressbar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-05 07:16:12 +01:00
Julien Danjou 1b4a1e7c9e convert text to draw to UTF-8 2008-02-04 13:28:20 +01:00
marco candrian b024b0c0cf draw_rectangle_gradient() for the progressbar widget; + fg_full option
Adds an optional additional foreground color option to a bar: fg_full = <color>

A value of 0 represents the fg-color, and a value of 100 (a full graph) the
fg_full-color.

Example:

progressbar xy
{
  bar { fg = "#111155" fg_full = "#3333cc"  bg = "#000000" bordercolor = "#4444cc"}
  ....
}

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-04 11:16:30 +01:00
marco candrian 8d3c24e03e fix for cairo_arc
Without a new (sub)path, it joined the new circle to the old reference point,
what happend to be at the end of the title-text - therefore the line to it with
cairo_stroke()

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-01 09:21:24 +01:00
marco candrian be0779d0fa graph widget adopted to the latest statusbar changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-31 20:43:42 +01:00
Julien Danjou a28876b5ce reuse cairo context stuff 2008-01-31 18:18:15 +01:00
Julien Danjou ea57fd8fc9 add support for smart windows placement in floating layout 2008-01-28 18:30:23 +01:00
Julien Danjou 30eba52596 rename draw_get_context() to draw_context_new() 2008-01-27 19:02:08 +01:00
Julien Danjou b6642e45c8 rename initxcolor to draw_color_new() and move it to draw.c 2008-01-27 18:56:37 +01:00
marco candrian 836942eb4c Fix for the problem that cairo draws over the given path on very sharp angles
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-26 17:38:20 +01:00
marco candrian c73e0bd72e Additional graph widget options
There are the new styles:

bottom (fill the graph to the bottom of widget-square)
top (fill the graph to the top of the widget-square
line (just print a line representing the values)

E.g when there are multiple 'bottom'-style graphs, it will print the larger
part on top of the smaller.  When two values are the same, it will (actually)
just print it with one color (something to improve maybe).

bottom-style overdraws top-style, and line-style overdraws top and bottom style
(= gets drawn at the end)

An example configuration:

    graph gr_cpu
    {
      data { scale = false max = 100 fg = "#669966" style = bottom} # total
      data { scale = false max = 100 fg = "#cc9966" style = bottom} # user
      data { scale = false max = 100 fg = "#ffffff" style = bottom} # nice-processes
      width = 50
      height = "0.80"
      bg = "#000000"
      bordercolor = "#669966"
    }

With the 'line' style, there is a bug (draws sometimes over the rectangle).
I checked the values and didn't find any value what actually should do that.
So I have no idea why that is... needs a recheck, because it's not really nice..
Happens especially when scale=true and after a rescaling takes place.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-25 22:53:20 +01:00
Julien Danjou 2ac27fdac4 move draw files to common/ 2008-01-24 18:48:11 +01:00