/*
 * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
 *
 * This file was generated by the dom/make_names.pl script.
 *
 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "config.h"

#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
#define CSS_WebKitFontFamily_NAMES_HIDE_GLOBALS 1
#else
#define QNAME_DEFAULT_CONSTRUCTOR 1
#endif

#include "WebKitFontFamilyNames.h"

namespace WebCore {

namespace WebKitFontFamilyNames {

using namespace WTF;

#if COMPILER(MSVC)
#pragma warning(push)
#pragma warning(disable: 4307)
#endif

static constexpr StringImpl::StaticStringImpl cursiveFamilyData("-webkit-cursive");
static constexpr StringImpl::StaticStringImpl fantasyFamilyData("-webkit-fantasy");
static constexpr StringImpl::StaticStringImpl monospaceFamilyData("-webkit-monospace");
static constexpr StringImpl::StaticStringImpl pictographFamilyData("-webkit-pictograph");
static constexpr StringImpl::StaticStringImpl sansSerifFamilyData("-webkit-sans-serif");
static constexpr StringImpl::StaticStringImpl serifFamilyData("-webkit-serif");
static constexpr StringImpl::StaticStringImpl standardFamilyData("-webkit-standard");
static constexpr StringImpl::StaticStringImpl systemUiFamilyData("-webkit-system-ui");

#if COMPILER(MSVC)
#pragma warning(pop)
#endif

LazyNeverDestroyed<FamilyNamesList<const StaticStringImpl*, 8>> familyNamesData;
MainThreadLazyNeverDestroyed<FamilyNamesList<AtomStringImpl*, 8>> familyNames;

MainThreadLazyNeverDestroyed<const AtomString> cursiveFamily;
MainThreadLazyNeverDestroyed<const AtomString> fantasyFamily;
MainThreadLazyNeverDestroyed<const AtomString> monospaceFamily;
MainThreadLazyNeverDestroyed<const AtomString> pictographFamily;
MainThreadLazyNeverDestroyed<const AtomString> sansSerifFamily;
MainThreadLazyNeverDestroyed<const AtomString> serifFamily;
MainThreadLazyNeverDestroyed<const AtomString> standardFamily;
MainThreadLazyNeverDestroyed<const AtomString> systemUiFamily;

void init()
{
    static bool initialized = false;
    if (initialized)
        return;
    initialized = true;

    // Use placement new to initialize the globals.

    AtomString::init();

#ifndef NDEBUG
    reinterpret_cast<const StringImpl*>(&cursiveFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&fantasyFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&monospaceFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&pictographFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&sansSerifFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&serifFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&standardFamilyData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&systemUiFamilyData)->assertHashIsCorrect();
#endif // NDEBUG

    familyNamesData.construct();
    familyNamesData->uncheckedAppend(&cursiveFamilyData);
    familyNamesData->uncheckedAppend(&fantasyFamilyData);
    familyNamesData->uncheckedAppend(&monospaceFamilyData);
    familyNamesData->uncheckedAppend(&pictographFamilyData);
    familyNamesData->uncheckedAppend(&sansSerifFamilyData);
    familyNamesData->uncheckedAppend(&serifFamilyData);
    familyNamesData->uncheckedAppend(&standardFamilyData);
    familyNamesData->uncheckedAppend(&systemUiFamilyData);

    cursiveFamily.construct(&cursiveFamilyData);
    fantasyFamily.construct(&fantasyFamilyData);
    monospaceFamily.construct(&monospaceFamilyData);
    pictographFamily.construct(&pictographFamilyData);
    sansSerifFamily.construct(&sansSerifFamilyData);
    serifFamily.construct(&serifFamilyData);
    standardFamily.construct(&standardFamilyData);
    systemUiFamily.construct(&systemUiFamilyData);

    familyNames.construct();
    familyNames->uncheckedAppend(cursiveFamily->impl());
    familyNames->uncheckedAppend(fantasyFamily->impl());
    familyNames->uncheckedAppend(monospaceFamily->impl());
    familyNames->uncheckedAppend(pictographFamily->impl());
    familyNames->uncheckedAppend(sansSerifFamily->impl());
    familyNames->uncheckedAppend(serifFamily->impl());
    familyNames->uncheckedAppend(standardFamily->impl());
    familyNames->uncheckedAppend(systemUiFamily->impl());
}
}
}
