A Guided Tour of the Common Lisp Interface Manager

A Guided Tour of the Common Lisp Interface Manager

A Guided Tour of the Common Lisp Interface Manager Ramana Rao <raoQxerox.com> William M. York <york~ila.com> Xerox Palo Alto Research Center International Lisp Associates, Inc. Dennis Doughty <[email protected]> International Lisp Associates, Inc. Abstract formatting; and high level facilities like context sen- sitive input, an adaptive toolkit, and an application The Common Lisp Interface Manager (CLIM) is a building framework. powerful Lisp-based system that provides a layered CLIM will eventually support a large num- set of facilities for building user interfaces. These ber of window enviromnents including Genera[16], facilities include a portable layer called Silica that in- X[12], the Macintosh[l], Microsoft Windows[5], cludes basic windowing, input, output services, and SunView[13], and NextStep[6]. CLIM is designed to mechanisms for constructing window types and user exploit the functionality provided by the host envi- interface components; stream-oriented input and out- ronment to the degree that it makes sense. For ex- put facilities extended with presentations and con- ample, CLIM top level windows are typically mapped text sensitive input similar to the work pioneered in onto host windows, and input and output opera- the Genera UI system; and a gadget-oriented toolkit tions are ultimately performed by host window sys- similar to those found in the X world extended with tem code. Another example is that CLIM supports support for look and feel adaptiveness. In this arti- the incorporation of toolkits written in other lan- cle, we present an overview of CLIM's broad range guages (e.g. C-based toolkits that implement Motif[7] of functionality and present a series of examples that or OpenLook[15]). However, in both cases, a uniform illustrates CLIM's power. interface provided by CLIM allows Lisp applications to deal only with Lisp objects and functions regard- less of their operating platform (i.e. combination of Introduction Lisp system, host computer, and host window envi- ronment). Common Lisp is a language standard that has pro- vided a broad range of functionality, and that has, An important goal that has guided the design of to a large degree, successfully enabled the writing CLIM has been to layer the specification into a num- of truly portable Lisp programs. The emergence of ber of distinct facilities. Furthermore, the specifica- CLOS and the cleanup efforts of Ansi X3J13 have tion doesn't distinguish the use of a facility by higher further enhanced the utility and portability of Com- level CLIM facilities from its use by CLIM users. mon Lisp. However, one major stumbling block re- For example, the geometry substrate, which includes mains in the path of those endeavoring to write large transformations and regions, is designed for efficient portable applications. The Common Lisp community use by the graphics and windowing substrates as well has not yet provided a standard interface for imple- as by CLIM users. This means that, in general, a menting user interfaces beyond the most basic oper- CLIM user can reimplement higher level CLIM fa- ations based on stream reading and printing. cilities using the interfaces provided by lower level The Common Lisp Interface Manager (CLIM) ad- facilities. dresses this problem by specifying an interface to a This modular, layered design has a number of ben- broad range of services necessary or useful for de- efits. The CLIM architecture balances the goal of veloping graphical user interfaces. These services ease of use on one hand, and the goal of versatility on include low level facilities like geometry, graphics, the other. High level facilities allow programmers to event-oriented input, and windowing; intermediate build portable user interfaces quickly, whereas lower level facilities like support for Common Lisp stream level facilities provide a useful platform for building operations, output recording, and advanced output toolkits or frameworks that better support the spe- copyright 1990 Ramana Rao of Xerox Parc, William M. York & Dennis Doughty of ILA IV-i. 17 Applications Frames Command Loops Frame Managers Presentations Adaptive Gadget Panes Extended Streams Layout Panes Application Panes Panes Formatted Output, Graphs Standard Sheets Output Recording Sheet Definition Graphics Ports Geometry Look and Feel Common Lisp w/CLOS Host Window System Operating System Hardware Figure 1: An Overview of CLIM functionality cific needs or requirements of a particular application. scribes Silica, application building functionality, and For example, CLIM's application framework and many of the high level facilities of CLIM in greater adaptive toolkit allow users to develop applications detail. These sections present a series of real code that automatically adopt the look and feel of the examples that gradually build up higher and higher host's environment. (We often call this "adaptive- CLIM concepts. ness," "look and feel independence," or occasion- ally more picturesquely, "chameleon look and feel" .) However, many users may need or want to define a 1 Overview of Functionality particular look and feel that stays constant across all host environments (we call this "portable look Figure 1 shows the various aspects of a host environ- and feel"). Such users can circumvent the look and ment in which CLIM lives as well as the various ele- feel adaptiveness provided by CLIM, while still using ments provided by CLIM. Below we briefly describe most of the application framework facility and other a number of CLIM's areas of functionality. Later sec- high level CLIM facilities like context sensitive input. tions will illustrate many of these components. Furthermore, using the lower level facilities of CLIM, they can develop portable toolkit libraries that define Geometry CLIM provides points, rectangles, and and implement their own particular look and feel. transformations; and functions for manipulating these object types. Another major benefit of CLIM's modular design is that application programs need only load CLIM Graphics CLIM provides a portable interface to facilities that they use. This is particularly impor- a broad set of graphics functions for drawing tant because of the extent of functionality provided complex geometric shapes. The CLIM drawing by CLIM. For example, some applications may not model supports a wide variety of drawing op- use some CLIM facility, say presentations or output tions (such as line thickness), a sophisticated ink- recording, and in such cases, these facilities need not ing model, color, and full affine transformations, be loaded. Similarly, other applications may not need which allows graphics to be arbitrarily trans- all gadget implementations or any Lisp-based gadget lated, rotated, and scaled. implementations, since they are running in an envi- ronment in which C-based gadgets have been incor- Silica CLIM provides a portable layer called Sil- porated. ica for implementing sheets (windows and other The next section presents an overview of the func- window-like objects). Silica specifies a uniform tionality provided by CLIM. The rest of paper de- interface for creating and managing hierarchies IV-I. 18 of sheets, regardless of their class or other prop- in terms of the details of its appearance or op- erties. In addition, Silica defines a standard eration. Application that use these gadget types sheet class that implements a straightforward and related facilities will automatically adapt to window that supports much of the functionality use whatever toolkit is available and appropriate of an X[12] or NEWS[14] window. for the host environment. In addition, portable Lisp-based implementations of the abstract gad- Common Lisp Streams CLIM integrates the get pane protocols are provided. Common Lisp Stream I/O functionality with the CLIM graphics, windowing, and panes facilities. 2 Silica Output Recording CLIM provides a facility for capturing all output done to a sheet and auto- The Silica layer of CLIM serves two primary func- matically repainting it when necessary. In addi- tions. First, it provides a portable windowing model tion, this facility provides a substrate for other that insulates higher levels of CLIM and CLIM users CLIM facilities including formatted output and from the details of the host window system. So from presentations. the perspective of most CLIM user's, Silica is the win- dow system. However, on most platforms, Silica will Formatted Output CLIM provides a set of high- use the services of a host window system to provide level macros that enable programs to produce efficient windowing, input and output facilities. In neatly formatted tabular and graphical displays easily. this regard, Silica can be viewed as a portable CLX (the Lisp interface to the Xll protocol). Presentations CLIM provides the ability to asso- Second, Silica provides an extensible framework ciate semantics with output, such that Lisp ob- that can be used to explore alternative window jects may be retrieved later via user gestures (e.g. system implementations. For example, two other mouse clicks) on their displayed representation. Common Lisp window systems interfaces have been This context sensitive input is modularly layered build within the Silica framework: the Deli Window on top of the output recording facility and is System[8] and Common Windows[2]. integrated with the Common Lisp type system. Moreover, the extensible framework also allows A mechanism for type coercion is also included, sharing and reusing of functionality typically associ- providing the basis

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    21 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us