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/>.
35 typedef struct Manager Manager;
36 typedef struct Session Session;
37 typedef struct Display Display;
38 typedef struct Workspace Workspace;
39 typedef struct Terminal Terminal;
47 LIST_FIELDS(Terminal, terminals_by_workspace);
55 int terminal_new(Terminal **out, Workspace *w);
56 Terminal *terminal_free(Terminal *t);
58 DEFINE_TRIVIAL_CLEANUP_FUNC(Terminal*, terminal_free);
60 void terminal_resize(Terminal *t);
61 void terminal_run(Terminal *t);
62 void terminal_feed(Terminal *t, idev_data *data);
63 bool terminal_draw(Terminal *t, const grdev_display_target *target);
72 LIST_FIELDS(Workspace, workspaces_by_manager);
74 LIST_HEAD(Terminal, terminal_list);
77 LIST_HEAD(Session, session_list);
82 int workspace_new(Workspace **out, Manager *m);
83 Workspace *workspace_ref(Workspace *w);
84 Workspace *workspace_unref(Workspace *w);
86 DEFINE_TRIVIAL_CLEANUP_FUNC(Workspace*, workspace_unref);
88 Workspace *workspace_attach(Workspace *w, Session *s);
89 Workspace *workspace_detach(Workspace *w, Session *s);
90 void workspace_refresh(Workspace *w);
92 void workspace_dirty(Workspace *w);
93 void workspace_feed(Workspace *w, idev_data *data);
94 bool workspace_draw(Workspace *w, const grdev_display_target *target);
102 LIST_FIELDS(Display, displays_by_session);
103 grdev_display *grdev;
108 int display_new(Display **out, Session *s, grdev_display *grdev);
109 Display *display_free(Display *d);
111 DEFINE_TRIVIAL_CLEANUP_FUNC(Display*, display_free);
113 void display_refresh(Display *d);
114 void display_render(Display *d, Workspace *w);
122 sysview_session *sysview;
123 grdev_session *grdev;
126 LIST_FIELDS(Session, sessions_by_workspace);
128 Workspace *active_ws;
130 LIST_HEAD(Display, display_list);
131 sd_event_source *redraw_src;
134 int session_new(Session **out, Manager *m, sysview_session *session);
135 Session *session_free(Session *s);
137 DEFINE_TRIVIAL_CLEANUP_FUNC(Session*, session_free);
139 void session_dirty(Session *s);
141 void session_add_device(Session *s, sysview_device *device);
142 void session_remove_device(Session *s, sysview_device *device);
143 void session_refresh_device(Session *s, sysview_device *device, struct udev_device *ud);
153 sysview_context *sysview;
154 grdev_context *grdev;
156 LIST_HEAD(Workspace, workspace_list);
159 int manager_new(Manager **out);
160 Manager *manager_free(Manager *m);
162 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
164 int manager_run(Manager *m);