Exemple #1
0
static bool shouldCreateMainFrameScrollbar(const ScrollView* scrollView)
{
    // Interior frame ScrollViews never have MainFrameScrollbars.
    if (scrollView->parent())
        return false;

    // If we don't have a host window or a containing widget (ala WebKit2).
    HostWindow* hostWindow = scrollView->hostWindow();
    if (!hostWindow || !hostWindow->platformPageClient())
        return false;

    gboolean selfScrolling = FALSE;
    g_object_get(hostWindow->platformPageClient(), "self-scrolling", &selfScrolling, NULL);
    return !selfScrolling;
}
Exemple #2
0
static AtkObject* atkParentOfRootObject(AtkObject* object)
{
    AccessibilityObject* coreObject = core(object);
    AccessibilityObject* coreParent = coreObject->parentObjectUnignored();

    // The top level object claims to not have a parent. This makes it
    // impossible for assistive technologies to ascend the accessible
    // hierarchy all the way to the application. (Bug 30489)
    if (!coreParent && isRootObject(coreObject)) {
        Document* document = coreObject->document();
        if (!document)
            return 0;

#if PLATFORM(GTK)
        HostWindow* hostWindow = document->view()->hostWindow();
        if (hostWindow) {
            PlatformPageClient scrollView = hostWindow->platformPageClient();
            if (scrollView) {
                GtkWidget* scrollViewParent = gtk_widget_get_parent(scrollView);
                if (scrollViewParent)
                    return gtk_widget_get_accessible(scrollViewParent);
            }
        }
#endif // PLATFORM(GTK)
    }

    if (!coreParent)
        return 0;

    return coreParent->wrapper();
}
static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
{
    AccessibilityObject* coreObject = core(textObject);

    HostWindow* hostWindow = coreObject->document()->view()->hostWindow();
    if (!hostWindow)
        return 0;
    PlatformPageClient webView = hostWindow->platformPageClient();
    if (!webView)
        return 0;

    GString* str = g_string_new(NULL);

    AccessibilityRenderObject* accObject = static_cast<AccessibilityRenderObject*>(coreObject);
    if (!accObject)
        return 0;
    RenderText* renderText = toRenderText(accObject->renderer());
    if (!renderText)
        return 0;

    // Create a string with the layout as it appears on the screen
    InlineTextBox* box = renderText->firstTextBox();
    while (box) {
        gchar *text = convertUniCharToUTF8(renderText->characters(), renderText->textLength(), box->start(), box->end());
        g_string_append(str, text);
        g_string_append(str, "\n");
        box = box->nextTextBox();
    }

    PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), g_string_free(str, FALSE));
    g_object_set_data_full(G_OBJECT(textObject), "webkit-accessible-pango-layout", layout, g_object_unref);
    return layout;
}
Exemple #4
0
QWebPageClient* PluginView::platformPageClient() const
{
    FrameView* view = m_parentFrame->view();
    if (!view)
        return 0;
    HostWindow* hostWindow = view->hostWindow();
    if (!hostWindow)
        return 0;
    return hostWindow->platformPageClient();
}
Exemple #5
0
static PlatformPageClient toPlatformPageClient(Widget* widget)
{
    if (!widget)
        return 0;
    ScrollView* root = widget->root();
    if (!root)
        return 0;
    HostWindow* hostWindow = root->hostWindow();
    if (!hostWindow)
        return 0;
    return hostWindow->platformPageClient();
}
static PangoLayout* getPangoLayoutForAtk(AtkText* textObject)
{
    AccessibilityObject* coreObject = core(textObject);

    Document* document = coreObject->document();
    if (!document)
        return 0;

    HostWindow* hostWindow = document->view()->hostWindow();
    if (!hostWindow)
        return 0;
    PlatformPageClient webView = hostWindow->platformPageClient();
    if (!webView)
        return 0;

    // Create a string with the layout as it appears on the screen
    PangoLayout* layout = gtk_widget_create_pango_layout(static_cast<GtkWidget*>(webView), textForObject(coreObject));
    return layout;
}
void Widget::setCursor(const Cursor& cursor)
{
#if PLATFORM(AMIGAOS4)
    if (!isFrameView())
        return;

    static const Cursor *waitCursorPtr = &waitCursor();
    HostWindow *hostWindow = static_cast<FrameView*>(this)->hostWindow();
    BalWidget *widget = hostWindow ? hostWindow->platformPageClient() : 0;
    Window *window = widget ? widget->window : 0;

    if (window)
        if (waitCursorPtr == &cursor && !cursor.impl())
            IIntuition->SetWindowPointer(window, WA_BusyPointer, TRUE, TAG_DONE);
        else if (widget->curentCursor != cursor.impl()) {
            IIntuition->SetWindowPointer(window, WA_Pointer, cursor.impl(), TAG_DONE);
            widget->curentCursor = cursor.impl();
        }
#endif
}
static AtkObject* webkit_accessible_get_parent(AtkObject* object)
{
    AccessibilityObject* coreParent = core(object)->parentObjectUnignored();

    // The top level web view claims to not have a parent. This makes it
    // impossible for assistive technologies to ascend the accessible
    // hierarchy all the way to the application. (Bug 30489)
    if (!coreParent && core(object)->isWebArea()) {
        HostWindow* hostWindow = core(object)->document()->view()->hostWindow();
        if (hostWindow) {
            PlatformPageClient webView = hostWindow->platformPageClient();
            if (webView) {
                GtkWidget* webViewParent = gtk_widget_get_parent(webView);
                if (webViewParent)
                    return gtk_widget_get_accessible(webViewParent);
            }
        }
    }

    if (!coreParent)
        return NULL;

    return coreParent->wrapper();
}