-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.JavaScriptCore.Flags
    ( 

 -- * Flags
-- ** ValuePropertyFlags #flag:ValuePropertyFlags#

    ValuePropertyFlags(..)                  ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL


-- Flags ValuePropertyFlags
-- | Flags used when defining properties with 'GI.JavaScriptCore.Objects.Value.valueObjectDefinePropertyData' and
-- 'GI.JavaScriptCore.Objects.Value.valueObjectDefinePropertyAccessor'.
data ValuePropertyFlags = 
      ValuePropertyFlagsConfigurable
    -- ^ the type of the property descriptor may be changed and the
    --  property may be deleted from the corresponding object.
    | ValuePropertyFlagsEnumerable
    -- ^ the property shows up during enumeration of the properties on
    --  the corresponding object.
    | ValuePropertyFlagsWritable
    -- ^ the value associated with the property may be changed with an
    --  assignment operator. This doesn\'t have any effect when passed to 'GI.JavaScriptCore.Objects.Value.valueObjectDefinePropertyAccessor'.
    | AnotherValuePropertyFlags Int
    -- ^ Catch-all for unknown values
    deriving (Int -> ValuePropertyFlags -> ShowS
[ValuePropertyFlags] -> ShowS
ValuePropertyFlags -> String
(Int -> ValuePropertyFlags -> ShowS)
-> (ValuePropertyFlags -> String)
-> ([ValuePropertyFlags] -> ShowS)
-> Show ValuePropertyFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValuePropertyFlags] -> ShowS
$cshowList :: [ValuePropertyFlags] -> ShowS
show :: ValuePropertyFlags -> String
$cshow :: ValuePropertyFlags -> String
showsPrec :: Int -> ValuePropertyFlags -> ShowS
$cshowsPrec :: Int -> ValuePropertyFlags -> ShowS
Show, ValuePropertyFlags -> ValuePropertyFlags -> Bool
(ValuePropertyFlags -> ValuePropertyFlags -> Bool)
-> (ValuePropertyFlags -> ValuePropertyFlags -> Bool)
-> Eq ValuePropertyFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValuePropertyFlags -> ValuePropertyFlags -> Bool
$c/= :: ValuePropertyFlags -> ValuePropertyFlags -> Bool
== :: ValuePropertyFlags -> ValuePropertyFlags -> Bool
$c== :: ValuePropertyFlags -> ValuePropertyFlags -> Bool
Eq)

instance P.Enum ValuePropertyFlags where
    fromEnum :: ValuePropertyFlags -> Int
fromEnum ValuePropertyFlagsConfigurable = 1
    fromEnum ValuePropertyFlagsEnumerable = 2
    fromEnum ValuePropertyFlagsWritable = 4
    fromEnum (AnotherValuePropertyFlags k :: Int
k) = Int
k

    toEnum :: Int -> ValuePropertyFlags
toEnum 1 = ValuePropertyFlags
ValuePropertyFlagsConfigurable
    toEnum 2 = ValuePropertyFlags
ValuePropertyFlagsEnumerable
    toEnum 4 = ValuePropertyFlags
ValuePropertyFlagsWritable
    toEnum k :: Int
k = Int -> ValuePropertyFlags
AnotherValuePropertyFlags Int
k

instance P.Ord ValuePropertyFlags where
    compare :: ValuePropertyFlags -> ValuePropertyFlags -> Ordering
compare a :: ValuePropertyFlags
a b :: ValuePropertyFlags
b = Int -> Int -> Ordering
forall a. Ord a => a -> a -> Ordering
P.compare (ValuePropertyFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum ValuePropertyFlags
a) (ValuePropertyFlags -> Int
forall a. Enum a => a -> Int
P.fromEnum ValuePropertyFlags
b)

instance IsGFlag ValuePropertyFlags