Skip to content

Commit 23a3668

Browse files
authored
Merge pull request #44 from xiaokangwang/master
Added c-for-go tip for nk_style_from_table, etc
2 parents d3cef3b + 86fface commit 23a3668

File tree

8 files changed

+35
-31
lines changed

8 files changed

+35
-31
lines changed

nk.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
---
2-
GENERATOR:
1+
---
2+
GENERATOR:
33
PackageName: nk
44
PackageDescription: "Package nk provides Go bindings for nuklear.h — a small ANSI C gui library."
55
PackageLicense: "THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS."
66
Includes: ["nuklear.h"]
77
Options:
88
SafeStrings: true
99

10-
PARSER:
10+
PARSER:
1111
IncludePaths: ["/usr/include", "/usr/local/include"]
1212
SourcesPaths: ["nk/nuklear.h"]
1313
Defines:
@@ -18,8 +18,8 @@ PARSER:
1818
NK_INCLUDE_DEFAULT_FONT: 1
1919
NK_INCLUDE_VERTEX_BUFFER_OUTPUT: 1
2020

21-
TRANSLATOR:
22-
ConstRules:
21+
TRANSLATOR:
22+
ConstRules:
2323
defines: expand
2424
enum: expand
2525
MemTips:
@@ -56,9 +56,13 @@ TRANSLATOR:
5656
- {target: "_edit_string_zero_terminated$", tips: [ref,0,arr,0,0]}
5757
- {target: "_font_atlas_add_from_memory$", tips: [ref,ref,size,0,ref]}
5858
- {target: "_convert$", tips: [ref,ref,ref,ref,ref]}
59+
- {target: "^nk_style_from_table$", tips: [sref,arr]}
60+
- {target: "^nk_stroke_polygon$", tips: [sref,arr,size,0,0]}
61+
- {target: "^nk_stroke_polyline$", tips: [sref,arr,size,0,0]}
62+
- {target: "^nk_fill_polygon$", tips: [sref,arr,size,0,0]}
5963
- {target: "nk_", tips: [sref,sref,sref,sref]} # defaults
60-
Rules:
61-
global:
64+
Rules:
65+
global:
6266
- {transform: lower}
6367
- {action: accept, from: "^nk_"}
6468
- {transform: export}
@@ -90,11 +94,11 @@ TRANSLATOR:
9094
- {action: ignore, from: "_combobox_callback$"}
9195
- {action: ignore, from: "_input_glyph$"}
9296
- {action: ignore, from: "_draw_list_clear$"}
93-
type:
97+
type:
9498
- {action: replace, from: "^Nk_", to: _}
9599
- {action: replace, from: "_t$"}
96100
private:
97101
- {transform: unexport}
98-
post-global:
102+
post-global:
99103
- {action: replace, from: _$}
100104
- {load: snakecase}

nk/cgo_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
#include "_cgo_export.h"

nk/cgo_helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
package nk

nk/cgo_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
#include "nuklear.h"

nk/const.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
package nk
@@ -13,18 +13,18 @@ package nk
1313
import "C"
1414

1515
const (
16-
// IncludeFixedTypes as defined in nuklear/<predefine>:24
17-
IncludeFixedTypes = 1
18-
// IncludeStandardIo as defined in nuklear/<predefine>:25
16+
// IncludeStandardIo as defined in nuklear/<predefine>:24
1917
IncludeStandardIo = 1
20-
// IncludeDefaultAllocator as defined in nuklear/<predefine>:26
18+
// IncludeDefaultAllocator as defined in nuklear/<predefine>:25
2119
IncludeDefaultAllocator = 1
22-
// IncludeFontBaking as defined in nuklear/<predefine>:27
20+
// IncludeFontBaking as defined in nuklear/<predefine>:26
2321
IncludeFontBaking = 1
24-
// IncludeDefaultFont as defined in nuklear/<predefine>:28
22+
// IncludeDefaultFont as defined in nuklear/<predefine>:27
2523
IncludeDefaultFont = 1
26-
// IncludeVertexBufferOutput as defined in nuklear/<predefine>:29
24+
// IncludeVertexBufferOutput as defined in nuklear/<predefine>:28
2725
IncludeVertexBufferOutput = 1
26+
// IncludeFixedTypes as defined in nuklear/<predefine>:29
27+
IncludeFixedTypes = 1
2828
// Undefined as defined in nk/nuklear.h:253
2929
Undefined = (-1.0)
3030
// UtfInvalid as defined in nk/nuklear.h:254

nk/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
/*

nk/nk.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
package nk
@@ -2461,9 +2461,9 @@ func NkStyleDefault(arg0 *Context) {
24612461
}
24622462

24632463
// NkStyleFromTable function as declared in nk/nuklear.h:2184
2464-
func NkStyleFromTable(arg0 *Context, arg1 *Color) {
2464+
func NkStyleFromTable(arg0 *Context, arg1 []Color) {
24652465
carg0, _ := (*C.struct_nk_context)(unsafe.Pointer(arg0)), cgoAllocsUnknown
2466-
carg1, _ := (*C.struct_nk_color)(unsafe.Pointer(arg1)), cgoAllocsUnknown
2466+
carg1, _ := (*C.struct_nk_color)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&arg1)).Data)), cgoAllocsUnknown
24672467
C.nk_style_from_table(carg0, carg1)
24682468
}
24692469

@@ -4159,19 +4159,19 @@ func NkStrokeTriangle(arg0 *CommandBuffer, arg1 float32, arg2 float32, arg3 floa
41594159
}
41604160

41614161
// NkStrokePolyline function as declared in nk/nuklear.h:3150
4162-
func NkStrokePolyline(arg0 *CommandBuffer, points *float32, pointCount int32, lineThickness float32, col Color) {
4162+
func NkStrokePolyline(arg0 *CommandBuffer, points []float32, pointCount int32, lineThickness float32, col Color) {
41634163
carg0, _ := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown
4164-
cpoints, _ := (*C.float)(unsafe.Pointer(points)), cgoAllocsUnknown
4164+
cpoints, _ := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&points)).Data)), cgoAllocsUnknown
41654165
cpointCount, _ := (C.int)(pointCount), cgoAllocsUnknown
41664166
clineThickness, _ := (C.float)(lineThickness), cgoAllocsUnknown
41674167
ccol, _ := *(*C.struct_nk_color)(unsafe.Pointer(&col)), cgoAllocsUnknown
41684168
C.nk_stroke_polyline(carg0, cpoints, cpointCount, clineThickness, ccol)
41694169
}
41704170

41714171
// NkStrokePolygon function as declared in nk/nuklear.h:3151
4172-
func NkStrokePolygon(arg0 *CommandBuffer, arg1 *float32, pointCount int32, lineThickness float32, arg4 Color) {
4172+
func NkStrokePolygon(arg0 *CommandBuffer, arg1 []float32, pointCount int32, lineThickness float32, arg4 Color) {
41734173
carg0, _ := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown
4174-
carg1, _ := (*C.float)(unsafe.Pointer(arg1)), cgoAllocsUnknown
4174+
carg1, _ := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&arg1)).Data)), cgoAllocsUnknown
41754175
cpointCount, _ := (C.int)(pointCount), cgoAllocsUnknown
41764176
clineThickness, _ := (C.float)(lineThickness), cgoAllocsUnknown
41774177
carg4, _ := *(*C.struct_nk_color)(unsafe.Pointer(&arg4)), cgoAllocsUnknown
@@ -4232,9 +4232,9 @@ func NkFillTriangle(arg0 *CommandBuffer, x0 float32, y0 float32, x1 float32, y1
42324232
}
42334233

42344234
// NkFillPolygon function as declared in nk/nuklear.h:3159
4235-
func NkFillPolygon(arg0 *CommandBuffer, arg1 *float32, pointCount int32, arg3 Color) {
4235+
func NkFillPolygon(arg0 *CommandBuffer, arg1 []float32, pointCount int32, arg3 Color) {
42364236
carg0, _ := (*C.struct_nk_command_buffer)(unsafe.Pointer(arg0)), cgoAllocsUnknown
4237-
carg1, _ := (*C.float)(unsafe.Pointer(arg1)), cgoAllocsUnknown
4237+
carg1, _ := (*C.float)(unsafe.Pointer((*sliceHeader)(unsafe.Pointer(&arg1)).Data)), cgoAllocsUnknown
42384238
cpointCount, _ := (C.int)(pointCount), cgoAllocsUnknown
42394239
carg3, _ := *(*C.struct_nk_color)(unsafe.Pointer(&arg3)), cgoAllocsUnknown
42404240
C.nk_fill_polygon(carg0, carg1, cpointCount, carg3)

nk/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS.
22

3-
// WARNING: This file has automatically been generated on Tue, 12 Dec 2017 20:09:32 MSK.
3+
// WARNING: This file has automatically been generated on Thu, 12 Apr 2018 14:22:43 CST.
44
// By https://git.io/c-for-go. DO NOT EDIT.
55

66
package nk

0 commit comments

Comments
 (0)