~sil2100/nux/precise_sru-1

« back to all changes in this revision

Viewing changes to tests/xtest-focus-on-mouse-down.cpp

  • Committer: Didier Roche
  • Date: 2012-02-17 10:28:35 UTC
  • mfrom: (159.3.34)
  • Revision ID: didier.roche@canonical.com-20120217102835-7fyqcabz0vad239t
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "Nux/Nux.h"
22
22
#include "Nux/WindowThread.h"
23
23
#include "Nux/VLayout.h"
 
24
#include "Nux/ProgramFramework/ProgramTemplate.h"
 
25
#include "Nux/ProgramFramework/TestView.h"
24
26
#include <X11/extensions/XTest.h>
25
27
#include <X11/keysym.h> 
26
 
#include "nux_test_framework.h"
27
28
#include "nux_automated_test_framework.h"
28
 
#include "test-view.h"
29
29
 
30
 
class FocusOnMouseDownTest: public NuxTestFramework
 
30
class FocusOnMouseDownTest: public ProgramTemplate
31
31
{
32
32
public:
33
 
  FocusOnMouseDownTest(const char *program_name, int window_width, int window_height, int program_life_span);
 
33
  FocusOnMouseDownTest(const char* program_name, int window_width, int window_height, int program_life_span);
34
34
  ~FocusOnMouseDownTest();
35
35
 
36
36
  virtual void UserInterfaceSetup();
43
43
                                           int window_width,
44
44
                                           int window_height,
45
45
                                           int program_life_span)
46
 
  : NuxTestFramework(program_name, window_width, window_height, program_life_span)
47
 
  , focus_view_(nullptr)
48
 
  , no_focus_view_(nullptr)
 
46
: ProgramTemplate(program_name, window_width, window_height, program_life_span)
 
47
, focus_view_(nullptr)
 
48
, no_focus_view_(nullptr)
49
49
{
50
50
}
51
51
 
87
87
 
88
88
  nux::SleepForMilliseconds(1000);
89
89
 
90
 
  nux::WindowThread *wnd_thread = static_cast<nux::WindowThread*>(user_data);
 
90
  nux::WindowThread* wnd_thread = static_cast<nux::WindowThread*>(user_data);
91
91
 
92
92
  NuxAutomatedTestFramework test(wnd_thread);
93
93
 
132
132
  nuxDebugMsg("Exit testing thread");
133
133
}
134
134
 
135
 
int main(int argc, char **argv)
 
135
int main(int argc, char** argv)
136
136
{
137
137
  int xstatus = XInitThreads();
138
138
  nuxAssertMsg(xstatus > 0, "XInitThreads has failed");
141
141
  focus_on_mouse_down_test->Startup();
142
142
  focus_on_mouse_down_test->UserInterfaceSetup();
143
143
 
144
 
  nux::SystemThread *test_thread = nux::CreateSystemThread(focus_on_mouse_down_test->GetWindowThread(), 
 
144
  nux::SystemThread* test_thread = nux::CreateSystemThread(focus_on_mouse_down_test->GetWindowThread(), 
145
145
                                                           &TestingThread,
146
146
                                                           focus_on_mouse_down_test->GetWindowThread());
147
147