[graphic-forms-cvs] r401 - in trunk: docs/manual src src/tests/uitoolkit src/uitoolkit/graphics src/uitoolkit/graphics/plugins/default src/uitoolkit/widgets

junrue at common-lisp.net junrue at common-lisp.net
Fri Nov 24 22:44:50 UTC 2006


Author: junrue
Date: Fri Nov 24 17:44:47 2006
New Revision: 401

Modified:
   trunk/docs/manual/constants.xml
   trunk/docs/manual/gfg-symbols.xml
   trunk/docs/manual/gfs-symbols.xml
   trunk/docs/manual/gfw-symbols.xml
   trunk/src/packages.lisp
   trunk/src/tests/uitoolkit/image-tester.lisp
   trunk/src/uitoolkit/graphics/graphics-constants.lisp
   trunk/src/uitoolkit/graphics/icon-bundle.lisp
   trunk/src/uitoolkit/graphics/image-data.lisp
   trunk/src/uitoolkit/graphics/plugins/default/default-data-plugin.lisp
   trunk/src/uitoolkit/widgets/widget-classes.lisp
Log:
cursor documentation

Modified: trunk/docs/manual/constants.xml
==============================================================================
--- trunk/docs/manual/constants.xml	(original)
+++ trunk/docs/manual/constants.xml	Fri Nov 24 17:44:47 2006
@@ -8,15 +8,21 @@
   <indexterm><primary>constants</primary></indexterm>
 
   <para role="normal">
-    This section lists the symbols for constants and variables exported from
-    each package.
+    This section lists the symbols for the constants and variables that help
+    comprise the public API.
   </para>
 
-  <bridgehead renderas="sect2">Character Sets [GFG]</bridgehead>
-
-  <informaltable frame="none">
+  <bridgehead renderas="sect2">
+    Character Sets [GFG]
     <anchor id="character sets"/>
     <indexterm><primary>character sets</primary></indexterm>
+  </bridgehead>
+
+  <para role="normal">
+    Character set constants to be used when requesting fonts.
+  </para>
+
+  <informaltable frame="none">
     <tgroup cols="1">
       <tbody>
         <row><entry><para role="normal">+ansi-charset+</para></entry></row>
@@ -43,11 +49,17 @@
     </tgroup>
   </informaltable>
 
-  <bridgehead renderas="sect2">Standard Colors [GFG]</bridgehead>
-
-  <informaltable frame="none">
+  <bridgehead renderas="sect2">
+    Standard Colors [GFG]
     <anchor id="colors"/>
     <indexterm><primary>colors</primary></indexterm>
+  </bridgehead>
+
+  <para role="normal">
+    Predefined color constants.
+  </para>
+
+  <informaltable frame="none">
     <tgroup cols="1">
       <tbody>
         <row><entry><para role="normal">*color-black*</para></entry></row>
@@ -59,11 +71,48 @@
     </tgroup>
   </informaltable>
 
-  <bridgehead renderas="sect2">System Icons [GFG]</bridgehead>
+  <bridgehead renderas="sect2">
+    System Cursors [GFG]
+    <indexterm><primary>system cursors</primary></indexterm>
+    <anchor id="system cursors"/>
+  </bridgehead>
+
+  <para role="normal">
+    Constants identifying predefined cursors.
+  </para>
 
   <informaltable frame="none">
+    <tgroup cols="1">
+      <tbody>
+        <row><entry><para role="normal">+app-starting-cursor+</para></entry></row>
+        <row><entry><para role="normal">+crosshair-cursor+</para></entry></row>
+        <row><entry><para role="normal">+default-cursor+</para></entry></row>
+        <row><entry><para role="normal">+hand-cursor+</para></entry></row>
+        <row><entry><para role="normal">+help-cursor+</para></entry></row>
+        <row><entry><para role="normal">+ibeam-cursor+</para></entry></row>
+        <row><entry><para role="normal">+no-cursor+</para></entry></row>
+        <row><entry><para role="normal">+size-all-cursor+</para></entry></row>
+        <row><entry><para role="normal">+size-nesw-cursor+</para></entry></row>
+        <row><entry><para role="normal">+size-ns-cursor+</para></entry></row>
+        <row><entry><para role="normal">+size-nwse-cursor+</para></entry></row>
+        <row><entry><para role="normal">+size-we-cursor+</para></entry></row>
+        <row><entry><para role="normal">+up-arrow-cursor+</para></entry></row>
+        <row><entry><para role="normal">+wait-cursor+</para></entry></row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
+  <bridgehead renderas="sect2">
+    System Icons [GFG]
     <anchor id="system icons"/>
     <indexterm><primary>system icons</primary></indexterm>
+  </bridgehead>
+
+  <para role="normal">
+    Constants identifying predefined icons.
+  </para>
+
+  <informaltable frame="none">
     <tgroup cols="1">
       <tbody>
         <row><entry><para role="normal">+application-icon+</para></entry></row>
@@ -75,11 +124,17 @@
     </tgroup>
   </informaltable>
 
-  <bridgehead renderas="sect2">Virtual Key Codes [GFW]</bridgehead>
-
-  <informaltable frame="none">
+  <bridgehead renderas="sect2">
+    Virtual Key Codes [GFW]
     <anchor id="virtual key codes"/>
     <indexterm><primary>virtual key codes</primary></indexterm>
+  </bridgehead>
+
+  <para role="normal">
+    Device-independent keyboard codes.
+  </para>
+
+  <informaltable frame="none">
     <tgroup cols="1">
       <tbody>
         <row><entry><para role="normal">+vk-break+</para></entry></row>
@@ -146,6 +201,25 @@
     </tgroup>
   </informaltable>
 
+  <bridgehead renderas="sect2">
+    Widget Defaults [GFW]
+    <anchor id="widget defaults"/>
+    <indexterm><primary>widget defaults</primary></indexterm>
+  </bridgehead>
+
+  <para role="normal">
+    Constants providing defaults for various widget attributes such as size.
+  </para>
+
+  <informaltable frame="none">
+    <tgroup cols="1">
+      <tbody>
+        <row><entry><para role="normal">+default-widget-height+</para></entry></row>
+        <row><entry><para role="normal">+default-widget-width+</para></entry></row>
+      </tbody>
+    </tgroup>
+  </informaltable>
+
   <para role="normal"/>
 
 </chapter>

Modified: trunk/docs/manual/gfg-symbols.xml
==============================================================================
--- trunk/docs/manual/gfg-symbols.xml	(original)
+++ trunk/docs/manual/gfg-symbols.xml	Fri Nov 24 17:44:47 2006
@@ -17,6 +17,51 @@
 
   <!-- CLASSES -->
 
+  <class name="cursor">
+    <description>
+      <hierarchy>
+        <inherits>
+          <reftopic>gfs:native-object</reftopic>
+        </inherits>
+      </hierarchy>
+      This class encapsulates a native cursor handle. A cursor is an image whose
+      screen location is determined by a pointing device; when the user moves the
+      pointing device, the system changes the location of the cursor image to
+      match.
+    </description>
+    <initargs>
+      <argument name=":handle">
+        <description>
+          See <reftopic>gfs:native-object</reftopic>.
+        </description>
+      </argument>
+      <argument name=":file">
+        <description>
+          Specifies a <refclhs>pathname</refclhs> for a file containing cursor image
+          data.
+        </description>
+      </argument>
+      <argument name=":image">
+        <description>
+          Specifies a <reftopic>gfg:image</reftopic> whose data will be copied and
+          transformed into a cursor.
+        </description>
+      </argument>
+      <argument name=":system">
+        <description>
+          Identifies the cursor to be displayed. See <reftopic>system cursors</reftopic>
+          for a list of cursor identifiers.
+        </description>
+      </argument>
+    </initargs>
+    <seealso>
+      <reftopic>gfw:with-wait-cursor</reftopic>
+      <reftopic>gfw:set-cursor</reftopic>
+      <reftopic>gfw:show-cursor</reftopic>
+      <reftopic>gfw:cursor-of</reftopic>
+    </seealso>
+  </class>
+
   <class name="font">
     <description>
       <hierarchy>
@@ -778,6 +823,7 @@
       If <arg2/> and <arg3/> are the same, a complete ellipse is drawn.
     </description>
     <seealso>
+      <reftopic>colors</reftopic>
       <reftopic>gfg:draw-pie-wedge</reftopic>
       <reftopic>gfg:draw-filled-pie-wedge</reftopic>
       <reftopic>gfg:foreground-color</reftopic>
@@ -1696,6 +1742,7 @@
       interior of closed shapes.
     </description>
     <seealso>
+      <reftopic>colors</reftopic>
       <reftopic>gfg:foreground-color</reftopic>
       <reftopic>gfg:graphics-context</reftopic>
     </seealso>

Modified: trunk/docs/manual/gfs-symbols.xml
==============================================================================
--- trunk/docs/manual/gfs-symbols.xml	(original)
+++ trunk/docs/manual/gfs-symbols.xml	Fri Nov 24 17:44:47 2006
@@ -433,6 +433,7 @@
   <function name="create-rectangle">
     <syntax>
       <arguments>
+        <notarg name="&key"/>
         <argument name=":x">
           <description>
             An <refclhs>integer</refclhs> specifying the X coordinate of the

Modified: trunk/docs/manual/gfw-symbols.xml
==============================================================================
--- trunk/docs/manual/gfw-symbols.xml	(original)
+++ trunk/docs/manual/gfw-symbols.xml	Fri Nov 24 17:44:47 2006
@@ -2195,7 +2195,7 @@
 
   <!-- FUNCTIONS -->
 
-  <function name="cursor">
+  <function name="cursor-of">
     <syntax with-setf="t">
       <arguments>
         <argument name="window">
@@ -2206,18 +2206,19 @@
         </argument>
       </arguments>
       <return>
-        <reftopic>gfw:cursor</reftopic>
+        <reftopic>gfg:cursor</reftopic>
       </return>
     </syntax>
     <description>
-      This function returns (sets) the cursor associated with a window. Such
-      an association remains in effect until either the next call to the
-      SETF function or the assigned cursor is disposed.
+      This function returns (sets) the cursor image associated with a window. The
+      association remains in effect until either the next call to (setf cursor)
+      or the assigned cursor is disposed.
     </description>
     <seealso>
       <reftopic>gfw:show-cursor</reftopic>
       <reftopic>gfw:with-cursor</reftopic>
       <reftopic>gfw:with-wait-cursor</reftopic>
+      <reftopic>gfg:cursor</reftopic>
     </seealso>
   </function>
 
@@ -2249,9 +2250,10 @@
       non-NIL, the system counter is incremented.
     </description>
     <seealso>
-      <reftopic>gfw:cursor</reftopic>
+      <reftopic>gfw:cursor-of</reftopic>
       <reftopic>gfw:with-cursor</reftopic>
       <reftopic>gfw:with-wait-cursor</reftopic>
+      <reftopic>gfg:cursor</reftopic>
     </seealso>
   </function>
 
@@ -5982,12 +5984,25 @@
             will be set as determined by <arg1/>.
           </description>
         </argument>
-        <argument name="cursor-id">
+        <notarg name="&key"/>
+        <argument name=":file">
+          <description>
+            See <reftopic>gfg:cursor</reftopic>.
+          </description>
+        </argument>
+        <notarg name="pathname"/>
+        <argument name=":image">
+          <description>
+            See <reftopic>gfg:cursor</reftopic>.
+          </description>
+        </argument>
+        <notarg name="gfg:image"/>
+        <argument name=":system">
           <description>
-            Identifies the cursor to be displayed. See <reftopic>gfw:cursor</reftopic>
-            for details on what values may be specified for this argument.
+            See <reftopic>gfg:cursor</reftopic>.
           </description>
         </argument>
+        <notarg name="integer"/>
         <notarg name=")"/>
         <notarg name="&body"/>
         <argument name="body">
@@ -6001,14 +6016,16 @@
       </return>
     </syntax>
     <description>
-      This macro temporarily sets the cursor specified by <arg1/> in <arg0/>
+      This macro temporarily sets a cursor in <arg0/>
       for the duration of <arg2/>. The previous cursor set in
       <arg0/> is restored afterwards.
     </description>
     <seealso>
+      <reftopic>system cursors</reftopic>
       <reftopic>gfw:with-wait-cursor</reftopic>
-      <reftopic>gfw:set-cursor</reftopic>
       <reftopic>gfw:show-cursor</reftopic>
+      <reftopic>gfw:cursor-of</reftopic>
+      <reftopic>gfg:cursor</reftopic>
     </seealso>
   </macro>
 
@@ -6035,14 +6052,22 @@
       </return>
     </syntax>
     <description>
-      This macro temporarily sets the wait cursor in <arg0/>
-      for the duration of <arg1/>. The previous cursor set in
-      <arg0/> is restored afterwards.
+      <para role="normal">
+        This macro temporarily sets the wait cursor in <arg0/>
+        for the duration of <arg1/>. The previous cursor set in
+        <arg0/> is restored afterwards. Use of this macro is equivalent
+        to:
+      </para>
+      <para role="normal">
+        (gfw:with-cursor (window :system gfg:+wait-cursor+) body...)
+      </para>
     </description>
     <seealso>
+      <reftopic>system cursors</reftopic>
       <reftopic>gfw:with-cursor</reftopic>
-      <reftopic>gfw:set-cursor</reftopic>
       <reftopic>gfw:show-cursor</reftopic>
+      <reftopic>gfw:cursor-of</reftopic>
+      <reftopic>gfg:cursor</reftopic>
     </seealso>
   </macro>
 

Modified: trunk/src/packages.lisp
==============================================================================
--- trunk/src/packages.lisp	(original)
+++ trunk/src/packages.lisp	Fri Nov 24 17:44:47 2006
@@ -126,10 +126,24 @@
     #:*color-red*
     #:*color-white*
     #:*image-file-types*
+    #:+app-starting-cursor+
     #:+application-icon+
+    #:+crosshair-cursor+
+    #:+default-cursor+
     #:+error-icon+
+    #:+hand-cursor+
+    #:+help-cursor+
+    #:+ibeam-cursor+
     #:+information-icon+
+    #:+no-cursor+
     #:+question-icon+
+    #:+size-all-cursor+
+    #:+size-nesw-cursor+
+    #:+size-ns-cursor+
+    #:+size-nwse-cursor+
+    #:+size-we-cursor+
+    #:+up-arrow-cursor+
+    #:+wait-cursor+
     #:+warning-icon+
 
 ;; methods, functions, macros
@@ -275,6 +289,8 @@
     #:window
 
 ;; constants
+    #:+default-widget-height+
+    #:+default-widget-width+
     #:+vk-break+
     #:+vk-backspace+
     #:+vk-tab+

Modified: trunk/src/tests/uitoolkit/image-tester.lisp
==============================================================================
--- trunk/src/tests/uitoolkit/image-tester.lisp	(original)
+++ trunk/src/tests/uitoolkit/image-tester.lisp	Fri Nov 24 17:44:47 2006
@@ -33,12 +33,12 @@
 
 (in-package #:graphic-forms.uitoolkit.tests)
 
-(defvar *image-win*    nil)
-(defvar *happy-image*  nil)
-(defvar *bw-image*     nil)
-(defvar *comp-image*   nil)
-(defvar *folder-image* nil)
-(defvar *true-image*   nil)
+(defvar *image-win*      nil)
+(defvar *happy-image*    nil)
+(defvar *bw-image*       nil)
+(defvar *comp-image*     nil)
+(defvar *folder-image*   nil)
+(defvar *true-image*     nil)
 
 (defclass image-events (gfw:event-dispatcher) ())
 
@@ -95,18 +95,14 @@
 
 (defun load-images ()
   (let ((*default-pathname-defaults* (parse-namestring gfsys::*gf-tests-dir*)))
-    (setf *happy-image*       (make-instance 'gfg:image))
-    (gfg::load *happy-image*  "happy.bmp")
-    (setf *bw-image*          (make-instance 'gfg:image))
-    (gfg::load *bw-image*     "blackwhite20x16.bmp")
-    (setf *true-image*        (make-instance 'gfg:image))
-    (gfg::load *true-image*   "truecolor16x16.bmp")
+    (setf *happy-image*       (make-instance 'gfg:image :file "happy.bmp")
+          *bw-image*          (make-instance 'gfg:image :file "blackwhite20x16.bmp")
+          *true-image*        (make-instance 'gfg:image :file "truecolor16x16.bmp"))
+    
 #+load-imagemagick-plugin
     (progn
-      (setf *folder-image*      (make-instance 'gfg:image))
-      (gfg::load *folder-image* "open-folder.gif")
-      (setf *comp-image*        (make-instance 'gfg:image))
-      (gfg::load *comp-image*   "computer.png"))))
+      (setf *folder-image* (make-instance 'gfg:image :file "open-folder.gif")
+            *comp-image*   (make-instance 'gfg:image :file "computer.png")))))
 
 (defun image-tester-internal ()
   (load-images)
@@ -118,7 +114,8 @@
     (setf menubar (gfw:defmenu ((:item "&File"
                                  :submenu ((:item "E&xit" :callback #'exit-image-fn))))))
     (setf (gfw:menu-bar *image-win*) menubar)
-    (setf (gfw:image *image-win*) (make-instance 'gfg:icon-bundle :file (merge-pathnames "default.ico")))
+    (setf (gfw:image *image-win*)
+          (make-instance 'gfg:icon-bundle :file (merge-pathnames "default.ico")))
     (gfw:show *image-win* t)))
 
 (defun image-tester ()

Modified: trunk/src/uitoolkit/graphics/graphics-constants.lisp
==============================================================================
--- trunk/src/uitoolkit/graphics/graphics-constants.lisp	(original)
+++ trunk/src/uitoolkit/graphics/graphics-constants.lisp	Fri Nov 24 17:44:47 2006
@@ -67,3 +67,23 @@
 (defconstant +information-icon+             32516)
 (defconstant +question-icon+                32514)
 (defconstant +warning-icon+                 32515)
+
+
+;;; The following are from WinUser.h; specify one of
+;;; them as the value of the :system keyword arg when
+;;; creating an image.
+;;;
+(defconstant +app-starting-cursor+ gfs::+ocr-appstarting+)
+(defconstant +crosshair-cursor+    gfs::+ocr-cross+)
+(defconstant +default-cursor+      gfs::+ocr-normal+)
+(defconstant +hand-cursor+         gfs::+ocr-hand+)
+(defconstant +help-cursor+         32651)
+(defconstant +ibeam-cursor+        gfs::+ocr-ibeam+)
+(defconstant +no-cursor+           gfs::+ocr-no+)
+(defconstant +size-all-cursor+     gfs::+ocr-sizeall+)
+(defconstant +size-nesw-cursor+    gfs::+ocr-sizenesw+)
+(defconstant +size-ns-cursor+      gfs::+ocr-sizens+)
+(defconstant +size-nwse-cursor+    gfs::+ocr-sizenwse+)
+(defconstant +size-we-cursor+      gfs::+ocr-sizewe+)
+(defconstant +up-arrow-cursor+     gfs::+ocr-up+)
+(defconstant +wait-cursor+         gfs::+ocr-wait+)

Modified: trunk/src/uitoolkit/graphics/icon-bundle.lisp
==============================================================================
--- trunk/src/uitoolkit/graphics/icon-bundle.lisp	(original)
+++ trunk/src/uitoolkit/graphics/icon-bundle.lisp	Fri Nov 24 17:44:47 2006
@@ -158,8 +158,7 @@
                        (#.+error-icon+       (cffi:make-pointer system))
                        (#.+information-icon+ (cffi:make-pointer system))
                        (#.+question-icon+    (cffi:make-pointer system))
-                       (#.+warning-icon+     (cffi:make-pointer system))
-                       (otherwise            nil))))
+                       (#.+warning-icon+     (cffi:make-pointer system)))))
     (cond
       (resource-id
          (setf (slot-value self 'gfs:handle) (gfs::load-icon (cffi:null-pointer) resource-id)))

Modified: trunk/src/uitoolkit/graphics/image-data.lisp
==============================================================================
--- trunk/src/uitoolkit/graphics/image-data.lisp	(original)
+++ trunk/src/uitoolkit/graphics/image-data.lisp	Fri Nov 24 17:44:47 2006
@@ -44,7 +44,8 @@
 ;; this extant in the world, so add more as needed)
 ;;
 (defvar *image-file-types* (let ((table (make-hash-table :test #'equal)))
-                             (loop for (key value) in '(("bmp"  "Microsoft Windows bitmap")
+                             (loop for (key value) in '(("ani"  "Microsoft Windows animated cursor")
+                                                        ("bmp"  "Microsoft Windows bitmap")
                                                         ("cur"  "Microsoft Windows cursor")
                                                         ("dib"  "Microsoft Windows device-independent bitmap")
                                                         ("emf"  "Microsoft Windows Enhanced Metafile")

Modified: trunk/src/uitoolkit/graphics/plugins/default/default-data-plugin.lisp
==============================================================================
--- trunk/src/uitoolkit/graphics/plugins/default/default-data-plugin.lisp	(original)
+++ trunk/src/uitoolkit/graphics/plugins/default/default-data-plugin.lisp	Fri Nov 24 17:44:47 2006
@@ -108,6 +108,7 @@
          (helper (cond
                    ((string-equal file-type "bmp") #'load-bmp-data)
                    ((string-equal file-type "ico") #'load-icon-data)
+                   ((string-equal file-type "cur") #'load-icon-data)
                    (t                              (return-from loader nil)))))
     (with-open-file (stream path :element-type '(unsigned-byte 8))
       (funcall helper stream))))

Modified: trunk/src/uitoolkit/widgets/widget-classes.lisp
==============================================================================
--- trunk/src/uitoolkit/widgets/widget-classes.lisp	(original)
+++ trunk/src/uitoolkit/widgets/widget-classes.lisp	Fri Nov 24 17:44:47 2006
@@ -33,9 +33,6 @@
 
 (in-package :graphic-forms.uitoolkit.widgets)
 
-(defclass cursor (gfs:native-object) ()
-  (:documentation "The cursor class represents the sprite controlled by the pointing device."))
-
 (defclass display (gfs:native-object) ()
   (:documentation "Instances of this class describe characteristics of monitors attached to the system."))
 



More information about the Graphic-forms-cvs mailing list