wckbuttons.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. */
  20. #ifndef __WCKBUTTONS_H__
  21. #define __WCKBUTTONS_H__
  22. #include <common/wck-utils.h>
  23. #include <common/wck-plugin.h>
  24. G_BEGIN_DECLS
  25. /* indexing of buttons */
  26. typedef enum {
  27. MINIMIZE_BUTTON = 0, // minimize button
  28. MAXIMIZE_BUTTON, // maximize/unmaximize button
  29. CLOSE_BUTTON, // close button
  30. BUTTONS // number of buttons
  31. } WindowButtonIndices;
  32. typedef enum {
  33. BUTTON_STATE_NORMAL = 0,
  34. BUTTON_STATE_PRELIGHT,
  35. BUTTON_STATE_PRESSED,
  36. BUTTON_STATES
  37. } WBButtonSt;
  38. /* we will index images for convenience */
  39. typedef enum {
  40. IMAGE_MINIMIZE = 0,
  41. IMAGE_UNMAXIMIZE,
  42. IMAGE_MAXIMIZE,
  43. IMAGE_CLOSE,
  44. IMAGES_BUTTONS
  45. } ImageStates;
  46. /* we will also index image states for convenience */
  47. typedef enum {
  48. IMAGE_UNFOCUSED = 0,
  49. IMAGE_FOCUSED,
  50. IMAGE_PRELIGHT,
  51. IMAGE_PRESSED,
  52. IMAGES_STATES
  53. } WBImageIndices;
  54. typedef struct {
  55. GtkBuilder *builder;
  56. gboolean only_maximized; // [T/F] Only track maximized windows
  57. gboolean show_on_desktop; // [T/F] Show the plugin on desktop
  58. gchar *theme; // Selected theme path
  59. gchar *button_layout; // Button layout ["XXX"] (example "HMC" : H=Hide, M=Maximize/unMaximize, C=Close)
  60. gboolean sync_wm_theme; // [T/F] Try to use xfwm4 active theme if possible.
  61. gint inactive_text_alpha; // Title inactive alpha
  62. gint inactive_text_shade; // Title inactive shade
  63. } WBPreferences;
  64. /* Definition for our button */
  65. typedef struct {
  66. GtkEventBox *eventbox;
  67. GtkImage *image;
  68. } WindowButton;
  69. /* plugin structure for title and buttons*/
  70. typedef struct {
  71. XfcePanelPlugin *plugin;
  72. /* Widgets */
  73. GtkWidget *ebox;
  74. GtkWidget *hvbox;
  75. WindowButton **button; // Array of buttons
  76. WBPreferences *prefs; // Main properties
  77. WckUtils *win;
  78. GdkPixbuf *pixbufs[IMAGES_STATES][IMAGES_BUTTONS];
  79. XfconfChannel *wm_channel; // window manager chanel
  80. XfconfChannel *x_channel; // xsettings chanel
  81. gulong wph; // xfwm chanel property changed handler id
  82. } WBPlugin;
  83. void wckbuttons_save (XfcePanelPlugin *plugin, WBPlugin *wb);
  84. G_END_DECLS
  85. #endif /* !__WCKBUTTONS_H__ */