Slashdot Mirror


Resources for Rolling Your Own Windowing System?

WalterGR asks: "There are plenty of resources available for writing operating systems, e.g. Tanenbaum's Modern Operating Systems, the Dinosaur Book, and countless web sites. For those of us who aren't interested in low-level issues, and prefer focusing on human-computer interaction, what resources are available for designing windowing systems (a la X Window)? Issues like the object hierarchy, event management, modularity, redefining behavior at runtime (e.g. for skins) etc. Any suggestions?"

12 of 279 comments (clear)

  1. OWL, MFC, K, etc. by Anonymous Coward · · Score: 5, Informative

    Take a look at the object windowing libraries put out by several vendors. It should give you a good footing on developing your own object hierarchy.

    As for not getting into 'low-level' stuff, you're SOL if you want to build an X-like system.

  2. Just wanted to point out... by 2nd+Post! · · Score: 4, Offtopic

    That windowing systems and HCI are distinct. Windowing systems is a component of HCI, but so is command line interfaces, voice interfaces, and graphical interfaces.

    Windowing systems is one metaphor applied to graphical interfaces. HCI includes the concepts of learnability, consistent behavior, teachability, and useability.

    I'm defining learnability as the capacity for the system to teach the user, and teachability is the capacity for the system to adapt to the user.

    Windowing systems doesn't necessarily have anything to do with any of those four points unless the designer and developer choses to address those points. Themes and skins count as teachable, adaptable systems, but do not necessarily mean the system is useable, powerful, or capable.

  3. Re:Wheel. by jungd · · Score: 4, Insightful

    Of course, MS's window system is a classic example of how to break all of the established rules about GUI design.
    If you rool your own, don't copy the mistakes made by MS/Apple/Xerox. GUI research has come along way since those days. Alas, we never see the results because of the entrenched WIMP paridgm - which is very out moded.
    In addition, many of the things learnt through WIMP have been successively undone my MS.

    For example, menus at the top of the screen (ala MacOS) worked well because a user's motor memory it trained to select items. The functions become motor program - like learning to play a piano.
    Unfortunately, this is broken if the menus change (e.g. MS's idea of hiding items and them bringing them back, moving them around etc.). It also doesn't work for menus on window titles - as you need to overload your visual system to select the menu to begin with. Only context and screen top menus retain the original design a pros of menus these days.

    There are many many other examples like this. I sugest you find some books on human factors and learn how visual and motor systes work etc.

    --
    /..sig file not found - permission denied.
  4. I'm right there. by Ortado · · Score: 5, Interesting

    I've been working for about 4 years now on a graphical user interface for dos as a pet project, and have learned a great number of things. So many, in fact, that i'm in the middle (still) of rewriting it. If you're intreseted, the website is http://dwin.sf.net/ and is open sourced. When the new version comes out (or the next preview) one could use it to see how it all fits together. This would be better then trying to use XWin to learn how everything works because it is smaller, simplier and very OOP (which is great for windowing systems). And yes, most of /. will call me crazy for reinventing the GUI, but heck, i've learned so much about computers in doing it that it's been a real fun time.

    -Jon Gentle(atrodo@atrodo.org)

  5. No really, I'm serious... by curunir · · Score: 5, Informative

    Microsoft's Research is pretty good...

    These guys spend a lot of effort answering the kind of questions you're asking.

    --
    "Don't blame me, I voted for Kodos!"
  6. It's a ten line program by CatherineCornelius · · Score: 5, Funny

    #include
    #include <rants/msvapple.h>
    #include <rants/nextstep.h>
    #include <slashdot/troll.h>
    #include <stdio.h>
    int main (int argc, char *argv[])
    {
    puts("Real programmers use curses");
    return 0;
    }

  7. Re:Wheel. by klund · · Score: 5, Insightful
    For more on some of the things wrong with Microsoft's WIMP GUI, see A Quiz Designed to Give You Fitts. Specifically, take the following quiz if you're interested in Windowing System Design:
    1. Microsoft Toolbars offer the user the option of displaying a label below each tool. Name at least one reason why labeled tools can be accessed faster. (Assume, for this, that the user knows the tool and does not need the label just simply to identify the tool.)

    2. You have a palette of tools in a graphics application that consists of a matrix of 16x16-pixel icons laid out as a 2x8 array that lies along the left-hand edge of the screen. Without moving the array from the left-hand side of the screen or changing the size of the icons, what steps can you take to decrease the time necessary to access the average tool?

    3. A right-handed user is known to be within 10 pixels of the exact center of a large, 1600 X 1200 screen. You will place a single-pixel target on the screen that the user must point to exactly. List the five pixel locations on the screen that the user can access fastest. For extra credit, list them in order from fastest to slowest access.

    4. Microsoft offers a Taskbar which can be oriented along the top, side or bottom of the screen, enabling users to get to hidden windows and applications. This Taskbar may either be hidden or constantly displayed. Describe at least two reasons why the method of triggering an auto-hidden Microsoft Taskbar is grossly inefficient.

    5. Explain why a Macintosh pull-down menu can be accessed at least five times faster than a typical Windows pull-down menu. For extra credit, suggest at least two reasons why Microsoft made such an apparently stupid decision.

    6. What is the bottleneck in hierarchical menus and what technique used on the Macintosh, but not on Windows, makes that bottleneck less of a problem? Can you think of other techniques that could be applied?

    7. Name at least one advantage circular popup menus have over standard, linear popup menus.

    8. What can you do to linear popup menus to better balance access time for all items?

    9. The industrial designers let loose on the iMac not only screwed up the mouse by making it round, they screwed up the keyboard by cutting the command keys in half so the total depth of the keyboard was reduced by half a key. Why was this incredibly stupid?

    10. What do the primary solutions to all these questions have in common?
    --
    My word processor was written by Stanford Professor Donald Knuth. Who wrote yours?
  8. What level are you trying to address by ReelOddeeo · · Score: 4, Insightful

    I see (at least) 3 distinct levels, and I'm not sure which one your question addresses.

    1. Low level graphics manipulation. I would put X here, although X includes network transparency. What I see at this level is graphics primitives. How to draw a circle, a line, a rectangle, draw characters of text in a certian font, etc.

    2. A window manager / widget toolkit. There are already five million of these for Linux. They can be fun to write and educational. But don't have any delusions of gaining significant market/mind share.

    3. Human-Computer interaction. User Interface. This is more about human psychology than it is about technology. Read some good books like The Design Of Everyday Things. Apple Human Interface Guidelines. (Apple's developer web site.)

    Your question makes fairly clear you aren't interested in (1). But it is ambiguous whether you are interested in (2) or (3). If you're interested in (3), then join either the GNOME or KDE projects and contribute ideas and effort that don't involve writing code.

    --

    Those who would give up liberty in exchange for security and DRM should switch to Microsoft Palladium!
  9. Re:DONT by ADRA · · Score: 4, Insightful

    Why not keep X11 the way it is, but have X11R7, or X12, which has all those dangling extensions internally as a requirement.

    It could keep almost 100% compatibility while making a "better" GUI system.

    The problem with that though is that you are forcing the user of the GUI to be a fat system. Right now, you can run X11 on an Ipaq with problem. If you start throwing the kitchen sink in as a requirement(the only way to enforce the standard), you are also abandoning a potentially large share of your market. The beauty of X11 as it is today, is that you have the choice in what you want to use, and what you don't. XFree86 does not make the pluggable nature of X11 as clear as it should be, but none the less, I like the flexability and scalability that the current system offers.

    --
    Bye!
  10. Understand prior art first by Havoc+Pennington · · Score: 4, Informative

    Here is the classic paper on how X could be improved, for example: http://www.std.org/~msm/common/WhyX.pdf.

    Write a window manager and fix some GUI toolkit bugs, that's a good way to understand X well. Hack on GUIs like GNOME and KDE to understand where progress is needed on the UI front, and where changing the window system could help.

    (I think almost everyone who's actually hacked on this stuff a lot will tell you that replacing X isn't interesting, but if you want to make a credible claim one way or the other, getting experience is the only way.)

  11. Plan9 by horster · · Score: 5, Interesting

    go to the plan9 site -
    http://www.cs.bell-labs.com/plan9dist/
    (for starters see this paper on the old plan9 window system) - http://www.cs.bell-labs.com/sys/doc/8%bd/8%bd.html

    there is some information there, and the source code for the window system is actually readable because it is much few lines of code and over all simpler than x windows.

    also Rob Pike (who worked on plan9) has written several interesting papers on windowing systems.
    try reading them by poking around this site - http://citeseer.nj.nec.com/144447.html
    http://citeseer.nj.nec.com/pike89concurrent.html
    (sorry the actual articles - linked off of the above links are only ps or pdf, no html)

    These papers, the plan9 window system as well as the inferno window system prove that a simple, elegant window system can be created that is both fast and runs over a network.

    Granted these use some features that don't exist in the unix world (like plan9's threading model, and the use of per process namespaces) but I believe these can be emulated somewhat using standard networking.
    The size, complexity and performance of x windows are all indications that it is not the optimal solution.

  12. MVC and Views by KidSock · · Score: 4, Insightful
    The foundation of all windowing systems is the Model View Controller mechanism. There are surprisingly few good examples of source code or descriptions of how to actually implement such frameworks but the general idea is well know and easy to understand and appreciate.

    The Model View Controller framework abstracts the three separate components of a basic user interface. The Model is the data. This might be a double subscripted array of numbers or a tree of arbitrarily complex nodes. The Controller is probably a keyboard and mouse. There would be some driver code that would deliver mouse and keyboard events to the object currently in focus (or to what ever object registered itself as an event listener). The most important and more sophisticated of these three components is the View.

    The View is an area (usually rectangular) of the display device such as a monitor or printer. The key principle behind a view is that it's potentially the child of a parent View. Thus each view may contain subviews each with their own coordinate space. Within a view graphics primiatives and subviews are drawn to create arbitarily complex grapical interfaces. Because the translation to display device coordinates is handled by the graphics context passed to all drawing functions (Graphics g in Java AWT), the implementation of a subview may draw it's widget with respect to coordinates 0,0. This makes it very easy to integrate new custom widgets (widgets stands for "Window Gadgets"). So, for example a frame is a View with a border, a label, and maybe a scrollbar. It has two buttons, some text, and another frame as children. The button is a View that contains a border decor and some text ... etc. This follows the process of Recursive Composition. There is a good description of Views in the BEOS documentation which unfortunately I cannot link to because BE has apprently disabled much of their site. I would appricitate it if someone could point me to a valid link to the description of the BView class.

    Ironnically, this framework is repeated in software over and over where only one would really be necessary provided the API were general and flexible. For example, the X-Window system is an MVC framework. But Mozilla has it's own MVC framework for drawing GUI components. Then within Mozilla's rendering engine Gecko is another MVC framework for rendering html components.

    In this last case of Gecko, I can understand why they would not want to use a generic windowing MVC API; the layout of components is very strict in that images, links, and the way text flows around components is required to behave in a certain way as to conform to the various associated standards such as CSS and DOM etc. It would be interesting and simplify things tremendously if one could reduce and refactor one unified implementation that parameterized all the different requirements of these MVC frameworks. Then custom components could be potentially integrated into previous unrelated applications (e.g. vi in xterm as the text area of an HTML page).