[graphic-forms-cvs] r202 - in trunk: docs/manual src/uitoolkit/system

junrue at common-lisp.net junrue at common-lisp.net
Tue Aug 8 05:47:30 UTC 2006


Author: junrue
Date: Tue Aug  8 01:47:29 2006
New Revision: 202

Modified:
   trunk/docs/manual/api.texinfo
   trunk/src/uitoolkit/system/system-types.lisp
   trunk/src/uitoolkit/system/user32.lisp
Log:
further work towards supporting icon display

Modified: trunk/docs/manual/api.texinfo
==============================================================================
--- trunk/docs/manual/api.texinfo	(original)
+++ trunk/docs/manual/api.texinfo	Tue Aug  8 01:47:29 2006
@@ -2020,11 +2020,76 @@
 @end deffn
 @end deftp
 
+ at anchor{icon-bundle}
+ at deftp Class icon-bundle
+This class encapsulates a collection of Win32 icon handles.
+Icons are used to decorate @ref{window} title bars, to represent
+a file or application on the desktop, to represent an application
+in the @code{<Alt><Tab>} task switching dialog, and in the
+Windows Start menu. See the @samp{Icons in Win32} topic of the MSDN
+documentation for further discussion of standard icon sizes, color
+depths and file format. @code{icon-bundle} derives from @ref{native-object}.
+ at deffn Initarg :file
+This initarg accepts a @sc{cl:pathname} identifying a file
+with @ref{image-data} to be loaded, as described for the @ref{image}
+class @code{:file} initarg. Note that the @sc{.ico} format can
+store multiple icons, all of which will be loaded. Since
+ at code{icon-bundle} needs a transparency mask for each image in
+order to create Windows icons, a value may be supplied for the
+ at code{:transparency-pixel} initarg of this class to select the
+proper transparency @ref{color}; by default, the pixel color at
+ at code{(0, 0)} in each image will be used. @emph{FIXME: link to
+documentation of graphics plugins here}.
+ at end deffn
+ at deffn Initarg :images
+This initarg accepts a @sc{cl:list} of image objects. Since
+ at code{icon-bundle} needs a transparency mask for each image in
+order to create Windows icons, the application may either @sc{setf}
+ at ref{transparency-pixel} for each image ahead of time (especially
+important when the pixel location is different from one image
+to the next), or provide a value for the @code{:transparency-pixel}
+initarg of this class; or else by default, the pixel color at
+ at code{(0, 0)} in each image will be used.
+ at end deffn
+ at deffn Initarg :system
+This initarg causes the @code{icon-bundle} to be loaded with a
+system-provided standard icon, identified by one of the following
+constants:
+ at table @code
+ at item +application-icon+
+Default application icon.
+ at item +error-icon+
+Icon for error notifications.
+ at item +information-icon+
+Icon for informational notifications.
+ at item +question-icon+
+Icon to be used when prompting the user for more input.
+ at item +warning-icon+
+Icon for warning notifications.
+ at end table
+ at end deffn
+ at deffn Initarg :transparency-pixel
+This initarg is similar in purpose to the same initarg for
+the image class, except that in this case the specified @ref{point}
+applies to all images (except pre-defined system icons)
+encapsulated by the @code{icon-bundle} object.
+ at end deffn
+ at end deftp
+
 @anchor{image}
- at deftp Class image
-This subclass of @ref{native-object} wraps a native image object.
-Instances may be drawn directly via a graphics-context (see
- at ref{draw-image}) or set as the content of a @ref{label} control.
+ at deftp Class image transparency-pixel
+This subclass of @ref{native-object} wraps a Win32 bitmap handle.
+Instances may be drawn using @ref{draw-image} or displayed within
+certain @ref{control}s such as a @ref{label}. Images may originate
+from a variety of formats. @emph{FIXME: link to documentation
+of graphics plugins here}.
+ at table @var
+ at anchor{transparency-pixel}
+ at item transparency-pixel
+This slot holds a @ref{point} that identifies a pixel within the
+image whose color will be used by @ref{transparency-mask}.
+ at xref{with-image-transparency}.
+ at end table
 @deffn Initarg :file
 Supply a path to a file containing image data to be loaded.
 @end deffn
@@ -2036,9 +2101,28 @@
 @end deftp
 
 @anchor{image-data}
- at deftp Class image-data
-This subclass of @ref{native-object} maintains image attributes,
-color, and pixel data. @xref{image}.
+ at deftp Class image-data data-plugin
+This class represents an image in an external format. Such formats
+may be loaded (via the @ref{load} method) and then converted to an
+ at ref{image} object by the @ref{data-object} @sc{setf} function.@*@*
+ at code{image-data} serves as an integration point between Graphic-Forms
+and third-party graphics libraries such as ImageMagick. @emph{FIXME:
+link to documentation of graphics plugins here}.
+ at table @var
+ at item data-plugin
+This slot holds a subclass of @ref{image-data-plugin} encapsulating
+format and functionality from a particular third-party graphics library.
+Many of the features offered by @code{image-data} are delegated to
+this plugin object.
+ at end table
+ at end deftp
+
+ at anchor{image-data-plugin}
+ at deftp Class image-data-plugin
+This is a base class for plugin objects that encapsulate third-party
+library representations of images. @emph{FIXME:
+link to documentation of graphics plugins here}. It derives from
+ at ref{native-object}.
 @end deftp
 
 @node graphics functions
@@ -2053,6 +2137,7 @@
 Returns a color object corresponding to the current background color.
 @end deffn
 
+ at anchor{data-object}
 @deffn GenericFunction data-object self &optional gc => object
 Returns the data structure representing the raw data form of the
 object.  The @code{gc} argument must be supplied when calling this
@@ -2261,6 +2346,7 @@
 Returns a color object corresponding to the current foreground color.
 @end deffn
 
+ at anchor{load}
 @deffn GenericFunction load self path => list
 Certain graphics objects have a persistent representation, which may
 be deserialized with the appropriate implementation of this function.
@@ -2296,8 +2382,16 @@
 @end table
 @end deffn
 
- at deffn GenericFunction transparency-mask self
+ at anchor{transparency-mask}
+ at deffn GenericFunction transparency-mask self => @ref{image}
 Returns an image object that will serve as the transparency mask for
 the original image, based on the original image's assigned
 transparency.
 @end deffn
+
+ at anchor{with-image-transparency}
+ at defmac with-image-transparency (image point) &body body
+This macro wraps @var{body} in an @sc{unwind-protect} form with
+ at var{point} set as the @ref{transparency-pixel} for @var{image}.
+Any existing point set in @var{image} is restored.
+ at end defmac

Modified: trunk/src/uitoolkit/system/system-types.lisp
==============================================================================
--- trunk/src/uitoolkit/system/system-types.lisp	(original)
+++ trunk/src/uitoolkit/system/system-types.lisp	Tue Aug  8 01:47:29 2006
@@ -167,6 +167,15 @@
   (hookfn     LPTR) ; FIXME: not yet used, but eventually should be FRHookProc
   (templname  :string))
 
+(defcstruct iconinfo
+  (flag       BOOL)
+  (hotspotx   DWORD)
+  (hotspoty   DWORD)
+  (maskbm     HANDLE)
+  (colorbm    HANDLE))
+
+(defctype iconinfo-pointer :pointer)
+
 (defcstruct initcommoncontrolsex
   (size DWORD)
   (icc DWORD))

Modified: trunk/src/uitoolkit/system/user32.lisp
==============================================================================
--- trunk/src/uitoolkit/system/user32.lisp	(original)
+++ trunk/src/uitoolkit/system/user32.lisp	Tue Aug  8 01:47:29 2006
@@ -72,6 +72,11 @@
   (ch UINT))
 
 (defcfun
+  ("CreateIconIndirect" create-icon-indirect)
+  HANDLE
+  (iconinfo iconinfo-pointer))
+
+(defcfun
   ("CreateMenu" create-menu)
   HANDLE)
 
@@ -124,6 +129,11 @@
   (lp LPARAM))
 
 (defcfun
+  ("DestroyIcon" destroy-icon)
+  BOOL
+  (hicon HANDLE))
+
+(defcfun
   ("DestroyMenu" destroy-menu)
   BOOL
   (hwnd HANDLE))
@@ -487,6 +497,12 @@
   (name LPTR)) ; LPTR to make it easier to pass constants like +obm-checkboxes+
 
 (defcfun
+  ("LoadIconA" load-icon)
+  HANDLE
+  (instance HANDLE)
+  (name LPCTSTR))
+
+(defcfun
   ("LoadImageA" load-image)
   HANDLE
   (instance HANDLE)



More information about the Graphic-forms-cvs mailing list