                    E N D E A V O U R   M A R K   I I

                          V E R S I O N   2.7.3

                        H A C K I N G   G U I D E


                    http://wolfpack.twu.net/Endeavour        

              Copyright (C) 1997-2006 WolfPack Entertainment
                       http://wolfpack.twu.net/


        For contributors, builders, or those interested in the finer
        details behind the scenes; this document details the source
        files with their related purpose in this program along with
        outlines of non-intuitive areas of the code.

        Note: Version represented in this document may be out of date,
        verify version above with actual version of accompanying source.

========
CONTENTS

        * Submitting Changes
	* Endeavour 2 Source Diagram
		o Diagram: Misc Modules
		o Diagram: GTK Additions
		o Diagram: Endeavour 2 Core
		o Diagram: Archiver
		o Diagram: Browser
		o Diagram: Image Browser
		o Diagram: Recycle Bin
		o Diagram: About Dialog
		o Diagram: Archive Info Dialog
		o Diagram: Customize Window
		o Diagram: Device Edit Dialog
		o Diagram: Devices List Window
		o Diagram: Find Window
		o Diagram: MIME Type Edit Dialog
		o Diagram: MIME Types List Window
		o Diagram: Options Window
		o Diagram: Properties Dialog
		o Diagram: Run Dialog
	* Endeavour 2 API Library Source Diagram
	* Utility Program Source Diagram
		o Diagram: Download Front End
		o Diagram: Format Front End
		o Diagram: FSCK Front End
		o Diagram: HEdit
		o Diagram: SysInfo
		o Diagram: ZipTool Front

==================
SUBMITTING CHANGES

	You MUST CONTACT the developers before you even get started on
	any contribution, because the master code may be modified and
	your contributions may not be integratable.

	To contact the authors, see:

	> http://wolfpack.twu.net/contacts.html


==========================
ENDEAVOUR 2 SOURCE DIAGRAM

	This diagram represents the code hierarcy diagram for Endeavour
	2.

	Everything above the Dependencies border are libraries that
	Endeavour 2 depends on and are not in any part of Endeavour 2's
	source.

	This diagram does not depict the Endeavour 2 API library, which
	is not attached to any part of Endeavour 2.


                    +
                    |
        [LIBC and other libraries]---------------+
                    |                            |
         [GLIB/GDK/GTK libraries]                |
                    |                            |         Depdendencies
        ============+============================+======================
                    |                            |           Endeavour 2
             [GTK Additions]              [Misc modules]
                    |                            |
                    +-------------+--------------+
                                  |
                           [Endeavour 2 Core]
                                  |
            +----------+----------+-+--------------+----------+
            |          |            |              |          |
        [Archiver] [Browser] [Image Browser] [Recycle Bin]    |
                                                              |
                      [About Dialog, Find Win, Properties Dialog, etc]


---------------------
Diagram: Misc Modules

	In $TOPLEVEL/endeavour2/:

	These are modules that provide various functionality to
	Endeavour 2 below the GTK+/GDK+/GLib level.

	disk.cpp		Path utility functions (ie directory
				listing).

	fio.cpp			Low-level file IO.

	gif.c			GIF image data opening using libgif, for
				opening gifs with multiple frames so that
				they can be displayed animated. See
				also; rgba_to_cidx.c

	rgba_to_cidx.c		RGBA image data dithering to
				colored-index. See also; gif.c

	prochandle.cpp		Low-level process running.

	string.cpp		String and string list manipulation.

	tga.cpp			Targa image format opening and saving
				to file. See also; tgadither.cpp

	tgadither.cpp		Targa image dithering functions. See
				also; tga.cpp.


----------------------
Diagram: GTK Additions

	In $TOPLEVEL/endeavour2/:

	These are modules that create additional functionality with
	GTK+ that greatly practicalizes the way Endeavour 2 uses GTK+
	but are not designed in a way that is specific so that only
	Endeavour 2 can use them.

	They include; guiutils.c which provide utility functions for
	GTK+, fb.c which is an enhanced file selector, tlist.c which is
	a thumbs list that Endeavour's Image Browser uses (or any other
	application can use), and many more

	cdialog.c		Confirmation dialog, a dialog that
				appears and pushes a GTK+ main loop
				that prompts the user for a response
				and returns the response code to the
				calling function.

	cfg.c			Configuration items & lists management.
				See edv_cfg_list.h for the list of
				defined items.
	cfg_fio.c		Configuration file opening and saving.

	conmsg.c		Console Message Display dialog, displays
				stdout and stderr in a dialog.

	csd.c			Color Selector dialog, a dialog that
				appears and pushes a GTK+ main loop
				that prompts the user for a color and
				returns the selected color to the
				calling function.

	desktop_icon.c		Desktop icon, for creating icons on the
				desktop that can be moved around and
				map a window when double clicked (used
				for Endeavour's Recycle Bin Desktop
				Icon).

	editclist.c		Editable GtkCList, has cells that you
				can easilly edit. See also; fprompt.c

	fb.c			File Selector dialog (improved over
				GTK+'s default file selector). A dialog
				that appears and pushes a GTK+ main loop
				and prompts the user to select objects
				and returns the selected object path(s)
				to the calling function. See also;
				cdialog.c, fprompt.c, pulist.c

	fprompt.c		Floating prompt, a prompt that can
				appear over any window with a GtkEntry
				that the user can enter text in.

	fsd.c			Font Selector dialog, a dialog that
				appears and pushes a GTK+ main loop
				and prompts the user to select a font
				and returns the selected font to the
				calling function.

	guiutils.c		GTK+ and GDK+ utility functions.

	guifullscreen.c		Fullscreen & Video Mode changing.

	guirgbimg.c		RGBA image buffer copy area, resize,
				rotate, mirror, flatten alpha and
				get from GdkDrawable.

	imgview.c		Image Viewer, displays an image that
				the user can conviently pan and zoom
				when viewing it.
	imgviewcrop.c		Image Viewer cropping, extends the
				functionality to the Image Viewer to
				crop images.

	keymap_list.c		Keymap List, used for editing accelerator
				keys and other key mappings.

	pdialog.c		Prompt dialog, a dialog that appears and
				pushes a GTK+ main loop and prompts the
				uesr with a variety of prompts and
				returns the selected values to the
				calling function.

	pie_chart.c		Pie Chart, displays a pie chart with a
				one or more different slices.

	presentation_mode.c	Presentation Mode (fullscreen slideshow).

	progressdialog.c	Progress dialog, a dialog that appears
				and displays the progress of an
				operation.

	pulist.c		Popup List, a widget that looks similar
				to the GtkCombo (a display and a map
				button) that displays a popup list when
				clicked.

	stacklist.c		Stack List, two GtkCLists that is used
				for editing a list of items from an
				available list of items (used for
				editing Tool Bars and Contents List
				in Endeavour's Customize Window).

	style_edit.c		GTK+ Style Editor, displays GtkStyle
				settings and allows for easy visual
				editing of GtkStyles.

	tlist.c			Thumbs List, displays a list of small
				images in a variety of customizable
				arrangements (used for Endeavour's
				Image Browser).

	toolbar.c		Tool Bar, a horizontal bar with buttons.

	url.c			URL parsing, includes encoding and
				decoding to/from buffer.


-------------------------
Diagram: Endeavour 2 Core

        In $TOPLEVEL/endeavour2/:

        This is the source directory for the primary program.


	archive_options_dlg.c	Archive adding and extracting options
				dialog.

	compiletimeinfo.h	Generated by the Makefile, contains
				information about the compiler and
				related values of interest.

	config.h		Compile time master configuration for this
				program. Contains definations for program
				name, version, language, copyright, and
				help messages.

	edv_archive_add.c	Create archives and add object(s) to an
				archive.
	edv_archive_chk.c	Check archives.
	edv_archive_cmt.c	Set/get archive comments.
	edv_archive_delete.c	Delete object(s) from an archive.
	edv_archive_extract.c	Extract object(s) from an archive.
	edv_archive_fix.c	Fix archives.
	edv_archive_obj.c	Endeavour archive object structure.
	edv_archive_stat.c	Get the stats of object(s) in archives.

	edv_cb.c		Endeavour core callbacks and signal emitters.
	edv_cfg_list.h		List of configuration parameters used by
				Endeavour.
	edv_confirm.c		Endeavour confirmation dialog mapping and
				querying, uses the confirmation dialog
				(cdialog.c).
	edv_core.c		Endeavour core creation, management, and
				deletion. See also; main.c
	edv_cursor.c		Endeavour cursor.
	edv_date.c		Date formatting.
	edv_device.c		Endeavour Device.
	edv_device_mount.c	Device mounting, unmounting, and ejecting.
	edv_devices_list.c	Devices list file opening & saving.
	edv_find.c		Find objects.
	edv_find_bar.c		Endeavour Find Bar creation, management,
				and deletion.
	edv_generic_options_win.c	Generic options window, used for
					the Customize Window and Options
					Window. See also; customize_win.c
					and options_win.c
	edv_generic_options_win_op.c	Get/set configuration values
					from/to the generic options window.

	edv_help.c		Help displaying.
	edv_history.c		Endeavour history item.
	edv_id.c		Endeavour user and group IDs.

	edv_interps.c		Endeavour InterPS (Inter Process) lock link
				and command sending & fetching.
	edv_interps_op.c	Endeavour InterPS command processing.

	edv_list_cb.c		Standard callbacks for the GtkCList and
				Thumbs List (primarly for keyboard and
				pointer scrolling).
	edv_list_seek.c		Matches character to a GtkCList row or
				Thumbs List thumb who's value starts with
				that character.
	edv_mime_type.c		Endeavour MIME Type.
	edv_mime_types_list.c	MIME Types list file opening & saving.
	edv_mime_types_mailcap.c	Mailcap file importing/exporting.
	edv_mime_typesfiomediatypes.c	Media Types importing/exporting
					to/from file.
	edv_mount_bar.c		Endeavour mount bar creation, management,
				deletion, and callbacks.
	edv_obj.c		Endeavour object.
	edv_obj_create.c	Create objects.
	edv_obj_op.c		Link, move, copy, rename, chmod, chown,
				and chtime objects.

	edv_op.c		Endeavour core operations.
	edv_open.c		Object opening by MIME Type matching and
				running an application.
	edv_open_cb.c		Open callback. See also;
				edv_open_to_menu.c
	edv_open_to_menu.c	Open To menu creation. See also;
				edv_open_cb.c
	edv_pixmap.c		Endeavour pixmaps, used for sharing pixmaps
				that are used internally.
	edv_recbin_delete.c	Deleting an object into the Recycle Bin.
	edv_recbin_index.c	Recycle Bin index, for listing recycled
				objects in the Recycle Bin.
	edv_recbin_purge.c	Purging recycled objects in the Recycle Bin.
	edv_recbin_recover.c	Recovering recycled objects from the
				Recycle Bin.
	edv_recbin_stat.c	Get the stats of recycled objects in the
				Recycle Bin.
	edv_recbin_sync.c	Checking and repairing the Recycle Bin.
	edv_recycled_obj.c	Endeavour recycled object.
	
	edv_status_bar.c	Endeavour Status Bar.
	edv_types.h		Endeavour data types.
	edv_utils.c		Endeavour utility functions (that do not
				require GTK+).
	edv_utils_gtk.c		Endeavour GTK+ utility functions.
	endeavour.h		Endeavour core header file.
	main.c			Legacy main() function.
	mime_type_import_options_dlg.c	MIME Type import (from other file
				formats) options dialog.
	obj_op_dlg.c		Object operations dialog, for linking,
				moving, copying, chmod, and chowning
				objects. See also; edv_obj_op.c

-----------------
Diagram: Archiver

	archiver.c		Archiver creation, modification, and
				deletion.
	archiver_cb.c		Archiver general callbacks.
	archiver_contents_list.c	Archiver contents GtkCList management.
	archiver_dnd.c		Archiver drag & drop callbacks and
				procedures.
	archiver_op_cb.c	Archiver operation callbacks and
				procedures.

----------------
Diagram: Browser

	browser.c		File Browser creation, modification, and
				deletion.
	browser_cb.c		File Browser general callbacks.
	browser_contents_list.c	File Browser contents GtkCList management.
	browser_dir_tree.c	File Browser directory GtkCTree management.
	browser_dnd.c		File Browser drag & drop callbacks and
				procedures.
	browser_op_cb.c		File Browser operation callbacks and
				procedures.

----------------------
Diagram: Image Browser

	imbr.c			Image Browser creation, management, and
				deletion.
	imbr_cb.c		Image Browser general callbacks.
	imbr_dnd.c		Image Browser drag & drop callbacks and
				procedures.
	imbr_imgview.c		Image Browser image viewer management.
	imbr_op_cb.c		Image Browser operations callbacks and
				procedures.
	imbr_tlist.c		Image Browser thumbs list management.

--------------------
Diagram: Recycle Bin

	recbin.c		Recycle Bin creation, management, and
				deletion.
	recbin_cb.c		Recycle Bin general callbacks.
	recbin_contents_list.c	Recycle Bin contents list management.
	recbin_desktop_icon.c	Recycle Bin desktop icon creation,
				management, deletion, and callbacks.
				Note that this module does not depend on
				the other recbin*.c modules. See also;
				desktop_icon.c
	recbin_dnd.c		Recycle Bin drag & drop callbacks and
				procedures.
	recbin_op_cb.c		Recycle Bin operation callbacks and
				procedures.

---------------------
Diagram: About Dialog

	about_dlg.c		About Dialog creation, modification, and
				deletion.

----------------------------
Diagram: Archive Info Dialog

	archive_info_dlg.c	Archive information dialog.

-------------------------
Diagram: Customize Window

	customize_win.c		Creates the Customize window creation,
				modification, and deletion. See also;
				edv_generic_options_win.c
	customize_win_archiver.c	Creates the Archiver page for the
					Customize window.
	customize_win_browser.c	Creates the File Browser page for the
				Customize window.
	customize_win_imbr.c	Creates the Image Browser page for the
				Customize window.
	customize_win_recbin.c	Creates the Recycle Bin page for the
				Customize window.

---------------------------
Diagram: Device Edit Dialog

	device_edit_dlg.c	Device edit dialog creation, modification,
				deletion, and callbacks. See also;
				devices_list_win.c

----------------------------
Diagram: Devices List Window

	devices_list_win.c	Devices list window creation, modification,
				deletion, and callbacks. See also;
				device_edit_dlg.c

--------------------
Diagram: Find Window

	find_win.c		Find objects window creation, management,
				and deletion.
	find_win_cb.c		Find objects window general callbacks.

------------------------------
Diagram: MIME Type Edit Dialog

	mime_type_edit_dlg.c	MIME Type edit dialog creation, management,
				deletion, and callbacks. See also;
				mime_types_list_win.c

-------------------------------
Diagram: MIME Types List Window

	mime_types_list_win.c	MIME Types list window creation, management,
				deletion, and callbacks. See also;
				mime_type_edit_dlg.c

-----------------------
Diagram: Options Window

	options_win.c		Options window creation, management, and
				deletion. See also edv_generic_options_win.c

--------------------------
Diagram: Properties Dialog

	prop_dlg.c		Properties Dialog creation, management,
				deletion, and callbacks.

-------------------
Diagram: Run Dialog

	run_dlg.c		Run Dialog creation, management, delection,
				and callbacks.


======================================
ENDEAVOUR 2 API LIBRARY SOURCE DIAGRAM

	This library allows third party programs to communicate with
	any running process of Endeavour 2.

	The third party program must use GLib (but GTK+ and GDK+ are
	optional) in order to be able to link to and use the
	Endeavour 2 API library.

	            +
	            |
	[LIBC and other libraries]-----------+
	            |                        |
	 [GLIB/GDK/GTK libraries]            |
	            |                        |             Depdendencies
	============+========================+==========================
	            |                        |   Endeavour 2 API Library
	     [GTK Additions]          [Misc modules]
	            |                        |
	            +-----------+------------+
	                        |
	            [Endeavour 2 API Library]


        In $TOPLEVEL/endeavour2/lib/:

        compiletimeinfo.h       Generated by the Makefile, contains
                                information about the compiler and
                                related values of interest.

        config.h                Compile time configuration for this
                                program. Contains definations for program
                                name, version, language, copyright, and
                                help messages. Some are inherited from
                                ../config.h.

	cfg.c			Same as ../cfg.h

	edv_cfg_list.h		Same as ../edv_cfg_list.h

	edv_context.c		Endeavour 2 API context.

        edv_device.c		Endeavour Device.
	edv_device_get.c	Endeavour 2 API Device querying & fetching.
        edv_devices_list.c	Endeavour devices list file opening & saving.

	edv_get.c		Endeavour 2 API configuration value fetching.

	edv_help.c		Endeavour 2 API help displaying.

	edv_history.c		Endeavour 2 API History event logging.

	edv_message.c		Endeavour 2 API message and sound output.

	edv_mime_type.c		Endeavour MIME Type.
	edv_mime_type_get.c	Endeavour 2 API MIME Type querying &
				fetching.
	edv_mime_type_install.c	Endeavour 2 API MIME Type installing.
	edv_mime_types_list.c	Endeavour MIME Types list file opening &
				saving.

	edv_notify.c		Endeavour 2 API notifies the running
				Endeavour process about external events,
				such as disk object add, modify, and
				removal events.

	edv_open.c		Endeavour 2 API object opening.

	edv_recycle.c		Endeavour 2 API object recycling.

	edv_types.h		Same as ../edv_types.h

	edv_utils.h		Same as ../edv_utils.h

	edv_window.c		Instructs a running Endeavour process to
				create a new window such as a file
				browser or Image Browser.

	endeavour2-config.c	Endeavour 2 API configuration reporter,
				for reporting source-related information
				to the compiler at compile time.

---------------------
Endeavour 2 API Demos

	These are a set of demo programs that use the Endeavour 2 API
	library and demostrate its usage.

        In $TOPLEVEL/endeavour2/lib/demos/:

	devices.c		Lists devices and their stats and
				mounts, unmounts, and ejects devices.

	helloworld.c		Basic demostration of how to create
				an Endeavour 2 API Context, initialize
				it, and map Endeavour 2's About dialog.

	history.c		Appends a history item to Endeavour 2's
				history list.

	mimetypeinstall.c	Installs a MIME Type. See also;
				mimetypeinstall.scp
	mimetypeinstall.scp	Calls the mimetypeinstall demo to
				install a MIME Type of type
				"text/x-plain". See also;
				mimetypeinstall.c

	mimetypes.c		Lists MIME Types or matches a MIME Type
				from a specified path.

	notify.c		Notifies Endeavour 2 of when a new
				object has been added, modified, or
				removed.

	open.c			Opens an object from a specified path
				by matching that object with Endeavour
				2's MIME Types list and then performing
				the action defined by that MIME Type
				(ie executing a program and instructing
				it to open the specified object).

	params.c		Get a configuration value from Endeavour
				2's configuration list.

	properties.c		Displays the properties of an object
				using Endeavour 2's Properties dialog.

	purge.c			Purges a recycled object from Endeavour
				2's Recycle Bin.

	recover.c		Recovers a recycled object from
				Endeavour 2's Recycle Bin.

	recycle.c		Recycles an object and puts it into
				Endeavour 2's Recycle Bin.

	rls.c			Lists the contents of Endeavour 2's
				Recycle Bin.


==============================
UTILITY PROGRAM SOURCE DIAGRAM

	Endeavour 2 comes with a set of utility programs that run
	separately from Endeavour 2 (but still interact with it).


	                   [Endeavour 2 Core]
	                           |                         Endeavour 2
	===========================+====================================
	                           |                    Utility Programs
	+--------------------------+
	|
	+---[Download Front End]
	|
	+---[Format Front End]
	|
	+---[FSCK Front End]
	|
	+---[HEdit]
	|
	+---[SysInfo]
	|
	+---[Zip Tool Front End]


---------------------------
Diagram: Download Front End

	In $TOPLEVEL/endeavour2/download.front/:

        compiletimeinfo.h       Generated by the Makefile, contains
                                information about the compiler and
                                related values of interest.

        config.h                Compile time configuration for this
                                program. Contains definations for program
                                name, version, language, copyright, and
                                help messages. Some are inherited from
                                ../config.h.

	downloadcfgio.c		Download configuration file opening and
				saving.

	main.c			Legacy main() function. Parses input,
				maps the download progress dialog,
				calls download program, and manages the
				download process until it is finished or
				aborted by the user.

-------------------------
Diagram: Format Front End

	In $TOPLEVEL/endeavour2/format.front/:

        compiletimeinfo.h       Generated by the Makefile, contains
                                information about the compiler and
                                related values of interest.

        config.h                Compile time configuration for this
                                program. Contains definations for program
                                name, version, language, copyright, and
                                help messages. Some are inherited from
                                ../config.h.

	formatcb.c		Format Manager window callbacks.

	formatmanager.c		Format Manager window creating,
				management, and deleting.

	main.c			Legacy main() function. Creates a Format
				Manager window and manages it until it
				is closed.


-----------------------
Diagram: FSCK Front End

	In $TOPLEVEL/endeavour2/fsck.front/:

        compiletimeinfo.h       Generated by the Makefile, contains
                                information about the compiler and
                                related values of interest.

	config.h		Compile time configuration for this
				program. Contains definations for program
				name, version, language, copyright, and
				help messages. Some are inherited from
				../config.h.

	fsckcb.c		FSCK Manager window callbacks.

	fsckmanager.c		FSCK Manager window creating,
				management, and deleting.

        main.c			Legacy main() function. Creates an FSCK
				Manager window and manages it until it
				is closed.

--------------
Diagram: HEdit

	A hex editor with cut, copy, paste, insert, and delete features.

	In $TOPLEVEL/endeavour2/hedit/:

        compiletimeinfo.h       Generated by the Makefile, contains
                                information about the compiler and
                                related values of interest.

        config.h                Compile time configuration for this
                                program. Contains definations for program
                                name, version, language, copyright, and
                                help messages. Some are inherited from
                                ../config.h.

	ascii_chart_dlg.c	A dialog displaying the ASCII hex values
				and their printed character equivilents.

	hview.c			HexView creating, management, and
				deleting.

	hviewcb.c		HexView callbacks.

	main.c			Legacy main() function. Creates a
				HexView window and manages it until it
				is closed.

----------------
Diagram: SysInfo

	A small graphical display of the CPU usage.

	In $TOPLEVEL/endeavour2/sysinfo/:


	main.c			Legacy main() function. Creates the
				SysInfo window and manages it until
				it is closed.

	sysinfowin.c		SysInfo window creating, managment,
				and deleting.

---------------------------
Diagram: Zip Tool Front End

	A graphical front end for the ziptool program, for controlling
	IOMega ZIP Drives.

        In $TOPLEVEL/endeavour2/ziptool.front/:

        compiletimeinfo.h       Generated by the Makefile, contains
                                information about the compiler and
                                related values of interest.

        config.h                Compile time configuration for this
                                program. Contains definations for program
                                name, version, language, copyright, and
                                help messages. Some are inherited from
                                ../config.h.

        main.c                  Legacy main() function. Creates the
				Zip Tool window and manages it until
				it is closed.

	ziptools.c		Zip Tools window creating, management,
				and deleting.

	ziptoolscb.c		Zip Tools window callbacks.

	ziptoolsio.c		IO functions for the ziptool program.


                                                       =================
                                                       ENDEAVOUR MARK II
