diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-08-18 16:58:51 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-08-18 16:58:51 +0400 |
commit | 990dcd0f7f362828eddeaca191640c1680808a6c (patch) | |
tree | c49767c528436e9153fe496b26dd5b6314f19572 /source/blender/editors | |
parent | ac2451c6be437fba14f9c0ceeeaeab382fd9ad58 (diff) |
2.5:
* Split Info and User preferences into two separate spaces.
* Renamed Buttons Window to Properties also in RNA identifiers.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/Makefile | 1 | ||||
-rw-r--r-- | source/blender/editors/SConscript | 1 | ||||
-rw-r--r-- | source/blender/editors/include/ED_space_api.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 9 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_api/spacetypes.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_info/info_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/space_userpref/Makefile | 55 | ||||
-rw-r--r-- | source/blender/editors/space_userpref/SConscript | 14 | ||||
-rw-r--r-- | source/blender/editors/space_userpref/space_userpref.c | 188 | ||||
-rw-r--r-- | source/blender/editors/space_userpref/userpref_intern.h | 34 | ||||
-rw-r--r-- | source/blender/editors/space_userpref/userpref_ops.c | 33 |
15 files changed, 342 insertions, 8 deletions
diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile index dbd0ca779aa..bbbb3fb985f 100644 --- a/source/blender/editors/Makefile +++ b/source/blender/editors/Makefile @@ -65,5 +65,6 @@ DIRS = armature \ space_text \ space_sequencer \ space_logic \ + space_userpref \ include nan_subdirs.mk diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript index 0a13082faaf..05f17dae1a1 100644 --- a/source/blender/editors/SConscript +++ b/source/blender/editors/SConscript @@ -32,6 +32,7 @@ SConscript(['datafiles/SConscript', 'space_sequencer/SConscript', 'space_logic/SConscript', 'space_console/SConscript', + 'space_userpref/SConscript', 'transform/SConscript', 'screen/SConscript', 'sculpt_paint/SConscript', diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index efaf0f56f92..04b6be3bcaa 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -52,6 +52,7 @@ void ED_spacetype_text(void); void ED_spacetype_sequencer(void); void ED_spacetype_logic(void); void ED_spacetype_console(void); +void ED_spacetype_userpref(void); /* calls for instancing and freeing spacetype static data called in WM_init_exit */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index efff5b8f39c..05001109b53 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -104,7 +104,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) SpaceButs *sbuts= sa->spacedata.first; return sbuts->align; } - else if(sa->spacetype==SPACE_INFO && ar->regiontype == RGN_TYPE_WINDOW) + else if(sa->spacetype==SPACE_USERPREF && ar->regiontype == RGN_TYPE_WINDOW) return BUT_VERTICAL; else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) return BUT_VERTICAL; diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 297e22610a6..5b51d898235 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -150,6 +150,9 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) case SPACE_INFO: ts= &btheme->tinfo; break; + case SPACE_USERPREF: + ts= &btheme->tuserpref; + break; case SPACE_TIME: ts= &btheme->ttime; break; @@ -402,6 +405,7 @@ static void ui_theme_init_new(bTheme *btheme) ui_theme_init_new_do(&btheme->ttime); ui_theme_init_new_do(&btheme->tnode); ui_theme_init_new_do(&btheme->tlogic); + ui_theme_init_new_do(&btheme->tuserpref); } @@ -583,6 +587,10 @@ void ui_theme_init_userdef(void) btheme->tinfo= btheme->tv3d; SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0); + /* space user preferences */ + btheme->tuserpref= btheme->tv3d; + SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0); + /* space sound */ btheme->tsnd= btheme->tv3d; SETCOLF(btheme->tsnd.back, 0.45, 0.45, 0.45, 1.0); @@ -1233,6 +1241,7 @@ void init_userdef_do_versions(void) } SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0); + SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0); } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index ff84542a7cd..ea1541a4e02 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1066,8 +1066,9 @@ static char *windowtype_pup(void) "|%l" "|Properties %x4" - "|User Preferences %x7" "|Outliner %x3" + "|User Preferences %x19" + "|Info%x7" "|%l" "|%l" diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 5c33b648947..041e6a09323 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -77,6 +77,7 @@ void ED_spacetypes_init(void) ED_spacetype_sequencer(); ED_spacetype_logic(); ED_spacetype_console(); + ED_spacetype_userpref(); // ... /* register operator types for screen and all spaces */ diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 6b89532cdaf..530500cfafa 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -311,7 +311,6 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) ToolSettings *ts; Brush *br= NULL; PointerRNA *ptr= &path->ptr[path->len-1]; - const Object *obact = CTX_data_active_object(C); /* if we already have a (pinned) brush, we're done */ if(RNA_struct_is_a(ptr->type, &RNA_Brush)) { @@ -333,7 +332,7 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) } } - /* no path to a world possible */ + /* no path to a brush possible */ return 0; } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index e52efe8508d..057f35a2487 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -916,7 +916,7 @@ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) uiPopupMenu *pup; uiLayout *layout; - RNA_pointer_create(&sc->id, &RNA_SpaceButtonsWindow, sbuts, &ptr); + RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr); pup= uiPupMenuBegin(C, "Align", 0); layout= uiPupMenuLayout(pup); diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h index 519364b58d9..070b627af07 100644 --- a/source/blender/editors/space_info/info_intern.h +++ b/source/blender/editors/space_info/info_intern.h @@ -32,9 +32,6 @@ struct wmOperatorType; -/* info_header.c */ -void info_header_buttons(const bContext *C, ARegion *ar); - void FILE_OT_pack_all(struct wmOperatorType *ot); void FILE_OT_unpack_all(struct wmOperatorType *ot); void FILE_OT_make_paths_relative(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_userpref/Makefile b/source/blender/editors/space_userpref/Makefile new file mode 100644 index 00000000000..be7206f51ce --- /dev/null +++ b/source/blender/editors/space_userpref/Makefile @@ -0,0 +1,55 @@ +# +# $Id$ +# +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The Original Code is Copyright (C) 2007 Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL LICENSE BLOCK ***** +# +# Makes module object directory and bounces make to subdirectories. + +LIBNAME = ed_userpref +DIR = $(OCGDIR)/blender/$(LIBNAME) + +include nan_compile.mk + +CFLAGS += $(LEVEL_1_C_WARNINGS) + +CPPFLAGS += -I$(NAN_GLEW)/include +CPPFLAGS += -I$(OPENGL_HEADERS) + +# not very neat.... +CPPFLAGS += -I../../windowmanager +CPPFLAGS += -I../../blenloader +CPPFLAGS += -I../../blenkernel +CPPFLAGS += -I../../blenlib +CPPFLAGS += -I../../makesdna +CPPFLAGS += -I../../makesrna +CPPFLAGS += -I../../imbuf +CPPFLAGS += -I../../python +CPPFLAGS += -I../../blenfont +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include + +# own include + +CPPFLAGS += -I../include diff --git a/source/blender/editors/space_userpref/SConscript b/source/blender/editors/space_userpref/SConscript new file mode 100644 index 00000000000..1b808a5a7c0 --- /dev/null +++ b/source/blender/editors/space_userpref/SConscript @@ -0,0 +1,14 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('*.c') + +incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' + +defs = [] + +if env['WITH_BF_GAMEENGINE']: + defs.append('GAMEBLENDER=1') + +env.BlenderLib ( 'bf_editors_space_userpref', sources, Split(incs), defs, libtype=['core'], priority=[70] ) diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c new file mode 100644 index 00000000000..8c9d723ce2c --- /dev/null +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -0,0 +1,188 @@ +/** + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <string.h> +#include <stdio.h> + +#include "DNA_space_types.h" +#include "DNA_screen_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" + +#include "BKE_context.h" +#include "BKE_screen.h" + +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "userpref_intern.h" // own include + +/* ******************** default callbacks for userpref space ***************** */ + +static SpaceLink *userpref_new(const bContext *C) +{ + ARegion *ar; + SpaceUserPref *spref; + + spref= MEM_callocN(sizeof(SpaceUserPref), "inituserpref"); + spref->spacetype= SPACE_USERPREF; + + /* header */ + ar= MEM_callocN(sizeof(ARegion), "header for userpref"); + + BLI_addtail(&spref->regionbase, ar); + ar->regiontype= RGN_TYPE_HEADER; + ar->alignment= RGN_ALIGN_BOTTOM; + + /* main area */ + ar= MEM_callocN(sizeof(ARegion), "main area for userpref"); + + BLI_addtail(&spref->regionbase, ar); + ar->regiontype= RGN_TYPE_WINDOW; + + return (SpaceLink *)spref; +} + +/* not spacelink itself */ +static void userpref_free(SpaceLink *sl) +{ +// SpaceUserPref *spref= (SpaceUserPref*) sl; + +} + + +/* spacetype; init callback */ +static void userpref_init(struct wmWindowManager *wm, ScrArea *sa) +{ + +} + +static SpaceLink *userpref_duplicate(SpaceLink *sl) +{ + SpaceUserPref *sprefn= MEM_dupallocN(sl); + + /* clear or remove stuff from old */ + + return (SpaceLink *)sprefn; +} + + + +/* add handlers, stuff you only do once or on area/region changes */ +static void userpref_main_area_init(wmWindowManager *wm, ARegion *ar) +{ + ED_region_panels_init(wm, ar); +} + +static void userpref_main_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_panels(C, ar, 1, NULL, -1); +} + +void userpref_operatortypes(void) +{ +} + +void userpref_keymap(struct wmWindowManager *wm) +{ + +} + +/* add handlers, stuff you only do once or on area/region changes */ +static void userpref_header_area_init(wmWindowManager *wm, ARegion *ar) +{ + ED_region_header_init(ar); +} + +static void userpref_header_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_header(C, ar); +} + +static void userpref_main_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ +} + +static void userpref_header_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + default: + break; + } + +} + +/* only called once, from space/spacetypes.c */ +void ED_spacetype_userpref(void) +{ + SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype userpref"); + ARegionType *art; + + st->spaceid= SPACE_USERPREF; + + st->new= userpref_new; + st->free= userpref_free; + st->init= userpref_init; + st->duplicate= userpref_duplicate; + st->operatortypes= userpref_operatortypes; + st->keymap= userpref_keymap; + + /* regions: main window */ + art= MEM_callocN(sizeof(ARegionType), "spacetype userpref region"); + art->regionid = RGN_TYPE_WINDOW; + art->init= userpref_main_area_init; + art->draw= userpref_main_area_draw; + art->listener= userpref_main_area_listener; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + + BLI_addhead(&st->regiontypes, art); + + /* regions: header */ + art= MEM_callocN(sizeof(ARegionType), "spacetype userpref region"); + art->regionid = RGN_TYPE_HEADER; + art->minsizey= HEADERY; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + art->listener= userpref_header_listener; + art->init= userpref_header_area_init; + art->draw= userpref_header_area_draw; + + BLI_addhead(&st->regiontypes, art); + + + BKE_spacetype_register(st); +} + diff --git a/source/blender/editors/space_userpref/userpref_intern.h b/source/blender/editors/space_userpref/userpref_intern.h new file mode 100644 index 00000000000..596c2675b01 --- /dev/null +++ b/source/blender/editors/space_userpref/userpref_intern.h @@ -0,0 +1,34 @@ +/** + * $Id: + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef ED_USERPREF_INTERN_H +#define ED_USERPREF_INTERN_H + +/* internal exports only */ + +#endif /* ED_USERPREF_INTERN_H */ + diff --git a/source/blender/editors/space_userpref/userpref_ops.c b/source/blender/editors/space_userpref/userpref_ops.c new file mode 100644 index 00000000000..91a6651bd92 --- /dev/null +++ b/source/blender/editors/space_userpref/userpref_ops.c @@ -0,0 +1,33 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include <string.h> +#include <stdio.h> + +#include "userpref_intern.h" + |