Changeset 96225 in webkit


Ignore:
Timestamp:
Sep 28, 2011 9:20:57 AM (13 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Add WebKitError to GTK+ WebKit2 API
https://bugs.webkit.org/show_bug.cgi?id=68508

Reviewed by Martin Robinson.

Source/WebKit2:

Add WebKitNetworkError enum to define network errors.

  • GNUmakefile.am: Add new files to compilation.
  • UIProcess/API/gtk/WebKitError.cpp: Added.

(webkit_network_error_quark):

  • UIProcess/API/gtk/WebKitError.h:
  • UIProcess/API/gtk/WebKitPrivate.h: Add

COMPILE_ASSERT_MATCHING_ENUM macro.

  • UIProcess/API/gtk/webkit2.h: Add WebKitError.h and

WebKitEnumTypes.h

Tools:

  • GNUmakefile.am: Add path to webkitgtk derived sources to the

include path.

Location:
trunk
Files:
1 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r96213 r96225  
     12011-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add WebKitError to GTK+ WebKit2 API
     4        https://bugs.webkit.org/show_bug.cgi?id=68508
     5
     6        Reviewed by Martin Robinson.
     7
     8        Add WebKitNetworkError enum to define network errors.
     9
     10        * GNUmakefile.am: Add new files to compilation.
     11        * UIProcess/API/gtk/WebKitError.cpp: Added.
     12        (webkit_network_error_quark):
     13        * UIProcess/API/gtk/WebKitError.h:
     14        * UIProcess/API/gtk/WebKitPrivate.h: Add
     15        COMPILE_ASSERT_MATCHING_ENUM macro.
     16        * UIProcess/API/gtk/webkit2.h: Add WebKitError.h and
     17        WebKitEnumTypes.h
     18
    1192011-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebKit2/GNUmakefile.am

    r96213 r96225  
    6969
    7070libwebkit2gtkincludedir = $(libwebkitgtkincludedir)/webkit2
    71 libwebkit2gtkinclude_HEADERS = \
     71webkit2gtk_headers = \
     72        $(WebKit2)/UIProcess/API/gtk/WebKitError.h \
    7273        $(WebKit2)/UIProcess/API/gtk/WebKitWebContext.h \
    7374        $(WebKit2)/UIProcess/API/gtk/WebKitWebView.h \
     
    454455        Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
    455456        Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \
     457        Source/WebKit2/UIProcess/API/gtk/WebKitError.h \
     458        Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp \
    456459        Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h \
    457460        Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h \
     
    858861        -I$(top_builddir)/DerivedSources/WebKit2 \
    859862        -I$(top_builddir)/DerivedSources/WebKit2/include \
    860         -I$(top_builddir)/DerivedSources/WebKit2/include/webkit2gtk \
     863        -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
     864        -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
    861865        -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
    862866        -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
     
    937941BUILT_SOURCES += generate-webkit2-forwarding-headers
    938942
    939 $(GENSOURCES_WEBKIT2)/include/webkit2gtk/webkit2: $(libwebkit2gtkinclude_HEADERS)
    940         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/include/webkit2gtk \
     943$(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2: $(webkit2gtk_headers)
     944        $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/include \
    941945        && ln -s -f ${shell pwd}/$(WebKit2)/UIProcess/API/gtk $@
    942946
    943 BUILT_SOURCES += $(GENSOURCES_WEBKIT2)/include/webkit2gtk/webkit2
     947BUILT_SOURCES += $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2
    944948
    945949vpath %.messages.in = \
     
    981985        $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-messages-header.py $< > $@
    982986
     987webkit2gtk_built_headers_dir := $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2
     988$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h: stamp-webkit2enumtypes
     989        @true
     990
     991stamp-webkit2enumtypes: $(webkit2gtk_headers) $(WebKit2)/GNUmakefile.am
     992        $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
     993        && glib-mkenums \
     994                        --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
     995                        --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
     996                        --fhead "#include <glib-object.h>\n\n" \
     997                        --fhead "#include <WebKit2/WKBase.h>\n\n" \
     998                        --fhead "G_BEGIN_DECLS\n\n" \
     999                        --ftail "G_END_DECLS\n\n" \
     1000                        --ftail "#endif\n" \
     1001                        --fprod "#include <webkit2/@basename@>\n\n" \
     1002                        --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
     1003                        --eprod "WK_EXPORT GType\n@enum_name@_get_type(void);\n\n" \
     1004                $(webkit2gtk_headers) | \
     1005                sed 's,web_kit,webkit,' | \
     1006                sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
     1007                > xgen-gth \
     1008        && (cmp -s xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h || cp xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h) \
     1009        && rm -f xgen-gth \
     1010        && echo timestamp > $(@F)
     1011
     1012$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp: $(webkit2gtk_headers) $(WebKit2)/GNUmakefile.am
     1013        $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
     1014        && glib-mkenums \
     1015                        --fhead "#include <config.h>\n" \
     1016                        --fhead "#include <glib-object.h>\n" \
     1017                        --fhead "#include \"$(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h\"\n\n" \
     1018                        --fhead "extern \"C\" {\n\n" \
     1019                        --fprod "\n/* Enumerations from \"@filename@\". */" \
     1020                        --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
     1021                        --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
     1022                        --vtail "    { 0, NULL, NULL }\n};\n\n" \
     1023                        --vtail "GType @enum_name@_get_type(void)\n{\n" \
     1024                        --vtail "    static GType type = 0;\n\n" \
     1025                        --vtail "    if (!type)\n" \
     1026                        --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
     1027                        --vtail "    return type;\n}\n\n" \
     1028                        --ftail "}\n" \
     1029                $(webkit2gtk_headers) | \
     1030                sed 's,web_kit,webkit,' \
     1031                > xgen-gtc \
     1032        && cp xgen-gtc $@ \
     1033        && rm -f xgen-gtc
     1034
     1035
     1036BUILT_SOURCES += \
     1037        $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp \
     1038        $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h
     1039
    9831040CLEANFILES += \
    9841041        $(BUILT_SOURCES) \
     1042        $(top_builddir)/stamp-webkit2enumtypes \
    9851043        $(top_builddir)/Programs/WebKitWebProcess
    9861044
     
    9991057        -I$(srcdir)/Source/WebKit2 \
    10001058        -I$(top_builddir)/DerivedSources/WebKit2/include \
    1001         -I$(top_builddir)/DerivedSources/WebKit2/include/webkit2gtk \
     1059        -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
     1060        -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
    10021061        -I$(srcdir)/Source/WebKit2/UIProcess/API/gtk \
    10031062        $(global_cflags) \
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitError.h

    r96224 r96225  
    11/*
    22 * Copyright (C) 2011 Igalia S.L.
     3 * Copyright (C) 2008 Luca Bruno <lethalman88@gmail.com>
    34 *
    45 * This library is free software; you can redistribute it and/or
     
    1819 */
    1920
    20 #ifndef __WEBKIT2_H__
    21 #define __WEBKIT2_H__
     21#ifndef WebKitError_h
     22#define WebKitError_h
    2223
    23 #include <webkit2/WebKitWebContext.h>
    24 #include <webkit2/WebKitWebViewBase.h>
    25 #include <webkit2/WebKitWebView.h>
     24#include <WebKit2/WKBase.h>
     25#include <glib.h>
    2626
    27 #endif /* __WEBKIT2_H__ */
     27G_BEGIN_DECLS
     28
     29#define WEBKIT_NETWORK_ERROR webkit_network_error_quark ()
     30
     31typedef enum {
     32    WEBKIT_NETWORK_ERROR_FAILED = 399,
     33    WEBKIT_NETWORK_ERROR_TRANSPORT = 300,
     34    WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL = 301,
     35    WEBKIT_NETWORK_ERROR_CANCELLED = 302,
     36    WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST = 303
     37} WebKitNetworkError;
     38
     39WK_EXPORT GQuark
     40webkit_network_error_quark (void);
     41
     42G_END_DECLS
     43
     44#endif
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h

    r96136 r96225  
    2828
    2929#include <glib.h>
     30#include <wtf/Assertions.h>
    3031
    3132G_BEGIN_DECLS
     
    3536#define WEBKIT_PARAM_READWRITE (static_cast<GParamFlags>(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
    3637
     38#define COMPILE_ASSERT_MATCHING_ENUM(webkitName, webcoreName) \
     39        COMPILE_ASSERT(int(webkitName) == int(WebCore::webcoreName), mismatchingEnums)
     40
    3741G_END_DECLS
    3842
  • trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h

    r96133 r96225  
    2121#define __WEBKIT2_H__
    2222
     23#include <webkit2/WebKitEnumTypes.h>
     24#include <webkit2/WebKitError.h>
    2325#include <webkit2/WebKitWebContext.h>
    2426#include <webkit2/WebKitWebViewBase.h>
  • trunk/Tools/ChangeLog

    r96214 r96225  
     12011-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Add WebKitError to GTK+ WebKit2 API
     4        https://bugs.webkit.org/show_bug.cgi?id=68508
     5
     6        Reviewed by Martin Robinson.
     7
     8        * GNUmakefile.am: Add path to webkitgtk derived sources to the
     9        include path.
     10
    1112011-09-28  Philippe Normand  <pnormand@igalia.com>
    212
  • trunk/Tools/GNUmakefile.am

    r96121 r96225  
    5858        -I$(top_builddir)/Source/WebKit2/UIProcess/API/gtk \
    5959        -I$(srcdir)/Source/WebKit/gtk \
    60         -I$(top_builddir)/DerivedSources/WebKit2/include/webkit2gtk \
     60        -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
     61        -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
    6162        -I$(top_builddir)/Source/WebKit/gtk \
    6263        -I$(top_builddir)/DerivedSources \
Note: See TracChangeset for help on using the changeset viewer.