- HookType.ob_type = &PyType_Type;
- HookType.tp_methods = HookMethods;
- HookType.tp_alloc = PyType_GenericAlloc;
- HookType.tp_new = PyType_GenericNew;
- HookType.tp_init = (initproc) hook_init;
- HookType.tp_call = (ternaryfunc) hook_call;
- PyType_Ready(&HookType);
-
- Py_InitModule("hooks", HooksMethods);
-
- /* get the hooks module/dict */
- hooks = PyImport_ImportModule("hooks"); /* new */
- g_assert(hooks != NULL);
- hooksdict = PyModule_GetDict(hooks); /* borrowed */
- g_assert(hooksdict != NULL);
-
- /* add the Hook type to the hooks module */
- PyDict_SetItemString(hooksdict, "Hook", (PyObject*) &HookType);
-
- hook_startup = hooks_create("startup");
- hook_shutdown = hooks_create("shutdown");
- hook_visibledesktop = hooks_create("visibledesktop");
- hook_numdesktops = hooks_create("numdesktops");
- hook_desktopnames = hooks_create("desktopnames");
- hook_showdesktop = hooks_create("showdesktop");
- hook_screenconfiguration = hooks_create("screenconfiguration");
- hook_screenarea = hooks_create("screenarea");
- hook_managed = hooks_create("managed");
- hook_closed = hooks_create("closed");
- hook_bell = hooks_create("bell");
- hook_urgent = hooks_create("urgent");
- hook_pointerenter = hooks_create("pointerenter");
- hook_pointerleave = hooks_create("pointerleave");
- hook_focused = hooks_create("focused");
- hook_requestactivate = hooks_create("requestactivate");
- hook_title = hooks_create("title");
- hook_desktop = hooks_create("desktop");
- hook_iconic = hooks_create("iconic");
- hook_shaded = hooks_create("shaded");
- hook_maximized = hooks_create("maximized");
- hook_fullscreen = hooks_create("fullscreen");
- hook_visible = hooks_create("visible");
- hook_configuration = hooks_create("configuration");