1 /* workspace object */ 2 /* vim: set sw=2 et: */ 3 4 /* 5 * Copyright (C) 2001 Havoc Pennington 6 * Copyright (C) 2006-2007 Vincent Untz 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Library General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Library General Public License for more details. 17 * 18 * You should have received a copy of the GNU Library General Public 19 * License along with this library; if not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 #if !defined (__LIBWNCK_H_INSIDE__) && !defined (WNCK_COMPILATION) 23 #error "Only <libwnck/libwnck.h> can be included directly." 24 #endif 25 26 #ifndef WNCK_WORKSPACE_H 27 #define WNCK_WORKSPACE_H 28 29 #include <glib-object.h> 30 #include <libwnck/screen.h> 31 32 G_BEGIN_DECLS 33 34 #define WNCK_TYPE_WORKSPACE (wnck_workspace_get_type ()) 35 #define WNCK_WORKSPACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), WNCK_TYPE_WORKSPACE, WnckWorkspace)) 36 #define WNCK_WORKSPACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WNCK_TYPE_WORKSPACE, WnckWorkspaceClass)) 37 #define WNCK_IS_WORKSPACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), WNCK_TYPE_WORKSPACE)) 38 #define WNCK_IS_WORKSPACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WNCK_TYPE_WORKSPACE)) 39 #define WNCK_WORKSPACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WNCK_TYPE_WORKSPACE, WnckWorkspaceClass)) 40 41 typedef struct _WnckWorkspaceClass WnckWorkspaceClass; 42 typedef struct _WnckWorkspacePrivate WnckWorkspacePrivate; 43 44 /** 45 * WnckWorkspace: 46 * 47 * The #WnckWorkspace struct contains only private fields and should not be 48 * directly accessed. 49 */ 50 struct _WnckWorkspace 51 { 52 GObject parent_instance; 53 54 WnckWorkspacePrivate *priv; 55 }; 56 57 struct _WnckWorkspaceClass 58 { 59 GObjectClass parent_class; 60 61 void (* name_changed) (WnckWorkspace *space); 62 63 /* Padding for future expansion */ 64 void (* pad1) (void); 65 void (* pad2) (void); 66 void (* pad3) (void); 67 void (* pad4) (void); 68 }; 69 70 /** 71 * WnckMotionDirection: 72 * @WNCK_MOTION_UP: search a neighbor #WnckWorkspace above another 73 * #WnckWorkspace. 74 * @WNCK_MOTION_DOWN: search a neighbor #WnckWorkspace below another 75 * #WnckWorkspace. 76 * @WNCK_MOTION_LEFT: search a neighbor #WnckWorkspace at the left of another 77 * #WnckWorkspace. 78 * @WNCK_MOTION_RIGHT: search a neighbor #WnckWorkspace at the right of another 79 * #WnckWorkspace. 80 * 81 * Type defining a direction in which to search a neighbor #WnckWorkspace. 82 * 83 * Since: 2.14 84 */ 85 typedef enum 86 { 87 WNCK_MOTION_UP = -1, 88 WNCK_MOTION_DOWN = -2, 89 WNCK_MOTION_LEFT = -3, 90 WNCK_MOTION_RIGHT = -4 91 } WnckMotionDirection; 92 93 GType wnck_workspace_get_type (void) G_GNUC_CONST; 94 95 int wnck_workspace_get_number (WnckWorkspace *space); 96 const char* wnck_workspace_get_name (WnckWorkspace *space); 97 void wnck_workspace_change_name (WnckWorkspace *space, 98 const char *name); 99 WnckScreen* wnck_workspace_get_screen (WnckWorkspace *space); 100 void wnck_workspace_activate (WnckWorkspace *space, 101 guint32 timestamp); 102 int wnck_workspace_get_width (WnckWorkspace *space); 103 int wnck_workspace_get_height (WnckWorkspace *space); 104 int wnck_workspace_get_viewport_x (WnckWorkspace *space); 105 int wnck_workspace_get_viewport_y (WnckWorkspace *space); 106 gboolean wnck_workspace_is_virtual (WnckWorkspace *space); 107 108 109 int wnck_workspace_get_layout_row (WnckWorkspace *space); 110 int wnck_workspace_get_layout_column (WnckWorkspace *space); 111 WnckWorkspace* wnck_workspace_get_neighbor (WnckWorkspace *space, 112 WnckMotionDirection direction); 113 114 G_END_DECLS 115 116 #endif /* WNCK_WORKSPACE_H */ 117