consoled-session.c revision ce7b9f50c3fadbad22feeb28e4429ad9bee02bcc
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 David Herrmann <dh.herrmann@gmail.com>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <errno.h>
#include <inttypes.h>
#include <libudev.h>
#include <stdlib.h>
#include "consoled.h"
#include "grdev.h"
#include "hashmap.h"
#include "idev.h"
#include "list.h"
#include "macro.h"
#include "sd-bus.h"
#include "sd-event.h"
#include "sysview.h"
#include "util.h"
/* handle VT-switch requests */
nr = 0;
case XKB_KEY_F1 ... XKB_KEY_F12:
if (IDEV_KBDMATCH(kdata,
break;
break;
}
if (nr != 0) {
return true;
}
}
return false;
}
case IDEV_DATA_KEYBOARD:
return session_feed_keyboard(s, data);
default:
return false;
}
}
case IDEV_EVENT_DEVICE_ADD:
break;
case IDEV_EVENT_DEVICE_REMOVE:
break;
case IDEV_EVENT_DEVICE_DATA:
break;
}
return 0;
}
Display *d;
int r;
case GRDEV_EVENT_DISPLAY_ADD:
r = display_new(&d, s, display);
if (r < 0) {
log_error("Cannot create display '%s' on '%s': %s",
break;
}
break;
if (!d)
break;
display_free(d);
break;
if (!d)
break;
display_refresh(d);
break;
if (!d)
break;
session_dirty(s);
break;
}
}
Display *d;
display_render(d, s->active_ws);
return 0;
}
int r;
assert(m);
if (!s)
return -ENOMEM;
s->manager = m;
r = grdev_session_new(&s->grdev,
m->grdev,
s);
if (r < 0)
return r;
r = idev_session_new(&s->idev,
m->idev,
s);
if (r < 0)
return r;
r = workspace_new(&s->my_ws, m);
if (r < 0)
return r;
if (r < 0)
return r;
idev_session_enable(s->idev);
*out = s;
s = NULL;
return 0;
}
if (!s)
return NULL;
assert(!s->display_list);
workspace_detach(s->active_ws, s);
workspace_unref(s->my_ws);
idev_session_free(s->idev);
grdev_session_free(s->grdev);
free(s);
return NULL;
}
void session_dirty(Session *s) {
int r;
assert(s);
if (r < 0)
}
unsigned int type;
assert(s);
switch (type) {
case SYSVIEW_DEVICE_DRM:
break;
case SYSVIEW_DEVICE_EVDEV:
break;
}
}
unsigned int type;
assert(s);
switch (type) {
case SYSVIEW_DEVICE_DRM:
break;
case SYSVIEW_DEVICE_EVDEV:
break;
}
}
unsigned int type;
assert(s);
switch (type) {
case SYSVIEW_DEVICE_DRM:
break;
}
}