# Path: tilenol/ewmh.py
# def match_type(*types):
#     types = tuple('_NET_WM_WINDOW_TYPE_' + typ.upper() for typ in types)
#     assert all(typ.isidentifier() for typ in types)
#     def type_checker(win):
#         for typ in types:
#             rtype = getattr(win.xcore.atom, typ)
#             if rtype in win.props.get('_NET_WM_WINDOW_TYPE', ()):
#                 return True
#     return type_checker


from zorro.di import di
from .ewmh import match_type
    def setter(win):
        win.ignore_hints = True
    return setter


def ignore_protocols(*ignore):
    def setter(win):
        win.ignore_protocols.update(ignore)
        win.protocols -= win.ignore_protocols
    return setter


def move_to_group_of(prop):
    def setter(win):
        wid = win.props[prop][0]
        other = di(win)['event-dispatcher'].all_windows[wid]
        win.lprops.group = other.lprops.group
    return setter


def move_to_group(group):
    def setter(win):
        gman = di(win)['group-manager']
        if group in gman.by_name:
            win.lprops.group = gman.groups.index(gman.by_name[group])
    return setter


all_conditions = {
    'match-role': match_role,

# Path: tilenol/ewmh.py
# def match_type(*types):
#     types = tuple('_NET_WM_WINDOW_TYPE_' + typ.upper() for typ in types)
#     assert all(typ.isidentifier() for typ in types)
#     def type_checker(win):
#         for typ in types:
#             rtype = getattr(win.xcore.atom, typ)
#             if rtype in win.props.get('_NET_WM_WINDOW_TYPE', ()):
#                 return True
#     return type_checker


# Path: tilenol/classify.py
from zorro.di import di
from .ewmh import match_type

    def setter(win):
        win.ignore_hints = True
    return setter


def ignore_protocols(*ignore):
    def setter(win):
        win.ignore_protocols.update(ignore)
        win.protocols -= win.ignore_protocols
    return setter


def move_to_group_of(prop):
    def setter(win):
        wid = win.props[prop][0]
        other = di(win)['event-dispatcher'].all_windows[wid]
        win.lprops.group = other.lprops.group
    return setter


def move_to_group(group):
    def setter(win):
        gman = di(win)['group-manager']
        if group in gman.by_name:
            win.lprops.group = gman.groups.index(gman.by_name[group])
    return setter


all_conditions = {
    'match-role': match_role,

    'match-type': match_type,