-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from swistakm/feature/extra-module-for-utility…
…-functions Extra module for utility functions
- Loading branch information
Showing
8 changed files
with
131 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
imgui.extra module | ||
================== | ||
|
||
|
||
.. automodule:: imgui.extra | ||
:members: | ||
:undoc-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ API reference | |
|
||
imgui | ||
imgui.core | ||
imgui.extra | ||
imgui.integrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from functools import wraps | ||
from warnings import warn | ||
|
||
|
||
class ImguiDeprecationWarning(FutureWarning): | ||
pass | ||
|
||
|
||
def deprecated(reason): | ||
def decorator(fn): | ||
@wraps(fn) | ||
def wrapper(*args, **kwargs): | ||
warn(reason, ImguiDeprecationWarning, stacklevel=2) | ||
return fn(*args, **kwargs) | ||
return wrapper | ||
return decorator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
This file provides all C/C++ definitions that need to be shared between all | ||
extension modules. This is mostly for the `extra` submodule that provides | ||
some additional utilities that do not belong to `core`. | ||
""" | ||
cimport cimgui | ||
|
||
|
||
cdef class _Font(object): | ||
cdef cimgui.ImFont* _ptr | ||
|
||
@staticmethod | ||
cdef from_ptr(cimgui.ImFont* ptr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
This module provides extra utilities that are not part of core ImGui C++ API | ||
but are useful in Python application. | ||
""" | ||
from . import core | ||
|
||
__all__ = ( | ||
"font", | ||
"styled", | ||
"istyled", | ||
"vertex_buffer_vertex_pos_offset", | ||
"vertex_buffer_vertex_uv_offset", | ||
"vertex_buffer_vertex_col_offset", | ||
"vertex_buffer_vertex_size", | ||
"index_buffer_index_size", | ||
) | ||
|
||
font = core._py_font | ||
styled = core._py_styled | ||
istyled = core._py_istyled | ||
vertex_buffer_vertex_pos_offset = core._py_vertex_buffer_vertex_pos_offset | ||
vertex_buffer_vertex_uv_offset = core._py_vertex_buffer_vertex_uv_offset | ||
vertex_buffer_vertex_col_offset = core._py_vertex_buffer_vertex_col_offset | ||
vertex_buffer_vertex_size = core._py_vertex_buffer_vertex_size | ||
index_buffer_index_size = core._py_index_buffer_index_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters