diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-17 02:47:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-17 02:47:27 +0400 |
commit | deb180e37f324ab789ecbf608d08c9f031953749 (patch) | |
tree | 1e8c4525cc9180ed9b7eb88523c9bef32345c90f /source/blender/blenkernel | |
parent | 9eebb2ca36fc7ea05fb46eb23cca8821e81889b8 (diff) |
- Scrollbars for the console (use View2D functions)
- Set View2D operators not to register, got in the way a lot with the console.
- Made autocomplete Ctrl+Enter so Tab can be used.
- Should work with python 2.5 now. (patch from Vilda)
- Moved report struct definitions into DNA_windowmanager_types.h, could also have DNA_report_types.h however the reports are not saved, its just needed so the report list can be used in the wmWindowManager struct. Fixes a crash reported by ZanQdo.
- Store the report message length in the report so calculating the total height including word wrap is not so slow.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_report.h | 38 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 6 |
3 files changed, 7 insertions, 39 deletions
diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index 26853866ebb..1d72b1c81f0 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -32,48 +32,14 @@ extern "C" { #endif -#include "DNA_listBase.h" +#include "DNA_windowmanager_types.h" /* Reporting Information and Errors * * These functions also accept NULL in case no error reporting * is needed. */ -typedef enum ReportType { - RPT_DEBUG = 1<<0, - RPT_INFO = 1<<1, - RPT_OPERATOR = 1<<2, - RPT_WARNING = 1<<3, - RPT_ERROR = 1<<4, - RPT_ERROR_INVALID_INPUT = 1<<5, - RPT_ERROR_INVALID_CONTEXT = 1<<6, - RPT_ERROR_OUT_OF_MEMORY = 1<<7 -} ReportType; - -#define RPT_DEBUG_ALL (RPT_DEBUG) -#define RPT_INFO_ALL (RPT_INFO) -#define RPT_OPERATOR_ALL (RPT_OPERATOR) -#define RPT_WARNING_ALL (RPT_WARNING) -#define RPT_ERROR_ALL (RPT_ERROR|RPT_ERROR_INVALID_INPUT|RPT_ERROR_INVALID_CONTEXT|RPT_ERROR_OUT_OF_MEMORY) - -enum ReportListFlags { - RPT_PRINT = 1, - RPT_STORE = 2, -}; - -typedef struct Report { - struct Report *next, *prev; - ReportType type; - char *typestr; - char *message; -} Report; - -typedef struct ReportList { - ListBase list; - ReportType printlevel; - ReportType storelevel; - int flag; -} ReportList; +/* report structures are stored in DNA */ void BKE_reports_init(ReportList *reports, int flag); void BKE_reports_clear(ReportList *reports); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index bbf3ceb01e8..4bfc1484e56 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -206,7 +206,7 @@ struct ARegion *CTX_wm_menu(const bContext *C) struct ReportList *CTX_wm_reports(const bContext *C) { - return C->wm.manager->reports; + return &(C->wm.manager->reports); } View3D *CTX_wm_view3d(const bContext *C) diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index 6564329ef82..3e3dd4b0af0 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -102,7 +102,7 @@ void BKE_report(ReportList *reports, ReportType type, const char *message) len= strlen(message); report->message= MEM_callocN(sizeof(char)*(len+1), "ReportMessage"); memcpy(report->message, message, sizeof(char)*(len+1)); - + report->len= len; BLI_addtail(&reports->list, report); } } @@ -129,7 +129,7 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...) va_end(args); report->message= BLI_dynstr_get_cstring(ds); - + report->len= BLI_dynstr_get_len(ds); BLI_dynstr_free(ds); report->type= type; @@ -155,6 +155,7 @@ void BKE_reports_prepend(ReportList *reports, const char *prepend) MEM_freeN(report->message); report->message= BLI_dynstr_get_cstring(ds); + report->len= BLI_dynstr_get_len(ds); BLI_dynstr_free(ds); } @@ -179,6 +180,7 @@ void BKE_reports_prependf(ReportList *reports, const char *prepend, ...) MEM_freeN(report->message); report->message= BLI_dynstr_get_cstring(ds); + report->len= BLI_dynstr_get_len(ds); BLI_dynstr_free(ds); } |