Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
ineo wrote:
Maybe we should have a dedicated "graphics, gui design" section.
Well, personally, i'm happy the way it works atm. If we had a "graphic" board, and another "filesystem" board, and yet a "networking" board, it would split up the community and checking the bare "Osdev" board would become "so, who's got trouble with bootsectors today" boredom (or is it boreness? )...
just a suggestion
now, if you wish to collate gui-related threads from one single root, you're welcome to add them as "related threads" of a wiki page ... say Osdeving like James T. Klik (noticed the StarTrek addiction ?)
My point was that most of the questions are not OS oriented, they are more graphics oriented. I know some people who develop "window managers" who could help, but they are not reading OS forums.
But I guess you always have answers if you haven't noticed that before.
I'm thinking 3D graphics with "first-person traverse technology" where you can interact with the environment like real-life. Sorta some kind of matrix feel where everything is avilable to use.
Mine really doesn't fit anything in the poll. It's just a system to split up the available framebuffer into rectangular pieces, give control of these to programs, and manage where input gets directed.
Instead of windows, I plan to have surfaces. Surfaces can be any rectangular portion of screen space, and indeed there will be a parent surface called Screen. Whichever program has control of a surface (can write), will also be allowed to create sub-surfaces. Every sub-surface will have a border around it. Each side of the border will do a different thing: the top will close the program, the bottom will focus the surface, and the sides will be indicators. One of them will be highlighted to show mouse focus and the other to show keyboard focus. Clicking either of them will drag focus that input onto that surface. No two surfaces will be allowed to intersect.
A graphics subsystem will be available with calls to draw lines and text, as well is do blitting to that surfaces section of framebuffer memory. Only the owning surface and the kernel will know the coordinates of that area, and only the kernel will have the pointer to that memory. Actually, I don't know how but I'd like to be able to just hand the controlling program a pointer to the surface it owns in memory and let it draw, but I don't know how to protect the surfaces around that one from a rogue program or drawing routine. Any ideas?
The point of this is to create a GUI system where programs draw where they like and input can be used in different ways. A program might open a command prompt or shell in one sub-surface of its surface, and use the rest of graphical display. The mouse would focus on the graphical surface, and the keyboard on the shell.
If the user wants a normal GUI, they can write a program to acquire the Screen surface and draw one.
Crazed123, isn't that how a regular raster GUI works? Ok, granted, most provide some idea of "window" with a feature or two to manage them, but basicly windows are just sub-surfaces of the screen...
They can't overlap in my system. The entire screen is tiled up into surfaces, tiled. They can't overlap and the chief feature really is that they can have different input foci for the mouse and keyboard. Also, I'm going with the alternative of just letting the surface controllers draw directly.
Yeah, I was actually wondering something. How do I give the program access to a particular rectangle of the framebuffer without giving it access to the whole thing?
Also, will giving a framebuffer pointer preclude all future use of hardware acceleration? Cause I was just planning on allowing drawing to the buffer, lines and text done in kernel, and maybe anything else VESA happens to expose in Protected Mode.
You don't give a program access to a particular (arbitary) rentangle, at least not with really evil hacks or total lack of control about where the program can draw. Instead, you can give a program access to a memory buffer, and then copy that memory buffer to screen. You can then optimize by allowing the program to specify which region to copy to screen (so as to avoid copying non-modified content).
You can also give a program a piece of offscreen video memory if you have accelerated drivers and memory to spend. In this case you can do the copying as an accelerated bitBlt-operation, although I probably should mention that accelerated bitBlts from main memory to screen are sometimes (often?) also possible, so the difference is not as big as one might think. It's mainly useful when most of the image doesn't change (or part of the old image can be reused, like in scrolling).
Finally, especially if you give a program a secondary buffer, I don't see any reason why you shouldn't let programs access accelerated drawing features as well.
Some existing GUIs (cough...X11..cough...) actually only allow "drawing commands" to access the screen, so if you want to have a buffer and bitblt that to screen you have to make it an image and draw the image.... oh well..
Personally, I advocate the idea of just giving each program a buffer. Then you can draw those buffers in any way you want, doing transfluencies and fancy animations, blurring effects, shadows... and ... well.. whatever. If 3d acceleration was not such a pain to support (that is, if 3d card vendors where a little more cooperative) one could even make each window a texture, and do all the fancy effects in hardware!
I think I know what I'll do. Each surface-owner will get a memory buffer they can draw directly into. Random buffers for drawing will be accessible possibly through a special malloc. When a special call is made, the surface-buffer will be blitted to screen. The need for a special malloc comes from wanting it to be transparent to the user program whether or not they're working with hardware accelerated memory or normal RAM. Same thing to the blit calls.
beyond infinity wrote:
I am not sure if I get you: what do you mean with "special malloc" and "hardware accelerated memory?" I'm clueless.
Normally the user-program's malloc is coded into the RunTime Library, such as FreePascal RTL or LibC. In order to allocate surface space, my kernel will expose its own special malloc. This malloc will function like a normal one, except that it will check for hardware accelerated video memory and give the program a piece of that if it is available. Otherwise it will allocate from main system RAM.
Wow! I didn't know so many people where working on their GUI. I really haven't started working on that because I have has classes and I'm trying to work on a media library for XMMS.
I have thought of making the GUI a module which can be loaded into the kernel. In this way, the GUI would run faster, but you could still choose your GUI.(like themes but better)