Ejemplo n.º 1
0
PassRefPtr<Image> Image::loadPlatformResource(const char* name)
{
    CString fileName;
    if (!strcmp("missingImage", name))
        fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
    if (fileName.isNull()) {
        GUniquePtr<gchar> imageName(g_strdup_printf("%s.png", name));
        GUniquePtr<gchar> glibFileName(getPathToImageResource(imageName.get()));
        fileName = glibFileName.get();
    }

    return loadImageFromFile(fileName);
}
Ejemplo n.º 2
0
PassRefPtr<Image> Image::loadPlatformResource(const char* name)
{
    CString fileName;
    if (!strcmp("missingImage", name))
        fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
    if (fileName.isNull()) {
        GOwnPtr<gchar> imageName(g_strdup_printf("%s.png", name));
        GOwnPtr<gchar> glibFileName(g_build_filename(getWebKitDataDirectory(), "webkitgtk-"WEBKITGTK_API_VERSION_STRING, "images", imageName.get(), NULL));
        fileName = glibFileName.get();
    }

    return loadImageFromFile(fileName);
}
Ejemplo n.º 3
0
PassRefPtr<Image> Image::loadPlatformResource(const char* name)
{
    CString fileName;
    if (!strcmp("missingImage", name))
        fileName = getThemeIconFileName(GTK_STOCK_MISSING_IMAGE, 16);
    if (fileName.isNull()) {
        gchar* imagename = g_strdup_printf("%s.png", name);
        gchar* glibFileName = g_build_filename(DATA_DIR, "webkit-1.0", "images", imagename, 0);
        fileName = glibFileName;
        g_free(imagename);
        g_free(glibFileName);
    }

    return loadImageFromFile(fileName);
}
Ejemplo n.º 4
0
PassRefPtr<Image> Image::loadPlatformThemeIcon(const char* name, int size)
{
    return loadImageFromFile(getThemeIconFileName(name, size));
}