summaryrefslogtreecommitdiffstats
path: root/lib/Phi/X11/AtomList.hs
blob: 5fbd98c1b1fb34f7fc4eee56c646561fd6e487c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{-# LANGUAGE TemplateHaskell #-}

module Phi.X11.AtomList ( atoms
                        , specialAtoms
                        ) where

import Language.Haskell.TH

import Graphics.XHB
import Graphics.XHB.Connection.Open

atoms :: [String]
atoms = [ "ATOM"
        , "CARDINAL"
        , "STRING"
        , "UTF8_STRING"
        , "WM_NAME"
        , "WM_CLASS"
        , "WM_TRANSIENT_FOR"
        , "MANAGER"
        , "_NET_WM_NAME"
        , "_NET_WM_WINDOW_TYPE"
        , "_NET_WM_WINDOW_TYPE_NORMAL"
        , "_NET_WM_WINDOW_TYPE_DOCK"
        , "_NET_WM_WINDOW_TYPE_DESKTOP"
        , "_NET_WM_WINDOW_TYPE_TOOLBAR"
        , "_NET_WM_WINDOW_TYPE_MENU"
        , "_NET_WM_WINDOW_TYPE_SPLASH"
        , "_NET_WM_DESKTOP"
        , "_NET_WM_ICON"
        , "_NET_WM_STATE"
        , "_NET_WM_STATE_SKIP_PAGER"
        , "_NET_WM_STATE_SKIP_TASKBAR"
        , "_NET_WM_STATE_STICKY"
        , "_NET_WM_STATE_BELOW"
        , "_NET_WM_STRUT"
        , "_NET_WM_STRUT_PARTIAL"
        , "_NET_WM_PID"
        , "_NET_SYSTEM_TRAY_OPCODE"
        , "_NET_SYSTEM_TRAY_ORIENTATION"
        , "_NET_SYSTEM_TRAY_VISUAL"
        , "_NET_ACTIVE_WINDOW"
        , "_NET_NUMBER_OF_DESKTOPS"
        , "_NET_CURRENT_DESKTOP"
        , "_NET_DESKTOP_NAMES"
        , "_NET_CLIENT_LIST"
        , "_MOTIF_WM_HINTS"
        , "_XEMBED"
        , "_XROOTPMAP_ID"
        , "_XROOTMAP_ID"
        ]

-- the expression must have the type (Connection -> String)
specialAtoms :: [(String, Q Exp)]
specialAtoms = [ ("_NET_SYSTEM_TRAY_SCREEN", [|("_NET_SYSTEM_TRAY_S" ++) . show . screen . displayInfo|])
               ]