mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-11 09:49:05 +00:00
Merge with develop
--HG-- branch : compatibility-develop
This commit is contained in:
commit
4600c74b6b
32 changed files with 3608 additions and 2235 deletions
1
.hgtags
1
.hgtags
|
@ -7,3 +7,4 @@ edaa3624a56420b02ccc64c26059801a389927ee ryzomcore/v0.11.0
|
|||
e3fe4855f22c3e75722e015dc33c091c340b3ad7 ryzomcore/v0.11.1
|
||||
9e583b717fd63be0be9fd60b99087abf1691ea49 ryzomcore/v0.11.2
|
||||
bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3
|
||||
9a6120735daa97c96ac5d85ca35c7f21f607bd87 ryzomcore/v0.12.0
|
||||
|
|
|
@ -152,7 +152,6 @@ IF(WITH_NEL)
|
|||
ENDIF(WITH_NEL_TESTS)
|
||||
|
||||
IF(WITH_GUI)
|
||||
FIND_PACKAGE(Libwww REQUIRED)
|
||||
FIND_PACKAGE(Luabind REQUIRED)
|
||||
FIND_PACKAGE(CURL REQUIRED)
|
||||
|
||||
|
|
|
@ -1,190 +0,0 @@
|
|||
#
|
||||
# Find the W3C libwww includes and library
|
||||
#
|
||||
# This module defines
|
||||
# LIBWWW_INCLUDE_DIR, where to find tiff.h, etc.
|
||||
# LIBWWW_LIBRARY, where to find the Libwww library.
|
||||
# LIBWWW_FOUND, If false, do not try to use Libwww.
|
||||
|
||||
OPTION(WITH_LIBWWW_STATIC "Use only static libraries for libwww" OFF)
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(Libwww_FIND_QUIETLY TRUE)
|
||||
ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(LIBWWW_INCLUDE_DIR
|
||||
WWWInit.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
PATH_SUFFIXES libwww w3c-libwww
|
||||
)
|
||||
|
||||
# when installing libwww on mac os x using macports the file wwwconf.h resides
|
||||
# in /opt/local/include and not in the real libwww include dir :/
|
||||
FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR
|
||||
wwwconf.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/csw/include
|
||||
/opt/include
|
||||
)
|
||||
|
||||
# combine both include directories into one variable
|
||||
IF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
||||
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR})
|
||||
ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
||||
|
||||
# helper to find all the libwww sub libraries
|
||||
MACRO(FIND_WWW_LIBRARY MYLIBRARY OPTION FILE)
|
||||
IF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||
ENDIF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}_RELEASE
|
||||
NAMES ${FILE}
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}_DEBUG
|
||||
NAMES ${FILE}d
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/local/X11R6/lib
|
||||
/usr/X11R6/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
IF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
||||
ENDIF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
|
||||
|
||||
IF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} optimized ${${MYLIBRARY}_RELEASE} debug ${${MYLIBRARY}_DEBUG})
|
||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
||||
ELSEIF(${MYLIBRARY}_RELEASE)
|
||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_RELEASE})
|
||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
||||
ELSEIF(${MYLIBRARY}_DEBUG)
|
||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_DEBUG})
|
||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
||||
ELSE(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
||||
IF(NOT Libwww_FIND_QUIETLY AND NOT WIN32)
|
||||
MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}")
|
||||
ENDIF(NOT Libwww_FIND_QUIETLY AND NOT WIN32)
|
||||
ENDIF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
||||
|
||||
MARK_AS_ADVANCED(${MYLIBRARY}_RELEASE ${MYLIBRARY}_DEBUG)
|
||||
ENDMACRO(FIND_WWW_LIBRARY)
|
||||
|
||||
MACRO(LINK_WWW_LIBRARY MYLIBRARY OTHERLIBRARY SYMBOL)
|
||||
IF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL)
|
||||
LINK_DEPENDS(LIBWWW_LIBRARIES ${MYLIBRARY} ${OTHERLIBRARY} ${SYMBOL})
|
||||
ENDIF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL)
|
||||
ENDMACRO(LINK_WWW_LIBRARY)
|
||||
|
||||
# Find and link required libs for static or dynamic
|
||||
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY REQUIRED wwwapp) # cache core file ftp gopher html http mime news stream telnet trans utils zip xml xmlparse
|
||||
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY REQUIRED wwwcore) # utils
|
||||
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY REQUIRED wwwfile) # core trans utils html
|
||||
FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY REQUIRED wwwhtml) # core utils
|
||||
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY REQUIRED wwwhttp) # md5 core mime stream utils
|
||||
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY REQUIRED wwwmime) # core cache stream utils
|
||||
|
||||
# Required for static or if underlinking
|
||||
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY OPTIONAL wwwcache) # core trans utils
|
||||
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY OPTIONAL wwwstream) # core file utils
|
||||
|
||||
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY REQUIRED wwwtrans) # core utils
|
||||
FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY REQUIRED wwwutils)
|
||||
|
||||
|
||||
# Required only if underlinking
|
||||
|
||||
# Unused protocols
|
||||
FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY OPTIONAL wwwftp) # core file utils
|
||||
FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY OPTIONAL wwwgopher) # core html utils file
|
||||
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY OPTIONAL wwwnews) # core html mime stream utils
|
||||
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY OPTIONAL wwwtelnet) # core utils
|
||||
|
||||
# Other used by app
|
||||
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY OPTIONAL wwwdir) # file
|
||||
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY OPTIONAL wwwinit) # app cache core file html utils
|
||||
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY OPTIONAL wwwmux) # core stream trans utils
|
||||
FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY OPTIONAL wwwxml) # core utils xmlparse
|
||||
FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY OPTIONAL wwwzip) # core utils
|
||||
FIND_WWW_LIBRARY(LIBXMLPARSE_LIBRARY OPTIONAL xmlparse) # xmltok
|
||||
|
||||
# Other used by other
|
||||
FIND_WWW_LIBRARY(LIBXMLTOK_LIBRARY OPTIONAL xmltok)
|
||||
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY OPTIONAL wwwssl)
|
||||
FIND_WWW_LIBRARY(LIBMD5_LIBRARY OPTIONAL md5)
|
||||
FIND_WWW_LIBRARY(LIBPICS_LIBRARY OPTIONAL pics)
|
||||
|
||||
# Other external libraries
|
||||
FIND_PACKAGE(EXPAT QUIET)
|
||||
FIND_PACKAGE(OpenSSL QUIET)
|
||||
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY OPTIONAL gnu_regex)
|
||||
|
||||
# Now link all libs together
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTLoadCache)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTCacheAppend)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWFTP_LIBRARY HTLoadFTP)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWGOPHER_LIBRARY HTLoadGopher)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWNEWS_LIBRARY HTLoadNews)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWTELNET_LIBRARY HTLoadTelnet)
|
||||
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTStreamToChunk)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTGuess_new)
|
||||
LINK_WWW_LIBRARY(LIBWWWFILE_LIBRARY LIBWWWDIR_LIBRARY HTDir_new)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWINIT_LIBRARY HTProtocolInit)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWXML_LIBRARY HTXML_new)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWZIP_LIBRARY HTZLib_inflate)
|
||||
|
||||
# libwwwxml can be linked to xmlparse or expat
|
||||
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY LIBXMLPARSE_LIBRARY XML_ParserCreate)
|
||||
|
||||
IF(LIBXMLPARSE_LIBRARY_LINKED)
|
||||
LINK_WWW_LIBRARY(LIBXMLPARSE_LIBRARY EXPAT_LIBRARY XmlInitEncoding)
|
||||
ELSE(LIBXMLPARSE_LIBRARY_LINKED)
|
||||
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY EXPAT_LIBRARY XML_ParserCreate)
|
||||
ENDIF(LIBXMLPARSE_LIBRARY_LINKED)
|
||||
|
||||
LINK_WWW_LIBRARY(LIBWWWHTTP_LIBRARY LIBMD5_LIBRARY MD5Init)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBREGEX_LIBRARY regexec)
|
||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY OPENSSL_LIBRARIES SSL_new)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libwww DEFAULT_MSG
|
||||
LIBWWW_LIBRARIES
|
||||
LIBWWW_INCLUDE_DIR
|
||||
)
|
|
@ -25,14 +25,10 @@
|
|||
#include "nel/gui/group_tree.h"
|
||||
#include "nel/gui/ctrl_button.h"
|
||||
#include "nel/gui/group_table.h"
|
||||
#include "nel/gui/libwww_types.h"
|
||||
|
||||
typedef std::map<std::string, std::string> TStyle;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "WWWInit.h"
|
||||
}
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
class CCtrlButton;
|
||||
|
@ -41,7 +37,8 @@ namespace NLGUI
|
|||
class CDBGroupComboBox;
|
||||
class CGroupParagraph;
|
||||
|
||||
|
||||
extern std::string CurrentCookie;
|
||||
extern std::string HTTPCurrentDomain;
|
||||
|
||||
// HTML group
|
||||
/**
|
||||
|
@ -55,15 +52,6 @@ namespace NLGUI
|
|||
public:
|
||||
DECLARE_UI_CLASS( CGroupHTML )
|
||||
|
||||
friend void TextAdd (struct _HText *me, const char * buf, int len);
|
||||
friend void TextBeginElement (_HText *me, int element_number, const BOOL *present, const char ** value);
|
||||
friend void TextEndElement (_HText *me, int element_number);
|
||||
friend void TextLink (struct _HText *me, int element_number, int attribute_number, struct _HTChildAnchor *anchor, const BOOL *present, const char **value);
|
||||
friend void TextBuild (HText * me, HTextStatus status);
|
||||
friend void TextBeginUnparsedElement(HText *me, const char *buffer, int length);
|
||||
friend void TextEndUnparsedElement(HText *me, const char *buffer, int length);
|
||||
friend int requestTerminater (HTRequest * request, HTResponse * response, void * param, int status);
|
||||
|
||||
/// Web browser options for CGroupHTML
|
||||
struct SWebOptions
|
||||
{
|
||||
|
@ -102,6 +90,9 @@ namespace NLGUI
|
|||
// Browse
|
||||
virtual void browse (const char *url);
|
||||
|
||||
// parse html string using libxml2 parser
|
||||
virtual bool parseHtml(std::string htmlString);
|
||||
|
||||
// Refresh
|
||||
void refresh();
|
||||
|
||||
|
@ -175,6 +166,34 @@ namespace NLGUI
|
|||
std::string DefaultBackgroundBitmapView;
|
||||
std::string CurrentLinkTitle;
|
||||
|
||||
struct TFormField {
|
||||
public:
|
||||
TFormField(const std::string &k, const std::string &v)
|
||||
:name(k),value(v)
|
||||
{}
|
||||
std::string name;
|
||||
std::string value;
|
||||
};
|
||||
|
||||
struct SFormFields {
|
||||
public:
|
||||
SFormFields()
|
||||
{
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
Values.clear();
|
||||
}
|
||||
|
||||
void add(const std::string &key, const std::string &value)
|
||||
{
|
||||
Values.push_back(TFormField(key, value));
|
||||
}
|
||||
|
||||
std::vector<TFormField> Values;
|
||||
};
|
||||
|
||||
// Browser home
|
||||
std::string Home;
|
||||
|
||||
|
@ -199,6 +218,7 @@ namespace NLGUI
|
|||
int luaBeginElement(CLuaState &ls);
|
||||
int luaEndElement(CLuaState &ls);
|
||||
int luaShowDiv(CLuaState &ls);
|
||||
int luaParseHtml(CLuaState &ls);
|
||||
|
||||
REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText)
|
||||
REFLECT_LUA_METHOD("browse", luaBrowse)
|
||||
|
@ -210,6 +230,7 @@ namespace NLGUI
|
|||
REFLECT_LUA_METHOD("beginElement", luaBeginElement)
|
||||
REFLECT_LUA_METHOD("endElement", luaEndElement)
|
||||
REFLECT_LUA_METHOD("showDiv", luaShowDiv)
|
||||
REFLECT_LUA_METHOD("parseHtml", luaParseHtml)
|
||||
REFLECT_STRING("url", getURL, setURL)
|
||||
REFLECT_FLOAT("timeout", getTimeout, setTimeout)
|
||||
REFLECT_EXPORT_END
|
||||
|
@ -228,10 +249,10 @@ namespace NLGUI
|
|||
virtual void addText (const char * buf, int len);
|
||||
|
||||
// A link has been parsed
|
||||
virtual void addLink (uint element_number, uint attribute_number, HTChildAnchor *anchor, const BOOL *present, const char **value);
|
||||
virtual void addLink (uint element_number, const std::vector<bool> &present, const std::vector<const char *> &value);
|
||||
|
||||
// A new begin HTML element has been parsed (<IMG> for exemple)
|
||||
virtual void beginElement (uint element_number, const BOOL *present, const char **value);
|
||||
virtual void beginElement (uint element_number, const std::vector<bool> &present, const std::vector<const char *> &value);
|
||||
|
||||
// A new end HTML element has been parsed (</IMG> for exemple)
|
||||
virtual void endElement (uint element_number);
|
||||
|
@ -246,10 +267,14 @@ namespace NLGUI
|
|||
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
|
||||
|
||||
// Add POST params to the libwww list
|
||||
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
|
||||
|
||||
// the current request is terminated
|
||||
virtual void requestTerminated(HTRequest *request);
|
||||
virtual void requestTerminated();
|
||||
|
||||
// libxml2 html parser functions
|
||||
void htmlElement(xmlNode *node, int element_number);
|
||||
void htmlWalkDOM(xmlNode *a_node);
|
||||
|
||||
// Get Home URL
|
||||
virtual std::string home();
|
||||
|
@ -338,6 +363,7 @@ namespace NLGUI
|
|||
bool _Connecting;
|
||||
double _TimeoutValue; // the timeout in seconds
|
||||
double _ConnectingTimeout;
|
||||
uint32 _RedirectsRemaining;
|
||||
|
||||
// minimal embeded lua script support
|
||||
// Note : any embeded script is executed immediately after the closing
|
||||
|
@ -351,11 +377,8 @@ namespace NLGUI
|
|||
bool _Object;
|
||||
std::string _ObjectScript;
|
||||
|
||||
// Someone is conecting. We got problem with libwww : 2 connection requests can deadlock the client.
|
||||
static CGroupHTML *_ConnectingLock;
|
||||
|
||||
// LibWWW data
|
||||
class CLibWWWData *_LibWWW;
|
||||
// Data container for active curl transfer
|
||||
class CCurlWWWData * _CurlWWW;
|
||||
|
||||
// Current paragraph
|
||||
std::string _DivName;
|
||||
|
@ -668,6 +691,18 @@ namespace NLGUI
|
|||
// read style attribute
|
||||
void getStyleParams(const std::string &styleString, CStyleParams &style, bool inherit = true);
|
||||
|
||||
// load and render local html file (from bnp for example)
|
||||
void doBrowseLocalFile(const std::string &filename);
|
||||
|
||||
// load remote content using either GET or POST
|
||||
void doBrowseRemoteUrl(const std::string &url, const std::string &referer, bool doPost = false, const SFormFields &formfields = SFormFields());
|
||||
|
||||
// render html string as new browser page
|
||||
bool renderHtmlString(const std::string &html);
|
||||
|
||||
// initialize formfields list from form elements on page
|
||||
void buildHTTPPostParams (SFormFields &formfields);
|
||||
|
||||
private:
|
||||
// decode all HTML entities
|
||||
static ucstring decodeHTMLEntities(const ucstring &str);
|
||||
|
@ -677,13 +712,16 @@ namespace NLGUI
|
|||
|
||||
struct CDataDownload
|
||||
{
|
||||
CDataDownload(CURL *c, const std::string &u, FILE *f, TDataType t, CViewBase *i, const std::string &s, const std::string &m) : curl(c), url(u), luaScript(s), md5sum(m), type(t), fp(f)
|
||||
public:
|
||||
CDataDownload(CURL *c, const std::string &u, const std::string &d, FILE *f, TDataType t, CViewBase *i, const std::string &s, const std::string &m) : curl(c), url(u), dest(d), luaScript(s), md5sum(m), type(t), fp(f)
|
||||
{
|
||||
if (t == ImgType) imgs.push_back(i);
|
||||
}
|
||||
|
||||
public:
|
||||
CURL *curl;
|
||||
std::string url;
|
||||
std::string dest;
|
||||
std::string luaScript;
|
||||
std::string md5sum;
|
||||
TDataType type;
|
||||
|
@ -699,6 +737,7 @@ namespace NLGUI
|
|||
void checkImageDownload();
|
||||
void addImageDownload(const std::string &url, CViewBase *img);
|
||||
std::string localImageName(const std::string &url);
|
||||
std::string getAbsoluteUrl(const std::string &url);
|
||||
|
||||
bool isTrustedDomain(const std::string &domain);
|
||||
void setImage(CViewBase *view, const std::string &file);
|
||||
|
@ -712,6 +751,13 @@ namespace NLGUI
|
|||
void releaseDownloads();
|
||||
void checkDownloads();
|
||||
|
||||
// HtmlType download finished
|
||||
void htmlDownloadFinished(const std::string &content, const std::string &type, long code);
|
||||
|
||||
// cURL transfer callbacks
|
||||
static size_t curlHeaderCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData);
|
||||
static size_t curlDataCallback(char *buffer, size_t size, size_t nmemb, void *pCCurlWWWData);
|
||||
static size_t curlProgressCallback(void *pCCurlWWWData, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow);
|
||||
};
|
||||
|
||||
// adapter group that store y offset for inputs inside an html form
|
||||
|
@ -725,7 +771,6 @@ namespace NLGUI
|
|||
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
|
||||
virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parentGroup);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,12 +20,10 @@
|
|||
#ifndef CL_LIB_WWW_H
|
||||
#define CL_LIB_WWW_H
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "WWWInit.h"
|
||||
}
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "nel/misc/rgba.h"
|
||||
#include "nel/gui/libwww_types.h"
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
|
@ -35,14 +33,12 @@ namespace NLGUI
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
// Legacy function from libwww
|
||||
SGML_dtd * HTML_dtd (void);
|
||||
|
||||
// Init the libwww
|
||||
void initLibWWW();
|
||||
|
||||
// Get an url and setup a local domain
|
||||
const std::string &setCurrentDomain(const std::string &url);
|
||||
|
||||
extern std::string CurrentCookie;
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
// Some DTD table
|
||||
|
@ -230,46 +226,6 @@ namespace NLGUI
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
// A smart ptr for LibWWW strings
|
||||
class C3WSmartPtr
|
||||
{
|
||||
public:
|
||||
C3WSmartPtr ()
|
||||
{
|
||||
_Ptr = NULL;
|
||||
}
|
||||
C3WSmartPtr (const char *ptr)
|
||||
{
|
||||
_Ptr = ptr;
|
||||
}
|
||||
~C3WSmartPtr ()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
void operator=(const char *str)
|
||||
{
|
||||
clear ();
|
||||
_Ptr = str;
|
||||
}
|
||||
operator const char *() const
|
||||
{
|
||||
return _Ptr;
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
if (_Ptr)
|
||||
{
|
||||
void *ptr = (void*)_Ptr;
|
||||
HT_FREE(ptr);
|
||||
}
|
||||
_Ptr = NULL;
|
||||
}
|
||||
private:
|
||||
const char *_Ptr;
|
||||
};
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
// Read a width HTML parameter. "100" or "100%". Returns true if percent (0 ~ 1) else false
|
||||
bool getPercentage (sint32 &width, float &percent, const char *str);
|
||||
|
||||
|
@ -280,15 +236,10 @@ namespace NLGUI
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void _VerifyLibWWW(const char *function, bool ok, const char *file, int line);
|
||||
#define VerifyLibWWW(a,b) _VerifyLibWWW(a,(b)!=FALSE,__FILE__,__LINE__)
|
||||
const std::string &setCurrentDomain(const std::string &uri);
|
||||
void receiveCookies (CURL *curl, const std::string &domain, bool trusted);
|
||||
void sendCookies(CURL *curl, const std::string &domain, bool trusted);
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
// Standard request terminator
|
||||
int requestTerminater (HTRequest * request, HTResponse * response, void * param, int status) ;
|
||||
|
||||
// ***************************************************************************
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
#ifndef LIBWWW_NEL_STREAM_H
|
||||
#define LIBWWW_NEL_STREAM_H
|
||||
|
||||
|
||||
#include "HTProt.h"
|
||||
|
||||
extern "C" HTProtCallback HTLoadNeLFile;
|
||||
extern "C" PUBLIC HTInputStream * HTNeLReader_new (HTHost * host, HTChannel * ch, void * param, int mode);
|
||||
|
||||
#endif // LIBWWW_NEL_STREAM_H
|
1073
code/nel/include/nel/gui/libwww_types.h
Normal file
1073
code/nel/include/nel/gui/libwww_types.h
Normal file
File diff suppressed because it is too large
Load diff
63
code/nel/include/nel/gui/url_parser.h
Normal file
63
code/nel/include/nel/gui/url_parser.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef CL_URL_PARSER_H
|
||||
#define CL_URL_PARSER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
/**
|
||||
* Simple URL parser
|
||||
* \author Meelis Mägi
|
||||
* \date 2015
|
||||
*/
|
||||
class CUrlParser
|
||||
{
|
||||
public:
|
||||
CUrlParser(){}
|
||||
|
||||
// parse uri to components
|
||||
CUrlParser(const std::string &url);
|
||||
|
||||
// parse uri to components
|
||||
void parse(std::string uri);
|
||||
|
||||
// serialize URL back to string
|
||||
std::string toString() const;
|
||||
|
||||
// inherit scheme, domain, path from given url
|
||||
void inherit(const std::string &url);
|
||||
|
||||
// if current parts can compose absolute url or not
|
||||
bool isAbsolute() const;
|
||||
|
||||
// resolve relative path like './a/../b' to absolute path '/a/b'
|
||||
static void resolveRelativePath(std::string &path);
|
||||
|
||||
public:
|
||||
std::string scheme;
|
||||
std::string domain;
|
||||
std::string path;
|
||||
std::string query;
|
||||
std::string hash;
|
||||
};
|
||||
|
||||
}// namespace
|
||||
|
||||
#endif // CL_URL_PARSER_H
|
||||
|
|
@ -6,9 +6,9 @@ SOURCE_GROUP("src" FILES ${SRC})
|
|||
|
||||
NL_TARGET_LIB(nelgui ${SRC} ${HEADERS})
|
||||
|
||||
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${LIBWWW_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBWWW_LIBRARIES} ${CURL_LIBRARIES})
|
||||
TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${LIBXML2_LIBRARIES} ${CURL_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(nelgui PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
||||
NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI")
|
||||
NL_ADD_RUNTIME_FLAGS(nelgui)
|
||||
|
|
File diff suppressed because it is too large
Load diff
312
code/nel/src/gui/group_html_parser.cpp
Normal file
312
code/nel/src/gui/group_html_parser.cpp
Normal file
|
@ -0,0 +1,312 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#include "stdpch.h"
|
||||
|
||||
#include <string>
|
||||
#include <libxml/HTMLparser.h>
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/gui/libwww.h"
|
||||
#include "nel/gui/group_html.h"
|
||||
#include "nel/gui/lua_ihm.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace NLMISC;
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
// ***************************************************************************
|
||||
void CGroupHTML::htmlElement(xmlNode *node, int element_number)
|
||||
{
|
||||
SGML_dtd *HTML_DTD = HTML_dtd ();
|
||||
|
||||
if (element_number < HTML_ELEMENTS)
|
||||
{
|
||||
CXMLAutoPtr ptr;
|
||||
// load attributes into libwww structs
|
||||
std::vector<bool> present;
|
||||
std::vector<const char *>value;
|
||||
std::string strvalues[MAX_ATTRIBUTES];
|
||||
present.resize(30, false);
|
||||
value.resize(30);
|
||||
|
||||
uint nbAttributes = std::min(MAX_ATTRIBUTES, HTML_DTD->tags[element_number].number_of_attributes);
|
||||
for(uint i=0; i<nbAttributes; i++)
|
||||
{
|
||||
std::string name;
|
||||
name = toLower(std::string(HTML_DTD->tags[element_number].attributes[i].name));
|
||||
ptr = xmlGetProp(node, (const xmlChar *)name.c_str());
|
||||
if (ptr)
|
||||
{
|
||||
// copy xmlChar to string (xmlChar will be released)
|
||||
strvalues[i] = (const char *)(ptr);
|
||||
// now use string pointer in value[] array
|
||||
value[i] = strvalues[i].c_str();
|
||||
present[i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (element_number == HTML_A)
|
||||
{
|
||||
addLink(element_number, present, value);
|
||||
}
|
||||
|
||||
beginElement(element_number, present, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
beginUnparsedElement((const char *)(node->name), xmlStrlen(node->name));
|
||||
}
|
||||
|
||||
// recursive - text content / child nodes
|
||||
htmlWalkDOM(node->children);
|
||||
|
||||
// closing tag
|
||||
if (element_number < HTML_ELEMENTS)
|
||||
{
|
||||
endElement(element_number);
|
||||
}
|
||||
else
|
||||
{
|
||||
endUnparsedElement((const char *)(node->name), xmlStrlen(node->name));
|
||||
}
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// recursive function to walk html document
|
||||
void CGroupHTML::htmlWalkDOM(xmlNode *a_node)
|
||||
{
|
||||
SGML_dtd *HTML_DTD = HTML_dtd ();
|
||||
|
||||
uint element_number;
|
||||
xmlNode *node = a_node;
|
||||
while(node)
|
||||
{
|
||||
if (node->type == XML_TEXT_NODE)
|
||||
{
|
||||
addText((const char *)(node->content), xmlStrlen(node->content));
|
||||
}
|
||||
else
|
||||
if (node->type == XML_ELEMENT_NODE)
|
||||
{
|
||||
// find libwww tag
|
||||
for(element_number = 0; element_number<HTML_ELEMENTS; ++element_number)
|
||||
{
|
||||
if (xmlStrncasecmp(node->name, (const xmlChar *)HTML_DTD->tags[element_number].name.c_str(), xmlStrlen(node->name)) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
htmlElement(node, element_number);
|
||||
}
|
||||
|
||||
// move into next sibling
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// http://stackoverflow.com/a/18335183
|
||||
static std::string correct_non_utf_8(const std::string &str)
|
||||
{
|
||||
int i,f_size=str.size();
|
||||
unsigned char c,c2,c3,c4;
|
||||
std::string to;
|
||||
to.reserve(f_size);
|
||||
|
||||
for(i=0 ; i<f_size ; i++){
|
||||
c=(unsigned char)(str[i]);
|
||||
if(c<32){//control char
|
||||
if(c==9 || c==10 || c==13){//allow only \t \n \r
|
||||
to.append(1,c);
|
||||
}
|
||||
continue;
|
||||
}else if(c<127){//normal ASCII
|
||||
to.append(1,c);
|
||||
continue;
|
||||
}else if(c<160){//control char (nothing should be defined here either ASCI, ISO_8859-1 or UTF8, so skipping)
|
||||
if(c==128){//fix microsoft mess, add euro
|
||||
to.append(1,226);
|
||||
to.append(1,130);
|
||||
to.append(1,172);
|
||||
}
|
||||
if(c==133){//fix IBM mess, add NEL = \n\r
|
||||
to.append(1,10);
|
||||
to.append(1,13);
|
||||
}
|
||||
continue;
|
||||
}else if(c<192){//invalid for UTF8, converting ASCII
|
||||
to.append(1,(unsigned char)194);
|
||||
to.append(1,c);
|
||||
continue;
|
||||
}else if(c<194){//invalid for UTF8, converting ASCII
|
||||
to.append(1,(unsigned char)195);
|
||||
to.append(1,c-64);
|
||||
continue;
|
||||
}else if(c<224 && i+1<f_size){//possibly 2byte UTF8
|
||||
c2=(unsigned char)(str[i+1]);
|
||||
if(c2>127 && c2<192){//valid 2byte UTF8
|
||||
if(c==194 && c2<160){//control char, skipping
|
||||
;
|
||||
}else{
|
||||
to.append(1,c);
|
||||
to.append(1,c2);
|
||||
}
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
}else if(c<240 && i+2<f_size){//possibly 3byte UTF8
|
||||
c2=(unsigned char)(str[i+1]);
|
||||
c3=(unsigned char)(str[i+2]);
|
||||
if(c2>127 && c2<192 && c3>127 && c3<192){//valid 3byte UTF8
|
||||
to.append(1,c);
|
||||
to.append(1,c2);
|
||||
to.append(1,c3);
|
||||
i+=2;
|
||||
continue;
|
||||
}
|
||||
}else if(c<245 && i+3<f_size){//possibly 4byte UTF8
|
||||
c2=(unsigned char)(str[i+1]);
|
||||
c3=(unsigned char)(str[i+2]);
|
||||
c4=(unsigned char)(str[i+3]);
|
||||
if(c2>127 && c2<192 && c3>127 && c3<192 && c4>127 && c4<192){//valid 4byte UTF8
|
||||
to.append(1,c);
|
||||
to.append(1,c2);
|
||||
to.append(1,c3);
|
||||
to.append(1,c4);
|
||||
i+=3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//invalid UTF8, converting ASCII (c>245 || string too short for multi-byte))
|
||||
to.append(1,(unsigned char)195);
|
||||
to.append(1,c-64);
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
static void patchHtmlQuirks(std::string &htmlString)
|
||||
{
|
||||
size_t npos = std::string::npos;
|
||||
size_t pos;
|
||||
|
||||
// get rid of BOM (some ingame help files does not show up otherwise)
|
||||
if (htmlString.substr(0, 3) == "\xEF\xBB\xBF")
|
||||
{
|
||||
htmlString.erase(0, 3);
|
||||
}
|
||||
|
||||
// if any element is before <html>, then parser adds <html><body>
|
||||
// and original tags are ignored (their attributes not processed)
|
||||
//
|
||||
// only fix situation when there is <body> tag with attributes
|
||||
//
|
||||
// tags are considered to be lowercase
|
||||
|
||||
pos = htmlString.find("<body ");
|
||||
if (pos != npos)
|
||||
{
|
||||
size_t start = htmlString.find("<");
|
||||
// skip <!doctype html>
|
||||
if (htmlString.substr(start, 2) == "<!")
|
||||
start = htmlString.find("<", start + 1);
|
||||
|
||||
// if there is no html tag, then abort
|
||||
size_t end = htmlString.find("<html>");
|
||||
if (end != npos && start < end && end < pos)
|
||||
{
|
||||
// body tag end position
|
||||
size_t insert = htmlString.find(">", pos);
|
||||
if (insert != npos)
|
||||
{
|
||||
std::string str = htmlString.substr(start, end - start);
|
||||
htmlString.insert(insert+1, str);
|
||||
htmlString.erase(start, str.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// make sure </html> (if present) is last in document or tags coming after it are ignored
|
||||
pos = htmlString.find("</html>");
|
||||
if (pos != npos && htmlString.find("<", pos+1) > pos)
|
||||
{
|
||||
htmlString.erase(pos, 7);
|
||||
htmlString += "</html>";
|
||||
}
|
||||
|
||||
// if there is invalid utf-8 chars, then libxml will break everything after first it finds.
|
||||
htmlString = correct_non_utf_8(htmlString);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
bool CGroupHTML::parseHtml(std::string htmlString)
|
||||
{
|
||||
htmlParserCtxtPtr parser = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL, XML_CHAR_ENCODING_UTF8);
|
||||
if (!parser)
|
||||
{
|
||||
nlwarning("Creating html parser context failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
htmlCtxtUseOptions(parser, HTML_PARSE_NOBLANKS | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING | HTML_PARSE_NONET);
|
||||
|
||||
// parser is little strict on tag order, so fix whats needed
|
||||
patchHtmlQuirks(htmlString);
|
||||
|
||||
htmlParseChunk(parser, htmlString.c_str(), htmlString.size(), 0);
|
||||
htmlParseChunk(parser, "", 0, 1);
|
||||
|
||||
bool success = true;
|
||||
if (parser->myDoc)
|
||||
{
|
||||
xmlNode *root = xmlDocGetRootElement(parser->myDoc);
|
||||
if (root)
|
||||
{
|
||||
htmlWalkDOM(root);
|
||||
}
|
||||
else
|
||||
{
|
||||
nlwarning("html root node failed");
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nlwarning("htmlstring parsing failed");
|
||||
success = false;
|
||||
}
|
||||
|
||||
htmlFreeParserCtxt(parser);
|
||||
return success;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
int CGroupHTML::luaParseHtml(CLuaState &ls)
|
||||
{
|
||||
const char *funcName = "parseHtml";
|
||||
CLuaIHM::checkArgCount(ls, funcName, 1);
|
||||
CLuaIHM::checkArgType(ls, funcName, 1, LUA_TSTRING);
|
||||
std::string html = ls.toString(1);
|
||||
|
||||
parseHtml(html);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -16,35 +16,21 @@
|
|||
|
||||
#include "stdpch.h"
|
||||
|
||||
#include "nel/gui/libwww.h"
|
||||
#include "nel/gui/group_html.h"
|
||||
|
||||
// LibWWW
|
||||
extern "C"
|
||||
{
|
||||
#include "WWWLib.h" /* Global Library Include file */
|
||||
#include "WWWApp.h"
|
||||
#include "WWWInit.h"
|
||||
}
|
||||
|
||||
#include "nel/gui/group_html.h"
|
||||
#include "nel/gui/libwww_nel_stream.h"
|
||||
|
||||
using namespace NLMISC;
|
||||
|
||||
// The HText structure for libwww
|
||||
struct _HText
|
||||
{
|
||||
NLGUI::CGroupHTML *Parent;
|
||||
};
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
/// the cookie value for session identification (nel cookie)
|
||||
std::string CurrentCookie;
|
||||
|
||||
/// store all cookies we receive and resent them depending of the domain
|
||||
std::map<std::string, std::map<std::string, std::string> > HTTPCookies;
|
||||
static std::map<std::string, std::map<std::string, std::string> > HTTPCookies;
|
||||
std::string HTTPCurrentDomain; // The current domain that will be used to get which cookies to send
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -213,7 +199,6 @@ namespace NLGUI
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
HTAttr p_attr[] =
|
||||
{
|
||||
HTML_ATTR(P,QUICK_HELP_CONDITION),
|
||||
|
@ -243,90 +228,6 @@ namespace NLGUI
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void _VerifyLibWWW(const char *function, bool ok, const char *file, int line)
|
||||
{
|
||||
if (!ok)
|
||||
nlwarning("%s(%d) : LIBWWW %s returned a bad status", file, line, function);
|
||||
}
|
||||
#define VerifyLibWWW(a,b) _VerifyLibWWW(a,(b)!=FALSE,__FILE__,__LINE__)
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
int NelPrinter (const char * fmt, va_list pArgs)
|
||||
{
|
||||
char info[1024];
|
||||
int ret;
|
||||
|
||||
ret = vsnprintf(info, sizeof(info), fmt, pArgs);
|
||||
nlinfo("%s", info);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
int NelTracer (const char * fmt, va_list pArgs)
|
||||
{
|
||||
char err[1024];
|
||||
int ret;
|
||||
|
||||
ret = vsnprintf(err, sizeof(err), fmt, pArgs);
|
||||
nlwarning ("%s", err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
HText * TextNew (HTRequest * request,
|
||||
HTParentAnchor * /* anchor */,
|
||||
HTStream * /* output_stream */)
|
||||
{
|
||||
HText *text = new HText;
|
||||
text->Parent = (CGroupHTML *) HTRequest_context(request);
|
||||
return text;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
BOOL TextDelete (HText * me)
|
||||
{
|
||||
delete me;
|
||||
return YES;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void TextBuild (HText * me, HTextStatus status)
|
||||
{
|
||||
// Do the work in the class
|
||||
if (status == HTEXT_BEGIN)
|
||||
me->Parent->beginBuild ();
|
||||
else if (status == HTEXT_END)
|
||||
me->Parent->endBuild ();
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void TextAdd (HText * me, const char * buf, int len)
|
||||
{
|
||||
// Do the work in the class
|
||||
me->Parent->addText (buf, len);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void TextLink (HText * me,
|
||||
int element_number,
|
||||
int attribute_number,
|
||||
HTChildAnchor * anchor,
|
||||
const BOOL * present,
|
||||
const char ** value)
|
||||
{
|
||||
// Do the work in the class
|
||||
me->Parent->addLink (element_number, attribute_number, anchor, present, value);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
// Read a width HTML parameter. "100" or "100%". Returns true if percent (0 ~ 1) else false
|
||||
bool getPercentage (sint32 &width, float &percent, const char *str)
|
||||
{
|
||||
|
@ -383,307 +284,143 @@ namespace NLGUI
|
|||
return dst;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void TextBeginElement (HText *me, int element_number, const BOOL *present, const char **value)
|
||||
// set current HTTPCurrentDomain for cookie selection, return new domain
|
||||
const std::string &setCurrentDomain(const std::string &uri)
|
||||
{
|
||||
// Do the work in the class
|
||||
me->Parent->beginElement (element_number, present, value);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void TextEndElement (HText *me, int element_number)
|
||||
{
|
||||
// Do the work in the class
|
||||
me->Parent->endElement (element_number);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
void TextBeginUnparsedElement(HText *me, const char *buffer, int length)
|
||||
{
|
||||
me->Parent->beginUnparsedElement(buffer, length);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
void TextEndUnparsedElement(HText *me, const char *buffer, int length)
|
||||
{
|
||||
me->Parent->endUnparsedElement(buffer, length);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
void TextUnparsedEntity (HText * /* HText */, const char *buffer, int length)
|
||||
{
|
||||
std::string str(buffer, buffer+length);
|
||||
nlinfo("Unparsed entity '%s'", str.c_str());
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
int requestTerminater (HTRequest * request, HTResponse * /* response */,
|
||||
void * param, int /* status */)
|
||||
{
|
||||
/*
|
||||
Yoyo and Boris: we had to make the request terminate by UID and not by pointer (param is an uid).
|
||||
Because this method was called at mainLoop time, but for GroupHTML created/deleted at login time !!!
|
||||
=> Memory Crash.
|
||||
*/
|
||||
|
||||
// TestYoyo
|
||||
//nlinfo("** requestTerminater(): uid%d", (uint32)param);
|
||||
|
||||
// the parameter is actually an uint32
|
||||
if (param != 0)
|
||||
{
|
||||
CGroupHTML::TGroupHtmlByUIDMap::iterator it= CGroupHTML::_GroupHtmlByUID.find((uint32)(size_t)param);
|
||||
if(it!=CGroupHTML::_GroupHtmlByUID.end())
|
||||
{
|
||||
// get the pointer. NB: the refptr should not be NULL
|
||||
// since object removed from map when deleted
|
||||
CGroupHTML *gh = it->second;
|
||||
nlassert(gh);
|
||||
|
||||
// callback the browser
|
||||
gh->requestTerminated(request);
|
||||
}
|
||||
}
|
||||
return HT_OK;
|
||||
}
|
||||
|
||||
|
||||
// callback called when receiving a cookie
|
||||
BOOL receiveCookie (HTRequest * /* request */, HTCookie * cookie, void * /* param */)
|
||||
{
|
||||
if (strcmp(HTCookie_name(cookie), "ryzomId") == 0)
|
||||
{
|
||||
// we receive the ryzom id cookie, store it
|
||||
CurrentCookie = HTCookie_value(cookie);
|
||||
}
|
||||
if (uri.find("http://") == 0)
|
||||
HTTPCurrentDomain = uri.substr(7, uri.find("/", 7) - 7);
|
||||
else
|
||||
{
|
||||
// store the id/value cookie
|
||||
HTTPCookies[HTTPCurrentDomain][HTCookie_name(cookie)] = HTCookie_value(cookie);
|
||||
// nlwarning("get cookie for domain %s %s=%s", HTTPCurrentDomain.c_str(), HTCookie_name(cookie), HTCookie_value(cookie));
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
// callback called to add cookie to a request before sending it to the server
|
||||
HTAssocList *sendCookie (HTRequest * /* request */, void * /* param */)
|
||||
{
|
||||
HTAssocList * alist = 0;
|
||||
if (!CurrentCookie.empty())
|
||||
{
|
||||
if(alist == 0) alist = HTAssocList_new(); /* Is deleted by the cookie module */
|
||||
HTAssocList_addObject(alist, "ryzomId", CurrentCookie.c_str());
|
||||
}
|
||||
|
||||
if(!HTTPCookies[HTTPCurrentDomain].empty())
|
||||
{
|
||||
if(alist == 0) alist = HTAssocList_new();
|
||||
for(std::map<std::string, std::string>::iterator it = HTTPCookies[HTTPCurrentDomain].begin(); it != HTTPCookies[HTTPCurrentDomain].end(); it++)
|
||||
{
|
||||
HTAssocList_addObject(alist, it->first.c_str(), it->second.c_str());
|
||||
// nlwarning("set cookie for domain '%s' %s=%s", HTTPCurrentDomain.c_str(), it->first.c_str(), it->second.c_str());
|
||||
}
|
||||
}
|
||||
return alist;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
HTAnchor * TextFindAnchor (HText * /* me */, int /* index */)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int HTMIME_location_custom (HTRequest * request, HTResponse * response, char * token, char * value)
|
||||
{
|
||||
char * location = HTStrip(value);
|
||||
|
||||
std::string finalLocation;
|
||||
|
||||
//nlinfo("redirect to '%s' '%s'", value, location);
|
||||
|
||||
// If not absolute URI (Error) then find the base
|
||||
if (!HTURL_isAbsolute(location))
|
||||
{
|
||||
char * base = HTAnchor_address((HTAnchor *) HTRequest_anchor(request));
|
||||
location = HTParse(location, base, PARSE_ALL);
|
||||
//redirection = HTAnchor_findAddress(location);
|
||||
finalLocation = location;
|
||||
HT_FREE(base);
|
||||
HT_FREE(location);
|
||||
}
|
||||
if (uri.find("https://") == 0)
|
||||
HTTPCurrentDomain = uri.substr(8, uri.find("/", 8) - 8);
|
||||
else
|
||||
{
|
||||
finalLocation = location;
|
||||
}
|
||||
//nlinfo("final location '%s'", finalLocation.c_str());
|
||||
|
||||
CGroupHTML *gh = (CGroupHTML *) HTRequest_context(request);
|
||||
|
||||
gh->setURL(finalLocation);
|
||||
|
||||
return HT_OK;
|
||||
}
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
const std::string &setCurrentDomain(const std::string &url)
|
||||
{
|
||||
if(url.find("http://") == 0)
|
||||
{
|
||||
HTTPCurrentDomain = url.substr(7, url.find('/', 7)-7);
|
||||
// nlinfo("****cd: %s", HTTPCurrentDomain.c_str());
|
||||
}
|
||||
if (uri.find("//") == 0)
|
||||
HTTPCurrentDomain = uri.substr(2, uri.find("/", 2) - 2);
|
||||
else
|
||||
{
|
||||
HTTPCurrentDomain.clear();
|
||||
// nlinfo("****cd: clear the domain");
|
||||
}
|
||||
if (uri.find("/") != std::string::npos)
|
||||
HTTPCurrentDomain = uri.substr(0, uri.find("/") - 1);
|
||||
|
||||
return HTTPCurrentDomain;
|
||||
}
|
||||
|
||||
// update HTTPCookies list
|
||||
static void receiveCookie(const char *nsformat, const std::string &domain, bool trusted)
|
||||
{
|
||||
// 0 1 2 3 4 5 6
|
||||
// domain tailmatch path secure expires name value
|
||||
// .app.ryzom.com TRUE / FALSE 1234 ryzomId AAAAAAAA|BBBBBBBB|CCCCCCCC
|
||||
// #HttpOnly_app.ryzom.com FALSE / FALSE 0 PHPSESSID sess-id-value
|
||||
std::string cookie(nsformat);
|
||||
|
||||
std::vector<std::string> chunks;
|
||||
splitString(cookie, "\t", chunks);
|
||||
if (chunks.size() < 6)
|
||||
{
|
||||
nlwarning("invalid cookie format '%s'", cookie.c_str());
|
||||
}
|
||||
|
||||
if (chunks[0].find("#HttpOnly_") == 0)
|
||||
{
|
||||
chunks[0] = chunks[0].substr(10);
|
||||
}
|
||||
|
||||
if (chunks[0] != domain && chunks[0] != std::string("." + domain))
|
||||
{
|
||||
// cookie is for different domain
|
||||
//nlinfo("cookie for different domain ('%s')", nsformat);
|
||||
return;
|
||||
}
|
||||
|
||||
if (chunks[5] == "ryzomId")
|
||||
{
|
||||
// we receive this cookie because we are telling curl about this on send
|
||||
// normally, this cookie should be set from client and not from headers
|
||||
// it's used for R2 sessions
|
||||
if (trusted && CurrentCookie != chunks[6])
|
||||
{
|
||||
CurrentCookie = chunks[6];
|
||||
nlwarning("received ryzomId cookie '%s' from trusted domain '%s'", CurrentCookie.c_str(), domain.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 expires = 0;
|
||||
fromString(chunks[4], expires);
|
||||
// expires == 0 is session cookie
|
||||
if (expires > 0)
|
||||
{
|
||||
time_t now;
|
||||
time(&now);
|
||||
if (expires < now)
|
||||
{
|
||||
nlwarning("cookie expired, remove from list '%s'", nsformat);
|
||||
HTTPCookies[domain].erase(chunks[5]);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// this overrides cookies with same name, but different paths
|
||||
//nlwarning("save domain '%s' cookie '%s' value '%s'", domain.c_str(), chunks[5].c_str(), nsformat);
|
||||
HTTPCookies[domain][chunks[5]] = nsformat;
|
||||
}
|
||||
}
|
||||
|
||||
// update HTTPCookies with cookies received from curl
|
||||
void receiveCookies (CURL *curl, const std::string &domain, bool trusted)
|
||||
{
|
||||
struct curl_slist *cookies = NULL;
|
||||
if (curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies) == CURLE_OK)
|
||||
{
|
||||
struct curl_slist *nc;
|
||||
nc = cookies;
|
||||
while(nc)
|
||||
{
|
||||
//nlwarning("received cookie '%s'", nc->data);
|
||||
receiveCookie(nc->data, domain, trusted);
|
||||
nc = nc->next;
|
||||
}
|
||||
|
||||
curl_slist_free_all(cookies);
|
||||
}
|
||||
}
|
||||
|
||||
// add all cookies for domain to curl handle
|
||||
void sendCookies(CURL *curl, const std::string &domain, bool trusted)
|
||||
{
|
||||
if (domain.empty())
|
||||
return;
|
||||
|
||||
if (trusted && !CurrentCookie.empty())
|
||||
{
|
||||
// domain tailmatch path secure expires name value
|
||||
// .app.ryzom.com TRUE / FALSE 1234 ryzomId AAAAAAAA|BBBBBBBB|CCCCCCCC
|
||||
// #HttpOnly_app.ryzom.com FALSE / FALSE 0 PHPSESSID sess-id-value
|
||||
std::string cookie;
|
||||
// set tailmatch
|
||||
if (domain[0] != '.' && domain[0] != '#')
|
||||
cookie = "." + domain + "\tTRUE";
|
||||
else
|
||||
cookie = domain + "\tFALSE";
|
||||
cookie += "\t/\tFALSE\t0\tryzomId\t" + CurrentCookie;
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIELIST, cookie.c_str());
|
||||
//nlwarning("domain '%s', cookie '%s'", domain.c_str(), cookie.c_str());
|
||||
}
|
||||
|
||||
if(!HTTPCookies[domain].empty())
|
||||
{
|
||||
for(std::map<std::string, std::string>::iterator it = HTTPCookies[domain].begin(); it != HTTPCookies[domain].end(); it++)
|
||||
{
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIELIST, it->second.c_str());
|
||||
//nlwarning("set domain '%s' cookie '%s'", domain.c_str(), it->second.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initLibWWW()
|
||||
{
|
||||
static bool initialized = false;
|
||||
if (!initialized)
|
||||
{
|
||||
//HTProfile_newNoCacheClient("Ryzom", "1.1");
|
||||
|
||||
/* Need our own trace and print functions */
|
||||
HTPrint_setCallback(NelPrinter);
|
||||
HTTrace_setCallback(NelTracer);
|
||||
|
||||
/* Initiate libwww */
|
||||
HTLib_setAppName( CGroupHTML::options.appName.c_str() );
|
||||
HTLib_setAppVersion( CGroupHTML::options.appVersion.c_str() );
|
||||
|
||||
/* Set up TCP as transport */
|
||||
VerifyLibWWW("HTTransport_add", HTTransport_add("buffered_tcp", HT_TP_SINGLE, HTReader_new, HTBufferWriter_new));
|
||||
VerifyLibWWW("HTTransport_add", HTTransport_add("local", HT_TP_SINGLE, HTNeLReader_new, HTWriter_new));
|
||||
// VerifyLibWWW("HTTransport_add", HTTransport_add("local", HT_TP_SINGLE, HTANSIReader_new, HTWriter_new));
|
||||
// VerifyLibWWW("HTTransport_add", HTTransport_add("local", HT_TP_SINGLE, HTReader_new, HTWriter_new));
|
||||
|
||||
/* Set up HTTP as protocol */
|
||||
VerifyLibWWW("HTProtocol_add", HTProtocol_add("http", "buffered_tcp", 80, NO, HTLoadHTTP, NULL));
|
||||
VerifyLibWWW("HTProtocol_add", HTProtocol_add("file", "local", 0, YES, HTLoadNeLFile, NULL));
|
||||
//VerifyLibWWW("HTProtocol_add", HTProtocol_add("file", "local", 0, YES, HTLoadFile, NULL));
|
||||
// HTProtocol_add("cache", "local", 0, NO, HTLoadCache, NULL);
|
||||
|
||||
HTBind_init();
|
||||
// HTCacheInit(NULL, 20);
|
||||
|
||||
/* Setup up transfer coders */
|
||||
HTFormat_addTransferCoding((char*)"chunked", HTChunkedEncoder, HTChunkedDecoder, 1.0);
|
||||
|
||||
/* Setup MIME stream converters */
|
||||
HTFormat_addConversion("message/rfc822", "*/*", HTMIMEConvert, 1.0, 0.0, 0.0);
|
||||
HTFormat_addConversion("message/x-rfc822-foot", "*/*", HTMIMEFooter, 1.0, 0.0, 0.0);
|
||||
HTFormat_addConversion("message/x-rfc822-head", "*/*", HTMIMEHeader, 1.0, 0.0, 0.0);
|
||||
HTFormat_addConversion("message/x-rfc822-cont", "*/*", HTMIMEContinue, 1.0, 0.0, 0.0);
|
||||
HTFormat_addConversion("message/x-rfc822-partial","*/*", HTMIMEPartial, 1.0, 0.0, 0.0);
|
||||
HTFormat_addConversion("multipart/*", "*/*", HTBoundary, 1.0, 0.0, 0.0);
|
||||
|
||||
/* Setup HTTP protocol stream */
|
||||
HTFormat_addConversion("text/x-http", "*/*", HTTPStatus_new, 1.0, 0.0, 0.0);
|
||||
|
||||
/* Setup the HTML parser */
|
||||
HTFormat_addConversion("text/html", "www/present", HTMLPresent, 1.0, 0.0, 0.0);
|
||||
|
||||
/* Setup black hole stream */
|
||||
HTFormat_addConversion("*/*", "www/debug", HTBlackHoleConverter, 1.0, 0.0, 0.0);
|
||||
HTFormat_addConversion("*/*", "www/present", HTBlackHoleConverter, 0.3, 0.0, 0.0);
|
||||
|
||||
/* Set max number of sockets we want open simultaneously */
|
||||
HTNet_setMaxSocket(32);
|
||||
|
||||
/* Register our HTML parser callbacks */
|
||||
VerifyLibWWW("HText_registerCDCallback", HText_registerCDCallback (TextNew, TextDelete));
|
||||
VerifyLibWWW("HText_registerBuildCallback", HText_registerBuildCallback (TextBuild));
|
||||
VerifyLibWWW("HText_registerTextCallback", HText_registerTextCallback(TextAdd));
|
||||
VerifyLibWWW("HText_registerLinkCallback", HText_registerLinkCallback (TextLink));
|
||||
VerifyLibWWW("HText_registerElementCallback", HText_registerElementCallback (TextBeginElement, TextEndElement));
|
||||
VerifyLibWWW("HText_registerUnparsedElementCallback", HText_registerUnparsedElementCallback(TextBeginUnparsedElement, TextEndUnparsedElement));
|
||||
VerifyLibWWW("HText_registerUnparsedEntityCallback ", HText_registerUnparsedEntityCallback (TextUnparsedEntity ));
|
||||
|
||||
|
||||
/* Register the default set of MIME header parsers */
|
||||
struct {
|
||||
const char * string;
|
||||
HTParserCallback * pHandler;
|
||||
} fixedHandlers[] = {
|
||||
{"accept", &HTMIME_accept},
|
||||
{"accept-charset", &HTMIME_acceptCharset},
|
||||
{"accept-encoding", &HTMIME_acceptEncoding},
|
||||
{"accept-language", &HTMIME_acceptLanguage},
|
||||
{"accept-ranges", &HTMIME_acceptRanges},
|
||||
{"authorization", NULL},
|
||||
{"cache-control", &HTMIME_cacheControl},
|
||||
{"connection", &HTMIME_connection},
|
||||
{"content-encoding", &HTMIME_contentEncoding},
|
||||
{"content-length", &HTMIME_contentLength},
|
||||
{"content-range", &HTMIME_contentRange},
|
||||
{"content-transfer-encoding", &HTMIME_contentTransferEncoding},
|
||||
{"content-type", &HTMIME_contentType},
|
||||
{"digest-MessageDigest", &HTMIME_messageDigest},
|
||||
{"keep-alive", &HTMIME_keepAlive},
|
||||
{"link", &HTMIME_link},
|
||||
{"location", &HTMIME_location_custom},
|
||||
{"max-forwards", &HTMIME_maxForwards},
|
||||
{"mime-version", NULL},
|
||||
{"pragma", &HTMIME_pragma},
|
||||
{"protocol", &HTMIME_protocol},
|
||||
{"protocol-info", &HTMIME_protocolInfo},
|
||||
{"protocol-request", &HTMIME_protocolRequest},
|
||||
{"proxy-authenticate", &HTMIME_authenticate},
|
||||
{"proxy-authorization", &HTMIME_proxyAuthorization},
|
||||
{"public", &HTMIME_public},
|
||||
{"range", &HTMIME_range},
|
||||
{"referer", &HTMIME_referer},
|
||||
{"retry-after", &HTMIME_retryAfter},
|
||||
{"server", &HTMIME_server},
|
||||
{"trailer", &HTMIME_trailer},
|
||||
{"transfer-encoding", &HTMIME_transferEncoding},
|
||||
{"upgrade", &HTMIME_upgrade},
|
||||
{"user-agent", &HTMIME_userAgent},
|
||||
{"vary", &HTMIME_vary},
|
||||
{"via", &HTMIME_via},
|
||||
{"warning", &HTMIME_warning},
|
||||
{"www-authenticate", &HTMIME_authenticate},
|
||||
{"authentication-info", &HTMIME_authenticationInfo},
|
||||
{"proxy-authentication-info", &HTMIME_proxyAuthenticationInfo}
|
||||
};
|
||||
|
||||
for (uint i = 0; i < sizeof(fixedHandlers)/sizeof(fixedHandlers[0]); i++)
|
||||
HTHeader_addParser(fixedHandlers[i].string, NO, fixedHandlers[i].pHandler);
|
||||
|
||||
/* Set up default event loop */
|
||||
HTEventInit();
|
||||
|
||||
/* Add our own request terminate handler */
|
||||
HTNet_addAfter(requestTerminater, NULL, 0, HT_ALL, HT_FILTER_LAST);
|
||||
|
||||
/* Setup cookies */
|
||||
HTCookie_init();
|
||||
HTCookie_setCookieMode(HTCookieMode(HT_COOKIE_ACCEPT | HT_COOKIE_SEND));
|
||||
HTCookie_setCallbacks(receiveCookie, NULL, sendCookie, NULL);
|
||||
|
||||
/* Start the first request */
|
||||
|
||||
/* Go into the event loop... */
|
||||
// HTEventList_newLoop();
|
||||
|
||||
// App_delete(app);
|
||||
|
||||
HTBind_add("htm", "text/html", NULL, "8bit", NULL, 1.0); /* HTML */
|
||||
HTBind_add("html", "text/html", NULL, "8bit", NULL, 1.0); /* HTML */
|
||||
|
||||
HTBind_caseSensitive(NO);
|
||||
|
||||
// Change the HTML DTD
|
||||
SGML_dtd *HTML_DTD = HTML_dtd ();
|
||||
|
@ -710,16 +447,6 @@ namespace NLGUI
|
|||
HTML_DTD->tags[HTML_SPAN].attributes = span_attr;
|
||||
HTML_DTD->tags[HTML_SPAN].number_of_attributes = sizeof(span_attr) / sizeof(HTAttr) - 1;
|
||||
|
||||
// Set a request timeout
|
||||
// HTHost_setEventTimeout (30000);
|
||||
// HTHost_setActiveTimeout (30000);
|
||||
// HTHost_setPersistTimeout (30000);
|
||||
|
||||
// libwww default value is 2000ms for POST/PUT requests on the first and 3000 on the second, smallest allowed value is 21ms
|
||||
// too small values may create timeout problems but we want it low as possible
|
||||
// second value is the timeout for the second try to we set that high
|
||||
HTTP_setBodyWriteDelay(250, 3000);
|
||||
|
||||
// Initialized
|
||||
initialized = true;
|
||||
}
|
||||
|
|
|
@ -1,633 +0,0 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#include "stdpch.h"
|
||||
#include <nel/misc/file.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
/* Library Includes */
|
||||
#include "wwwsys.h"
|
||||
#include "WWWUtil.h"
|
||||
#include "WWWCore.h"
|
||||
#include "WWWDir.h"
|
||||
#include "WWWTrans.h"
|
||||
#include "HTReqMan.h"
|
||||
#include "HTBind.h"
|
||||
#include "HTMulti.h"
|
||||
#include "HTNetMan.h"
|
||||
#include "HTChannl.h"
|
||||
#include "nel/gui/libwww_nel_stream.h" /* Implemented here */
|
||||
}
|
||||
|
||||
using namespace std;
|
||||
using namespace NLMISC;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
/* Final states have negative value */
|
||||
typedef enum _FileState
|
||||
{
|
||||
FS_RETRY = -4,
|
||||
FS_ERROR = -3,
|
||||
FS_NO_DATA = -2,
|
||||
FS_GOT_DATA = -1,
|
||||
FS_BEGIN = 0,
|
||||
FS_PENDING,
|
||||
FS_DO_CN,
|
||||
FS_NEED_OPEN_FILE,
|
||||
FS_NEED_BODY,
|
||||
FS_PARSE_DIR,
|
||||
FS_TRY_FTP
|
||||
} FileState;
|
||||
|
||||
/* This is the context structure for the this module */
|
||||
typedef struct _file_info
|
||||
{
|
||||
FileState state; /* Current state of the connection */
|
||||
char * local; /* Local representation of file name */
|
||||
struct stat stat_info; /* Contains actual file chosen */
|
||||
HTNet * net;
|
||||
HTTimer * timer;
|
||||
} file_info;
|
||||
|
||||
struct _HTStream
|
||||
{
|
||||
const HTStreamClass * isa;
|
||||
};
|
||||
|
||||
struct _HTInputStream
|
||||
{
|
||||
const HTInputStreamClass * isa;
|
||||
HTChannel * ch;
|
||||
HTHost * host;
|
||||
char * write; /* Last byte written */
|
||||
char * read; /* Last byte read */
|
||||
int b_read;
|
||||
char data [INPUT_BUFFER_SIZE]; /* buffer */
|
||||
};
|
||||
|
||||
PRIVATE int FileCleanup (HTRequest *req, int status)
|
||||
{
|
||||
HTNet * net = HTRequest_net(req);
|
||||
file_info * file = (file_info *) HTNet_context(net);
|
||||
HTStream * input = HTRequest_inputStream(req);
|
||||
|
||||
/* Free stream with data TO Local file system */
|
||||
if (input)
|
||||
{
|
||||
if (status == HT_INTERRUPTED)
|
||||
(*input->isa->abort)(input, NULL);
|
||||
else
|
||||
(*input->isa->_free)(input);
|
||||
HTRequest_setInputStream(req, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
** Remove if we have registered a timer function as a callback
|
||||
*/
|
||||
if (file->timer)
|
||||
{
|
||||
HTTimer_delete(file->timer);
|
||||
file->timer = NULL;
|
||||
}
|
||||
|
||||
if (file)
|
||||
{
|
||||
HT_FREE(file->local);
|
||||
HT_FREE(file);
|
||||
}
|
||||
|
||||
HTNet_delete(net, status);
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
PRIVATE int FileEvent (SOCKET soc, void * pVoid, HTEventType type);
|
||||
|
||||
PUBLIC int HTLoadNeLFile (SOCKET soc, HTRequest * request)
|
||||
{
|
||||
file_info *file; /* Specific access information */
|
||||
HTNet * net = HTRequest_net(request);
|
||||
HTParentAnchor * anchor = HTRequest_anchor(request);
|
||||
|
||||
HTTRACE(PROT_TRACE, "HTLoadFile.. Looking for `%s\'\n" _ HTAnchor_physical(anchor));
|
||||
if ((file = (file_info *) HT_CALLOC(1, sizeof(file_info))) == NULL) HT_OUTOFMEM("HTLoadFILE");
|
||||
file->state = FS_BEGIN;
|
||||
file->net = net;
|
||||
HTNet_setContext(net, file);
|
||||
HTNet_setEventCallback(net, FileEvent);
|
||||
HTNet_setEventParam(net, file); /* callbacks get http* */
|
||||
|
||||
return FileEvent(soc, file, HTEvent_BEGIN); /* get it started - ops is ignored */
|
||||
}
|
||||
|
||||
PRIVATE int ReturnEvent (HTTimer * timer, void * param, HTEventType /* type */)
|
||||
{
|
||||
file_info * file = (file_info *) param;
|
||||
if (timer != file->timer) HTDEBUGBREAK("File timer %p not in sync\n" _ timer);
|
||||
|
||||
HTTRACE(PROT_TRACE, "HTLoadFile.. Continuing %p with timer %p\n" _ file _ timer);
|
||||
|
||||
/*
|
||||
** Delete the timer
|
||||
*/
|
||||
HTTimer_delete(file->timer);
|
||||
file->timer = NULL;
|
||||
|
||||
/*
|
||||
** Now call the event again
|
||||
*/
|
||||
return FileEvent(INVSOC, file, HTEvent_READ);
|
||||
}
|
||||
|
||||
PUBLIC int HTNeLFileOpen (HTNet * net, char * local, HTLocalMode /* mode */)
|
||||
{
|
||||
HTRequest * request = HTNet_request(net);
|
||||
HTHost * host = HTNet_host(net);
|
||||
CIFile* fp = new CIFile;
|
||||
|
||||
if (!fp->open (local))
|
||||
{
|
||||
HTRequest_addSystemError(request, ERR_FATAL, errno, NO, "CIFile::open");
|
||||
return HT_ERROR;
|
||||
}
|
||||
|
||||
HTHost_setChannel(host, HTChannel_new(INVSOC, (FILE*)fp, YES));
|
||||
|
||||
HTHost_getInput(host, HTNet_transport(net), NULL, 0);
|
||||
HTHost_getOutput(host, HTNet_transport(net), NULL, 0);
|
||||
return HT_OK;
|
||||
}
|
||||
|
||||
PRIVATE int FileEvent (SOCKET /* soc */, void * pVoid, HTEventType type)
|
||||
{
|
||||
file_info *file = (file_info *)pVoid; /* Specific access information */
|
||||
int status = HT_ERROR;
|
||||
HTNet * net = file->net;
|
||||
HTRequest * request = HTNet_request(net);
|
||||
HTParentAnchor * anchor = HTRequest_anchor(request);
|
||||
|
||||
if (type == HTEvent_CLOSE)
|
||||
{
|
||||
/* Interrupted */
|
||||
HTRequest_addError(request, ERR_FATAL, NO, HTERR_INTERRUPTED,
|
||||
NULL, 0, "HTLoadFile");
|
||||
FileCleanup(request, HT_INTERRUPTED);
|
||||
return HT_OK;
|
||||
}
|
||||
|
||||
|
||||
/* Now jump into the machine. We know the state from the previous run */
|
||||
for(;;)
|
||||
{
|
||||
switch (file->state)
|
||||
{
|
||||
case FS_BEGIN:
|
||||
|
||||
/* We only support safe (GET, HEAD, etc) methods for the moment */
|
||||
if (!HTMethod_isSafe(HTRequest_method(request))) {
|
||||
HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_ALLOWED,
|
||||
NULL, 0, "HTLoadFile");
|
||||
file->state = FS_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check whether we have access to local disk at all */
|
||||
if (HTLib_secure())
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "LoadFile.... No access to local file system\n");
|
||||
file->state = FS_TRY_FTP;
|
||||
break;
|
||||
}
|
||||
|
||||
/*file->local = HTWWWToLocal(HTAnchor_physical(anchor), "",
|
||||
HTRequest_userProfile(request));*/
|
||||
{
|
||||
string tmp = HTAnchor_physical(anchor);
|
||||
if (strlwr(tmp).find("file:/") == 0)
|
||||
{
|
||||
tmp = tmp.substr(6, tmp.size()-6);
|
||||
}
|
||||
StrAllocCopy(file->local, tmp.c_str());
|
||||
}
|
||||
|
||||
if (!file->local)
|
||||
{
|
||||
file->state = FS_TRY_FTP;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Create a new host object and link it to the net object */
|
||||
{
|
||||
HTHost * host = NULL;
|
||||
if ((host = HTHost_new("localhost", 0)) == NULL) return HT_ERROR;
|
||||
HTNet_setHost(net, host);
|
||||
if (HTHost_addNet(host, net) == HT_PENDING)
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n");
|
||||
/* move to the hack state */
|
||||
file->state = FS_PENDING;
|
||||
return HT_OK;
|
||||
}
|
||||
}
|
||||
file->state = FS_DO_CN;
|
||||
break;
|
||||
|
||||
case FS_PENDING:
|
||||
{
|
||||
HTHost * host = NULL;
|
||||
if ((host = HTHost_new((char*)"localhost", 0)) == NULL) return HT_ERROR;
|
||||
HTNet_setHost(net, host);
|
||||
if (HTHost_addNet(host, net) == HT_PENDING)
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "HTLoadFile.. Pending...\n");
|
||||
file->state = FS_PENDING;
|
||||
return HT_OK;
|
||||
}
|
||||
}
|
||||
file->state = FS_DO_CN;
|
||||
break;
|
||||
|
||||
case FS_DO_CN:
|
||||
if (HTRequest_negotiation(request) &&
|
||||
HTMethod_isSafe(HTRequest_method(request)))
|
||||
{
|
||||
HTAnchor_setPhysical(anchor, file->local);
|
||||
HTTRACE(PROT_TRACE, "Load File... Found `%s\'\n" _ file->local);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (HT_STAT(file->local, &file->stat_info) == -1)
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "Load File... Not found `%s\'\n" _ file->local);
|
||||
HTRequest_addError(request, ERR_FATAL, NO, HTERR_NOT_FOUND, NULL, 0, "HTLoadFile");
|
||||
file->state = FS_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (((file->stat_info.st_mode) & S_IFMT) == S_IFDIR)
|
||||
{
|
||||
if (HTRequest_method(request) == METHOD_GET)
|
||||
{
|
||||
file->state = FS_PARSE_DIR;
|
||||
}
|
||||
else
|
||||
{
|
||||
HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, NULL, 0, "HTLoadFile");
|
||||
file->state = FS_NO_DATA;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
{
|
||||
BOOL editable = FALSE;
|
||||
HTBind_getAnchorBindings(anchor);
|
||||
if (editable) HTAnchor_appendAllow(anchor, METHOD_PUT);
|
||||
|
||||
/* Set the file size */
|
||||
CIFile nelFile;
|
||||
if (nelFile.open (file->local))
|
||||
{
|
||||
file->stat_info.st_size = nelFile.getFileSize();
|
||||
}
|
||||
nelFile.close();
|
||||
|
||||
if (file->stat_info.st_size)
|
||||
HTAnchor_setLength(anchor, file->stat_info.st_size);
|
||||
|
||||
/* Set the file last modified time stamp */
|
||||
if (file->stat_info.st_mtime > 0)
|
||||
HTAnchor_setLastModified(anchor, file->stat_info.st_mtime);
|
||||
|
||||
/* Check to see if we can edit it */
|
||||
if (!editable && !file->stat_info.st_size)
|
||||
{
|
||||
HTRequest_addError(request, ERR_INFO, NO, HTERR_NO_CONTENT, NULL, 0, "HTLoadFile");
|
||||
file->state = FS_NO_DATA;
|
||||
}
|
||||
else
|
||||
{
|
||||
file->state = (HTRequest_method(request)==METHOD_GET) ? FS_NEED_OPEN_FILE : FS_GOT_DATA;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FS_NEED_OPEN_FILE:
|
||||
status = HTNeLFileOpen(net, file->local, HT_FB_RDONLY);
|
||||
if (status == HT_OK)
|
||||
{
|
||||
{
|
||||
HTStream * rstream = HTStreamStack(HTAnchor_format(anchor),
|
||||
HTRequest_outputFormat(request),
|
||||
HTRequest_outputStream(request),
|
||||
request, YES);
|
||||
HTNet_setReadStream(net, rstream);
|
||||
HTRequest_setOutputConnected(request, YES);
|
||||
}
|
||||
|
||||
{
|
||||
HTOutputStream * output = HTNet_getOutput(net, NULL, 0);
|
||||
HTRequest_setInputStream(request, (HTStream *) output);
|
||||
}
|
||||
|
||||
if (HTRequest_isSource(request) && !HTRequest_destinationsReady(request)) return HT_OK;
|
||||
|
||||
HTRequest_addError(request, ERR_INFO, NO, HTERR_OK, NULL, 0, "HTLoadFile");
|
||||
file->state = FS_NEED_BODY;
|
||||
|
||||
if (HTEvent_isCallbacksRegistered())
|
||||
{
|
||||
if (!HTRequest_preemptive(request))
|
||||
{
|
||||
if (!HTNet_preemptive(net))
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n");
|
||||
HTHost_register(HTNet_host(net), net, HTEvent_READ);
|
||||
}
|
||||
else if (!file->timer)
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "HTLoadFile.. Returning\n");
|
||||
file->timer = HTTimer_new(NULL, ReturnEvent, file, 1, YES, NO);
|
||||
}
|
||||
return HT_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (status == HT_WOULD_BLOCK || status == HT_PENDING)
|
||||
{
|
||||
return HT_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
HTRequest_addError(request, ERR_INFO, NO, HTERR_INTERNAL, NULL, 0, "HTLoadFile");
|
||||
file->state = FS_ERROR; /* Error or interrupt */
|
||||
}
|
||||
break;
|
||||
|
||||
case FS_NEED_BODY:
|
||||
status = HTHost_read(HTNet_host(net), net);
|
||||
if (status == HT_WOULD_BLOCK)
|
||||
{
|
||||
return HT_OK;
|
||||
}
|
||||
else if (status == HT_LOADED || status == HT_CLOSED)
|
||||
{
|
||||
file->state = FS_GOT_DATA;
|
||||
}
|
||||
else
|
||||
{
|
||||
HTRequest_addError(request, ERR_INFO, NO, HTERR_FORBIDDEN, NULL, 0, "HTLoadFile");
|
||||
file->state = FS_ERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
case FS_TRY_FTP:
|
||||
{
|
||||
char *url = HTAnchor_physical(anchor);
|
||||
HTAnchor *anchor;
|
||||
char *newname = NULL;
|
||||
StrAllocCopy(newname, "ftp:");
|
||||
if (!strncmp(url, "file:", 5))
|
||||
{
|
||||
StrAllocCat(newname, url+5);
|
||||
}
|
||||
else
|
||||
{
|
||||
StrAllocCat(newname, url);
|
||||
}
|
||||
anchor = HTAnchor_findAddress(newname);
|
||||
HTRequest_setAnchor(request, anchor);
|
||||
HT_FREE(newname);
|
||||
FileCleanup(request, HT_IGNORE);
|
||||
return HTLoad(request, YES);
|
||||
}
|
||||
break;
|
||||
|
||||
case FS_GOT_DATA:
|
||||
FileCleanup(request, HT_LOADED);
|
||||
return HT_OK;
|
||||
break;
|
||||
|
||||
case FS_NO_DATA:
|
||||
FileCleanup(request, HT_NO_DATA);
|
||||
return HT_OK;
|
||||
break;
|
||||
|
||||
case FS_RETRY:
|
||||
FileCleanup(request, HT_RETRY);
|
||||
return HT_OK;
|
||||
break;
|
||||
|
||||
case FS_ERROR:
|
||||
FileCleanup(request, HT_ERROR);
|
||||
return HT_OK;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} /* End of while(1) */
|
||||
}
|
||||
|
||||
// *************************************************************************
|
||||
// HTNeLReader
|
||||
// *************************************************************************
|
||||
|
||||
size_t nel_fread (void *buffer, uint size, FILE *fp)
|
||||
{
|
||||
CIFile *file = (CIFile *)fp;
|
||||
int toRead = std::min ((int)(file->getFileSize () - file->getPos ()), (int)size);
|
||||
file->serialBuffer((uint8*)buffer, toRead);
|
||||
return toRead;
|
||||
}
|
||||
|
||||
PRIVATE int HTNeLReader_read (HTInputStream * me)
|
||||
{
|
||||
FILE * fp = HTChannel_file(me->ch);
|
||||
HTNet * net = HTHost_getReadNet(me->host);
|
||||
int status;
|
||||
|
||||
/* Read the file desriptor */
|
||||
while (fp)
|
||||
{
|
||||
if ((me->b_read = (int)nel_fread(me->data, FILE_BUFFER_SIZE, fp)) == 0)
|
||||
{
|
||||
HTAlertCallback *cbf = HTAlert_find(HT_PROG_DONE);
|
||||
// HTTRACE(PROT_TRACE, "ANSI read... Finished loading file %p\n" _ fp);
|
||||
if (cbf)
|
||||
(*cbf)(net->request, HT_PROG_DONE, HT_MSG_NULL,NULL,NULL,NULL);
|
||||
return HT_CLOSED;
|
||||
}
|
||||
|
||||
/* Remember how much we have read from the input socket */
|
||||
HTTRACEDATA(me->data, me->b_read, "HTANSIReader_read me->data:");
|
||||
me->write = me->data;
|
||||
me->read = me->data + me->b_read;
|
||||
|
||||
{
|
||||
HTAlertCallback * cbf = HTAlert_find(HT_PROG_READ);
|
||||
HTNet_addBytesRead(net, me->b_read);
|
||||
if (cbf)
|
||||
{
|
||||
int tr = HTNet_bytesRead(net);
|
||||
(*cbf)(net->request, HT_PROG_READ, HT_MSG_NULL, NULL, &tr, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!net->readStream)
|
||||
return HT_ERROR;
|
||||
|
||||
/* Now push the data down the stream */
|
||||
if ((status = (*net->readStream->isa->put_block)
|
||||
(net->readStream, me->data, me->b_read)) != HT_OK)
|
||||
{
|
||||
if (status == HT_WOULD_BLOCK)
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "ANSI read... Target WOULD BLOCK\n");
|
||||
return HT_WOULD_BLOCK;
|
||||
}
|
||||
else if (status == HT_PAUSE)
|
||||
{
|
||||
HTTRACE(PROT_TRACE, "ANSI read... Target PAUSED\n");
|
||||
return HT_PAUSE;
|
||||
}
|
||||
else if (status > 0)
|
||||
{
|
||||
/* Stream specific return code */
|
||||
HTTRACE(PROT_TRACE, "ANSI read... Target returns %d\n" _ status);
|
||||
me->write = me->data + me->b_read;
|
||||
return status;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have a real error */
|
||||
HTTRACE(PROT_TRACE, "ANSI read... Target ERROR\n");
|
||||
return status;
|
||||
}
|
||||
}
|
||||
me->write = me->data + me->b_read;
|
||||
}
|
||||
HTTRACE(PROT_TRACE, "ANSI read... File descriptor is NULL...\n");
|
||||
return HT_ERROR;
|
||||
}
|
||||
|
||||
PRIVATE int HTNeLReader_close (HTInputStream * me)
|
||||
{
|
||||
CIFile *file = (CIFile *)HTChannel_file(me->ch);
|
||||
if (file)
|
||||
{
|
||||
file->close();
|
||||
}
|
||||
|
||||
int status = HT_OK;
|
||||
HTNet * net = HTHost_getReadNet(me->host);
|
||||
|
||||
|
||||
if (net && net->readStream)
|
||||
{
|
||||
if ((status = (*net->readStream->isa->_free)(net->readStream))==HT_WOULD_BLOCK) return HT_WOULD_BLOCK;
|
||||
net->readStream = NULL;
|
||||
}
|
||||
|
||||
HTTRACE(STREAM_TRACE, "Socket read. FREEING....\n");
|
||||
HT_FREE(me);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
PUBLIC int HTNeLReader_consumed (HTInputStream * me, size_t bytes)
|
||||
{
|
||||
me->write += bytes;
|
||||
me->b_read -= (int)bytes;
|
||||
HTHost_setRemainingRead(me->host, me->b_read);
|
||||
return HT_OK;
|
||||
}
|
||||
|
||||
PRIVATE int HTNeLReader_flush (HTInputStream * me)
|
||||
{
|
||||
HTNet * net = HTHost_getReadNet(me->host);
|
||||
return net && net->readStream ? (*net->readStream->isa->flush)(net->readStream) : HT_OK;
|
||||
}
|
||||
|
||||
PRIVATE int HTNeLReader_free (HTInputStream * me)
|
||||
{
|
||||
CIFile *file = (CIFile *)HTChannel_file(me->ch);
|
||||
if (file)
|
||||
{
|
||||
delete file;
|
||||
HTChannel_setFile (me->ch, NULL);
|
||||
}
|
||||
|
||||
HTNet * net = HTHost_getReadNet(me->host);
|
||||
if (net && net->readStream)
|
||||
{
|
||||
int status = (*net->readStream->isa->_free)(net->readStream);
|
||||
if (status == HT_OK) net->readStream = NULL;
|
||||
return status;
|
||||
}
|
||||
return HT_OK;
|
||||
}
|
||||
|
||||
PRIVATE int HTNeLReader_abort (HTInputStream * me, HTList * /* e */)
|
||||
{
|
||||
HTNet * net = HTHost_getReadNet(me->host);
|
||||
if (net && net->readStream)
|
||||
{
|
||||
int status = (*net->readStream->isa->abort)(net->readStream, NULL);
|
||||
if (status != HT_IGNORE) net->readStream = NULL;
|
||||
}
|
||||
return HT_ERROR;
|
||||
}
|
||||
|
||||
PRIVATE const HTInputStreamClass HTNeLReader =
|
||||
{
|
||||
"SocketReader",
|
||||
HTNeLReader_flush,
|
||||
HTNeLReader_free,
|
||||
HTNeLReader_abort,
|
||||
HTNeLReader_read,
|
||||
HTNeLReader_close,
|
||||
HTNeLReader_consumed
|
||||
};
|
||||
|
||||
PUBLIC HTInputStream * HTNeLReader_new (HTHost * host, HTChannel * ch, void * /* param */, int /* mode */)
|
||||
{
|
||||
if (host && ch)
|
||||
{
|
||||
HTInputStream * me = HTChannel_input(ch);
|
||||
if (me == NULL)
|
||||
{
|
||||
if ((me=(HTInputStream *) HT_CALLOC(1, sizeof(HTInputStream))) == NULL) HT_OUTOFMEM("HTNeLReader_new");
|
||||
me->isa = &HTNeLReader;
|
||||
me->ch = ch;
|
||||
me->host = host;
|
||||
HTTRACE(STREAM_TRACE, "Reader...... Created reader stream %p\n" _ me);
|
||||
}
|
||||
return me;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//PUBLIC unsigned int WWW_TraceFlag = 0;
|
||||
|
||||
} // extern "C"
|
||||
|
||||
|
797
code/nel/src/gui/libwww_types.cpp
Normal file
797
code/nel/src/gui/libwww_types.cpp
Normal file
|
@ -0,0 +1,797 @@
|
|||
/**
|
||||
libwww Copyright Notice
|
||||
[This notice should be placed within redistributed or derivative software
|
||||
code when appropriate. This particular formulation of W3C's notice for
|
||||
inclusion in libwww code became active on August 14 1998.]
|
||||
|
||||
LIBWWW COPYRIGHT NOTICE
|
||||
|
||||
libwww: W3C's implementation of HTTP can be found at:
|
||||
http://www.w3.org/Library/
|
||||
|
||||
Copyright ¨ 1995-2002 World Wide Web Consortium,
|
||||
(Massachusetts Institute of Technology, Institut
|
||||
National de Recherche en Informatique et en
|
||||
Automatique, Keio University). All Rights Reserved.
|
||||
This program is distributed under the W3C's
|
||||
Intellectual Property License. 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 W3C License
|
||||
http://www.w3.org/Consortium/Legal/ for more details.
|
||||
|
||||
Copyright ¨ 1995 CERN. "This product includes computer
|
||||
software created and made available by CERN. This
|
||||
acknowledgment shall be mentioned in full in any
|
||||
product which includes the CERN computer software
|
||||
included herein or parts thereof."
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#include "nel/gui/libwww_types.h"
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
|
||||
/*
|
||||
** ATTRIBUTE DEFINITION MACROS (see HTMLPDTD.h)
|
||||
*/
|
||||
|
||||
/*
|
||||
* redefine the macros, so that the "stringized" attribute name
|
||||
* is generated
|
||||
*/
|
||||
|
||||
#undef HTML_ATTR
|
||||
#define HTML_ATTR(t,a) { (char *) #a }
|
||||
#undef HTML_ATTRIBUTES
|
||||
#define HTML_ATTRIBUTES(t) { 0 }
|
||||
|
||||
/*
|
||||
** ATTRIBUTE LISTS
|
||||
*/
|
||||
|
||||
static HTAttr no_attr[1] = {
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static HTAttr body_attr[HTML_BODY_ATTRIBUTES+1] = { /* to catch images */
|
||||
HTML_ATTR(BODY,ALINK),
|
||||
HTML_ATTR(BODY,BACKGROUND),
|
||||
HTML_ATTR(BODY,BGCOLOR),
|
||||
HTML_ATTR(BODY,CLASS),
|
||||
HTML_ATTR(BODY,DIR),
|
||||
HTML_ATTR(BODY,ID),
|
||||
HTML_ATTR(BODY,LANG),
|
||||
HTML_ATTR(BODY,LINK),
|
||||
HTML_ATTR(BODY,STYLE),
|
||||
HTML_ATTR(BODY,TEXT),
|
||||
HTML_ATTR(BODY,TITLE),
|
||||
HTML_ATTR(BODY,VLINK),
|
||||
HTML_ATTRIBUTES(BODY)
|
||||
};
|
||||
|
||||
static HTAttr frame_attr[HTML_FRAME_ATTRIBUTES+1] = { /* frame attributes */
|
||||
HTML_ATTR(FRAME,CLASS),
|
||||
HTML_ATTR(FRAME,FRAMEBORDER),
|
||||
HTML_ATTR(FRAME,ID),
|
||||
HTML_ATTR(FRAME,NAME),
|
||||
HTML_ATTR(FRAME,MARGINHEIGHT),
|
||||
HTML_ATTR(FRAME,MARGINWIDTH),
|
||||
HTML_ATTR(FRAME,NORESIZE),
|
||||
HTML_ATTR(FRAME,LONGDESC),
|
||||
HTML_ATTR(FRAME,SCROLLING),
|
||||
HTML_ATTR(FRAME,SRC),
|
||||
HTML_ATTR(FRAME,STYLE),
|
||||
HTML_ATTR(FRAME,TARGET),
|
||||
HTML_ATTR(FRAME,TITLE),
|
||||
HTML_ATTRIBUTES(FRAME)
|
||||
};
|
||||
|
||||
static HTAttr frameset_attr[HTML_FRAMESET_ATTRIBUTES+1] = { /* frameset attributes */
|
||||
HTML_ATTR(FRAMESET,CLASS),
|
||||
HTML_ATTR(FRAMESET,COLS),
|
||||
HTML_ATTR(FRAMESET,ID),
|
||||
HTML_ATTR(FRAMESET,ROWS),
|
||||
HTML_ATTR(FRAMESET,STYLE),
|
||||
HTML_ATTR(FRAMESET,TITLE),
|
||||
HTML_ATTRIBUTES(FRAMESET)
|
||||
};
|
||||
|
||||
static HTAttr a_attr[HTML_A_ATTRIBUTES+1] = { /* Anchor attributes */
|
||||
HTML_ATTR(A,ACCESSKEY),
|
||||
HTML_ATTR(A,CHARSET),
|
||||
HTML_ATTR(A,CLASS),
|
||||
HTML_ATTR(A,COORDS),
|
||||
HTML_ATTR(A,DIR),
|
||||
HTML_ATTR(A,HREF),
|
||||
HTML_ATTR(A,HREFLANG),
|
||||
HTML_ATTR(A,ID),
|
||||
HTML_ATTR(A,NAME),
|
||||
HTML_ATTR(A,REL),
|
||||
HTML_ATTR(A,REV),
|
||||
HTML_ATTR(A,SHAPE),
|
||||
HTML_ATTR(A,STYLE),
|
||||
HTML_ATTR(A,TABINDEX),
|
||||
HTML_ATTR(A,TARGET),
|
||||
HTML_ATTR(A,TYPE),
|
||||
HTML_ATTR(A,TITLE),
|
||||
HTML_ATTRIBUTES(A)
|
||||
};
|
||||
|
||||
static HTAttr applet_attr[HTML_APPLET_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(APPLET,ALIGN),
|
||||
HTML_ATTR(APPLET,ALT),
|
||||
HTML_ATTR(APPLET,ARCHIVE),
|
||||
HTML_ATTR(APPLET,CLASS),
|
||||
HTML_ATTR(APPLET,CODE),
|
||||
HTML_ATTR(APPLET,CODEBASE),
|
||||
HTML_ATTR(APPLET,HEIGHT),
|
||||
HTML_ATTR(APPLET,HSPACE),
|
||||
HTML_ATTR(APPLET,ID),
|
||||
HTML_ATTR(APPLET,NAME),
|
||||
HTML_ATTR(APPLET,OBJECT),
|
||||
HTML_ATTR(APPLET,STYLE),
|
||||
HTML_ATTR(APPLET,TITLE),
|
||||
HTML_ATTR(APPLET,VSPACE),
|
||||
HTML_ATTR(APPLET,WIDTH),
|
||||
HTML_ATTRIBUTES(APPLET)
|
||||
};
|
||||
|
||||
static HTAttr area_attr[HTML_AREA_ATTRIBUTES+1] = { /* Area attributes */
|
||||
HTML_ATTR(AREA,ACCESSKEY),
|
||||
HTML_ATTR(AREA,ALT),
|
||||
HTML_ATTR(AREA,CLASS),
|
||||
HTML_ATTR(AREA,COORDS),
|
||||
HTML_ATTR(AREA,DIR),
|
||||
HTML_ATTR(AREA,HREF),
|
||||
HTML_ATTR(AREA,ID),
|
||||
HTML_ATTR(AREA,NAME),
|
||||
HTML_ATTR(AREA,NOHREF),
|
||||
HTML_ATTR(AREA,LANG),
|
||||
HTML_ATTR(AREA,SHAPE),
|
||||
HTML_ATTR(AREA,STYLE),
|
||||
HTML_ATTR(AREA,TABINDEX),
|
||||
HTML_ATTR(AREA,TARGET),
|
||||
HTML_ATTR(AREA,TITLE),
|
||||
HTML_ATTRIBUTES(AREA)
|
||||
};
|
||||
|
||||
static HTAttr base_attr[HTML_BASE_ATTRIBUTES+1] = { /* BASE attributes */
|
||||
HTML_ATTR(BASE,HREF),
|
||||
HTML_ATTR(BASE,TARGET),
|
||||
HTML_ATTRIBUTES(BASE)
|
||||
};
|
||||
|
||||
static HTAttr bdo_attr[HTML_BDO_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(BDO,CLASS),
|
||||
HTML_ATTR(BDO,DIR),
|
||||
HTML_ATTR(BDO,ID),
|
||||
HTML_ATTR(BDO,LANG),
|
||||
HTML_ATTR(BDO,STYLE),
|
||||
HTML_ATTR(BDO,TITLE),
|
||||
HTML_ATTRIBUTES(BDO)
|
||||
};
|
||||
|
||||
static HTAttr bq_attr[HTML_BQ_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(BQ,CITE),
|
||||
HTML_ATTR(BQ,CLASS),
|
||||
HTML_ATTR(BQ,DIR),
|
||||
HTML_ATTR(BQ,ID),
|
||||
HTML_ATTR(BQ,LANG),
|
||||
HTML_ATTR(BQ,STYLE),
|
||||
HTML_ATTR(BQ,TITLE),
|
||||
HTML_ATTRIBUTES(BQ)
|
||||
};
|
||||
|
||||
static HTAttr br_attr[HTML_BR_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(BR,CLASS),
|
||||
HTML_ATTR(BR,CLEAR),
|
||||
HTML_ATTR(BR,ID),
|
||||
HTML_ATTR(BR,STYLE),
|
||||
HTML_ATTR(BR,TITLE),
|
||||
HTML_ATTRIBUTES(BR)
|
||||
};
|
||||
|
||||
static HTAttr button_attr[HTML_BUTTON_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(BUTTON,ACCESSKEY),
|
||||
HTML_ATTR(BUTTON,CLASS),
|
||||
HTML_ATTR(BUTTON,DIR),
|
||||
HTML_ATTR(BUTTON,DISABLED),
|
||||
HTML_ATTR(BUTTON,ID),
|
||||
HTML_ATTR(BUTTON,LANG),
|
||||
HTML_ATTR(BUTTON,NAME),
|
||||
HTML_ATTR(BUTTON,STYLE),
|
||||
HTML_ATTR(BUTTON,TABINDEX),
|
||||
HTML_ATTR(BUTTON,TITLE),
|
||||
HTML_ATTR(BUTTON,TYPE),
|
||||
HTML_ATTR(BUTTON,VALUE),
|
||||
HTML_ATTRIBUTES(BUTTON),
|
||||
};
|
||||
|
||||
static HTAttr col_attr[HTML_COL_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(COL,CLASS),
|
||||
HTML_ATTR(COL,DIR),
|
||||
HTML_ATTR(COL,ID),
|
||||
HTML_ATTR(COL,LANG),
|
||||
HTML_ATTR(COL,SPAN),
|
||||
HTML_ATTR(COL,STYLE),
|
||||
HTML_ATTR(COL,TITLE),
|
||||
HTML_ATTR(COL,WIDTH),
|
||||
HTML_ATTRIBUTES(COL)
|
||||
};
|
||||
|
||||
static HTAttr changes_attr[HTML_CHANGES_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(CHANGES,CITE),
|
||||
HTML_ATTR(CHANGES,CLASS),
|
||||
HTML_ATTR(CHANGES,DATETIME),
|
||||
HTML_ATTR(CHANGES,DIR),
|
||||
HTML_ATTR(CHANGES,ID),
|
||||
HTML_ATTR(CHANGES,LANG),
|
||||
HTML_ATTR(CHANGES,STYLE),
|
||||
HTML_ATTR(CHANGES,TITLE),
|
||||
HTML_ATTRIBUTES(CHANGES)
|
||||
};
|
||||
|
||||
static HTAttr font_attr[HTML_FONT_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(FONT,CLASS),
|
||||
HTML_ATTR(FONT,COLOR),
|
||||
HTML_ATTR(FONT,DIR),
|
||||
HTML_ATTR(FONT,FACE),
|
||||
HTML_ATTR(FONT,ID),
|
||||
HTML_ATTR(FONT,LANG),
|
||||
HTML_ATTR(FONT,SIZE),
|
||||
HTML_ATTR(FONT,STYLE),
|
||||
HTML_ATTR(FONT,TITLE),
|
||||
HTML_ATTRIBUTES(FONT)
|
||||
};
|
||||
|
||||
static HTAttr form_attr[HTML_FORM_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(FORM,ACCEPT),
|
||||
{ (char *) "ACCEPT-CHARSET" }, /* HTML_ATTR(FORM,ACCEPT_CHARSET) */
|
||||
HTML_ATTR(FORM,ACTION),
|
||||
HTML_ATTR(FORM,CLASS),
|
||||
HTML_ATTR(FORM,DIR),
|
||||
HTML_ATTR(FORM,ENCTYPE),
|
||||
HTML_ATTR(FORM,ID),
|
||||
HTML_ATTR(FORM,LANG),
|
||||
HTML_ATTR(FORM,METHOD),
|
||||
HTML_ATTR(FORM,STYLE),
|
||||
HTML_ATTR(FORM,TARGET),
|
||||
HTML_ATTR(FORM,TITLE),
|
||||
HTML_ATTRIBUTES(FORM)
|
||||
};
|
||||
|
||||
static HTAttr gen_attr[HTML_GEN_ATTRIBUTES+1] = { /* General, for many things */
|
||||
HTML_ATTR(GEN,CLASS),
|
||||
HTML_ATTR(GEN,DIR),
|
||||
HTML_ATTR(GEN,ID),
|
||||
HTML_ATTR(GEN,LANG),
|
||||
HTML_ATTR(GEN,STYLE),
|
||||
HTML_ATTR(GEN,TITLE),
|
||||
HTML_ATTRIBUTES(GEN)
|
||||
};
|
||||
|
||||
static HTAttr block_attr[HTML_BLOCK_ATTRIBUTES+1] = { /* DIV, SPAN, H1-H6 */
|
||||
HTML_ATTR(BLOCK,ALIGN),
|
||||
HTML_ATTR(BLOCK,CLASS),
|
||||
HTML_ATTR(BLOCK,DIR),
|
||||
HTML_ATTR(BLOCK,ID),
|
||||
HTML_ATTR(BLOCK,LANG),
|
||||
HTML_ATTR(BLOCK,STYLE),
|
||||
HTML_ATTR(BLOCK,TITLE),
|
||||
HTML_ATTRIBUTES(BLOCK)
|
||||
};
|
||||
|
||||
static HTAttr head_attr[HTML_HEAD_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(HEAD,DIR),
|
||||
HTML_ATTR(HEAD,LANG),
|
||||
HTML_ATTR(HEAD,PROFILE),
|
||||
HTML_ATTRIBUTES(HEAD)
|
||||
};
|
||||
|
||||
static HTAttr hr_attr[HTML_HR_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(HR,ALIGN),
|
||||
HTML_ATTR(HR,CLASS),
|
||||
HTML_ATTR(HR,DIR),
|
||||
HTML_ATTR(HR,ID),
|
||||
HTML_ATTR(HR,LANG),
|
||||
HTML_ATTR(HR,NOSHADE),
|
||||
HTML_ATTR(HR,SIZE),
|
||||
HTML_ATTR(HR,STYLE),
|
||||
HTML_ATTR(HR,TITLE),
|
||||
HTML_ATTR(HR,WIDTH),
|
||||
HTML_ATTRIBUTES(HR)
|
||||
};
|
||||
|
||||
static HTAttr html_attr[HTML_HTML_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(HTML,DIR),
|
||||
HTML_ATTR(HTML,LANG),
|
||||
HTML_ATTR(HTML,VERSION),
|
||||
HTML_ATTRIBUTES(HTML)
|
||||
};
|
||||
|
||||
static HTAttr iframe_attr[HTML_IFRAME_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(IFRAME,ALIGN),
|
||||
HTML_ATTR(IFRAME,CLASS),
|
||||
HTML_ATTR(IFRAME,FRAMEBORDER),
|
||||
HTML_ATTR(IFRAME,HEIGHT),
|
||||
HTML_ATTR(IFRAME,ID),
|
||||
HTML_ATTR(IFRAME,LONGDESC),
|
||||
HTML_ATTR(IFRAME,MARGINHEIGHT),
|
||||
HTML_ATTR(IFRAME,MARGINWIDTH),
|
||||
HTML_ATTR(IFRAME,NAME),
|
||||
HTML_ATTR(IFRAME,SCROLLING),
|
||||
HTML_ATTR(IFRAME,SRC),
|
||||
HTML_ATTR(IFRAME,STYLE),
|
||||
HTML_ATTR(IFRAME,TARGET),
|
||||
HTML_ATTR(IFRAME,TITLE),
|
||||
HTML_ATTR(IFRAME,WIDTH),
|
||||
HTML_ATTRIBUTES(IFRAME)
|
||||
};
|
||||
|
||||
static HTAttr img_attr[HTML_IMG_ATTRIBUTES+1] = { /* IMG attributes */
|
||||
HTML_ATTR(IMG,ALIGN),
|
||||
HTML_ATTR(IMG,ALT),
|
||||
HTML_ATTR(IMG,BORDER),
|
||||
HTML_ATTR(IMG,CLASS),
|
||||
HTML_ATTR(IMG,DIR),
|
||||
HTML_ATTR(IMG,HEIGHT),
|
||||
HTML_ATTR(IMG,HSPACE),
|
||||
HTML_ATTR(IMG,ID),
|
||||
HTML_ATTR(IMG,ISMAP),
|
||||
HTML_ATTR(IMG,LANG),
|
||||
HTML_ATTR(IMG,LONGDESC),
|
||||
HTML_ATTR(IMG,SRC),
|
||||
HTML_ATTR(IMG,STYLE),
|
||||
HTML_ATTR(IMG,TITLE),
|
||||
HTML_ATTR(IMG,USEMAP),
|
||||
HTML_ATTR(IMG,VSPACE),
|
||||
HTML_ATTR(IMG,WIDTH),
|
||||
HTML_ATTRIBUTES(IMG)
|
||||
};
|
||||
|
||||
static HTAttr input_attr[HTML_INPUT_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(INPUT,ACCEPT),
|
||||
HTML_ATTR(INPUT,ACCESSKEY),
|
||||
HTML_ATTR(INPUT,ALIGN),
|
||||
HTML_ATTR(INPUT,ALT),
|
||||
HTML_ATTR(INPUT,CHECKED),
|
||||
HTML_ATTR(INPUT,CLASS),
|
||||
HTML_ATTR(INPUT,DIR),
|
||||
HTML_ATTR(INPUT,DISABLED),
|
||||
HTML_ATTR(INPUT,ID),
|
||||
HTML_ATTR(INPUT,LANG),
|
||||
HTML_ATTR(INPUT,MAXLENGTH),
|
||||
HTML_ATTR(INPUT,NAME),
|
||||
HTML_ATTR(INPUT,READONLY),
|
||||
HTML_ATTR(INPUT,SIZE),
|
||||
HTML_ATTR(INPUT,SRC),
|
||||
HTML_ATTR(INPUT,STYLE),
|
||||
HTML_ATTR(INPUT,TABINDEX),
|
||||
HTML_ATTR(INPUT,TITLE),
|
||||
HTML_ATTR(INPUT,TYPE),
|
||||
HTML_ATTR(INPUT,USEMAP),
|
||||
HTML_ATTR(INPUT,VALUE),
|
||||
HTML_ATTRIBUTES(INPUT)
|
||||
};
|
||||
|
||||
static HTAttr isindex_attr[HTML_ISINDEX_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(ISINDEX,CLASS),
|
||||
HTML_ATTR(ISINDEX,DIR),
|
||||
HTML_ATTR(ISINDEX,ID),
|
||||
HTML_ATTR(ISINDEX,LANG),
|
||||
HTML_ATTR(ISINDEX,PROMPT),
|
||||
HTML_ATTR(ISINDEX,STYLE),
|
||||
HTML_ATTR(ISINDEX,TITLE),
|
||||
HTML_ATTRIBUTES(ISINDEX)
|
||||
};
|
||||
|
||||
static HTAttr label_attr[HTML_LABEL_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(LABEL,ACCESSKEY),
|
||||
HTML_ATTR(LABEL,CLASS),
|
||||
HTML_ATTR(LABEL,DIR),
|
||||
HTML_ATTR(LABEL,FOR),
|
||||
HTML_ATTR(LABEL,ID),
|
||||
HTML_ATTR(LABEL,LANG),
|
||||
HTML_ATTR(LABEL,STYLE),
|
||||
HTML_ATTR(LABEL,TITLE),
|
||||
HTML_ATTRIBUTES(LABEL)
|
||||
};
|
||||
|
||||
static HTAttr legend_attr[HTML_LEGEND_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(LEGEND,ACCESSKEY),
|
||||
HTML_ATTR(LEGEND,ALIGN),
|
||||
HTML_ATTR(LEGEND,CLASS),
|
||||
HTML_ATTR(LEGEND,DIR),
|
||||
HTML_ATTR(LEGEND,ID),
|
||||
HTML_ATTR(LEGEND,LANG),
|
||||
HTML_ATTR(LEGEND,STYLE),
|
||||
HTML_ATTR(LEGEND,TITLE),
|
||||
HTML_ATTRIBUTES(LEGEND)
|
||||
};
|
||||
|
||||
static HTAttr li_attr[HTML_LI_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(LI,CLASS),
|
||||
HTML_ATTR(LI,COMPACT),
|
||||
HTML_ATTR(LI,DIR),
|
||||
HTML_ATTR(LI,ID),
|
||||
HTML_ATTR(LI,LANG),
|
||||
HTML_ATTR(LI,STYLE),
|
||||
HTML_ATTR(LI,TITLE),
|
||||
HTML_ATTR(LI,TYPE),
|
||||
HTML_ATTR(LI,VALUE),
|
||||
HTML_ATTRIBUTES(LI)
|
||||
};
|
||||
|
||||
static HTAttr link_attr[HTML_LINK_ATTRIBUTES+1] = { /* link attributes */
|
||||
HTML_ATTR(LINK,CHARSET),
|
||||
HTML_ATTR(LINK,CLASS),
|
||||
HTML_ATTR(LINK,DIR),
|
||||
HTML_ATTR(LINK,HREF),
|
||||
HTML_ATTR(LINK,HREFLANG),
|
||||
HTML_ATTR(LINK,ID),
|
||||
HTML_ATTR(LINK,LANG),
|
||||
HTML_ATTR(LINK,MEDIA),
|
||||
HTML_ATTR(LINK,REL),
|
||||
HTML_ATTR(LINK,REV),
|
||||
HTML_ATTR(LINK,STYLE),
|
||||
HTML_ATTR(LINK,TARGET),
|
||||
HTML_ATTR(LINK,TITLE),
|
||||
HTML_ATTR(LINK,TYPE),
|
||||
HTML_ATTRIBUTES(LINK)
|
||||
};
|
||||
|
||||
static HTAttr map_attr[HTML_MAP_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(MAP,CLASS),
|
||||
HTML_ATTR(MAP,DIR),
|
||||
HTML_ATTR(MAP,ID),
|
||||
HTML_ATTR(MAP,LANG),
|
||||
HTML_ATTR(MAP,NAME),
|
||||
HTML_ATTR(MAP,STYLE),
|
||||
HTML_ATTR(MAP,TITLE),
|
||||
HTML_ATTRIBUTES(MAP)
|
||||
};
|
||||
|
||||
static HTAttr meta_attr[HTML_META_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(META,CONTENT),
|
||||
HTML_ATTR(META,DIR),
|
||||
{ (char *)"HTTP-EQUIV" }, /* HTML_ATTR(META,HTTP_EQUIV) */
|
||||
HTML_ATTR(META,LANG),
|
||||
HTML_ATTR(META,NAME),
|
||||
HTML_ATTR(META,SCHEME),
|
||||
HTML_ATTRIBUTES(META)
|
||||
};
|
||||
|
||||
static HTAttr nextid_attr[HTML_NEXTID_ATTRIBUTES+1] = {
|
||||
{ (char *)"N" },
|
||||
{ 0 } /* Terminate list */
|
||||
};
|
||||
|
||||
static HTAttr object_attr[HTML_OBJECT_ATTRIBUTES+1] = { /* object attributes */
|
||||
HTML_ATTR(OBJECT,ALIGN),
|
||||
HTML_ATTR(OBJECT,ARCHIVE),
|
||||
HTML_ATTR(OBJECT,BORDER),
|
||||
HTML_ATTR(OBJECT,CLASS),
|
||||
HTML_ATTR(OBJECT,CLASSID),
|
||||
HTML_ATTR(OBJECT,CODEBASE),
|
||||
HTML_ATTR(OBJECT,CODETYPE),
|
||||
HTML_ATTR(OBJECT,DATA),
|
||||
HTML_ATTR(OBJECT,DECLARE),
|
||||
HTML_ATTR(OBJECT,DIR),
|
||||
HTML_ATTR(OBJECT,HEIGHT),
|
||||
HTML_ATTR(OBJECT,HSPACE),
|
||||
HTML_ATTR(OBJECT,ID),
|
||||
HTML_ATTR(OBJECT,LANG),
|
||||
HTML_ATTR(OBJECT,NAME),
|
||||
HTML_ATTR(OBJECT,STANDBY),
|
||||
HTML_ATTR(OBJECT,STYLE),
|
||||
HTML_ATTR(OBJECT,TABINDEX),
|
||||
HTML_ATTR(OBJECT,TITLE),
|
||||
HTML_ATTR(OBJECT,TYPE),
|
||||
HTML_ATTR(OBJECT,USEMAP),
|
||||
HTML_ATTR(OBJECT,VSPACE),
|
||||
HTML_ATTR(OBJECT,WIDTH),
|
||||
HTML_ATTRIBUTES(OBJECT)
|
||||
};
|
||||
|
||||
static HTAttr ol_attr[HTML_OL_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(OL,CLASS),
|
||||
HTML_ATTR(OL,COMPACT),
|
||||
HTML_ATTR(OL,DIR),
|
||||
HTML_ATTR(OL,ID),
|
||||
HTML_ATTR(OL,LANG),
|
||||
HTML_ATTR(OL,START),
|
||||
HTML_ATTR(OL,STYLE),
|
||||
HTML_ATTR(OL,TITLE),
|
||||
HTML_ATTR(OL,TYPE),
|
||||
HTML_ATTRIBUTES(OL)
|
||||
};
|
||||
|
||||
static HTAttr optgroup_attr[HTML_OPTGROUP_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(OPTGROUP,CLASS),
|
||||
HTML_ATTR(OPTGROUP,DISABLED),
|
||||
HTML_ATTR(OPTGROUP,DIR),
|
||||
HTML_ATTR(OPTGROUP,ID),
|
||||
HTML_ATTR(OPTGROUP,LABEL),
|
||||
HTML_ATTR(OPTGROUP,LANG),
|
||||
HTML_ATTR(OPTGROUP,STYLE),
|
||||
HTML_ATTR(OPTGROUP,TITLE),
|
||||
HTML_ATTRIBUTES(OPTGROUP)
|
||||
};
|
||||
|
||||
static HTAttr option_attr[HTML_OPTION_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(OPTION,CLASS),
|
||||
HTML_ATTR(OPTION,DISABLED),
|
||||
HTML_ATTR(OPTION,DIR),
|
||||
HTML_ATTR(OPTION,ID),
|
||||
HTML_ATTR(OPTION,LABEL),
|
||||
HTML_ATTR(OPTION,LANG),
|
||||
HTML_ATTR(OPTION,SELECTED),
|
||||
HTML_ATTR(OPTION,STYLE),
|
||||
HTML_ATTR(OPTION,TITLE),
|
||||
HTML_ATTR(OPTION,VALUE),
|
||||
HTML_ATTRIBUTES(OPTION)
|
||||
};
|
||||
|
||||
static HTAttr param_attr[HTML_PARAM_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(PARAM,ID),
|
||||
HTML_ATTR(PARAM,NAME),
|
||||
HTML_ATTR(PARAM,TYPE),
|
||||
HTML_ATTR(PARAM,VALUE),
|
||||
HTML_ATTR(PARAM,VALUETYPE),
|
||||
HTML_ATTRIBUTES(PARAM)
|
||||
};
|
||||
|
||||
static HTAttr pre_attr[HTML_PRE_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(PRE,CLASS),
|
||||
HTML_ATTR(PRE,DIR),
|
||||
HTML_ATTR(PRE,ID),
|
||||
HTML_ATTR(PRE,LANG),
|
||||
HTML_ATTR(PRE,STYLE),
|
||||
HTML_ATTR(PRE,TITLE),
|
||||
HTML_ATTR(PRE,WIDTH),
|
||||
HTML_ATTRIBUTES(PRE)
|
||||
};
|
||||
|
||||
static HTAttr script_attr[HTML_SCRIPT_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(SCRIPT,CHARSET),
|
||||
HTML_ATTR(SCRIPT,DEFER),
|
||||
HTML_ATTR(SCRIPT,LANGUAGE),
|
||||
HTML_ATTR(SCRIPT,SRC),
|
||||
HTML_ATTR(SCRIPT,TYPE),
|
||||
HTML_ATTRIBUTES(SCRIPT)
|
||||
};
|
||||
|
||||
static HTAttr select_attr[HTML_SELECT_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(SELECT,CLASS),
|
||||
HTML_ATTR(SELECT,DIR),
|
||||
HTML_ATTR(SELECT,DISABLED),
|
||||
HTML_ATTR(SELECT,ID),
|
||||
HTML_ATTR(SELECT,LANG),
|
||||
HTML_ATTR(SELECT,MULTIPLE),
|
||||
HTML_ATTR(SELECT,NAME),
|
||||
HTML_ATTR(SELECT,SIZE),
|
||||
HTML_ATTR(SELECT,STYLE),
|
||||
HTML_ATTR(SELECT,TABINDEX),
|
||||
HTML_ATTR(SELECT,TITLE),
|
||||
HTML_ATTRIBUTES(SELECT)
|
||||
};
|
||||
|
||||
static HTAttr style_attr[HTML_STYLE_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(STYLE,DIR),
|
||||
HTML_ATTR(STYLE,LANG),
|
||||
HTML_ATTR(STYLE,MEDIA),
|
||||
HTML_ATTR(STYLE,TITLE),
|
||||
HTML_ATTR(STYLE,TYPE),
|
||||
HTML_ATTRIBUTES(STYLE)
|
||||
};
|
||||
|
||||
static HTAttr table_attr[HTML_TABLE_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(TABLE,ALIGN),
|
||||
HTML_ATTR(TABLE,BGCOLOR),
|
||||
HTML_ATTR(TABLE,BORDER),
|
||||
HTML_ATTR(TABLE,CELLPADDING),
|
||||
HTML_ATTR(TABLE,CELLSPACING),
|
||||
HTML_ATTR(TABLE,CLASS),
|
||||
HTML_ATTR(TABLE,DIR),
|
||||
HTML_ATTR(TABLE,FRAME),
|
||||
HTML_ATTR(TABLE,ID),
|
||||
HTML_ATTR(TABLE,LANG),
|
||||
HTML_ATTR(TABLE,RULES),
|
||||
HTML_ATTR(TABLE,SUMMARY),
|
||||
HTML_ATTR(TABLE,STYLE),
|
||||
HTML_ATTR(TABLE,TITLE),
|
||||
HTML_ATTR(TABLE,WIDTH),
|
||||
HTML_ATTRIBUTES(TABLE)
|
||||
};
|
||||
|
||||
static HTAttr tele_attr[HTML_TELE_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(TELE,ALIGN),
|
||||
HTML_ATTR(TELE,CHAR),
|
||||
HTML_ATTR(TELE,CHAROFF),
|
||||
HTML_ATTR(TELE,CLASS),
|
||||
HTML_ATTR(TELE,DIR),
|
||||
HTML_ATTR(TELE,ID),
|
||||
HTML_ATTR(TELE,LANG),
|
||||
HTML_ATTR(TELE,STYLE),
|
||||
HTML_ATTR(TELE,TITLE),
|
||||
HTML_ATTR(TELE,VALIGN),
|
||||
HTML_ATTRIBUTES(TELE)
|
||||
};
|
||||
|
||||
static HTAttr td_attr[HTML_TD_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(TD,ABBR),
|
||||
HTML_ATTR(TD,ALIGN),
|
||||
HTML_ATTR(TD,AXIS),
|
||||
HTML_ATTR(TD,BGCOLOR),
|
||||
HTML_ATTR(TD,CHAR),
|
||||
HTML_ATTR(TD,CHAROFF),
|
||||
HTML_ATTR(TD,CLASS),
|
||||
HTML_ATTR(TD,COLSPAN),
|
||||
HTML_ATTR(TD,DIR),
|
||||
HTML_ATTR(TD,ID),
|
||||
HTML_ATTR(TD,HEADERS),
|
||||
HTML_ATTR(TD,HEIGHT),
|
||||
HTML_ATTR(TD,LANG),
|
||||
HTML_ATTR(TD,NOWRAP),
|
||||
HTML_ATTR(TD,ROWSPAN),
|
||||
HTML_ATTR(TD,SCOPE),
|
||||
HTML_ATTR(TD,STYLE),
|
||||
HTML_ATTR(TD,TITLE),
|
||||
HTML_ATTR(TD,VALIGN),
|
||||
HTML_ATTR(TD,WIDTH),
|
||||
HTML_ATTRIBUTES(TD)
|
||||
};
|
||||
|
||||
static HTAttr textarea_attr[HTML_TEXTAREA_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(TEXTAREA,CLASS),
|
||||
HTML_ATTR(TEXTAREA,COLS),
|
||||
HTML_ATTR(TEXTAREA,DIR),
|
||||
HTML_ATTR(TEXTAREA,DISABLED),
|
||||
HTML_ATTR(TEXTAREA,ID),
|
||||
HTML_ATTR(TEXTAREA,LANG),
|
||||
HTML_ATTR(TEXTAREA,NAME),
|
||||
HTML_ATTR(TEXTAREA,READONLY),
|
||||
HTML_ATTR(TEXTAREA,ROWS),
|
||||
HTML_ATTR(TEXTAREA,STYLE),
|
||||
HTML_ATTR(TEXTAREA,TABINDEX),
|
||||
HTML_ATTR(TEXTAREA,TITLE),
|
||||
HTML_ATTRIBUTES(TEXTAREA)
|
||||
};
|
||||
|
||||
static HTAttr title_attr[HTML_TITLE_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(TITLE,DIR),
|
||||
HTML_ATTR(TITLE,LANG),
|
||||
HTML_ATTRIBUTES(TITLE)
|
||||
};
|
||||
|
||||
static HTAttr ul_attr[HTML_UL_ATTRIBUTES+1] = {
|
||||
HTML_ATTR(UL,CLASS),
|
||||
HTML_ATTR(UL,COMPACT),
|
||||
HTML_ATTR(UL,DIR),
|
||||
HTML_ATTR(UL,ID),
|
||||
HTML_ATTR(UL,LANG),
|
||||
HTML_ATTR(UL,STYLE),
|
||||
HTML_ATTR(UL,TITLE),
|
||||
HTML_ATTR(UL,TYPE),
|
||||
HTML_ATTRIBUTES(UL)
|
||||
};
|
||||
|
||||
/*
|
||||
** ELEMENTS
|
||||
** Must match definitions in HTMLPDTD.html!
|
||||
** Must be in alphabetical order.
|
||||
**
|
||||
** Name, Attributes, content
|
||||
*/
|
||||
static HTTag tags[HTML_ELEMENTS] = {
|
||||
{ "A" , a_attr, HTML_A_ATTRIBUTES },
|
||||
{ "ABBR" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "ACRONYM" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "ADDRESS" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "APPLET" , applet_attr, HTML_APPLET_ATTRIBUTES },
|
||||
{ "AREA" , area_attr, HTML_AREA_ATTRIBUTES },
|
||||
{ "B" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "BASE" , base_attr, HTML_BASE_ATTRIBUTES },
|
||||
{ "BASEFONT", font_attr, HTML_FONT_ATTRIBUTES },
|
||||
{ "BDO" , bdo_attr, HTML_BDO_ATTRIBUTES },
|
||||
{ "BIG" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "BLOCKQUOTE", bq_attr, HTML_BQ_ATTRIBUTES },
|
||||
{ "BODY" , body_attr, HTML_BODY_ATTRIBUTES },
|
||||
{ "BR" , br_attr, HTML_BR_ATTRIBUTES },
|
||||
{ "BUTTON" , button_attr, HTML_BUTTON_ATTRIBUTES },
|
||||
{ "CAPTION" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "CENTER" , no_attr, 0 },
|
||||
{ "CITE" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "CODE" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "COL" , col_attr, HTML_COL_ATTRIBUTES },
|
||||
{ "COLGROUP", col_attr, HTML_COL_ATTRIBUTES },
|
||||
{ "DD" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "DEL" , changes_attr, HTML_CHANGES_ATTRIBUTES },
|
||||
{ "DFN" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "DIR" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "DIV" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "DL" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "DT" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "EM" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "FIELDSET", gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "FONT" , font_attr, HTML_FONT_ATTRIBUTES },
|
||||
{ "FORM" , form_attr, HTML_FORM_ATTRIBUTES },
|
||||
{ "FRAME" , frame_attr, HTML_FRAME_ATTRIBUTES },
|
||||
{ "FRAMESET", frameset_attr,HTML_FRAMESET_ATTRIBUTES },
|
||||
{ "H1" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "H2" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "H3" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "H4" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "H5" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "H6" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "HEAD" , head_attr, HTML_HEAD_ATTRIBUTES },
|
||||
{ "HR" , hr_attr, HTML_HR_ATTRIBUTES },
|
||||
{ "HTML" , html_attr, HTML_HTML_ATTRIBUTES },
|
||||
{ "I" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "IFRAME" , iframe_attr, HTML_IFRAME_ATTRIBUTES },
|
||||
{ "IMG" , img_attr, HTML_IMG_ATTRIBUTES },
|
||||
{ "INPUT" , input_attr, HTML_INPUT_ATTRIBUTES },
|
||||
{ "INS" , changes_attr, HTML_CHANGES_ATTRIBUTES },
|
||||
{ "ISINDEX" , isindex_attr, HTML_ISINDEX_ATTRIBUTES },
|
||||
{ "KBD" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "LABEL" , label_attr, HTML_LABEL_ATTRIBUTES },
|
||||
{ "LEGEND" , legend_attr, HTML_LEGEND_ATTRIBUTES },
|
||||
{ "LI" , li_attr, HTML_LI_ATTRIBUTES },
|
||||
{ "LINK" , link_attr, HTML_LINK_ATTRIBUTES },
|
||||
{ "MAP" , map_attr, HTML_MAP_ATTRIBUTES },
|
||||
{ "MENU" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "META" , meta_attr, HTML_META_ATTRIBUTES },
|
||||
{ "NEXTID" , nextid_attr, 1 },
|
||||
{ "NOFRAMES", gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "NOSCRIPT", gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "OBJECT" , object_attr, HTML_OBJECT_ATTRIBUTES },
|
||||
{ "OL" , ol_attr, HTML_OL_ATTRIBUTES },
|
||||
{ "OPTGROUP", optgroup_attr,HTML_OPTGROUP_ATTRIBUTES },
|
||||
{ "OPTION" , option_attr, HTML_OPTION_ATTRIBUTES },
|
||||
{ "P" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "PARAM" , param_attr, HTML_PARAM_ATTRIBUTES },
|
||||
{ "PRE" , pre_attr, HTML_PRE_ATTRIBUTES },
|
||||
{ "Q" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "S" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "SAMP" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "SCRIPT" , script_attr, HTML_SCRIPT_ATTRIBUTES },
|
||||
{ "SELECT" , select_attr, HTML_SELECT_ATTRIBUTES },
|
||||
{ "SMALL" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "SPAN" , block_attr, HTML_BLOCK_ATTRIBUTES },
|
||||
{ "STRIKE" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "STRONG" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "STYLE" , style_attr, HTML_STYLE_ATTRIBUTES },
|
||||
{ "SUB" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "SUP" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "TABLE" , table_attr, HTML_TABLE_ATTRIBUTES },
|
||||
{ "TBODY" , tele_attr, HTML_TELE_ATTRIBUTES },
|
||||
{ "TD" , td_attr, HTML_TD_ATTRIBUTES },
|
||||
{ "TEXTAREA", textarea_attr,HTML_TEXTAREA_ATTRIBUTES },
|
||||
{ "TFOOT" , tele_attr, HTML_TELE_ATTRIBUTES },
|
||||
{ "TH" , td_attr, HTML_TD_ATTRIBUTES },
|
||||
{ "THEAD" , tele_attr, HTML_TELE_ATTRIBUTES },
|
||||
{ "TITLE" , title_attr, HTML_TITLE_ATTRIBUTES },
|
||||
{ "TR" , tele_attr, HTML_TELE_ATTRIBUTES },
|
||||
{ "TT" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "U" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
{ "UL" , ul_attr, HTML_UL_ATTRIBUTES },
|
||||
{ "VAR" , gen_attr, HTML_GEN_ATTRIBUTES },
|
||||
};
|
||||
|
||||
static SGML_dtd HTMLP_dtd = {
|
||||
tags,
|
||||
HTML_ELEMENTS
|
||||
};
|
||||
|
||||
static SGML_dtd * DTD = &HTMLP_dtd;
|
||||
|
||||
SGML_dtd * HTML_dtd (void)
|
||||
{
|
||||
return DTD;
|
||||
}
|
||||
|
||||
}// namespace
|
||||
|
222
code/nel/src/gui/url_parser.cpp
Normal file
222
code/nel/src/gui/url_parser.cpp
Normal file
|
@ -0,0 +1,222 @@
|
|||
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include <string>
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/gui/url_parser.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
namespace NLGUI
|
||||
{
|
||||
// ***************************************************************************
|
||||
CUrlParser::CUrlParser(const std::string &uri)
|
||||
{
|
||||
parse(uri);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
void CUrlParser::parse(std::string uri)
|
||||
{
|
||||
const size_t npos = std::string::npos;
|
||||
size_t pos;
|
||||
size_t offset = 0;
|
||||
|
||||
// strip fragment if present
|
||||
pos = uri.find("#");
|
||||
if (pos != npos)
|
||||
{
|
||||
hash = uri.substr(pos + 1);
|
||||
uri = uri.substr(0, pos);
|
||||
}
|
||||
|
||||
// scan for scheme
|
||||
pos = uri.find(":");
|
||||
if (pos != npos && pos >= 1)
|
||||
{
|
||||
for (uint i=0; i<pos; i++)
|
||||
{
|
||||
if (!isalnum(uri[i]))
|
||||
{
|
||||
pos = npos;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pos != npos)
|
||||
{
|
||||
scheme = uri.substr(0, pos);
|
||||
uri = uri.substr(pos + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// scan for domain
|
||||
if (uri.substr(0, 2) == "//")
|
||||
{
|
||||
pos = uri.find("/", 3);
|
||||
domain = uri.substr(0, pos);
|
||||
if (pos != npos)
|
||||
uri = uri.substr(pos);
|
||||
else
|
||||
uri.clear();
|
||||
}
|
||||
|
||||
// scan for query
|
||||
pos = uri.find("?");
|
||||
if (pos != npos)
|
||||
{
|
||||
query = uri.substr(pos + 1);
|
||||
uri = uri.substr(0, pos);
|
||||
}
|
||||
|
||||
// all that is remaining is path
|
||||
path = uri;
|
||||
}
|
||||
|
||||
void CUrlParser::inherit(const std::string &url)
|
||||
{
|
||||
// we have scheme, so we already absolute url
|
||||
if (!scheme.empty())
|
||||
return;
|
||||
|
||||
const size_t npos = std::string::npos;
|
||||
size_t pos;
|
||||
|
||||
CUrlParser base(url);
|
||||
|
||||
scheme = base.scheme;
|
||||
|
||||
// if we already have domain, then ignore base path
|
||||
if (!domain.empty())
|
||||
return;
|
||||
|
||||
domain = base.domain;
|
||||
if (path.empty())
|
||||
{
|
||||
path = base.path;
|
||||
if (query.empty())
|
||||
query = base.query;
|
||||
}
|
||||
else
|
||||
if (path[0] != '/')
|
||||
{
|
||||
// find start of last path segment from base path
|
||||
// if not found, then dont inherit base path at all
|
||||
pos = base.path.find_last_of("/");
|
||||
if (pos != npos)
|
||||
path = base.path.substr(0, pos) + "/" + path;
|
||||
}
|
||||
|
||||
resolveRelativePath(path);
|
||||
}
|
||||
|
||||
void CUrlParser::resolveRelativePath(std::string &path)
|
||||
{
|
||||
const size_t npos = std::string::npos;
|
||||
|
||||
// no relative components in path. filename.ext is also matched, but that's fine
|
||||
size_t pos = path.find(".");
|
||||
if (pos == npos)
|
||||
return;
|
||||
|
||||
// normalize path
|
||||
size_t lhp = 0;
|
||||
while(pos < path.size())
|
||||
{
|
||||
if (path[pos] == '.')
|
||||
{
|
||||
// scan ahead to see what we have
|
||||
std::string sub = path.substr(pos, 2);
|
||||
if (sub == "./" || sub == ".")
|
||||
{
|
||||
// starts with
|
||||
if (pos == 0)
|
||||
path.replace(pos, sub.size(), "/");
|
||||
else
|
||||
{
|
||||
// full or last segment
|
||||
sub = path.substr(pos-1, 3);
|
||||
if (sub == "/./" || sub == "/.")
|
||||
{
|
||||
path.replace(pos, sub.size()-1, "");
|
||||
// we just removed char that pos was pointing, so rewind
|
||||
pos--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (sub == "..")
|
||||
{
|
||||
// starts with
|
||||
if (pos == 0 && path.substr(pos, 3) == "../")
|
||||
path.replace(pos, 3, "/");
|
||||
else
|
||||
if (pos > 0)
|
||||
{
|
||||
// full or last segment
|
||||
sub = path.substr(pos-1, 4);
|
||||
if (sub == "/../" || sub == "/..")
|
||||
{
|
||||
if (pos > 1)
|
||||
lhp = path.find_last_of("/", pos - 2);
|
||||
else
|
||||
lhp = 0;
|
||||
|
||||
// pos points to first dot in ..
|
||||
// lhp points to start slash (/) of last segment
|
||||
pos += sub.size() - 1;
|
||||
path.replace(lhp, pos - lhp, "/");
|
||||
pos = lhp;
|
||||
}
|
||||
}
|
||||
}// sub == ".."
|
||||
} // path[pos] == '.'
|
||||
pos++;
|
||||
}// while
|
||||
}
|
||||
|
||||
bool CUrlParser::isAbsolute() const
|
||||
{
|
||||
return !scheme.empty() && !domain.empty();
|
||||
}
|
||||
|
||||
// serialize URL back to string
|
||||
std::string CUrlParser::toString() const
|
||||
{
|
||||
std::string result;
|
||||
if (!scheme.empty())
|
||||
result += scheme + ":";
|
||||
|
||||
if (!domain.empty())
|
||||
{
|
||||
result += domain;
|
||||
}
|
||||
|
||||
// path already has leading slash
|
||||
if (!path.empty())
|
||||
result += path;
|
||||
|
||||
if (!query.empty())
|
||||
result += "?" + query;
|
||||
|
||||
if (!hash.empty())
|
||||
result += "#" + hash;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}// namespace
|
||||
|
|
@ -252,7 +252,7 @@ namespace NLGUI
|
|||
|
||||
if (vLink->getMouseOverShape(tooltip, rot, col))
|
||||
{
|
||||
setString(ucstring(tooltip));
|
||||
setString(ucstring::makeFromUtf8(tooltip));
|
||||
sint32 texId = rVR.getTextureIdFromName ("curs_pick.tga");
|
||||
|
||||
CInterfaceGroup *stringCursor = hwMouse ? _StringCursorHardware : _StringCursor;
|
||||
|
@ -408,7 +408,7 @@ namespace NLGUI
|
|||
splitString(tooltipInfos, "@", tooltipInfosList);
|
||||
texName = tooltipInfosList[0];
|
||||
tooltip = tooltipInfosList[1];
|
||||
setString(ucstring(tooltip));
|
||||
setString(ucstring::makeFromUtf8(tooltip));
|
||||
CViewRenderer &rVR = *CViewRenderer::getInstance();
|
||||
sint32 texId = rVR.getTextureIdFromName (texName);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include <windows.h>
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
@ -26,141 +26,109 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||
// Dialog
|
||||
//
|
||||
|
||||
IDD_PANEL DIALOG DISCARDABLE 0, 0, 108, 251
|
||||
STYLE WS_CHILD | WS_VISIBLE
|
||||
IDD_PANEL DIALOG 0, 0, 108, 251
|
||||
STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
PUSHBUTTON "Export model",ID_SAVEMODEL,10,10,85,15
|
||||
PUSHBUTTON "Export model animations",ID_SAVE_MODEL_ANIM,10,90,85,15
|
||||
PUSHBUTTON "View the scene",ID_VIEW,10,152,85,15
|
||||
PUSHBUTTON "Export scene animations",ID_SAVE_SCENE_ANIM,10,110,85,
|
||||
15
|
||||
PUSHBUTTON "Export scene animations",ID_SAVE_SCENE_ANIM,10,110,85,15
|
||||
PUSHBUTTON "Export skeleton weights",ID_SAVESWT,10,50,85,15
|
||||
PUSHBUTTON "Export Instance Group",ID_EXPORTINSTANCEGROUP,10,70,85,
|
||||
15
|
||||
PUSHBUTTON "Export Instance Group",ID_EXPORTINSTANCEGROUP,10,70,85,15
|
||||
PUSHBUTTON "Export skeleton",ID_SAVESKELETON,10,30,85,15
|
||||
PUSHBUTTON "Options",ID_OPTIONS,10,173,85,15
|
||||
PUSHBUTTON "Node properties",ID_NODE_PROPERTIES,10,194,85,15
|
||||
PUSHBUTTON "Export Collision",ID_SAVECOLLISION,10,131,85,15
|
||||
CTEXT "Can't read the version",IDC_VERSION,15,234,75,10
|
||||
PUSHBUTTON "Test interface mesh",ID_TEST_INTERFACE_MESH,10,215,85,
|
||||
15
|
||||
PUSHBUTTON "Test interface mesh",ID_TEST_INTERFACE_MESH,10,215,85,15
|
||||
END
|
||||
|
||||
IDD_SWT DIALOG DISCARDABLE 0, 0, 186, 63
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
IDD_SWT DIALOG 0, 0, 186, 63
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
CAPTION "Choose the channel to export"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,129,42,50,14
|
||||
CONTROL "All",IDC_ALLCHANNEL,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,7,23,10
|
||||
CONTROL "Channel Position",IDC_CHANNELPOS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,23,69,10
|
||||
CONTROL "Channel Rotation",IDC_CHANNELROT,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,34,71,10
|
||||
CONTROL "Channel Scale",IDC_CHANNELSCA,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,7,46,62,10
|
||||
CONTROL "All",IDC_ALLCHANNEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,23,10
|
||||
CONTROL "Channel Position",IDC_CHANNELPOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,23,69,10
|
||||
CONTROL "Channel Rotation",IDC_CHANNELROT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,34,71,10
|
||||
CONTROL "Channel Scale",IDC_CHANNELSCA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,46,62,10
|
||||
END
|
||||
|
||||
IDD_EXPORTSCENE DIALOG DISCARDABLE 0, 0, 171, 255
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
IDD_EXPORTSCENE DIALOG 0, 0, 171, 255
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Options"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,115,173,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,115,190,50,14
|
||||
CONTROL "Export Lighting",IDC_CHECKEXPORTLIGHTING,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,18,63,10
|
||||
CONTROL "Export Lighting",IDC_CHECKEXPORTLIGHTING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,18,63,10
|
||||
GROUPBOX "Light Method",IDC_STATIC,7,60,74,39,WS_GROUP
|
||||
CONTROL "Raytrace",IDC_RADIONORMALEXPORTLIGHTING,"Button",
|
||||
BS_AUTORADIOBUTTON,15,74,45,10
|
||||
CONTROL "Soft Shadow",IDC_RADIORADIOSITYEXPORTLIGHTING,"Button",
|
||||
BS_AUTORADIOBUTTON,15,84,57,10
|
||||
CONTROL "Raytrace",IDC_RADIONORMALEXPORTLIGHTING,"Button",BS_AUTORADIOBUTTON,15,74,45,10
|
||||
CONTROL "Soft Shadow",IDC_RADIORADIOSITYEXPORTLIGHTING,"Button",BS_AUTORADIOBUTTON,15,84,57,10
|
||||
EDITTEXT IDC_EDITEXPORTLIGHTING,7,42,137,14,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "...",IDC_BUTTONEXPORTLIGHTING,151,42,13,14
|
||||
LTEXT "Lumel Size in meter",IDC_STATIC,90,63,62,8
|
||||
EDITTEXT IDC_EDITLUMELSIZE,90,73,40,14,ES_AUTOHSCROLL
|
||||
GROUPBOX "OverSampling",IDC_STATIC,7,104,60,54,WS_GROUP
|
||||
CONTROL "None",IDC_RADIOSS1,"Button",BS_AUTORADIOBUTTON,15,113,
|
||||
33,10
|
||||
CONTROL "4x",IDC_RADIOSS2,"Button",BS_AUTORADIOBUTTON,15,124,23,
|
||||
10
|
||||
CONTROL "16x",IDC_RADIOSS3,"Button",BS_AUTORADIOBUTTON,15,135,27,
|
||||
10
|
||||
CONTROL "64x",IDC_RADIOSS4,"Button",BS_AUTORADIOBUTTON,15,146,27,
|
||||
10
|
||||
CONTROL "Shadow",IDC_SHADOW,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,81,18,42,10
|
||||
CONTROL "None",IDC_RADIOSS1,"Button",BS_AUTORADIOBUTTON,15,113,33,10
|
||||
CONTROL "4x",IDC_RADIOSS2,"Button",BS_AUTORADIOBUTTON,15,124,23,10
|
||||
CONTROL "16x",IDC_RADIOSS3,"Button",BS_AUTORADIOBUTTON,15,135,27,10
|
||||
CONTROL "64x",IDC_RADIOSS4,"Button",BS_AUTORADIOBUTTON,15,146,27,10
|
||||
CONTROL "Shadow",IDC_SHADOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,18,42,10
|
||||
CONTROL "Exclude non selected nodes from lighting",IDC_EXCLUDE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,145,10
|
||||
CONTROL "Show Lumel",IDC_SHOWLUMEL,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,91,100,55,10
|
||||
CONTROL "Export bg color",IDC_EXPORT_BG_COLOR,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,91,115,63,10
|
||||
CONTROL "Test Surface Lighting",IDC_TEST_SURFACE_LIGHT,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,15,173,84,10
|
||||
CONTROL "Show Lumel",IDC_SHOWLUMEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,100,55,10
|
||||
CONTROL "Export bg color",IDC_EXPORT_BG_COLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,91,115,63,10
|
||||
CONTROL "Test Surface Lighting",IDC_TEST_SURFACE_LIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,173,84,10
|
||||
EDITTEXT IDC_EDITCELLSIZE,15,198,65,15,ES_AUTOHSCROLL
|
||||
LTEXT "Surface CellSize (in meter)",IDC_STATIC,15,188,85,10
|
||||
EDITTEXT IDC_EDITCELLDELTAZ,15,228,65,15,ES_AUTOHSCROLL
|
||||
LTEXT "Surface DeltaZ (in meter)",IDC_STATIC2,15,218,85,10
|
||||
GROUPBOX "Surface Lighting",IDC_STATIC,7,163,98,85
|
||||
CONTROL "Output lightmap log",IDC_CHECKOUTPUTLIGHTMAPLOG,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,7,29,77,10
|
||||
CONTROL "Output lightmap log",IDC_CHECKOUTPUTLIGHTMAPLOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,29,77,10
|
||||
END
|
||||
|
||||
IDD_CALCULATING DIALOG DISCARDABLE 0, 0, 186, 181
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
IDD_CALCULATING DIALOG 0, 0, 186, 181
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
CAPTION "Calculating..."
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,
|
||||
7,41,172,14
|
||||
LTEXT "Please wait intializing...",IDC_STATICTIMELEFT,7,7,172,
|
||||
8
|
||||
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,7,41,172,14
|
||||
LTEXT "Please wait intializing...",IDC_STATICTIMELEFT,7,7,172,8
|
||||
PUSHBUTTON "Interrupt",IDC_BUTTONCANCEL,129,23,50,14,BS_NOTIFY
|
||||
LTEXT "Object progression",IDC_STATIC,7,28,79,8
|
||||
LTEXT "Lightmaps Information...",IDC_STATICINFO,7,60,172,114
|
||||
END
|
||||
|
||||
IDD_LOD DIALOG DISCARDABLE 0, 0, 360, 200
|
||||
STYLE WS_CHILD
|
||||
IDD_LOD DIALOG 0, 0, 360, 200
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "LOD Root Properties",IDC_STATIC,5,5,172,95
|
||||
LTEXT "List of lod mesh (ungrowing order):",IDC_STATIC,15,15,
|
||||
108,10,SS_CENTERIMAGE
|
||||
LISTBOX IDC_LIST1,15,25,111,70,LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "List of lod mesh (ungrowing order):",IDC_STATIC,15,15,108,10,SS_CENTERIMAGE
|
||||
LISTBOX IDC_LIST1,15,25,111,70,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Add..",IDC_ADD,131,25,40,14
|
||||
PUSHBUTTON "Remove",IDC_REMOVE,131,39,40,14
|
||||
PUSHBUTTON "Up",IDC_UP,131,54,40,14
|
||||
PUSHBUTTON "Down",IDC_DOWN,131,68,40,14
|
||||
GROUPBOX "LOD Properties",IDC_STATIC,5,105,172,50
|
||||
CONTROL "Blend in",IDC_BLEND_IN,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,15,121,40,10
|
||||
CONTROL "Blend out",IDC_BLEND_OUT,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,15,130,45,10
|
||||
CONTROL "Coarse mesh",IDC_COARSE_MESH,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,15,140,55,10
|
||||
CONTROL "Dynamic mesh",IDC_DYNAMIC_MESH,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,80,120,60,10
|
||||
CONTROL "Blend in",IDC_BLEND_IN,"Button",BS_AUTO3STATE | WS_TABSTOP,15,121,40,10
|
||||
CONTROL "Blend out",IDC_BLEND_OUT,"Button",BS_AUTO3STATE | WS_TABSTOP,15,130,45,10
|
||||
CONTROL "Coarse mesh",IDC_COARSE_MESH,"Button",BS_AUTO3STATE | WS_TABSTOP,15,140,55,10
|
||||
CONTROL "Dynamic mesh",IDC_DYNAMIC_MESH,"Button",BS_AUTO3STATE | WS_TABSTOP,80,120,60,10
|
||||
LTEXT "Dist Max:",IDC_STATIC,5,160,45,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_DIST_MAX,51,160,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Blend length:",IDC_STATIC,80,135,45,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_BLEND_LENGTH,125,135,45,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
EDITTEXT IDC_BLEND_LENGTH,125,135,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
GROUPBOX "MRM properties",IDC_STATIC,185,5,172,95
|
||||
CONTROL "Active MRM",IDC_ACTIVE_MRM,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,195,20,60,10
|
||||
CONTROL "Active MRM",IDC_ACTIVE_MRM,"Button",BS_AUTO3STATE | WS_TABSTOP,195,20,60,10
|
||||
LTEXT "Skin reduction",IDC_STATIC,195,35,50,10,SS_CENTERIMAGE
|
||||
CONTROL "Min",IDC_SKIN_REDUCTION_MIN,"Button",BS_AUTORADIOBUTTON,
|
||||
195,45,45,8
|
||||
CONTROL "Max",IDC_SKIN_REDUCTION_MAX,"Button",BS_AUTORADIOBUTTON,
|
||||
195,55,45,8
|
||||
CONTROL "Best",IDC_SKIN_REDUCTION_BEST,"Button",
|
||||
BS_AUTORADIOBUTTON,195,65,45,8
|
||||
CONTROL "Min",IDC_SKIN_REDUCTION_MIN,"Button",BS_AUTORADIOBUTTON,195,45,45,8
|
||||
CONTROL "Max",IDC_SKIN_REDUCTION_MAX,"Button",BS_AUTORADIOBUTTON,195,55,45,8
|
||||
CONTROL "Best",IDC_SKIN_REDUCTION_BEST,"Button",BS_AUTORADIOBUTTON,195,65,45,8
|
||||
LTEXT "Steps count:",IDC_STATIC,260,20,45,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_NB_LOD,305,20,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Divisor poly:",IDC_STATIC,260,35,45,13,SS_CENTERIMAGE
|
||||
|
@ -170,128 +138,91 @@ BEGIN
|
|||
LTEXT "Dist middle:",IDC_STATIC,260,65,45,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_DIST_MIDDLE,305,65,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "Dist coarsest:",IDC_STATIC,260,80,45,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_DIST_COARSEST,305,80,45,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
EDITTEXT IDC_DIST_COARSEST,305,80,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
GROUPBOX "LOD Bones",IDC_STATIC,185,105,170,45
|
||||
LTEXT "Disable Distance (0 means always activated) :",
|
||||
IDC_STATIC,190,120,160,10
|
||||
EDITTEXT IDC_BONE_LOD_DISTANCE,190,130,45,12,ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
CONTROL "Export as Lod character (.clod)",IDC_EXPORT_CLOD,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,190,160,150,10
|
||||
LTEXT "Disable Distance (0 means always activated) :",IDC_STATIC,190,120,160,10
|
||||
EDITTEXT IDC_BONE_LOD_DISTANCE,190,130,45,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
CONTROL "Export as Lod character (.clod)",IDC_EXPORT_CLOD,"Button",BS_AUTO3STATE | WS_TABSTOP,190,160,150,10
|
||||
END
|
||||
|
||||
IDD_ACCEL DIALOG DISCARDABLE 0, 0, 360, 200
|
||||
STYLE WS_CHILD
|
||||
IDD_ACCEL DIALOG 0, 0, 360, 200
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Not an accelerator",IDC_RADIOACCELNO,"Button",
|
||||
BS_AUTORADIOBUTTON,5,5,75,10
|
||||
CONTROL "Portal",IDC_RADIOACCELPORTAL,"Button",
|
||||
BS_AUTORADIOBUTTON,5,21,34,10
|
||||
CONTROL "Cluster",IDC_RADIOACCELCLUSTER,"Button",
|
||||
BS_AUTORADIOBUTTON,5,70,37,10
|
||||
CONTROL "Father visible",IDC_FATHER_VISIBLE,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,27,81,57,10
|
||||
CONTROL "Visible from father",IDC_VISIBLE_FROM_FATHER,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,27,92,71,10
|
||||
CONTROL "Dynamic Portal",IDC_DYNAMIC_PORTAL,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,27,44,63,10
|
||||
CONTROL "Clusterize",IDC_CLUSTERIZE,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,93,5,46,10
|
||||
COMBOBOX IDC_OCC_MODEL,209,30,123,134,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Not an accelerator",IDC_RADIOACCELNO,"Button",BS_AUTORADIOBUTTON,5,5,75,10
|
||||
CONTROL "Portal",IDC_RADIOACCELPORTAL,"Button",BS_AUTORADIOBUTTON,5,21,34,10
|
||||
CONTROL "Cluster",IDC_RADIOACCELCLUSTER,"Button",BS_AUTORADIOBUTTON,5,70,37,10
|
||||
CONTROL "Father visible",IDC_FATHER_VISIBLE,"Button",BS_AUTO3STATE | WS_TABSTOP,27,81,57,10
|
||||
CONTROL "Visible from father",IDC_VISIBLE_FROM_FATHER,"Button",BS_AUTO3STATE | WS_TABSTOP,27,92,71,10
|
||||
CONTROL "Dynamic Portal",IDC_DYNAMIC_PORTAL,"Button",BS_AUTO3STATE | WS_TABSTOP,27,44,63,10
|
||||
CONTROL "Clusterize",IDC_CLUSTERIZE,"Button",BS_AUTO3STATE | WS_TABSTOP,93,5,46,10
|
||||
COMBOBOX IDC_OCC_MODEL,209,30,123,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
RTEXT "Occlusion model",IDC_STATIC,134,30,68,12,SS_CENTERIMAGE
|
||||
COMBOBOX IDC_OPEN_OCC_MODEL,209,44,123,116,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
RTEXT "Open portal occlusion model",IDC_STATIC,112,44,89,10,
|
||||
SS_CENTERIMAGE
|
||||
COMBOBOX IDC_OPEN_OCC_MODEL,209,44,123,116,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
RTEXT "Open portal occlusion model",IDC_STATIC,112,44,89,10,SS_CENTERIMAGE
|
||||
GROUPBOX "Audio properties",IDC_STATIC,105,19,237,141
|
||||
RTEXT "Sound group",IDC_STATIC,111,86,90,14
|
||||
COMBOBOX IDC_ENV_FX,209,106,123,87,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
COMBOBOX IDC_ENV_FX,209,106,123,87,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
RTEXT "Environment FX",IDC_STATIC,112,106,89,10,SS_CENTERIMAGE
|
||||
COMBOBOX IDC_SOUND_GROUP,209,86,123,101,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Father audible",IDC_FATHER_AUDIBLE,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,210,135,61,10
|
||||
CONTROL "Audible from father",IDC_AUDIBLE_FROM_FATHER,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,210,145,81,10
|
||||
CONTROL "Audible like visible",IDC_AUDIBLE_LIKE_VISIBLE,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,210,125,73,10
|
||||
COMBOBOX IDC_SOUND_GROUP,209,86,123,101,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Father audible",IDC_FATHER_AUDIBLE,"Button",BS_AUTO3STATE | WS_TABSTOP,210,135,61,10
|
||||
CONTROL "Audible from father",IDC_AUDIBLE_FROM_FATHER,"Button",BS_AUTO3STATE | WS_TABSTOP,210,145,81,10
|
||||
CONTROL "Audible like visible",IDC_AUDIBLE_LIKE_VISIBLE,"Button",BS_AUTO3STATE | WS_TABSTOP,210,125,73,10
|
||||
END
|
||||
|
||||
IDD_LIGHTMAP DIALOG DISCARDABLE 0, 0, 360, 211
|
||||
STYLE WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
IDD_LIGHTMAP DIALOGEX 0, 0, 360, 211
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x0
|
||||
BEGIN
|
||||
GROUPBOX "Properties for objects with lightmaps",IDC_STATIC,5,5,
|
||||
150,70
|
||||
LTEXT "Lumel Size Multiplier",IDC_STATIC,10,15,64,13,
|
||||
SS_CENTERIMAGE
|
||||
GROUPBOX "Properties for objects with lightmaps",IDC_STATIC,5,5,150,70
|
||||
LTEXT "Lumel Size Multiplier",IDC_STATIC,10,15,64,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_LUMELSIZEMUL,96,15,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Soft Shadow Radius",IDC_STATIC,10,35,66,13,
|
||||
SS_CENTERIMAGE
|
||||
LTEXT "Soft Shadow Radius",IDC_STATIC,10,35,66,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_SOFTSHADOW_RADIUS,96,35,40,14,ES_AUTOHSCROLL
|
||||
LTEXT "Soft Shadow Cone Length",IDC_STATIC,10,55,84,13,
|
||||
SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_SOFTSHADOW_CONELENGTH,96,55,40,14,
|
||||
ES_AUTOHSCROLL
|
||||
GROUPBOX "Properties for objects without lightmaps",IDC_STATIC,5,
|
||||
80,150,60
|
||||
CONTROL "If checked, use per vertex lighting attenuation else use global lighting attenuation for the object. Doesn't work with per pixel lighting shader.",
|
||||
IDC_USE_LIGHT_LOCAL_ATTENUATION,"Button",BS_AUTO3STATE |
|
||||
BS_TOP | BS_MULTILINE | WS_TABSTOP,15,95,120,41
|
||||
LTEXT "Soft Shadow Cone Length",IDC_STATIC,10,55,84,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_SOFTSHADOW_CONELENGTH,96,55,40,14,ES_AUTOHSCROLL
|
||||
GROUPBOX "Properties for objects without lightmaps",IDC_STATIC,5,80,150,60
|
||||
CONTROL "If checked, use per vertex lighting attenuation else use global lighting attenuation for the object. Doesn't work with per pixel lighting shader.",IDC_USE_LIGHT_LOCAL_ATTENUATION,
|
||||
"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,18,96,120,41
|
||||
GROUPBOX "Properties for lights",IDC_STATIC,160,5,185,200
|
||||
CONTROL "RealTime Light. If set, this light will light scene objects.",
|
||||
IDC_EXPORT_REALTIME_LIGHT,"Button",BS_AUTO3STATE |
|
||||
BS_TOP | BS_MULTILINE | WS_TABSTOP,170,15,165,20
|
||||
CONTROL "RealTime Sun Light. If set, this DIRECTIONNAL light will be used as sun light to light scene objects.",
|
||||
IDC_EXPORT_AS_SUN_LIGHT,"Button",BS_AUTO3STATE | BS_TOP |
|
||||
BS_MULTILINE | WS_TABSTOP,170,34,170,25
|
||||
CONTROL "LightMap Light. If set, this light will be used to compute the lightmaps of the project objects.",
|
||||
IDC_EXPORT_LIGHTMAP_LIGHT,"Button",BS_AUTO3STATE |
|
||||
BS_TOP | BS_MULTILINE | WS_TABSTOP,170,60,170,20
|
||||
LTEXT "LightMap Animation Name. This is the name of the animation used to flick the light color.",
|
||||
IDC_STATIC,170,135,170,20
|
||||
EDITTEXT IDC_EXPORT_LIGHTMAP_NAME,170,155,85,15,ES_AUTOHSCROLL
|
||||
CONTROL "RealTime Light. If set, this light will light scene objects.",IDC_EXPORT_REALTIME_LIGHT,
|
||||
"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,174,18,168,18
|
||||
CONTROL "RealTime Sun Light. If set, this DIRECTIONNAL light will be used as sun light to light scene objects.",IDC_EXPORT_AS_SUN_LIGHT,
|
||||
"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,174,36,168,24
|
||||
CONTROL "LightMap Light. If set, this light will be used to compute the lightmaps of the project objects.",IDC_EXPORT_LIGHTMAP_LIGHT,
|
||||
"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,174,60,168,18
|
||||
LTEXT "LightMap Animation Name. This is the name of the animation used to flick the light color.",IDC_STATIC,174,138,170,20
|
||||
EDITTEXT IDC_EXPORT_LIGHTMAP_NAME,174,156,85,15,ES_AUTOHSCROLL
|
||||
CONTROL "Animated Dynamic Light",IDC_EXPORT_LIGHTMAP_ANIMATED,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,170,175,125,10
|
||||
CONTROL "Always group",IDC_LIGHT_GROUP_ALWAYS,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,170,80,150,15
|
||||
CONTROL "Sun group",IDC_LIGHT_GROUP_DAY,"Button",
|
||||
BS_AUTORADIOBUTTON,170,95,150,15
|
||||
CONTROL "Night group",IDC_LIGHT_GROUP_NIGHT,"Button",
|
||||
BS_AUTORADIOBUTTON,170,110,150,15
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,174,177,125,10
|
||||
CONTROL "Always on lightgroup (0)",IDC_LIGHT_GROUP_ALWAYS,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,174,90,156,12
|
||||
CONTROL "Day cycle (3)",IDC_LIGHT_GROUP_DAY_CYCLE,"Button",BS_AUTORADIOBUTTON,174,102,66,12
|
||||
CONTROL "Night cycle (2)",IDC_LIGHT_GROUP_NIGHT_CYCLE,"Button",BS_AUTORADIOBUTTON,174,114,66,12
|
||||
GROUPBOX "Misc",IDC_STATIC,5,145,150,60
|
||||
CONTROL "Don't cast shadow for Interior. Known as Trick of the ""Matis serre""",
|
||||
IDC_LIGHT_DONT_CAST_SHADOW_INTERIOR,"Button",
|
||||
BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,15,
|
||||
155,135,20
|
||||
CONTROL "Don't cast shadow for Exterior. Known as Trick of the ""Matis serre""",
|
||||
IDC_LIGHT_DONT_CAST_SHADOW_EXTERIOR,"Button",
|
||||
BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,15,
|
||||
175,135,20
|
||||
CONTROL "Add Realtime Ambient Light With sun Ambient",
|
||||
IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,170,190,160,10
|
||||
CONTROL "Don't cast shadow for Interior. Known as Trick of the ""Matis serre""",IDC_LIGHT_DONT_CAST_SHADOW_INTERIOR,
|
||||
"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,15,155,135,20
|
||||
CONTROL "Don't cast shadow for Exterior. Known as Trick of the ""Matis serre""",IDC_LIGHT_DONT_CAST_SHADOW_EXTERIOR,
|
||||
"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,15,175,135,20
|
||||
CONTROL "Add Realtime Ambient Light With sun Ambient",IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,174,192,160,10
|
||||
CONTROL "Landscape Diffuse (Sun) (1)",IDC_LIGHT_GROUP_LANDSCAPE_DIFFUSE,
|
||||
"Button",BS_AUTORADIOBUTTON,240,102,102,12
|
||||
CONTROL "Landscape Ambient (4)",IDC_LIGHT_GROUP_LANDSCAPE_AMBIENT,
|
||||
"Button",BS_AUTORADIOBUTTON,240,114,102,12
|
||||
END
|
||||
|
||||
IDD_MISC DIALOG DISCARDABLE 0, 0, 360, 221
|
||||
STYLE WS_CHILD
|
||||
IDD_MISC DIALOG 0, 0, 360, 221
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Floating Object",IDC_FLOATING_OBJECT,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,5,5,65,12
|
||||
CONTROL "Floating Object",IDC_FLOATING_OBJECT,"Button",BS_AUTO3STATE | WS_TABSTOP,5,5,65,12
|
||||
GROUPBOX "Ligoscape",IDC_STATIC,5,100,120,45
|
||||
CONTROL "Symmetry",IDC_LIGO_SYMMETRY,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,11,110,44,12
|
||||
CONTROL "Symmetry",IDC_LIGO_SYMMETRY,"Button",BS_AUTO3STATE | WS_TABSTOP,11,110,44,12
|
||||
LTEXT "Rotation:",IDC_STATIC,11,125,30,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_LIGO_ROTATE,60,126,57,14,ES_AUTOHSCROLL
|
||||
LTEXT "Weight (0~1):",IDC_STATIC,10,75,43,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_SWT_WEIGHT,60,75,60,14,ES_AUTOHSCROLL
|
||||
CONTROL "Enable",IDC_SWT,"Button",BS_AUTO3STATE | WS_TABSTOP,10,
|
||||
60,40,10
|
||||
CONTROL "Enable",IDC_SWT,"Button",BS_AUTO3STATE | WS_TABSTOP,10,60,40,10
|
||||
GROUPBOX "Skeleton template weight",IDC_STATIC,5,50,120,45
|
||||
GROUPBOX "Radial Normals",IDC_STATIC,135,5,130,105
|
||||
LTEXT "Smooth group 29",IDC_STATIC,140,45,55,13,SS_CENTERIMAGE
|
||||
|
@ -302,144 +233,104 @@ BEGIN
|
|||
EDITTEXT IDC_RADIAL_NORMAL_31,200,75,57,14,ES_AUTOHSCROLL
|
||||
LTEXT "Smooth group 32",IDC_STATIC,140,90,55,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_RADIAL_NORMAL_32,200,90,57,14,ES_AUTOHSCROLL
|
||||
LTEXT "For the 4 last smoothing group, choose the node you want to use the position to compute radial normals from it.",
|
||||
IDC_STATIC,140,15,120,25
|
||||
LTEXT "For the 4 last smoothing group, choose the node you want to use the position to compute radial normals from it.",IDC_STATIC,140,15,120,25
|
||||
GROUPBOX "Mesh interfaces",IDC_STATIC,134,110,219,56
|
||||
LTEXT "Interface .max file",IDC_STATIC,141,120,61,15,
|
||||
SS_CENTERIMAGE
|
||||
LTEXT "Interface .max file",IDC_STATIC,141,120,61,15,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_INTERFACE_FILE,221,120,110,14,ES_AUTOHSCROLL
|
||||
LTEXT "Interface weld threshold",IDC_STATIC,141,137,77,15,
|
||||
SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_INTERFACE_THRESHOLD,221,137,110,14,
|
||||
ES_AUTOHSCROLL
|
||||
LTEXT "Interface weld threshold",IDC_STATIC,141,137,77,15,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_INTERFACE_THRESHOLD,221,137,110,14,ES_AUTOHSCROLL
|
||||
GROUPBOX "Bone Scale",IDC_STATIC,5,150,120,60
|
||||
CONTROL "Enable",IDC_EXPORT_BONE_SCALE,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,10,160,38,10
|
||||
LTEXT "Bone Reference Name extension:",IDC_STATIC,10,175,110,
|
||||
13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EXPORT_BONE_SCALE_NAME_EXT,10,190,75,14,
|
||||
ES_AUTOHSCROLL
|
||||
CONTROL "Get interface normals from scene objects",
|
||||
IDC_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,142,151,145,15
|
||||
CONTROL "Enable",IDC_EXPORT_BONE_SCALE,"Button",BS_AUTO3STATE | WS_TABSTOP,10,160,38,10
|
||||
LTEXT "Bone Reference Name extension:",IDC_STATIC,10,175,110,13,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EXPORT_BONE_SCALE_NAME_EXT,10,190,75,14,ES_AUTOHSCROLL
|
||||
CONTROL "Get interface normals from scene objects",IDC_GET_INTERFACE_NORMAL_FROM_SCENE_OBJECTS,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,151,145,15
|
||||
GROUPBOX "Remanence",IDC_STATIC,134,169,219,45
|
||||
CONTROL "Use remanence",IDC_USE_REMANENCE,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,137,178,66,9
|
||||
CONTROL "Use remanence",IDC_USE_REMANENCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,137,178,66,9
|
||||
LTEXT "Slice number :",IDC_STATIC,138,191,47,10,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_REMANENCE_SLICE_NUMBER,186,189,19,14,ES_AUTOHSCROLL
|
||||
LTEXT "Sampling period :",IDC_STATIC,210,192,54,10,
|
||||
SS_CENTERIMAGE
|
||||
EDITTEXT IDC_REMANENCE_SAMPLING_PERIOD,266,190,20,14,
|
||||
ES_AUTOHSCROLL
|
||||
CONTROL "Shift texture at start of animation",
|
||||
IDC_REMANENCE_SHIFTING_TEXTURE,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,207,178,116,9
|
||||
LTEXT "Sampling period :",IDC_STATIC,210,192,54,10,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_REMANENCE_SAMPLING_PERIOD,266,190,20,14,ES_AUTOHSCROLL
|
||||
CONTROL "Shift texture at start of animation",IDC_REMANENCE_SHIFTING_TEXTURE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,178,116,9
|
||||
LTEXT "Rollup ratio :",IDC_ROLLUP_RATIO,290,192,41,8
|
||||
EDITTEXT IDC_REMANENCE_ROLLUP_RATIO,332,190,16,14,ES_AUTOHSCROLL
|
||||
END
|
||||
|
||||
IDD_VEGETABLE DIALOG DISCARDABLE 0, 0, 360, 200
|
||||
STYLE WS_CHILD
|
||||
IDD_VEGETABLE DIALOG 0, 0, 360, 200
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Vegetable",IDC_VEGETABLE,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,5,5,50,12
|
||||
CONTROL "Alpha Blend ON (double sided)",
|
||||
IDC_VEGETABLE_ALPHA_BLEND_ON,"Button",BS_AUTORADIOBUTTON |
|
||||
WS_GROUP,21,30,112,15
|
||||
CONTROL "Alpha Blend OFF",IDC_VEGETABLE_ALPHA_BLEND_OFF,"Button",
|
||||
BS_AUTORADIOBUTTON,20,74,85,15
|
||||
CONTROL "Lighted - precomputed",
|
||||
IDC_VEGETABLE_AB_ON_LIGHTED_PRECOMPUTED,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_GROUP,50,45,85,15
|
||||
CONTROL "Unlighted",IDC_VEGETABLE_AB_ON_UNLIGHTED,"Button",
|
||||
BS_AUTORADIOBUTTON,50,61,90,15
|
||||
CONTROL "Lighted - precomputed",
|
||||
IDC_VEGETABLE_AB_OFF_LIGHTED_PRECOMPUTED,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_GROUP,50,90,85,15
|
||||
CONTROL "Vegetable",IDC_VEGETABLE,"Button",BS_AUTO3STATE | WS_TABSTOP,5,5,50,12
|
||||
CONTROL "Alpha Blend ON (double sided)",IDC_VEGETABLE_ALPHA_BLEND_ON,
|
||||
"Button",BS_AUTORADIOBUTTON | WS_GROUP,21,30,112,15
|
||||
CONTROL "Alpha Blend OFF",IDC_VEGETABLE_ALPHA_BLEND_OFF,"Button",BS_AUTORADIOBUTTON,20,74,85,15
|
||||
CONTROL "Lighted - precomputed",IDC_VEGETABLE_AB_ON_LIGHTED_PRECOMPUTED,
|
||||
"Button",BS_AUTORADIOBUTTON | WS_GROUP,50,45,85,15
|
||||
CONTROL "Unlighted",IDC_VEGETABLE_AB_ON_UNLIGHTED,"Button",BS_AUTORADIOBUTTON,50,61,90,15
|
||||
CONTROL "Lighted - precomputed",IDC_VEGETABLE_AB_OFF_LIGHTED_PRECOMPUTED,
|
||||
"Button",BS_AUTORADIOBUTTON | WS_GROUP,50,90,85,15
|
||||
CONTROL "Lighted - dynamic",IDC_VEGETABLE_AB_OFF_LIGHTED_DYNAMIC,
|
||||
"Button",BS_AUTORADIOBUTTON,50,105,90,15
|
||||
CONTROL "Unighted",IDC_VEGETABLE_AB_OFF_UNLIGHTED,"Button",
|
||||
BS_AUTORADIOBUTTON,50,120,85,15
|
||||
CONTROL "Double sided",IDC_VEGETABLE_AB_OFF_DOUBLE_SIDED,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,50,135,85,15
|
||||
CONTROL "Unighted",IDC_VEGETABLE_AB_OFF_UNLIGHTED,"Button",BS_AUTORADIOBUTTON,50,120,85,15
|
||||
CONTROL "Double sided",IDC_VEGETABLE_AB_OFF_DOUBLE_SIDED,"Button",BS_AUTO3STATE | WS_TABSTOP,50,135,85,15
|
||||
GROUPBOX "Alpha mode",IDC_STATIC,15,20,135,155
|
||||
GROUPBOX "Bend center",IDC_STATIC,160,20,105,45
|
||||
CONTROL "Center Null",IDC_CENTER_NULL,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_GROUP,166,30,50,15
|
||||
CONTROL "Center Z",IDC_CENTER_Z,"Button",BS_AUTORADIOBUTTON,166,
|
||||
45,50,15
|
||||
CONTROL "Center Null",IDC_CENTER_NULL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,166,30,50,15
|
||||
CONTROL "Center Z",IDC_CENTER_Z,"Button",BS_AUTORADIOBUTTON,166,45,50,15
|
||||
LTEXT "Bend Factor (0 - 1)",IDC_STATIC,160,75,60,8
|
||||
EDITTEXT IDC_VEGETABLE_BEND_FACTOR,226,70,40,14,ES_AUTOHSCROLL
|
||||
CONTROL "Force Best Sided Lighting",
|
||||
IDC_VEGETABLE_FORCE_BEST_SIDED_LIGHTING,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,20,155,120,15
|
||||
CONTROL "Force Best Sided Lighting",IDC_VEGETABLE_FORCE_BEST_SIDED_LIGHTING,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,20,155,120,15
|
||||
END
|
||||
|
||||
IDD_INSTANCE DIALOG DISCARDABLE 0, 0, 360, 226
|
||||
STYLE WS_CHILD
|
||||
IDD_INSTANCE DIALOG 0, 0, 360, 226
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Instance shape",IDC_STATIC,5,5,51,15,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_INSTANCE_GROUP_SHAPE,80,5,110,14,ES_AUTOHSCROLL
|
||||
LTEXT "Name of the instancied object. (ex: ""table.shape"").",
|
||||
IDC_STATIC,195,5,160,8,SS_CENTERIMAGE
|
||||
LTEXT "Name of the instancied object. (ex: ""table.shape"").",IDC_STATIC,195,5,160,8,SS_CENTERIMAGE
|
||||
LTEXT "Instance name",IDC_STATIC,5,25,49,15,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_INSTANCE_NAME,80,25,110,14,ES_AUTOHSCROLL
|
||||
LTEXT "String associed with the instance in the instance group file. Enter ... to erase all.",
|
||||
IDC_STATIC,195,26,160,16
|
||||
LTEXT "Instance group name",IDC_STATIC,5,45,70,15,
|
||||
SS_CENTERIMAGE
|
||||
LTEXT "String associed with the instance in the instance group file. Enter ... to erase all.",IDC_STATIC,195,26,160,16
|
||||
LTEXT "Instance group name",IDC_STATIC,5,45,70,15,SS_CENTERIMAGE
|
||||
EDITTEXT IDC_EDIT_INSTANCE_GROUP_NAME,80,45,110,14,ES_AUTOHSCROLL
|
||||
LTEXT "Name of the instance group where this instance will be inserted. Enter ... to erase all",
|
||||
IDC_STATIC,195,45,160,15
|
||||
CONTROL "Don't add to scene. If checked, this instance will not be added in the scene.",
|
||||
IDC_DONT_ADD_TO_SCENE,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,5,71,255,10
|
||||
CONTROL "Don't export the shape. If checked, no shape file will be exported from this object.",
|
||||
IDC_DONT_EXPORT,"Button",BS_AUTO3STATE | WS_TABSTOP,5,86,
|
||||
271,10
|
||||
LTEXT "Name of the instance group where this instance will be inserted. Enter ... to erase all",IDC_STATIC,195,45,160,15
|
||||
CONTROL "Don't add to scene. If checked, this instance will not be added in the scene.",IDC_DONT_ADD_TO_SCENE,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,5,71,255,10
|
||||
CONTROL "Don't export the shape. If checked, no shape file will be exported from this object.",IDC_DONT_EXPORT,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,5,86,271,10
|
||||
GROUPBOX "Collision",IDC_STATIC,5,180,170,40
|
||||
CONTROL "Collision Mesh",IDC_CHECK_COLLISION,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,15,191,110,10
|
||||
CONTROL "Collision Mesh",IDC_CHECK_COLLISION,"Button",BS_AUTO3STATE | WS_TABSTOP,15,191,110,10
|
||||
CONTROL "Collision Mesh Exterior",IDC_CHECK_COLLISION_EXTERIOR,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,15,204,110,10
|
||||
LTEXT "Enter ... to erase all.",IDC_STATIC,195,15,108,10
|
||||
GROUPBOX "Camera Collision",IDC_STATIC,5,105,270,70
|
||||
CONTROL "Automatic (collision only if mesh is lightmapped)",
|
||||
IDC_CAMERA_COL_RADIO1,"Button",BS_AUTORADIOBUTTON,15,115,
|
||||
230,10
|
||||
CONTROL "Disable (don't collision with camera)",
|
||||
IDC_CAMERA_COL_RADIO2,"Button",BS_AUTORADIOBUTTON,15,130,
|
||||
230,10
|
||||
CONTROL "Forced (collision with camera, even if not lightmapped)",
|
||||
IDC_CAMERA_COL_RADIO3,"Button",BS_AUTORADIOBUTTON,15,145,
|
||||
230,10
|
||||
CONTROL "Camera collision only (mesh not displayed)",
|
||||
IDC_CAMERA_COL_RADIO4,"Button",BS_AUTORADIOBUTTON,15,160,
|
||||
230,10
|
||||
CONTROL "Automatic (collision only if mesh is lightmapped)",IDC_CAMERA_COL_RADIO1,
|
||||
"Button",BS_AUTORADIOBUTTON,15,115,230,10
|
||||
CONTROL "Disable (don't collision with camera)",IDC_CAMERA_COL_RADIO2,
|
||||
"Button",BS_AUTORADIOBUTTON,15,130,230,10
|
||||
CONTROL "Forced (collision with camera, even if not lightmapped)",IDC_CAMERA_COL_RADIO3,
|
||||
"Button",BS_AUTORADIOBUTTON,15,145,230,10
|
||||
CONTROL "Camera collision only (mesh not displayed)",IDC_CAMERA_COL_RADIO4,
|
||||
"Button",BS_AUTORADIOBUTTON,15,160,230,10
|
||||
END
|
||||
|
||||
IDD_ANIM DIALOG DISCARDABLE 0, 0, 360, 221
|
||||
STYLE WS_CHILD
|
||||
IDD_ANIM DIALOG 0, 0, 360, 221
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Export note track",IDC_EXPORT_NOTE_TRACK,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,5,50,75,10
|
||||
CONTROL "Export animated materials",
|
||||
IDC_EXPORT_ANIMATED_MATERIALS,"Button",BS_AUTO3STATE |
|
||||
WS_TABSTOP,5,35,98,10
|
||||
CONTROL "Export node animation",IDC_EXPORT_NODE_ANIMATION,"Button",
|
||||
BS_AUTO3STATE | WS_TABSTOP,5,5,98,10
|
||||
CONTROL "Prefixe tracks with node name (Instance name or, if emtpy, node name)",
|
||||
IDC_EXPORT_ANIMATION_PREFIXE_NAME,"Button",BS_AUTO3STATE |
|
||||
BS_MULTILINE | WS_TABSTOP,5,20,245,10
|
||||
CONTROL "Allow automatic animation. If the shape is ""obj.shape"", then it will bind ""obj.anim"" automatically.",
|
||||
IDC_AUTOMATIC_ANIM,"Button",BS_AUTO3STATE | BS_MULTILINE |
|
||||
WS_TABSTOP,5,65,315,10
|
||||
CONTROL "Export SSS track (Skeleton Spawn Script)",
|
||||
IDC_EXPORT_SSS_TRACK,"Button",BS_AUTO3STATE | WS_TABSTOP,
|
||||
5,80,310,10
|
||||
CONTROL "Export note track",IDC_EXPORT_NOTE_TRACK,"Button",BS_AUTO3STATE | WS_TABSTOP,5,50,75,10
|
||||
CONTROL "Export animated materials",IDC_EXPORT_ANIMATED_MATERIALS,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,5,35,98,10
|
||||
CONTROL "Export node animation",IDC_EXPORT_NODE_ANIMATION,"Button",BS_AUTO3STATE | WS_TABSTOP,5,5,98,10
|
||||
CONTROL "Prefixe tracks with node name (Instance name or, if emtpy, node name)",IDC_EXPORT_ANIMATION_PREFIXE_NAME,
|
||||
"Button",BS_AUTO3STATE | BS_MULTILINE | WS_TABSTOP,5,20,245,10
|
||||
CONTROL "Allow automatic animation. If the shape is ""obj.shape"", then it will bind ""obj.anim"" automatically.",IDC_AUTOMATIC_ANIM,
|
||||
"Button",BS_AUTO3STATE | BS_MULTILINE | WS_TABSTOP,5,65,315,10
|
||||
CONTROL "Export SSS track (Skeleton Spawn Script)",IDC_EXPORT_SSS_TRACK,
|
||||
"Button",BS_AUTO3STATE | WS_TABSTOP,5,80,310,10
|
||||
END
|
||||
|
||||
|
||||
|
@ -449,7 +340,7 @@ END
|
|||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_PANEL, DIALOG
|
||||
BEGIN
|
||||
|
@ -548,18 +439,18 @@ END
|
|||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
|
@ -568,7 +459,6 @@ END
|
|||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
|
@ -591,17 +481,13 @@ BEGIN
|
|||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample\0"
|
||||
VALUE "CompanyName", "Ryzom Core\0"
|
||||
VALUE "Comments", "Based on Kinetix 3D Studio Max 3.0 plugin sample"
|
||||
VALUE "CompanyName", "Ryzom Core"
|
||||
VALUE "FileVersion", "0.12.0\0"
|
||||
VALUE "InternalName", "CNelExport\0"
|
||||
VALUE "LegalCopyright", "\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "CNelExport.dlu\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "Ryzom Core\0"
|
||||
VALUE "InternalName", "CNelExport"
|
||||
VALUE "OriginalFilename", "CNelExport.dlu"
|
||||
VALUE "ProductName", "Ryzom Core"
|
||||
VALUE "ProductVersion", "0.12.0\0"
|
||||
VALUE "SpecialBuild", "\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
@ -610,15 +496,13 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_LIBDESCRIPTION "Geometry Export/View"
|
||||
IDS_CATEGORY "Nel Tools"
|
||||
|
@ -645,8 +529,8 @@ LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
|
|||
// Dialog
|
||||
//
|
||||
|
||||
IDD_NODE_PROPERTIES_PANEL DIALOG DISCARDABLE 0, 0, 384, 290
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
IDD_NODE_PROPERTIES_PANEL DIALOG 0, 0, 384, 290
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Node properties"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
|
@ -655,76 +539,57 @@ BEGIN
|
|||
PUSHBUTTON "Cancel",IDCANCEL,327,267,50,15
|
||||
END
|
||||
|
||||
IDD_VERTEX_PROGRAM DIALOG DISCARDABLE 0, 0, 361, 211
|
||||
STYLE WS_CHILD
|
||||
IDD_VERTEX_PROGRAM DIALOG 0, 0, 361, 211
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "VertexProgram :",IDC_VP_TEXT,5,5,70,10
|
||||
COMBOBOX IDC_COMBO_VP,80,0,105,55,CBS_DROPDOWNLIST | WS_TABSTOP
|
||||
LTEXT "Can't use vp (needed by material shader)",IDC_BYPASS_VP,
|
||||
196,3,132,9
|
||||
LTEXT "Can't use vp (needed by material shader)",IDC_BYPASS_VP,196,3,132,9
|
||||
END
|
||||
|
||||
IDD_VP_WINDTREE DIALOG DISCARDABLE 0, 0, 356, 191
|
||||
STYLE WS_CHILD
|
||||
IDD_VP_WINDTREE DIALOG 0, 0, 356, 191
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CONTROL "Use VP SpecularLighting",IDC_CHECK_VP_SPECLIGHT,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,10,5,105,10
|
||||
CONTROL "Use VP SpecularLighting",IDC_CHECK_VP_SPECLIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,5,105,10
|
||||
LTEXT "Frequency Scale :",IDC_STATIC,120,5,60,10
|
||||
LTEXT "Distance Scale :",IDC_STATIC,245,5,60,10
|
||||
EDITTEXT IDC_EDIT_VPWT_FREQ_SCALE,190,5,35,12,ES_MULTILINE |
|
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
EDITTEXT IDC_EDIT_VPWT_DIST_SCALE,305,5,35,12,ES_MULTILINE |
|
||||
ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
EDITTEXT IDC_EDIT_VPWT_FREQ_SCALE,190,5,35,12,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
EDITTEXT IDC_EDIT_VPWT_DIST_SCALE,305,5,35,12,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
GROUPBOX "Level 0 (eg: Tree Trunk)",IDC_STATIC,0,20,355,50
|
||||
GROUPBOX "Level 1 (eg: branch)",IDC_STATIC,0,75,355,55
|
||||
GROUPBOX "Level 2 (eg: leaves)",IDC_STATIC,0,135,355,55
|
||||
LTEXT "Frequency :",IDC_STATIC,5,31,50,10
|
||||
LTEXT "DistanceXY :",IDC_STATIC,5,41,50,10
|
||||
LTEXT "Distance Bias :",IDC_STATIC,5,51,50,10
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQ_L0,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,30,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTXY_L0,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,41,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQ_L0,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,30,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTXY_L0,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,41,100,11
|
||||
LTEXT "FreqWindDep :",IDC_STATIC,180,31,50,10
|
||||
LTEXT "DistanceZ :",IDC_STATIC,180,40,50,10
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQWD_L0,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,30,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTZ_L0,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,40,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_BIAS_L0,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,51,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQWD_L0,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,30,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTZ_L0,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,40,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_BIAS_L0,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,51,100,11
|
||||
LTEXT "Frequency :",IDC_STATIC,5,90,50,10
|
||||
LTEXT "DistanceXY :",IDC_STATIC,5,101,50,10
|
||||
LTEXT "Distance Bias :",IDC_STATIC,5,112,50,10
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQ_L1,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,91,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTXY_L1,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,101,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQ_L1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,91,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTXY_L1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,101,100,11
|
||||
LTEXT "FreqWindDep :",IDC_STATIC,180,92,50,10
|
||||
LTEXT "DistanceZ :",IDC_STATIC,180,100,50,10
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQWD_L1,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,90,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTZ_L1,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,100,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_BIAS_L1,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,112,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQWD_L1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,90,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTZ_L1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,100,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_BIAS_L1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,112,100,11
|
||||
LTEXT "Frequency :",IDC_STATIC,5,150,50,10
|
||||
LTEXT "DistanceXY :",IDC_STATIC,5,160,50,10
|
||||
LTEXT "Distance Bias :",IDC_STATIC,5,170,50,10
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQ_L2,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,150,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTXY_L2,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,160,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQ_L2,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,150,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTXY_L2,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,160,100,11
|
||||
LTEXT "FreqWindDep :",IDC_STATIC,180,153,50,10
|
||||
LTEXT "DistanceZ :",IDC_STATIC,180,162,50,10
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQWD_L2,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,151,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTZ_L2,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,162,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_BIAS_L2,"msctls_trackbar32",
|
||||
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,170,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_FREQWD_L2,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,151,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_DISTZ_L2,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,230,162,100,11
|
||||
CONTROL "Slider1",IDC_SLIDER_VPWT_BIAS_L2,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,55,170,100,11
|
||||
LTEXT "-0.12",IDC_STATIC_VPWT_FREQ_L0,155,31,20,10,SS_SUNKEN
|
||||
LTEXT "0.12",IDC_STATIC_VPWT_DISTXY_L0,155,41,20,10,SS_SUNKEN
|
||||
LTEXT "0.12",IDC_STATIC_VPWT_BIAS_L0,155,51,20,10,SS_SUNKEN
|
||||
|
@ -748,8 +613,8 @@ BEGIN
|
|||
LTEXT "+2",IDC_STATIC,145,180,10,8
|
||||
END
|
||||
|
||||
IDD_LIGHTMAP2 DIALOG DISCARDABLE 0, 0, 361, 211
|
||||
STYLE WS_CHILD
|
||||
IDD_LIGHTMAP2 DIALOG 0, 0, 361, 211
|
||||
STYLE DS_SETFONT | WS_CHILD
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
GROUPBOX "LMC: 8Bits Lightmap compression",IDC_STATIC,5,5,195,190
|
||||
|
@ -757,67 +622,45 @@ BEGIN
|
|||
LTEXT "Sun Group",IDC_LMC_STATIC3,10,115,40,10
|
||||
LTEXT "Night Group",IDC_LMC_STATIC6,10,155,45,10
|
||||
LTEXT "Ambient:",IDC_LMC_STATIC1,10,90,45,10
|
||||
CONTROL "Custom1",IDC_LM_ALWAYS_AMBIENT,"ColorSwatch",WS_TABSTOP,
|
||||
65,85,30,15
|
||||
CONTROL "Custom1",IDC_LM_ALWAYS_AMBIENT,"ColorSwatch",WS_TABSTOP,65,85,30,15
|
||||
LTEXT "Diffuse:",IDC_LMC_STATIC2,105,90,45,10
|
||||
CONTROL "Custom1",IDC_LM_ALWAYS_DIFFUSE,"ColorSwatch",WS_TABSTOP,
|
||||
160,85,30,15
|
||||
CONTROL "Custom1",IDC_LM_ALWAYS_DIFFUSE,"ColorSwatch",WS_TABSTOP,160,85,30,15
|
||||
LTEXT "Ambient:",IDC_LMC_STATIC4,10,130,45,10
|
||||
CONTROL "Custom1",IDC_LM_DAY_AMBIENT,"ColorSwatch",WS_TABSTOP,65,
|
||||
125,30,15
|
||||
CONTROL "Custom1",IDC_LM_DAY_AMBIENT,"ColorSwatch",WS_TABSTOP,65,125,30,15
|
||||
LTEXT "Diffuse:",IDC_LMC_STATIC5,105,130,45,10
|
||||
CONTROL "Custom1",IDC_LM_DAY_DIFFUSE,"ColorSwatch",WS_TABSTOP,
|
||||
160,125,30,15
|
||||
CONTROL "Custom1",IDC_LM_DAY_DIFFUSE,"ColorSwatch",WS_TABSTOP,160,125,30,15
|
||||
LTEXT "Ambient:",IDC_LMC_STATIC7,10,170,45,10
|
||||
CONTROL "Custom1",IDC_LM_NIGHT_AMBIENT,"ColorSwatch",WS_TABSTOP,
|
||||
65,165,30,15
|
||||
CONTROL "Custom1",IDC_LM_NIGHT_AMBIENT,"ColorSwatch",WS_TABSTOP,65,165,30,15
|
||||
LTEXT "Diffuse:",IDC_LMC_STATIC8,105,170,45,10
|
||||
CONTROL "Custom1",IDC_LM_NIGHT_DIFFUSE,"ColorSwatch",WS_TABSTOP,
|
||||
160,165,30,15
|
||||
CONTROL "Use 8Bits lightmaps",IDC_LM_COMPRESS_8BIT,"Button",
|
||||
BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,10,20,
|
||||
90,10
|
||||
CONTROL "Custom1",IDC_LM_NIGHT_DIFFUSE,"ColorSwatch",WS_TABSTOP,160,165,30,15
|
||||
CONTROL "Use 8Bits lightmaps",IDC_LM_COMPRESS_8BIT,"Button",BS_AUTO3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,10,20,90,10
|
||||
PUSHBUTTON "Auto Setup All",IDC_LMC_AUTO_SETUP,15,45,65,15
|
||||
PUSHBUTTON "Auto Setup Visible",IDC_LMC_AUTO_SETUP_VISIBLEONLY,95,
|
||||
45,90,15
|
||||
PUSHBUTTON "Auto Setup Visible",IDC_LMC_AUTO_SETUP_VISIBLEONLY,95,45,90,15
|
||||
PUSHBUTTON "Copy From",IDC_LMC_COPY_FROM,120,20,65,15
|
||||
END
|
||||
|
||||
IDD_LMC_CHOOSE_FROM DIALOG DISCARDABLE 0, 0, 217, 290
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
IDD_LMC_CHOOSE_FROM DIALOG 0, 0, 217, 290
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Choose LMC setup from object"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,160,240,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,160,265,50,14
|
||||
LISTBOX IDC_LMC_COPY_LIST,5,20,120,260,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
LISTBOX IDC_LMC_COPY_LIST,5,20,120,260,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "List of objects in LMC mode.",IDC_STATIC,5,10,120,10
|
||||
CONTROL "Custom1",IDC_LMC_COPY_ALWAYS_DIFFUSE,"ColorSwatch",
|
||||
WS_TABSTOP,180,45,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_ALWAYS_AMBIENT,"ColorSwatch",
|
||||
WS_TABSTOP,140,45,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_SUN_AMBIENT,"ColorSwatch",
|
||||
WS_TABSTOP,140,90,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_SUN_DIFFUSE,"ColorSwatch",
|
||||
WS_TABSTOP,180,90,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_NIGHT_DIFFUSE,"ColorSwatch",
|
||||
WS_TABSTOP,180,135,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_NIGHT_AMBIENT,"ColorSwatch",
|
||||
WS_TABSTOP,140,135,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_ALWAYS_DIFFUSE,"ColorSwatch",WS_TABSTOP,180,45,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_ALWAYS_AMBIENT,"ColorSwatch",WS_TABSTOP,140,45,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_SUN_AMBIENT,"ColorSwatch",WS_TABSTOP,140,90,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_SUN_DIFFUSE,"ColorSwatch",WS_TABSTOP,180,90,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_NIGHT_DIFFUSE,"ColorSwatch",WS_TABSTOP,180,135,30,15
|
||||
CONTROL "Custom1",IDC_LMC_COPY_NIGHT_AMBIENT,"ColorSwatch",WS_TABSTOP,140,135,30,15
|
||||
LTEXT "Colors for this node:",IDC_STATIC,140,25,70,10
|
||||
CONTROL "Get",IDC_LMC_COPY_ALWAYS_AMBIENT_FILTER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,140,65,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_ALWAYS_DIFFUSE_FILTER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,180,65,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_SUN_DIFFUSE_FILTER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,180,110,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_SUN_AMBIENT_FILTER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,140,110,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_NIGHT_AMBIENT_FILTER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,140,155,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_NIGHT_DIFFUSE_FILTER,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,180,155,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_ALWAYS_AMBIENT_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,65,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_ALWAYS_DIFFUSE_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,65,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_SUN_DIFFUSE_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,110,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_SUN_AMBIENT_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,110,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_NIGHT_AMBIENT_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,155,30,10
|
||||
CONTROL "Get",IDC_LMC_COPY_NIGHT_DIFFUSE_FILTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,180,155,30,10
|
||||
PUSHBUTTON "Clear All",IDC_LMC_COPY_CLEAR,140,175,70,15
|
||||
PUSHBUTTON "Get All",IDC_LMC_COPY_GET_ALL,140,195,70,15
|
||||
END
|
||||
|
@ -829,7 +672,7 @@ END
|
|||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_NODE_PROPERTIES_PANEL, DIALOG
|
||||
BEGIN
|
||||
|
|
|
@ -1054,7 +1054,7 @@ INT_PTR CALLBACK LightmapDialogCallback (
|
|||
// Set enable disable
|
||||
LightingStateChanged (hwndDlg, currentParam);
|
||||
|
||||
CheckRadioButton (hwndDlg, IDC_LIGHT_GROUP_ALWAYS, IDC_LIGHT_GROUP_NIGHT, IDC_LIGHT_GROUP_ALWAYS+(currentParam->LightGroup%3));
|
||||
CheckRadioButton (hwndDlg, IDC_LIGHT_GROUP_ALWAYS, IDC_LIGHT_GROUP_LANDSCAPE_AMBIENT, IDC_LIGHT_GROUP_ALWAYS+(currentParam->LightGroup%5));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1096,10 +1096,14 @@ INT_PTR CALLBACK LightmapDialogCallback (
|
|||
// Get the acceleration type
|
||||
if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_ALWAYS) == BST_CHECKED)
|
||||
currentParam->LightGroup = 0;
|
||||
else if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_DAY) == BST_CHECKED)
|
||||
else if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_LANDSCAPE_DIFFUSE) == BST_CHECKED)
|
||||
currentParam->LightGroup = 1;
|
||||
else if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_NIGHT) == BST_CHECKED)
|
||||
else if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_NIGHT_CYCLE) == BST_CHECKED)
|
||||
currentParam->LightGroup = 2;
|
||||
else if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_DAY_CYCLE) == BST_CHECKED)
|
||||
currentParam->LightGroup = 3;
|
||||
else if (IsDlgButtonChecked (hwndDlg, IDC_LIGHT_GROUP_LANDSCAPE_AMBIENT) == BST_CHECKED)
|
||||
currentParam->LightGroup = 4;
|
||||
else
|
||||
currentParam->LightGroup = -1;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by nel_export.rc
|
||||
//
|
||||
#define IDS_LIBDESCRIPTION 1
|
||||
|
@ -7,7 +7,6 @@
|
|||
#define IDS_CLASS_NAME 3
|
||||
#define IDC_ADD 3
|
||||
#define IDS_PARAMS 4
|
||||
#define IDC_STATIC -1
|
||||
#define IDC_REMOVE 4
|
||||
#define IDS_SPIN 5
|
||||
#define IDC_UP 5
|
||||
|
@ -225,9 +224,6 @@
|
|||
#define IDC_OPEN_OCC_MODEL 1529
|
||||
#define IDC_ENV_FX 1531
|
||||
#define IDC_SOUND_GROUP 1532
|
||||
#define IDC_LIGHT_GROUP_ALWAYS 1533
|
||||
#define IDC_LIGHT_GROUP_DAY 1534
|
||||
#define IDC_LIGHT_GROUP_NIGHT 1535
|
||||
#define IDC_LIGHT_DONT_CAST_SHADOW_INTERIOR 1536
|
||||
#define IDC_LIGHT_DONT_CAST_SHADOW_EXTERIOR 1537
|
||||
#define IDC_8BITS_LIGHTMAP 1537
|
||||
|
@ -270,6 +266,12 @@
|
|||
#define IDC_LMC_COPY_ALWAYS_DIFFUSE 1567
|
||||
#define IDC_LMC_COPY_LIST 1568
|
||||
#define IDC_REALTIME_LIGHT_AMBIENT_ADD_SUN 1569
|
||||
#define IDC_LIGHT_GROUP_ALWAYS 1570
|
||||
#define IDC_LIGHT_GROUP_LANDSCAPE_DIFFUSE 1571
|
||||
#define IDC_LIGHT_GROUP_NIGHT_CYCLE 1572
|
||||
#define IDC_LIGHT_GROUP_DAY_CYCLE 1573
|
||||
#define IDC_LIGHT_GROUP_LANDSCAPE_AMBIENT 1574
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
|
|
|
@ -71,7 +71,7 @@ void initIG()
|
|||
{
|
||||
// Initialize lightmaps colors for the fireworks.
|
||||
|
||||
// Fireworks is group 3
|
||||
// Fireworks is group 5
|
||||
Scene->setLightGroupColor (LightGroupFireworks, CRGBA(0,0,0));
|
||||
|
||||
}// initIG //
|
||||
|
|
|
@ -70,7 +70,7 @@ void CGroupHTMLCS::addHTTPGetParams (string &url, bool /*trustedDomain*/)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CGroupHTMLCS::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDomain*/)
|
||||
void CGroupHTMLCS::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/)
|
||||
{
|
||||
std::vector<CParameter> parameters;
|
||||
getParameters (parameters, false);
|
||||
|
@ -78,7 +78,7 @@ void CGroupHTMLCS::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDom
|
|||
uint i;
|
||||
for (i=0; i<parameters.size(); i++)
|
||||
{
|
||||
HTParseFormInput(formfields, (parameters[i].Name+"="+parameters[i].Value).c_str());
|
||||
formfields.add(parameters[i].Name, parameters[i].Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
// From CGroupHTML
|
||||
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
|
||||
virtual std::string home();
|
||||
|
||||
private:
|
||||
|
|
|
@ -83,7 +83,7 @@ void CGroupHTMLForum::addHTTPGetParams (string &url, bool /*trustedDomain*/)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CGroupHTMLForum::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDomain*/)
|
||||
void CGroupHTMLForum::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/)
|
||||
{
|
||||
ucstring user_name = UserEntity->getLoginName ();
|
||||
const SGuild &guild = CGuildManager::getInstance()->getGuild();
|
||||
|
@ -91,10 +91,10 @@ void CGroupHTMLForum::addHTTPPostParams (HTAssocList *formfields, bool /*trusted
|
|||
|
||||
if (!gname.empty())
|
||||
{
|
||||
HTParseFormInput(formfields, ("shard="+toString(CharacterHomeSessionId)).c_str());
|
||||
HTParseFormInput(formfields, ("user_login="+user_name.toString()).c_str());
|
||||
HTParseFormInput(formfields, ("forum="+gname).c_str());
|
||||
HTParseFormInput(formfields, ("session_cookie="+NetMngr.getLoginCookie().toString()).c_str());
|
||||
formfields.add("shard", toString(CharacterHomeSessionId));
|
||||
formfields.add("user_login", user_name.toString());
|
||||
formfields.add("forum", gname);
|
||||
formfields.add("session_cookie", NetMngr.getLoginCookie().toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
// From CGroupHTML
|
||||
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
|
||||
virtual std::string home();
|
||||
virtual void handle ();
|
||||
|
||||
|
|
|
@ -62,13 +62,13 @@ void CGroupHTMLMail::addHTTPGetParams (string &url, bool /*trustedDomain*/)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CGroupHTMLMail::addHTTPPostParams (HTAssocList *formfields, bool /*trustedDomain*/)
|
||||
void CGroupHTMLMail::addHTTPPostParams (SFormFields &formfields, bool /*trustedDomain*/)
|
||||
{
|
||||
ucstring user_name = UserEntity->getLoginName ();
|
||||
HTParseFormInput(formfields, ("shard="+toString(CharacterHomeSessionId)).c_str());
|
||||
HTParseFormInput(formfields, ("user_login="+user_name.toString()).c_str());
|
||||
HTParseFormInput(formfields, ("session_cookie="+NetMngr.getLoginCookie().toString()).c_str());
|
||||
HTParseFormInput(formfields, ("lang="+CI18N::getCurrentLanguageCode()).c_str());
|
||||
formfields.add("shard", toString(CharacterHomeSessionId));
|
||||
formfields.add("user_login", user_name.toString());
|
||||
formfields.add("session_cookie", NetMngr.getLoginCookie().toString());
|
||||
formfields.add("lang", CI18N::getCurrentLanguageCode());
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
// From CGroupHTML
|
||||
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
|
||||
virtual std::string home();
|
||||
virtual void handle ();
|
||||
|
||||
|
|
|
@ -307,19 +307,19 @@ void CGroupHTMLAuth::addHTTPGetParams (string &url, bool trustedDomain)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CGroupHTMLAuth::addHTTPPostParams (HTAssocList *formfields, bool trustedDomain)
|
||||
void CGroupHTMLAuth::addHTTPPostParams (SFormFields &formfields, bool trustedDomain)
|
||||
{
|
||||
if(!UserEntity) return;
|
||||
|
||||
uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
|
||||
HTParseFormInput(formfields, ("shardid="+toString(CharacterHomeSessionId)).c_str());
|
||||
HTParseFormInput(formfields, ("name="+UserEntity->getLoginName().toUtf8()).c_str());
|
||||
HTParseFormInput(formfields, ("lang="+CI18N::getCurrentLanguageCode()).c_str());
|
||||
HTParseFormInput(formfields, "ig=1");
|
||||
formfields.add("shardid", toString(CharacterHomeSessionId));
|
||||
formfields.add("name", UserEntity->getLoginName().toUtf8());
|
||||
formfields.add("lang", CI18N::getCurrentLanguageCode());
|
||||
formfields.add("ig", "1");
|
||||
if (trustedDomain)
|
||||
{
|
||||
HTParseFormInput(formfields, ("cid="+toString(cid)).c_str());
|
||||
HTParseFormInput(formfields, ("authkey="+getWebAuthKey()).c_str());
|
||||
formfields.add("cid", toString(cid));
|
||||
formfields.add("authkey", getWebAuthKey());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ void CGroupHTMLWebIG::addHTTPGetParams (string &url, bool trustedDomain)
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CGroupHTMLWebIG::addHTTPPostParams (HTAssocList *formfields, bool trustedDomain)
|
||||
void CGroupHTMLWebIG::addHTTPPostParams (SFormFields &formfields, bool trustedDomain)
|
||||
{
|
||||
CGroupHTMLAuth::addHTTPPostParams(formfields, trustedDomain);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
|
||||
// From CGroupHTML
|
||||
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
|
||||
virtual std::string home();
|
||||
virtual void handle ();
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
|||
|
||||
/// From CGroupHTMLAuth
|
||||
virtual void addHTTPGetParams (std::string &url, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (HTAssocList *formfields, bool trustedDomain);
|
||||
virtual void addHTTPPostParams (SFormFields &formfields, bool trustedDomain);
|
||||
virtual std::string home();
|
||||
virtual void handle ();
|
||||
|
||||
|
|
|
@ -215,7 +215,7 @@ void CGroupQuickHelp::setGroupTextSize (CInterfaceGroup *group, bool selected)
|
|||
|
||||
extern CActionsContext ActionsContext;
|
||||
|
||||
void CGroupQuickHelp::beginElement (uint element_number, const BOOL *present, const char **value)
|
||||
void CGroupQuickHelp::beginElement (uint element_number, const std::vector<bool> &present, const std::vector<const char *>&value)
|
||||
{
|
||||
CGroupHTML::beginElement (element_number, present, value);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ private:
|
|||
virtual void updateCoords();
|
||||
|
||||
// From CGroupHTML
|
||||
virtual void beginElement (uint element_number, const BOOL *present, const char **value);
|
||||
virtual void beginElement (uint element_number, const std::vector<bool> &present, const std::vector<const char *>&value);
|
||||
virtual void endBuild ();
|
||||
virtual void browse (const char *url);
|
||||
virtual std::string home();
|
||||
|
|
|
@ -354,11 +354,17 @@ void CLightCycleManager::setHour(float hour, const CWeatherManagerClient &wm, NL
|
|||
{
|
||||
CRGBA color;
|
||||
color.add(_LastDiffuse, lightningColor);
|
||||
Scene->setLightGroupColor (LightGroupDay, color);
|
||||
Scene->setLightGroupColor(LightGroupLandscapeDiffuse, color);
|
||||
color.add(_LastAmbient, lightningColor);
|
||||
Scene->setLightGroupColor(LightGroupLandscapeAmbient, color);
|
||||
float nightLevel = _LightLevel*255.f;
|
||||
clamp (nightLevel, 0, 255);
|
||||
color.set ((uint8)nightLevel, (uint8)nightLevel, (uint8)nightLevel);
|
||||
Scene->setLightGroupColor (LightGroupNight, color);
|
||||
uint8 nightLevelColor = (uint8)nightLevel;
|
||||
color.set (nightLevelColor, nightLevelColor, nightLevelColor);
|
||||
Scene->setLightGroupColor (LightGroupNightCycle, color);
|
||||
uint8 dayLevelColor = 255 - nightLevel;
|
||||
color.set (dayLevelColor, dayLevelColor, dayLevelColor);
|
||||
Scene->setLightGroupColor (LightGroupDayCycle, color);
|
||||
}
|
||||
|
||||
if (Landscape)
|
||||
|
|
|
@ -65,9 +65,11 @@ class CPlayerSheet;
|
|||
enum TLightGroup
|
||||
{
|
||||
LightGroupAlways = 0,
|
||||
LightGroupDay,
|
||||
LightGroupNight,
|
||||
LightGroupFireworks,
|
||||
LightGroupLandscapeDiffuse = 1,
|
||||
LightGroupNightCycle = 2,
|
||||
LightGroupDayCycle = 3,
|
||||
LightGroupLandscapeAmbient = 4,
|
||||
LightGroupFireworks
|
||||
};
|
||||
|
||||
class CSeeds;
|
||||
|
|
Loading…
Reference in a new issue