A notebook contains a collection of items. Each item can have a label, a time stamp, text, a user and a pixmap. (The notebook_data may also have a window and a colormap when using the pixmap.)
A user interface for the notebook is implemented in the notebook metaclass. The ui was intentionally kept separate from the functionality of the notebook_data class because different projects have different requirements that should be dealt with thru the user interface.
file_prefix is the full path of the directory that the notebook is saved in. You will need to set this to open or save a notebook. (Warning: "save as", where you can save a notebook to a different filename is not yet implemented.)
pixmaps_changeable is a boolean flag which tells the notebook_data if the pixmaps can be changed once they are entered in the notebook. If the pimaps can be changed, this should be set to one and all pixmaps will be resaved every time you save the notebook. If this flag is set to 0, only new pixmaps will be saved. The default value is false, or 0.
open_fast affects how much of a notebook is read in when opened. If open_fast is set to 1 (the default), pixmaps will not be loaded into memory until needed. If open_fast is set to 0, pixmaps will be
loaded when the notebook is opened.
report_language indicates the format that will be used to print the notebook. 0 = postscript. (1 will indicate HPGL when this is implemented.)
report_graphics_monochrome indicates whether the graphics will be printed in monochrome (1) or color (1). Note: your choice of printer or plotter should affect this value.
report_graphics_destination is a name of a printer or plotter that notebook graphics will be printed on.
report_text_destination is a name of a printer that notebook text will be printed on.
report_footer is a footer to be included in printed reports. default? Currently not used.
report_header is a header to be included in printed reports. default? Currently not used.
use_default_colormap is a boolean flag that indicates whether pixmaps should be displayed using the default colormap or the colormap that they were stored with. The default is 0, so the default colormap is not used.
file_prefix? returns the value of the file_prefix instance variable.
file_prefix= directory_path sets the value of the file_prefix instance variable.
free! frees the notebook object and all of its items. Pixmaps owned by the notebook_data (created by the notebook_data from files) will also be freed.
free_item! frees the current item and updates the
number_of_items and current_item_position. If the item has a pixmap that is owned by the notebook_data (created by the notebook_data from files), it will be freed.
free_items! frees the items in the notebook and reinitializes the number_of_items and current_item_position. Pixmaps owned by the notebook_data (created by the notebook_data from files) will be freed.
insert_first! inserts a new item at the beginning of the items list.
insert_item:position inserts a new empty item at the given position.
insert_last! inserts a new item at the end of the items list.
label: sets the label of the item at the current_item_position.
label? retrieves the label for the current item.
number_of_items? returns the number of items in the notebook.
open! opens the notebook using the current file_prefix. If the open_fast mode is true (default), then pixmaps will not be loaded into memory.
open:file_prefix opens a notebook using the given file_prefix and updates the file_prefix instance variable.
open_fast? returns the value of the open_fast instance variable.
open_fast=1_or_0 sets the value of the open_fast instance variable.
own_pixmap:1_or_0 indicates whether the notebook_data instance has the power to delete the pixmap for the current item. This value will be true (1) if the notebook_data created the pixmap, or permission was given to the notebook_data using this message. Otherwise, the value will be false (0) and the notebook_data will not free the pixmap when the item is freed.
own_pixmap? returns whether the notebook_data has permission to free the pixmap for the current item or not.
pixmap:xpixmap_instance_name sets the pixmap of the item at the current_item_position.
pixmap? retrieves the name of an xpixmap for the current item, if one exists. If no pixmap is available and the pixmap_filename has a value, a pixmap will be created from the file.
pixmap_available? will return true (1) if there is a pixmap associated with the current item (either pixmap or pixmap_filename has a value.)
pixmap_colormap= sets the colormap for the pixmap for the current item. This message is mainly for internal use. This colormap is used when the pixmap is displayed.
pixmap_colormap? returns the name of an xcolormap object, if one exists, for the current item. This is usually set internally, if a colormap is read when the pixmap is read in from file. Then this colormap is used when the pixmap is displayed.
pixmap_filename? returns the filename, if one exists, for the pixmap associated with the current item.
pixmap_filename=name sets the filename for the pixmap associated with the current item. The argument is a filename which is not a full path. If you do not set the filename for a pixmap, a unique name will automatically be generated when the pixmap is saved with the notebook.
pixmap_window? returns the window, if one exists, which is associated with the pixmap for the current_item.
pixmap_window=xwindow_instance_name associates an xwindow with the pixmap for the current_item. This window will be used when the pixmap is saved for colormap and visual information. If no window is associated with a pixmap, the default colormap and visual will be used to save the pixmap.
print_items! displays the items. Intended for debugging purposes.
report! is implemented in this version, but subject to change (for improvements.) This will print the text portion of the notebook, followed by the graphics associated with the notebook.
save! saves the notebook file.
Note: For each item, if there is a pixmap associated with the item, the pixmap will also be saved to a file. If there is no pixmap, but there is a pixmap_filename, the pixmap_filename will still be saved.
save:file_prefix saves the notebook and updates the file_prefix instance variable.
text:string sets the text of the item at the current_item_position.
text? retrieves the text for the current item.
timestamp:string sets the timestamp of the item at the current_item_position.
timestamp? retrieves the timestamp for the current item.
user:string sets the user of the item at the current_item_position.
user? retrieves the user for the current item.
Notebook files use the following format:
#START_HEADER
#FILE_PREFIX: <directory_pathname>
#DATE: (repeat the item structure as much as necessary...)
Note that pixmaps are stored in xwd format. The xwd files
are stored in the directory specified by the file_prefix
instance variable. xwd files have the suffix .xwd.
This would include a setting, in minutes for
autosave (autosave_setting). Autosave could be
activated (autosave_on!) and deactived
(autosave_off!). Also, files can be restored from
the last autosave version (autosave_restore!);
selected_items
We could select an arbitrary set of items (based on
item number). This could be used for selective
printing, etc.
reporting
The notebook (or a selected portion) could be
printed to postscript or HPGL devices.
POSSIBLE FURURE ENHANCEMENTS
autosave mode
SEE ALSO
notebook (metaclass), notebook_item (metaclass), notebook_entry_window (metaclass)
Please send comments and suggestions toconsult@rpi.edu