summaryrefslogtreecommitdiffstats
path: root/src/komposeglobal.h
blob: 760fce9880f24243407b0839734a6a942dfbe787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//
// C++ Interface: komposeglobal
//
// Description:
//
//
// Author: Hans Oischinger <hans.oischinger@kde-mail.net>, (C) 2004
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef KOMPOSEGLOBAL_H
#define KOMPOSEGLOBAL_H

class KomposeSysTray;

#include <tqobject.h>
#include <tqstring.h>

class TDEPopupMenu;
class TDEActionCollection;
class TDEAction;
class TDESharedPixmap;
class KWinModule;

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#if defined(Q_WS_X11) && defined(HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && TQT_VERSION >= 0x030300
# define COMPOSITE
#endif

/**
@author Hans Oischinger
*/
class KomposeGlobal : public TQObject
{
  Q_OBJECT
protected:
  KomposeGlobal(TQObject *parent = 0, const char *name = 0);

  ~KomposeGlobal();

public:
  static KomposeGlobal *instance();
  KomposeSysTray* getSysTray() { return systray; }
  void initGui();
  
  bool hasAboutDialogOpen() { return aboutDialogOpen; }
  void setHideSystray( bool b ) { hideSystray = b; }
  void setSingleShot( bool b ) { singleShot = b; }
  bool getSingleShot() { return singleShot; }
  bool hasXcomposite() { return xcomposite; }
  int getDamageEvent() { return damageEvent; }
  
  // Action getters
  TDEAction *getActConfigGlobalShortcuts() { return actConfigGlobalShortcuts; }
  TDEAction *getActPreferencesDialog() { return actPreferencesDialog; }
  TDEAction *getActShowVirtualDesktopView() { return actShowVirtualDesktopView; }
  TDEAction *getActShowCurrentDesktopView() { return actShowCurrentDesktopView; }
  TDEAction *getActShowWorldView() { return actShowWorldView; }
  TDEAction *getActAboutDlg() { return actAboutDlg; }
  TDEAction *getActQuit() { return actQuit; }

  const TDESharedPixmap *getDesktopBgPixmap() const { return desktopBgPixmap; }
  
protected:
  void initActions();
  void initImlib();

protected slots:
  void initSharedPixmaps();
  TQString pixmapName(int desk);
  void slotDone(bool success);
  void enablePixmapExports();
  void slotDesktopChanged(int desktop);
  void slotBackgroundChanged(int desktop);
  void refreshSharedPixmaps();
  
  void slotConfigChanged();
  void initCompositeExt();
  void showGlobalShortcutsSettingsDialog();
  void showAboutDlg();

private:
  bool aboutDialogOpen;
  bool hideSystray;
  bool singleShot;
  bool xcomposite;
  int damageEvent, damageError;
  
  TDESharedPixmap *desktopBgPixmap;
  int currentDesktop;
  KomposeSysTray* systray;
  TDEActionCollection* actionCollection;

  TDEAction *actConfigGlobalShortcuts;
  TDEAction *actPreferencesDialog;
  TDEAction *actShowVirtualDesktopView;
  TDEAction *actShowCurrentDesktopView;
  TDEAction *actShowWorldView;
  TDEAction *actAboutDlg;
  TDEAction *actQuit;
  
  KWinModule* twin_module;
};

#endif