1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2014 David Herrmann <dh.herrmann@gmail.com>
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
41 typedef struct Manager Manager;
42 typedef struct Session Session;
43 typedef struct Display Display;
44 typedef struct Workspace Workspace;
45 typedef struct Terminal Terminal;
53 LIST_FIELDS(Terminal, terminals_by_workspace);
61 int terminal_new(Terminal **out, Workspace *w);
62 Terminal *terminal_free(Terminal *t);
64 DEFINE_TRIVIAL_CLEANUP_FUNC(Terminal*, terminal_free);
66 void terminal_resize(Terminal *t);
67 void terminal_run(Terminal *t);
68 void terminal_feed(Terminal *t, idev_data *data);
69 bool terminal_draw(Terminal *t, const grdev_display_target *target);
78 LIST_FIELDS(Workspace, workspaces_by_manager);
80 LIST_HEAD(Terminal, terminal_list);
83 LIST_HEAD(Session, session_list);
88 int workspace_new(Workspace **out, Manager *m);
89 Workspace *workspace_ref(Workspace *w);
90 Workspace *workspace_unref(Workspace *w);
92 DEFINE_TRIVIAL_CLEANUP_FUNC(Workspace*, workspace_unref);
94 Workspace *workspace_attach(Workspace *w, Session *s);
95 Workspace *workspace_detach(Workspace *w, Session *s);
96 void workspace_refresh(Workspace *w);
98 void workspace_dirty(Workspace *w);
99 void workspace_feed(Workspace *w, idev_data *data);
100 bool workspace_draw(Workspace *w, const grdev_display_target *target);
108 LIST_FIELDS(Display, displays_by_session);
109 grdev_display *grdev;
114 int display_new(Display **out, Session *s, grdev_display *grdev);
115 Display *display_free(Display *d);
117 DEFINE_TRIVIAL_CLEANUP_FUNC(Display*, display_free);
119 void display_refresh(Display *d);
120 void display_render(Display *d, Workspace *w);
128 sysview_session *sysview;
129 grdev_session *grdev;
132 LIST_FIELDS(Session, sessions_by_workspace);
134 Workspace *active_ws;
136 LIST_HEAD(Display, display_list);
137 sd_event_source *redraw_src;
140 int session_new(Session **out, Manager *m, sysview_session *session);
141 Session *session_free(Session *s);
143 DEFINE_TRIVIAL_CLEANUP_FUNC(Session*, session_free);
145 void session_dirty(Session *s);
147 void session_add_device(Session *s, sysview_device *device);
148 void session_remove_device(Session *s, sysview_device *device);
149 void session_refresh_device(Session *s, sysview_device *device, struct udev_device *ud);
159 sysview_context *sysview;
160 grdev_context *grdev;
162 LIST_HEAD(Workspace, workspace_list);
165 int manager_new(Manager **out);
166 Manager *manager_free(Manager *m);
168 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
170 int manager_run(Manager *m);