home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / prim / objects.el < prev    next >
Encoding:
Text File  |  1995-06-10  |  4.2 KB  |  92 lines

  1. ;;; objects.el --- Lisp interface to C window-system objects
  2. ;; Keywords: faces internal
  3.  
  4. ;; Copyright (C) 1994 Board of Trustees, University of Illinois
  5. ;; Copyright (C) 1995 Ben Wing
  6.  
  7. ;; Author: Chuck Thompson <cthomp@cs.uiuc.edu>,
  8. ;;         Ben Wing <wing@netcom.com>
  9.  
  10. ;; This file is part of XEmacs.
  11.  
  12. ;; XEmacs is free software; you can redistribute it and/or modify it
  13. ;; under the terms of the GNU General Public License as published by
  14. ;; the Free Software Foundation; either version 2, or (at your option)
  15. ;; any later version.
  16.  
  17. ;; XEmacs is distributed in the hope that it will be useful, but
  18. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  20. ;; General Public License for more details.
  21.  
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  24. ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  25.  
  26. (defun object-property-1 (function object domain)
  27.   (let ((instance (specifier-instance object domain)))
  28.     (and instance (funcall function instance))))
  29.  
  30. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; font specifiers
  31.  
  32. (defun make-font-specifier (spec-list)
  33.   "Create a new `font' specifier object with the given specification list.
  34. SPEC-LIST can be a list of specifications (each of which is a cons of a
  35. locale and a list of instantiators), a single instantiator, or a list
  36. of instantiators.  See `make-specifier' for more information about
  37. specifiers."
  38.   (make-specifier-and-init 'font spec-list))
  39.  
  40. (defun font-name (font &optional domain)
  41.   "Return the name of the FONT in the specified DOMAIN, if any.
  42. FONT should be a font specifier object and DOMAIN is normally a window
  43. and defaults to the selected window if omitted.  This is equivalent
  44. to using `specifier-instance' and applying `font-instance-name' to
  45. the result.  See `make-specifier' for more information about specifiers."
  46.   (object-property-1 'font-instance-name font domain))
  47.  
  48. (defun font-properties (font &optional domain)
  49.   "Return the properties of the FONT in the specified DOMAIN, if any.
  50. FONT should be a font specifier object and DOMAIN is normally a window
  51. and defaults to the selected window if omitted.  This is equivalent
  52. to using `specifier-instance' and applying `font-instance-properties'
  53. to the result.  See `make-specifier' for more information about specifiers."
  54.   (object-property-1 'font-instance-properties font domain))
  55.  
  56. (defun font-truename (font &optional domain)
  57.   "Return the truename of the FONT in the specified DOMAIN, if any.
  58. FONT should be a font specifier object and DOMAIN is normally a window
  59. and defaults to the selected window if omitted.  This is equivalent
  60. to using `specifier-instance' and applying `font-instance-truename'
  61. to the result.  See `make-specifier' for more information about specifiers."
  62.   (object-property-1 'font-instance-truename font domain))
  63.  
  64. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; color specifiers
  65.  
  66. (defun make-color-specifier (spec-list)
  67.   "Create a new `color' specifier object with the given specification list.
  68. SPEC-LIST can be a list of specifications (each of which is a cons of a
  69. locale and a list of instantiators), a single instantiator, or a list
  70. of instantiators.  See `make-specifier' for a detailed description of
  71. how specifiers work."
  72.   (make-specifier-and-init 'color spec-list))
  73.  
  74. (defun color-name (color &optional domain)
  75.   "Return the name of the COLOR in the specified DOMAIN, if any.
  76. COLOR should be a color specifier object and DOMAIN is normally a window
  77. and defaults to the selected window if omitted.  This is equivalent
  78. to using `specifier-instance' and applying `color-instance-name' to
  79. the result.  See `make-specifier' for more information about specifiers."
  80.   (object-property-1 'color-instance-name color domain))
  81.  
  82. (defun color-rgb-components (color &optional domain)
  83.   "Return the RGB components of the COLOR in the specified DOMAIN, if any.
  84. COLOR should be a color specifier object and DOMAIN is normally a window
  85. and defaults to the selected window if omitted.  This is equivalent
  86. to using `specifier-instance' and applying `color-instance-rgb-components'
  87. to the result.  See `make-specifier' for more information about specifiers."
  88.   (object-property-1 'color-instance-rgb-components color domain))
  89.  
  90. ;;; objects.el ends here.
  91.  
  92.