[Bf-committers] possible redesign step?

Ton Roosendaal bf-committers@blender.org
Sat, 31 May 2003 15:20:43 +0200


Hi Michel,

Good you remind me, that's what you get with soooo many mails coming in  
here.
I wanted to reply as well:

(bandoler wrote:)
> Hello,
>   I think that maybe the user interface in blender could be moved to  
> ghost, or to a "separate" library on top of ghost. I've seen that most  
> controls are implemented ina monolythic file called "interface.c".

That's not entirely correct. In interface.c just the buttons are  
handled. And there is a layer between this and ghost that should need  
attention first!

I mean here the Blender 'screen' and 'window' code (mywindow.c screen.c  
editscreen.c space.c ghostwinlay.c). It has been polluted in the past  
quite some when the port to Glut was done... there are also still  
issues with the internal swapbuffers system.

This system is a sort-of window manager using opengl. This was written  
after experimenting with the iris window system and X, which both had a  
very slow and cumbersome handling of a subwindow (for window  
subdivision) system.

What ghost now enables, is not only cleaner code, but also upgrading  
the event structure in Blender. It now uses 2 shorts for events (iris  
gl convention). That can be done quite some more advanced, also based  
at message handlers and with python hooks.

Further, I think it is not wise to expand ghost with buttons...  
especially not with code that is too blender-specific.

>    Separating it and maybe converting to C++ would have the following  
> benefits:
>    - easier to document
>    - better extensibility,
>    - portability: with a frozen interface for this library many things  
> are possible like implementing skins or using other GUI libraries with  
> wrappers. I've hear something about Aqua...

C++ is OK, for as long the library has a C interface.
But: as explained, the blender interface code is far more than just  
buttons... so it is:
a) very hard to pull out
b) designed completely custom for blender
c) not easy at all to replace with another GUI library

>    - integration of other components: a python IDE has been proposed  
> to develop blender (the editor is nice, but needs many features  
> difficult to implement). That ide is written using wxWindows (which i  
> personally dislike). If the UI in Blender was in a separate C++  
> library, and with some extensions, maybe that IDE could get ported to  
> be native and completely integrated in blender windows?

I still have no real clue what this IDE is good for! :-) If it is just  
a text editor for python scripts... then we could better implement  
dynamic scripts in blender (that just reload scripts when changed).

>> Hello,
>>    I think that maybe the user interface in blender could be moved to
>> ghost, or to a "separate" library on top of ghost. I've seen that most
>> controls are implemented ina monolythic file called "interface.c".
>
> I agree with you about moving the code for the controls out of
> source/blender/src
>
> I propose to do this in 2 steps:
>
> - Move the code out of source/blender/src without altering the
>   functionality. Of course, bugs should be fixed :)
> - Possible redesign the code for the controls in an OO design. This  
> will
>   have an impact on the interface code in source/blender/src.

Hrms... removing code out is easy, but does not solve anything at  
all... except that it suggest another level of organization that's not  
there.

Better is to define a target, and work on that... the exact directory  
where code resides is not important. Now i wished I had more time for  
it myself... in its origin, the interface is not too bad structured at  
all, and can be organized & documented quite a lot better. Revealing  
this structure under all garbish and dust is something I could do best,  
or at least help others with who want to get a full understanding of  
that code.

But, of course we can discuss this tomorrow in more detail of course!

-Ton-

------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton@blender.org