Saturday, September 18, 2010

Progress, progress, progress.....

What a productive day! Most of the gnocl::abiwidget code completed now and I'm quite pleased with myself, so far 950 lines of (apparently) bug free code. I wish that implementing other packages such as the pixbuf were as easy.

In fact, most of the code is recycling a standard switch block but, there's lots of them and many are nested too.

I've already uploaded a nightly build to Sourceforge. So, here's the latest development screenshot. I think that its full of many of those expected features.... nice....




MAKEFILE ------ HAPPINESS!

Resolved last nights problems with the ol' makefile. What was the solution? Don't code after a full day (nay week) of brain-numbing academic research! Have a good nights sleep and hit the problem at again all refreshed! Well, here's the proof of the pudding, a screen grab of the gnocl::abiwidget in action although it doesnt do much yet ;-).


Friday, September 17, 2010

MAKEFILE MADNESS!

Isn't it great when things go well, and then really urgghghghghh! when they don't? Well, tonight has been one of those nights. From the outside one would assume that computing and programming is straight forward, like cooking a cake. Follow the recipe and, well., you get some sort of cake at the end.

How unlike programming is! How can a nice simple make file, become a nightmare! Easily, it is a make file!

Well, that's enough for t'night.... Resolved compilation issues with headers (always the first hassle) and now we're onto link problems. But, this will have to wait until some other time over the weekend.


Abiwidget -------> gnocl::abiwidget

During one of those little breaks between research and writing up I decided to take a look at building the Abiwidget test. I was expecting a whole pile of hassle and unresolved compile dependencies but no! Simply installed the development files from the OpenSuse repositories saved the demo app from the Abiword wiki, modified the make to reflect the inclusion of the 2.8 libraries and bam! After a brief compilation it all worked! In fact writing this blog post has taken more time! Tonight, I think that I'll wrap the widget creation code into a gnocl package. There's so much functionality here!

If there's going to be a tricky part to this all it will be plug-in support.



 

Monday, September 13, 2010

gnocl::background

I've got the basics working for this command but have come to something of a dead-end for a while. This is largely due to not having enough information at hand on how to update the background. Also, I'm not longer certain whether or not a simple command is the right approach, perhaps the solution is to create another class of objects so that backgrounds can be created and manipulated like a widget.

The jury is out on this one. The old subconscious mind needs to digest this one a little longer!

So, back to gnocl::draw. This too, as it principally related to pixbuf object might well deserve  re-working to reflect this. In this case, the creation of a pixbuf will need to automatically create a cairo context during initialization. This would provide a considerable speed improvement but would also require the implementation of a pixbufParams structure.


Monday, September 06, 2010

gnocl::pixbuf

Last night I decided that I wanted to have a desktop gadget that would give me a rolling-slideshow of some my favourite family photos. With the implementation of the gnocl::pixBuf command I hacked together something useful in about half an hour. I wanted a nice dissolve and so finished the previously existing composite stub. Here's the script:

#---------------
# photoAlbumGadget.tcl
#---------------
# Produce a desktop photo slideshow.
#---------------
# William J Giddings
# 05/09/2010
#---------------

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Gnocl

#---------------
#
#---------------
proc init {} {
    set ::dt 3000
    set ::size {200 150}
    set ::i 0
    set ::first 1

    # create a list of images
    set ::album [glob ./album/*]
}

#---------------
#
#---------------
proc slideChange {} {
    incr ::i
    if {$::i == [llength $::album] } {set ::i 0}
    $::pb delete
    # show the first frame, and dissolve thereafter
    if {$::first} {
        set ::pb [gnocl::pixBuf load -file [lindex $::album $::i]]
        $::img configure -image %?$::pb -size $::size
        set ::first 0
    } else {
        set src [gnocl::pixBuf load -file [lindex $::album $::i]]
        for {set i 5} {$i <= 255 } {incr i } {
            $::pb composite $src -alpha $i
            $::img configure -image %?$::pb -size $::size
            gnocl::update
            after 10
        }
            $src delete
    }
    after $::dt slideChange
}

#---------------
#
#---------------
proc main {} {
    set ::pb [gnocl::pixBuf new]
    set ::img [gnocl::image]
    gnocl::window \
        -child $::img \
        -defaultHeight 150 \
        -defaultWidth 150 \
        -decorated 0 \
        -x 1200 \
        -y 200
    slideChange
    gnocl::mainLoop
}

init
main


Friday, September 03, 2010

gnocl::draw

Now that I've put to one side the silly idea of adding stockitems to cursor graphics, I returned to the job of looking at the gnocl::draw command. Ironed out a couple of issues but now having others! This time on tokenizing strings saved in global structs. The string containes a series of floats to implement line dashes. When the string is first passed from the interpretor it tokenizes well, no problems. Once its assigned to the global struct, yuk. It doens't work. Maybe its should be left as a string... mmm I'll try that now.

json_shell_utils.tcl