Skip to content

Commit

Permalink
feat: add Underline method
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Sep 16, 2023
1 parent 143844c commit 5f75178
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,9 @@ func Inherit(fieldPtr, stylePtr *C.char) {
styleToInherit := getStyle(stylePtr)
style.Inherit(styleToInherit)
}

//export Underline
func Underline(fieldPtr *C.char, value bool) {
style := getStyle(fieldPtr)
style.Underline(value)
}
6 changes: 5 additions & 1 deletion src/ffi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,9 @@ export const { symbols } = dlopen(location, {
Inherit: {
args: [FFIType.ptr, FFIType.ptr],
returns: FFIType.void
}
},
Underline: {
args: [FFIType.ptr, FFIType.bool],
returns: FFIType.void
},
})
5 changes: 5 additions & 0 deletions src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ export class Style {
symbols.Inherit(this.#handle, ptr(encode(style.#handle)))
return this
}

Underline(value: boolean) {
symbols.Underline(this.#handle, value)
return this
}
}

export function NewStyle() {
Expand Down

0 comments on commit 5f75178

Please sign in to comment.