File: CWWindow.h

package info (click to toggle)
craftywatcher 1.4-2
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 88 kB
  • ctags: 98
  • sloc: cpp: 660; makefile: 52
file content (72 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download
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
#ifndef CW_WINDOW_H
#define CW_WINDOW_H

#include <string>
#include <gtk--/window.h>

class CWText;
class Gtk_VBox;
class Gtk_HBox;
class Gtk_Button;

class CWWindow : public Gtk_Window
{
public:

  CWWindow();
  virtual ~CWWindow();

protected:

  virtual void RewCB();
  virtual void PrevCB();
  virtual void NextCB();
  virtual void FfCB();
  virtual void AboutCB();
  virtual void ExitCB();

  virtual void FileLoadedCB(const string& fileName);

  virtual gint delete_event_impl(GdkEventAny* p1);

private:

  void GetCraftyLogPath();
  void GlobForMaxMin();
  int GetFileNumber(const string& fileName);
  gint InitialLoadFileCB();
  void LoadFile(const string& fileName, bool waitUntilAtEnd = false);

  string CreateFileName(int n);
  string GetBaseName(const string& baseName);


  gint TickCB();
  void CheckForNewFile();
  void RugPulledOutFromUnder();


  // gui
  Gtk_VBox* _vbox;
  CWText* _text;
  Gtk_HBox* _buttonBox;
  Gtk_Button* _rewButton;
  Gtk_Button* _prevButton;
  Gtk_Button* _nextButton;
  Gtk_Button* _ffButton;
  Gtk_Button* _aboutButton;
  Gtk_Button* _exitButton;

  string _craftyLogPath;
  string _baseStr;
  string _globPattern;
  string _newFileName;

  int _n;      // Current file number
  int _nMax;   // Max file number
  int _nMin;   // Min file number

  Connection _tick;
};

#endif  /*  CW_WINDOW_H  */