2024-05-30 00:17
parent
f362ea9b7a
commit
5cb5e05fe3
|
@ -1,266 +0,0 @@
|
||||||
/**
|
|
||||||
|
|
||||||
The code below is based on the Doxygen Awesome project with some minor modifications
|
|
||||||
https://github.com/jothepro/doxygen-awesome-css
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021 - 2022 jothepro
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
class DarkModeToggle extends HTMLElement {
|
|
||||||
static icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em"><g fill="none" fill-rule="evenodd"><path d="M0 0h24v24H0z"></path><rect width="1" height="3" x="12" fill="currentColor" rx=".5"></rect><rect width="1" height="3" x="12" y="21" fill="currentColor" rx=".5"></rect><rect width="1" height="3" x="22" y="10.5" fill="currentColor" rx=".5" transform="rotate(90 22.5 12)"></rect><rect width="1" height="3" x="1" y="10.5" fill="currentColor" rx=".5" transform="rotate(90 1.5 12)"></rect><rect width="1" height="3" x="19" y="3" fill="currentColor" rx=".5" transform="rotate(-135 19.5 4.5)"></rect><rect width="1" height="3" x="19" y="18" fill="currentColor" rx=".5" transform="rotate(135 19.5 19.5)"></rect><rect width="1" height="3" x="4" y="3" fill="currentColor" rx=".5" transform="scale(1 -1) rotate(45 15.37 0)"></rect><rect width="1" height="3" x="4" y="18" fill="currentColor" rx=".5" transform="scale(1 -1) rotate(-45 -42.57 0)"></rect><circle cx="12" cy="12" r="6.5" stroke="currentColor"></circle><path fill="currentColor" stroke="currentColor" d="M12.5 18.48V5.52a6.5 6.5 0 010 12.96z"></path></g></svg>';
|
|
||||||
static title = "Toggle Light/Dark Mode"
|
|
||||||
|
|
||||||
static prefersLightModeInDarkModeKey = "prefers-light-mode-in-dark-mode"
|
|
||||||
static prefersDarkModeInLightModeKey = "prefers-dark-mode-in-light-mode"
|
|
||||||
|
|
||||||
static _staticConstructor = function() {
|
|
||||||
DarkModeToggle.enableDarkMode(DarkModeToggle.userPreference)
|
|
||||||
// Update the color scheme when the browsers preference changes
|
|
||||||
// without user interaction on the website.
|
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
|
||||||
DarkModeToggle.onSystemPreferenceChanged()
|
|
||||||
})
|
|
||||||
// Update the color scheme when the tab is made visible again.
|
|
||||||
// It is possible that the appearance was changed in another tab
|
|
||||||
// while this tab was in the background.
|
|
||||||
document.addEventListener("visibilitychange", visibilityState => {
|
|
||||||
if (document.visibilityState === 'visible') {
|
|
||||||
DarkModeToggle.onSystemPreferenceChanged()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}()
|
|
||||||
|
|
||||||
static init() {
|
|
||||||
$(function() {
|
|
||||||
$(document).ready(function() {
|
|
||||||
const toggleButton = document.createElement('dark-mode-toggle')
|
|
||||||
toggleButton.title = DarkModeToggle.title
|
|
||||||
toggleButton.innerHTML = DarkModeToggle.icon
|
|
||||||
|
|
||||||
function addButton() {
|
|
||||||
var titleArea = document.getElementById("titlearea");
|
|
||||||
var searchBox = document.getElementById("MSearchBox");
|
|
||||||
var mainMenu = document.getElementById("main-menu");
|
|
||||||
var navRow1 = document.getElementById("navrow1");
|
|
||||||
var mainMenuVisible = false;
|
|
||||||
if (mainMenu) {
|
|
||||||
var menuStyle = window.getComputedStyle(mainMenu);
|
|
||||||
mainMenuVisible = menuStyle.display!=='none'
|
|
||||||
}
|
|
||||||
var searchBoxPos1 = document.getElementById("searchBoxPos1");
|
|
||||||
if (searchBox) { // (1) search box visible
|
|
||||||
searchBox.parentNode.appendChild(toggleButton)
|
|
||||||
} else if (navRow1) { // (2) no search box, static menu bar
|
|
||||||
var li = document.createElement('li');
|
|
||||||
li.style = 'float: right;'
|
|
||||||
li.appendChild(toggleButton);
|
|
||||||
toggleButton.style = 'width: 24px; height: 25px; padding-top: 11px; float: right;';
|
|
||||||
var row = document.querySelector('#navrow1 > ul:first-of-type');
|
|
||||||
row.appendChild(li)
|
|
||||||
} else if (mainMenu && mainMenuVisible) { // (3) no search box + dynamic menu bar expanded
|
|
||||||
var li = document.createElement('li');
|
|
||||||
li.style = 'float: right;'
|
|
||||||
li.appendChild(toggleButton);
|
|
||||||
toggleButton.style = 'width: 14px; height: 36px; padding-top: 10px; float: right;';
|
|
||||||
mainMenu.appendChild(li)
|
|
||||||
} else if (searchBoxPos1) { // (4) no search box + dynamic menu bar collapsed
|
|
||||||
toggleButton.style = 'width: 24px; height: 36px; padding-top: 10px; float: right;';
|
|
||||||
searchBoxPos1.style = 'top: 0px;'
|
|
||||||
searchBoxPos1.appendChild(toggleButton);
|
|
||||||
} else if (titleArea) { // (5) no search box and no navigation tabs
|
|
||||||
toggleButton.style = 'width: 24px; height: 24px; position: absolute; right: 0px; top: 34px;';
|
|
||||||
titleArea.append(toggleButton);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
addButton();
|
|
||||||
})
|
|
||||||
$(window).resize(function(){
|
|
||||||
addButton();
|
|
||||||
})
|
|
||||||
DarkModeToggle.setDarkModeVisibility(DarkModeToggle.darkModeEnabled)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this.onclick=this.toggleDarkMode
|
|
||||||
}
|
|
||||||
|
|
||||||
static createCookie(name, value, days) {
|
|
||||||
if (days) {
|
|
||||||
var date = new Date();
|
|
||||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
||||||
var expires = "; expires=" + date.toGMTString();
|
|
||||||
}
|
|
||||||
else var expires = "";
|
|
||||||
|
|
||||||
document.cookie = name + "=" + value + expires + "; path=/";
|
|
||||||
}
|
|
||||||
|
|
||||||
static readCookie(name) {
|
|
||||||
var nameEQ = name + "=";
|
|
||||||
var ca = document.cookie.split(';');
|
|
||||||
for (var i = 0; i < ca.length; i++) {
|
|
||||||
var c = ca[i];
|
|
||||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
||||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
static eraseCookie(name) {
|
|
||||||
DarkModeToggle.createCookie(name, "", -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns `true` for dark-mode, `false` for light-mode system preference
|
|
||||||
*/
|
|
||||||
static get systemPreference() {
|
|
||||||
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
||||||
}
|
|
||||||
|
|
||||||
static get prefersDarkModeInLightMode() {
|
|
||||||
if (window.chrome) { // Chrome supports localStorage in combination with file:// but not cookies
|
|
||||||
return localStorage.getItem(DarkModeToggle.prefersDarkModeInLightModeKey)
|
|
||||||
} else { // Other browsers support cookies in combination with file:// but not localStorage
|
|
||||||
return DarkModeToggle.readCookie('doxygen_prefers_dark')=='1'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static set prefersDarkModeInLightMode(preference) {
|
|
||||||
if (window.chrome) {
|
|
||||||
if (preference) {
|
|
||||||
localStorage.setItem(DarkModeToggle.prefersDarkModeInLightModeKey, true)
|
|
||||||
} else {
|
|
||||||
localStorage.removeItem(DarkModeToggle.prefersDarkModeInLightModeKey)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (preference) {
|
|
||||||
DarkModeToggle.createCookie('doxygen_prefers_dark','1',365)
|
|
||||||
} else {
|
|
||||||
DarkModeToggle.eraseCookie('doxygen_prefers_dark')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get prefersLightModeInDarkMode() {
|
|
||||||
if (window.chrome) { // Chrome supports localStorage in combination with file:// but not cookies
|
|
||||||
return localStorage.getItem(DarkModeToggle.prefersLightModeInDarkModeKey)
|
|
||||||
} else { // Other browsers support cookies in combination with file:// but not localStorage
|
|
||||||
return DarkModeToggle.readCookie('doxygen_prefers_light')=='1'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static set prefersLightModeInDarkMode(preference) {
|
|
||||||
if (window.chrome) {
|
|
||||||
if (preference) {
|
|
||||||
localStorage.setItem(DarkModeToggle.prefersLightModeInDarkModeKey, true)
|
|
||||||
} else {
|
|
||||||
localStorage.removeItem(DarkModeToggle.prefersLightModeInDarkModeKey)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (preference) {
|
|
||||||
DarkModeToggle.createCookie('doxygen_prefers_light','1',365)
|
|
||||||
} else {
|
|
||||||
DarkModeToggle.eraseCookie('doxygen_prefers_light')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns `true` for dark-mode, `false` for light-mode user preference
|
|
||||||
*/
|
|
||||||
static get userPreference() {
|
|
||||||
return (!DarkModeToggle.systemPreference && DarkModeToggle.prefersDarkModeInLightMode) ||
|
|
||||||
(DarkModeToggle.systemPreference && !DarkModeToggle.prefersLightModeInDarkMode)
|
|
||||||
}
|
|
||||||
|
|
||||||
static set userPreference(userPreference) {
|
|
||||||
DarkModeToggle.darkModeEnabled = userPreference
|
|
||||||
if (!userPreference) {
|
|
||||||
if (DarkModeToggle.systemPreference) {
|
|
||||||
DarkModeToggle.prefersLightModeInDarkMode = true
|
|
||||||
} else {
|
|
||||||
DarkModeToggle.prefersDarkModeInLightMode = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!DarkModeToggle.systemPreference) {
|
|
||||||
DarkModeToggle.prefersDarkModeInLightMode = true
|
|
||||||
} else {
|
|
||||||
DarkModeToggle.prefersLightModeInDarkMode = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DarkModeToggle.onUserPreferenceChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
static setDarkModeVisibility(enable) {
|
|
||||||
var darkModeStyle, lightModeStyle;
|
|
||||||
if(enable) {
|
|
||||||
darkModeStyle = 'inline-block';
|
|
||||||
lightModeStyle = 'none'
|
|
||||||
} else {
|
|
||||||
darkModeStyle = 'none';
|
|
||||||
lightModeStyle = 'inline-block'
|
|
||||||
}
|
|
||||||
document.querySelectorAll('.dark-mode-visible').forEach(function(el) {
|
|
||||||
el.style.display = darkModeStyle;
|
|
||||||
});
|
|
||||||
document.querySelectorAll('.light-mode-visible').forEach(function(el) {
|
|
||||||
el.style.display = lightModeStyle;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
static enableDarkMode(enable) {
|
|
||||||
if(enable) {
|
|
||||||
DarkModeToggle.darkModeEnabled = true
|
|
||||||
document.documentElement.classList.add("dark-mode")
|
|
||||||
document.documentElement.classList.remove("light-mode")
|
|
||||||
} else {
|
|
||||||
DarkModeToggle.darkModeEnabled = false
|
|
||||||
document.documentElement.classList.remove("dark-mode")
|
|
||||||
document.documentElement.classList.add("light-mode")
|
|
||||||
}
|
|
||||||
DarkModeToggle.setDarkModeVisibility(enable)
|
|
||||||
}
|
|
||||||
|
|
||||||
static onSystemPreferenceChanged() {
|
|
||||||
DarkModeToggle.darkModeEnabled = DarkModeToggle.userPreference
|
|
||||||
DarkModeToggle.enableDarkMode(DarkModeToggle.darkModeEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
static onUserPreferenceChanged() {
|
|
||||||
DarkModeToggle.enableDarkMode(DarkModeToggle.darkModeEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleDarkMode() {
|
|
||||||
DarkModeToggle.userPreference = !DarkModeToggle.userPreference
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("dark-mode-toggle", DarkModeToggle);
|
|
||||||
|
|
||||||
DarkModeToggle.init();
|
|
|
@ -1,116 +0,0 @@
|
||||||
/**
|
|
||||||
|
|
||||||
Doxygen Awesome
|
|
||||||
https://github.com/jothepro/doxygen-awesome-css
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021 - 2023 jothepro
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
html {
|
|
||||||
/* side nav width. MUST be = `TREEVIEW_WIDTH`.
|
|
||||||
* Make sure it is wide enough to contain the page title (logo + title + version)
|
|
||||||
*/
|
|
||||||
--side-nav-fixed-width: 335px;
|
|
||||||
--menu-display: none;
|
|
||||||
|
|
||||||
--top-height: 120px;
|
|
||||||
--toc-sticky-top: -25px;
|
|
||||||
--toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 25px);
|
|
||||||
}
|
|
||||||
|
|
||||||
#projectname {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
|
||||||
html {
|
|
||||||
--searchbar-background: var(--page-background-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-nav {
|
|
||||||
min-width: var(--side-nav-fixed-width);
|
|
||||||
max-width: var(--side-nav-fixed-width);
|
|
||||||
top: var(--top-height);
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav-tree, #side-nav {
|
|
||||||
height: calc(100vh - var(--top-height)) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav-tree {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#top {
|
|
||||||
display: block;
|
|
||||||
border-bottom: none;
|
|
||||||
height: var(--top-height);
|
|
||||||
margin-bottom: calc(0px - var(--top-height));
|
|
||||||
max-width: var(--side-nav-fixed-width);
|
|
||||||
overflow: hidden;
|
|
||||||
background: var(--side-nav-background);
|
|
||||||
}
|
|
||||||
#main-nav {
|
|
||||||
float: left;
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ui-resizable-handle {
|
|
||||||
cursor: default;
|
|
||||||
width: 1px !important;
|
|
||||||
background: var(--separator-color);
|
|
||||||
box-shadow: 0 calc(-2 * var(--top-height)) 0 0 var(--separator-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav-path {
|
|
||||||
position: fixed;
|
|
||||||
right: 0;
|
|
||||||
left: var(--side-nav-fixed-width);
|
|
||||||
bottom: 0;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#doc-content {
|
|
||||||
height: calc(100vh - 31px) !important;
|
|
||||||
padding-bottom: calc(3 * var(--spacing-large));
|
|
||||||
padding-top: calc(var(--top-height) - 80px);
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin-left: var(--side-nav-fixed-width) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#MSearchBox {
|
|
||||||
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)));
|
|
||||||
}
|
|
||||||
|
|
||||||
#MSearchField {
|
|
||||||
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - 65px);
|
|
||||||
}
|
|
||||||
|
|
||||||
#MSearchResultsWindow {
|
|
||||||
left: var(--spacing-medium) !important;
|
|
||||||
right: auto;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,419 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
||||||
<meta name="generator" content="Doxygen 1.9.7"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
||||||
<title>godot-cpp-utils: godot_macros.h File Reference</title>
|
|
||||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="dynsections.js"></script>
|
|
||||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
||||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
||||||
<script type="text/javascript" src="search/search.js"></script>
|
|
||||||
<script type="text/javascript" src="darkmode_toggle.js"></script>
|
|
||||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
||||||
<div id="titlearea">
|
|
||||||
<table cellspacing="0" cellpadding="0">
|
|
||||||
<tbody>
|
|
||||||
<tr id="projectrow">
|
|
||||||
<td id="projectalign">
|
|
||||||
<div id="projectname">godot-cpp-utils
|
|
||||||
</div>
|
|
||||||
<div id="projectbrief">A collection of utility classes, functions and macros for use with Godot and GDExtension.</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- end header part -->
|
|
||||||
<!-- Generated by Doxygen 1.9.7 -->
|
|
||||||
<script type="text/javascript">
|
|
||||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
||||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
||||||
/* @license-end */
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="menudata.js"></script>
|
|
||||||
<script type="text/javascript" src="menu.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
||||||
$(function() {
|
|
||||||
initMenu('',true,false,'search.php','Search');
|
|
||||||
$(document).ready(function() { init_search(); });
|
|
||||||
});
|
|
||||||
/* @license-end */
|
|
||||||
</script>
|
|
||||||
<div id="main-nav"></div>
|
|
||||||
<!-- window showing the filter options -->
|
|
||||||
<div id="MSearchSelectWindow"
|
|
||||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
||||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
||||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- iframe showing the search results (closed by default) -->
|
|
||||||
<div id="MSearchResultsWindow">
|
|
||||||
<div id="MSearchResults">
|
|
||||||
<div class="SRPage">
|
|
||||||
<div id="SRIndex">
|
|
||||||
<div id="SRResults"></div>
|
|
||||||
<div class="SRStatus" id="Loading">Loading...</div>
|
|
||||||
<div class="SRStatus" id="Searching">Searching...</div>
|
|
||||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div><!-- top -->
|
|
||||||
<div class="header">
|
|
||||||
<div class="summary">
|
|
||||||
<a href="#define-members">Macros</a> </div>
|
|
||||||
<div class="headertitle"><div class="title">godot_macros.h File Reference</div></div>
|
|
||||||
</div><!--header-->
|
|
||||||
<div class="contents">
|
|
||||||
|
|
||||||
<p>C-style preprocessor macros to simplify using godot's C++ API.
|
|
||||||
<a href="#details">More...</a></p>
|
|
||||||
<div class="textblock"><code>#include "godot_cpp/classes/engine.hpp"</code><br />
|
|
||||||
<code>#include "godot_cpp/core/class_db.hpp"</code><br />
|
|
||||||
<code>#include "godot_cpp/variant/string.hpp"</code><br />
|
|
||||||
</div>
|
|
||||||
<p><a href="godot__macros_8h_source.html">Go to the source code of this file.</a></p>
|
|
||||||
<table class="memberdecls">
|
|
||||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
|
||||||
Macros</h2></td></tr>
|
|
||||||
<tr class="memitem:a7458deef1a40348503d0a48ffd0003f6"><td class="memItemLeft" align="right" valign="top"><a id="a7458deef1a40348503d0a48ffd0003f6" name="a7458deef1a40348503d0a48ffd0003f6"></a>
|
|
||||||
#define </td><td class="memItemRight" valign="bottom"><b>MACRO_STRING_INNER</b>(_Arg)   #_Arg</td></tr>
|
|
||||||
<tr class="separator:a7458deef1a40348503d0a48ffd0003f6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a0be8cf11055d2f4c194baa2c5cbb8b19"><td class="memItemLeft" align="right" valign="top"><a id="a0be8cf11055d2f4c194baa2c5cbb8b19" name="a0be8cf11055d2f4c194baa2c5cbb8b19"></a>
|
|
||||||
#define </td><td class="memItemRight" valign="bottom"><b>MACRO_STRING</b>(_Arg)   MACRO_STRING_INNER(_Arg)</td></tr>
|
|
||||||
<tr class="separator:a0be8cf11055d2f4c194baa2c5cbb8b19"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a3dab0009fb317e0fce558e09edd4964c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#a3dab0009fb317e0fce558e09edd4964c">GDPROPERTY</a>(PropName_, PropType_)</td></tr>
|
|
||||||
<tr class="memdesc:a3dab0009fb317e0fce558e09edd4964c"><td class="mdescLeft"> </td><td class="mdescRight">Register property. <br /></td></tr>
|
|
||||||
<tr class="separator:a3dab0009fb317e0fce558e09edd4964c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a9e70408fe612616931e2c251eb149114"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#a9e70408fe612616931e2c251eb149114">GDPROPERTY_HINTED</a>(PropName_, PropType_, ...)</td></tr>
|
|
||||||
<tr class="memdesc:a9e70408fe612616931e2c251eb149114"><td class="mdescLeft"> </td><td class="mdescRight">Register a hinted property. <br /></td></tr>
|
|
||||||
<tr class="separator:a9e70408fe612616931e2c251eb149114"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:aec4c8284cb9ea77c97a7037176081801"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#aec4c8284cb9ea77c97a7037176081801">GDFUNCTION</a>(FnName_)   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &CLASSNAME::FnName_)</td></tr>
|
|
||||||
<tr class="memdesc:aec4c8284cb9ea77c97a7037176081801"><td class="mdescLeft"> </td><td class="mdescRight">Register a function CLASSNAME::FnName_() to godot. <br /></td></tr>
|
|
||||||
<tr class="separator:aec4c8284cb9ea77c97a7037176081801"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:abb5f0f48b26566dab84ff075fdc9fb4e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#abb5f0f48b26566dab84ff075fdc9fb4e">GDFUNCTION_ARGS</a>(FnName_, ...)   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)</td></tr>
|
|
||||||
<tr class="memdesc:abb5f0f48b26566dab84ff075fdc9fb4e"><td class="mdescLeft"> </td><td class="mdescRight">Register a function CLASSNAME::FnName_(...) to godot. <br /></td></tr>
|
|
||||||
<tr class="separator:abb5f0f48b26566dab84ff075fdc9fb4e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:ab1d89a5d5f8e83ed25d64195e8e432b6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#ab1d89a5d5f8e83ed25d64195e8e432b6">GDFUNCTION_STATIC</a>(FnName_)   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &CLASSNAME::_FnName)</td></tr>
|
|
||||||
<tr class="memdesc:ab1d89a5d5f8e83ed25d64195e8e432b6"><td class="mdescLeft"> </td><td class="mdescRight">Register a static member function CLASSNAME::FnName_() to godot. <br /></td></tr>
|
|
||||||
<tr class="separator:ab1d89a5d5f8e83ed25d64195e8e432b6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a26ae27fbaa531f900a2e3a2c339975df"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#a26ae27fbaa531f900a2e3a2c339975df">GDFUNCTION_STATIC_ARGS</a>(FnName_, ...)   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)</td></tr>
|
|
||||||
<tr class="memdesc:a26ae27fbaa531f900a2e3a2c339975df"><td class="mdescLeft"> </td><td class="mdescRight">Register a static member function CLASSNAME::FnName_(...) to godot. <br /></td></tr>
|
|
||||||
<tr class="separator:a26ae27fbaa531f900a2e3a2c339975df"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:abed0b44fb9b7da904a745cd09219ddea"><td class="memItemLeft" align="right" valign="top"><a id="abed0b44fb9b7da904a745cd09219ddea" name="abed0b44fb9b7da904a745cd09219ddea"></a>
|
|
||||||
#define </td><td class="memItemRight" valign="bottom"><b>GDSIGNAL</b>(...)   godot::ClassDB::add_signal(MACRO_STRING(CLASSNAME), godot::MethodInfo(__VA_ARGS__))</td></tr>
|
|
||||||
<tr class="memdesc:abed0b44fb9b7da904a745cd09219ddea"><td class="mdescLeft"> </td><td class="mdescRight">Declare a godot Observer signal. <br /></td></tr>
|
|
||||||
<tr class="separator:abed0b44fb9b7da904a745cd09219ddea"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:ae0818ebba543d3c6e8a61f460509451f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#ae0818ebba543d3c6e8a61f460509451f">GDRESOURCETYPE</a>(Class_)   godot::vformat("%s/%s:%s", godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)</td></tr>
|
|
||||||
<tr class="memdesc:ae0818ebba543d3c6e8a61f460509451f"><td class="mdescLeft"> </td><td class="mdescRight">Construct godot resource type hint. <br /></td></tr>
|
|
||||||
<tr class="separator:ae0818ebba543d3c6e8a61f460509451f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a36c0da7ac54da4b5a5a9fe754e68eaa1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#a36c0da7ac54da4b5a5a9fe754e68eaa1">GDEDITORONLY</a>()   if(!godot::Engine::get_singleton()->is_editor_hint()) return;</td></tr>
|
|
||||||
<tr class="memdesc:a36c0da7ac54da4b5a5a9fe754e68eaa1"><td class="mdescLeft"> </td><td class="mdescRight">Execute the rest of the function only if currently running as editor. <br /></td></tr>
|
|
||||||
<tr class="separator:a36c0da7ac54da4b5a5a9fe754e68eaa1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a33ac9c3bfce05f857cfdd472cb00ca89"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#a33ac9c3bfce05f857cfdd472cb00ca89">GDGAMEONLY</a>()   if(godot::Engine::get_singleton()->is_editor_hint()) return;</td></tr>
|
|
||||||
<tr class="memdesc:a33ac9c3bfce05f857cfdd472cb00ca89"><td class="mdescLeft"> </td><td class="mdescRight">Execute the rest of the function only if currently running as game. <br /></td></tr>
|
|
||||||
<tr class="separator:a33ac9c3bfce05f857cfdd472cb00ca89"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
<tr class="memitem:a069154a04e2e9e1df6cbbec0a0fc8829"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="godot__macros_8h.html#a069154a04e2e9e1df6cbbec0a0fc8829">GDENUM</a>(Name_, ...)</td></tr>
|
|
||||||
<tr class="memdesc:a069154a04e2e9e1df6cbbec0a0fc8829"><td class="mdescLeft"> </td><td class="mdescRight">Declare a scoped enum struct. <br /></td></tr>
|
|
||||||
<tr class="separator:a069154a04e2e9e1df6cbbec0a0fc8829"><td class="memSeparator" colspan="2"> </td></tr>
|
|
||||||
</table>
|
|
||||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
||||||
<div class="textblock"><p>C-style preprocessor macros to simplify using godot's C++ API. </p>
|
|
||||||
</div><h2 class="groupheader">Macro Definition Documentation</h2>
|
|
||||||
<a id="a36c0da7ac54da4b5a5a9fe754e68eaa1" name="a36c0da7ac54da4b5a5a9fe754e68eaa1"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#a36c0da7ac54da4b5a5a9fe754e68eaa1">◆ </a></span>GDEDITORONLY</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDEDITORONLY</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramname"></td><td>)</td>
|
|
||||||
<td>   if(!godot::Engine::get_singleton()->is_editor_hint()) return;</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Execute the rest of the function only if currently running as editor. </p>
|
|
||||||
<p>Useful for _ready, _enter/_exit, _process, etc. functions. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="a069154a04e2e9e1df6cbbec0a0fc8829" name="a069154a04e2e9e1df6cbbec0a0fc8829"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#a069154a04e2e9e1df6cbbec0a0fc8829">◆ </a></span>GDENUM</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDENUM</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">Name_, </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="paramkey"></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname"><em>...</em> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>)</td>
|
|
||||||
<td></td><td></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
<b>Value:</b><div class="fragment"><div class="line"><span class="keyword">struct </span>Name_ {\</div>
|
|
||||||
<div class="line"> <span class="keyword">enum</span> Value {__VA_ARGS__};\</div>
|
|
||||||
<div class="line"> <span class="keyword">private</span>:\</div>
|
|
||||||
<div class="line"> Value value{};\</div>
|
|
||||||
<div class="line"> <span class="keyword">public</span>:\</div>
|
|
||||||
<div class="line"> <span class="keyword">static</span> <span class="keyword">inline</span> godot::String get_property_hint() { <span class="keywordflow">return</span> godot::String(#__VA_ARGS__); }\</div>
|
|
||||||
<div class="line"> <span class="keyword">inline</span> Name_(Value value): value{value} {}\</div>
|
|
||||||
<div class="line"> <span class="keyword">inline</span> Name_(Name_ <span class="keyword">const</span> &value): value{value.value} {}\</div>
|
|
||||||
<div class="line">}</div>
|
|
||||||
</div><!-- fragment -->
|
|
||||||
<p>Declare a scoped enum struct. </p>
|
|
||||||
<p>Declares a struct Name_ with an enum Value and a single variable and a get_property_hint() function. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="aec4c8284cb9ea77c97a7037176081801" name="aec4c8284cb9ea77c97a7037176081801"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#aec4c8284cb9ea77c97a7037176081801">◆ </a></span>GDFUNCTION</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDFUNCTION</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">FnName_</td><td>)</td>
|
|
||||||
<td>   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &CLASSNAME::FnName_)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Register a function CLASSNAME::FnName_() to godot. </p>
|
|
||||||
<p>Requires setting CLASSNAME as a #define first. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="abb5f0f48b26566dab84ff075fdc9fb4e" name="abb5f0f48b26566dab84ff075fdc9fb4e"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#abb5f0f48b26566dab84ff075fdc9fb4e">◆ </a></span>GDFUNCTION_ARGS</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDFUNCTION_ARGS</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">FnName_, </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="paramkey"></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname"><em>...</em> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>)</td>
|
|
||||||
<td></td><td>   godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Register a function CLASSNAME::FnName_(...) to godot. </p>
|
|
||||||
<p>Requires setting CLASSNAME as a #define first. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="ab1d89a5d5f8e83ed25d64195e8e432b6" name="ab1d89a5d5f8e83ed25d64195e8e432b6"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#ab1d89a5d5f8e83ed25d64195e8e432b6">◆ </a></span>GDFUNCTION_STATIC</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDFUNCTION_STATIC</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">FnName_</td><td>)</td>
|
|
||||||
<td>   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &CLASSNAME::_FnName)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Register a static member function CLASSNAME::FnName_() to godot. </p>
|
|
||||||
<p>Requires setting CLASSNAME as a #define first. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="a26ae27fbaa531f900a2e3a2c339975df" name="a26ae27fbaa531f900a2e3a2c339975df"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#a26ae27fbaa531f900a2e3a2c339975df">◆ </a></span>GDFUNCTION_STATIC_ARGS</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDFUNCTION_STATIC_ARGS</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">FnName_, </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="paramkey"></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname"><em>...</em> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>)</td>
|
|
||||||
<td></td><td>   godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Register a static member function CLASSNAME::FnName_(...) to godot. </p>
|
|
||||||
<p>Requires setting CLASSNAME as a #define first. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="a33ac9c3bfce05f857cfdd472cb00ca89" name="a33ac9c3bfce05f857cfdd472cb00ca89"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#a33ac9c3bfce05f857cfdd472cb00ca89">◆ </a></span>GDGAMEONLY</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDGAMEONLY</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramname"></td><td>)</td>
|
|
||||||
<td>   if(godot::Engine::get_singleton()->is_editor_hint()) return;</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Execute the rest of the function only if currently running as game. </p>
|
|
||||||
<p>Useful for _ready, _enter/_exit, _process, etc. functions. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="a3dab0009fb317e0fce558e09edd4964c" name="a3dab0009fb317e0fce558e09edd4964c"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#a3dab0009fb317e0fce558e09edd4964c">◆ </a></span>GDPROPERTY</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDPROPERTY</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">PropName_, </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="paramkey"></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">PropType_ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>)</td>
|
|
||||||
<td></td><td></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
<b>Value:</b><div class="fragment"><div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">"get_"</span> #PropName_), &CLASSNAME::get_##PropName_); \</div>
|
|
||||||
<div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">"set_"</span> #PropName_, <span class="stringliteral">"value"</span>), &CLASSNAME::set_##PropName_); \</div>
|
|
||||||
<div class="line"> godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_), <span class="stringliteral">"set_"</span> #PropName_, <span class="stringliteral">"get_"</span> #PropName_)</div>
|
|
||||||
</div><!-- fragment -->
|
|
||||||
<p>Register property. </p>
|
|
||||||
<p>Register variable CLASSNAME::PropName_ with variant type PropType_. Requires setting CLASSNAME as a #define first. Also requires a CLASSNAME::get_PropName_ and CLASSNAME::set_PropName_ to exist. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="a9e70408fe612616931e2c251eb149114" name="a9e70408fe612616931e2c251eb149114"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#a9e70408fe612616931e2c251eb149114">◆ </a></span>GDPROPERTY_HINTED</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDPROPERTY_HINTED</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">PropName_, </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="paramkey"></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">PropType_, </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="paramkey"></td>
|
|
||||||
<td></td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname"><em>...</em> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>)</td>
|
|
||||||
<td></td><td></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
<b>Value:</b><div class="fragment"><div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">"get_"</span> #PropName_), &CLASSNAME::get_##PropName_); \</div>
|
|
||||||
<div class="line"> godot::ClassDB::bind_method(godot::D_METHOD(<span class="stringliteral">"set_"</span> #PropName_, <span class="stringliteral">"value"</span>), &CLASSNAME::set_##PropName_); \</div>
|
|
||||||
<div class="line"> godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_, __VA_ARGS__), <span class="stringliteral">"set_"</span> #PropName_, <span class="stringliteral">"get_"</span> #PropName_)</div>
|
|
||||||
</div><!-- fragment -->
|
|
||||||
<p>Register a hinted property. </p>
|
|
||||||
<p>Register variable CLASSNAME::PropName_ with variant type PropType_. Requires setting CLASSNAME as a #define first, and CLASSNAME::get_PropName and CLASSNAME::set_PropName_ to exist. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a id="ae0818ebba543d3c6e8a61f460509451f" name="ae0818ebba543d3c6e8a61f460509451f"></a>
|
|
||||||
<h2 class="memtitle"><span class="permalink"><a href="#ae0818ebba543d3c6e8a61f460509451f">◆ </a></span>GDRESOURCETYPE</h2>
|
|
||||||
|
|
||||||
<div class="memitem">
|
|
||||||
<div class="memproto">
|
|
||||||
<table class="memname">
|
|
||||||
<tr>
|
|
||||||
<td class="memname">#define GDRESOURCETYPE</td>
|
|
||||||
<td>(</td>
|
|
||||||
<td class="paramtype"> </td>
|
|
||||||
<td class="paramname">Class_</td><td>)</td>
|
|
||||||
<td>   godot::vformat("%s/%s:%s", godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div><div class="memdoc">
|
|
||||||
|
|
||||||
<p>Construct godot resource type hint. </p>
|
|
||||||
<p>Use when registering properties of arrays of resource classes. </p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div><!-- contents -->
|
|
||||||
<!-- start footer part -->
|
|
||||||
<hr class="footer"/><address class="footer"><small>
|
|
||||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
|
|
||||||
</small></address>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,131 +0,0 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
|
||||||
<meta name="generator" content="Doxygen 1.9.7"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
||||||
<title>godot-cpp-utils: godot_macros.h Source File</title>
|
|
||||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
|
||||||
<script type="text/javascript" src="dynsections.js"></script>
|
|
||||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
||||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
||||||
<script type="text/javascript" src="search/search.js"></script>
|
|
||||||
<script type="text/javascript" src="darkmode_toggle.js"></script>
|
|
||||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
||||||
<div id="titlearea">
|
|
||||||
<table cellspacing="0" cellpadding="0">
|
|
||||||
<tbody>
|
|
||||||
<tr id="projectrow">
|
|
||||||
<td id="projectalign">
|
|
||||||
<div id="projectname">godot-cpp-utils
|
|
||||||
</div>
|
|
||||||
<div id="projectbrief">A collection of utility classes, functions and macros for use with Godot and GDExtension.</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- end header part -->
|
|
||||||
<!-- Generated by Doxygen 1.9.7 -->
|
|
||||||
<script type="text/javascript">
|
|
||||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
||||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
|
||||||
/* @license-end */
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="menudata.js"></script>
|
|
||||||
<script type="text/javascript" src="menu.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
||||||
$(function() {
|
|
||||||
initMenu('',true,false,'search.php','Search');
|
|
||||||
$(document).ready(function() { init_search(); });
|
|
||||||
});
|
|
||||||
/* @license-end */
|
|
||||||
</script>
|
|
||||||
<div id="main-nav"></div>
|
|
||||||
</div><!-- top -->
|
|
||||||
<!-- window showing the filter options -->
|
|
||||||
<div id="MSearchSelectWindow"
|
|
||||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
||||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
||||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- iframe showing the search results (closed by default) -->
|
|
||||||
<div id="MSearchResultsWindow">
|
|
||||||
<div id="MSearchResults">
|
|
||||||
<div class="SRPage">
|
|
||||||
<div id="SRIndex">
|
|
||||||
<div id="SRResults"></div>
|
|
||||||
<div class="SRStatus" id="Loading">Loading...</div>
|
|
||||||
<div class="SRStatus" id="Searching">Searching...</div>
|
|
||||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="header">
|
|
||||||
<div class="headertitle"><div class="title">godot_macros.h</div></div>
|
|
||||||
</div><!--header-->
|
|
||||||
<div class="contents">
|
|
||||||
<a href="godot__macros_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef UC_GODOT_MACROS_H</span></div>
|
|
||||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define UC_GODOT_MACROS_H</span></div>
|
|
||||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
|
|
||||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include "godot_cpp/classes/engine.hpp"</span></div>
|
|
||||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include "godot_cpp/core/class_db.hpp"</span></div>
|
|
||||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include "godot_cpp/variant/string.hpp"</span></div>
|
|
||||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
|
||||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
|
||||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#define MACRO_STRING_INNER(_Arg) #_Arg</span></div>
|
|
||||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#define MACRO_STRING(_Arg) MACRO_STRING_INNER(_Arg)</span></div>
|
|
||||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
|
||||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#a3dab0009fb317e0fce558e09edd4964c"> 22</a></span><span class="preprocessor">#define GDPROPERTY(PropName_, PropType_) \</span></div>
|
|
||||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor"> godot::ClassDB::bind_method(godot::D_METHOD("get_"</span> #PropName_), &CLASSNAME::get_##PropName_); \</div>
|
|
||||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> godot::ClassDB::bind_method(godot::D_METHOD("set_" #PropName_, "value"), &CLASSNAME::set_##PropName_); \</div>
|
|
||||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_), "set_" #PropName_, "get_" #PropName_)</div>
|
|
||||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> </div>
|
|
||||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#a9e70408fe612616931e2c251eb149114"> 33</a></span><span class="preprocessor">#define GDPROPERTY_HINTED(PropName_, PropType_, ...) \</span></div>
|
|
||||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor"> godot::ClassDB::bind_method(godot::D_METHOD("get_"</span> #PropName_), &CLASSNAME::get_##PropName_); \</div>
|
|
||||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> godot::ClassDB::bind_method(godot::D_METHOD("set_" #PropName_, "value"), &CLASSNAME::set_##PropName_); \</div>
|
|
||||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> godot::ClassDB::add_property(MACRO_STRING(CLASSNAME), godot::PropertyInfo(PropType_, #PropName_, __VA_ARGS__), "set_" #PropName_, "get_" #PropName_)</div>
|
|
||||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> </div>
|
|
||||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#aec4c8284cb9ea77c97a7037176081801"> 43</a></span><span class="preprocessor">#define GDFUNCTION(FnName_) godot::ClassDB::bind_method(godot::D_METHOD(#FnName_), &CLASSNAME::FnName_)</span></div>
|
|
||||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> </div>
|
|
||||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#abb5f0f48b26566dab84ff075fdc9fb4e"> 50</a></span><span class="preprocessor">#define GDFUNCTION_ARGS(FnName_, ...) godot::ClassDB::bind_method(godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)</span></div>
|
|
||||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
|
|
||||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#ab1d89a5d5f8e83ed25d64195e8e432b6"> 57</a></span><span class="preprocessor">#define GDFUNCTION_STATIC(FnName_) godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_), &CLASSNAME::_FnName)</span></div>
|
|
||||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
|
|
||||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#a26ae27fbaa531f900a2e3a2c339975df"> 64</a></span><span class="preprocessor">#define GDFUNCTION_STATIC_ARGS(FnName_, ...) godot::ClassDB::bind_static_method(MACRO_STRING(CLASSNAME), godot::D_METHOD(#FnName_, __VA_ARGS__), &CLASSNAME::FnName_)</span></div>
|
|
||||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
|
|
||||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#abed0b44fb9b7da904a745cd09219ddea"> 69</a></span><span class="preprocessor">#define GDSIGNAL(...) godot::ClassDB::add_signal(MACRO_STRING(CLASSNAME), godot::MethodInfo(__VA_ARGS__))</span></div>
|
|
||||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> </div>
|
|
||||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#ae0818ebba543d3c6e8a61f460509451f"> 76</a></span><span class="preprocessor">#define GDRESOURCETYPE(Class_) godot::vformat("%s/%s:%s"</span>, godot::Variant::OBJECT, godot::PROPERTY_HINT_RESOURCE_TYPE, #Class_)</div>
|
|
||||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
|
|
||||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#a36c0da7ac54da4b5a5a9fe754e68eaa1"> 83</a></span><span class="preprocessor">#define GDEDITORONLY() if(!godot::Engine::get_singleton()->is_editor_hint()) return;</span></div>
|
|
||||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#a33ac9c3bfce05f857cfdd472cb00ca89"> 89</a></span><span class="preprocessor">#define GDGAMEONLY() if(godot::Engine::get_singleton()->is_editor_hint()) return;</span></div>
|
|
||||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> </div>
|
|
||||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="godot__macros_8h.html#a069154a04e2e9e1df6cbbec0a0fc8829"> 96</a></span><span class="preprocessor">#define GDENUM(Name_, ...)\</span></div>
|
|
||||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="preprocessor">struct Name_ {\</span></div>
|
|
||||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="preprocessor"> enum Value {__VA_ARGS__};\</span></div>
|
|
||||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="preprocessor"> private:\</span></div>
|
|
||||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="preprocessor"> Value value{};\</span></div>
|
|
||||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="preprocessor"> public:\</span></div>
|
|
||||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="preprocessor"> static inline godot::String get_property_hint() { return godot::String(#__VA_ARGS__); }\</span></div>
|
|
||||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="preprocessor"> inline Name_(Value value): value{value} {}\</span></div>
|
|
||||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="preprocessor"> inline Name_(Name_ const &value): value{value.value} {}\</span></div>
|
|
||||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="preprocessor">}</span></div>
|
|
||||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> </div>
|
|
||||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="preprocessor">#endif </span><span class="comment">// !UC_GODOT_MACROS_H</span></div>
|
|
||||||
</div><!-- fragment --></div><!-- contents -->
|
|
||||||
<!-- start footer part -->
|
|
||||||
<hr class="footer"/><address class="footer"><small>
|
|
||||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
|
|
||||||
</small></address>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
136
html/menu.js
136
html/menu.js
|
@ -1,136 +0,0 @@
|
||||||
/*
|
|
||||||
@licstart The following is the entire license notice for the JavaScript code in this file.
|
|
||||||
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (C) 1997-2020 by Dimitri van Heesch
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
||||||
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
||||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or
|
|
||||||
substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
||||||
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
||||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@licend The above is the entire license notice for the JavaScript code in this file
|
|
||||||
*/
|
|
||||||
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
|
|
||||||
function makeTree(data,relPath) {
|
|
||||||
var result='';
|
|
||||||
if ('children' in data) {
|
|
||||||
result+='<ul>';
|
|
||||||
for (var i in data.children) {
|
|
||||||
var url;
|
|
||||||
var link;
|
|
||||||
link = data.children[i].url;
|
|
||||||
if (link.substring(0,1)=='^') {
|
|
||||||
url = link.substring(1);
|
|
||||||
} else {
|
|
||||||
url = relPath+link;
|
|
||||||
}
|
|
||||||
result+='<li><a href="'+url+'">'+
|
|
||||||
data.children[i].text+'</a>'+
|
|
||||||
makeTree(data.children[i],relPath)+'</li>';
|
|
||||||
}
|
|
||||||
result+='</ul>';
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
var searchBoxHtml;
|
|
||||||
if (searchEnabled) {
|
|
||||||
if (serverSide) {
|
|
||||||
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
|
||||||
'<div class="left">'+
|
|
||||||
'<form id="FSearchBox" action="'+relPath+searchPage+
|
|
||||||
'" method="get"><span id="MSearchSelectExt"> </span>'+
|
|
||||||
'<input type="text" id="MSearchField" name="query" value="" placeholder="'+search+
|
|
||||||
'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)"'+
|
|
||||||
' onblur="searchBox.OnSearchFieldFocus(false)"/>'+
|
|
||||||
'</form>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="right"></div>'+
|
|
||||||
'</div>';
|
|
||||||
} else {
|
|
||||||
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
|
||||||
'<span class="left">'+
|
|
||||||
'<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()"'+
|
|
||||||
' onmouseout="return searchBox.OnSearchSelectHide()"> </span>'+
|
|
||||||
'<input type="text" id="MSearchField" value="" placeholder="'+search+
|
|
||||||
'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" '+
|
|
||||||
'onblur="searchBox.OnSearchFieldFocus(false)" '+
|
|
||||||
'onkeyup="searchBox.OnSearchFieldChange(event)"/>'+
|
|
||||||
'</span>'+
|
|
||||||
'<span class="right"><a id="MSearchClose" '+
|
|
||||||
'href="javascript:searchBox.CloseResultsWindow()">'+
|
|
||||||
'<img id="MSearchCloseImg" border="0" src="'+relPath+
|
|
||||||
'search/close.svg" alt=""/></a>'+
|
|
||||||
'</span>'+
|
|
||||||
'</div>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#main-nav').before('<div class="sm sm-dox"><input id="main-menu-state" type="checkbox"/>'+
|
|
||||||
'<label class="main-menu-btn" for="main-menu-state">'+
|
|
||||||
'<span class="main-menu-btn-icon"></span> '+
|
|
||||||
'Toggle main menu visibility</label>'+
|
|
||||||
'<span id="searchBoxPos1" style="position:absolute;right:8px;top:8px;height:36px;"></span>'+
|
|
||||||
'</div>');
|
|
||||||
$('#main-nav').append(makeTree(menudata,relPath));
|
|
||||||
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
|
|
||||||
if (searchBoxHtml) {
|
|
||||||
$('#main-menu').append('<li id="searchBoxPos2" style="float:right"></li>');
|
|
||||||
}
|
|
||||||
var $mainMenuState = $('#main-menu-state');
|
|
||||||
var prevWidth = 0;
|
|
||||||
if ($mainMenuState.length) {
|
|
||||||
function initResizableIfExists() {
|
|
||||||
if (typeof initResizable==='function') initResizable();
|
|
||||||
}
|
|
||||||
// animate mobile menu
|
|
||||||
$mainMenuState.change(function(e) {
|
|
||||||
var $menu = $('#main-menu');
|
|
||||||
var options = { duration: 250, step: initResizableIfExists };
|
|
||||||
if (this.checked) {
|
|
||||||
options['complete'] = function() { $menu.css('display', 'block') };
|
|
||||||
$menu.hide().slideDown(options);
|
|
||||||
} else {
|
|
||||||
options['complete'] = function() { $menu.css('display', 'none') };
|
|
||||||
$menu.show().slideUp(options);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// set default menu visibility
|
|
||||||
function resetState() {
|
|
||||||
var $menu = $('#main-menu');
|
|
||||||
var $mainMenuState = $('#main-menu-state');
|
|
||||||
var newWidth = $(window).outerWidth();
|
|
||||||
if (newWidth!=prevWidth) {
|
|
||||||
if ($(window).outerWidth()<768) {
|
|
||||||
$mainMenuState.prop('checked',false); $menu.hide();
|
|
||||||
$('#searchBoxPos1').html(searchBoxHtml);
|
|
||||||
$('#searchBoxPos2').hide();
|
|
||||||
} else {
|
|
||||||
$menu.show();
|
|
||||||
$('#searchBoxPos1').empty();
|
|
||||||
$('#searchBoxPos2').html(searchBoxHtml);
|
|
||||||
$('#searchBoxPos2').show();
|
|
||||||
}
|
|
||||||
if (typeof searchBox!=='undefined') {
|
|
||||||
searchBox.CloseResultsWindow();
|
|
||||||
}
|
|
||||||
prevWidth = newWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$(window).ready(function() { resetState(); initResizableIfExists(); });
|
|
||||||
$(window).resize(resetState);
|
|
||||||
}
|
|
||||||
$('#main-menu').smartmenus();
|
|
||||||
}
|
|
||||||
/* @license-end */
|
|
Loading…
Reference in New Issue