helpers.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>ldoc</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. </ul>
  28. <h2>Modules</h2>
  29. <ul>
  30. <li><a href="../modules/blingbling.clock.html">blingbling.clock</a></li>
  31. <li><a href="../modules/blingbling.linegraph.html">blingbling.linegraph</a></li>
  32. <li><a href="../modules/blingbling.popups.html">blingbling.popups</a></li>
  33. <li><a href="../modules/blingbling.progress_graph.html">blingbling.progress_graph</a></li>
  34. <li><a href="../modules/blingbling.system.html">blingbling.system</a></li>
  35. <li><a href="../modules/blingbling.tagslist.html">blingbling.tagslist</a></li>
  36. <li><a href="../modules/blingbling.task_warrior.html">blingbling.task_warrior</a></li>
  37. <li><a href="../modules/blingbling.text_box.html">blingbling.text_box</a></li>
  38. <li><a href="../modules/blingbling.triangular_progress_graph.html">blingbling.triangular_progress_graph</a></li>
  39. <li><a href="../modules/blingbling.udisks_glue.html">blingbling.udisks_glue</a></li>
  40. <li><a href="../modules/blingbling.volume.html">blingbling.volume</a></li>
  41. <li><a href="../modules/blingbling.widget.html">blingbling.widget</a></li>
  42. <li><a href="../modules/blingbling.wlourf_circle_graph.html">blingbling.wlourf_circle_graph</a></li>
  43. <li><a href="../modules/config_example.japanese2.theme.html">config_example.japanese2.theme</a></li>
  44. <li><strong>helpers</strong></li>
  45. <li><a href="../modules/superproperties.html">superproperties</a></li>
  46. <li><a href="../modules/value_text_box.html">value_text_box</a></li>
  47. </ul>
  48. </div>
  49. <div id="content">
  50. <h1>Module <code>helpers</code></h1>
  51. <p>Functions used in blingbling.</p>
  52. <p>
  53. blingbling.helpers</p>
  54. <h2><a href="#Functions">Functions</a></h2>
  55. <table class="function_list">
  56. <tr>
  57. <td class="name" nowrap><a href="#dbg">dbg&nbsp;(vars)</a></td>
  58. <td class="summary">Display values of variables in an awesome popup.</td>
  59. </tr>
  60. <tr>
  61. <td class="name" nowrap><a href="#hexadecimal_to_rgba_percent">hexadecimal_to_rgba_percent&nbsp;(my_color)</a></td>
  62. <td class="summary">Convert an hexadecimal color to rgba color.</td>
  63. </tr>
  64. <tr>
  65. <td class="name" nowrap><a href="#rgb">rgb&nbsp;(red, green, blue)</a></td>
  66. <td class="summary">Get red green blue value in parameters and return hexadecimal string</td>
  67. </tr>
  68. <tr>
  69. <td class="name" nowrap><a href="#rgba">rgba&nbsp;(red, green, blue, alpha)</a></td>
  70. <td class="summary">Get red green blue and alpha value in parameters and return hexadecimal string.</td>
  71. </tr>
  72. <tr>
  73. <td class="name" nowrap><a href="#is_transparent">is_transparent&nbsp;(my_color)</a></td>
  74. <td class="summary">Check if an hexadecimal color is fully transparent.</td>
  75. </tr>
  76. <tr>
  77. <td class="name" nowrap><a href="#split">split&nbsp;(str, pat)</a></td>
  78. <td class="summary">Split string in different parts which are returned in a table.</td>
  79. </tr>
  80. <tr>
  81. <td class="name" nowrap><a href="#draw_background_tiles">draw_background_tiles&nbsp;(cr, height, v_margin, width, h_margin)</a></td>
  82. <td class="summary">Draw tiles in a cairo context.</td>
  83. </tr>
  84. <tr>
  85. <td class="name" nowrap><a href="#draw_text_and_background">draw_text_and_background&nbsp;(cr, text, x, y, text_background_color, text_color, show_text_centered_on_x, show_text_centered_on_y, show_text_on_left_of_x, show_text_on_bottom_of_y)</a></td>
  86. <td class="summary">Draw text on a rectangle which width and height depend on the text width and height.</td>
  87. </tr>
  88. <tr>
  89. <td class="name" nowrap><a href="#draw_up_down_arrows">draw_up_down_arrows&nbsp;(cr, x, y_bottom, y_top, value, background_arrow_color, arrow_color, arrow_line_color, up)</a></td>
  90. <td class="summary">Drawn one foreground arrow with a background arrow that depend on a value.</td>
  91. </tr>
  92. <tr>
  93. <td class="name" nowrap><a href="#draw_vertical_bar">draw_vertical_bar&nbsp;(cr, h_margin, v_margin, width, height, represent)</a></td>
  94. <td class="summary">Draw a vertical bar with gradient color, so it looks like a cylinder, and it's height depends on a value.</td>
  95. </tr>
  96. <tr>
  97. <td class="name" nowrap><a href="#draw_horizontal_bar">draw_horizontal_bar&nbsp;(cr, h_margin, v_margin, width, height, represent)</a></td>
  98. <td class="summary">Draw an horizontal bar with gradient color, so it looks like a cylinder, and it's height depends on a value.</td>
  99. </tr>
  100. <tr>
  101. <td class="name" nowrap><a href="#draw_rounded_corners_rectangle">draw_rounded_corners_rectangle&nbsp;(cr, x, y, width, height, color, rounded_size)</a></td>
  102. <td class="summary">Draw a rectangle width rounded corners.</td>
  103. </tr>
  104. <tr>
  105. <td class="name" nowrap><a href="#clip_rounded_corners_rectangle">clip_rounded_corners_rectangle&nbsp;(cr, x, y, width, height, rounded_size)</a></td>
  106. <td class="summary">Set a rectangle width rounded corners that define the area to draw.</td>
  107. </tr>
  108. <tr>
  109. <td class="name" nowrap><a href="#draw_rounded_corners_horizontal_graph">draw_rounded_corners_horizontal_graph&nbsp;(cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</a></td>
  110. <td class="summary">Draw a foreground rounded corners rectangle which width depends on a value, and a background rounded corners rectangle.</td>
  111. </tr>
  112. <tr>
  113. <td class="name" nowrap><a href="#draw_rounded_corners_vertical_graph">draw_rounded_corners_vertical_graph&nbsp;(cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</a></td>
  114. <td class="summary">Draw a foreground rounded corners rectangle which height depends on a value, and a background rounded corners rectangle.</td>
  115. </tr>
  116. <tr>
  117. <td class="name" nowrap><a href="#generate_rounded_rectangle_with_text">generate_rounded_rectangle_with_text&nbsp;(cr, width, height, text, padding, background_color, text_color, font_size, rounded_size, border)</a></td>
  118. <td class="summary">Generate a text in front of a centered rectangle with rounded corners (or not) in a cairo context.</td>
  119. </tr>
  120. <tr>
  121. <td class="name" nowrap><a href="#hash_remove">hash_remove&nbsp;(hash, key)</a></td>
  122. <td class="summary">Remove an element from a table using key.</td>
  123. </tr>
  124. <tr>
  125. <td class="name" nowrap><a href="#get_days_in_month">get_days_in_month&nbsp;(month, year)</a></td>
  126. <td class="summary">Get the number of days in a given month of a year.</td>
  127. </tr>
  128. <tr>
  129. <td class="name" nowrap><a href="#get_ISO8601_weeks_number_of_month">get_ISO8601_weeks_number_of_month&nbsp;(month, year)</a></td>
  130. <td class="summary">Find the weeks numbers of a given month.</td>
  131. </tr>
  132. </table>
  133. <br/>
  134. <br/>
  135. <h2><a name="Functions"></a>Functions</h2>
  136. <dl class="function">
  137. <dt>
  138. <a name = "dbg"></a>
  139. <strong>dbg&nbsp;(vars)</strong>
  140. </dt>
  141. <dd>
  142. Display values of variables in an awesome popup.
  143. Each variables in vars is separated by a "|"
  144. <h3>Parameters:</h3>
  145. <ul>
  146. <li><span class="parameter">vars</span>
  147. a table of variable</li>
  148. </ul>
  149. </dd>
  150. <dt>
  151. <a name = "hexadecimal_to_rgba_percent"></a>
  152. <strong>hexadecimal_to_rgba_percent&nbsp;(my_color)</strong>
  153. </dt>
  154. <dd>
  155. Convert an hexadecimal color to rgba color.
  156. <h3>Parameters:</h3>
  157. <ul>
  158. <li><span class="parameter">my_color</span>
  159. a string "#rrggbb" or "#rrggbbaa"</li>
  160. </ul>
  161. </dd>
  162. <dt>
  163. <a name = "rgb"></a>
  164. <strong>rgb&nbsp;(red, green, blue)</strong>
  165. </dt>
  166. <dd>
  167. Get red green blue value in parameters and return hexadecimal string
  168. <h3>Parameters:</h3>
  169. <ul>
  170. <li><span class="parameter">red</span>
  171. </li>
  172. <li><span class="parameter">green</span>
  173. </li>
  174. <li><span class="parameter">blue</span>
  175. </li>
  176. </ul>
  177. </dd>
  178. <dt>
  179. <a name = "rgba"></a>
  180. <strong>rgba&nbsp;(red, green, blue, alpha)</strong>
  181. </dt>
  182. <dd>
  183. Get red green blue and alpha value in parameters and return hexadecimal string.
  184. <h3>Parameters:</h3>
  185. <ul>
  186. <li><span class="parameter">red</span>
  187. </li>
  188. <li><span class="parameter">green</span>
  189. </li>
  190. <li><span class="parameter">blue</span>
  191. </li>
  192. <li><span class="parameter">alpha</span>
  193. </li>
  194. </ul>
  195. </dd>
  196. <dt>
  197. <a name = "is_transparent"></a>
  198. <strong>is_transparent&nbsp;(my_color)</strong>
  199. </dt>
  200. <dd>
  201. Check if an hexadecimal color is fully transparent.
  202. Returns true or false
  203. <h3>Parameters:</h3>
  204. <ul>
  205. <li><span class="parameter">my_color</span>
  206. a string "#rrggbb" or "#rrggbbaa"</li>
  207. </ul>
  208. </dd>
  209. <dt>
  210. <a name = "split"></a>
  211. <strong>split&nbsp;(str, pat)</strong>
  212. </dt>
  213. <dd>
  214. Split string in different parts which are returned in a table. The delimiter of each part is a pattern given in argument.
  215. <h3>Parameters:</h3>
  216. <ul>
  217. <li><span class="parameter">str</span>
  218. the string to split</li>
  219. <li><span class="parameter">pat</span>
  220. the pattern delimiter</li>
  221. </ul>
  222. </dd>
  223. <dt>
  224. <a name = "draw_background_tiles"></a>
  225. <strong>draw_background_tiles&nbsp;(cr, height, v_margin, width, h_margin)</strong>
  226. </dt>
  227. <dd>
  228. Draw tiles in a cairo context.
  229. <h3>Parameters:</h3>
  230. <ul>
  231. <li><span class="parameter">cr</span>
  232. a cairo context.</li>
  233. <li><span class="parameter">height</span>
  234. the height of the surface on which we want tiles</li>
  235. <li><span class="parameter">v_margin</span>
  236. value used to define top margin and/or bottom margin (tiles are not drawn on the margins)</li>
  237. <li><span class="parameter">width</span>
  238. the width of the surface on which we want tiles</li>
  239. <li><span class="parameter">h_margin</span>
  240. value used to define left margin and/or right margin.</li>
  241. </ul>
  242. </dd>
  243. <dt>
  244. <a name = "draw_text_and_background"></a>
  245. <strong>draw_text_and_background&nbsp;(cr, text, x, y, text_background_color, text_color, show_text_centered_on_x, show_text_centered_on_y, show_text_on_left_of_x, show_text_on_bottom_of_y)</strong>
  246. </dt>
  247. <dd>
  248. Draw text on a rectangle which width and height depend on the text width and height.
  249. <h3>Parameters:</h3>
  250. <ul>
  251. <li><span class="parameter">cr</span>
  252. a cairo context already initialised with oocairo.context_create( )</li>
  253. <li><span class="parameter">text</span>
  254. the text to display</li>
  255. <li><span class="parameter">x</span>
  256. the x coordinate of the left of the text</li>
  257. <li><span class="parameter">y</span>
  258. the y coordinate of the bottom of the text</li>
  259. <li><span class="parameter">text_background_color</span>
  260. a string "#rrggbb" or "#rrggbbaa" for the rectangle color</li>
  261. <li><span class="parameter">text_color</span>
  262. a string "#rrggbb" or "#rrggbbaa" for the text color</li>
  263. <li><span class="parameter">show_text_centered_on_x</span>
  264. a boolean value not mandatory (false by default) if true, x parameter is the coordinate of the middle of the text</li>
  265. <li><span class="parameter">show_text_centered_on_y</span>
  266. a boolean value not mandatory (false by default) if true, y parameter is the coordinate of the middle of the text</li>
  267. <li><span class="parameter">show_text_on_left_of_x</span>
  268. a boolean value not mandatory (false by default) if true, x parameter is the right of the text</li>
  269. <li><span class="parameter">show_text_on_bottom_of_y</span>
  270. a boolean value not mandatory (false by default) if true, y parameter is the top of the text</li>
  271. </ul>
  272. </dd>
  273. <dt>
  274. <a name = "draw_up_down_arrows"></a>
  275. <strong>draw_up_down_arrows&nbsp;(cr, x, y_bottom, y_top, value, background_arrow_color, arrow_color, arrow_line_color, up)</strong>
  276. </dt>
  277. <dd>
  278. Drawn one foreground arrow with a background arrow that depend on a value.
  279. If the value is egal to 0 then the foreground arrow is not drawn.
  280. <h3>Parameters:</h3>
  281. <ul>
  282. <li><span class="parameter">cr</span>
  283. a cairo context already initialised with oocairo.context_create( )</li>
  284. <li><span class="parameter">x</span>
  285. the x coordinate in the cairo context where the arrow start</li>
  286. <li><span class="parameter">y_bottom</span>
  287. the bottom corrdinate of the arrows</li>
  288. <li><span class="parameter">y_top</span>
  289. the top coordinate of the arrows</li>
  290. <li><span class="parameter">value</span>
  291. a number</li>
  292. <li><span class="parameter">background_arrow_color</span>
  293. the color of the background arrow, a string "#rrggbb" or "#rrggbbaa"</li>
  294. <li><span class="parameter">arrow_color</span>
  295. the color of the foreground arrow, a string "#rrggbb" or "#rrggbbaa"</li>
  296. <li><span class="parameter">arrow_line_color</span>
  297. the color of the outline of the foreground arrow , a string "#rrggbb" or "#rrggbbaa"</li>
  298. <li><span class="parameter">up</span>
  299. boolean value if false draw a down arrow, if true draw a up arrow</li>
  300. </ul>
  301. </dd>
  302. <dt>
  303. <a name = "draw_vertical_bar"></a>
  304. <strong>draw_vertical_bar&nbsp;(cr, h_margin, v_margin, width, height, represent)</strong>
  305. </dt>
  306. <dd>
  307. Draw a vertical bar with gradient color, so it looks like a cylinder, and it's height depends on a value.
  308. <h3>Parameters:</h3>
  309. <ul>
  310. <li><span class="parameter">cr</span>
  311. a cairo context already initialised with oocairo.context_create( )</li>
  312. <li><span class="parameter">h_margin</span>
  313. the left and right margin of the bar in the cr</li>
  314. <li><span class="parameter">v_margin</span>
  315. the top and bottom margin of the bar in the cr</li>
  316. <li><span class="parameter">width</span>
  317. the width used to display the left margin, the bar and the right margin</li>
  318. <li><span class="parameter">height</span>
  319. the height used to display the top margin, the bar and the bottom margin</li>
  320. <li><span class="parameter">represent</span>
  321. a table {background_bar_color = "#rrggbb" or "#rrggbbaa", color = "#rrggbb" or "#rrggbbaa", value =the value used to calculate the height of the bar}</li>
  322. </ul>
  323. </dd>
  324. <dt>
  325. <a name = "draw_horizontal_bar"></a>
  326. <strong>draw_horizontal_bar&nbsp;(cr, h_margin, v_margin, width, height, represent)</strong>
  327. </dt>
  328. <dd>
  329. Draw an horizontal bar with gradient color, so it looks like a cylinder, and it's height depends on a value.
  330. <h3>Parameters:</h3>
  331. <ul>
  332. <li><span class="parameter">cr</span>
  333. a cairo context already initialised with oocairo.context_create( )</li>
  334. <li><span class="parameter">h_margin</span>
  335. the left and right margin of the bar in the cr</li>
  336. <li><span class="parameter">v_margin</span>
  337. the top and bottom margin of the bar in the cr</li>
  338. <li><span class="parameter">width</span>
  339. the width used to display the left margin, the bar and the right margin</li>
  340. <li><span class="parameter">height</span>
  341. the height used to display the top margin, the bar and the bottom margin</li>
  342. <li><span class="parameter">represent</span>
  343. a table {background_bar_color = "#rrggbb" or "#rrggbbaa", color = "#rrggbb" or "#rrggbbaa", value =the value used to calculate the width of the bar}</li>
  344. </ul>
  345. </dd>
  346. <dt>
  347. <a name = "draw_rounded_corners_rectangle"></a>
  348. <strong>draw_rounded_corners_rectangle&nbsp;(cr, x, y, width, height, color, rounded_size)</strong>
  349. </dt>
  350. <dd>
  351. Draw a rectangle width rounded corners.
  352. <h3>Parameters:</h3>
  353. <ul>
  354. <li><span class="parameter">cr</span>
  355. a cairo context already initialised with oocairo.context_create( )</li>
  356. <li><span class="parameter">x</span>
  357. the x coordinate of the left top corner</li>
  358. <li><span class="parameter">y</span>
  359. the y corrdinate of the left top corner</li>
  360. <li><span class="parameter">width</span>
  361. the width of the rectangle</li>
  362. <li><span class="parameter">height</span>
  363. the height of the rectangle</li>
  364. <li><span class="parameter">color</span>
  365. a string "#rrggbb" or "#rrggbbaa" for the color of the rectangle</li>
  366. <li><span class="parameter">rounded_size</span>
  367. a float value from 0 to 1 (0 is no rounded corner) or a table of float value</li>
  368. </ul>
  369. </dd>
  370. <dt>
  371. <a name = "clip_rounded_corners_rectangle"></a>
  372. <strong>clip_rounded_corners_rectangle&nbsp;(cr, x, y, width, height, rounded_size)</strong>
  373. </dt>
  374. <dd>
  375. Set a rectangle width rounded corners that define the area to draw.
  376. <h3>Parameters:</h3>
  377. <ul>
  378. <li><span class="parameter">cr</span>
  379. a cairo context already initialised with oocairo.context_create( )</li>
  380. <li><span class="parameter">x</span>
  381. the x coordinate of the left top corner</li>
  382. <li><span class="parameter">y</span>
  383. the y corrdinate of the left top corner</li>
  384. <li><span class="parameter">width</span>
  385. the width of the rectangle</li>
  386. <li><span class="parameter">height</span>
  387. the height of the rectangle</li>
  388. <li><span class="parameter">rounded_size</span>
  389. a float value from 0 to 1 (0 is no rounded corner)</li>
  390. </ul>
  391. </dd>
  392. <dt>
  393. <a name = "draw_rounded_corners_horizontal_graph"></a>
  394. <strong>draw_rounded_corners_horizontal_graph&nbsp;(cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</strong>
  395. </dt>
  396. <dd>
  397. Draw a foreground rounded corners rectangle which width depends on a value, and a background rounded corners rectangle.
  398. <h3>Parameters:</h3>
  399. <ul>
  400. <li><span class="parameter">cr</span>
  401. a cairo context already initialised with oocairo.context_create( )</li>
  402. <li><span class="parameter">x</span>
  403. the x coordinate of the left top corner</li>
  404. <li><span class="parameter">y</span>
  405. the y corrdinate of the left top corner</li>
  406. <li><span class="parameter">width</span>
  407. the width of the background rectangle and the maximal width of th foreground rectangle</li>
  408. <li><span class="parameter">height</span>
  409. the height of the background and the foreground rectangles</li>
  410. <li><span class="parameter">background_color</span>
  411. a string "#rrggbb" or "#rrggbbaa" for the color of the background rectangle</li>
  412. <li><span class="parameter">graph_color</span>
  413. a string "#rrggbb" or "#rrggbbaa" for the color of the foreground rectangle</li>
  414. <li><span class="parameter">rounded_size</span>
  415. a float value from 0 to 1 (0 is no rounded corner)</li>
  416. <li><span class="parameter">value_to_represent</span>
  417. the percent of the max width used to calculate the width of the foreground rectangle</li>
  418. <li><span class="parameter">graph_line_color</span>
  419. a string "#rrggbb" or "#rrggbbaa" for the outiline color of the background rectangle</li>
  420. </ul>
  421. </dd>
  422. <dt>
  423. <a name = "draw_rounded_corners_vertical_graph"></a>
  424. <strong>draw_rounded_corners_vertical_graph&nbsp;(cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</strong>
  425. </dt>
  426. <dd>
  427. Draw a foreground rounded corners rectangle which height depends on a value, and a background rounded corners rectangle.
  428. <h3>Parameters:</h3>
  429. <ul>
  430. <li><span class="parameter">cr</span>
  431. a cairo context already initialised with oocairo.context_create( )</li>
  432. <li><span class="parameter">x</span>
  433. the x coordinate of the left top corner</li>
  434. <li><span class="parameter">y</span>
  435. the y corrdinate of the left top corner</li>
  436. <li><span class="parameter">width</span>
  437. the width of the background and the foreground rectangles</li>
  438. <li><span class="parameter">height</span>
  439. the height of the background rectangle and the maximal height of the foreground rectangle</li>
  440. <li><span class="parameter">background_color</span>
  441. a string "#rrggbb" or "#rrggbbaa" for the color of the background rectangle</li>
  442. <li><span class="parameter">graph_color</span>
  443. a string "#rrggbb" or "#rrggbbaa" for the color of the foreground rectangle</li>
  444. <li><span class="parameter">rounded_size</span>
  445. a float value from 0 to 1 (0 is no rounded corner)</li>
  446. <li><span class="parameter">value_to_represent</span>
  447. the percent of the max height used to calculate the height of the foreground rectangle</li>
  448. <li><span class="parameter">graph_line_color</span>
  449. a string "#rrggbb" or "#rrggbbaa" for the outiline color of the background rectangle</li>
  450. </ul>
  451. </dd>
  452. <dt>
  453. <a name = "generate_rounded_rectangle_with_text"></a>
  454. <strong>generate_rounded_rectangle_with_text&nbsp;(cr, width, height, text, padding, background_color, text_color, font_size, rounded_size, border)</strong>
  455. </dt>
  456. <dd>
  457. Generate a text in front of a centered rectangle with rounded corners (or not) in a cairo context.
  458. It returns a table ={ width = the width of the image, height = the height of the image}
  459. <h3>Parameters:</h3>
  460. <ul>
  461. <li><span class="parameter">cr</span>
  462. a cairo context already initialised with oocairo.context_create( )</li>
  463. <li><span class="parameter">width</span>
  464. the width of the widget</li>
  465. <li><span class="parameter">height</span>
  466. the height of the widget</li>
  467. <li><span class="parameter">text</span>
  468. the text to display</li>
  469. <li><span class="parameter">padding</span>
  470. the left/right/top/bottom padding used to center the text in the background rectangle</li>
  471. <li><span class="parameter">background_color</span>
  472. a string "#rrggbb" or "#rrggbbaa" for the color of the background rectangle</li>
  473. <li><span class="parameter">text_color</span>
  474. a string "#rrggbb" or "#rrggbbaa" for the color of the text</li>
  475. <li><span class="parameter">font_size</span>
  476. define the size of the font</li>
  477. <li><span class="parameter">rounded_size</span>
  478. a float value from 0 to 1 (0 is no rounded corner)</li>
  479. <li><span class="parameter">border</span>
  480. a color as a string "#rrggbb" or "#rrggbbaa"</li>
  481. </ul>
  482. </dd>
  483. <dt>
  484. <a name = "hash_remove"></a>
  485. <strong>hash_remove&nbsp;(hash, key)</strong>
  486. </dt>
  487. <dd>
  488. Remove an element from a table using key.
  489. <h3>Parameters:</h3>
  490. <ul>
  491. <li><span class="parameter">hash</span>
  492. the table</li>
  493. <li><span class="parameter">key</span>
  494. the key to remove</li>
  495. </ul>
  496. </dd>
  497. <dt>
  498. <a name = "get_days_in_month"></a>
  499. <strong>get_days_in_month&nbsp;(month, year)</strong>
  500. </dt>
  501. <dd>
  502. Get the number of days in a given month of a year.
  503. iT returns a number
  504. <h3>Parameters:</h3>
  505. <ul>
  506. <li><span class="parameter">month</span>
  507. the month we focus on ( 1 to 12 )</li>
  508. <li><span class="parameter">year</span>
  509. a number YYYY used to check if it's a leap year.</li>
  510. </ul>
  511. </dd>
  512. <dt>
  513. <a name = "get_ISO8601_weeks_number_of_month"></a>
  514. <strong>get_ISO8601_weeks_number_of_month&nbsp;(month, year)</strong>
  515. </dt>
  516. <dd>
  517. Find the weeks numbers of a given month.
  518. Week begin on monday
  519. http://fr.wikipedia.org/wiki/ISO_8601
  520. find the week number of a date:
  521. 1 find the day number (in the year) of the thursday of the same week of our date
  522. 2 find the week day of the 04 january of the year of our date
  523. 3 find the number of days between the 04-01 and the first monday before this date
  524. 4 find the number of days between the 04-01 and the date we focus on
  525. 5 add the two last value, add 3 and divide by 7
  526. First it checks the number of the first week of a month and then it calculate the next six weeks numbers. The value returned is a table of six number.
  527. <h3>Parameters:</h3>
  528. <ul>
  529. <li><span class="parameter">month</span>
  530. the month</li>
  531. <li><span class="parameter">year</span>
  532. the year</li>
  533. </ul>
  534. </dd>
  535. </dl>
  536. </div> <!-- id="content" -->
  537. </div> <!-- id="main" -->
  538. <div id="about">
  539. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.3.12</a></i>
  540. </div> <!-- id="about" -->
  541. </div> <!-- id="container" -->
  542. </body>
  543. </html>