<- previous    index    next ->

Lecture 22, Windowing systems

Now that the class has been using one or more windowing systems
to do homework and their project, let us peek under the cover
and learn some fundamentals that are hidden by tool kits.

The facilities and functions presented in this lecture are
available for everyone to use. Yet, typically these "low level"
facilities and functions are called by higher level tool kits.

Both Microsoft Windows windowing and X Windows windowing will
be covered. The names may be changed yet the observant student
will see great similarity at the basic capability level.

A first look at Microsoft Windows starts with the "C" header
file Windows.h and the header
files that are included:
WinDef.h
WinBase.h
WinGDI.h
WinUser.h
ShellAPI.h
and
WindowsX.h

A higher level Microsoft toolkit is the Microsoft Foundation Classes,
MFC, for C++. Within this toolkit the top level files are:
StdAfx.h and StdAfx.cpp
An example use is:
vc_plotd.h and vc_plotd.cpp


To help understand some of the function calls, "h" as a first
letter of a type usually means "handle" that means a "C" pointer.
Thus, hwnd, is a handle to a specific window. hdc, is a handle to a
device context, drawing context, that contains drawing parameters
such as colors and pixels.



The X Windows System considers the top level entity to be a "display"
typically named "dpy". A display may have one or more "screens".
Within each screen is a top level window that covers the entire
screen. Within the top level window there can be any number of
windows, some with the top level window being the parent and others
nested, children, to any nesting depth. For each window that may be
one or more graphics context, "gc" that contain drawing parameters.

The basic header file for X Windows is Xlib.h
The next level header file is Intrinsic.h
The Motif tool kit main header file is Xm.h
Note that the library names for linking are  -lXm -lXt -lX11 for
Xm.h Intrinsic.h and Xlib.h respectively.

man X  as a text file

An example basic X Windows program is w1.c

There are an amazing number of windows on a desktop.
The program treewalk.c shows 465 windows
for a Linux KDE desktop treewalk.out
Note that some windows have names, some do not.
Child windows are shown indented. Coordinates and sizes are shown.

X Windows and Microsoft Windows give the user some control over
what seem to be unchangeable programs. For X Windows check out
/usr/X11R6/lib/X11/app-defaults directory. For example XCalc
A user may modify one of these files, typically with
an ".ad" extension meaning application default.

For Microsoft Windows there is a resource file, typically with extension
".rc" that gets compiled by the resource compiler into a binary file.
For example  hw7.rc

Application default or resource files can set simple items such as
colors and sizes, can provide additional key bindings and in some cases
can change the names of menu items or behavior of the application.

    <- previous    index    next ->

Other links

Go to top