You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

568 lines
16 KiB

1 year ago
  1. var NAVTREE =
  2. [
  3. [ "Face Engine SDK", "index.html", [
  4. [ "LUNA SDK", "index.html", [
  5. [ "Introduction", "index.html#IntroSection", null ],
  6. [ "Structure", "index.html#StructureSection", null ]
  7. ] ],
  8. [ "Modules", "modules.html", "modules" ],
  9. [ "Namespaces", null, [
  10. [ "Namespace List", "namespaces.html", "namespaces" ],
  11. [ "Namespace Members", "namespacemembers.html", [
  12. [ "All", "namespacemembers.html", null ],
  13. [ "Functions", "namespacemembers_func.html", null ],
  14. [ "Typedefs", "namespacemembers_type.html", null ],
  15. [ "Enumerations", "namespacemembers_enum.html", null ],
  16. [ "Enumerator", "namespacemembers_eval.html", null ]
  17. ] ]
  18. ] ],
  19. [ "Classes", null, [
  20. [ "Class List", "annotated.html", "annotated" ],
  21. [ "Class Index", "classes.html", null ],
  22. [ "Class Hierarchy", "hierarchy.html", "hierarchy" ],
  23. [ "Class Members", "functions.html", [
  24. [ "All", "functions.html", "functions_dup" ],
  25. [ "Functions", "functions_func.html", "functions_func" ],
  26. [ "Variables", "functions_vars.html", null ],
  27. [ "Typedefs", "functions_type.html", null ],
  28. [ "Enumerations", "functions_enum.html", null ],
  29. [ "Enumerator", "functions_eval.html", null ]
  30. ] ]
  31. ] ],
  32. [ "Files", null, [
  33. [ "File List", "files.html", "files" ],
  34. [ "File Members", "globals.html", [
  35. [ "All", "globals.html", null ],
  36. [ "Macros", "globals_defs.html", null ]
  37. ] ]
  38. ] ]
  39. ] ]
  40. ];
  41. var NAVTREEINDEX =
  42. [
  43. "_def_8h.html",
  44. "functions_0x66.html",
  45. "structfsdk_1_1_face.html#a9c829216cf178ece188aee1afa78af8f",
  46. "structfsdk_1_1_i_serializable_object.html#a5171a97d79c639d613ec9d6ee694c8e1",
  47. "structfsdk_1_1_image.html#a8bce66953fc250acf5c729d5168d6310",
  48. "structfsdk_1_1_vector2.html#a956df0b0a02e8a0a2129749129c97676"
  49. ];
  50. var SYNCONMSG = 'click to disable panel synchronisation';
  51. var SYNCOFFMSG = 'click to enable panel synchronisation';
  52. var SYNCONMSG = 'click to disable panel synchronisation';
  53. var SYNCOFFMSG = 'click to enable panel synchronisation';
  54. var navTreeSubIndices = new Array();
  55. function getData(varName)
  56. {
  57. var i = varName.lastIndexOf('/');
  58. var n = i>=0 ? varName.substring(i+1) : varName;
  59. return eval(n.replace(/\-/g,'_'));
  60. }
  61. function stripPath(uri)
  62. {
  63. return uri.substring(uri.lastIndexOf('/')+1);
  64. }
  65. function stripPath2(uri)
  66. {
  67. var i = uri.lastIndexOf('/');
  68. var s = uri.substring(i+1);
  69. var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/);
  70. return m ? uri.substring(i-6) : s;
  71. }
  72. function localStorageSupported()
  73. {
  74. try {
  75. return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem;
  76. }
  77. catch(e) {
  78. return false;
  79. }
  80. }
  81. function storeLink(link)
  82. {
  83. if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) {
  84. window.localStorage.setItem('navpath',link);
  85. }
  86. }
  87. function deleteLink()
  88. {
  89. if (localStorageSupported()) {
  90. window.localStorage.setItem('navpath','');
  91. }
  92. }
  93. function cachedLink()
  94. {
  95. if (localStorageSupported()) {
  96. return window.localStorage.getItem('navpath');
  97. } else {
  98. return '';
  99. }
  100. }
  101. function getScript(scriptName,func,show)
  102. {
  103. var head = document.getElementsByTagName("head")[0];
  104. var script = document.createElement('script');
  105. script.id = scriptName;
  106. script.type = 'text/javascript';
  107. script.onload = func;
  108. script.src = scriptName+'.js';
  109. if ($.browser.msie && $.browser.version<=8) {
  110. // script.onload does not work with older versions of IE
  111. script.onreadystatechange = function() {
  112. if (script.readyState=='complete' || script.readyState=='loaded') {
  113. func(); if (show) showRoot();
  114. }
  115. }
  116. }
  117. head.appendChild(script);
  118. }
  119. function createIndent(o,domNode,node,level)
  120. {
  121. var level=-1;
  122. var n = node;
  123. while (n.parentNode) { level++; n=n.parentNode; }
  124. if (node.childrenData) {
  125. var imgNode = document.createElement("img");
  126. imgNode.style.paddingLeft=(16*level).toString()+'px';
  127. imgNode.width = 16;
  128. imgNode.height = 22;
  129. imgNode.border = 0;
  130. node.plus_img = imgNode;
  131. node.expandToggle = document.createElement("a");
  132. node.expandToggle.href = "javascript:void(0)";
  133. node.expandToggle.onclick = function() {
  134. if (node.expanded) {
  135. $(node.getChildrenUL()).slideUp("fast");
  136. node.plus_img.src = node.relpath+"ftv2pnode.png";
  137. node.expanded = false;
  138. } else {
  139. expandNode(o, node, false, false);
  140. }
  141. }
  142. node.expandToggle.appendChild(imgNode);
  143. domNode.appendChild(node.expandToggle);
  144. imgNode.src = node.relpath+"ftv2pnode.png";
  145. } else {
  146. var span = document.createElement("span");
  147. span.style.display = 'inline-block';
  148. span.style.width = 16*(level+1)+'px';
  149. span.style.height = '22px';
  150. span.innerHTML = '&nbsp;';
  151. domNode.appendChild(span);
  152. }
  153. }
  154. var animationInProgress = false;
  155. function gotoAnchor(anchor,aname,updateLocation)
  156. {
  157. var pos, docContent = $('#doc-content');
  158. if (anchor.parent().attr('class')=='memItemLeft' ||
  159. anchor.parent().attr('class')=='fieldtype' ||
  160. anchor.parent().is(':header'))
  161. {
  162. pos = anchor.parent().position().top;
  163. } else if (anchor.position()) {
  164. pos = anchor.position().top;
  165. }
  166. if (pos) {
  167. var dist = Math.abs(Math.min(
  168. pos-docContent.offset().top,
  169. docContent[0].scrollHeight-
  170. docContent.height()-docContent.scrollTop()));
  171. animationInProgress=true;
  172. docContent.animate({
  173. scrollTop: pos + docContent.scrollTop() - docContent.offset().top
  174. },Math.max(50,Math.min(500,dist)),function(){
  175. if (updateLocation) window.location.href=aname;
  176. animationInProgress=false;
  177. });
  178. }
  179. }
  180. function newNode(o, po, text, link, childrenData, lastNode)
  181. {
  182. var node = new Object();
  183. node.children = Array();
  184. node.childrenData = childrenData;
  185. node.depth = po.depth + 1;
  186. node.relpath = po.relpath;
  187. node.isLast = lastNode;
  188. node.li = document.createElement("li");
  189. po.getChildrenUL().appendChild(node.li);
  190. node.parentNode = po;
  191. node.itemDiv = document.createElement("div");
  192. node.itemDiv.className = "item";
  193. node.labelSpan = document.createElement("span");
  194. node.labelSpan.className = "label";
  195. createIndent(o,node.itemDiv,node,0);
  196. node.itemDiv.appendChild(node.labelSpan);
  197. node.li.appendChild(node.itemDiv);
  198. var a = document.createElement("a");
  199. node.labelSpan.appendChild(a);
  200. node.label = document.createTextNode(text);
  201. node.expanded = false;
  202. a.appendChild(node.label);
  203. if (link) {
  204. var url;
  205. if (link.substring(0,1)=='^') {
  206. url = link.substring(1);
  207. link = url;
  208. } else {
  209. url = node.relpath+link;
  210. }
  211. a.className = stripPath(link.replace('#',':'));
  212. if (link.indexOf('#')!=-1) {
  213. var aname = '#'+link.split('#')[1];
  214. var srcPage = stripPath($(location).attr('pathname'));
  215. var targetPage = stripPath(link.split('#')[0]);
  216. a.href = srcPage!=targetPage ? url : "javascript:void(0)";
  217. a.onclick = function(){
  218. storeLink(link);
  219. if (!$(a).parent().parent().hasClass('selected'))
  220. {
  221. $('.item').removeClass('selected');
  222. $('.item').removeAttr('id');
  223. $(a).parent().parent().addClass('selected');
  224. $(a).parent().parent().attr('id','selected');
  225. }
  226. var anchor = $(aname);
  227. gotoAnchor(anchor,aname,true);
  228. };
  229. } else {
  230. a.href = url;
  231. a.onclick = function() { storeLink(link); }
  232. }
  233. } else {
  234. if (childrenData != null)
  235. {
  236. a.className = "nolink";
  237. a.href = "javascript:void(0)";
  238. a.onclick = node.expandToggle.onclick;
  239. }
  240. }
  241. node.childrenUL = null;
  242. node.getChildrenUL = function() {
  243. if (!node.childrenUL) {
  244. node.childrenUL = document.createElement("ul");
  245. node.childrenUL.className = "children_ul";
  246. node.childrenUL.style.display = "none";
  247. node.li.appendChild(node.childrenUL);
  248. }
  249. return node.childrenUL;
  250. };
  251. return node;
  252. }
  253. function showRoot()
  254. {
  255. var headerHeight = $("#top").height();
  256. var footerHeight = $("#nav-path").height();
  257. var windowHeight = $(window).height() - headerHeight - footerHeight;
  258. (function (){ // retry until we can scroll to the selected item
  259. try {
  260. var navtree=$('#nav-tree');
  261. navtree.scrollTo('#selected',0,{offset:-windowHeight/2});
  262. } catch (err) {
  263. setTimeout(arguments.callee, 0);
  264. }
  265. })();
  266. }
  267. function expandNode(o, node, imm, showRoot)
  268. {
  269. if (node.childrenData && !node.expanded) {
  270. if (typeof(node.childrenData)==='string') {
  271. var varName = node.childrenData;
  272. getScript(node.relpath+varName,function(){
  273. node.childrenData = getData(varName);
  274. expandNode(o, node, imm, showRoot);
  275. }, showRoot);
  276. } else {
  277. if (!node.childrenVisited) {
  278. getNode(o, node);
  279. } if (imm || ($.browser.msie && $.browser.version>8)) {
  280. // somehow slideDown jumps to the start of tree for IE9 :-(
  281. $(node.getChildrenUL()).show();
  282. } else {
  283. $(node.getChildrenUL()).slideDown("fast");
  284. }
  285. if (node.isLast) {
  286. node.plus_img.src = node.relpath+"ftv2mlastnode.png";
  287. } else {
  288. node.plus_img.src = node.relpath+"ftv2mnode.png";
  289. }
  290. node.expanded = true;
  291. }
  292. }
  293. }
  294. function glowEffect(n,duration)
  295. {
  296. n.addClass('glow').delay(duration).queue(function(next){
  297. $(this).removeClass('glow');next();
  298. });
  299. }
  300. function highlightAnchor()
  301. {
  302. var aname = $(location).attr('hash');
  303. var anchor = $(aname);
  304. if (anchor.parent().attr('class')=='memItemLeft'){
  305. var rows = $('.memberdecls tr[class$="'+
  306. window.location.hash.substring(1)+'"]');
  307. glowEffect(rows.children(),300); // member without details
  308. } else if (anchor.parents().slice(2).prop('tagName')=='TR') {
  309. glowEffect(anchor.parents('div.memitem'),1000); // enum value
  310. } else if (anchor.parent().attr('class')=='fieldtype'){
  311. glowEffect(anchor.parent().parent(),1000); // struct field
  312. } else if (anchor.parent().is(":header")) {
  313. glowEffect(anchor.parent(),1000); // section header
  314. } else {
  315. glowEffect(anchor.next(),1000); // normal member
  316. }
  317. gotoAnchor(anchor,aname,false);
  318. }
  319. function selectAndHighlight(hash,n)
  320. {
  321. var a;
  322. if (hash) {
  323. var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1);
  324. a=$('.item a[class$="'+link+'"]');
  325. }
  326. if (a && a.length) {
  327. a.parent().parent().addClass('selected');
  328. a.parent().parent().attr('id','selected');
  329. highlightAnchor();
  330. } else if (n) {
  331. $(n.itemDiv).addClass('selected');
  332. $(n.itemDiv).attr('id','selected');
  333. }
  334. if ($('#nav-tree-contents .item:first').hasClass('selected')) {
  335. $('#nav-sync').css('top','30px');
  336. } else {
  337. $('#nav-sync').css('top','5px');
  338. }
  339. showRoot();
  340. }
  341. function showNode(o, node, index, hash)
  342. {
  343. if (node && node.childrenData) {
  344. if (typeof(node.childrenData)==='string') {
  345. var varName = node.childrenData;
  346. getScript(node.relpath+varName,function(){
  347. node.childrenData = getData(varName);
  348. showNode(o,node,index,hash);
  349. },true);
  350. } else {
  351. if (!node.childrenVisited) {
  352. getNode(o, node);
  353. }
  354. $(node.getChildrenUL()).css({'display':'block'});
  355. if (node.isLast) {
  356. node.plus_img.src = node.relpath+"ftv2mlastnode.png";
  357. } else {
  358. node.plus_img.src = node.relpath+"ftv2mnode.png";
  359. }
  360. node.expanded = true;
  361. var n = node.children[o.breadcrumbs[index]];
  362. if (index+1<o.breadcrumbs.length) {
  363. showNode(o,n,index+1,hash);
  364. } else {
  365. if (typeof(n.childrenData)==='string') {
  366. var varName = n.childrenData;
  367. getScript(n.relpath+varName,function(){
  368. n.childrenData = getData(varName);
  369. node.expanded=false;
  370. showNode(o,node,index,hash); // retry with child node expanded
  371. },true);
  372. } else {
  373. var rootBase = stripPath(o.toroot.replace(/\..+$/, ''));
  374. if (rootBase=="index" || rootBase=="pages" || rootBase=="search") {
  375. expandNode(o, n, true, true);
  376. }
  377. selectAndHighlight(hash,n);
  378. }
  379. }
  380. }
  381. } else {
  382. selectAndHighlight(hash);
  383. }
  384. }
  385. function removeToInsertLater(element) {
  386. var parentNode = element.parentNode;
  387. var nextSibling = element.nextSibling;
  388. parentNode.removeChild(element);
  389. return function() {
  390. if (nextSibling) {
  391. parentNode.insertBefore(element, nextSibling);
  392. } else {
  393. parentNode.appendChild(element);
  394. }
  395. };
  396. }
  397. function getNode(o, po)
  398. {
  399. var insertFunction = removeToInsertLater(po.li);
  400. po.childrenVisited = true;
  401. var l = po.childrenData.length-1;
  402. for (var i in po.childrenData) {
  403. var nodeData = po.childrenData[i];
  404. po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2],
  405. i==l);
  406. }
  407. insertFunction();
  408. }
  409. function gotoNode(o,subIndex,root,hash,relpath)
  410. {
  411. var nti = navTreeSubIndices[subIndex][root+hash];
  412. o.breadcrumbs = $.extend(true, [], nti ? nti : navTreeSubIndices[subIndex][root]);
  413. if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index
  414. navTo(o,NAVTREE[0][1],"",relpath);
  415. $('.item').removeClass('selected');
  416. $('.item').removeAttr('id');
  417. }
  418. if (o.breadcrumbs) {
  419. o.breadcrumbs.unshift(0); // add 0 for root node
  420. showNode(o, o.node, 0, hash);
  421. }
  422. }
  423. function navTo(o,root,hash,relpath)
  424. {
  425. var link = cachedLink();
  426. if (link) {
  427. var parts = link.split('#');
  428. root = parts[0];
  429. if (parts.length>1) hash = '#'+parts[1];
  430. else hash='';
  431. }
  432. if (hash.match(/^#l\d+$/)) {
  433. var anchor=$('a[name='+hash.substring(1)+']');
  434. glowEffect(anchor.parent(),1000); // line number
  435. hash=''; // strip line number anchors
  436. //root=root.replace(/_source\./,'.'); // source link to doc link
  437. }
  438. var url=root+hash;
  439. var i=-1;
  440. while (NAVTREEINDEX[i+1]<=url) i++;
  441. if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index
  442. if (navTreeSubIndices[i]) {
  443. gotoNode(o,i,root,hash,relpath)
  444. } else {
  445. getScript(relpath+'navtreeindex'+i,function(){
  446. navTreeSubIndices[i] = eval('NAVTREEINDEX'+i);
  447. if (navTreeSubIndices[i]) {
  448. gotoNode(o,i,root,hash,relpath);
  449. }
  450. },true);
  451. }
  452. }
  453. function showSyncOff(n,relpath)
  454. {
  455. n.html('<img src="'+relpath+'sync_off.png" title="'+SYNCOFFMSG+'"/>');
  456. }
  457. function showSyncOn(n,relpath)
  458. {
  459. n.html('<img src="'+relpath+'sync_on.png" title="'+SYNCONMSG+'"/>');
  460. }
  461. function toggleSyncButton(relpath)
  462. {
  463. var navSync = $('#nav-sync');
  464. if (navSync.hasClass('sync')) {
  465. navSync.removeClass('sync');
  466. showSyncOff(navSync,relpath);
  467. storeLink(stripPath2($(location).attr('pathname'))+$(location).attr('hash'));
  468. } else {
  469. navSync.addClass('sync');
  470. showSyncOn(navSync,relpath);
  471. deleteLink();
  472. }
  473. }
  474. function initNavTree(toroot,relpath)
  475. {
  476. var o = new Object();
  477. o.toroot = toroot;
  478. o.node = new Object();
  479. o.node.li = document.getElementById("nav-tree-contents");
  480. o.node.childrenData = NAVTREE;
  481. o.node.children = new Array();
  482. o.node.childrenUL = document.createElement("ul");
  483. o.node.getChildrenUL = function() { return o.node.childrenUL; };
  484. o.node.li.appendChild(o.node.childrenUL);
  485. o.node.depth = 0;
  486. o.node.relpath = relpath;
  487. o.node.expanded = false;
  488. o.node.isLast = true;
  489. o.node.plus_img = document.createElement("img");
  490. o.node.plus_img.src = relpath+"ftv2pnode.png";
  491. o.node.plus_img.width = 16;
  492. o.node.plus_img.height = 22;
  493. if (localStorageSupported()) {
  494. var navSync = $('#nav-sync');
  495. if (cachedLink()) {
  496. showSyncOff(navSync,relpath);
  497. navSync.removeClass('sync');
  498. } else {
  499. showSyncOn(navSync,relpath);
  500. }
  501. navSync.click(function(){ toggleSyncButton(relpath); });
  502. }
  503. $(window).load(function(){
  504. navTo(o,toroot,window.location.hash,relpath);
  505. showRoot();
  506. });
  507. $(window).bind('hashchange', function(){
  508. if (window.location.hash && window.location.hash.length>1){
  509. var a;
  510. if ($(location).attr('hash')){
  511. var clslink=stripPath($(location).attr('pathname'))+':'+
  512. $(location).attr('hash').substring(1);
  513. a=$('.item a[class$="'+clslink+'"]');
  514. }
  515. if (a==null || !$(a).parent().parent().hasClass('selected')){
  516. $('.item').removeClass('selected');
  517. $('.item').removeAttr('id');
  518. }
  519. var link=stripPath2($(location).attr('pathname'));
  520. navTo(o,link,$(location).attr('hash'),relpath);
  521. } else if (!animationInProgress) {
  522. $('#doc-content').scrollTop(0);
  523. $('.item').removeClass('selected');
  524. $('.item').removeAttr('id');
  525. navTo(o,toroot,window.location.hash,relpath);
  526. }
  527. })
  528. }