From: [email protected]
Date: 11/05/02
Hello,
Here's the patches (from my CVS update moments ago) to give image support to GOK. It works, but it's not clean. There are some invalid casts and stuff, and I'm working on fixing those, but with this code, you can get an image to display on a button, and that was the first goal.
Basically, what I did was create an object called GokKeyImage which is heavily based on GokKeyLabel. Added support to the XML reader to get an image file name. For instance, to put the image "/tmp/esc.jpeg" on the Escape key, do this (this is copied from my modified qwerty.kbd).
<GOK:key left="1" right="2" top="0" bottom="1" type="normal">
<GOK:image>/tmp/esc.jpeg</GOK:image>
<GOK:label>Esc</GOK:label>
<GOK:output type="keysym">Escape</GOK:output>
The images are displayed using GtkImage, so you can do any image supported by your GdkPixbuf, and GtkImage handles the file loading and stuff automagically.
What's left? Well, there are a bunch of things that I'm currently working on. My next patches will lead up to this.
Anyways, this is the first in a series of patches to get image support set up. I'm working almost exclusively on this at work.
I apologize if I've made any stupid assumptions, big mistakes, or implemented things in a way that was less than ideal. In my defense, I'm working blind on a codebase that I'm not all that familiar with.
That said, the code is really clean. There are some questions I have, but I'll post them over time.
Thanks for your patience with me, and allowing me to help out. If you have any suggestions (or gripes, or just want to yell) let me know.
If you're going to apply these patches directly to CVS, then I'm more than happy to write a detailed ChangeLog (i'm more than happy to do so anyways).
The files I changed are:
srbaker@gloria:~/devel/gok/gok$ cvs update cvs server: Updating .
M gok-button.c M gok-button.h M gok-key.c M gok-key.h M gok-keyboard.c
I did cvs diff individually on each of the files.
And, one last thing: I should mention that I've never done any GNOME programming before (well, except in Python, but Python does the grunt work for you). Haven't used libxml in years, and haven't ever worked with custom GTK+ widgets before. This has been a wonderful learning experience. :) But, undoubtedly, my methods may look retarded.
-Steven
This archive was generated by hypermail 2.1.4 : 03/09/04 EST