OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Jan 20, 2018 7:12 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 6:13 am 
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?


Top
  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 6:17 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7184
Location: Germany
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?


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

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 7:37 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5959
Location: In a galaxy, far, far away
Code:
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.


struct Widget_class {
void draw(Widget_object *wo, DrawingArea *da);
void process(Widget_object *wo, GuiEvent *ev);
};
Code:

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);
}


window are just 'special' containers. The 'root' object should list all window and will have display/process features that handles window overlapping (possibly adding clipping zones to the drawing area), window moving (for instance capturing mouse movement when ALT key and button 1 are pressed together or when a title bar is clicked ...

HTH.

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 7:54 am 
Offline
Member
Member

Joined: Sat Nov 25, 2006 12:50 am
Posts: 454
..


Last edited by Perica on Tue Dec 05, 2006 9:28 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 8:17 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7184
Location: Germany
Perica wrote:
As for the licensing issue, what do you mean by "you don't want the source code getting out of your control" ?


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.

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.


Top
 Profile  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 8:24 am 
Quote:
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.

I completely agree.
Just going for my OWN license ;D
Quote:
I've been working on this project over one and a half year

Pretty fast ;)


Top
  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 10:18 am 
Quote:
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...


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.

Quote:
Do you have a compiled binary version of your operating system available on the internet so we can download and test it?


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.

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.


Top
  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 10:21 am 
Quote:
I will also have to find a way to handle the order of "draw" sequences for a total screen refresh.


I mean the "z-order" thing of course... :)


Top
  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Wed Apr 21, 2004 11:14 am 
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.


Top
  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Thu Aug 18, 2005 6:28 am 
Im impressed :D
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 :)


Top
  
 
 Post subject: Re:Graphical User Interface Design
PostPosted: Thu Aug 18, 2005 6:39 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7184
Location: Germany
The notion is appreciated, but please... this thread is over a year old!

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot], Roman and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group