Oliver Fabel 1 год назад
Родитель
Сommit
622cefdf95

+ 22 - 0
docs/pages/examples.rst

@@ -0,0 +1,22 @@
+Examples
+========
+
+This page contains a few examples.
+
+Speaker
+-------
+
+.. literalinclude:: ../../examples/flipperzero_speaker_test.py
+   :language: python
+
+Input
+-----
+
+.. literalinclude:: ../../examples/flipperzero_draw_on_input_test.py
+   :language: python
+
+All Together
+------------
+
+.. literalinclude:: ../../examples/tic_tac_toe.py
+   :language: python

+ 1 - 0
docs/pages/index.rst

@@ -5,6 +5,7 @@
    quickstart
    reference
    features
+   examples
    Changelog </changelog>
    License </license>
 

+ 17 - 0
docs/pages/reference.rst

@@ -42,3 +42,20 @@ Write text and draw dots and shapes on the the display.
 
 .. automodule:: flipperzero._canvas
    :members:
+
+Dialog
+------
+
+Display message dialogs on the display for user infos and confirm actions.
+
+.. automodule:: flipperzero._modal
+   :members:
+
+Built-In
+--------
+
+The functions in this section are `not` part of the ``flipperzero`` module.
+They're members of the global namespace instead.
+
+.. automodule:: flipperzero._builtins
+   :members:

+ 1 - 0
flipperzero/__init__.py

@@ -3,3 +3,4 @@ from ._input import *
 from ._light import *
 from ._speaker import *
 from ._vibro import *
+from ._builtins import *

+ 16 - 0
flipperzero/_builtins.py

@@ -0,0 +1,16 @@
+def print(*objects, sep=' ', end='\n', file=None, flush=False) -> None:
+    '''
+    The standard Python `print <https://docs.python.org/3/library/functions.html#print>`_ function.
+
+    :param objects: The objects to print (mostly a single string).
+    :param sep: The separator to use between the objects.
+    :param end: The line terminator character to use.
+
+    .. attention::
+
+        This function prints to the internal log buffer.
+        Check out the `Flipper Zero docs <https://docs.flipper.net/development/cli#_yZ2E>`_ on how to reveal them in the CLI interface.
+    
+
+    '''
+    pass

+ 23 - 0
flipperzero/_modal.py

@@ -0,0 +1,23 @@
+def dialog_message_set_text(text:str, x: int, y: int, h: int, v: int) -> None:
+    '''
+    Set a text on the dialog box.
+
+    :param text: The text to set.
+    :param x: The x coordinates to use.
+    :param y: The y coordinates to use.
+    :param h: The horizontal alignment.
+    :param v: The vertical alignment.
+    '''
+    pass
+
+def dialog_message_set_header(text:str, x: int, y: int, h: int, v: int) -> None:
+    '''
+    Set a header text on the dialog box.
+
+    :param text: The text to set.
+    :param x: The x coordinates to use.
+    :param y: The y coordinates to use.
+    :param h: The horizontal alignment.
+    :param v: The vertical alignment.
+    '''
+    pass