innerWidth Window::InnerWidth DontDelete|ReadOnly
length Window::Length DontDelete|ReadOnly
location Window::_Location DontDelete
+ locationbar Window::Locationbar DontDelete
name Window::Name DontDelete
navigator Window::_Navigator DontDelete|ReadOnly
clientInformation Window::ClientInformation DontDelete|ReadOnly
konqueror Window::_Konqueror DontDelete|ReadOnly
+ menubar Window::Menubar DontDelete|ReadOnly
offscreenBuffering Window::OffscreenBuffering DontDelete|ReadOnly
opener Window::Opener DontDelete|ReadOnly
outerHeight Window::OuterHeight DontDelete|ReadOnly
screenLeft Window::ScreenLeft DontDelete|ReadOnly
screenTop Window::ScreenTop DontDelete|ReadOnly
scrollbars Window::Scrollbars DontDelete|ReadOnly
+ statusbar Window::Statusbar DontDelete|ReadOnly
+ toolbar Window::Toolbar DontDelete|ReadOnly
scroll Window::Scroll DontDelete|Function 2
scrollBy Window::ScrollBy DontDelete|Function 2
scrollTo Window::ScrollTo DontDelete|Function 2
IMPLEMENT_PROTOFUNC(WindowFunc)
Window::Window(KHTMLPart *p)
- : ObjectImp(/*no proto*/), m_part(p), screen(0), history(0), frames(0), loc(0), m_selection(0), m_evt(0)
+ : ObjectImp(/*no proto*/)
+ , m_part(p)
+ , screen(0)
+ , history(0)
+ , frames(0)
+ , loc(0)
+ , m_selection(0)
+ , m_locationbar(0)
+ , m_menubar(0)
+ , m_personalbar(0)
+ , m_scrollbars(0)
+ , m_statusbar(0)
+ , m_toolbar(0)
+ , m_evt(0)
{
winq = new WindowQObject(this);
//kdDebug(6070) << "Window::Window this=" << this << " part=" << m_part << " " << m_part->name() << endl;
return m_selection;
}
+BarInfo *Window::locationbar(ExecState *exec) const
+{
+ if (!m_locationbar)
+ const_cast<Window*>(this)->m_locationbar = new BarInfo(exec, m_part, BarInfo::Locationbar);
+ return m_locationbar;
+}
+
+BarInfo *Window::menubar(ExecState *exec) const
+{
+ if (!m_menubar)
+ const_cast<Window*>(this)->m_menubar = new BarInfo(exec, m_part, BarInfo::Menubar);
+ return m_menubar;
+}
+
+BarInfo *Window::personalbar(ExecState *exec) const
+{
+ if (!m_personalbar)
+ const_cast<Window*>(this)->m_personalbar = new BarInfo(exec, m_part, BarInfo::Personalbar);
+ return m_personalbar;
+}
+
+BarInfo *Window::statusbar(ExecState *exec) const
+{
+ if (!m_statusbar)
+ const_cast<Window*>(this)->m_statusbar = new BarInfo(exec, m_part, BarInfo::Statusbar);
+ return m_statusbar;
+}
+
+BarInfo *Window::toolbar(ExecState *exec) const
+{
+ if (!m_toolbar)
+ const_cast<Window*>(this)->m_toolbar = new BarInfo(exec, m_part, BarInfo::Toolbar);
+ return m_toolbar;
+}
+
+BarInfo *Window::scrollbars(ExecState *exec) const
+{
+ if (!m_scrollbars)
+ const_cast<Window*>(this)->m_scrollbars = new BarInfo(exec, m_part, BarInfo::Scrollbars);
+ return m_scrollbars;
+}
+
// reference our special objects during garbage collection
void Window::mark()
{
loc->mark();
if (m_selection && !m_selection->marked())
m_selection->mark();
+ if (m_locationbar && !m_locationbar->marked())
+ m_locationbar->mark();
+ if (m_menubar && !m_menubar->marked())
+ m_menubar->mark();
+ if (m_personalbar && !m_personalbar->marked())
+ m_personalbar->mark();
+ if (m_scrollbars && !m_scrollbars->marked())
+ m_scrollbars->mark();
+ if (m_statusbar && !m_statusbar->marked())
+ m_statusbar->mark();
+ if (m_toolbar && !m_toolbar->marked())
+ m_toolbar->mark();
}
bool Window::hasProperty(ExecState * /*exec*/, const Identifier &/*p*/) const
case _Konqueror:
return Value(new Konqueror(m_part));
#endif
+ case Locationbar:
+ return Value(locationbar(exec));
+ case Menubar:
+ return Value(menubar(exec));
case OffscreenBuffering:
return Boolean(true);
case Opener:
case Parent:
return Value(retrieve(m_part->parentPart() ? m_part->parentPart() : (KHTMLPart*)m_part));
case Personalbar:
- return Undefined(); // ###
+ return Value(personalbar(exec));
case ScreenLeft:
case ScreenX: {
if (!m_part->view())
return Number(m_part->view()->contentsY());
}
case Scrollbars:
- return Undefined(); // ###
+ return Value(scrollbars(exec));
+ case Statusbar:
+ return Value(statusbar(exec));
+ case Toolbar:
+ return Value(toolbar(exec));
case Self:
case _Window:
return Value(retrieve(m_part));
return Undefined();
}
+////////////////////// BarInfo Object ////////////////////////
+
+const ClassInfo BarInfo::info = { "BarInfo", 0, 0, 0 };
+/*
+@begin BarInfoTable 1
+ visible BarInfo::Visible DontDelete|ReadOnly
+@end
+*/
+BarInfo::BarInfo(ExecState *exec, KHTMLPart *p, Type barType)
+ : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype())
+ , m_part(p)
+ , m_type(barType)
+{
+}
+
+BarInfo::~BarInfo()
+{
+}
+
+Value BarInfo::get(ExecState *exec, const Identifier &p) const
+{
+ if (m_part.isNull())
+ return Undefined();
+
+ const HashEntry *entry = Lookup::findEntry(&BarInfoTable, p);
+ if (entry && entry->value == Visible) {
+ switch (m_type) {
+ case Locationbar:
+#if APPLE_CHANGES
+ return Boolean(KWQ(m_part)->locationbarVisible());
+#endif
+ case Menubar:
+#if APPLE_CHANGES
+ return Boolean(KWQ(m_part)->locationbarVisible());
+#endif
+ case Personalbar:
+#if APPLE_CHANGES
+ return Boolean(KWQ(m_part)->personalbarVisible());
+#endif
+ case Scrollbars:
+#if APPLE_CHANGES
+ return Boolean(KWQ(m_part)->scrollbarsVisible());
+#endif
+ case Statusbar:
+#if APPLE_CHANGES
+ return Boolean(KWQ(m_part)->statusbarVisible());
+#endif
+ case Toolbar:
+#if APPLE_CHANGES
+ return Boolean(KWQ(m_part)->toolbarVisible());
+#endif
+ default:
+ return Boolean(false);
+ }
+ }
+
+ return Undefined();
+}
+
+void BarInfo::put(ExecState *exec, const Identifier &p, const Value &v, int attr)
+{
+}
+
////////////////////// History Object ////////////////////////
const ClassInfo History::info = { "History", 0, 0, 0 };
class WindowQObject;
class Location;
class Selection;
+ class BarInfo;
class History;
class FrameArray;
class JSEventListener;
bool isSafeScript(ExecState *exec) const;
Location *location() const;
Selection *selection() const;
+ BarInfo *locationbar(ExecState *exec) const;
+ BarInfo *menubar(ExecState *exec) const;
+ BarInfo *personalbar(ExecState *exec) const;
+ BarInfo *scrollbars(ExecState *exec) const;
+ BarInfo *statusbar(ExecState *exec) const;
+ BarInfo *toolbar(ExecState *exec) const;
JSEventListener *getJSEventListener(const Value &val, bool html = false);
JSLazyEventListener *getJSLazyEventListener(const QString &code, bool html = false, int lineno = 0);
void clear( ExecState *exec );
static const ClassInfo info;
enum { Closed, Crypto, DefaultStatus, Status, Document, Node, EventCtor, Range,
NodeFilter, DOMException, CSSRule, Frames, _History, Event, InnerHeight,
- InnerWidth, Length, _Location, Name, _Navigator, _Konqueror, ClientInformation,
- OffscreenBuffering, Opener, OuterHeight, OuterWidth, PageXOffset, PageYOffset,
+ InnerWidth, Length, _Location, Locationbar, Name, _Navigator, _Konqueror, ClientInformation,
+ Menubar, OffscreenBuffering, Opener, OuterHeight, OuterWidth, PageXOffset, PageYOffset,
Parent, Personalbar, ScreenX, ScreenY, Scrollbars, Scroll, ScrollBy,
ScreenTop, ScreenLeft,
ScrollTo, ScrollX, ScrollY, MoveBy, MoveTo, ResizeBy, ResizeTo, Self, _Window, Top, _Screen,
Onabort, Onblur, Onchange, Onclick, Ondblclick, Ondragdrop, Onerror,
Onfocus, Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove,
Onmouseout, Onmouseover, Onmouseup, Onmove, Onreset, Onresize, Onscroll, Onsearch,
- Onselect, Onsubmit, Onunload };
+ Onselect, Onsubmit, Onunload,
+ Statusbar, Toolbar };
protected:
Value getListener(ExecState *exec, int eventId) const;
void setListener(ExecState *exec, int eventId, Value func);
FrameArray *frames;
Location *loc;
Selection *m_selection;
+ BarInfo *m_locationbar;
+ BarInfo *m_menubar;
+ BarInfo *m_personalbar;
+ BarInfo *m_scrollbars;
+ BarInfo *m_statusbar;
+ BarInfo *m_toolbar;
WindowQObject *winq;
DOM::Event *m_evt;
};
QGuardedPtr<KHTMLPart> m_part;
};
+ class BarInfo : public ObjectImp {
+ public:
+ ~BarInfo();
+ virtual Value get(ExecState *exec, const Identifier &propertyName) const;
+ virtual void put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
+ enum { Visible };
+ enum Type { Locationbar, Menubar, Personalbar, Scrollbars, Statusbar, Toolbar };
+ KHTMLPart *part() const { return m_part; }
+ virtual const ClassInfo* classInfo() const { return &info; }
+ static const ClassInfo info;
+ private:
+ friend class Window;
+ BarInfo(ExecState *exec, KHTMLPart *p, Type barType);
+ QGuardedPtr<KHTMLPart> m_part;
+ Type m_type;
+ };
+
#ifdef Q_WS_QWS
class Konqueror : public ObjectImp {
friend class KonquerorFunc;
{ "event", Window::Event, DontDelete, 0, &WindowTableEntries[94] },
{ "frames", Window::Frames, DontDelete|ReadOnly, 0, &WindowTableEntries[95] },
{ "onmouseup", Window::Onmouseup, DontDelete, 0, 0 },
- { "NodeFilter", Window::NodeFilter, DontDelete, 0, &WindowTableEntries[99] },
- { "CSSRule", Window::CSSRule, DontDelete, 0, &WindowTableEntries[107] },
+ { "NodeFilter", Window::NodeFilter, DontDelete, 0, &WindowTableEntries[102] },
+ { "CSSRule", Window::CSSRule, DontDelete, 0, &WindowTableEntries[111] },
{ "length", Window::Length, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "print", Window::Print, DontDelete|Function, 2, &WindowTableEntries[106] },
+ { "print", Window::Print, DontDelete|Function, 2, &WindowTableEntries[110] },
{ "opener", Window::Opener, DontDelete|ReadOnly, 0, 0 },
{ "parent", Window::Parent, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[114] },
- { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, &WindowTableEntries[108] },
+ { "scrollX", Window::ScrollX, DontDelete|ReadOnly, 0, &WindowTableEntries[118] },
+ { "scrollY", Window::ScrollY, DontDelete|ReadOnly, 0, &WindowTableEntries[112] },
{ "XMLSerializer", Window::XMLSerializer, DontDelete|ReadOnly, 0, 0 },
- { "scroll", Window::Scroll, DontDelete|Function, 2, 0 },
+ { "menubar", Window::Menubar, DontDelete|ReadOnly, 0, &WindowTableEntries[97] },
{ 0, 0, 0, 0, 0 },
- { "defaultStatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[104] },
+ { "defaultStatus", Window::DefaultStatus, DontDelete, 0, &WindowTableEntries[108] },
{ "onblur", Window::Onblur, DontDelete, 0, 0 },
{ "confirm", Window::Confirm, DontDelete|Function, 1, 0 },
- { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, &WindowTableEntries[119] },
+ { "scrollBy", Window::ScrollBy, DontDelete|Function, 2, &WindowTableEntries[123] },
{ "pageXOffset", Window::PageXOffset, DontDelete|ReadOnly, 0, 0 },
{ "pageYOffset", Window::PageYOffset, DontDelete|ReadOnly, 0, 0 },
- { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[97] },
- { "window", Window::_Window, DontDelete|ReadOnly, 0, 0 },
+ { "Node", Window::Node, DontDelete, 0, &WindowTableEntries[99] },
+ { "toolbar", Window::Toolbar, DontDelete|ReadOnly, 0, &WindowTableEntries[101] },
{ "Image", Window::Image, DontDelete|ReadOnly, 0, 0 },
{ "onabort", Window::Onabort, DontDelete, 0, 0 },
{ "onmousemove", Window::Onmousemove, DontDelete, 0, 0 },
- { "scrollTo", Window::ScrollTo, DontDelete|Function, 2, &WindowTableEntries[117] },
+ { "scrollTo", Window::ScrollTo, DontDelete|Function, 2, &WindowTableEntries[121] },
{ "onsearch", Window::Onsearch, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "screenLeft", Window::ScreenLeft, DontDelete|ReadOnly, 0, &WindowTableEntries[98] },
+ { "screenLeft", Window::ScreenLeft, DontDelete|ReadOnly, 0, &WindowTableEntries[100] },
{ "onmouseover", Window::Onmouseover, DontDelete, 0, 0 },
{ "crypto", Window::Crypto, DontDelete|ReadOnly, 0, 0 },
- { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, &WindowTableEntries[100] },
+ { "screenTop", Window::ScreenTop, DontDelete|ReadOnly, 0, &WindowTableEntries[103] },
{ "Range", Window::Range, DontDelete, 0, &WindowTableEntries[91] },
{ "status", Window::Status, DontDelete, 0, 0 },
{ "onreset", Window::Onreset, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "onselect", Window::Onselect, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "document", Window::Document, DontDelete|ReadOnly, 0, &WindowTableEntries[110] },
+ { "document", Window::Document, DontDelete|ReadOnly, 0, &WindowTableEntries[114] },
{ "onunload", Window::Onunload, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "onerror", Window::Onerror, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "innerHeight", Window::InnerHeight, DontDelete|ReadOnly, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[115] },
+ { "innerWidth", Window::InnerWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[119] },
{ "defaultstatus", Window::DefaultStatus, DontDelete, 0, 0 },
{ "name", Window::Name, DontDelete, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "Event", Window::EventCtor, DontDelete, 0, 0 },
{ "onresize", Window::Onresize, DontDelete, 0, 0 },
{ "navigator", Window::_Navigator, DontDelete|ReadOnly, 0, 0 },
- { "self", Window::Self, DontDelete|ReadOnly, 0, &WindowTableEntries[120] },
+ { "self", Window::Self, DontDelete|ReadOnly, 0, &WindowTableEntries[124] },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "clientInformation", Window::ClientInformation, DontDelete|ReadOnly, 0, &WindowTableEntries[93] },
{ 0, 0, 0, 0, 0 },
- { "outerWidth", Window::OuterWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[102] },
- { "getSelection", Window::GetSelection, DontDelete|Function, 0, &WindowTableEntries[111] },
+ { "outerWidth", Window::OuterWidth, DontDelete|ReadOnly, 0, &WindowTableEntries[105] },
+ { "getSelection", Window::GetSelection, DontDelete|Function, 0, &WindowTableEntries[115] },
{ 0, 0, 0, 0, 0 },
{ "blur", Window::Blur, DontDelete|Function, 0, 0 },
- { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
- { "DOMException", Window::DOMException, DontDelete, 0, 0 },
+ { "locationbar", Window::Locationbar, DontDelete, 0, &WindowTableEntries[106] },
+ { "DOMException", Window::DOMException, DontDelete, 0, &WindowTableEntries[96] },
{ 0, 0, 0, 0, 0 },
{ "setInterval", Window::SetInterval, DontDelete|Function, 2, 0 },
{ "scrollbars", Window::Scrollbars, DontDelete|ReadOnly, 0, 0 },
- { "clearTimeout", Window::ClearTimeout, DontDelete|Function, 1, &WindowTableEntries[103] },
- { "moveBy", Window::MoveBy, DontDelete|Function, 2, &WindowTableEntries[113] },
+ { "clearTimeout", Window::ClearTimeout, DontDelete|Function, 1, &WindowTableEntries[107] },
+ { "moveBy", Window::MoveBy, DontDelete|Function, 2, &WindowTableEntries[117] },
{ "alert", Window::Alert, DontDelete|Function, 1, 0 },
{ "clearInterval", Window::ClearInterval, DontDelete|Function, 1, 0 },
{ 0, 0, 0, 0, 0 },
{ "focus", Window::Focus, DontDelete|Function, 0, 0 },
{ 0, 0, 0, 0, 0 },
{ "location", Window::_Location, DontDelete, 0, 0 },
- { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 0, &WindowTableEntries[96] },
+ { "konqueror", Window::_Konqueror, DontDelete|ReadOnly, 0, &WindowTableEntries[98] },
{ "outerHeight", Window::OuterHeight, DontDelete|ReadOnly, 0, 0 },
- { "screenX", Window::ScreenX, DontDelete|ReadOnly, 0, &WindowTableEntries[116] },
- { "screenY", Window::ScreenY, DontDelete|ReadOnly, 0, &WindowTableEntries[105] },
+ { "screenX", Window::ScreenX, DontDelete|ReadOnly, 0, &WindowTableEntries[120] },
+ { "screenY", Window::ScreenY, DontDelete|ReadOnly, 0, &WindowTableEntries[109] },
+ { "statusbar", Window::Statusbar, DontDelete|ReadOnly, 0, 0 },
+ { "scroll", Window::Scroll, DontDelete|Function, 2, 0 },
{ "moveTo", Window::MoveTo, DontDelete|Function, 2, 0 },
- { "resizeBy", Window::ResizeBy, DontDelete|Function, 2, &WindowTableEntries[118] },
+ { "resizeBy", Window::ResizeBy, DontDelete|Function, 2, &WindowTableEntries[122] },
{ "resizeTo", Window::ResizeTo, DontDelete|Function, 2, 0 },
+ { "window", Window::_Window, DontDelete|ReadOnly, 0, 0 },
{ "screen", Window::_Screen, DontDelete|ReadOnly, 0, 0 },
- { "XMLHttpRequest", Window::XMLHttpRequest, DontDelete|ReadOnly, 0, &WindowTableEntries[101] },
- { "prompt", Window::Prompt, DontDelete|Function, 2, &WindowTableEntries[112] },
+ { "XMLHttpRequest", Window::XMLHttpRequest, DontDelete|ReadOnly, 0, &WindowTableEntries[104] },
+ { "prompt", Window::Prompt, DontDelete|Function, 2, &WindowTableEntries[116] },
{ "open", Window::Open, DontDelete|Function, 3, 0 },
+ { "setTimeout", Window::SetTimeout, DontDelete|Function, 2, 0 },
{ "close", Window::Close, DontDelete|Function, 0, 0 },
{ "captureEvents", Window::CaptureEvents, DontDelete|Function, 0, 0 },
{ "releaseEvents", Window::ReleaseEvents, DontDelete|Function, 0, 0 },
- { "addEventListener", Window::AddEventListener, DontDelete|Function, 3, &WindowTableEntries[109] },
+ { "addEventListener", Window::AddEventListener, DontDelete|Function, 3, &WindowTableEntries[113] },
{ "removeEventListener", Window::RemoveEventListener, DontDelete|Function, 3, 0 },
{ "onchange", Window::Onchange, DontDelete, 0, 0 },
{ "onclick", Window::Onclick, DontDelete, 0, 0 },
{ "onsubmit", Window::Onsubmit, DontDelete, 0, 0 }
};
-const struct HashTable WindowTable = { 2, 121, WindowTableEntries, 91 };
+const struct HashTable WindowTable = { 2, 125, WindowTableEntries, 91 };
} // namespace
namespace KJS {
+const struct HashEntry BarInfoTableEntries[] = {
+ { "visible", BarInfo::Visible, DontDelete|ReadOnly, 0, 0 }
+};
+
+const struct HashTable BarInfoTable = { 2, 1, BarInfoTableEntries, 1 };
+
+} // namespace
+
+namespace KJS {
+
const struct HashEntry HistoryTableEntries[] = {
{ 0, 0, 0, 0, 0 },
{ "back", History::Back, DontDelete|Function, 0, &HistoryTableEntries[4] },