summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/uilib/qui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/designer/uilib/qui.cpp')
-rw-r--r--qtruby/rubylib/designer/uilib/qui.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/qtruby/rubylib/designer/uilib/qui.cpp b/qtruby/rubylib/designer/uilib/qui.cpp
index c52a40f2..912918f6 100644
--- a/qtruby/rubylib/designer/uilib/qui.cpp
+++ b/qtruby/rubylib/designer/uilib/qui.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- qui.cpp - A ruby wrapper for the TQWidgetFactory class
+ tqui.cpp - A ruby wrapper for the TTQWidgetFactory class
-------------------
begin : Wed Mar 14 2004
copyright : (C) 2004 by Richard Dale
@@ -41,37 +41,37 @@ extern bool isDerivedFrom(Smoke *smoke, Smoke::Index classId, Smoke::Index baseI
extern "C" {
extern VALUE set_obj_info(const char * className, smokeruby_object * o);
-static VALUE qui_module;
+static VALUE tqui_module;
static VALUE qwidget_factory_class;
static VALUE
create(int argc, VALUE * argv, VALUE /*klass*/)
{
- TQWidget * topLevelWidget = 0;
+ TTQWidget * topLevelWidget = 0;
VALUE result = Qnil;
if (argc == 0 || argc > 4) {
rb_raise(rb_eArgError, "wrong number of arguments (%d)\n", argc);
}
- TQObject * connector = 0;
+ TTQObject * connector = 0;
if (argc >= 2) {
if (TYPE(argv[1]) == T_DATA) {
smokeruby_object *o = value_obj_info(argv[1]);
if (o != 0) {
- connector = (TQObject *) o->ptr;
+ connector = (TTQObject *) o->ptr;
}
} else {
rb_raise(rb_eArgError, "invalid argument type\n");
}
}
- TQWidget * parent = 0;
+ TTQWidget * parent = 0;
if (argc >= 3) {
if (TYPE(argv[2]) == T_DATA) {
smokeruby_object *o = value_obj_info(argv[2]);
if (o != 0) {
- parent = (TQWidget *) o->ptr;
+ parent = (TTQWidget *) o->ptr;
}
} else {
rb_raise(rb_eArgError, "invalid argument type\n");
@@ -88,18 +88,18 @@ create(int argc, VALUE * argv, VALUE /*klass*/)
}
if (TYPE(argv[0]) == T_STRING) {
- topLevelWidget = TQWidgetFactory::create(TQString(StringValuePtr(argv[0])), connector, parent, name);
+ topLevelWidget = TTQWidgetFactory::create(TTQString(StringValuePtr(argv[0])), connector, parent, name);
} else if (TYPE(argv[0]) == T_DATA) {
- TQIODevice * dev = 0;
+ TTQIODevice * dev = 0;
smokeruby_object *o = value_obj_info(argv[0]);
- if (o != 0 && o->ptr != 0 && o->classId == qt_Smoke->idClass("QIODevice")) {
- dev = (TQIODevice *) o->ptr;
+ if (o != 0 && o->ptr != 0 && o->classId == qt_Smoke->idClass("TQIODevice")) {
+ dev = (TTQIODevice *) o->ptr;
} else {
rb_raise(rb_eArgError, "invalid argument type\n");
}
- topLevelWidget = TQWidgetFactory::create(dev, connector, parent, name);
+ topLevelWidget = TTQWidgetFactory::create(dev, connector, parent, name);
} else {
rb_raise(rb_eArgError, "invalid argument type\n");
}
@@ -121,7 +121,7 @@ create(int argc, VALUE * argv, VALUE /*klass*/)
static VALUE
load_images(VALUE klass, VALUE dir)
{
- TQWidgetFactory::loadImages(TQString(StringValuePtr(dir)));
+ TTQWidgetFactory::loadImages(TTQString(StringValuePtr(dir)));
return klass;
}
@@ -129,14 +129,14 @@ static VALUE
widgets(VALUE /*self*/)
{
VALUE result = rb_ary_new();
- TQStringList widgetList = TQWidgetFactory::widgets();
+ TTQStringList widgetList = TTQWidgetFactory::widgets();
- for (TQStringList::Iterator it = widgetList.begin(); it != widgetList.end(); ++it) {
- TQString widgetName = *it;
+ for (TTQStringList::Iterator it = widgetList.begin(); it != widgetList.end(); ++it) {
+ TTQString widgetName = *it;
if (widgetName.startsWith("Q")) {
- widgetName.replace(0, 1, TQString("Qt::"));
+ widgetName.replace(0, 1, TTQString("TQt::"));
} else if (widgetName.startsWith("K")) {
- widgetName.replace(0, 1, TQString("KDE::"));
+ widgetName.replace(0, 1, TTQString("KDE::"));
}
rb_ary_push(result, rb_str_new2(widgetName.latin1()));
}
@@ -147,22 +147,22 @@ widgets(VALUE /*self*/)
static VALUE
supports_widget(VALUE /*self*/, VALUE widget)
{
- TQString widgetName(StringValuePtr(widget));
+ TTQString widgetName(StringValuePtr(widget));
- if (widgetName.startsWith("Qt::")) {
- widgetName.replace(0, 4, TQString("Q"));
+ if (widgetName.startsWith("TQt::")) {
+ widgetName.replace(0, 4, TTQString("Q"));
} else if (widgetName.startsWith("KDE::")) {
- widgetName.replace(0, 5, TQString("K"));
+ widgetName.replace(0, 5, TTQString("K"));
}
- return TQWidgetFactory::supportsWidget(widgetName) ? Qtrue : Qfalse;
+ return TTQWidgetFactory::supportsWidget(widgetName) ? Qtrue : Qfalse;
}
void
-Init_qui()
+Init_tqui()
{
- qui_module = rb_define_module("QUI");
- qwidget_factory_class = rb_define_class_under(qui_module, "WidgetFactory", rb_cObject);
+ tqui_module = rb_define_module("TQUI");
+ qwidget_factory_class = rb_define_class_under(tqui_module, "WidgetFactory", rb_cObject);
rb_define_singleton_method(qwidget_factory_class, "create", (VALUE (*) (...)) create, -1);
rb_define_singleton_method(qwidget_factory_class, "loadImages", (VALUE (*) (...)) load_images, 1);