1 /**
2  *
3  * Compiz group plugin
4  *
5  * group-internal.h
6  *
7  * Copyright : (C) 2006-2007 by Patrick Niklaus, Roi Cohen, Danny Baumann
8  * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
9  *          Roi Cohen       <roico.beryl@gmail.com>
10  *          Danny Baumann   <maniac@opencompositing.org>
11  *
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  **/
24 
25 #ifndef _GROUP_H
26 #define _GROUP_H
27 
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <stdlib.h>
32 #include <time.h>
33 #include <X11/Xlib.h>
34 #include <cairo/cairo-xlib-xrender.h>
35 #include <compiz-core.h>
36 #include <compiz-text.h>
37 #include <X11/Xatom.h>
38 #include <X11/extensions/shape.h>
39 
40 #include <math.h>
41 #include <limits.h>
42 
43 #include "group_options.h"
44 
45 /*
46  * Constants
47  *
48  */
49 #define PI 3.1415926535897
50 
51 /*
52  * Helpers
53  *
54  */
55 #define GET_GROUP_DISPLAY(d) \
56     ((GroupDisplay *) (d)->base.privates[groupDisplayPrivateIndex].ptr)
57 #define GROUP_DISPLAY(d) \
58     GroupDisplay *gd = GET_GROUP_DISPLAY (d)
59 
60 #define GET_GROUP_SCREEN(s, gd) \
61     ((GroupScreen *) (s)->base.privates[(gd)->screenPrivateIndex].ptr)
62 #define GROUP_SCREEN(s) \
63     GroupScreen *gs = GET_GROUP_SCREEN (s, GET_GROUP_DISPLAY (s->display))
64 
65 #define GET_GROUP_WINDOW(w, gs) \
66     ((GroupWindow *) (w)->base.privates[(gs)->windowPrivateIndex].ptr)
67 #define GROUP_WINDOW(w) \
68     GroupWindow *gw = GET_GROUP_WINDOW (w, \
69 		      GET_GROUP_SCREEN  (w->screen, \
70 		      GET_GROUP_DISPLAY (w->screen->display)))
71 
72 #define WIN_X(w) (w->attrib.x)
73 #define WIN_Y(w) (w->attrib.y)
74 #define WIN_WIDTH(w) (w->attrib.width)
75 #define WIN_HEIGHT(w) (w->attrib.height)
76 
77 #define WIN_CENTER_X(w) (WIN_X (w) + (WIN_WIDTH (w) / 2))
78 #define WIN_CENTER_Y(w) (WIN_Y (w) + (WIN_HEIGHT (w) / 2))
79 
80 /* definitions used for glow painting */
81 #define WIN_REAL_X(w) (w->attrib.x - w->input.left)
82 #define WIN_REAL_Y(w) (w->attrib.y - w->input.top)
83 #define WIN_REAL_WIDTH(w) (w->width + 2 * w->attrib.border_width + \
84 			   w->input.left + w->input.right)
85 #define WIN_REAL_HEIGHT(w) (w->height + 2 * w->attrib.border_width + \
86 			    w->input.top + w->input.bottom)
87 
88 #define TOP_TAB(g) ((g)->topTab->window)
89 #define PREV_TOP_TAB(g) ((g)->prevTopTab->window)
90 #define NEXT_TOP_TAB(g) ((g)->nextTopTab->window)
91 
92 #define HAS_TOP_WIN(group) (((group)->topTab) && ((group)->topTab->window))
93 #define HAS_PREV_TOP_WIN(group) (((group)->prevTopTab) && \
94 				 ((group)->prevTopTab->window))
95 
96 #define IS_TOP_TAB(w, group) (HAS_TOP_WIN (group) && \
97 			      ((TOP_TAB (group)->id) == (w)->id))
98 #define IS_PREV_TOP_TAB(w, group) (HAS_PREV_TOP_WIN (group) && \
99 				   ((PREV_TOP_TAB (group)->id) == (w)->id))
100 
101 /*
102  * Structs
103  *
104  */
105 
106 /*
107  * Window states
108  */
109 typedef enum {
110     WindowNormal = 0,
111     WindowMinimized,
112     WindowShaded
113 } GroupWindowState;
114 
115 /*
116  * Screengrab states
117  */
118 typedef enum {
119     ScreenGrabNone = 0,
120     ScreenGrabSelect,
121     ScreenGrabTabDrag
122 } GroupScreenGrabState;
123 
124 /*
125  * Ungrouping states
126  */
127 typedef enum {
128     UngroupNone = 0,
129     UngroupAll,
130     UngroupSingle
131 } GroupUngroupState;
132 
133 /*
134  * Rotation direction for change tab animation
135  */
136 typedef enum {
137     RotateUncertain = 0,
138     RotateLeft,
139     RotateRight
140 } ChangeTabAnimationDirection;
141 
142 typedef struct _GlowTextureProperties {
143     char *textureData;
144     int  textureSize;
145     int  glowOffset;
146 } GlowTextureProperties;
147 
148 /*
149  * Structs for pending callbacks
150  */
151 typedef struct _GroupPendingMoves GroupPendingMoves;
152 struct _GroupPendingMoves {
153     CompWindow        *w;
154     int               dx;
155     int               dy;
156     Bool              immediate;
157     Bool              sync;
158     GroupPendingMoves *next;
159 };
160 
161 typedef struct _GroupPendingGrabs GroupPendingGrabs;
162 struct _GroupPendingGrabs {
163     CompWindow        *w;
164     int               x;
165     int               y;
166     unsigned int      state;
167     unsigned int      mask;
168     GroupPendingGrabs *next;
169 };
170 
171 typedef struct _GroupPendingUngrabs GroupPendingUngrabs;
172 struct _GroupPendingUngrabs {
173     CompWindow          *w;
174     GroupPendingUngrabs *next;
175 };
176 
177 typedef struct _GroupPendingSyncs GroupPendingSyncs;
178 struct _GroupPendingSyncs {
179     CompWindow        *w;
180     GroupPendingSyncs *next;
181 };
182 
183 /*
184  * Pointer to display list
185  */
186 extern int groupDisplayPrivateIndex;
187 
188 /*
189  * PaintState
190  */
191 
192 /* Mask values for groupTabSetVisibility */
193 #define SHOW_BAR_INSTANTLY_MASK (1 << 0)
194 #define PERMANENT		(1 << 1)
195 
196 /* Mask values for tabbing animation */
197 #define IS_ANIMATED		(1 << 0)
198 #define FINISHED_ANIMATION	(1 << 1)
199 #define CONSTRAINED_X		(1 << 2)
200 #define CONSTRAINED_Y		(1 << 3)
201 #define DONT_CONSTRAIN		(1 << 4)
202 #define IS_UNGROUPING           (1 << 5)
203 
204 typedef enum {
205     PaintOff = 0,
206     PaintFadeIn,
207     PaintFadeOut,
208     PaintOn,
209     PaintPermanentOn
210 } PaintState;
211 
212 typedef enum {
213     AnimationNone = 0,
214     AnimationPulse,
215     AnimationReflex
216 } GroupAnimationType;
217 
218 typedef enum {
219     NoTabChange = 0,
220     TabChangeOldOut,
221     TabChangeNewIn
222 } TabChangeState;
223 
224 typedef enum {
225     NoTabbing = 0,
226     Tabbing,
227     Untabbing
228 } TabbingState;
229 
230 typedef struct _GroupCairoLayer {
231     CompTexture	    texture;
232 
233     /* used if layer is used for cairo drawing */
234     unsigned char   *buffer;
235     cairo_surface_t *surface;
236     cairo_t	    *cairo;
237 
238     /* used if layer is used for text drawing */
239     Pixmap pixmap;
240 
241     int texWidth;
242     int texHeight;
243 
244     PaintState state;
245     int        animationTime;
246 } GroupCairoLayer;
247 
248 /*
249  * GroupTabBarSlot
250  */
251 typedef struct _GroupTabBarSlot GroupTabBarSlot;
252 struct _GroupTabBarSlot {
253     GroupTabBarSlot *prev;
254     GroupTabBarSlot *next;
255 
256     Region region;
257 
258     CompWindow *window;
259 
260     /* For DnD animations */
261     int	  springX;
262     int	  speed;
263     float msSinceLastMove;
264 };
265 
266 /*
267  * GroupTabBar
268  */
269 typedef struct _GroupTabBar {
270     GroupTabBarSlot *slots;
271     GroupTabBarSlot *revSlots;
272     int		    nSlots;
273 
274     GroupTabBarSlot *hoveredSlot;
275     GroupTabBarSlot *textSlot;
276 
277     GroupCairoLayer *textLayer;
278     GroupCairoLayer *bgLayer;
279     GroupCairoLayer *selectionLayer;
280 
281     /* For animations */
282     int                bgAnimationTime;
283     GroupAnimationType bgAnimation;
284 
285     PaintState state;
286     int        animationTime;
287     Region     region;
288     int        oldWidth;
289 
290     CompTimeoutHandle timeoutHandle;
291 
292     /* For DnD animations */
293     int   leftSpringX, rightSpringX;
294     int   leftSpeed, rightSpeed;
295     float leftMsSinceLastMove, rightMsSinceLastMove;
296 } GroupTabBar;
297 
298 /*
299  * GroupGlow
300  */
301 
302 typedef struct _GlowQuad {
303     BoxRec     box;
304     CompMatrix matrix;
305 } GlowQuad;
306 
307 #define GLOWQUAD_TOPLEFT	 0
308 #define GLOWQUAD_TOPRIGHT	 1
309 #define GLOWQUAD_BOTTOMLEFT	 2
310 #define GLOWQUAD_BOTTOMRIGHT     3
311 #define GLOWQUAD_TOP		 4
312 #define GLOWQUAD_BOTTOM		 5
313 #define GLOWQUAD_LEFT		 6
314 #define GLOWQUAD_RIGHT		 7
315 #define NUM_GLOWQUADS		 8
316 
317 /*
318  * GroupSelection
319  */
320 typedef struct _GroupSelection GroupSelection;
321 struct _GroupSelection {
322     GroupSelection *prev;
323     GroupSelection *next;
324 
325     CompScreen *screen;
326     CompWindow **windows;
327     int        nWins;
328 
329     /* Unique identifier for this group */
330     long int identifier;
331 
332     GroupTabBarSlot* topTab;
333     GroupTabBarSlot* prevTopTab;
334 
335     /* needed for untabbing animation */
336     CompWindow *lastTopTab;
337 
338     /* Those two are only for the change-tab animation,
339        when the tab was changed again during animation.
340        Another animation should be started again,
341        switching for this window. */
342     ChangeTabAnimationDirection nextDirection;
343     GroupTabBarSlot             *nextTopTab;
344 
345     /* check focus stealing prevention after changing tabs */
346     Bool checkFocusAfterTabChange;
347 
348     GroupTabBar *tabBar;
349 
350     int            changeAnimationTime;
351     int            changeAnimationDirection;
352     TabChangeState changeState;
353 
354     TabbingState tabbingState;
355 
356     GroupUngroupState ungroupState;
357 
358     Window       grabWindow;
359     unsigned int grabMask;
360 
361     Window inputPrevention;
362     Bool   ipwMapped;
363 
364     GLushort color[4];
365 };
366 
367 typedef struct _GroupWindowHideInfo {
368     Window frameWindow;
369 
370     unsigned long skipState;
371     unsigned long shapeMask;
372 
373     XRectangle *inputRects;
374     int        nInputRects;
375     int        inputRectOrdering;
376 } GroupWindowHideInfo;
377 
378 typedef struct _GroupResizeInfo {
379     CompWindow *resizedWindow;
380     XRectangle origGeometry;
381 } GroupResizeInfo;
382 
383 /*
384  * GroupDisplay structure
385  */
386 typedef struct _GroupDisplay {
387     int screenPrivateIndex;
388 
389     HandleEventProc handleEvent;
390 
391     Bool ignoreMode;
392 
393     GroupResizeInfo *resizeInfo;
394 
395     GlowTextureProperties *glowTextureProperties;
396 
397     GroupSelection *lastRestackedGroup;
398 
399     Atom groupWinPropertyAtom;
400     Atom resizeNotifyAtom;
401 
402     TextFunc *textFunc;
403 } GroupDisplay;
404 
405 /*
406  * GroupScreen structure
407  */
408 
409 typedef struct _GroupScreen {
410     int windowPrivateIndex;
411 
412     WindowMoveNotifyProc          windowMoveNotify;
413     WindowResizeNotifyProc        windowResizeNotify;
414     GetOutputExtentsForWindowProc getOutputExtentsForWindow;
415     PreparePaintScreenProc        preparePaintScreen;
416     PaintOutputProc               paintOutput;
417     DrawWindowProc                drawWindow;
418     PaintWindowProc               paintWindow;
419     PaintTransformedOutputProc    paintTransformedOutput;
420     DonePaintScreenProc           donePaintScreen;
421     WindowGrabNotifyProc          windowGrabNotify;
422     WindowUngrabNotifyProc        windowUngrabNotify;
423     DamageWindowRectProc          damageWindowRect;
424     WindowStateChangeNotifyProc   windowStateChangeNotify;
425     ActivateWindowProc            activateWindow;
426 
427     GroupPendingMoves   *pendingMoves;
428     GroupPendingGrabs   *pendingGrabs;
429     GroupPendingUngrabs *pendingUngrabs;
430     CompTimeoutHandle   dequeueTimeoutHandle;
431 
432     GroupSelection *groups;
433     GroupSelection tmpSel;
434 
435     Bool queued;
436 
437     GroupScreenGrabState grabState;
438     int                  grabIndex;
439 
440     GroupSelection *lastHoveredGroup;
441 
442     CompTimeoutHandle showDelayTimeoutHandle;
443 
444     /* For selection */
445     Bool painted;
446     int  vpX, vpY;
447     int  x1, y1, x2, y2;
448 
449     /* For d&d */
450     GroupTabBarSlot   *draggedSlot;
451     CompTimeoutHandle dragHoverTimeoutHandle;
452     Bool              dragged;
453     int               prevX, prevY; /* Buffer for mouse coordinates */
454 
455     CompTimeoutHandle initialActionsTimeoutHandle;
456 
457     CompTexture glowTexture;
458 } GroupScreen;
459 
460 /*
461  * GroupWindow structure
462  */
463 typedef struct _GroupWindow {
464     GroupSelection *group;
465     Bool inSelection;
466 
467     /* To prevent freeing the group
468        property in groupFiniWindow. */
469     Bool readOnlyProperty;
470 
471     /* For the tab bar */
472     GroupTabBarSlot *slot;
473 
474     Bool needsPosSync;
475 
476     GlowQuad *glowQuads;
477 
478     GroupWindowState    windowState;
479     GroupWindowHideInfo *windowHideInfo;
480 
481     XRectangle *resizeGeometry;
482 
483     /* For tab animation */
484     int    animateState;
485     XPoint mainTabOffset;
486     XPoint destination;
487     XPoint orgPos;
488 
489     float tx,ty;
490     float xVelocity, yVelocity;
491 } GroupWindow;
492 
493 /*
494  * Pre-Definitions
495  *
496  */
497 
498 /*
499  * group.c
500  */
501 
502 Bool
503 groupIsGroupWindow (CompWindow *w);
504 
505 void
506 groupUpdateWindowProperty (CompWindow *w);
507 
508 Bool
509 groupCheckWindowProperty (CompWindow *w,
510 			  long int   *id,
511 			  Bool       *tabbed,
512 			  GLushort   *color);
513 
514 void
515 groupGrabScreen (CompScreen           *s,
516 		 GroupScreenGrabState newState);
517 
518 void
519 groupHandleEvent (CompDisplay *d,
520 		  XEvent      *event);
521 
522 void
523 groupDeleteGroupWindow (CompWindow *w);
524 
525 void
526 groupRemoveWindowFromGroup (CompWindow *w);
527 
528 void
529 groupDeleteGroup (GroupSelection *group);
530 
531 void
532 groupAddWindowToGroup (CompWindow     *w,
533 		       GroupSelection *group,
534 		       long int       initialIdent);
535 
536 Bool
537 groupGroupWindows (CompDisplay     *d,
538 		   CompAction      *action,
539 		   CompActionState state,
540 		   CompOption      *option,
541 		   int             nOption);
542 
543 Bool
544 groupUnGroupWindows (CompDisplay     *d,
545 		     CompAction      *action,
546 		     CompActionState state,
547 		     CompOption      *option,
548 		     int             nOption);
549 
550 Bool
551 groupRemoveWindow (CompDisplay     *d,
552 		   CompAction      *action,
553 		   CompActionState state,
554 		   CompOption      *option,
555 		   int             nOption);
556 
557 Bool
558 groupCloseWindows (CompDisplay     *d,
559 		   CompAction      *action,
560 		   CompActionState state,
561 		   CompOption      *option,
562 		   int             nOption);
563 
564 Bool
565 groupChangeColor (CompDisplay     *d,
566 		  CompAction      *action,
567 		  CompActionState state,
568 		  CompOption      *option,
569 		  int             nOption);
570 
571 Bool
572 groupSetIgnore (CompDisplay     *d,
573 		CompAction      *action,
574 		CompActionState state,
575 		CompOption      *option,
576 		int             nOption);
577 
578 Bool
579 groupUnsetIgnore (CompDisplay     *d,
580 		  CompAction      *action,
581 		  CompActionState state,
582 		  CompOption      *option,
583 		  int             nOption);
584 
585 void
586 groupWindowResizeNotify (CompWindow *w,
587 			 int        dx,
588 			 int        dy,
589 			 int        dwidth,
590 			 int        dheight);
591 
592 void
593 groupWindowGrabNotify (CompWindow   *w,
594 		       int          x,
595 		       int          y,
596 		       unsigned int state,
597 		       unsigned int mask);
598 
599 void
600 groupWindowUngrabNotify (CompWindow *w);
601 
602 void
603 groupWindowMoveNotify (CompWindow *w,
604 		       int        dx,
605 		       int        dy,
606 		       Bool       immediate);
607 
608 void
609 groupWindowStateChangeNotify (CompWindow   *w,
610 			      unsigned int lastState);
611 
612 void
613 groupGetOutputExtentsForWindow (CompWindow        *w,
614 				CompWindowExtents *output);
615 
616 Bool
617 groupDamageWindowRect (CompWindow *w,
618 		       Bool       initial,
619 		       BoxPtr     rect);
620 
621 void
622 groupActivateWindow (CompWindow *w);
623 
624 /*
625  * cairo.c
626  */
627 
628 void
629 groupClearCairoLayer (GroupCairoLayer *layer);
630 
631 void
632 groupDestroyCairoLayer (CompScreen      *s,
633 			GroupCairoLayer *layer);
634 
635 GroupCairoLayer*
636 groupRebuildCairoLayer (CompScreen      *s,
637 			GroupCairoLayer *layer,
638 			int             width,
639 			int             height);
640 
641 GroupCairoLayer*
642 groupCreateCairoLayer (CompScreen *s,
643 		       int        width,
644 		       int        height);
645 
646 void
647 groupRenderTopTabHighlight (GroupSelection *group);
648 
649 void
650 groupRenderTabBarBackground (GroupSelection *group);
651 
652 void
653 groupRenderWindowTitle (GroupSelection *group);
654 
655 
656 /*
657  * tab.c
658  */
659 
660 void
661 groupSetWindowVisibility (CompWindow *w,
662 			  Bool       visible);
663 
664 void
665 groupClearWindowInputShape (CompWindow          *w,
666 			    GroupWindowHideInfo *hideInfo);
667 
668 void
669 groupHandleAnimation (GroupSelection *group);
670 
671 void
672 groupHandleHoverDetection (GroupSelection *group);
673 
674 void
675 groupHandleTabBarFade (GroupSelection *group,
676 		       int            msSinceLastPaint);
677 
678 void
679 groupHandleTabBarAnimation (GroupSelection *group,
680 			    int            msSinceLastPaint);
681 
682 void
683 groupHandleTextFade (GroupSelection *group,
684 		     int            msSinceLastPaint);
685 
686 void
687 groupDrawTabAnimation (GroupSelection *group,
688 		       int            msSinceLastPaint);
689 
690 void
691 groupUpdateTabBars (CompScreen *s,
692 		    Window     enteredWin);
693 
694 void
695 groupGetDrawOffsetForSlot (GroupTabBarSlot *slot,
696 			   int             *hoffset,
697 			   int             *voffset);
698 
699 void
700 groupTabSetVisibility (GroupSelection *group,
701 		       Bool           visible,
702 		       unsigned int   mask);
703 
704 Bool
705 groupGetCurrentMousePosition (CompScreen *s,
706 			      int        *x,
707 			      int        *y);
708 
709 void
710 groupRecalcTabBarPos (GroupSelection *group,
711 		      int            middleX,
712 		      int            minX1,
713 		      int            maxX2);
714 
715 void
716 groupInsertTabBarSlotAfter (GroupTabBar     *bar,
717 			    GroupTabBarSlot *slot,
718 			    GroupTabBarSlot *prevSlot);
719 
720 void
721 groupInsertTabBarSlotBefore (GroupTabBar     *bar,
722 			     GroupTabBarSlot *slot,
723 			     GroupTabBarSlot *nextSlot);
724 
725 void
726 groupInsertTabBarSlot (GroupTabBar     *bar,
727 		       GroupTabBarSlot *slot);
728 
729 void
730 groupUnhookTabBarSlot (GroupTabBar     *bar,
731 		       GroupTabBarSlot *slot,
732 		       Bool            temporary);
733 
734 void
735 groupDeleteTabBarSlot (GroupTabBar     *bar,
736 		       GroupTabBarSlot *slot);
737 
738 void
739 groupCreateSlot (GroupSelection *group,
740 		 CompWindow     *w);
741 
742 void
743 groupApplyForces (CompScreen      *s,
744 		  GroupTabBar     *bar,
745 		  GroupTabBarSlot *draggedSlot);
746 
747 void
748 groupApplySpeeds (CompScreen     *s,
749 		  GroupSelection *group,
750 		  int            msSinceLastRepaint);
751 
752 void
753 groupInitTabBar (GroupSelection *group,
754 		 CompWindow     *topTab);
755 
756 void
757 groupDeleteTabBar (GroupSelection *group);
758 
759 void
760 groupStartTabbingAnimation (GroupSelection *group,
761 			    Bool           tab);
762 
763 void
764 groupTabGroup (CompWindow *main);
765 
766 void
767 groupUntabGroup (GroupSelection *group);
768 
769 Bool
770 groupInitTab (CompDisplay     *d,
771 	      CompAction      *action,
772 	      CompActionState state,
773 	      CompOption      *option,
774 	      int             nOption);
775 
776 Bool
777 groupChangeTab (GroupTabBarSlot             *topTab,
778 		ChangeTabAnimationDirection direction);
779 
780 Bool
781 groupChangeTabLeft (CompDisplay     *d,
782 		    CompAction      *action,
783 		    CompActionState state,
784 		    CompOption      *option,
785 		    int             nOption);
786 
787 Bool
788 groupChangeTabRight (CompDisplay     *d,
789 		     CompAction      *action,
790 		     CompActionState state,
791 		     CompOption      *option,
792 		     int             nOption);
793 
794 void
795 groupSwitchTopTabInput (GroupSelection *group,
796 			Bool           enable);
797 
798 void
799 groupCreateInputPreventionWindow (GroupSelection *group);
800 
801 void
802 groupDestroyInputPreventionWindow (GroupSelection *group);
803 
804 Region
805 groupGetClippingRegion (CompWindow *w);
806 
807 void
808 groupMoveTabBarRegion (GroupSelection *group,
809 		       int            dx,
810 		       int            dy,
811 		       Bool           syncIPW);
812 
813 void
814 groupResizeTabBarRegion (GroupSelection *group,
815 			 XRectangle     *box,
816 			 Bool           syncIPW);
817 
818 void
819 groupDamageTabBarRegion (GroupSelection *group);
820 
821 /*
822  * paint.c
823  */
824 
825 void
826 groupComputeGlowQuads (CompWindow *w,
827 		       CompMatrix *matrix);
828 
829 void
830 groupPreparePaintScreen (CompScreen *s,
831 			 int        msSinceLastPaint);
832 
833 Bool
834 groupPaintOutput (CompScreen              *s,
835 		  const ScreenPaintAttrib *sAttrib,
836 		  const CompTransform     *transform,
837 		  Region                  region,
838 		  CompOutput              *output,
839 		  unsigned int            mask);
840 
841 void
842 groupPaintTransformedOutput (CompScreen              *s,
843 			     const ScreenPaintAttrib *sa,
844 			     const CompTransform     *transform,
845 			     Region                  region,
846 			     CompOutput              *output,
847 			     unsigned int            mask);
848 
849 void
850 groupDonePaintScreen (CompScreen *s);
851 
852 Bool
853 groupDrawWindow (CompWindow           *w,
854 		 const CompTransform  *transform,
855 		 const FragmentAttrib *attrib,
856 		 Region               region,
857 		 unsigned int         mask);
858 
859 void
860 groupGetStretchRectangle (CompWindow *w,
861 			  BoxPtr     pBox,
862 			  float      *xScale,
863 			  float      *yScale);
864 
865 void
866 groupDamagePaintRectangle (CompScreen *s,
867 			   BoxPtr     pBox);
868 
869 Bool
870 groupPaintWindow (CompWindow              *w,
871 		  const WindowPaintAttrib *attrib,
872 		  const CompTransform     *transform,
873 		  Region                  region,
874 		  unsigned int            mask);
875 
876 
877 /*
878  * queues.c
879  */
880 
881 void
882 groupEnqueueMoveNotify (CompWindow *w,
883 			int        dx,
884 			int        dy,
885 			Bool       immediate,
886 			Bool       sync);
887 
888 void
889 groupDequeueMoveNotifies (CompScreen *s);
890 
891 void
892 groupEnqueueGrabNotify (CompWindow   *w,
893 			int          x,
894 			int          y,
895 			unsigned int state,
896 			unsigned int mask);
897 
898 void
899 groupEnqueueUngrabNotify (CompWindow *w);
900 
901 /*
902  * selection.c
903  */
904 
905 Bool
906 groupSelectSingle (CompDisplay     *d,
907 		   CompAction      *action,
908 		   CompActionState state,
909 		   CompOption      *option,
910 		   int             nOption);
911 
912 Bool groupSelect (CompDisplay     *d,
913 		  CompAction      *action,
914 		  CompActionState state,
915 		  CompOption      *option,
916 		  int             nOption);
917 
918 Bool
919 groupSelectTerminate (CompDisplay     *d,
920 		      CompAction      *action,
921 		      CompActionState state,
922 		      CompOption      *option,
923 		      int             nOption);
924 
925 void
926 groupDamageSelectionRect (CompScreen *s,
927 			  int        xRoot,
928 			  int        yRoot);
929 
930 #endif
931