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/>.
39 typedef struct Manager Manager;
40 typedef struct Session Session;
41 typedef struct Display Display;
42 typedef struct Workspace Workspace;
43 typedef struct Terminal Terminal;
51 LIST_FIELDS(Terminal, terminals_by_workspace);
59 int terminal_new(Terminal **out, Workspace *w);
60 Terminal *terminal_free(Terminal *t);
62 DEFINE_TRIVIAL_CLEANUP_FUNC(Terminal*, terminal_free);
64 void terminal_resize(Terminal *t);
65 void terminal_run(Terminal *t);
66 void terminal_feed(Terminal *t, idev_data *data);
67 bool terminal_draw(Terminal *t, const grdev_display_target *target);
76 LIST_FIELDS(Workspace, workspaces_by_manager);
78 LIST_HEAD(Terminal, terminal_list);
81 LIST_HEAD(Session, session_list);
86 int workspace_new(Workspace **out, Manager *m);
87 Workspace *workspace_ref(Workspace *w);
88 Workspace *workspace_unref(Workspace *w);
90 DEFINE_TRIVIAL_CLEANUP_FUNC(Workspace*, workspace_unref);
92 Workspace *workspace_attach(Workspace *w, Session *s);
93 Workspace *workspace_detach(Workspace *w, Session *s);
94 void workspace_refresh(Workspace *w);
96 void workspace_dirty(Workspace *w);
97 void workspace_feed(Workspace *w, idev_data *data);
98 bool workspace_draw(Workspace *w, const grdev_display_target *target);
106 LIST_FIELDS(Display, displays_by_session);
107 grdev_display *grdev;
112 int display_new(Display **out, Session *s, grdev_display *grdev);
113 Display *display_free(Display *d);
115 DEFINE_TRIVIAL_CLEANUP_FUNC(Display*, display_free);
117 void display_refresh(Display *d);
118 void display_render(Display *d, Workspace *w);
126 sysview_session *sysview;
127 grdev_session *grdev;
130 LIST_FIELDS(Session, sessions_by_workspace);
132 Workspace *active_ws;
134 LIST_HEAD(Display, display_list);
135 sd_event_source *redraw_src;
138 int session_new(Session **out, Manager *m, sysview_session *session);
139 Session *session_free(Session *s);
141 DEFINE_TRIVIAL_CLEANUP_FUNC(Session*, session_free);
143 void session_dirty(Session *s);
145 void session_add_device(Session *s, sysview_device *device);
146 void session_remove_device(Session *s, sysview_device *device);
147 void session_refresh_device(Session *s, sysview_device *device, struct udev_device *ud);
157 sysview_context *sysview;
158 grdev_context *grdev;
160 LIST_HEAD(Workspace, workspace_list);
163 int manager_new(Manager **out);
164 Manager *manager_free(Manager *m);
166 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
168 int manager_run(Manager *m);