wck-utils.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* $Id$
  2. *
  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 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along
  14. * with this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  16. *
  17. * Copyright (C) 2013 Cedric Leporcq <cedl38@gmail.com>
  18. *
  19. * This code is derived from original 'Window Applets' from Andrej Belcijan.
  20. */
  21. #ifndef WCK_UTILS_H_
  22. #define WCK_UTILS_H_
  23. #ifndef WNCK_I_KNOW_THIS_IS_UNSTABLE
  24. #define WNCK_I_KNOW_THIS_IS_UNSTABLE
  25. #endif
  26. #include <libwnck/libwnck.h>
  27. #include <libxfce4panel/xfce-panel-plugin.h>
  28. G_BEGIN_DECLS
  29. /* Wnck structure */
  30. typedef struct {
  31. WnckScreen *activescreen; // Active screen
  32. WnckWorkspace *activeworkspace; // Active workspace
  33. WnckWindow *controlwindow; // Controled window according to only_maximized option
  34. WnckWindow *activewindow; // Active window
  35. WnckWindow *umaxwindow; // Upper maximized window
  36. gulong msh; // upper maximized window state handler id
  37. gulong ash; // active state handler id
  38. gulong mwh; // upper maximized workspace handler id
  39. gulong sch; // window closed handler id
  40. gulong soh; // window opened handler id
  41. gulong svh; // viewport changed handler id
  42. gulong swh; // workspace changed handler id
  43. gboolean only_maximized; // [T/F] Only track maximized windows
  44. gpointer data;
  45. } WckUtils;
  46. void init_wnck (WckUtils *win, gboolean only_maximized, gpointer data);
  47. void on_wck_state_changed (WnckWindow *controlwindow, gpointer data);
  48. void on_control_window_changed(WnckWindow *controlwindow, WnckWindow *previous, gpointer data);
  49. void reload_wnck (WckUtils *win, gboolean only_maximized, gpointer data);
  50. void toggle_maximize (WnckWindow *window);
  51. gboolean wck_signal_handler_disconnect (GObject *object, gulong handler);
  52. G_END_DECLS
  53. #endif /* WCK_UTILS_H_ */