Changeset 34646 in webkit


Ignore:
Timestamp:
Jun 18, 2008 4:35:44 AM (16 years ago)
Author:
jmalonzo@webkit.org
Message:

2008-06-18 Marco Barisione <marco.barisione@collabora.co.uk>

Reviewed by Alp Toker.

https://bugs.webkit.org/show_bug.cgi?id=19171
[GTK] GTypes for enumerations

  • webkit/webkit.h: Include webkit-enum-types.h.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r34594 r34646  
     12008-06-18  Marco Barisione  <marco.barisione@collabora.co.uk>
     2
     3        Reviewed by Alp Toker.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=19171
     6        [GTK] GTypes for enumerations
     7
     8        Generate GTypes for public enumerations so they can be used as
     9        properties.
     10
     11        * GNUmakefile.am: Generate webkit-enum-types.cpp and
     12        webkit-enum-types.h.
     13
    1142008-06-16  Simon Hausmann  <hausmann@webkit.org>
    215
  • trunk/GNUmakefile.am

    r34568 r34646  
    233233
    234234libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
    235 libwebkit_1_0_la_HEADERS = $(webkitgtk_h_api)
     235libwebkit_1_0_la_HEADERS = \
     236        $(webkitgtk_h_api) \
     237        WebKit/gtk/webkit/webkitenumtypes.h
    236238
    237239libwebkit_1_0_la_SOURCES = \
     
    320322webkitgtk_built_sources += \
    321323        DerivedSources/webkit-marshal.h \
    322         DerivedSources/webkit-marshal.cpp
     324        DerivedSources/webkit-marshal.cpp \
     325        DerivedSources/webkitenumtypes.cpp \
     326        WebKit/gtk/webkit/webkitenumtypes.h
    323327
    324328webkitgtk_headers += \
     
    363367pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
    364368
     369stamp_files := \
     370        stamp-webkit-marshal.cpp \
     371        stamp-webkit-marshal.h \
     372        stamp-webkitenumtypes.cpp \
     373        stamp-webkitenumtypes.h
     374
    365375WEBKIT_MARSHAL = $(GENSOURCES)/webkit-marshal
    366376WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
    367 
    368 stamp_files := \
    369         stamp-webkit-marshal.cpp \
    370         stamp-webkit-marshal.h
    371377
    372378DerivedSources/webkit-marshal.cpp: stamp-webkit-marshal.cpp
     
    384390        $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
    385391        echo timestamp > $(@F)
     392
     393WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
     394        @true
     395stamp-webkitenumtypes.h: $(webkitgtk_h_api) Makefile
     396        (cd $(srcdir) \
     397        && glib-mkenums \
     398                        --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
     399                        --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
     400                        --fhead "#include <glib-object.h>\n\n" \
     401                        --fhead "#include <webkit/webkitdefines.h>\n\n" \
     402                        --fhead "G_BEGIN_DECLS\n\n" \
     403                        --ftail "G_END_DECLS\n\n" \
     404                        --ftail "#endif\n" \
     405                        --fprod "#include <@filename@>\n\n" \
     406                        --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
     407                        --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
     408                $(webkitgtk_h_api) | \
     409                sed 's,WebKit/gtk/,,' | \
     410                sed 's,web_kit,webkit,' | \
     411                sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
     412                ) > xgen-gth \
     413        && (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
     414        && rm -f xgen-gth \
     415        && echo timestamp > $(@F)
     416
     417DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) Makefile
     418        (cd $(srcdir) \
     419        && glib-mkenums \
     420                        --fhead "#include <config.h>\n" \
     421                        --fhead "#include <glib-object.h>\n" \
     422                        --fhead "#include \"$(srcdir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
     423                        --fhead "extern \"C\" {\n\n" \
     424                        --fprod "\n/* enumerations from \"@filename@\" */" \
     425                        --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
     426                        --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
     427                        --vtail "    { 0, NULL, NULL }\n};\n\n" \
     428                        --vtail "GType @enum_name@_get_type(void)\n{\n" \
     429                        --vtail "    static GType type = 0;\n\n" \
     430                        --vtail "    if (!type)\n" \
     431                        --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
     432                        --vtail "    return type;\n}\n\n" \
     433                        --ftail "}\n" \
     434                $(webkitgtk_h_api) | \
     435                sed 's,web_kit,webkit,' \
     436                ) > xgen-gtc \
     437        && cp xgen-gtc $@ \
     438        && rm -f xgen-gtc
    386439
    387440# END WEBKIT GTK+
  • trunk/WebKit/gtk/ChangeLog

    r34636 r34646  
     12008-06-18  Marco Barisione  <marco.barisione@collabora.co.uk>
     2
     3        Reviewed by Alp Toker.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=19171
     6        [GTK] GTypes for enumerations
     7
     8        * webkit/webkit.h: Include webkit-enum-types.h.
     9
    1102008-06-17  Christian Dywan  <christian@twotoasts.de>
    211
  • trunk/WebKit/gtk/webkit/webkit.h

    r34387 r34646  
    2929#include <webkit/webkitwebbackforwardlist.h>
    3030#include <webkit/webkitwebhistoryitem.h>
     31#include <webkit/webkitenumtypes.h>
    3132
    3233#endif /* __WEBKIT_H__ */
Note: See TracChangeset for help on using the changeset viewer.