Done some work with working on the print settings module today. Now, up to a little under 1100 lines of code and rising! I think that this will end up being one of the largest single modules once all the options are taken into account. Properly implemented the framework for setting print settings from basic options. I've got the basics ready for a 'settings get' subcommand too. Since Gtk+2.10 there has also been the option to save/load settings as a keyfile. This is also something that I'll take a look at. The current work on the print.c module means that the printoperation.c module is no longer needed and will be removed.
Tuesday, January 11, 2011
Friday, January 07, 2011
create-custom-transitioning-backgrounds
Most of the default desktop backgrounds on my OpenSuse workstation are slide shows. Here's the link to a simple 'How-To' tutorial on creating custom slide-show desktops.
http://www.linuxjournal.com/content/create-custom-transitioning-background-your-gnome-228-desktop
A little ingenuity might lead to the possibility of creating desktop embedded display applications. Graphics could be regularly written to using the cairo and/or the imagemagick bindings. The possibilities aren't execatly endless but they could be interesting.
http://www.linuxjournal.com/content/create-custom-transitioning-background-your-gnome-228-desktop
A little ingenuity might lead to the possibility of creating desktop embedded display applications. Graphics could be regularly written to using the cairo and/or the imagemagick bindings. The possibilities aren't execatly endless but they could be interesting.
Changing the GNOME Desktop background with gnocl::gconf
Apart from the appletbar and status box, the desktop background could be used to display some interesting things. The management of the this lowest graphic plane comes under the control of the Xlibs but its a relatively simple task to change graphics using the gnocl::gconf command. This simple test script explains all:
#---------------
# test-gconf-background.tcl
#---------------
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
#---------------
package require Gnocl
package require GnoclGconf
set tb [gnocl::toolBar -orientation vertical]
$tb add item \
-text TCL \
-onClicked {
gnocl::gconf set /desktop/gnome/background/picture_options centered -type string
gnocl::gconf set /desktop/gnome/background/picture_filename [pwd]/Tcl.svg -type string
}
$tb add item \
-text GTK \
-onClicked {
gnocl::gconf set /desktop/gnome/background/picture_options wallpaper -type string
gnocl::gconf set /desktop/gnome/background/picture_filename [pwd]/gtk.svg -type string
}
gnocl::window -child $tb -widthRequest 125
gnocl::mainLoop
#---------------
# test-gconf-background.tcl
#---------------
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
#---------------
package require Gnocl
package require GnoclGconf
set tb [gnocl::toolBar -orientation vertical]
$tb add item \
-text TCL \
-onClicked {
gnocl::gconf set /desktop/gnome/background/picture_options centered -type string
gnocl::gconf set /desktop/gnome/background/picture_filename [pwd]/Tcl.svg -type string
}
$tb add item \
-text GTK \
-onClicked {
gnocl::gconf set /desktop/gnome/background/picture_options wallpaper -type string
gnocl::gconf set /desktop/gnome/background/picture_filename [pwd]/gtk.svg -type string
}
gnocl::window -child $tb -widthRequest 125
gnocl::mainLoop
gnocl::print
Did a little more to this module this lunchtime. Basically implemented the three options shown below.
I'm now pondering over how to handle pagesize etc...
proc doPrintFile {} {
puts [upvar level #0]
gnocl::print file test-print.tcl \
-baseFont {Gentium 10.0} \
-linePadding 2 \
-header "How now brown cow"\
}
puts [upvar level #0]
gnocl::print file test-print.tcl \
-baseFont {Gentium 10.0} \
-linePadding 2 \
-header "How now brown cow"\
}
I'm now pondering over how to handle pagesize etc...
Thursday, January 06, 2011
gnocl::print and printing as a text widget command
Had enough of gnocl::wand for the meantime and so I've spent this evening working through the code stubs for printing. The basics were there but nothing really useful. Today I made some useful headway into fully implementing print functionality for disk based text files and for direct printing from a text widget. At the moment only plain text is supported and I'm not yet certain how to handle rich-text formatting.
The way in which Gtk+ prints is by first rendering up to a Cairo canvas and then printing out the graphic content. If the Gnocl side needs to handle the formatting then this could be a lengthy implementation job. Here's the test-script to show how things are progressing.
The way in which Gtk+ prints is by first rendering up to a Cairo canvas and then printing out the graphic content. If the Gnocl side needs to handle the formatting then this could be a lengthy implementation job. Here's the test-script to show how things are progressing.
#---------------
# test-print.tcl
#---------------
# Author: William J Giddings
# Date: 06/01/11
#---------------
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
#---------------
package require Gnocl
proc doPrintFile {} {
puts [upvar level #0]
gnocl::print file test-print.tcl
}
proc doPrintWidget {} {
global txt
puts [upvar level #0]
gnocl::print widget $txt start end
}
proc doWidgetPrint {} {
global txt
puts [upvar level #0]
$txt print start end
}
set tb [gnocl::toolBar]
$tb add item -text "PRINT FILE" -onClicked {doPrintFile}
$tb add item -text "PRINT WIDGET" -onClicked {doPrintWidget}
$tb add item -text "WIDGET PRINT" -onClicked {doWidgetPrint}
set txt [gnocl::text -baseFont {Gentium 12} ]
set box [gnocl::box -orientation vertical]
$box add $tb
$box add $txt -fill {1 1} -expand 1
gnocl::window -child $box -widthRequest 300
# test-print.tcl
#---------------
# Author: William J Giddings
# Date: 06/01/11
#---------------
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
#---------------
package require Gnocl
proc doPrintFile {} {
puts [upvar level #0]
gnocl::print file test-print.tcl
}
proc doPrintWidget {} {
global txt
puts [upvar level #0]
gnocl::print widget $txt start end
}
proc doWidgetPrint {} {
global txt
puts [upvar level #0]
$txt print start end
}
set tb [gnocl::toolBar]
$tb add item -text "PRINT FILE" -onClicked {doPrintFile}
$tb add item -text "PRINT WIDGET" -onClicked {doPrintWidget}
$tb add item -text "WIDGET PRINT" -onClicked {doWidgetPrint}
set txt [gnocl::text -baseFont {Gentium 12} ]
set box [gnocl::box -orientation vertical]
$box add $tb
$box add $txt -fill {1 1} -expand 1
gnocl::window -child $box -widthRequest 300
Monday, January 03, 2011
gnocl::wand
Made some progress on this module to today. Its a strange way of doing things. ImageMagick is something of a mixture of the gtk Pixbuf and Cairo operations in that pixel drawing and vector drawing operations are available. Ok, there are differences, ImageMagic has a whole pile of image manipulation tools to begin with and is aimed primarily on the processing of disk-based imagery. Cairo, on the other hand, is fast enough handle real-time drawing for rendering widgets. Yesterday I got block 'drawing' working using the vector drawing ops and today created a custom command for a pixel block draw. Both are a somewhat slower than I expected. I need something to set a whole chunk of pixel array in the fastest possible time. Maybe the MagicCore has something more efficient to offer.
Ended my programming day looking at how its possible to port gdk_pixbuf data to a MagicWand image and vice-versa. Got the rudiments together but coming up against a couple of bugs accessing the pixbuf.
Seeing as its the new year I took a look at the development review that I posted a few months back. Sure enough, most of those features tagged for some TLC are still waiting!
Ended my programming day looking at how its possible to port gdk_pixbuf data to a MagicWand image and vice-versa. Got the rudiments together but coming up against a couple of bugs accessing the pixbuf.
Seeing as its the new year I took a look at the development review that I posted a few months back. Sure enough, most of those features tagged for some TLC are still waiting!
Saturday, January 01, 2011
gnocl::wand
HAPPY NEW YEAR!
Spent a little while this morning sorting out a couple of issues in the gnocl::gnome module makefile. Thanks to John and Chris for the feedback. The remainder of the day saw me working on the gnocl::wand bindings to the ImageMagick libraries. Added a little more functionality but, as usually, add something - loose something. Added control over pen colours and a few other items but now the rendering is slowed down! I'm missing something here...
Spent a little while this morning sorting out a couple of issues in the gnocl::gnome module makefile. Thanks to John and Chris for the feedback. The remainder of the day saw me working on the gnocl::wand bindings to the ImageMagick libraries. Added a little more functionality but, as usually, add something - loose something. Added control over pen colours and a few other items but now the rendering is slowed down! I'm missing something here...
Subscribe to:
Posts (Atom)
-
Given this module some attention today. Added some of the more package wide options to the module and created customised handler for settin...
-
Over the past few programming sessions I've been working on producing a central point, a dashboard, around which it's possible to se...
-
Spent some time today creating some simple howto-tutorials on creating standalone Tcl/Gnocl applications using freewrap. The process is almo...