File: bbpager.hh

package info (click to toggle)
bbpager 0.3.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 500 kB
  • ctags: 725
  • sloc: cpp: 5,181; sh: 327; makefile: 72
file content (149 lines) | stat: -rw-r--r-- 3,355 bytes parent folder | download | duplicates (2)
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// bbpager.hh for bbpager - an pager tool for Blackbox.
//
//  Copyright (c) 1998-2000 by John Kennis, jkennis@chello.nl
//
//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// (See the included file COPYING / GPL-2.0)
//


#ifndef __MAIN_HH
#define __MAIN_HH

#include "Image.hh"
#include "Basewindow.hh"
#include "resource.hh"
#include "wminterface.hh"

class Resource;
class BaseResource;
class Basewindow;
class WMInterface;

struct PIXMAP {
  Pixmap 	frame;
  Pixmap	desktop;
  Pixmap  focusedDesktop;
  Pixmap  window;
  Pixmap  focusedWindow;
};

struct GEOM {
  unsigned int height;
  unsigned int width;
  int x;
  int y;
};

struct WindowList {
  Window win;
  int x_position;
  int y_position;
  unsigned int width;
  unsigned int height;
  bool icon;
  bool focused;
  bool shaded;
  Window pager_win;
  int pager_x;
  int pager_y;
  int pager_width;
  int pager_height;
  int desktop_nr;
  bool sticky;
};

struct DesktopList {
    Window win;
    int desktop_nr;
    int x;
    int y;
    int width;
    int height;
  };


class ToolWindow : public Basewindow {

public:
  ToolWindow(int argc,char **argv,struct CMDOPTIONS *);
  ~ToolWindow(void);

  XGCValues gcv;
  GC frameGC;

  Window framewin;
  Resource *resource;
  int desktop_nr;

  LinkedList<WindowList> *windowList;
  LinkedList<DesktopList> *desktopList;

  void MakeWindow(bool);
  void addDesktopWindow(struct DesktopList *,bool);
  void addFrameWindow(struct WindowList *,Window,bool);
  void removeDesktopWindow(void);
  void reconfigure(void);
  int getDesktop(Window);
  int getWindowGeometry(struct WindowList *);
  void changeDesktop(int);
  void removeWindow(Window);
  void changeWindow(Window);
  void raiseWindow(Window);
  void lowerWindow(Window);
  void focusWindow(Window);
  void desktopChange(int );
  int winOnDesktop(Window);
  bool isIcon(Window);
  void changeWinDesktop(Window,int);
  void moveWinToDesktop(Window,DesktopList *);
  int getCurrentDesktopNr(void) { return current_desktop_nr; }
  int getNumberOfDesktops(void) { return number_of_desktops; }
  void setNumberOfDesktops(int n) { number_of_desktops=n; }

  void setBlackboxInit(void) { wm_init = True; }
  struct PIXMAP getPixmap(void) { return pixmap; }
  Resource *getResource(void) { return resource; }

protected:
  virtual void process_event(XEvent *);
  
private:

  bool lower;
  bool wm_init;
  int day,month,year;
  int number_of_desktops;
  int current_desktop_nr;
  PIXMAP  pixmap;
  GEOM frame;
  GEOM label;
  GEOM lbutton;
  GEOM rbutton;
  fd_set rfds;
  char **iargv;
  int iargc;
  int row_last,column_last;
  
  Window focuswin;
  
  WMInterface *wminterface;

void CheckConfig(void);

};

#endif /* __MAIN_HH */