blingbling.helpers.html 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  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 class="$(kind=='Topics' and '' or 'nowrap'">
  30. <li><a href="../modules/blingbling.calendar.html">blingbling.calendar</a></li>
  31. <li><a href="../modules/blingbling.clock.html">blingbling.clock</a></li>
  32. <li><strong>blingbling.helpers</strong></li>
  33. <li><a href="../modules/blingbling.linegraph.html">blingbling.linegraph</a></li>
  34. <li><a href="../modules/blingbling.widget.html">blingbling.widget</a></li>
  35. <li><a href="../modules/blingbling.popups.html">blingbling.popups</a></li>
  36. <li><a href="../modules/blingbling.progress_graph.html">blingbling.progress_graph</a></li>
  37. <li><a href="../modules/blingbling.system.html">blingbling.system</a></li>
  38. <li><a href="../modules/blingbling.tagslist.html">blingbling.tagslist</a></li>
  39. <li><a href="../modules/blingbling.task_warrior.html">blingbling.task_warrior</a></li>
  40. <li><a href="../modules/blingbling.text_box.html">blingbling.text_box</a></li>
  41. <li><a href="../modules/blingbling.transient.html">blingbling.transient</a></li>
  42. <li><a href="../modules/blingbling.triangular_progress_graph.html">blingbling.triangular_progress_graph</a></li>
  43. <li><a href="../modules/blingbling.udisks_glue.html">blingbling.udisks_glue</a></li>
  44. <li><a href="../modules/blingbling.value_text_box.html">blingbling.value_text_box</a></li>
  45. <li><a href="../modules/blingbling.volume.html">blingbling.volume</a></li>
  46. <li><a href="../modules/blingbling.wlourf_circle_graph.html">blingbling.wlourf_circle_graph</a></li>
  47. </ul>
  48. </div>
  49. <div id="content">
  50. <h1>Module <code>blingbling.helpers</code></h1>
  51. <p>Functions used in blingbling.</p>
  52. <p></p>
  53. <h2><a href="#Functions">Functions</a></h2>
  54. <table class="function_list">
  55. <tr>
  56. <td class="name" nowrap><a href="#dbg">dbg (vars)</a></td>
  57. <td class="summary">Display values of variables in an awesome popup.</td>
  58. </tr>
  59. <tr>
  60. <td class="name" nowrap><a href="#hexadecimal_to_rgba_percent">hexadecimal_to_rgba_percent (my_color)</a></td>
  61. <td class="summary">Convert an hexadecimal color to rgba color.</td>
  62. </tr>
  63. <tr>
  64. <td class="name" nowrap><a href="#rgb">rgb (red, green, blue)</a></td>
  65. <td class="summary">Get red green blue value in parameters and return hexadecimal string</td>
  66. </tr>
  67. <tr>
  68. <td class="name" nowrap><a href="#rgba">rgba (red, green, blue, alpha)</a></td>
  69. <td class="summary">Get red green blue and alpha value in parameters and return hexadecimal string.</td>
  70. </tr>
  71. <tr>
  72. <td class="name" nowrap><a href="#is_transparent">is_transparent (my_color)</a></td>
  73. <td class="summary">Check if an hexadecimal color is fully transparent.</td>
  74. </tr>
  75. <tr>
  76. <td class="name" nowrap><a href="#split">split (str, pat)</a></td>
  77. <td class="summary">Split string in different parts which are returned in a table.</td>
  78. </tr>
  79. <tr>
  80. <td class="name" nowrap><a href="#draw_background_tiles">draw_background_tiles (cr, height, v_margin, width, h_margin)</a></td>
  81. <td class="summary">Draw tiles in a cairo context.</td>
  82. </tr>
  83. <tr>
  84. <td class="name" nowrap><a href="#draw_text_and_background">draw_text_and_background (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>
  85. <td class="summary">Draw text on a rectangle which width and height depend on the text width and height.</td>
  86. </tr>
  87. <tr>
  88. <td class="name" nowrap><a href="#draw_up_down_arrows">draw_up_down_arrows (cr, x, y_bottom, y_top, value, background_arrow_color, arrow_color, arrow_line_color, up)</a></td>
  89. <td class="summary">Drawn one foreground arrow with a background arrow that depend on a value.</td>
  90. </tr>
  91. <tr>
  92. <td class="name" nowrap><a href="#draw_vertical_bar">draw_vertical_bar (cr, h_margin, v_margin, width, height, represent)</a></td>
  93. <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>
  94. </tr>
  95. <tr>
  96. <td class="name" nowrap><a href="#draw_horizontal_bar">draw_horizontal_bar (cr, h_margin, v_margin, width, height, represent)</a></td>
  97. <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>
  98. </tr>
  99. <tr>
  100. <td class="name" nowrap><a href="#draw_rounded_corners_rectangle">draw_rounded_corners_rectangle (cr, x, y, width, height, color, rounded_size)</a></td>
  101. <td class="summary">Draw a rectangle width rounded corners.</td>
  102. </tr>
  103. <tr>
  104. <td class="name" nowrap><a href="#clip_rounded_corners_rectangle">clip_rounded_corners_rectangle (cr, x, y, width, height, rounded_size)</a></td>
  105. <td class="summary">Set a rectangle width rounded corners that define the area to draw.</td>
  106. </tr>
  107. <tr>
  108. <td class="name" nowrap><a href="#draw_rounded_corners_horizontal_graph">draw_rounded_corners_horizontal_graph (cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</a></td>
  109. <td class="summary">Draw a foreground rounded corners rectangle which width depends on a value, and a background rounded corners rectangle.</td>
  110. </tr>
  111. <tr>
  112. <td class="name" nowrap><a href="#draw_rounded_corners_vertical_graph">draw_rounded_corners_vertical_graph (cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</a></td>
  113. <td class="summary">Draw a foreground rounded corners rectangle which height depends on a value, and a background rounded corners rectangle.</td>
  114. </tr>
  115. <tr>
  116. <td class="name" nowrap><a href="#generate_rounded_rectangle_with_text">generate_rounded_rectangle_with_text (cr, width, height, text, padding, background_color, text_color, font_size, rounded_size, border)</a></td>
  117. <td class="summary">Generate a text in front of a centered rectangle with rounded corners (or not) in a cairo context.</td>
  118. </tr>
  119. <tr>
  120. <td class="name" nowrap><a href="#draw_triangle">draw_triangle (cr, first, second, third, color)</a></td>
  121. <td class="summary">Draw a rectangular triangle filled with given color</td>
  122. </tr>
  123. <tr>
  124. <td class="name" nowrap><a href="#draw_triangle_outline">draw_triangle_outline (cr, first, second, third, color)</a></td>
  125. <td class="summary">Draw a rectangular triangular outline of the given color</td>
  126. </tr>
  127. <tr>
  128. <td class="name" nowrap><a href="#compute_bar_width">compute_bar_width (nb_bars, width, sep)</a></td>
  129. <td class="summary">Compute the width of each bar in a graph
  130. It returns the width of the bar and a value
  131. that corresponds to the remaing space divided
  132. by 2</td>
  133. </tr>
  134. <tr>
  135. <td class="name" nowrap><a href="#draw_triangle_graph_using_bars">draw_triangle_graph_using_bars (cr, width, height, h_margin, v_margin, color, value)</a></td>
  136. <td class="summary">Display a value using bars or parts of bar in a triangular form</td>
  137. </tr>
  138. <tr>
  139. <td class="name" nowrap><a href="#hash_remove">hash_remove (hash, key)</a></td>
  140. <td class="summary">Remove an element from a table using key.</td>
  141. </tr>
  142. <tr>
  143. <td class="name" nowrap><a href="#get_days_in_month">get_days_in_month (month, year)</a></td>
  144. <td class="summary">Get the number of days in a given month of a year.</td>
  145. </tr>
  146. <tr>
  147. <td class="name" nowrap><a href="#get_ISO8601_weeks_number_of_month">get_ISO8601_weeks_number_of_month (month, year)</a></td>
  148. <td class="summary">Find the weeks numbers of a given month.</td>
  149. </tr>
  150. <tr>
  151. <td class="name" nowrap><a href="#get_nb_cores">get_nb_cores ()</a></td>
  152. <td class="summary">Get the number of cpu cores</td>
  153. </tr>
  154. <tr>
  155. <td class="name" nowrap><a href="#get_cpu_name">get_cpu_name ()</a></td>
  156. <td class="summary">Get the cpu name</td>
  157. </tr>
  158. <tr>
  159. <td class="name" nowrap><a href="#get_mounted_devices">get_mounted_devices ()</a></td>
  160. <td class="summary">Get all the currently mounted devices</td>
  161. </tr>
  162. <tr>
  163. <td class="name" nowrap><a href="#get_total_mem_in_kb">get_total_mem_in_kb ()</a></td>
  164. <td class="summary">Get the total amount of RAM in kb</td>
  165. </tr>
  166. <tr>
  167. <td class="name" nowrap><a href="#get_input_devices">get_input_devices ()</a></td>
  168. <td class="summary">Get the input device names</td>
  169. </tr>
  170. <tr>
  171. <td class="name" nowrap><a href="#get_graphic_card">get_graphic_card ()</a></td>
  172. <td class="summary">Get the current graphic card</td>
  173. </tr>
  174. <tr>
  175. <td class="name" nowrap><a href="#get_os_release_informations">get_os_release_informations ()</a></td>
  176. <td class="summary">Get OS related informations from /etc/os-release</td>
  177. </tr>
  178. <tr>
  179. <td class="name" nowrap><a href="#icons_only_tasklist">icons_only_tasklist (w, buttons, label, data, objects)</a></td>
  180. <td class="summary">Function used in order to have a tasklist with icons only
  181. The classical usage of it is:
  182. awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons,nil,icons_only_tasklist)</td>
  183. </tr>
  184. <tr>
  185. <td class="name" nowrap><a href="#load_properties">load_properties (properties, data, graph, superproperties)</a></td>
  186. <td class="summary">Function used in widgets in order to create a local table of
  187. all the widget properties which are a mix between the properties
  188. provided by the user trought the widget interface, or the properties
  189. defined by superproperties</td>
  190. </tr>
  191. </table>
  192. <br/>
  193. <br/>
  194. <h2><a name="Functions"></a>Functions</h2>
  195. <dl class="function">
  196. <dt>
  197. <a name = "dbg"></a>
  198. <strong>dbg (vars)</strong>
  199. </dt>
  200. <dd>
  201. Display values of variables in an awesome popup.
  202. Each variables in vars is separated by a "|"
  203. <h3>Parameters:</h3>
  204. <ul>
  205. <li><span class="parameter">vars</span>
  206. a table of variable
  207. </li>
  208. </ul>
  209. </dd>
  210. <dt>
  211. <a name = "hexadecimal_to_rgba_percent"></a>
  212. <strong>hexadecimal_to_rgba_percent (my_color)</strong>
  213. </dt>
  214. <dd>
  215. Convert an hexadecimal color to rgba color.
  216. It convert a string variable "#rrggbb" or "#rrggbbaa" (with r,g,b and a which are hexadecimal value) to r, g, b a=1 or r,g,b,a (with r,g,b,a floated value from 0 to 1.
  217. The function returns 4 variables.
  218. <h3>Parameters:</h3>
  219. <ul>
  220. <li><span class="parameter">my_color</span>
  221. a string "#rrggbb" or "#rrggbbaa"
  222. </li>
  223. </ul>
  224. </dd>
  225. <dt>
  226. <a name = "rgb"></a>
  227. <strong>rgb (red, green, blue)</strong>
  228. </dt>
  229. <dd>
  230. Get red green blue value in parameters and return hexadecimal string
  231. <h3>Parameters:</h3>
  232. <ul>
  233. <li><span class="parameter">red</span>
  234. </li>
  235. <li><span class="parameter">green</span>
  236. </li>
  237. <li><span class="parameter">blue</span>
  238. </li>
  239. </ul>
  240. </dd>
  241. <dt>
  242. <a name = "rgba"></a>
  243. <strong>rgba (red, green, blue, alpha)</strong>
  244. </dt>
  245. <dd>
  246. Get red green blue and alpha value in parameters and return hexadecimal string.
  247. <h3>Parameters:</h3>
  248. <ul>
  249. <li><span class="parameter">red</span>
  250. </li>
  251. <li><span class="parameter">green</span>
  252. </li>
  253. <li><span class="parameter">blue</span>
  254. </li>
  255. <li><span class="parameter">alpha</span>
  256. </li>
  257. </ul>
  258. </dd>
  259. <dt>
  260. <a name = "is_transparent"></a>
  261. <strong>is_transparent (my_color)</strong>
  262. </dt>
  263. <dd>
  264. Check if an hexadecimal color is fully transparent.
  265. Returns true or false
  266. <h3>Parameters:</h3>
  267. <ul>
  268. <li><span class="parameter">my_color</span>
  269. a string "#rrggbb" or "#rrggbbaa"
  270. </li>
  271. </ul>
  272. </dd>
  273. <dt>
  274. <a name = "split"></a>
  275. <strong>split (str, pat)</strong>
  276. </dt>
  277. <dd>
  278. Split string in different parts which are returned in a table. The delimiter of each part is a pattern given in argument.
  279. <h3>Parameters:</h3>
  280. <ul>
  281. <li><span class="parameter">str</span>
  282. the string to split
  283. </li>
  284. <li><span class="parameter">pat</span>
  285. the pattern delimiter
  286. </li>
  287. </ul>
  288. </dd>
  289. <dt>
  290. <a name = "draw_background_tiles"></a>
  291. <strong>draw_background_tiles (cr, height, v_margin, width, h_margin)</strong>
  292. </dt>
  293. <dd>
  294. Draw tiles in a cairo context.
  295. <h3>Parameters:</h3>
  296. <ul>
  297. <li><span class="parameter">cr</span>
  298. a cairo context.
  299. </li>
  300. <li><span class="parameter">height</span>
  301. the height of the surface on which we want tiles
  302. </li>
  303. <li><span class="parameter">v_margin</span>
  304. value used to define top margin and/or bottom margin (tiles are not drawn on the margins)
  305. </li>
  306. <li><span class="parameter">width</span>
  307. the width of the surface on which we want tiles
  308. </li>
  309. <li><span class="parameter">h_margin</span>
  310. value used to define left margin and/or right margin.
  311. </li>
  312. </ul>
  313. </dd>
  314. <dt>
  315. <a name = "draw_text_and_background"></a>
  316. <strong>draw_text_and_background (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>
  317. </dt>
  318. <dd>
  319. Draw text on a rectangle which width and height depend on the text width and height.
  320. <h3>Parameters:</h3>
  321. <ul>
  322. <li><span class="parameter">cr</span>
  323. a cairo context already initialised with oocairo.context_create( )
  324. </li>
  325. <li><span class="parameter">text</span>
  326. the text to display
  327. </li>
  328. <li><span class="parameter">x</span>
  329. the x coordinate of the left of the text
  330. </li>
  331. <li><span class="parameter">y</span>
  332. the y coordinate of the bottom of the text
  333. </li>
  334. <li><span class="parameter">text_background_color</span>
  335. a string "#rrggbb" or "#rrggbbaa" for the rectangle color
  336. </li>
  337. <li><span class="parameter">text_color</span>
  338. a string "#rrggbb" or "#rrggbbaa" for the text color
  339. </li>
  340. <li><span class="parameter">show_text_centered_on_x</span>
  341. a boolean value not mandatory (false by default) if true, x parameter is the coordinate of the middle of the text
  342. </li>
  343. <li><span class="parameter">show_text_centered_on_y</span>
  344. a boolean value not mandatory (false by default) if true, y parameter is the coordinate of the middle of the text
  345. </li>
  346. <li><span class="parameter">show_text_on_left_of_x</span>
  347. a boolean value not mandatory (false by default) if true, x parameter is the right of the text
  348. </li>
  349. <li><span class="parameter">show_text_on_bottom_of_y</span>
  350. a boolean value not mandatory (false by default) if true, y parameter is the top of the text
  351. </li>
  352. </ul>
  353. </dd>
  354. <dt>
  355. <a name = "draw_up_down_arrows"></a>
  356. <strong>draw_up_down_arrows (cr, x, y_bottom, y_top, value, background_arrow_color, arrow_color, arrow_line_color, up)</strong>
  357. </dt>
  358. <dd>
  359. Drawn one foreground arrow with a background arrow that depend on a value.
  360. If the value is egal to 0 then the foreground arrow is not drawn.
  361. <h3>Parameters:</h3>
  362. <ul>
  363. <li><span class="parameter">cr</span>
  364. a cairo context already initialised with oocairo.context_create( )
  365. </li>
  366. <li><span class="parameter">x</span>
  367. the x coordinate in the cairo context where the arrow start
  368. </li>
  369. <li><span class="parameter">y_bottom</span>
  370. the bottom corrdinate of the arrows
  371. </li>
  372. <li><span class="parameter">y_top</span>
  373. the top coordinate of the arrows
  374. </li>
  375. <li><span class="parameter">value</span>
  376. a number
  377. </li>
  378. <li><span class="parameter">background_arrow_color</span>
  379. the color of the background arrow, a string "#rrggbb" or "#rrggbbaa"
  380. </li>
  381. <li><span class="parameter">arrow_color</span>
  382. the color of the foreground arrow, a string "#rrggbb" or "#rrggbbaa"
  383. </li>
  384. <li><span class="parameter">arrow_line_color</span>
  385. the color of the outline of the foreground arrow , a string "#rrggbb" or "#rrggbbaa"
  386. </li>
  387. <li><span class="parameter">up</span>
  388. boolean value if false draw a down arrow, if true draw a up arrow
  389. </li>
  390. </ul>
  391. </dd>
  392. <dt>
  393. <a name = "draw_vertical_bar"></a>
  394. <strong>draw_vertical_bar (cr, h_margin, v_margin, width, height, represent)</strong>
  395. </dt>
  396. <dd>
  397. Draw a vertical bar with gradient color, so it looks like a cylinder, and it's height depends on a value.
  398. <h3>Parameters:</h3>
  399. <ul>
  400. <li><span class="parameter">cr</span>
  401. a cairo context already initialised with oocairo.context_create( )
  402. </li>
  403. <li><span class="parameter">h_margin</span>
  404. the left and right margin of the bar in the cr
  405. </li>
  406. <li><span class="parameter">v_margin</span>
  407. the top and bottom margin of the bar in the cr
  408. </li>
  409. <li><span class="parameter">width</span>
  410. the width used to display the left margin, the bar and the right margin
  411. </li>
  412. <li><span class="parameter">height</span>
  413. the height used to display the top margin, the bar and the bottom margin
  414. </li>
  415. <li><span class="parameter">represent</span>
  416. a table {background_bar_color = "#rrggbb" or "#rrggbbaa", color = "#rrggbb" or "#rrggbbaa", value =the value used to calculate the height of the bar}
  417. </li>
  418. </ul>
  419. </dd>
  420. <dt>
  421. <a name = "draw_horizontal_bar"></a>
  422. <strong>draw_horizontal_bar (cr, h_margin, v_margin, width, height, represent)</strong>
  423. </dt>
  424. <dd>
  425. Draw an horizontal bar with gradient color, so it looks like a cylinder, and it's height depends on a value.
  426. <h3>Parameters:</h3>
  427. <ul>
  428. <li><span class="parameter">cr</span>
  429. a cairo context already initialised with oocairo.context_create( )
  430. </li>
  431. <li><span class="parameter">h_margin</span>
  432. the left and right margin of the bar in the cr
  433. </li>
  434. <li><span class="parameter">v_margin</span>
  435. the top and bottom margin of the bar in the cr
  436. </li>
  437. <li><span class="parameter">width</span>
  438. the width used to display the left margin, the bar and the right margin
  439. </li>
  440. <li><span class="parameter">height</span>
  441. the height used to display the top margin, the bar and the bottom margin
  442. </li>
  443. <li><span class="parameter">represent</span>
  444. a table {background_bar_color = "#rrggbb" or "#rrggbbaa", color = "#rrggbb" or "#rrggbbaa", value =the value used to calculate the width of the bar}
  445. </li>
  446. </ul>
  447. </dd>
  448. <dt>
  449. <a name = "draw_rounded_corners_rectangle"></a>
  450. <strong>draw_rounded_corners_rectangle (cr, x, y, width, height, color, rounded_size)</strong>
  451. </dt>
  452. <dd>
  453. Draw a rectangle width rounded corners.
  454. <h3>Parameters:</h3>
  455. <ul>
  456. <li><span class="parameter">cr</span>
  457. a cairo context already initialised with oocairo.context_create( )
  458. </li>
  459. <li><span class="parameter">x</span>
  460. the x coordinate of the left top corner
  461. </li>
  462. <li><span class="parameter">y</span>
  463. the y corrdinate of the left top corner
  464. </li>
  465. <li><span class="parameter">width</span>
  466. the width of the rectangle
  467. </li>
  468. <li><span class="parameter">height</span>
  469. the height of the rectangle
  470. </li>
  471. <li><span class="parameter">color</span>
  472. a string "#rrggbb" or "#rrggbbaa" for the color of the rectangle
  473. </li>
  474. <li><span class="parameter">rounded_size</span>
  475. a float value from 0 to 1 (0 is no rounded corner) or a table of float value
  476. </li>
  477. </ul>
  478. </dd>
  479. <dt>
  480. <a name = "clip_rounded_corners_rectangle"></a>
  481. <strong>clip_rounded_corners_rectangle (cr, x, y, width, height, rounded_size)</strong>
  482. </dt>
  483. <dd>
  484. Set a rectangle width rounded corners that define the area to draw.
  485. <h3>Parameters:</h3>
  486. <ul>
  487. <li><span class="parameter">cr</span>
  488. a cairo context already initialised with oocairo.context_create( )
  489. </li>
  490. <li><span class="parameter">x</span>
  491. the x coordinate of the left top corner
  492. </li>
  493. <li><span class="parameter">y</span>
  494. the y corrdinate of the left top corner
  495. </li>
  496. <li><span class="parameter">width</span>
  497. the width of the rectangle
  498. </li>
  499. <li><span class="parameter">height</span>
  500. the height of the rectangle
  501. </li>
  502. <li><span class="parameter">rounded_size</span>
  503. a float value from 0 to 1 (0 is no rounded corner)
  504. </li>
  505. </ul>
  506. </dd>
  507. <dt>
  508. <a name = "draw_rounded_corners_horizontal_graph"></a>
  509. <strong>draw_rounded_corners_horizontal_graph (cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</strong>
  510. </dt>
  511. <dd>
  512. Draw a foreground rounded corners rectangle which width depends on a value, and a background rounded corners rectangle.
  513. <h3>Parameters:</h3>
  514. <ul>
  515. <li><span class="parameter">cr</span>
  516. a cairo context already initialised with oocairo.context_create( )
  517. </li>
  518. <li><span class="parameter">x</span>
  519. the x coordinate of the left top corner
  520. </li>
  521. <li><span class="parameter">y</span>
  522. the y corrdinate of the left top corner
  523. </li>
  524. <li><span class="parameter">width</span>
  525. the width of the background rectangle and the maximal width of th foreground rectangle
  526. </li>
  527. <li><span class="parameter">height</span>
  528. the height of the background and the foreground rectangles
  529. </li>
  530. <li><span class="parameter">background_color</span>
  531. a string "#rrggbb" or "#rrggbbaa" for the color of the background rectangle
  532. </li>
  533. <li><span class="parameter">graph_color</span>
  534. a string "#rrggbb" or "#rrggbbaa" for the color of the foreground rectangle
  535. </li>
  536. <li><span class="parameter">rounded_size</span>
  537. a float value from 0 to 1 (0 is no rounded corner)
  538. </li>
  539. <li><span class="parameter">value_to_represent</span>
  540. the percent of the max width used to calculate the width of the foreground rectangle
  541. </li>
  542. <li><span class="parameter">graph_line_color</span>
  543. a string "#rrggbb" or "#rrggbbaa" for the outiline color of the background rectangle
  544. </li>
  545. </ul>
  546. </dd>
  547. <dt>
  548. <a name = "draw_rounded_corners_vertical_graph"></a>
  549. <strong>draw_rounded_corners_vertical_graph (cr, x, y, width, height, background_color, graph_color, rounded_size, value_to_represent, graph_line_color)</strong>
  550. </dt>
  551. <dd>
  552. Draw a foreground rounded corners rectangle which height depends on a value, and a background rounded corners rectangle.
  553. <h3>Parameters:</h3>
  554. <ul>
  555. <li><span class="parameter">cr</span>
  556. a cairo context already initialised with oocairo.context_create( )
  557. </li>
  558. <li><span class="parameter">x</span>
  559. the x coordinate of the left top corner
  560. </li>
  561. <li><span class="parameter">y</span>
  562. the y corrdinate of the left top corner
  563. </li>
  564. <li><span class="parameter">width</span>
  565. the width of the background and the foreground rectangles
  566. </li>
  567. <li><span class="parameter">height</span>
  568. the height of the background rectangle and the maximal height of the foreground rectangle
  569. </li>
  570. <li><span class="parameter">background_color</span>
  571. a string "#rrggbb" or "#rrggbbaa" for the color of the background rectangle
  572. </li>
  573. <li><span class="parameter">graph_color</span>
  574. a string "#rrggbb" or "#rrggbbaa" for the color of the foreground rectangle
  575. </li>
  576. <li><span class="parameter">rounded_size</span>
  577. a float value from 0 to 1 (0 is no rounded corner)
  578. </li>
  579. <li><span class="parameter">value_to_represent</span>
  580. the percent of the max height used to calculate the height of the foreground rectangle
  581. </li>
  582. <li><span class="parameter">graph_line_color</span>
  583. a string "#rrggbb" or "#rrggbbaa" for the outiline color of the background rectangle
  584. </li>
  585. </ul>
  586. </dd>
  587. <dt>
  588. <a name = "generate_rounded_rectangle_with_text"></a>
  589. <strong>generate_rounded_rectangle_with_text (cr, width, height, text, padding, background_color, text_color, font_size, rounded_size, border)</strong>
  590. </dt>
  591. <dd>
  592. Generate a text in front of a centered rectangle with rounded corners (or not) in a cairo context.
  593. It returns a table ={ width = the width of the image, height = the height of the image}
  594. <h3>Parameters:</h3>
  595. <ul>
  596. <li><span class="parameter">cr</span>
  597. a cairo context already initialised with oocairo.context_create( )
  598. </li>
  599. <li><span class="parameter">width</span>
  600. the width of the widget
  601. </li>
  602. <li><span class="parameter">height</span>
  603. the height of the widget
  604. </li>
  605. <li><span class="parameter">text</span>
  606. the text to display
  607. </li>
  608. <li><span class="parameter">padding</span>
  609. the left/right/top/bottom padding used to center the text in the background rectangle
  610. </li>
  611. <li><span class="parameter">background_color</span>
  612. a string "#rrggbb" or "#rrggbbaa" for the color of the background rectangle
  613. </li>
  614. <li><span class="parameter">text_color</span>
  615. a string "#rrggbb" or "#rrggbbaa" for the color of the text
  616. </li>
  617. <li><span class="parameter">font_size</span>
  618. define the size of the font
  619. </li>
  620. <li><span class="parameter">rounded_size</span>
  621. a float value from 0 to 1 (0 is no rounded corner)
  622. </li>
  623. <li><span class="parameter">border</span>
  624. a color as a string "#rrggbb" or "#rrggbbaa"
  625. </li>
  626. </ul>
  627. </dd>
  628. <dt>
  629. <a name = "draw_triangle"></a>
  630. <strong>draw_triangle (cr, first, second, third, color)</strong>
  631. </dt>
  632. <dd>
  633. Draw a rectangular triangle filled with given color
  634. <h3>Parameters:</h3>
  635. <ul>
  636. <li><span class="parameter">cr</span>
  637. cairo context
  638. </li>
  639. <li><span class="parameter">first</span>
  640. point coordinates {x= 1.0, y = 2.0}
  641. </li>
  642. <li><span class="parameter">second</span>
  643. point coordinates {x= 1.0, y = 2.0}
  644. </li>
  645. <li><span class="parameter">third</span>
  646. point coordinates {x= 1.0, y = 2.0}
  647. </li>
  648. <li><span class="parameter">color</span>
  649. a color as a string "#rrggbb" or "#rrggbbaa"
  650. </li>
  651. </ul>
  652. </dd>
  653. <dt>
  654. <a name = "draw_triangle_outline"></a>
  655. <strong>draw_triangle_outline (cr, first, second, third, color)</strong>
  656. </dt>
  657. <dd>
  658. Draw a rectangular triangular outline of the given color
  659. <h3>Parameters:</h3>
  660. <ul>
  661. <li><span class="parameter">cr</span>
  662. cairo context
  663. </li>
  664. <li><span class="parameter">first</span>
  665. point coordinates {x= 1.0, y = 2.0}
  666. </li>
  667. <li><span class="parameter">second</span>
  668. point coordinates {x= 1.0, y = 2.0}
  669. </li>
  670. <li><span class="parameter">third</span>
  671. point coordinates {x= 1.0, y = 2.0}
  672. </li>
  673. <li><span class="parameter">color</span>
  674. a color as a string "#rrggbb" or "#rrggbbaa"
  675. </li>
  676. </ul>
  677. </dd>
  678. <dt>
  679. <a name = "compute_bar_width"></a>
  680. <strong>compute_bar_width (nb_bars, width, sep)</strong>
  681. </dt>
  682. <dd>
  683. Compute the width of each bar in a graph
  684. It returns the width of the bar and a value
  685. that corresponds to the remaing space divided
  686. by 2
  687. <h3>Parameters:</h3>
  688. <ul>
  689. <li><span class="parameter">nb_bars</span>
  690. the number of bars
  691. </li>
  692. <li><span class="parameter">width</span>
  693. the width of the graph
  694. </li>
  695. <li><span class="parameter">sep</span>
  696. the size between two bars
  697. </li>
  698. </ul>
  699. </dd>
  700. <dt>
  701. <a name = "draw_triangle_graph_using_bars"></a>
  702. <strong>draw_triangle_graph_using_bars (cr, width, height, h_margin, v_margin, color, value)</strong>
  703. </dt>
  704. <dd>
  705. Display a value using bars or parts of bar in a triangular form
  706. <h3>Parameters:</h3>
  707. <ul>
  708. <li><span class="parameter">cr</span>
  709. cairo context
  710. </li>
  711. <li><span class="parameter">width</span>
  712. width of the graph
  713. </li>
  714. <li><span class="parameter">height</span>
  715. height of the graph
  716. </li>
  717. <li><span class="parameter">h_margin</span>
  718. horizontal space left at left and right of the graph
  719. </li>
  720. <li><span class="parameter">v_margin</span>
  721. vertical space left at top and bottom of the graph
  722. </li>
  723. <li><span class="parameter">color</span>
  724. the color of the graph
  725. </li>
  726. <li><span class="parameter">value</span>
  727. to represent
  728. </li>
  729. </ul>
  730. </dd>
  731. <dt>
  732. <a name = "hash_remove"></a>
  733. <strong>hash_remove (hash, key)</strong>
  734. </dt>
  735. <dd>
  736. Remove an element from a table using key.
  737. <h3>Parameters:</h3>
  738. <ul>
  739. <li><span class="parameter">hash</span>
  740. the table
  741. </li>
  742. <li><span class="parameter">key</span>
  743. the key to remove
  744. </li>
  745. </ul>
  746. </dd>
  747. <dt>
  748. <a name = "get_days_in_month"></a>
  749. <strong>get_days_in_month (month, year)</strong>
  750. </dt>
  751. <dd>
  752. Get the number of days in a given month of a year.
  753. iT returns a number
  754. <h3>Parameters:</h3>
  755. <ul>
  756. <li><span class="parameter">month</span>
  757. the month we focus on ( 1 to 12 )
  758. </li>
  759. <li><span class="parameter">year</span>
  760. a number YYYY used to check if it's a leap year.
  761. </li>
  762. </ul>
  763. </dd>
  764. <dt>
  765. <a name = "get_ISO8601_weeks_number_of_month"></a>
  766. <strong>get_ISO8601_weeks_number_of_month (month, year)</strong>
  767. </dt>
  768. <dd>
  769. Find the weeks numbers of a given month.
  770. Implementation as per the ISO 8601 definition (http://en.wikipedia.org/wiki/ISO_week_date)
  771. Fully compatible with original, returns table with 6 week numbers
  772. <h3>Parameters:</h3>
  773. <ul>
  774. <li><span class="parameter">month</span>
  775. the month
  776. </li>
  777. <li><span class="parameter">year</span>
  778. the year
  779. </li>
  780. </ul>
  781. </dd>
  782. <dt>
  783. <a name = "get_nb_cores"></a>
  784. <strong>get_nb_cores ()</strong>
  785. </dt>
  786. <dd>
  787. Get the number of cpu cores
  788. <h3>Returns:</h3>
  789. <ol>
  790. a number
  791. </ol>
  792. </dd>
  793. <dt>
  794. <a name = "get_cpu_name"></a>
  795. <strong>get_cpu_name ()</strong>
  796. </dt>
  797. <dd>
  798. Get the cpu name
  799. <h3>Returns:</h3>
  800. <ol>
  801. a string describing the cpu
  802. </ol>
  803. </dd>
  804. <dt>
  805. <a name = "get_mounted_devices"></a>
  806. <strong>get_mounted_devices ()</strong>
  807. </dt>
  808. <dd>
  809. Get all the currently mounted devices
  810. <h3>Returns:</h3>
  811. <ol>
  812. an indexed table from 1 to n, where each element is a table with the "mnt", and "dev" key.
  813. </ol>
  814. </dd>
  815. <dt>
  816. <a name = "get_total_mem_in_kb"></a>
  817. <strong>get_total_mem_in_kb ()</strong>
  818. </dt>
  819. <dd>
  820. Get the total amount of RAM in kb
  821. <h3>Returns:</h3>
  822. <ol>
  823. a number
  824. </ol>
  825. </dd>
  826. <dt>
  827. <a name = "get_input_devices"></a>
  828. <strong>get_input_devices ()</strong>
  829. </dt>
  830. <dd>
  831. Get the input device names
  832. <h3>Returns:</h3>
  833. <ol>
  834. an table with "keyboard" and "mouse" keys
  835. </ol>
  836. </dd>
  837. <dt>
  838. <a name = "get_graphic_card"></a>
  839. <strong>get_graphic_card ()</strong>
  840. </dt>
  841. <dd>
  842. Get the current graphic card
  843. <h3>Returns:</h3>
  844. <ol>
  845. a string
  846. </ol>
  847. </dd>
  848. <dt>
  849. <a name = "get_os_release_informations"></a>
  850. <strong>get_os_release_informations ()</strong>
  851. </dt>
  852. <dd>
  853. Get OS related informations from /etc/os-release
  854. <h3>Returns:</h3>
  855. <ol>
  856. a key/value table
  857. </ol>
  858. </dd>
  859. <dt>
  860. <a name = "icons_only_tasklist"></a>
  861. <strong>icons_only_tasklist (w, buttons, label, data, objects)</strong>
  862. </dt>
  863. <dd>
  864. Function used in order to have a tasklist with icons only
  865. The classical usage of it is:
  866. awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons,nil,icons_only_tasklist)
  867. <h3>Parameters:</h3>
  868. <ul>
  869. <li><span class="parameter">w</span>
  870. </li>
  871. <li><span class="parameter">buttons</span>
  872. </li>
  873. <li><span class="parameter">label</span>
  874. </li>
  875. <li><span class="parameter">data</span>
  876. </li>
  877. <li><span class="parameter">objects</span>
  878. </li>
  879. </ul>
  880. </dd>
  881. <dt>
  882. <a name = "load_properties"></a>
  883. <strong>load_properties (properties, data, graph, superproperties)</strong>
  884. </dt>
  885. <dd>
  886. Function used in widgets in order to create a local table of
  887. all the widget properties which are a mix between the properties
  888. provided by the user trought the widget interface, or the properties
  889. defined by superproperties
  890. <h3>Parameters:</h3>
  891. <ul>
  892. <li><span class="parameter">properties</span>
  893. a table with the names of all the properties
  894. </li>
  895. <li><span class="parameter">data</span>
  896. the data table of the module that references all the same widgets
  897. </li>
  898. <li><span class="parameter">graph</span>
  899. the widget itself
  900. </li>
  901. <li><span class="parameter">superproperties</span>
  902. the table of the superporperties
  903. </li>
  904. </ul>
  905. </dd>
  906. </dl>
  907. </div> <!-- id="content" -->
  908. </div> <!-- id="main" -->
  909. <div id="about">
  910. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
  911. <i style="float:right;">Last updated 2015-08-04 10:16:50 </i>
  912. </div> <!-- id="about" -->
  913. </div> <!-- id="container" -->
  914. </body>
  915. </html>