summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-04-24 22:24:28 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2015-04-24 22:24:28 +0300
commit178be163fcb2354a9352de38f6987ca0ceb8662d (patch)
treea1da427b42607695fac4c207684761e85dcab7a7
parentbd88b8845e9a212b974e23e4a595d89f7b9d345b (diff)
Evas: Fix documentation
-rw-r--r--efl/evas/efl.evas.pyx26
-rw-r--r--efl/evas/efl.evas_object_textgrid.pxi169
2 files changed, 77 insertions, 118 deletions
diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx
index 46fe2db..df557a5 100644
--- a/efl/evas/efl.evas.pyx
+++ b/efl/evas/efl.evas.pyx
@@ -914,42 +914,46 @@ Evas_Textblock_Cursor_Type
914 914
915.. _Evas_Textgrid_Palette: 915.. _Evas_Textgrid_Palette:
916 916
917_Evas_Textgrid_Palette 917Textgrid Palette
918------------------------------------- 918----------------
919
920The palette to use for the foreground and background colors.
919 921
920.. data:: EVAS_TEXTGRID_PALETTE_NONE 922.. data:: EVAS_TEXTGRID_PALETTE_NONE
921 923
922 None. 924 No palette is used.
923 925
924.. data:: EVAS_TEXTGRID_PALETTE_STANDARD 926.. data:: EVAS_TEXTGRID_PALETTE_STANDARD
925 927
926 Standard. 928 Standard palette (around 16 colors).
927 929
928.. data:: EVAS_TEXTGRID_PALETTE_EXTENDED 930.. data:: EVAS_TEXTGRID_PALETTE_EXTENDED
929 931
930 Extended. 932 Extended palette (at max 256 colors).
931 933
932.. data:: EVAS_TEXTGRID_PALETTE_LAST 934.. data:: EVAS_TEXTGRID_PALETTE_LAST
933 935
934 Last. 936 Ignore it.
935 937
936 938
937.. _Evas_Textgrid_Font_Style: 939.. _Evas_Textgrid_Font_Style:
938 940
939Evas_Textgrid_Font_Style 941Textgrid Font Style
940------------------------------------- 942-------------------
943
944The style to give to each character of the grid.
941 945
942.. data:: EVAS_TEXTGRID_FONT_STYLE_NORMAL 946.. data:: EVAS_TEXTGRID_FONT_STYLE_NORMAL
943 947
944 Normal. 948 Normal style.
945 949
946.. data:: EVAS_TEXTGRID_FONT_STYLE_BOLD 950.. data:: EVAS_TEXTGRID_FONT_STYLE_BOLD
947 951
948 Bold. 952 Bold style.
949 953
950.. data:: EVAS_TEXTGRID_FONT_STYLE_ITALIC 954.. data:: EVAS_TEXTGRID_FONT_STYLE_ITALIC
951 955
952 italic. 956 Oblique style.
953 957
954 958
955Module level functions 959Module level functions
diff --git a/efl/evas/efl.evas_object_textgrid.pxi b/efl/evas/efl.evas_object_textgrid.pxi
index c21c0c0..9b93cc4 100644
--- a/efl/evas/efl.evas_object_textgrid.pxi
+++ b/efl/evas/efl.evas_object_textgrid.pxi
@@ -15,47 +15,6 @@
15# You should have received a copy of the GNU Lesser General Public License 15# You should have received a copy of the GNU Lesser General Public License
16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>. 16# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
17 17
18"""
19
20.. _Evas_Textgrid_Palette:
21
22.. rubric:: The palette to use for the foreground and background colors.
23
24.. data:: EVAS_TEXTGRID_PALETTE_NONE
25
26 No palette is used
27
28.. data:: EVAS_TEXTGRID_PALETTE_STANDARD
29
30 standard palette (around 16 colors)
31
32.. data:: EVAS_TEXTGRID_PALETTE_EXTENDED
33
34 extended palette (at max 256 colors)
35
36.. data:: EVAS_TEXTGRID_PALETTE_LAST
37
38 ignore it
39
40
41.. _Evas_Textgrid_Font_Style:
42
43.. rubric:: The style to give to each character of the grid.
44
45.. data:: EVAS_TEXTGRID_FONT_STYLE_NORMAL
46
47 Normal style
48
49.. data:: EVAS_TEXTGRID_FONT_STYLE_BOLD
50
51 Bold style
52
53.. data:: EVAS_TEXTGRID_FONT_STYLE_ITALIC
54
55 Oblique style
56
57"""
58
59from libc.stdlib cimport malloc 18from libc.stdlib cimport malloc
60 19
61 20
@@ -74,9 +33,9 @@ cdef class TextgridCell(object):
74 return "%s" % (self.codepoint,) 33 return "%s" % (self.codepoint,)
75 34
76 def __repr__(self): 35 def __repr__(self):
77 return "%s(codepoint = %s, fg = %s, bg = %s, bold = %s, \ 36 return "<%s(codepoint = %s, fg = %s, bg = %s, bold = %s, \
78 italic = %s, underline = %s, strikethrough = %s, \ 37 italic = %s, underline = %s, strikethrough = %s, \
79 fg_extended = %s, bg_extended = %s, double_width = %s)" % ( 38 fg_extended = %s, bg_extended = %s, double_width = %s)>" % (
80 type(self).__name__, self.codepoint, 39 type(self).__name__, self.codepoint,
81 self.fg, self.bg, self.bold, self.italic, 40 self.fg, self.bg, self.bold, self.italic,
82 self.underline, self.strikethrough, 41 self.underline, self.strikethrough,
@@ -223,7 +182,7 @@ cdef class Textgrid(Object):
223 :type canvas: :py:class:`~efl.evas.Canvas` 182 :type canvas: :py:class:`~efl.evas.Canvas`
224 :keyword \**kwargs: All the remaining keyword arguments are interpreted 183 :keyword \**kwargs: All the remaining keyword arguments are interpreted
225 as properties of the instance 184 as properties of the instance
226 185
227 """ 186 """
228 self._set_obj(evas_object_textgrid_add(canvas.obj)) 187 self._set_obj(evas_object_textgrid_add(canvas.obj))
229 self._set_properties_from_keyword_args(kwargs) 188 self._set_properties_from_keyword_args(kwargs)
@@ -231,9 +190,8 @@ cdef class Textgrid(Object):
231 property size: 190 property size:
232 """The size of the textgrid object. 191 """The size of the textgrid object.
233 192
234 The number of lines **h** and the number 193 The number of lines **h** and the number of columns **w** of the
235 of columns **w** of the textgrid object. Values 194 textgrid object. Values less than or equal to 0 are ignored.
236 less than or equal to 0 are ignored.
237 195
238 :type: (int **w**, int **h**) 196 :type: (int **w**, int **h**)
239 197
@@ -251,13 +209,12 @@ cdef class Textgrid(Object):
251 property font_source: 209 property font_source:
252 """The font (source) file used on a given textgrid object. 210 """The font (source) file used on a given textgrid object.
253 211
254 This allows the font file to be explicitly 212 This allows the font file to be explicitly set for the textgrid object,
255 set for the textgrid object, overriding system lookup, which 213 overriding system lookup, which will first occur in the given file's
256 will first occur in the given file's contents. If 214 contents. If None or an empty string is assigned, or the same
257 None or an empty string is assigned, or the same font_source has already 215 font_source has already been set, or on error, this does nothing.
258 been set, or on error, this does nothing.
259 216
260 :type: unicode 217 :type: string
261 218
262 .. seealso:: :py:attr:`font` 219 .. seealso:: :py:attr:`font`
263 220
@@ -283,7 +240,7 @@ cdef class Textgrid(Object):
283 ``None``, or if it is an empty string, or if **font_size** is less or 240 ``None``, or if it is an empty string, or if **font_size** is less or
284 equal than 0, or on error, this function does nothing. 241 equal than 0, or on error, this function does nothing.
285 242
286 :type: (unicode **font_name**, unicode **font_size**) 243 :type: (string **font_name**, int **font_size**)
287 244
288 :see: :py:attr:`font_source` 245 :see: :py:attr:`font_source`
289 246
@@ -306,14 +263,12 @@ cdef class Textgrid(Object):
306 return (_ctouni(font_name), font_size) 263 return (_ctouni(font_name), font_size)
307 264
308 property cell_size: 265 property cell_size:
309 """The size of a cell of the given textgrid object in pixels. 266 """The width and height of a cell in pixels.
310 267
311 This functions retrieves the width and height, in pixels, of a cell 268 This read-only property has the width and height, in pixels, of a cell
312 of the textgrid object **obj** and store them respectively in the 269 of the textgrid object. Their value depends on the monospace font used
313 buffers **width** and **height**. Their value depends on the 270 for the textgrid object, as well as the style. On error, they are set
314 monospace font used for the textgrid object, as well as the 271 to 0.
315 style. **width** and **height** can be ``None``. On error, they are
316 set to 0.
317 272
318 :type: (int **width**, int **height**) 273 :type: (int **width**, int **height**)
319 274
@@ -330,25 +285,26 @@ cdef class Textgrid(Object):
330 return (w, h) 285 return (w, h)
331 286
332 def palette_set(self, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a): 287 def palette_set(self, Evas_Textgrid_Palette pal, int idx, int r, int g, int b, int a):
333 """The set color to the given palette at the given index of the given textgrid object. 288 """Set color to the given palette at the given index.
334 289
335 :param pal: The type of the palette to set the color. 290 :param pal: The type of the palette to set the color.
336 :param idx: The index of the paletter to wich the color is stored. 291 :type pal: :ref:`Evas_Textgrid_Palette`
337 :param r: The red component of the color. 292 :param int idx: The index of the paletter to which the color is stored.
338 :param g: The green component of the color. 293 :param int r: The red component of the color.
339 :param b: The blue component of the color. 294 :param int g: The green component of the color.
340 :param a: The alpha component of the color. 295 :param int b: The blue component of the color.
296 :param int a: The alpha component of the color.
341 297
342 This function sets the color for the palette of type **pal** at the 298 This function sets the color for the palette of type **pal** at the
343 index **idx** of the textgrid object **obj**. The ARGB components are 299 index **idx** of the textgrid object. The ARGB components are given by
344 given by **r**, **g**, **b** and **a**. This color can be used when 300 **r**, **g**, **b** and **a**. This color can be used when setting the
345 setting the :py:class:`TextgridCell` object. The components must set 301 :py:class:`TextgridCell` object. The components must set a pre-
346 a pre-multiplied color. If pal is EVAS_TEXTGRID_PALETTE_NONE or 302 multiplied color. If pal is EVAS_TEXTGRID_PALETTE_NONE or
347 EVAS_TEXTGRID_PALETTE_LAST, or if **idx** is not between 0 and 255, 303 EVAS_TEXTGRID_PALETTE_LAST, or if **idx** is not between 0 and 255, or
348 or on error, this function does nothing. The color components are 304 on error, this function does nothing. The color components are clamped
349 clamped between 0 and 255. If **idx** is greater than the latest set 305 between 0 and 255. If **idx** is greater than the latest set color, the
350 color, the colors between this last index and **idx** - 1 are set to 306 colors between this last index and **idx** - 1 are set to black (0, 0,
351 black (0, 0, 0, 0). 307 0, 0).
352 308
353 :see: :py:func:`palette_get` 309 :see: :py:func:`palette_get`
354 310
@@ -356,21 +312,21 @@ cdef class Textgrid(Object):
356 evas_object_textgrid_palette_set(self.obj, pal, idx, r, g, b, a) 312 evas_object_textgrid_palette_set(self.obj, pal, idx, r, g, b, a)
357 313
358 def palette_get(self, Evas_Textgrid_Palette pal, int idx): 314 def palette_get(self, Evas_Textgrid_Palette pal, int idx):
359 """The retrieve color to the given palette at the given index of the given textgrid object. 315 """Retrieve color from the given palette at the given index.
360 316
361 :param pal: The type of the palette to set the color. 317 :param pal: The type of the palette to set the color.
362 :param idx: The index of the palette to which the color is stored. 318 :type pal: :ref:`Evas_Textgrid_Palette`
319 :param int idx: The index of the palette to which the color is stored.
363 :rtype: (int **r**, int **g**, int **b**, int **a**) 320 :rtype: (int **r**, int **g**, int **b**, int **a**)
364 321
365 This function retrieves the color for the palette of type **pal** at the 322 This method retrieves the color for the palette of type **pal** at
366 index **idx** of the textgrid object **obj**. The ARGB components are 323 the index **idx** of the textgrid object. The ARGB components are
367 stored in the buffers **r**, **g**, **b** and **a**. If **idx** is not 324 stored in the buffers **r**, **g**, **b** and **a**. If **idx** is not
368 between 0 and the index of the latest set color, or if **pal** is 325 between 0 and the index of the latest set color, or if **pal** is
369 EVAS_TEXTGRID_PALETTE_NONE or EVAS_TEXTGRID_PALETTE_LAST, the 326 EVAS_TEXTGRID_PALETTE_NONE or EVAS_TEXTGRID_PALETTE_LAST, the values of
370 values of the components are 0. **r**, **g**, **b** and **a** can be 327 the components are 0.
371 ``None``.
372 328
373 :see: :py:func:`palette_set` 329 :see: :py:meth:`palette_set`
374 330
375 """ 331 """
376 cdef: 332 cdef:
@@ -388,23 +344,21 @@ cdef class Textgrid(Object):
388 return evas_object_textgrid_supported_font_styles_get(self.obj) 344 return evas_object_textgrid_supported_font_styles_get(self.obj)
389 345
390 def cellrow_set(self, int y, list row not None): 346 def cellrow_set(self, int y, list row not None):
391 """Set the string at the given row of the given textgrid object. 347 """Set the string at the given row.
392 348
393 :param y: The row index of the grid. 349 :param y: The row index of the grid.
394 :type y: int 350 :type y: int
395 :param row: The string as a sequence of #Evas_Textgrid_Cell. 351 :param row: The string as a sequence of :class:`TextgridCell`.
396 :type row: list 352 :type row: list
397 353
398 This function returns cells to the textgrid taken by 354 This method allows returning cells to the textgrid, retrieved with
399 :py:func:`cellrow_get`. The row pointer **row** should be the 355 :py:meth:`cellrow_get`.
400 same row pointer returned by :py:func:`cellrow_get` for the
401 same row **y**.
402 356
403 .. seealso:: 357 .. seealso::
404 358
405 :py:func:`cellrow_get` 359 :py:meth:`cellrow_get`
406 :py:attr:`size` 360 :py:attr:`size`
407 :py:func:`update_add` 361 :py:meth:`update_add`
408 362
409 """ 363 """
410 cdef: 364 cdef:
@@ -422,20 +376,21 @@ cdef class Textgrid(Object):
422 evas_object_textgrid_cellrow_set(self.obj, y, crow[0]) 376 evas_object_textgrid_cellrow_set(self.obj, y, crow[0])
423 377
424 def cellrow_get(self, int y): 378 def cellrow_get(self, int y):
425 """Get the string at the given row of the given textgrid object. 379 """Get the string at the given row.
426 380
427 :param y: The row index of the grid. 381 :param int y: The row index of the grid.
428 :return: A pointer to the first cell of the given row. 382 :return: A list of :class:`TextgridCell`
383 :rtype: list
429 384
430 This function returns a pointer to the first cell of the line **y** 385 This method returns a list of cells in the line **y** of
431 of the textgrid object **obj**. If **y** is not between 0 and the 386 the textgrid object. If **y** is not between 0 and the number
432 number of lines of the grid - 1, or on error, this function return ``None``. 387 of lines of the grid - 1, or on error, this function return ``None``.
433 388
434 .. seealso:: 389 .. seealso::
435 390
436 :py:func:`cellrow_set` 391 :py:meth:`cellrow_set`
437 :py:attr:`size` 392 :py:attr:`size`
438 :py:func:`update_add` 393 :py:meth:`update_add`
439 394
440 """ 395 """
441 cdef: 396 cdef:
@@ -457,12 +412,12 @@ cdef class Textgrid(Object):
457 def update_add(self, int x, int y, int w, int h): 412 def update_add(self, int x, int y, int w, int h):
458 """Indicate for evas that part of a textgrid region (cells) has been updated. 413 """Indicate for evas that part of a textgrid region (cells) has been updated.
459 414
460 :param x: The rect region of cells top-left x (column) 415 :param int x: The rect region of cells top-left x (column)
461 :param y: The rect region of cells top-left y (row) 416 :param int y: The rect region of cells top-left y (row)
462 :param w: The rect region size in number of cells (columns) 417 :param int w: The rect region size in number of cells (columns)
463 :param h: The rect region size in number of cells (rows) 418 :param int h: The rect region size in number of cells (rows)
464 419
465 This function declares to evas that a region of cells was updated by 420 This method declares to evas that a region of cells was updated by
466 code and needs refreshing. An application should modify cells like this 421 code and needs refreshing. An application should modify cells like this
467 as an example:: 422 as an example::
468 423
@@ -474,8 +429,8 @@ cdef class Textgrid(Object):
474 429
475 .. seealso:: 430 .. seealso::
476 431
477 :py:func:`cellrow_set` 432 :py:meth:`cellrow_set`
478 :py:func:`cellrow_get` 433 :py:meth:`cellrow_get`
479 :py:attr:`size` 434 :py:attr:`size`
480 435
481 """ 436 """