summaryrefslogtreecommitdiff
path: root/vcl/inc/unx/gtk
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-11-13 06:13:22 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2017-07-13 12:10:25 +0200
commit3e20ce802ee2ab49c4f2a98880f6e999657686bb (patch)
tree36371101121e00c047e7b99755c55bb3336ea620 /vcl/inc/unx/gtk
parent1fedc1c38a141bf071c707fda6a3ae1a5bf8fd41 (diff)
GTK+ simplifiy system timer implementation
Instead of implementing an own GSource, this implements the glib based system timer using the g_timeout_source_new() function. It removes the vector of GtkSalTimer and changes the remaining timer to be single-shot, just like the Windows and KDE platforms. The ownership handling is a little bit strange and should generally be changed to use std::shared_ptr as the result of CreateSalTimer for all backends. Change-Id: Iea40a6284bdc5c121235af5a6079a92a679391ca
Diffstat (limited to 'vcl/inc/unx/gtk')
-rw-r--r--vcl/inc/unx/gtk/gtkdata.hxx4
-rw-r--r--vcl/inc/unx/gtk/gtkinst.hxx4
2 files changed, 3 insertions, 5 deletions
diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx
index 2582314eb003..052fc071dcc0 100644
--- a/vcl/inc/unx/gtk/gtkdata.hxx
+++ b/vcl/inc/unx/gtk/gtkdata.hxx
@@ -81,15 +81,13 @@ inline void widget_set_can_default(GtkWidget *widget, gboolean can_default)
class GtkSalTimer : public SalTimer
{
- struct SalGtkTimeoutSource *m_pTimeout;
+ GSource *m_pTimeout;
public:
GtkSalTimer();
virtual ~GtkSalTimer() override;
virtual void Start( sal_uLong nMS ) override;
virtual void Stop() override;
bool Expired();
-
- sal_uLong m_nTimeoutMS;
};
class GtkData : public SalGenericData
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 4c86a3d62867..ff8271b514a4 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -233,12 +233,12 @@ public:
const cairo_font_options_t* GetLastSeenCairoFontOptions();
void ResetLastSeenCairoFontOptions();
- void RemoveTimer (SalTimer *pTimer);
+ void RemoveTimer();
std::shared_ptr<vcl::unx::GtkPrintWrapper> const & getPrintWrapper() const;
private:
- std::vector<GtkSalTimer *> m_aTimers;
+ GtkSalTimer* m_pTimer;
#if GTK_CHECK_VERSION(3,0,0)
std::unordered_map< GdkAtom, css::uno::Reference<css::uno::XInterface> > m_aClipboards;
#endif