Merged latest changes from SciTech code base into wxWindows CVS Tree.
Includes updates to remove Watcom compiler warnings and the latest updates to the wxApplet code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -34,7 +34,10 @@
|
||||
#define __WX_APPLET_H
|
||||
|
||||
#include "wx/panel.h"
|
||||
#include "wx/applet/window.h"
|
||||
#include "wx/html/htmlwin.h"
|
||||
|
||||
// Forward declaration
|
||||
class wxHtmlAppletWindow;
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
@@ -48,18 +51,19 @@ private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
protected:
|
||||
wxHtmlAppletWindow *m_Parent;
|
||||
wxHtmlAppletWindow *m_parent;
|
||||
|
||||
// Special handler for background erase messages
|
||||
void OnEraseBackground(wxEraseEvent&);
|
||||
|
||||
public:
|
||||
// Constructor (called during dynamic creation)
|
||||
wxApplet() { m_Parent = NULL; }
|
||||
wxApplet() { m_parent = NULL; };
|
||||
|
||||
// Psuedo virtual constructor
|
||||
virtual bool Create(
|
||||
wxHtmlAppletWindow *parent,
|
||||
const wxHtmlTag& params,
|
||||
const wxSize& size,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER);
|
||||
|
||||
@@ -79,5 +83,7 @@ public:
|
||||
virtual void OnMessage(wxEvent& msg) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // __WX_APPLET_H
|
||||
|
||||
|
@@ -35,18 +35,46 @@
|
||||
|
||||
#include "wx/html/htmlwin.h"
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
// Forward declare
|
||||
class wxApplet;
|
||||
class wxLoadPageEvent;
|
||||
class wxPageLoadedEvent;
|
||||
class wxIncludePrep;
|
||||
|
||||
// Declare a linked list of wxApplet pointers
|
||||
class wxApplet;
|
||||
WX_DECLARE_LIST(wxApplet, wxAppletList);
|
||||
|
||||
/****************************************************************************
|
||||
MEMBERS:
|
||||
appletModules - List of register applet modules
|
||||
appletList - List of all active applets instances
|
||||
cookies - Hash table for managing cookies
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
/****************************************************************************
|
||||
REMARKS:
|
||||
Defines the class for virtual-link data types
|
||||
****************************************************************************/
|
||||
class VirtualData : public wxObject {
|
||||
private:
|
||||
wxString m_name;
|
||||
wxString m_group;
|
||||
wxString m_href;
|
||||
|
||||
public:
|
||||
// Ctors
|
||||
VirtualData(
|
||||
wxString& name,
|
||||
wxString& group,
|
||||
wxString& href );
|
||||
|
||||
// Gets
|
||||
wxString GetName(){ return m_name;};
|
||||
wxString GetGroup(){ return m_group;};
|
||||
wxString GetHref(){ return m_href;};
|
||||
|
||||
// Sets
|
||||
void SetName (wxString& s){ m_name = s; };
|
||||
void SetGroup(wxString& s){ m_group = s; };
|
||||
void SetHref (wxString& s){ m_href = s; };
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
REMARKS:
|
||||
Defines the class for wxAppletWindow. This class is derived from the
|
||||
wxHtmlWindow class and extends it with functionality to handle embedded
|
||||
@@ -57,15 +85,22 @@ private:
|
||||
DECLARE_CLASS(wxHtmlAppletWindow);
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
wxIncludePrep *incPreprocessor; // deleted by list it is added too in constructor
|
||||
protected:
|
||||
wxAppletList m_AppletList;
|
||||
wxHashTable m_Cookies;
|
||||
static wxHashTable m_Cookies;
|
||||
wxToolBarBase *m_NavBar;
|
||||
int m_NavBackId;
|
||||
int m_NavForwardId;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
wxHtmlAppletWindow(
|
||||
wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
wxToolBarBase *navBar = NULL,
|
||||
int navBackId = -1,
|
||||
int navForwardId = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHW_SCROLLBAR_AUTO,
|
||||
@@ -76,7 +111,9 @@ public:
|
||||
|
||||
// Create an instance of an applet based on it's class name
|
||||
wxApplet *CreateApplet(
|
||||
const wxString& className,
|
||||
const wxString& classId,
|
||||
const wxString& iName,
|
||||
const wxHtmlTag ¶ms,
|
||||
const wxSize& size);
|
||||
|
||||
// Find an instance of an applet based on it's class name
|
||||
@@ -86,10 +123,10 @@ public:
|
||||
bool RemoveApplet(const wxApplet *applet);
|
||||
|
||||
// Load a new URL page
|
||||
bool LoadPage(const wxString& hRef);
|
||||
virtual bool LoadPage(const wxString& location);
|
||||
|
||||
// Called when users clicked on hypertext link.
|
||||
void OnLinkClicked(const wxHtmlLinkInfo& link);
|
||||
virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
|
||||
|
||||
// Handles forward navigation within the HTML stack
|
||||
bool HistoryForward();
|
||||
@@ -108,6 +145,13 @@ public:
|
||||
|
||||
// Find a cookie of data given it's public name
|
||||
wxObject *FindCookie(const wxString& name);
|
||||
|
||||
// Event handlers to load a new page
|
||||
void OnLoadPage(wxLoadPageEvent &event);
|
||||
|
||||
// Event handlers to load a new page
|
||||
void OnPageLoaded(wxPageLoadedEvent &event);
|
||||
|
||||
};
|
||||
|
||||
#endif // __WX_APPLET_WINDOW_H
|
||||
|
@@ -28,7 +28,7 @@ public:
|
||||
virtual bool CanSave() { return FALSE; }
|
||||
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc);
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc) { return FALSE; }
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc) { (void)stream; (void)doc; return FALSE; }
|
||||
};
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ class WXXMLDLLEXPORT wxXmlIOHandlerWriter : public wxXmlIOHandler
|
||||
{
|
||||
public:
|
||||
virtual wxXmlIOType GetType() { return wxXML_IO_TEXT_OUTPUT; }
|
||||
virtual bool CanLoad(wxInputStream& stream) { return FALSE; }
|
||||
virtual bool CanLoad(wxInputStream& stream) { (void)stream; return FALSE; }
|
||||
virtual bool CanSave() { return TRUE; }
|
||||
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc) { return FALSE; }
|
||||
virtual bool Load(wxInputStream& stream, wxXmlDocument& doc) { (void)stream; (void)doc; return FALSE; }
|
||||
virtual bool Save(wxOutputStream& stream, const wxXmlDocument& doc);
|
||||
};
|
||||
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
// Include private headers
|
||||
#include "wx/applet/applet.h"
|
||||
#include "wx/applet/window.h"
|
||||
|
||||
/*------------------------- Implementation --------------------------------*/
|
||||
|
||||
@@ -54,12 +55,13 @@ Psuedo virtual constructor for the wxApplet class.
|
||||
****************************************************************************/
|
||||
bool wxApplet::Create(
|
||||
wxHtmlAppletWindow *parent,
|
||||
const wxHtmlTag& ,
|
||||
const wxSize& size,
|
||||
long style)
|
||||
{
|
||||
bool ret = wxPanel::Create(parent, -1, wxDefaultPosition, size, style);
|
||||
if (ret) {
|
||||
m_Parent = parent;
|
||||
m_parent = parent;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -70,7 +72,7 @@ Destructor for the wxApplet class.
|
||||
****************************************************************************/
|
||||
wxApplet::~wxApplet()
|
||||
{
|
||||
m_Parent->RemoveApplet(this);
|
||||
m_parent->RemoveApplet(this);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@@ -32,9 +32,22 @@
|
||||
|
||||
// For compilers that support precompilation
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/html/forcelnk.h"
|
||||
|
||||
// Include private headers
|
||||
#include "wx/applet/applet.h"
|
||||
#include "wx/applet/window.h"
|
||||
#include "wx/applet/loadpage.h"
|
||||
|
||||
// Preprocessor Stuff
|
||||
#include "wx/applet/prepinclude.h"
|
||||
#include "wx/applet/prepecho.h"
|
||||
#include "wx/applet/prepifelse.h"
|
||||
|
||||
|
||||
/*---------------------------- Global variables ---------------------------*/
|
||||
|
||||
wxHashTable wxHtmlAppletWindow::m_Cookies;
|
||||
|
||||
/*------------------------- Implementation --------------------------------*/
|
||||
|
||||
@@ -42,6 +55,8 @@
|
||||
// sub-classes of wxApplet can reference wxApplet in the event tables
|
||||
// that they create as necessary.
|
||||
BEGIN_EVENT_TABLE(wxHtmlAppletWindow, wxHtmlWindow)
|
||||
EVT_LOAD_PAGE(wxHtmlAppletWindow::OnLoadPage)
|
||||
EVT_PAGE_LOADED(wxHtmlAppletWindow::OnPageLoaded)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// Implement the class functions for wxHtmlAppletWindow
|
||||
@@ -58,14 +73,37 @@ Constructor for the applet window class.
|
||||
wxHtmlAppletWindow::wxHtmlAppletWindow(
|
||||
wxWindow *parent,
|
||||
wxWindowID id,
|
||||
wxToolBarBase *navBar,
|
||||
int navBackId,
|
||||
int navForwardId,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name)
|
||||
: wxHtmlWindow(parent,id,pos,size,style,name)
|
||||
{
|
||||
// Ensure all cookie data is destroyed when window is killed
|
||||
m_Cookies.DeleteContents(true);
|
||||
//setup client navbars
|
||||
if (navBar) {
|
||||
m_NavBar = navBar;
|
||||
m_NavBackId = navBackId;
|
||||
m_NavForwardId = navForwardId;
|
||||
}
|
||||
else {
|
||||
m_NavBar = NULL;
|
||||
}
|
||||
|
||||
//Add HTML preprocessors
|
||||
// deleting preprocessors is done by the code within the window
|
||||
|
||||
incPreprocessor = new wxIncludePrep(); // #include preprocessor
|
||||
wxEchoPrep * echoPreprocessor = new wxEchoPrep(); // #echo preprocessor
|
||||
wxIfElsePrep * ifPreprocessor = new wxIfElsePrep();
|
||||
|
||||
this->AddProcessor(incPreprocessor);
|
||||
this->AddProcessor(echoPreprocessor);
|
||||
this->AddProcessor(ifPreprocessor);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -91,15 +129,13 @@ created dynamically based on string values embedded in the custom tags of an
|
||||
HTML page.
|
||||
****************************************************************************/
|
||||
wxApplet *wxHtmlAppletWindow::CreateApplet(
|
||||
const wxString& className,
|
||||
const wxString& classId,
|
||||
const wxString& iName,
|
||||
const wxHtmlTag& params,
|
||||
const wxSize& size)
|
||||
{
|
||||
// We presently only allow one applet per page of the same class!
|
||||
if (m_AppletList.Find(className))
|
||||
return NULL;
|
||||
|
||||
// Dynamically create the class instance at runtime
|
||||
wxClassInfo *info = wxClassInfo::FindClass(className.c_str());
|
||||
wxClassInfo *info = wxClassInfo::FindClass(classId.c_str());
|
||||
if (!info)
|
||||
return NULL;
|
||||
wxObject *obj = info->CreateObject();
|
||||
@@ -108,11 +144,11 @@ wxApplet *wxHtmlAppletWindow::CreateApplet(
|
||||
wxApplet *applet = wxDynamicCast(obj,wxApplet);
|
||||
if (!applet)
|
||||
return NULL;
|
||||
if (!applet->Create(this,size)) {
|
||||
if (!applet->Create(this,params,size)) {
|
||||
delete applet;
|
||||
return NULL;
|
||||
}
|
||||
m_AppletList.Append(className,applet);
|
||||
m_AppletList.Append(iName,applet);
|
||||
return applet;
|
||||
}
|
||||
|
||||
@@ -169,11 +205,64 @@ REMARKS:
|
||||
Remove an applet from the manager. Called during applet destruction
|
||||
****************************************************************************/
|
||||
bool wxHtmlAppletWindow::LoadPage(
|
||||
const wxString& hRef)
|
||||
const wxString& link)
|
||||
{
|
||||
wxString href(link);
|
||||
|
||||
// TODO: This needs to be made platform inde if possible.
|
||||
if (link.GetChar(0) == '?'){
|
||||
wxString cmd = link.BeforeFirst('=');
|
||||
wxString cmdValue = link.AfterFirst('=');
|
||||
|
||||
if(!(cmd.CmpNoCase("?EXTERNAL"))){
|
||||
#ifdef __WINDOWS__
|
||||
ShellExecute(this ? (HWND)this->GetHWND() : NULL,NULL,cmdValue.c_str(),NULL,"",SW_SHOWNORMAL);
|
||||
#else
|
||||
#error Platform not implemented yet!
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
if (!(cmd.CmpNoCase("?EXECUTE"))){
|
||||
wxMessageBox(cmdValue);
|
||||
return true;
|
||||
}
|
||||
if (!(cmd.CmpNoCase("?VIRTUAL"))){
|
||||
VirtualData& temp = *((VirtualData*)FindCookie(cmdValue));
|
||||
if (&temp) {
|
||||
href = temp.GetHref();
|
||||
}
|
||||
else {
|
||||
#ifdef CHECKED
|
||||
wxMessageBox("VIRTUAL LINK ERROR: " + cmdValue + " does not exist.");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Grab the directory from the string for use in the include preprocessor
|
||||
// make sure we get either type of / or \.
|
||||
int ch = link.Find('\\', true);
|
||||
if (ch == -1) ch = link.Find('/', true);
|
||||
if (ch != -1) {
|
||||
wxFileSystem fs;
|
||||
wxString tmp = link.Mid(0, ch+1);
|
||||
fs.ChangePathTo(incPreprocessor->GetDirectory(), true);
|
||||
fs.ChangePathTo(tmp, true);
|
||||
incPreprocessor->ChangeDirectory(fs.GetPath());
|
||||
}
|
||||
|
||||
// Inform all the applets that the new page is being loaded
|
||||
for (wxAppletList::Node *node = m_AppletList.GetFirst(); node; node = node->GetNext())
|
||||
(node->GetData())->OnLinkClicked(hRef);
|
||||
return wxHtmlWindow::LoadPage(hRef);
|
||||
(node->GetData())->OnLinkClicked(wxHtmlLinkInfo(href));
|
||||
bool stat = wxHtmlWindow::LoadPage(href);
|
||||
|
||||
// Enable/Dis the navbar tools
|
||||
if (m_NavBar) {
|
||||
m_NavBar->EnableTool(m_NavForwardId,HistoryCanForward());
|
||||
m_NavBar->EnableTool(m_NavBackId,HistoryCanBack());
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -187,9 +276,7 @@ call the LoadPage function above to load the new page and display it.
|
||||
void wxHtmlAppletWindow::OnLinkClicked(
|
||||
const wxHtmlLinkInfo& link)
|
||||
{
|
||||
for (wxAppletList::Node *node = m_AppletList.GetFirst(); node; node = node->GetNext())
|
||||
(node->GetData())->OnLinkClicked(link);
|
||||
wxHtmlWindow::LoadPage(link.GetHref());
|
||||
LoadPage(link.GetHref());
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -202,8 +289,10 @@ bool wxHtmlAppletWindow::HistoryForward()
|
||||
{
|
||||
if (!HistoryCanForward())
|
||||
return false;
|
||||
|
||||
for (wxAppletList::Node *node = m_AppletList.GetFirst(); node; node = node->GetNext())
|
||||
(node->GetData())->OnHistoryForward();
|
||||
|
||||
return wxHtmlWindow::HistoryForward();
|
||||
}
|
||||
|
||||
@@ -217,8 +306,10 @@ bool wxHtmlAppletWindow::HistoryBack()
|
||||
{
|
||||
if (!HistoryCanBack())
|
||||
return false;
|
||||
|
||||
for (wxAppletList::Node *node = m_AppletList.GetFirst(); node; node = node->GetNext())
|
||||
(node->GetData())->OnHistoryBack();
|
||||
|
||||
return wxHtmlWindow::HistoryBack();
|
||||
}
|
||||
|
||||
@@ -246,14 +337,17 @@ void wxHtmlAppletWindow::SendMessage(
|
||||
// Process all applets in turn and send them the message
|
||||
for (wxAppletList::Node *node = m_AppletList.GetFirst(); node; node = node->GetNext()) {
|
||||
(node->GetData())->OnMessage(msg);
|
||||
if (!msg.GetSkipped())
|
||||
if (!msg.GetSkipped()){
|
||||
wxMessageBox("BREAK");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
msg - wxEvent message to be sent to all wxApplets
|
||||
name - Uniq wxString used as hash key
|
||||
cookie - wxObject data returned when name is found.
|
||||
|
||||
RETURNS:
|
||||
True if new cookie was added, false if cookie with same name already exists.
|
||||
@@ -287,7 +381,7 @@ bool wxHtmlAppletWindow::RegisterCookie(
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
msg - wxEvent message to be sent to all wxApplets
|
||||
name - wxString uniq haskey used to remove item from hash
|
||||
|
||||
RETURNS:
|
||||
True if found and deleted, false if not found in table.
|
||||
@@ -326,6 +420,57 @@ wxObject *wxHtmlAppletWindow::FindCookie(
|
||||
return m_Cookies.Get(name);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
event - Event to handle
|
||||
|
||||
REMARKS:
|
||||
This function handles delayed LoadPage events posted from applets that
|
||||
need to change the page for the current window to a new window.
|
||||
****************************************************************************/
|
||||
void wxHtmlAppletWindow::OnLoadPage(
|
||||
wxLoadPageEvent &event)
|
||||
{
|
||||
if (event.GetHtmlWindow() == this){
|
||||
if (LoadPage(event.GetHRef())){
|
||||
wxPageLoadedEvent evt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
event - Event to handle
|
||||
|
||||
REMARKS:
|
||||
This function handles delayed LoadPage events posted from applets that
|
||||
need to change the page for the current window to a new window.
|
||||
****************************************************************************/
|
||||
void wxHtmlAppletWindow::OnPageLoaded(
|
||||
wxPageLoadedEvent &)
|
||||
{
|
||||
Enable(true);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
name - name of the last applet that changed the data in this object
|
||||
group - name of the group the allplet belongs to.
|
||||
href - webpage to go to.
|
||||
|
||||
REMARKS:
|
||||
VirtualData is used to store information on the virtual links.
|
||||
****************************************************************************/
|
||||
VirtualData::VirtualData(
|
||||
wxString& name,
|
||||
wxString& group,
|
||||
wxString& href )
|
||||
{
|
||||
m_name = name;
|
||||
m_group = group;
|
||||
m_href = href;
|
||||
}
|
||||
|
||||
#include "wx/html/m_templ.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -334,38 +479,62 @@ Implementation for the <embed> HTML tag handler. This handler takes care
|
||||
of automatically constructing the wxApplet objects of the appropriate
|
||||
class based on the <embed> tag information.
|
||||
****************************************************************************/
|
||||
TAG_HANDLER_BEGIN(Embed, "EMBED")
|
||||
TAG_HANDLER_BEGIN(wxApplet, "WXAPPLET")
|
||||
|
||||
TAG_HANDLER_PROC(tag)
|
||||
{
|
||||
wxWindow *wnd;
|
||||
wxHtmlAppletWindow *appletWindow;
|
||||
wxApplet *applet;
|
||||
wxString classId;
|
||||
wxString name;
|
||||
int width, height;
|
||||
int floatPercent = 0;
|
||||
|
||||
wnd = m_WParser->GetWindow();
|
||||
if ((appletWindow = wxDynamicCast(wnd,wxHtmlAppletWindow)) != NULL) {
|
||||
|
||||
if ((appletWindow = wxDynamicCast(wnd,wxHtmlAppletWindow)) != NULL){
|
||||
tag.ScanParam("WIDTH", "%i", &width);
|
||||
tag.ScanParam("HEIGHT", "%i", &height);
|
||||
if (tag.HasParam("FLOAT"))
|
||||
tag.ScanParam("FLOAT", "%i", &floatPercent);
|
||||
if (tag.HasParam("APPLET")) {
|
||||
if ((applet = appletWindow->CreateApplet(tag.GetParam("APPLET"), wxSize(width, height))) != NULL) {
|
||||
if (tag.HasParam("CLASSID")){
|
||||
classId = tag.GetParam("CLASSID");
|
||||
if ( classId.IsNull() || classId.Len() == 0 ){
|
||||
wxMessageBox("wxApplet tag error: CLASSID is NULL or empty.","Error",wxICON_ERROR);
|
||||
return false;
|
||||
}
|
||||
if (tag.HasParam("NAME"))
|
||||
name = tag.GetParam("NAME");
|
||||
|
||||
// If the name is NULL or len is zero then we assume that the html guy
|
||||
// didn't include the name param which is optional.
|
||||
if ( name.IsNull() || name.Len() == 0 )
|
||||
name = classId;
|
||||
|
||||
// We got all the params and can now create the applet
|
||||
if ((applet = appletWindow->CreateApplet(classId, name, tag , wxSize(width, height))) != NULL){
|
||||
applet->Show(true);
|
||||
m_WParser->OpenContainer()->InsertCell(new wxHtmlWidgetCell(applet,floatPercent));
|
||||
m_WParser->OpenContainer()->InsertCell(new wxHtmlWidgetCell(applet,0));
|
||||
}
|
||||
else
|
||||
wxMessageBox("wxApplet error: Could not create:" + classId + "," + name);
|
||||
}
|
||||
else if (tag.HasParam("TEXT")) {
|
||||
// TODO: Somehow get the text returned from this class displayed on the page!
|
||||
else{
|
||||
wxMessageBox("wxApplet tag error: Can not find CLASSID param.","Error",wxICON_ERROR);
|
||||
return false;
|
||||
}
|
||||
//Add more param parsing here. If or when spec changes.
|
||||
//For now we'll ignore any other params those HTML guys
|
||||
//might put in our tag.
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
TAG_HANDLER_END(Embed)
|
||||
TAG_HANDLER_END(wxApplet)
|
||||
|
||||
TAGS_MODULE_BEGIN(Embed)
|
||||
TAGS_MODULE_ADD(Embed)
|
||||
TAGS_MODULE_END(Embed)
|
||||
TAGS_MODULE_BEGIN(wxApplet)
|
||||
TAGS_MODULE_ADD(wxApplet)
|
||||
TAGS_MODULE_END(wxApplet)
|
||||
|
||||
// This is our little forcelink hack.
|
||||
FORCE_LINK(loadpage)
|
||||
|
||||
|
@@ -26,9 +26,12 @@ static const char KW_FIXED[] = { ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\
|
||||
static const char KW_ID[] = { ASCII_I, ASCII_D, '\0' };
|
||||
static const char KW_IDREF[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' };
|
||||
static const char KW_IDREFS[] = { ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' };
|
||||
static const char KW_IGNORE[] = { ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' };
|
||||
static const char KW_IMPLIED[] = { ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' };
|
||||
/* Remove compiler warnings for not using when XML_DTD is not defined */
|
||||
#ifdef XML_DTD
|
||||
static const char KW_INCLUDE[] = { ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' };
|
||||
static const char KW_IGNORE[] = { ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' };
|
||||
#endif
|
||||
static const char KW_IMPLIED[] = { ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' };
|
||||
static const char KW_NDATA[] = { ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' };
|
||||
static const char KW_NMTOKEN[] = { ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' };
|
||||
static const char KW_NMTOKENS[] = { ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, '\0' };
|
||||
|
@@ -3,10 +3,17 @@ Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
|
||||
See the file copying.txt for copying permission.
|
||||
*/
|
||||
|
||||
#undef INVALID_LEAD_CASE
|
||||
|
||||
#ifndef IS_INVALID_CHAR
|
||||
#define IS_INVALID_CHAR(enc, ptr, n) (0)
|
||||
#endif
|
||||
|
||||
#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \
|
||||
case BT_LEAD ## n: \
|
||||
if (end - ptr < n) \
|
||||
return XML_TOK_PARTIAL_CHAR; \
|
||||
ptr += n; \
|
||||
break;
|
||||
#else
|
||||
#define INVALID_LEAD_CASE(n, ptr, nextTokPtr) \
|
||||
case BT_LEAD ## n: \
|
||||
if (end - ptr < n) \
|
||||
@@ -17,6 +24,7 @@ See the file copying.txt for copying permission.
|
||||
} \
|
||||
ptr += n; \
|
||||
break;
|
||||
#endif
|
||||
|
||||
#define INVALID_CASES(ptr, nextTokPtr) \
|
||||
INVALID_LEAD_CASE(2, ptr, nextTokPtr) \
|
||||
@@ -304,6 +312,7 @@ int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *en
|
||||
{
|
||||
if (ptr == end)
|
||||
return XML_TOK_NONE;
|
||||
#if !(MINBPC(enc) == 1)
|
||||
if (MINBPC(enc) > 1) {
|
||||
size_t n = end - ptr;
|
||||
if (n & (MINBPC(enc) - 1)) {
|
||||
@@ -313,6 +322,7 @@ int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *en
|
||||
end = ptr + n;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
switch (BYTE_TYPE(enc, ptr)) {
|
||||
case BT_RSQB:
|
||||
ptr += MINBPC(enc);
|
||||
@@ -783,6 +793,7 @@ int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
{
|
||||
if (ptr == end)
|
||||
return XML_TOK_NONE;
|
||||
#if !(MINBPC(enc) == 1)
|
||||
if (MINBPC(enc) > 1) {
|
||||
size_t n = end - ptr;
|
||||
if (n & (MINBPC(enc) - 1)) {
|
||||
@@ -792,6 +803,7 @@ int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
end = ptr + n;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
switch (BYTE_TYPE(enc, ptr)) {
|
||||
case BT_LT:
|
||||
return PREFIX(scanLt)(enc, ptr + MINBPC(enc), end, nextTokPtr);
|
||||
@@ -971,6 +983,7 @@ int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
int tok;
|
||||
if (ptr == end)
|
||||
return XML_TOK_NONE;
|
||||
#if !(MINBPC(enc) == 1)
|
||||
if (MINBPC(enc) > 1) {
|
||||
size_t n = end - ptr;
|
||||
if (n & (MINBPC(enc) - 1)) {
|
||||
@@ -980,6 +993,7 @@ int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
end = ptr + n;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
switch (BYTE_TYPE(enc, ptr)) {
|
||||
case BT_QUOT:
|
||||
return PREFIX(scanLit)(BT_QUOT, enc, ptr + MINBPC(enc), end, nextTokPtr);
|
||||
@@ -1086,6 +1100,7 @@ int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
return XML_TOK_DECL_CLOSE;
|
||||
case BT_NUM:
|
||||
return PREFIX(scanPoundName)(enc, ptr + MINBPC(enc), end, nextTokPtr);
|
||||
#ifdef XML_MIN_SIZE
|
||||
#define LEAD_CASE(n) \
|
||||
case BT_LEAD ## n: \
|
||||
if (end - ptr < n) \
|
||||
@@ -1102,6 +1117,14 @@ int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
} \
|
||||
*nextTokPtr = ptr; \
|
||||
return XML_TOK_INVALID;
|
||||
#else
|
||||
#define LEAD_CASE(n) \
|
||||
case BT_LEAD ## n: \
|
||||
if (end - ptr < n) \
|
||||
return XML_TOK_PARTIAL_CHAR; \
|
||||
*nextTokPtr = ptr; \
|
||||
return XML_TOK_INVALID;
|
||||
#endif
|
||||
LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4)
|
||||
#undef LEAD_CASE
|
||||
case BT_NMSTRT:
|
||||
@@ -1119,6 +1142,7 @@ int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
ptr += MINBPC(enc);
|
||||
break;
|
||||
case BT_NONASCII:
|
||||
#ifdef XML_MIN_SIZE
|
||||
if (IS_NMSTRT_CHAR_MINBPC(enc, ptr)) {
|
||||
ptr += MINBPC(enc);
|
||||
tok = XML_TOK_NAME;
|
||||
@@ -1129,6 +1153,7 @@ int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
|
||||
tok = XML_TOK_NMTOKEN;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* fall through */
|
||||
default:
|
||||
*nextTokPtr = ptr;
|
||||
|
@@ -87,7 +87,7 @@ static void StartElementHnd(void *userData, const char *name, const char **atts)
|
||||
ctx->lastAsText = NULL;
|
||||
}
|
||||
|
||||
static void EndElementHnd(void *userData, const char *name)
|
||||
static void EndElementHnd(void *userData, const char* WXUNUSED(name))
|
||||
{
|
||||
wxXmlParsingContext *ctx = (wxXmlParsingContext*)userData;
|
||||
|
||||
|
@@ -603,9 +603,9 @@ wxColour wxXmlResourceHandler::GetColour(const wxString& param)
|
||||
return wxNullColour;
|
||||
}
|
||||
|
||||
return wxColour((tmp & 0xFF0000) >> 16 ,
|
||||
(tmp & 0x00FF00) >> 8,
|
||||
(tmp & 0x0000FF));
|
||||
return wxColour((unsigned char) ((tmp & 0xFF0000) >> 16) ,
|
||||
(unsigned char) ((tmp & 0x00FF00) >> 8),
|
||||
(unsigned char) ((tmp & 0x0000FF)));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -62,7 +62,7 @@ public:
|
||||
void WriteString(const wxString& string);
|
||||
|
||||
wxDataOutputStream& operator<<(const wxChar *string);
|
||||
wxDataOutputStream& operator<<(wxString& string);
|
||||
wxDataOutputStream& operator<<(const wxString& string);
|
||||
wxDataOutputStream& operator<<(wxInt8 c);
|
||||
wxDataOutputStream& operator<<(wxInt16 i);
|
||||
wxDataOutputStream& operator<<(wxInt32 i);
|
||||
|
@@ -72,7 +72,7 @@ public:
|
||||
// After the page is loaded, the method calls SetPage() to display it.
|
||||
// Note : you can also use path relative to previously loaded page
|
||||
// Return value : same as SetPage
|
||||
bool LoadPage(const wxString& location);
|
||||
virtual bool LoadPage(const wxString& location);
|
||||
|
||||
// Returns full location of opened page
|
||||
wxString GetOpenedPage() const {return m_OpenedPage;}
|
||||
|
@@ -1330,8 +1330,6 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const
|
||||
// check that the algorithm gave us something reasonable
|
||||
wxASSERT_MSG( (0 < month) && (month <= 12), _T("invalid month") );
|
||||
wxASSERT_MSG( (1 <= day) && (day < 32), _T("invalid day") );
|
||||
wxASSERT_MSG( (INT_MIN <= year) && (year <= INT_MAX),
|
||||
_T("year range overflow") );
|
||||
|
||||
// construct Tm from these values
|
||||
Tm tm;
|
||||
|
@@ -237,7 +237,7 @@ wxDataOutputStream& wxDataOutputStream::operator<<(const wxChar *string)
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxDataOutputStream& wxDataOutputStream::operator<<(wxString& string)
|
||||
wxDataOutputStream& wxDataOutputStream::operator<<(const wxString& string)
|
||||
{
|
||||
WriteString(string);
|
||||
return *this;
|
||||
|
@@ -96,7 +96,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMHandler,wxImageHandler)
|
||||
|
||||
bool wxXPMHandler::LoadFile(wxImage *image,
|
||||
wxInputStream& stream,
|
||||
bool verbose, int WXUNUSED(index))
|
||||
bool WXUNUSED(verbose), int WXUNUSED(index))
|
||||
{
|
||||
wxXPMDecoder decoder;
|
||||
|
||||
|
@@ -1879,13 +1879,6 @@ void wxArrayString::Grow()
|
||||
else {
|
||||
// otherwise when it's called for the first time, nIncrement would be 0
|
||||
// and the array would never be expanded
|
||||
#if defined(__VISAGECPP__) && defined(__WXDEBUG__)
|
||||
int array_size = ARRAY_DEFAULT_INITIAL_SIZE;
|
||||
wxASSERT( array_size != 0 );
|
||||
#else
|
||||
wxASSERT( ARRAY_DEFAULT_INITIAL_SIZE != 0 );
|
||||
#endif
|
||||
|
||||
// add 50% but not too much
|
||||
size_t nIncrement = m_nSize < ARRAY_DEFAULT_INITIAL_SIZE
|
||||
? ARRAY_DEFAULT_INITIAL_SIZE : m_nSize >> 1;
|
||||
|
@@ -3461,6 +3461,9 @@ bool wxWindow::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam)
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
#else
|
||||
(void) wParam;
|
||||
(void) lParam;
|
||||
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user