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:
authorCampbell Barton <ideasman42@gmail.com>2018-04-22 11:51:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-22 11:51:23 +0300
commit1de7a0c0dc011a9286f14552858f10efc64d5f91 (patch)
tree1957a7ddac128dd6c1fa88aa900ccbd5752800c8
parente597f7495abcb5eedf8db27b4c4a72b3a58b727e (diff)
parent420e379e99a3351b2dd2a46989aa1d50bdf8abef (diff)
Merge branch 'master' into blender2.8
-rw-r--r--release/scripts/modules/bpy_types.py4
-rw-r--r--source/blender/blenlib/BLI_bitmap_draw_2d.h6
-rw-r--r--source/blender/blenlib/intern/bitmap_draw_2d.c20
-rw-r--r--source/blender/makesrna/intern/rna_wm.c34
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c8
5 files changed, 32 insertions, 40 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 511fc7e8d1e..1124070fea2 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -137,12 +137,12 @@ class WindowManager(bpy_types.ID):
def popup_menu(self, draw_func, title="", icon='NONE'):
import bpy
- popup = self.pupmenu_begin__internal(title, icon)
+ popup = self.popmenu_begin__internal(title, icon)
try:
draw_func(popup, bpy.context)
finally:
- self.pupmenu_end__internal(popup)
+ self.popmenu_end__internal(popup)
def popup_menu_pie(self, event, draw_func, title="", icon='NONE'):
import bpy
diff --git a/source/blender/blenlib/BLI_bitmap_draw_2d.h b/source/blender/blenlib/BLI_bitmap_draw_2d.h
index e41439e38d2..7036196425a 100644
--- a/source/blender/blenlib/BLI_bitmap_draw_2d.h
+++ b/source/blender/blenlib/BLI_bitmap_draw_2d.h
@@ -27,7 +27,7 @@
void BLI_bitmap_draw_2d_line_v2v2i(
const int p1[2], const int p2[2],
- bool (*callback)(int, int, void *), void *userData);
+ bool (*callback)(int, int, void *), void *user_data);
void BLI_bitmap_draw_2d_tri_v2i(
const int p1[2], const int p2[2], const int p3[2],
@@ -35,7 +35,7 @@ void BLI_bitmap_draw_2d_tri_v2i(
void BLI_bitmap_draw_2d_poly_v2i_n(
const int xmin, const int ymin, const int xmax, const int ymax,
- const int polyXY[][2], const int polyCorners,
- void (*callback)(int x, int x_end, int y, void *), void *userData);
+ const int verts[][2], const int verts_len,
+ void (*callback)(int x, int x_end, int y, void *), void *user_data);
#endif /* __BLI_BITMAP_DRAW_2D_H__ */
diff --git a/source/blender/blenlib/intern/bitmap_draw_2d.c b/source/blender/blenlib/intern/bitmap_draw_2d.c
index c6386cb3080..ff62d78796b 100644
--- a/source/blender/blenlib/intern/bitmap_draw_2d.c
+++ b/source/blender/blenlib/intern/bitmap_draw_2d.c
@@ -52,7 +52,7 @@
*/
void BLI_bitmap_draw_2d_line_v2v2i(
const int p1[2], const int p2[2],
- bool (*callback)(int, int, void *), void *userData)
+ bool (*callback)(int, int, void *), void *user_data)
{
/* Bresenham's line algorithm. */
int x1 = p1[0];
@@ -60,7 +60,7 @@ void BLI_bitmap_draw_2d_line_v2v2i(
int x2 = p2[0];
int y2 = p2[1];
- if (callback(x1, y1, userData) == 0) {
+ if (callback(x1, y1, user_data) == 0) {
return;
}
@@ -91,7 +91,7 @@ void BLI_bitmap_draw_2d_line_v2v2i(
x1 += sign_x;
error += delta_y_step;
- if (callback(x1, y1, userData) == 0) {
+ if (callback(x1, y1, user_data) == 0) {
return;
}
}
@@ -113,7 +113,7 @@ void BLI_bitmap_draw_2d_line_v2v2i(
y1 += sign_y;
error += delta_x_step;
- if (callback(x1, y1, userData) == 0) {
+ if (callback(x1, y1, user_data) == 0) {
return;
}
}
@@ -353,16 +353,16 @@ static int draw_poly_v2i_n__span_y_sort(const void *a_p, const void *b_p, void *
*/
void BLI_bitmap_draw_2d_poly_v2i_n(
const int xmin, const int ymin, const int xmax, const int ymax,
- const int verts[][2], const int nr,
- void (*callback)(int x, int x_end, int y, void *), void *userData)
+ const int verts[][2], const int verts_len,
+ void (*callback)(int x, int x_end, int y, void *), void *user_data)
{
/* Originally by Darel Rex Finley, 2007.
* Optimized by Campbell Barton, 2016 to track sorted intersections. */
- int (*span_y)[2] = MEM_mallocN(sizeof(*span_y) * (size_t)nr, __func__);
+ int (*span_y)[2] = MEM_mallocN(sizeof(*span_y) * (size_t)verts_len, __func__);
int span_y_len = 0;
- for (int i_curr = 0, i_prev = nr - 1; i_curr < nr; i_prev = i_curr++) {
+ for (int i_curr = 0, i_prev = verts_len - 1; i_curr < verts_len; i_prev = i_curr++) {
const int *co_prev = verts[i_prev];
const int *co_curr = verts[i_curr];
@@ -391,7 +391,7 @@ void BLI_bitmap_draw_2d_poly_v2i_n(
struct NodeX {
int span_y_index;
int x;
- } *node_x = MEM_mallocN(sizeof(*node_x) * (size_t)(nr + 1), __func__);
+ } *node_x = MEM_mallocN(sizeof(*node_x) * (size_t)(verts_len + 1), __func__);
int node_x_len = 0;
int span_y_index = 0;
@@ -472,7 +472,7 @@ void BLI_bitmap_draw_2d_poly_v2i_n(
}
/* for single call per x-span */
if (x_src < x_dst) {
- callback(x_src - xmin, x_dst - xmin, pixel_y - ymin, userData);
+ callback(x_src - xmin, x_dst - xmin, pixel_y - ymin, user_data);
}
}
}
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 1d4652b0212..d7718d2e0f2 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1951,44 +1951,36 @@ static void rna_def_timer(BlenderRNA *brna)
RNA_define_verify_sdna(1); /* not in sdna */
}
-static void rna_def_popupmenu(BlenderRNA *brna)
+static void rna_def_popup_menu_wrapper(
+ BlenderRNA *brna, const char *rna_type, const char *c_type, const char *layout_get_fn)
{
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "UIPopupMenu", NULL);
- RNA_def_struct_ui_text(srna, "PopupMenu", "");
- RNA_def_struct_sdna(srna, "uiPopupMenu");
+ srna = RNA_def_struct(brna, rna_type, NULL);
+ /* UI name isn't visible, name same as type. */
+ RNA_def_struct_ui_text(srna, rna_type, "");
+ RNA_def_struct_sdna(srna, c_type);
RNA_define_verify_sdna(0); /* not in sdna */
/* could wrap more, for now this is enough */
prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "UILayout");
- RNA_def_property_pointer_funcs(prop, "rna_PopupMenu_layout_get",
+ RNA_def_property_pointer_funcs(prop, layout_get_fn,
NULL, NULL, NULL);
RNA_define_verify_sdna(1); /* not in sdna */
}
-static void rna_def_piemenu(BlenderRNA *brna)
+static void rna_def_popupmenu(BlenderRNA *brna)
{
- StructRNA *srna;
- PropertyRNA *prop;
-
- srna = RNA_def_struct(brna, "UIPieMenu", NULL);
- RNA_def_struct_ui_text(srna, "PieMenu", "");
- RNA_def_struct_sdna(srna, "uiPieMenu");
-
- RNA_define_verify_sdna(0); /* not in sdna */
-
- /* could wrap more, for now this is enough */
- prop = RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE);
- RNA_def_property_struct_type(prop, "UILayout");
- RNA_def_property_pointer_funcs(prop, "rna_PieMenu_layout_get",
- NULL, NULL, NULL);
+ rna_def_popup_menu_wrapper(brna, "UIPopupMenu", "uiPopupMenu", "rna_PopupMenu_layout_get");
+}
- RNA_define_verify_sdna(1); /* not in sdna */
+static void rna_def_piemenu(BlenderRNA *brna)
+{
+ rna_def_popup_menu_wrapper(brna, "UIPieMenu", "uiPieMenu", "rna_PieMenu_layout_get");
}
static void rna_def_window_stereo3d(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 82077051c18..28d8115f8c6 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -331,7 +331,7 @@ static void rna_KeyConfig_remove(wmWindowManager *wm, ReportList *reports, Point
}
/* popup menu wrapper */
-static PointerRNA rna_PupMenuBegin(bContext *C, const char *title, int icon)
+static PointerRNA rna_PopMenuBegin(bContext *C, const char *title, int icon)
{
PointerRNA r_ptr;
void *data;
@@ -343,7 +343,7 @@ static PointerRNA rna_PupMenuBegin(bContext *C, const char *title, int icon)
return r_ptr;
}
-static void rna_PupMenuEnd(bContext *C, PointerRNA *handle)
+static void rna_PopMenuEnd(bContext *C, PointerRNA *handle)
{
UI_popup_menu_end(C, handle->data);
}
@@ -524,7 +524,7 @@ void RNA_api_wm(StructRNA *srna)
/* wrap UI_popup_menu_begin */
- func = RNA_def_function(srna, "pupmenu_begin__internal", "rna_PupMenuBegin");
+ func = RNA_def_function(srna, "popmenu_begin__internal", "rna_PopMenuBegin");
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
parm = RNA_def_string(func, "title", NULL, 0, "", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
@@ -536,7 +536,7 @@ void RNA_api_wm(StructRNA *srna)
RNA_def_function_return(func, parm);
/* wrap UI_popup_menu_end */
- func = RNA_def_function(srna, "pupmenu_end__internal", "rna_PupMenuEnd");
+ func = RNA_def_function(srna, "popmenu_end__internal", "rna_PopMenuEnd");
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_CONTEXT);
parm = RNA_def_pointer(func, "menu", "UIPopupMenu", "", "");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_RNAPTR);