Delete JSClass JSI_GUIColor / GUIColor from af9c336b43, refs #5387, D1699.
* JSI_GUIColor::construct and JSI_IGUIObject::setProperty hunk are
duplicates of FromJSVal, getProperty of ToJSVal, following 7c2e9027c2.
* The constructor, it's fallback magenta and toString have never been
used by JS.
* A JS color class providing some methods (such as found in color.js,
refs #5387, and the unused toString redundant with rgbToGuiColor, see
also eee8217b45) is more inviting to changes and maintenance if defined
in JS and can still be instantiated in C++, like the Vector2D (see also
65b02395b3).
* PredefinedColors (such as "red" or "green") can be obtained from the
prototype without defining the class in C++.
* Minimize ugliness by removing macrosity, refs 8ceb41212d.
Rename alpha to a in guiToRgbColor from eee8217b45 for consistency with
the C++ conversions (opaqueness had been skipped in the only callers of
this JS function yet).
Delete unused GUISTDTYPE Mouse in header forgotton in 8734efca94.
This was SVN commit r22534.
2019-07-23 07:22:27 -07:00
|
|
|
/* Copyright (C) 2019 Wildfire Games.
|
2009-04-18 10:00:33 -07:00
|
|
|
* This file is part of 0 A.D.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. 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.
|
|
|
|
|
*
|
|
|
|
|
* 0 A.D. 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 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-09-30 01:19:56 -07:00
|
|
|
#ifndef INCLUDED_JSI_GUISIZE
|
|
|
|
|
#define INCLUDED_JSI_GUISIZE
|
2004-07-08 08:23:47 -07:00
|
|
|
|
2018-04-27 09:48:44 -07:00
|
|
|
#include "scriptinterface/ScriptInterface.h"
|
2019-09-30 01:19:56 -07:00
|
|
|
#include "ps/CStr.h"
|
2018-04-27 09:48:44 -07:00
|
|
|
|
2019-09-30 01:19:56 -07:00
|
|
|
namespace JSI_GUISize
|
|
|
|
|
{
|
|
|
|
|
extern JSClass JSI_class;
|
|
|
|
|
extern JSPropertySpec JSI_props[];
|
|
|
|
|
extern JSFunctionSpec JSI_methods[];
|
2004-07-08 08:23:47 -07:00
|
|
|
|
2019-09-30 01:19:56 -07:00
|
|
|
void RegisterScriptClass(ScriptInterface& scriptInterface);
|
2004-07-08 08:23:47 -07:00
|
|
|
|
2019-09-30 01:19:56 -07:00
|
|
|
bool construct(JSContext* cx, uint argc, JS::Value* vp);
|
|
|
|
|
bool toString(JSContext* cx, uint argc, JS::Value* vp);
|
2004-07-08 08:23:47 -07:00
|
|
|
|
2019-09-30 01:19:56 -07:00
|
|
|
CStr ToPercentString(double pix, double per);
|
2004-07-08 08:23:47 -07:00
|
|
|
}
|
|
|
|
|
|
2019-09-30 01:19:56 -07:00
|
|
|
#endif // INCLUDED_JSI_GUISIZE
|