Skip to content

Commit

Permalink
Fix functions taking enums
Browse files Browse the repository at this point in the history
  • Loading branch information
bindreams committed May 4, 2024
1 parent 3d98dfe commit 92db8dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/zint-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,13 @@ class Symbol:
@outfile.setter
def outfile(self, arg1: str) -> None: ...
@property
def output_options(self) -> int:
def output_options(self) -> OutputOptions:
"""
Various output parameters (bind, box etc, see below)
"""

@output_options.setter
def output_options(self, arg1: int) -> None: ...
def output_options(self, arg1: OutputOptions) -> None: ...
@property
def primary(self) -> str:
"""
Expand Down Expand Up @@ -554,13 +554,13 @@ class Symbol:
"""

@property
def warn_level(self) -> int:
def warn_level(self) -> WarningLevel:
"""
Affects error/warning value returned by Zint API (see WARN_XXX below)
"""

@warn_level.setter
def warn_level(self, arg1: int) -> None: ...
def warn_level(self, arg1: WarningLevel) -> None: ...
@property
def whitespace_height(self) -> int:
"""
Expand Down
8 changes: 4 additions & 4 deletions src/zint/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ struct Symbol {
void set_border_width(int val) { m_handle->border_width = val; }
int get_border_width() { return m_handle->border_width; }

void set_output_options(int val) { m_handle->output_options = val; }
int get_output_options() { return m_handle->output_options; }
void set_output_options(OutputOptions val) { m_handle->output_options = static_cast<int>(val); }
OutputOptions get_output_options() { return static_cast<OutputOptions>(m_handle->output_options); }

void set_fgcolour(std::string_view val) {
static constexpr int size = std::extent_v<decltype(m_handle->fgcolour)>;
Expand Down Expand Up @@ -327,8 +327,8 @@ struct Symbol {
return reinterpret_cast<StructApp&>(m_handle->structapp);
}

void set_warn_level(int val) { m_handle->warn_level = val; }
int get_warn_level() { return m_handle->warn_level; }
void set_warn_level(WarningLevel val) { m_handle->warn_level = static_cast<int>(val); }
WarningLevel get_warn_level() { return static_cast<WarningLevel>(m_handle->warn_level); }

void set_debug(int val) { m_handle->debug = val; }
int get_debug() { return m_handle->debug; }
Expand Down

0 comments on commit 92db8dc

Please sign in to comment.