- drag region on zoomed out image ... possible to start off the edge of the
  image! some kind of rounding problem

- after Esc on rowview, warp focus back to column text box

- also after "return" on row text edit

- same for column title widget

- any others?

- could bind cursor up/down to moving up and down a column ... enter on row
  could edit next row?

win 
---

- get "invalid cast" every time you pop up a menu on GtkMenubar2? how puzzling

- try to get gtk-engines running? a more win theme would be good

- on winders, redirect stdout/stderr to a file somewhere?

  would be nice to be able to capture to a log file on *nix too I guess

mac
---

- abort() on middle button paste in gtk? test again

- make a dmg from a tree ... could add to build system

-------------------------------------
#!/bin/sh
#
# Creates a disk image (dmg) on Mac OS X from the command line.
# usage:
#    mkdmg <volname> <vers> <srcdir>
#
# Where <volname> is the name to use for the mounted image, <vers> is the
# version
# number of the volume and <srcdir> is where the contents to put on the dmg
# are.
#
# The result will be a file called <volname>-<vers>.dmg

if [ $# != 3 ]; then
 echo "usage: mkdmg.sh volname vers srcdir"
 exit 0
fi

VOL="$1"
VER="$2"
FILES="$3"

DMG="tmp-$VOL.dmg"

# create temporary disk image and format, ejecting when done
SIZE=`du -sk ${FILES} | sed -n '/^[0-9]*/s/([0-9]*).*/1/p'`
SIZE=$((${SIZE}/1000+1))
hdiutil create "$DMG" -megabytes ${SIZE} -ov -type UDIF
DISK=`hdid "$DMG" | sed -ne ' /Apple_partition_scheme/ s|^/dev/([^
]*).*$|1|p'`
newfs_hfs -v "$VOL" /dev/r${DISK}s2
hdiutil eject $DISK

# mount and copy files onto volume
hdid "$DMG"
cp -R "${FILES}"/* "/Volumes/$VOL"
hdiutil eject $DISK
#osascript -e "tell application "Finder" to eject disk "$VOL"" && 

# convert to compressed image, delete temp image
rm -f "${VOL}-${VER}.dmg"
hdiutil convert "$DMG" -format UDZO -o "${VOL}-${VER}.dmg"
rm -f "$DMG"
-------------------------------------

paintbox
--------

- the font name isn't updated when changed

  fix this in gtk2 when we use pango for font naming

- the 'drawing cursor' probably should be set only for
  the drawing area, currently it is set for the
  top level window

  to do this we need to change the iWindow cursor system to be per-widget, 
  not per-window ... might be tricky

- maybe select the tool by buttons instead of a drop down list?

  need a nice set of button icons

minor bugs/wibnifs
------------------

- make region and colourpatch edit pinupable

  update dialog on value changed on model?

  need a modeledit class

- can we delay model building as well as display building?

  currently build view when a row is opened, but we build the entire underlying
  model at the end of row recomp ... could maybe delay building the model as
  well? would produce a good speed-up

  sticking point: interactions with dependency tracking ... it's obviously OK
  for completely closed rows, but what about rows with top level open and
  lower levels still closed?

  we currently use the model to work out which rows depend on which rows, in
  case we have zero-param local classes etc. with submarine references

- add fourier filtering with paintbar to nip for nerds?

  better in an image processing section ... could put sobel code in there too?

  what else could go in? morphology is quite cool

- hourglass hands don't turn during imageinfo_file()?

- should have "close window ctrl-w" on most winds, "quit ctrl-q" just on main

  can't do this, as GtkEntry binds ctrl-w to forward word ... should be
  fixable with gtk2

- add a symbol_recalculate_all() to the end of filemodel_load_all() can cause 
  segv on reload start stuff?

  generate an image, make a region on it, reload ... how odd

- nice if

	(int) -2

  wasn't a syntax error :-( need to differentiate unary and binary minus in the
  parser?  or spot casts in the lexer?

- try:

	A1 = fred 12;
	A1.a = 99;
	clone A
	B1 = fred 12;
	fails to update correctly

  B1.a never gets formula_default, since it's created with edited set!

  when we reset B1.a on enter in B1, we have no default formula to revert to

  need a better way to set formula_default

  see FIXME in text_reset()

magic def maker
---------------

  works on current column

  - refs to other columns become class parameters

  - bottom row is output

  - set of "control" rows (Slider, Toggle, Option, Region, Matrix, Filesel,
    others?)

  - non-control rows are computation rows and become locals of value to hide
    them

  - we allow edits to class params and to model values ... promoted to params

	eg. a Slider dragged to 12

	A1 = Slider 0 255 128;
	drag value to 12

	on mag, generate

	A1 = Slider 0 255 (12)

    also class param edits: eg. open A1, set

    	A1.from = A2.value;

    generate

    	A1 = Slider (A2.value) 255 (12)

  - text box to set name of function (and toolkit? or can we let edit do
    that?)

  generate code, then pop up an edit box with the text in

find
----

- find for workspace?

- pin-me-up in find dialog?

- could abstract a lot of search stuff into Find class ... later, share with
  workspace find

  maybe do workspace find first, common stuff up later

- history pulldown for find? keep history as static class member for all finds?

- find should just search the current tool/workspace ... have a toggle for
  "search all"

code cleanups
-------------

- rename iDialog -> Dialog, iWindow -> Window?

- rename row_map_fn -> RowMapFn etc.

- check occurences of main_workspacegroup, main_toolkitgroups, reduce_context
  ... sure we can scrap a few of them

- SYM_PARAM should be property of expr, not symbol?

- make expr/link derive from gtk_object?

- dependency stuff in at least three places ... topchildren stuff, expr/sym
  parent/child stuff, row recomp dependency stuff ... abstract into
  depend.c class?

- experiment with create/destroy views on notebook page flip?

- mainw should subclass off iwindow?

- work through the FIXME comments again

- try decoupling expose events ... don't call imagedisplay_repaint() directly
  from (eg. imagedisplay_scrollto()), instead queue a redraw with
  gtk_widget_queue_draw() and gtk_widget_queue_clear_area() (slight wrinkle:
  need to map to x cods before we ask for a repaint)

  problem is that we do our own scrolling: we can queue a draw but we won't
  know when it happens, so drag-scrolling gets confused unless we make it
  synchronous, which seems like a loss

preferences
-----------

- add a preference for IM_CONCURRENCY

- warn if lots of stuff in ~/.nip-x.x.x/tmp area?

- recursively load sub dirs of start as well?

- edit start path in prefs, start nip, start path not followed, since we
  don't load Preferences.ws until we've started walking it ... hmmmm

load and save
-------------

- could make no-compression-and-prettyprint into a save option for ws-es? or a
  preference?

- "nip fred.jpg" loads fred and displays thumbnail ... should display image
  window and not display mainw?

  good if we could bypass parse/compile and just work as an image viewer in
  this case

- need workspace_load_file() to load from stdin in main.c for -script flag

- make "-main" work differently ... want:

	#!/usr/local/bin/nip -main
	main = argv?0 + argv?1;

  need:

    - start with no X for -script (is this possible with gtk+-1.2.x?)
    - read args and create root.argv list of strings
    - allow leading '#' as comment character
    - load first arg as a toolkit
    - print "main" on exit

- make XML save format more abstract ... should not be tied to 
  col/subcol/row/rhs/text structure so closely

- XML load could warn of unrecognised names if DEBUG is on?

- catch xml errors 

- chunks of workspace.c ought to be in column.c?

- swap Clone for Cut/Copy/Paste via clipboard of XML?

properties
----------

- add a properties system to Model ... automates XML load/save, read/write
  heap, edit dialog read/write, info system

  alternatively, use gtk property system on gtk2 switch?

- for each property, need to track:

  * name (eg. "view_height")
  * friendly name (eg. "View height")
  * type (eg. int, see below)
  * offset in model instance var table
  * default value (eg. view_height=64)
  * should-be-saved flag ... eg. value in iimage should not
  * should appear in edit dialog (so we can make eg. slider edit dialog
    automatically)
  * optional flag ... eg. view_height 

  for each type, need:

  * read from XML 
  	get_iprop( xthis, property->name, model + property->off )
  * write to XML
  	set_prop( xthis, property->name, "%d", model + property->off )
  * get from heap
  	class_get_member_real( instance, property->name, ... );
  * write to heap
  	heap_real_new( ...
  * name (eg. "int")

  _get_properties() method to get prop list ... so iregion can set a load of
  props, and iimage can too ... we will see both

  have multiple sets of instance vars ... so could read widgets into
  an instance, then if all succeed, copy instance to model vars

program window
--------------

- could add "save/save as" to right button menu on toolkits

programming language and .def files
-----------------------------------

- add Group class? would help iteration

- debug window could look at trace and generate C/C++ for an action?

- dilate [[255,255,255],[255,255,255],[255,255,255]] with itself ... get a
  matrix 1 element too large all round

- dE_.CIE00 does not work for all combinations (eg. colour, matrix)

- sort out Plot_scatter args ... matrix? List? what?

  redo the ip workspace that assesses print accuracy and plots graphs ... this
  is the case we want to work well

- add geo stuff to New=>New_video

- need matrix plus vector for Morph_for_print? want to add row-wise in this
  case

- make a vector menu and add cross and dot products

- matrix * vector ... vector should be one column matrix?

  ie. currently we do 

  a b  c d
  e f

  ==

  a*c b*d
  e*c f*d

  should do

  [[a, b], [c, d]] * [e, f] ==
	  [[a, b], [c, d]] * [[e], [f]] 

- need to think again about batching :-( how to do batch crop, for example?

  current Join=>Crop is useless

- map_trinary is in _stdenv, used by If_then_else in Boolean.def ... maybe we
  could have a true trinary if_then_else?

- can we spot refs to things that ref super in super class constructor?

  any direct or indirect ref to "this" or "super"? is that enough?

  no, but it would get most loops

- reduce needs rethinking again, much too complicated

  trace 2 + 2 ... bleurg

- common path: track down APPL heapnode pointers ... could add little loop to
  reduce_spine to do this before switch ... any faster?

- test fix

- test scan

- not sure matrix is being done the right way, maybe better to have something 
  like the imageinfo mechanism

  split imageinfo into two levels: a base class for a pointer to a VIPS object
  managed by the GC (Externalobject?)

  subclass off this to make imageinfo ... add LUT stuff etc.

  needs to interact with vips_call.c

  this should be part of the VIPS type model really :-(

  projection functions can just be vips operators ... im_mask_matrix( mask )
  returns a [[real]], no need to build into ip

  same for constructors .. im_mask_new( double scale, double offset, char
  *filename, int width, int height, doublevec coeff )

  need a destructor for when we GC an object away

  save is harder: this has to be wired in to ip for each type?

- is_image -> is_vips_image?

- image"" -> vips"" ? or im_open? or im_image?

- add imagevec as a type to vips.c

- could make links more fine-grained ... atm, if untitled.A1.a looks at 
  System.A1.a, then we will record a dependency from untitled.A1.a to
  System.A1 (can't note link to System.A1.a, since a might be part of
  root.fred)

  we would need links with exprs at both ends, not "many expr"->"one sym" as 
  we have now

- make all operators take an expr pointer? would be handy for debugging ...
  could use them to set watchpoints ... or something

- add symbol lookup by name to language? 

	symbol_lookup "workspace.fred" == fred

  easy to do, useful though? hmm

widgets
-------

- keyboard shortcuts for imagepresent menu are broken? and tooltip is the
  wrong colour? how odd

- imagedisplay_max_nodecompose_pixels is a bit crude ... should look at
  current strip height ... if it's small, lower the threshold

- think about layer stuff? turning channels on and off? maybe better as
  something which can show a list of images (so we can have colour layers)

  have to be rather like paintbox ... a separate window popped up by a menu
  item? could also try just as a column?

- load and save groups? need an Imagegroup class? also layers 

- also a Path class? makes an orderlist widget? 

  Filename could have an "exists" bool ... also file length, date etc.? 

  maybe rename as file?

- region vector/hguide/vguide paint is very slow ... we're not really xoring

- have class fields for scale/convert in Image? might be handy for xrays
  could link them to the sliders in imageview windows?

- when we make a new iimage, should search for regions which might have a
  display ... currently only update links when region is recalced

  should be when a new ImageInfo goes in ... find what other iimage have that
  as their value, and see which regions they have defined on them

  eg.

  	A1 = image
	A2 is region on A1
	A3 = A1

	open A3, no image display until touch A2

- could update edit dialogs on model_change

- have low and high priority repaints ... high (eg. repainting after a region
  move) do clear to background, even in the image ... all high done before all
  low

- default image file format preference?

- turn on rulers by default for graph images? or draw axes in hist_draw?

- use gtkplot to show histograms? and others? what about guppi?

	http://www.gnome.org/projects/guppi/

- could add width/height to display of mask? handy for edits

- new member: "tooltip"? make a table of names somewhere for auto suppress
  stuff? 

- top level widget in option_new() etc. should not be shown by _init()?
  need to sort out what's shown when

- nice to be able to scrap edit dialogs in favor of popping open class
  displays ... but does not work well for derived classes ATM ... think about
  how to fix this

  maybe have a special "views" member which lists the members which should be
  displayed at each view level?
  
  slider f t v = class {
  	views = [
		[ "f", "t" ],
		[ "v" ]
	];
  }

  so views?0 is the members we show for 1st view level, etc.

class browser
-------------

- TAB should move down column texts, toggling to expr edit

- Measure_colour_chart: seem to call im_measure() twice? if we then
  Generate_colour_chart with that, call im_measure() twice more

  make a region, open up class, set a breakpoint on im_extract, edit a 
  member (eg. left = 12), im_extract() is called once

  now turn off region update on drag and move the region ... on region drop,
  im_extract() is called 9 times as the class is rebuilt

- view source button for rowview menu pops up a program window showing the
  code that made that row

- keyboard nav for menu column could be better ... up/down for vertical :/

- better more/less visible stuff for class display ... need some feedback 
  from rhs so spins know how much to increase/decrease visibility

- row up/down spin buttons should grey out on max/min ... look at
  gtknotebook.c, they have nice greyoutable buttons

- add an "action" pull right to row object menu, displays class
  instance functions, just like toolkit menu (but dynamic)

- add outline drag for columns, needed when we put images into workspaces
  ... make a floating column title plus hollow frame, drag that?

- draw arrows for object relationships on background?

other interface
---------------

- could do right button => rename for workspaces and rows ... useful?

- nice to have some way to trigger itemfactory actions programmatically, handy
  for toolbar stuff

  also the toolkit menus

- preview image in fileselect

- could offer workspace preview in "recover after crash" too?

- add toolbars

- something to set storage options per image ... to limit pipeline lengths
  ... replacing 'istop' make_temp_image() parameter and eval preferences
  stuff

- offer cancel more often ... currently every 100000 reductions, add every 10
  VIPS function calls too?

- use colour icons? how is this done?

- add colour calib stuff?

- flash error arrow on GC?

- could add "save as nip" to ip

- gtk_fixed flashes a lot on gtk_fixed_move() :-(

  gtk_fixed_move() does a queue_resize() on fixed, not on the child?

  need gtk_fixed2?

configure
---------

- if can't find lex/yacc, should abort configure

something like

 [AC_CHECK_HEADER(png.h,
         png_ok=yes,
         png_ok=no)],
-      AC_MSG_WARN(*** PNG loader will not be built (PNG library not found)
       ***), -lz -lm)
+      AC_MSG_ERROR(*** PNG loader can not be built (PNG library not found)
***), -lz -lm)
     if test "$png_ok" = yes; then
       AC_MSG_CHECKING([for png_structp in png.h])
       AC_TRY_COMPILE([#include <png.h>],

