Ck.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SLiM - Simple Login Manager
  2. Copyright (C) 2007 Martin Parm
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version.
  7. */
  8. #ifndef _CK_H_
  9. #define _CK_H_
  10. #include <string>
  11. #include <ck-connector.h>
  12. #include <dbus/dbus.h>
  13. namespace Ck {
  14. class Exception {
  15. public:
  16. std::string func;
  17. std::string errstr;
  18. Exception(const std::string &func, const std::string &errstr);
  19. };
  20. class Session {
  21. private:
  22. CkConnector *ckc;
  23. DBusError error;
  24. const char * get_x11_device(const std::string &display);
  25. dbus_bool_t ck_connector_open_graphic_session(const std::string &display,
  26. uid_t uid);
  27. public:
  28. const char * get_xdg_session_cookie();
  29. void open_session(const std::string &display, uid_t uid);
  30. void close_session();
  31. Session();
  32. ~Session();
  33. };
  34. }
  35. std::ostream &operator<<(std::ostream &os, const Ck::Exception &e);
  36. #endif /* _CK_H_ */