summaryrefslogtreecommitdiff
path: root/TAO/tests/Xt_Stopwatch
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/Xt_Stopwatch')
-rw-r--r--TAO/tests/Xt_Stopwatch/.cvsignore4
-rw-r--r--TAO/tests/Xt_Stopwatch/Client.h4
-rw-r--r--TAO/tests/Xt_Stopwatch/Control.cpp2
-rw-r--r--TAO/tests/Xt_Stopwatch/Control.h2
-rw-r--r--TAO/tests/Xt_Stopwatch/README26
-rw-r--r--TAO/tests/Xt_Stopwatch/Stopwatch_display.cpp2
-rw-r--r--TAO/tests/Xt_Stopwatch/Stopwatch_display.h3
-rw-r--r--TAO/tests/Xt_Stopwatch/Xt_Stopwatch.mpc6
-rw-r--r--TAO/tests/Xt_Stopwatch/client.cpp14
-rw-r--r--TAO/tests/Xt_Stopwatch/server.cpp18
-rw-r--r--TAO/tests/Xt_Stopwatch/svc.conf3
-rw-r--r--TAO/tests/Xt_Stopwatch/svc.conf.xml9
-rw-r--r--TAO/tests/Xt_Stopwatch/test_i.cpp5
-rw-r--r--TAO/tests/Xt_Stopwatch/test_i.h3
-rw-r--r--TAO/tests/Xt_Stopwatch/timer.cpp2
-rw-r--r--TAO/tests/Xt_Stopwatch/timer.h2
16 files changed, 19 insertions, 86 deletions
diff --git a/TAO/tests/Xt_Stopwatch/.cvsignore b/TAO/tests/Xt_Stopwatch/.cvsignore
new file mode 100644
index 00000000000..955ffdc75d5
--- /dev/null
+++ b/TAO/tests/Xt_Stopwatch/.cvsignore
@@ -0,0 +1,4 @@
+client
+client
+server
+server
diff --git a/TAO/tests/Xt_Stopwatch/Client.h b/TAO/tests/Xt_Stopwatch/Client.h
index e39fb418d95..978e0f3c3b1 100644
--- a/TAO/tests/Xt_Stopwatch/Client.h
+++ b/TAO/tests/Xt_Stopwatch/Client.h
@@ -18,9 +18,8 @@
#include "testC.h"
-#if defined (ACE_HAS_XT)
-#include "tao/xt_resource.h"
+#include "tao/XtResource_Loader.h"
class Control;
class Client
@@ -59,5 +58,4 @@ private:
// The server.
};
-#endif /*ACE_HAS_XT*/
#endif /* CLIENT_H */
diff --git a/TAO/tests/Xt_Stopwatch/Control.cpp b/TAO/tests/Xt_Stopwatch/Control.cpp
index 9e7745c2f24..6d3de01204b 100644
--- a/TAO/tests/Xt_Stopwatch/Control.cpp
+++ b/TAO/tests/Xt_Stopwatch/Control.cpp
@@ -2,7 +2,6 @@
#include "Control.h"
-#if defined (ACE_HAS_XT)
Control::Control (Widget &parent)
{
@@ -53,4 +52,3 @@ Control::stopwidget (void)
return this->stopwidget_;
}
-#endif /*ACE_HAS_XT*/
diff --git a/TAO/tests/Xt_Stopwatch/Control.h b/TAO/tests/Xt_Stopwatch/Control.h
index 88aaeada02c..0dea6b7eed9 100644
--- a/TAO/tests/Xt_Stopwatch/Control.h
+++ b/TAO/tests/Xt_Stopwatch/Control.h
@@ -17,7 +17,6 @@
#define CONTROL_H
#include "Client.h"
-#if defined (ACE_HAS_XT)
#include <Xm/Xm.h>
#include <Xm/PushB.h>
@@ -60,6 +59,5 @@ class Control
};
-#endif /*ACE_HAS_XT */
#endif /* CONTROL_H */
diff --git a/TAO/tests/Xt_Stopwatch/README b/TAO/tests/Xt_Stopwatch/README
index 3bbd0f6f22c..85040fb2895 100644
--- a/TAO/tests/Xt_Stopwatch/README
+++ b/TAO/tests/Xt_Stopwatch/README
@@ -24,22 +24,12 @@ Technical Description:
In addition to specifying the resources that the ORB needs to allocate
for an Xt event loop, the ORB also needs the information about the
XtAppContext in which the user application is initialised. To provide
-these information TAO provides a class by name
-"TAO_XT_Resource_Factory" that inherits from the
-TAO_Default_Resource_factory. This provides the user with a static
-method through which he can set the XtAppContext.
-
-To make TAO understand that the user is in fact wants to use the
-TAO_XT_Resource_Factory and not the default resource factory, the
-application developer must add the following line to his svc.conf
-file.
-
-dynamic Resource_Factory Service_Object *
-TAO:_make_TAO_XT_Resource_Factory() ""
-
-Please see the line of code in server.cpp that sets the XtAppContext
-in the TAO_XT_Resource_factory.
-
-One more interseting observation would be to note that the server and
-client run on the Xt event loop by calling the XtAppMainLoop ().
+these information TAO provides a class by name TAO_XtResource_Loader which is
+responsible for create and instance of TAO_XtResource_Factory that inherits
+from the TAO_Default_Resource_factory. TAO_XtResource_Loader has a constructor
+parameterized the application context necessary for integration of ACE_XtReactor
+with Xt event loop.
+
+Please notice also that the server and client run on the Xt event loop by
+calling the XtAppMainLoop ().
diff --git a/TAO/tests/Xt_Stopwatch/Stopwatch_display.cpp b/TAO/tests/Xt_Stopwatch/Stopwatch_display.cpp
index 9020bdd4e44..9f55249b27b 100644
--- a/TAO/tests/Xt_Stopwatch/Stopwatch_display.cpp
+++ b/TAO/tests/Xt_Stopwatch/Stopwatch_display.cpp
@@ -2,7 +2,6 @@
#include "Stopwatch_display.h"
-#if defined (ACE_HAS_XT)
#include "ace/OS_NS_stdio.h"
@@ -58,4 +57,3 @@ Stopwatch_display::set_time (CORBA::Float time)
XmStringFree (xmstr);
}
-#endif /*ACE_HAS_XT*/
diff --git a/TAO/tests/Xt_Stopwatch/Stopwatch_display.h b/TAO/tests/Xt_Stopwatch/Stopwatch_display.h
index dd62dd9d5eb..984d90b4d35 100644
--- a/TAO/tests/Xt_Stopwatch/Stopwatch_display.h
+++ b/TAO/tests/Xt_Stopwatch/Stopwatch_display.h
@@ -18,8 +18,6 @@
#include /**/ "ace/pre.h"
#include "tao/ORB_Constants.h"
-#if defined (ACE_HAS_XT)
-
#include <Xm/Xm.h>
#include <Xm/Frame.h>
#include <Xm/Label.h>
@@ -48,7 +46,6 @@ private:
// Label Widget that is used to display time..
};
-#endif /*ACE_HAS_XT*/
#include /**/ "ace/post.h"
#endif /* STOPWATCH_H */
diff --git a/TAO/tests/Xt_Stopwatch/Xt_Stopwatch.mpc b/TAO/tests/Xt_Stopwatch/Xt_Stopwatch.mpc
index fa1415dbe43..d98e1e04898 100644
--- a/TAO/tests/Xt_Stopwatch/Xt_Stopwatch.mpc
+++ b/TAO/tests/Xt_Stopwatch/Xt_Stopwatch.mpc
@@ -1,8 +1,7 @@
// -*- MPC -*-
// $Id$
-project(*Server): taoexe, portableserver {
- requires += xt_reactor
+project(*Server): taoexe, portableserver, tao_xtresource, ace_motif {
Source_Files {
test_i.cpp
Stopwatch_display.cpp
@@ -11,8 +10,7 @@ project(*Server): taoexe, portableserver {
}
}
-project(*Client): taoexe {
- requires += xt_reactor
+project(*Client): taoexe, tao_xtresource, ace_motif {
Source_Files {
testC.cpp
Control.cpp
diff --git a/TAO/tests/Xt_Stopwatch/client.cpp b/TAO/tests/Xt_Stopwatch/client.cpp
index f40fe31f222..5ef015f0e6a 100644
--- a/TAO/tests/Xt_Stopwatch/client.cpp
+++ b/TAO/tests/Xt_Stopwatch/client.cpp
@@ -5,17 +5,6 @@
ACE_RCSID(Xt_Stopwatch, client, "$Id$")
-#if !defined (ACE_HAS_XT)
-
-int
-main (int, char *[])
-{
- ACE_ERROR ((LM_INFO,
- "Xt not supported on this platform\n"));
- return 0;
-}
-
-#else
#include "Control.h"
#include "Client.h"
@@ -34,7 +23,7 @@ main (int argc, char *argv[])
NULL,
0);
- TAO_XT_Resource_Factory::set_context (app);
+ TAO::XtResource_Loader xt_loader (app);
Control control (toplevel);
@@ -191,4 +180,3 @@ Client::stop_hook (void)
ACE_CHECK;
}
-#endif /* ACE_HAS_FL */
diff --git a/TAO/tests/Xt_Stopwatch/server.cpp b/TAO/tests/Xt_Stopwatch/server.cpp
index d7febb879c3..374dcb368f0 100644
--- a/TAO/tests/Xt_Stopwatch/server.cpp
+++ b/TAO/tests/Xt_Stopwatch/server.cpp
@@ -8,20 +8,7 @@ ACE_RCSID (Xt_Stopwatch,
server,
"$Id$")
-
-#if !defined (ACE_HAS_XT)
-
-int
-main (int, char *[])
-{
- ACE_ERROR ((LM_INFO,
- "Xt not supported on this platform\n"));
- return 0;
-}
-
-#else
-
-#include "tao/xt_resource.h"
+#include "tao/XtResource_Loader.h"
#include <Xm/Xm.h>
#include "Stopwatch_display.h"
#include "timer.h"
@@ -72,7 +59,7 @@ main (int argc, char *argv[])
NULL,
0);
- TAO_XT_Resource_Factory::set_context (app);
+ TAO::XtResource_Loader xt_loader (app);
Stopwatch_display stopwatch (toplevel);
@@ -157,4 +144,3 @@ main (int argc, char *argv[])
return 0;
}
-#endif /* ACE_HAS_Xt */
diff --git a/TAO/tests/Xt_Stopwatch/svc.conf b/TAO/tests/Xt_Stopwatch/svc.conf
deleted file mode 100644
index 9d6894193c4..00000000000
--- a/TAO/tests/Xt_Stopwatch/svc.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id$
-#
-dynamic Resource_Factory Service_Object * TAO:_make_TAO_XT_Resource_Factory() ""
diff --git a/TAO/tests/Xt_Stopwatch/svc.conf.xml b/TAO/tests/Xt_Stopwatch/svc.conf.xml
deleted file mode 100644
index 58ce9b10ea3..00000000000
--- a/TAO/tests/Xt_Stopwatch/svc.conf.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version='1.0'?>
-<!-- Converted from ./tests/Xt_Stopwatch/svc.conf by svcconf-convert.pl -->
-<ACE_Svc_Conf>
- <!-- $Id$ -->
- <!-- -->
- <dynamic id="Resource_Factory" type="Service_Object">
- <initializer path="TAO" init="_make_TAO_XT_Resource_Factory"/>
- </dynamic>
-</ACE_Svc_Conf>
diff --git a/TAO/tests/Xt_Stopwatch/test_i.cpp b/TAO/tests/Xt_Stopwatch/test_i.cpp
index b3e9678fa62..de99f651892 100644
--- a/TAO/tests/Xt_Stopwatch/test_i.cpp
+++ b/TAO/tests/Xt_Stopwatch/test_i.cpp
@@ -2,9 +2,7 @@
#include "test_i.h"
-#if defined(ACE_HAS_XT)
-
-ACE_RCSID(FL_Cube, test_i, "$Id$")
+ACE_RCSID(Xt_Stopwatch, test_i, "$Id$")
Stopwatch_imp::Stopwatch_imp (CORBA::ORB_ptr orb, Timer_imp *timer)
: orb_ (CORBA::ORB::_duplicate (orb)),
@@ -33,4 +31,3 @@ Stopwatch_imp::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
this->orb_->shutdown (0);
}
-#endif /* ACE_HAS_XT */
diff --git a/TAO/tests/Xt_Stopwatch/test_i.h b/TAO/tests/Xt_Stopwatch/test_i.h
index 9250769c1b8..33e4e0e826f 100644
--- a/TAO/tests/Xt_Stopwatch/test_i.h
+++ b/TAO/tests/Xt_Stopwatch/test_i.h
@@ -19,7 +19,6 @@
#include "testS.h"
#include "timer.h"
-#if defined(ACE_HAS_XT)
class Stopwatch_imp : public POA_Stopwatch
{
@@ -51,6 +50,4 @@ private:
// Hold the timer object...
};
-#endif /* ACE_HAS_XT */
-
#endif /* SERVER_TEST_I_H */
diff --git a/TAO/tests/Xt_Stopwatch/timer.cpp b/TAO/tests/Xt_Stopwatch/timer.cpp
index 35716040392..e9dca4c405e 100644
--- a/TAO/tests/Xt_Stopwatch/timer.cpp
+++ b/TAO/tests/Xt_Stopwatch/timer.cpp
@@ -1,7 +1,6 @@
//$Id$
#include "timer.h"
-#if defined (ACE_HAS_XT)
Timer_imp::Timer_imp (XtAppContext &app,
CORBA::Long interval,
@@ -84,4 +83,3 @@ Timer_imp::report_time (CORBA::Float time)
}
-#endif /*ACE_HAS_XT*/
diff --git a/TAO/tests/Xt_Stopwatch/timer.h b/TAO/tests/Xt_Stopwatch/timer.h
index 08ae4345a40..6c2362cb1a3 100644
--- a/TAO/tests/Xt_Stopwatch/timer.h
+++ b/TAO/tests/Xt_Stopwatch/timer.h
@@ -18,7 +18,6 @@
#include "Stopwatch_display.h"
-#if defined (ACE_HAS_XT)
#include <Xm/Xm.h>
@@ -69,6 +68,5 @@ class Timer_imp
// Required by Xt functions
};
-#endif /*ACE_HAS_XT*/
#endif /* TIMER_H */