Commit Graph

56 Commits

Author SHA1 Message Date
Julien Danjou ed7865c37b [graph] Cosmetic
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:35 +02:00
Julien Danjou effaa99b91 [awesome] Remove useless includes
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:35 +02:00
Julien Danjou 33837d77a1 [draw] Rename DrawCtx to draw_context_t
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:05 +02:00
marco candrian 8fa33698d2 replace 'command' with 'new_value'
Describes it somebit better

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:04 +02:00
Julien Danjou a73b07f5d3 [statusbar] Rename Statusbar type to statusbar_t
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:03 +02:00
Julien Danjou 0cd46ab6b1 [widgets] Rename Widget type to widget_t
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:03 +02:00
Julien Danjou bd18eb2018 [util] Change Position type to position_t
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:03 +02:00
Arnaud Fontaine dafafd077c Port Awesome to XCB 2008-05-03 12:00:59 +02:00
marco candrian ce17b1457e [widgets] allow NULL for 'command' (FS#175)
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-23 08:49:31 +02:00
marco candrian cbef649a2d [graph] fix: use own vertical_gradient config for each data{}
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-18 09:12:08 +02:00
marco candrian 2eb6fda36e [graph] simplify 'line' drawing; draw the border after the graph-drawing
Drawing the border after the graph-drawing, allows to draw down to the border itself
when 0 values occur.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-18 09:12:02 +02:00
marco candrian 96fe2ec6fd [widgets/graph] when grow=right, fg_end in on the left of the rectangle (FS#163) 2008-04-14 04:23:57 +02:00
marco candrian bc7d9211ba [widgets/graph] offset fixed now.
In fact on my pc, when there is no fg_end or fg_center defined,
it draws it one pixel too much on the right.

On Gigamo's PC, that patch should work on any case.

It also 'should' work from what I guess!

For people having a problem, they could define fg_end to the same as fg.

Or when it's really serious (on not just here), that could be done inside
awesome.

(Finally somekind of little cairo bug, from my perspektive)
2008-04-14 04:21:52 +02:00
marco candrian 62ac090368 [common/draw] curious (cairo?) bug, sometimes draws the line 1 pixel to much on the right
happens only when creating a gradient, and not always, and
adding + 1 (creating a slightly diagonal gradient), seems to help a little bit).
2008-04-12 06:56:14 +00:00
Julien Danjou c582f4397b [widgets] Check for no value in uicb_widget_tell and only update sbar on no error
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-02 15:31:19 +02:00
Julien Danjou a79cb3f927 [config] Add a bunch of new checks in configuration file
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-04-02 09:17:25 +02:00
Julien Danjou 6c6d86eef1 [widgets/graph] Fix regression in padding removal (FS#139)
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-31 14:31:58 +02:00
Julien Danjou c4cc8c5e04 [widgets] Remove paddings
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-31 10:04:03 +02:00
marco candrian b92a292e43 additional line width argument to draw_rectangle[_gradient] in draw.c
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:22 +01:00
Julien Danjou 0a6c6e017b Store physical screen id in statusbar and client, change get_phys_s() to screen_virttophys()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:22 +01:00
Julien Danjou 2a47aa7f0b Add cfg_getalignment() functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-03-23 15:52:21 +01:00
Julien Danjou 7b1ce042de Add cfg_getposition() and cie to ease libconfuse compatibility
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
Julien Danjou fe8bd0bb5b Implement a CFG_POSITION type and use it 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
marco candrian 29673467f9 change graph's style to draw_style
to prevent confusion with the other style {} sections,
and it might also better describes what is it used for..
2008-03-23 15:52:20 +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
marco candrian d1e216936c try to calculated the height etc in the same way on progressbar and graph
some issue is still there (anyway). When there are e.g. 5 horizontal bars
the width of that progressbar (multiply of 5 or similar) may won't be the
same like a graph.

So some tweaking on the graphs' height is necessary then.
2008-03-23 15:52:18 +01:00
marco candrian b1b2b48a4c graph: different widget index's (FIXME) handled now
widget_tell can feed data to some with another frequenzy.

When drawing a line, it has to be searched for a smaller value, what should
not get overdrawed. In order to find such a smaller value, the correct value
has to be compared to - and therefore the correct index.
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
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
marco candrian 397aa33163 widget error infrastructure additions 2008-03-23 15:52:16 +01:00
Julien Danjou 0e69534a65 Add a common error infratructure for widget_tell
Signed-off-by: Marco Candrian <mac@calmar.ws>
2008-03-23 15:52:16 +01:00
marco candrian 3efadded39 graph widget handles property arguments now
data section values:

echo '0 widget_tell progess data title new_value' ...

universal settings  are width, height, padding_left, bg, bordercolor like:

echo '0 widget_tell progess height value' ...
2008-03-23 15:52:16 +01:00
marco candrian 3569ab617d new property argument to widget _tell functions
actually the _tell function won't handle the new argument.
Coming patches will handle them.

it will need now something like this:

echo '0 widget_tell widget property value'

where property can be anything used in the awesomerc file,
that means what will be supported. Like: fg, fg_end, width, font...

(actually it ignores the property value and changes what have been changed in
the past as well.)
2008-03-23 15:52:16 +01:00
marco candrian 070ec6dbcd little memory leak fix *shrug*
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-02-13 09:04:32 +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 95fc524993 set widget alignment for graph 2008-02-11 19:01:48 +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
Julien Danjou 0e890697ac fix uninit warning 2008-02-05 15:40:16 +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 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 3d74f42446 tmp_color can be uninitialized 2008-01-27 19:10:15 +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 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
marco candrian ec7ab36814 max values must be > 0 on the graph-widget
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-01-22 15:01:21 +01:00
Julien Danjou 668702b777 move list.h and util.[ch] to common/ 2008-01-21 18:14:59 +01:00