File: Ck.h

package info (click to toggle)
slim 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,768 kB
  • sloc: cpp: 4,383; sh: 202; makefile: 23
file content (49 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* SLiM - Simple Login Manager
 * Copyright (C) 2007 Martin Parm
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 *(at your option) any later version.
 */

#ifndef _CK_H_
#define _CK_H_

#include <string>

#include <ck-connector.h>
#include <dbus/dbus.h>

namespace Ck
{
	class Exception
	{
	public:
		std::string func;
		std::string errstr;
		Exception(const std::string &func, const std::string &errstr);
	};

	class Session
	{
	private:
		CkConnector *ckc;
		DBusError error;

		const char *get_x11_device(const std::string &display);
		dbus_bool_t ck_connector_open_graphic_session(const std::string &display,
			uid_t uid);
	public:
		const char *get_xdg_session_cookie();
		void open_session(const std::string &display, uid_t uid);
		void close_session();

		Session();
		~Session();
	};
}

std::ostream &operator<<(std::ostream &os, const Ck::Exception &e);

#endif /* _CK_H_ */