/* name: stk_components.h info: auxiliary object which handle mechanism of bidirectional linked list features of stk_components author: Dusan Halicky (dvh.tosomja@post.sk) licence: GNU GPL history: 2005-09-26 - start of developement todo: - finish and release this bugs: - */ #ifndef STK_COMPONENTS #define STK_COMPONENTS #define STK_ALL_EVENTS NoEventMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | \ PointerMotionMask | PointerMotionHintMask | Button1MotionMask | Button2MotionMask | Button3MotionMask | Button4MotionMask | Button5MotionMask | \ ButtonMotionMask | KeymapStateMask | ExposureMask | VisibilityChangeMask | StructureNotifyMask | ResizeRedirectMask | SubstructureNotifyMask | \ SubstructureRedirectMask | FocusChangeMask | PropertyChangeMask | ColormapChangeMask | OwnerGrabButtonMask extern XEvent stkevent; // next event given from the server extern StkComponent* stkeventcomponent; // component which call the event, important when you are using dynamicaly created components void stk_next_event(); // this get next event from the server // driver for the group of components stored in one window class StkComponents { public: StkComponent *first; // first component in the bidirectional linked list StkComponent *last; // last component StkComponent *focused_last; // last focused component (important to remember focus when focus is set by WM to component which is not focusable (e.g window) ) StkComponent *last_focused_focusable_component; // this is suposed to fix focus changing problem.... StkComponents (); // constructor ~StkComponents (); // destructor void Add (StkComponent * item); // add component to the list void Remove (StkComponent * item); // remove component from the list void Debug (); // write the list of components void ECNF(Window window); // debug when event component not found (ECNF) StkComponent *Find (Window w); // this find the component which has a window w void Update(void); // update window by new stkevent void CallShortcut(void); // check all shortcut and probably call OnShortcut void SetFocus(StkComponent *item); // unset focus for all focused focusable component except component item and set focus to this item }; #endif // STK_COMPONENTS