Set up ctypes function signatures.
(self)
| 141 | self._initialized = False |
| 142 | |
| 143 | def _setup_functions(self): |
| 144 | """Set up ctypes function signatures.""" |
| 145 | # Init/cleanup |
| 146 | _lib.pager_init.argtypes = [] |
| 147 | _lib.pager_init.restype = c_int |
| 148 | _lib.pager_cleanup.argtypes = [] |
| 149 | _lib.pager_cleanup.restype = None |
| 150 | |
| 151 | # Rotation |
| 152 | _lib.pager_set_rotation.argtypes = [c_int] |
| 153 | _lib.pager_set_rotation.restype = None |
| 154 | _lib.pager_get_width.argtypes = [] |
| 155 | _lib.pager_get_width.restype = c_int |
| 156 | _lib.pager_get_height.argtypes = [] |
| 157 | _lib.pager_get_height.restype = c_int |
| 158 | |
| 159 | # Frame management |
| 160 | _lib.pager_flip.argtypes = [] |
| 161 | _lib.pager_flip.restype = None |
| 162 | _lib.pager_clear.argtypes = [c_uint16] |
| 163 | _lib.pager_clear.restype = None |
| 164 | _lib.pager_get_ticks.argtypes = [] |
| 165 | _lib.pager_get_ticks.restype = c_uint32 |
| 166 | _lib.pager_delay.argtypes = [c_uint32] |
| 167 | _lib.pager_delay.restype = None |
| 168 | _lib.pager_frame_sync.argtypes = [] |
| 169 | _lib.pager_frame_sync.restype = c_uint32 |
| 170 | |
| 171 | # Drawing |
| 172 | _lib.pager_set_pixel.argtypes = [c_int, c_int, c_uint16] |
| 173 | _lib.pager_set_pixel.restype = None |
| 174 | _lib.pager_fill_rect.argtypes = [c_int, c_int, c_int, c_int, c_uint16] |
| 175 | _lib.pager_fill_rect.restype = None |
| 176 | _lib.pager_draw_rect.argtypes = [c_int, c_int, c_int, c_int, c_uint16] |
| 177 | _lib.pager_draw_rect.restype = None |
| 178 | _lib.pager_hline.argtypes = [c_int, c_int, c_int, c_uint16] |
| 179 | _lib.pager_hline.restype = None |
| 180 | _lib.pager_vline.argtypes = [c_int, c_int, c_int, c_uint16] |
| 181 | _lib.pager_vline.restype = None |
| 182 | _lib.pager_draw_line.argtypes = [c_int, c_int, c_int, c_int, c_uint16] |
| 183 | _lib.pager_draw_line.restype = None |
| 184 | _lib.pager_fill_circle.argtypes = [c_int, c_int, c_int, c_uint16] |
| 185 | _lib.pager_fill_circle.restype = None |
| 186 | _lib.pager_draw_circle.argtypes = [c_int, c_int, c_int, c_uint16] |
| 187 | _lib.pager_draw_circle.restype = None |
| 188 | |
| 189 | # Text (built-in font) |
| 190 | _lib.pager_draw_char.argtypes = [c_int, c_int, c_char, c_uint16, c_int] |
| 191 | _lib.pager_draw_char.restype = c_int |
| 192 | _lib.pager_draw_text.argtypes = [c_int, c_int, c_char_p, c_uint16, c_int] |
| 193 | _lib.pager_draw_text.restype = c_int |
| 194 | _lib.pager_draw_text_centered.argtypes = [c_int, c_char_p, c_uint16, c_int] |
| 195 | _lib.pager_draw_text_centered.restype = None |
| 196 | _lib.pager_text_width.argtypes = [c_char_p, c_int] |
| 197 | _lib.pager_text_width.restype = c_int |
| 198 | _lib.pager_draw_number.argtypes = [c_int, c_int, c_int, c_uint16, c_int] |
| 199 | _lib.pager_draw_number.restype = c_int |
| 200 |