Friday, October 22, 2010

Built-in graphics

A while ago, after upgrading my distro from OpenSuse 11.2 to 11.3 I noticed that the Gnocl icon on my apps had vanished. Of course it had been installed as a shareable graphic. Its about time to add it to gnocl core so that it will always appear by default in the top left corner of all newly opened Gnocl windows.

gnocl::printOperation -unit option

Just implemented -unit option functionality, this will allow long and short keywords, millimeter/mm, inch/ins. pixel/px and point/pnt. Just looking at obtaining and manipulating the print status options. This module is certainly going to be a big one!


Thursday, October 21, 2010

gnocl::printOperation

Added the core structures to hand the configure and cget commands. And its running fine.
Took a look at the online docs and urgh! The gnocl::assistant page is in urgent need of completion.


Tuesday, October 19, 2010

gnocl::print ------ progressing

Did some more work on the print module today. First of all I reworked the registration of the print op. Originally it was registered along with the other widgets, but on reflection I felt that it should be named differently in the same way as pixBufs are. So, I had to add a pile of funcs to add a hashtable to handle print jobs. Another change that I made to the code was to use a pointer to a parameters structure rather than to the op itself. Ok, all of the relevant info regarding the print job will be held in a printersettings structure, but the use of the parameters structure means that all the relevant pointers and non-gtk option settings can be accessed through a single call rather than having too many messy globals floating about. Finally, added the basics for the developer docs. The module doesn't print anything yet even though there's well over 500 lines of code!

Friday, October 15, 2010

gnocl::print

Returned to the print binding today and put the code in place to handle the Gtk properties and signals for the GtkPrintOperation widget. I'm pretty well playing this one as I go along as I have to admit that I don't fully understand the whole process. In terms of requiring print functionality all that is ever needed for document processing is now probably catered for using the gnocl::abiword widget. The gnocl::text object could have a simple print command added to it for the purpose of simple listings. Rich formatted text is a different matter. Does an application need to draw directly to a canvas and then output the rasterized image to print? What about applications that generate their own reports, how are these to be directed to print?

MMMM.... more to think about. Still, carry on putting the pieces together.

Thursday, October 14, 2010

Development Audit

Earlier today I did a rather informal audit of the state of the implementation of Gnocl widget set. As my attention to coding is largely demand driven certain implementations are begun, brought to a 'what is required' state and then....  Well, left to looked at some indefinite future period. As I've nothing to draw my attention at the moment, the obvious activity in need of attention is those incomplete items. So, here's a list of what I have to finish.

1) Printing support, only the bare bones are present.
2) Undo/Redo script for text, support for d'n'd needs implementing.
3) Extension of Undo/Redo include text entry items.
4) Recent file choose button.

5) Tooltips work, but rely heavily upon deprecated code.

6) Canvas, add polyline arc and some other simple line primitives (eg. stars).
7) Pixbuf -complete image processing commands.
8) Cairo support -complete support for primitives.
9) Review splashscreen code.
10) Calendar

That should do for now.



Wednesday, October 06, 2010

gnocl::stockItem -finished!

In the end I decide against the creation of new stock items from pre-existing items. So, here's what a piece of test script and its screenshot looks like






#---------------
# test-stockitems.tcl
#---------------
# Created by William J Giddings
# 06-Oct-2010
#---------------

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

package require Gnocl
 

#----- create stock item from an existing buffer -----#
 set pb1 [gnocl::pixBuf load -file [pwd]/georgie.jpg]

gnocl::stockItem add \
    -label Georgie \
    -icon "%?$pb1"


#----- create stock item from disk objects  -----#
gnocl::stockItem add \
    -label News \
    -icon "%/[pwd]/news.png"

gnocl::stockItem add \
    -label White \
    -icon "%/[pwd]/night1.png"

gnocl::stockItem add \
    -label Black \
    -icon "%/[pwd]/night2.png"


 #----- display the whole lot  -----#
set box [gnocl::box]
set but1 [gnocl::button -icon "%#News" -text News]
set but2 [gnocl::button -icon "%#White" -text White]
set but3 [gnocl::button -icon "%#Black" -text Black]
set but4 [gnocl::button -icon "%#Georgie" -text Black]
$box add [list  $but1 $but2 $but3 $but4 ]
gnocl::window -child $box
gnocl::mainLoop

json_shell_utils.tcl