本文整理汇总了C++中dom::DocumentImpl类的典型用法代码示例。如果您正苦于以下问题:C++ DocumentImpl类的具体用法?C++ DocumentImpl怎么用?C++ DocumentImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DocumentImpl类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: monochromeMediaFeatureEval
static bool monochromeMediaFeatureEval(CSSValueImpl* value, RenderStyle*, KHTMLPart* part, MediaFeaturePrefix op)
{
KHTMLPart* rootPart = part;
while (rootPart->parentPart()) rootPart = rootPart->parentPart();
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl*>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
int depth = 0;
if (printing) {
if (pd->numColors() < 2)
depth = 1;
// assume printer is either b&w or color.
} else {
int sn = QApplication::desktop()->screenNumber( rootPart->view() );
if (QApplication::desktop()->screen(sn)->depth() == 1)
depth = 1;
else if (QColormap::instance(sn).mode() == QColormap::Gray)
depth = QApplication::desktop()->screen(sn)->depth();
}
if (value)
{
float number = 0;
return numberValue(value, number) && compareValue(depth, static_cast<int>(number), op);
}
return depth;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:26,代码来源:css_mediaquery.cpp
示例2: openURL
bool KHTMLImage::openURL( const KURL &url )
{
static const QString &html = KGlobal::staticQString( "<html><body><img src=\"%1\"></body></html>" );
m_url = url;
emit started( 0 );
KParts::URLArgs args = m_ext->urlArgs();
m_mimeType = args.serviceType;
m_khtml->begin( m_url, args.xOffset, args.yOffset );
m_khtml->setAutoloadImages( true );
DOM::DocumentImpl *impl = dynamic_cast<DOM::DocumentImpl *>( m_khtml->document().handle() ); // ### hack ;-)
if ( impl && m_ext->urlArgs().reload )
impl->docLoader()->setCachePolicy( KIO::CC_Refresh );
m_khtml->write( html.arg( m_url.url() ) );
m_khtml->end();
emit setWindowCaption( url.prettyURL() );
connect( khtml::Cache::loader(), SIGNAL( requestDone( khtml::DocLoader*, khtml::CachedObject *) ),
this, SLOT( updateWindowCaption() ) );
return true;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:27,代码来源:khtmlimage.cpp
示例3: orientationMediaFeatureEval
static bool orientationMediaFeatureEval(CSSValueImpl *value, RenderStyle *, KHTMLPart *part, MediaFeaturePrefix /*op*/)
{
if (value) {
CSSPrimitiveValueImpl *pv = static_cast<CSSPrimitiveValueImpl *>(value);
if (!value->isPrimitiveValue() || pv->primitiveType() != CSSPrimitiveValue::CSS_IDENT ||
(pv->getIdent() != CSS_VAL_PORTRAIT && pv->getIdent() != CSS_VAL_LANDSCAPE)) {
return false;
}
KHTMLPart *rootPart = part;
while (rootPart->parentPart()) {
rootPart = rootPart->parentPart();
}
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
if (printing) {
if (pd->width() > pd->height()) {
return (pv->getIdent() == CSS_VAL_LANDSCAPE);
}
} else {
if (part->view()->visibleWidth() > part->view()->visibleHeight()) {
return (pv->getIdent() == CSS_VAL_LANDSCAPE);
}
}
return (pv->getIdent() == CSS_VAL_PORTRAIT);
}
return false;
}
开发者ID:KDE,项目名称:khtml,代码行数:29,代码来源:css_mediaquery.cpp
示例4: aspect_ratioMediaFeatureEval
static bool aspect_ratioMediaFeatureEval(CSSValueImpl *value, RenderStyle *, KHTMLPart *part, MediaFeaturePrefix op)
{
if (value) {
KHTMLPart *rootPart = part;
while (rootPart->parentPart()) {
rootPart = rootPart->parentPart();
}
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
QSize vs;
int h = 0, v = 0;
if (printing) {
vs = QSize(pd->width(), pd->height());
} else {
vs = QSize(part->view()->visibleWidth(), part->view()->visibleHeight());
}
if (parseAspectRatio(value, h, v)) {
return v != 0 && compareValue(vs.width() * v, vs.height() * h, op);
}
return false;
}
// ({,min-,max-}aspect-ratio)
// assume if we have a viewport, its aspect ratio is non-zero
return true;
}
开发者ID:KDE,项目名称:khtml,代码行数:26,代码来源:css_mediaquery.cpp
示例5: device_aspect_ratioMediaFeatureEval
static bool device_aspect_ratioMediaFeatureEval(CSSValueImpl *value, RenderStyle *, KHTMLPart *part, MediaFeaturePrefix op)
{
if (value) {
KHTMLPart *rootPart = part;
while (rootPart->parentPart()) {
rootPart = rootPart->parentPart();
}
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
QRect sg;
int h = 0, v = 0;
if (printing) {
sg = QRect(0, 0, pd->width(), pd->height());
} else {
sg = QApplication::desktop()->screen(QApplication::desktop()->screenNumber(rootPart->view()))->rect();
}
if (parseAspectRatio(value, h, v)) {
return v != 0 && compareValue(sg.width() * v, sg.height() * h, op);
}
return false;
}
// ({,min-,max-}device-aspect-ratio)
// assume if we have a device, its aspect ratio is non-zero
return true;
}
开发者ID:KDE,项目名称:khtml,代码行数:27,代码来源:css_mediaquery.cpp
示例6: colorMediaFeatureEval
static bool colorMediaFeatureEval(CSSValueImpl *value, RenderStyle *, KHTMLPart *part, MediaFeaturePrefix op)
{
KHTMLPart *rootPart = part;
while (rootPart->parentPart()) {
rootPart = rootPart->parentPart();
}
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
int bitsPerComponent = 0;
if (printing) {
if (pd->colorCount() > 2) {
bitsPerComponent = pd->depth() / 3;
}
// assume printer is either b&w or color.
} else {
int sn = QApplication::desktop()->screenNumber(rootPart->view());
if (QColormap::instance(sn).mode() != QColormap::Gray) {
bitsPerComponent = QApplication::desktop()->screen(sn)->depth() / 3;
}
}
if (value && bitsPerComponent) {
float number = 0;
return numberValue(value, number) && compareValue(bitsPerComponent, static_cast<int>(number), op);
}
return bitsPerComponent;
}
开发者ID:KDE,项目名称:khtml,代码行数:27,代码来源:css_mediaquery.cpp
示例7: color_indexMediaFeatureEval
static bool color_indexMediaFeatureEval(CSSValueImpl *value, RenderStyle *, KHTMLPart *part, MediaFeaturePrefix op)
{
KHTMLPart *rootPart = part;
while (rootPart->parentPart()) {
rootPart = rootPart->parentPart();
}
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
unsigned int numColors = 0;
if (printing) {
numColors = pd->colorCount();
} else {
int sn = QApplication::desktop()->screenNumber(rootPart->view());
numColors = QApplication::desktop()->screen(sn)->colorCount();
}
if (numColors == INT_MAX) {
numColors = UINT_MAX;
}
if (value) {
float number = 0;
return numberValue(value, number) && compareValue(numColors, static_cast<unsigned int>(number), op);
}
return numColors;
}
开发者ID:KDE,项目名称:khtml,代码行数:26,代码来源:css_mediaquery.cpp
示例8: resolutionMediaFeatureEval
static bool resolutionMediaFeatureEval(CSSValueImpl* value, RenderStyle*, KHTMLPart* part, MediaFeaturePrefix op)
{
DOM::DocumentImpl *d = static_cast<DOM::DocumentImpl*>(part->document().handle());
int logicalDpiY = d ? d->logicalDpiY() : 0;
if (value && logicalDpiY)
return value->isPrimitiveValue() && compareValue(logicalDpiY, static_cast<CSSPrimitiveValueImpl*>(value)->getDPIResolution(), op);
return logicalDpiY != 0;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:10,代码来源:css_mediaquery.cpp
示例9: tryCall
Value XMLSerializerProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
{
if (!thisObj.inherits(&XMLSerializer::info)) {
Object err = Error::create(exec,TypeError);
exec->setException(err);
return err;
}
switch (id) {
case XMLSerializer::SerializeToString:
{
if (args.size() != 1) {
return Undefined();
}
if (!args[0].toObject(exec).inherits(&DOMDocument::info)) {
return Undefined();
}
DOM::Node docNode = static_cast<KJS::DOMDocument *>(args[0].toObject(exec).imp())->toNode();
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(docNode.handle());
if (!doc) {
return Undefined();
}
QString body;
try {
body = doc->toString().string();
} catch(DOM::DOMException& e) {
Object err = Error::create(exec, GeneralError, "Exception serializing document");
exec->setException(err);
return err;
}
return getStringOrNull(body);
}
}
return Undefined();
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:42,代码来源:xmlserializer.cpp
示例10: heightMediaFeatureEval
static bool heightMediaFeatureEval(CSSValueImpl* value, RenderStyle* style, KHTMLPart* part, MediaFeaturePrefix op)
{
KHTMLPart* rootPart = part;
while (rootPart->parentPart()) rootPart = rootPart->parentPart();
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl*>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
int height;
if (printing)
height = pd->height();
else {
height = part->view()->visibleHeight();
doc = static_cast<DOM::DocumentImpl*>(part->document().handle());
}
int logicalDpiY = doc->logicalDpiY();
if (value)
return value->isPrimitiveValue() && compareValue(height, static_cast<CSSPrimitiveValueImpl*>(value)->computeLength(style, logicalDpiY), op);
return height > 0;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:20,代码来源:css_mediaquery.cpp
示例11: device_widthMediaFeatureEval
static bool device_widthMediaFeatureEval(CSSValueImpl* value, RenderStyle* style, KHTMLPart* part, MediaFeaturePrefix op)
{
if (value) {
KHTMLPart* rootPart = part;
while (rootPart->parentPart()) rootPart = rootPart->parentPart();
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl*>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
int width;
if (printing)
width = pd->width();
else {
width = QApplication::desktop()->screen(QApplication::desktop()->screenNumber( rootPart->view() ))->rect().width();
doc = static_cast<DOM::DocumentImpl*>(part->document().handle());
}
int logicalDpiY = doc->logicalDpiY();
return value->isPrimitiveValue() && compareValue(width, static_cast<CSSPrimitiveValueImpl*>(value)->computeLength(style,logicalDpiY), op);
}
// ({,min-,max-}device-width)
// assume if we have a device, assume non-zero
return true;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:22,代码来源:css_mediaquery.cpp
示例12: widthMediaFeatureEval
static bool widthMediaFeatureEval(CSSValueImpl *value, RenderStyle *style, KHTMLPart *part, MediaFeaturePrefix op)
{
KHTMLPart *rootPart = part;
while (rootPart->parentPart()) {
rootPart = rootPart->parentPart();
}
DOM::DocumentImpl *doc = static_cast<DOM::DocumentImpl *>(rootPart->document().handle());
QPaintDevice *pd = doc->paintDevice();
bool printing = pd ? (pd->devType() == QInternal::Printer) : false;
int width;
if (printing) {
width = pd->width();
} else {
width = part->view()->visibleWidth();
doc = static_cast<DOM::DocumentImpl *>(part->document().handle());
}
int logicalDpiY = doc->logicalDpiY();
if (value) {
return value->isPrimitiveValue() && compareValue(width, static_cast<CSSPrimitiveValueImpl *>(value)->computeLength(style, style, logicalDpiY), op);
}
return width > 0;
}
开发者ID:KDE,项目名称:khtml,代码行数:23,代码来源:css_mediaquery.cpp
注:本文中的dom::DocumentImpl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论