[Bf-committers] Code "cleanups" in buttons.c

Ton Roosendaal bf-committers@blender.org
Sun, 23 Feb 2003 11:49:51 +0100


Hi Timo,

I think it would help understanding the 'cleaning' you do when you  
start with publishing the concepts of the new GUI, how this will work,  
what the improvements will be, and the optimal migration path.

-Ton-



On Saturday, Feb 22, 2003, at 19:38 Europe/Amsterdam, Timo Mihaljov  
wrote:

> Hi everybody,
> as a first step in preparation for future GUI changes, I've used  
> refactoring
> to make (parts of) buttons.c more readable.
>
> At first I wanted to do this for just one function (I picked  
> curvebuts() at
> random) just to show everyone what I'd like to do to the source and  
> ask if
> it's OK to do that, but then I got carried away and reorganized  
> meshbuts()
> and commonbuts() aswell. :-)
>
> I haven't changed what the program does in any way, I've just  
> reorganized the
> actions in a way that IMHO is easier to understand at a quick glance.
>
> I made the following changes to the buttons.c in bf-tree CVS code:
> 1) I gave all the functions that draw the EditButtons for different  
> object
> types more sensible names: curvebuts() -> create_curve_edit_buttons(),
> commonbuts() -> create_common_edit_buttons(), etc.
>
> 2) I tried to make the code inside three of them
> (create_common_edit_buttons(), create_mesh_edit_buttons(),
> create_curve_edit_buttons()) easier to read. For doing this I also
>
> 3) created 3 helper functions: active_obj_ptr(), edited_obj_ptr() and
> obj_data_is_linked().
>
> I don't know if it's OK to include files in the mails to this list so  
> I'll
> just give you the URL where you can get the patch:
> http://matvei.joroinen.fi/partial_buttons_cleanup.patch
>
> I'd like to hear people's thoughts on changes like this to the code.  
> If the
> project managers are OK with it I'd like to continue to improve the
> architecture of the GUI system, as I think that there might be quite a  
> number
> of GUI changes coming up and I'd like to make them as easy as possible.
>
>
> Timo Mihaljov
> noid @ #blenderchat & #blendersauce
>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton@blender.org