libera/#clim - IRC Chatlog
Search
14:36:45
beach
I don't think it is in a single place, and I suspect it is often in the form of code, like drawing a button or a scroll bar.
14:37:30
beach
But I haven't work on McCLIM for a while, since others are doing an excellent job. So I may not be up to date.
14:38:26
beach
In #commonlisp, I was told that things like buttons and scroll bars could (should?) be drawn using bitmaps of corners and "middle". So that might be a valid change.
14:41:08
beach
Maybe so, but I think I was in charge of drawing buttons and scroll bars in early code, and I didn't see it. So I just wrote calls to DRAW-LINE and such.
14:41:15
lotuseater
this AutoLISP job I applied to doesn't work out, they don't want me without interviewing. so wish them good luck finding just an overpriced C# developer.
14:42:29
beach
Maybe I mentioned this, but there was a brief moment, several decades ago, where there was a plan to rewrite AutoCAD in Common Lisp.
14:44:04
lotuseater
and about the new backend for McCLIM: I would like to be able to do that, of course, but I certainly lack the talent. But ok, I've always thought that about other things, where I think afterwards they are not so difficult after all.
14:45:57
lotuseater
like the CL->Python rewrite of Reddit. big costs, but would have been many times smaller to train some people
14:47:05
lotuseater
no above I just said I can imagine it will happen. cause also official X support ends in 2023 and wayland is growing
14:51:26
jackdaniel
especially that wayland is (after oh so manny years) still referred as a work in progress as far as I recall
14:53:00
jackdaniel
regarding theming, there are a few special variables that customize the look, but in the end it all ends in the handle-repaint method for gadgets (so draw-line etc)
14:53:48
jackdaniel
using bitmaps would be a bad idea, because they don't scale well (and with arbitrary native transformation that will matter), some minimal vector format would be much better (and then it would be executed in form of draw-line etc)
14:54:53
lotuseater
can it also do anti-aliazing? I mean the more advanced form of the Bresenham algorithm
14:55:07
jackdaniel
the method is easy: (defmethod handle-repaint ((sheet push-button) region) (with-bounding-rectangle (x1 y1 x2 y2) sheet (draw-rectangle* sheet x1 y1 x2 y2 :ink +blue+) (draw-text* sheet x1 y1 "HELLO"))
14:56:46
jackdaniel
as of now clx-fb supports antialiasing while clx doesn't (that said I've made a significant progress in switching to xrender, so the latter should support antialiasing too - after I get back to McCLIM codebase and finish the branch)
14:58:23
jackdaniel
if zoomed by changing the native transformation, then it is appropriately adjusted
15:01:38
lotuseater
it doesn't? that wonders me. but you're the expert of course :) was just one of my thoughts
15:01:58
jackdaniel
I'm not saying that it doesn't, I'm saying that I don't see how it does, that's why I've asked
15:02:17
lotuseater
or i think it would be better for me when you explain to me polygonizing of paths so I can see
15:03:05
jackdaniel
you have a line (0,0) -> (10,10); of course it has some thickness (otherwise it couldn't be rendered on the screen as not being 2-dimensional object)
15:03:15
lotuseater
hmpf that again shows me I'm not digged into a topic as much as I want to. (graph theory and algorithms about it)
15:04:08
lotuseater
haha yes "there are a billion lines rendered with thickness 0, all at once, don't you see it?"
15:04:58
jackdaniel
i.e xrender or opengl accepts a set of triangles to render (I've implemented recently an algorithm to triangulate polygons that works for xrender)
15:05:18
jackdaniel
in case of a line that could be probably hand-written with all edge cases, but then you have other paths - polylines, arcs and bezier curves
15:06:08
jackdaniel
that's why it may get tricky to represent them as polygons (or, converserly, triangles)
15:07:23
lotuseater
learning about Wallace-Bolyai-Gerwien theorem was interesting: http://weitz.de/polygons/
15:07:26
jackdaniel
here is a short video from that time: http://turtleware.eu/static/paste/0de83150-triangles.webm
15:08:13
beach
My idea was to turn everything into shapes defined by Bezier curves and then polygonalize the result.
15:09:33
beach
Well for things like join style, it seems easier to define in terms of Bezier curves, I would think.
15:10:56
beach
So there would be polygonalization code only for Bezier shapes. But I haven't thought of it that much, so take what I say with a grain of salt.
15:11:02
jackdaniel
on that note, I've been experimenting and polygonizing ellipses directly gives much more accurate result; but regarding paths that may be the case that using bezier curves as an intermediate will be easier
15:13:52
jackdaniel
lotuseater: if you are interested in algorithms, you could investigate and contribute algorithms for bezigons (polygons with curved edges) - region-contains-position-p, region-contains-region-p, region-intersects-region-p and such
15:18:09
splittist
There's also the bit of CLIM that is supposed to use native widgets for gadgets. How that interacts with 'everything is a bitmap' I'm not sure.
15:19:30
jackdaniel
splittist: you may have multiple implementations of gadgets (even under the same port); it is up to the frame manager to resolve the pane abstract class (i.e :push-button) to a concrete implementation
15:20:01
jackdaniel
so i.e bitmap-frame-manager may provide gadgets as bitmaps and native-frame-manager may use the native gadgets
15:20:15
splittist
jackdaniel: sure. And if someone wants to get a pixmap of a native gadget they might be sol.
15:21:56
jackdaniel
so even when they are not implemented internally as a pixmap, getting it should be possible (for a complete backend, putting aside a situation where the underlying display server doesn't allow such copying)
16:04:25
lotuseater
jackdaniel: I'm no expert but mathematical algorithms is one of my special interest fields :)