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?"

33 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.

    1. Re:OWL, MFC, K, etc. by Doomdark · · Score: 3, Offtopic
      Minor nitpicking; neither Swing nor AWT (on which Swing is based, just AWT primitive stuff not widgets) are on X-Windows (or Win32 GUI) level. They use platforms' windowing systems for (main-level) window management, and gfx primitive for actually doing screen output.

      As to whether Swing is not the way to do actual GUI level (above X-windows, upper levels of W32 GUI) is arguable. It's not completely bad, although in some places it is bit overengineered. Its beauty is in customization, and some people like its "by-the-book" design patterns + OO design. It's unfortunate that its not multi-threaded, but apparently they had some valid reasons for avoiding that route (there was a white paper about that; basically multi-threading at that level is bitch to implement reliably). As to the most popular complaint, speed... well, it just depends on what you do and how (from application). Swing has been aggressively optimized, and is not dog slow if you know how to develop and don't do braindead stuff (which, in some cases, you can get by when using faster libs in apps written in C/C++). Part of the time saved when writing apps in Java should be used for more optimizations, if/when app doesn't feel quite as responsive as native ones; it's simple as that.

      --
      I like paying taxes. With them I buy civilization -- Oliver Wendell Holmes
    2. Re:OWL, MFC, K, etc. by Baba+Abhui · · Score: 3, Insightful

      OWL and MFC were both written to create an OO shell around the pre-existing Windows window-management stuff. In a sense, they are hacks, not clean-sheet designs. As a result, they have some rather odd characteristics (well, at least MFC does - I haven't used OWL).

      So it may be that someone interested in starting from scratch on a new, OO-based windowing system would be better served by studying something else, like Java's AWT or Swing.

    3. Re:OWL, MFC, K, etc. by Steveftoth · · Score: 3, Informative

      One of the reasons that swing is so slow is that it looks the same on ALL operating systems. They achieve this by not accelerating ANY DRAWING CODE.

      All the widgets are drawn onto an offscreen buffer then blitted to the main screen. Instead of just simply being drawn to the screen ( like normally) This causes huge problems in X over the network ( especially if the application likes t call repaint a lot ).

      the apple jvm accelerates some of swing, but on windows ( where most people see swing ), it is really slow.

      I totatly agree that swing is a little too OO sometimes. It's a problem with java being so OO.

    4. Re:OWL, MFC, K, etc. by Chainsaw · · Score: 3, Interesting

      MFC is plain horrible. It features almost none of the OO concepts at all, and encapsulation is the one feature I miss the most. In a toolkit with a good OO design, to change the font of a label to bold you type label->Font->Style = CFont.STYLE_BOLD; or something similar. Not in MFC: you have to use the Win32 API for an operation on that simple level.

      The one toolkit I like the most (in the C++ world) is Borland's VCL classes. Swing is very nice and easy to extend. My experience from Apples Cocoa and other toolkits (Qt, GTK, Motif) is near zero, so I'm not going to comment on things I don't know about.

      --
      War is one of the most horrible things a human can be exposed to. And one of the worlds largest industries.
    5. Re:OWL, MFC, K, etc. by igrek · · Score: 3, Interesting

      For simple programs, VB will do just fine.

      For bigger projects sometimes it's better to use MFC. It's is based on the Model-View-Controller pattern, which makes it easier to decompose complex systems. Plus, it has some small convenient features, like object serialization.

      From the other hand, MFC is very fat and quite inefficient in some areas. As a result, not many of the successful client-side applications are written using MFC. Even Microsoft programmers usually dont use it for production code, with the notable exception of WordPad. Well, it's not a surprise, of course. They don't even use the normal Visual C++ neither and use the frozen stable "internal" version of the compiler.

  2. Windowing system or window manager? by Indomitus · · Score: 3, Insightful

    First you need to ask yourself if you really want to recreate the XWindows System or if you want to create a window manager like Enlightenment, fvwm, etc. If you want to recreate the years of work that has gone into X, that's your choice but I think you should look at creating a window manager, you'll probably get farther.

    1. Re:Windowing system or window manager? by Fnkmaster · · Score: 3, Offtopic
      Again, I point out that X11 is a piece of turd. There is no reason that we should accept the X Window system as sacrosanct. Why does X insist that a font is a 1 bit bitmap? Why is X written for network transparent operation when 99% of the usage of a desktop windowing system is local (I'm not knocking the feature, just saying it shouldn't be the central assumption of a desktop windowing system)? Why do the features necessary end up getting strapped on like XRender in a way that leaves us with two parallel font management systems for different types of X Windows apps? While everyone agrees that diversity and choice are good, do we really need so many different widget set and toolkits, all of which are separately themeable, resulting in the most heinous looking clash of aesthetics when Qt, Gtk, and Xaw apps are used simultaneously? Why is transparency and alpha blending on the client end totally impossible in X windows? Why is X Windows so damned chatty that it blows over the internet anyway?


      While X windows is mature, and supports a lot of features, and represents (unfortunately) the repository of the vast majority of the current video support for Linux (if all the drivers for video support weren't in X land, perhaps we'd have better X Windows alternatives), that does NOT mean it is the best solution and that people shouldn't be trying to come up with something better.

    2. Re:Windowing system or window manager? by kaiidth · · Score: 3, Insightful

      As an HCI student I can see the interest in writing your own window manager (I'd like to do this myself... although starting from scratch might not be the best way)

      If this is actually what you want to do, make sure that you can't customise an existing one before you start all over again - the chances are you could take a simple system like FVWM ie. something minimal, and just put a few custom toolbars and such on it.

      Try looking at the source code to other window managers. You can find several on freshmeat that are absolutely tiny ie. a couple of hundred k. The gzipped source for aewm, for example, is apparently under 50k - incredible :P

      If you're after rewriting the windowing system itself and you're doing it for HCI related reasons, I think you may be nuts. There may be a good reason to do this but it doesn't spring to mind. Whereas there are - arguably - huge numbers of usability problems with window managers in general... low consistency, little feedback, that sort of thing.

    3. Re:Windowing system or window manager? by lkaos · · Score: 3, Offtopic

      Why is X written for network transparent operation when 99% of the usage of a desktop windowing system is local (I'm not knocking the feature, just saying it shouldn't be the central assumption of a desktop windowing system)?

      99% of X-Window terminals don't run on desktops. They run on Workstations, that are usually connected to very fast LANS. You may not thing transparent network operation is important at home on a 28.8k modem, but when your using it in a highly distributed production network, the fact that you can make Emacs come up on the display of a Sun from an HP since Emacs isn't installed on the Sun is one of the most useful things in the world.

      While everyone agrees that diversity and choice are good, do we really need so many different widget set and toolkits, all of which are separately themeable, resulting in the most heinous looking clash of aesthetics when Qt, Gtk, and Xaw apps are used simultaneously?

      So monopoly is good? People like different things. Let the desktop evolve.

      Why is transparency and alpha blending on the client end totally impossible in X windows? Why is X Windows so damned chatty that it blows over the internet anyway?

      LBX == Low Bandwidth X. It started as the Broadway project. When X was first designed, the chattiness wasn't a problem because there were no low bandwidth networks so this wasn't even a concern.

      Why do the features necessary end up getting strapped on like XRender in a way that leaves us with two parallel font management systems for different types of X Windows apps?

      The reason Linux has support for so many Window drivers is because of the XFree86 development team. They have done an incredible amount of work so that you can sit here and bitch. You don't have to like it, and you don't have to support it, but for god sakes, so atleast a little bit of respect for it.

      --
      int func(int a);
      func((b += 3, b));
  3. 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.

    1. Re:Just wanted to point out... by Pav · · Score: 3, Interesting

      A HCI idea I've been excited about for a long time is a "general interface spec"... ie. a general way to link an application to any number of interfaces.

      Just think :
      * You'd be able to twiddle kernel compile options on your interface of choice.
      * Applications suddenly become automatically accessible to the disabled.
      * Translation could be switched on (just in case the application doesn't support a particular language).
      * Interface development could SPEED ahead if a suite of decent programs are already developed.
      * Users can make choices about the bleeding-edge interfaces they use without worrying about supported applications.
      * Application developers don't have to port their wares to new interfaces.
      * From a Unix philosophy standpoint it just seems "right"... abstracting away the interface gives you a smaller more general tool.

      I've done lots of seaching for an implimentation of this idea, and probably the closest is in XML (can't remember the name unfortunately) but it's a bit limited both in functionality and available platforms.

  4. 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.
  5. 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)

  6. More of an art than science. by Circuit+Breaker · · Score: 3, Interesting

    Operating systems have so much material available because there's science involved - there are a few things that can be proved (e.g., shortest job first, lock-free / wait-free synchronziation primitives, Belady's FIFO anomaly) which should be known to everyone starting to practice. There is also a considerable accumulated body of knowledge which, though not based on solid math, has reached a "common knowledge" status.

    The same cannot be said about windowing systems. The algorithms are well documented, but there isn't much connection between them and actually building a windowing system. Building a windowing system is an art more than science or engineering - a system that's a masterpiece to one is considered bad practice by another.

    That said, if you want to learn from a system IMO exceptionally well balanced between doing things cleanly and making them work, take a look at FLTK (pronounced FullTick) - it revolves around the ridiculous and totally unaccepted idea that the GUI is only an aspect of your program, and that the logic of the program should not be influenced by how the GUI is implemented. How silly. (Yep, I know, SDNWOTN).

  7. 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!"
  8. Re:Wheel. by RedWizzard · · Score: 3, Interesting
    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.
    Actually screen top (or bottom, or side) menus work well because effectively they are infinitely high (or wide) so they're easy to aim at. I think the reason Windows doesn't use them is because they didn't want to give Apple more ammunition for their look and feel lawsuit. It's also possible that Apple have a patent on screen top menus - I know Commodore-Amiga owned a patent on auto-hiding screen top menus.
  9. 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;
    }

  10. SVG GUI by schepers · · Score: 3, Informative

    There is a new SourceForge project called SVgUI. The intent is to make a windowing system--Web and possibly desktop-based--using Scalable Vector Graphics (SVG). There are no released files yet, but several promising examples of GUI elements have been posted on the SVG-Developers list.

    Sorta off-topic, I know, but you might be interested in working with a community from the ground up.

  11. 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?
  12. 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!
  13. Re:Wheel. by Malc · · Score: 3, Interesting

    "For example, menus at the top of the screen (ala MacOS) worked well because a user's motor memory it trained to select items. "

    I think that works for small screens as in the original Macs. With big modern screens it's a pain in the arse. I also don't think it works well with the paradigm of over-lapping windows - one needs to associate the menu with active titlebar which could be on the smallest window at the bottom of the screen with a much bigger and more imposing "background" window fully visible in between. If all windows were maximised, this Mac menu paradigm might work, except then it's not much different to having the menu on the window under the titlebar. I also don't think that I'm too keen on the way the Mac menubar mixes application menu items and system items. MSFT do get one thing right with menus: they keep all of the items together at one end, anything else is bad (e.g. Netscape under X with it's Help menu in BFE!)

    "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.)."

    Yes, I agree with you here. MSFT's latest "innovation" of personalised menus is a real pain in the arse. I turned them off immediately - they're so loathesome! Even worse, the user interface for disabling these menus isn't consistent between MSFT apps, and really, if they're going to do it, it should be a display settings property to ensure system-wide consistency.

  14. Re:DONT by tjansen · · Score: 3, Interesting

    >suck. Writing more won't help. We need a better
    >windowing system, rewritten from scratch for
    >desktop use, that supports network operation >without sacrificing speed,

    How do you want to improve speed? That's one of the problems. People claim that its slow, but nobody has an idea of how to make it faster without making it less secure (by letting the programs/clients access the hardware directly) or putting everything in the kernel (trading speed for stability). The only other solution I see is to reduce traffic by putting more logic on the server, and this is something already exists, it's called DisplayPostScript... of course people would have to start using it, but this is more realistic than porting appliations to a completely new system.
    And even if there was a solution to improve speed, why start something new from scratch instead of using the existing XFree and adding a new communication mechanism?

    > supports transparency and vector fonts
    > internally

    What's the advantage of saying 'this command is internally' over using an extension? There is no big difference in the X11 protocol...

    > that includes a widget set/toolkit as part of
    > the windowing system.

    The only advantage for the user (less IPC traffic) can be achieved with DPS as well. You don't need a new windowing system for this...

    > Just look at OS X for proof that your argument
    > is entirely irrational.

    OS X does not have any X11 legacy applications, and they use a DisplayPostScript variant as well. And OF COURSE they made sure that all existing applications still work on their new system.

    bye...

  15. 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!
  16. You're absolutely right! by tswinzig · · Score: 3, Funny
    --

    "And like that ... he's gone."
  17. Re:DONT by Fnkmaster · · Score: 3, Interesting
    I'm sorry, I don't really understand your argument. I don't really think that "network transparency" should be part of the architecture of a desktop windowing environment at all, so I don't see what this has to do with security. When you are allowing remote apps to run on other desktops, yes, a security mechanism needs to be in place. X is slower in terms of putting pixels onto screen than any other modern desktop windowing system (i.e. Windows, Mac OS X, etc.). As in I can see Mozilla redrawing when I drag a window, even with a blazing processor, and blazing graphics card.


    With regards to "advantage of internal support for vector fonts", the advantage is that all apps would just say "draw these letters to the screen with these fonts" and the anti-aliasing, etc. would happen internally. Now, only apps written to the XRender extension do that. This means some apps support anti-aliasing, some don't. This makes my desktop ugly as sin. Also there are two parallel font management systems. This is a nightmare.


    OS X DOES support legacy X11 applications, since you can run XFree86 in rootless mode under Mac OS X. It's just that they are heinous looking compared to Aqua apps. :) I am not opposed to this kind of solution, and I'm not saying X doesn't have its uses, I'm just saying we CAN do better.


    As for your comments about DPS and the fact that OS X uses DPS as well, I am aware of that. If you are saying we could use X11 with DPS, I suppose that is true, but that seems like yet another awful hack to me. Why not just make something new and better (DPS based or otherwise) and support X11 as an add-on, or for backwards compatibility with legacy X11 apps?

  18. 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.)

  19. 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.

  20. No more, please!!! by suso · · Score: 3, Interesting

    PLEASE PLEASE PLEASE PLEASE PLEASE!!!!!
    Don't write any more window managers or windowing systems. When there are window managers out there called "Yet another window manager" or "Yet another window manager2" along with all those window managers that aim to be something special. It's just got to stop. What's needed are better applications that you can be productive with. Please focus on the applications that people demand, not on the ones that you think would be cool to write.

  21. Network transparency by coyote-san · · Score: 3, Insightful

    There are many possible cost metrics. One puts the most value in the most commonly used cases - if 99% of all users are local, focus on them and drop remote users.

    Another valid metric tries to minimize the cost of the legitimate, but rare, users. Network transparency has a small cost, but it's critical for the people who need it.

    Yet another valid metric tries to minimize the cost of development. It is extremely cheap to develop X Windows applications in the sense that the API I learned a decade ago is still in use today. Motif has come and gone, and there are now several additional toolkits, but it's nothing like the mishmash that Microsoft has produced in the same period.

    (On a similar note, compare how little C has changed between K&R C to ANSI C9X, vs. the massive changes Visual Basic has repeatedly suffered in far less time.)

    Yet another metric tries to minimize the cost of developing new drivers. The X wire protocol is well documented, and anyone who develops a driver that speaks it (as either client or server) can be confident that their code can be widely used. Non-wire protocols tend to mutate far more quickly, either decimating the potential user base or driving up development costs.

    Put it all together, and the costs of network transparency are outweighed by its many benefits for all but the most demanding local users. And even they gain from it, albeit in more subtle ways.

    Is X perfect? Of course not, but many of the "flaws" were actually design goals for long-gone hardware. When was the last time you used a monochrome dumb terminal? The wire protocols need to be extended to reflect the fact that commodity PC prices are now far lower than dumb terminal prices - use the power of those systems! But the key word there is extending the protocols, not replacing them. E.g., make the font system more flexible.

    But at the same time, at least once a month I find I need to run an X session remotely, and I can do that from both Unix and Windows boxes. I have never been able to run Windows remotely, although I've heard that BackOrifice is pretty good for that.

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  22. 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).

  23. Re:DONT by tjansen · · Score: 3, Insightful

    I don't really think that "network transparency" should be part of the architecture of a desktop windowing environment at all,

    There is not a real difference between inter-process-communication and a real network. Whatever you do with IPC can be done with a network as well.

    so I don't see what this has to do with security.

    To access the graphics hardware you need special privileges that a user-level app should not have. So you either need a server that has these priviliges (requiring IPC, the X11 way), give the app the power to access the hardware (bad idea if the user can install applications, but ok and used in some embedded solutions) or put a significant part of the windowing system in the kernel (not really recommended, but the windows way).

    With regards to "advantage of internal support for vector fonts", the advantage is that all apps would just say "draw these letters to the screen with these fonts" and the anti-aliasing, etc. would happen internally. Now, only apps written to the XRender extension do that. This means some apps support anti-aliasing, some don't.

    So what? Is your argument "the app has to be rewritten to use anti-aliased fonts, so I better rewrite it completely to use a new windowing system"? (and BTW it's usually only a matter of updating the toolkit)

    Why not just make something new and better (DPS based or otherwise) and support X11 as an add-on, or for backwards compatibility with legacy X11 apps?

    Because no user will notice the difference. Neither will most app developers who use toolkits anyway. It is just a HUGE amount of work, consider all the drivers, video support, 3D and so on, and what will be the result: nothing.

  24. Implement on top of OpenGL by Animats · · Score: 3, Interesting
    If you want to do a new window system, try one on top of OpenGL.
    • You can run on top of Linux, Microsoft, and Apple OSs, plus some others.
    • There's a well-defined API for talking to the display system.
    • By the time you get it done, everything on the market will have at least NVidia NForce 3D acceleration (which is equivalent to a GEForce 2), if not better. So there won't be a performance problem.
    • You can double-buffer, so that users never see partially drawn windows.
    • You can scale and morph windows easily, so you can implement effects like MacOS X, if you want to.
    • You can port Quake to it.