Commit Graph

498 Commits

Author SHA1 Message Date
Julien Danjou db45624809 widgets: fix index on checkudata
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 15:58:43 +02:00
Uli Schlachter fa89775626 Add some missing luaA_checkudata() calls
luaA_object_ref_item doesn't check the type of object it returns which resulted
in stuff like this:

  wibox.shape_clip = wibox
  wibox.shape_bounding = wibox
  imagebox.image = imagebox
  textbox.bg_image = textbox

All of the above calls would result in a crash (unverified) and all of them
where fixed.

This should fix all places which use luaA_object_ref_item(). The others already
did a proper type check.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 13:58:30 +02:00
Brian Gianforcaro 3145e3145e Grammar/spelling corrections in comments and docs.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-31 10:39:36 +02:00
Julien Danjou d126b554db textbox: add .height
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 15:40:49 +02:00
Julien Danjou 6cf9f509c5 textbox: extents() honors user-set width
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 15:39:34 +02:00
Julien Danjou 1060470b3f draw: stop requesting extents
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 15:38:17 +02:00
Julien Danjou 34967f7b13 textbox: fix integer overflow
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 15:34:05 +02:00
Julien Danjou 7ecf1afdfd draw: move padding stuff inside textbox
This is only used by textbox.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 20:24:38 +02:00
Julien Danjou 4a81695f8b systray: merge geometry and extents
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 18:29:19 +02:00
Julien Danjou 6922df8b46 textbox: merge geometry and extents function
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 18:28:20 +02:00
Julien Danjou 59a0f7e34b imagebox: merge geometry and extents
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 18:26:58 +02:00
Julien Danjou fdefa387aa widget: remove useless geometry field
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 18:24:19 +02:00
Julien Danjou 26c446fa82 textbox: add valign
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-25 17:56:48 +02:00
Julien Danjou 901029ce97 systray: fix leak, add missing destructor
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 23:36:03 +02:00
Julien Danjou a916f2cd55 image: port to new class system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou dc61d258f0 luaclass: optimize type handling
We use lua_class_t pointer as key in the registry to store metatable we
will compare.
lauxlib uses a string, which sucks, because it forces to do a
pushliteral() each time you want to get a metatable from the registry,
which is slower.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 1cc50b8a29 luaobject: remove useless custom function
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:46 +02:00
Julien Danjou 946231ce74 textbox: ignore border_width of the wibox
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-20 10:42:47 +02:00
Julien Danjou ec5ae3dfb8 imagebox: remove valign
This is not used anymore in rendering.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-04 14:31:21 +02:00
Julien Danjou 55c0163332 textbox: fix getopt_padding call
Bug introduced because of the previous fix.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-30 17:38:50 +02:00
Julien Danjou 13efd8a199 wibox: get rid of simple window
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 16:11:41 +02:00
Julien Danjou 339fb53d56 luaobject: add and use item system
Now, each object can store items.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-28 10:29:30 +02:00
Gregor Best 9890561fd5 systray: don't crap up on odd-sized windows
Basically, we get the size we want the systray to be drawn at upon drawing
the tray, thus removing the query to the xcb_get_geometry function. As all
windows embedded in the systray are squares, their size is equal to their
height, so we simply force the size to be wibox_height * n x wibox_height,
where n is the number of embedded windows, instead of deriving it from the
largest embedded window (which, for example in the case of wicd, would be
200x200, way too much for one window on a regular wibox).

Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-17 16:46:50 +02:00
Gregor Best aa9a7b1fc8 widgets: get rid of align attribute
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-17 16:46:49 +02:00
Gregor Best 6bbcb1f56e widgets: add bool widget_geometries(wibox_t *)
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-17 16:46:48 +02:00
Julien Danjou a8115bd45e luaobject: ref take index number as argument
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-16 17:15:20 +02:00
Julien Danjou 3f6ab274c0 wibox: all wiboxes go into one and only one array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:35 +02:00
Gregor Best 0f2da4b9bf widgets: export extents() function
This commit adds a function called extents() to widgets. In the case of
a systray, it takes the systray's screen as its argument to correctly
calculate the width. By default, 1 is assumed. For all other widgets,
the argument can be ommitted.
The function doesn't return the geometry as drawn, instead it returns
the geometry the widget _wants_ to be drawn at, for example an imagebox
always has (image width, image height) as the return values even if it's
drawn with a smaller width and height on a smaller wibox.

Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:23:29 +02:00
Julien Danjou 45c2ac38a4 image: only compute when needed
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:23:17 +02:00
Julien Danjou 1e6d4747be graph: deprecate in favor of awful widget
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:23:13 +02:00
Julien Danjou 9e7054f3c0 progressbar: deprecate old widget
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:23:05 +02:00
Uli Schlachter df0df1bc37 Fix a couple of harmless compiler warnings
In each widget's *_geometry function, two warnings were generated, e.g.:
 warning: ‘geometry.y’ is used uninitialized in this function
 warning: ‘geometry.x’ is used uninitialized in this function

Found by gogonkt with GCC 4.2.4 on gentoo.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-05-25 12:07:06 +02:00
Julien Danjou 4a34693bfb screen: remove index field
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-18 17:51:31 +02:00
Uli Schlachter 708636b5bf Convert the textbox widget to color_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter 829caf45ba Convert the progressbar widget to color_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter 69082ddf5f Convert the imagebox widget to color_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter 3216a849b5 Convert the graph widget to color_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter 99b521b2c7 Rename luaA_pushcolor() to luaA_pushxcolor()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Uli Schlachter 37862c83c0 Make the draw_*() functions take a color_t*
Signed-off-by: Uli Schlachter <psychon@znc.in>
2009-04-18 14:02:21 +02:00
Julien Danjou 486ef71a7f screen: replace screens pointer by a screen_t array
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-17 16:14:09 +02:00
Matus Telgarsky 1c147a6d76 graph: fix for missing allocation
resizing graph widgets (by setting the width parameter) was failing to
update the caches draw_to and draw_from.  I have attached a 2-line patch
remedying this.  The bug wasn't caught earlier because the default size,
80, is bigger than what people typically use.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-15 11:36:11 +02:00
Julien Danjou 045d4c823b textbox: unref image on destruction
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-13 12:43:00 +02:00
Julien Danjou b1a59aca07 widget: widget are now full Lua object
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Julien Danjou 541d4f565f image: use new object system
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:32 +02:00
Uli Schlachter 95457c5ab7 Move the definition of globalconf into a header file
Pretty much every single source file needs this struct, so it makes sense to
define it in a common header instead of in every single .c file.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-10 16:32:42 +02:00
Lionel Ott 858802537f Implemented bottom and middle alignment for textbox backgrounds
- background images of textbox widgets can now be aligned vertically
  to the bottom and middle aswell as the top

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou 527e6308c3 graph: return if size is 0 (FS#466)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-02 17:43:14 +01:00
Julien Danjou ab0220274e graph: check width value (FS#465)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-02 14:20:08 +01:00
Julien Danjou 8f9cc9a262 widgets: use integer instead of int8_t
The computer is smart, and the compiler also.
Should fix:
widgets/progressbar.c:451: warning: array subscript has type `char'

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-01-18 11:03:13 +01:00
Julien Danjou 4379b19eb9 textbox: include margin when computing needed width
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-12-19 12:59:16 +01:00