J5’s Blog

March 24, 2006

Gtk+ now has Printing

Filed under: Gnome, Linux, Recreation — J5 @ 5:53 pm

Alex Larsson has merged our work into the gtk-printing branch of gtk+ in gnome cvs. I am in the process of making an srpm so Fedora users can play with it and Matthias Clasen has created a gtk+/printing component in bugzilla. I am sure there are a lot of bugs. We should be doing a talk at GUADEC this summer on the new API.

To all those that are excited about the new dialog, keep your expectations in check. I’ll post screenshots this weekend but it looks a lot like the old gnome-print dialog. This is because printing in itself is unexciting (I sort of like it in that respect). While great work was done at the Boston Summit much has changed since then. Things may change more yet given the input of others.

The coolest part of the new API is the highlevel API itself. All one needs to do to print is show the dialog and then write to the cairo surface provided by the API. If your app is already using cairo it should be a snap to add the new printing API.

Other News:

I went with 1and1.com for my hosting. martianrock.com may be down for a bit as I need to transfer the domain. I have also registered a couple of other domains:

  • johnpalmieri.info will be an about me page that details things like my current projects, what the J5 means and current happenings for friends and family.
  • j5live.com and j5live.cc will both be repositories for my Creative Commons contributions but may expand to cover others. Not sure yet exactly what I want to do but it can be thought of as a place for content distribution.

Thailand:

I will be away in Thailand for two weeks starting the middle of next week. Chances are I will not be able to be reached after th 28th. If any Gnome or FOSS developer wants to meet up let me know. I’ll be all over but in Bangkok for the first few days. I’m not promising I’ll be free but it would be nice to see the community in action half way across the world.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

March 21, 2006

PolicyKit

Filed under: Freedesktop, Linux — J5 @ 9:42 am

Davidz not only pulls another project HAL related project called PolicyKit out of thin air (only weeks after blogging about what he wanted to accomplish) but managed to get an article written about it.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

March 6, 2006

Moving Servers

Filed under: Uncategorized — J5 @ 5:27 pm

So it seems that my friend who has been hosting the martianrock.com domain for the past three years is way too busy and is closing down his hosting service. I need to move by the end of the month. Does anyone know of an inexpensive place to park my domain which has wordpress access, reasonable disk space and reliable imap e-mail?

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

March 1, 2006

Crash Course in GLib Internals

Filed under: Gnome, Linux — J5 @ 1:43 pm

In the course of writing various bits of EggPrintOperation I have have had to learn how various bits of GLib work that I would have never needed to know as an applications developer. One such crash course was in the magic and mystery of a GSource. These little buggers are integration points into the GMainLoop. Whenever you create a timeout or an idle handler you are creating a source.

Well I needed to create my very own source to step through the states of talking to the cups server without blocking. Hooking everything up wasn’t too hard. You fill in a structure with your prepare, check, dispatch and finalize functions, “subclass” the source stuct so you can keep state information and attach the source to your mainloop. The functions get called in a particular order each time mainloop is run. That is the simplified explanation.

Doing that I was able to successfully get printer information and print to a selected printer. Of course for a 3 meg postscript file being written in 8k chunks it was taking 9 seconds to send to the local cups queue over an http socket.

Alex then pointed me to the g_source_add_poll method which allows you to add a file descriptor and some flags that will cause the check function to be called whenever the fd can be written to or read from depending on what flags you set. Adding a poll for the http connection’s file descriptor when we are writing took that 9 seconds down to about 1/3 of a second.

w/o polling:

write #0: 1141230805.220s
write #366: 1141230814.228s

delta: 9.008s

w/ polling:

write #0: 1141230516.298s
write #366: 1141230516.609s

delta: 0.311s

Nothing all that spectacular but it is pretty fun starting to get a lower level view of how things work.

[read this post in: ar de es fr it ja ko pt ru zh-CN ]

Powered by WordPress