Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-render

Source of release 0.6.2

0.6.2 / src / gfx / types_traits.lucb

#==============================================================================================
#
#   types_traits - hash traits of the key types of HashMap/HashTable instantiations
#
#   DESCRIPTION:
#       Generated by the skeleton generator (DESIGN.md ยง2.6): one declaration per distinct
#       instantiation the phase-1 declarations use, at donor commit 47c82b38d0.
#
#==============================================================================================

## AK::Traits<CssPixels>: AK's hash and equality for the key type.
pub struct CssPixelsTraits: ak.Traits[CssPixels]:
    var empty_: u8

    # Ported from Libraries/LibWeb/PixelUnits.h:495 AK::Traits<Web::CSSPixels>::hash.
    func hash_of(key: const CssPixels*) -> u32: return ak.u32_hash((u32)css_pixels_raw_value(key))

    # Ported from Libraries/LibWeb/PixelUnits.h:500 AK::Traits<Web::CSSPixels>::equals.
    func equals(a: const CssPixels*, b: const CssPixels*) -> bool: return *a == *b

## AK::Traits<FourCc>: AK's hash and equality for the key type.
pub struct FourCcTraits: ak.Traits[FourCc]:
    var empty_: u8

    func hash_of(key: const FourCc*) -> u32: return four_cc_to_u32(key)

    func equals(a: const FourCc*, b: const FourCc*) -> bool: return *a == *b

## AK::Traits<IntSize>: AK's hash and equality for the key type.
pub struct IntSizeTraits: ak.Traits[IntSize]:
    var empty_: u8

    # Ported from Libraries/LibGfx/Size.h:218 AK::Traits<Gfx::Size<T>>::hash.
    func hash_of(key: const IntSize*) -> u32: return int_size_hash(key)

    # AK::DefaultTraits<Gfx::IntSize>::equals: Size::operator==.
    func equals(a: const IntSize*, b: const IntSize*) -> bool: return int_size_eq(a, *b)