URGENT:
~~~~~~~

| Need a new type of Mutex - one that can differentiate between read- and
| write-access.  It's safe for multiple threads to access data concurrently
| so long as none of them is modifying it - so a new form of Shareable mutex.
| pthreads rwlocks would do nicely here, if it weren't for the fact that the
| linux implementation doesn't support "upgrading" an ro lock to an rw lock.

| Can we arrange for the rendering subthreads to perform their own cleanup,
| so we don't have to wait on them before setting a replacement thread going?
| As long as the preview's idle function removes the pointer from the ImageInfo
| all should be well.  However, it will have to compare the thread pointer before
| clearing it.  Should be no race condition, since the idle function runs in the
| main thread's context.


| Rearrange scaling functions to separate horizontal and vertical scaling
| such that t's possible to downsample vertically, while enlarging horizontally
| with Lanczos Sinc, etc.

| Fix the background colour when using masks - currently if the BG is
| simulated-paper-white, the mask background remains monitor-white.

Look into the consistency of the opaque/transparent scale of alpha channels

Add support for printing with black ink only.

| Fix the rendering of greyscale previews.  If the desaturate effect is applied,
| the paper simulation doesn't happen.

Fix left/top margin for Single layout...

Test and fix, if necessary, custom sizes with PostScript driver.

Custom page sizes are extremely ill-behaved with borderless enabled!

| Modify ProfileSelector to display "inner" names rather than filenames.

| Add "Duplicate" option to right-click/Image menu.

| Add right-click menu option for "Duplicate to fill page."

| Use finer-grained flushing of previews - no need to flush high-res preview on
| selection or page change.

| Need to flush on any effectwidget changes, which probably means giving the
| effectselector knowledge of Layout_ImageInfo.
| (Used a much more elegant solution - Since Layout_ImageInfo inherits from the
| EffectHeader, the EffectHeader now has the mutex, not the ImageInfo.
| The Obtain() method is then overridden, both by the effectheader and the ImageInfo
| so the ImageInfo is able to trap write locks and flush the HRPreview.

| Either make PhotoPrint buildable without libtiff/jpeg or fix the configure
| script to bail out.

| Options from right-click menu aren't being greyed out according to the
| Layout Capabilities.  FIXED

Need to store collapsed/expanded states for each UI expander in the preset file.

Use a CMS Transform to convert CMYK -> RGB in pixbuf_from_imagesource().

| Create a new widget to show various information about the selected image.

Create a new widget with buttons to adjust orientation and flipping

Create mirroring imagesources.

Look at using librsvg to deal with SVG files.  How can we find the "natural"
dimensions of an SVG file?

Find a more elegant solution for scaling ImageSources.  Should they have
a "scalable" flag, and perhaps a ::Scale() function?  The latter would have
to return a pointer to an ImageSource that would replace the one held by
the calling function - perhaps make it a static function?

Look at making the border- and background-selection widgets multi-column.

Allow use of D-bus for adding images and other functions?

| Create an ImageAdjustment Widget which will be a vbox containing Info,
| Transformation, Filtering and Masking options in expanders.  The layouts will
| use an ImageAdjustment_SetCurrentImage(ImageAdjustment *ia,Layout_ImageInfo *ii)
| function when an image is selected.
(How to deal with multiple images being selected?  "Average out" the data - or 
differentiate between "selected" and "focussed"?)

Add image's physical dimensions to the ImageInfo widget.

The Cropping/Rotation flags aren't currently honoured for dragged'n'dropped
files - look at moving DND stuff from pageview to main window, and these
flags into the Layout superstructure, so the default values are more easily
accessible.

Store the Expanded status of each UI element in the preset file.

Can we separate UI settings and printer/colour settings in any way?

| Fix segfault with 180degree rotation.

| Random Access problem again with JPEGs.

| Page size seems to be reverting to Letter at startup - fix!

| Check for non-existent queues in the preset file, and warn the user.
| Also allow the user to select a new queue at this stage.  This solves the
| problem of sharing presets and profiles when changing the queue causes
| the printer settings to be reset to defaults.


| Get preview of background working again.

| Save the state of the Allow Cropping flag, and rotation controls in
| the preset file.  This will allow these features to be used in batch
| mode.

| JPEG export to accompany TIFF export.
| Written JPEGSaver routine
Need to support CMYK saving
| and profile embedding.
Need to store JPEG Resolution too
| Need to add control for JPEG Quality

| Solve translation problem with queue names.  For now, use a SetLocale() call.
| Ultimately, migrate to CUPS API.


| Use the XICC atom to fetch the display profile, if possible.
| This really needs an extra entry in the profile selector, and some kind of
| well-defined escape-string to refer to the display profile, and function to
| return a profile constructed from this atom.
| How about a Win32 equivalent, too?

Need some way of specifying whether or not a profile selector should include
the display profile.


| Higher resolution previews?


Sepia effect.


When a profile is added to the system, PhotoPrint won't recognise it until
either it's restarted or the paths change.  Can we set up file notifications
as part of the SearchPath class?
(Or maybe just a "rescan" button in the Profile dialog?)


Create a widget to view an ImageSource.  Perhaps simply create a pixbuf from
the imagesource at 72dpi, and view that in an image widget?
Need to deal with scaling and panning...   Take a look at GQView's view widget!


Migrate all combo widgets to use the new-style gtk_combo_box.
(Not until the new-style combo box supports tool-tips properly.)


| Add "Overwrite?" dialog to File Save dialog.


Need to link enter and the OK button on the file dialog.


| Flush thumbnails on loading of a new preset, since the profiles may change.


| INTERNATIONALISATION!


|Use new-style File Selector
(A few instances left of the old one, in certain widgets...)

| Tooltips to describe rendering intents?

| Fetch embedded profiles from JPEG files...

| Proofing?
| Display Mode:
|  "Normal"  -  Normal source->monitor transform
|  "Simulate Print"  -  Proofing transform, using Abs Col intent for proof.
|  "Simulate Print, Adapt White" - Proofing transform, using Rel Col.


| How to support Proofing Transforms in the ProfileManager?
| LCMSWrapper needs to sprout support for Proofing Transform, for a start.
| But what about DeviceLinks?  For now, don't worry, because LCMS doesn't support
| proofing with DeviceLinks.
Ultimately, one could simply chain an absolute colorimetric transform to the monitor
profile onto the end of a multi-profile transform.  (Do multi-profile transforms
work with devicelinks?)


| Create a routine to substitute the home directory in a filename.  (Needed for Win32.)

| If there's a monitor profile defined, then transform the thumbnails into the
| monitor's colourspace.  That means opening up the original image through the
| ImageSource system to fetch the embedded profile if there is one.
| Layout superclass now has a TransformFactory, so the transforms will live as
| long as the layout does.


| Need a custom IntentSelector widget.


| Implement tagging an image with a custom profile.
| Need to open the imagesource and warn the user if there's already an
| embedded profile, and ask whether they really intend to over-ride it.
| Allow images to set the rendering intent too.

| The Layouts need to make sure the final imagesource is tagged with the output
| profile.  (Actually, made the TIFF Export route do this in the finish.)
| To do this, we need to add the profile's filename (if known) to the CMSProfile
| class, because the TIFFSaver needs the filename to embed the profile - since
| it can't access the raw profile through LCMS.


| Add two new "virtual" print queues - need "<custom print command>" and "<file>".
| Only the second of these is applicable under Win32.
| Implement this as a custom widget - a PrintQueueSelector - which handles the
| tedious details.
| Implement it as a "view" that operates upon the printerqueues object.
| Then the printerqueues object will need methods to:
| get/set_queuename
| get/set_customcommand


Add a sensible error message for when the output profile is missing...


| Add a sharpen filter of some kind?


Add a parametric imagesource for gradients, etc.


| Use a HQ Downsample filter for reducing images.
FIXME - black stripe on the right hand edge...


Investigate Win32 installation techniques - how to detect and use the Windows
GTK+ installation?  More difficult now GIMP is shipping GTK bundled rather than separately. :(


Temporary files:
Clipboard pasting, the GS imagesource, remote images fetched by HTTP/FTP all need
temporary images to be stored and cleaned up at program exit.

Can we use a tracking class, store an instance in a global variable and have it perform
cleanup through an atexit() call?

What about cleaning up after previous runs?


Create GIMP ImageSource for use in plugins.


****
Need to be able to specify a PPD file for use with the Gutenprint PostScript driver.
****

| Explore the correctness of ImageSource_Promote and the "flavour" of greyscale
| ImageSources in general.  (Use MinIsWhite for greyscale, to match CMYK?)
(Need to add support for indexed BMP and all flavours of PNG - fallback to GDKPixbuf
fails for CMYK, non-colour-managed output).

Add native PNG loader!

|  Need to create an stp_file widget - a text entry and file selector button.
| (Or perhaps arrange this as a variation on the ProfileSelector widget?  Would be
|  nice to keep this widget in C, though, along with the rest of stpui_widgets.)

****

Need to hand off responsibility for loading and saving an stp_vars_t to the STPUI library.

| Or perhaps even create *another* library - stpsupport - to handle print queues and loading / saving...

Can we use XML, like the print plugin, for this?

****



When queried for a queue's PPD, cups returns the path of a temporary file - this
filename can't be relied upon to be persistent - thus when saving this parameter
in the preset it will be necessary to create a special case, whereby the filename
will be checked against the queue's default, and a special "<default>" option will
be saved instead of the actual filename.

This will, of course, have to be detected upon preset loading, which means the
queue name and PPDFile parameter *must* be loaded and saved in the preset before
the rest of the printer options.

(Need to provide a method for the user to choose a default value...)
Might the answer be to make a widget that resembles the profile selector -
has the queue's default PPD in the widget, and has an "other..." option to select
a different one?

| The stpui_widgets support library takes charge of 
| print queue selection - so some of that will need to be re-implemented in pure C.

| Also need to support Win32 printing - using the Gutenprint driver to print Raw data.
| Ideally, the printerqueue class will take charge of actually feeding the data to the
| print queue.

Need to support three different printing methods:
| Via the queue
| Via a command
| Via a file

| Need to create a dummy Consumer class to route data through the queue.

| Add a menu item somewhere to Select All.

| Add an "Edit menu"

(Clipboard support?  How would it be arranged?  URIs or something else?)
Can copy or cut be arranged such that if the image has a mask, the masked version is
clipped?

Pasting images will need to create a temporary file somewhere, and free it when done.
(Perhaps build temp filenames with the PID as a root, then delete all temp files with
that PID when the app closes?)

Use whatever solution we use for temp files for the GS imagesource too.

| Improve performance of ProfileSelector widget.
| Perhaps the most elegant way of doing this is to have the ProfileManager class build a
| list of Profile details, which will then be used to create the widget.

| The ProfileManager will need a method to flush and rebuild the list, which will be
| called immediately before building a dialog using ProfileSelectors.  The result will be
| that the expensive operations of scanning the profile paths will only have to be done once,
| even if the dialog contains many ProfileSelectors.



High priority:
~~~~~~~~~~~~~~

| Dialog for TIFF export:

| Filename: ________________ [...]   (Need to support including a %d for page number...)
| Pages: _________________  (Routine to parse page numbers already built)
| Resolution: ______  (Dots per inch - default to 300?)
| Colour Profile: [=====profile====|v] (Default to the Default RGB profile
|	but allow CMYK profiles too...)

| Cancel  Export

| Create a routine to substitute $HOME, or a leading '~' with the user's home directory...


Improve the ProfileManager class.
Need to be able to get a profile filename for a device class.
Autonomous widget for handling the profile settings?  Need a "Save" method
to store the current settings in the ConfigDB?
Or should that be a subclass, a separate entity?

Split the ProfileManager into a general section that doesn't use the configdb,
and a second section that does.

|The TransformFactory needs to support an arbitrary profile (or filename?) as a
|target, not just the predefined DeviceClasses.  

Support the DeviceClass-based behaviour in a subclass?

The autonomous widget needs to handle the interaction between the toggle-button
and profile selector.  Allow the toggle button to be passed in as an argument.
The autonomous widget will take the deviceclass as an argument, and automatically
fetch its activation state and the default profile from the profilemanager.


*****

LONGER TERM:
~~~~~~~~~~~~
Can we reorganise the way the print system works?  How about separating the queue-based
options and the specific printer options?
For each queue have a folder of presets specific to that queue?

Printer: [======Queue======|v]  [Properties]

Preset: [===Option preset===|v]  [Save...]

Pages: _____________

*****

| Allow a background image to be used in NUp mode; this could allow for some very professional
| looking contact sheets.

| Add support for drag-n-drop to the ImageSelector widget...
Do this only if the ImageSelector has image selection enabled; if it's in display-only mode,
ignore drops so the parent widget can catch drops if it wishes.

Allow converting RGB and CMYK to GreyScale for the masks.

Clean up the n-up layout code so that zero-gutter layouts don't have white stripes between
some of the images...

| Need some kind of Paths UI for setting profile paths, border paths, etc.
| Need to build a specific widget for this.
| Create a list box, and a pair of buttons.

| Widget needs to be able to dissolve a "PATH1:PATH2:PATH3" string into a glist of
| paths which can be used in the list box.  The list box should be able to rearrange
| the order of the paths, and "Add..." and "Remove" buttons are needed too.

| DONE - created a widget which operates directly on a SearchPath object.

PathEditor can't yet re-arrange the order of the elements.

Add code to prune elements from the right hand of the path until it points
to a valid directory.


| Create a dialog - either using tabs or an OptionMenu.
| Paths are needed for:
| * ICC Profiles
| * Borders / masks

| Create an ImageList widget - showing thumbnails in a scrollable list.  Again, use
| a SearchPath object to find the filenames.

| Improve user interface for profile selection.  Need the following features:

| Create a profile selection widget that builds a combo from the profile manager,
| with a box to the right that will allow an arbitrary file to be selected.

| Need to be able to select a profile for:
| * Default RGB colour space
| * Default CMYK colour space
* TIFF Export profile  **** Use the Default RGB profile for TIFF Export, but allow
  a different one (RGB or CMYK) to be specified at export time.
* Monitor profile
| * Printer profile

TIFF export needs some options:
  Page number (range) to be exported.
  Output resolution.
  Colour profile to use: (Screen, Printer, custom...)
  (Embedd colour profile?)

--

ProfileManager:
Try and separate out the INIDB code - will make re-using the ProfileManager much easier.

| Need to be able to build a list of profiles from the various paths,
and show a warning if there are any repeats.

--

Add support for heredoc to the Config code - i.e.
Keyword = <<<EOHD
<?xml version="1.0"?>
...
EOHD

This will allow embedding XML code in the presets for curves.

--

Scale and crop to specific aspect ratios?

--

Add a list of preset paper sizes for poster printing...

This will need a paper-size class - one that maintains a list (glist)
of paper sizes.  Probably best to create a generic non-glist-based class first,
then a subclass that builds a client-owned glist according to filters?

MatchPagesizes...
PAGESIZES_ALL
PAGESIZES_COMMON
PAGESIZES_EUROPEAN
PAGESIZES_AMERICAN

--

DCRaw import?

--

Postscript backend (PPD-based options instead of gutenprint options?)

--

Print dialog with page numbers, etc.
|routine to parse a page number description string
|1,4-5,7 etc.

--

Pull as much as possible out of the specific layout classes into the general layout
superclass.  Perhaps split into several source files for different aspects (ui, print, etc)

Keep in mind the possibility of the current layouts becoming page elements in the future.

(Can they be separated out enough to be done as plugins?)

--

Add a dialog for setting rendering resolution

--


Print preview widget:
Need a widget to display a portion of a pixbuf.  The pixbuf will typically be rendered at
72dpi or similar.  Must be able to pan around, and perhaps zoom in.

The print preview process must do a colour-managed proof.

--

// Masking:
// This function will be called immediately prior to rendering the preview, in layout_*.cpp.


| New mode: Carousel
| In this mode, a circle of images will be overlaid and stitched together in a manner suitable
| for printing on a CD.
| *	Makes heavy use of masks, so the preview will have to be re-rendered every time an image
| 	is added.
| *	Might need a progress display.

Needs a control panel to set:
| * overlap size (%)
| * rotation offset (degrees)
| * Get ImageInfo by coordinates.
* Move image forward / backward in list.


Need an interface for cropping images.  Need to store coordinates.  (Will we need to crop
twice?  Or can the rectangle class take into account a previous crop?)

| Or for now, just perform the minimum crop necessary, and store an H/V panning value?



Can the image view be separated out so that the poster and n-up pageviews
both place imageview widgets on their pages instead of handling items themselves?

The imageview widgets will be responsible for constructing the context menus, which
will provide the following facilities:
(High priority)

Set profile.
Add a menu item for applying masks.
Set rotation -> submenu:
  Automatic
  0
  90
  180
  270
Allow cropping


(It must be possible to grey-out any of these options that are inappropraite for a
particular image.)


Allow saving of "projects" - lists of files, positions, orientations, clip flags, profiles, etc.



--

Read up on Pango / text functions.

--

PhotoPrint Options:


  Colour Management options:
    Move the rough-cast profile generation facility out into a standalone utility,
	that can be used to generate an ICC profile from the user's settings.
    (Long term: perhaps make a custom widget based on the CIE diagram?)
    Colour Temperature (Degrees K) [  ]

  Add support for Curves


Selection of Print queue:
DONE: Need to improve selection of printer queue, etc., similar to how the Print plugin handles it.

  Allow saving to a file  (Ignore this case for now; any user advanced enough to need to
  print to a file should be quite capable of prefixing the filename with cat > )
  (Perhaps add TCP/IP support too)


Lower priority:
~~~~~~~~~~~~~~~

PNG Support
  Direct PNG support will make it possible to extract embedded profiles, and fetching
  of 16-bit data.
  (GdkPixbuf has some provision for 16-bit data - how far has it got?)

PostScript / PDF loader
  Add an imagesource for loading a PS file.  This will have to use GhostScript to generate
  a temporary image in /tmp, that will be deleted when the imagesource is disposed.
  (Resolution to use?  360dpi as a default.)
  Pixbuf thumbnail code can't currently deal with PS/PDF, so we'll need the ImageSource->pixbuf
  converter.
  (Just convert first page for now?)


Add some sort of sanity check to the option parsing code; parsing a binary file causes
garbage to be printed as the code objects to the nonsense strings.

Create a BoilerPlate section to go at the head of the configuration file, which will
include the program's version string, and a version number readable by the INI code.


Layout_NUp class:
  Allow dropping an image directly into a particular cell.
  Make the cells a drag'n'drop source, so images can be rearranged on the page.

pp_Layout_NUp widget:
  Assign ICC profile
  Remove ICC profile  (Only active if profile has been manually assigned)


Layout_Poster class:
DONE:  Need to set individual page dimensions (+ margins)
DONE:  Need to set poster dimensions + overlap.
DONE:  Provide widgets allowing the number of pages horizontally and vertically to be set
DONE:  Provide a final dimension widget; adjusting this will automatically set
       the H/V page counts, while adjusting the H/V page counts will automatically set
       this to the largest size possible with the specified pages.

	The poster class will include a pageextent taken from the printer, and will maintain its
	own paper_width / paper_height from the number of tiles in each direction.
	Also needed are image_width and image_height; if the number of tiles is manually adjusted
	then the image size can be set to the maximum possible;
	
	image_width = imageablewidth*ht - (ht-1)*hoverlap;
	image_height = imageableheight*vt - (vt-1)*voverlap;
	
	ht=(image_width-hoverlap)/(imageablewidth-hoverlap)+0.999;
	vt=(image_width-hoverlap)/(imageablewidth-voverlap)+0.999;
	
	Need to find the coordinates of each section of the image for cropping:
	
	left=h*(imageablewidth-hoverlap);
	right=(h+1)*imageablewidth-h*hoverlap;
	top=v*(imageableheight-voverlap);
	bottom=(v+1)*imageableheight-v*voverlap;
	
	Then scale to imagesource coordinates.


PrinterSelector:
  Need to find some way of grouping the Epson printers - the list is
  ridiculously long now!


Printer Settings:
  Need a "Defaults" button on each page of the optionbook to reset to defaults.

  
Long term:
~~~~~~~~~~

Investigate ways of generating an image containing text; this would allow filenames to be
printed on a contact sheet.
 
Perhaps add the ability to save an "Album" of images; HTML and PS/PDF export would be nice.

-----------------------

Longer term - more generalised page model:

Allow the creation of Page Templates to replace the current n-up page model.
The page class would maintain a list of image "slots", which would be filled one by one
as the user adds images.
This must not conflict with the placing of images at their natural size, or poster printing.

Need support for the following:
* Placing images one by one into multiple pre-defined rectangular slots.
* Adjusting the layout of such slots on the fly.  (Perhaps a word-table-style selector?)
* Placing images in a more freeform manner.
* Placing images into an image "carousel"
  (Objects that adjust their layout to accommodate n images, up to a maximum)
  The N-up layout could be implemented in the same way - but what to do about displaced
  images if the number of cells is reduced?
* Text objects.  (Find a way to render a bitmap text object)
* Poster printing.
  (Page setup option?)
* Moving objects forward or backwards.
* All this must be accessible without becoming significantly more clumsy than the
  current system.

Does all this really belong in PhotoPrint at all - should PhotoPrint be a more minimalist
program?  It already fills its niche well.

Perhaps start a new project, side-by-side and see how this stuff pans out.
Begin with a generic page layout system, with just moving empty boxes around,
with support for resizing, moving, snapping to guides, highlighting, etc.

Need a file format for storing preset layouts.

Each of the element types from photoprint-traditional could be implemented as a particular
type of object in PhotoPrintNG; a control panel for each type could appear in the right
hand panel where they already appear; all that would change is the panel would change as
the user clicks on different types of objects.

* Single image.
  H/V Scale (defaults to natural size)
  
* n-up image table
  Rows/Columns
  Gutters

* Image carousel
  Overlap
  Rotation

* Text box
  Font
  Colour

