windowck.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 Alessio Piccoli <alepic@geckoblu.net>
  18. * Cedric Leporcq <cedl38@gmail.com>
  19. *
  20. */
  21. #ifndef __WINDOWCK_H__
  22. #define __WINDOWCK_H__
  23. #ifdef HAVE_CONFIG_H
  24. #include <config.h>
  25. #endif
  26. #ifdef HAVE_STRING_H
  27. #include <string.h>
  28. #endif
  29. #include <gtk/gtk.h>
  30. #include <common/wck-utils.h>
  31. #include <common/wck-plugin.h>
  32. #define ICON_PADDING 3
  33. #define XFCE_PANEL_IS_SMALL (xfce_panel_plugin_get_size (wckp->plugin) < 23)
  34. G_BEGIN_DECLS
  35. typedef enum Alignment
  36. {
  37. LEFT = 0, CENTER = 5, RIGHT = 10
  38. } Alignment;
  39. typedef enum SizeMode
  40. {
  41. SHRINK = 1, FIXE = 2, EXPAND = 3
  42. } SizeMode;
  43. typedef struct {
  44. GtkEventBox *eventbox;
  45. GtkWidget *symbol;
  46. } WindowIcon;
  47. typedef struct {
  48. GtkBuilder *builder;
  49. gboolean only_maximized; // [T/F] Only track maximized windows
  50. gboolean show_on_desktop; // [T/F] Show the plugin on desktop
  51. //gboolean hide_icon; // [T/F] Hide the icon
  52. gboolean hide_title; // [T/F] Hide the title
  53. gboolean show_app_icon; // [T/F] Show the window icon
  54. gboolean icon_on_right; // [T/F] Place icon on the right
  55. gboolean show_window_menu; // [T/F] Show window action menu
  56. gboolean full_name; // [T/F] Show full name
  57. gboolean two_lines; // [T/F] Display the title on two lines
  58. gboolean show_tooltips; // [T/F] Show tooltips
  59. SizeMode size_mode; // Size mode : Length=[MINIMAL,FIXE,EXPAND]
  60. gint title_size; // Title size in chars
  61. gint title_padding; // Title padding
  62. gboolean sync_wm_font; // [T/F] Try to use xfwm4 active theme if possible.
  63. gchar *title_font; // Title font
  64. gchar *subtitle_font; // Subtitle font
  65. gint title_alignment; // Title alignment [LEFT, CENTER, RIGHT]
  66. gint inactive_text_alpha; // Title inactive alpha
  67. gint inactive_text_shade; // Title inactive shade
  68. gchar *active_text_color; // active text color
  69. gchar *inactive_text_color; // inactive text color
  70. } WCKPreferences;
  71. /* plugin structure */
  72. typedef struct {
  73. XfcePanelPlugin *plugin;
  74. /* Widgets */
  75. GtkWidget *ebox;
  76. GtkWidget *hvbox;
  77. GtkWidget *alignment;
  78. GtkLabel *title;
  79. WindowIcon *icon; // Icon widget
  80. WCKPreferences *prefs;
  81. WckUtils *win;
  82. gulong cnh; // controled window name handler id
  83. gulong cih; // controled window icon handler id
  84. XfconfChannel *wm_channel; // window manager chanel
  85. XfconfChannel *x_channel; // xsettings chanel
  86. } WindowckPlugin;
  87. void windowck_save(XfcePanelPlugin *plugin, WindowckPlugin *wckp);
  88. void create_symbol (gboolean show_app_icon, WindowckPlugin *wckp);
  89. G_END_DECLS
  90. #endif /* !__WINDOWCK_H__ */