Graphical User Interface Design
Graphical User Interface Design
Hi...
I'm developing my own operating system... the kernel is complete with all multi-thread multi-process, ( all usual OS functionalities ) etc support, the filesystem is complete and working, I am planning to build a graphical user interface subsystem on my operating system.
The display interface is vesa based, and all putpixel, drawline, drawrect type libraries are already implemented.
now I need advice about how to program a windowing subsystem, how to implement windows, buttons, checkboxes etc all those kind of stuff.
thanks.
...Cemre...
PS: I'm planning to distribute the source codes of my operating system, but i'm not quite sure about it, I've been working on this project over one and a half year, and i just don't want it to get out of my own control... what do you think about this? what would you suggest?
I'm developing my own operating system... the kernel is complete with all multi-thread multi-process, ( all usual OS functionalities ) etc support, the filesystem is complete and working, I am planning to build a graphical user interface subsystem on my operating system.
The display interface is vesa based, and all putpixel, drawline, drawrect type libraries are already implemented.
now I need advice about how to program a windowing subsystem, how to implement windows, buttons, checkboxes etc all those kind of stuff.
thanks.
...Cemre...
PS: I'm planning to distribute the source codes of my operating system, but i'm not quite sure about it, I've been working on this project over one and a half year, and i just don't want it to get out of my own control... what do you think about this? what would you suggest?
Re:Graphical User Interface Design
I feel the same about giving away not only the source, but the control over my own project. I am working on a proprietary license agreement (http://www.pro-pos.org/wiki/LicenseAgreement) that will try to strike a compromise between Open Source and control over your project. (Unfinished yet, as so many things. *sigh*.)Cemre wrote:
PS: I'm planning to distribute the source codes of my operating system, but i'm not quite sure about it, I've been working on this project over one and a half year, and i just don't want it to get out of my own control... what do you think about this? what would you suggest?
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Graphical User Interface Design
Code: Select all
woow! all that stuff in 1.5 year !!
basically, you will define [i]widget[/i] classes, that will be responsible to draw objects on screen and process input events.
void draw(Widget_object *wo, DrawingArea *da);
void process(Widget_object *wo, GuiEvent *ev);
};
Code: Select all
The 'DrawingArea' usually includes informations such as the memory region in which the widget should be rendered, clipping zones, etc.
Compound widget such as menu, frames, etc. are usually [i]containers[/i] of simpler widget. I.e.
struct IconsMenuWidget {
struct WidgetClass _class;
struct Widget *contains[];
int spacing;
int itemsize;
int nbwidgets;
};
IconsMenuDraw(wo,da) {
DrawingArea d=*da;
d.x+=wo->spacing; // keep a border around icons
d.y+=wo->spacing;
d.w=wo->itemsize; // and prevent icons from getting out
d.h-=wo->itemsize; // of their assigned box.
for (int i=0; i<wo->nbwidgets; i++) {
wo->contains[i]->class->draw(wo->contains[i],&d);
d.x+=wo->itemsize+wo->spacing;
}
}
IconsMenuProcess(wo,ev) {
GuiEvent e=*ev;
int selected=(ev.x-wo->spacing)/(wo->itemsize+wo->spacing);
e.x= (ev.x-wo->spacing)%(wo->itemsize+wo->spacing);
e.y=(ev.y-wo->spacing);
wo->contains[selected]->class->process(wo->contains[selected],e);
}
HTH.
Re:Graphical User Interface Design
..
Last edited by Perica on Tue Dec 05, 2006 9:28 pm, edited 1 time in total.
Re:Graphical User Interface Design
I speak only for myself here, but I am confident Cemre will agree:Perica wrote: As for the licensing issue, what do you mean by "you don't want the source code getting out of your control" ?
Sometimes it is necessary to make unpopular design decisions for a greater ultimate benefit. With traditional Open Source licenses, every anybody is allowed to take your hard-earned work, go down the more popular way (no matter how inferor in the long run), yelling "follow me!". With people and the world being as they are, chances are people will flock to the more popular source fork.
You just kick-started a competitive project into existence, including flamewars, compatibility issues, backporting, code merges, and everything that goes with it.
You will notice that every really successful Open Source project has a strong, benign dictatorship at the helm, and is recognized as being "the real thing" because it has been around since well before the "I want my own pet project" craze. Any branch of Linux will be just that - a branch of "the real thing". Same for KDE, GCC, GLibC, whatever.
A small startup project does not enjoy this level of public recognition, and is ripped off rather easily.
IMHO, as always.
Every good solution is obvious once you've found it.
Re:Graphical User Interface Design
I completely agree.I speak only for myself here, but I am confident Cemre will agree:
Sometimes it is necessary to make unpopular design decisions for a greater ultimate benefit. With traditional Open Source licenses, every anybody is allowed to take your hard-earned work, go down the more popular way (no matter how inferor in the long run), yelling "follow me!". With people and the world being as they are, chances are people will flock to the more popular source fork.
Just going for my OWN license ;D
Pretty fastI've been working on this project over one and a half year
Re:Graphical User Interface Design
It changes from time to time, sometimes i don't sleep to finish a component of the OS, sometimes i don't write a simple line of code for 3-4 days.As Pype pointed out, it's amazing that you can get that much done in 1.5 years . How much time do you spend writing your operating system every day
(approx.)? Just out of curiosity. And what motivates you the most? Because I myself am pretty short on motivation for operating system development, it just seems like one huge job with no real reward at the end - besides the operating system itself...
I have partition images of the OS ( also available to use in Bochs, where most of the development is made ) I'm going to upload a use-able, functional version of the OS after I finish the Windowing subsystem. but at least a notepad ( an editor ), and a file manager, file browser will be included in the binary.Do you have a compiled binary version of your operating system available on the internet so we can download and test it?
About the motivation: This project previously was an amateur attempt to learn the basics of OS and hardware programming. At first times, the code would completely change every day, week. Soon after, the components were so stabilized that the basics and the design of the OS didn't change in major level. And I thought that "God, i AM doing something more than an amateur project, this thing has really developped much".
Actually this project just makes me feel good, makes me feel I'm doing something big.
Anyway, this much about the motivation, it's just not completely tell-able, but again, it makes me feel that I am important.
About the GUI now...
I'm going to use c++ to develop the windowing system since it sounds more suitable for an OOP design. every button, window, menu, checkbox etc will extend a base "GuiObject" class inside which "draw" method is declared "virtual". ( as speaking for a Java jargon, every class will implement a GuiObject interface, but of course the c++ way ) the "Widget" keyword reminds me my days of KDE, Gnome, X-Window linux programming.
I will also have to find a way to handle the order of "draw" sequences for a total screen refresh.
The message handling mechanism is similar to what we do in windows, there exists message boxe per every thread in the OS. the "GetMessage", "SendMessage" and "Find/WaitMessage" system calls will handle it.
typedef struct {
int Message;
int Parameter;
int Sender; // sender thread id
int SysPar; // reserved for messages sent by the system
} Message;
Message msg;
do {
GetMessage ( &msg , true /* block until arrival of new msg */ );
switch ( msg.Message ) {
...
};
} while ( true );
etc...
Thanks about the talk about developing a new end user licence agreement, I completely agree with "Solar", He is just as a good advocate of mine a new licence must be developed to protect the programmer from being overpassed ( or bypassed, if this is the right word for it ). GPL is not enough for this.
Re:Graphical User Interface Design
I mean the "z-order" thing of course...I will also have to find a way to handle the order of "draw" sequences for a total screen refresh.
Re:Graphical User Interface Design
To me the greatest fear on releasing my code is that people will down load it, Just to Cherry pick the best bits from the code to put in there OS.
When you've spent weeks debugging it and finely get it right the last thing you want to do is give it away.
But then it has help looking at others code,So what is the answer.
May be to do a tut,on how it is done, But not the code it self ?.
ASHLEY4.
When you've spent weeks debugging it and finely get it right the last thing you want to do is give it away.
But then it has help looking at others code,So what is the answer.
May be to do a tut,on how it is done, But not the code it self ?.
ASHLEY4.
Re:Graphical User Interface Design
Im impressed
I always get tons of bull from others...you cant do this, or you cant do that. you need massive capital. Dont let your vision be manupilated by others or even big business...after all, everyone started just like you guys...and theres always a way!!! AWAYS!
I personally work all night coding on my creation too, I went to med-school and found myself hating it. I love to create like you guys. Its very motivational to read the blogs here ;D
The fact is...you guys are on the right track, GOOD LUCK GUYS
I always get tons of bull from others...you cant do this, or you cant do that. you need massive capital. Dont let your vision be manupilated by others or even big business...after all, everyone started just like you guys...and theres always a way!!! AWAYS!
I personally work all night coding on my creation too, I went to med-school and found myself hating it. I love to create like you guys. Its very motivational to read the blogs here ;D
The fact is...you guys are on the right track, GOOD LUCK GUYS
Re:Graphical User Interface Design
The notion is appreciated, but please... this thread is over a year old!
Every good solution is obvious once you've found it.