~brandontschaefer/nux/xim-support-12-04-SRU

« back to all changes in this revision

Viewing changes to NuxGraphics/Events.cpp

  • Committer: Brandon Schaefer
  • Date: 2013-05-23 21:21:46 UTC
  • Revision ID: brandon.schaefer@canonical.com-20130523212146-pst2eltm14z05lj0
* Avoid breaking the ABI!

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "GLResource.h"
23
23
#include "Events.h"
24
24
 
25
 
 
26
25
namespace nux
27
26
{
28
27
  MouseButton GetEventButton(unsigned long button_state)
60
59
 
61
60
  Event::Event()
62
61
  {
63
 
    Memset(text, 0, sizeof(text));
64
62
    dtext = nullptr;
65
63
 
66
64
    for (int i = 0; i < NUX_MAX_VK; i++)
102
100
  void Event::Reset()
103
101
  {
104
102
    type = NUX_NO_EVENT;
105
 
    Memset(text, 0, sizeof(text));
106
103
#if defined(NUX_OS_WINDOWS)
107
104
    win32_keycode = 0;
108
105
    win32_keysym = 0;
114
111
    x11_key_state = 0;
115
112
#endif
116
113
 
117
 
        delete[] dtext;
 
114
    delete[] dtext;
118
115
    dtext = nullptr;
119
116
 
120
117
    key_repeat_count = 0;
214
211
 
215
212
  const char* Event::GetText() const
216
213
  {
217
 
    if (dtext)
218
 
                return dtext;
219
 
 
220
 
    return text;
 
214
    return dtext;
221
215
  }
222
216
 
223
217