PDA

View Full Version : Oh dear...



bwkaz
08-16-2003, 08:40 PM
Well, I just got the time graph part of dfGUI for Linux working fairly well. I had the development version running in the background, while playing some FF3 with zsnes. I was playing most of the way through generation 45, and halfway through 46 (as if you couldn't tell...).

:scared:

Boy, I wish I could stand to just give up zsnes... I'm thinking it'd help my stats... ;)

Oh, and the gen. vs. time graph:

Paratima
08-16-2003, 08:52 PM
Ultra-cool! :cool:

How close are ya to a new release?

bwkaz
08-16-2003, 09:29 PM
Getting there. I've got the graphs working, mostly. I have to figure out how to get them to scroll with the prev. page and next page buttons.

I also still need to get code in there to update the "points" tab. But that's just about it.

At this rate, though, I'll probably get it just about finished by the time Jeff releases v3.2... :crazy:

Oh well. At least I'm making some sort of progress...

Oh -- for anybody thinking about using it, would it be a good idea to require ImageMagick to be installed? Right now, the only reliable way I can get one of the graphs to capture is to shell out to ImageMagick's import command. I tried linking against libpng and getting a GdkWindow to the graph, but it came out almost black (the scrollbars were the only thing visible).

I'm thinking that since ImageMagick is available on pretty much all distro CDs that I know of, it's probably not a horrible workaround. But if somebody thinks it is, say so now so I can either dike it out completely (:() or figure out another way to do it.

IronBits
08-16-2003, 09:35 PM
gd libraries should/could be intalled ;)
same sorta thing pproxy uses to generate graphs on the fly

Paratima
08-16-2003, 09:51 PM
Authorization approved.

Go fer it! :thumbs:

Beyond
08-16-2003, 09:55 PM
Originally posted by IronBits
gd libraries should/could be intalled ;)
same sorta thing pproxy uses to generate graphs on the fly


GNUPlot draws the graphs, gd just creates the images as PNG, JPEG or WBMP. But still a good (or better) alternative :)

bwkaz
08-16-2003, 10:47 PM
Hmm. That kind of thing would work fairly well, except for the integration into Gtk+ part.

As it is, I've found a GtkDatabox library on Freshmeat, and the developer was pretty cool about me including the library in the package. Plus it was pretty small. It's an actual Gtk widget (actually, what you see in the screenshot above is all it is), so it works nicely in the Glade 2 layout designer, also.

If I would use gd or gnuplot, OTOH, I would end up swinging the other way. It'd be really really easy to save it to a file, but it would be quite a bit harder to get it into the GUI...

Basically what I'm doing with import is building a command line that looks something like /path/to/import -window WID -crop WWWxHHH+XXX+YYY ~/graph.jpg. /path/to/import can be changed at configure time. WID is the XFree86 window ID, obtained from GDK. WWWxHHH is the width and height of the graph, and +XXX+YYY are the coordinates of the top-left corner.

Unfortunately, while import will output PNG files that are perfectly readable by other programs, it won't do so correctly. The +XXX+YYY part ends up screwing it up -- it actually offsets the image inside the PNG file by that amount. Which means you need to first make it bigger, then do something else (probably a call to mogrify) to chop off the extra. If you don't do it that way, you end up with the graph moved down and right, so that pieces are cut off, with transparent areas on the top and left sides of the image. This seems to be independent of which version of ImageMagick I use. Crappy.

I would very much like to be able to generate PNGs, I just can't seem to figure out how to do it correctly, and with the right pixels... :o

bwkaz
08-23-2003, 11:57 AM
OK, for anybody that cares (:p), I thought I'd found a better way to do it, then realized I hadn't. But in the end, what I came up with should work. Let me explain:

I was looking through the _GtkDatabox structure to see if maybe there was a structure member that would help. Perhaps a GdkWindow for the whole widget, or perhaps something else. I did find a GdkPixmap (an X-server-side area of pixels), with the comment "this is for double-buffering", so I thought that it might help with the black pixel issue.

I copied it to the client side of the X connection (with gdk_pixbuf_from_drawable(), and yes, a pixbuf is not the same as a pixmap, go figure ;)), then saved it with libpng. I managed to get everything except the rulers and scrollbars. Which is nice, except that I think a reference point might be good... ;) That was when I "realized I hadn't" come up with a better way to do it.

So what I ended up doing was going back to the original original plan but using a default colormap. (The original original plan was coming out with parts of the graph black). I was still getting the entire window, but at least parts of it weren't black, which was a step up. A bit of manual clipping later, and it actually works quite well. :)

So ATM, it'll require libpng, but IMHO that's better than ImageMagick -- the latter is huge, while the former is quite a bit smaller. Would there be any interest in making libpng optional? Without it, I'd just disable the save buttons. It'd be a compile-time option; I don't know enough about libdl (dlopen(), dlsym(), etc.) to make dfGUI be able to check at runtime...

bwkaz
08-23-2003, 03:23 PM
Whoops, forgot the image. This is the new PNG version. Much better, don't you think?

Dyyryath
08-23-2003, 03:48 PM
Looking good, bwkaz! I've got a spot on my desktop set aside for it. :D

IronBits
08-23-2003, 04:24 PM
Very nice! :D

rsbriggs
08-23-2003, 09:02 PM
Any ETA on a release for it?

bwkaz
08-24-2003, 01:35 PM
I wish... ;)

I was hoping for this weekend, especially after I finally came up with a good way to save the graphs, but then I got stumped trying to figure out the best way to run the client benchmark. I'm trying to decide between figuring out a way to force a terminal window to stay open, and just running the benchmark in it, or to capture the actual output of the benchmark (as in, making stdout from the benchmark connect to a pipe that dfGUI reads from), and displaying it in a textview widget. Decisions, decisions... :D

But once that's working, all I'd need to do is get the graph scrolling stuff to work, and get the refresh function to update a couple of the new bits of info.

I think I'll go out on a limb here and say sometime in the next couple weeks. Barring any issues with the above stuff (the benchmark or the graph scrolling, that is -- the rest of it shouldn't take more than an hour or so total), it should be done sometime before Sept. 7 or 8 or so. I'm hoping for sometime around the start of Sept., but we'll see.

rsbriggs
08-24-2003, 01:42 PM
I'd be willing to bet that most people (including me) would be perfectly happy with a more immediate release that didn't include the benchmarks, perhaps followed by a version "in a couple of weeks" that did.... :D

Chinasaur
08-24-2003, 01:47 PM
Very nice work bwkaz :thumbs: Always wished I had learned to program.

and..

"Benchmark support? We don't need no steenkin benchmark support!!! "


:cheers:

IronBits
08-24-2003, 02:23 PM
What HE said :D

Paratima
08-24-2003, 02:43 PM
Yup, likewise!! :cool:

bwkaz
08-24-2003, 04:09 PM
Uhh... well... okay them. :D

Give me about an hour or so.

(I guess... :jester: )

Paratima
08-24-2003, 04:50 PM
But hey... take your time! :p

rsbriggs
08-24-2003, 05:05 PM
An hour would be great. But, hey - don't feel rushed here or anything. If it takes an hour-and-a-half that'd be cool, too.....

bwkaz
08-24-2003, 05:10 PM
Well, I was leaving in an hour (an hour after that post, that is... in a couple of minutes, now).

The bench stuff isn't done, and neither is the graph scrolling. Which is why it's v3.0.99. But:

http://kadzban.is-a-geek.net/dfGUI-linux/dfGUI-3.0.99.tar.gz

Requires Gtk 2, and if you already have installed gtkdatabox (from http://www.eudoxos.net/gtk/gtkdatabox/), then you can pass --without-included-gtkdatabox to the configure script to dynamically link against the system version. But it doesn't require a gtkdatabox if you don't have it installed.

There's also an --enable-server switch -- DON'T USE IT! ;) It's quite broken at the moment.

Other than that, have fun. :D If something breaks and you can figure out what, let me know. Well, even if you can't, let me know, but it'd help a little if you could. I've seen it crash once or twice, which is kind of disheartening, but I've been running it a lot, so it's not a huge deal.

I think I'll throw an announcement in the add-on forum, too.

IronBits
08-24-2003, 05:35 PM
Someone care to post a pre-compiled version so it runs as a stand-alone binary?