~ubuntu-branches/ubuntu/raring/workrave/raring

« back to all changes in this revision

Viewing changes to frontend/gtkmm/src/MainWindow.hh

  • Committer: Package Import Robot
  • Author(s): Francois Marier, Francois Marier, Jordi Mallach
  • Date: 2012-05-28 11:29:40 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20120528112940-bbbsjkk30fom9s8x
Tags: 1.9.909+abc941eb70-1
[ Francois Marier ]
* New upstream snapshot
  - Drop leak-fix patch (applied upstream)
  - Document how the tarball is built in README.source
* Build GNOME applets and use gsettings
* Massive update of Build-Depends as per configure.ac

* Update README.source with snapshot instructions
* Switch to machine-readable copyright file
* Update alioth git repo links
* Bump debhelper version to 9
* Bump Standards-Version to 3.9.3

[ Jordi Mallach ]
* Avoid references to GNU/Linux in manpage.
* Drop build dependency on libgnet-dev, it's obsolete and unneeded.
* Add myself to Uploaders.
* Rewrite d/rules into dh style.
  - Move all install tweaks to .install files.
  - Install manpages using dh_installman.
* As a side effect, the package installs arch-dependant data in the
  arch triplet directory; add the required Pre-Depends for m-a-support.
* Bring back GNOME Panel applet (for GNOME 3 fallback mode) and ship the
  new GNOME Shell extension (closes: #642514, #666100).
* Add private_dirs.patch: move libworkrave-private and GObject
  Introspection files to a private dir, so they are really out of the
  way, but disable it for now as it breaks the Shell extension.
* Move typelib out of the triplet dir as gobject-introspection is not
  M-A ready yet.
* Enable dh_autoreconf for the above patches.
* Add lintian overrides.
* Add necessary Breaks/Replaces as the xpm icon has moved to workrave-data.
* Prefix all debhelper files with package name.
* Suggest gnome-shell and gnome-panel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// MainWindow.hh --- Main info Window
2
2
//
3
 
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Rob Caelers & Raymond Penners
 
3
// Copyright (C) 2001 - 2012 Rob Caelers & Raymond Penners
4
4
// All rights reserved.
5
5
//
6
6
// This program is free software: you can redistribute it and/or modify
23
23
#include "preinclude.h"
24
24
 
25
25
#include <string>
26
 
 
27
 
class GUI;
28
 
class TimeBar;
29
 
class NetworkLogDialog;
30
 
class TimerBoxControl;
31
 
class TimerBoxGtkView;
32
 
 
33
26
#include <gtkmm/window.h>
34
27
 
35
28
#ifdef PLATFORM_OS_WIN32
39
32
 
40
33
#include "IConfiguratorListener.hh"
41
34
 
42
 
namespace Gtk
43
 
{
44
 
  class Menu;
45
 
}
 
35
class TimerBoxControl;
 
36
class TimerBoxGtkView;
46
37
 
47
38
using namespace workrave;
48
39
 
54
45
  MainWindow();
55
46
  ~MainWindow();
56
47
 
 
48
  void init();
 
49
  void toggle_window();
57
50
  void open_window();
58
51
  void close_window();
59
 
  void set_applet_active(bool a);
60
 
  void status_icon_changed();
61
 
 
 
52
  void set_can_close(bool can_close);
 
53
  
62
54
  void update();
63
55
  void relocate_window(int width, int height);
64
56
 
65
 
  void on_activate();
66
 
 
67
 
  static bool get_always_on_top();
68
 
  static void set_always_on_top(bool b);
69
 
 
 
57
  sigc::signal<void> &signal_closed();
 
58
  sigc::signal<void> &signal_visibility_changed();
 
59
 
 
60
  bool is_visible() const;
 
61
  
70
62
protected:
71
63
  bool on_button_press_event(GdkEventButton *event);
72
64
 
73
65
private:
74
 
  //! Window enabled
 
66
  void on_visibility_changed();
 
67
 
 
68
private:
 
69
  //! Is the main window enabled?
75
70
  bool enabled;
76
71
 
77
 
  //! Connection to the delete_event signal.
78
 
  // SigC::Connection delete_connection;
79
 
 
80
 
  //! Connection to the timeout timer.
81
 
  // SigC::Connection timer_connection;
82
 
 
83
 
  //! Table containing all timer information
 
72
  //! Can the user close the window?
 
73
  bool can_close;
 
74
 
 
75
  //! Controller that determines the timerbox content
84
76
  TimerBoxControl *timer_box_control;
85
77
 
86
 
  //! Table containing all timer information
 
78
  //! View that displays the timerbox.
87
79
  TimerBoxGtkView *timer_box_view;
88
80
 
89
 
  //! Is the monitoring function suspended?
90
 
  bool monitor_suspended;
91
 
 
92
 
  //! Is the visible?
93
 
  bool visible;
94
 
 
95
 
  //! Applet active?
96
 
  bool applet_active;
97
 
 
98
81
#ifdef PLATFORM_OS_UNIX
99
82
  Gtk::Window *leader;
100
83
#endif
108
91
  //! Relocated location of main window
109
92
  Gdk::Point window_relocated_location;
110
93
 
 
94
  //! Event triggered when the main window has been closed by the user
 
95
  sigc::signal<void> closed_signal;
 
96
 
 
97
  //!
 
98
  sigc::signal<void> visibility_changed_signal;
 
99
 
 
100
  //!
 
101
  sigc::connection visible_connection;
 
102
  
111
103
private:
112
 
  //
113
 
  void init();
114
104
  void setup();
115
105
  void config_changed_notify(const std::string &key);
116
106
  void locate_window(GdkEventConfigure *event);
117
107
  void move_to_start_position();
118
108
 
119
 
  // Events.
 
109
  // UI Events.
120
110
  bool on_delete_event(GdkEventAny*);
121
111
  bool on_configure_event(GdkEventConfigure *event);
122
 
 
123
 
public:
124
 
  static void set_start_in_tray(bool b);
125
 
  static bool get_start_in_tray();
126
 
 
 
112
  
127
113
  static void get_start_position(int &x, int &y, int &head);
128
114
  static void set_start_position(int x, int y, int head);
129
115
 
130
 
  static const std::string CFG_KEY_MAIN_WINDOW;
131
 
  static const std::string CFG_KEY_MAIN_WINDOW_ALWAYS_ON_TOP;
132
 
  static const std::string CFG_KEY_MAIN_WINDOW_START_IN_TRAY;
133
 
  static const std::string CFG_KEY_MAIN_WINDOW_X;
134
 
  static const std::string CFG_KEY_MAIN_WINDOW_Y;
135
 
  static const std::string CFG_KEY_MAIN_WINDOW_HEAD;
136
 
 
137
116
#ifdef PLATFORM_OS_WIN32
138
117
private:
139
118
  void win32_show(bool b);
147
126
  HWND win32_main_hwnd;
148
127
  HINSTANCE win32_hinstance;
149
128
  int show_retry_count;
150
 
 
151
129
  sigc::connection timeout_connection;
152
130
#endif
153
131
};
154
132
 
155
 
 
156
 
// inline bool
157
 
// MainWindow::get_iconified() const
158
 
// {
159
 
//   return iconified;
160
 
// }
161
 
 
162
133
#endif // MAINWINDOW_HH