Ck.h 1.0 KB

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