diff options
author | Thomas Dinges <blender@dingto.org> | 2016-08-26 00:51:58 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2016-08-26 01:16:31 +0300 |
commit | 10d3fe34ecdcc96e097eaeff8378d0793fecc8ea (patch) | |
tree | 9a5ce3b2c8c85026a3a90dfd0c0b31826677e6b3 | |
parent | 09ea19c76e3f16396be48b50998211ae02b193fa (diff) |
Further work on the Statistics Editor.
* Fix drawing, now it at least draws a solid main area.
* Add empty UI py file.
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_stats.py | 32 | ||||
-rw-r--r-- | source/blender/editors/space_stats/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/editors/space_stats/space_stats.c | 27 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 2 |
5 files changed, 61 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 2389be6787d..d478e455083 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -75,6 +75,7 @@ _modules = [ "space_outliner", "space_properties", "space_sequencer", + "space_stats", "space_text", "space_time", "space_userpref", diff --git a/release/scripts/startup/bl_ui/space_stats.py b/release/scripts/startup/bl_ui/space_stats.py new file mode 100644 index 00000000000..72a4ae61917 --- /dev/null +++ b/release/scripts/startup/bl_ui/space_stats.py @@ -0,0 +1,32 @@ +# ##### 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +from bpy.types import Header, Menu + + +class LAYERS_HT_header(Header): + bl_space_type = 'STATS' + + def draw(self, context): + layout = self.layout + layout.template_header() + +if __name__ == "__main__": # only for live edit. + bpy.utils.register_module(__name__) diff --git a/source/blender/editors/space_stats/CMakeLists.txt b/source/blender/editors/space_stats/CMakeLists.txt index d11156ec745..ff23513dfa8 100644 --- a/source/blender/editors/space_stats/CMakeLists.txt +++ b/source/blender/editors/space_stats/CMakeLists.txt @@ -22,10 +22,12 @@ set(INC ../include ../../blenkernel ../../blenlib + ../../gpu ../../makesdna ../../makesrna ../../windowmanager ../../../../intern/guardedalloc + ../../../../intern/glew-mx ) set(INC_SYS diff --git a/source/blender/editors/space_stats/space_stats.c b/source/blender/editors/space_stats/space_stats.c index 3ebd3212d02..86659661357 100644 --- a/source/blender/editors/space_stats/space_stats.c +++ b/source/blender/editors/space_stats/space_stats.c @@ -26,6 +26,8 @@ #include "MEM_guardedalloc.h" +#include "BIF_gl.h" + #include "BKE_context.h" #include "BKE_screen.h" @@ -38,6 +40,10 @@ #include "ED_screen.h" #include "ED_space_api.h" +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + #include "WM_types.h" @@ -85,9 +91,26 @@ static void stats_main_region_init(wmWindowManager *UNUSED(wm), ARegion *ar) ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE; } -static void stats_main_region_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar)) +static void stats_main_region_draw(const bContext *C, ARegion *ar) { - printf("Look Sergey, it's an Editor!\n"); + View2D *v2d = &ar->v2d; + float size_x = ar->winx; + float size_y = 0.0f; + + UI_ThemeClearColor(TH_BACK); + glClear(GL_COLOR_BUFFER_BIT); + + /* update size of tot-rect (extents of data/viewable area) */ + UI_view2d_totRect_set(v2d, size_x, size_y); + + /* reset view matrix */ + UI_view2d_view_restore(C); + + /* scrollers */ + View2DScrollers *scrollers; + scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); + UI_view2d_scrollers_draw(C, v2d, scrollers); + UI_view2d_scrollers_free(scrollers); } /* add handlers, stuff you only do once or on area/region changes */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index d8c36cbcf24..00280749c9f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -79,7 +79,7 @@ EnumPropertyItem rna_enum_space_type_items[] = { {0, "", ICON_NONE, NULL, NULL}, {SPACE_BUTS, "PROPERTIES", ICON_BUTS, "Properties", "Edit properties of active object and related data-blocks"}, {SPACE_OUTLINER, "OUTLINER", ICON_OOPS, "Outliner", "Overview of scene graph and all available data-blocks"}, - {SPACE_STATS, "STATS", ICON_OOPS, "Statistics", "Display various statistics and logs"}, + {SPACE_STATS, "STATS", ICON_SCRIPT, "Statistics", "Display various statistics and logs"}, {SPACE_USERPREF, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", "Edit persistent configuration settings"}, {SPACE_INFO, "INFO", ICON_INFO, "Info", "Main menu bar and list of error messages (drag down to expand and display)"}, {0, "", ICON_NONE, NULL, NULL}, |