Commit Graph

420 Commits

Author SHA1 Message Date
Julien Danjou 36fd44d1a0 draw: add char len as arg of xcolor_init()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-10 15:30:16 +02:00
Julien Danjou 750040be68 draw: text extents now gets len as arg
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-10 15:06:09 +02:00
Julien Danjou ad58260243 tasklist: use len and set it to 0 if no text
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-10 11:02:11 +02:00
Julien Danjou 354f37ef6c taglist: use callback function to get print text
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-10 11:02:11 +02:00
Julien Danjou f28b4c07b2 tasklist: stop using client markup
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-10 11:02:11 +02:00
Julien Danjou 3f46ec2152 tasklist: use a callback for label
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-09 12:12:52 +02:00
Julien Danjou 64e390e2a3 textbox: documente index
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-02 17:59:06 +02:00
marco candrian 2b767c2352 widgets: use vector_t for the color-gradients course.
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-02 13:59:30 +02:00
marco candrian 3074c3fdf4 progressbar: cosmetic
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-02 13:59:25 +02:00
Pierre Habouzit 46ea7c45aa Get rid of the color name, and generate a #RGBA value on the fly if needed.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-02 11:09:10 +02:00
Pierre Habouzit 924078c898 Streamline xcolor_t.
Do not have a ->name char * field, but a char[32] instead.  This isn't a
big problem, the longest color in /etc/X11/rgb.txt is 23 chars long, and
if it becomes a problem one day, one could just strip the name and
generate an hexadecimal representation on the fly instead. But allocating
the name is asking for a lot of trouble.

Since we do not allocate anything anymore, just don't allocate anything
anymore at all, it avoids the mess of xcolor_copy/_wipe and fixes a lot of
sleeping bugs (p_dup were used e.g., which is wrong).

Pass xcolor_t *, xcolor_t becomes too big to be passed by value. Add
consts at some places.

xcolor_new allocates nothing, hence is renamed xcolor_init, has xcolor_t
as a first argument (OO-style, this is self), and doesn't touch the
structure at all if it returns false, which allow us to skip a lot of
intermediates values.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-02 10:36:46 +02:00
marco candrian 0c4b56a065 add fg_off to set + fix copy/paste typo
- widgets/progressbar.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-02 08:10:46 +02:00
Julien Danjou 5bb431fc4a widgets: don't tokenize twice
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-01 15:27:41 +02:00
Julien Danjou 9b74cdbc0a draw: iso2utf now gets len as arg
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-01 14:44:19 +02:00
Pierre Habouzit 1bdf22f631 Add stricter warnings wrt prototypes.
And add the missing static's it found.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-07-01 08:12:22 +02:00
Byron Clark 1e4641389c progressbar: fix newindex
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-30 19:30:09 +02:00
Julien Danjou b584b19104 atoms: add all used atoms
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-30 18:55:14 +02:00
Julien Danjou 15111d8584 progressbar: use newindex API
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-30 17:42:36 +02:00
Julien Danjou 3ebca2181c draw: really copy colors
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-29 12:14:09 +02:00
Pierre Habouzit b63f768f00 MIN/MAX multi-evaluate their arguments.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-29 11:28:10 +02:00
Julien Danjou 912b9cd28a graph: add bg and border color on __index
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-28 13:31:33 +02:00
Julien Danjou 35e948f53b draw: xcolor_t store color name
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-28 13:30:17 +02:00
Julien Danjou 823ed27b82 graph: use newindex API
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-28 13:02:42 +02:00
Julien Danjou 09647eef9b taglist: use newindex API
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-27 22:25:31 +02:00
Julien Danjou e9b6c33be3 tasklist: bug fix in show
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-27 22:21:10 +02:00
Julien Danjou c4cc8da645 tasklist: use newindex API
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-27 22:15:54 +02:00
Julien Danjou 5aa2768861 textbox: use newindex API
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-27 20:24:30 +02:00
Julien Danjou 39e1fc7011 textbox: use newindex
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-27 12:49:24 +02:00
Julien Danjou 4bf6d2df62 widgets: add documentation support
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-26 23:32:33 +02:00
Pierre Habouzit cde80ab49a Move CLEANMASK to xutil.h, remove useless #Includes
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-26 22:47:56 +02:00
Julien Danjou 2cdfb71f15 textbox: remove wrong comment
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-26 22:06:47 +02:00
Michael Gehring f56f34d715 widgets: remove unnecessary #includes 2008-06-26 19:33:43 +02:00
Julien Danjou 25f795b04f graph: add comments
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-26 17:22:01 +02:00
Julien Danjou c9311efd5b widgets: s/lstack/luastack/
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-26 17:13:02 +02:00
Julien Danjou 37e8b95ad9 widgets: handle image size in text data
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-26 16:53:58 +02:00
Julien Danjou 094d0ebc50 widget: new widget index method
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-26 16:35:07 +02:00
Julien Danjou 68f0eda193 iconbox: remove
This can be replaced by textbox.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-25 16:37:16 +02:00
Julien Danjou ec414ae39b systray: set orientation
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-24 19:56:10 +02:00
Pierre Habouzit 17744fc81d Be more on the safe side.
it's useless to escape anything if text_len is 0, also some clients seem
to have a NULL name, so use NONULL(p->priv).

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-23 18:55:29 +02:00
Julien Danjou 425c8ea635 util: tokenize a_strtobool() 2008-06-23 18:06:00 +02:00
Pierre Habouzit 14f4e02e66 Replace tag_t lists with arrays.
This improves lots of code efficiency (we *know* how many tags we have
now, YA'RLY).

Also fix a \todo in client.c: since knowing the number of tags is cheap,
ignore props that don't match it.

Use many p_alloca for things that depends on the number of tags (no sane
user will have *thousands* of tags. This saves a few more mallocs.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-23 17:37:19 +02:00
Pierre Habouzit 3116c0d381 Add draw_parser_data_{init,wipe}.
Use it everywhere needed instead of wrong p_clear's, this fixes memory
leaks.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-23 15:23:49 +02:00
Julien Danjou 4711f4631f systray: restack on client raise
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 14:53:31 +02:00
Julien Danjou 446df09acc cosmetic
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 14:14:47 +02:00
Julien Danjou cd21e6665b tasklist: tokenize
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 14:12:01 +02:00
Julien Danjou e880f7c11b taglist: use tokenize
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 14:09:00 +02:00
Julien Danjou 4c133bc646 iconbox: use tokenize
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 14:06:37 +02:00
Julien Danjou ab5119732d use more tokenizer, with len
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 14:01:33 +02:00
Julien Danjou 28830c0dc9 textbox: use tokenize
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 13:24:03 +02:00
Julien Danjou 7aab504350 draw: store parser_data made by extents call
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-23 13:09:42 +02:00
Pierre Habouzit 8d7f45d76a And more gperf.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-23 07:41:22 +02:00
Pierre Habouzit 4d21d0fd98 Use more gperf stuff.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-23 07:41:22 +02:00
Julien Danjou 46f03fd6a6 area_t: make it smaller, use arrays instead of lists.
Make area_t smaller so that it fits in an uint64_t using 4 {u,}int16_t's
for it. Note that xcb uses the very same structure, so we aren't loosing
any information while remaining very small.

This is better to use arrays in term of:
* memory access when iterating over area_t's;
* allocation because area_t's have no *next/*prev members anymore, which
  makes it a tiny structure (8 octets);
* allocation because we allocate area_t's by vector of'em rather than one
  by one.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 22:09:48 +02:00
Pierre Habouzit 25fc879582 Stupid memory leak fixed.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 22:03:01 +02:00
Pierre Habouzit b4b381e947 Finish markup parsing rewrite to avoid mallocs.
For that matter, use elements as a filter for elements we care about, and
let the hook implement whatever it needs without duplicating everything.

The resulting algorithm is still O(n²) where n is the number of filtered
elements (3 at most right now), which isn't bad if we don't need to get
too many elements, but at least it's not quadratic in the number of
attributes anymore.

Speedup improvements could be done using gperf btw.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 17:45:45 +02:00
Pierre Habouzit 37d69b8dcc markup substitutions enhancements.
Do not preemptively allocate a g_markup_escape_text for substitutions,
just remember what we want to substitute markup with, and substitute it in
the final buffer efficiently.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 16:58:56 +02:00
Pierre Habouzit 943e2035fa Rework the markup_parser_* allocation API.
We have a stack, don't be ashamed to use it.

Instead of:

    foo_t *foo;

    foo = foo_new();
    /* work with foo */
    foo_delete(&foo);

It's way better to:

    foo_t foo;

    foo_init(&foo);
    /* work with &foo */
    foo_wipe(&foo);

Remember: more mallocs == more fragmentation.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 16:17:12 +02:00
Pierre Habouzit 5c601dfd19 Use extensible buffers in markup parsing.
This should avoid quite a few malloc calls.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 15:12:42 +02:00
Julien Danjou 92f369e3aa lua: userdata_new is now macro
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-18 18:31:35 +02:00
Julien Danjou 8753a54c65 ewmh: s/NetWMIcon/netwm_icon_t/
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-18 09:29:57 +02:00
Julien Danjou 514320a576 systray: support running without any systray widget
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-17 13:33:17 +02:00
Julien Danjou 64c4202519 draw: remove draw_image_from_file()
This should speed up tasklist image drawing.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-17 09:21:26 +02:00
Julien Danjou 72957f999a systray: handle window that are on phys_screen only
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-15 10:50:50 +02:00
Julien Danjou f418cb0c2e systray: attach systray to external window, not statusbar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-15 10:33:10 +02:00
Julien Danjou 70dbe7bc4d systray: add support for multiple physical screens
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-14 23:23:00 +02:00
Julien Danjou f5314dbc9e widgets: add destructors functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-14 22:56:05 +02:00
Julien Danjou e5e379656a systray: import widget
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-14 18:12:16 +02:00
Julien Danjou 89e03dd326 textbox: rename data type
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-14 09:18:51 +02:00
Julien Danjou 3fa072504f graph: draw everything in one loop
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-12 16:14:51 +02:00
Julien Danjou 4b6ba11360 graph: allow graphs to overlap
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-12 16:10:12 +02:00
Julien Danjou 30a19041c9 graph: use round()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-12 14:59:06 +02:00
Julien Danjou b6eea1788f [graph] Rewrite with linked list
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-11 17:39:24 +02:00
Julien Danjou ebb25ba2d4 [graph] Rename Data to graph_data_t
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-11 16:44:18 +02:00
Julien Danjou 35e83ddfa6 [progressbar] Rewrite progressbar with linked list
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-11 14:39:00 +02:00
Julien Danjou 5955a8754b [progressbar] Stop duplicating code
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-11 09:49:57 +02:00
Julien Danjou aa6bfc560a [draw] Do inline UTF-8 conversion
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-10 07:32:35 +02:00
Julien Danjou 1049393840 Revert "Replace tags by workspaces"
This reverts commit 00f966ea04.

Revert "[focus] Fix bogus arguments"
This reverts commit 816b5d16bc.

Revert "[mouse] Fix bug with floating"
This reverts commit 89daa72790.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-09 21:56:03 +02:00
Julien Danjou 816b5d16bc [focus] Fix bogus arguments
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-09 18:18:27 +02:00
Julien Danjou 00f966ea04 Replace tags by workspaces
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-09 16:30:46 +02:00
Michael Gehring 59c04890fc [cleanup] random doxygen fixes
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-08 17:13:09 +02:00
Lucas de Vries 90088be534 [taglist] Fix taglist bugs in show_empty=false mode
Attached patch fixes the width allocation for the taglist (it stayed
the same size when it should've become smaller (FS#205)), as well as a
bug with mouse bindings when the first tag was empty and thus hidden.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-08 09:32:18 +02:00
marco candrian 265fc187a9 [graph] rename 'max' to 'max_value' (like in the progressbar)
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-07 10:41:19 +02:00
Alex Cornejo e63312766d [tasklist] Fix incorrect icon background.
The tasklist widget displayed the icon over the statusbar background
ignoring the user preferences of the tasklist widget.

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-05 14:53:57 +02:00
Julien Danjou 4c41361d6c [lua] Add object as argument to mouse click function
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-04 19:21:21 +02:00
Michael Gehring 321f855752 stop reloading image on every draw
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-04 08:32:58 +02:00
Michael Gehring d2f9c6518b rename draw_image to draw_image_from_file
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-04 08:32:46 +02:00
marco candrian 0afa1a41b7 [tasklist] 'tags', 'focus', 'all', are new_value's
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-04 08:23:17 +02:00
Julien Danjou 807c5bf208 [widget] Remove useless drawing args
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-03 16:08:33 +02:00
Julien Danjou 34cd5504a7 [widget] Make button press event statusbar indep
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-03 11:40:50 +02:00
marco candrian 007787107c [graph] re-add draw_style ('bottom', 'top' and 'line')
e.g.: graph:set("draw_style", "data-title line")

Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-03 07:58:45 +02:00
Julien Danjou e350a61eb0 [widget] Add tasklist show property
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-02 14:26:49 +02:00
Lucas de Vries a4161434c2 [tasklist] Add show_icons property handling
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-02 14:24:57 +02:00
Julien Danjou d8a5b43f26 [widgets] Make draw functions statusbar-less dependents
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-06-02 12:18:17 +02:00
marco candrian 878b4de509 [graph] lua transition
no 'draw_style' yet.
2008-05-31 14:53:56 +02:00
Julien Danjou c332971b21 [draw] Rename draw_color_new() to xcolor_new()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-30 12:34:38 +02:00
Julien Danjou 14c29006f2 [tasklist] Remove useless draw_rectangle()
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-29 13:01:53 +02:00
Julien Danjou fda025a591 [statusbar] Add fake transparency
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-29 13:01:09 +02:00
marco candrian 270c705447 [progressbar] remove tmp variable stuff formerly used for check_settings 2008-05-29 08:21:32 +02:00
marco candrian 4a38937cf3 [progressbar] allow setting a range (min_value + max_value) for the bar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-29 08:21:19 +02:00
marco candrian 3b3b7db99f [progressbar] allow floats for incoming values
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-29 08:20:33 +02:00