gi-gdk-3.0.23: Gdk bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gdk.Structs.Atom

Contents

- Exported types
- Methods
  - Overloaded methods
  - intern
  - internStaticString
  - name

Description

An opaque type representing a string as an index into a table of strings on the X server.

Synopsis

- newtype Atom = Atom (ManagedPtr Atom)
- atomIntern :: (HasCallStack, MonadIO m) => Text -> Bool -> m Atom
- atomInternStaticString :: (HasCallStack, MonadIO m) => Text -> m Atom
- atomName :: (HasCallStack, MonadIO m) => Atom -> m Text

# Exported types

newtype Atom Source #

Memory-managed wrapper type.

Constructors

Atom (ManagedPtr Atom) |

#### Instances

Instances details

Eq Atom Source # |
Instance details Defined in GI.Gdk.Structs.Atom Methods (==) :: Atom -> Atom -> Bool # (/=) :: Atom -> Atom -> Bool #
BoxedPtr Atom Source # |
Instance details Defined in GI.Gdk.Structs.Atom Methods boxedPtrCopy :: Atom -> IO Atom Source # boxedPtrFree :: Atom -> IO () Source #
ManagedPtrNewtype Atom Source # |
Instance details Defined in GI.Gdk.Structs.Atom Methods toManagedPtr :: Atom -> ManagedPtr Atom Source #

# Methods

## Overloaded methods

## intern

atomIntern Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `atomName`: a string.
-> Bool | `onlyIfExists`: if `True`, GDK is allowed to not create a new atom, but just return `GDK_NONE` if the requested atom doesn’t already exists. Currently, the flag is ignored, since checking the existance of an atom is as expensive as creating it.
-> m Atom | Returns: the atom corresponding to `atomName`.

Finds or creates an atom corresponding to a given string.

## internStaticString

atomInternStaticString Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `atomName`: a static string
-> m Atom | Returns: the atom corresponding to `atomName`

Finds or creates an atom corresponding to a given string.

Note that this function is identical to `atomIntern` except that if a new `Atom` is created the string itself is used rather than a copy. This saves memory, but can only be used if the string will always exist. It can be used with statically allocated strings in the main program, but not with statically allocated memory in dynamically loaded modules, if you expect to ever unload the module again (e.g. do not use this function in GTK+ theme engines).

Since: 2.10

## name

atomName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Atom | `atom`: a `Atom`.
-> m Text | Returns: a newly-allocated string containing the string corresponding to `atom`. When you are done with the return value, you should free it using `free`.

Determines the string corresponding to an atom.