Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-13 16:38:41 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-13 16:38:41 +0300
commit4c3d64116e2c74315afea7b005ffaf320178337f (patch)
tree86d6db3a35fd5847387c2970ba0d160d9f92b0a7 /source/blender/makesrna
parenta4793a3b4ac298a651f7bab0bafd809287647509 (diff)
2.5: UI Layout Engine, initial code.
* As a test, used by: * Object buttons, tried to make it match the mockup. * Text window header. * Text window properties panel. * Panel interaction with view2d is still problematic, need to make this work properly still. * Templates are very basic, the ones there are simple but already can follow the object buttons mockup quite closely. * It's based on a three level system: panels, templates and items. To get an idea of what that means in practice, see: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/UI_LayoutEngine#Panels.2C_Templates_and_Items
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_access.c13
-rw-r--r--source/blender/makesrna/intern/rna_image.c1
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c4
-rw-r--r--source/blender/makesrna/intern/rna_text.c19
6 files changed, 26 insertions, 14 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 8bc8c58f425..dfa74ea2f24 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -327,6 +327,7 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision);
int RNA_property_string_maxlength(PointerRNA *ptr, PropertyRNA *prop);
+StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop);
void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem);
int RNA_property_enum_value(PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index bbf2030e4f3..202bd6bc615 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -431,6 +431,19 @@ int RNA_property_string_maxlength(PointerRNA *ptr, PropertyRNA *prop)
return sprop->maxlength;
}
+StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
+{
+ PointerPropertyRNA *pprop;
+
+ rna_idproperty_check(&prop, ptr);
+ pprop= (PointerPropertyRNA*)prop;
+
+ if(pprop->structtype)
+ return pprop->structtype;
+
+ return &RNA_UnknownType;
+}
+
void RNA_property_enum_items(PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **item, int *totitem)
{
EnumPropertyRNA *eprop;
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index c98a936030a..3ea26f198e9 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -230,4 +230,3 @@ void RNA_def_image(BlenderRNA *brna)
#endif
-
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 2907658b17e..e1b24a93605 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -830,7 +830,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Draw Bounds", "Displays the object's bounds.");
RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
- prop= RNA_def_property(srna, "draw_bounds_types", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "draw_bounds_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "boundtype");
RNA_def_property_enum_items(prop, boundtype_items);
RNA_def_property_ui_text(prop, "Draw Bounds Type", "Object boundary display type.");
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index c889a0ec195..2639f1b3012 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -218,9 +218,9 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LOCAL_UV);
RNA_def_property_ui_text(prop, "Local View", "Draw only faces with the currently displayed image assigned.");*/
- prop= RNA_def_property(srna, "display_normalized_coordinates", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS);
- RNA_def_property_ui_text(prop, "Display Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels.");
+ RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels.");
/* todo: move edge and face drawing options here from G.f */
diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c
index 80b9e56eff5..020ba635e4a 100644
--- a/source/blender/makesrna/intern/rna_text.c
+++ b/source/blender/makesrna/intern/rna_text.c
@@ -36,6 +36,8 @@
#include "DNA_text_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
static void rna_Text_filename_get(PointerRNA *ptr, char *value)
@@ -83,7 +85,6 @@ static int rna_TextLine_line_length(PointerRNA *ptr)
return line->len;
}
-#if 0
static void rna_TextLine_line_set(PointerRNA *ptr, const char *value)
{
TextLine *line= (TextLine*)ptr->data;
@@ -91,16 +92,14 @@ static void rna_TextLine_line_set(PointerRNA *ptr, const char *value)
if(line->line)
MEM_freeN(line->line);
- if(strlen(value)) {
- line->line= BLI_strdup(value);
- line->len= strlen(line->line);
- }
- else {
- line->line= NULL;
- line->len= 0;
+ line->line= BLI_strdup(value);
+ line->len= strlen(line->line);
+
+ if(line->format) {
+ MEM_freeN(line->format);
+ line->format= NULL;
}
}
-#endif
#else
@@ -113,9 +112,9 @@ static void rna_def_text_line(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Text Line", "Line of text in a Text datablock.");
prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE);
- RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_TextLine_line_get", "rna_TextLine_line_length", "rna_TextLine_line_set");
RNA_def_property_ui_text(prop, "Line", "Text in the line.");
+ RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
}
static void rna_def_text_marker(BlenderRNA *brna)