1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 
3 /*
4  * Copyright (C) 2001 Havoc Pennington
5  * Copyright (C) 2004, 2005 Elijah Newren
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street - Suite 500, Boston, MA
20  * 02110-1335, USA.
21  */
22 
23 #ifndef META_WORKSPACE_H
24 #define META_WORKSPACE_H
25 
26 /**
27  * SECTION:Workspaces
28  * @short_description:Workspaces
29  *
30  * A workspace is a set of windows which all live on the same
31  * screen.  (You may also see the name "desktop" around the place,
32  * which is the EWMH's name for the same thing.)  Only one workspace
33  * of a screen may be active at once; all windows on all other workspaces
34  * are unmapped.
35  */
36 
37 #include <meta/types.h>
38 #include <meta/boxes.h>
39 #include <meta/screen.h>
40 
41 #define META_TYPE_WORKSPACE            (meta_workspace_get_type ())
42 #define META_WORKSPACE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WORKSPACE, MetaWorkspace))
43 #define META_WORKSPACE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  META_TYPE_WORKSPACE, MetaWorkspaceClass))
44 #define META_IS_WORKSPACE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_WORKSPACE_TYPE))
45 #define META_IS_WORKSPACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  META_TYPE_WORKSPACE))
46 #define META_WORKSPACE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  META_TYPE_WORKSPACE, MetaWorkspaceClass))
47 
48 typedef struct _MetaWorkspaceClass   MetaWorkspaceClass;
49 
50 GType meta_workspace_get_type (void);
51 
52 int  meta_workspace_index (MetaWorkspace *workspace);
53 GList* meta_workspace_list_windows (MetaWorkspace *workspace);
54 void meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
55                                                int            which_monitor,
56                                                MetaRectangle *area);
57 void meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
58                                                 MetaRectangle *area);
59 void meta_workspace_activate (MetaWorkspace *workspace, guint32 timestamp);
60 void meta_workspace_activate_with_focus (MetaWorkspace *workspace,
61                                          MetaWindow    *focus_this,
62                                          guint32        timestamp);
63 void meta_workspace_activate_with_direction_hint (MetaWorkspace       *workspace,
64                                                   MetaMotionDirection  direction,
65                                                   guint32              timestamp);
66 
67 void meta_workspace_update_window_hints (MetaWorkspace *workspace);
68 void meta_workspace_set_builtin_struts (MetaWorkspace *workspace,
69                                         GSList        *struts);
70 MetaWorkspace *meta_workspace_get_neighbor (MetaWorkspace      *workspace,
71                                             MetaMotionDirection direction);
72 
73 void meta_workspace_focus_default_window (MetaWorkspace *workspace,
74                                           MetaWindow    *not_this_one,
75                                           guint32        timestamp);
76 
77 #endif
78