From a929c9a3b465db8b7e17b9b39936c612c2621a7c Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Fri, 14 Jul 2006 16:20:12 +0000 Subject: * Remove all bindings --- Doxyfile.in | 2 +- Makefile.am | 53 +- configure.in | 472 +- dbus-glib-1.pc.in | 12 - dbus/Makefile.am | 22 +- dbus/dbus-glib-lowlevel.h | 72 - dbus/dbus-glib.h | 256 - dbus/make-dbus-glib-error-enum.sh | 25 - gcj/.cvsignore | 6 - gcj/Makefile.am | 18 - gcj/TestMessage.java | 8 - gcj/org/.cvsignore | 3 - gcj/org/Makefile.am | 1 - gcj/org/freedesktop/.cvsignore | 2 - gcj/org/freedesktop/Makefile.am | 1 - gcj/org/freedesktop/dbus/.cvsignore | 9 - gcj/org/freedesktop/dbus/Makefile.am | 57 - gcj/org/freedesktop/dbus/Message.java | 13 - gcj/org/freedesktop/dbus/natMessage.cc | 20 - glib/Makefile.am | 105 - glib/dbus-binding-tool-glib.c | 1625 - glib/dbus-binding-tool-glib.h | 40 - glib/dbus-gidl.c | 788 - glib/dbus-gidl.h | 158 - glib/dbus-glib-tool.c | 489 - glib/dbus-glib-tool.h | 38 - glib/dbus-glib.c | 304 - glib/dbus-gloader-expat.c | 266 - glib/dbus-gmain.c | 814 - glib/dbus-gmarshal.c | 89 - glib/dbus-gmarshal.h | 21 - glib/dbus-gmarshal.list | 1 - glib/dbus-gobject.c | 2217 - glib/dbus-gobject.h | 43 - glib/dbus-gparser.c | 881 - glib/dbus-gparser.h | 65 - glib/dbus-gproxy.c | 2748 - glib/dbus-gsignature.c | 210 - glib/dbus-gsignature.h | 19 - glib/dbus-gtest-main.c | 51 - glib/dbus-gtest.c | 92 - glib/dbus-gtest.h | 38 - glib/dbus-gthread.c | 179 - glib/dbus-gtool-test.h | 31 - glib/dbus-gtype-specialized.c | 778 - glib/dbus-gtype-specialized.h | 176 - glib/dbus-gutils.c | 130 - glib/dbus-gutils.h | 57 - glib/dbus-gvalue-utils.c | 1439 - glib/dbus-gvalue-utils.h | 73 - glib/dbus-gvalue.c | 1854 - glib/dbus-gvalue.h | 43 - glib/examples/.cvsignore | 17 - glib/examples/Makefile.am | 38 - glib/examples/example-client.c | 121 - glib/examples/example-service.c | 153 - glib/examples/example-service.xml | 19 - glib/examples/example-signal-emitter.c | 132 - glib/examples/example-signal-emitter.xml | 13 - glib/examples/example-signal-recipient.c | 102 - glib/examples/statemachine/.cvsignore | 16 - glib/examples/statemachine/Makefile.am | 35 - glib/examples/statemachine/sm-marshal.list | 1 - glib/examples/statemachine/statemachine-client.c | 662 - glib/examples/statemachine/statemachine-server.c | 229 - glib/examples/statemachine/statemachine-server.h | 37 - glib/examples/statemachine/statemachine-server.xml | 14 - glib/examples/statemachine/statemachine.c | 353 - glib/examples/statemachine/statemachine.h | 77 - glib/examples/statemachine/statemachine.xml | 33 - glib/make-dbus-glib-error-switch.sh | 29 - mono/.cvsignore | 17 - mono/Arguments.cs | 327 - mono/AssemblyInfo.cs.in | 6 - mono/Bus.cs | 54 - mono/BusDriver.cs | 37 - mono/Connection.cs | 354 - mono/DBusException.cs | 12 - mono/DBusType/Array.cs | 172 - mono/DBusType/Boolean.cs | 86 - mono/DBusType/Byte.cs | 105 - mono/DBusType/Dict.cs | 148 - mono/DBusType/Double.cs | 86 - mono/DBusType/IDBusType.cs | 16 - mono/DBusType/Int16.cs | 93 - mono/DBusType/Int32.cs | 93 - mono/DBusType/Int64.cs | 94 - mono/DBusType/ObjectPath.cs | 107 - mono/DBusType/String.cs | 95 - mono/DBusType/UInt16.cs | 93 - mono/DBusType/UInt32.cs | 95 - mono/DBusType/UInt64.cs | 95 - mono/Error.cs | 60 - mono/ErrorMessage.cs | 45 - mono/Handler.cs | 172 - mono/InterfaceAttribute.cs | 23 - mono/InterfaceProxy.cs | 121 - mono/Introspector.cs | 81 - mono/Makefile.am | 76 - mono/Message.cs | 437 - mono/MethodAttribute.cs | 12 - mono/MethodCall.cs | 80 - mono/MethodReturn.cs | 57 - mono/ProxyBuilder.cs | 608 - mono/README | 118 - mono/Server.cs | 148 - mono/Service.cs | 191 - mono/Signal.cs | 79 - mono/SignalAttribute.cs | 11 - mono/TODO | 8 - mono/Test.cs | 77 - mono/dbus-sharp.dll.config.in | 4 - mono/dbus-sharp.snk | Bin 596 -> 0 bytes mono/doc/.cvsignore | 4 - mono/doc/Makefile.am | 47 - mono/doc/dbus-sharp-docs.source | 4 - mono/doc/en/DBus.DBusType.xml | 10 - mono/doc/en/DBus.DBusType/Array.xml | 168 - mono/doc/en/DBus.DBusType/Boolean.xml | 168 - mono/doc/en/DBus.DBusType/Byte.xml | 184 - mono/doc/en/DBus.DBusType/Custom.xml | 168 - mono/doc/en/DBus.DBusType/Dict.xml | 168 - mono/doc/en/DBus.DBusType/Double.xml | 168 - mono/doc/en/DBus.DBusType/IDBusType.xml | 65 - mono/doc/en/DBus.DBusType/Int32.xml | 168 - mono/doc/en/DBus.DBusType/Int64.xml | 168 - mono/doc/en/DBus.DBusType/Nil.xml | 168 - mono/doc/en/DBus.DBusType/ObjectPath.xml | 168 - mono/doc/en/DBus.DBusType/String.xml | 168 - mono/doc/en/DBus.DBusType/UInt32.xml | 168 - mono/doc/en/DBus.DBusType/UInt64.xml | 168 - mono/doc/en/DBus.xml | 34 - mono/doc/en/DBus/Arguments.xml | 253 - mono/doc/en/DBus/Bus.xml | 60 - mono/doc/en/DBus/Connection.xml | 86 - mono/doc/en/DBus/Custom.xml | 65 - mono/doc/en/DBus/DBusException.xml | 26 - mono/doc/en/DBus/ErrorMessage.xml | 61 - mono/doc/en/DBus/InterfaceAttribute.xml | 54 - mono/doc/en/DBus/Message.xml | 431 - mono/doc/en/DBus/MessageType.xml | 111 - mono/doc/en/DBus/MethodAttribute.xml | 38 - mono/doc/en/DBus/MethodCall.xml | 107 - mono/doc/en/DBus/MethodReturn.xml | 76 - mono/doc/en/DBus/Server.xml | 62 - mono/doc/en/DBus/Service.xml | 148 - mono/doc/en/DBus/Signal.xml | 107 - mono/doc/en/DBus/SignalAttribute.xml | 38 - mono/doc/en/DBus/SignalCalledHandler.xml | 35 - mono/example/.cvsignore | 4 - mono/example/BusListener.cs | 44 - mono/example/EchoClient.cs | 19 - mono/example/EchoServer.cs | 23 - mono/example/Echoer.cs | 16 - mono/example/Makefile.am | 22 - python/.cvsignore | 10 - python/Makefile.am | 56 - python/__init__.py | 5 - python/_dbus.py | 308 - python/_util.py | 13 - python/dbus.pth | 1 - python/dbus_bindings.pxd.in | 8 - python/dbus_bindings.pyx | 1849 - python/dbus_glib_bindings.pyx | 17 - python/dbus_h_wrapper.h | 3 - python/decorators.py | 83 - python/examples/.cvsignore | 2 - python/examples/Makefile.am | 13 - python/examples/example-client.py | 22 - python/examples/example-service.py | 30 - python/examples/example-signal-emitter.py | 29 - python/examples/example-signal-recipient.py | 54 - python/examples/gconf-proxy-client.py | 13 - python/examples/gconf-proxy-service.py | 43 - python/examples/gconf-proxy-service2.py | 39 - python/examples/list-system-services.py | 22 - python/exceptions.py | 29 - python/extract.py | 234 - python/glib.py | 17 - python/introspect_parser.py | 51 - python/matchrules.py | 232 - python/proxies.py | 222 - python/service.py | 370 - python/types.py | 19 - qt/.cvsignore | 11 - qt/Doxyfile | 1261 - qt/Makefile.am | 9 - qt/README | 10 - qt/dbus/Makefile.am | 23 - qt/dbus/qdbus.h | 1 - qt/dbus/qdbusabstractadaptor.h | 1 - qt/dbus/qdbusabstractadaptor_p.h | 1 - qt/dbus/qdbusabstractinterface.h | 1 - qt/dbus/qdbusabstractinterface_p.h | 1 - qt/dbus/qdbusbus.h | 1 - qt/dbus/qdbusconnection.h | 1 - qt/dbus/qdbusconnection_p.h | 1 - qt/dbus/qdbuserror.h | 1 - qt/dbus/qdbusinterface.h | 1 - qt/dbus/qdbusinterface_p.h | 1 - qt/dbus/qdbusintrospection_p.h | 1 - qt/dbus/qdbusmacros.h | 1 - qt/dbus/qdbusmarshall_p.h | 1 - qt/dbus/qdbusmessage.h | 1 - qt/dbus/qdbusmessage_p.h | 1 - qt/dbus/qdbusmetaobject_p.h | 1 - qt/dbus/qdbusreply.h | 1 - qt/dbus/qdbusserver.h | 1 - qt/dbus/qdbustype_p.h | 1 - qt/dbus/qdbustypehelper_p.h | 1 - qt/dbus/qdbusutil.h | 1 - qt/dbus/qdbusxmlparser_p.h | 1 - qt/examples/.cvsignore | 11 - qt/examples/Makefile.am | 42 - qt/examples/chat.cpp | 136 - qt/examples/chat.h | 62 - qt/examples/chatadaptor.cpp | 36 - qt/examples/chatadaptor.h | 40 - qt/examples/chatmainwindow.ui | 188 - qt/examples/chatsetnickname.ui | 149 - qt/examples/com.trolltech.ChatInterface.xml | 15 - qt/examples/complexping.cpp | 91 - qt/examples/complexping.h | 37 - qt/examples/complexpong.cpp | 86 - qt/examples/complexpong.h | 46 - qt/examples/hello.cpp | 33 - qt/examples/listnames.cpp | 61 - qt/examples/ping-common.h | 22 - qt/examples/ping.cpp | 48 - qt/examples/pong.cpp | 54 - qt/examples/pong.h | 34 - qt/qt-dbus.qdocconf | 132 - qt/qt.tag | 66720 ------------------- qt/src/.cvsignore | 11 - qt/src/Makefile.am | 71 - qt/src/qdbus.h | 52 - qt/src/qdbusabstractadaptor.cpp | 335 - qt/src/qdbusabstractadaptor.h | 50 - qt/src/qdbusabstractadaptor_p.h | 127 - qt/src/qdbusabstractinterface.cpp | 392 - qt/src/qdbusabstractinterface.h | 257 - qt/src/qdbusabstractinterface_p.h | 72 - qt/src/qdbusbus.cpp | 302 - qt/src/qdbusbus.h | 159 - qt/src/qdbusconnection.cpp | 768 - qt/src/qdbusconnection.h | 124 - qt/src/qdbusconnection_p.h | 245 - qt/src/qdbuserror.cpp | 244 - qt/src/qdbuserror.h | 93 - qt/src/qdbusintegrator.cpp | 1554 - qt/src/qdbusinterface.cpp | 203 - qt/src/qdbusinterface.h | 63 - qt/src/qdbusinterface_p.h | 65 - qt/src/qdbusinternalfilters.cpp | 235 - qt/src/qdbusintrospection.cpp | 403 - qt/src/qdbusintrospection_p.h | 147 - qt/src/qdbusmacros.h | 60 - qt/src/qdbusmarshall.cpp | 582 - qt/src/qdbusmarshall_p.h | 57 - qt/src/qdbusmessage.cpp | 704 - qt/src/qdbusmessage.h | 99 - qt/src/qdbusmessage_p.h | 50 - qt/src/qdbusmetaobject.cpp | 689 - qt/src/qdbusmetaobject_p.h | 96 - qt/src/qdbusmisc.cpp | 156 - qt/src/qdbusreply.h | 132 - qt/src/qdbusserver.cpp | 61 - qt/src/qdbusserver.h | 48 - qt/src/qdbusthread.cpp | 116 - qt/src/qdbustype.cpp | 847 - qt/src/qdbustype_p.h | 109 - qt/src/qdbustypehelper_p.h | 231 - qt/src/qdbusutil.cpp | 229 - qt/src/qdbusutil.h | 55 - qt/src/qdbusxmlgenerator.cpp | 200 - qt/src/qdbusxmlparser.cpp | 349 - qt/src/qdbusxmlparser_p.h | 53 - qt/tools/.cvsignore | 11 - qt/tools/Makefile.am | 13 - qt/tools/dbus.cpp | 397 - qt/tools/dbuscpp2xml.cpp | 411 - qt/tools/dbusidl2cpp.cpp | 972 - qt3/.cvsignore | 11 - qt3/Makefile.am | 37 - qt3/connection.cpp | 168 - qt3/connection.h | 83 - qt3/dbus-qt.h | 81 - qt3/dbus-qthread.cpp | 163 - qt3/integrator.cpp | 244 - qt3/integrator.h | 92 - qt3/message.cpp | 561 - qt3/message.h | 131 - qt3/server.cpp | 90 - qt3/server.h | 57 - test/Makefile.am | 15 +- .../data/valid-service-files/debug-glib.service.in | 3 - .../valid-service-files/debug-python.service.in | 3 - test/glib/Makefile.am | 80 - test/glib/my-object-marshal.list | 2 - test/glib/run-test.sh | 36 - test/glib/test-dbus-glib.c | 1621 - test/glib/test-profile.c | 1150 - test/glib/test-service-glib.c | 928 - test/glib/test-service-glib.xml | 179 - test/glib/test-thread-client.c | 98 - test/glib/test-thread-server.c | 209 - test/glib/test-thread.h | 1 - test/python/.cvsignore | 3 - test/python/Makefile.am | 11 - test/python/run-test.sh | 42 - test/python/test-client.py | 306 - test/python/test-service.py | 141 - test/qt/.cvsignore | 11 - test/qt/Makefile.am | 38 - test/qt/common.h | 264 - test/qt/qpong.cpp | 38 - test/qt/tst_hal.cpp | 80 - test/qt/tst_headertest.cpp | 16 - test/qt/tst_qdbusabstractadaptor.cpp | 989 - test/qt/tst_qdbusconnection.cpp | 257 - test/qt/tst_qdbusinterface.cpp | 295 - test/qt/tst_qdbusmarshall.cpp | 342 - test/qt/tst_qdbusxmlparser.cpp | 578 - tools/Makefile.am | 39 +- tools/dbus-names-model.c | 388 - tools/dbus-names-model.h | 31 - tools/dbus-tree-view.c | 374 - tools/dbus-tree-view.h | 36 - 328 files changed, 16 insertions(+), 124017 deletions(-) delete mode 100644 dbus-glib-1.pc.in delete mode 100644 dbus/dbus-glib-lowlevel.h delete mode 100644 dbus/dbus-glib.h delete mode 100755 dbus/make-dbus-glib-error-enum.sh delete mode 100644 gcj/.cvsignore delete mode 100644 gcj/Makefile.am delete mode 100644 gcj/TestMessage.java delete mode 100644 gcj/org/.cvsignore delete mode 100644 gcj/org/Makefile.am delete mode 100644 gcj/org/freedesktop/.cvsignore delete mode 100644 gcj/org/freedesktop/Makefile.am delete mode 100644 gcj/org/freedesktop/dbus/.cvsignore delete mode 100644 gcj/org/freedesktop/dbus/Makefile.am delete mode 100644 gcj/org/freedesktop/dbus/Message.java delete mode 100644 gcj/org/freedesktop/dbus/natMessage.cc delete mode 100644 glib/Makefile.am delete mode 100644 glib/dbus-binding-tool-glib.c delete mode 100644 glib/dbus-binding-tool-glib.h delete mode 100644 glib/dbus-gidl.c delete mode 100644 glib/dbus-gidl.h delete mode 100644 glib/dbus-glib-tool.c delete mode 100644 glib/dbus-glib-tool.h delete mode 100644 glib/dbus-glib.c delete mode 100644 glib/dbus-gloader-expat.c delete mode 100644 glib/dbus-gmain.c delete mode 100644 glib/dbus-gmarshal.c delete mode 100644 glib/dbus-gmarshal.h delete mode 100644 glib/dbus-gmarshal.list delete mode 100644 glib/dbus-gobject.c delete mode 100644 glib/dbus-gobject.h delete mode 100644 glib/dbus-gparser.c delete mode 100644 glib/dbus-gparser.h delete mode 100644 glib/dbus-gproxy.c delete mode 100644 glib/dbus-gsignature.c delete mode 100644 glib/dbus-gsignature.h delete mode 100644 glib/dbus-gtest-main.c delete mode 100644 glib/dbus-gtest.c delete mode 100644 glib/dbus-gtest.h delete mode 100644 glib/dbus-gthread.c delete mode 100644 glib/dbus-gtool-test.h delete mode 100644 glib/dbus-gtype-specialized.c delete mode 100644 glib/dbus-gtype-specialized.h delete mode 100644 glib/dbus-gutils.c delete mode 100644 glib/dbus-gutils.h delete mode 100644 glib/dbus-gvalue-utils.c delete mode 100644 glib/dbus-gvalue-utils.h delete mode 100644 glib/dbus-gvalue.c delete mode 100644 glib/dbus-gvalue.h delete mode 100644 glib/examples/.cvsignore delete mode 100644 glib/examples/Makefile.am delete mode 100644 glib/examples/example-client.c delete mode 100644 glib/examples/example-service.c delete mode 100644 glib/examples/example-service.xml delete mode 100644 glib/examples/example-signal-emitter.c delete mode 100644 glib/examples/example-signal-emitter.xml delete mode 100644 glib/examples/example-signal-recipient.c delete mode 100644 glib/examples/statemachine/.cvsignore delete mode 100644 glib/examples/statemachine/Makefile.am delete mode 100644 glib/examples/statemachine/sm-marshal.list delete mode 100644 glib/examples/statemachine/statemachine-client.c delete mode 100644 glib/examples/statemachine/statemachine-server.c delete mode 100644 glib/examples/statemachine/statemachine-server.h delete mode 100644 glib/examples/statemachine/statemachine-server.xml delete mode 100644 glib/examples/statemachine/statemachine.c delete mode 100644 glib/examples/statemachine/statemachine.h delete mode 100644 glib/examples/statemachine/statemachine.xml delete mode 100755 glib/make-dbus-glib-error-switch.sh delete mode 100644 mono/.cvsignore delete mode 100644 mono/Arguments.cs delete mode 100644 mono/AssemblyInfo.cs.in delete mode 100644 mono/Bus.cs delete mode 100644 mono/BusDriver.cs delete mode 100644 mono/Connection.cs delete mode 100644 mono/DBusException.cs delete mode 100644 mono/DBusType/Array.cs delete mode 100644 mono/DBusType/Boolean.cs delete mode 100644 mono/DBusType/Byte.cs delete mode 100644 mono/DBusType/Dict.cs delete mode 100644 mono/DBusType/Double.cs delete mode 100644 mono/DBusType/IDBusType.cs delete mode 100644 mono/DBusType/Int16.cs delete mode 100644 mono/DBusType/Int32.cs delete mode 100644 mono/DBusType/Int64.cs delete mode 100644 mono/DBusType/ObjectPath.cs delete mode 100644 mono/DBusType/String.cs delete mode 100644 mono/DBusType/UInt16.cs delete mode 100644 mono/DBusType/UInt32.cs delete mode 100644 mono/DBusType/UInt64.cs delete mode 100644 mono/Error.cs delete mode 100644 mono/ErrorMessage.cs delete mode 100644 mono/Handler.cs delete mode 100644 mono/InterfaceAttribute.cs delete mode 100644 mono/InterfaceProxy.cs delete mode 100644 mono/Introspector.cs delete mode 100644 mono/Makefile.am delete mode 100644 mono/Message.cs delete mode 100644 mono/MethodAttribute.cs delete mode 100644 mono/MethodCall.cs delete mode 100644 mono/MethodReturn.cs delete mode 100644 mono/ProxyBuilder.cs delete mode 100644 mono/README delete mode 100644 mono/Server.cs delete mode 100644 mono/Service.cs delete mode 100644 mono/Signal.cs delete mode 100644 mono/SignalAttribute.cs delete mode 100644 mono/TODO delete mode 100644 mono/Test.cs delete mode 100644 mono/dbus-sharp.dll.config.in delete mode 100644 mono/dbus-sharp.snk delete mode 100644 mono/doc/.cvsignore delete mode 100644 mono/doc/Makefile.am delete mode 100644 mono/doc/dbus-sharp-docs.source delete mode 100644 mono/doc/en/DBus.DBusType.xml delete mode 100644 mono/doc/en/DBus.DBusType/Array.xml delete mode 100644 mono/doc/en/DBus.DBusType/Boolean.xml delete mode 100644 mono/doc/en/DBus.DBusType/Byte.xml delete mode 100644 mono/doc/en/DBus.DBusType/Custom.xml delete mode 100644 mono/doc/en/DBus.DBusType/Dict.xml delete mode 100644 mono/doc/en/DBus.DBusType/Double.xml delete mode 100644 mono/doc/en/DBus.DBusType/IDBusType.xml delete mode 100644 mono/doc/en/DBus.DBusType/Int32.xml delete mode 100644 mono/doc/en/DBus.DBusType/Int64.xml delete mode 100644 mono/doc/en/DBus.DBusType/Nil.xml delete mode 100644 mono/doc/en/DBus.DBusType/ObjectPath.xml delete mode 100644 mono/doc/en/DBus.DBusType/String.xml delete mode 100644 mono/doc/en/DBus.DBusType/UInt32.xml delete mode 100644 mono/doc/en/DBus.DBusType/UInt64.xml delete mode 100644 mono/doc/en/DBus.xml delete mode 100644 mono/doc/en/DBus/Arguments.xml delete mode 100644 mono/doc/en/DBus/Bus.xml delete mode 100644 mono/doc/en/DBus/Connection.xml delete mode 100644 mono/doc/en/DBus/Custom.xml delete mode 100644 mono/doc/en/DBus/DBusException.xml delete mode 100644 mono/doc/en/DBus/ErrorMessage.xml delete mode 100644 mono/doc/en/DBus/InterfaceAttribute.xml delete mode 100644 mono/doc/en/DBus/Message.xml delete mode 100644 mono/doc/en/DBus/MessageType.xml delete mode 100644 mono/doc/en/DBus/MethodAttribute.xml delete mode 100644 mono/doc/en/DBus/MethodCall.xml delete mode 100644 mono/doc/en/DBus/MethodReturn.xml delete mode 100644 mono/doc/en/DBus/Server.xml delete mode 100644 mono/doc/en/DBus/Service.xml delete mode 100644 mono/doc/en/DBus/Signal.xml delete mode 100644 mono/doc/en/DBus/SignalAttribute.xml delete mode 100644 mono/doc/en/DBus/SignalCalledHandler.xml delete mode 100644 mono/example/.cvsignore delete mode 100644 mono/example/BusListener.cs delete mode 100644 mono/example/EchoClient.cs delete mode 100644 mono/example/EchoServer.cs delete mode 100644 mono/example/Echoer.cs delete mode 100644 mono/example/Makefile.am delete mode 100644 python/.cvsignore delete mode 100644 python/Makefile.am delete mode 100644 python/__init__.py delete mode 100644 python/_dbus.py delete mode 100644 python/_util.py delete mode 100644 python/dbus.pth delete mode 100644 python/dbus_bindings.pxd.in delete mode 100644 python/dbus_bindings.pyx delete mode 100644 python/dbus_glib_bindings.pyx delete mode 100644 python/dbus_h_wrapper.h delete mode 100644 python/decorators.py delete mode 100644 python/examples/.cvsignore delete mode 100644 python/examples/Makefile.am delete mode 100644 python/examples/example-client.py delete mode 100644 python/examples/example-service.py delete mode 100644 python/examples/example-signal-emitter.py delete mode 100644 python/examples/example-signal-recipient.py delete mode 100644 python/examples/gconf-proxy-client.py delete mode 100644 python/examples/gconf-proxy-service.py delete mode 100644 python/examples/gconf-proxy-service2.py delete mode 100644 python/examples/list-system-services.py delete mode 100644 python/exceptions.py delete mode 100644 python/extract.py delete mode 100644 python/glib.py delete mode 100644 python/introspect_parser.py delete mode 100644 python/matchrules.py delete mode 100644 python/proxies.py delete mode 100644 python/service.py delete mode 100644 python/types.py delete mode 100644 qt/.cvsignore delete mode 100644 qt/Doxyfile delete mode 100644 qt/Makefile.am delete mode 100644 qt/README delete mode 100644 qt/dbus/Makefile.am delete mode 100644 qt/dbus/qdbus.h delete mode 100644 qt/dbus/qdbusabstractadaptor.h delete mode 100644 qt/dbus/qdbusabstractadaptor_p.h delete mode 100644 qt/dbus/qdbusabstractinterface.h delete mode 100644 qt/dbus/qdbusabstractinterface_p.h delete mode 100644 qt/dbus/qdbusbus.h delete mode 100644 qt/dbus/qdbusconnection.h delete mode 100644 qt/dbus/qdbusconnection_p.h delete mode 100644 qt/dbus/qdbuserror.h delete mode 100644 qt/dbus/qdbusinterface.h delete mode 100644 qt/dbus/qdbusinterface_p.h delete mode 100644 qt/dbus/qdbusintrospection_p.h delete mode 100644 qt/dbus/qdbusmacros.h delete mode 100644 qt/dbus/qdbusmarshall_p.h delete mode 100644 qt/dbus/qdbusmessage.h delete mode 100644 qt/dbus/qdbusmessage_p.h delete mode 100644 qt/dbus/qdbusmetaobject_p.h delete mode 100644 qt/dbus/qdbusreply.h delete mode 100644 qt/dbus/qdbusserver.h delete mode 100644 qt/dbus/qdbustype_p.h delete mode 100644 qt/dbus/qdbustypehelper_p.h delete mode 100644 qt/dbus/qdbusutil.h delete mode 100644 qt/dbus/qdbusxmlparser_p.h delete mode 100644 qt/examples/.cvsignore delete mode 100644 qt/examples/Makefile.am delete mode 100644 qt/examples/chat.cpp delete mode 100644 qt/examples/chat.h delete mode 100644 qt/examples/chatadaptor.cpp delete mode 100644 qt/examples/chatadaptor.h delete mode 100644 qt/examples/chatmainwindow.ui delete mode 100644 qt/examples/chatsetnickname.ui delete mode 100644 qt/examples/com.trolltech.ChatInterface.xml delete mode 100644 qt/examples/complexping.cpp delete mode 100644 qt/examples/complexping.h delete mode 100644 qt/examples/complexpong.cpp delete mode 100644 qt/examples/complexpong.h delete mode 100644 qt/examples/hello.cpp delete mode 100644 qt/examples/listnames.cpp delete mode 100644 qt/examples/ping-common.h delete mode 100644 qt/examples/ping.cpp delete mode 100644 qt/examples/pong.cpp delete mode 100644 qt/examples/pong.h delete mode 100644 qt/qt-dbus.qdocconf delete mode 100644 qt/qt.tag delete mode 100644 qt/src/.cvsignore delete mode 100644 qt/src/Makefile.am delete mode 100644 qt/src/qdbus.h delete mode 100644 qt/src/qdbusabstractadaptor.cpp delete mode 100644 qt/src/qdbusabstractadaptor.h delete mode 100644 qt/src/qdbusabstractadaptor_p.h delete mode 100644 qt/src/qdbusabstractinterface.cpp delete mode 100644 qt/src/qdbusabstractinterface.h delete mode 100644 qt/src/qdbusabstractinterface_p.h delete mode 100644 qt/src/qdbusbus.cpp delete mode 100644 qt/src/qdbusbus.h delete mode 100644 qt/src/qdbusconnection.cpp delete mode 100644 qt/src/qdbusconnection.h delete mode 100644 qt/src/qdbusconnection_p.h delete mode 100644 qt/src/qdbuserror.cpp delete mode 100644 qt/src/qdbuserror.h delete mode 100644 qt/src/qdbusintegrator.cpp delete mode 100644 qt/src/qdbusinterface.cpp delete mode 100644 qt/src/qdbusinterface.h delete mode 100644 qt/src/qdbusinterface_p.h delete mode 100644 qt/src/qdbusinternalfilters.cpp delete mode 100644 qt/src/qdbusintrospection.cpp delete mode 100644 qt/src/qdbusintrospection_p.h delete mode 100644 qt/src/qdbusmacros.h delete mode 100644 qt/src/qdbusmarshall.cpp delete mode 100644 qt/src/qdbusmarshall_p.h delete mode 100644 qt/src/qdbusmessage.cpp delete mode 100644 qt/src/qdbusmessage.h delete mode 100644 qt/src/qdbusmessage_p.h delete mode 100644 qt/src/qdbusmetaobject.cpp delete mode 100644 qt/src/qdbusmetaobject_p.h delete mode 100644 qt/src/qdbusmisc.cpp delete mode 100644 qt/src/qdbusreply.h delete mode 100644 qt/src/qdbusserver.cpp delete mode 100644 qt/src/qdbusserver.h delete mode 100644 qt/src/qdbusthread.cpp delete mode 100644 qt/src/qdbustype.cpp delete mode 100644 qt/src/qdbustype_p.h delete mode 100644 qt/src/qdbustypehelper_p.h delete mode 100644 qt/src/qdbusutil.cpp delete mode 100644 qt/src/qdbusutil.h delete mode 100644 qt/src/qdbusxmlgenerator.cpp delete mode 100644 qt/src/qdbusxmlparser.cpp delete mode 100644 qt/src/qdbusxmlparser_p.h delete mode 100644 qt/tools/.cvsignore delete mode 100644 qt/tools/Makefile.am delete mode 100644 qt/tools/dbus.cpp delete mode 100644 qt/tools/dbuscpp2xml.cpp delete mode 100644 qt/tools/dbusidl2cpp.cpp delete mode 100644 qt3/.cvsignore delete mode 100644 qt3/Makefile.am delete mode 100644 qt3/connection.cpp delete mode 100644 qt3/connection.h delete mode 100644 qt3/dbus-qt.h delete mode 100644 qt3/dbus-qthread.cpp delete mode 100644 qt3/integrator.cpp delete mode 100644 qt3/integrator.h delete mode 100644 qt3/message.cpp delete mode 100644 qt3/message.h delete mode 100644 qt3/server.cpp delete mode 100644 qt3/server.h delete mode 100644 test/data/valid-service-files/debug-glib.service.in delete mode 100644 test/data/valid-service-files/debug-python.service.in delete mode 100644 test/glib/Makefile.am delete mode 100644 test/glib/my-object-marshal.list delete mode 100755 test/glib/run-test.sh delete mode 100644 test/glib/test-dbus-glib.c delete mode 100644 test/glib/test-profile.c delete mode 100644 test/glib/test-service-glib.c delete mode 100644 test/glib/test-service-glib.xml delete mode 100644 test/glib/test-thread-client.c delete mode 100644 test/glib/test-thread-server.c delete mode 100644 test/glib/test-thread.h delete mode 100644 test/python/.cvsignore delete mode 100644 test/python/Makefile.am delete mode 100755 test/python/run-test.sh delete mode 100755 test/python/test-client.py delete mode 100755 test/python/test-service.py delete mode 100644 test/qt/.cvsignore delete mode 100644 test/qt/Makefile.am delete mode 100644 test/qt/common.h delete mode 100644 test/qt/qpong.cpp delete mode 100644 test/qt/tst_hal.cpp delete mode 100644 test/qt/tst_headertest.cpp delete mode 100644 test/qt/tst_qdbusabstractadaptor.cpp delete mode 100644 test/qt/tst_qdbusconnection.cpp delete mode 100644 test/qt/tst_qdbusinterface.cpp delete mode 100644 test/qt/tst_qdbusmarshall.cpp delete mode 100644 test/qt/tst_qdbusxmlparser.cpp delete mode 100644 tools/dbus-names-model.c delete mode 100644 tools/dbus-names-model.h delete mode 100644 tools/dbus-tree-view.c delete mode 100644 tools/dbus-tree-view.h diff --git a/Doxyfile.in b/Doxyfile.in index 88ed6de0..7701e905 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -49,7 +49,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = dbus glib +INPUT = dbus FILE_PATTERNS = *.c *.h RECURSIVE = YES #EXCLUDE = test diff --git a/Makefile.am b/Makefile.am index 816d653d..118cbeea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,56 +1,15 @@ - -if HAVE_GLIB - GLIB_SUBDIR=glib - GLIB_PC=dbus-glib-1.pc -endif - -if HAVE_QT - QT_SUBDIR=qt - QT_PC=dbus-qt4-1.pc -endif - -if HAVE_QT3 - QT3_SUBDIR=qt3 -endif - -if DBUS_USE_GCJ - GCJ_SUBDIR=gcj -endif - -if DBUS_USE_CSC - MONO_SUBDIR=mono - MONO_PC=dbus-sharp.pc -endif - -if HAVE_PYTHON - PYTHON_SUBDIR=python -endif - -## really we should require gcj/mcs/python also but since they are -## annoying to install, we don't for now -dist-local: - if test -z "$(QT_SUBDIR)" || test -z "$(GLIB_SUBDIR)" ; then \ - echo "You have to build with Qt and GLib to make dist" ; \ - fi - -SUBDIRS=dbus bus doc $(GLIB_SUBDIR) $(GCJ_SUBDIR) $(MONO_SUBDIR) $(QT_SUBDIR) $(QT3_SUBDIR) $(PYTHON_SUBDIR) tools test -DIST_SUBDIRS=dbus bus doc glib qt qt3 gcj mono python tools test +SUBDIRS=dbus bus doc tools test +DIST_SUBDIRS=dbus bus doc tools test pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = dbus-1.pc $(GLIB_PC) $(QT_PC) $(MONO_PC) +pkgconfig_DATA = dbus-1.pc DISTCLEANFILES = \ - dbus-1.pc \ - $(GLIB_PC) \ - $(QT_PC) \ - $(MONO_PC) + dbus-1.pc EXTRA_DIST = \ HACKING \ - dbus-1.pc.in \ - dbus-glib-1.pc.in \ - dbus-qt4-1.pc.in \ - dbus-sharp.pc.in + dbus-1.pc.in all-local: Doxyfile @@ -61,7 +20,7 @@ clean-gcov: clean-bbg: find -name "*.bbg" -o -name "*.bb" | xargs rm || true -GCOV_DIRS=dbus bus $(GLIB_SUBDIR) $(QT_SUBDIR) +GCOV_DIRS=dbus bus ## .PHONY so it always rebuilds it .PHONY: coverage-report.txt diff --git a/configure.in b/configure.in index 81588017..0bc65f60 100644 --- a/configure.in +++ b/configure.in @@ -46,13 +46,6 @@ AC_PROG_CXX AC_ISC_POSIX AC_HEADER_STDC -AC_ARG_ENABLE(qt, AS_HELP_STRING([--enable-qt],[enable Qt-friendly client library]),enable_qt=$enableval,enable_qt=auto) -AC_ARG_ENABLE(qt-debug, AS_HELP_STRING([--enable-qt-debug],[enable Qt-friendly client library, linked to debug Qt libraries]),enable_qt_debug=$enableval,enable_qt_debug=no) -AC_ARG_WITH(qt_moc, AS_HELP_STRING([--with-qt-moc=],[moc for Qt])) -AC_ARG_ENABLE(qt3, AS_HELP_STRING([--enable-qt3],[enable Qt3-friendly client library]),enable_qt3=$enableval,enable_qt3=auto) -AC_ARG_WITH(qt3_moc, AS_HELP_STRING([--with-qt3-moc=],[moc for Qt3])) -AC_ARG_ENABLE(glib, AS_HELP_STRING([--enable-glib],[enable GLib-friendly client library]),enable_glib=$enableval,enable_glib=auto) -AC_ARG_ENABLE(gtk, AS_HELP_STRING([--enable-gtk],[enable GTK-requiring executables]),enable_gtk=$enableval,enable_gtk=auto) AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE) AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no) AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE) @@ -62,10 +55,6 @@ AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentat AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto) AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no) AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto) -AC_ARG_ENABLE(gcj, AS_HELP_STRING([--enable-gcj],[build gcj bindings]),enable_gcj=$enableval,enable_gcj=no) -AC_ARG_ENABLE(mono, AS_HELP_STRING([--enable-mono],[build mono bindings]),enable_mono=$enableval,enable_mono=no) -AC_ARG_ENABLE(mono_docs, AS_HELP_STRING([--enable-mono-docs],[build mono docs]),enable_mono_docs=$enableval,enable_mono_docs=no) -AC_ARG_ENABLE(python, AS_HELP_STRING([--enable-python],[build python bindings]),enable_python=$enableval,enable_python=auto) AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto) AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto) AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto) @@ -190,142 +179,8 @@ else fi fi -#### can't use AM_PROG_GCJ since it fails fatally if no gcj found -AC_CHECK_PROGS(GCJ, gcj, gcj) -if test -z "$GCJ" ; then - have_gcj=no -else - # Needs to be here so libtool wont get confused - AM_PROG_GCJ - - have_gcj=yes - if test "x${GCJFLAGS-unset}" = xunset; then - GCJFLAGS="-g -O2 -Wall" - fi - AC_SUBST(GCJFLAGS) -fi - -if test x$enable_gcj = xauto ; then - if test x$have_gcj = xno ; then - enable_gcj=no - else - enable_gcj=yes - fi -fi - -if test x$enable_gcj = xyes; then - if test x$have_gcj = xno ; then - AC_MSG_ERROR([Building gcj explicitly required, but gcj not found]) - else - AC_CHECK_PROGS(JAR, gcj-jar fastjar jar) - fi -fi - -AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes) - AM_PROG_LIBTOOL -#### Look for mono -MONO_REQUIRED_VERSION=0.95 -AC_SUBST(MONO_REQUIRED_VERSION) -PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false) - -if test "x$enable_mono" = "xyes"; then - if test "x$have_mono" = "xfalse"; then - AC_MSG_ERROR([Mono was not found]) - fi -fi - -if test "x$have_mono" = "xtrue"; then - if test `uname -s` = "Darwin"; then - AC_PATH_PROG(RUNTIME, mint, no) - AC_PATH_PROG(CSC, mcs, no) - LIB_PREFIX= - LIB_SUFFIX=.dylib - else - AC_PATH_PROG(RUNTIME, mono, no) - AC_PATH_PROG(CSC, mcs, no) - LIB_PREFIX=.so - LIB_SUFFIX= - fi -else - AC_PATH_PROG(CSC, csc.exe, no) - RUNTIME= - LIB_PREFIX= - LIB_SUFFIX=.dylib -fi - -if test x$enable_mono = xyes; then - if test x$have_mcs = xno ; then - AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found]) - fi - - ### Test for GACUTIL - AC_PATH_PROG(GACUTIL, gacutil, no) - if test "x$GACUTIL" = "xno" ; then - AC_MSG_ERROR([No gacutil tool found]) - fi - - AC_SUBST(GACUTIL) -fi - -if test x$enable_mono = xauto ; then - if test x$CSC = xno ; then - enable_mono=no - else - ### Test for GACUTIL - AC_PATH_PROG(GACUTIL, gacutil, no) - if test "x$GACUTIL" = "xno" ; then - enable_mono=no - else - enable_mono=yes - fi - fi -fi - -AC_SUBST(RUNTIME) -AC_SUBST(CSC) -AC_SUBST(GACUTIL) -AC_SUBST(LIB_PREFIX) -AC_SUBST(LIB_SUFFIX) - -AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes) - -#### Look for monodoc -MONODOC_REQUIRED_VERSION=0.16 -AC_SUBST(MONODOC_REQUIRED_VERSION) -PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no) - -if test x$enable_mono_docs = xyes; then - if test x$have_monodoc = xno ; then - AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found]) - else - AC_PATH_PROG(MONODOC, monodoc, no) - if test x$MONODOC = xno; then - AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found]) - fi - fi -fi - -if test x$enable_mono_docs = xauto ; then - if test x$have_monodoc = xno ; then - enable_mono_docs=no - MONODOC= - else - AC_PATH_PROG(MONODOC, monodoc, no) - if test x$MONODOC = xno; then - enable_mono_docs=no - MONODOC= - else - enable_mono_docs=yes - fi - fi -fi - -AC_SUBST(MONODOC) - -AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes") - changequote(,)dnl # let ourselves use our own unstable API CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS" @@ -885,230 +740,6 @@ DBUS_TEST_LIBS= AC_SUBST(DBUS_TEST_CFLAGS) AC_SUBST(DBUS_TEST_LIBS) -# Glib detection -PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0 >= 2.4, have_glib=yes, have_glib=no) -PKG_CHECK_MODULES(DBUS_GLIB_THREADS, gthread-2.0 >= 2.4, have_glib_threads=yes, have_glib_threads=no) - -if test x$have_glib = xno ; then - AC_MSG_WARN([GLib development libraries not found]) -fi - -if test x$enable_glib = xyes; then - if test x$have_glib = xno; then - AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found]) - fi -fi - -if test x$enable_glib = xno; then - have_glib=no; -fi - -AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes) -AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes) - -if test x$have_glib = xyes; then - GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` -else - GLIB_GENMARSHAL=glib-not-enabled-so-there-is-no-genmarshal -fi -AC_SUBST(GLIB_GENMARSHAL) - -dnl GLib flags -AC_SUBST(DBUS_GLIB_CFLAGS) -AC_SUBST(DBUS_GLIB_LIBS) -AC_SUBST(DBUS_GLIB_THREADS_LIBS) - -DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS -DBUS_GLIB_TOOL_LIBS="$XML_LIBS $INTLLIBS" -AC_SUBST(DBUS_GLIB_TOOL_CFLAGS) -AC_SUBST(DBUS_GLIB_TOOL_LIBS) - -# GTK detection -if test x$have_glib = xno ; then - AC_MSG_WARN([Can't use GTK+ since GLib not enabled]) - have_gtk=no -else - PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0 >= 2.4, have_gtk=yes, have_gtk=no) - PKG_CHECK_MODULES(DBUS_GTK_THREADS, gtk+-2.0 >= 2.4 gthread-2.0, have_gtk_threads=yes, have_gtk_threads=no) -fi - -if test x$have_gtk = xno ; then - AC_MSG_WARN([GTK+ development libraries not found]) -fi - -if test x$enable_gtk = xyes; then - if test x$have_gtk = xno; then - AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found]) - fi -fi - -if test x$enable_gtk = xno; then - have_gtk=no; -fi - -AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes) - -dnl Gtk flags -AC_SUBST(DBUS_GTK_CFLAGS) -AC_SUBST(DBUS_GTK_LIBS) -AC_SUBST(DBUS_GTK_THREADS_CFLAGS) -AC_SUBST(DBUS_GTK_THREADS_LIBS) - - -dnl Qt3 detection -if test -z "$with_qt3_moc" ; then - AC_PATH_PROG(QT3_MOC, moc, no) -else - QT3_MOC=$with_qt3_moc - AC_SUBST(QT3_MOC) -fi - -have_qt3=no -AC_MSG_CHECKING([for qglobal.h]) -if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then - have_qt3=yes - DBUS_QT3_CXXFLAGS="-I$QTDIR/include" -else - for dir in "${prefix}/include/qt" "/usr/include/qt-3.1" "/usr/include/qt3" "/usr/include/qt" "/usr/lib/qt/include" "/usr/lib/qt-3.1/include"; do - if test -f "$dir/qglobal.h"; then - have_qt3=yes - DBUS_QT3_CXXFLAGS="-I$dir" - DBUS_QT3_LIBS="-L$QTDIR/lib -lqt-mt" - fi - done -fi -if test x$have_qt3 = xyes; then - AC_MSG_RESULT([found]) -else - AC_MSG_RESULT([not found]) -fi - -if test x$have_qt3 = xno; then - AC_MSG_WARN([Qt3 development libraries not found]) -fi - -if test x$enable_qt3 = xyes; then - if test x$have_qt3 = xno; then - AC_MSG_ERROR([Qt3 integration explicitly required, and Qt3 libraries not found]) - fi -fi - -if test x$enable_qt3 = xno; then - have_qt3=no; -fi - -AM_CONDITIONAL(HAVE_QT3, test x$have_qt3 = xyes) - -dnl Qt3 flags -AC_SUBST(DBUS_QT3_CXXFLAGS) -AC_SUBST(DBUS_QT3_LIBS) - - -dnl Qt4 detection - -AC_MSG_CHECKING([if we want to link to Qt debugging libraries]) -qt_suffix= -if test x$enable_qt_debug = xyes; then - qt_suffix=_debug - AC_MSG_RESULT([debug]) -else - AC_MSG_RESULT([release]) -fi - -if test x$enable_qt = xno; then - have_qt=no - have_qt_gui=no - have_qtest=no -else - QT_CORE=QtCore$qt_suffix - QT_XML=QtXml$qt_suffix - QT_GUI=QtGui$qt_suffix - QT_TESTLIB=QtTest$qt_suffix - min_qt_version=4.1.3 - - AC_SUBST(QT_CORE) - AC_SUBST(QT_XML) - - PKG_CHECK_MODULES([DBUS_QT], - [$QT_CORE >= $min_qt_version $QT_XML >= $min_qt_version], - have_qt=yes, - have_qt=no) -fi - -dnl Check for moc too -if test x$have_qt = xyes ; then - AC_MSG_CHECKING([for moc]) - - if test -z "$with_qt_moc" ; then - QT_MOC=`$PKG_CONFIG --variable=exec_prefix $QT_CORE` - QT_MOC=${QT_MOC}/bin/moc - else - QT_MOC=$with_qt_moc - fi - - if test -x "$QT_MOC"; then - AC_MSG_RESULT([found, $QT_MOC]) - else - AC_MSG_RESULT([not found]) - AC_MSG_WARN([moc not found; disabling Qt]) - have_qt=no - fi -fi - -if test x$have_qt = xno ; then - if test x$enable_qt = xyes; then - AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found]) - fi - have_qt=no -else - dnl Qt4 flags - AC_SUBST(DBUS_QT_CFLAGS) - AC_SUBST(DBUS_QT_LIBS) - AC_SUBST(QT_MOC) - - dnl QTestLib detection - PKG_CHECK_MODULES([DBUS_QTESTLIB], - [$QT_TESTLIB >= 4.1.0], - have_qtest=yes, - have_qtest=no) - - if test x$have_qtest = xno ; then - AC_MSG_WARN([Qt Unit Test library not found]) - fi - - if test x$have_qt = xno; then - have_qtest=no - fi - - AC_SUBST(DBUS_QTESTLIB_CFLAGS) - AC_SUBST(DBUS_QTESTLIB_LIBS) - - dnl QtGui detection - PKG_CHECK_MODULES([DBUS_QT_GUI], [$QT_GUI >= $min_qt_version], - have_qt_gui=yes, - have_qt_gui=no) - - if test x$have_qt_gui = xyes ; then - AC_MSG_CHECKING([for uic]) - QT_UIC=`$PKG_CONFIG --variable=exec_prefix $QT_GUI`/bin/uic - - if test -x "$QT_UIC" ; then - AC_MSG_RESULT([found, $QT_UIC]) - else - AC_MSG_RESULT([not found, disabling Qt Gui]) - have_qt_gui=no - fi - fi - - AC_SUBST(DBUS_QT_GUI_CFLAGS) - AC_SUBST(DBUS_QT_GUI_LIBS) - AC_SUBST(QT_UIC) -fi - -AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes) -AM_CONDITIONAL(HAVE_QT_GUI, test x$have_qt_gui = xyes) -AM_CONDITIONAL(HAVE_QTESTLIB, test x$have_qtest = xyes) - ### X11 detection AC_PATH_XTRA @@ -1343,8 +974,6 @@ AC_SUBST(TEST_$1) TEST_PATH(SERVICE_DIR, data/valid-service-files) TEST_PATH(SERVICE_BINARY, test-service) TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service) -TEST_PATH(GLIB_SERVICE_BINARY, glib/test-service-glib) -TEST_PATH(PYTHON_SERVICE_BINARY, python/test-service.py) TEST_PATH(EXIT_BINARY, test-exit) TEST_PATH(SEGFAULT_BINARY, test-segfault) TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever) @@ -1377,51 +1006,6 @@ fi AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets]) AC_SUBST(DBUS_SESSION_SOCKET_DIR) -# Detect if we can build Python bindings (need python, python headers, and pyrex) -if test x$enable_python = xno; then - have_python=no -else - have_python_version=2.4 - AC_MSG_NOTICE([Checking to see if we can build Python bindings]) - have_python=no - AM_PATH_PYTHON() - - if test -z "$PYTHON" ; then - AC_MSG_WARN([Python not found]) - else - AC_MSG_CHECKING([whether $PYTHON version >= $have_python_version]) - AM_PYTHON_CHECK_VERSION([$PYTHON], [$have_python_version], - [have_python_version="yes"], - [have_python_version="too old"]) - - AC_MSG_RESULT($have_python_version) - - AC_CHECK_PROGS(PYREX, pyrexc) - - if test -z "$PYREX" ; then - have_pyrex=no - else - have_pyrex=yes - fi - - AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no) - - if test x$have_pyrex = xyes -a x$have_python_headers = xyes -a "x$have_python_version" = xyes ; then - have_python=yes - fi - fi - - if test x$have_python = xno ; then - if test x$enable_python = xyes ; then - AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings because either Pyrex, Python headers or a suitable Python version was not found]) - else - AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings]) - fi - fi -fi - -AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes) - AC_OUTPUT([ Doxyfile dbus/dbus-arch-deps.h @@ -1432,49 +1016,21 @@ bus/rc.messagebus bus/dbus-daemon.1 Makefile dbus/Makefile -glib/Makefile -glib/examples/Makefile -glib/examples/statemachine/Makefile -python/Makefile -python/examples/Makefile -qt/Makefile -qt/dbus/Makefile -qt/src/Makefile -qt/tools/Makefile -qt/examples/Makefile -qt3/Makefile -gcj/Makefile -gcj/org/Makefile -gcj/org/freedesktop/Makefile -gcj/org/freedesktop/dbus/Makefile -mono/Makefile -mono/AssemblyInfo.cs -mono/dbus-sharp.dll.config -mono/example/Makefile -mono/doc/Makefile bus/Makefile tools/Makefile test/Makefile -test/glib/Makefile -test/python/Makefile -test/qt/Makefile test/name-test/Makefile doc/Makefile dbus-1.pc -dbus-glib-1.pc -dbus-sharp.pc -dbus-qt4-1.pc test/data/valid-config-files/debug-allow-all.conf test/data/valid-config-files/debug-allow-all-sha1.conf test/data/valid-service-files/debug-echo.service test/data/valid-service-files/debug-segfault.service -test/data/valid-service-files/debug-glib.service test/data/valid-service-files/debug-shell-echo-success.service test/data/valid-service-files/debug-shell-echo-fail.service -test/data/valid-service-files/debug-python.service ]) -### FIXME it's bizarre that have_qt and have_glib are used +### FIXME it's bizarre that have_qt ### instead of enable_ - should fix things so that enable ### is always whether it's enabled, and have is always whether ### it was found. @@ -1502,26 +1058,6 @@ echo " Doxygen: ${DOXYGEN} xmlto: ${XMLTO}" -if test x$enable_gcj = xyes ; then -echo \ -" gcj: ${GCJ} - gcjflags: ${GCJFLAGS} - jar: ${JAR}" -else -echo \ -" gcj: (not enabled)" -fi - -if test x$enable_mono = xyes ; then -echo \ -" csc: ${CSC} -" -else -echo \ -" csc: (not enabled) -" -fi - echo " Maintainer mode: ${USE_MAINTAINER_MODE} gcc coverage profiling: ${enable_gcov} @@ -1529,14 +1065,8 @@ echo " Building verbose mode: ${enable_verbose_mode} Building assertions: ${enable_asserts} Building checks: ${enable_checks} - Building Qt4 bindings: ${have_qt} - Building Qt3 bindings: ${have_qt3} - Building GLib bindings: ${have_glib} - Building Python bindings: ${have_python} Building SELinux support: ${have_selinux} Building dnotify support: ${have_dnotify} - Building Mono bindings: ${enable_mono} - Building Mono docs: ${enable_mono_docs} Building GTK+ tools: ${have_gtk} Building X11 code: ${enable_x11} Building Doxygen docs: ${enable_doxygen_docs} diff --git a/dbus-glib-1.pc.in b/dbus-glib-1.pc.in deleted file mode 100644 index 9633f872..00000000 --- a/dbus-glib-1.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: dbus-glib -Description: GLib integration for the free desktop message bus -Version: @VERSION@ -Requires: dbus-1 glib-2.0 -Libs: -L${libdir} -ldbus-glib-1 - - diff --git a/dbus/Makefile.am b/dbus/Makefile.am index 74657ee7..5ceb89d2 100644 --- a/dbus/Makefile.am +++ b/dbus/Makefile.am @@ -1,20 +1,6 @@ INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) -DDBUS_COMPILATION -if HAVE_GLIB -DBUS_GLIB_BUILT_INCLUDES= \ - dbus-glib-error-enum.h - -GLIB_INCLUDES= \ - dbus-glib.h \ - dbus-glib-lowlevel.h \ - $(DBUS_GLIB_BUILT_INCLUDES) - -dbus-glib-error-enum.h: dbus-protocol.h make-dbus-glib-error-enum.sh - $(srcdir)/make-dbus-glib-error-enum.sh $(srcdir)/dbus-protocol.h $@ - -endif - dbusincludedir=$(includedir)/dbus-1.0/dbus dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus @@ -35,8 +21,7 @@ dbusinclude_HEADERS= \ dbus-shared.h \ dbus-signature.h \ dbus-threads.h \ - dbus-types.h \ - $(GLIB_INCLUDES) + dbus-types.h dbusarchinclude_HEADERS= \ @@ -158,9 +143,8 @@ libdbus_convenience_la_SOURCES= \ $(DBUS_UTIL_SOURCES) -BUILT_SOURCES=$(dbusarchinclude_HEADERS) $(DBUS_GLIB_BUILT_INCLUDES) -EXTRA_DIST=dbus-arch-deps.h.in make-dbus-glib-error-enum.sh -CLEANFILES=$(DBUS_GLIB_BUILT_INCLUDES) +BUILT_SOURCES=$(dbusarchinclude_HEADERS) +EXTRA_DIST=dbus-arch-deps.h.in ## this library is the same as libdbus, but exports all the symbols ## and is only used for static linking within the dbus package. diff --git a/dbus/dbus-glib-lowlevel.h b/dbus/dbus-glib-lowlevel.h deleted file mode 100644 index cb015ccb..00000000 --- a/dbus/dbus-glib-lowlevel.h +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-glib-lowlevel.h GLib integration details that require dbus/dbus.h - * - * Copyright (C) 2002, 2003 CodeFactory AB - * Copyright (C) 2003, 2004 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_GLIB_LOWLEVEL_H -#define DBUS_GLIB_LOWLEVEL_H - -#include -#include - -G_BEGIN_DECLS - -void dbus_set_g_error (GError **gerror, - DBusError *derror); - -#define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ()) -#define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ()) -#define DBUS_TYPE_PENDING_CALL (dbus_pending_call_get_g_type ()) -GType dbus_connection_get_g_type (void) G_GNUC_CONST; -GType dbus_message_get_g_type (void) G_GNUC_CONST; -GType dbus_pending_call_get_g_type (void) G_GNUC_CONST; - -void dbus_connection_setup_with_g_main (DBusConnection *connection, - GMainContext *context); -void dbus_server_setup_with_g_main (DBusServer *server, - GMainContext *context); - -void dbus_g_proxy_send (DBusGProxy *proxy, - DBusMessage *message, - dbus_uint32_t *client_serial); - -DBusConnection* dbus_g_connection_get_connection (DBusGConnection *gconnection); -DBusMessage* dbus_g_message_get_message (DBusGMessage *gmessage); - -/* dbus_g_pending_call_get_pending_call() deliberately skipped for now; - * not sure it makes sense to use any of the DBusPendingCall functions - * on the wrapped pending call (once we have the right exported - * g-functions anyhow) - */ - -gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context); - -DBusMessage* dbus_g_method_get_reply (DBusGMethodInvocation *context); - -void dbus_g_method_send_reply (DBusGMethodInvocation *context, - DBusMessage *reply); - -G_END_DECLS - -#endif /* DBUS_GLIB_LOWLEVEL_H */ - - - diff --git a/dbus/dbus-glib.h b/dbus/dbus-glib.h deleted file mode 100644 index 1c319259..00000000 --- a/dbus/dbus-glib.h +++ /dev/null @@ -1,256 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-glib.h GLib integration - * - * Copyright (C) 2002, 2003 CodeFactory AB - * Copyright (C) 2003, 2004 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_GLIB_H -#define DBUS_GLIB_H - -#include -#include - -G_BEGIN_DECLS - -#define DBUS_INSIDE_DBUS_GLIB_H 1 - - -/** - * Convert to DBusConnection with dbus_g_connection_get_connection() in dbus-glib-lowlevel.h - */ -typedef struct _DBusGConnection DBusGConnection; -/** - * Convert to DBusMessage with dbus_g_message_get_message() in dbus-glib-lowlevel.h - */ -typedef struct _DBusGMessage DBusGMessage; - - -#define DBUS_TYPE_G_CONNECTION (dbus_g_connection_get_g_type ()) -#define DBUS_TYPE_G_MESSAGE (dbus_g_message_get_g_type ()) -GType dbus_g_connection_get_g_type (void) G_GNUC_CONST; -GType dbus_g_message_get_g_type (void) G_GNUC_CONST; - - -DBusGConnection* dbus_g_connection_ref (DBusGConnection *connection); -void dbus_g_connection_unref (DBusGConnection *connection); -DBusGMessage* dbus_g_message_ref (DBusGMessage *message); -void dbus_g_message_unref (DBusGMessage *message); - -void dbus_g_connection_flush (DBusGConnection *connection); - -GQuark dbus_g_error_quark (void); -#define DBUS_GERROR dbus_g_error_quark () - -typedef enum -{ -#include -} DBusGError; - -gboolean dbus_g_error_has_name (GError *error, - const char *name); -const char * dbus_g_error_get_name (GError *error); - -void dbus_g_thread_init (void); - -DBusGConnection* dbus_g_connection_open (const gchar *address, - GError **error); -DBusGConnection* dbus_g_bus_get (DBusBusType type, - GError **error); - -typedef struct _DBusGObjectInfo DBusGObjectInfo; -typedef struct _DBusGMethodInfo DBusGMethodInfo; - -/** - * Object typically generated by dbus-binding-tool that - * stores a mapping from introspection data to a - * function pointer for a C method to be invoked. - */ -struct _DBusGMethodInfo -{ - GCallback function; /**< C method to invoke */ - GClosureMarshal marshaller; /**< Marshaller to invoke method */ - int data_offset; /**< Offset into the introspection data */ -}; - -/** - * Introspection data for a GObject, normally autogenerated by - * a tool such as dbus-binding-tool. - */ -struct _DBusGObjectInfo -{ - int format_version; /**< Allows us to change the rest of this struct - * by adding DBusGObjectInfo2, DBusGObjectInfo3, etc. - */ - const DBusGMethodInfo *method_infos; /**< Array of method pointers */ - int n_method_infos; /**< Length of the infos array */ - const char *data; /**< Introspection data */ - const char *exported_signals; /**< Exported signals */ - const char *exported_properties; /**< Exported properties */ -}; - -void dbus_g_object_type_install_info (GType object_type, - const DBusGObjectInfo *info); - -void dbus_g_error_domain_register (GQuark domain, - const char * default_iface, - GType code_enum); - -void dbus_g_connection_register_g_object (DBusGConnection *connection, - const char *at_path, - GObject *object); -GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection, - const char *at_path); - -#ifdef DBUS_COMPILATION -#include "glib/dbus-gtype-specialized.h" -#else -#include -#endif - -/* definitions for some basic array types */ -#define DBUS_TYPE_G_BOOLEAN_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN)) -#define DBUS_TYPE_G_UCHAR_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR)) -#define DBUS_TYPE_G_UINT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) -#define DBUS_TYPE_G_INT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT)) -#define DBUS_TYPE_G_UINT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT64)) -#define DBUS_TYPE_G_INT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT64)) -#define DBUS_TYPE_G_OBJECT_ARRAY (dbus_g_type_get_collection ("GPtrArray", G_TYPE_OBJECT)) - -#define DBUS_TYPE_G_STRING_STRING_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) - -GType dbus_g_object_path_get_g_type (void) G_GNUC_CONST; -#define DBUS_TYPE_G_OBJECT_PATH (dbus_g_object_path_get_g_type ()) - -void dbus_g_object_register_marshaller (GClosureMarshal marshaller, - GType rettype, - ...); -void dbus_g_object_register_marshaller_array(GClosureMarshal marshaller, - GType rettype, - guint n_types, - const GType* types); - -typedef struct _DBusGProxy DBusGProxy; -typedef struct _DBusGProxyClass DBusGProxyClass; - -#define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ()) -#define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy)) -#define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass)) -#define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY)) -#define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY)) -#define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass)) - -struct _DBusGProxy -{ - GObject parent; -}; - -struct _DBusGProxyClass -{ - GObjectClass parent_class; /**< Parent class */ -}; - -typedef struct _DBusGProxyCall DBusGProxyCall; -typedef void (* DBusGProxyCallNotify) (DBusGProxy *proxy, - DBusGProxyCall *call_id, - void *user_data); - -GType dbus_g_proxy_get_type (void) G_GNUC_CONST; -DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection, - const char *name, - const char *path, - const char *interface); -DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, - const char *name, - const char *path, - const char *interface, - GError **error); -DBusGProxy* dbus_g_proxy_new_from_proxy (DBusGProxy *proxy, - const char *interface, - const char *path_name); -DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection, - const char *path_name, - const char *interface_name); - -void dbus_g_proxy_set_interface (DBusGProxy *proxy, - const char *interface_name); -void dbus_g_proxy_add_signal (DBusGProxy *proxy, - const char *signal_name, - GType first_type, - ...); - -void dbus_g_proxy_connect_signal (DBusGProxy *proxy, - const char *signal_name, - GCallback handler, - void *data, - GClosureNotify free_data_func); -void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy, - const char *signal_name, - GCallback handler, - void *data); - -gboolean dbus_g_proxy_call (DBusGProxy *proxy, - const char *method, - GError **error, - GType first_arg_type, - ...); - -void dbus_g_proxy_call_no_reply (DBusGProxy *proxy, - const char *method, - GType first_arg_type, - ...); - -DBusGProxyCall * dbus_g_proxy_begin_call (DBusGProxy *proxy, - const char *method, - DBusGProxyCallNotify notify, - gpointer data, - GDestroyNotify destroy, - GType first_arg_type, - ...); -gboolean dbus_g_proxy_end_call (DBusGProxy *proxy, - DBusGProxyCall *call, - GError **error, - GType first_arg_type, - ...); -void dbus_g_proxy_cancel_call (DBusGProxy *proxy, - DBusGProxyCall *call); - -const char* dbus_g_proxy_get_path (DBusGProxy *proxy); - -const char* dbus_g_proxy_get_bus_name (DBusGProxy *proxy); - -const char* dbus_g_proxy_get_interface (DBusGProxy *proxy); - -typedef struct _DBusGMethodInvocation DBusGMethodInvocation; - -void dbus_g_method_return (DBusGMethodInvocation *context, ...); - -void dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error); - -/* Probably possible to replace this with a closure */ -typedef struct { - GCallback cb; - gpointer userdata; -} DBusGAsyncData; - -#undef DBUS_INSIDE_DBUS_GLIB_H - -G_END_DECLS - -#endif /* DBUS_GLIB_H */ diff --git a/dbus/make-dbus-glib-error-enum.sh b/dbus/make-dbus-glib-error-enum.sh deleted file mode 100755 index 55362ded..00000000 --- a/dbus/make-dbus-glib-error-enum.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -SRC=$1 -DEST=$2 - -die() -{ - echo $1 1>&2 - /bin/rm $DEST.tmp - exit 1 -} - -cat $SRC | grep '#define DBUS_ERROR' | sed -e 's/#define //g' | \ - sed -e 's/".*//g' | sed -e 's/DBUS_ERROR/DBUS_GERROR/g' | sed -e 's/ *$/,/g' > $DEST.tmp - -if ! test -s $DEST.tmp ; then - die "$DEST.tmp is empty, something went wrong, see any preceding error message" -fi -echo "DBUS_GERROR_REMOTE_EXCEPTION" >> $DEST.tmp - -echo "#ifndef DBUS_INSIDE_DBUS_GLIB_H" >> $DEST.tmp -echo '#error "' "$DEST" 'may only be included by dbus-glib.h"' >> $DEST.tmp -echo "#endif" >> $DEST.tmp - -mv $DEST.tmp $DEST || die "could not move $DEST.tmp to $DEST" diff --git a/gcj/.cvsignore b/gcj/.cvsignore deleted file mode 100644 index 3e5eeedc..00000000 --- a/gcj/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -dbus-1.jar -test-message diff --git a/gcj/Makefile.am b/gcj/Makefile.am deleted file mode 100644 index 5ee26b9c..00000000 --- a/gcj/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -SUBDIRS=org - -CLEANFILES=dbus-1.jar - -dbus-1.jar: - -@rm -f dbus-1.jar - find org -type d -o -type f -name '*.class' | \ - sed -e '/\/\./d' | \ - $(JAR) cfM0E@ $@ - -jardir = $(datadir)/java -jar_DATA = dbus-1.jar - -noinst_PROGRAMS = test-message - -test_message_SOURCES = TestMessage.java -test_message_LDFLAGS = --main=TestMessage -test_message_LDADD = $(top_builddir)/gcj/org/freedesktop/dbus/libdbus-gcj-1.la diff --git a/gcj/TestMessage.java b/gcj/TestMessage.java deleted file mode 100644 index 6e17eaa1..00000000 --- a/gcj/TestMessage.java +++ /dev/null @@ -1,8 +0,0 @@ -import org.freedesktop.dbus.Message; - -public class TestMessage { - public static void main (String[] args) { - Message msg = new Message ("test", "bla"); - - } -} diff --git a/gcj/org/.cvsignore b/gcj/org/.cvsignore deleted file mode 100644 index 22a4e729..00000000 --- a/gcj/org/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in - diff --git a/gcj/org/Makefile.am b/gcj/org/Makefile.am deleted file mode 100644 index a3e21224..00000000 --- a/gcj/org/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=freedesktop diff --git a/gcj/org/freedesktop/.cvsignore b/gcj/org/freedesktop/.cvsignore deleted file mode 100644 index 282522db..00000000 --- a/gcj/org/freedesktop/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/gcj/org/freedesktop/Makefile.am b/gcj/org/freedesktop/Makefile.am deleted file mode 100644 index ee8f397a..00000000 --- a/gcj/org/freedesktop/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS=dbus diff --git a/gcj/org/freedesktop/dbus/.cvsignore b/gcj/org/freedesktop/dbus/.cvsignore deleted file mode 100644 index 1744d8cb..00000000 --- a/gcj/org/freedesktop/dbus/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -*.la -*.class -*.lo -*.h - diff --git a/gcj/org/freedesktop/dbus/Makefile.am b/gcj/org/freedesktop/dbus/Makefile.am deleted file mode 100644 index a6aaf819..00000000 --- a/gcj/org/freedesktop/dbus/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -INCLUDES= \ - -I$(top_srcdir) \ - -I$(top_builddir)/gcj/org/freedesktop/dbus \ - $(DBUS_CLIENT_CFLAGS) - - -GCJH = gcjh - -lib_LTLIBRARIES = libdbus-gcj-1.la - -MOSTLYCLEANFILES = $(generated_headers) $(java_class_files) - - -java_sources = \ - Message.java - -native_sources = \ - natMessage.cc - -generated_headers = $(java_sources:.java=.h) -java_class_files = $(java_sources:.java=.class) -native_object_files = $(native_sources:.cc=.lo) -java_object_files = $(java_sources:.java=.lo) - -.class.h: - $(GCJH) $(basename $<) - -.java.class: - $(GCJ) -C $< -d ../../.. - -.cc.lo: - $(LIBTOOL) --mode=compile $(CXX) $(INCLUDES) $(CXXFLAGS) $(CPPFLAGS) -c -o '$@' '$<' - -.java.lo: - $(LIBTOOL) --mode=compile $(GCJ) $(INCLUDES) $(GCJ_FLAGS) -c -o '$@' '$<' - -libdbus_gcj_1_la_SOURCES = - -libdbus_gcj_1_la_DEPENDENCIES = \ - $(generated_headers) \ - $(native_object_files) \ - $(java_object_files) \ - $(java_class_files) - - -libdbus_gcj_1_la_LDFLAGS = -no-undefined - -libdbus_gcj_1_la_LIBADD = \ - $(native_object_files) \ - $(java_object_files) - -EXTRA_libdbus_gcj_1_la_SOURCES = \ - $(native_sources) \ - $(java_sources) - -libdbus_gcj_1_la_LINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@ - diff --git a/gcj/org/freedesktop/dbus/Message.java b/gcj/org/freedesktop/dbus/Message.java deleted file mode 100644 index ede8b3aa..00000000 --- a/gcj/org/freedesktop/dbus/Message.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.freedesktop.dbus; - -import gnu.gcj.RawData; - -public class Message { - private RawData message; - - public Message (String name, String destService) { - this.message = dbus_message_new (name, destService); - } - - private static native RawData dbus_message_new (String name, String destService); -} diff --git a/gcj/org/freedesktop/dbus/natMessage.cc b/gcj/org/freedesktop/dbus/natMessage.cc deleted file mode 100644 index d8b19033..00000000 --- a/gcj/org/freedesktop/dbus/natMessage.cc +++ /dev/null @@ -1,20 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include -#include -#include - -#include - -::gnu::gcj::RawData * -org::freedesktop::dbus::Message::dbus_message_new (::java::lang::String *, ::java::lang::String *) -{ - throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 ("org::freedesktop::dbus::Message::dbus_message_new (::java::lang::String *, ::java::lang::String *) not implemented")); -} - - diff --git a/glib/Makefile.am b/glib/Makefile.am deleted file mode 100644 index f87145e2..00000000 --- a/glib/Makefile.am +++ /dev/null @@ -1,105 +0,0 @@ -SUBDIRS = . examples - -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) -DDBUS_COMPILATION=1 -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" - -lib_LTLIBRARIES=libdbus-glib-1.la - -dbus-glib-error-switch.h: $(top_srcdir)/dbus/dbus-protocol.h make-dbus-glib-error-switch.sh - $(LIBTOOL) --mode=execute $(srcdir)/make-dbus-glib-error-switch.sh $(top_srcdir)/dbus/dbus-protocol.h $@ - -BUILT_SOURCES = dbus-glib-error-switch.h - -CLEANFILES = $(BUILT_SOURCES) - -DBUS_GLIB_INTERNALS = \ - dbus-gtype-specialized.c \ - dbus-gutils.c \ - dbus-gutils.h \ - dbus-gsignature.c \ - dbus-gsignature.h \ - dbus-gvalue.h \ - dbus-gvalue-utils.c \ - dbus-gvalue-utils.h - -libdbus_glib_1_la_SOURCES = \ - dbus-glib-error-switch.h \ - dbus-glib.c \ - dbus-gmain.c \ - dbus-gmarshal.c \ - dbus-gmarshal.h \ - dbus-gobject.c \ - dbus-gobject.h \ - dbus-gproxy.c \ - dbus-gtest.c \ - dbus-gtest.h \ - dbus-gvalue.c \ - dbus-gvalue.h \ - dbus-gthread.c \ - $(DBUS_GLIB_INTERNALS) - -libdbus_glib_HEADERS = \ - dbus-gtype-specialized.h - -libdbus_glibdir = $(includedir)/dbus-1.0/dbus - -libdbus_glib_1_la_LIBADD= $(top_builddir)/dbus/libdbus-1.la $(DBUS_GLIB_LIBS) -## don't export symbols that start with "_" (we use this -## convention for internal symbols) -libdbus_glib_1_la_LDFLAGS= -export-symbols-regex "^[^_].*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined - -# convenience lib used here and by dbus-viewer -noinst_LTLIBRARIES=libdbus-gtool.la - -libdbus_gtool_la_SOURCES = $(DBUS_GLIB_INTERNALS) \ - dbus-gidl.c \ - dbus-gidl.h \ - dbus-gloader-expat.c \ - dbus-gparser.c \ - dbus-gparser.h - -libdbus_gtool_la_LIBADD = libdbus-glib-1.la - -bin_PROGRAMS=dbus-binding-tool - -dbus_binding_tool_SOURCES = \ - dbus-binding-tool-glib.h \ - dbus-binding-tool-glib.c \ - dbus-glib-tool.h \ - dbus-glib-tool.c - -dbus_binding_tool_LDADD= libdbus-gtool.la $(DBUS_GLIB_LIBS) -lexpat - -## we just rebuilt these manually and check them into cvs; easier than -## convincing automake/make to do this properly -regenerate-built-sources: - @GLIB_GENMARSHAL@ --prefix=_dbus_g_marshal dbus-gmarshal.list --header > dbus-gmarshal.h && \ - echo '#include "dbus-gmarshal.h"' > dbus-gmarshal.c && \ - @GLIB_GENMARSHAL@ --prefix=_dbus_g_marshal dbus-gmarshal.list --body >> dbus-gmarshal.c - -EXTRA_DIST=dbus-gmarshal.list make-dbus-glib-error-switch.sh - -if DBUS_BUILD_TESTS - -## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we -## build even when not doing "make check" -noinst_PROGRAMS= $(TESTS) - -## note that TESTS has special meaning (stuff to use in make check) -## so if adding tests not to be run in make check, don't add them to -## TESTS -TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus -TESTS=dbus-glib-test - -## FIXME we aren't running dbus-glib-tool --self-test - -dbus_glib_test_SOURCES= \ - dbus-gtest-main.c - -dbus_glib_test_LDADD= $(top_builddir)/glib/libdbus-glib-1.la - -else -### not building tests -TESTS= - -endif - diff --git a/glib/dbus-binding-tool-glib.c b/glib/dbus-binding-tool-glib.c deleted file mode 100644 index 1386e3f1..00000000 --- a/glib/dbus-binding-tool-glib.c +++ /dev/null @@ -1,1625 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-binding-tool-glib.c: Output C glue - * - * Copyright (C) 2003, 2004, 2005 Red Hat, Inc. - * Copyright (C) 2005 Nokia - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include "dbus/dbus-glib.h" -#include "dbus-gidl.h" -#include "dbus-gparser.h" -#include "dbus-gutils.h" -#include "dbus-gtype-specialized.h" -#include "dbus-gsignature.h" -#include "dbus-gvalue-utils.h" -#include "dbus-glib-tool.h" -#include "dbus-binding-tool-glib.h" -#include -#include -#include -#include -#include - -#define MARSHAL_PREFIX "dbus_glib_marshal_" - -typedef struct -{ - gboolean ignore_unsupported; - const char* prefix; - GIOChannel *channel; - - GError **error; - - GHashTable *generated; - GString *blob; - GString *signal_blob; - GString *property_blob; - guint count; -} DBusBindingToolCData; - -static gboolean gather_marshallers (BaseInfo *base, DBusBindingToolCData *data, GError **error); -static gboolean generate_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error); -static gboolean generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error); - -static const char * -dbus_g_type_get_marshal_name (GType gtype) -{ - switch (G_TYPE_FUNDAMENTAL (gtype)) - { - case G_TYPE_NONE: - return "NONE"; - case G_TYPE_BOOLEAN: - return "BOOLEAN"; - case G_TYPE_UCHAR: - return "UCHAR"; - case G_TYPE_INT: - return "INT"; - case G_TYPE_UINT: - return "UINT"; - case G_TYPE_INT64: - return "INT64"; - case G_TYPE_UINT64: - return "UINT64"; - case G_TYPE_DOUBLE: - return "DOUBLE"; - case G_TYPE_STRING: - return "STRING"; - case G_TYPE_POINTER: - return "POINTER"; - case G_TYPE_BOXED: - return "BOXED"; - case G_TYPE_OBJECT: - return "OBJECT"; - default: - return NULL; - } -} - -/* This entire function is kind of...ugh. */ -static const char * -dbus_g_type_get_c_name (GType gtype) -{ - GType subtype; - if (dbus_g_type_is_struct (gtype)) - { - return "GValueArray"; - } - if (dbus_g_type_is_collection (gtype)) - { - subtype = dbus_g_type_get_collection_specialization(gtype); - if (_dbus_g_type_is_fixed (subtype)) - return "GArray"; - else - return "GPtrArray"; - } - - if (dbus_g_type_is_map (gtype)) - return "GHashTable"; - - if (g_type_is_a (gtype, G_TYPE_STRING)) - return "char *"; - - /* This one is even more hacky...we get an extra * - * because G_TYPE_STRV is a G_TYPE_BOXED - */ - if (g_type_is_a (gtype, G_TYPE_STRV)) - return "char *"; - - if (g_type_is_a (gtype, DBUS_TYPE_G_OBJECT_PATH)) - return "char"; - - return g_type_name (gtype); -} - -static gboolean -compute_gsignature (MethodInfo *method, GType *rettype, GArray **params, GError **error) -{ - GSList *elt; - GType retval_type; - GArray *ret; - gboolean is_async; - const char *arg_type; - gboolean retval_signals_error; - - is_async = method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_ASYNC) != NULL; - retval_signals_error = FALSE; - - ret = g_array_new (TRUE, TRUE, sizeof (GType)); - - if (is_async) - retval_type = G_TYPE_NONE; - else - { - gboolean found_retval; - - /* Look for return value */ - found_retval = FALSE; - for (elt = method_info_get_args (method); elt; elt = elt->next) - { - ArgInfo *arg = elt->data; - const char *returnval_annotation; - - returnval_annotation = arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_RETURNVAL); - if (returnval_annotation != NULL) - { - arg_type = arg_info_get_type (arg); - retval_type = _dbus_gtype_from_signature (arg_type, FALSE); - if (retval_type == G_TYPE_INVALID) - goto invalid_type; - found_retval = TRUE; - if (!strcmp (returnval_annotation, "error")) - retval_signals_error = TRUE; - break; - } - } - if (!found_retval) - { - retval_type = G_TYPE_BOOLEAN; - retval_signals_error = TRUE; - } - } - - *rettype = retval_type; - - /* Handle all input arguments */ - for (elt = method_info_get_args (method); elt; elt = elt->next) - { - ArgInfo *arg = elt->data; - if (arg_info_get_direction (arg) == ARG_IN) - { - GType gtype; - - arg_type = arg_info_get_type (arg); - gtype = _dbus_gtype_from_signature (arg_type, FALSE); - if (gtype == G_TYPE_INVALID) - goto invalid_type; - - g_array_append_val (ret, gtype); - } - } - - if (!is_async) - { - /* Append pointer for each out arg storage */ - for (elt = method_info_get_args (method); elt; elt = elt->next) - { - ArgInfo *arg = elt->data; - - /* Skip return value */ - if (arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_RETURNVAL) != NULL) - continue; - - if (arg_info_get_direction (arg) == ARG_OUT) - { - GType gtype; - arg_type = arg_info_get_type (arg); - gtype = _dbus_gtype_from_signature (arg_type, FALSE); - if (gtype == G_TYPE_INVALID) - goto invalid_type; - /* We actually just need a pointer for the return value - storage */ - gtype = G_TYPE_POINTER; - g_array_append_val (ret, gtype); - } - } - - if (retval_signals_error) - { - /* Final GError parameter */ - GType gtype = G_TYPE_POINTER; - g_array_append_val (ret, gtype); - } - } - else - { - /* Context pointer */ - GType gtype = G_TYPE_POINTER; - g_array_append_val (ret, gtype); - } - - *params = ret; - return TRUE; - - invalid_type: - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, - _("Unsupported conversion from D-BUS type %s to glib-genmarshal type"), - arg_type); - return FALSE; -} - - -static char * -compute_marshaller (MethodInfo *method, GError **error) -{ - GArray *signature; - GType rettype; - const char *marshal_name; - GString *ret; - guint i; - - if (!compute_gsignature (method, &rettype, &signature, error)) - return NULL; - - ret = g_string_new (""); - marshal_name = dbus_g_type_get_marshal_name (rettype); - g_assert (marshal_name != NULL); - g_string_append (ret, marshal_name); - g_string_append_c (ret, ':'); - for (i = 0; i < signature->len; i++) - { - marshal_name = dbus_g_type_get_marshal_name (g_array_index (signature, GType, i)); - g_assert (marshal_name != NULL); - g_string_append (ret, marshal_name); - if (i < signature->len - 1) - g_string_append_c (ret, ','); - } - if (signature->len == 0) - { - marshal_name = dbus_g_type_get_marshal_name (G_TYPE_NONE); - g_assert (marshal_name != NULL); - g_string_append (ret, marshal_name); - } - g_array_free (signature, TRUE); - return g_string_free (ret, FALSE); -} - -static char * -compute_marshaller_name (MethodInfo *method, const char *prefix, GError **error) -{ - GString *ret; - GArray *signature; - GType rettype; - const char *marshal_name; - guint i; - - if (!compute_gsignature (method, &rettype, &signature, error)) - return NULL; - - ret = g_string_new (MARSHAL_PREFIX); - g_string_append (ret, prefix); - g_string_append_c (ret, '_'); - - marshal_name = dbus_g_type_get_marshal_name (rettype); - g_assert (marshal_name != NULL); - g_string_append (ret, marshal_name); - g_string_append (ret, "__"); - for (i = 0; i < signature->len; i++) - { - marshal_name = dbus_g_type_get_marshal_name (g_array_index (signature, GType, i)); - g_assert (marshal_name != NULL); - g_string_append (ret, marshal_name); - if (i < signature->len - 1) - g_string_append_c (ret, '_'); - } - if (signature->len == 0) - { - marshal_name = dbus_g_type_get_marshal_name (G_TYPE_NONE); - g_assert (marshal_name != NULL); - g_string_append (ret, marshal_name); - } - g_array_free (signature, TRUE); - return g_string_free (ret, FALSE); -} - -static gboolean -gather_marshallers_list (GSList *list, DBusBindingToolCData *data, GError **error) -{ - GSList *tmp; - - tmp = list; - while (tmp != NULL) - { - if (!gather_marshallers (tmp->data, data, error)) - return FALSE; - tmp = tmp->next; - } - return TRUE; -} - -static gboolean -gather_marshallers (BaseInfo *base, DBusBindingToolCData *data, GError **error) -{ - if (base_info_get_type (base) == INFO_TYPE_NODE) - { - if (!gather_marshallers_list (node_info_get_nodes ((NodeInfo *) base), - data, error)) - return FALSE; - if (!gather_marshallers_list (node_info_get_interfaces ((NodeInfo *) base), - data, error)) - return FALSE; - } - else - { - InterfaceInfo *interface; - GSList *methods; - GSList *tmp; - const char *interface_c_name; - - interface = (InterfaceInfo *) base; - interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_C_SYMBOL); - if (interface_c_name == NULL) - { - if (!data->prefix) - return TRUE; - } - - methods = interface_info_get_methods (interface); - - /* Generate the necessary marshallers for the methods. */ - - for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp)) - { - MethodInfo *method; - char *marshaller_name; - - method = (MethodInfo *) tmp->data; - - marshaller_name = compute_marshaller (method, error); - if (!marshaller_name) - return FALSE; - - if (g_hash_table_lookup (data->generated, marshaller_name)) - { - g_free (marshaller_name); - continue; - } - - g_hash_table_insert (data->generated, marshaller_name, NULL); - } - - } - return TRUE; -} - -static gboolean -generate_glue_list (GSList *list, DBusBindingToolCData *data, GError **error) -{ - GSList *tmp; - - tmp = list; - while (tmp != NULL) - { - if (!generate_glue (tmp->data, data, error)) - return FALSE; - tmp = tmp->next; - } - return TRUE; -} - -#define WRITE_OR_LOSE(x) do { gsize bytes_written; if (!g_io_channel_write_chars (channel, x, -1, &bytes_written, error)) goto io_lose; } while (0) - -static gboolean -write_printf_to_iochannel (const char *fmt, GIOChannel *channel, GError **error, ...) -{ - char *str; - va_list args; - GIOStatus status; - gsize written; - gboolean ret; - - va_start (args, error); - - str = g_strdup_vprintf (fmt, args); - if ((status = g_io_channel_write_chars (channel, str, -1, &written, error)) == G_IO_STATUS_NORMAL) - ret = TRUE; - else - ret = FALSE; - - g_free (str); - - va_end (args); - - return ret; -} - -static gboolean -write_quoted_string (GIOChannel *channel, GString *string, GError **error) -{ - guint i; - - WRITE_OR_LOSE ("\""); - for (i = 0; i < string->len; i++) - { - if (string->str[i] != '\0') - { - if (!g_io_channel_write_chars (channel, string->str + i, 1, NULL, error)) - return FALSE; - } - else - { - if (!g_io_channel_write_chars (channel, "\\0", -1, NULL, error)) - return FALSE; - } - } - WRITE_OR_LOSE ("\\0\""); - return TRUE; - io_lose: - return FALSE; -} - -static gboolean -generate_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error) -{ - if (base_info_get_type (base) == INFO_TYPE_NODE) - { - GString *object_introspection_data_blob; - GIOChannel *channel; - - channel = data->channel; - - object_introspection_data_blob = g_string_new_len ("", 0); - - data->blob = object_introspection_data_blob; - data->count = 0; - - data->signal_blob = g_string_new_len ("", 0); - data->property_blob = g_string_new_len ("", 0); - - if (!write_printf_to_iochannel ("static const DBusGMethodInfo dbus_glib_%s_methods[] = {\n", channel, error, data->prefix)) - goto io_lose; - - if (!generate_glue_list (node_info_get_nodes ((NodeInfo *) base), - data, error)) - return FALSE; - if (!generate_glue_list (node_info_get_interfaces ((NodeInfo *) base), - data, error)) - return FALSE; - - WRITE_OR_LOSE ("};\n\n"); - - /* Information about the object. */ - - if (!write_printf_to_iochannel ("const DBusGObjectInfo dbus_glib_%s_object_info = {\n", - channel, error, data->prefix)) - goto io_lose; - WRITE_OR_LOSE (" 0,\n"); - if (!write_printf_to_iochannel (" dbus_glib_%s_methods,\n", channel, error, data->prefix)) - goto io_lose; - if (!write_printf_to_iochannel (" %d,\n", channel, error, data->count)) - goto io_lose; - - if (!write_quoted_string (channel, object_introspection_data_blob, error)) - goto io_lose; - WRITE_OR_LOSE (",\n"); - if (!write_quoted_string (channel, data->signal_blob, error)) - goto io_lose; - WRITE_OR_LOSE (",\n"); - if (!write_quoted_string (channel, data->property_blob, error)) - goto io_lose; - WRITE_OR_LOSE ("\n};\n\n"); - - g_string_free (object_introspection_data_blob, TRUE); - g_string_free (data->signal_blob, TRUE); - g_string_free (data->property_blob, TRUE); - } - else - { - GIOChannel *channel; - InterfaceInfo *interface; - GSList *methods; - GSList *signals; - GSList *properties; - GSList *tmp; - const char *interface_c_name; - GString *object_introspection_data_blob; - - channel = data->channel; - object_introspection_data_blob = data->blob; - - interface = (InterfaceInfo *) base; - interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_C_SYMBOL); - if (interface_c_name == NULL) - { - if (data->prefix == NULL) - return TRUE; - interface_c_name = data->prefix; - } - - methods = interface_info_get_methods (interface); - - /* Table of marshalled methods. */ - - for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp)) - { - MethodInfo *method; - char *marshaller_name; - char *method_c_name; - gboolean async = FALSE; - GSList *args; - gboolean found_retval = FALSE; - - method = (MethodInfo *) tmp->data; - method_c_name = g_strdup (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_C_SYMBOL)); - if (method_c_name == NULL) - { - char *method_name_uscored; - method_name_uscored = _dbus_gutils_wincaps_to_uscore (method_info_get_name (method)); - method_c_name = g_strdup_printf ("%s_%s", - interface_c_name, - method_name_uscored); - g_free (method_name_uscored); - } - - if (!write_printf_to_iochannel (" { (GCallback) %s, ", channel, error, - method_c_name)) - goto io_lose; - - marshaller_name = compute_marshaller_name (method, data->prefix, error); - if (!marshaller_name) - goto io_lose; - - if (!write_printf_to_iochannel ("%s, %d },\n", channel, error, - marshaller_name, - object_introspection_data_blob->len)) - { - g_free (marshaller_name); - goto io_lose; - } - - if (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_ASYNC) != NULL) - async = TRUE; - - /* Object method data blob format: - * \0\0(\0\0\0)*\0 - */ - - g_string_append (object_introspection_data_blob, interface_info_get_name (interface)); - g_string_append_c (object_introspection_data_blob, '\0'); - - g_string_append (object_introspection_data_blob, method_info_get_name (method)); - g_string_append_c (object_introspection_data_blob, '\0'); - - g_string_append_c (object_introspection_data_blob, async ? 'A' : 'S'); - g_string_append_c (object_introspection_data_blob, '\0'); - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - char direction; - const char *returnval_annotation; - - arg = args->data; - - g_string_append (object_introspection_data_blob, arg_info_get_name (arg)); - g_string_append_c (object_introspection_data_blob, '\0'); - - switch (arg_info_get_direction (arg)) - { - case ARG_IN: - direction = 'I'; - break; - case ARG_OUT: - direction = 'O'; - break; - case ARG_INVALID: - default: - g_assert_not_reached (); - direction = 0; /* silence gcc */ - break; - } - g_string_append_c (object_introspection_data_blob, direction); - g_string_append_c (object_introspection_data_blob, '\0'); - - if (arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_CONST) != NULL) - { - if (arg_info_get_direction (arg) == ARG_IN) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, - "Input argument \"%s\" cannot have const annotation in method \"%s\" of interface \"%s\"\n", - arg_info_get_name (arg), - method_info_get_name (method), - interface_info_get_name (interface)); - return FALSE; - } - g_string_append_c (object_introspection_data_blob, 'C'); - g_string_append_c (object_introspection_data_blob, '\0'); - } - else if (arg_info_get_direction (arg) == ARG_OUT) - { - g_string_append_c (object_introspection_data_blob, 'F'); - g_string_append_c (object_introspection_data_blob, '\0'); - } - - returnval_annotation = arg_info_get_annotation (arg, DBUS_GLIB_ANNOTATION_RETURNVAL); - if (returnval_annotation != NULL) - { - GType gtype; - - if (found_retval) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, - "Multiple arguments with return value annotation in method \"%s\" of interface \"%s\"\n", - method_info_get_name (method), - interface_info_get_name (interface)); - return FALSE; - } - found_retval = TRUE; - if (arg_info_get_direction (arg) == ARG_IN) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, - "Input argument \"%s\" cannot have return value annotation in method \"%s\" of interface \"%s\"\n", - arg_info_get_name (arg), - method_info_get_name (method), - interface_info_get_name (interface)); - return FALSE; - } - if (!strcmp ("", returnval_annotation)) - g_string_append_c (object_introspection_data_blob, 'R'); - else if (!strcmp ("error", returnval_annotation)) - { - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - if (!_dbus_gtype_can_signal_error (gtype)) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, - "Output argument \"%s\" cannot signal error with type \"%s\" in method \"%s\" of interface \"%s\"\n", - arg_info_get_name (arg), - g_type_name (gtype), - method_info_get_name (method), - interface_info_get_name (interface)); - return FALSE; - } - g_string_append_c (object_introspection_data_blob, 'E'); - } - else - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION, - "Invalid ReturnVal annotation for argument \"%s\" in method \"%s\" of interface \"%s\"\n", - arg_info_get_name (arg), - method_info_get_name (method), - interface_info_get_name (interface)); - return FALSE; - } - - g_string_append_c (object_introspection_data_blob, '\0'); - } - else if (arg_info_get_direction (arg) == ARG_OUT) - { - g_string_append_c (object_introspection_data_blob, 'N'); - g_string_append_c (object_introspection_data_blob, '\0'); - } - - g_string_append (object_introspection_data_blob, arg_info_get_type (arg)); - g_string_append_c (object_introspection_data_blob, '\0'); - } - - g_string_append_c (object_introspection_data_blob, '\0'); - - data->count++; - } - - signals = interface_info_get_signals (interface); - - for (tmp = signals; tmp != NULL; tmp = g_slist_next (tmp)) - { - SignalInfo *sig; - - sig = tmp->data; - - g_string_append (data->signal_blob, interface_info_get_name (interface)); - g_string_append_c (data->signal_blob, '\0'); - g_string_append (data->signal_blob, signal_info_get_name (sig)); - g_string_append_c (data->signal_blob, '\0'); - } - - properties = interface_info_get_properties (interface); - - for (tmp = properties; tmp != NULL; tmp = g_slist_next (tmp)) - { - PropertyInfo *prop; - - prop = tmp->data; - - g_string_append (data->property_blob, interface_info_get_name (interface)); - g_string_append_c (data->property_blob, '\0'); - g_string_append (data->property_blob, property_info_get_name (prop)); - g_string_append_c (data->property_blob, '\0'); - } - } - return TRUE; - io_lose: - return FALSE; -} - -static void -write_marshaller (gpointer key, gpointer value, gpointer user_data) -{ - DBusBindingToolCData *data; - const char *marshaller; - gsize bytes_written; - - data = user_data; - marshaller = key; - - if (data->error && *data->error) - return; - - if (g_io_channel_write_chars (data->channel, marshaller, -1, &bytes_written, data->error) == G_IO_STATUS_NORMAL) - g_io_channel_write_chars (data->channel, "\n", -1, &bytes_written, data->error); -} - -gboolean -dbus_binding_tool_output_glib_server (BaseInfo *info, GIOChannel *channel, const char *prefix, GError **error) -{ - gboolean ret; - GPtrArray *argv; - gint child_stdout; - GIOChannel *genmarshal_stdout; - GPid child_pid; - DBusBindingToolCData data; - char *tempfile_name; - gint tempfile_fd; - GIOStatus iostatus; - char buf[4096]; - gsize bytes_read, bytes_written; - - memset (&data, 0, sizeof (data)); - - dbus_g_type_specialized_init (); - _dbus_g_type_specialized_builtins_init (); - - data.prefix = prefix; - data.generated = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL); - data.error = error; - genmarshal_stdout = NULL; - tempfile_name = NULL; - - if (!gather_marshallers (info, &data, error)) - goto io_lose; - - tempfile_fd = g_file_open_tmp ("dbus-binding-tool-c-marshallers.XXXXXX", - &tempfile_name, error); - if (tempfile_fd < 0) - goto io_lose; - - data.channel = g_io_channel_unix_new (tempfile_fd); - if (!g_io_channel_set_encoding (data.channel, NULL, error)) - goto io_lose; - g_hash_table_foreach (data.generated, write_marshaller, &data); - if (error && *error != NULL) - { - ret = FALSE; - g_io_channel_close (data.channel); - g_io_channel_unref (data.channel); - goto io_lose; - } - - g_io_channel_close (data.channel); - g_io_channel_unref (data.channel); - - /* Now spawn glib-genmarshal to insert all our required marshallers */ - argv = g_ptr_array_new (); - g_ptr_array_add (argv, "glib-genmarshal"); - g_ptr_array_add (argv, "--header"); - g_ptr_array_add (argv, "--body"); - g_ptr_array_add (argv, g_strdup_printf ("--prefix=%s%s", MARSHAL_PREFIX, prefix)); - g_ptr_array_add (argv, tempfile_name); - g_ptr_array_add (argv, NULL); - if (!g_spawn_async_with_pipes (NULL, (char**)argv->pdata, NULL, - G_SPAWN_SEARCH_PATH, - NULL, NULL, - &child_pid, - NULL, - &child_stdout, NULL, error)) - { - g_ptr_array_free (argv, TRUE); - goto io_lose; - } - g_ptr_array_free (argv, TRUE); - - genmarshal_stdout = g_io_channel_unix_new (child_stdout); - if (!g_io_channel_set_encoding (genmarshal_stdout, NULL, error)) - goto io_lose; - - WRITE_OR_LOSE ("/* Generated by dbus-binding-tool; do not edit! */\n\n"); - - while ((iostatus = g_io_channel_read_chars (genmarshal_stdout, buf, sizeof (buf), - &bytes_read, error)) == G_IO_STATUS_NORMAL) - if (g_io_channel_write_chars (channel, buf, bytes_read, &bytes_written, error) != G_IO_STATUS_NORMAL) - goto io_lose; - if (iostatus != G_IO_STATUS_EOF) - goto io_lose; - - g_io_channel_close (genmarshal_stdout); - - WRITE_OR_LOSE ("#include \n"); - - data.channel = channel; - g_io_channel_ref (data.channel); - if (!generate_glue (info, &data, error)) - goto io_lose; - - ret = TRUE; - cleanup: - if (tempfile_name) - unlink (tempfile_name); - g_free (tempfile_name); - if (genmarshal_stdout) - g_io_channel_unref (genmarshal_stdout); - if (data.channel) - g_io_channel_unref (data.channel); - g_hash_table_destroy (data.generated); - - return ret; - io_lose: - ret = FALSE; - goto cleanup; -} - -static char * -iface_to_c_prefix (const char *iface) -{ - char **components; - char **component; - GString *ret; - gboolean first; - - components = g_strsplit (iface, ".", 0); - - first = TRUE; - ret = g_string_new (""); - for (component = components; *component; component++) - { - if (!first) - g_string_append_c (ret, '_'); - else - first = FALSE; - g_string_append (ret, *component); - } - g_strfreev (components); - return g_string_free (ret, FALSE); -} - -static char * -compute_client_method_name (const char *iface_prefix, MethodInfo *method) -{ - char *method_name_uscored, *ret; - - method_name_uscored = _dbus_gutils_wincaps_to_uscore (method_info_get_name (method)); - ret = g_strdup_printf ("%s_%s", iface_prefix, method_name_uscored); - g_free (method_name_uscored); - - return ret; -} - -static gboolean -write_formal_parameters (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, GError **error) -{ - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - const char *type_str; - const char *type_suffix; - GType gtype; - int direction; - - arg = args->data; - - WRITE_OR_LOSE (", "); - - direction = arg_info_get_direction (arg); - - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - if (gtype == G_TYPE_INVALID) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, - _("Unsupported conversion from D-BUS type signature \"%s\" to glib C type in method \"%s\" of interface \"%s\""), - arg_info_get_type (arg), - method_info_get_name (method), - interface_info_get_name (iface)); - return FALSE; - } - type_str = dbus_g_type_get_c_name (gtype); - g_assert (type_str); - /* Variants are special...*/ - if (gtype == G_TYPE_VALUE) - { - if (direction == ARG_IN) - type_suffix = "*"; - else - type_suffix = ""; - } - else if ((g_type_is_a (gtype, G_TYPE_BOXED) - || g_type_is_a (gtype, G_TYPE_OBJECT) - || g_type_is_a (gtype, G_TYPE_POINTER))) - type_suffix = "*"; - else - type_suffix = ""; - - - switch (direction) - { - case ARG_IN: - if (!write_printf_to_iochannel ("const %s%s IN_%s", channel, error, - type_str, - type_suffix, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_OUT: - if (!write_printf_to_iochannel ("%s%s* OUT_%s", channel, error, - type_str, - type_suffix, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_INVALID: - break; - } - } - - return TRUE; - io_lose: - return FALSE; -} - -#define MAP_FUNDAMENTAL(NAME) \ - case G_TYPE_ ## NAME: \ - return g_strdup ("G_TYPE_" #NAME); -#define MAP_KNOWN(NAME) \ - if (gtype == NAME) \ - return g_strdup (#NAME) -static char * -dbus_g_type_get_lookup_function (GType gtype) -{ - char *type_lookup; - switch (gtype) - { - MAP_FUNDAMENTAL(CHAR); - MAP_FUNDAMENTAL(UCHAR); - MAP_FUNDAMENTAL(BOOLEAN); - MAP_FUNDAMENTAL(LONG); - MAP_FUNDAMENTAL(ULONG); - MAP_FUNDAMENTAL(INT); - MAP_FUNDAMENTAL(UINT); - MAP_FUNDAMENTAL(INT64); - MAP_FUNDAMENTAL(UINT64); - MAP_FUNDAMENTAL(FLOAT); - MAP_FUNDAMENTAL(DOUBLE); - MAP_FUNDAMENTAL(STRING); - } - if (dbus_g_type_is_collection (gtype)) - { - GType elt_gtype; - char *sublookup; - - elt_gtype = dbus_g_type_get_collection_specialization (gtype); - sublookup = dbus_g_type_get_lookup_function (elt_gtype); - g_assert (sublookup); - - if (_dbus_g_type_is_fixed (elt_gtype)) - { - type_lookup = g_strdup_printf ("dbus_g_type_get_collection " - "(\"GArray\", %s)", sublookup); - } - else - { - type_lookup = g_strdup_printf ("dbus_g_type_get_collection " - "(\"GPtrArray\", %s)", sublookup); - } - - g_free (sublookup); - - return type_lookup; - } - else if (dbus_g_type_is_map (gtype)) - { - GType key_gtype; - char *key_lookup; - GType value_gtype; - char *value_lookup; - - key_gtype = dbus_g_type_get_map_key_specialization (gtype); - value_gtype = dbus_g_type_get_map_value_specialization (gtype); - key_lookup = dbus_g_type_get_lookup_function (key_gtype); - g_assert (key_lookup); - value_lookup = dbus_g_type_get_lookup_function (value_gtype); - g_assert (value_lookup); - type_lookup = g_strdup_printf ("dbus_g_type_get_map (\"GHashTable\", %s, %s)", - key_lookup, value_lookup); - g_free (key_lookup); - g_free (value_lookup); - return type_lookup; - } - else if (dbus_g_type_is_struct (gtype)) - { - GType value_gtype; - GString *string; - char *value_lookup = NULL; - guint size, i; - - string = g_string_new ("dbus_g_type_get_struct (\"GValueArray\""); - - size = dbus_g_type_get_struct_size (gtype); - for (i=0; i < size; i++) - { - value_gtype = dbus_g_type_get_struct_member_type(gtype, i); - value_lookup = dbus_g_type_get_lookup_function (value_gtype); - g_assert (value_lookup); - g_string_append_printf (string, ", %s", value_lookup); - g_free (value_lookup); - } - g_string_append (string, ", G_TYPE_INVALID)"); - return g_string_free (string, FALSE); - } - - MAP_KNOWN(G_TYPE_VALUE); - MAP_KNOWN(G_TYPE_STRV); - MAP_KNOWN(G_TYPE_VALUE_ARRAY); - MAP_KNOWN(DBUS_TYPE_G_PROXY); - MAP_KNOWN(DBUS_TYPE_G_OBJECT_PATH); - return NULL; -} -#undef MAP_FUNDAMENTAL -#undef MAP_KNOWN - -static gboolean -write_args_for_direction (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, int direction, GError **error) -{ - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - GType gtype; - char *type_lookup; - - arg = args->data; - - if (direction != arg_info_get_direction (arg)) - continue; - - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - g_assert (gtype != G_TYPE_INVALID); - type_lookup = dbus_g_type_get_lookup_function (gtype); - g_assert (type_lookup != NULL); - - switch (direction) - { - - case ARG_IN: - if (!write_printf_to_iochannel ("%s, IN_%s, ", channel, error, - type_lookup, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_OUT: - if (!write_printf_to_iochannel ("%s, OUT_%s, ", channel, error, - type_lookup, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_INVALID: - break; - } - g_free (type_lookup); - } - - return TRUE; - io_lose: - return FALSE; -} - -static gboolean -check_supported_parameters (MethodInfo *method) -{ - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - GType gtype; - - arg = args->data; - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - if (gtype == G_TYPE_INVALID) - return FALSE; - } - return TRUE; -} - -static gboolean -write_untyped_out_args (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, GError **error) -{ - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - - arg = args->data; - if (arg_info_get_direction (arg) != ARG_OUT) - continue; - - if (!write_printf_to_iochannel ("OUT_%s, ", channel, error, - arg_info_get_name (arg))) - goto io_lose; - } - - return TRUE; - io_lose: - return FALSE; -} - -static gboolean -write_formal_declarations_for_direction (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, const int direction, GError **error) - { - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - GType gtype; - const char *type_str, *type_suffix; - int dir; - - arg = args->data; - - dir = arg_info_get_direction (arg); - - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - type_str = dbus_g_type_get_c_name (gtype); - - if (!type_str) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, - _("Unsupported conversion from D-BUS type signature \"%s\" to glib C type in method \"%s\" of interface \"%s\""), - arg_info_get_type (arg), - method_info_get_name (method), - interface_info_get_name (iface)); - return FALSE; - } - - /* Variants are special...*/ - if (gtype == G_TYPE_VALUE) - { - if (direction == ARG_IN) - type_suffix = "*"; - else - type_suffix = ""; - } - else if ((g_type_is_a (gtype, G_TYPE_BOXED) - || g_type_is_a (gtype, G_TYPE_OBJECT) - || g_type_is_a (gtype, G_TYPE_POINTER))) - type_suffix = "*"; - else - type_suffix = ""; - - if (direction != dir) - continue; - - switch (dir) - { - case ARG_IN: - if (!write_printf_to_iochannel (" %s%s IN_%s;\n", channel, error, - type_str, type_suffix, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_OUT: - if (!write_printf_to_iochannel (" %s%s OUT_%s;\n", channel, error, - type_str, type_suffix, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_INVALID: - break; - } - } - return TRUE; - io_lose: - return FALSE; - } - -static gboolean -write_formal_parameters_for_direction (InterfaceInfo *iface, MethodInfo *method, int dir, GIOChannel *channel, GError **error) -{ - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - const char *type_str; - const char *type_suffix; - GType gtype; - int direction; - - arg = args->data; - - direction = arg_info_get_direction (arg); - if (dir != direction) continue; - - WRITE_OR_LOSE (", "); - - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - type_str = dbus_g_type_get_c_name (gtype); - /* Variants are special...*/ - if (gtype == G_TYPE_VALUE) - { - if (direction == ARG_IN) - type_suffix = "*"; - else - type_suffix = ""; - } - else if ((g_type_is_a (gtype, G_TYPE_BOXED) - || g_type_is_a (gtype, G_TYPE_OBJECT) - || g_type_is_a (gtype, G_TYPE_POINTER))) - type_suffix = "*"; - else - type_suffix = ""; - - if (!type_str) - { - g_set_error (error, - DBUS_BINDING_TOOL_ERROR, - DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, - _("Unsupported conversion from D-BUS type signature \"%s\" to glib C type in method \"%s\" of interface \"%s\""), - arg_info_get_type (arg), - method_info_get_name (method), - interface_info_get_name (iface)); - return FALSE; - } - - switch (direction) - { - case ARG_IN: - if (!write_printf_to_iochannel ("const %s%s IN_%s", channel, error, - type_str, - type_suffix, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_OUT: - if (!write_printf_to_iochannel ("%s%s* OUT_%s", channel, error, - type_str, - type_suffix, - arg_info_get_name (arg))) - goto io_lose; - break; - case ARG_INVALID: - break; - } - } - return TRUE; - io_lose: - return FALSE; -} - -static gboolean -write_typed_args_for_direction (InterfaceInfo *iface, MethodInfo *method, GIOChannel *channel, const int direction, GError **error) - { - GSList *args; - - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - int dir; - GType gtype; - const char *type_lookup; - - arg = args->data; - - dir = arg_info_get_direction (arg); - - if (dir != direction) - continue; - - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - type_lookup = dbus_g_type_get_lookup_function (gtype); - - if (!write_printf_to_iochannel ("%s, &%s_%s, ", channel, error, type_lookup, direction == ARG_IN ? "IN" : "OUT", arg_info_get_name (arg))) - goto io_lose; - } - return TRUE; - io_lose: - return FALSE; -} - -static gboolean -write_async_method_client (GIOChannel *channel, InterfaceInfo *interface, MethodInfo *method, GError **error) -{ - char *method_name, *iface_prefix; - const char *interface_c_name; - - iface_prefix = iface_to_c_prefix (interface_info_get_name (interface)); - interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL); - if (interface_c_name == NULL) - { - interface_c_name = (const char *) iface_prefix; - } - - method_name = g_strdup (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL)); - if (method_name == NULL) - { - method_name = compute_client_method_name (interface_c_name, method); - } - g_free(iface_prefix); - - /* Write the typedef for the client callback */ - if (!write_printf_to_iochannel ("typedef void (*%s_reply) (DBusGProxy *proxy, ", channel, error, method_name)) - goto io_lose; - { - GSList *args; - for (args = method_info_get_args (method); args; args = args->next) - { - ArgInfo *arg; - const char *type_suffix, *type_str; - GType gtype; - - arg = args->data; - - if (arg_info_get_direction (arg) != ARG_OUT) - continue; - gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE); - if (gtype != G_TYPE_VALUE && (g_type_is_a (gtype, G_TYPE_BOXED) - || g_type_is_a (gtype, G_TYPE_OBJECT) - || g_type_is_a (gtype, G_TYPE_POINTER))) - type_suffix = "*"; - else - type_suffix = ""; - type_str = dbus_g_type_get_c_name (_dbus_gtype_from_signature (arg_info_get_type (arg), TRUE)); - if (!write_printf_to_iochannel ("%s %sOUT_%s, ", channel, error, type_str, type_suffix, arg_info_get_name (arg))) - goto io_lose; - } - } - WRITE_OR_LOSE ("GError *error, gpointer userdata);\n\n"); - - - /* Write the callback when the call returns */ - WRITE_OR_LOSE ("static void\n"); - if (!write_printf_to_iochannel ("%s_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)\n", channel, error, method_name)) - goto io_lose; - WRITE_OR_LOSE ("{\n"); - WRITE_OR_LOSE (" DBusGAsyncData *data = user_data;\n GError *error = NULL;\n"); - if (!write_formal_declarations_for_direction (interface, method, channel, ARG_OUT, error)) - goto io_lose; - /* TODO: handle return boolean of end_call */ - WRITE_OR_LOSE (" dbus_g_proxy_end_call (proxy, call, &error, "); - if (!write_typed_args_for_direction (interface, method, channel, ARG_OUT, error)) - goto io_lose; - WRITE_OR_LOSE("G_TYPE_INVALID);\n"); - if (!write_printf_to_iochannel (" (*(%s_reply)data->cb) (proxy, ", channel, error, method_name)) - goto io_lose; - if (!write_untyped_out_args (interface, method, channel, error)) - goto io_lose; - WRITE_OR_LOSE ("error, data->userdata);\n"); - WRITE_OR_LOSE (" return;\n}\n\n"); - - - /* Write the main wrapper function */ - WRITE_OR_LOSE ("static\n#ifdef G_HAVE_INLINE\ninline\n#endif\nDBusGProxyCall*\n"); - if (!write_printf_to_iochannel ("%s_async (DBusGProxy *proxy", channel, error, - method_name)) - goto io_lose; - if (!write_formal_parameters_for_direction (interface, method, ARG_IN, channel, error)) - goto io_lose; - - if (!write_printf_to_iochannel (", %s_reply callback, gpointer userdata)\n\n", channel, error, method_name)) - goto io_lose; - - WRITE_OR_LOSE ("{\n"); - WRITE_OR_LOSE (" DBusGAsyncData *stuff;\n stuff = g_new (DBusGAsyncData, 1);\n stuff->cb = G_CALLBACK (callback);\n stuff->userdata = userdata;\n"); - if (!write_printf_to_iochannel (" return dbus_g_proxy_begin_call (proxy, \"%s\", %s_async_callback, stuff, g_free, ", channel, error, method_info_get_name (method), method_name)) - goto io_lose; - if (!write_args_for_direction (interface, method, channel, ARG_IN, error)) - goto io_lose; - WRITE_OR_LOSE ("G_TYPE_INVALID);\n}\n"); - - g_free (method_name); - return TRUE; - io_lose: - g_free (method_name); - return FALSE; - } - -static gboolean -generate_client_glue_list (GSList *list, DBusBindingToolCData *data, GError **error) -{ - GSList *tmp; - - tmp = list; - while (tmp != NULL) - { - if (!generate_client_glue (tmp->data, data, error)) - return FALSE; - tmp = tmp->next; - } - return TRUE; -} - -static gboolean -generate_client_glue (BaseInfo *base, DBusBindingToolCData *data, GError **error) -{ - if (base_info_get_type (base) == INFO_TYPE_NODE) - { - if (!generate_client_glue_list (node_info_get_nodes ((NodeInfo *) base), - data, error)) - return FALSE; - if (!generate_client_glue_list (node_info_get_interfaces ((NodeInfo *) base), - data, error)) - return FALSE; - } - else - { - GIOChannel *channel; - InterfaceInfo *interface; - GSList *methods; - GSList *tmp; - char *iface_prefix; - const char *interface_c_name; - - channel = data->channel; - - interface = (InterfaceInfo *) base; - - methods = interface_info_get_methods (interface); - - iface_prefix = iface_to_c_prefix (interface_info_get_name (interface)); - interface_c_name = interface_info_get_annotation (interface, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL); - if (interface_c_name == NULL) - { - interface_c_name = (const char *) iface_prefix; - } - - if (!write_printf_to_iochannel ("#ifndef DBUS_GLIB_CLIENT_WRAPPERS_%s\n" - "#define DBUS_GLIB_CLIENT_WRAPPERS_%s\n\n", - channel, error, - iface_prefix, iface_prefix)) - { - g_free (iface_prefix); - goto io_lose; - } - - for (tmp = methods; tmp != NULL; tmp = g_slist_next (tmp)) - { - MethodInfo *method; - char *method_c_name; - gboolean is_noreply; - - method = (MethodInfo *) tmp->data; - method_c_name = g_strdup (method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL)); - if (method_c_name == NULL) - { - method_c_name = compute_client_method_name (interface_c_name, method); - } - - is_noreply = method_info_get_annotation (method, DBUS_GLIB_ANNOTATION_NOREPLY) != NULL; - - if (data->ignore_unsupported && !check_supported_parameters (method)) - { - g_warning ("Ignoring unsupported signature in method \"%s\" of interface \"%s\"\n", - method_info_get_name (method), - interface_info_get_name (interface)); - continue; - } - - - WRITE_OR_LOSE ("static\n#ifdef G_HAVE_INLINE\ninline\n#endif\ngboolean\n"); - if (!write_printf_to_iochannel ("%s (DBusGProxy *proxy", channel, error, - method_c_name)) - goto io_lose; - g_free (method_c_name); - - if (!write_formal_parameters (interface, method, channel, error)) - goto io_lose; - - WRITE_OR_LOSE (", GError **error)\n\n"); - - WRITE_OR_LOSE ("{\n"); - - if (is_noreply) { - if (!write_printf_to_iochannel (" dbus_g_proxy_call_no_reply (proxy, \"%s\", ", channel, error, - method_info_get_name (method))) - goto io_lose; - - if (!write_args_for_direction (interface, method, channel, ARG_IN, error)) - goto io_lose; - - WRITE_OR_LOSE ("G_TYPE_INVALID, "); - - if (!write_args_for_direction (interface, method, channel, ARG_OUT, error)) - goto io_lose; - - WRITE_OR_LOSE ("G_TYPE_INVALID);\n"); - - WRITE_OR_LOSE (" return TRUE;\n}\n\n"); - } else { - if (!write_printf_to_iochannel (" return dbus_g_proxy_call (proxy, \"%s\", ", channel, error, - method_info_get_name (method))) - goto io_lose; - - WRITE_OR_LOSE ("error, "); - - if (!write_args_for_direction (interface, method, channel, ARG_IN, error)) - goto io_lose; - - WRITE_OR_LOSE ("G_TYPE_INVALID, "); - - if (!write_args_for_direction (interface, method, channel, ARG_OUT, error)) - goto io_lose; - - WRITE_OR_LOSE ("G_TYPE_INVALID);\n}\n\n"); - } - - write_async_method_client (channel, interface, method, error); - } - - if (!write_printf_to_iochannel ("#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_%s */\n\n", channel, error, iface_prefix)) - { - g_free (iface_prefix); - goto io_lose; - } - - g_free (iface_prefix); - } - return TRUE; - io_lose: - return FALSE; -} - - -gboolean -dbus_binding_tool_output_glib_client (BaseInfo *info, GIOChannel *channel, gboolean ignore_unsupported, GError **error) -{ - DBusBindingToolCData data; - gboolean ret; - - memset (&data, 0, sizeof (data)); - - data.channel = channel; - data.ignore_unsupported = ignore_unsupported; - - dbus_g_type_specialized_init (); - _dbus_g_type_specialized_builtins_init (); - - WRITE_OR_LOSE ("/* Generated by dbus-binding-tool; do not edit! */\n\n"); - WRITE_OR_LOSE ("#include \n"); - WRITE_OR_LOSE ("#include \n"); - WRITE_OR_LOSE ("#include \n\n"); - WRITE_OR_LOSE ("G_BEGIN_DECLS\n\n"); - - ret = generate_client_glue (info, &data, error); - if (!ret) - goto io_lose; - - WRITE_OR_LOSE ("G_END_DECLS\n"); - - return ret; - io_lose: - return FALSE; -} diff --git a/glib/dbus-binding-tool-glib.h b/glib/dbus-binding-tool-glib.h deleted file mode 100644 index 7a2f0e97..00000000 --- a/glib/dbus-binding-tool-glib.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-binding-tool-output-glib.h prototypes for glib output - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it bwill be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_BINDING_TOOL_OUTPUT_GLIB_H -#define DBUS_BINDING_TOOL_OUTPUT_GLIB_H - -G_BEGIN_DECLS - -#define DBUS_GLIB_ANNOTATION_C_SYMBOL "org.freedesktop.DBus.GLib.CSymbol" -#define DBUS_GLIB_ANNOTATION_CLIENT_C_SYMBOL "org.freedesktop.DBus.GLib.ClientCSymbol" -#define DBUS_GLIB_ANNOTATION_ASYNC "org.freedesktop.DBus.GLib.Async" -#define DBUS_GLIB_ANNOTATION_CONST "org.freedesktop.DBus.GLib.Const" -#define DBUS_GLIB_ANNOTATION_RETURNVAL "org.freedesktop.DBus.GLib.ReturnVal" -#define DBUS_GLIB_ANNOTATION_NOREPLY "org.freedesktop.DBus.Method.NoReply" - -gboolean dbus_binding_tool_output_glib_client (BaseInfo *info, GIOChannel *channel, gboolean ignore_unsupported, GError **error); -gboolean dbus_binding_tool_output_glib_server (BaseInfo *info, GIOChannel *channel, const char *prefix, GError **error); - -G_END_DECLS - -#endif diff --git a/glib/dbus-gidl.c b/glib/dbus-gidl.c deleted file mode 100644 index 619e25fd..00000000 --- a/glib/dbus-gidl.c +++ /dev/null @@ -1,788 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gidl.c data structure describing an interface, to be generated from IDL - * or something - * - * Copyright (C) 2003, 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "dbus-gidl.h" - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -struct BaseInfo -{ - unsigned int refcount : 28; - unsigned int type : 4; - char *name; -}; - -struct NodeInfo -{ - BaseInfo base; - GSList *interfaces; - GSList *nodes; -}; - -struct InterfaceInfo -{ - BaseInfo base; - GHashTable *annotations; - /* Since we have BaseInfo now these could be one list */ - GSList *methods; - GSList *signals; - GSList *properties; -}; - -struct MethodInfo -{ - BaseInfo base; - GHashTable *annotations; - GSList *args; -}; - -struct SignalInfo -{ - BaseInfo base; - GSList *args; -}; - -struct PropertyInfo -{ - BaseInfo base; - char *type; - PropertyAccessFlags access; -}; - -struct ArgInfo -{ - BaseInfo base; - char *type; - ArgDirection direction; - GHashTable *annotations; -}; - -static void -get_hash_key (gpointer key, gpointer value, gpointer data) -{ - GSList **list = data; - *list = g_slist_prepend (*list, key); -} - -static GSList * -get_hash_keys (GHashTable *table) -{ - GSList *ret = NULL; - - g_hash_table_foreach (table, get_hash_key, &ret); - - return ret; -} - -BaseInfo * -base_info_ref (BaseInfo *info) -{ - g_return_val_if_fail (info != NULL, NULL); - g_return_val_if_fail (info->refcount > 0, NULL); - - info->refcount += 1; - - return info; -} - -static void -base_info_free (void *ptr) -{ - BaseInfo *info; - - info = ptr; - - g_free (info->name); - g_free (info); -} - -void -base_info_unref (BaseInfo *info) -{ - g_return_if_fail (info != NULL); - g_return_if_fail (info->refcount > 0); - - /* This is sort of bizarre, BaseInfo was tacked on later */ - - switch (info->type) - { - case INFO_TYPE_NODE: - node_info_unref ((NodeInfo*) info); - break; - case INFO_TYPE_INTERFACE: - interface_info_unref ((InterfaceInfo*) info); - break; - case INFO_TYPE_SIGNAL: - signal_info_unref ((SignalInfo*) info); - break; - case INFO_TYPE_METHOD: - method_info_unref ((MethodInfo*) info); - break; - case INFO_TYPE_PROPERTY: - property_info_unref ((PropertyInfo*) info); - break; - case INFO_TYPE_ARG: - arg_info_unref ((ArgInfo*) info); - break; - } -} - -InfoType -base_info_get_type (BaseInfo *info) -{ - return info->type; -} - -const char* -base_info_get_name (BaseInfo *info) -{ - return info->name; -} - -void -base_info_set_name (BaseInfo *info, - const char *name) -{ - char *old; - - old = info->name; - info->name = g_strdup (name); - g_free (old); -} - -GType -base_info_get_gtype (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ("BaseInfo", - (GBoxedCopyFunc) base_info_ref, - (GBoxedFreeFunc) base_info_unref); - - return our_type; -} - -static void -free_interface_list (GSList **interfaces_p) -{ - GSList *tmp; - tmp = *interfaces_p; - while (tmp != NULL) - { - interface_info_unref (tmp->data); - tmp = tmp->next; - } - g_slist_free (*interfaces_p); - *interfaces_p = NULL; -} - -static void -free_node_list (GSList **nodes_p) -{ - GSList *tmp; - tmp = *nodes_p; - while (tmp != NULL) - { - node_info_unref (tmp->data); - tmp = tmp->next; - } - g_slist_free (*nodes_p); - *nodes_p = NULL; -} - -static void -free_method_list (GSList **methods_p) -{ - GSList *tmp; - tmp = *methods_p; - while (tmp != NULL) - { - method_info_unref (tmp->data); - tmp = tmp->next; - } - g_slist_free (*methods_p); - *methods_p = NULL; -} - -static void -free_signal_list (GSList **signals_p) -{ - GSList *tmp; - tmp = *signals_p; - while (tmp != NULL) - { - signal_info_unref (tmp->data); - tmp = tmp->next; - } - g_slist_free (*signals_p); - *signals_p = NULL; -} - -static void -free_property_list (GSList **props_p) -{ - GSList *tmp; - tmp = *props_p; - while (tmp != NULL) - { - property_info_unref (tmp->data); - tmp = tmp->next; - } - g_slist_free (*props_p); - *props_p = NULL; -} - -NodeInfo* -node_info_new (const char *name) -{ - NodeInfo *info; - - /* name can be NULL */ - - info = g_new0 (NodeInfo, 1); - info->base.refcount = 1; - info->base.name = g_strdup (name); - info->base.type = INFO_TYPE_NODE; - - return info; -} - -NodeInfo * -node_info_ref (NodeInfo *info) -{ - info->base.refcount += 1; - - return info; -} - -void -node_info_unref (NodeInfo *info) -{ - info->base.refcount -= 1; - if (info->base.refcount == 0) - { - free_interface_list (&info->interfaces); - free_node_list (&info->nodes); - base_info_free (info); - } -} - -const char* -node_info_get_name (NodeInfo *info) -{ - return info->base.name; -} - -GSList* -node_info_get_interfaces (NodeInfo *info) -{ - return info->interfaces; -} - -void -node_info_add_interface (NodeInfo *info, - InterfaceInfo *interface) -{ - interface_info_ref (interface); - info->interfaces = g_slist_append (info->interfaces, interface); -} - -GSList* -node_info_get_nodes (NodeInfo *info) -{ - return info->nodes; -} - -void -node_info_add_node (NodeInfo *info, - NodeInfo *node) -{ - node_info_ref (node); - info->nodes = g_slist_append (info->nodes, node); -} - -void -node_info_replace_node (NodeInfo *info, - NodeInfo *old_child, - NodeInfo *new_child) -{ - GSList *link; - - node_info_ref (new_child); /* before unref old_child in case they are the same */ - link = g_slist_find (info->nodes, old_child); - g_assert (link != NULL); - node_info_unref (old_child); - link->data = new_child; -} - -InterfaceInfo* -interface_info_new (const char *name) -{ - InterfaceInfo *info; - - info = g_new0 (InterfaceInfo, 1); - info->base.refcount = 1; - info->base.name = g_strdup (name); - info->base.type = INFO_TYPE_INTERFACE; - info->annotations = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) g_free); - - return info; -} - -InterfaceInfo * -interface_info_ref (InterfaceInfo *info) -{ - info->base.refcount += 1; - - return info; -} - -void -interface_info_unref (InterfaceInfo *info) -{ - info->base.refcount -= 1; - if (info->base.refcount == 0) - { - g_hash_table_destroy (info->annotations); - free_method_list (&info->methods); - free_signal_list (&info->signals); - free_property_list (&info->properties); - base_info_free (info); - } -} - -const char* -interface_info_get_name (InterfaceInfo *info) -{ - return info->base.name; -} - -GSList * -interface_info_get_annotations (InterfaceInfo *info) -{ - return get_hash_keys (info->annotations); -} - -const char* -interface_info_get_annotation (InterfaceInfo *info, - const char *name) -{ - return g_hash_table_lookup (info->annotations, name); -} - -GSList* -interface_info_get_methods (InterfaceInfo *info) -{ - return info->methods; -} - -GSList* -interface_info_get_signals (InterfaceInfo *info) -{ - return info->signals; -} - -GSList* -interface_info_get_properties (InterfaceInfo *info) -{ - return info->properties; -} - -void -interface_info_add_annotation (InterfaceInfo *info, - const char *name, - const char *value) -{ - g_hash_table_insert (info->annotations, - g_strdup (name), - g_strdup (value)); -} - -void -interface_info_add_method (InterfaceInfo *info, - MethodInfo *method) -{ - method_info_ref (method); - info->methods = g_slist_append (info->methods, method); -} - -void -interface_info_add_signal (InterfaceInfo *info, - SignalInfo *signal) -{ - signal_info_ref (signal); - info->signals = g_slist_append (info->signals, signal); -} - -void -interface_info_add_property (InterfaceInfo *info, - PropertyInfo *property) -{ - property_info_ref (property); - info->properties = g_slist_append (info->properties, property); -} - -static void -free_arg_list (GSList **args_p) -{ - GSList *tmp; - tmp = *args_p; - while (tmp != NULL) - { - ArgInfo *ai = tmp->data; - g_assert (ai->base.type == INFO_TYPE_ARG); - arg_info_unref (tmp->data); - tmp = tmp->next; - } - g_slist_free (*args_p); - *args_p = NULL; -} - -MethodInfo* -method_info_new (const char *name) -{ - MethodInfo *info; - - info = g_new0 (MethodInfo, 1); - info->base.refcount = 1; - info->base.name = g_strdup (name); - info->base.type = INFO_TYPE_METHOD; - info->annotations = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) g_free); - - return info; -} - -MethodInfo * -method_info_ref (MethodInfo *info) -{ - info->base.refcount += 1; - - return info; -} - -void -method_info_unref (MethodInfo *info) -{ - info->base.refcount -= 1; - if (info->base.refcount == 0) - { - g_hash_table_destroy (info->annotations); - free_arg_list (&info->args); - base_info_free (info); - } -} - -const char* -method_info_get_name (MethodInfo *info) -{ - return info->base.name; -} - -GSList * -method_info_get_annotations (MethodInfo *info) -{ - return get_hash_keys (info->annotations); -} - -const char* -method_info_get_annotation (MethodInfo *info, - const char *name) -{ - return g_hash_table_lookup (info->annotations, name); -} - -GSList* -method_info_get_args (MethodInfo *info) -{ - return info->args; -} - -int -method_info_get_n_args (MethodInfo *info) -{ - return g_slist_length (info->args); -} - -static int -args_sort_by_direction (const void *a, - const void *b) -{ - const ArgInfo *arg_a = a; - const ArgInfo *arg_b = b; - - if (arg_a->direction == arg_b->direction) - return 0; - else if (arg_a->direction == ARG_IN) - return -1; /* in is less than out */ - else - return 1; -} - -void -method_info_add_annotation (MethodInfo *info, - const char *name, - const char *value) -{ - g_hash_table_insert (info->annotations, - g_strdup (name), - g_strdup (value)); -} - -void -method_info_add_arg (MethodInfo *info, - ArgInfo *arg) -{ - arg_info_ref (arg); - info->args = g_slist_append (info->args, arg); - - /* Keep "in" args sorted before "out" and otherwise maintain - * stable order (g_slist_sort is stable, at least in sufficiently - * new glib) - */ - info->args = g_slist_sort (info->args, args_sort_by_direction); -} - -SignalInfo* -signal_info_new (const char *name) -{ - SignalInfo *info; - - info = g_new0 (SignalInfo, 1); - info->base.refcount = 1; - info->base.name = g_strdup (name); - info->base.type = INFO_TYPE_SIGNAL; - - return info; -} - -SignalInfo * -signal_info_ref (SignalInfo *info) -{ - info->base.refcount += 1; - - return info; -} - -void -signal_info_unref (SignalInfo *info) -{ - info->base.refcount -= 1; - if (info->base.refcount == 0) - { - free_arg_list (&info->args); - base_info_free (info); - } -} - -const char* -signal_info_get_name (SignalInfo *info) -{ - return info->base.name; -} - -GSList* -signal_info_get_args (SignalInfo *info) -{ - return info->args; -} - -int -signal_info_get_n_args (SignalInfo *info) -{ - return g_slist_length (info->args); -} - -void -signal_info_add_arg (SignalInfo *info, - ArgInfo *arg) -{ - g_assert (arg->direction == ARG_OUT); - - arg_info_ref (arg); - info->args = g_slist_append (info->args, arg); - - /* signal args don't need sorting since only "out" is allowed */ -} - -PropertyInfo* -property_info_new (const char *name, - const char *type, - PropertyAccessFlags access) -{ - PropertyInfo *info; - - info = g_new0 (PropertyInfo, 1); - info->base.refcount = 1; - info->base.name = g_strdup (name); - info->base.type = INFO_TYPE_PROPERTY; - - info->type = g_strdup (type); - info->access = access; - - return info; -} - -PropertyInfo* -property_info_ref (PropertyInfo *info) -{ - info->base.refcount += 1; - - return info; -} - -void -property_info_unref (PropertyInfo *info) -{ - info->base.refcount -= 1; - if (info->base.refcount == 0) - { - g_free (info->type); - base_info_free (info); - } -} - -const char* -property_info_get_name (PropertyInfo *info) -{ - return info->base.name; -} - -const char * -property_info_get_type (PropertyInfo *info) -{ - return info->type; -} - -PropertyAccessFlags -property_info_get_access (PropertyInfo *info) -{ - return info->access; -} - -ArgInfo* -arg_info_new (const char *name, - ArgDirection direction, - const char *type) -{ - ArgInfo *info; - - info = g_new0 (ArgInfo, 1); - info->base.refcount = 1; - info->base.type = INFO_TYPE_ARG; - - /* name can be NULL */ - info->base.name = g_strdup (name); - info->direction = direction; - info->type = g_strdup (type); - info->annotations = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) g_free); - - return info; -} - -ArgInfo * -arg_info_ref (ArgInfo *info) -{ - info->base.refcount += 1; - - return info; -} - -void -arg_info_unref (ArgInfo *info) -{ - info->base.refcount -= 1; - if (info->base.refcount == 0) - { - g_hash_table_destroy (info->annotations); - g_free (info->type); - base_info_free (info); - } -} - -const char* -arg_info_get_name (ArgInfo *info) -{ - return info->base.name; -} - -const char * -arg_info_get_type (ArgInfo *info) -{ - return info->type; -} - -ArgDirection -arg_info_get_direction (ArgInfo *info) -{ - return info->direction; -} - -GSList* -arg_info_get_annotations (ArgInfo *info) -{ - return get_hash_keys (info->annotations); -} - -const char* -arg_info_get_annotation (ArgInfo *info, - const char *annotation) -{ - return g_hash_table_lookup (info->annotations, annotation); -} - -void -arg_info_add_annotation (ArgInfo *info, - const char *name, - const char *value) -{ - g_hash_table_insert (info->annotations, - g_strdup (name), - g_strdup (value)); -} - - -#ifdef DBUS_BUILD_TESTS - -/** - * @ingroup DBusGIDL - * Unit test for GLib IDL internals - * @returns #TRUE on success. - */ -gboolean -_dbus_gidl_test (void) -{ - - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/dbus-gidl.h b/glib/dbus-gidl.h deleted file mode 100644 index 53bab67a..00000000 --- a/glib/dbus-gidl.h +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gidl.h data structure describing an interface, to be generated from IDL - * or something - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_GLIB_IDL_H -#define DBUS_GLIB_IDL_H - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -#include -#include - -G_BEGIN_DECLS - -typedef struct BaseInfo BaseInfo; -typedef struct NodeInfo NodeInfo; -typedef struct InterfaceInfo InterfaceInfo; -typedef struct MethodInfo MethodInfo; -typedef struct SignalInfo SignalInfo; -typedef struct PropertyInfo PropertyInfo; -typedef struct ArgInfo ArgInfo; - -typedef enum -{ - ARG_INVALID = -1, - ARG_IN, - ARG_OUT -} ArgDirection; - -typedef enum -{ - PROPERTY_READ = 1 << 0, - PROPERTY_WRITE = 1 << 1 -} PropertyAccessFlags; - -typedef enum -{ - INFO_TYPE_NODE, - INFO_TYPE_INTERFACE, - INFO_TYPE_METHOD, - INFO_TYPE_SIGNAL, - INFO_TYPE_ARG, - INFO_TYPE_PROPERTY - -} InfoType; - -BaseInfo* base_info_ref (BaseInfo *info); -void base_info_unref (BaseInfo *info); -InfoType base_info_get_type (BaseInfo *info); -const char* base_info_get_name (BaseInfo *info); -void base_info_set_name (BaseInfo *info, - const char *name); -GType base_info_get_gtype (void); -#define BASE_INFO_TYPE (base_info_get_gtype ()) - - -NodeInfo* node_info_new (const char *name); -NodeInfo* node_info_ref (NodeInfo *info); -void node_info_unref (NodeInfo *info); -const char* node_info_get_name (NodeInfo *info); -GSList* node_info_get_interfaces (NodeInfo *info); -GSList* node_info_get_nodes (NodeInfo *info); -void node_info_add_interface (NodeInfo *info, - InterfaceInfo *interface); -void node_info_add_node (NodeInfo *info, - NodeInfo *child); -void node_info_replace_node (NodeInfo *info, - NodeInfo *old_child, - NodeInfo *new_child); -InterfaceInfo* interface_info_new (const char *name); -InterfaceInfo* interface_info_ref (InterfaceInfo *info); -void interface_info_unref (InterfaceInfo *info); -const char* interface_info_get_name (InterfaceInfo *info); -GSList* interface_info_get_annotations(InterfaceInfo *info); -const char* interface_info_get_annotation (InterfaceInfo*info, - const char *annotation); -GSList* interface_info_get_methods (InterfaceInfo *info); -GSList* interface_info_get_signals (InterfaceInfo *info); -GSList* interface_info_get_properties (InterfaceInfo *info); -void interface_info_add_annotation (InterfaceInfo *info, - const char *name, - const char *value); -void interface_info_add_method (InterfaceInfo *info, - MethodInfo *method); -void interface_info_add_signal (InterfaceInfo *info, - SignalInfo *signal); -void interface_info_add_property (InterfaceInfo *info, - PropertyInfo *property); -MethodInfo* method_info_new (const char *name); -MethodInfo* method_info_ref (MethodInfo *info); -void method_info_unref (MethodInfo *info); -const char* method_info_get_name (MethodInfo *info); -GSList* method_info_get_annotations (MethodInfo *info); -const char* method_info_get_annotation (MethodInfo *info, - const char *annotation); -void method_info_add_annotation (MethodInfo *info, - const char *name, - const char *value); -GSList* method_info_get_args (MethodInfo *info); -void method_info_add_arg (MethodInfo *info, - ArgInfo *arg); -int method_info_get_n_args (MethodInfo *info); -SignalInfo* signal_info_new (const char *name); -SignalInfo* signal_info_ref (SignalInfo *info); -void signal_info_unref (SignalInfo *info); -const char* signal_info_get_name (SignalInfo *info); -GSList* signal_info_get_args (SignalInfo *info); -void signal_info_add_arg (SignalInfo *info, - ArgInfo *arg); -int signal_info_get_n_args (SignalInfo *info); -PropertyInfo* property_info_new (const char *name, - const char *type, - PropertyAccessFlags access); -PropertyInfo* property_info_ref (PropertyInfo *info); -void property_info_unref (PropertyInfo *info); -const char* property_info_get_name (PropertyInfo *info); -const char* property_info_get_type (PropertyInfo *info); -PropertyAccessFlags property_info_get_access (PropertyInfo *info); -ArgInfo* arg_info_new (const char *name, - ArgDirection direction, - const char *type); -ArgInfo* arg_info_ref (ArgInfo *info); -void arg_info_unref (ArgInfo *info); -const char* arg_info_get_name (ArgInfo *info); -const char* arg_info_get_type (ArgInfo *info); -ArgDirection arg_info_get_direction (ArgInfo *info); -GSList* arg_info_get_annotations (ArgInfo *info); -const char* arg_info_get_annotation (ArgInfo *info, - const char *annotation); -void arg_info_add_annotation (ArgInfo *info, - const char *name, - const char *value); - - -G_END_DECLS - -#endif /* DBUS_GLIB_IDL_H */ - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/dbus-glib-tool.c b/glib/dbus-glib-tool.c deleted file mode 100644 index 37152eb8..00000000 --- a/glib/dbus-glib-tool.c +++ /dev/null @@ -1,489 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-glib-tool.c Tool used by apps using glib bindings - * - * Copyright (C) 2003, 2004 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include "dbus-gidl.h" -#include "dbus-gparser.h" -#include "dbus-gutils.h" -#include "dbus-glib-tool.h" -#include "dbus-binding-tool-glib.h" -#include -#include -#define _(x) dgettext (GETTEXT_PACKAGE, x) -#define N_(x) x -#include -#include -#include -#include -#include -#include - -#ifdef DBUS_BUILD_TESTS -static void run_all_tests (const char *test_data_dir); -#endif - -typedef enum { - DBUS_BINDING_OUTPUT_NONE, - DBUS_BINDING_OUTPUT_PRETTY, - DBUS_BINDING_OUTPUT_GLIB_SERVER, - DBUS_BINDING_OUTPUT_GLIB_CLIENT -} DBusBindingOutputMode; - -static void -indent (int depth) -{ - depth *= 2; /* 2-space indent */ - - while (depth > 0) - { - putc (' ', stdout); - --depth; - } -} - -static void pretty_print (BaseInfo *base, - int depth); - -static void -pretty_print_list (GSList *list, - int depth) -{ - GSList *tmp; - - tmp = list; - while (tmp != NULL) - { - pretty_print (tmp->data, depth); - tmp = tmp->next; - } -} - -static void -pretty_print (BaseInfo *base, - int depth) -{ - InfoType t; - const char *name; - - t = base_info_get_type (base); - name = base_info_get_name (base); - - indent (depth); - - switch (t) - { - case INFO_TYPE_NODE: - { - NodeInfo *n = (NodeInfo*) base; - - if (name == NULL) - printf (_(" {\n")); - else - printf (_("node \"%s\" {\n"), name); - - pretty_print_list (node_info_get_interfaces (n), depth + 1); - pretty_print_list (node_info_get_nodes (n), depth + 1); - - indent (depth); - printf ("}\n"); - } - break; - case INFO_TYPE_INTERFACE: - { - InterfaceInfo *i = (InterfaceInfo*) base; - GSList *annotations, *elt; - - g_assert (name != NULL); - - printf (_("interface \"%s\" {\n"), name); - - annotations = interface_info_get_annotations (i); - for (elt = annotations; elt; elt = elt->next) - { - const char *name = elt->data; - const char *value = interface_info_get_annotation (i, name); - - printf (_(" (binding \"%s\": \"%s\") "), - name, value); - } - g_slist_free (annotations); - - pretty_print_list (interface_info_get_methods (i), depth + 1); - pretty_print_list (interface_info_get_signals (i), depth + 1); - pretty_print_list (interface_info_get_properties (i), depth + 1); - - indent (depth); - printf ("}\n"); - } - break; - case INFO_TYPE_METHOD: - { - MethodInfo *m = (MethodInfo*) base; - GSList *annotations, *elt; - - g_assert (name != NULL); - - annotations = method_info_get_annotations (m); - printf (_("method \"%s\""), name); - for (elt = annotations; elt; elt = elt->next) - { - const char *name = elt->data; - const char *value = method_info_get_annotation (m, name); - - printf (_(" (annotation \"%s\": \"%s\") "), - name, value); - } - g_slist_free (annotations); - - pretty_print_list (method_info_get_args (m), depth + 1); - - indent (depth); - printf (")\n"); - } - break; - case INFO_TYPE_SIGNAL: - { - SignalInfo *s = (SignalInfo*) base; - - g_assert (name != NULL); - - printf (_("signal \"%s\" (\n"), name); - - pretty_print_list (signal_info_get_args (s), depth + 1); - - indent (depth); - printf (")\n"); - } - break; - case INFO_TYPE_PROPERTY: - { - PropertyInfo *a = (PropertyInfo*) base; - const char *pt = property_info_get_type (a); - PropertyAccessFlags acc = property_info_get_access (a); - - printf ("%s%s %s", - acc & PROPERTY_READ ? "read" : "", - acc & PROPERTY_WRITE ? "write" : "", - pt); - if (name) - printf (" %s\n", name); - else - printf ("\n"); - } - break; - case INFO_TYPE_ARG: - { - ArgInfo *a = (ArgInfo*) base; - const char *at = arg_info_get_type (a); - ArgDirection d = arg_info_get_direction (a); - - printf ("%s %s", - d == ARG_IN ? "in" : "out", - at); - if (name) - printf (" %s\n", name); - else - printf ("\n"); - } - break; - } -} - -GQuark -dbus_binding_tool_error_quark (void) -{ - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string ("dbus_binding_tool_error"); - - return quark; -} - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - lose ("%s: %s", prefix, error->message); -} - -static void -usage (int ecode) -{ - fprintf (stderr, "dbus-binding-tool [--version] [--help] --mode=[pretty|glib-server|glib-client] [--ignore-unsupported] [--force] [--output=FILE] [--prefix=SYMBOL_PREFIX]\n"); - exit (ecode); -} - -static void -version (void) -{ - printf ("D-BUS Binding Tool %s\n" - "Copyright (C) 2003-2005 Red Hat, Inc.\n" - "This is free software; see the source for copying conditions.\n" - "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", - VERSION); - exit (0); -} - -int -main (int argc, char **argv) -{ - const char *output_file; - const char *prefix; - char *output_file_tmp; - int i; - GSList *files; - DBusBindingOutputMode outputmode; - gboolean end_of_args; - GSList *tmp; - GIOChannel *channel; - GError *error; - time_t newest_src; - struct stat srcbuf; - struct stat targetbuf; - gboolean force; - gboolean ignore_unsupported; - - setlocale (LC_ALL, ""); - bindtextdomain (GETTEXT_PACKAGE, DBUS_LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - textdomain (GETTEXT_PACKAGE); - - g_type_init (); - - outputmode = DBUS_BINDING_OUTPUT_NONE; - end_of_args = FALSE; - files = NULL; - output_file = NULL; - prefix = ""; - ignore_unsupported = FALSE; - force = FALSE; - i = 1; - while (i < argc) - { - const char *arg = argv[i]; - - if (!end_of_args) - { - if (strcmp (arg, "--help") == 0 || - strcmp (arg, "-h") == 0 || - strcmp (arg, "-?") == 0) - usage (0); - else if (strcmp (arg, "--version") == 0) - version (); - else if (strcmp (arg, "--force") == 0) - force = TRUE; -#ifdef DBUS_BUILD_TESTS - else if (strcmp (arg, "--self-test") == 0) - run_all_tests (NULL); -#endif /* DBUS_BUILD_TESTS */ - else if (strncmp (arg, "--mode=", 7) == 0) - { - const char *mode = arg + 7; - if (!strcmp (mode, "pretty")) - outputmode = DBUS_BINDING_OUTPUT_PRETTY; - else if (!strcmp (mode, "glib-server")) - outputmode = DBUS_BINDING_OUTPUT_GLIB_SERVER; - else if (!strcmp (mode, "glib-client")) - outputmode = DBUS_BINDING_OUTPUT_GLIB_CLIENT; - else - usage (1); - } - else if (strcmp (arg, "--ignore-unsupported") == 0) - ignore_unsupported = TRUE; - else if (strncmp (arg, "--output=", 9) == 0) - { - output_file = arg + 9; - } - else if (strncmp (arg, "--prefix=", 9) == 0) - { - prefix = arg + 9; - } - else if (arg[0] == '-' && - arg[1] == '-' && - arg[2] == '\0') - end_of_args = TRUE; - else if (arg[0] == '-') - { - usage (1); - } - else - { - files = g_slist_prepend (files, (char*) arg); - } - } - else - files = g_slist_prepend (files, (char*) arg); - - ++i; - } - - error = NULL; - - files = g_slist_reverse (files); - - if (output_file && !force) - { - newest_src = 0; - for (tmp = files; tmp != NULL; tmp = tmp->next) - { - const char *filename; - - filename = tmp->data; - if (stat (filename, &srcbuf) < 0) - lose ("Couldn't stat %s: %s", filename, g_strerror (errno)); - - if (srcbuf.st_mtime > newest_src) - newest_src = srcbuf.st_mtime; - } - - if (stat (output_file, &targetbuf) > 0 - && targetbuf.st_mtime >= newest_src) - exit (0); - } - - if (output_file) - { - output_file_tmp = g_strconcat (output_file, ".tmp", NULL); - - if (!(channel = g_io_channel_new_file (output_file_tmp, "w", &error))) - lose_gerror (_("Couldn't open temporary file"), error); - } - else - { - channel = g_io_channel_unix_new (fileno (stdout)); - output_file_tmp = NULL; /* silence gcc */ - } - if (!g_io_channel_set_encoding (channel, NULL, &error)) - lose_gerror (_("Couldn't set channel encoding to NULL"), error); - - - for (tmp = files; tmp != NULL; tmp = tmp->next) - { - NodeInfo *node; - GError *error; - const char *filename; - - filename = tmp->data; - - error = NULL; - node = description_load_from_file (filename, - &error); - if (node == NULL) - { - lose_gerror (_("Unable to load \"%s\""), error); - } - else - { - switch (outputmode) - { - case DBUS_BINDING_OUTPUT_PRETTY: - pretty_print ((BaseInfo*) node, 0); - break; - case DBUS_BINDING_OUTPUT_GLIB_SERVER: - if (!dbus_binding_tool_output_glib_server ((BaseInfo *) node, channel, prefix, &error)) - lose_gerror (_("Compilation failed"), error); - break; - case DBUS_BINDING_OUTPUT_GLIB_CLIENT: - if (!dbus_binding_tool_output_glib_client ((BaseInfo *) node, channel, ignore_unsupported, &error)) - lose_gerror (_("Compilation failed"), error); - break; - case DBUS_BINDING_OUTPUT_NONE: - break; - } - } - - if (node) - node_info_unref (node); - } - - if (g_io_channel_shutdown (channel, TRUE, &error) != G_IO_STATUS_NORMAL) - lose_gerror (_("Failed to shutdown IO channel"), error); - g_io_channel_unref (channel); - - if (output_file) - { - if (rename (output_file_tmp, output_file) < 0) - lose ("Failed to rename %s to %s: %s", output_file_tmp, output_file, - g_strerror (errno)); - g_free (output_file_tmp); - } - - return 0; -} - - -#ifdef DBUS_BUILD_TESTS -static void -test_die (const char *failure) -{ - lose ("Unit test failed: %s", failure); -} - -/** - * @ingroup DBusGTool - * Unit test for GLib utility tool - * @returns #TRUE on success. - */ -static gboolean -_dbus_gtool_test (const char *test_data_dir) -{ - - return TRUE; -} - -static void -run_all_tests (const char *test_data_dir) -{ - if (test_data_dir == NULL) - test_data_dir = g_getenv ("DBUS_TEST_DATA"); - - if (test_data_dir != NULL) - printf ("Test data in %s\n", test_data_dir); - else - printf ("No test data!\n"); - - printf ("%s: running binding tests\n", "dbus-binding-tool"); - if (!_dbus_gtool_test (test_data_dir)) - test_die ("gtool"); - - printf ("%s: completed successfully\n", "dbus-binding-tool"); -} - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-glib-tool.h b/glib/dbus-glib-tool.h deleted file mode 100644 index 0c61de74..00000000 --- a/glib/dbus-glib-tool.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-glib-tool.h: Definitions used internally by binding tool - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_BINDING_TOOL_H -#define DBUS_BINDING_TOOL_H - -#include - -typedef enum -{ - DBUS_BINDING_TOOL_ERROR_UNSUPPORTED_CONVERSION, - DBUS_BINDING_TOOL_ERROR_INVALID_ANNOTATION -} DBusBindingToolError; - -#define DBUS_BINDING_TOOL_ERROR dbus_binding_tool_error_quark () - -GQuark dbus_binding_tool_error_quark (void); - -#endif diff --git a/glib/dbus-glib.c b/glib/dbus-glib.c deleted file mode 100644 index 332c313f..00000000 --- a/glib/dbus-glib.c +++ /dev/null @@ -1,304 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-glib.c General GLib binding stuff - * - * Copyright (C) 2004 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include "dbus-gtest.h" -#include "dbus-gutils.h" -#include "dbus-gobject.h" -#include - -#include -#define _(x) dgettext (GETTEXT_PACKAGE, x) -#define N_(x) x - -/** - * @addtogroup DBusGLib - * @{ - */ - -/** - * Blocks until outgoing calls and signal emissions have been sent. - * - * @param connection the connection to flush - */ -void -dbus_g_connection_flush (DBusGConnection *connection) -{ - dbus_connection_flush (DBUS_CONNECTION_FROM_G_CONNECTION (connection)); -} - -/** - * Increment refcount on a #DBusGConnection - * - * @param gconnection the connection to ref - * @returns the connection that was ref'd - */ -DBusGConnection* -dbus_g_connection_ref (DBusGConnection *gconnection) -{ - DBusConnection *c; - - c = DBUS_CONNECTION_FROM_G_CONNECTION (gconnection); - dbus_connection_ref (c); - return gconnection; -} - - -/** - * Decrement refcount on a #DBusGConnection - * - * @param gconnection the connection to unref - */ -void -dbus_g_connection_unref (DBusGConnection *gconnection) -{ - DBusConnection *c; - - c = DBUS_CONNECTION_FROM_G_CONNECTION (gconnection); - dbus_connection_unref (c); -} - - -/** - * Increment refcount on a #DBusGMessage - * - * @param gmessage the message to ref - * @returns the message that was ref'd - */ -DBusGMessage* -dbus_g_message_ref (DBusGMessage *gmessage) -{ - DBusMessage *c; - - c = DBUS_MESSAGE_FROM_G_MESSAGE (gmessage); - dbus_message_ref (c); - return gmessage; -} - -/** - * Decrement refcount on a #DBusGMessage - * - * @param gmessage the message to unref - */ -void -dbus_g_message_unref (DBusGMessage *gmessage) -{ - DBusMessage *c; - - c = DBUS_MESSAGE_FROM_G_MESSAGE (gmessage); - dbus_message_unref (c); -} - -/** - * The implementation of DBUS_GERROR error domain. See documentation - * for GError in GLib reference manual. - * - * @returns the error domain quark for use with GError - */ -GQuark -dbus_g_error_quark (void) -{ - static GQuark quark = 0; - if (quark == 0) - quark = g_quark_from_static_string ("g-exec-error-quark"); - return quark; -} - -/** - * Determine whether D-BUS error name for a remote exception matches - * the given name. This function is intended to be invoked on a - * GError returned from an invocation of a remote method, e.g. via - * dbus_g_proxy_end_call. It will silently return FALSE for errors - * which are not remote D-BUS exceptions (i.e. with a domain other - * than DBUS_GERROR or a code other than - * DBUS_GERROR_REMOTE_EXCEPTION). - * - * @param error the GError given from the remote method - * @param name the D-BUS error name - * @param msg the D-BUS error detailed message - * @returns TRUE iff the remote error has the given name - */ -gboolean -dbus_g_error_has_name (GError *error, const char *name) -{ - g_return_val_if_fail (error != NULL, FALSE); - - if (error->domain != DBUS_GERROR - || error->code != DBUS_GERROR_REMOTE_EXCEPTION) - return FALSE; - - return !strcmp (dbus_g_error_get_name (error), name); -} - -/** - * Return the D-BUS name for a remote exception. - * This function may only be invoked on a GError returned from an - * invocation of a remote method, e.g. via dbus_g_proxy_end_call. - * Moreover, you must ensure that the error's domain is DBUS_GERROR, - * and the code is DBUS_GERROR_REMOTE_EXCEPTION. - * - * @param error the GError given from the remote method - * @param name the D-BUS error name - * @param msg the D-BUS error detailed message - * @returns the D-BUS error name - */ -const char * -dbus_g_error_get_name (GError *error) -{ - g_return_val_if_fail (error != NULL, NULL); - g_return_val_if_fail (error->domain == DBUS_GERROR, NULL); - g_return_val_if_fail (error->code == DBUS_GERROR_REMOTE_EXCEPTION, NULL); - - return error->message + strlen (error->message) + 1; -} - -/** - * Get the GLib type ID for a DBusConnection boxed type. - * - * @returns GLib type - */ -GType -dbus_connection_get_g_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ("DBusConnection", - (GBoxedCopyFunc) dbus_connection_ref, - (GBoxedFreeFunc) dbus_connection_unref); - - return our_type; -} - -/** - * Get the GLib type ID for a DBusMessage boxed type. - * - * @returns GLib type - */ -GType -dbus_message_get_g_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ("DBusMessage", - (GBoxedCopyFunc) dbus_message_ref, - (GBoxedFreeFunc) dbus_message_unref); - - return our_type; -} - -/** - * Get the GLib type ID for a DBusGConnection boxed type. - * - * @returns GLib type - */ -GType -dbus_g_connection_get_g_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ("DBusGConnection", - (GBoxedCopyFunc) dbus_g_connection_ref, - (GBoxedFreeFunc) dbus_g_connection_unref); - - return our_type; -} - -/** - * Get the GLib type ID for a DBusGMessage boxed type. - * - * @returns GLib type - */ -GType -dbus_g_message_get_g_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ("DBusGMessage", - (GBoxedCopyFunc) dbus_g_message_ref, - (GBoxedFreeFunc) dbus_g_message_unref); - - return our_type; -} - -/** - * Get the DBusConnection corresponding to this DBusGConnection. - * The return value does not have its refcount incremented. - * - * @returns DBusConnection - */ -DBusConnection* -dbus_g_connection_get_connection (DBusGConnection *gconnection) -{ - return DBUS_CONNECTION_FROM_G_CONNECTION (gconnection); -} - -/** - * Get the DBusMessage corresponding to this DBusGMessage. - * The return value does not have its refcount incremented. - * - * @returns DBusMessage - */ -DBusMessage* -dbus_g_message_get_message (DBusGMessage *gmessage) -{ - return DBUS_MESSAGE_FROM_G_MESSAGE (gmessage); -} - -/** @} */ /* end of public API */ - - -#ifdef DBUS_BUILD_TESTS - -/** - * @ingroup DBusGLibInternals - * Unit test for general glib stuff - * @returns #TRUE on success. - */ -gboolean -_dbus_glib_test (const char *test_data_dir) -{ - DBusError err; - GError *gerror = NULL; - - dbus_error_init (&err); - dbus_set_error_const (&err, DBUS_ERROR_NO_MEMORY, "Out of memory!"); - - dbus_set_g_error (&gerror, &err); - g_assert (gerror != NULL); - g_assert (gerror->domain == DBUS_GERROR); - g_assert (gerror->code == DBUS_GERROR_NO_MEMORY); - g_assert (!strcmp (gerror->message, "Out of memory!")); - - dbus_error_init (&err); - g_clear_error (&gerror); - - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-gloader-expat.c b/glib/dbus-gloader-expat.c deleted file mode 100644 index 609f3164..00000000 --- a/glib/dbus-gloader-expat.c +++ /dev/null @@ -1,266 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gloader-expat.c expat XML loader - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "dbus-gparser.h" -#include -#include - -static void* -expat_g_malloc (size_t sz) -{ - return g_malloc (sz); -} - -static void* -expat_g_realloc (void *mem, size_t sz) -{ - return g_realloc (mem, sz); -} - -static XML_Memory_Handling_Suite memsuite = -{ - expat_g_malloc, - expat_g_realloc, - g_free -}; - -/** - * Context for Expat parser for introspection data. - */ -typedef struct -{ - Parser *parser; /**< The parser for the introspection data */ - const char *filename; /**< The filename being loaded */ - GString *content; /**< The content of the current element */ - GError **error; /**< Error return location */ - gboolean failed; /**< True if parse has failed */ -} ExpatParseContext; - -static dbus_bool_t -process_content (ExpatParseContext *context) -{ - if (context->failed) - return FALSE; - - if (context->content->len > 0) - { - if (!parser_content (context->parser, - context->content->str, - context->content->len, - context->error)) - { - context->failed = TRUE; - return FALSE; - } - g_string_set_size (context->content, 0); - } - - return TRUE; -} - -static void -expat_StartElementHandler (void *userData, - const XML_Char *name, - const XML_Char **atts) -{ - ExpatParseContext *context = userData; - int i; - char **names; - char **values; - - /* Expat seems to suck and can't abort the parse if we - * throw an error. Expat 2.0 is supposed to fix this. - */ - if (context->failed) - return; - - if (!process_content (context)) - return; - - /* "atts" is key, value, key, value, NULL */ - for (i = 0; atts[i] != NULL; ++i) - ; /* nothing */ - - g_assert (i % 2 == 0); - names = g_new0 (char *, i / 2 + 1); - values = g_new0 (char *, i / 2 + 1); - - i = 0; - while (atts[i] != NULL) - { - g_assert (i % 2 == 0); - names [i / 2] = (char*) atts[i]; - values[i / 2] = (char*) atts[i+1]; - - i += 2; - } - - if (!parser_start_element (context->parser, - name, - (const char **) names, - (const char **) values, - context->error)) - { - g_free (names); - g_free (values); - context->failed = TRUE; - return; - } - - g_free (names); - g_free (values); -} - -static void -expat_EndElementHandler (void *userData, - const XML_Char *name) -{ - ExpatParseContext *context = userData; - - if (!process_content (context)) - return; - - if (!parser_end_element (context->parser, - name, - context->error)) - { - context->failed = TRUE; - return; - } -} - -/* s is not 0 terminated. */ -static void -expat_CharacterDataHandler (void *userData, - const XML_Char *s, - int len) -{ - ExpatParseContext *context = userData; - - if (context->failed) - return; - - g_string_append_len (context->content, - s, len); -} - -NodeInfo* -description_load_from_file (const char *filename, - GError **error) -{ - char *contents; - gsize len; - NodeInfo *nodes; - - contents = NULL; - if (!g_file_get_contents (filename, &contents, &len, error)) - return NULL; - - nodes = description_load_from_string (contents, len, error); - g_free (contents); - - return nodes; -} - -NodeInfo* -description_load_from_string (const char *str, - int len, - GError **error) -{ - XML_Parser expat; - ExpatParseContext context; - NodeInfo *nodes; - - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - if (len < 0) - len = strlen (str); - - expat = NULL; - context.parser = NULL; - context.error = error; - context.failed = FALSE; - - expat = XML_ParserCreate_MM ("UTF-8", &memsuite, NULL); - if (expat == NULL) - g_error ("No memory to create XML parser\n"); - - context.parser = parser_new (); - context.content = g_string_new (NULL); - - XML_SetUserData (expat, &context); - XML_SetElementHandler (expat, - expat_StartElementHandler, - expat_EndElementHandler); - XML_SetCharacterDataHandler (expat, - expat_CharacterDataHandler); - - if (!XML_Parse (expat, str, len, TRUE)) - { - if (context.error != NULL && - *context.error == NULL) - { - enum XML_Error e; - - e = XML_GetErrorCode (expat); - if (e == XML_ERROR_NO_MEMORY) - g_error ("Not enough memory to parse XML document"); - else - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - "Error in D-BUS description XML, line %d, column %d: %s\n", - XML_GetCurrentLineNumber (expat), - XML_GetCurrentColumnNumber (expat), - XML_ErrorString (e)); - } - - goto failed; - } - - if (context.failed) - goto failed; - - if (!parser_finished (context.parser, error)) - goto failed; - - XML_ParserFree (expat); - g_string_free (context.content, TRUE); - - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - nodes = parser_get_nodes (context.parser); - node_info_ref (nodes); - parser_unref (context.parser); - return nodes; - - failed: - g_return_val_if_fail (error == NULL || *error != NULL, NULL); - - g_string_free (context.content, TRUE); - if (expat) - XML_ParserFree (expat); - if (context.parser) - parser_unref (context.parser); - return NULL; -} - diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c deleted file mode 100644 index 54f868dd..00000000 --- a/glib/dbus-gmain.c +++ /dev/null @@ -1,814 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gmain.c GLib main loop integration - * - * Copyright (C) 2002, 2003 CodeFactory AB - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include "dbus-gtest.h" -#include "dbus-gutils.h" -#include "dbus-gvalue.h" -#include "dbus-gobject.h" -#include "dbus-gvalue-utils.h" -#include "dbus-gsignature.h" -#include - -#include -#define _(x) dgettext (GETTEXT_PACKAGE, x) -#define N_(x) x - -/** - * @defgroup DBusGLib GLib bindings - * @brief API for using D-BUS with GLib - * - * libdbus proper is a low-level API, these GLib bindings wrap libdbus - * with a much higher-level approach. The higher level approach is - * possible because GLib defines a main loop, an object/type system, - * and an out-of-memory handling policy (it exits the program). - * See http://www.gtk.org for GLib information. - * - * To manipulate remote objects, use #DBusGProxy. - */ - -/** - * @defgroup DBusGLibInternals GLib bindings implementation details - * @ingroup DBusInternals - * @brief Implementation details of GLib bindings - * - * @{ - */ - -/** - * A GSource subclass for dispatching DBusConnection messages. - * We need this on top of the IO handlers, because sometimes - * there are messages to dispatch queued up but no IO pending. - */ -typedef struct -{ - GSource source; /**< the parent GSource */ - DBusConnection *connection; /**< the connection to dispatch */ -} DBusGMessageQueue; - -static gboolean message_queue_prepare (GSource *source, - gint *timeout); -static gboolean message_queue_check (GSource *source); -static gboolean message_queue_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data); - -static const GSourceFuncs message_queue_funcs = { - message_queue_prepare, - message_queue_check, - message_queue_dispatch, - NULL -}; - -static gboolean -message_queue_prepare (GSource *source, - gint *timeout) -{ - DBusConnection *connection = ((DBusGMessageQueue *)source)->connection; - - *timeout = -1; - - return (dbus_connection_get_dispatch_status (connection) == DBUS_DISPATCH_DATA_REMAINS); -} - -static gboolean -message_queue_check (GSource *source) -{ - return FALSE; -} - -static gboolean -message_queue_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data) -{ - DBusConnection *connection = ((DBusGMessageQueue *)source)->connection; - - dbus_connection_ref (connection); - - /* Only dispatch once - we don't want to starve other GSource */ - dbus_connection_dispatch (connection); - - dbus_connection_unref (connection); - - return TRUE; -} - -typedef struct -{ - GMainContext *context; /**< the main context */ - GSList *ios; /**< all IOHandler */ - GSList *timeouts; /**< all TimeoutHandler */ - DBusConnection *connection; /**< NULL if this is really for a server not a connection */ - GSource *message_queue_source; /**< DBusGMessageQueue */ -} ConnectionSetup; - - -typedef struct -{ - ConnectionSetup *cs; - GSource *source; - DBusWatch *watch; -} IOHandler; - -typedef struct -{ - ConnectionSetup *cs; - GSource *source; - DBusTimeout *timeout; -} TimeoutHandler; - -static dbus_int32_t connection_slot = -1; -static dbus_int32_t server_slot = -1; - -static ConnectionSetup* -connection_setup_new (GMainContext *context, - DBusConnection *connection) -{ - ConnectionSetup *cs; - - cs = g_new0 (ConnectionSetup, 1); - - g_assert (context != NULL); - - cs->context = context; - g_main_context_ref (cs->context); - - if (connection) - { - cs->connection = connection; - - cs->message_queue_source = g_source_new (&message_queue_funcs, - sizeof (DBusGMessageQueue)); - ((DBusGMessageQueue*)cs->message_queue_source)->connection = connection; - g_source_attach (cs->message_queue_source, cs->context); - } - - return cs; -} - -static void -io_handler_source_finalized (gpointer data) -{ - IOHandler *handler; - - handler = data; - - if (handler->watch) - dbus_watch_set_data (handler->watch, NULL, NULL); - - g_free (handler); -} - -static void -io_handler_destroy_source (void *data) -{ - IOHandler *handler; - - handler = data; - - if (handler->source) - { - GSource *source = handler->source; - handler->source = NULL; - handler->cs->ios = g_slist_remove (handler->cs->ios, handler); - g_source_destroy (source); - g_source_unref (source); - } -} - -static void -io_handler_watch_freed (void *data) -{ - IOHandler *handler; - - handler = data; - - handler->watch = NULL; - - io_handler_destroy_source (handler); -} - -static gboolean -io_handler_dispatch (GIOChannel *source, - GIOCondition condition, - gpointer data) -{ - IOHandler *handler; - guint dbus_condition = 0; - DBusConnection *connection; - - handler = data; - - connection = handler->cs->connection; - - if (connection) - dbus_connection_ref (connection); - - if (condition & G_IO_IN) - dbus_condition |= DBUS_WATCH_READABLE; - if (condition & G_IO_OUT) - dbus_condition |= DBUS_WATCH_WRITABLE; - if (condition & G_IO_ERR) - dbus_condition |= DBUS_WATCH_ERROR; - if (condition & G_IO_HUP) - dbus_condition |= DBUS_WATCH_HANGUP; - - /* Note that we don't touch the handler after this, because - * dbus may have disabled the watch and thus killed the - * handler. - */ - dbus_watch_handle (handler->watch, dbus_condition); - handler = NULL; - - if (connection) - dbus_connection_unref (connection); - - return TRUE; -} - -static void -connection_setup_add_watch (ConnectionSetup *cs, - DBusWatch *watch) -{ - guint flags; - GIOCondition condition; - GIOChannel *channel; - IOHandler *handler; - - if (!dbus_watch_get_enabled (watch)) - return; - - g_assert (dbus_watch_get_data (watch) == NULL); - - flags = dbus_watch_get_flags (watch); - - condition = G_IO_ERR | G_IO_HUP; - if (flags & DBUS_WATCH_READABLE) - condition |= G_IO_IN; - if (flags & DBUS_WATCH_WRITABLE) - condition |= G_IO_OUT; - - handler = g_new0 (IOHandler, 1); - handler->cs = cs; - handler->watch = watch; - - channel = g_io_channel_unix_new (dbus_watch_get_fd (watch)); - - handler->source = g_io_create_watch (channel, condition); - g_source_set_callback (handler->source, (GSourceFunc) io_handler_dispatch, handler, - io_handler_source_finalized); - g_source_attach (handler->source, cs->context); - - cs->ios = g_slist_prepend (cs->ios, handler); - - dbus_watch_set_data (watch, handler, io_handler_watch_freed); - g_io_channel_unref (channel); -} - -static void -connection_setup_remove_watch (ConnectionSetup *cs, - DBusWatch *watch) -{ - IOHandler *handler; - - handler = dbus_watch_get_data (watch); - - if (handler == NULL) - return; - - io_handler_destroy_source (handler); -} - -static void -timeout_handler_source_finalized (gpointer data) -{ - TimeoutHandler *handler; - - handler = data; - - if (handler->timeout) - dbus_timeout_set_data (handler->timeout, NULL, NULL); - - g_free (handler); -} - -static void -timeout_handler_destroy_source (void *data) -{ - TimeoutHandler *handler; - - handler = data; - - if (handler->source) - { - GSource *source = handler->source; - handler->source = NULL; - handler->cs->timeouts = g_slist_remove (handler->cs->timeouts, handler); - g_source_destroy (source); - g_source_unref (source); - } -} - -static void -timeout_handler_timeout_freed (void *data) -{ - TimeoutHandler *handler; - - handler = data; - - handler->timeout = NULL; - - timeout_handler_destroy_source (handler); -} - -static gboolean -timeout_handler_dispatch (gpointer data) -{ - TimeoutHandler *handler; - - handler = data; - - dbus_timeout_handle (handler->timeout); - - return TRUE; -} - -static void -connection_setup_add_timeout (ConnectionSetup *cs, - DBusTimeout *timeout) -{ - TimeoutHandler *handler; - - if (!dbus_timeout_get_enabled (timeout)) - return; - - g_assert (dbus_timeout_get_data (timeout) == NULL); - - handler = g_new0 (TimeoutHandler, 1); - handler->cs = cs; - handler->timeout = timeout; - - handler->source = g_timeout_source_new (dbus_timeout_get_interval (timeout)); - g_source_set_callback (handler->source, timeout_handler_dispatch, handler, - timeout_handler_source_finalized); - g_source_attach (handler->source, handler->cs->context); - - cs->timeouts = g_slist_prepend (cs->timeouts, handler); - - dbus_timeout_set_data (timeout, handler, timeout_handler_timeout_freed); -} - -static void -connection_setup_remove_timeout (ConnectionSetup *cs, - DBusTimeout *timeout) -{ - TimeoutHandler *handler; - - handler = dbus_timeout_get_data (timeout); - - if (handler == NULL) - return; - - timeout_handler_destroy_source (handler); -} - -static void -connection_setup_free (ConnectionSetup *cs) -{ - while (cs->ios) - io_handler_destroy_source (cs->ios->data); - - while (cs->timeouts) - timeout_handler_destroy_source (cs->timeouts->data); - - if (cs->message_queue_source) - { - GSource *source; - - source = cs->message_queue_source; - cs->message_queue_source = NULL; - - g_source_destroy (source); - g_source_unref (source); - } - - g_main_context_unref (cs->context); - g_free (cs); -} - -static dbus_bool_t -add_watch (DBusWatch *watch, - gpointer data) -{ - ConnectionSetup *cs; - - cs = data; - - connection_setup_add_watch (cs, watch); - - return TRUE; -} - -static void -remove_watch (DBusWatch *watch, - gpointer data) -{ - ConnectionSetup *cs; - - cs = data; - - connection_setup_remove_watch (cs, watch); -} - -static void -watch_toggled (DBusWatch *watch, - void *data) -{ - /* Because we just exit on OOM, enable/disable is - * no different from add/remove - */ - if (dbus_watch_get_enabled (watch)) - add_watch (watch, data); - else - remove_watch (watch, data); -} - -static dbus_bool_t -add_timeout (DBusTimeout *timeout, - void *data) -{ - ConnectionSetup *cs; - - cs = data; - - if (!dbus_timeout_get_enabled (timeout)) - return TRUE; - - connection_setup_add_timeout (cs, timeout); - - return TRUE; -} - -static void -remove_timeout (DBusTimeout *timeout, - void *data) -{ - ConnectionSetup *cs; - - cs = data; - - connection_setup_remove_timeout (cs, timeout); -} - -static void -timeout_toggled (DBusTimeout *timeout, - void *data) -{ - /* Because we just exit on OOM, enable/disable is - * no different from add/remove - */ - if (dbus_timeout_get_enabled (timeout)) - add_timeout (timeout, data); - else - remove_timeout (timeout, data); -} - -static void -wakeup_main (void *data) -{ - ConnectionSetup *cs = data; - - g_main_context_wakeup (cs->context); -} - - -/* Move to a new context */ -static ConnectionSetup* -connection_setup_new_from_old (GMainContext *context, - ConnectionSetup *old) -{ - GSList *tmp; - ConnectionSetup *cs; - - g_assert (old->context != context); - - cs = connection_setup_new (context, old->connection); - - tmp = old->ios; - while (tmp != NULL) - { - IOHandler *handler = tmp->data; - - connection_setup_add_watch (cs, handler->watch); - - tmp = tmp->next; - } - - tmp = old->timeouts; - while (tmp != NULL) - { - TimeoutHandler *handler = tmp->data; - - connection_setup_add_timeout (cs, handler->timeout); - - tmp = tmp->next; - } - - return cs; -} - -/** @} */ /* End of GLib bindings internals */ - -/** @addtogroup DBusGLib - * @{ - */ - -/** - * Sets the watch and timeout functions of a #DBusConnection - * to integrate the connection with the GLib main loop. - * Pass in #NULL for the #GMainContext unless you're - * doing something specialized. - * - * If called twice for the same context, does nothing the second - * time. If called once with context A and once with context B, - * context B replaces context A as the context monitoring the - * connection. - * - * @param connection the connection - * @param context the #GMainContext or #NULL for default context - */ -void -dbus_connection_setup_with_g_main (DBusConnection *connection, - GMainContext *context) -{ - ConnectionSetup *old_setup; - ConnectionSetup *cs; - - /* FIXME we never free the slot, so its refcount just keeps growing, - * which is kind of broken. - */ - dbus_connection_allocate_data_slot (&connection_slot); - if (connection_slot < 0) - goto nomem; - - if (context == NULL) - context = g_main_context_default (); - - cs = NULL; - - old_setup = dbus_connection_get_data (connection, connection_slot); - if (old_setup != NULL) - { - if (old_setup->context == context) - return; /* nothing to do */ - - cs = connection_setup_new_from_old (context, old_setup); - - /* Nuke the old setup */ - dbus_connection_set_data (connection, connection_slot, NULL, NULL); - old_setup = NULL; - } - - if (cs == NULL) - cs = connection_setup_new (context, connection); - - if (!dbus_connection_set_data (connection, connection_slot, cs, - (DBusFreeFunction)connection_setup_free)) - goto nomem; - - if (!dbus_connection_set_watch_functions (connection, - add_watch, - remove_watch, - watch_toggled, - cs, NULL)) - goto nomem; - - if (!dbus_connection_set_timeout_functions (connection, - add_timeout, - remove_timeout, - timeout_toggled, - cs, NULL)) - goto nomem; - - dbus_connection_set_wakeup_main_function (connection, - wakeup_main, - cs, NULL); - - return; - - nomem: - g_error ("Not enough memory to set up DBusConnection for use with GLib"); -} - -/** - * Sets the watch and timeout functions of a #DBusServer - * to integrate the server with the GLib main loop. - * In most cases the context argument should be #NULL. - * - * If called twice for the same context, does nothing the second - * time. If called once with context A and once with context B, - * context B replaces context A as the context monitoring the - * connection. - * - * @param server the server - * @param context the #GMainContext or #NULL for default - */ -void -dbus_server_setup_with_g_main (DBusServer *server, - GMainContext *context) -{ - ConnectionSetup *old_setup; - ConnectionSetup *cs; - - /* FIXME we never free the slot, so its refcount just keeps growing, - * which is kind of broken. - */ - dbus_server_allocate_data_slot (&server_slot); - if (server_slot < 0) - goto nomem; - - if (context == NULL) - context = g_main_context_default (); - - cs = NULL; - - old_setup = dbus_server_get_data (server, server_slot); - if (old_setup != NULL) - { - if (old_setup->context == context) - return; /* nothing to do */ - - cs = connection_setup_new_from_old (context, old_setup); - - /* Nuke the old setup */ - dbus_server_set_data (server, server_slot, NULL, NULL); - old_setup = NULL; - } - - if (cs == NULL) - cs = connection_setup_new (context, NULL); - - if (!dbus_server_set_data (server, server_slot, cs, - (DBusFreeFunction)connection_setup_free)) - goto nomem; - - if (!dbus_server_set_watch_functions (server, - add_watch, - remove_watch, - watch_toggled, - cs, NULL)) - goto nomem; - - if (!dbus_server_set_timeout_functions (server, - add_timeout, - remove_timeout, - timeout_toggled, - cs, NULL)) - goto nomem; - - return; - - nomem: - g_error ("Not enough memory to set up DBusServer for use with GLib"); -} - -/** - * Returns a connection to the given address. - * - * (Internally, calls dbus_connection_open() then calls - * dbus_connection_setup_with_g_main() on the result.) - * - * @param address address of the connection to open - * @param error address where an error can be returned. - * @returns a DBusConnection - */ -DBusGConnection* -dbus_g_connection_open (const gchar *address, - GError **error) -{ - DBusConnection *connection; - DBusError derror; - - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - _dbus_g_value_types_init (); - - dbus_error_init (&derror); - - connection = dbus_connection_open (address, &derror); - if (connection == NULL) - { - dbus_set_g_error (error, &derror); - dbus_error_free (&derror); - return NULL; - } - - /* does nothing if it's already been done */ - dbus_connection_setup_with_g_main (connection, NULL); - - return DBUS_G_CONNECTION_FROM_CONNECTION (connection); -} - -/** - * Returns a connection to the given bus. The connection is a global variable - * shared with other callers of this function. - * - * (Internally, calls dbus_bus_get() then calls - * dbus_connection_setup_with_g_main() on the result.) - * - * @param type bus type - * @param error address where an error can be returned. - * @returns a DBusConnection - */ -DBusGConnection* -dbus_g_bus_get (DBusBusType type, - GError **error) -{ - DBusConnection *connection; - DBusError derror; - - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - _dbus_g_value_types_init (); - - dbus_error_init (&derror); - - connection = dbus_bus_get (type, &derror); - if (connection == NULL) - { - dbus_set_g_error (error, &derror); - dbus_error_free (&derror); - return NULL; - } - - /* does nothing if it's already been done */ - dbus_connection_setup_with_g_main (connection, NULL); - - return DBUS_G_CONNECTION_FROM_CONNECTION (connection); -} - -/** @} */ /* end of public API */ - -#ifdef DBUS_BUILD_TESTS - -/** - * @ingroup DBusGLibInternals - * Unit test for GLib main loop integration - * @returns #TRUE on success. - */ -gboolean -_dbus_gmain_test (const char *test_data_dir) -{ - GType type; - GType rectype; - - g_type_init (); - _dbus_g_value_types_init (); - - rectype = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); - g_assert (rectype != G_TYPE_INVALID); - g_assert (!strcmp (g_type_name (rectype), "GArray_guint_")); - - type = _dbus_gtype_from_signature ("au", TRUE); - g_assert (type == rectype); - - rectype = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); - g_assert (rectype != G_TYPE_INVALID); - g_assert (!strcmp (g_type_name (rectype), "GHashTable_gchararray+gchararray_")); - - type = _dbus_gtype_from_signature ("a{ss}", TRUE); - g_assert (type == rectype); - - type = _dbus_gtype_from_signature ("o", FALSE); - g_assert (type == DBUS_TYPE_G_OBJECT_PATH); - type = _dbus_gtype_from_signature ("o", TRUE); - g_assert (type == DBUS_TYPE_G_OBJECT_PATH); - - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-gmarshal.c b/glib/dbus-gmarshal.c deleted file mode 100644 index 13e98b19..00000000 --- a/glib/dbus-gmarshal.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "dbus-gmarshal.h" - -#include - - -#ifdef G_ENABLE_DEBUG -#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) -#define g_marshal_value_peek_char(v) g_value_get_char (v) -#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) -#define g_marshal_value_peek_int(v) g_value_get_int (v) -#define g_marshal_value_peek_uint(v) g_value_get_uint (v) -#define g_marshal_value_peek_long(v) g_value_get_long (v) -#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) -#define g_marshal_value_peek_int64(v) g_value_get_int64 (v) -#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) -#define g_marshal_value_peek_enum(v) g_value_get_enum (v) -#define g_marshal_value_peek_flags(v) g_value_get_flags (v) -#define g_marshal_value_peek_float(v) g_value_get_float (v) -#define g_marshal_value_peek_double(v) g_value_get_double (v) -#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) -#define g_marshal_value_peek_param(v) g_value_get_param (v) -#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) -#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) -#define g_marshal_value_peek_object(v) g_value_get_object (v) -#else /* !G_ENABLE_DEBUG */ -/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. - * Do not access GValues directly in your code. Instead, use the - * g_value_get_*() functions - */ -#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int -#define g_marshal_value_peek_char(v) (v)->data[0].v_int -#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint -#define g_marshal_value_peek_int(v) (v)->data[0].v_int -#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint -#define g_marshal_value_peek_long(v) (v)->data[0].v_long -#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 -#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 -#define g_marshal_value_peek_enum(v) (v)->data[0].v_long -#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong -#define g_marshal_value_peek_float(v) (v)->data[0].v_float -#define g_marshal_value_peek_double(v) (v)->data[0].v_double -#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer -#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer -#endif /* !G_ENABLE_DEBUG */ - - -/* NONE:STRING,STRING,STRING (dbus-gmarshal.list:1) */ -void -_dbus_g_marshal_VOID__STRING_STRING_STRING (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__STRING_STRING_STRING) (gpointer data1, - gpointer arg_1, - gpointer arg_2, - gpointer arg_3, - gpointer data2); - register GMarshalFunc_VOID__STRING_STRING_STRING callback; - register GCClosure *cc = (GCClosure*) closure; - register gpointer data1, data2; - - g_return_if_fail (n_param_values == 4); - - if (G_CCLOSURE_SWAP_DATA (closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer (param_values + 0); - } - else - { - data1 = g_value_peek_pointer (param_values + 0); - data2 = closure->data; - } - callback = (GMarshalFunc_VOID__STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_string (param_values + 1), - g_marshal_value_peek_string (param_values + 2), - g_marshal_value_peek_string (param_values + 3), - data2); -} - diff --git a/glib/dbus-gmarshal.h b/glib/dbus-gmarshal.h deleted file mode 100644 index 2cdb3d7e..00000000 --- a/glib/dbus-gmarshal.h +++ /dev/null @@ -1,21 +0,0 @@ - -#ifndef ___dbus_g_marshal_MARSHAL_H__ -#define ___dbus_g_marshal_MARSHAL_H__ - -#include - -G_BEGIN_DECLS - -/* NONE:STRING,STRING,STRING (dbus-gmarshal.list:1) */ -extern void _dbus_g_marshal_VOID__STRING_STRING_STRING (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); -#define _dbus_g_marshal_NONE__STRING_STRING_STRING _dbus_g_marshal_VOID__STRING_STRING_STRING - -G_END_DECLS - -#endif /* ___dbus_g_marshal_MARSHAL_H__ */ - diff --git a/glib/dbus-gmarshal.list b/glib/dbus-gmarshal.list deleted file mode 100644 index 12974e24..00000000 --- a/glib/dbus-gmarshal.list +++ /dev/null @@ -1 +0,0 @@ -NONE:STRING,STRING,STRING diff --git a/glib/dbus-gobject.c b/glib/dbus-gobject.c deleted file mode 100644 index 1427a34e..00000000 --- a/glib/dbus-gobject.c +++ /dev/null @@ -1,2217 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gobject.c Exporting a GObject remotely - * - * Copyright (C) 2003, 2004, 2005 Red Hat, Inc. - * Copyright (C) 2005 Nokia - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include "dbus-gtest.h" -#include "dbus-gutils.h" -#include "dbus-gobject.h" -#include "dbus-gsignature.h" -#include "dbus-gvalue.h" -#include "dbus-gmarshal.h" -#include "dbus-gvalue-utils.h" -#include - -/** - * @addtogroup DBusGLibInternals - * @{ - */ - -typedef struct -{ - char *default_iface; - GType code_enum; -} DBusGErrorInfo; - -static GStaticRWLock globals_lock = G_STATIC_RW_LOCK_INIT; -static GHashTable *marshal_table = NULL; -static GData *error_metadata = NULL; - -static char* -uscore_to_wincaps (const char *uscore) -{ - const char *p; - GString *str; - gboolean last_was_uscore; - - last_was_uscore = TRUE; - - str = g_string_new (NULL); - p = uscore; - while (*p) - { - if (*p == '-' || *p == '_') - { - last_was_uscore = TRUE; - } - else - { - if (last_was_uscore) - { - g_string_append_c (str, g_ascii_toupper (*p)); - last_was_uscore = FALSE; - } - else - g_string_append_c (str, *p); - } - ++p; - } - - return g_string_free (str, FALSE); -} - -static const char * -string_table_next (const char *table) -{ - return (table + (strlen (table) + 1)); -} - -static const char * -string_table_lookup (const char *table, int index) -{ - const char *ret; - - ret = table; - - while (index--) - ret = string_table_next (ret); - - return ret; -} - -static const char * -get_method_data (const DBusGObjectInfo *object, - const DBusGMethodInfo *method) -{ - return object->data + method->data_offset; -} - -static char * -object_error_domain_prefix_from_object_info (const DBusGObjectInfo *info) -{ - /* FIXME */ - return NULL; -} - -static char * -object_error_code_from_object_info (const DBusGObjectInfo *info, GQuark domain, gint code) -{ - /* FIXME */ - return NULL; -} - -static const char * -method_interface_from_object_info (const DBusGObjectInfo *object, - const DBusGMethodInfo *method) -{ - return string_table_lookup (get_method_data (object, method), 0); -} - -static const char * -method_name_from_object_info (const DBusGObjectInfo *object, - const DBusGMethodInfo *method) -{ - return string_table_lookup (get_method_data (object, method), 1); -} - -static const char * -method_arg_info_from_object_info (const DBusGObjectInfo *object, - const DBusGMethodInfo *method) -{ - return string_table_lookup (get_method_data (object, method), 3);/*RB was 2*/ -} - -typedef enum -{ - RETVAL_NONE, - RETVAL_NOERROR, - RETVAL_ERROR -} RetvalType; - -static const char * -arg_iterate (const char *data, - const char **name, - gboolean *in, - gboolean *constval, - RetvalType *retval, - const char **type) -{ - gboolean inarg; - - if (name) - *name = data; - - data = string_table_next (data); - switch (*data) - { - case 'I': - inarg = TRUE; - break; - case 'O': - inarg = FALSE; - break; - default: - g_warning ("invalid arg direction '%c'", *data); - inarg = FALSE; - break; - } - if (in) - *in = inarg; - - if (!inarg) - { - data = string_table_next (data); - switch (*data) - { - case 'F': - if (constval) - *constval = FALSE; - break; - case 'C': - if (constval) - *constval = TRUE; - break; - default: - g_warning ("invalid arg const value '%c'", *data); - break; - } - data = string_table_next (data); - switch (*data) - { - case 'N': - if (retval) - *retval = RETVAL_NONE; - break; - case 'E': - if (retval) - *retval = RETVAL_ERROR; - break; - case 'R': - if (retval) - *retval = RETVAL_NOERROR; - break; - default: - g_warning ("invalid arg ret value '%c'", *data); - break; - } - } - else - { - if (constval) - *constval = FALSE; - if (retval) - *retval = FALSE; - } - - data = string_table_next (data); - if (type) - *type = data; - - return string_table_next (data); -} - -static char * -method_dir_signature_from_object_info (const DBusGObjectInfo *object, - const DBusGMethodInfo *method, - gboolean in) -{ - const char *arg; - GString *ret; - - arg = method_arg_info_from_object_info (object, method); - - ret = g_string_new (NULL); - - while (*arg) - { - const char *name; - gboolean arg_in; - const char *type; - - arg = arg_iterate (arg, &name, &arg_in, NULL, NULL, &type); - - if (arg_in == in) - g_string_append (ret, type); - } - - return g_string_free (ret, FALSE); -} - -static char * -method_input_signature_from_object_info (const DBusGObjectInfo *object, - const DBusGMethodInfo *method) -{ - return method_dir_signature_from_object_info (object, method, TRUE); -} - -static char * -method_output_signature_from_object_info (const DBusGObjectInfo *object, - const DBusGMethodInfo *method) -{ - return method_dir_signature_from_object_info (object, method, FALSE); -} - -static const char * -propsig_iterate (const char *data, const char **iface, const char **name) -{ - *iface = data; - - data = string_table_next (data); - *name = data; - - return string_table_next (data); -} - -static GQuark -dbus_g_object_type_dbus_metadata_quark (void) -{ - static GQuark quark; - - if (!quark) - quark = g_quark_from_static_string ("DBusGObjectTypeDBusMetadataQuark"); - return quark; -} - -static const DBusGObjectInfo * -lookup_object_info (GObject *object) -{ - const DBusGObjectInfo *ret; - GType classtype; - - ret = NULL; - - for (classtype = G_TYPE_FROM_INSTANCE (object); classtype != 0; classtype = g_type_parent (classtype)) - { - const DBusGObjectInfo *info; - - info = g_type_get_qdata (classtype, dbus_g_object_type_dbus_metadata_quark ()); - - if (info != NULL && info->format_version >= 0) - { - ret = info; - break; - } - } - - return ret; -} - -static void -gobject_unregister_function (DBusConnection *connection, - void *user_data) -{ - GObject *object; - - object = G_OBJECT (user_data); - - /* FIXME */ - -} - -typedef struct -{ - GString *xml; - GType gtype; - const DBusGObjectInfo *object_info; -} DBusGLibWriteIterfaceData; - -typedef struct -{ - GSList *methods; - GSList *signals; - GSList *properties; -} DBusGLibWriteInterfaceValues; - -static void -write_interface (gpointer key, gpointer val, gpointer user_data) -{ - const char *name; - GSList *methods; - GSList *signals; - GSList *properties; - GString *xml; - const DBusGObjectInfo *object_info; - DBusGLibWriteIterfaceData *data; - DBusGLibWriteInterfaceValues *values; - - name = key; - - values = val; - methods = values->methods; - signals = values->signals; - properties = values->properties; - - data = user_data; - xml = data->xml; - object_info = data->object_info; - - g_string_append_printf (xml, " \n", name); - - /* FIXME: recurse to parent types ? */ - for (; methods; methods = methods->next) - { - DBusGMethodInfo *method; - const char *args; - method = methods->data; - - g_string_append_printf (xml, " \n", - method_name_from_object_info (object_info, method)); - - args = method_arg_info_from_object_info (object_info, method); - - while (*args) - { - const char *name; - gboolean arg_in; - const char *type; - - args = arg_iterate (args, &name, &arg_in, NULL, NULL, &type); - - /* FIXME - handle container types */ - g_string_append_printf (xml, " \n", - name, type, arg_in ? "in" : "out"); - - } - g_string_append (xml, " \n"); - - } - g_slist_free (values->methods); - - for (; signals; signals = signals->next) - { - guint id; - guint arg; - const char *signame; - GSignalQuery query; - char *s; - - signame = signals->data; - - s = _dbus_gutils_wincaps_to_uscore (signame); - - id = g_signal_lookup (s, data->gtype); - g_assert (id != 0); - - g_signal_query (id, &query); - g_assert (query.return_type == G_TYPE_NONE); - - g_string_append_printf (xml, " \n", signame); - - for (arg = 0; arg < query.n_params; arg++) - { - char *dbus_type = _dbus_gtype_to_signature (query.param_types[arg]); - - g_assert (dbus_type != NULL); - - g_string_append (xml, " \n"); - g_free (dbus_type); - } - - g_string_append (xml, " \n"); - g_free (s); - } - g_slist_free (values->signals); - - for (; properties; properties = properties->next) - { - const char *propname; - GParamSpec *spec; - char *dbus_type; - gboolean can_set; - gboolean can_get; - char *s; - - propname = properties->data; - spec = NULL; - - s = _dbus_gutils_wincaps_to_uscore (spec->name); - - spec = g_object_class_find_property (g_type_class_peek (data->gtype), s); - g_assert (spec != NULL); - g_free (s); - - dbus_type = _dbus_gtype_to_signature (G_PARAM_SPEC_VALUE_TYPE (spec)); - g_assert (dbus_type != NULL); - - can_set = ((spec->flags & G_PARAM_WRITABLE) != 0 && - (spec->flags & G_PARAM_CONSTRUCT_ONLY) == 0); - - can_get = (spec->flags & G_PARAM_READABLE) != 0; - - if (can_set || can_get) - { - g_string_append_printf (xml, " \n"); - } - - g_free (dbus_type); - g_free (s); - - g_string_append (xml, " \n"); - } - g_slist_free (values->properties); - - g_free (values); - g_string_append (xml, " \n"); -} - -static DBusGLibWriteInterfaceValues * -lookup_values (GHashTable *interfaces, const char *method_interface) -{ - DBusGLibWriteInterfaceValues *values; - if ((values = g_hash_table_lookup (interfaces, (gpointer) method_interface)) == NULL) - { - values = g_new0 (DBusGLibWriteInterfaceValues, 1); - g_hash_table_insert (interfaces, (gpointer) method_interface, values); - } - return values; -} - -static void -introspect_interfaces (GObject *object, GString *xml) -{ - const DBusGObjectInfo *info; - DBusGLibWriteIterfaceData data; - int i; - GHashTable *interfaces; - DBusGLibWriteInterfaceValues *values; - const char *propsig; - - info = lookup_object_info (object); - - g_assert (info != NULL); - - /* Gather a list of all interfaces, indexed into their methods */ - interfaces = g_hash_table_new (g_str_hash, g_str_equal); - for (i = 0; i < info->n_method_infos; i++) - { - const char *method_name; - const char *method_interface; - const char *method_args; - const DBusGMethodInfo *method; - - method = &(info->method_infos[i]); - - method_interface = method_interface_from_object_info (info, method); - method_name = method_name_from_object_info (info, method); - method_args = method_arg_info_from_object_info (info, method); - - values = lookup_values (interfaces, method_interface); - values->methods = g_slist_prepend (values->methods, (gpointer) method); - } - - propsig = info->exported_signals; - while (*propsig) - { - const char *iface; - const char *signame; - - propsig = propsig_iterate (propsig, &iface, &signame); - - values = lookup_values (interfaces, iface); - values->signals = g_slist_prepend (values->signals, (gpointer) signame); - } - - propsig = info->exported_properties; - while (*propsig) - { - const char *iface; - const char *propname; - - propsig = propsig_iterate (propsig, &iface, &propname); - - values = lookup_values (interfaces, iface); - values->properties = g_slist_prepend (values->properties, (gpointer) propname); - } - - memset (&data, 0, sizeof (data)); - data.xml = xml; - data.gtype = G_TYPE_FROM_INSTANCE (object); - data.object_info = info; - g_hash_table_foreach (interfaces, write_interface, &data); - - g_hash_table_destroy (interfaces); -} - -static DBusHandlerResult -handle_introspect (DBusConnection *connection, - DBusMessage *message, - GObject *object) -{ - GString *xml; - unsigned int i; - DBusMessage *ret; - char **children; - - if (!dbus_connection_list_registered (connection, - dbus_message_get_path (message), - &children)) - g_error ("Out of memory"); - - xml = g_string_new (NULL); - - g_string_append (xml, DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE); - - g_string_append (xml, "\n"); - - /* We are introspectable, though I guess that was pretty obvious */ - g_string_append_printf (xml, " \n", DBUS_INTERFACE_INTROSPECTABLE); - g_string_append (xml, " \n"); - g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); - g_string_append (xml, " \n"); - g_string_append (xml, " \n"); - - /* We support get/set properties */ - g_string_append_printf (xml, " \n", DBUS_INTERFACE_PROPERTIES); - g_string_append (xml, " \n"); - g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); - g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); - g_string_append_printf (xml, " \n", DBUS_TYPE_VARIANT_AS_STRING); - g_string_append (xml, " \n"); - g_string_append (xml, " \n"); - g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); - g_string_append_printf (xml, " \n", DBUS_TYPE_STRING_AS_STRING); - g_string_append_printf (xml, " \n", DBUS_TYPE_VARIANT_AS_STRING); - g_string_append (xml, " \n"); - g_string_append (xml, " \n"); - - introspect_interfaces (object, xml); - - /* Append child nodes */ - for (i = 0; children[i]; i++) - g_string_append_printf (xml, " \n", - children[i]); - - /* Close the XML, and send it to the requesting app */ - g_string_append (xml, "\n"); - - ret = dbus_message_new_method_return (message); - if (ret == NULL) - g_error ("Out of memory"); - - dbus_message_append_args (ret, - DBUS_TYPE_STRING, &xml->str, - DBUS_TYPE_INVALID); - - dbus_connection_send (connection, ret, NULL); - dbus_message_unref (ret); - - g_string_free (xml, TRUE); - - dbus_free_string_array (children); - - return DBUS_HANDLER_RESULT_HANDLED; -} - -static DBusMessage* -set_object_property (DBusConnection *connection, - DBusMessage *message, - DBusMessageIter *iter, - GObject *object, - GParamSpec *pspec) -{ - GValue value = { 0, }; - DBusMessage *ret; - DBusMessageIter sub; - DBusGValueMarshalCtx context; - - dbus_message_iter_recurse (iter, &sub); - - context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection); - context.proxy = NULL; - - g_value_init (&value, pspec->value_type); - if (_dbus_gvalue_demarshal (&context, &sub, &value, NULL)) - { - g_object_set_property (object, - pspec->name, - &value); - - g_value_unset (&value); - - ret = dbus_message_new_method_return (message); - if (ret == NULL) - g_error ("out of memory"); - } - else - { - ret = dbus_message_new_error (message, - DBUS_ERROR_INVALID_ARGS, - "Argument's D-BUS type can't be converted to a GType"); - if (ret == NULL) - g_error ("out of memory"); - } - - return ret; -} - -static DBusMessage* -get_object_property (DBusConnection *connection, - DBusMessage *message, - GObject *object, - GParamSpec *pspec) -{ - GType value_gtype; - GValue value = {0, }; - gchar *variant_sig; - DBusMessage *ret; - DBusMessageIter iter, subiter; - - ret = dbus_message_new_method_return (message); - if (ret == NULL) - g_error ("out of memory"); - - - g_value_init (&value, pspec->value_type); - g_object_get_property (object, pspec->name, &value); - - variant_sig = _dbus_gvalue_to_signature (&value); - if (variant_sig == NULL) - { - value_gtype = G_VALUE_TYPE (&value); - g_warning ("Cannot marshal type \"%s\" in variant", g_type_name (value_gtype)); - g_value_unset (&value); - return ret; - } - - dbus_message_iter_init_append (ret, &iter); - if (!dbus_message_iter_open_container (&iter, - DBUS_TYPE_VARIANT, - variant_sig, - &subiter)) - { - g_free (variant_sig); - g_value_unset (&value); - return ret; - } - - if (!_dbus_gvalue_marshal (&subiter, &value)) - { - dbus_message_unref (ret); - ret = dbus_message_new_error (message, - DBUS_ERROR_UNKNOWN_METHOD, - "Can't convert GType of object property to a D-BUS type"); - } - - dbus_message_iter_close_container (&iter, &subiter); - - g_value_unset (&value); - g_free (variant_sig); - - return ret; -} - -static gboolean -lookup_object_and_method (GObject *object, - DBusMessage *message, - const DBusGObjectInfo **object_ret, - const DBusGMethodInfo **method_ret) -{ - const char *interface; - const char *member; - const char *signature; - gboolean ret; - const DBusGObjectInfo *info; - int i; - - interface = dbus_message_get_interface (message); - member = dbus_message_get_member (message); - signature = dbus_message_get_signature (message); - ret = FALSE; - - info = lookup_object_info (object); - *object_ret = info; - - for (i = 0; i < info->n_method_infos; i++) - { - const char *expected_member; - const char *expected_interface; - char *expected_signature; - const DBusGMethodInfo *method; - - method = &(info->method_infos[i]); - - /* Check method interface/name and input signature */ - expected_interface = method_interface_from_object_info (*object_ret, method); - expected_member = method_name_from_object_info (*object_ret, method); - expected_signature = method_input_signature_from_object_info (*object_ret, method); - - if ((interface == NULL - || strcmp (expected_interface, interface) == 0) - && strcmp (expected_member, member) == 0 - && strcmp (expected_signature, signature) == 0) - { - g_free (expected_signature); - *method_ret = method; - return TRUE; - } - g_free (expected_signature); - } - - return ret; -} - -static char * -gerror_domaincode_to_dbus_error_name (const DBusGObjectInfo *object_info, - const char *msg_interface, - GQuark domain, gint code) -{ - const char *domain_str; - const char *code_str; - GString *dbus_error_name; - - domain_str = object_error_domain_prefix_from_object_info (object_info); - code_str = object_error_code_from_object_info (object_info, domain, code); - - if (!domain_str || !code_str) - { - DBusGErrorInfo *info; - - g_static_rw_lock_reader_lock (&globals_lock); - - if (error_metadata != NULL) - info = g_datalist_id_get_data (&error_metadata, domain); - else - info = NULL; - - g_static_rw_lock_reader_unlock (&globals_lock); - - if (info) - { - GEnumValue *value; - GEnumClass *klass; - - klass = g_type_class_ref (info->code_enum); - value = g_enum_get_value (klass, code); - g_type_class_unref (klass); - - domain_str = info->default_iface; - code_str = value->value_nick; - } - } - - if (!domain_str) - domain_str = msg_interface; - - if (!domain_str || !code_str) - { - /* If we can't map it sensibly, make up an error name */ - char *domain_from_quark; - - dbus_error_name = g_string_new ("org.freedesktop.DBus.GLib.UnmappedError."); - - domain_from_quark = uscore_to_wincaps (g_quark_to_string (domain)); - g_string_append (dbus_error_name, domain_from_quark); - g_free (domain_from_quark); - - g_string_append_printf (dbus_error_name, ".Code%d", code); - } - else - { - dbus_error_name = g_string_new (domain_str); - g_string_append_c (dbus_error_name, '.'); - g_string_append (dbus_error_name, code_str); - } - - return g_string_free (dbus_error_name, FALSE); -} - -static DBusMessage * -gerror_to_dbus_error_message (const DBusGObjectInfo *object_info, - DBusMessage *message, - GError *error) -{ - DBusMessage *reply; - - if (!error) - { - char *error_msg; - - error_msg = g_strdup_printf ("Method invoked for %s returned FALSE but did not set error", dbus_message_get_member (message)); - reply = dbus_message_new_error (message, "org.freedesktop.DBus.GLib.ErrorError", error_msg); - g_free (error_msg); - } - else - { - if (error->domain == DBUS_GERROR) - reply = dbus_message_new_error (message, - dbus_g_error_get_name (error), - error->message); - else - { - char *error_name; - error_name = gerror_domaincode_to_dbus_error_name (object_info, - dbus_message_get_interface (message), - error->domain, error->code); - reply = dbus_message_new_error (message, error_name, error->message); - g_free (error_name); - } - } - return reply; -} - -/** - * The context of an asynchronous method call. See dbus_g_method_return() and - * dbus_g_method_return_error(). - */ -struct _DBusGMethodInvocation { - DBusGConnection *connection; /**< The connection */ - DBusGMessage *message; /**< The message which generated the method call */ - const DBusGObjectInfo *object; /**< The object the method was called on */ - const DBusGMethodInfo *method; /**< The method called */ -}; - -static DBusHandlerResult -invoke_object_method (GObject *object, - const DBusGObjectInfo *object_info, - const DBusGMethodInfo *method, - DBusConnection *connection, - DBusMessage *message) -{ - gboolean had_error, call_only; - GError *gerror; - GValueArray *value_array; - GValue return_value = {0,}; - GClosure closure; - char *in_signature; - GArray *out_param_values = NULL; - GValueArray *out_param_gvalues = NULL; - int out_param_count; - int out_param_pos, out_param_gvalue_pos; - DBusHandlerResult result; - DBusMessage *reply; - gboolean have_retval; - gboolean retval_signals_error; - gboolean retval_is_synthetic; - gboolean retval_is_constant; - const char *arg_metadata; - - gerror = NULL; - - /* Determine whether or not this method should be invoked in a new - thread - */ - if (strcmp (string_table_lookup (get_method_data (object_info, method), 2), "A") == 0) - call_only = TRUE; - else - call_only = FALSE; - - have_retval = FALSE; - retval_signals_error = FALSE; - retval_is_synthetic = FALSE; - retval_is_constant = FALSE; - - /* This is evil. We do this to work around the fact that - * the generated glib marshallers check a flag in the closure object - * which we don't care about. We don't need/want to create - * a new closure for each invocation. - */ - memset (&closure, 0, sizeof (closure)); - - in_signature = method_input_signature_from_object_info (object_info, method); - - /* Convert method IN parameters to GValueArray */ - { - GArray *types_array; - guint n_params; - const GType *types; - DBusGValueMarshalCtx context; - GError *error = NULL; - - context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection); - context.proxy = NULL; - - types_array = _dbus_gtypes_from_arg_signature (in_signature, FALSE); - n_params = types_array->len; - types = (const GType*) types_array->data; - - value_array = _dbus_gvalue_demarshal_message (&context, message, n_params, types, &error); - if (value_array == NULL) - { - g_free (in_signature); - g_array_free (types_array, TRUE); - reply = dbus_message_new_error (message, "org.freedesktop.DBus.GLib.ErrorError", error->message); - dbus_connection_send (connection, reply, NULL); - dbus_message_unref (reply); - g_error_free (error); - return DBUS_HANDLER_RESULT_HANDLED; - } - g_array_free (types_array, TRUE); - } - - /* Prepend object as first argument */ - g_value_array_prepend (value_array, NULL); - g_value_init (g_value_array_get_nth (value_array, 0), G_TYPE_OBJECT); - g_value_set_object (g_value_array_get_nth (value_array, 0), object); - - if (call_only) - { - GValue context_value = {0,}; - DBusGMethodInvocation *context; - context = g_new (DBusGMethodInvocation, 1); - context->connection = dbus_g_connection_ref (DBUS_G_CONNECTION_FROM_CONNECTION (connection)); - context->message = dbus_g_message_ref (DBUS_G_MESSAGE_FROM_MESSAGE (message)); - context->object = object_info; - context->method = method; - g_value_init (&context_value, G_TYPE_POINTER); - g_value_set_pointer (&context_value, context); - g_value_array_append (value_array, &context_value); - } - else - { - RetvalType retval; - gboolean arg_in; - gboolean arg_const; - const char *argsig; - - arg_metadata = method_arg_info_from_object_info (object_info, method); - - /* Count number of output parameters, and look for a return value */ - out_param_count = 0; - while (*arg_metadata) - { - arg_metadata = arg_iterate (arg_metadata, NULL, &arg_in, &arg_const, &retval, &argsig); - if (arg_in) - continue; - if (retval != RETVAL_NONE) - { - DBusSignatureIter tmp_sigiter; - /* This is the function return value */ - g_assert (!have_retval); - have_retval = TRUE; - retval_is_synthetic = FALSE; - - switch (retval) - { - case RETVAL_NONE: - g_assert_not_reached (); - break; - case RETVAL_NOERROR: - retval_signals_error = FALSE; - break; - case RETVAL_ERROR: - retval_signals_error = TRUE; - break; - } - - retval_is_constant = arg_const; - - /* Initialize our return GValue with the specified type */ - dbus_signature_iter_init (&tmp_sigiter, argsig); - g_value_init (&return_value, _dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE)); - } - else - { - /* It's a regular output value */ - out_param_count++; - } - } - - /* For compatibility, if we haven't found a return value, we assume - * the function returns a gboolean for signalling an error - * (and therefore also takes a GError). We also note that it - * is a "synthetic" return value; i.e. we aren't going to be - * sending it over the bus, it's just to signal an error. - */ - if (!have_retval) - { - have_retval = TRUE; - retval_is_synthetic = TRUE; - retval_signals_error = TRUE; - g_value_init (&return_value, G_TYPE_BOOLEAN); - } - - /* Create an array to store the actual values of OUT parameters - * (other than the real function return, if any). Then, create - * a GValue boxed POINTER to each of those values, and append to - * the invocation, so the method can return the OUT parameters. - */ - out_param_values = g_array_sized_new (FALSE, TRUE, sizeof (GTypeCValue), out_param_count); - - /* We have a special array of GValues for toplevel GValue return - * types. - */ - out_param_gvalues = g_value_array_new (out_param_count); - out_param_pos = 0; - out_param_gvalue_pos = 0; - - /* Reset argument metadata pointer */ - arg_metadata = method_arg_info_from_object_info (object_info, method); - - /* Iterate over output arguments again, this time allocating space for - * them as appopriate. - */ - while (*arg_metadata) - { - GValue value = {0, }; - GTypeCValue storage; - DBusSignatureIter tmp_sigiter; - GType current_gtype; - - arg_metadata = arg_iterate (arg_metadata, NULL, &arg_in, NULL, &retval, &argsig); - /* Skip over input arguments and the return value, if any */ - if (arg_in || retval != RETVAL_NONE) - continue; - - dbus_signature_iter_init (&tmp_sigiter, argsig); - current_gtype = _dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE); - - g_value_init (&value, G_TYPE_POINTER); - - /* We special case variants to make method invocation a bit nicer */ - if (current_gtype != G_TYPE_VALUE) - { - memset (&storage, 0, sizeof (storage)); - g_array_append_val (out_param_values, storage); - g_value_set_pointer (&value, &(g_array_index (out_param_values, GTypeCValue, out_param_pos))); - out_param_pos++; - } - else - { - g_value_array_append (out_param_gvalues, NULL); - g_value_set_pointer (&value, out_param_gvalues->values + out_param_gvalue_pos); - out_param_gvalue_pos++; - } - g_value_array_append (value_array, &value); - } - } - - /* Append GError as final argument if necessary */ - if (retval_signals_error) - { - g_assert (have_retval); - g_value_array_append (value_array, NULL); - g_value_init (g_value_array_get_nth (value_array, value_array->n_values - 1), G_TYPE_POINTER); - g_value_set_pointer (g_value_array_get_nth (value_array, value_array->n_values - 1), &gerror); - } - - /* Actually invoke method */ - method->marshaller (&closure, have_retval ? &return_value : NULL, - value_array->n_values, - value_array->values, - NULL, method->function); - if (call_only) - { - result = DBUS_HANDLER_RESULT_HANDLED; - goto done; - } - if (retval_signals_error) - had_error = _dbus_gvalue_signals_error (&return_value); - else - had_error = FALSE; - - if (!had_error) - { - DBusMessageIter iter; - - reply = dbus_message_new_method_return (message); - if (reply == NULL) - goto nomem; - - /* Append output arguments to reply */ - dbus_message_iter_init_append (reply, &iter); - - /* First, append the return value, unless it's synthetic */ - if (have_retval && !retval_is_synthetic) - { - if (!_dbus_gvalue_marshal (&iter, &return_value)) - goto nomem; - if (!retval_is_constant) - g_value_unset (&return_value); - } - - /* Grab the argument metadata and iterate over it */ - arg_metadata = method_arg_info_from_object_info (object_info, method); - - /* Now append any remaining return values */ - out_param_pos = 0; - out_param_gvalue_pos = 0; - while (*arg_metadata) - { - GValue gvalue = {0, }; - const char *arg_name; - gboolean arg_in; - gboolean constval; - RetvalType retval; - const char *arg_signature; - DBusSignatureIter argsigiter; - - do - { - /* Iterate over only output values; skip over input - arguments and the return value */ - arg_metadata = arg_iterate (arg_metadata, &arg_name, &arg_in, &constval, &retval, &arg_signature); - } - while ((arg_in || retval != RETVAL_NONE) && *arg_metadata); - - /* If the last argument we saw was input or the return - * value, we must be done iterating over output arguments. - */ - if (arg_in || retval != RETVAL_NONE) - break; - - dbus_signature_iter_init (&argsigiter, arg_signature); - - g_value_init (&gvalue, _dbus_gtype_from_signature_iter (&argsigiter, FALSE)); - if (G_VALUE_TYPE (&gvalue) != G_TYPE_VALUE) - { - if (!_dbus_gvalue_take (&gvalue, - &(g_array_index (out_param_values, GTypeCValue, out_param_pos)))) - g_assert_not_reached (); - out_param_pos++; - } - else - { - g_value_set_static_boxed (&gvalue, out_param_gvalues->values + out_param_gvalue_pos); - out_param_gvalue_pos++; - } - - if (!_dbus_gvalue_marshal (&iter, &gvalue)) - goto nomem; - /* Here we actually free the allocated value; we - * took ownership of it with _dbus_gvalue_take, unless - * an annotation has specified this value as constant. - */ - if (!constval) - g_value_unset (&gvalue); - } - } - else - reply = gerror_to_dbus_error_message (object_info, message, gerror); - - if (reply) - { - dbus_connection_send (connection, reply, NULL); - dbus_message_unref (reply); - } - - result = DBUS_HANDLER_RESULT_HANDLED; - done: - g_free (in_signature); - if (!call_only) - { - g_array_free (out_param_values, TRUE); - g_value_array_free (out_param_gvalues); - } - g_value_array_free (value_array); - return result; - nomem: - result = DBUS_HANDLER_RESULT_NEED_MEMORY; - goto done; -} - -static DBusHandlerResult -gobject_message_function (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - GParamSpec *pspec; - GObject *object; - gboolean setter; - gboolean getter; - char *s; - const char *wincaps_propname; - /* const char *wincaps_propiface; */ - DBusMessageIter iter; - const DBusGMethodInfo *method; - const DBusGObjectInfo *object_info; - - object = G_OBJECT (user_data); - - if (dbus_message_is_method_call (message, - DBUS_INTERFACE_INTROSPECTABLE, - "Introspect")) - return handle_introspect (connection, message, object); - - /* Try the metainfo, which lets us invoke methods */ - if (lookup_object_and_method (object, message, &object_info, &method)) - return invoke_object_method (object, object_info, method, connection, message); - - /* If no metainfo, we can still do properties and signals - * via standard GLib introspection - */ - getter = FALSE; - setter = FALSE; - if (dbus_message_is_method_call (message, - DBUS_INTERFACE_PROPERTIES, - "Get")) - getter = TRUE; - else if (dbus_message_is_method_call (message, - DBUS_INTERFACE_PROPERTIES, - "Set")) - setter = TRUE; - - if (!(setter || getter)) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - - dbus_message_iter_init (message, &iter); - - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) - { - g_warning ("Property get or set does not have an interface string as first arg\n"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - /* We never use the interface name; if we did, we'd need to - * remember that it can be empty string for "pick one for me" - */ - /* dbus_message_iter_get_basic (&iter, &wincaps_propiface); */ - dbus_message_iter_next (&iter); - - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) - { - g_warning ("Property get or set does not have a property name string as second arg\n"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - dbus_message_iter_get_basic (&iter, &wincaps_propname); - dbus_message_iter_next (&iter); - - s = _dbus_gutils_wincaps_to_uscore (wincaps_propname); - - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), - s); - - g_free (s); - - if (pspec != NULL) - { - DBusMessage *ret; - - if (setter) - { - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_VARIANT) - { - g_warning ("Property set does not have a variant value as third arg\n"); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - - ret = set_object_property (connection, message, &iter, - object, pspec); - dbus_message_iter_next (&iter); - } - else if (getter) - { - ret = get_object_property (connection, message, - object, pspec); - } - else - { - g_assert_not_reached (); - ret = NULL; - } - - g_assert (ret != NULL); - - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INVALID) - g_warning ("Property get or set had too many arguments\n"); - - dbus_connection_send (connection, ret, NULL); - dbus_message_unref (ret); - return DBUS_HANDLER_RESULT_HANDLED; - } - - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -static const DBusObjectPathVTable gobject_dbus_vtable = { - gobject_unregister_function, - gobject_message_function, - NULL -}; - -typedef struct { - GClosure closure; - DBusGConnection *connection; - GObject *object; - const char *signame; - const char *sigiface; -} DBusGSignalClosure; - -static GClosure * -dbus_g_signal_closure_new (DBusGConnection *connection, - GObject *object, - const char *signame, - const char *sigiface) -{ - DBusGSignalClosure *closure; - - closure = (DBusGSignalClosure*) g_closure_new_simple (sizeof (DBusGSignalClosure), NULL); - - closure->connection = dbus_g_connection_ref (connection); - closure->object = object; - closure->signame = signame; - closure->sigiface = sigiface; - return (GClosure*) closure; -} - -static void -dbus_g_signal_closure_finalize (gpointer data, - GClosure *closure) -{ - DBusGSignalClosure *sigclosure = (DBusGSignalClosure *) closure; - - dbus_g_connection_unref (sigclosure->connection); -} - -static void -signal_emitter_marshaller (GClosure *closure, - GValue *retval, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - DBusGSignalClosure *sigclosure; - DBusMessage *signal; - DBusMessageIter iter; - guint i; - const char *path; - - sigclosure = (DBusGSignalClosure *) closure; - - g_assert (retval == NULL); - - path = _dbus_gobject_get_path (sigclosure->object); - - g_assert (path != NULL); - - signal = dbus_message_new_signal (path, - sigclosure->sigiface, - sigclosure->signame); - if (!signal) - { - g_error ("out of memory"); - return; - } - - dbus_message_iter_init_append (signal, &iter); - - /* First argument is the object itself, and we can't marshall that */ - for (i = 1; i < n_param_values; i++) - { - if (!_dbus_gvalue_marshal (&iter, - (GValue *) (&(param_values[i])))) - { - g_warning ("failed to marshal parameter %d for signal %s", - i, sigclosure->signame); - goto out; - } - } - dbus_connection_send (DBUS_CONNECTION_FROM_G_CONNECTION (sigclosure->connection), - signal, NULL); - out: - dbus_message_unref (signal); -} - -static void -export_signals (DBusGConnection *connection, const DBusGObjectInfo *info, GObject *object) -{ - GType gtype; - const char *sigdata; - const char *iface; - const char *signame; - - gtype = G_TYPE_FROM_INSTANCE (object); - - sigdata = info->exported_signals; - - while (*sigdata != '\0') - { - guint id; - GSignalQuery query; - GClosure *closure; - char *s; - - sigdata = propsig_iterate (sigdata, &iface, &signame); - - s = _dbus_gutils_wincaps_to_uscore (signame); - - id = g_signal_lookup (s, gtype); - if (id == 0) - { - g_warning ("signal \"%s\" (from \"%s\") exported but not found in object class \"%s\"", - s, signame, g_type_name (gtype)); - g_free (s); - continue; - } - - g_signal_query (id, &query); - - if (query.return_type != G_TYPE_NONE) - { - g_warning ("Not exporting signal \"%s\" for object class \"%s\" as it has a return type \"%s\"", - s, g_type_name (gtype), g_type_name (query.return_type)); - g_free (s); - continue; /* FIXME: these could be listed as methods ? */ - } - - closure = dbus_g_signal_closure_new (connection, object, signame, (char*) iface); - g_closure_set_marshal (closure, signal_emitter_marshaller); - - g_signal_connect_closure_by_id (object, - id, - 0, - closure, - FALSE); - - g_closure_add_finalize_notifier (closure, NULL, - dbus_g_signal_closure_finalize); - g_free (s); - } -} - -#include "dbus-glib-error-switch.h" - -void -dbus_set_g_error (GError **gerror, - DBusError *error) -{ - int code; - - code = dbus_error_to_gerror_code (error->name); - if (code != DBUS_GERROR_REMOTE_EXCEPTION) - g_set_error (gerror, DBUS_GERROR, - code, - "%s", - error->message); - else - g_set_error (gerror, DBUS_GERROR, - code, - "%s%c%s", - error->message ? error->message : "", - '\0', - error->name); -} - -static void -dbus_g_error_info_free (gpointer p) -{ - DBusGErrorInfo *info; - - info = p; - - g_free (info->default_iface); - g_free (info); -} - -/** @} */ /* end of internals */ - -/** - * @addtogroup DBusGLib - * @{ - */ - -/** - * Install introspection information about the given object GType - * sufficient to allow methods on the object to be invoked by name. - * The introspection information is normally generated by - * dbus-glib-tool, then this function is called in the - * class_init() for the object class. - * - * Once introspection information has been installed, instances of the - * object registered with dbus_g_connection_register_g_object() can have - * their methods invoked remotely. - * - * @param object_type GType for the object - * @param info introspection data generated by dbus-glib-tool - */ -void -dbus_g_object_type_install_info (GType object_type, - const DBusGObjectInfo *info) -{ - g_return_if_fail (G_TYPE_IS_CLASSED (object_type)); - - _dbus_g_value_types_init (); - - g_type_set_qdata (object_type, - dbus_g_object_type_dbus_metadata_quark (), - (gpointer) info); -} - -/** - * Register a GError domain and set of codes with D-BUS. You must - * have created a GEnum for the error codes. This function will not - * be needed with an introspection-capable GLib. - * - * @param domain the GError domain - * @param default_iface the D-BUS interface used for error values by default, or #NULL - * @param code_enum a GType for a GEnum of the error codes - */ -void -dbus_g_error_domain_register (GQuark domain, - const char *default_iface, - GType code_enum) -{ - DBusGErrorInfo *info; - - g_return_if_fail (g_quark_to_string (domain) != NULL); - g_return_if_fail (code_enum != G_TYPE_INVALID); - g_return_if_fail (G_TYPE_FUNDAMENTAL (code_enum) == G_TYPE_ENUM); - - g_static_rw_lock_writer_lock (&globals_lock); - - if (error_metadata == NULL) - g_datalist_init (&error_metadata); - - info = g_datalist_id_get_data (&error_metadata, domain); - - if (info != NULL) - { - g_warning ("Metadata for error domain \"%s\" already registered\n", - g_quark_to_string (domain)); - } - else - { - info = g_new0 (DBusGErrorInfo, 1); - info->default_iface = g_strdup (default_iface); - info->code_enum = code_enum; - - g_datalist_id_set_data_full (&error_metadata, - domain, - info, - dbus_g_error_info_free); - } - - g_static_rw_lock_writer_unlock (&globals_lock); -} - -static void -unregister_gobject (DBusGConnection *connection, GObject *dead) -{ - char *path; - path = g_object_steal_data (dead, "dbus_glib_object_path"); - dbus_connection_unregister_object_path (DBUS_CONNECTION_FROM_G_CONNECTION (connection), path); - g_free (path); -} - -/** - * Registers a GObject at the given path. Properties, methods, and signals - * of the object can then be accessed remotely. Methods are only available - * if method introspection data has been added to the object's class - * with g_object_class_install_info(). - * - * The registration will be cancelled if either the DBusConnection or - * the GObject gets finalized. - * - * @param connection the D-BUS connection - * @param at_path the path where the object will live (the object's name) - * @param object the object - */ -void -dbus_g_connection_register_g_object (DBusGConnection *connection, - const char *at_path, - GObject *object) -{ - const DBusGObjectInfo *info; - g_return_if_fail (connection != NULL); - g_return_if_fail (at_path != NULL); - g_return_if_fail (G_IS_OBJECT (object)); - - info = lookup_object_info (object); - if (info == NULL) - { - g_warning ("No introspection data registered for object class \"%s\"", - g_type_name (G_TYPE_FROM_INSTANCE (object))); - return; - } - - if (!dbus_connection_register_object_path (DBUS_CONNECTION_FROM_G_CONNECTION (connection), - at_path, - &gobject_dbus_vtable, - object)) - { - g_error ("Failed to register GObject with DBusConnection"); - return; - } - - export_signals (connection, info, object); - - g_object_set_data (object, "dbus_glib_object_path", g_strdup (at_path)); - g_object_weak_ref (object, (GWeakNotify)unregister_gobject, connection); -} - -GObject * -dbus_g_connection_lookup_g_object (DBusGConnection *connection, - const char *at_path) -{ - gpointer ret; - if (!dbus_connection_get_object_path_data (DBUS_CONNECTION_FROM_G_CONNECTION (connection), at_path, &ret)) - return NULL; - return ret; -} - -typedef struct { - GType rettype; - guint n_params; - GType *params; -} DBusGFuncSignature; - -static guint -funcsig_hash (gconstpointer key) -{ - const DBusGFuncSignature *sig = key; - GType *types; - guint ret; - guint i; - - ret = sig->rettype; - types = sig->params; - - for (i = 0; i < sig->n_params; i++) - { - ret += (int) (*types); - types++; - } - - return ret; -} - -static gboolean -funcsig_equal (gconstpointer aval, - gconstpointer bval) -{ - const DBusGFuncSignature *a = aval; - const DBusGFuncSignature *b = bval; - const GType *atypes; - const GType *btypes; - guint i; - - if (a->rettype != b->rettype - || a->n_params != b->n_params) - return FALSE; - - atypes = a->params; - btypes = b->params; - - for (i = 0; i < a->n_params; i++) - { - if (*btypes != *atypes) - return FALSE; - atypes++; - btypes++; - } - - return TRUE; -} - -GClosureMarshal -_dbus_gobject_lookup_marshaller (GType rettype, - guint n_params, - const GType *param_types) -{ - GClosureMarshal ret; - DBusGFuncSignature sig; - GType *params; - guint i; - - /* Convert to fundamental types */ - rettype = G_TYPE_FUNDAMENTAL (rettype); - params = g_new (GType, n_params); - for (i = 0; i < n_params; i++) - params[i] = G_TYPE_FUNDAMENTAL (param_types[i]); - - sig.rettype = rettype; - sig.n_params = n_params; - sig.params = params; - - g_static_rw_lock_reader_lock (&globals_lock); - - if (marshal_table) - ret = g_hash_table_lookup (marshal_table, &sig); - else - ret = NULL; - - g_static_rw_lock_reader_unlock (&globals_lock); - - if (ret == NULL) - { - if (rettype == G_TYPE_NONE) - { - if (n_params == 0) - ret = g_cclosure_marshal_VOID__VOID; - else if (n_params == 1) - { - switch (params[0]) - { - case G_TYPE_BOOLEAN: - ret = g_cclosure_marshal_VOID__BOOLEAN; - break; - case G_TYPE_UCHAR: - ret = g_cclosure_marshal_VOID__UCHAR; - break; - case G_TYPE_INT: - ret = g_cclosure_marshal_VOID__INT; - break; - case G_TYPE_UINT: - ret = g_cclosure_marshal_VOID__UINT; - break; - case G_TYPE_DOUBLE: - ret = g_cclosure_marshal_VOID__DOUBLE; - break; - case G_TYPE_STRING: - ret = g_cclosure_marshal_VOID__STRING; - break; - case G_TYPE_BOXED: - ret = g_cclosure_marshal_VOID__BOXED; - break; - } - } - else if (n_params == 3 - && params[0] == G_TYPE_STRING - && params[1] == G_TYPE_STRING - && params[2] == G_TYPE_STRING) - { - ret = _dbus_g_marshal_NONE__STRING_STRING_STRING; - } - } - } - - g_free (params); - return ret; -} - -/** - * Register a GClosureMarshal to be used for signal invocations, - * giving its return type and a list of parameter types, - * followed by G_TYPE_INVALID. - - * This function will not be needed once GLib includes libffi. - * - * @param marshaller a GClosureMarshal to be used for invocation - * @param rettype a GType for the return type of the function - * @param ... The parameter GTypes, followed by G_TYPE_INVALID - */ -void -dbus_g_object_register_marshaller (GClosureMarshal marshaller, - GType rettype, - ...) -{ - va_list args; - GArray *types; - GType gtype; - - va_start (args, rettype); - - types = g_array_new (TRUE, TRUE, sizeof (GType)); - - while ((gtype = va_arg (args, GType)) != G_TYPE_INVALID) - g_array_append_val (types, gtype); - - dbus_g_object_register_marshaller_array (marshaller, rettype, - types->len, (GType*) types->data); - - g_array_free (types, TRUE); - va_end (args); -} - -/** - * Register a GClosureMarshal to be used for signal invocations. - * See also #dbus_g_object_register_marshaller - * - * @param marshaller a GClosureMarshal to be used for invocation - * @param rettype a GType for the return type of the function - * @param n_types number of function parameters - * @param types a C array of GTypes values - */ -void -dbus_g_object_register_marshaller_array (GClosureMarshal marshaller, - GType rettype, - guint n_types, - const GType* types) -{ - DBusGFuncSignature *sig; - guint i; - - g_static_rw_lock_writer_lock (&globals_lock); - - if (marshal_table == NULL) - marshal_table = g_hash_table_new_full (funcsig_hash, - funcsig_equal, - g_free, - NULL); - sig = g_new0 (DBusGFuncSignature, 1); - sig->rettype = G_TYPE_FUNDAMENTAL (rettype); - sig->n_params = n_types; - sig->params = g_new (GType, n_types); - for (i = 0; i < n_types; i++) - sig->params[i] = G_TYPE_FUNDAMENTAL (types[i]); - - g_hash_table_insert (marshal_table, sig, marshaller); - - g_static_rw_lock_writer_unlock (&globals_lock); -} - -/** - * Get the sender of a message so we can send a - * "reply" later (i.e. send a message directly - * to a service which invoked the method at a - * later time). - * - * @param context the method context - * - * @return the unique name of teh sender - */ -gchar * -dbus_g_method_get_sender (DBusGMethodInvocation *context) -{ - const gchar *sender; - - sender = dbus_message_get_sender (dbus_g_message_get_message (context->message)); - - if (sender == NULL) - return NULL; - - return strdup (sender); -} - -/** - * Get the reply message to append reply values - * Used as a sidedoor when you can't generate dbus values - * of the correct type due to glib binding limitations - * - * @param context the method context - */ -DBusMessage * -dbus_g_method_get_reply (DBusGMethodInvocation *context) -{ - return dbus_message_new_method_return (dbus_g_message_get_message (context->message)); -} - -/** - * Send a manually created reply message - * Used as a sidedoor when you can't generate dbus values - * of the correct type due to glib binding limitations - * - * @param context the method context - * @param reply the reply message, will be unreffed - */ -void -dbus_g_method_send_reply (DBusGMethodInvocation *context, DBusMessage *reply) -{ - dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL); - dbus_message_unref (reply); - - dbus_g_connection_unref (context->connection); - dbus_g_message_unref (context->message); - g_free (context); -} - - -/** - * Send a return message for a given method invocation, with arguments. - * This function also frees the sending context. - * - * @param context the method context - */ -void -dbus_g_method_return (DBusGMethodInvocation *context, ...) -{ - DBusMessage *reply; - DBusMessageIter iter; - va_list args; - char *out_sig; - GArray *argsig; - guint i; - - reply = dbus_message_new_method_return (dbus_g_message_get_message (context->message)); - out_sig = method_output_signature_from_object_info (context->object, context->method); - argsig = _dbus_gtypes_from_arg_signature (out_sig, FALSE); - - dbus_message_iter_init_append (reply, &iter); - - va_start (args, context); - for (i = 0; i < argsig->len; i++) - { - GValue value = {0,}; - char *error; - g_value_init (&value, g_array_index (argsig, GType, i)); - error = NULL; - G_VALUE_COLLECT (&value, args, G_VALUE_NOCOPY_CONTENTS, &error); - if (error) - { - g_warning(error); - g_free (error); - } - _dbus_gvalue_marshal (&iter, &value); - } - va_end (args); - - dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL); - dbus_message_unref (reply); - - dbus_g_connection_unref (context->connection); - dbus_g_message_unref (context->message); - g_free (context); - g_free (out_sig); - g_array_free (argsig, TRUE); -} - -/** - * Send a error message for a given method invocation. - * This function also frees the sending context. - * - * @param context the method context - * @param error the error to send. - */ -void -dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error) -{ - DBusMessage *reply; - reply = gerror_to_dbus_error_message (context->object, dbus_g_message_get_message (context->message), error); - dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL); - dbus_message_unref (reply); - g_free (context); -} - -/** @} */ /* end of public API */ - -const char * _dbus_gobject_get_path (GObject *obj) -{ - return g_object_get_data (obj, "dbus_glib_object_path"); -} - -#ifdef DBUS_BUILD_TESTS -#include - -static void -_dummy_function (void) -{ -} - -/* Data structures copied from one generated by current dbus-binding-tool; - * we need to support this layout forever - */ -static const DBusGMethodInfo dbus_glib_internal_test_methods[] = { - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 0 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 49 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 117 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 191 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 270 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 320 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 391 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 495 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 623 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 693 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 765 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 838 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 911 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 988 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1064 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1140 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1204 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1278 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1347 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1408 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1460 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1533 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1588 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1647 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1730 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1784 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1833 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1895 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1947 }, - { (GCallback) _dummy_function, g_cclosure_marshal_VOID__VOID, 1999 }, -}; - -const DBusGObjectInfo dbus_glib_internal_test_object_info = { - 0, - dbus_glib_internal_test_methods, - 30, -"org.freedesktop.DBus.Tests.MyObject\0DoNothing\0S\0\0org.freedesktop.DBus.Tests.MyObject\0Increment\0S\0x\0I\0u\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0IncrementRetval\0S\0x\0I\0u\0arg1\0O\0F\0R\0u\0\0org.freedesktop.DBus.Tests.MyObject\0IncrementRetvalError\0S\0x\0I\0u\0arg1\0O\0F\0E\0u\0\0org.freedesktop.DBus.Tests.MyObject\0ThrowError\0S\0\0org.freedesktop.DBus.Tests.MyObject\0Uppercase\0S\0arg0\0I\0s\0arg1\0O\0F\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0ManyArgs\0S\0x\0I\0u\0str\0I\0s\0trouble\0I\0d\0d_ret\0O\0F\0N\0d\0str_ret\0O\0F\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0ManyReturn\0S\0arg0\0O\0F\0N\0u\0arg1\0O\0F\0N\0s\0arg2\0O\0F\0N\0i\0arg3\0O\0F\0N\0u\0arg4\0O\0F\0N\0u\0arg5\0O\0C\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0Stringify\0S\0val\0I\0v\0arg1\0O\0F\0N\0s\0\0org.freedesktop.DBus.Tests.MyObject\0Unstringify\0S\0val\0I\0s\0arg1\0O\0F\0N\0v\0\0org.freedesktop.DBus.Tests.MyObject\0Recursive1\0S\0arg0\0I\0au\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0Recursive2\0S\0arg0\0I\0u\0arg1\0O\0F\0N\0au\0\0org.freedesktop.DBus.Tests.MyObject\0ManyUppercase\0S\0arg0\0I\0as\0arg1\0O\0F\0N\0as\0\0org.freedesktop.DBus.Tests.MyObject\0StrHashLen\0S\0arg0\0I\0a{ss}\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0SendCar\0S\0arg0\0I\0(suv)\0arg1\0O\0F\0N\0(uo)\0\0org.freedesktop.DBus.Tests.MyObject\0GetHash\0S\0arg0\0O\0F\0N\0a{ss}\0\0org.freedesktop.DBus.Tests.MyObject\0RecArrays\0S\0val\0I\0aas\0arg1\0O\0F\0N\0aau\0\0org.freedesktop.DBus.Tests.MyObject\0Objpath\0S\0arg0\0I\0o\0arg1\0O\0C\0N\0o\0\0org.freedesktop.DBus.Tests.MyObject\0GetObjs\0S\0arg0\0O\0F\0N\0ao\0\0org.freedesktop.DBus.Tests.MyObject\0IncrementVal\0S\0\0org.freedesktop.DBus.Tests.MyObject\0AsyncIncrement\0A\0x\0I\0u\0arg1\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0AsyncThrowError\0A\0\0org.freedesktop.DBus.Tests.MyObject\0GetVal\0S\0arg0\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.MyObject\0ManyStringify\0S\0arg0\0I\0a{sv}\0arg1\0O\0F\0N\0a{sv}\0\0org.freedesktop.DBus.Tests.MyObject\0EmitFrobnicate\0S\0\0org.freedesktop.DBus.Tests.MyObject\0Terminate\0S\0\0org.freedesktop.DBus.Tests.FooObject\0GetValue\0S\0arg0\0O\0F\0N\0u\0\0org.freedesktop.DBus.Tests.FooObject\0EmitSignals\0S\0\0org.freedesktop.DBus.Tests.FooObject\0EmitSignal2\0S\0\0org.freedesktop.DBus.Tests.FooObject\0Terminate\0S\0\0\0", -"org.freedesktop.DBus.Tests.MyObject\0Frobnicate\0org.freedesktop.DBus.Tests.FooObject\0Sig0\0org.freedesktop.DBus.Tests.FooObject\0Sig1\0org.freedesktop.DBus.Tests.FooObject\0Sig2\0\0", -"\0" -}; - - -/** - * @ingroup DBusGLibInternals - * Unit test for GLib GObject integration ("skeletons") - * @returns #TRUE on success. - */ -gboolean -_dbus_gobject_test (const char *test_data_dir) -{ - int i; - const char *arg; - const char *arg_name; - gboolean arg_in; - gboolean constval; - RetvalType retval; - const char *arg_signature; - const char *sigdata; - const char *iface; - const char *signame; - - static struct { const char *wincaps; const char *uscore; } name_pairs[] = { - { "SetFoo", "set_foo" }, - { "Foo", "foo" }, - { "GetFooBar", "get_foo_bar" }, - { "Hello", "hello" } - - /* Impossible-to-handle cases */ - /* { "FrobateUIHandler", "frobate_ui_handler" } */ - }; - - /* Test lookup in our hardcoded object info; if these tests fail - * then it likely means you changed the generated object info in an - * incompatible way and broke the lookup functions. In that case - * you need to bump the version and use a new structure instead. */ - /* DoNothing */ - arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, - &(dbus_glib_internal_test_methods[0])); - g_assert (*arg == '\0'); - - /* Increment */ - arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, - &(dbus_glib_internal_test_methods[1])); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (!strcmp (arg_name, "x")); - g_assert (arg_in == TRUE); - g_assert (!strcmp (arg_signature, "u")); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (arg_in == FALSE); - g_assert (retval == RETVAL_NONE); - g_assert (!strcmp (arg_signature, "u")); - g_assert (*arg == '\0'); - - /* IncrementRetval */ - arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, - &(dbus_glib_internal_test_methods[2])); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (!strcmp (arg_name, "x")); - g_assert (arg_in == TRUE); - g_assert (!strcmp (arg_signature, "u")); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (retval == RETVAL_NOERROR); - g_assert (arg_in == FALSE); - g_assert (!strcmp (arg_signature, "u")); - g_assert (*arg == '\0'); - - /* IncrementRetvalError */ - arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, - &(dbus_glib_internal_test_methods[3])); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (!strcmp (arg_name, "x")); - g_assert (arg_in == TRUE); - g_assert (!strcmp (arg_signature, "u")); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (retval == RETVAL_ERROR); - g_assert (arg_in == FALSE); - g_assert (!strcmp (arg_signature, "u")); - g_assert (*arg == '\0'); - - /* Stringify */ - arg = method_arg_info_from_object_info (&dbus_glib_internal_test_object_info, - &(dbus_glib_internal_test_methods[8])); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (!strcmp (arg_name, "val")); - g_assert (arg_in == TRUE); - g_assert (!strcmp (arg_signature, "v")); - g_assert (*arg != '\0'); - arg = arg_iterate (arg, &arg_name, &arg_in, &constval, &retval, &arg_signature); - g_assert (retval == RETVAL_NONE); - g_assert (arg_in == FALSE); - g_assert (!strcmp (arg_signature, "s")); - g_assert (*arg == '\0'); - - sigdata = dbus_glib_internal_test_object_info.exported_signals; - g_assert (*sigdata != '\0'); - sigdata = propsig_iterate (sigdata, &iface, &signame); - g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.MyObject")); - g_assert (!strcmp (signame, "Frobnicate")); - g_assert (*sigdata != '\0'); - sigdata = propsig_iterate (sigdata, &iface, &signame); - g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.FooObject")); - g_assert (!strcmp (signame, "Sig0")); - g_assert (*sigdata != '\0'); - sigdata = propsig_iterate (sigdata, &iface, &signame); - g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.FooObject")); - g_assert (!strcmp (signame, "Sig1")); - g_assert (*sigdata != '\0'); - sigdata = propsig_iterate (sigdata, &iface, &signame); - g_assert (!strcmp (iface, "org.freedesktop.DBus.Tests.FooObject")); - g_assert (!strcmp (signame, "Sig2")); - g_assert (*sigdata == '\0'); - - - i = 0; - while (i < (int) G_N_ELEMENTS (name_pairs)) - { - char *uscore; - char *wincaps; - - uscore = _dbus_gutils_wincaps_to_uscore (name_pairs[i].wincaps); - wincaps = uscore_to_wincaps (name_pairs[i].uscore); - - if (strcmp (uscore, name_pairs[i].uscore) != 0) - { - g_printerr ("\"%s\" should have been converted to \"%s\" not \"%s\"\n", - name_pairs[i].wincaps, name_pairs[i].uscore, - uscore); - exit (1); - } - - if (strcmp (wincaps, name_pairs[i].wincaps) != 0) - { - g_printerr ("\"%s\" should have been converted to \"%s\" not \"%s\"\n", - name_pairs[i].uscore, name_pairs[i].wincaps, - wincaps); - exit (1); - } - - g_free (uscore); - g_free (wincaps); - - ++i; - } - - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-gobject.h b/glib/dbus-gobject.h deleted file mode 100644 index fcc38cda..00000000 --- a/glib/dbus-gobject.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gobject.h: common functions used to map between D-BUS and GObject - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_GLIB_OBJECT_H -#define DBUS_GLIB_OBJECT_H - -#include -#include -#include -#include "dbus/dbus-glib.h" - -G_BEGIN_DECLS - -const char * _dbus_gobject_get_path (GObject *obj); - -GClosureMarshal _dbus_gobject_lookup_marshaller (GType rettype, - guint n_params, - const GType *param_types); - - - -G_END_DECLS - -#endif diff --git a/glib/dbus-gparser.c b/glib/dbus-gparser.c deleted file mode 100644 index f296f961..00000000 --- a/glib/dbus-gparser.c +++ /dev/null @@ -1,881 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gparser.c parse DBus description files - * - * Copyright (C) 2003, 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "dbus-gparser.h" -#include "dbus/dbus-glib-lowlevel.h" -#include "dbus-gidl.h" -#include "dbus-gobject.h" -#include "dbus/dbus-signature.h" -#include - -#include -#define _(x) gettext ((x)) -#define N_(x) x - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -#define ELEMENT_IS(name) (strcmp (element_name, (name)) == 0) - -typedef struct -{ - const char *name; - const char **retloc; -} LocateAttr; - -static gboolean -locate_attributes (const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error, - const char *first_attribute_name, - const char **first_attribute_retloc, - ...) -{ - va_list args; - const char *name; - const char **retloc; - int n_attrs; -#define MAX_ATTRS 24 - LocateAttr attrs[MAX_ATTRS]; - gboolean retval; - int i; - - g_return_val_if_fail (first_attribute_name != NULL, FALSE); - g_return_val_if_fail (first_attribute_retloc != NULL, FALSE); - - retval = TRUE; - - n_attrs = 1; - attrs[0].name = first_attribute_name; - attrs[0].retloc = first_attribute_retloc; - *first_attribute_retloc = NULL; - - va_start (args, first_attribute_retloc); - - name = va_arg (args, const char*); - retloc = va_arg (args, const char**); - - while (name != NULL) - { - g_return_val_if_fail (retloc != NULL, FALSE); - - g_assert (n_attrs < MAX_ATTRS); - - attrs[n_attrs].name = name; - attrs[n_attrs].retloc = retloc; - n_attrs += 1; - *retloc = NULL; - - name = va_arg (args, const char*); - retloc = va_arg (args, const char**); - } - - va_end (args); - - if (!retval) - return retval; - - i = 0; - while (attribute_names[i]) - { - int j; - gboolean found; - - found = FALSE; - j = 0; - while (j < n_attrs) - { - if (strcmp (attrs[j].name, attribute_names[i]) == 0) - { - retloc = attrs[j].retloc; - - if (*retloc != NULL) - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Attribute \"%s\" repeated twice on the same <%s> element"), - attrs[j].name, element_name); - retval = FALSE; - goto out; - } - - *retloc = attribute_values[i]; - found = TRUE; - } - - ++j; - } - - if (!found) - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Attribute \"%s\" is invalid on <%s> element in this context"), - attribute_names[i], element_name); - retval = FALSE; - goto out; - } - - ++i; - } - - out: - return retval; -} - -#if 0 -static gboolean -check_no_attributes (const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - if (attribute_names[0] != NULL) - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Attribute \"%s\" is invalid on <%s> element in this context"), - attribute_names[0], element_name); - return FALSE; - } - - return TRUE; -} -#endif - -struct Parser -{ - int refcount; - - NodeInfo *result; /* Filled in when we pop the last node */ - GSList *node_stack; - InterfaceInfo *interface; - MethodInfo *method; - SignalInfo *signal; - PropertyInfo *property; - ArgInfo *arg; - gboolean in_annotation; -}; - -Parser* -parser_new (void) -{ - Parser *parser; - - parser = g_new0 (Parser, 1); - - parser->refcount = 1; - - return parser; -} - -Parser * -parser_ref (Parser *parser) -{ - parser->refcount += 1; - - return parser; -} - -void -parser_unref (Parser *parser) -{ - parser->refcount -= 1; - if (parser->refcount == 0) - { - if (parser->result) - node_info_unref (parser->result); - - g_free (parser); - } -} - -gboolean -parser_check_doctype (Parser *parser, - const char *doctype, - GError **error) -{ - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - if (strcmp (doctype, "node") != 0) - { - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - "D-BUS description file has the wrong document type %s, use node or interface", - doctype); - return FALSE; - } - else - return TRUE; -} - -static gboolean -parse_node (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - NodeInfo *node; - - if (parser->interface || - parser->method || - parser->signal || - parser->property || - parser->arg || - parser->in_annotation) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - NULL)) - return FALSE; - - /* Only the root node can have no name */ - if (parser->node_stack != NULL && name == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "name", element_name); - return FALSE; - } - - /* Root element name must be absolute */ - if (parser->node_stack == NULL && name && *name != '/') - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute on <%s> element must be an absolute object path, \"%s\" not OK"), - "name", element_name, name); - return FALSE; - } - - /* Other element names must not be absolute */ - if (parser->node_stack != NULL && name && *name == '/') - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute on <%s> element must not be an absolute object path, \"%s\" starts with /"), - "name", element_name, name); - return FALSE; - } - - node = node_info_new (name); - - if (parser->node_stack != NULL) - { - node_info_add_node (parser->node_stack->data, - node); - } - - parser->node_stack = g_slist_prepend (parser->node_stack, - node); - - return TRUE; -} - -static gboolean -parse_interface (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - InterfaceInfo *iface; - NodeInfo *top; - - if (parser->interface || - parser->method || - parser->signal || - parser->property || - parser->arg || - parser->in_annotation || - (parser->node_stack == NULL)) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - NULL)) - return FALSE; - - if (name == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "name", element_name); - return FALSE; - } - - top = parser->node_stack->data; - - iface = interface_info_new (name); - node_info_add_interface (top, iface); - interface_info_unref (iface); - - parser->interface = iface; - - return TRUE; -} - -static gboolean -parse_method (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - MethodInfo *method; - - if (parser->interface == NULL || - parser->node_stack == NULL || - parser->method || - parser->signal || - parser->property || - parser->in_annotation || - parser->arg) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - NULL)) - return FALSE; - - if (name == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "name", element_name); - return FALSE; - } - - method = method_info_new (name); - interface_info_add_method (parser->interface, method); - method_info_unref (method); - - parser->method = method; - - return TRUE; -} - -static gboolean -parse_signal (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - SignalInfo *signal; - - if (parser->interface == NULL || - parser->node_stack == NULL || - parser->signal || - parser->method || - parser->property || - parser->in_annotation || - parser->arg) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - NULL)) - return FALSE; - - if (name == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "name", element_name); - return FALSE; - } - - signal = signal_info_new (name); - interface_info_add_signal (parser->interface, signal); - signal_info_unref (signal); - - parser->signal = signal; - - return TRUE; -} - -static gboolean -validate_signature (const char *str, - const char *element_name, - GError **error) -{ - DBusError derror; - - dbus_error_init (&derror); - - if (!dbus_signature_validate (str, &derror)) - { - dbus_set_g_error (error, &derror); - return FALSE; - } - return TRUE; -} - -static gboolean -parse_property (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - const char *access; - const char *type; - PropertyInfo *property; - PropertyAccessFlags access_flags; - - if (parser->interface == NULL || - parser->node_stack == NULL || - parser->signal || - parser->method || - parser->property || - parser->in_annotation || - parser->arg) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - "access", &access, - "type", &type, - NULL)) - return FALSE; - - if (name == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "name", element_name); - return FALSE; - } - - if (access == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "access", element_name); - return FALSE; - } - - if (type == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "type", element_name); - return FALSE; - } - - if (!validate_signature (type, element_name, error)) - return FALSE; - - access_flags = 0; - if (strcmp (access, "readwrite") == 0) - access_flags = PROPERTY_READ | PROPERTY_WRITE; - else if (strcmp (access, "read") == 0) - access_flags = PROPERTY_READ; - else if (strcmp (access, "write") == 0) - access_flags = PROPERTY_WRITE; - else - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("access=\"%s\" must have value readwrite, read, or write on %s\n"), - access, element_name); - return FALSE; - } - - property = property_info_new (name, type, access_flags); - interface_info_add_property (parser->interface, property); - property_info_unref (property); - - parser->property = property; - - return TRUE; -} - -static gboolean -parse_arg (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - const char *type; - const char *direction; - ArgDirection dir; - ArgInfo *arg; - char *generated_name; - - if (!(parser->method || parser->signal) || - parser->node_stack == NULL || - parser->property || - parser->in_annotation || - parser->arg) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - "type", &type, - "direction", &direction, - NULL)) - return FALSE; - - /* name can be null for args */ - - if (type == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "type", element_name); - return FALSE; - } - - if (direction == NULL) - { - /* methods default to in, signal to out */ - if (parser->method) - direction = "in"; - else if (parser->signal) - direction = "out"; - else - g_assert_not_reached (); - } - - dir = ARG_INVALID; - - if (strcmp (direction, "in") == 0) - dir = ARG_IN; - else if (strcmp (direction, "out") == 0) - dir = ARG_OUT; - - if (dir == ARG_INVALID || - (parser->signal && dir == ARG_IN)) - { - if (parser->signal) - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Signals must have direction=\"out\" (just omit the direction attribute)")); - else - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute on <%s> has value \"in\" or \"out\""), - "direction", element_name); - return FALSE; - } - - if (!validate_signature (type, element_name, error)) - return FALSE; - - generated_name = NULL; - if (name == NULL) - generated_name = g_strdup_printf ("arg%d", - parser->method ? - method_info_get_n_args (parser->method) : - signal_info_get_n_args (parser->signal)); - - arg = arg_info_new (name ? name : generated_name, dir, type); - if (parser->method) - method_info_add_arg (parser->method, arg); - else if (parser->signal) - signal_info_add_arg (parser->signal, arg); - else - g_assert_not_reached (); - - g_free (generated_name); - - arg_info_unref (arg); - - parser->arg = arg; - - return TRUE; -} - -static gboolean -parse_annotation (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - const char *name; - const char *value; - - if (!(parser->method || parser->interface || parser->arg) || - parser->node_stack == NULL || - parser->signal || - parser->property || - parser->in_annotation) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Can't put <%s> element here"), - element_name); - return FALSE; - } - - name = NULL; - if (!locate_attributes (element_name, attribute_names, - attribute_values, error, - "name", &name, - "value", &value, - NULL)) - return FALSE; - - if (name == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "name", element_name); - return FALSE; - } - if (value == NULL) - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("\"%s\" attribute required on <%s> element "), - "value", element_name); - return FALSE; - } - - if (parser->arg) - arg_info_add_annotation (parser->arg, name, value); - else if (parser->method) - method_info_add_annotation (parser->method, name, value); - else if (parser->interface) - interface_info_add_annotation (parser->interface, name, value); - else - g_assert_not_reached (); - - parser->in_annotation = TRUE; - - return TRUE; -} - -gboolean -parser_start_element (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error) -{ - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - if (ELEMENT_IS ("node")) - { - if (!parse_node (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else if (ELEMENT_IS ("interface")) - { - if (!parse_interface (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else if (ELEMENT_IS ("method")) - { - if (!parse_method (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else if (ELEMENT_IS ("signal")) - { - if (!parse_signal (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else if (ELEMENT_IS ("property")) - { - if (!parse_property (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else if (ELEMENT_IS ("arg")) - { - if (!parse_arg (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else if (ELEMENT_IS ("annotation")) - { - if (!parse_annotation (parser, element_name, attribute_names, - attribute_values, error)) - return FALSE; - } - else - { - g_set_error (error, G_MARKUP_ERROR, - G_MARKUP_ERROR_PARSE, - _("Element <%s> not recognized"), - element_name); - } - - return TRUE; -} - -gboolean -parser_end_element (Parser *parser, - const char *element_name, - GError **error) -{ - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - if (ELEMENT_IS ("interface")) - { - parser->interface = NULL; - } - else if (ELEMENT_IS ("method")) - { - parser->method = NULL; - } - else if (ELEMENT_IS ("signal")) - { - parser->signal = NULL; - } - else if (ELEMENT_IS ("property")) - { - parser->property = NULL; - } - else if (ELEMENT_IS ("arg")) - { - parser->arg = NULL; - } - else if (ELEMENT_IS ("annotation")) - { - parser->in_annotation = FALSE; - } - else if (ELEMENT_IS ("node")) - { - NodeInfo *top; - - g_assert (parser->node_stack != NULL); - top = parser->node_stack->data; - - parser->node_stack = g_slist_remove (parser->node_stack, - top); - - if (parser->node_stack == NULL) - parser->result = top; /* We are done, store the result */ - } - else - g_assert_not_reached (); /* should have had an error on start_element */ - - return TRUE; -} - -gboolean -parser_content (Parser *parser, - const char *content, - int len, - GError **error) -{ - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - /* FIXME check that it's all whitespace */ - - return TRUE; -} - -gboolean -parser_finished (Parser *parser, - GError **error) -{ - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - return TRUE; -} - -NodeInfo* -parser_get_nodes (Parser *parser) -{ - return parser->result; -} - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/dbus-gparser.h b/glib/dbus-gparser.h deleted file mode 100644 index d1b0aa04..00000000 --- a/glib/dbus-gparser.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gparser.h parse DBus description files - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_GLIB_PARSER_H -#define DBUS_GLIB_PARSER_H - -#include -#include -#include "dbus-gidl.h" - -G_BEGIN_DECLS - -typedef struct Parser Parser; - -Parser* parser_new (void); -Parser* parser_ref (Parser *parser); -void parser_unref (Parser *parser); -gboolean parser_check_doctype (Parser *parser, - const char *doctype, - GError **error); -gboolean parser_start_element (Parser *parser, - const char *element_name, - const char **attribute_names, - const char **attribute_values, - GError **error); -gboolean parser_end_element (Parser *parser, - const char *element_name, - GError **error); -gboolean parser_content (Parser *parser, - const char *content, - int len, - GError **error); -gboolean parser_finished (Parser *parser, - GError **error); - -NodeInfo* description_load_from_file (const char *filename, - GError **error); -NodeInfo* description_load_from_string (const char *str, - int len, - GError **error); - -NodeInfo* parser_get_nodes (Parser *parser); - -G_END_DECLS - -#endif /* DBUS_GLIB_GPARSER_H */ diff --git a/glib/dbus-gproxy.c b/glib/dbus-gproxy.c deleted file mode 100644 index e4243114..00000000 --- a/glib/dbus-gproxy.c +++ /dev/null @@ -1,2748 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gproxy.c Proxy for remote objects - * - * Copyright (C) 2003, 2004, 2005 Red Hat, Inc. - * Copyright (C) 2005 Nokia - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include "dbus-gutils.h" -#include "dbus-gsignature.h" -#include "dbus-gvalue.h" -#include "dbus-gvalue-utils.h" -#include "dbus-gobject.h" -#include -#include -#include - -#define DBUS_G_PROXY_CALL_TO_ID(x) (GPOINTER_TO_UINT(x)) -#define DBUS_G_PROXY_ID_TO_CALL(x) (GUINT_TO_POINTER(x)) -#define DBUS_G_PROXY_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUS_TYPE_G_PROXY, DBusGProxyPrivate)) - - -/** - * @addtogroup DBusGLibInternals - * - * @{ - */ - -/** - * DBusGProxyManager typedef - */ - -typedef struct _DBusGProxyManager DBusGProxyManager; - -typedef struct _DBusGProxyPrivate DBusGProxyPrivate; - -/** - * Internals of DBusGProxy - */ -struct _DBusGProxyPrivate -{ - DBusGProxyManager *manager; /**< Proxy manager */ - char *name; /**< Name messages go to or NULL */ - char *path; /**< Path messages go to or NULL */ - char *interface; /**< Interface messages go to or NULL */ - - DBusGProxyCall *name_call; /**< Pending call id to retrieve name owner */ - guint for_owner : 1; /**< Whether or not this proxy is for a name owner */ - guint associated : 1; /**< Whether or not this proxy is associated (for name proxies) */ - - /* FIXME: make threadsafe? */ - guint call_id_counter; /**< Integer counter for pending calls */ - - GData *signal_signatures; /**< D-BUS signatures for each signal */ - - GHashTable *pending_calls; /**< Calls made on this proxy which have not yet returned */ -}; - -static void dbus_g_proxy_init (DBusGProxy *proxy); -static void dbus_g_proxy_class_init (DBusGProxyClass *klass); -static GObject *dbus_g_proxy_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties); -static void dbus_g_proxy_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void dbus_g_proxy_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); - -static void dbus_g_proxy_finalize (GObject *object); -static void dbus_g_proxy_dispose (GObject *object); -static void dbus_g_proxy_destroy (DBusGProxy *proxy); -static void dbus_g_proxy_emit_remote_signal (DBusGProxy *proxy, - DBusMessage *message); - -static DBusGProxyCall *manager_begin_bus_call (DBusGProxyManager *manager, - const char *method, - DBusGProxyCallNotify notify, - gpointer data, - GDestroyNotify destroy, - GType first_arg_type, - ...); -static guint dbus_g_proxy_begin_call_internal (DBusGProxy *proxy, - const char *method, - DBusGProxyCallNotify notify, - gpointer data, - GDestroyNotify destroy, - GValueArray *args); -static gboolean dbus_g_proxy_end_call_internal (DBusGProxy *proxy, - guint call_id, - GError **error, - GType first_arg_type, - va_list args); - -/** - * A list of proxies with a given name+path+interface, used to - * route incoming signals. - */ -typedef struct -{ - GSList *proxies; /**< The list of proxies */ - - char name[4]; /**< name (empty string for none), nul byte, - * path, nul byte, - * interface, nul byte - */ - -} DBusGProxyList; - -/** - * DBusGProxyManager's primary task is to route signals to the proxies - * those signals are emitted on. In order to do this it also has to - * track the owners of the names proxies are bound to. - */ -struct _DBusGProxyManager -{ - GStaticMutex lock; /**< Thread lock */ - int refcount; /**< Reference count */ - DBusConnection *connection; /**< Connection we're associated with. */ - - DBusGProxy *bus_proxy; /**< Special internal proxy used to talk to the bus */ - - GHashTable *proxy_lists; /**< Hash used to route incoming signals - * and iterate over proxies - */ - GHashTable *owner_names; /**< Hash to keep track of mapping from - * base name -> [name,name,...] for proxies which - * are for names. - */ - GSList *unassociated_proxies; /**< List of name proxies for which - * there was no result for - * GetNameOwner - */ -}; - -static DBusGProxyManager *dbus_g_proxy_manager_ref (DBusGProxyManager *manager); -static DBusHandlerResult dbus_g_proxy_manager_filter (DBusConnection *connection, - DBusMessage *message, - void *user_data); - - -/** Lock the DBusGProxyManager */ -#define LOCK_MANAGER(mgr) (g_static_mutex_lock (&(mgr)->lock)) -/** Unlock the DBusGProxyManager */ -#define UNLOCK_MANAGER(mgr) (g_static_mutex_unlock (&(mgr)->lock)) - -static int g_proxy_manager_slot = -1; - -/* Lock controlling get/set manager as data on each connection */ -static GStaticMutex connection_g_proxy_lock = G_STATIC_MUTEX_INIT; - -static DBusGProxyManager* -dbus_g_proxy_manager_get (DBusConnection *connection) -{ - DBusGProxyManager *manager; - - dbus_connection_allocate_data_slot (&g_proxy_manager_slot); - if (g_proxy_manager_slot < 0) - g_error ("out of memory"); - - g_static_mutex_lock (&connection_g_proxy_lock); - - manager = dbus_connection_get_data (connection, g_proxy_manager_slot); - if (manager != NULL) - { - dbus_connection_free_data_slot (&g_proxy_manager_slot); - dbus_g_proxy_manager_ref (manager); - g_static_mutex_unlock (&connection_g_proxy_lock); - return manager; - } - - manager = g_new0 (DBusGProxyManager, 1); - - manager->refcount = 1; - manager->connection = connection; - - g_static_mutex_init (&manager->lock); - - /* Proxy managers keep the connection alive, which means that - * DBusGProxy indirectly does. To free a connection you have to free - * all the proxies referring to it. - */ - dbus_connection_ref (manager->connection); - - dbus_connection_set_data (connection, g_proxy_manager_slot, - manager, NULL); - - dbus_connection_add_filter (connection, dbus_g_proxy_manager_filter, - manager, NULL); - - g_static_mutex_unlock (&connection_g_proxy_lock); - - return manager; -} - -static DBusGProxyManager * -dbus_g_proxy_manager_ref (DBusGProxyManager *manager) -{ - g_assert (manager != NULL); - g_assert (manager->refcount > 0); - - LOCK_MANAGER (manager); - - manager->refcount += 1; - - UNLOCK_MANAGER (manager); - - return manager; -} - -static void -dbus_g_proxy_manager_unref (DBusGProxyManager *manager) -{ - g_assert (manager != NULL); - g_assert (manager->refcount > 0); - - LOCK_MANAGER (manager); - manager->refcount -= 1; - if (manager->refcount == 0) - { - UNLOCK_MANAGER (manager); - - if (manager->bus_proxy) - g_object_unref (manager->bus_proxy); - - if (manager->proxy_lists) - { - /* can't have any proxies left since they hold - * a reference to the proxy manager. - */ - g_assert (g_hash_table_size (manager->proxy_lists) == 0); - - g_hash_table_destroy (manager->proxy_lists); - manager->proxy_lists = NULL; - - } - - if (manager->owner_names) - { - /* Since we destroyed all proxies, none can be tracking - * name owners - */ - g_assert (g_hash_table_size (manager->owner_names) == 0); - - g_hash_table_destroy (manager->owner_names); - manager->owner_names = NULL; - } - - g_assert (manager->unassociated_proxies == NULL); - - g_static_mutex_free (&manager->lock); - - g_static_mutex_lock (&connection_g_proxy_lock); - - dbus_connection_remove_filter (manager->connection, dbus_g_proxy_manager_filter, - manager); - - dbus_connection_set_data (manager->connection, - g_proxy_manager_slot, - NULL, NULL); - - g_static_mutex_unlock (&connection_g_proxy_lock); - - dbus_connection_unref (manager->connection); - g_free (manager); - - dbus_connection_free_data_slot (&g_proxy_manager_slot); - } - else - { - UNLOCK_MANAGER (manager); - } -} - -static guint -tristring_hash (gconstpointer key) -{ - const char *p = key; - guint h = *p; - - if (h) - { - for (p += 1; *p != '\0'; p++) - h = (h << 5) - h + *p; - } - - /* skip nul and do the next substring */ - for (p += 1; *p != '\0'; p++) - h = (h << 5) - h + *p; - - /* skip nul again and another substring */ - for (p += 1; *p != '\0'; p++) - h = (h << 5) - h + *p; - - return h; -} - -static gboolean -strequal_len (const char *a, - const char *b, - size_t *lenp) -{ - size_t a_len; - size_t b_len; - - a_len = strlen (a); - b_len = strlen (b); - - if (a_len != b_len) - return FALSE; - - if (memcmp (a, b, a_len) != 0) - return FALSE; - - *lenp = a_len; - - return TRUE; -} - -static gboolean -tristring_equal (gconstpointer a, - gconstpointer b) -{ - const char *ap = a; - const char *bp = b; - size_t len; - - if (!strequal_len (ap, bp, &len)) - return FALSE; - - ap += len + 1; - bp += len + 1; - - if (!strequal_len (ap, bp, &len)) - return FALSE; - - ap += len + 1; - bp += len + 1; - - if (strcmp (ap, bp) != 0) - return FALSE; - - return TRUE; -} - -static char* -tristring_alloc_from_strings (size_t padding_before, - const char *name, - const char *path, - const char *interface) -{ - size_t name_len, iface_len, path_len, len; - char *tri; - - if (name) - name_len = strlen (name); - else - name_len = 0; - - path_len = strlen (path); - - iface_len = strlen (interface); - - tri = g_malloc (padding_before + name_len + path_len + iface_len + 3); - - len = padding_before; - - if (name) - memcpy (&tri[len], name, name_len); - - len += name_len; - tri[len] = '\0'; - len += 1; - - g_assert (len == (padding_before + name_len + 1)); - - memcpy (&tri[len], path, path_len); - len += path_len; - tri[len] = '\0'; - len += 1; - - g_assert (len == (padding_before + name_len + path_len + 2)); - - memcpy (&tri[len], interface, iface_len); - len += iface_len; - tri[len] = '\0'; - len += 1; - - g_assert (len == (padding_before + name_len + path_len + iface_len + 3)); - - return tri; -} - -static char* -tristring_from_proxy (DBusGProxy *proxy) -{ - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - return tristring_alloc_from_strings (0, - priv->name, - priv->path, - priv->interface); -} - -static char* -tristring_from_message (DBusMessage *message) -{ - const char *path; - const char *interface; - - path = dbus_message_get_path (message); - interface = dbus_message_get_interface (message); - - g_assert (path); - g_assert (interface); - - return tristring_alloc_from_strings (0, - dbus_message_get_sender (message), - path, interface); -} - -static DBusGProxyList* -g_proxy_list_new (DBusGProxy *first_proxy) -{ - DBusGProxyList *list; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(first_proxy); - - list = (void*) tristring_alloc_from_strings (G_STRUCT_OFFSET (DBusGProxyList, name), - priv->name, - priv->path, - priv->interface); - list->proxies = NULL; - - return list; -} - -static void -g_proxy_list_free (DBusGProxyList *list) -{ - /* we don't hold a reference to the proxies in the list, - * as they ref the GProxyManager - */ - g_slist_free (list->proxies); - - g_free (list); -} - -static char* -g_proxy_get_match_rule (DBusGProxy *proxy) -{ - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - /* FIXME Escaping is required here */ - - if (priv->name) - return g_strdup_printf ("type='signal',sender='%s',path='%s',interface='%s'", - priv->name, priv->path, priv->interface); - else - return g_strdup_printf ("type='signal',path='%s',interface='%s'", - priv->path, priv->interface); -} - -typedef struct -{ - char *name; - guint refcount; -} DBusGProxyNameOwnerInfo; - -static gint -find_name_in_info (gconstpointer a, gconstpointer b) -{ - const DBusGProxyNameOwnerInfo *info = a; - const char *name = b; - - return strcmp (info->name, name); -} - -typedef struct -{ - const char *name; - const char *owner; - DBusGProxyNameOwnerInfo *info; -} DBusGProxyNameOwnerForeachData; - -static void -name_owner_foreach (gpointer key, gpointer val, gpointer data) -{ - const char *owner; - DBusGProxyNameOwnerForeachData *foreach_data; - GSList *names; - GSList *link; - - owner = key; - names = val; - foreach_data = data; - - if (foreach_data->owner != NULL) - return; - - g_assert (foreach_data->info == NULL); - - link = g_slist_find_custom (names, foreach_data->name, find_name_in_info); - if (link) - { - foreach_data->owner = owner; - foreach_data->info = link->data; - } -} - -static gboolean -dbus_g_proxy_manager_lookup_name_owner (DBusGProxyManager *manager, - const char *name, - DBusGProxyNameOwnerInfo **info, - const char **owner) -{ - DBusGProxyNameOwnerForeachData foreach_data; - - foreach_data.name = name; - foreach_data.owner = NULL; - foreach_data.info = NULL; - - g_hash_table_foreach (manager->owner_names, name_owner_foreach, &foreach_data); - - *info = foreach_data.info; - *owner = foreach_data.owner; - return *info != NULL; -} - -static void -insert_nameinfo (DBusGProxyManager *manager, - const char *owner, - DBusGProxyNameOwnerInfo *info) -{ - GSList *names; - gboolean insert; - - names = g_hash_table_lookup (manager->owner_names, owner); - - /* Only need to g_hash_table_insert the first time */ - insert = (names == NULL); - - names = g_slist_append (names, info); - - if (insert) - g_hash_table_insert (manager->owner_names, g_strdup (owner), names); -} - -static void -dbus_g_proxy_manager_monitor_name_owner (DBusGProxyManager *manager, - const char *owner, - const char *name) -{ - GSList *names; - GSList *link; - DBusGProxyNameOwnerInfo *nameinfo; - - names = g_hash_table_lookup (manager->owner_names, owner); - link = g_slist_find_custom (names, name, find_name_in_info); - - if (!link) - { - nameinfo = g_new0 (DBusGProxyNameOwnerInfo, 1); - nameinfo->name = g_strdup (name); - nameinfo->refcount = 1; - - insert_nameinfo (manager, owner, nameinfo); - } - else - { - nameinfo = link->data; - nameinfo->refcount++; - } -} - -static void -dbus_g_proxy_manager_unmonitor_name_owner (DBusGProxyManager *manager, - const char *name) -{ - DBusGProxyNameOwnerInfo *info; - const char *owner; - gboolean ret; - - ret = dbus_g_proxy_manager_lookup_name_owner (manager, name, &info, &owner); - g_assert (ret); - g_assert (info != NULL); - g_assert (owner != NULL); - - info->refcount--; - if (info->refcount == 0) - { - GSList *names; - GSList *link; - - names = g_hash_table_lookup (manager->owner_names, owner); - link = g_slist_find_custom (names, name, find_name_in_info); - names = g_slist_delete_link (names, link); - if (names != NULL) - g_hash_table_insert (manager->owner_names, g_strdup (owner), names); - else - g_hash_table_remove (manager->owner_names, owner); - - g_free (info->name); - g_free (info); - } -} - -typedef struct -{ - const char *name; - GSList *destroyed; -} DBusGProxyUnassociateData; - -static void -unassociate_proxies (gpointer key, gpointer val, gpointer user_data) -{ - DBusGProxyList *list; - const char *name; - GSList *tmp; - DBusGProxyUnassociateData *data; - - list = val; - data = user_data; - name = data->name; - - for (tmp = list->proxies; tmp; tmp = tmp->next) - { - DBusGProxy *proxy = DBUS_G_PROXY (tmp->data); - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - DBusGProxyManager *manager; - - manager = priv->manager; - - if (!strcmp (priv->name, name)) - { - if (!priv->for_owner) - { - g_assert (priv->associated); - g_assert (priv->name_call == NULL); - - priv->associated = FALSE; - manager->unassociated_proxies = g_slist_prepend (manager->unassociated_proxies, proxy); - } - else - { - data->destroyed = g_slist_prepend (data->destroyed, proxy); - } - } - } -} - -static void -dbus_g_proxy_manager_replace_name_owner (DBusGProxyManager *manager, - const char *name, - const char *prev_owner, - const char *new_owner) -{ - GSList *names; - - if (prev_owner[0] == '\0') - { - GSList *tmp; - GSList *removed; - - /* We have a new service, look at unassociated proxies */ - - removed = NULL; - - for (tmp = manager->unassociated_proxies; tmp ; tmp = tmp->next) - { - DBusGProxy *proxy = tmp->data; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - if (!strcmp (priv->name, name)) - { - removed = g_slist_prepend (removed, tmp); - - dbus_g_proxy_manager_monitor_name_owner (manager, new_owner, name); - priv->associated = TRUE; - } - } - - for (tmp = removed; tmp; tmp = tmp->next) - manager->unassociated_proxies = g_slist_delete_link (manager->unassociated_proxies, tmp->data); - g_slist_free (removed); - } - else - { - DBusGProxyNameOwnerInfo *info; - GSList *link; - - /* Name owner changed or deleted */ - - names = g_hash_table_lookup (manager->owner_names, prev_owner); - - link = g_slist_find_custom (names, name, find_name_in_info); - - info = NULL; - if (link != NULL) - { - info = link->data; - - names = g_slist_delete_link (names, link); - - if (names == NULL) - g_hash_table_remove (manager->owner_names, prev_owner); - } - - if (new_owner[0] == '\0') - { - DBusGProxyUnassociateData data; - GSList *tmp; - - data.name = name; - data.destroyed = NULL; - - /* A service went away, we need to unassociate proxies */ - g_hash_table_foreach (manager->proxy_lists, - unassociate_proxies, &data); - - UNLOCK_MANAGER (manager); - - for (tmp = data.destroyed; tmp; tmp = tmp->next) - dbus_g_proxy_destroy (tmp->data); - g_slist_free (data.destroyed); - - LOCK_MANAGER (manager); - } - else - { - insert_nameinfo (manager, new_owner, info); - } - } -} - -static void -got_name_owner_cb (DBusGProxy *bus_proxy, - DBusGProxyCall *call, - void *user_data) -{ - DBusGProxy *proxy = user_data; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - GError *error; - char *owner; - - error = NULL; - owner = NULL; - - LOCK_MANAGER (priv->manager); - - if (!dbus_g_proxy_end_call (bus_proxy, call, &error, - G_TYPE_STRING, &owner, - G_TYPE_INVALID)) - { - if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NAME_HAS_NO_OWNER) - { - priv->manager->unassociated_proxies = g_slist_prepend (priv->manager->unassociated_proxies, proxy); - } - else - g_warning ("Couldn't get name owner (%s): %s", - dbus_g_error_get_name (error), - error->message); - - g_clear_error (&error); - goto out; - } - else - { - dbus_g_proxy_manager_monitor_name_owner (priv->manager, owner, priv->name); - priv->associated = TRUE; - } - - out: - priv->name_call = NULL; - UNLOCK_MANAGER (priv->manager); - g_free (owner); -} - -static char * -get_name_owner (DBusConnection *connection, - const char *name, - GError **error) -{ - DBusError derror; - DBusMessage *request, *reply; - char *base_name; - - dbus_error_init (&derror); - - base_name = NULL; - reply = NULL; - - request = dbus_message_new_method_call (DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - "GetNameOwner"); - if (request == NULL) - g_error ("Out of memory"); - - if (!dbus_message_append_args (request, - DBUS_TYPE_STRING, &name, - DBUS_TYPE_INVALID)) - g_error ("Out of memory"); - - reply = - dbus_connection_send_with_reply_and_block (connection, - request, - 2000, &derror); - if (reply == NULL) - goto error; - - if (dbus_set_error_from_message (&derror, reply)) - goto error; - - if (!dbus_message_get_args (reply, &derror, - DBUS_TYPE_STRING, &base_name, - DBUS_TYPE_INVALID)) - goto error; - - base_name = g_strdup (base_name); - goto out; - - error: - g_assert (dbus_error_is_set (&derror)); - dbus_set_g_error (error, &derror); - dbus_error_free (&derror); - - out: - if (request) - dbus_message_unref (request); - if (reply) - dbus_message_unref (reply); - - return base_name; -} - - -static void -dbus_g_proxy_manager_register (DBusGProxyManager *manager, - DBusGProxy *proxy) -{ - DBusGProxyList *list; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - LOCK_MANAGER (manager); - - if (manager->proxy_lists == NULL) - { - g_assert (manager->owner_names == NULL); - - list = NULL; - manager->proxy_lists = g_hash_table_new_full (tristring_hash, - tristring_equal, - NULL, - (GFreeFunc) g_proxy_list_free); - manager->owner_names = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, - NULL); - /* FIXME - for now we listen for all NameOwnerChanged; once - * Anders' detail patch lands we should add individual rules - */ - dbus_bus_add_match (manager->connection, - "type='signal',sender='" DBUS_SERVICE_DBUS - "',path='" DBUS_PATH_DBUS - "',interface='" DBUS_INTERFACE_DBUS - "',member='NameOwnerChanged'", - NULL); - } - else - { - char *tri; - - tri = tristring_from_proxy (proxy); - - list = g_hash_table_lookup (manager->proxy_lists, tri); - - g_free (tri); - } - - if (list == NULL) - { - list = g_proxy_list_new (proxy); - - g_hash_table_replace (manager->proxy_lists, - list->name, list); - } - - if (list->proxies == NULL) - { - /* We have to add the match rule to the server, - * but FIXME only if the server is a message bus, - * not if it's a peer. - */ - char *rule; - - rule = g_proxy_get_match_rule (proxy); - - /* We don't check for errors; it's not like anyone would handle them, - * and we don't want a round trip here. - */ - dbus_bus_add_match (manager->connection, - rule, NULL); - - g_free (rule); - } - - g_assert (g_slist_find (list->proxies, proxy) == NULL); - - list->proxies = g_slist_prepend (list->proxies, proxy); - - if (!priv->for_owner) - { - const char *owner; - DBusGProxyNameOwnerInfo *info; - - if (!dbus_g_proxy_manager_lookup_name_owner (manager, priv->name, &info, &owner)) - { - priv->name_call = manager_begin_bus_call (manager, "GetNameOwner", - got_name_owner_cb, - proxy, NULL, - G_TYPE_STRING, - priv->name, - G_TYPE_INVALID); - - priv->associated = FALSE; - } - else - { - info->refcount++; - priv->associated = TRUE; - } - } - - UNLOCK_MANAGER (manager); -} - -static void -dbus_g_proxy_manager_unregister (DBusGProxyManager *manager, - DBusGProxy *proxy) -{ - DBusGProxyList *list; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - char *tri; - - LOCK_MANAGER (manager); - -#ifndef G_DISABLE_CHECKS - if (manager->proxy_lists == NULL) - { - g_warning ("Trying to unregister a proxy but there aren't any registered"); - return; - } -#endif - - tri = tristring_from_proxy (proxy); - - list = g_hash_table_lookup (manager->proxy_lists, tri); - -#ifndef G_DISABLE_CHECKS - if (list == NULL) - { - g_warning ("Trying to unregister a proxy but it isn't registered"); - return; - } -#endif - - g_assert (g_slist_find (list->proxies, proxy) != NULL); - - list->proxies = g_slist_remove (list->proxies, proxy); - - g_assert (g_slist_find (list->proxies, proxy) == NULL); - - if (!priv->for_owner) - { - if (!priv->associated) - { - GSList *link; - - if (priv->name_call != 0) - { - dbus_g_proxy_cancel_call (manager->bus_proxy, priv->name_call); - priv->name_call = 0; - } - else - { - link = g_slist_find (manager->unassociated_proxies, proxy); - g_assert (link != NULL); - - manager->unassociated_proxies = g_slist_delete_link (manager->unassociated_proxies, link); - } - } - else - { - g_assert (priv->name_call == 0); - - dbus_g_proxy_manager_unmonitor_name_owner (manager, priv->name); - } - } - - if (list->proxies == NULL) - { - char *rule; - g_hash_table_remove (manager->proxy_lists, - tri); - list = NULL; - - rule = g_proxy_get_match_rule (proxy); - dbus_bus_remove_match (manager->connection, - rule, NULL); - g_free (rule); - } - - if (g_hash_table_size (manager->proxy_lists) == 0) - { - g_hash_table_destroy (manager->proxy_lists); - manager->proxy_lists = NULL; - } - - g_free (tri); - - UNLOCK_MANAGER (manager); -} - -static void -list_proxies_foreach (gpointer key, - gpointer value, - gpointer user_data) -{ - DBusGProxyList *list; - GSList **ret; - GSList *tmp; - - list = value; - ret = user_data; - - tmp = list->proxies; - while (tmp != NULL) - { - DBusGProxy *proxy = DBUS_G_PROXY (tmp->data); - - g_object_ref (proxy); - *ret = g_slist_prepend (*ret, proxy); - - tmp = tmp->next; - } -} - -static GSList* -dbus_g_proxy_manager_list_all (DBusGProxyManager *manager) -{ - GSList *ret; - - ret = NULL; - - if (manager->proxy_lists) - { - g_hash_table_foreach (manager->proxy_lists, - list_proxies_foreach, - &ret); - } - - return ret; -} - -static DBusHandlerResult -dbus_g_proxy_manager_filter (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - DBusGProxyManager *manager; - - if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - - manager = user_data; - - dbus_g_proxy_manager_ref (manager); - - LOCK_MANAGER (manager); - - if (dbus_message_is_signal (message, - DBUS_INTERFACE_LOCAL, - "Disconnected")) - { - /* Destroy all the proxies, quite possibly resulting in unreferencing - * the proxy manager and the connection as well. - */ - GSList *all; - GSList *tmp; - - all = dbus_g_proxy_manager_list_all (manager); - - tmp = all; - while (tmp != NULL) - { - DBusGProxy *proxy; - - proxy = DBUS_G_PROXY (tmp->data); - - UNLOCK_MANAGER (manager); - dbus_g_proxy_destroy (proxy); - g_object_unref (G_OBJECT (proxy)); - LOCK_MANAGER (manager); - - tmp = tmp->next; - } - - g_slist_free (all); - -#ifndef G_DISABLE_CHECKS - if (manager->proxy_lists != NULL) - g_warning ("Disconnection emitted \"destroy\" on all DBusGProxy, but somehow new proxies were created in response to one of those destroy signals. This will cause a memory leak."); -#endif - } - else - { - char *tri; - GSList *full_list; - GSList *owned_names; - GSList *tmp; - const char *sender; - - /* First we handle NameOwnerChanged internally */ - if (dbus_message_is_signal (message, - DBUS_INTERFACE_DBUS, - "NameOwnerChanged")) - { - const char *name; - const char *prev_owner; - const char *new_owner; - DBusError derr; - - dbus_error_init (&derr); - if (!dbus_message_get_args (message, - &derr, - DBUS_TYPE_STRING, - &name, - DBUS_TYPE_STRING, - &prev_owner, - DBUS_TYPE_STRING, - &new_owner, - DBUS_TYPE_INVALID)) - { - /* Ignore this error */ - dbus_error_free (&derr); - } - else if (manager->owner_names != NULL) - { - dbus_g_proxy_manager_replace_name_owner (manager, name, prev_owner, new_owner); - } - } - - sender = dbus_message_get_sender (message); - - /* dbus spec requires these, libdbus validates */ - g_assert (sender != NULL); - g_assert (dbus_message_get_path (message) != NULL); - g_assert (dbus_message_get_interface (message) != NULL); - g_assert (dbus_message_get_member (message) != NULL); - - tri = tristring_from_message (message); - - if (manager->proxy_lists) - { - DBusGProxyList *owner_list; - owner_list = g_hash_table_lookup (manager->proxy_lists, tri); - if (owner_list) - full_list = g_slist_copy (owner_list->proxies); - else - full_list = NULL; - } - else - full_list = NULL; - - g_free (tri); - - if (manager->owner_names) - { - owned_names = g_hash_table_lookup (manager->owner_names, sender); - for (tmp = owned_names; tmp; tmp = tmp->next) - { - DBusGProxyList *owner_list; - DBusGProxyNameOwnerInfo *nameinfo; - - nameinfo = tmp->data; - g_assert (nameinfo->refcount > 0); - tri = tristring_alloc_from_strings (0, nameinfo->name, - dbus_message_get_path (message), - dbus_message_get_interface (message)); - - owner_list = g_hash_table_lookup (manager->proxy_lists, tri); - if (owner_list != NULL) - full_list = g_slist_concat (full_list, g_slist_copy (owner_list->proxies)); - g_free (tri); - } - } - -#if 0 - g_print ("proxy got %s,%s,%s = list %p\n", - tri, - tri + strlen (tri) + 1, - tri + strlen (tri) + 1 + strlen (tri + strlen (tri) + 1) + 1, - list); -#endif - - /* Emit the signal */ - - g_slist_foreach (full_list, (GFunc) g_object_ref, NULL); - - for (tmp = full_list; tmp; tmp = tmp->next) - { - DBusGProxy *proxy; - - proxy = DBUS_G_PROXY (tmp->data); - - UNLOCK_MANAGER (manager); - dbus_g_proxy_emit_remote_signal (proxy, message); - g_object_unref (G_OBJECT (proxy)); - LOCK_MANAGER (manager); - } - g_slist_free (full_list); - } - - UNLOCK_MANAGER (manager); - dbus_g_proxy_manager_unref (manager); - - /* "Handling" signals doesn't make sense, they are for everyone - * who cares - */ - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - - - -/* ---------- DBusGProxy -------------- */ -#define DBUS_G_PROXY_DESTROYED(proxy) (DBUS_G_PROXY_GET_PRIVATE(proxy)->manager == NULL) - -static void -marshal_dbus_message_to_g_marshaller (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); -enum -{ - PROP_0, - PROP_NAME, - PROP_PATH, - PROP_INTERFACE, - PROP_CONNECTION -}; - -enum -{ - DESTROY, - RECEIVED, - LAST_SIGNAL -}; - -static void *parent_class; -static guint signals[LAST_SIGNAL] = { 0 }; - -static void -dbus_g_proxy_init (DBusGProxy *proxy) -{ - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - g_datalist_init (&priv->signal_signatures); - priv->pending_calls = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) dbus_pending_call_unref); - priv->name_call = 0; - priv->associated = FALSE; -} - -static GObject * -dbus_g_proxy_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties) -{ - DBusGProxy *proxy; - DBusGProxyClass *klass; - GObjectClass *parent_class; - DBusGProxyPrivate *priv; - - klass = DBUS_G_PROXY_CLASS (g_type_class_peek (DBUS_TYPE_G_PROXY)); - - parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); - - proxy = DBUS_G_PROXY (parent_class->constructor (type, n_construct_properties, - construct_properties)); - - priv = DBUS_G_PROXY_GET_PRIVATE (proxy); - - /* if these assertions fail, a deriving class has not set our required - * parameters - our own public constructors do return_if_fail checks - * on these parameters being provided. unfortunately we can't assert - * for manager because it's allowed to be NULL when tha mangager is - * setting up a bus proxy for its own calls */ - g_assert (priv->name != NULL); - g_assert (priv->path != NULL); - g_assert (priv->interface != NULL); - - if (priv->manager != NULL) - { - dbus_g_proxy_manager_register (priv->manager, proxy); - } - - return G_OBJECT (proxy); -} - -static void -dbus_g_proxy_class_init (DBusGProxyClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - parent_class = g_type_class_peek_parent (klass); - - g_type_class_add_private (klass, sizeof (DBusGProxyPrivate)); - - object_class->set_property = dbus_g_proxy_set_property; - object_class->get_property = dbus_g_proxy_get_property; - - g_object_class_install_property (object_class, - PROP_NAME, - g_param_spec_string ("name", - "name", - "name", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_PATH, - g_param_spec_string ("path", - "path", - "path", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_INTERFACE, - g_param_spec_string ("interface", - "interface", - "interface", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - g_object_class_install_property (object_class, - PROP_CONNECTION, - g_param_spec_boxed ("connection", - "connection", - "connection", - DBUS_TYPE_G_CONNECTION, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - object_class->finalize = dbus_g_proxy_finalize; - object_class->dispose = dbus_g_proxy_dispose; - object_class->constructor = dbus_g_proxy_constructor; - - signals[DESTROY] = - g_signal_new ("destroy", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[RECEIVED] = - g_signal_new ("received", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - marshal_dbus_message_to_g_marshaller, - G_TYPE_NONE, 2, DBUS_TYPE_MESSAGE, G_TYPE_POINTER); -} - -static void -cancel_pending_call (gpointer key, gpointer val, gpointer data) -{ - DBusGProxyCall *call = key; - DBusGProxy *proxy = data; - - dbus_g_proxy_cancel_call (proxy, call); -} - -static void -dbus_g_proxy_dispose (GObject *object) -{ - DBusGProxy *proxy = DBUS_G_PROXY (object); - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - if (priv->pending_calls == NULL) - { - return; - } - - /* Cancel outgoing pending calls */ - g_hash_table_foreach (priv->pending_calls, cancel_pending_call, proxy); - g_hash_table_destroy (priv->pending_calls); - priv->pending_calls = NULL; - - if (priv->manager && proxy != priv->manager->bus_proxy) - { - dbus_g_proxy_manager_unregister (priv->manager, proxy); - dbus_g_proxy_manager_unref (priv->manager); - } - priv->manager = NULL; - - g_datalist_clear (&priv->signal_signatures); - - g_signal_emit (object, signals[DESTROY], 0); - - G_OBJECT_CLASS (parent_class)->dispose (object); -} - -static void -dbus_g_proxy_finalize (GObject *object) -{ - DBusGProxy *proxy = DBUS_G_PROXY (object); - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - g_return_if_fail (DBUS_G_PROXY_DESTROYED (proxy)); - - g_free (priv->name); - g_free (priv->path); - g_free (priv->interface); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void -dbus_g_proxy_destroy (DBusGProxy *proxy) -{ - /* FIXME do we need the GTK_IN_DESTRUCTION style flag - * from GtkObject? - */ - g_object_run_dispose (G_OBJECT (proxy)); -} - -static void -dbus_g_proxy_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - DBusGProxy *proxy = DBUS_G_PROXY (object); - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - DBusGConnection *connection; - - switch (prop_id) - { - case PROP_NAME: - priv->name = g_strdup (g_value_get_string (value)); - priv->for_owner = (priv->name[0] == ':'); - break; - case PROP_PATH: - priv->path = g_strdup (g_value_get_string (value)); - break; - case PROP_INTERFACE: - priv->interface = g_strdup (g_value_get_string (value)); - break; - case PROP_CONNECTION: - connection = g_value_get_boxed (value); - if (connection != NULL) - { - priv->manager = dbus_g_proxy_manager_get (DBUS_CONNECTION_FROM_G_CONNECTION (connection)); - } - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -dbus_g_proxy_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - DBusGProxy *proxy = DBUS_G_PROXY (object); - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - switch (prop_id) - { - case PROP_NAME: - g_value_set_string (value, priv->name); - break; - case PROP_PATH: - g_value_set_string (value, priv->path); - break; - case PROP_INTERFACE: - g_value_set_string (value, priv->interface); - break; - case PROP_CONNECTION: - g_value_set_boxed (value, DBUS_G_CONNECTION_FROM_CONNECTION(priv->manager->connection)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -/* this is to avoid people using g_signal_connect() directly, - * to avoid confusion with local signal names, and because - * of the horribly broken current setup (signals are added - * globally to all proxies) - */ -static char* -create_signal_name (const char *interface, - const char *signal) -{ - GString *str; - char *p; - - str = g_string_new (interface); - - g_string_append (str, "-"); - - g_string_append (str, signal); - - /* GLib will silently barf on '.' in signal names */ - p = str->str; - while (*p) - { - if (*p == '.') - *p = '-'; - ++p; - } - - return g_string_free (str, FALSE); -} - -static void -marshal_dbus_message_to_g_marshaller (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - /* Incoming here we have three params, the instance (Proxy), the - * DBusMessage, the signature. We want to convert that to an - * expanded GValue array, then call an appropriate normal GLib - * marshaller. - */ -#define MAX_SIGNATURE_ARGS 20 - GValueArray *value_array; - GSignalCMarshaller c_marshaller; - DBusGProxy *proxy; - DBusMessage *message; - GArray *gsignature; - const GType *types; - DBusGProxyPrivate *priv; - - g_assert (n_param_values == 3); - - proxy = g_value_get_object (¶m_values[0]); - message = g_value_get_boxed (¶m_values[1]); - gsignature = g_value_get_pointer (¶m_values[2]); - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (message != NULL); - g_return_if_fail (gsignature != NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - c_marshaller = _dbus_gobject_lookup_marshaller (G_TYPE_NONE, gsignature->len, - (GType*) gsignature->data); - - g_return_if_fail (c_marshaller != NULL); - - { - DBusGValueMarshalCtx context; - context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (priv->manager->connection); - context.proxy = proxy; - - types = (const GType*) gsignature->data; - value_array = _dbus_gvalue_demarshal_message (&context, message, - gsignature->len, types, NULL); - } - - if (value_array == NULL) - return; - - g_value_array_prepend (value_array, NULL); - g_value_init (g_value_array_get_nth (value_array, 0), G_TYPE_FROM_INSTANCE (proxy)); - g_value_set_instance (g_value_array_get_nth (value_array, 0), proxy); - - (* c_marshaller) (closure, return_value, value_array->n_values, - value_array->values, invocation_hint, marshal_data); - - g_value_array_free (value_array); -} - -static void -dbus_g_proxy_emit_remote_signal (DBusGProxy *proxy, - DBusMessage *message) -{ - const char *interface; - const char *signal; - char *name; - GQuark q; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - GArray *msg_gsignature = NULL; - - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - - interface = dbus_message_get_interface (message); - signal = dbus_message_get_member (message); - - g_assert (interface != NULL); - g_assert (signal != NULL); - - name = create_signal_name (interface, signal); - - /* If the quark isn't preexisting, there's no way there - * are any handlers connected. We don't want to create - * extra quarks for every possible signal. - */ - q = g_quark_try_string (name); - - if (q != 0) - { - GArray *gsignature; - guint i; - - gsignature = g_datalist_id_get_data (&priv->signal_signatures, q); - if (gsignature == NULL) - goto out; - - msg_gsignature = _dbus_gtypes_from_arg_signature (dbus_message_get_signature (message), - TRUE); - for (i = 0; i < gsignature->len; i++) - { - if (msg_gsignature->len == i - || g_array_index (gsignature, GType, i) != g_array_index (msg_gsignature, GType, i)) - goto mismatch; - } - if (msg_gsignature->len != i) - goto mismatch; - - g_signal_emit (proxy, - signals[RECEIVED], - q, - message, - msg_gsignature); - } - - out: - g_free (name); - if (msg_gsignature) - g_array_free (msg_gsignature, TRUE); - return; - mismatch: -#if 0 - /* Don't spew on remote errors */ - g_warning ("Unexpected message signature '%s' for signal '%s'\n", - dbus_message_get_signature (message), - name); -#endif - goto out; -} - -typedef struct -{ - DBusGProxy *proxy; - guint call_id; - DBusGProxyCallNotify func; - void *data; - GDestroyNotify free_data_func; -} GPendingNotifyClosure; - -static void -d_pending_call_notify (DBusPendingCall *dcall, - void *data) -{ - GPendingNotifyClosure *closure = data; - - (* closure->func) (closure->proxy, DBUS_G_PROXY_ID_TO_CALL (closure->call_id), closure->data); -} - -static void -d_pending_call_free (void *data) -{ - GPendingNotifyClosure *closure = data; - - if (closure->free_data_func) - (* closure->free_data_func) (closure->data); - - g_free (closure); -} - -#define DBUS_G_VALUE_ARRAY_COLLECT_ALL(VALARRAY, FIRST_ARG_TYPE, ARGS) \ -do { \ - GType valtype; \ - int i = 0; \ - VALARRAY = g_value_array_new (6); \ - valtype = FIRST_ARG_TYPE; \ - while (valtype != G_TYPE_INVALID) \ - { \ - const char *collect_err; \ - GValue *val; \ - g_value_array_append (VALARRAY, NULL); \ - val = g_value_array_get_nth (VALARRAY, i); \ - g_value_init (val, valtype); \ - collect_err = NULL; \ - G_VALUE_COLLECT (val, ARGS, G_VALUE_NOCOPY_CONTENTS, &collect_err); \ - valtype = va_arg (ARGS, GType); \ - i++; \ - } \ -} while (0) - -DBusGProxyCall * -manager_begin_bus_call (DBusGProxyManager *manager, - const char *method, - DBusGProxyCallNotify notify, - gpointer user_data, - GDestroyNotify destroy, - GType first_arg_type, - ...) -{ - DBusGProxyCall *call; - DBusGProxyPrivate *priv; - va_list args; - GValueArray *arg_values; - - va_start (args, first_arg_type); - - if (!manager->bus_proxy) - { - manager->bus_proxy = g_object_new (DBUS_TYPE_G_PROXY, - "name", DBUS_SERVICE_DBUS, - "path", DBUS_PATH_DBUS, - "interface", DBUS_INTERFACE_DBUS, - NULL); - priv = DBUS_G_PROXY_GET_PRIVATE(manager->bus_proxy); - priv->manager = manager; - } - - DBUS_G_VALUE_ARRAY_COLLECT_ALL (arg_values, first_arg_type, args); - - call = DBUS_G_PROXY_ID_TO_CALL (dbus_g_proxy_begin_call_internal (manager->bus_proxy, method, notify, user_data, destroy, arg_values)); - - g_value_array_free (arg_values); - - va_end (args); - - return call; -} - -/** @} End of DBusGLibInternals */ - -/** @addtogroup DBusGLib - * @{ - */ - -/** - * Standard GObject get_type() function for DBusGProxy. - * - * @returns type ID for DBusGProxy class - */ -GType -dbus_g_proxy_get_type (void) -{ - static GType object_type = 0; - - if (!object_type) - { - static const GTypeInfo object_info = - { - sizeof (DBusGProxyClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) dbus_g_proxy_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (DBusGProxy), - 0, /* n_preallocs */ - (GInstanceInitFunc) dbus_g_proxy_init, - }; - - object_type = g_type_register_static (G_TYPE_OBJECT, - "DBusGProxy", - &object_info, 0); - } - - return object_type; -} - -static DBusGProxy* -dbus_g_proxy_new (DBusGConnection *connection, - const char *name, - const char *path_name, - const char *interface_name) -{ - DBusGProxy *proxy; - - g_assert (connection != NULL); - - proxy = g_object_new (DBUS_TYPE_G_PROXY, - "name", name, - "path", path_name, - "interface", interface_name, - "connection", connection, NULL); - - return proxy; -} - -/** - * Creates a new proxy for a remote interface exported by a connection - * on a message bus. Method calls and signal connections over this - * proxy will go to the name owner; the name's owner is expected to - * support the given interface name. THE NAME OWNER MAY CHANGE OVER - * TIME, for example between two different method calls, unless the - * name is a unique name. If you need a fixed owner, you need to - * request the current owner and bind a proxy to its unique name - * rather than to the generic name; see - * dbus_g_proxy_new_for_name_owner(). - * - * A name-associated proxy only makes sense with a message bus, not - * for app-to-app direct dbus connections. - * - * This proxy will only emit the "destroy" signal if the - * #DBusConnection is disconnected, the proxy has no remaining - * references, or the name is a unique name and its owner - * disappears. If a well-known name changes owner, the proxy will - * still be alive. - * - * @param connection the connection to the remote bus - * @param name any name on the message bus - * @param path_name name of the object instance to call methods on - * @param interface_name name of the interface to call methods on - * @returns new proxy object - */ -DBusGProxy* -dbus_g_proxy_new_for_name (DBusGConnection *connection, - const char *name, - const char *path_name, - const char *interface_name) -{ - g_return_val_if_fail (connection != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - g_return_val_if_fail (path_name != NULL, NULL); - g_return_val_if_fail (interface_name != NULL, NULL); - - return dbus_g_proxy_new (connection, name, - path_name, interface_name); -} - -/** - * Similar to dbus_g_proxy_new_for_name(), but makes a round-trip - * request to the message bus to get the current name owner, then - * binds the proxy to the unique name of the current owner, rather - * than to the well-known name. As a result, the name owner will - * not change over time, and the proxy will emit the "destroy" signal - * when the owner disappears from the message bus. - * - * An example of the difference between dbus_g_proxy_new_for_name() - * and dbus_g_proxy_new_for_name_owner(): if you provide the well-known name - * "org.freedesktop.Database" dbus_g_proxy_new_for_name() remains bound - * to that name as it changes owner. dbus_g_proxy_new_for_name_owner() - * will fail if the name has no owner. If the name has an owner, - * dbus_g_proxy_new_for_name_owner() will bind to the unique name - * of that owner rather than the generic name. - * - * @param connection the connection to the remote bus - * @param name any name on the message bus - * @param path_name name of the object inside the service to call methods on - * @param interface_name name of the interface to call methods on - * @param error return location for an error - * @returns new proxy object, or #NULL on error - */ -DBusGProxy* -dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, - const char *name, - const char *path_name, - const char *interface_name, - GError **error) -{ - DBusGProxy *proxy; - char *unique_name; - - g_return_val_if_fail (connection != NULL, NULL); - g_return_val_if_fail (name != NULL, NULL); - g_return_val_if_fail (path_name != NULL, NULL); - g_return_val_if_fail (interface_name != NULL, NULL); - - if (!(unique_name = get_name_owner (DBUS_CONNECTION_FROM_G_CONNECTION (connection), name, error))) - return NULL; - - proxy = dbus_g_proxy_new (connection, unique_name, - path_name, interface_name); - g_free (unique_name); - return proxy; -} - -/** - * Creates a proxy using an existing proxy as a template, substituting - * the specified interface and path. Either or both may be NULL. - * - * @param proxy the proxy to use as a template - * @param path of the object inside the peer to call methods on - * @param interface name of the interface to call methods on - * @returns new proxy object - * - */ -DBusGProxy* -dbus_g_proxy_new_from_proxy (DBusGProxy *proxy, - const char *interface, - const char *path) -{ - DBusGProxyPrivate *priv; - - g_return_val_if_fail (proxy != NULL, NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - if (interface == NULL) - interface = priv->interface; - if (path == NULL) - path = priv->path; - - return dbus_g_proxy_new (DBUS_G_CONNECTION_FROM_CONNECTION (priv->manager->connection), - priv->name, - path, interface); -} - -/** - * Creates a proxy for an object in peer application (one - * we're directly connected to). That is, this function is - * intended for use when there's no message bus involved, - * we're doing a simple 1-to-1 communication between two - * applications. - * - * - * @param connection the connection to the peer - * @param path_name name of the object inside the peer to call methods on - * @param interface_name name of the interface to call methods on - * @returns new proxy object - * - */ -DBusGProxy* -dbus_g_proxy_new_for_peer (DBusGConnection *connection, - const char *path_name, - const char *interface_name) -{ - DBusGProxy *proxy; - - g_return_val_if_fail (connection != NULL, NULL); - g_return_val_if_fail (path_name != NULL, NULL); - g_return_val_if_fail (interface_name != NULL, NULL); - - proxy = dbus_g_proxy_new (connection, NULL, - path_name, interface_name); - - return proxy; -} - -/** - * Gets the bus name a proxy is bound to (may be #NULL in some cases). - * If you created the proxy with dbus_g_proxy_new_for_name(), then - * the name you passed to that will be returned. - * If you created it with dbus_g_proxy_new_for_name_owner(), then the - * unique connection name will be returned. If you created it - * with dbus_g_proxy_new_for_peer() then #NULL will be returned. - * - * @param proxy the proxy - * @returns the bus name the proxy sends messages to - */ -const char* -dbus_g_proxy_get_bus_name (DBusGProxy *proxy) -{ - DBusGProxyPrivate *priv; - - g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); - g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - return priv->name; -} - -/** - * Gets the object interface proxy is bound to (may be #NULL in some cases). - * - * @param proxy the proxy - * @returns an object interface - */ -const char* -dbus_g_proxy_get_interface (DBusGProxy *proxy) -{ - DBusGProxyPrivate *priv; - - g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); - g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - return priv->interface; -} - -/** - * Sets the object interface proxy is bound to - * - * @param proxy the proxy - * @param interface_name an object interface - */ -void -dbus_g_proxy_set_interface (DBusGProxy *proxy, - const char *interface_name) -{ - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - /* FIXME - need to unregister when we switch interface for now - * later should support idea of unset interface - */ - dbus_g_proxy_manager_unregister (priv->manager, proxy); - g_free (priv->interface); - priv->interface = g_strdup (interface_name); - dbus_g_proxy_manager_register (priv->manager, proxy); -} - -/** - * Gets the path this proxy is bound to - * - * @param proxy the proxy - * @returns an object path - */ -const char* -dbus_g_proxy_get_path (DBusGProxy *proxy) -{ - DBusGProxyPrivate *priv; - - g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), NULL); - g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - return priv->path; -} - -static DBusMessage * -dbus_g_proxy_marshal_args_to_message (DBusGProxy *proxy, - const char *method, - GValueArray *args) -{ - DBusMessage *message; - DBusMessageIter msgiter; - guint i; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - message = dbus_message_new_method_call (priv->name, - priv->path, - priv->interface, - method); - if (message == NULL) - goto oom; - - dbus_message_iter_init_append (message, &msgiter); - for (i = 0; i < args->n_values; i++) - { - GValue *gvalue; - - gvalue = g_value_array_get_nth (args, i); - - if (!_dbus_gvalue_marshal (&msgiter, gvalue)) - g_assert_not_reached (); - } - return message; - oom: - return NULL; -} - -static guint -dbus_g_proxy_begin_call_internal (DBusGProxy *proxy, - const char *method, - DBusGProxyCallNotify notify, - gpointer user_data, - GDestroyNotify destroy, - GValueArray *args) -{ - DBusMessage *message; - DBusPendingCall *pending; - GPendingNotifyClosure *closure; - guint call_id; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - pending = NULL; - - message = dbus_g_proxy_marshal_args_to_message (proxy, method, args); - if (!message) - goto oom; - - if (!dbus_connection_send_with_reply (priv->manager->connection, - message, - &pending, - -1)) - goto oom; - dbus_message_unref (message); - g_assert (pending != NULL); - - call_id = ++priv->call_id_counter; - - if (notify != NULL) - { - closure = g_new (GPendingNotifyClosure, 1); - closure->proxy = proxy; /* No need to ref as the lifecycle is tied to proxy */ - closure->call_id = call_id; - closure->func = notify; - closure->data = user_data; - closure->free_data_func = destroy; - dbus_pending_call_set_notify (pending, d_pending_call_notify, - closure, - d_pending_call_free); - } - - g_hash_table_insert (priv->pending_calls, GUINT_TO_POINTER (call_id), pending); - - return call_id; - oom: - g_error ("Out of memory"); - return 0; -} - -static gboolean -dbus_g_proxy_end_call_internal (DBusGProxy *proxy, - guint call_id, - GError **error, - GType first_arg_type, - va_list args) -{ - DBusMessage *reply; - DBusMessageIter msgiter; - DBusError derror; - va_list args_unwind; - guint over; - int n_retvals_processed; - gboolean ret; - GType valtype; - DBusPendingCall *pending; - DBusGProxyPrivate *priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - reply = NULL; - ret = FALSE; - n_retvals_processed = 0; - over = 0; - - pending = g_hash_table_lookup (priv->pending_calls, GUINT_TO_POINTER (call_id)); - - dbus_pending_call_block (pending); - reply = dbus_pending_call_steal_reply (pending); - - g_assert (reply != NULL); - - dbus_error_init (&derror); - - switch (dbus_message_get_type (reply)) - { - case DBUS_MESSAGE_TYPE_METHOD_RETURN: - - dbus_message_iter_init (reply, &msgiter); - valtype = first_arg_type; - while (valtype != G_TYPE_INVALID) - { - int arg_type; - gpointer return_storage; - GValue gvalue = { 0, }; - DBusGValueMarshalCtx context; - - context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (priv->manager->connection); - context.proxy = proxy; - - arg_type = dbus_message_iter_get_arg_type (&msgiter); - if (arg_type == DBUS_TYPE_INVALID) - { - g_set_error (error, DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Too few arguments in reply")); - goto out; - } - - return_storage = va_arg (args, gpointer); - if (return_storage == NULL) - goto next; - - /* We handle variants specially; the caller is expected - * to have already allocated storage for them. - */ - if (arg_type == DBUS_TYPE_VARIANT - && g_type_is_a (valtype, G_TYPE_VALUE)) - { - if (!_dbus_gvalue_demarshal_variant (&context, &msgiter, (GValue*) return_storage, NULL)) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Couldn't convert argument, expected \"%s\""), - g_type_name (valtype)); - goto out; - } - } - else - { - g_value_init (&gvalue, valtype); - - if (!_dbus_gvalue_demarshal (&context, &msgiter, &gvalue, error)) - goto out; - - /* Anything that can be demarshaled must be storable */ - if (!_dbus_gvalue_store (&gvalue, (gpointer*) return_storage)) - g_assert_not_reached (); - /* Ownership of the value passes to the client, don't unset */ - } - - next: - n_retvals_processed++; - dbus_message_iter_next (&msgiter); - valtype = va_arg (args, GType); - } - - while (dbus_message_iter_get_arg_type (&msgiter) != DBUS_TYPE_INVALID) - { - over++; - dbus_message_iter_next (&msgiter); - } - - if (over > 0) - { - g_set_error (error, DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Too many arguments in reply; expected %d, got %d"), - n_retvals_processed, over); - goto out; - } - break; - case DBUS_MESSAGE_TYPE_ERROR: - dbus_set_error_from_message (&derror, reply); - dbus_set_g_error (error, &derror); - dbus_error_free (&derror); - goto out; - break; - default: - dbus_set_error (&derror, DBUS_ERROR_FAILED, - "Reply was neither a method return nor an exception"); - dbus_set_g_error (error, &derror); - dbus_error_free (&derror); - goto out; - break; - } - - ret = TRUE; - out: - va_end (args); - - if (ret == FALSE) - { - int i; - for (i = 0; i < n_retvals_processed; i++) - { - gpointer retval; - - retval = va_arg (args_unwind, gpointer); - - g_free (retval); - } - } - va_end (args_unwind); - - g_hash_table_remove (priv->pending_calls, GUINT_TO_POINTER (call_id)); - - if (reply) - dbus_message_unref (reply); - return ret; -} - -/** - * Asynchronously invokes a method on a remote interface. The method - * call will not be sent over the wire until the application returns - * to the main loop, or blocks in dbus_connection_flush() to write out - * pending data. The call will be completed after a timeout, or when - * a reply is received. When the call returns, the callback specified - * will be invoked; you can then collect the results of the call - * (which may be an error, or a reply), use dbus_g_proxy_end_call(). - * - * @todo this particular function shouldn't die on out of memory, - * since you should be able to do a call with large arguments. - * - * @param proxy a proxy for a remote interface - * @param method the name of the method to invoke - * @param notify callback to be invoked when method returns - * @param user_data user data passed to callback - * @param destroy function called to destroy user_data - * @param first_arg_type type of the first argument - * - * @returns call identifier - * */ -DBusGProxyCall * -dbus_g_proxy_begin_call (DBusGProxy *proxy, - const char *method, - DBusGProxyCallNotify notify, - gpointer user_data, - GDestroyNotify destroy, - GType first_arg_type, - ...) -{ - guint call_id; - va_list args; - GValueArray *arg_values; - - g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE); - g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), FALSE); - - va_start (args, first_arg_type); - - DBUS_G_VALUE_ARRAY_COLLECT_ALL (arg_values, first_arg_type, args); - - call_id = dbus_g_proxy_begin_call_internal (proxy, method, notify, user_data, destroy, arg_values); - - g_value_array_free (arg_values); - - va_end (args); - - return DBUS_G_PROXY_ID_TO_CALL (call_id); -} - -/** - * Collects the results of a method call. The method call was normally - * initiated with dbus_g_proxy_end_call(). You may use this function - * outside of the callback given to dbus_g_proxy_begin_call; in that - * case this function will block if the results haven't yet been - * received. - * - * If the call results in an error, the error is set as normal for - * GError and the function returns #FALSE. - * - * Otherwise, the "out" parameters and return value of the - * method are stored in the provided varargs list. - * The list should be terminated with G_TYPE_INVALID. - * - * @param proxy a proxy for a remote interface - * @param call the pending call ID from dbus_g_proxy_begin_call() - * @param error return location for an error - * @param first_arg_type type of first "out" argument - * @returns #FALSE if an error is set - */ -gboolean -dbus_g_proxy_end_call (DBusGProxy *proxy, - DBusGProxyCall *call, - GError **error, - GType first_arg_type, - ...) -{ - gboolean ret; - va_list args; - - va_start (args, first_arg_type); - - ret = dbus_g_proxy_end_call_internal (proxy, GPOINTER_TO_UINT (call), error, first_arg_type, args); - - va_end (args); - - return ret; -} - -/** - * Function for synchronously invoking a method and receiving reply - * values. This function is equivalent to dbus_g_proxy_begin_call - * followed by dbus_g_proxy_end_call. All of the input arguments are - * specified first, followed by G_TYPE_INVALID, followed by all of the - * output values, followed by a second G_TYPE_INVALID. Note that - * this means you must always specify G_TYPE_INVALID twice. - * - * @param proxy a proxy for a remote interface - * @param method method to invoke - * @param error return location for an error - * @param first_arg_type type of first "in" argument - * @returns #FALSE if an error is set, TRUE otherwise - */ -gboolean -dbus_g_proxy_call (DBusGProxy *proxy, - const char *method, - GError **error, - GType first_arg_type, - ...) -{ - gboolean ret; - guint call_id; - va_list args; - GValueArray *in_args; - - g_return_val_if_fail (DBUS_IS_G_PROXY (proxy), FALSE); - g_return_val_if_fail (!DBUS_G_PROXY_DESTROYED (proxy), FALSE); - - va_start (args, first_arg_type); - - DBUS_G_VALUE_ARRAY_COLLECT_ALL (in_args, first_arg_type, args); - - call_id = dbus_g_proxy_begin_call_internal (proxy, method, NULL, NULL, NULL, in_args); - - g_value_array_free (in_args); - - first_arg_type = va_arg (args, GType); - ret = dbus_g_proxy_end_call_internal (proxy, call_id, error, first_arg_type, args); - - va_end (args); - - return ret; -} - -/** - * Sends a method call message as with dbus_g_proxy_begin_call(), but - * does not ask for a reply or allow you to receive one. - * - * @todo this particular function shouldn't die on out of memory, - * since you should be able to do a call with large arguments. - * - * @param proxy a proxy for a remote interface - * @param method the name of the method to invoke - * @param first_arg_type type of the first argument - */ -void -dbus_g_proxy_call_no_reply (DBusGProxy *proxy, - const char *method, - GType first_arg_type, - ...) -{ - DBusMessage *message; - va_list args; - GValueArray *in_args; - DBusGProxyPrivate *priv; - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - va_start (args, first_arg_type); - DBUS_G_VALUE_ARRAY_COLLECT_ALL (in_args, first_arg_type, args); - - message = dbus_g_proxy_marshal_args_to_message (proxy, method, in_args); - - g_value_array_free (in_args); - va_end (args); - - if (!message) - goto oom; - - dbus_message_set_no_reply (message, TRUE); - - if (!dbus_connection_send (priv->manager->connection, - message, - NULL)) - goto oom; - dbus_message_unref (message); - return; - - oom: - g_error ("Out of memory"); -} - -/** - * Cancels a pending method call. The method call was normally - * initiated with dbus_g_proxy_begin_call(). This function - * may not be used on pending calls that have already been - * ended with dbus_g_proxy_end_call. - * - * @param proxy a proxy for a remote interface - * @param call the pending call ID from dbus_g_proxy_begin_call() - */ -void -dbus_g_proxy_cancel_call (DBusGProxy *proxy, - DBusGProxyCall *call) -{ - guint call_id; - DBusPendingCall *pending; - DBusGProxyPrivate *priv; - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - call_id = DBUS_G_PROXY_CALL_TO_ID (call); - - pending = g_hash_table_lookup (priv->pending_calls, GUINT_TO_POINTER (call_id)); - g_return_if_fail (pending != NULL); - - dbus_pending_call_cancel (pending); - - g_hash_table_remove (priv->pending_calls, GUINT_TO_POINTER (call_id)); -} - -/** - * Sends a message to the interface we're proxying for. Does not - * block or wait for a reply. The message is only actually written out - * when you return to the main loop or block in - * dbus_connection_flush(). - * - * The message is modified to be addressed to the target interface. - * That is, a destination name field or whatever is needed will be - * added to the message. The basic point of this function is to add - * the necessary header fields, otherwise it's equivalent to - * dbus_connection_send(). - * - * This function adds a reference to the message, so the caller - * still owns its original reference. - * - * @param proxy a proxy for a remote interface - * @param message the message to address and send - * @param client_serial return location for message's serial, or #NULL */ -void -dbus_g_proxy_send (DBusGProxy *proxy, - DBusMessage *message, - dbus_uint32_t *client_serial) -{ - DBusGProxyPrivate *priv; - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - if (priv->name) - { - if (!dbus_message_set_destination (message, priv->name)) - g_error ("Out of memory"); - } - if (priv->path) - { - if (!dbus_message_set_path (message, priv->path)) - g_error ("Out of memory"); - } - if (priv->interface) - { - if (!dbus_message_set_interface (message, priv->interface)) - g_error ("Out of memory"); - } - - if (!dbus_connection_send (priv->manager->connection, message, client_serial)) - g_error ("Out of memory\n"); -} - -static void -array_free_all (gpointer array) -{ - g_array_free (array, TRUE); -} - -/** - * Specifies the argument signature of a signal;.only necessary - * if the remote object does not support introspection. The arguments - * specified are the GLib types expected. - * - * @param proxy the proxy for a remote interface - * @param signal_name the name of the signal - * @param first_type the first argument type, or G_TYPE_INVALID if none - */ -void -dbus_g_proxy_add_signal (DBusGProxy *proxy, - const char *signal_name, - GType first_type, - ...) -{ - GQuark q; - char *name; - GArray *gtypesig; - GType gtype; - va_list args; - DBusGProxyPrivate *priv; - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - g_return_if_fail (signal_name != NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - - name = create_signal_name (priv->interface, signal_name); - - q = g_quark_from_string (name); - - g_return_if_fail (g_datalist_id_get_data (&priv->signal_signatures, q) == NULL); - - gtypesig = g_array_new (FALSE, TRUE, sizeof (GType)); - - va_start (args, first_type); - gtype = first_type; - while (gtype != G_TYPE_INVALID) - { - g_array_append_val (gtypesig, gtype); - gtype = va_arg (args, GType); - } - va_end (args); - -#ifndef G_DISABLE_CHECKS - if (_dbus_gobject_lookup_marshaller (G_TYPE_NONE, gtypesig->len, (const GType*) gtypesig->data) == NULL) - g_warning ("No marshaller for signature of signal '%s'", signal_name); -#endif - - - g_datalist_id_set_data_full (&priv->signal_signatures, - q, gtypesig, - array_free_all); - - g_free (name); -} - -/** - * Connect a signal handler to a proxy for a remote interface. When - * the remote interface emits the specified signal, the proxy will - * emit a corresponding GLib signal. - * - * @param proxy a proxy for a remote interface - * @param signal_name the DBus signal name to listen for - * @param handler the handler to connect - * @param data data to pass to handler - * @param free_data_func callback function to destroy data - */ -void -dbus_g_proxy_connect_signal (DBusGProxy *proxy, - const char *signal_name, - GCallback handler, - void *data, - GClosureNotify free_data_func) -{ - char *name; - GClosure *closure; - GQuark q; - DBusGProxyPrivate *priv; - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - g_return_if_fail (signal_name != NULL); - g_return_if_fail (handler != NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - name = create_signal_name (priv->interface, signal_name); - - q = g_quark_try_string (name); - -#ifndef G_DISABLE_CHECKS - if (q == 0 || g_datalist_id_get_data (&priv->signal_signatures, q) == NULL) - { - g_warning ("Must add the signal '%s' with dbus_g_proxy_add_signal() prior to connecting to it\n", name); - g_free (name); - return; - } -#endif - - closure = g_cclosure_new (G_CALLBACK (handler), data, free_data_func); - - g_signal_connect_closure_by_id (G_OBJECT (proxy), - signals[RECEIVED], - q, - closure, FALSE); - - g_free (name); -} - -/** - * Disconnect all signal handlers from a proxy that match the given - * criteria. - * - * @param proxy a proxy for a remote interface - * @param signal_name the DBus signal name to disconnect - * @param handler the handler to disconnect - * @param data the data that was registered with handler - */ -void -dbus_g_proxy_disconnect_signal (DBusGProxy *proxy, - const char *signal_name, - GCallback handler, - void *data) -{ - char *name; - GQuark q; - DBusGProxyPrivate *priv; - - g_return_if_fail (DBUS_IS_G_PROXY (proxy)); - g_return_if_fail (!DBUS_G_PROXY_DESTROYED (proxy)); - g_return_if_fail (signal_name != NULL); - g_return_if_fail (handler != NULL); - - priv = DBUS_G_PROXY_GET_PRIVATE(proxy); - name = create_signal_name (priv->interface, signal_name); - - q = g_quark_try_string (name); - - if (q != 0) - { - g_signal_handlers_disconnect_matched (G_OBJECT (proxy), - G_SIGNAL_MATCH_DETAIL | - G_SIGNAL_MATCH_FUNC | - G_SIGNAL_MATCH_DATA, - signals[RECEIVED], - q, - NULL, - G_CALLBACK (handler), data); - } - else - { - g_warning ("Attempt to disconnect from signal '%s' which is not registered\n", - name); - } - - g_free (name); -} - -/** @} End of DBusGLib public */ - -#ifdef DBUS_BUILD_TESTS - -/** - * @ingroup DBusGLibInternals - * Unit test for GLib proxy functions - * @returns #TRUE on success. - */ -gboolean -_dbus_g_proxy_test (void) -{ - - - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-gsignature.c b/glib/dbus-gsignature.c deleted file mode 100644 index 5df959db..00000000 --- a/glib/dbus-gsignature.c +++ /dev/null @@ -1,210 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gsignature.c Mapping from dbus type signatures to GType - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "config.h" -#include "dbus-gtest.h" -#include "dbus-gsignature.h" -#include "dbus-gvalue-utils.h" -#include -#include - -#define MAP_BASIC(d_t, g_t) \ - case DBUS_TYPE_##d_t: \ - return G_TYPE_##g_t; -static GType -typecode_to_gtype (int type) -{ - switch (type) - { - MAP_BASIC (BOOLEAN, BOOLEAN); - MAP_BASIC (BYTE, UCHAR); - MAP_BASIC (INT16, INT); - MAP_BASIC (INT32, INT); - MAP_BASIC (UINT16, UINT); - MAP_BASIC (UINT32, UINT); - MAP_BASIC (INT64, INT64); - MAP_BASIC (UINT64, UINT64); - MAP_BASIC (DOUBLE, DOUBLE); - MAP_BASIC (STRING, STRING); - default: - return G_TYPE_INVALID; - } -} -#undef MAP_BASIC - -static gboolean -dbus_typecode_maps_to_basic (int typecode) -{ - return typecode_to_gtype (typecode) != G_TYPE_INVALID; -} - -GType -_dbus_gtype_from_basic_typecode (int typecode) -{ - g_assert (dbus_type_is_basic (typecode)); - g_assert (dbus_typecode_maps_to_basic (typecode)); - return typecode_to_gtype (typecode); -} - -static GType -signature_iter_to_g_type_dict (const DBusSignatureIter *subiter, gboolean is_client) -{ - DBusSignatureIter iter; - GType key_gtype; - GType value_gtype; - - g_assert (dbus_signature_iter_get_current_type (subiter) == DBUS_TYPE_DICT_ENTRY); - - dbus_signature_iter_recurse (subiter, &iter); - - key_gtype = _dbus_gtype_from_signature_iter (&iter, is_client); - if (key_gtype == G_TYPE_INVALID) - return G_TYPE_INVALID; - - dbus_signature_iter_next (&iter); - value_gtype = _dbus_gtype_from_signature_iter (&iter, is_client); - if (value_gtype == G_TYPE_INVALID) - return G_TYPE_INVALID; - - if (!_dbus_gtype_is_valid_hash_key (key_gtype) - || !_dbus_gtype_is_valid_hash_value (value_gtype)) - /* Later we need to return DBUS_TYPE_G_VALUE */ - return G_TYPE_INVALID; - - return dbus_g_type_get_map ("GHashTable", key_gtype, value_gtype); -} - -static GType -signature_iter_to_g_type_array (DBusSignatureIter *iter, gboolean is_client) -{ - GType elt_gtype; - - elt_gtype = _dbus_gtype_from_signature_iter (iter, is_client); - if (elt_gtype == G_TYPE_INVALID) - return G_TYPE_INVALID; - - if (elt_gtype == G_TYPE_OBJECT) - return DBUS_TYPE_G_OBJECT_ARRAY; - if (elt_gtype == G_TYPE_STRING) - return G_TYPE_STRV; - if (_dbus_g_type_is_fixed (elt_gtype)) - return dbus_g_type_get_collection ("GArray", elt_gtype); - else if (g_type_is_a (elt_gtype, G_TYPE_OBJECT) - || g_type_is_a (elt_gtype, G_TYPE_BOXED)) - return dbus_g_type_get_collection ("GPtrArray", elt_gtype); - - /* Later we need to return DBUS_TYPE_G_VALUE */ - return G_TYPE_INVALID; -} - -static GType -signature_iter_to_g_type_struct (DBusSignatureIter *iter, gboolean is_client) -{ - GArray *types; - GType ret; - types = g_array_new (FALSE, FALSE, sizeof (GType)); - do - { - GType curtype; - curtype = _dbus_gtype_from_signature_iter (iter, is_client); - g_array_append_val (types, curtype); - } - while (dbus_signature_iter_next (iter)); - - ret = dbus_g_type_get_structv ("GValueArray", types->len, (GType*) types->data); - g_array_free (types, TRUE); - return ret; -} - -GType -_dbus_gtype_from_signature_iter (DBusSignatureIter *iter, gboolean is_client) -{ - int current_type; - - current_type = dbus_signature_iter_get_current_type (iter); - /* TODO: handle type 0? */ - if (dbus_typecode_maps_to_basic (current_type)) - return _dbus_gtype_from_basic_typecode (current_type); - else if (current_type == DBUS_TYPE_OBJECT_PATH) - return DBUS_TYPE_G_OBJECT_PATH; - else - { - DBusSignatureIter subiter; - - g_assert (dbus_type_is_container (current_type)); - - if (current_type == DBUS_TYPE_VARIANT) - return G_TYPE_VALUE; - - dbus_signature_iter_recurse (iter, &subiter); - - if (current_type == DBUS_TYPE_ARRAY) - { - int elt_type = dbus_signature_iter_get_current_type (&subiter); - if (elt_type == DBUS_TYPE_DICT_ENTRY) - return signature_iter_to_g_type_dict (&subiter, is_client); - else - return signature_iter_to_g_type_array (&subiter, is_client); - } - else if (current_type == DBUS_TYPE_STRUCT) - { - return signature_iter_to_g_type_struct (&subiter, is_client); - } - else - { - g_assert_not_reached (); - return G_TYPE_INVALID; - } - } -} - -GType -_dbus_gtype_from_signature (const char *signature, gboolean is_client) -{ - DBusSignatureIter iter; - - dbus_signature_iter_init (&iter, signature); - - return _dbus_gtype_from_signature_iter (&iter, is_client); -} - -GArray * -_dbus_gtypes_from_arg_signature (const char *argsig, gboolean is_client) -{ - GArray *ret; - int current_type; - DBusSignatureIter sigiter; - - ret = g_array_new (FALSE, FALSE, sizeof (GType)); - - dbus_signature_iter_init (&sigiter, argsig); - while ((current_type = dbus_signature_iter_get_current_type (&sigiter)) != DBUS_TYPE_INVALID) - { - GType curtype; - - curtype = _dbus_gtype_from_signature_iter (&sigiter, is_client); - g_array_append_val (ret, curtype); - dbus_signature_iter_next (&sigiter); - } - return ret; -} diff --git a/glib/dbus-gsignature.h b/glib/dbus-gsignature.h deleted file mode 100644 index 08757e11..00000000 --- a/glib/dbus-gsignature.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef DBUS_GOBJECT_SIGNATURE_H -#define DBUS_GOBJECT_SIGNATURE_H - -#include -#include -#include - -GType _dbus_gtype_from_basic_typecode (int typecode); - -GType _dbus_gtype_from_signature (const char *signature, - gboolean is_client); - -GType _dbus_gtype_from_signature_iter (DBusSignatureIter *sigiter, - gboolean is_client); - -GArray * _dbus_gtypes_from_arg_signature (const char *signature, - gboolean is_client); - -#endif diff --git a/glib/dbus-gtest-main.c b/glib/dbus-gtest-main.c deleted file mode 100644 index c23c5c1e..00000000 --- a/glib/dbus-gtest-main.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gtest-main.c Program to run all libdbus-glib tests - * - * Copyright (C) 2003 Red Hat Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include - -#ifdef DBUS_BUILD_TESTS - -#include "dbus-gtest.h" -#include -#include -#include - -int -main (int argc, - char **argv) -{ - const char *test_data_dir; - - setlocale(LC_ALL, ""); - - - if (argc > 1) - test_data_dir = argv[1]; - else - test_data_dir = NULL; - - dbus_glib_internal_do_not_use_run_tests (test_data_dir); - - return 0; -} - -#endif diff --git a/glib/dbus-gtest.c b/glib/dbus-gtest.c deleted file mode 100644 index e5c2e8b9..00000000 --- a/glib/dbus-gtest.c +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-test.c Program to run all tests - * - * Copyright (C) 2002, 2003 Red Hat Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include "dbus-gtest.h" -#include -#include -#include - -#ifdef DBUS_BUILD_TESTS -static void -die (const char *failure) -{ - fprintf (stderr, "Unit test failed: %s\n", failure); - exit (1); -} -#endif /* DBUS_BUILD_TESTS */ - -/** - * An exported symbol to be run in order to execute - * unit tests. Should not be used by - * any app other than our test app, this symbol - * won't exist in some builds of the library. - * (with --enable-tests=no) - * - * @param test_data_dir the directory with test data (test/data normally) - */ -void -dbus_glib_internal_do_not_use_run_tests (const char *test_data_dir) -{ -#ifdef DBUS_BUILD_TESTS - if (test_data_dir == NULL) - test_data_dir = g_getenv ("DBUS_TEST_DATA"); - - if (test_data_dir != NULL) - printf ("Test data in %s\n", test_data_dir); - else - printf ("No test data!\n"); - - g_type_init (); - - printf ("%s: running GValue util tests\n", "dbus-glib-test"); - if (!_dbus_gvalue_utils_test (test_data_dir)) - die ("gvalue utils"); - - printf ("%s: running GValue tests\n", "dbus-glib-test"); - if (!_dbus_gvalue_test (test_data_dir)) - die ("gvalue utils"); - - printf ("%s: running glib tests\n", "dbus-glib-test"); - if (!_dbus_glib_test (test_data_dir)) - die ("glib"); - - printf ("%s: running utils tests\n", "dbus-glib-test"); - if (!_dbus_gutils_test (test_data_dir)) - die ("gutils"); - - printf ("%s: running mainloop integration tests\n", "dbus-glib-test"); - if (!_dbus_gmain_test (test_data_dir)) - die ("gmain"); - - printf ("%s: running GObject tests\n", "dbus-glib-test"); - if (!_dbus_gobject_test (test_data_dir)) - die ("gobject"); - - printf ("%s: completed successfully\n", "dbus-glib-test"); -#else - printf ("Not compiled with unit tests, not running any\n"); -#endif -} - - diff --git a/glib/dbus-gtest.h b/glib/dbus-gtest.h deleted file mode 100644 index 75633ea7..00000000 --- a/glib/dbus-gtest.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gtest.h Declarations of test functions. - * - * Copyright (C) 2003 Red Hat Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef DBUS_GLIB_TEST_H -#define DBUS_GLIB_TEST_H - -#include - -gboolean _dbus_gmain_test (const char *test_data_dir); -gboolean _dbus_gobject_test (const char *test_data_dir); -gboolean _dbus_gutils_test (const char *test_data_dir); -gboolean _dbus_glib_test (const char *test_data_dir); -gboolean _dbus_gvalue_test (const char *test_data_dir); -gboolean _dbus_gvalue_utils_test (const char *test_data_dir); - -void dbus_glib_internal_do_not_use_run_tests (const char *test_data_dir); - -#endif /* DBUS_GLIB_TEST_H */ diff --git a/glib/dbus-gthread.c b/glib/dbus-gthread.c deleted file mode 100644 index 1b925cdd..00000000 --- a/glib/dbus-gthread.c +++ /dev/null @@ -1,179 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gthread.c GThread integration - * - * Copyright (C) 2002 CodeFactory AB - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* #define G_DEBUG_LOCKS 1 */ - -#include -#include -#include -#include - -/** @addtogroup DBusGLibInternals - * @{ - */ - -static DBusMutex * dbus_gmutex_new (void); -static void dbus_gmutex_free (DBusMutex *mutex); -static dbus_bool_t dbus_gmutex_lock (DBusMutex *mutex); -static dbus_bool_t dbus_gmutex_unlock (DBusMutex *mutex); - - -static DBusCondVar* dbus_gcondvar_new (void); -static void dbus_gcondvar_free (DBusCondVar *cond); -static void dbus_gcondvar_wait (DBusCondVar *cond, - DBusMutex *mutex); -static dbus_bool_t dbus_gcondvar_wait_timeout (DBusCondVar *cond, - DBusMutex *mutex, - int timeout_msec); -static void dbus_gcondvar_wake_one (DBusCondVar *cond); -static void dbus_gcondvar_wake_all (DBusCondVar *cond); - - -static const DBusThreadFunctions functions = -{ - DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK | - DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, - dbus_gmutex_new, - dbus_gmutex_free, - dbus_gmutex_lock, - dbus_gmutex_unlock, - dbus_gcondvar_new, - dbus_gcondvar_free, - dbus_gcondvar_wait, - dbus_gcondvar_wait_timeout, - dbus_gcondvar_wake_one, - dbus_gcondvar_wake_all -}; - -static DBusMutex * -dbus_gmutex_new (void) -{ - GMutex *mutex; - - mutex = g_mutex_new (); - - return (DBusMutex *)mutex; -} - -static void -dbus_gmutex_free (DBusMutex *mutex) -{ - g_mutex_free ((GMutex *)mutex); -} - -static dbus_bool_t -dbus_gmutex_lock (DBusMutex *mutex) -{ - g_mutex_lock ((GMutex *)mutex); - - return TRUE; -} - -static dbus_bool_t -dbus_gmutex_unlock (DBusMutex *mutex) -{ - g_mutex_unlock ((GMutex *)mutex); - - return TRUE; -} - -static DBusCondVar* -dbus_gcondvar_new (void) -{ - return (DBusCondVar*)g_cond_new (); -} - -static void -dbus_gcondvar_free (DBusCondVar *cond) -{ - g_cond_free ((GCond *)cond); -} - -static void -dbus_gcondvar_wait (DBusCondVar *cond, - DBusMutex *mutex) -{ - g_cond_wait ((GCond *)cond, (GMutex *)mutex); -} - -static dbus_bool_t -dbus_gcondvar_wait_timeout (DBusCondVar *cond, - DBusMutex *mutex, - int timeout_msec) -{ - GTimeVal now; - - g_get_current_time (&now); - - now.tv_sec += timeout_msec / 1000; - now.tv_usec += (timeout_msec % 1000) * 1000; - if (now.tv_usec > G_USEC_PER_SEC) - { - now.tv_sec += 1; - now.tv_usec -= G_USEC_PER_SEC; - } - - return g_cond_timed_wait ((GCond *)cond, (GMutex *)mutex, &now); -} - -static void -dbus_gcondvar_wake_one (DBusCondVar *cond) -{ - g_cond_signal ((GCond *)cond); -} - -static void -dbus_gcondvar_wake_all (DBusCondVar *cond) -{ - g_cond_broadcast ((GCond *)cond); -} - -/** @} End of internals */ - -/** @addtogroup DBusGLib - * @{ - */ -/** - * Initializes the D-BUS thread system to use - * GLib threads. This function may only be called - * once and must be called prior to calling any - * other function in the D-BUS API. - */ -void -dbus_g_thread_init (void) -{ - if (!g_thread_supported ()) - g_error ("g_thread_init() must be called before dbus_threads_init()"); - - dbus_threads_init (&functions); -} - -/** @} end of public API */ diff --git a/glib/dbus-gtool-test.h b/glib/dbus-gtool-test.h deleted file mode 100644 index 971264ea..00000000 --- a/glib/dbus-gtool-test.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gtool-test.h Declarations of test functions for dbus-glib-tool. - * - * Copyright (C) 2003 Red Hat Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef DBUS_GLIB_TOOL_TEST_H -#define DBUS_GLIB_TOOL_TEST_H - -#include - -gboolean _dbus_gtool_test (const char *test_data_dir); - -#endif /* DBUS_GLIB_TEST_H */ diff --git a/glib/dbus-gtype-specialized.c b/glib/dbus-gtype-specialized.c deleted file mode 100644 index 3e39c49d..00000000 --- a/glib/dbus-gtype-specialized.c +++ /dev/null @@ -1,778 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gtype-specialized.c: Non-DBus-specific functions for specialized GTypes - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "dbus-gtype-specialized.h" -#include -#include -#include - -typedef enum { - DBUS_G_SPECTYPE_COLLECTION, - DBUS_G_SPECTYPE_MAP, - DBUS_G_SPECTYPE_STRUCT -} DBusGTypeSpecializedType; - -typedef struct { - DBusGTypeSpecializedType type; - const DBusGTypeSpecializedVtable *vtable; -} DBusGTypeSpecializedContainer; - -typedef struct { - guint num_types; - GType *types; - const DBusGTypeSpecializedContainer *klass; -} DBusGTypeSpecializedData; - -static GHashTable /* char * -> data* */ *specialized_containers; - -static GQuark -specialized_type_data_quark () -{ - static GQuark quark; - if (!quark) - quark = g_quark_from_static_string ("DBusGTypeSpecializedData"); - - return quark; -} - -void -dbus_g_type_specialized_init (void) -{ - specialized_containers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); -} - -static gboolean -specialized_types_is_initialized (void) -{ - return specialized_containers != NULL; -} - -static DBusGTypeSpecializedData * -lookup_specialization_data (GType type) -{ - return g_type_get_qdata (type, specialized_type_data_quark ()); -} - - -/* Copied from gboxed.c */ -static void -proxy_value_init (GValue *value) -{ - value->data[0].v_pointer = NULL; -} - -/* Adapted from gboxed.c */ -static void -proxy_value_free (GValue *value) -{ - if (value->data[0].v_pointer && !(value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS)) - { - DBusGTypeSpecializedData *data; - GType type; - - type = G_VALUE_TYPE (value); - data = lookup_specialization_data (type); - g_assert (data != NULL); - - if (data->klass->vtable->free_func) - { - data->klass->vtable->free_func (type, value->data[0].v_pointer); - } - else - { - g_assert (data->klass->vtable->simple_free_func != NULL); - data->klass->vtable->simple_free_func (value->data[0].v_pointer); - } - } -} - -/* Adapted from gboxed.c */ -static void -proxy_value_copy (const GValue *src_value, - GValue *dest_value) -{ - if (src_value->data[0].v_pointer) - { - DBusGTypeSpecializedData *data; - GType type; - type = G_VALUE_TYPE (src_value); - data = lookup_specialization_data (type); - g_assert (data != NULL); - dest_value->data[0].v_pointer = data->klass->vtable->copy_func (type, src_value->data[0].v_pointer); - } - else - dest_value->data[0].v_pointer = src_value->data[0].v_pointer; -} - -/* Copied from gboxed.c */ -static gpointer -proxy_value_peek_pointer (const GValue *value) -{ - return value->data[0].v_pointer; -} - -/* Adapted from gboxed.c */ -static gchar* -proxy_collect_value (GValue *value, - guint n_collect_values, - GTypeCValue *collect_values, - guint collect_flags) -{ - DBusGTypeSpecializedData *data; - GType type; - - type = G_VALUE_TYPE (value); - data = lookup_specialization_data (type); - - if (!collect_values[0].v_pointer) - value->data[0].v_pointer = NULL; - else - { - if (collect_flags & G_VALUE_NOCOPY_CONTENTS) - { - value->data[0].v_pointer = collect_values[0].v_pointer; - value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS; - } - else - { - value->data[0].v_pointer = data->klass->vtable->copy_func (type, collect_values[0].v_pointer); - } - } - - return NULL; -} - -/* Adapted from gboxed.c */ -static gchar* -proxy_lcopy_value (const GValue *value, - guint n_collect_values, - GTypeCValue *collect_values, - guint collect_flags) -{ - gpointer *boxed_p = collect_values[0].v_pointer; - - if (!boxed_p) - return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); - - if (!value->data[0].v_pointer) - *boxed_p = NULL; - else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) - *boxed_p = value->data[0].v_pointer; - else - { - DBusGTypeSpecializedData *data; - GType type; - - type = G_VALUE_TYPE (value); - data = lookup_specialization_data (type); - - *boxed_p = data->klass->vtable->copy_func (type, value->data[0].v_pointer); - } - - return NULL; -} - -static char * -build_specialization_name (const char *prefix, guint num_types, GType *types) -{ - GString *fullname; - guint i; - - fullname = g_string_new (prefix); - - g_string_append_c (fullname, '_'); - for (i=0; i < num_types; i++) - { - if (i!=0) - g_string_append_c (fullname, '+'); - g_string_append (fullname, g_type_name (types[i])); - } - g_string_append_c (fullname, '_'); - return g_string_free (fullname, FALSE); -} - -static void -register_container (const char *name, - DBusGTypeSpecializedType type, - const DBusGTypeSpecializedVtable *vtable) -{ - DBusGTypeSpecializedContainer *klass; - - klass = g_new0 (DBusGTypeSpecializedContainer, 1); - klass->type = type; - klass->vtable = vtable; - - g_hash_table_insert (specialized_containers, g_strdup (name), klass); -} - -void -dbus_g_type_register_collection (const char *name, - const DBusGTypeSpecializedCollectionVtable *vtable, - guint flags) -{ - g_return_if_fail (specialized_types_is_initialized ()); - register_container (name, DBUS_G_SPECTYPE_COLLECTION, (const DBusGTypeSpecializedVtable*) vtable); -} - -void -dbus_g_type_register_map (const char *name, - const DBusGTypeSpecializedMapVtable *vtable, - guint flags) -{ - g_return_if_fail (specialized_types_is_initialized ()); - register_container (name, DBUS_G_SPECTYPE_MAP, (const DBusGTypeSpecializedVtable*) vtable); -} - -void -dbus_g_type_register_struct (const char *name, - const DBusGTypeSpecializedStructVtable *vtable, - guint flags) -{ - g_return_if_fail (specialized_types_is_initialized ()); - register_container (name, DBUS_G_SPECTYPE_STRUCT, (const DBusGTypeSpecializedVtable*) vtable); -} - - -const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type) -{ - DBusGTypeSpecializedData *data; - g_return_val_if_fail (dbus_g_type_is_map(map_type), NULL); - - data = lookup_specialization_data (map_type); - g_assert (data != NULL); - - return (DBusGTypeSpecializedMapVtable *)(data->klass->vtable); -} - -const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type) -{ - DBusGTypeSpecializedData *data; - g_return_val_if_fail (dbus_g_type_is_collection(collection_type), NULL); - - data = lookup_specialization_data (collection_type); - g_assert (data != NULL); - - return (DBusGTypeSpecializedCollectionVtable *)(data->klass->vtable); -} - -const DBusGTypeSpecializedStructVtable* dbus_g_type_struct_peek_vtable (GType struct_type) -{ - DBusGTypeSpecializedData *data; - g_return_val_if_fail (dbus_g_type_is_struct (struct_type), NULL); - - data = lookup_specialization_data (struct_type); - g_assert (data != NULL); - - return (DBusGTypeSpecializedStructVtable *)(data->klass->vtable); -} - -static GType -register_specialized_instance (const DBusGTypeSpecializedContainer *klass, - char *name, - guint num_types, - GType *types) -{ - GType ret; - - static const GTypeValueTable vtable = - { - proxy_value_init, - proxy_value_free, - proxy_value_copy, - proxy_value_peek_pointer, - "p", - proxy_collect_value, - "p", - proxy_lcopy_value, - }; - static const GTypeInfo derived_info = - { - 0, /* class_size */ - NULL, /* base_init */ - NULL, /* base_finalize */ - NULL, /* class_init */ - NULL, /* class_finalize */ - NULL, /* class_data */ - 0, /* instance_size */ - 0, /* n_preallocs */ - NULL, /* instance_init */ - &vtable, /* value_table */ - }; - - ret = g_type_register_static (G_TYPE_BOXED, name, &derived_info, 0); - /* install proxy functions upon successfull registration */ - if (ret != G_TYPE_INVALID) - { - DBusGTypeSpecializedData *data; - data = g_new0 (DBusGTypeSpecializedData, 1); - data->num_types = num_types; - data->types = g_memdup (types, sizeof (GType) * num_types); - data->klass = klass; - g_type_set_qdata (ret, specialized_type_data_quark (), data); - } - - return ret; -} - -static GType -lookup_or_register_specialized (const char *container, - guint num_types, - GType *types) -{ - GType ret; - char *name; - const DBusGTypeSpecializedContainer *klass; - - g_return_val_if_fail (specialized_types_is_initialized (), G_TYPE_INVALID); - - klass = g_hash_table_lookup (specialized_containers, container); - g_return_val_if_fail (klass != NULL, G_TYPE_INVALID); - - name = build_specialization_name (container, num_types, types); - ret = g_type_from_name (name); - if (ret == G_TYPE_INVALID) - { - /* Take ownership of name */ - ret = register_specialized_instance (klass, name, - num_types, - types); - } - else - g_free (name); - return ret; -} - -GType -dbus_g_type_get_collection (const char *container, - GType specialization) -{ - return lookup_or_register_specialized (container, 1, &specialization); -} - -GType -dbus_g_type_get_map (const char *container, - GType key_specialization, - GType value_specialization) -{ - GType types[2] = {key_specialization, value_specialization}; - return lookup_or_register_specialized (container, 2, types); -} - -GType -dbus_g_type_get_structv (const char *container, - guint num_items, - GType *types) -{ - return lookup_or_register_specialized (container, num_items, types); -} - -GType -dbus_g_type_get_struct (const char *container, - GType first_type, - ...) -{ - GArray *types; - GType curtype, ret; - va_list args; - va_start (args, first_type); - - types = g_array_new (FALSE, FALSE, sizeof (GType)); - curtype = first_type; - while (curtype != G_TYPE_INVALID) - { - g_array_append_val (types, curtype); - curtype = va_arg (args, GType); - } - va_end (args); - - ret = lookup_or_register_specialized (container, types->len, - (GType *) types->data); - - g_array_free (types, TRUE); - - return ret; -} - - - -gboolean -dbus_g_type_is_collection (GType gtype) -{ - DBusGTypeSpecializedData *data; - data = lookup_specialization_data (gtype); - if (data == NULL) - return FALSE; - return data->klass->type == DBUS_G_SPECTYPE_COLLECTION; -} - -gboolean -dbus_g_type_is_map (GType gtype) -{ - DBusGTypeSpecializedData *data; - data = lookup_specialization_data (gtype); - if (data == NULL) - return FALSE; - return data->klass->type == DBUS_G_SPECTYPE_MAP; -} - -gboolean -dbus_g_type_is_struct (GType gtype) -{ - DBusGTypeSpecializedData *data; - data = lookup_specialization_data (gtype); - if (data == NULL) - return FALSE; - return data->klass->type == DBUS_G_SPECTYPE_STRUCT; -} - - -static GType -get_specialization_index (GType gtype, guint i) -{ - DBusGTypeSpecializedData *data; - - data = lookup_specialization_data (gtype); - if (i < data->num_types) - return data->types[i]; - else - return G_TYPE_INVALID; -} - -GType -dbus_g_type_get_collection_specialization (GType gtype) -{ - g_return_val_if_fail (dbus_g_type_is_collection (gtype), G_TYPE_INVALID); - return get_specialization_index (gtype, 0); -} - -GType -dbus_g_type_get_map_key_specialization (GType gtype) -{ - g_return_val_if_fail (dbus_g_type_is_map (gtype), G_TYPE_INVALID); - return get_specialization_index (gtype, 0); -} - -GType -dbus_g_type_get_map_value_specialization (GType gtype) -{ - g_return_val_if_fail (dbus_g_type_is_map (gtype), G_TYPE_INVALID); - return get_specialization_index (gtype, 1); -} - -GType -dbus_g_type_get_struct_member_type (GType gtype, guint index) -{ - g_return_val_if_fail (dbus_g_type_is_struct (gtype), G_TYPE_INVALID); - return get_specialization_index (gtype, index); -} - -guint -dbus_g_type_get_struct_size (GType gtype) -{ - DBusGTypeSpecializedData *data; - g_return_val_if_fail (dbus_g_type_is_struct (gtype), G_TYPE_INVALID); - - data = lookup_specialization_data (gtype); - return data->num_types; -} - - - -gpointer -dbus_g_type_specialized_construct (GType type) -{ - DBusGTypeSpecializedData *data; - g_return_val_if_fail (specialized_types_is_initialized (), FALSE); - - data = lookup_specialization_data (type); - g_return_val_if_fail (data != NULL, FALSE); - - return data->klass->vtable->constructor (type); -} - -gboolean -dbus_g_type_collection_get_fixed (GValue *value, - gpointer *data_ret, - guint *len_ret) -{ - DBusGTypeSpecializedData *data; - GType gtype; - - g_return_val_if_fail (specialized_types_is_initialized (), FALSE); - g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), FALSE); - - gtype = G_VALUE_TYPE (value); - data = lookup_specialization_data (gtype); - g_return_val_if_fail (data != NULL, FALSE); - - return ((DBusGTypeSpecializedCollectionVtable *) (data->klass->vtable))->fixed_accessor (gtype, - g_value_get_boxed (value), - data_ret, len_ret); -} - -void -dbus_g_type_collection_value_iterate (const GValue *value, - DBusGTypeSpecializedCollectionIterator iterator, - gpointer user_data) -{ - DBusGTypeSpecializedData *data; - GType gtype; - - g_return_if_fail (specialized_types_is_initialized ()); - g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); - - gtype = G_VALUE_TYPE (value); - data = lookup_specialization_data (gtype); - g_return_if_fail (data != NULL); - - ((DBusGTypeSpecializedCollectionVtable *) data->klass->vtable)->iterator (gtype, - g_value_get_boxed (value), - iterator, user_data); -} - -typedef struct { - GValue *val; - GType specialization_type; - DBusGTypeSpecializedData *specdata; -} DBusGTypeSpecializedAppendContextReal; - -void -dbus_g_type_specialized_init_append (GValue *value, DBusGTypeSpecializedAppendContext *ctx) -{ - DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; - GType gtype; - DBusGTypeSpecializedData *specdata; - - g_return_if_fail (specialized_types_is_initialized ()); - g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); - gtype = G_VALUE_TYPE (value); - specdata = lookup_specialization_data (gtype); - g_return_if_fail (specdata != NULL); - g_return_if_fail (specdata->num_types != 0); - - realctx->val = value; - realctx->specialization_type = specdata->types[0]; - realctx->specdata = specdata; -} - -void -dbus_g_type_specialized_collection_append (DBusGTypeSpecializedAppendContext *ctx, - GValue *elt) -{ - DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; - ((DBusGTypeSpecializedCollectionVtable *) realctx->specdata->klass->vtable)->append_func (ctx, elt); -} - -void -dbus_g_type_specialized_collection_end_append (DBusGTypeSpecializedAppendContext *ctx) -{ - DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; - if (((DBusGTypeSpecializedCollectionVtable *) realctx->specdata->klass->vtable)->end_append_func != NULL) - ((DBusGTypeSpecializedCollectionVtable *) realctx->specdata->klass->vtable)->end_append_func (ctx); -} - -void -dbus_g_type_specialized_map_append (DBusGTypeSpecializedAppendContext *ctx, - GValue *key, - GValue *val) -{ - DBusGTypeSpecializedAppendContextReal *realctx = (DBusGTypeSpecializedAppendContextReal *) ctx; - ((DBusGTypeSpecializedMapVtable *) realctx->specdata->klass->vtable)->append_func (ctx, key, val); -} - -void -dbus_g_type_map_value_iterate (const GValue *value, - DBusGTypeSpecializedMapIterator iterator, - gpointer user_data) -{ - DBusGTypeSpecializedData *data; - GType gtype; - - g_return_if_fail (specialized_types_is_initialized ()); - g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); - - gtype = G_VALUE_TYPE (value); - data = lookup_specialization_data (gtype); - g_return_if_fail (data != NULL); - - ((DBusGTypeSpecializedMapVtable *) data->klass->vtable)->iterator (gtype, - g_value_get_boxed (value), - iterator, user_data); -} - -gboolean -dbus_g_type_struct_get_member (const GValue *value, - guint index, - GValue *dest) -{ - DBusGTypeSpecializedData *data; - GType gtype; - - g_return_val_if_fail (specialized_types_is_initialized (), FALSE); - g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), FALSE); - - gtype = G_VALUE_TYPE (value); - data = lookup_specialization_data (gtype); - g_return_val_if_fail (data != NULL, FALSE); - - return ((DBusGTypeSpecializedStructVtable *) (data->klass->vtable))->get_member(gtype, - g_value_get_boxed (value), - index, dest); -} - -gboolean -dbus_g_type_struct_set_member (GValue *value, - guint index, - const GValue *src) -{ - DBusGTypeSpecializedData *data; - GType gtype; - - g_return_val_if_fail (specialized_types_is_initialized (), FALSE); - g_return_val_if_fail (G_VALUE_HOLDS_BOXED (value), FALSE); - - gtype = G_VALUE_TYPE (value); - data = lookup_specialization_data (gtype); - g_return_val_if_fail (data != NULL, FALSE); - - return ((DBusGTypeSpecializedStructVtable *) (data->klass->vtable))->set_member(gtype, - g_value_get_boxed (value), - index, src); -} - -/** - * dbus_g_type_struct_get: - * @value: a GValue containing a DBusGTypeStruct type - * @member: struct member to get - * @...: location in which to return the value of this member, - * followed optionally by more member/return locations pairs, followed by - * by G_MAXUINT - * - * Collects the selected values of this struct into the return locations - * provided. - * - * Returns: FALSE on failure - */ - -gboolean -dbus_g_type_struct_get (const GValue *value, - guint first_member, - ...) -{ - va_list var_args; - GType type; - guint size,i; - gchar *error; - GValue val = {0,}; - - g_return_val_if_fail (dbus_g_type_is_struct (G_VALUE_TYPE (value)), FALSE); - - va_start (var_args, first_member); - size = dbus_g_type_get_struct_size (G_VALUE_TYPE (value)); - i = first_member; - while (i != G_MAXUINT) - { - if (i >= size) - goto error; - - type = dbus_g_type_get_struct_member_type (G_VALUE_TYPE (value),i); - - g_value_init (&val, type); - dbus_g_type_struct_get_member (value, i, &val); - - G_VALUE_LCOPY (&val, var_args, 0, &error); - if (error) - { - g_warning ("%s, %s", G_STRFUNC, error); - g_free (error); - g_value_unset (&val); - goto error; - } - g_value_unset (&val); - i = va_arg (var_args, guint); - } - va_end (var_args); - return TRUE; -error: - va_end (var_args); - return FALSE; -} - -/** - * dbus_g_type_struct_set: - * @value: a GValue containing a DBusGTypeStruct type - * @member: struct member to set - * @...: value for the first member, followed optionally by - * more member/value pairs, followed by G_MAXUINT - * - * Sets the selected members of the struct in @value. - * - * Returns: FALSE on failure - */ - -gboolean -dbus_g_type_struct_set (GValue *value, - guint first_member, - ...) -{ - va_list var_args; - GType type; - guint size,i; - gchar *error; - GValue val = {0,}; - - g_return_val_if_fail (dbus_g_type_is_struct (G_VALUE_TYPE (value)), FALSE); - - va_start (var_args, first_member); - size = dbus_g_type_get_struct_size (G_VALUE_TYPE (value)); - i = first_member; - while (i != G_MAXUINT) - { - if (i >= size) - goto error; - - type = dbus_g_type_get_struct_member_type (G_VALUE_TYPE (value),i); - - g_value_init (&val, type); - - G_VALUE_COLLECT (&val, var_args, 0, &error); - if (error) - { - g_warning ("%s, %s", G_STRFUNC, error); - g_free (error); - g_value_unset (&val); - goto error; - } - - dbus_g_type_struct_set_member (value, i, &val); - - g_value_unset (&val); - i = va_arg (var_args, guint); - } - va_end (var_args); - return TRUE; -error: - va_end (var_args); - return FALSE; -} - diff --git a/glib/dbus-gtype-specialized.h b/glib/dbus-gtype-specialized.h deleted file mode 100644 index 1d260092..00000000 --- a/glib/dbus-gtype-specialized.h +++ /dev/null @@ -1,176 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gtype-specialized.h: Non-DBus-specific functions for specialized GTypes - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef DBUS_GOBJECT_TYPE_SPECIALIZED_H -#define DBUS_GOBJECT_TYPE_SPECIALIZED_H - -#include -#include - -G_BEGIN_DECLS - -GType dbus_g_type_get_collection (const char *container, - GType specialization); -GType dbus_g_type_get_map (const char *container, - GType key_specialization, - GType value_specialization); -GType dbus_g_type_get_structv (const char *container, - guint num_items, - GType *types); -GType dbus_g_type_get_struct (const char *container, - GType first_type, - ...); -gboolean dbus_g_type_is_collection (GType gtype); -gboolean dbus_g_type_is_map (GType gtype); -gboolean dbus_g_type_is_struct (GType gtype); -GType dbus_g_type_get_collection_specialization (GType gtype); -GType dbus_g_type_get_map_key_specialization (GType gtype); -GType dbus_g_type_get_map_value_specialization (GType gtype); -GType dbus_g_type_get_struct_member_type (GType gtype, - guint index); -guint dbus_g_type_get_struct_size (GType gtype); - -typedef void (*DBusGTypeSpecializedCollectionIterator) (const GValue *val, - gpointer user_data); -typedef void (*DBusGTypeSpecializedMapIterator) (const GValue *key_val, - const GValue *value_val, - gpointer user_data); - -gpointer dbus_g_type_specialized_construct (GType type); - -typedef struct { - /* public */ - GValue *val; - GType specialization_type; - /* padding */ - gpointer b; - guint c; - gpointer d; -} DBusGTypeSpecializedAppendContext; - -void dbus_g_type_specialized_init_append (GValue *val, DBusGTypeSpecializedAppendContext *ctx); - -void dbus_g_type_specialized_collection_append (DBusGTypeSpecializedAppendContext *ctx, GValue *elt); - -void dbus_g_type_specialized_collection_end_append (DBusGTypeSpecializedAppendContext *ctx); - -void dbus_g_type_specialized_map_append (DBusGTypeSpecializedAppendContext *ctx, - GValue *key, - GValue *val); - - -gboolean dbus_g_type_collection_get_fixed (GValue *value, - gpointer *data, - guint *len); - -void dbus_g_type_collection_value_iterate (const GValue *value, - DBusGTypeSpecializedCollectionIterator iterator, - gpointer user_data); - -void dbus_g_type_map_value_iterate (const GValue *value, - DBusGTypeSpecializedMapIterator iterator, - gpointer user_data); - -gboolean dbus_g_type_struct_get_member (const GValue *value, - guint index, - GValue *dest); -gboolean dbus_g_type_struct_set_member (GValue *value, - guint index, - const GValue *src); - -gboolean dbus_g_type_struct_get (const GValue *value, - guint member, - ...); - -gboolean dbus_g_type_struct_set (GValue *value, - guint member, - ...); - -typedef gpointer (*DBusGTypeSpecializedConstructor) (GType type); -typedef void (*DBusGTypeSpecializedFreeFunc) (GType type, gpointer val); -typedef gpointer (*DBusGTypeSpecializedCopyFunc) (GType type, gpointer src); - -typedef struct { - DBusGTypeSpecializedConstructor constructor; - DBusGTypeSpecializedFreeFunc free_func; - DBusGTypeSpecializedCopyFunc copy_func; - GDestroyNotify simple_free_func; /* for type-independent freeing if possible */ - gpointer padding2; - gpointer padding3; -} DBusGTypeSpecializedVtable; - -typedef gboolean (*DBusGTypeSpecializedCollectionFixedAccessorFunc) (GType type, gpointer instance, gpointer *values, guint *len); -typedef void (*DBusGTypeSpecializedCollectionIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data); -typedef void (*DBusGTypeSpecializedCollectionAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *val); -typedef void (*DBusGTypeSpecializedCollectionEndAppendFunc) (DBusGTypeSpecializedAppendContext *ctx); - -typedef struct { - DBusGTypeSpecializedVtable base_vtable; - DBusGTypeSpecializedCollectionFixedAccessorFunc fixed_accessor; - DBusGTypeSpecializedCollectionIteratorFunc iterator; - DBusGTypeSpecializedCollectionAppendFunc append_func; - DBusGTypeSpecializedCollectionEndAppendFunc end_append_func; -} DBusGTypeSpecializedCollectionVtable; - -typedef void (*DBusGTypeSpecializedMapIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedMapIterator iterator, gpointer user_data); -typedef void (*DBusGTypeSpecializedMapAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val); - -typedef struct { - DBusGTypeSpecializedVtable base_vtable; - DBusGTypeSpecializedMapIteratorFunc iterator; - DBusGTypeSpecializedMapAppendFunc append_func; -} DBusGTypeSpecializedMapVtable; - -typedef gboolean (*DBusGTypeSpecializedStructGetMember) (GType type, gpointer instance, guint member, GValue *ret_value); -typedef gboolean (*DBusGTypeSpecializedStructSetMember) (GType type, gpointer instance, guint member, const GValue *new_value); - -typedef struct { - DBusGTypeSpecializedVtable base_vtable; - DBusGTypeSpecializedStructGetMember get_member; - DBusGTypeSpecializedStructSetMember set_member; -} DBusGTypeSpecializedStructVtable; - -void dbus_g_type_specialized_init (void); - -void dbus_g_type_register_collection (const char *name, - const DBusGTypeSpecializedCollectionVtable *vtable, - guint flags); - -void dbus_g_type_register_map (const char *name, - const DBusGTypeSpecializedMapVtable *vtable, - guint flags); -const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type); -const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type); - -void dbus_g_type_register_struct (const char *name, - const DBusGTypeSpecializedStructVtable *vtable, - guint flags); - -const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type); -const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type); - -const DBusGTypeSpecializedStructVtable* dbus_g_type_struct_peek_vtable (GType struct_type); - -G_END_DECLS - -#endif diff --git a/glib/dbus-gutils.c b/glib/dbus-gutils.c deleted file mode 100644 index ea7a1df4..00000000 --- a/glib/dbus-gutils.c +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gutils.c Utils shared between convenience lib and installed lib - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include "dbus-gutils.h" -#include "dbus-gtest.h" -#include - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -char** -_dbus_gutils_split_path (const char *path) -{ - int len; - char **split; - int n_components; - int i, j, comp; - - len = strlen (path); - - n_components = 0; - if (path[1] != '\0') /* if not "/" */ - { - i = 0; - while (i < len) - { - if (path[i] == '/') - n_components += 1; - ++i; - } - } - - split = g_new0 (char*, n_components + 1); - - comp = 0; - if (n_components == 0) - i = 1; - else - i = 0; - while (comp < n_components) - { - if (path[i] == '/') - ++i; - j = i; - - while (j < len && path[j] != '/') - ++j; - - /* Now [i, j) is the path component */ - g_assert (i < j); - g_assert (path[i] != '/'); - g_assert (j == len || path[j] == '/'); - - split[comp] = g_strndup (&path[i], j - i + 1); - - split[comp][j-i] = '\0'; - - ++comp; - i = j; - } - g_assert (i == len); - - return split; -} - -char* -_dbus_gutils_wincaps_to_uscore (const char *caps) -{ - const char *p; - GString *str; - - str = g_string_new (NULL); - p = caps; - while (*p) - { - if (g_ascii_isupper (*p)) - { - if (str->len > 0 && - (str->len < 2 || str->str[str->len-2] != '_')) - g_string_append_c (str, '_'); - g_string_append_c (str, g_ascii_tolower (*p)); - } - else - { - g_string_append_c (str, *p); - } - ++p; - } - - return g_string_free (str, FALSE); -} - - -#ifdef DBUS_BUILD_TESTS - -/** - * @ingroup DBusGLibInternals - * Unit test for GLib utils internals - * @returns #TRUE on success. - */ -gboolean -_dbus_gutils_test (const char *test_data_dir) -{ - - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/dbus-gutils.h b/glib/dbus-gutils.h deleted file mode 100644 index 874028c9..00000000 --- a/glib/dbus-gutils.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gutils.h Utils shared between convenience lib and installed lib - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef DBUS_GLIB_UTILS_H -#define DBUS_GLIB_UTILS_H - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -#include -#include - -G_BEGIN_DECLS - -char **_dbus_gutils_split_path (const char *path); - -char *_dbus_gutils_wincaps_to_uscore (const char *uscore); - -/* These munge the pointer to enforce that a plain cast won't work, - * accessor functions must be used; i.e. to ensure the ABI - * reflects our encapsulation. - */ -#define _DBUS_POINTER_SHIFT(p) ((void*) (((char*)p) + sizeof (void*))) -#define _DBUS_POINTER_UNSHIFT(p) ((void*) (((char*)p) - sizeof (void*))) - -#define DBUS_CONNECTION_FROM_G_CONNECTION(x) ((DBusConnection*) _DBUS_POINTER_UNSHIFT(x)) -#define DBUS_MESSAGE_FROM_G_MESSAGE(x) ((DBusMessage*) _DBUS_POINTER_UNSHIFT(x)) -#define DBUS_PENDING_CALL_FROM_G_PENDING_CALL(x) ((DBusPendingCall*) _DBUS_POINTER_UNSHIFT(x)) - -#define DBUS_G_CONNECTION_FROM_CONNECTION(x) ((DBusGConnection*) _DBUS_POINTER_SHIFT(x)) -#define DBUS_G_MESSAGE_FROM_MESSAGE(x) ((DBusGMessage*) _DBUS_POINTER_SHIFT(x)) -#define DBUS_G_PENDING_CALL_FROM_PENDING_CALL(x) ((DBusGPendingCall*) _DBUS_POINTER_SHIFT(x)) - -G_END_DECLS - -#endif /* DBUS_GLIB_UTILS_H */ - -#endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/glib/dbus-gvalue-utils.c b/glib/dbus-gvalue-utils.c deleted file mode 100644 index 89ff16d9..00000000 --- a/glib/dbus-gvalue-utils.c +++ /dev/null @@ -1,1439 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gvalue-utils.c: Non-DBus-specific functions related to GType/GValue - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include "dbus/dbus-glib.h" -#include "dbus-gvalue-utils.h" -#include "dbus-gtest.h" -#include -#include -#include - - -static guint -fixed_type_get_size (GType type) -{ - switch (type) - { - case G_TYPE_CHAR: - case G_TYPE_UCHAR: - return sizeof (gchar); - case G_TYPE_BOOLEAN: - return sizeof (gboolean); - case G_TYPE_LONG: - case G_TYPE_ULONG: - return sizeof (glong); - case G_TYPE_INT: - case G_TYPE_UINT: - return sizeof (gint); - case G_TYPE_INT64: - case G_TYPE_UINT64: - return sizeof (gint64); - case G_TYPE_FLOAT: - return sizeof (gfloat); - case G_TYPE_DOUBLE: - return sizeof (gdouble); - default: - return 0; - } -} - -gboolean -_dbus_g_type_is_fixed (GType type) -{ - return fixed_type_get_size (type) > 0; -} - -guint -_dbus_g_type_fixed_get_size (GType type) -{ - g_assert (_dbus_g_type_is_fixed (type)); - return fixed_type_get_size (type); -} - -gboolean -_dbus_gvalue_store (GValue *value, - gpointer storage) -{ - /* FIXME - can we use the GValue lcopy_value method - * to do this in a cleaner way? - */ - switch (g_type_fundamental (G_VALUE_TYPE (value))) - { - case G_TYPE_CHAR: - *((gchar *) storage) = g_value_get_char (value); - return TRUE; - case G_TYPE_UCHAR: - *((guchar *) storage) = g_value_get_uchar (value); - return TRUE; - case G_TYPE_BOOLEAN: - *((gboolean *) storage) = g_value_get_boolean (value); - return TRUE; - case G_TYPE_LONG: - *((glong *) storage) = g_value_get_long (value); - return TRUE; - case G_TYPE_ULONG: - *((gulong *) storage) = g_value_get_ulong (value); - return TRUE; - case G_TYPE_INT: - *((gint *) storage) = g_value_get_int (value); - return TRUE; - case G_TYPE_UINT: - *((guint *) storage) = g_value_get_uint (value); - return TRUE; - case G_TYPE_INT64: - *((gint64 *) storage) = g_value_get_int64 (value); - return TRUE; - case G_TYPE_UINT64: - *((guint64 *) storage) = g_value_get_uint64 (value); - return TRUE; - case G_TYPE_DOUBLE: - *((gdouble *) storage) = g_value_get_double (value); - return TRUE; - case G_TYPE_STRING: - *((gchar **) storage) = (char*) g_value_get_string (value); - return TRUE; - case G_TYPE_OBJECT: - *((gpointer *) storage) = g_value_get_object (value); - return TRUE; - case G_TYPE_BOXED: - *((gpointer *) storage) = g_value_get_boxed (value); - return TRUE; - default: - return FALSE; - } -} - -gboolean -_dbus_gvalue_set_from_pointer (GValue *value, - gconstpointer storage) -{ - /* FIXME - is there a better way to do this? */ - switch (g_type_fundamental (G_VALUE_TYPE (value))) - { - case G_TYPE_CHAR: - g_value_set_char (value, *((gchar *) storage)); - return TRUE; - case G_TYPE_UCHAR: - g_value_set_uchar (value, *((guchar *) storage)); - return TRUE; - case G_TYPE_BOOLEAN: - g_value_set_boolean (value, *((gboolean *) storage)); - return TRUE; - case G_TYPE_LONG: - g_value_set_long (value, *((glong *) storage)); - return TRUE; - case G_TYPE_ULONG: - g_value_set_ulong (value, *((gulong *) storage)); - return TRUE; - case G_TYPE_INT: - g_value_set_int (value, *((gint *) storage)); - return TRUE; - case G_TYPE_UINT: - g_value_set_uint (value, *((guint *) storage)); - return TRUE; - case G_TYPE_INT64: - g_value_set_int64 (value, *((gint64 *) storage)); - return TRUE; - case G_TYPE_UINT64: - g_value_set_uint64 (value, *((guint64 *) storage)); - return TRUE; - case G_TYPE_DOUBLE: - g_value_set_double (value, *((gdouble *) storage)); - return TRUE; - case G_TYPE_STRING: - g_value_set_string (value, *((gchar **) storage)); - return TRUE; - case G_TYPE_OBJECT: - g_value_set_object (value, *((gpointer *) storage)); - return TRUE; - case G_TYPE_BOXED: - g_value_set_boxed (value, *((gpointer *) storage)); - return TRUE; - default: - return FALSE; - } -} - -gboolean -_dbus_gvalue_take (GValue *value, - GTypeCValue *cvalue) -{ - GType g_type; - GTypeValueTable *value_table; - char *error_msg; - - g_type = G_VALUE_TYPE (value); - value_table = g_type_value_table_peek (g_type); - - error_msg = value_table->collect_value (value, 1, cvalue, G_VALUE_NOCOPY_CONTENTS); - if (error_msg) - { - g_warning ("%s: %s", G_STRLOC, error_msg); - g_free (error_msg); - return FALSE; - } - /* Clear the NOCOPY_CONTENTS flag; we want to take ownership - * of the value. - */ - value->data[1].v_uint &= ~(G_VALUE_NOCOPY_CONTENTS); - return TRUE; -} - -gboolean -_dbus_gtype_can_signal_error (GType gtype) -{ - switch (gtype) - { - case G_TYPE_BOOLEAN: - case G_TYPE_INT: - case G_TYPE_UINT: - case G_TYPE_STRING: - case G_TYPE_BOXED: - case G_TYPE_OBJECT: - return TRUE; - default: - return FALSE; - } -} - -gboolean -_dbus_gvalue_signals_error (const GValue *value) -{ - /* Hardcoded rules for return value semantics for certain - * types. Perhaps in the future we'd want an annotation - * specifying which return values are errors, but in - * reality people will probably just use boolean and - * boxed, and there the semantics are pretty standard. - */ - switch (G_TYPE_FUNDAMENTAL (G_VALUE_TYPE (value))) - { - case G_TYPE_BOOLEAN: - return (g_value_get_boolean (value) == FALSE); - break; - case G_TYPE_INT: - return (g_value_get_int (value) < 0); - break; - case G_TYPE_UINT: - return (g_value_get_uint (value) == 0); - break; - case G_TYPE_STRING: - return (g_value_get_string (value) == NULL); - break; - case G_TYPE_BOXED: - return (g_value_get_boxed (value) == NULL); - break; - case G_TYPE_OBJECT: - return (g_value_get_boxed (value) == NULL); - break; - default: - g_assert_not_reached (); - } -} - - -static gboolean -hash_func_from_gtype (GType gtype, GHashFunc *func) -{ - switch (gtype) - { - case G_TYPE_CHAR: - case G_TYPE_UCHAR: - case G_TYPE_BOOLEAN: - case G_TYPE_INT: - case G_TYPE_UINT: - *func = NULL; - return TRUE; - case G_TYPE_STRING: - *func = g_str_hash; - return TRUE; - default: - return FALSE; - } -} - -static void -unset_and_free_g_value (gpointer val) -{ - GValue *value = val; - - g_value_unset (value); - g_free (value); -} - -static gboolean -hash_free_from_gtype (GType gtype, GDestroyNotify *func) -{ - switch (gtype) - { - case G_TYPE_CHAR: - case G_TYPE_UCHAR: - case G_TYPE_BOOLEAN: - case G_TYPE_INT: - case G_TYPE_UINT: - *func = NULL; - return TRUE; - case G_TYPE_DOUBLE: - case G_TYPE_STRING: - *func = g_free; - return TRUE; - default: - if (gtype == G_TYPE_VALUE) - { - *func = unset_and_free_g_value; - return TRUE; - } - else if (gtype == G_TYPE_VALUE_ARRAY) - { - *func = (GDestroyNotify) g_value_array_free; - return TRUE; - } - else if (dbus_g_type_is_collection (gtype)) - { - const DBusGTypeSpecializedCollectionVtable* vtable; - vtable = dbus_g_type_collection_peek_vtable (gtype); - if (vtable->base_vtable.simple_free_func) - { - *func = vtable->base_vtable.simple_free_func; - return TRUE; - } - } - else if (dbus_g_type_is_map (gtype)) - { - const DBusGTypeSpecializedMapVtable* vtable; - vtable = dbus_g_type_map_peek_vtable (gtype); - if (vtable->base_vtable.simple_free_func) - { - *func = vtable->base_vtable.simple_free_func; - return TRUE; - } - } - else if (dbus_g_type_is_struct (gtype)) - { - const DBusGTypeSpecializedStructVtable *vtable; - vtable = dbus_g_type_struct_peek_vtable (gtype); - if (vtable->base_vtable.simple_free_func) - { - *func = vtable->base_vtable.simple_free_func; - return TRUE; - } - } - return FALSE; - } -} - -gboolean -_dbus_gtype_is_valid_hash_key (GType type) -{ - GHashFunc func; - return hash_func_from_gtype (type, &func); -} - -gboolean -_dbus_gtype_is_valid_hash_value (GType type) -{ - GDestroyNotify func; - return hash_free_from_gtype (type, &func); -} - -GHashFunc -_dbus_g_hash_func_from_gtype (GType gtype) -{ - GHashFunc func; - gboolean ret; - ret = hash_func_from_gtype (gtype, &func); - g_assert (ret != FALSE); - return func; -} - -GEqualFunc -_dbus_g_hash_equal_from_gtype (GType gtype) -{ - g_assert (_dbus_gtype_is_valid_hash_key (gtype)); - - switch (gtype) - { - case G_TYPE_CHAR: - case G_TYPE_UCHAR: - case G_TYPE_BOOLEAN: - case G_TYPE_INT: - case G_TYPE_UINT: - return NULL; - case G_TYPE_STRING: - return g_str_equal; - default: - g_assert_not_reached (); - return NULL; - } -} - -GDestroyNotify -_dbus_g_hash_free_from_gtype (GType gtype) -{ - GDestroyNotify func; - gboolean ret; - ret = hash_free_from_gtype (gtype, &func); - g_assert (ret != FALSE); - return func; -} - -static void gvalue_take_ptrarray_value (GValue *value, gpointer instance); - -static void -gvalue_take_hash_value (GValue *value, gpointer instance) -{ - switch (g_type_fundamental (G_VALUE_TYPE (value))) - { - case G_TYPE_CHAR: - g_value_set_char (value, (gchar) GPOINTER_TO_INT (instance)); - break; - case G_TYPE_UCHAR: - g_value_set_uchar (value, (guchar) GPOINTER_TO_UINT (instance)); - break; - case G_TYPE_BOOLEAN: - g_value_set_boolean (value, (gboolean) GPOINTER_TO_UINT (instance)); - break; - case G_TYPE_INT: - g_value_set_int (value, GPOINTER_TO_INT (instance)); - break; - case G_TYPE_UINT: - g_value_set_uint (value, GPOINTER_TO_UINT (instance)); - break; - case G_TYPE_DOUBLE: - g_value_set_double (value, *(gdouble *) instance); - break; - default: - gvalue_take_ptrarray_value (value, instance); - break; - } -} - -static gpointer ptrarray_value_from_gvalue (const GValue *value); - -static gpointer -hash_value_from_gvalue (GValue *value) -{ - switch (g_type_fundamental (G_VALUE_TYPE (value))) - { - case G_TYPE_CHAR: - return GINT_TO_POINTER ((int) g_value_get_char (value)); - break; - case G_TYPE_UCHAR: - return GUINT_TO_POINTER ((guint) g_value_get_uchar (value)); - break; - case G_TYPE_BOOLEAN: - return GUINT_TO_POINTER ((guint) g_value_get_boolean (value)); - break; - case G_TYPE_INT: - return GINT_TO_POINTER (g_value_get_int (value)); - break; - case G_TYPE_UINT: - return GUINT_TO_POINTER (g_value_get_uint (value)); - break; - case G_TYPE_DOUBLE: - { - gdouble *p = (gdouble *) g_malloc0 (sizeof (gdouble)); - *p = g_value_get_double (value); - return (gpointer) p; - } - break; - default: - return ptrarray_value_from_gvalue (value); - break; - } -} - -struct DBusGHashTableValueForeachData -{ - DBusGTypeSpecializedMapIterator func; - GType key_type; - GType value_type; - gpointer data; -}; - -static void -hashtable_foreach_with_values (gpointer key, gpointer value, gpointer user_data) -{ - GValue key_val = {0, }; - GValue value_val = {0, }; - struct DBusGHashTableValueForeachData *data = user_data; - - g_value_init (&key_val, data->key_type); - g_value_init (&value_val, data->value_type); - gvalue_take_hash_value (&key_val, key); - gvalue_take_hash_value (&value_val, value); - - data->func (&key_val, &value_val, data->data); -} - - -static void -hashtable_iterator (GType hash_type, - gpointer instance, - DBusGTypeSpecializedMapIterator iterator, - gpointer user_data) -{ - struct DBusGHashTableValueForeachData data; - GType key_gtype; - GType value_gtype; - - key_gtype = dbus_g_type_get_map_key_specialization (hash_type); - value_gtype = dbus_g_type_get_map_value_specialization (hash_type); - - data.func = iterator; - data.key_type = key_gtype; - data.value_type = value_gtype; - data.data = user_data; - - g_hash_table_foreach (instance, hashtable_foreach_with_values, &data); -} - -void -_dbus_g_hash_table_insert_steal_values (GHashTable *table, - GValue *key_val, - GValue *value_val) -{ - gpointer key, val; - - key = hash_value_from_gvalue (key_val); - val = hash_value_from_gvalue (value_val); - - g_hash_table_insert (table, key, val); -} - -static void -hashtable_append (DBusGTypeSpecializedAppendContext *ctx, - GValue *key, - GValue *val) -{ - GHashTable *table; - - table = g_value_get_boxed (ctx->val); - _dbus_g_hash_table_insert_steal_values (table, key, val); -} - -static gpointer -hashtable_constructor (GType type) -{ - GHashTable *ret; - GType key_gtype; - GType value_gtype; - - key_gtype = dbus_g_type_get_map_key_specialization (type); - value_gtype = dbus_g_type_get_map_value_specialization (type); - - ret = g_hash_table_new_full (_dbus_g_hash_func_from_gtype (key_gtype), - _dbus_g_hash_equal_from_gtype (key_gtype), - _dbus_g_hash_free_from_gtype (key_gtype), - _dbus_g_hash_free_from_gtype (value_gtype)); - return ret; -} - -static void -hashtable_insert_values (GHashTable *table, - const GValue *key_val, - const GValue *value_val) -{ - GValue key_copy = {0, }; - GValue value_copy = {0, }; - - g_value_init (&key_copy, G_VALUE_TYPE (key_val)); - g_value_copy (key_val, &key_copy); - g_value_init (&value_copy, G_VALUE_TYPE (value_val)); - g_value_copy (value_val, &value_copy); - - _dbus_g_hash_table_insert_steal_values (table, &key_copy, &value_copy); -} - -static void -hashtable_foreach_copy (const GValue *key, const GValue *val, gpointer data) -{ - hashtable_insert_values ((GHashTable *) data, key, val); -} - -static gpointer -hashtable_copy (GType type, gpointer src) -{ - GHashTable *ghash; - GHashTable *ret; - GValue hashval = {0,}; - - ghash = src; - - ret = hashtable_constructor (type); - - g_value_init (&hashval, type); - g_value_set_static_boxed (&hashval, ghash); - dbus_g_type_map_value_iterate (&hashval, hashtable_foreach_copy, ret); - return ret; -} - -static void -hashtable_simple_free (gpointer val) -{ - g_hash_table_destroy (val); -} - -static gpointer -valuearray_constructor (GType type) -{ - GValueArray *ret; - guint size = dbus_g_type_get_struct_size (type); - guint i; - ret = g_value_array_new (size); - for (i=0; i < size; i++) - { - GValue val = {0,}; - g_value_init (&val, dbus_g_type_get_struct_member_type (type, i)); - g_value_array_append(ret, &val); - } - return (gpointer)ret; -} - -static gpointer -valuearray_copy (GType type, gpointer src) -{ - return g_value_array_copy ((GValueArray*) src); -} - -static void -valuearray_simple_free (gpointer val) -{ - g_value_array_free (val); -} - -static gboolean -valuearray_get_member (GType type, gpointer instance, - guint member, GValue *ret) -{ - GValueArray *va = (GValueArray*) instance; - const GValue *val; - if (member < dbus_g_type_get_struct_size (type)) - { - val = g_value_array_get_nth (va, member); - g_value_copy (val, ret); - return TRUE; - } - else - return FALSE; -} - -static gboolean -valuearray_set_member (GType type, gpointer instance, - guint member, const GValue *member_type) -{ - GValueArray *va = (GValueArray*) instance; - GValue *vp; - if (member < dbus_g_type_get_struct_size (type)) - { - vp = g_value_array_get_nth (va, member); - g_value_copy (member_type, vp); - return TRUE; - } - else - return FALSE; -} - - -static gpointer -array_constructor (GType type) -{ - GArray *array; - guint elt_size; - GType elt_type; - gboolean zero_terminated; - gboolean clear; - - elt_type = dbus_g_type_get_collection_specialization (type); - g_assert (elt_type != G_TYPE_INVALID); - - elt_size = _dbus_g_type_fixed_get_size (elt_type); - - /* These are "safe" defaults */ - zero_terminated = TRUE; /* ((struct _DBusGRealArray*) garray)->zero_terminated; */ - clear = TRUE; /* ((struct _DBusGRealArray*) garray)->clear; */ - - array = g_array_new (zero_terminated, clear, elt_size); - return array; -} - -static gpointer -array_copy (GType type, gpointer src) -{ - GArray *garray; - GArray *new; - - garray = src; - - new = array_constructor (type); - g_array_append_vals (new, garray->data, garray->len); - - return new; -} - -static void -array_simple_free (gpointer val) -{ - GArray *array; - array = val; - g_array_free (array, TRUE); -} - -static gboolean -array_fixed_accessor (GType type, gpointer instance, gpointer *values, guint *len) -{ - GType elt_type; - GArray *array = instance; - - elt_type = dbus_g_type_get_collection_specialization (type); - if (!_dbus_g_type_is_fixed (elt_type)) - return FALSE; - - *values = array->data; - *len = array->len; - return TRUE; -} - -static gpointer -ptrarray_constructor (GType type) -{ - /* Later we should determine a destructor, need g_ptr_array_destroy */ - return g_ptr_array_new (); -} - -static void -gvalue_take_ptrarray_value (GValue *value, gpointer instance) -{ - switch (g_type_fundamental (G_VALUE_TYPE (value))) - { - case G_TYPE_STRING: - g_value_take_string (value, instance); - break; - case G_TYPE_BOXED: - g_value_take_boxed (value, instance); - break; - case G_TYPE_OBJECT: - g_value_take_object (value, instance); - break; - default: - g_assert_not_reached (); - break; - } -} - -static gpointer -ptrarray_value_from_gvalue (const GValue *value) -{ - GValue tmp = {0, }; - - /* if the NOCOPY flag is set, then value was created via set_static and hence - * is not owned by us. in order to preserve the "take" semantics that the API - * has in general (which avoids copying in the common case), we must copy any - * static values so that we can indiscriminately free the entire collection - * later. */ - if (value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS) - { - g_value_init (&tmp, G_VALUE_TYPE (value)); - g_value_copy (value, &tmp); - value = &tmp; - } - - switch (g_type_fundamental (G_VALUE_TYPE (value))) - { - case G_TYPE_STRING: - return (gpointer) g_value_get_string (value); - break; - case G_TYPE_BOXED: - return g_value_get_boxed (value); - break; - case G_TYPE_OBJECT: - return g_value_get_object (value); - break; - default: - g_assert_not_reached (); - return NULL; - } -} - -static void -ptrarray_iterator (GType ptrarray_type, - gpointer instance, - DBusGTypeSpecializedCollectionIterator iterator, - gpointer user_data) -{ - GPtrArray *ptrarray; - GType elt_gtype; - guint i; - - ptrarray = instance; - - elt_gtype = dbus_g_type_get_collection_specialization (ptrarray_type); - - for (i = 0; i < ptrarray->len; i++) - { - GValue val = {0, }; - g_value_init (&val, elt_gtype); - gvalue_take_ptrarray_value (&val, g_ptr_array_index (ptrarray, i)); - iterator (&val, user_data); - } -} - -static void -ptrarray_copy_elt (const GValue *val, gpointer user_data) -{ - GPtrArray *dest = user_data; - GValue val_copy = {0, }; - - g_value_init (&val_copy, G_VALUE_TYPE (val)); - g_value_copy (val, &val_copy); - - g_ptr_array_add (dest, ptrarray_value_from_gvalue (&val_copy)); -} - -static gpointer -ptrarray_copy (GType type, gpointer src) -{ - GPtrArray *new; - GValue array_val = {0, }; - - g_value_init (&array_val, type); - g_value_set_static_boxed (&array_val, src); - - new = ptrarray_constructor (type); - dbus_g_type_collection_value_iterate (&array_val, ptrarray_copy_elt, new); - - return new; -} - -static void -ptrarray_append (DBusGTypeSpecializedAppendContext *ctx, GValue *value) -{ - GPtrArray *array; - - array = g_value_get_boxed (ctx->val); - - g_ptr_array_add (array, ptrarray_value_from_gvalue (value)); -} - -static void -ptrarray_free (GType type, gpointer val) -{ - GPtrArray *array; - GValue elt_val = {0, }; - GType elt_gtype; - unsigned int i; - - array = val; - - elt_gtype = dbus_g_type_get_collection_specialization (type); - - for (i = 0; i < array->len; i++) - { - g_value_init (&elt_val, elt_gtype); - gvalue_take_ptrarray_value (&elt_val, g_ptr_array_index (array, i)); - g_value_unset (&elt_val); - } - - g_ptr_array_free (array, TRUE); -} - -static gpointer -slist_constructor (GType type) -{ - return NULL; -} - -static void -slist_iterator (GType list_type, - gpointer instance, - DBusGTypeSpecializedCollectionIterator iterator, - gpointer user_data) -{ - GSList *slist; - GType elt_gtype; - - slist = instance; - - elt_gtype = dbus_g_type_get_collection_specialization (list_type); - - for (slist = instance; slist != NULL; slist = slist->next) - { - GValue val = {0, }; - g_value_init (&val, elt_gtype); - gvalue_take_ptrarray_value (&val, slist->data); - iterator (&val, user_data); - } -} - -static void -slist_copy_elt (const GValue *val, gpointer user_data) -{ - GSList **dest = user_data; - GValue val_copy = {0, }; - - g_value_init (&val_copy, G_VALUE_TYPE (val)); - g_value_copy (val, &val_copy); - - *dest = g_slist_append (*dest, ptrarray_value_from_gvalue (&val_copy)); -} - -static gpointer -slist_copy (GType type, gpointer src) -{ - GSList *new; - GValue slist_val = {0, }; - - g_value_init (&slist_val, type); - g_value_set_static_boxed (&slist_val, src); - - new = slist_constructor (type); - dbus_g_type_collection_value_iterate (&slist_val, slist_copy_elt, &new); - - return new; -} - -static void -slist_append (DBusGTypeSpecializedAppendContext *ctx, GValue *value) -{ - GSList *list; - - list = g_value_get_boxed (ctx->val); - list = g_slist_prepend (list, ptrarray_value_from_gvalue (value)); - g_value_set_static_boxed (ctx->val, list); -} - -static void -slist_end_append (DBusGTypeSpecializedAppendContext *ctx) -{ - GSList *list; - - /* if you append multiple times to the slist, this will reverse the existing - * elements... we need an init_append function */ - list = g_value_get_boxed (ctx->val); - list = g_slist_reverse (list); - - g_value_take_boxed (ctx->val, list); -} - -static void -slist_free (GType type, gpointer val) -{ - GSList *list; - GType elt_gtype; - list = val; - - elt_gtype = dbus_g_type_get_collection_specialization (type); - - while (list != NULL) - { - GValue elt_val = {0, }; - g_value_init (&elt_val, elt_gtype); - gvalue_take_ptrarray_value (&elt_val, list->data); - g_value_unset (&elt_val); - list = g_slist_next(list); - } - list=val; - g_slist_free (list); -} - -void -_dbus_g_type_specialized_builtins_init (void) -{ - /* types with a simple_free function can be freed at run-time without - * the destroy function needing to know the type, so they can be - * stored in hash tables */ - - static const DBusGTypeSpecializedCollectionVtable array_vtable = { - { - array_constructor, - NULL, - array_copy, - array_simple_free, - NULL, - NULL, - }, - array_fixed_accessor, - NULL, - NULL, - NULL - }; - - - static const DBusGTypeSpecializedCollectionVtable ptrarray_vtable = { - { - ptrarray_constructor, - ptrarray_free, - ptrarray_copy, - NULL, - NULL, - NULL, - }, - NULL, - ptrarray_iterator, - ptrarray_append, - NULL, - }; - - - static const DBusGTypeSpecializedCollectionVtable slist_vtable = { - { - slist_constructor, - slist_free, - slist_copy, - NULL, - NULL, - NULL, - }, - NULL, - slist_iterator, - slist_append, - slist_end_append, - }; - - static const DBusGTypeSpecializedMapVtable hashtable_vtable = { - { - hashtable_constructor, - NULL, - hashtable_copy, - hashtable_simple_free, - NULL, - NULL - }, - hashtable_iterator, - hashtable_append - }; - - static const DBusGTypeSpecializedStructVtable valuearray_vtable = { - { - valuearray_constructor, - NULL, - valuearray_copy, - valuearray_simple_free, - NULL, - NULL - }, - valuearray_get_member, - valuearray_set_member - }; - - dbus_g_type_register_collection ("GSList", &slist_vtable, 0); - dbus_g_type_register_collection ("GArray", &array_vtable, 0); - dbus_g_type_register_collection ("GPtrArray", &ptrarray_vtable, 0); - dbus_g_type_register_map ("GHashTable", &hashtable_vtable, 0); - dbus_g_type_register_struct ("GValueArray", &valuearray_vtable, 0); -} - -#ifdef DBUS_BUILD_TESTS - -typedef struct -{ - gboolean seen_foo; - gboolean seen_baz; -} TestSpecializedHashData; - -static void -test_specialized_hash (const GValue *key, const GValue *val, gpointer user_data) -{ - TestSpecializedHashData *data = user_data; - - g_assert (G_VALUE_HOLDS_STRING (key)); - g_assert (G_VALUE_HOLDS_STRING (val)); - - if (!strcmp (g_value_get_string (key), "foo")) - { - data->seen_foo = TRUE; - g_assert (!strcmp (g_value_get_string (val), "bar")); - } - else if (!strcmp (g_value_get_string (key), "baz")) - { - data->seen_baz = TRUE; - g_assert (!strcmp (g_value_get_string (val), "moo")); - } - else - { - g_assert_not_reached (); - } -} - -static void -test_specialized_hash_2 (const GValue *key, const GValue *val, gpointer user_data) -{ - TestSpecializedHashData *data = user_data; - const GValue *realval; - - g_assert (G_VALUE_HOLDS_STRING (key)); - g_assert (G_VALUE_TYPE (val) == G_TYPE_VALUE); - - realval = g_value_get_boxed (val); - - if (!strcmp (g_value_get_string (key), "foo")) - { - data->seen_foo = TRUE; - g_assert (G_VALUE_HOLDS_UINT (realval)); - g_assert (g_value_get_uint (realval) == 20); - } - else if (!strcmp (g_value_get_string (key), "baz")) - { - data->seen_baz = TRUE; - g_assert (G_VALUE_HOLDS_STRING (realval)); - g_assert (!strcmp ("bar", g_value_get_string (realval))); - } - else - { - g_assert_not_reached (); - } -} - -gboolean -_dbus_gvalue_utils_test (const char *datadir) -{ - GType type; - - dbus_g_type_specialized_init (); - _dbus_g_type_specialized_builtins_init (); - - type = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); - g_assert (dbus_g_type_is_collection (type)); - g_assert (dbus_g_type_get_collection_specialization (type) == G_TYPE_UINT); - { - GArray *instance; - - instance = dbus_g_type_specialized_construct (type); - - g_assert (instance->len == 0); - - g_array_free (instance, TRUE); - } - - type = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); - g_assert (dbus_g_type_is_map (type)); - g_assert (dbus_g_type_get_map_key_specialization (type) == G_TYPE_STRING); - g_assert (dbus_g_type_get_map_value_specialization (type) == G_TYPE_STRING); - { - GHashTable *instance; - GValue val = { 0, }; - TestSpecializedHashData hashdata; - - instance = dbus_g_type_specialized_construct (type); - - g_assert (g_hash_table_size (instance) == 0); - g_hash_table_insert (instance, g_strdup ("foo"), g_strdup ("bar")); - g_hash_table_insert (instance, g_strdup ("baz"), g_strdup ("moo")); - g_assert (g_hash_table_size (instance) == 2); - - g_value_init (&val, type); - g_value_set_boxed_take_ownership (&val, instance); - hashdata.seen_foo = FALSE; - hashdata.seen_baz = FALSE; - dbus_g_type_map_value_iterate (&val, - test_specialized_hash, - &hashdata); - - g_assert (hashdata.seen_foo); - g_assert (hashdata.seen_baz); - - g_value_unset (&val); - } - - type = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); - g_assert (dbus_g_type_is_map (type)); - g_assert (dbus_g_type_get_map_key_specialization (type) == G_TYPE_STRING); - g_assert (dbus_g_type_get_map_value_specialization (type) == G_TYPE_VALUE); - { - GHashTable *instance; - GValue val = { 0, }; - TestSpecializedHashData hashdata; - DBusGTypeSpecializedAppendContext ctx; - GValue *eltval; - - instance = dbus_g_type_specialized_construct (type); - g_value_init (&val, type); - g_value_set_boxed_take_ownership (&val, instance); - - dbus_g_type_specialized_init_append (&val, &ctx); - - { - GValue keyval = { 0, }; - GValue valval = { 0, }; - g_value_init (&keyval, G_TYPE_STRING); - g_value_set_string (&keyval, "foo"); - - g_value_init (&valval, G_TYPE_VALUE); - eltval = g_new0 (GValue, 1); - g_value_init (eltval, G_TYPE_UINT); - g_value_set_uint (eltval, 20); - g_value_set_boxed_take_ownership (&valval, eltval); - dbus_g_type_specialized_map_append (&ctx, &keyval, &valval); - } - - { - GValue keyval = { 0, }; - GValue valval = { 0, }; - g_value_init (&keyval, G_TYPE_STRING); - g_value_set_string (&keyval, "baz"); - g_value_init (&valval, G_TYPE_VALUE); - eltval = g_new0 (GValue, 1); - g_value_init (eltval, G_TYPE_STRING); - g_value_set_string (eltval, "bar"); - g_value_set_boxed_take_ownership (&valval, eltval); - dbus_g_type_specialized_map_append (&ctx, &keyval, &valval); - } - - hashdata.seen_foo = FALSE; - hashdata.seen_baz = FALSE; - dbus_g_type_map_value_iterate (&val, - test_specialized_hash_2, - &hashdata); - - g_assert (hashdata.seen_foo); - g_assert (hashdata.seen_baz); - - g_value_unset (&val); - } - - type = dbus_g_type_get_collection ("GSList", G_TYPE_OBJECT); - g_assert (dbus_g_type_is_collection (type)); - g_assert (dbus_g_type_get_collection_specialization (type) == G_TYPE_OBJECT); - { - GSList *instance, *tmp, *copy; - GValue val = {0, }; - GValue copyval = {0, }; - DBusGTypeSpecializedAppendContext ctx; - GObject *objects[3]; - int i; - - instance = dbus_g_type_specialized_construct (type); - g_assert (instance == NULL); - - g_value_init (&val, type); - g_value_take_boxed (&val, instance); - - dbus_g_type_specialized_init_append (&val, &ctx); - - for (i = 0; i < 3; i++) - { - GValue eltval = { 0, }; - GObject *obj = g_object_new (G_TYPE_OBJECT, NULL); - - g_assert (obj != NULL); - objects[i] = obj; - g_object_add_weak_pointer (obj, (gpointer) (objects + i)); - - g_value_init (&eltval, G_TYPE_OBJECT); - g_value_take_object (&eltval, obj); - dbus_g_type_specialized_collection_append (&ctx, &eltval); - } - - dbus_g_type_specialized_collection_end_append (&ctx); - - instance = g_value_get_boxed (&val); - g_assert (g_slist_length (instance) == 3); - - for (tmp = instance; tmp; tmp = tmp->next) - { - GObject *obj = tmp->data; - g_assert (G_IS_OBJECT (obj)); - g_assert (obj->ref_count == 1); - } - - g_value_init (©val, type); - g_value_copy (&val, ©val); - - copy = g_value_get_boxed (©val); - g_assert (g_slist_length (copy) == 3); - - for (tmp = copy; tmp; tmp = tmp->next) - { - GObject *obj = tmp->data; - g_assert (G_IS_OBJECT (obj)); - g_assert (obj->ref_count == 2); - } - - g_value_unset (©val); - - for (i = 0; i < 3; i++) - { - g_assert (objects[i] != NULL); - } - - for (tmp = instance; tmp; tmp = tmp->next) - { - GObject *obj = tmp->data; - g_assert (G_IS_OBJECT (obj)); - g_assert (obj->ref_count == 1); - } - - g_value_unset (&val); - - for (i = 0; i < 3; i++) - { - g_assert (objects[i] == NULL); - } - } - - type = dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING); - g_assert (dbus_g_type_is_collection (type)); - g_assert (dbus_g_type_get_collection_specialization (type) == G_TYPE_STRING); - { - GPtrArray *instance; - DBusGTypeSpecializedAppendContext ctx; - GValue val = {0, }; - GValue eltval = {0, }; - - instance = dbus_g_type_specialized_construct (type); - - g_assert (instance->len == 0); - - g_value_init (&val, type); - g_value_set_boxed_take_ownership (&val, instance); - - dbus_g_type_specialized_init_append (&val, &ctx); - - g_value_init (&eltval, G_TYPE_STRING); - g_value_set_static_string (&eltval, "foo"); - dbus_g_type_specialized_collection_append (&ctx, &eltval); - - g_value_reset (&eltval); - g_value_set_static_string (&eltval, "bar"); - dbus_g_type_specialized_collection_append (&ctx, &eltval); - - g_value_reset (&eltval); - g_value_set_static_string (&eltval, "baz"); - dbus_g_type_specialized_collection_append (&ctx, &eltval); - - dbus_g_type_specialized_collection_end_append (&ctx); - - g_assert (instance->len == 3); - - g_assert (!strcmp ("foo", g_ptr_array_index (instance, 0))); - g_assert (!strcmp ("bar", g_ptr_array_index (instance, 1))); - g_assert (!strcmp ("baz", g_ptr_array_index (instance, 2))); - - g_value_unset (&val); - } - - type = dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_UINT, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); - g_assert (dbus_g_type_is_struct (type)); - g_assert (dbus_g_type_get_struct_size (type) == 3); - g_assert (dbus_g_type_get_struct_member_type (type, 0) == G_TYPE_STRING); - g_assert (dbus_g_type_get_struct_member_type (type, 1) == G_TYPE_UINT); - g_assert (dbus_g_type_get_struct_member_type (type, 2) == DBUS_TYPE_G_OBJECT_PATH); - { - GValueArray *instance; - GValue val = {0, }; - GValue memval = {0, }; - - instance = dbus_g_type_specialized_construct (type); - - g_assert (instance->n_values == 3); - - g_value_init (&val, type); - g_value_set_boxed_take_ownership (&val, instance); - - g_value_init (&memval, G_TYPE_STRING); - g_value_set_static_string (&memval, "foo"); - dbus_g_type_struct_set_member (&val, 0, &memval); - g_value_unset (&memval); - - g_value_init (&memval, G_TYPE_UINT); - g_value_set_uint (&memval, 42); - dbus_g_type_struct_set_member (&val, 1, &memval); - g_value_unset (&memval); - - g_value_init (&memval, DBUS_TYPE_G_OBJECT_PATH); - g_value_set_static_boxed (&memval, "/bar/moo/foo/baz"); - dbus_g_type_struct_set_member (&val, 2, &memval); - g_value_unset (&memval); - - g_assert (instance->n_values == 3); - - g_value_init (&memval, G_TYPE_STRING); - dbus_g_type_struct_get_member (&val, 0, &memval); - g_assert (0 == strcmp (g_value_get_string (&memval), "foo")); - g_value_unset (&memval); - - g_value_init (&memval, G_TYPE_UINT); - dbus_g_type_struct_get_member (&val, 1, &memval); - g_assert (g_value_get_uint (&memval) == 42); - g_value_unset (&memval); - - g_value_init (&memval, DBUS_TYPE_G_OBJECT_PATH); - dbus_g_type_struct_get_member (&val, 2, &memval); - g_assert (0 == strcmp ((gchar*) g_value_get_boxed (&memval), - "/bar/moo/foo/baz")); - g_value_unset (&memval); - - g_value_unset (&val); - } - - type = dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_UINT, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); - g_assert (dbus_g_type_is_struct (type)); - g_assert (dbus_g_type_get_struct_size (type) == 3); - g_assert (dbus_g_type_get_struct_member_type (type, 0) == G_TYPE_STRING); - g_assert (dbus_g_type_get_struct_member_type (type, 1) == G_TYPE_UINT); - g_assert (dbus_g_type_get_struct_member_type (type, 2) == DBUS_TYPE_G_OBJECT_PATH); - { - GValueArray *instance; - GValue val = {0, }; - - instance = dbus_g_type_specialized_construct (type); - - g_assert (instance->n_values == 3); - - g_value_init (&val, type); - g_value_set_boxed_take_ownership (&val, instance); - - dbus_g_type_struct_set (&val, - 0,"foo", - 1, 42, - 2, "/bar/moo/foo/baz", - G_MAXUINT); - - g_assert (instance->n_values == 3); - - { - gchar *string; - guint intval; - gchar *path; - - dbus_g_type_struct_get (&val, - 0, &string, - 1, &intval, - 2, &path, - G_MAXUINT); - - g_assert (0 == strcmp (string, "foo")); - g_assert (intval == 42); - g_assert (0 == strcmp (path, "/bar/moo/foo/baz")); - } - - g_value_unset (&val); - } - - - return TRUE; -} - - - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-gvalue-utils.h b/glib/dbus-gvalue-utils.h deleted file mode 100644 index cba3b61a..00000000 --- a/glib/dbus-gvalue-utils.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gvalue-utils.h: Non-DBus-specific functions related to GType/GValue - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef DBUS_GOBJECT_VALUE_UTILS_H -#define DBUS_GOBJECT_VALUE_UTILS_H - -#include -#include - -G_BEGIN_DECLS - -void _dbus_g_type_specialized_builtins_init (void); - -gboolean _dbus_g_type_is_fixed (GType gtype); -guint _dbus_g_type_fixed_get_size (GType gtype); - -gboolean _dbus_gvalue_set_from_pointer (GValue *value, - gconstpointer storage); - -typedef void (*DBusGHashValueForeachFunc) (GValue * key, GValue *val, gpointer data); - -void _dbus_g_hash_table_value_foreach (GHashTable *table, - GType hash_type, - DBusGHashValueForeachFunc func, - gpointer data); - -void _dbus_g_hash_table_insert_values (GHashTable *table, - GValue *key_val, - GValue *value_val); -void _dbus_g_hash_table_insert_steal_values (GHashTable *table, - GValue *key_val, - GValue *value_val); - -gboolean _dbus_gtype_is_valid_hash_key (GType type); -gboolean _dbus_gtype_is_valid_hash_value (GType type); - -GHashFunc _dbus_g_hash_func_from_gtype (GType gtype); -GEqualFunc _dbus_g_hash_equal_from_gtype (GType gtype); -GDestroyNotify _dbus_g_hash_free_from_gtype (GType gtype); - -gboolean _dbus_gvalue_store (GValue *value, - gpointer storage); - -gboolean _dbus_gvalue_take (GValue *value, - GTypeCValue *cvalue); - -gboolean _dbus_gtype_can_signal_error (GType gtype); -gboolean _dbus_gvalue_signals_error (const GValue *value); - - -G_END_DECLS - -#endif diff --git a/glib/dbus-gvalue.c b/glib/dbus-gvalue.c deleted file mode 100644 index b81b4a65..00000000 --- a/glib/dbus-gvalue.c +++ /dev/null @@ -1,1854 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-gvalue.c GValue to-from DBusMessageIter - * - * Copyright (C) 2004 Ximian, Inc. - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "config.h" -#include "dbus-gtest.h" -#include "dbus-gvalue.h" -#include "dbus-gsignature.h" -#include "dbus-gobject.h" -#include "dbus-gvalue-utils.h" -#include "dbus/dbus-glib.h" -#include -#include -#include -#include "dbus/dbus-signature.h" - -static gboolean demarshal_static_variant (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); - - -static gboolean marshal_basic (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_basic (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_strv (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_strv (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_valuearray (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_valuearray (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_variant (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_variant (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_proxy (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_proxy (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_object_path (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_object_path (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_object (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_object (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_map (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_map (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); - -static gboolean marshal_collection (DBusMessageIter *iter, - const GValue *value); -static gboolean marshal_collection_ptrarray (DBusMessageIter *iter, - const GValue *value); -static gboolean marshal_collection_array (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_collection (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean demarshal_collection_ptrarray (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean demarshal_collection_array (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); -static gboolean marshal_struct (DBusMessageIter *iter, - const GValue *value); -static gboolean demarshal_struct (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); - - -typedef gboolean (*DBusGValueMarshalFunc) (DBusMessageIter *iter, - const GValue *value); -typedef gboolean (*DBusGValueDemarshalFunc) (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); - -typedef struct { - DBusGValueMarshalFunc marshaller; - DBusGValueDemarshalFunc demarshaller; -} DBusGTypeMarshalVtable; - -typedef struct { - const char *sig; - const DBusGTypeMarshalVtable *vtable; -} DBusGTypeMarshalData; - -static GQuark -dbus_g_type_metadata_data_quark () -{ - static GQuark quark; - if (!quark) - quark = g_quark_from_static_string ("DBusGTypeMetaData"); - - return quark; -} - -static void -set_type_metadata (GType type, const DBusGTypeMarshalData *data) -{ - g_type_set_qdata (type, dbus_g_type_metadata_data_quark (), (gpointer) data); -} - -static void -register_basic (int typecode, const DBusGTypeMarshalData *typedata) -{ - set_type_metadata (_dbus_gtype_from_basic_typecode (typecode), typedata); -} - -void -_dbus_g_value_types_init (void) -{ - static gboolean types_initialized; - - static const DBusGTypeMarshalVtable basic_vtable = { - marshal_basic, - demarshal_basic - }; - - if (types_initialized) - return; - - dbus_g_type_specialized_init (); - _dbus_g_type_specialized_builtins_init (); - - /* Register basic types */ - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_BOOLEAN_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_BOOLEAN, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_BYTE_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_BYTE, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_INT16_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_INT16, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_UINT16_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_UINT16, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_UINT32_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_UINT32, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_INT32_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_INT32, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_UINT64_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_UINT64, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_INT64_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_INT64, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_DOUBLE_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_DOUBLE, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_STRING_AS_STRING, - &basic_vtable, - }; - register_basic (DBUS_TYPE_STRING, &typedata); - } - /* fundamental GTypes that don't map 1:1 with D-BUS types */ - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_BYTE_AS_STRING, - &basic_vtable, - }; - set_type_metadata (G_TYPE_CHAR, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_INT32_AS_STRING, - &basic_vtable, - }; - set_type_metadata (G_TYPE_LONG, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_UINT32_AS_STRING, - &basic_vtable, - }; - set_type_metadata (G_TYPE_ULONG, &typedata); - } - { - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_DOUBLE_AS_STRING, - &basic_vtable, - }; - set_type_metadata (G_TYPE_FLOAT, &typedata); - } - - /* Register complex types with builtin GType mappings */ - { - static const DBusGTypeMarshalVtable vtable = { - marshal_variant, - demarshal_variant - }; - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_VARIANT_AS_STRING, - &vtable - }; - set_type_metadata (G_TYPE_VALUE, &typedata); - }; - { - static const DBusGTypeMarshalVtable vtable = { - marshal_strv, - demarshal_strv - }; - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING, - &vtable - }; - set_type_metadata (G_TYPE_STRV, &typedata); - }; - - - /* Register some types specific to the D-BUS GLib bindings */ - { - static const DBusGTypeMarshalVtable vtable = { - marshal_proxy, - demarshal_proxy - }; - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_OBJECT_PATH_AS_STRING, - &vtable - }; - set_type_metadata (DBUS_TYPE_G_PROXY, &typedata); - } - - { - static const DBusGTypeMarshalVtable vtable = { - marshal_object_path, - demarshal_object_path - }; - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_OBJECT_PATH_AS_STRING, - &vtable - }; - set_type_metadata (DBUS_TYPE_G_OBJECT_PATH, &typedata); - } - - { - static const DBusGTypeMarshalVtable vtable = { - marshal_object, - demarshal_object - }; - static const DBusGTypeMarshalData typedata = { - DBUS_TYPE_OBJECT_PATH_AS_STRING, - &vtable - }; - set_type_metadata (G_TYPE_OBJECT, &typedata); - } - - types_initialized = TRUE; -} - -/** - * Get the GLib type ID for a DBusGObjectPath boxed type. - * - * @returns GLib type - */ -GType -dbus_g_object_path_get_g_type (void) -{ - static GType type_id = 0; - - if (!type_id) - type_id = g_boxed_type_register_static ("DBusGObjectPath", - (GBoxedCopyFunc) g_strdup, - (GBoxedFreeFunc) g_free); - return type_id; -} - - -char * -_dbus_gtype_to_signature (GType gtype) -{ - char *ret; - DBusGTypeMarshalData *typedata; - - if (dbus_g_type_is_collection (gtype)) - { - GType elt_gtype; - char *subsig; - - elt_gtype = dbus_g_type_get_collection_specialization (gtype); - subsig = _dbus_gtype_to_signature (elt_gtype); - ret = g_strconcat (DBUS_TYPE_ARRAY_AS_STRING, subsig, NULL); - g_free (subsig); - } - else if (dbus_g_type_is_map (gtype)) - { - GType key_gtype; - GType val_gtype; - char *key_subsig; - char *val_subsig; - - key_gtype = dbus_g_type_get_map_key_specialization (gtype); - val_gtype = dbus_g_type_get_map_value_specialization (gtype); - key_subsig = _dbus_gtype_to_signature (key_gtype); - val_subsig = _dbus_gtype_to_signature (val_gtype); - ret = g_strconcat (DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING, key_subsig, val_subsig, DBUS_DICT_ENTRY_END_CHAR_AS_STRING, NULL); - g_free (key_subsig); - g_free (val_subsig); - } - else if (dbus_g_type_is_struct (gtype)) - { - guint i, size; - GString *sig; - size = dbus_g_type_get_struct_size (gtype); - sig = g_string_sized_new (size+2); /*some sensible starting size*/ - g_string_assign (sig, DBUS_STRUCT_BEGIN_CHAR_AS_STRING); - for (i = 0; i < size; i++) - { - gchar *subsig; - subsig = _dbus_gtype_to_signature ( - dbus_g_type_get_struct_member_type (gtype, i)); - g_string_append (sig, subsig); - g_free (subsig); - } - g_string_append (sig, DBUS_STRUCT_END_CHAR_AS_STRING); - ret = g_string_free (sig, FALSE); - } - else - { - typedata = g_type_get_qdata (gtype, dbus_g_type_metadata_data_quark ()); - if (typedata == NULL) - return NULL; - ret = g_strdup (typedata->sig); - } - return ret; -} - -char * -_dbus_gvalue_to_signature (const GValue *val) -{ - GType gtype; - - gtype = G_VALUE_TYPE (val); - if (g_type_is_a (gtype, G_TYPE_VALUE_ARRAY)) - { - GString *str; - guint i; - GValueArray *array; - - array = g_value_get_boxed (val); - - str = g_string_new (DBUS_STRUCT_BEGIN_CHAR_AS_STRING); - for (i = 0; i < array->n_values; i++) - { - char *sig; - sig = _dbus_gvalue_to_signature (g_value_array_get_nth (array, i)); - g_string_append (str, sig); - g_free (sig); - } - g_string_append (str, DBUS_STRUCT_END_CHAR_AS_STRING); - - return g_string_free (str, FALSE); - } - else - return _dbus_gtype_to_signature (gtype); -} - -static gboolean -demarshal_basic (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - int current_type; - - current_type = dbus_message_iter_get_arg_type (iter); - g_assert (dbus_type_is_basic (current_type)); - - switch (current_type) - { - case DBUS_TYPE_BOOLEAN: - { - dbus_bool_t bool; - dbus_message_iter_get_basic (iter, &bool); - g_value_set_boolean (value, bool); - return TRUE; - } - case DBUS_TYPE_BYTE: - { - unsigned char byte; - dbus_message_iter_get_basic (iter, &byte); - g_value_set_uchar (value, byte); - return TRUE; - } - case DBUS_TYPE_INT32: - { - dbus_int32_t intval; - dbus_message_iter_get_basic (iter, &intval); - g_value_set_int (value, intval); - return TRUE; - } - case DBUS_TYPE_UINT32: - { - dbus_uint32_t intval; - dbus_message_iter_get_basic (iter, &intval); - g_value_set_uint (value, intval); - return TRUE; - } - case DBUS_TYPE_INT64: - { - dbus_int64_t intval; - dbus_message_iter_get_basic (iter, &intval); - g_value_set_int64 (value, intval); - return TRUE; - } - case DBUS_TYPE_UINT64: - { - dbus_uint64_t intval; - dbus_message_iter_get_basic (iter, &intval); - g_value_set_uint64 (value, intval); - return TRUE; - } - case DBUS_TYPE_DOUBLE: - { - double dval; - dbus_message_iter_get_basic (iter, &dval); - g_value_set_double (value, dval); - return TRUE; - } - case DBUS_TYPE_INT16: - { - dbus_int16_t v; - dbus_message_iter_get_basic (iter, &v); - g_value_set_int (value, v); - return TRUE; - } - case DBUS_TYPE_UINT16: - { - dbus_uint16_t v; - dbus_message_iter_get_basic (iter, &v); - g_value_set_uint (value, v); - return TRUE; - } - case DBUS_TYPE_STRING: - { - const char *s; - dbus_message_iter_get_basic (iter, &s); - g_value_set_string (value, s); - return TRUE; - } - default: - g_assert_not_reached (); - return FALSE; - } -} - -static gboolean -demarshal_static_variant (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - char *sig; - int current_type; - DBusMessageIter subiter; - GType variant_type; - - current_type = dbus_message_iter_get_arg_type (iter); - dbus_message_iter_recurse (iter, &subiter); - sig = dbus_message_iter_get_signature (&subiter); - - variant_type = _dbus_gtype_from_signature (sig, context->proxy != NULL); - if (variant_type != G_TYPE_INVALID) - { - g_value_init (value, variant_type); - - if (!_dbus_gvalue_demarshal (context, &subiter, value, error)) - { - dbus_free (sig); - return FALSE; - } - } - dbus_free (sig); - return TRUE; -} - -static gboolean -demarshal_variant (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) - -{ - GValue *variant_val; - variant_val = g_new0 (GValue, 1); - - if (!demarshal_static_variant (context, iter, variant_val, error)) - return FALSE; - - g_value_set_boxed_take_ownership (value, variant_val); - return TRUE; -} - -static gboolean -demarshal_proxy (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - DBusGProxy *new_proxy; - const char *objpath; - int current_type; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_OBJECT_PATH) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS object path, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - g_assert (context->proxy != NULL); - - dbus_message_iter_get_basic (iter, &objpath); - - new_proxy = dbus_g_proxy_new_from_proxy (context->proxy, NULL, objpath); - g_value_set_object_take_ownership (value, new_proxy); - - return TRUE; -} - -static gboolean -demarshal_object_path (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - const char *objpath; - int current_type; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_OBJECT_PATH) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS object path, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - dbus_message_iter_get_basic (iter, &objpath); - - g_value_set_boxed_take_ownership (value, g_strdup (objpath)); - - return TRUE; -} - -static gboolean -demarshal_object (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - const char *objpath; - int current_type; - GObject *obj; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_OBJECT_PATH) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS object path, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - g_assert (context->proxy == NULL); - - dbus_message_iter_get_basic (iter, &objpath); - - obj = dbus_g_connection_lookup_g_object (context->gconnection, objpath); - if (obj == NULL) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Unregistered object at path '%s'"), - objpath); - return FALSE; - } - g_value_set_object (value, obj); - - return TRUE; -} - -static gboolean -demarshal_strv (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - DBusMessageIter subiter; - int current_type; - char **ret; - int len; - int i; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_ARRAY) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS array, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - dbus_message_iter_recurse (iter, &subiter); - - current_type = dbus_message_iter_get_arg_type (&subiter); - if (current_type != DBUS_TYPE_INVALID - && current_type != DBUS_TYPE_STRING) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS string, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - len = dbus_message_iter_get_array_len (&subiter); - g_assert (len >= 0); - ret = g_malloc (sizeof (char *) * (len + 1)); - - i = 0; - while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) - { - g_assert (i < len); - g_assert (current_type == DBUS_TYPE_STRING); - - dbus_message_iter_get_basic (&subiter, &(ret[i])); - ret[i] = g_strdup (ret[i]); - - dbus_message_iter_next (&subiter); - i++; - } - ret[i] = NULL; - g_value_set_boxed_take_ownership (value, ret); - - return TRUE; -} - -static gboolean -demarshal_valuearray (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - int current_type; - GValueArray *ret; - DBusMessageIter subiter; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_STRUCT) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS struct, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - dbus_message_iter_recurse (iter, &subiter); - - ret = g_value_array_new (12); - - while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) - { - GValue *val; - GType elt_type; - char *current_sig; - - g_value_array_append (ret, NULL); - val = g_value_array_get_nth (ret, ret->n_values - 1); - - current_sig = dbus_message_iter_get_signature (&subiter); - elt_type = _dbus_gtype_from_signature (current_sig, TRUE); - - dbus_free (current_sig); - if (elt_type == G_TYPE_INVALID) - { - g_value_array_free (ret); - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Couldn't demarshal argument with signature \"%s\""), current_sig); - return FALSE; - } - - g_value_init (val, elt_type); - - if (!_dbus_gvalue_demarshal (context, &subiter, val, error)) - { - g_value_array_free (ret); - return FALSE; - } - - dbus_message_iter_next (&subiter); - } - - g_value_set_boxed_take_ownership (value, ret); - - return TRUE; -} - -static gboolean -demarshal_map (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - GType gtype; - DBusMessageIter subiter; - int current_type; - gpointer ret; - GType key_gtype; - GType value_gtype; - DBusGTypeSpecializedAppendContext appendctx; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_ARRAY) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS array, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - gtype = G_VALUE_TYPE (value); - - dbus_message_iter_recurse (iter, &subiter); - - current_type = dbus_message_iter_get_arg_type (&subiter); - if (current_type != DBUS_TYPE_INVALID - && current_type != DBUS_TYPE_DICT_ENTRY) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS dict entry, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - key_gtype = dbus_g_type_get_map_key_specialization (gtype); - value_gtype = dbus_g_type_get_map_value_specialization (gtype); - - ret = dbus_g_type_specialized_construct (gtype); - g_value_set_boxed_take_ownership (value, ret); - - dbus_g_type_specialized_init_append (value, &appendctx); - - while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) - { - DBusMessageIter entry_iter; - GValue key_value = {0,}; - GValue value_value = {0,}; - - current_type = dbus_message_iter_get_arg_type (&subiter); - g_assert (current_type == DBUS_TYPE_DICT_ENTRY); - - dbus_message_iter_recurse (&subiter, &entry_iter); - - g_value_init (&key_value, key_gtype); - if (!_dbus_gvalue_demarshal (context, - &entry_iter, - &key_value, - error)) - return FALSE; - - dbus_message_iter_next (&entry_iter); - - g_value_init (&value_value, value_gtype); - if (!_dbus_gvalue_demarshal (context, - &entry_iter, - &value_value, - error)) - return FALSE; - - dbus_g_type_specialized_map_append (&appendctx, &key_value, &value_value); - /* Ownership of values passes to map, don't unset */ - - dbus_message_iter_next (&subiter); - } - - return TRUE; -} - -static gboolean -demarshal_struct (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - int current_type; - DBusMessageIter subiter; - guint i, size; - GValue val = {0,}; - GType elt_type; - - current_type = dbus_message_iter_get_arg_type (iter); - if (current_type != DBUS_TYPE_STRUCT) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS struct, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - dbus_message_iter_recurse (iter, &subiter); - - g_value_set_boxed_take_ownership (value, - dbus_g_type_specialized_construct (G_VALUE_TYPE (value))); - - size = dbus_g_type_get_struct_size (G_VALUE_TYPE (value)); - - for (i=0; i < size; i++) - { - - elt_type = dbus_g_type_get_struct_member_type (G_VALUE_TYPE(value), i); - if (elt_type == G_TYPE_INVALID) - { - g_value_unset (value); - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Couldn't demarshal argument, " - "struct type %s has no member %d"), - g_type_name (G_VALUE_TYPE(value)), i); - return FALSE; - } - - g_value_init (&val, elt_type); - - if (!_dbus_gvalue_demarshal (context, &subiter, &val, error)) - { - g_value_unset (&val); - g_value_unset (value); - return FALSE; - } - if (!dbus_g_type_struct_set_member (value, i, &val)) - { - g_value_unset (&val); - g_value_unset (value); - return FALSE; - } - - dbus_message_iter_next (&subiter); - g_value_unset (&val); - } - - g_assert (dbus_message_iter_get_arg_type (&subiter) == DBUS_TYPE_INVALID); - - return TRUE; -} - - -static DBusGValueDemarshalFunc -get_type_demarshaller (GType type) -{ - DBusGTypeMarshalData *typedata; - - typedata = g_type_get_qdata (type, dbus_g_type_metadata_data_quark ()); - if (typedata == NULL) - { - if (g_type_is_a (type, G_TYPE_VALUE_ARRAY)) - return demarshal_valuearray; - if (dbus_g_type_is_collection (type)) - return demarshal_collection; - if (dbus_g_type_is_map (type)) - return demarshal_map; - if (dbus_g_type_is_struct (type)) - return demarshal_struct; - - g_warning ("No demarshaller registered for type \"%s\"", g_type_name (type)); - return NULL; - } - g_assert (typedata->vtable); - return typedata->vtable->demarshaller; -} - -static gboolean -demarshal_collection (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - GType coltype; - GType subtype; - - coltype = G_VALUE_TYPE (value); - subtype = dbus_g_type_get_collection_specialization (coltype); - - if (_dbus_g_type_is_fixed (subtype)) - return demarshal_collection_array (context, iter, value, error); - else - return demarshal_collection_ptrarray (context, iter, value, error); -} - -static gboolean -demarshal_collection_ptrarray (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - GType coltype; - GType subtype; - gpointer instance; - DBusGTypeSpecializedAppendContext ctx; - DBusGValueDemarshalFunc demarshaller; - DBusMessageIter subiter; - int current_type; - - current_type = dbus_message_iter_get_arg_type (iter); - - if (current_type != DBUS_TYPE_ARRAY) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Expected D-BUS array, got type code \'%c\'"), (guchar) current_type); - return FALSE; - } - - dbus_message_iter_recurse (iter, &subiter); - - coltype = G_VALUE_TYPE (value); - subtype = dbus_g_type_get_collection_specialization (coltype); - - demarshaller = get_type_demarshaller (subtype); - - if (!demarshaller) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("No demarshaller registered for type \"%s\" of collection \"%s\""), - g_type_name (coltype), - g_type_name (subtype)); - return FALSE; - } - - instance = dbus_g_type_specialized_construct (coltype); - g_value_set_boxed_take_ownership (value, instance); - - dbus_g_type_specialized_init_append (value, &ctx); - - while ((current_type = dbus_message_iter_get_arg_type (&subiter)) != DBUS_TYPE_INVALID) - { - GValue eltval = {0, }; - - g_value_init (&eltval, subtype); - - if (!demarshaller (context, &subiter, &eltval, error)) - { - dbus_g_type_specialized_collection_end_append (&ctx); - g_value_unset (value); - return FALSE; - } - dbus_g_type_specialized_collection_append (&ctx, &eltval); - - dbus_message_iter_next (&subiter); - } - dbus_g_type_specialized_collection_end_append (&ctx); - - return TRUE; -} - -static gboolean -demarshal_collection_array (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - DBusMessageIter subiter; - GArray *ret; - GType elt_gtype; - int elt_size; - void *msgarray; - int msgarray_len; - - dbus_message_iter_recurse (iter, &subiter); - - elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value)); - g_assert (elt_gtype != G_TYPE_INVALID); - g_assert (_dbus_g_type_is_fixed (elt_gtype)); - - elt_size = _dbus_g_type_fixed_get_size (elt_gtype); - - ret = g_array_new (FALSE, TRUE, elt_size); - - msgarray = NULL; - dbus_message_iter_get_fixed_array (&subiter, - &msgarray, - &msgarray_len); - g_assert (msgarray != NULL || msgarray_len == 0); - - if (msgarray_len) - g_array_append_vals (ret, msgarray, (guint) msgarray_len); - - g_value_set_boxed_take_ownership (value, ret); - - return TRUE; -} - -gboolean -_dbus_gvalue_demarshal (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - GType gtype; - DBusGValueDemarshalFunc demarshaller; - - gtype = G_VALUE_TYPE (value); - - demarshaller = get_type_demarshaller (gtype); - - if (demarshaller == NULL) - { - g_set_error (error, - DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("No demarshaller registered for type \"%s\""), - g_type_name (gtype)); - return FALSE; - } - - return demarshaller (context, iter, value, error); -} - -gboolean -_dbus_gvalue_demarshal_variant (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error) -{ - return demarshal_static_variant (context, iter, value, error); -} - -GValueArray * -_dbus_gvalue_demarshal_message (DBusGValueMarshalCtx *context, - DBusMessage *message, - guint n_types, - const GType *types, - GError **error) -{ - GValueArray *ret; - DBusMessageIter iter; - int current_type; - guint index; - - ret = g_value_array_new (6); /* 6 is a typical maximum for arguments */ - - dbus_message_iter_init (message, &iter); - index = 0; - while ((current_type = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID) - { - GValue *value; - GType gtype; - - if (index >= n_types) - { - g_set_error (error, DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Too many arguments in message")); - goto lose; - } - - g_value_array_append (ret, NULL); - value = g_value_array_get_nth (ret, index); - - gtype = types[index]; - g_value_init (value, gtype); - - if (!_dbus_gvalue_demarshal (context, &iter, value, error)) - goto lose; - dbus_message_iter_next (&iter); - index++; - } - if (index < n_types) - { - g_set_error (error, DBUS_GERROR, - DBUS_GERROR_INVALID_ARGS, - _("Too few arguments in message")); - goto lose; - } - - return ret; - lose: - g_value_array_free (ret); - return NULL; -} - -static gboolean -marshal_basic (DBusMessageIter *iter, const GValue *value) -{ - GType value_type; - - value_type = G_VALUE_TYPE (value); - - switch (value_type) - { - case G_TYPE_CHAR: - { - char b = g_value_get_char (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_BYTE, - &b)) - goto nomem; - } - return TRUE; - case G_TYPE_UCHAR: - { - unsigned char b = g_value_get_uchar (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_BYTE, - &b)) - goto nomem; - } - return TRUE; - case G_TYPE_BOOLEAN: - { - dbus_bool_t b = g_value_get_boolean (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_BOOLEAN, - &b)) - goto nomem; - } - return TRUE; - case G_TYPE_INT: - { - dbus_int32_t v = g_value_get_int (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_INT32, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_UINT: - { - dbus_uint32_t v = g_value_get_uint (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_UINT32, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_LONG: - { - dbus_int32_t v = g_value_get_long (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_INT32, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_ULONG: - { - dbus_uint32_t v = g_value_get_ulong (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_UINT32, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_INT64: - { - gint64 v = g_value_get_int64 (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_INT64, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_UINT64: - { - guint64 v = g_value_get_uint64 (value); - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_UINT64, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_FLOAT: - { - double v = g_value_get_float (value); - - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_DOUBLE, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_DOUBLE: - { - double v = g_value_get_double (value); - - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_DOUBLE, - &v)) - goto nomem; - } - return TRUE; - case G_TYPE_STRING: - /* FIXME, the GValue string may not be valid UTF-8 */ - { - const char *v = g_value_get_string (value); - if (!v) - v = ""; - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_STRING, - &v)) - goto nomem; - } - return TRUE; - - default: - { - g_assert_not_reached (); - return FALSE; - } - } - - nomem: - g_error ("no memory"); - return FALSE; -} - -static gboolean -marshal_strv (DBusMessageIter *iter, - const GValue *value) -{ - DBusMessageIter subiter; - char **array; - char **elt; - gboolean ret = FALSE; - - g_assert (G_VALUE_TYPE (value) == g_strv_get_type ()); - - array = g_value_get_boxed (value); - - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_ARRAY, - "s", - &subiter)) - goto out; - - for (elt = array; *elt; elt++) - { - if (!dbus_message_iter_append_basic (&subiter, - DBUS_TYPE_STRING, - elt)) - goto out; - } - - if (!dbus_message_iter_close_container (iter, &subiter)) - goto out; - ret = TRUE; - out: - return ret; -} - -static gboolean -marshal_valuearray (DBusMessageIter *iter, - const GValue *value) -{ - GValueArray *array; - guint i; - DBusMessageIter subiter; - - g_assert (G_VALUE_TYPE (value) == G_TYPE_VALUE_ARRAY); - - array = g_value_get_boxed (value); - - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_STRUCT, - NULL, - &subiter)) - goto oom; - - for (i = 0; i < array->n_values; i++) - { - if (!_dbus_gvalue_marshal (&subiter, g_value_array_get_nth (array, i))) - return FALSE; - } - - if (!dbus_message_iter_close_container (iter, &subiter)) - goto oom; - - return TRUE; - oom: - g_error ("out of memory"); - return FALSE; -} - -static gboolean -marshal_proxy (DBusMessageIter *iter, - const GValue *value) -{ - const char *path; - DBusGProxy *proxy; - - g_assert (G_VALUE_TYPE (value) == dbus_g_proxy_get_type ()); - - proxy = g_value_get_object (value); - path = dbus_g_proxy_get_path (proxy); - - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_OBJECT_PATH, - &path)) - return FALSE; - return TRUE; -} - -static gboolean -marshal_object_path (DBusMessageIter *iter, - const GValue *value) -{ - const char *path; - - g_assert (G_VALUE_TYPE (value) == DBUS_TYPE_G_OBJECT_PATH); - - path = (const char*) g_value_get_boxed (value); - - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_OBJECT_PATH, - &path)) - return FALSE; - return TRUE; -} - -static gboolean -marshal_object (DBusMessageIter *iter, - const GValue *value) -{ - const char *path; - GObject *obj; - - obj = g_value_get_object (value); - path = _dbus_gobject_get_path (obj); - - if (path == NULL) - /* FIXME should throw error */ - return FALSE; - - if (!dbus_message_iter_append_basic (iter, - DBUS_TYPE_OBJECT_PATH, - &path)) - return FALSE; - return TRUE; -} - -struct DBusGLibHashMarshalData -{ - const char *entry_sig; - DBusMessageIter *iter; - gboolean err; -}; - -static void -marshal_map_entry (const GValue *key, - const GValue *value, - gpointer data) -{ - struct DBusGLibHashMarshalData *hashdata = data; - DBusMessageIter subiter; - - if (hashdata->err) - return; - - if (!dbus_message_iter_open_container (hashdata->iter, - DBUS_TYPE_DICT_ENTRY, - NULL, - &subiter)) - goto lose; - - if (!_dbus_gvalue_marshal (&subiter, key)) - goto lose; - - if (!_dbus_gvalue_marshal (&subiter, value)) - goto lose; - - if (!dbus_message_iter_close_container (hashdata->iter, &subiter)) - goto lose; - - return; - lose: - hashdata->err = TRUE; -} - -static gboolean -marshal_map (DBusMessageIter *iter, - const GValue *value) -{ - GType gtype; - DBusMessageIter arr_iter; - gboolean ret; - struct DBusGLibHashMarshalData hashdata; - char *key_sig; - char *value_sig; - GType key_type; - GType value_type; - char *entry_sig; - char *array_sig; - - gtype = G_VALUE_TYPE (value); - - ret = FALSE; - - key_type = dbus_g_type_get_map_key_specialization (gtype); - g_assert (_dbus_gtype_is_valid_hash_key (key_type)); - value_type = dbus_g_type_get_map_value_specialization (gtype); - g_assert (_dbus_gtype_is_valid_hash_value (value_type)); - - key_sig = _dbus_gtype_to_signature (key_type); - if (!key_sig) - { - g_warning ("Cannot marshal type \"%s\" in map\n", g_type_name (key_type)); - return FALSE; - } - value_sig = _dbus_gtype_to_signature (value_type); - if (!value_sig) - { - g_free (key_sig); - g_warning ("Cannot marshal type \"%s\" in map\n", g_type_name (value_type)); - return FALSE; - } - entry_sig = g_strdup_printf ("%s%s", key_sig, value_sig); - g_free (key_sig); - g_free (value_sig); - array_sig = g_strdup_printf ("%c%s%c", - DBUS_DICT_ENTRY_BEGIN_CHAR, - entry_sig, - DBUS_DICT_ENTRY_END_CHAR); - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_ARRAY, - array_sig, - &arr_iter)) - goto lose; - - hashdata.iter = &arr_iter; - hashdata.err = FALSE; - hashdata.entry_sig = entry_sig; - - dbus_g_type_map_value_iterate (value, - marshal_map_entry, - &hashdata); - - if (!dbus_message_iter_close_container (iter, &arr_iter)) - goto lose; - - out: - g_free (entry_sig); - g_free (array_sig); - return !hashdata.err; - lose: - hashdata.err = TRUE; - goto out; -} - -static gboolean -marshal_struct (DBusMessageIter *iter, - const GValue *value) -{ - GType gtype; - DBusMessageIter subiter; - gboolean ret; - guint size, i; - GValue val = {0,}; - - gtype = G_VALUE_TYPE (value); - - ret = FALSE; - - size = dbus_g_type_get_struct_size (gtype); - - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_STRUCT, - NULL, - &subiter)) - goto oom; - - for (i = 0; i < size; i++) - { - g_value_init (&val, dbus_g_type_get_struct_member_type - (G_VALUE_TYPE(value), i)); - if (!dbus_g_type_struct_get_member (value, i, &val)) - return FALSE; - if (!_dbus_gvalue_marshal (&subiter, &val)) - return FALSE; - g_value_unset(&val); - } - - if (!dbus_message_iter_close_container (iter, &subiter)) - goto oom; - - return TRUE; - oom: - g_error ("out of memory"); - return FALSE; -} - -static gboolean -marshal_variant (DBusMessageIter *iter, - const GValue *value) -{ - GType value_gtype; - DBusMessageIter subiter; - char *variant_sig; - GValue *real_value; - gboolean ret = FALSE; - - real_value = g_value_get_boxed (value); - value_gtype = G_VALUE_TYPE (real_value); - - variant_sig = _dbus_gvalue_to_signature (real_value); - if (variant_sig == NULL) - { - g_warning ("Cannot marshal type \"%s\" in variant", g_type_name (value_gtype)); - return FALSE; - } - - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_VARIANT, - variant_sig, - &subiter)) - goto out; - - if (!_dbus_gvalue_marshal (&subiter, real_value)) - goto out; - - if (!dbus_message_iter_close_container (iter, &subiter)) - goto out; - - ret = TRUE; - out: - g_free (variant_sig); - return ret; -} - -static DBusGValueMarshalFunc -get_type_marshaller (GType type) -{ - DBusGTypeMarshalData *typedata; - - typedata = g_type_get_qdata (type, dbus_g_type_metadata_data_quark ()); - if (typedata == NULL) - { - if (g_type_is_a (type, G_TYPE_VALUE_ARRAY)) - return marshal_valuearray; - if (dbus_g_type_is_collection (type)) - return marshal_collection; - if (dbus_g_type_is_map (type)) - return marshal_map; - if (dbus_g_type_is_struct (type)) - return marshal_struct; - - g_warning ("No marshaller registered for type \"%s\"", g_type_name (type)); - return NULL; - } - g_assert (typedata->vtable); - return typedata->vtable->marshaller; -} - -typedef struct -{ - DBusMessageIter *iter; - DBusGValueMarshalFunc marshaller; - gboolean err; -} DBusGValueCollectionMarshalData; - -static void -collection_marshal_iterator (const GValue *eltval, - gpointer user_data) -{ - DBusGValueCollectionMarshalData *data = user_data; - - if (data->err) - return; - - if (!data->marshaller (data->iter, eltval)) - data->err = TRUE; -} - -static gboolean -marshal_collection (DBusMessageIter *iter, - const GValue *value) -{ - GType coltype; - GType subtype; - - coltype = G_VALUE_TYPE (value); - subtype = dbus_g_type_get_collection_specialization (coltype); - - if (_dbus_g_type_is_fixed (subtype)) - return marshal_collection_array (iter, value); - else - return marshal_collection_ptrarray (iter, value); -} - -static gboolean -marshal_collection_ptrarray (DBusMessageIter *iter, - const GValue *value) -{ - GType coltype; - GType elt_gtype; - DBusGValueCollectionMarshalData data; - DBusMessageIter subiter; - char *elt_sig; - - coltype = G_VALUE_TYPE (value); - elt_gtype = dbus_g_type_get_collection_specialization (coltype); - data.marshaller = get_type_marshaller (elt_gtype); - if (!data.marshaller) - return FALSE; - - elt_sig = _dbus_gtype_to_signature (elt_gtype); - if (!elt_sig) - { - g_warning ("Cannot marshal type \"%s\" in collection\n", g_type_name (elt_gtype)); - return FALSE; - } - - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_ARRAY, - elt_sig, - &subiter)) - goto oom; - g_free (elt_sig); - - data.iter = &subiter; - data.err = FALSE; - - dbus_g_type_collection_value_iterate (value, - collection_marshal_iterator, - &data); - - if (!dbus_message_iter_close_container (iter, &subiter)) - goto oom; - - return !data.err; - oom: - g_error ("out of memory"); - return FALSE; -} - - -static gboolean -marshal_collection_array (DBusMessageIter *iter, - const GValue *value) -{ - GType elt_gtype; - DBusMessageIter subiter; - GArray *array; - guint elt_size; - char *subsignature_str; - - elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value)); - g_assert (_dbus_g_type_is_fixed (elt_gtype)); - subsignature_str = _dbus_gtype_to_signature (elt_gtype); - if (!subsignature_str) - { - g_warning ("Cannot marshal type \"%s\" in collection\n", g_type_name (elt_gtype)); - return FALSE; - } - - elt_size = _dbus_g_type_fixed_get_size (elt_gtype); - - array = g_value_get_boxed (value); - - if (!dbus_message_iter_open_container (iter, - DBUS_TYPE_ARRAY, - subsignature_str, - &subiter)) - goto oom; - - /* TODO - This assumes that basic values are the same size - * is this always true? If it is we can probably avoid - * a lot of the overhead in _marshal_basic_instance... - */ - if (!dbus_message_iter_append_fixed_array (&subiter, - subsignature_str[0], - &(array->data), - array->len)) - goto oom; - - if (!dbus_message_iter_close_container (iter, &subiter)) - goto oom; - g_free (subsignature_str); - return TRUE; - oom: - g_error ("out of memory"); - return FALSE; -} - -gboolean -_dbus_gvalue_marshal (DBusMessageIter *iter, - const GValue *value) -{ - GType gtype; - DBusGValueMarshalFunc marshaller; - - gtype = G_VALUE_TYPE (value); - - marshaller = get_type_marshaller (gtype); - if (marshaller == NULL) - return FALSE; - return marshaller (iter, value); -} - -#ifdef DBUS_BUILD_TESTS - -static void -assert_type_maps_to (GType gtype, const char *expected_sig) -{ - char *sig; - sig = _dbus_gtype_to_signature (gtype); - g_assert (sig != NULL); - g_assert (!strcmp (expected_sig, sig)); - g_free (sig); -} - -static void -assert_signature_maps_to (const char *sig, GType expected_gtype) -{ - g_assert (_dbus_gtype_from_signature (sig, TRUE) == expected_gtype); -} - -static void -assert_bidirectional_mapping (GType gtype, const char *expected_sig) -{ - assert_type_maps_to (gtype, expected_sig); - assert_signature_maps_to (expected_sig, gtype); -} - -/** - * @ingroup DBusGLibInternals - * Unit test for general glib stuff - * @returns #TRUE on success. - */ -gboolean -_dbus_gvalue_test (const char *test_data_dir) -{ - _dbus_g_value_types_init (); - - assert_bidirectional_mapping (G_TYPE_STRING, DBUS_TYPE_STRING_AS_STRING); - assert_bidirectional_mapping (G_TYPE_UCHAR, DBUS_TYPE_BYTE_AS_STRING); - assert_bidirectional_mapping (G_TYPE_UINT, DBUS_TYPE_UINT32_AS_STRING); - - assert_bidirectional_mapping (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), - DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING); - assert_bidirectional_mapping (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), - DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_OBJECT_PATH_AS_STRING); - assert_bidirectional_mapping (dbus_g_type_get_collection ("GArray", G_TYPE_INT), - DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_INT32_AS_STRING); - - assert_bidirectional_mapping (dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_STRING, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID), - DBUS_STRUCT_BEGIN_CHAR_AS_STRING DBUS_TYPE_INT32_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_OBJECT_PATH_AS_STRING DBUS_STRUCT_END_CHAR_AS_STRING ); - return TRUE; -} - -#endif /* DBUS_BUILD_TESTS */ diff --git a/glib/dbus-gvalue.h b/glib/dbus-gvalue.h deleted file mode 100644 index 1bfd719d..00000000 --- a/glib/dbus-gvalue.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef DBUS_GOBJECT_VALUE_H -#define DBUS_GOBJECT_VALUE_H - -#include -#include -#include -#include -#include "dbus/dbus-glib.h" - -G_BEGIN_DECLS - -typedef struct { - DBusGConnection *gconnection; - DBusGProxy *proxy; -} DBusGValueMarshalCtx; - -void _dbus_g_value_types_init (void); - -char * _dbus_gtype_to_signature (GType type); -char * _dbus_gvalue_to_signature (const GValue *val); - -gboolean _dbus_gvalue_demarshal (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); - -gboolean _dbus_gvalue_demarshal_variant (DBusGValueMarshalCtx *context, - DBusMessageIter *iter, - GValue *value, - GError **error); - -GValueArray * _dbus_gvalue_demarshal_message (DBusGValueMarshalCtx *context, - DBusMessage *message, - guint n_params, - const GType *types, - GError **error); - -gboolean _dbus_gvalue_marshal (DBusMessageIter *iter, - const GValue *value); - -G_END_DECLS - -#endif /* DBUS_GOBJECT_VALUE_H */ diff --git a/glib/examples/.cvsignore b/glib/examples/.cvsignore deleted file mode 100644 index fc6a0634..00000000 --- a/glib/examples/.cvsignore +++ /dev/null @@ -1,17 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -example-client -example-service -example-service-glue.h -example-signal-recipient -example-signal-emitter -example-signal-emitter-glue.h -run-with-tmp-session-bus.conf -*.bb -*.bbg -*.da -*.gcov diff --git a/glib/examples/Makefile.am b/glib/examples/Makefile.am deleted file mode 100644 index 34b9cb8b..00000000 --- a/glib/examples/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -SUBDIRS = . statemachine - -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_COMPILATION - -## Makefile.am bits for sample client/server pair - -noinst_PROGRAMS= example-client example-service - -example_client_SOURCES= example-client.c -example_client_LDADD= $(top_builddir)/glib/libdbus-glib-1.la - -example_service_SOURCES= example-service.c -example_service_LDADD= $(top_builddir)/glib/libdbus-glib-1.la - -BUILT_SOURCES = example-service-glue.h - -example-service-glue.h: example-service.xml - $(LIBTOOL) --mode=execute $(top_builddir)/glib/dbus-binding-tool --prefix=some_object --mode=glib-server --output=example-service-glue.h $(srcdir)/example-service.xml - - -## Makefile.am bits for another client/server pair - -noinst_PROGRAMS += example-signal-recipient example-signal-emitter - -example_signal_recipient_SOURCES= example-signal-recipient.c -example_signal_recipient_LDADD= $(top_builddir)/glib/libdbus-glib-1.la - -example_signal_emitter_SOURCES= example-signal-emitter.c -example_signal_emitter_LDADD= $(top_builddir)/glib/libdbus-glib-1.la - -BUILT_SOURCES += example-signal-emitter-glue.h - -example-signal-emitter-glue.h: example-signal-emitter.xml - $(LIBTOOL) --mode=execute $(top_builddir)/glib/dbus-binding-tool --prefix=test_object --mode=glib-server --output=example-signal-emitter-glue.h $(srcdir)/example-signal-emitter.xml - -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = example-service.xml example-signal-emitter.xml diff --git a/glib/examples/example-client.c b/glib/examples/example-client.c deleted file mode 100644 index dac1f825..00000000 --- a/glib/examples/example-client.c +++ /dev/null @@ -1,121 +0,0 @@ -#include -#include -#include - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - lose ("%s: %s", prefix, error->message); -} - -static void -print_hash_value (gpointer key, gpointer val, gpointer data) -{ - printf ("%s -> %s\n", (char *) key, (char *) val); -} - -int -main (int argc, char **argv) -{ - DBusGConnection *bus; - DBusGProxy *remote_object; - DBusGProxy *remote_object_introspectable; - GError *error = NULL; - char **reply_list; - char **reply_ptr; - GValueArray *hello_reply_struct; - GHashTable *hello_reply_dict; - char *introspect_data; - guint i; - - g_type_init (); - - { - GLogLevelFlags fatal_mask; - - fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); - fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; - g_log_set_always_fatal (fatal_mask); - } - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - lose_gerror ("Couldn't connect to session bus", error); - - remote_object = dbus_g_proxy_new_for_name (bus, - "org.designfu.SampleService", - "/SomeObject", - "org.designfu.SampleInterface"); - - if (!dbus_g_proxy_call (remote_object, "HelloWorld", &error, - G_TYPE_STRING, "Hello from example-client.c!", G_TYPE_INVALID, - G_TYPE_STRV, &reply_list, G_TYPE_INVALID)) - lose_gerror ("Failed to complete HelloWorld", error); - - - if (!dbus_g_proxy_call (remote_object, "GetTuple", &error, - G_TYPE_INVALID, - G_TYPE_VALUE_ARRAY, &hello_reply_struct, G_TYPE_INVALID)) - lose_gerror ("Failed to complete GetTuple", error); - - if (!dbus_g_proxy_call (remote_object, "GetDict", &error, - G_TYPE_INVALID, - DBUS_TYPE_G_STRING_STRING_HASHTABLE, &hello_reply_dict, G_TYPE_INVALID)) - lose_gerror ("Failed to complete GetDict", error); - - printf ("reply_list: "); - for (reply_ptr = reply_list; *reply_ptr; reply_ptr++) - printf ("\"%s\" ", *reply_ptr); - printf ("\n"); - g_strfreev (reply_list); - - for (i = 0; i < hello_reply_struct->n_values; i++) - { - GValue strval = { 0, }; - - g_value_init (&strval, G_TYPE_STRING); - if (!g_value_transform (g_value_array_get_nth (hello_reply_struct, i), &strval)) - g_value_set_static_string (&strval, "(couldn't transform to string)"); - g_print ("%s: %s\n", g_type_name (G_VALUE_TYPE (g_value_array_get_nth (hello_reply_struct, i))), - g_value_get_string (&strval)); - } - g_value_array_free (hello_reply_struct); - printf ("\n"); - - g_hash_table_foreach (hello_reply_dict, print_hash_value, NULL); - g_hash_table_destroy (hello_reply_dict); - - remote_object_introspectable = dbus_g_proxy_new_for_name (bus, - "org.designfu.SampleService", - "/SomeObject", - "org.freedesktop.DBus.Introspectable"); - if (!dbus_g_proxy_call (remote_object_introspectable, "Introspect", &error, - G_TYPE_INVALID, - G_TYPE_STRING, &introspect_data, G_TYPE_INVALID)) - lose_gerror ("Failed to complete Introspect", error); - printf ("%s", introspect_data); - g_free (introspect_data); - - g_object_unref (G_OBJECT (remote_object_introspectable)); - g_object_unref (G_OBJECT (remote_object)); - - exit(0); -} diff --git a/glib/examples/example-service.c b/glib/examples/example-service.c deleted file mode 100644 index a66855c1..00000000 --- a/glib/examples/example-service.c +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - lose ("%s: %s", prefix, error->message); -} - -typedef struct SomeObject SomeObject; -typedef struct SomeObjectClass SomeObjectClass; - -GType some_object_get_type (void); - -struct SomeObject -{ - GObject parent; -}; - -struct SomeObjectClass -{ - GObjectClass parent; -}; - -#define SOME_TYPE_OBJECT (some_object_get_type ()) -#define SOME_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SOME_TYPE_OBJECT, SomeObject)) -#define SOME_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOME_TYPE_OBJECT, SomeObjectClass)) -#define SOME_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SOME_TYPE_OBJECT)) -#define SOME_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOME_TYPE_OBJECT)) -#define SOME_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOME_TYPE_OBJECT, SomeObjectClass)) - -G_DEFINE_TYPE(SomeObject, some_object, G_TYPE_OBJECT) - -gboolean some_object_hello_world (SomeObject *obj, const char *hello_message, char ***ret, GError **error); -gboolean some_object_get_tuple (SomeObject *obj, GValueArray **ret, GError **error); -gboolean some_object_get_dict (SomeObject *obj, GHashTable **ret, GError **error); - -#include "example-service-glue.h" - -static void -some_object_init (SomeObject *obj) -{ -} - -static void -some_object_class_init (SomeObjectClass *klass) -{ -} - -gboolean -some_object_hello_world (SomeObject *obj, const char *hello_message, char ***ret, GError **error) -{ - printf ("%s\n", hello_message); - *ret = g_new (char *, 3); - (*ret)[0] = g_strdup ("Hello"); - (*ret)[1] = g_strdup (" from example-service.c"); - (*ret)[2] = NULL; - - return TRUE; -} - -gboolean -some_object_get_tuple (SomeObject *obj, GValueArray **ret, GError **error) -{ - *ret = g_value_array_new (6); - g_value_array_prepend (*ret, NULL); - g_value_init (g_value_array_get_nth (*ret, 0), G_TYPE_STRING); - g_value_set_string (g_value_array_get_nth (*ret, 0), "hello"); - g_value_array_prepend (*ret, NULL); - g_value_init (g_value_array_get_nth (*ret, 0), G_TYPE_UINT); - g_value_set_uint (g_value_array_get_nth (*ret, 0), 42); - - return TRUE; -} - -gboolean -some_object_get_dict (SomeObject *obj, GHashTable **ret, GError **error) -{ - *ret = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (*ret, "first", "Hello Dict"); - g_hash_table_insert (*ret, "second", " from example-service.c"); - return TRUE; -} - -int -main (int argc, char **argv) -{ - DBusGConnection *bus; - DBusGProxy *bus_proxy; - GError *error = NULL; - SomeObject *obj; - GMainLoop *mainloop; - guint request_name_result; - - g_type_init (); - - { - GLogLevelFlags fatal_mask; - - fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); - fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; - g_log_set_always_fatal (fatal_mask); - } - - dbus_g_object_type_install_info (SOME_TYPE_OBJECT, &dbus_glib_some_object_object_info); - - mainloop = g_main_loop_new (NULL, FALSE); - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - lose_gerror ("Couldn't connect to session bus", error); - - bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); - - if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, - G_TYPE_STRING, "org.designfu.SampleService", - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &request_name_result, - G_TYPE_INVALID)) - lose_gerror ("Failed to acquire org.designfu.SampleService", error); - - obj = g_object_new (SOME_TYPE_OBJECT, NULL); - - dbus_g_connection_register_g_object (bus, "/SomeObject", G_OBJECT (obj)); - - printf ("service running\n"); - - g_main_loop_run (mainloop); - - exit (0); -} diff --git a/glib/examples/example-service.xml b/glib/examples/example-service.xml deleted file mode 100644 index 9c39bb05..00000000 --- a/glib/examples/example-service.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/glib/examples/example-signal-emitter.c b/glib/examples/example-signal-emitter.c deleted file mode 100644 index c60865d2..00000000 --- a/glib/examples/example-signal-emitter.c +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - lose ("%s: %s", prefix, error->message); -} - -typedef struct TestObject TestObject; -typedef struct TestObjectClass TestObjectClass; - -GType test_object_get_type (void); - -struct TestObject -{ - GObject parent; -}; - -struct TestObjectClass -{ - GObjectClass parent; -}; - -enum -{ - HELLO_SIGNAL, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -#define TEST_TYPE_OBJECT (test_object_get_type ()) -#define TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TEST_TYPE_OBJECT, TestObject)) -#define TEST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_OBJECT, TestObjectClass)) -#define TEST_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TEST_TYPE_OBJECT)) -#define TEST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_OBJECT)) -#define TEST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_OBJECT, TestObjectClass)) - -G_DEFINE_TYPE(TestObject, test_object, G_TYPE_OBJECT) - -gboolean test_object_emit_hello_signal (TestObject *obj, GError **error); - -#include "example-signal-emitter-glue.h" - -static void -test_object_init (TestObject *obj) -{ -} - -static void -test_object_class_init (TestObjectClass *klass) -{ - signals[HELLO_SIGNAL] = - g_signal_new ("hello_signal", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); -} - -gboolean -test_object_emit_hello_signal (TestObject *obj, GError **error) -{ - g_signal_emit (obj, signals[HELLO_SIGNAL], 0, "Hello"); - return TRUE; -} - - -int -main (int argc, char **argv) -{ - DBusGConnection *bus; - DBusGProxy *bus_proxy; - GError *error = NULL; - TestObject *obj; - GMainLoop *mainloop; - guint request_name_result; - - g_type_init (); - - dbus_g_object_type_install_info (TEST_TYPE_OBJECT, &dbus_glib_test_object_object_info); - - mainloop = g_main_loop_new (NULL, FALSE); - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - lose_gerror ("Couldn't connect to session bus", error); - - bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); - - if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, - G_TYPE_STRING, "org.designfu.TestService", - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &request_name_result, - G_TYPE_INVALID)) - lose_gerror ("Failed to acquire org.designfu.TestService", error); - - obj = g_object_new (TEST_TYPE_OBJECT, NULL); - - dbus_g_connection_register_g_object (bus, "/org/designfu/TestService/object", G_OBJECT (obj)); - - printf ("test service running\n"); - - g_main_loop_run (mainloop); - - exit (0); -} diff --git a/glib/examples/example-signal-emitter.xml b/glib/examples/example-signal-emitter.xml deleted file mode 100644 index ae178e3b..00000000 --- a/glib/examples/example-signal-emitter.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/glib/examples/example-signal-recipient.c b/glib/examples/example-signal-recipient.c deleted file mode 100644 index 86ba4c77..00000000 --- a/glib/examples/example-signal-recipient.c +++ /dev/null @@ -1,102 +0,0 @@ -#include -#include -#include - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - lose ("%s: %s", prefix, error->message); -} - -static gboolean -emit_signal (gpointer arg) -{ - DBusGProxy *proxy = arg; - - dbus_g_proxy_call_no_reply (proxy, "emitHelloSignal", G_TYPE_INVALID); - return TRUE; -} - -static void -hello_signal_handler (DBusGProxy *proxy, const char *hello_string, gpointer user_data) -{ - printf ("Received signal and it says: %s\n", hello_string); -} - -int -main (int argc, char **argv) -{ - DBusGConnection *bus; - DBusGProxy *remote_object; - GError *error = NULL; - GMainLoop *mainloop; - - g_type_init (); - - mainloop = g_main_loop_new (NULL, FALSE); - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - lose_gerror ("Couldn't connect to session bus", error); - - /* We use _for_name_owner in order to track this particular service - * instance, which lets us receive signals. - */ - remote_object = dbus_g_proxy_new_for_name (bus, - "org.designfu.TestService", - "/org/designfu/TestService/object", - "org.designfu.TestService"); - if (!remote_object) - lose_gerror ("Failed to get name owner", error); - - /* IMPORTANT: - * - * Note because this signal's signature is VOID__STRING, we do not - * need to register a marshaller, since there is a builtin one. - * However for other signatures, you must generate a marshaller, - * then call dbus_g_object_register_marshaller. It would look like - * this: - * - * dbus_g_object_register_marshaller (g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - * - */ - - /* Tell DBus what the type signature of the signal callback is; this - * allows us to sanity-check incoming messages before invoking the - * callback. You need to do this once for each proxy you create, - * not every time you want to connect to the signal. - */ - dbus_g_proxy_add_signal (remote_object, "HelloSignal", G_TYPE_STRING, G_TYPE_INVALID); - - /* Actually connect to the signal. Note you can call - * dbus_g_proxy_connect_signal multiple times for one invocation of - * dbus_g_proxy_add_signal. - */ - dbus_g_proxy_connect_signal (remote_object, "HelloSignal", G_CALLBACK (hello_signal_handler), - NULL, NULL); - - - g_timeout_add (2000, emit_signal, remote_object); - - g_main_loop_run (mainloop); - - exit (0); -} diff --git a/glib/examples/statemachine/.cvsignore b/glib/examples/statemachine/.cvsignore deleted file mode 100644 index 6bf74218..00000000 --- a/glib/examples/statemachine/.cvsignore +++ /dev/null @@ -1,16 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -statemachine-client -statemachine-server -statemachine-glue.h -statemachine-server-glue.h -run-with-tmp-session-bus.conf -sm-marshal.[ch] -*.bb -*.bbg -*.da -*.gcov diff --git a/glib/examples/statemachine/Makefile.am b/glib/examples/statemachine/Makefile.am deleted file mode 100644 index 0fea83ed..00000000 --- a/glib/examples/statemachine/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_COMPILATION - -## Makefile.am bits for sample client/server pair - -noinst_PROGRAMS= statemachine-server - -if HAVE_GTK -noinst_PROGRAMS += statemachine-client -endif - -EXTRA_DIST = statemachine.h statemachine-server.h sm-marshal.list statemachine-server.xml statemachine.xml - -statemachine_server_SOURCES= statemachine-server.c sm-marshal.c statemachine.c -statemachine_server_LDADD= $(top_builddir)/glib/libdbus-glib-1.la - -statemachine_client_SOURCES= statemachine-client.c sm-marshal.c statemachine.h -statemachine_client_LDADD= $(top_builddir)/glib/libdbus-glib-1.la $(DBUS_GTK_THREADS_LIBS) - -BUILT_SOURCES = statemachine-server-glue.h statemachine-glue.h - -statemachine-server-glue.h: statemachine-server.xml - $(LIBTOOL) --mode=execute $(top_builddir)/glib/dbus-binding-tool --prefix=sm_server --mode=glib-server --output=$@ $< - -statemachine-glue.h: statemachine.xml - $(LIBTOOL) --mode=execute $(top_builddir)/glib/dbus-binding-tool --prefix=sm_object --mode=glib-server --output=$@ $< - -sm-marshal.c: Makefile sm-marshal.list - @GLIB_GENMARSHAL@ --prefix=sm_marshal $(srcdir)/sm-marshal.list --header --body > $@.tmp && mv $@.tmp $@ - -sm-marshal.h: Makefile sm-marshal.list - @GLIB_GENMARSHAL@ --prefix=sm_marshal $(srcdir)/sm-marshal.list --header > $@.tmp && mv $@.tmp $@ - -BUILT_SOURCES += sm-marshal.c sm-marshal.h - -CLEANFILES = $(BUILT_SOURCES) diff --git a/glib/examples/statemachine/sm-marshal.list b/glib/examples/statemachine/sm-marshal.list deleted file mode 100644 index e72aa4bc..00000000 --- a/glib/examples/statemachine/sm-marshal.list +++ /dev/null @@ -1 +0,0 @@ -VOID:STRING,BOXED diff --git a/glib/examples/statemachine/statemachine-client.c b/glib/examples/statemachine/statemachine-client.c deleted file mode 100644 index 88b21847..00000000 --- a/glib/examples/statemachine/statemachine-client.c +++ /dev/null @@ -1,662 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "sm-marshal.h" - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -lose (const char *str, ...) -{ - va_list args; - GtkWidget *dialog; - char *text; - - va_start (args, str); - - text = g_strdup_vprintf (str, args); - - va_end (args); - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s", - text); - gtk_dialog_run (GTK_DIALOG (dialog)); - - g_free (text); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s", - prefix); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), - "%s", - error->message); - - gtk_dialog_run (GTK_DIALOG (dialog)); - - exit (1); -} - -typedef struct -{ - char *name; - char *state; - gdouble progress; - DBusGProxy *proxy; - DBusGProxyCall *get_progress_call; -} MachineInfo; - -typedef struct -{ - GtkWindow *window; - GtkWidget *view; - GtkTreeModel *store; - - DBusGConnection *bus; - DBusGProxy *server_proxy; - - GSList *pending_creation_calls; - DBusGProxyCall *get_machines_call; -} ClientState; - -static gboolean -proxy_to_iter (GtkTreeModel *model, DBusGProxy *proxy, GtkTreeIter *iter) -{ - if (!gtk_tree_model_get_iter_first (model, iter)) - return FALSE; - do { - MachineInfo *info; - gtk_tree_model_get (model, iter, 0, &info, -1); - if (info->proxy == proxy) - return TRUE; - } while (gtk_tree_model_iter_next (model, iter)); - return FALSE; -} - -static void -signal_row_change (ClientState *state, GtkTreeIter *iter) -{ - GtkTreePath *path; - path = gtk_tree_model_get_path (state->store, iter); - gtk_tree_model_row_changed (state->store, path, iter); - gtk_tree_path_free (path); -} - -static void -get_machine_info_cb (DBusGProxy *proxy, - DBusGProxyCall *call, - gpointer data) -{ - GtkTreeIter iter; - ClientState *state = data; - GError *error = NULL; - char *name, *statename; - MachineInfo *info; - - if (!dbus_g_proxy_end_call (proxy, call, &error, - G_TYPE_STRING, &name, - G_TYPE_STRING, &statename, - G_TYPE_INVALID)) - lose_gerror ("Couldn't complete GetInfo", error); - - if (!proxy_to_iter (state->store, proxy, &iter)) - g_assert_not_reached (); - - gtk_tree_model_get (state->store, &iter, 0, &info, -1); - g_free (info->name); - info->name = name; - g_free (info->state); - info->state = statename; - signal_row_change (state, &iter); -} - -static void -set_proxy_acquisition_progress (ClientState *state, - DBusGProxy *proxy, - double progress) -{ - MachineInfo *info; - GtkTreeIter iter; - - if (!proxy_to_iter (state->store, proxy, &iter)) - g_assert_not_reached (); - gtk_tree_model_get (state->store, &iter, 0, &info, -1); - - /* Ignore machines in unknown state */ - if (!info->state) - return; - - if (strcmp (info->state, "Acquired")) - lose ("Got AcquisitionProgress signal in bad state %s", - info->state); - - g_print ("Got acquisition progress change for %p (%s) to %f\n", proxy, info->name ? info->name : "(unknown)", progress); - - info->progress = progress; - - signal_row_change (state, &iter); -} - -static void -proxy_acquisition_changed_cb (DBusGProxy *proxy, - double progress, - gpointer user_data) -{ - set_proxy_acquisition_progress (user_data, proxy, progress); -} - -static void -get_acquiring_progress_cb (DBusGProxy *proxy, - DBusGProxyCall *call, - gpointer user_data) -{ - GError *error = NULL; - MachineInfo *info; - GtkTreeIter iter; - ClientState *state = user_data; - gdouble progress; - - if (!proxy_to_iter (state->store, proxy, &iter)) - g_assert_not_reached (); - gtk_tree_model_get (state->store, &iter, 0, &info, -1); - - g_assert (info->get_progress_call == call); - - if (!dbus_g_proxy_end_call (proxy, call, &error, - G_TYPE_DOUBLE, &progress, G_TYPE_INVALID)) - lose_gerror ("Failed to complete GetAcquiringProgress call", error); - info->get_progress_call = NULL; - - set_proxy_acquisition_progress (state, proxy, progress); -} - -static void -proxy_state_changed_cb (DBusGProxy *proxy, - const char *statename, - gpointer user_data) -{ - MachineInfo *info; - GtkTreeIter iter; - ClientState *state = user_data; - - if (!proxy_to_iter (state->store, proxy, &iter)) - g_assert_not_reached (); - gtk_tree_model_get (state->store, &iter, 0, &info, -1); - - g_print ("Got state change for %p (%s) to %s\n", proxy, info->name ? info->name : "(unknown)", statename); - - g_free (info->state); - info->state = g_strdup (statename); - - if (!strcmp (info->state, "Acquired")) - { - g_print ("Starting GetAcquiringProgress call for %p\n", info->proxy); - if (info->get_progress_call != NULL) - { - dbus_g_proxy_cancel_call (info->proxy, info->get_progress_call); - info->get_progress_call = NULL; - } - info->get_progress_call = - dbus_g_proxy_begin_call (info->proxy, "GetAcquiringProgress", - get_acquiring_progress_cb, - state, NULL, - G_TYPE_INVALID); - } - else - info->progress = 0.0; - - signal_row_change (state, &iter); -} - -static void -add_machine (ClientState *state, - const char *name, - const char *mstate, - const char *path) -{ - MachineInfo *info; - GtkTreeIter iter; - - info = g_new0 (MachineInfo, 1); - info->name = g_strdup (name); - info->state = g_strdup (mstate); - info->progress = 0.0; - - info->proxy = dbus_g_proxy_new_for_name (state->bus, - "com.example.StateServer", - path, - "com.example.StateMachine"); - - if (!info->state) - { - g_print ("Starting GetInfo call for %p\n", info->proxy); - dbus_g_proxy_begin_call (info->proxy, "GetInfo", - get_machine_info_cb, - state, NULL, - G_TYPE_INVALID); - } - - /* Watch for state changes */ - dbus_g_proxy_add_signal (info->proxy, "StateChanged", - G_TYPE_STRING, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (info->proxy, - "StateChanged", - G_CALLBACK (proxy_state_changed_cb), - state, - NULL); - - dbus_g_proxy_add_signal (info->proxy, "AcquisitionProgress", - G_TYPE_DOUBLE, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (info->proxy, - "AcquisitionProgress", - G_CALLBACK (proxy_acquisition_changed_cb), - state, - NULL); - - gtk_list_store_prepend (GTK_LIST_STORE (state->store), &iter); - gtk_list_store_set (GTK_LIST_STORE (state->store), &iter, 0, info, -1); - -} - -static void -machine_created_cb (DBusGProxy *proxy, - const char *name, - const char *path, - gpointer data) -{ - ClientState *state = data; - - add_machine (state, name, NULL, path); -} - -static void -server_destroyed_cb (DBusGProxy *proxy, gpointer data) -{ - g_print ("Server terminated!\n"); - GtkWidget *dialog; - - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_CLOSE, - "State Machine server has exited"); - - gtk_dialog_run (GTK_DIALOG (dialog)); - - exit (1); -} - -static void -window_destroyed_cb (GtkWidget *window, gpointer data) -{ - gtk_main_quit (); -} - -static void -create_machine_completed_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) -{ - GError *error = NULL; - ClientState *state = data; - - if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) - { - /* Ignore NameInUse errors */ - if (dbus_g_error_has_name (error, "com.example.StateServer.NameInUse")) - ; - else - lose_gerror ("Failed to create new state machine", error); - } - g_print ("machine created successfully\n"); - state->pending_creation_calls = g_slist_remove (state->pending_creation_calls, call); -} - -static void -send_create_machine (ClientState *state) -{ - DBusGProxyCall *call; - char *name; - gint n_children; - - n_children = gtk_tree_model_iter_n_children (state->store, NULL); - name = g_strdup_printf ("machine%d", n_children); - - g_print ("Invoking CreateMachine(%s)\n", name); - call = dbus_g_proxy_begin_call (state->server_proxy, "CreateMachine", - create_machine_completed_cb, - state, NULL, - G_TYPE_STRING, name, G_TYPE_INVALID); - g_free (name); - state->pending_creation_calls = g_slist_prepend (state->pending_creation_calls, call); -} - -static void -do_a_state_change (ClientState *state) -{ - gint index; - GtkTreeIter iter; - gint n_children; - MachineInfo *info; - - n_children = gtk_tree_model_iter_n_children (state->store, NULL); - if (n_children == 0) - { - g_print ("No machines yet, not doing a state switch\n"); - return; - } - - index = g_random_int_range (0, n_children); - gtk_tree_model_iter_nth_child (state->store, &iter, NULL, index); - gtk_tree_model_get (state->store, &iter, 0, &info, -1); - - if (!info->state) - { - g_print ("Machine not yet in known state, skipping state switch\n"); - return; - } - - if (!strcmp (info->state, "Shutdown")) - { - g_print ("Sending Start request to machine %s\n", info->name); - dbus_g_proxy_call_no_reply (info->proxy, "Start", G_TYPE_INVALID); - } - else if (!strcmp (info->state, "Loading")) - { - - g_print ("Sending Reacquire request to machine %s\n", info->name); - dbus_g_proxy_call_no_reply (info->proxy, "Reacquire", G_TYPE_INVALID); - } - else - { - g_print ("Sending Shutdown request to machine %s\n", info->name); - dbus_g_proxy_call_no_reply (info->proxy, "Shutdown", G_TYPE_INVALID); - } -} - -static gboolean -do_something_random_2 (gpointer data) -{ - ClientState *state = data; - do_a_state_change (state); - g_timeout_add (g_random_int_range (2000, 5000), do_something_random_2, state); - return FALSE; -} - -static gboolean -do_something_random (gpointer data) -{ - ClientState *state = data; - gint n_children; - - switch (g_random_int_range (0, 3)) - { - case 0: - send_create_machine (state); - break; - case 1: - case 2: - do_a_state_change (state); - break; - default: - g_assert_not_reached (); - } - - n_children = gtk_tree_model_iter_n_children (state->store, NULL); - if (n_children >= 5) - { - g_print ("MAX children reached, switching to state changes only\n"); - g_timeout_add (g_random_int_range (500, 3000), do_something_random_2, state); - } - else - g_timeout_add (g_random_int_range (500, 3000), do_something_random, state); - return FALSE; -} - -static void -set_cell_name (GtkTreeViewColumn *tree_column, - GtkCellRenderer *cell, - GtkTreeModel *tree_model, - GtkTreeIter *iter, - gpointer data) -{ - MachineInfo *info; - - gtk_tree_model_get (tree_model, iter, 0, &info, -1); - - g_object_set (cell, "text", info->name ? info->name : "", NULL); -} - -static gint -sort_by_name (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer user_data) -{ - MachineInfo *info_a, *info_b; - - gtk_tree_model_get (model, a, 0, &info_a, -1); - gtk_tree_model_get (model, b, 0, &info_b, -1); - - return strcmp (info_a->name ? info_a->name : "", - info_b ? info_b->name : ""); -} - -static void -set_cell_state (GtkTreeViewColumn *tree_column, - GtkCellRenderer *cell, - GtkTreeModel *tree_model, - GtkTreeIter *iter, - gpointer data) -{ - MachineInfo *info; - - gtk_tree_model_get (tree_model, iter, 0, &info, -1); - - g_object_set (cell, "text", info->state ? info->state : "", NULL); -} - -static gint -sort_by_state (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer user_data) -{ - MachineInfo *info_a, *info_b; - - gtk_tree_model_get (model, a, 0, &info_a, -1); - gtk_tree_model_get (model, b, 0, &info_b, -1); - - return strcmp (info_a->state ? info_a->state : "", - info_b ? info_b->state : ""); -} - -static void -set_cell_progress (GtkTreeViewColumn *tree_column, - GtkCellRenderer *cell, - GtkTreeModel *tree_model, - GtkTreeIter *iter, - gpointer data) -{ - MachineInfo *info; - - gtk_tree_model_get (tree_model, iter, 0, &info, -1); - - g_object_set (cell, "value", (int) (info->progress * 100), NULL); -} - -static gint -sort_by_progress (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer user_data) -{ - MachineInfo *info_a, *info_b; - - gtk_tree_model_get (model, a, 0, &info_a, -1); - gtk_tree_model_get (model, b, 0, &info_b, -1); - - return info_a->progress > info_b->progress ? 1 : -1; -} - -static void -get_machines_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer data) -{ - GError *error = NULL; - ClientState *state = data; - GPtrArray *objs; - guint i; - GtkWidget *scrolledwin; - GtkTreeViewColumn *col; - GtkCellRenderer *rend; - - g_assert (call == state->get_machines_call); - - if (!dbus_g_proxy_end_call (proxy, call, &error, - dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), - &objs, - G_TYPE_INVALID)) - lose_gerror ("Failed to get current machine list", error); - - gtk_container_remove (GTK_CONTAINER (state->window), - gtk_bin_get_child (GTK_BIN (state->window))); - - scrolledwin = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (scrolledwin); - - state->store = GTK_TREE_MODEL (gtk_list_store_new (1, G_TYPE_POINTER)); - state->view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (state->store)); - gtk_widget_show (state->view); - gtk_container_add (GTK_CONTAINER (scrolledwin), state->view); - gtk_container_add (GTK_CONTAINER (state->window), scrolledwin); - - rend = gtk_cell_renderer_text_new (); - col = gtk_tree_view_column_new_with_attributes (_("Name"), - rend, - NULL); - gtk_tree_view_column_set_cell_data_func (col, rend, set_cell_name, NULL, NULL); - gtk_tree_view_column_set_resizable (col, TRUE); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (state->store), - 0, sort_by_name, NULL, NULL); - gtk_tree_view_column_set_sort_column_id (col, 0); - gtk_tree_view_append_column (GTK_TREE_VIEW (state->view), col); - - rend = gtk_cell_renderer_text_new (); - col = gtk_tree_view_column_new_with_attributes (_("State"), - rend, - NULL); - gtk_tree_view_column_set_cell_data_func (col, rend, set_cell_state, NULL, NULL); - gtk_tree_view_column_set_resizable (col, TRUE); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (state->store), - 0, sort_by_state, NULL, NULL); - gtk_tree_view_column_set_sort_column_id (col, 0); - gtk_tree_view_append_column (GTK_TREE_VIEW (state->view), col); - - rend = gtk_cell_renderer_progress_new (); - col = gtk_tree_view_column_new_with_attributes (_("Progress"), - rend, - NULL); - gtk_tree_view_column_set_cell_data_func (col, rend, set_cell_progress, NULL, NULL); - gtk_tree_view_column_set_resizable (col, TRUE); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (state->store), - 0, sort_by_progress, NULL, NULL); - gtk_tree_view_column_set_sort_column_id (col, 0); - gtk_tree_view_append_column (GTK_TREE_VIEW (state->view), col); - - for (i = 0; i < objs->len; i++) - { - add_machine (state, NULL, NULL, g_ptr_array_index (objs, i)); - g_free (g_ptr_array_index (objs, i)); - } - g_ptr_array_free (objs, TRUE); - - g_idle_add (do_something_random, state); -} - -int -main (int argc, char **argv) -{ - DBusGConnection *bus; - DBusGProxy *server; - GError *error = NULL; - ClientState state; - GtkWidget *label; - - gtk_init (&argc, &argv); - - g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); - - state.window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); - gtk_window_set_resizable (GTK_WINDOW (state.window), TRUE); - g_signal_connect (G_OBJECT (state.window), "destroy", - G_CALLBACK (window_destroyed_cb), - &state); - gtk_window_set_title (GTK_WINDOW (state.window), _("D-BUS State Machine Demo")); - gtk_window_set_default_size (GTK_WINDOW (state.window), 320, 240); - - label = gtk_label_new (""); - gtk_label_set_markup (GTK_LABEL (label), "Loading..."); - gtk_widget_show (label); - - gtk_container_add (GTK_CONTAINER (state.window), label); - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - lose_gerror ("Couldn't connect to session bus", error); - - state.bus = bus; - - server = dbus_g_proxy_new_for_name_owner (bus, - "com.example.StateServer", - "/com/example/StateServer", - "com.example.StateMachineServer", - &error); - if (!server) - lose_gerror ("Couldn't find \"com.example.StateServer\"", error); - - state.server_proxy = server; - - g_signal_connect (server, "destroy", - G_CALLBACK (server_destroyed_cb), - &state); - - dbus_g_object_register_marshaller (sm_marshal_VOID__STRING_BOXED, - G_TYPE_NONE, G_TYPE_STRING, - DBUS_TYPE_G_OBJECT_PATH); - - dbus_g_proxy_add_signal (server, "MachineCreated", G_TYPE_STRING, DBUS_TYPE_G_OBJECT_PATH, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (server, "MachineCreated", - G_CALLBACK (machine_created_cb), - &state, NULL); - - state.get_machines_call = dbus_g_proxy_begin_call (server, "GetMachines", - get_machines_cb, &state, NULL, - G_TYPE_INVALID); - - gtk_widget_show (GTK_WIDGET (state.window)); - - gtk_main (); - - g_object_unref (G_OBJECT (server)); - - exit(0); -} diff --git a/glib/examples/statemachine/statemachine-server.c b/glib/examples/statemachine/statemachine-server.c deleted file mode 100644 index cc9ca4bd..00000000 --- a/glib/examples/statemachine/statemachine-server.c +++ /dev/null @@ -1,229 +0,0 @@ -#include -#include -#include - -#include "statemachine.h" -#include "sm-marshal.h" -#include "statemachine-server.h" - -enum -{ - PROP_O, - PROP_BUS -}; - -enum -{ - MACHINE_CREATED, - LAST_SIGNAL -}; - -static guint sm_server_signals[LAST_SIGNAL] = { 0 }; - -static void sm_server_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void sm_server_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); - -G_DEFINE_TYPE(SMServer, sm_server, G_TYPE_OBJECT) - -#include "statemachine-server-glue.h" -#include "statemachine-glue.h" - -static void -sm_server_init (SMServer *obj) -{ - obj->machines = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); -} - -static void -sm_server_class_init (SMServerClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->set_property = sm_server_set_property; - object_class->get_property = sm_server_get_property; - - g_object_class_install_property (object_class, - PROP_BUS, - g_param_spec_boxed ("bus", - "bus", - "bus", - DBUS_TYPE_G_CONNECTION, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - - sm_server_signals[MACHINE_CREATED] = - g_signal_new ("machine-created", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - sm_marshal_VOID__STRING_BOXED, - G_TYPE_NONE, 2, G_TYPE_STRING, DBUS_TYPE_G_OBJECT_PATH); -} - -static void -sm_server_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - SMServer *server = SM_SERVER (object); - - switch (prop_id) - { - case PROP_BUS: - server->bus = g_value_get_boxed (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -sm_server_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - SMServer *server = SM_SERVER (object); - - switch (prop_id) - { - case PROP_BUS: - g_value_set_boxed (value, server->bus); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -machine_state_changed_cb (SMObject *obj, const char *state, gpointer data) -{ - char *name; - - g_object_get (obj, "name", &name, NULL); - g_print ("Machine %s switching to state %s\n", name, state); - g_free (name); -} - -static void -machine_acquisition_changed_cb (SMObject *obj, gdouble progress, gpointer data) -{ - char *name; - - g_object_get (obj, "name", &name, NULL); - g_print ("Machine %s got progress %f\n", name, progress); - g_free (name); -} - -gboolean -sm_server_create_machine (SMServer *server, const char *name, GError **error) -{ - SMObject *machine; - char *path; - - machine = g_hash_table_lookup (server->machines, name); - if (machine != NULL) - { - g_set_error (error, - SM_ERROR, - SM_ERROR_NAME_IN_USE, - "Statemachine name \"%s\" is already in use", - name); - return FALSE; - } - - machine = g_object_new (SM_TYPE_OBJECT, "name", name, NULL); - - path = g_strdup_printf ("/com/example/StateMachines/%s", name); - dbus_g_connection_register_g_object (server->bus, path, G_OBJECT (machine)); - - g_hash_table_insert (server->machines, g_strdup (name), machine); - - g_print ("Created state machine with name %s at %s\n", name, path); - - g_signal_connect_object (machine, "state-changed", - G_CALLBACK (machine_state_changed_cb), - NULL, 0); - g_signal_connect_object (machine, "acquisition-progress", - G_CALLBACK (machine_acquisition_changed_cb), - NULL, 0); - - g_signal_emit (server, sm_server_signals[MACHINE_CREATED], 0, name, path); - - return TRUE; -} - -static void -add_machine_to_ptr_array (gpointer key, gpointer val, gpointer data) -{ - const char *name = key; - /* SMObject *sm = val; */ - GPtrArray *ptrarray = data; - - g_ptr_array_add (ptrarray, g_strdup_printf ("/com/example/StateMachines/%s", - name)); -} - -gboolean -sm_server_get_machines (SMServer *server, GPtrArray **machines, GError **error) -{ - *machines = g_ptr_array_new (); - - g_hash_table_foreach (server->machines, add_machine_to_ptr_array, *machines); - - return TRUE; -} - -int -main (int argc, char **argv) -{ - DBusGConnection *bus; - DBusGProxy *bus_proxy; - GError *error = NULL; - SMServer *server; - GMainLoop *mainloop; - guint request_name_result; - - g_type_init (); - - dbus_g_object_type_install_info (SM_TYPE_SERVER, &dbus_glib_sm_server_object_info); - dbus_g_object_type_install_info (SM_TYPE_OBJECT, &dbus_glib_sm_object_object_info); - dbus_g_error_domain_register (SM_ERROR, NULL, SM_TYPE_ERROR); - - mainloop = g_main_loop_new (NULL, FALSE); - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - if (!bus) - g_critical ("Couldn't connect to session bus: %s\n", error->message); - - bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); - - if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, - G_TYPE_STRING, "com.example.StateServer", - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &request_name_result, - G_TYPE_INVALID)) - g_critical ("Couldn't acquire com.example.StateServer: %s\n", error->message); - - server = g_object_new (SM_TYPE_SERVER, "bus", bus, NULL); - - dbus_g_connection_register_g_object (bus, "/com/example/StateServer", G_OBJECT (server)); - - g_print ("StateMachine server initialized\n"); - - g_main_loop_run (mainloop); - - exit (0); -} diff --git a/glib/examples/statemachine/statemachine-server.h b/glib/examples/statemachine/statemachine-server.h deleted file mode 100644 index 360be3a6..00000000 --- a/glib/examples/statemachine/statemachine-server.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _SM_SERVER_H -#define _SM_SERVER_H - -#include "statemachine.h" -#include - -typedef struct SMServer SMServer; -typedef struct SMServerClass SMServerClass; - -struct SMServer -{ - GObject parent; - - /* Private */ - DBusGConnection *bus; - GHashTable *machines; -}; - -struct SMServerClass -{ - GObjectClass parent; -}; - -#define SM_TYPE_SERVER (sm_server_get_type ()) -#define SM_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SM_TYPE_SERVER, SMServer)) -#define SM_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SM_TYPE_SERVER, SMServerClass)) -#define SM_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SM_TYPE_SERVER)) -#define SM_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SM_TYPE_SERVER)) -#define SM_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SM_TYPE_SERVER, SMServerClass)) - -GType sm_server_get_type (void); - -gboolean sm_server_create_machine (SMServer *server, const char *name, GError **error); - -gboolean sm_server_get_machines (SMServer *server, GPtrArray **machines, GError **error); - -#endif diff --git a/glib/examples/statemachine/statemachine-server.xml b/glib/examples/statemachine/statemachine-server.xml deleted file mode 100644 index fe9caaf7..00000000 --- a/glib/examples/statemachine/statemachine-server.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/glib/examples/statemachine/statemachine.c b/glib/examples/statemachine/statemachine.c deleted file mode 100644 index c94e2945..00000000 --- a/glib/examples/statemachine/statemachine.c +++ /dev/null @@ -1,353 +0,0 @@ -#include -#include -#include "statemachine.h" - -static void clear_pending_tasks (SMObject *object); -static void state_change (SMObject *object, SMObjectState new_state); -static void sm_object_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void sm_object_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -enum -{ - PROP_0, - PROP_NAME, -}; - -enum -{ - STATE_CHANGED, - ACQUISITION_FAILED, - ACQUISITION_PROGRESS, - LAST_SIGNAL -}; - -static guint sm_object_signals[LAST_SIGNAL] = { 0 }; - -G_DEFINE_TYPE(SMObject, sm_object, G_TYPE_OBJECT) - -static void -sm_object_init (SMObject *obj) -{ - obj->state = SM_OBJECT_STATE_SHUTDOWN; -} - -static void -sm_object_class_init (SMObjectClass *klass) -{ - GObjectClass *object_class; - - object_class = G_OBJECT_CLASS (klass); - - object_class->set_property = sm_object_set_property; - object_class->get_property = sm_object_get_property; - - g_object_class_install_property (object_class, - PROP_NAME, - g_param_spec_string ("name", - "name", - "name", - NULL, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - sm_object_signals[STATE_CHANGED] = - g_signal_new ("state-changed", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__STRING, - G_TYPE_NONE, 1, G_TYPE_STRING); - sm_object_signals[ACQUISITION_PROGRESS] = - g_signal_new ("acquisition-progress", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__DOUBLE, - G_TYPE_NONE, 1, G_TYPE_DOUBLE); - sm_object_signals[ACQUISITION_FAILED] = - g_signal_new ("acquisition-failed", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -/* This should really be standard. */ -#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } - -GQuark -sm_error_quark (void) -{ - static GQuark ret = 0; - if (!ret) - ret = g_quark_from_static_string ("SMObjectErrorQuark"); - return ret; -} - -GType -sm_object_state_get_type (void) -{ - static GType etype = 0; - - if (etype == 0) - { - static const GEnumValue values[] = - { - - ENUM_ENTRY (SM_OBJECT_STATE_SHUTDOWN, "Shutdown"), - ENUM_ENTRY (SM_OBJECT_STATE_INITIALIZED, "Loading"), - ENUM_ENTRY (SM_OBJECT_STATE_ACQUIRED, "Acquired"), - ENUM_ENTRY (SM_OBJECT_STATE_OPERATING, "Operating"), - { 0, 0, 0 } - }; - - etype = g_enum_register_static ("SMObjectState", values); - } - - return etype; -} - -GType -sm_error_get_type (void) -{ - static GType etype = 0; - - if (etype == 0) - { - static const GEnumValue values[] = - { - - ENUM_ENTRY (SM_ERROR_INVALID_STATE, "InvalidState"), - ENUM_ENTRY (SM_ERROR_NAME_IN_USE, "NameInUse"), - { 0, 0, 0 } - }; - - g_assert (SM_NUM_ERRORS == G_N_ELEMENTS (values) - 1); - - etype = g_enum_register_static ("SMError", values); - } - - return etype; -} - -static void -sm_object_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - SMObject *sm = SM_OBJECT (object); - - switch (prop_id) - { - case PROP_NAME: - sm->name = g_strdup (g_value_get_string (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -sm_object_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - SMObject *sm= SM_OBJECT (object); - - switch (prop_id) - { - case PROP_NAME: - g_value_set_string (value, sm->name); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static const char * -state_to_string (SMObjectState state) -{ - GEnumValue *value; - GEnumClass *prop_class; - const char *ret; - - prop_class = g_type_class_ref (SM_TYPE_OBJECT_STATE); - value = g_enum_get_value (prop_class, state); - ret = value->value_nick; - - g_type_class_unref (prop_class); - return ret; -} - -static void -queue_task (SMObject *object, guint delay, GSourceFunc func) -{ - guint id; - id = g_timeout_add (delay, func, object); - object->pending_tasks = g_slist_prepend (object->pending_tasks, GUINT_TO_POINTER (id)); -} - -static gboolean -idle_state_change (gpointer data) -{ - SMObject *object = data; - - g_print ("doing idle state change for %s to %s\n", - object->name, state_to_string (object->requested_state)); - state_change (object, object->requested_state); - return FALSE; -} - -static gboolean -idle_further_acquire (gpointer data) -{ - SMObject *object = data; - - g_print ("doing idle acquisition for machine %s\n", object->name); - object->acquisition_progress += g_random_double_range (0.20, 0.7); - if (object->acquisition_progress > 1.0) - { - object->acquisition_progress = 1.0; - return FALSE; - } - else - { - g_signal_emit (object, sm_object_signals[ACQUISITION_PROGRESS], 0, object->acquisition_progress); - return TRUE; - } -} - -static void -clear_pending_tasks (SMObject *object) -{ - GSList *tmp; - for (tmp = object->pending_tasks; tmp; tmp = tmp->next) - g_source_remove (GPOINTER_TO_UINT (tmp->data)); - g_slist_free (object->pending_tasks); - object->pending_tasks = NULL; -} - -static void -state_change (SMObject *object, SMObjectState new_state) -{ - g_signal_emit (object, sm_object_signals[STATE_CHANGED], 0, - state_to_string (new_state)); - - clear_pending_tasks (object); - - if (new_state == SM_OBJECT_STATE_ACQUIRED) - { - object->acquisition_progress = 0.0; - queue_task (object, 1000, idle_further_acquire); - } - else if (new_state == SM_OBJECT_STATE_INITIALIZED) - { - if (g_random_int_range (0, 2) == 0) - { - object->requested_state = SM_OBJECT_STATE_ACQUIRED; - queue_task (object, 3000, idle_state_change); - } - } - - object->state = new_state; -} - -gboolean -sm_object_get_info (SMObject *object, char **name, char **state, GError **error) -{ - *name= g_strdup (object->name); - *state = g_strdup (state_to_string (object->state)); - return TRUE; -} - -gboolean -sm_object_start (SMObject *object, GError **error) -{ - if (object->state != SM_OBJECT_STATE_SHUTDOWN) - { - g_set_error (error, - SM_ERROR, - SM_ERROR_INVALID_STATE, - "%s", - "Can't start from non-shutdown state"); - return FALSE; - } - state_change (object, SM_OBJECT_STATE_INITIALIZED); - return TRUE; -} - -gboolean -sm_object_shutdown (SMObject *object, GError **error) -{ - if (object->state == SM_OBJECT_STATE_SHUTDOWN) - { - g_set_error (error, - SM_ERROR, - SM_ERROR_INVALID_STATE, - "%s", - "Can't shutdown from shutdown state"); - return FALSE; - } - state_change (object, SM_OBJECT_STATE_SHUTDOWN); - return TRUE; -} - -gboolean -sm_object_reinitialize (SMObject *object, GError **error) -{ - if (object->state != SM_OBJECT_STATE_ACQUIRED - && object->state != SM_OBJECT_STATE_OPERATING) - { - g_set_error (error, - SM_ERROR, - SM_ERROR_INVALID_STATE, - "Can't reinitialize from state %d", - object->state); - return FALSE; - } - state_change (object, SM_OBJECT_STATE_INITIALIZED); - return TRUE; -} - -gboolean -sm_object_reacquire (SMObject *object, GError **error) -{ - if (object->state == SM_OBJECT_STATE_ACQUIRED) - { - g_set_error (error, - SM_ERROR, - SM_ERROR_INVALID_STATE, - "Can't reacquire from state %d", - object->state); - return FALSE; - } - state_change (object, SM_OBJECT_STATE_ACQUIRED); - return TRUE; -} - -gboolean -sm_object_get_acquiring_progress (SMObject *object, gdouble *out, GError **error) -{ - if (object->state != SM_OBJECT_STATE_ACQUIRED) - { - g_set_error (error, - SM_ERROR, - SM_ERROR_INVALID_STATE, - "Can't get progress from state %d", - object->state); - return FALSE; - } - *out = object->acquisition_progress; - return TRUE; -} diff --git a/glib/examples/statemachine/statemachine.h b/glib/examples/statemachine/statemachine.h deleted file mode 100644 index ac6047bd..00000000 --- a/glib/examples/statemachine/statemachine.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef _SM_OBJECT_H -#define _SM_OBJECT_H - -#include -#include - -GQuark sm_error_quark (void); - -#define SM_ERROR (sm_error_quark ()) - -typedef enum -{ - SM_ERROR_INVALID_STATE = 0, - SM_ERROR_NAME_IN_USE, - SM_NUM_ERRORS -} SMError; - -GType sm_error_get_type (void); -#define SM_TYPE_ERROR (sm_error_get_type ()) - -typedef enum -{ - SM_OBJECT_STATE_SHUTDOWN = 0, - SM_OBJECT_STATE_INITIALIZED, - SM_OBJECT_STATE_ACQUIRED, - SM_OBJECT_STATE_OPERATING, - SM_OBJECT_NUM_STATES -} SMObjectState; - -GType sm_object_state_get_type (void); - -#define SM_TYPE_OBJECT_STATE (sm_object_state_get_type ()) - -typedef struct SMObject SMObject; -typedef struct SMObjectClass SMObjectClass; - -struct SMObject -{ - GObject parent; - - /* Private */ - char *name; - SMObjectState state; - double acquisition_progress; - - GSList /* guint */ *pending_tasks; - - SMObjectState requested_state; -}; - -struct SMObjectClass -{ - GObjectClass parent; -}; - -#define SM_TYPE_OBJECT (sm_object_get_type ()) -#define SM_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), SM_TYPE_OBJECT, SMObject)) -#define SM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SM_TYPE_OBJECT, SMObjectClass)) -#define SM_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), SM_TYPE_OBJECT)) -#define SM_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SM_TYPE_OBJECT)) -#define SM_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SM_TYPE_OBJECT, SMObjectClass)) - -GType sm_object_get_type (void); - -gboolean sm_object_get_info (SMObject *object, char **name, char **state, GError **error); - -gboolean sm_object_start (SMObject *object, GError **error); - -gboolean sm_object_shutdown (SMObject *object, GError **error); - -gboolean sm_object_reinitialize (SMObject *object, GError **error); - -gboolean sm_object_reacquire (SMObject *object, GError **error); - -gboolean sm_object_get_acquiring_progress (SMObject *object, gdouble *out, GError **error); - -#endif diff --git a/glib/examples/statemachine/statemachine.xml b/glib/examples/statemachine/statemachine.xml deleted file mode 100644 index c375ef1b..00000000 --- a/glib/examples/statemachine/statemachine.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/glib/make-dbus-glib-error-switch.sh b/glib/make-dbus-glib-error-switch.sh deleted file mode 100755 index 602cf990..00000000 --- a/glib/make-dbus-glib-error-switch.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -SRC=$1 -DEST=$2 - -die() -{ - echo $1 1>&2 - /bin/rm $DEST.tmp - exit 1 -} - -echo 'static gint' > $DEST.tmp -echo 'dbus_error_to_gerror_code (const char *derr)' >> $DEST.tmp -echo '{' >> $DEST.tmp -echo ' if (0) ; ' >> $DEST.tmp - -cat $SRC | grep '#define DBUS_ERROR' | sed -e 's/#define //g' | \ - sed -e 's/".*//g' | \ - (while read line; do \ - echo ' else if (!strcmp (derr, ' "$line" ' )) '; \ - echo ' return ' `echo $line | sed -e 's/DBUS_ERROR/DBUS_GERROR/g'` ';'; \ - done; \ - ) >> $DEST.tmp -echo ' else' >> $DEST.tmp -echo ' return DBUS_GERROR_REMOTE_EXCEPTION;' >> $DEST.tmp -echo '}' >> $DEST.tmp - -mv $DEST.tmp $DEST || die "could not move $DEST.tmp to $DEST" diff --git a/mono/.cvsignore b/mono/.cvsignore deleted file mode 100644 index 52cab4d7..00000000 --- a/mono/.cvsignore +++ /dev/null @@ -1,17 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.gcov -*.da -.dbus-keyrings -*.dll -*.exe -test-dbus-sharp -AssemblyInfo.cs -dbus-sharp.dll.config - diff --git a/mono/Arguments.cs b/mono/Arguments.cs deleted file mode 100644 index 25f89daf..00000000 --- a/mono/Arguments.cs +++ /dev/null @@ -1,327 +0,0 @@ -using System; -using System.Collections; -using System.Reflection; -using System.Runtime.InteropServices; - -namespace DBus -{ - // Holds the arguments of a message. Provides methods for appending - // arguments and to assist in matching .NET types with D-BUS types. - public class Arguments : IEnumerable, IDisposable - { - // Must follow sizeof(DBusMessageIter) - internal static readonly int DBusMessageIterSize = Marshal.SizeOf (typeof(_DBusMessageIter)); - private static Hashtable dbusTypes = null; - private Message message; - private IntPtr appenderIter; - private IEnumerator enumerator = null; - - internal Arguments (Message message) - { - this.appenderIter = Marshal.AllocCoTaskMem(DBusMessageIterSize); - this.message = message; - } - - private void Dispose (bool disposing) - { - Marshal.FreeCoTaskMem(appenderIter); - } - - public void Dispose () - { - Dispose (true); - GC.SuppressFinalize (this); - } - - ~Arguments() - { - Dispose (false); - } - - // Checks the suitability of a D-BUS type for supporting a .NET - // type. - public static bool Suits(Type dbusType, Type type) - { - object [] pars = new object[1]; - pars[0] = type; - - return (bool) dbusType.InvokeMember("Suits", BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod, null, null, pars, null); - } - - // Find a suitable match for the given .NET type or throw an - // exception if one can't be found. - public static Type MatchType(Type type) - { - foreach(Type dbusType in DBusTypes.Values) { - if (Suits(dbusType, type)) { - return dbusType; - } - } - - throw new ApplicationException("No suitable DBUS type found for type '" + type + "'"); - } - - // The D-BUS types. - public static Hashtable DBusTypes { - get - { - if (dbusTypes == null) { - dbusTypes = new Hashtable(); - - foreach (Type type in Assembly.GetAssembly(typeof(DBusType.IDBusType)).GetTypes()) { - if (type != typeof(DBusType.IDBusType) && typeof(DBusType.IDBusType).IsAssignableFrom(type)) { - dbusTypes.Add(GetCode(type), type); - } - } - } - - return dbusTypes; - } - } - - // Append an argument - public void Append(DBusType.IDBusType dbusType) - { - dbusType.Append(appenderIter); - } - - // Append an argument of the specified type - private void AppendType(Type type, object val) - { - object [] pars = new Object[2]; - pars[0] = val; - pars[1] = message.Service; - DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(MatchType(type), pars); - Append(dbusType); - } - - // Append the results of a method call - public void AppendResults(MethodInfo method, object retVal, object [] parameters) - { - InitAppending(); - - if (method.ReturnType != typeof(void)) { - AppendType(method.ReturnType, retVal); - } - - for (int i = 0; i < method.GetParameters().Length; i++) { - ParameterInfo par = method.GetParameters()[i]; - if (par.IsOut || par.ParameterType.ToString().EndsWith("&")) { - // It's an OUT or INOUT parameter. - AppendType(par.ParameterType.UnderlyingSystemType, parameters[i]); - } - } - } - - // Get the parameters - public object[] GetParameters(MethodInfo method) - { - ParameterInfo[] pars = method.GetParameters(); - ArrayList paramList = new ArrayList(); - - enumerator = GetEnumerator(); - foreach (ParameterInfo par in pars) { - if (!par.IsOut) { - // It's an IN or INOUT paramter. - enumerator.MoveNext(); - DBusType.IDBusType dbusType = (DBusType.IDBusType) enumerator.Current; - paramList.Add(dbusType.Get(par.ParameterType)); - } else { - // It's an OUT so just create a parameter for it - object var = null; - paramList.Add(var); - } - } - - return paramList.ToArray(); - } - - // Parse the IN & REF parameters to a method and return the types in a list. - public static object[] ParseInParameters(MethodInfo method) - { - ArrayList types = new ArrayList(); - - ParameterInfo[] pars = method.GetParameters(); - foreach (ParameterInfo par in pars) { - if (!par.IsOut) { - types.Add(MatchType(par.ParameterType)); - } - } - - return types.ToArray(); - } - - // Parse the OUT & REF parameters to a method and return the types in a list. - public static object[] ParseOutParameters(MethodInfo method) - { - ArrayList types = new ArrayList(); - - ParameterInfo[] pars = method.GetParameters(); - foreach (ParameterInfo par in pars) { - if (par.IsOut || par.ParameterType.ToString().EndsWith("&")) { - types.Add(MatchType(par.ParameterType)); - } - } - - return types.ToArray(); - } - - // Get the appropriate constructor for a D-BUS type - public static ConstructorInfo GetDBusTypeConstructor(Type dbusType, Type type) - { - Type constructorType; - - if (type.IsArray) - constructorType = typeof (System.Array); - else if (type.IsEnum) - constructorType = Enum.GetUnderlyingType (type); - else - constructorType = type.UnderlyingSystemType; - - ConstructorInfo constructor = dbusType.GetConstructor(new Type[] {constructorType, typeof(Service)}); - if (constructor == null) - throw new ArgumentException("There is no valid constructor for '" + dbusType + "' from type '" + type + "'"); - - return constructor; - } - - // Get the type code for a given D-BUS type - public static char GetCode(Type dbusType) - { - return (char) dbusType.InvokeMember("Code", BindingFlags.Static | BindingFlags.GetField, null, null, null); - } - - // Get the type code for a given D-BUS type as a string - public static string GetCodeAsString (Type dbusType) - { - return GetCode (dbusType).ToString (); - } - - // Get a complete method signature - public override string ToString() - { - IntPtr iter = Marshal.AllocCoTaskMem(DBusMessageIterSize); - string key = ""; - - // Iterate through the parameters getting the type codes to a string - bool notEmpty = dbus_message_iter_init(message.RawMessage, iter); - - if (notEmpty) { - do { - char code = (char) dbus_message_iter_get_arg_type(iter); - if (code == '\0') - return key; - - key += code; - } while (dbus_message_iter_next(iter)); - } - - Marshal.FreeCoTaskMem(iter); - - return key; - } - - // Move to the next parameter - public DBusType.IDBusType GetNext() - { - enumerator.MoveNext(); - return (DBusType.IDBusType) enumerator.Current; - } - - // Begin appending - public void InitAppending() - { - dbus_message_iter_init_append(message.RawMessage, appenderIter); - } - - // Get the enumerator - public IEnumerator GetEnumerator() - { - return new ArgumentsEnumerator(this); - } - - [StructLayout(LayoutKind.Sequential)] - private class _DBusMessageIter - { - IntPtr dummy1; - IntPtr dummy2; - int dummy3; - int dummy4; - int dummy5; - int dummy6; - int dummy7; - int dummy8; - int dummy9; - int dummy10; - int dummy11; - int pad1; - int pad2; - IntPtr pad3; - } - - private class ArgumentsEnumerator : IEnumerator - { - private Arguments arguments; - private bool started = false; - private bool notEmpty = false; - private IntPtr iter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize); - - public ArgumentsEnumerator(Arguments arguments) - { - this.arguments = arguments; - Reset(); - } - - ~ArgumentsEnumerator() - { - Marshal.FreeCoTaskMem(iter); - } - - public bool MoveNext() - { - if (started) { - return dbus_message_iter_next(iter); - } else { - started = true; - return notEmpty; - } - } - - public void Reset() - { - notEmpty = dbus_message_iter_init(arguments.message.RawMessage, iter); - started = false; - } - - public object Current - { - get - { - object [] pars = new Object[2]; - pars[0] = iter; - pars[1] = arguments.message.Service; - - Type type = (Type) DBusTypes[(char) dbus_message_iter_get_arg_type(iter)]; - DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(type, pars); - - return dbusType; - } - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_init_append(IntPtr rawMessage, IntPtr iter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_has_next(IntPtr iter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_next(IntPtr iter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_init(IntPtr rawMessage, IntPtr iter); - - [DllImport("dbus-1")] - private extern static int dbus_message_iter_get_arg_type(IntPtr iter); - } -} diff --git a/mono/AssemblyInfo.cs.in b/mono/AssemblyInfo.cs.in deleted file mode 100644 index ae231892..00000000 --- a/mono/AssemblyInfo.cs.in +++ /dev/null @@ -1,6 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly:AssemblyVersion("@VERSION@")] -[assembly:AssemblyDelaySign(false)] -[assembly:AssemblyKeyFile("@srcdir@/dbus-sharp.snk")] diff --git a/mono/Bus.cs b/mono/Bus.cs deleted file mode 100644 index 05cf24c2..00000000 --- a/mono/Bus.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class Bus - { - // Keep in sync with C - private enum BusType - { - Session = 0, - System = 1, - Activation = 2 - } - - // Don't allow instantiation - private Bus () { } - - public static Connection GetSessionBus() - { - return GetBus(BusType.Session); - } - - public static Connection GetSystemBus() - { - return GetBus(BusType.System); - } - - private static Connection GetBus(BusType busType) - { - Error error = new Error(); - error.Init(); - - IntPtr rawConnection = dbus_bus_get((int) busType, ref error); - - if (rawConnection != IntPtr.Zero) { - Connection connection = Connection.Wrap(rawConnection); - connection.SetupWithMain(); - dbus_connection_unref(rawConnection); - - return connection; - } else { - throw new DBusException(error); - } - } - - [DllImport ("dbus-1")] - private extern static IntPtr dbus_bus_get (int which, ref Error error); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_unref (IntPtr ptr); - } -} diff --git a/mono/BusDriver.cs b/mono/BusDriver.cs deleted file mode 100644 index 4e9b7afa..00000000 --- a/mono/BusDriver.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace DBus -{ - - using System; - - public delegate void NameOwnerChangedHandler (string name, - string oldOwner, - string newOwner); - - [Interface ("org.freedesktop.DBus")] - public abstract class BusDriver - { - [Method] - public abstract string[] ListNames (); - - [Method] - public abstract string GetNameOwner (string name); - - [Method] - public abstract UInt32 GetConnectionUnixUser (string connectionName); - - - [Signal] - public virtual event NameOwnerChangedHandler NameOwnerChanged; - - static public BusDriver New (Connection connection) - { - Service service; - service = Service.Get (connection, "org.freedesktop.DBus"); - - BusDriver driver; - driver = (BusDriver) service.GetObject (typeof (BusDriver), "/org/freedesktop/DBus"); - - return driver; - } - } -} diff --git a/mono/Connection.cs b/mono/Connection.cs deleted file mode 100644 index 5413c1c8..00000000 --- a/mono/Connection.cs +++ /dev/null @@ -1,354 +0,0 @@ -namespace DBus -{ - - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - using System.Reflection; - using System.IO; - using System.Collections; - - public delegate int DBusHandleMessageFunction (IntPtr rawConnection, - IntPtr rawMessage, - IntPtr userData); - - internal delegate void DBusObjectPathUnregisterFunction(IntPtr rawConnection, - IntPtr userData); - - internal delegate int DBusObjectPathMessageFunction(IntPtr rawConnection, - IntPtr rawMessage, - IntPtr userData); - - [StructLayout (LayoutKind.Sequential)] - internal struct DBusObjectPathVTable - { - public DBusObjectPathUnregisterFunction unregisterFunction; - public DBusObjectPathMessageFunction messageFunction; - public IntPtr padding1; - public IntPtr padding2; - public IntPtr padding3; - public IntPtr padding4; - - public DBusObjectPathVTable(DBusObjectPathUnregisterFunction unregisterFunction, - DBusObjectPathMessageFunction messageFunction) - { - this.unregisterFunction = unregisterFunction; - this.messageFunction = messageFunction; - this.padding1 = IntPtr.Zero; - this.padding2 = IntPtr.Zero; - this.padding3 = IntPtr.Zero; - this.padding4 = IntPtr.Zero; - } - } - - public class Connection : IDisposable - { - /// - /// A pointer to the underlying Connection structure - /// - private IntPtr rawConnection; - - /// - /// The current slot number - /// - private static int slot = -1; - - private int timeout = -1; - - private ArrayList filters = new ArrayList (); // of DBusHandleMessageFunction - private ArrayList matches = new ArrayList (); // of string - private Hashtable object_paths = new Hashtable (); // key: string value: DBusObjectPathVTable - - internal Connection(IntPtr rawConnection) - { - RawConnection = rawConnection; - } - - public Connection(string address) - { - // the assignment bumps the refcount - Error error = new Error(); - error.Init(); - RawConnection = dbus_connection_open(address, ref error); - if (RawConnection != IntPtr.Zero) { - dbus_connection_unref(RawConnection); - } else { - throw new DBusException(error); - } - - SetupWithMain(); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - public void Dispose (bool disposing) - { - if (disposing && RawConnection != IntPtr.Zero) - { - dbus_connection_disconnect(rawConnection); - - RawConnection = IntPtr.Zero; // free the native object - } - } - - public void Flush() - { - dbus_connection_flush(RawConnection); - } - - public void SetupWithMain() - { - dbus_connection_setup_with_g_main(RawConnection, IntPtr.Zero); - } - - ~Connection () - { - Dispose (false); - } - - internal static Connection Wrap(IntPtr rawConnection) - { - if (slot > -1) { - // Maybe we already have a Connection object associated with - // this rawConnection then return it - IntPtr rawThis = dbus_connection_get_data (rawConnection, slot); - if (rawThis != IntPtr.Zero && ((GCHandle)rawThis).Target == typeof(DBus.Connection)) { - return (DBus.Connection) ((GCHandle)rawThis).Target; - } - } - - // If it doesn't exist then create a new connection around it - return new Connection(rawConnection); - } - - public void AddFilter (DBusHandleMessageFunction func) - { - if (!dbus_connection_add_filter (RawConnection, - func, - IntPtr.Zero, - IntPtr.Zero)) - throw new OutOfMemoryException (); - - this.filters.Add (func); - } - - public void RemoveFilter (DBusHandleMessageFunction func) - { - dbus_connection_remove_filter (RawConnection, func, IntPtr.Zero); - - this.filters.Remove (func); - } - - public void AddMatch (string match_rule) - { - dbus_bus_add_match (RawConnection, match_rule, IntPtr.Zero); - - this.matches.Add (match_rule); - } - - public void RemoveMatch (string match_rule) - { - dbus_bus_remove_match (RawConnection, match_rule, IntPtr.Zero); - - this.matches.Remove (match_rule); - } - - internal void RegisterObjectPath (string path, DBusObjectPathVTable vtable) - { - if (!dbus_connection_register_object_path (RawConnection, path, ref vtable, IntPtr.Zero)) - throw new OutOfMemoryException (); - - this.object_paths[path] = vtable; - } - - internal void UnregisterObjectPath (string path) - { - dbus_connection_unregister_object_path (RawConnection, path); - - this.object_paths.Remove (path); - } - - - public string UniqueName - { - get - { - return Marshal.PtrToStringAnsi (dbus_bus_get_unique_name (RawConnection)); - } - } - - public int Timeout - { - get - { - return this.timeout; - } - set - { - this.timeout = value; - } - } - - private int Slot - { - get - { - if (slot == -1) - { - // We need to initialize the slot - if (!dbus_connection_allocate_data_slot (ref slot)) - throw new OutOfMemoryException (); - - Debug.Assert (slot >= 0); - } - - return slot; - } - } - - internal IntPtr RawConnection - { - get - { - return rawConnection; - } - set - { - if (value == rawConnection) - return; - - if (rawConnection != IntPtr.Zero) - { - // Remove our callbacks from this connection - foreach (DBusHandleMessageFunction func in this.filters) - dbus_connection_remove_filter (rawConnection, func, IntPtr.Zero); - - foreach (string match_rule in this.matches) - dbus_bus_remove_match (rawConnection, match_rule, IntPtr.Zero); - - foreach (string path in this.object_paths.Keys) - dbus_connection_unregister_object_path (rawConnection, path); - - // Get the reference to this - IntPtr rawThis = dbus_connection_get_data (rawConnection, Slot); - Debug.Assert (rawThis != IntPtr.Zero); - - // Blank over the reference - dbus_connection_set_data (rawConnection, Slot, IntPtr.Zero, IntPtr.Zero); - - // Free the reference - ((GCHandle) rawThis).Free(); - - // Unref the connection - dbus_connection_unref(rawConnection); - } - - this.rawConnection = value; - - if (rawConnection != IntPtr.Zero) - { - GCHandle rawThis; - - dbus_connection_ref (rawConnection); - - // We store a weak reference to the C# object on the C object - rawThis = GCHandle.Alloc (this, GCHandleType.WeakTrackResurrection); - - dbus_connection_set_data(rawConnection, Slot, (IntPtr) rawThis, IntPtr.Zero); - - // Add the callbacks to this new connection - foreach (DBusHandleMessageFunction func in this.filters) - dbus_connection_add_filter (rawConnection, func, IntPtr.Zero, IntPtr.Zero); - - foreach (string match_rule in this.matches) - dbus_bus_add_match (rawConnection, match_rule, IntPtr.Zero); - - foreach (string path in this.object_paths.Keys) { - DBusObjectPathVTable vtable = (DBusObjectPathVTable) this.object_paths[path]; - dbus_connection_register_object_path (rawConnection, path, ref vtable, IntPtr.Zero); - } - } - else - { - this.filters.Clear (); - this.matches.Clear (); - this.object_paths.Clear (); - } - } - } - - [DllImport("dbus-glib-1")] - private extern static void dbus_connection_setup_with_g_main(IntPtr rawConnection, - IntPtr rawContext); - - [DllImport ("dbus-1")] - private extern static IntPtr dbus_connection_open (string address, ref Error error); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_unref (IntPtr ptr); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_ref (IntPtr ptr); - - [DllImport ("dbus-1")] - private extern static bool dbus_connection_allocate_data_slot (ref int slot); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_free_data_slot (ref int slot); - - [DllImport ("dbus-1")] - private extern static bool dbus_connection_set_data (IntPtr ptr, - int slot, - IntPtr data, - IntPtr free_data_func); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_flush (IntPtr ptr); - - [DllImport ("dbus-1")] - private extern static IntPtr dbus_connection_get_data (IntPtr ptr, - int slot); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_disconnect (IntPtr ptr); - - [DllImport ("dbus-1")] - private extern static IntPtr dbus_bus_get_unique_name (IntPtr ptr); - - [DllImport("dbus-1")] - private extern static bool dbus_connection_add_filter(IntPtr rawConnection, - DBusHandleMessageFunction filter, - IntPtr userData, - IntPtr freeData); - - [DllImport("dbus-1")] - private extern static void dbus_connection_remove_filter(IntPtr rawConnection, - DBusHandleMessageFunction filter, - IntPtr userData); - - [DllImport("dbus-1")] - private extern static void dbus_bus_add_match(IntPtr rawConnection, - string rule, - IntPtr erro); - - [DllImport("dbus-1")] - private extern static void dbus_bus_remove_match(IntPtr rawConnection, - string rule, - IntPtr erro); - - [DllImport ("dbus-1")] - private extern static bool dbus_connection_register_object_path (IntPtr rawConnection, - string path, - ref DBusObjectPathVTable vTable, - IntPtr userData); - - [DllImport ("dbus-1")] - private extern static void dbus_connection_unregister_object_path (IntPtr rawConnection, - string path); - - } -} diff --git a/mono/DBusException.cs b/mono/DBusException.cs deleted file mode 100644 index 5c912cca..00000000 --- a/mono/DBusException.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - - public class DBusException : ApplicationException - { - internal DBusException (Error error) : base (error.Message) { - error.Free(); - } - } -} diff --git a/mono/DBusType/Array.cs b/mono/DBusType/Array.cs deleted file mode 100644 index 3279b5aa..00000000 --- a/mono/DBusType/Array.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using System.Collections; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// Array. - /// - public class Array : IDBusType - { - public const char Code = 'a'; - private System.Array val; - private ArrayList elements; - private Type elementType; - private Service service = null; - - private Array() - { - } - - public Array(System.Array val, Service service) - { - this.val = val; - this.elementType = Arguments.MatchType(val.GetType().GetElementType()); - this.service = service; - } - - public Array(IntPtr iter, Service service) - { - this.service = service; - - IntPtr arrayIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize); - - int elementTypeCode = dbus_message_iter_get_element_type (iter); - dbus_message_iter_recurse (iter, arrayIter); - this.elementType = (Type) Arguments.DBusTypes [(char) elementTypeCode]; - - elements = new ArrayList (); - - if (dbus_message_iter_get_arg_type (arrayIter) != 0) { - do { - object [] pars = new Object[2]; - pars[0] = arrayIter; - pars[1] = service; - DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars); - elements.Add(dbusType); - } while (dbus_message_iter_next(arrayIter)); - } - - Marshal.FreeCoTaskMem(arrayIter); - } - - public string GetElementCodeAsString () - { - string ret = System.String.Empty; - Type t = val.GetType ().GetElementType (); - - while (true) { - ret += Arguments.GetCodeAsString (Arguments.MatchType(t)); - - if (t.IsArray) - t = t.GetElementType (); - else - break; - } - - return ret; - } - - public void Append(IntPtr iter) - { - IntPtr arrayIter = Marshal.AllocCoTaskMem (Arguments.DBusMessageIterSize); - - if (!dbus_message_iter_open_container (iter, - (int) Code, GetElementCodeAsString(), - arrayIter)) { - throw new ApplicationException("Failed to append array argument: " + val); - } - - foreach (object element in this.val) { - object [] pars = new Object[2]; - pars[0] = element; - pars[1] = this.service; - DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars); - dbusType.Append(arrayIter); - } - - if (!dbus_message_iter_close_container (iter, arrayIter)) { - throw new ApplicationException ("Failed to append array argument: " + val); - } - - Marshal.FreeCoTaskMem (arrayIter); - } - - public static bool Suits(System.Type type) - { - Type type2 = type.GetElementType (); - if (type.IsArray || (type2 != null && type2.IsArray)) { - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_Ref); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Castclass, type); - if (!isReturn) { - generator.Emit(OpCodes.Stind_Ref); - } - } - - public object Get() - { - throw new ArgumentException("Cannot call Get on an Array without specifying type."); - } - - public object Get(System.Type type) - { - if (type.IsArray) - type = type.GetElementType (); - - if (Arguments.Suits(elementType, type.UnderlyingSystemType)) { - this.val = System.Array.CreateInstance(type.UnderlyingSystemType, elements.Count); - int i = 0; - foreach (DBusType.IDBusType element in elements) { - this.val.SetValue(element.Get(type.UnderlyingSystemType), i++); - } - } else { - throw new ArgumentException("Cannot cast DBus.Type.Array to type '" + type.ToString() + "'"); - } - - return this.val; - } - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_open_container (IntPtr iter, - int containerType, - string elementType, - IntPtr subIter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_close_container (IntPtr iter, - IntPtr subIter); - - [DllImport("dbus-1")] - private extern static int dbus_message_iter_get_element_type(IntPtr iter); - - [DllImport("dbus-1")] - private extern static int dbus_message_iter_get_arg_type(IntPtr iter); - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_recurse(IntPtr iter, IntPtr subIter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_next(IntPtr iter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_has_next (IntPtr iter); - } -} diff --git a/mono/DBusType/Boolean.cs b/mono/DBusType/Boolean.cs deleted file mode 100644 index c561f0c5..00000000 --- a/mono/DBusType/Boolean.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// Boolean - /// - public class Boolean : IDBusType - { - public const char Code = 'b'; - private System.Boolean val; - - private Boolean() - { - } - - public Boolean(System.Boolean val, Service service) - { - this.val = val; - } - - public Boolean(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append BOOLEAN argument:" + val); - } - - public static bool Suits(System.Type type) - { - switch (type.ToString()) { - case "System.Boolean": - case "System.Boolean&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_I1); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_I1); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I1); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - switch (type.ToString()) { - case "System.Boolean": - case "System.Boolean&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.Boolean to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out bool value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref bool value); - } -} diff --git a/mono/DBusType/Byte.cs b/mono/DBusType/Byte.cs deleted file mode 100644 index 958f6832..00000000 --- a/mono/DBusType/Byte.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// Byte - /// - public class Byte : IDBusType - { - public const char Code = 'y'; - private System.Byte val; - - private Byte() - { - } - - public Byte(System.Byte val, Service service) - { - this.val = val; - } - - public Byte(System.Char val, Service service) - { - this.val = (byte) val; - } - - public Byte(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append BYTE argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.Byte)) { - return true; - } - - switch (type.ToString()) { - case "System.Byte": - case "System.Byte&": - case "System.Char": - case "System.Char&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_U1); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_U1); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I1); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) { - case "System.Byte": - case "System.Byte&": - return this.val; - case "System.Char": - case "System.Char&": - char charVal = (char) this.val; - return charVal; - default: - throw new ArgumentException("Cannot cast DBus.Type.Byte to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out byte value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref byte value); - } -} diff --git a/mono/DBusType/Dict.cs b/mono/DBusType/Dict.cs deleted file mode 100644 index 660cac57..00000000 --- a/mono/DBusType/Dict.cs +++ /dev/null @@ -1,148 +0,0 @@ -using System; -using System.Collections; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// Dict. - /// - public class Dict : IDBusType - { - public const char Code = 'm'; - private Hashtable val; - - private Dict() - { - } - - public Dict(IDictionary val, Service service) - { - this.val = new Hashtable(); - foreach (DictionaryEntry entry in val) { - this.val.Add(entry.Key, entry.Value); - } - } - - public Dict(IntPtr iter, Service service) - { - IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize); - - bool notEmpty = dbus_message_iter_init_dict_iterator(iter, dictIter); - - this.val = new Hashtable(); - - if (notEmpty) { - do { - string key = dbus_message_iter_get_dict_key(dictIter); - - // Get the argument type and get the value - Type elementType = (Type) DBus.Arguments.DBusTypes[(char) dbus_message_iter_get_arg_type(dictIter)]; - object [] pars = new Object[2]; - pars[0] = dictIter; - pars[1] = service; - DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars); - this.val.Add(key, dbusType); - } while (dbus_message_iter_next(dictIter)); - } - - Marshal.FreeCoTaskMem(dictIter); - } - - public void Append(IntPtr iter) - { - IntPtr dictIter = Marshal.AllocCoTaskMem(Arguments.DBusMessageIterSize); - - if (!dbus_message_iter_append_dict(iter, - dictIter)) { - throw new ApplicationException("Failed to append DICT argument:" + val); - } - - foreach (DictionaryEntry entry in this.val) { - if (!dbus_message_iter_append_dict_key(dictIter, (string) entry.Key)) { - throw new ApplicationException("Failed to append DICT key:" + entry.Key); - } - - // Get the element type - Type elementType = Arguments.MatchType(entry.Value.GetType()); - object [] pars = new Object[1]; - pars[0] = entry.Value; - DBusType.IDBusType dbusType = (DBusType.IDBusType) Activator.CreateInstance(elementType, pars); - dbusType.Append(dictIter); - } - - Marshal.FreeCoTaskMem(dictIter); - } - - public static bool Suits(System.Type type) - { - if (typeof(IDictionary).IsAssignableFrom(type)) { - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_Ref); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Castclass, type); - if (!isReturn) { - generator.Emit(OpCodes.Stind_Ref); - } - } - - public object Get() - { - return Get(typeof(Hashtable)); - } - - public object Get(System.Type type) - { - IDictionary retVal; - - if (Suits(type)) { - retVal = (IDictionary) Activator.CreateInstance(type, new object[0]); - foreach (DictionaryEntry entry in this.val) { - retVal.Add(entry.Key, ((IDBusType) entry.Value).Get()); - } - } else { - throw new ArgumentException("Cannot cast DBus.Type.Dict to type '" + type.ToString() + "'"); - } - - return retVal; - } - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_init_dict_iterator(IntPtr iter, - IntPtr dictIter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_dict(IntPtr iter, - IntPtr dictIter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_has_next(IntPtr iter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_next(IntPtr iter); - - [DllImport("dbus-1")] - private extern static string dbus_message_iter_get_dict_key (IntPtr dictIter); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_dict_key (IntPtr dictIter, - string value); - [DllImport("dbus-1")] - private extern static int dbus_message_iter_get_arg_type(IntPtr iter); - } -} diff --git a/mono/DBusType/Double.cs b/mono/DBusType/Double.cs deleted file mode 100644 index c8975cdc..00000000 --- a/mono/DBusType/Double.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// IEEE 754 double - /// - public class Double : IDBusType - { - public const char Code = 'd'; - private System.Double val; - - private Double() - { - } - - public Double(System.Double val, Service service) - { - this.val = val; - } - - public Double(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append DOUBLE argument:" + val); - } - - public static bool Suits(System.Type type) - { - switch (type.ToString()) { - case "System.Double": - case "System.Double&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_R8); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_R8); - if (!isReturn) { - generator.Emit(OpCodes.Stind_R8); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - switch (type.ToString()) { - case "System.Double": - case "System.Double&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.Double to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out double value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref double value); - } -} diff --git a/mono/DBusType/IDBusType.cs b/mono/DBusType/IDBusType.cs deleted file mode 100644 index 447c8208..00000000 --- a/mono/DBusType/IDBusType.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace DBus.DBusType -{ - /// - /// Base class for DBusTypes - /// - public interface IDBusType - { - object Get(); - - object Get(System.Type type); - - void Append(IntPtr iter); - } -} diff --git a/mono/DBusType/Int16.cs b/mono/DBusType/Int16.cs deleted file mode 100644 index cd99e19e..00000000 --- a/mono/DBusType/Int16.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// 16-bit integer. - /// - public class Int16 : IDBusType - { - public const char Code = 'n'; - private System.Int16 val; - - private Int16() - { - } - - public Int16(System.Int16 val, Service service) - { - this.val = val; - } - - public Int16(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append INT16 argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.Int16)) { - return true; - } - - switch (type.ToString()) { - case "System.Int16": - case "System.Int16&": - return true; } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_I2); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_I2); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I2); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) { - case "System.Int16": - case "System.Int16&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.Int16 to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out System.Int16 value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref System.Int16 value); - } -} diff --git a/mono/DBusType/Int32.cs b/mono/DBusType/Int32.cs deleted file mode 100644 index 868d4335..00000000 --- a/mono/DBusType/Int32.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// 32-bit integer. - /// - public class Int32 : IDBusType - { - public const char Code = 'i'; - private System.Int32 val; - - private Int32() - { - } - - public Int32(System.Int32 val, Service service) - { - this.val = val; - } - - public Int32(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append INT32 argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.Int32)) { - return true; - } - - switch (type.ToString()) { - case "System.Int32": - case "System.Int32&": - return true; } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_I4); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_I4); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I4); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) { - case "System.Int32": - case "System.Int32&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.Int32 to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out System.Int32 value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref System.Int32 value); - } -} diff --git a/mono/DBusType/Int64.cs b/mono/DBusType/Int64.cs deleted file mode 100644 index 47c066bc..00000000 --- a/mono/DBusType/Int64.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// 64-bit integer. - /// - public class Int64 : IDBusType - { - public const char Code = 'x'; - private System.Int64 val; - - private Int64() - { - } - - public Int64(System.Int64 val, Service service) - { - this.val = val; - } - - public Int64(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append INT64 argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.Int64)) { - return true; - } - - switch (type.ToString()) { - case "System.Int64": - case "System.Int64&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_I8); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_I8); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I8); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) { - case "System.Int64": - case "System.Int64&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.Int64 to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out System.Int64 value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref System.Int64 value); - } -} diff --git a/mono/DBusType/ObjectPath.cs b/mono/DBusType/ObjectPath.cs deleted file mode 100644 index 4f064d59..00000000 --- a/mono/DBusType/ObjectPath.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// An object path. - /// - public class ObjectPath : IDBusType - { - public const char Code = 'o'; - private string path = null; - private object val = null; - private Service service = null; - - private ObjectPath() - { - } - - public ObjectPath(object val, Service service) - { - this.val = val; - this.service = service; - } - - public ObjectPath(IntPtr iter, Service service) - { - IntPtr raw; - - dbus_message_iter_get_basic (iter, out raw); - - this.path = Marshal.PtrToStringAnsi (raw); - this.service = service; - } - - private string Path - { - get { - if (this.path == null && this.val != null) { - Handler handler = this.service.GetHandler(this.val); - this.path = handler.Path; - } - - return this.path; - } - } - - public void Append(IntPtr iter) - { - IntPtr marshalVal = Marshal.StringToHGlobalAnsi (Path); - - bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal); - Marshal.FreeHGlobal (marshalVal); - - if (!success) - throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val); - } - - public static bool Suits(System.Type type) - { - object[] attributes = type.GetCustomAttributes(typeof(InterfaceAttribute), false); - if (attributes.Length == 1) { - return true; - } else { - return false; - } - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_Ref); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Castclass, type); - if (!isReturn) { - generator.Emit(OpCodes.Stind_Ref); - } - } - - public object Get() - { - throw new ArgumentException("Cannot call Get on an ObjectPath without specifying type."); - } - - public object Get(System.Type type) - { - try { - return this.service.GetObject(type, Path); - } catch(Exception ex) { - throw new ArgumentException("Cannot cast object pointed to by Object Path to type '" + type.ToString() + "': " + ex); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out IntPtr path); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref IntPtr path); - } -} diff --git a/mono/DBusType/String.cs b/mono/DBusType/String.cs deleted file mode 100644 index 3b619cfb..00000000 --- a/mono/DBusType/String.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// A string. - /// - public class String : IDBusType - { - public const char Code = 's'; - private string val; - - private String() - { - } - - public String(string val, Service service) - { - this.val = val; - } - - public String(IntPtr iter, Service service) - { - IntPtr raw; - - dbus_message_iter_get_basic (iter, out raw); - - this.val = Marshal.PtrToStringAnsi (raw); - } - - public void Append(IntPtr iter) - { - IntPtr marshalVal = Marshal.StringToHGlobalAnsi (val); - - bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal); - Marshal.FreeHGlobal (marshalVal); - - if (!success) - throw new ApplicationException("Failed to append STRING argument:" + val); - } - - public static bool Suits(System.Type type) - { - switch (type.ToString()) { - case "System.String": - case "System.String&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_Ref); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Castclass, type); - if (!isReturn) { - generator.Emit(OpCodes.Stind_Ref); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - switch (type.ToString()) - { - case "System.String": - case "System.String&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.String to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out IntPtr value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref IntPtr value); - } -} diff --git a/mono/DBusType/UInt16.cs b/mono/DBusType/UInt16.cs deleted file mode 100644 index 73132875..00000000 --- a/mono/DBusType/UInt16.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// 16-bit integer. - /// - public class UInt16 : IDBusType - { - public const char Code = 'q'; - private System.UInt16 val; - - private UInt16() - { - } - - public UInt16(System.UInt16 val, Service service) - { - this.val = val; - } - - public UInt16(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append INT16 argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.UInt16)) { - return true; - } - - switch (type.ToString()) { - case "System.UInt16": - case "System.UInt16&": - return true; } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_U2); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_U2); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I2); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) { - case "System.UInt16": - case "System.UInt16&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.UInt16 to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out System.UInt16 value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref System.UInt16 value); - } -} diff --git a/mono/DBusType/UInt32.cs b/mono/DBusType/UInt32.cs deleted file mode 100644 index 5bb31217..00000000 --- a/mono/DBusType/UInt32.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// 32-bit unsigned integer. - /// - public class UInt32 : IDBusType - { - public const char Code = 'u'; - private System.UInt32 val; - - private UInt32() - { - } - - public UInt32(System.UInt32 val, Service service) - { - this.val = val; - } - - public UInt32(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append UINT32 argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.UInt32)) { - return true; - } - - switch (type.ToString()) { - case "System.UInt32": - case "System.UInt32&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_U4); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_U4); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I4); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) - { - case "System.UInt32": - case "System.UInt32&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.UInt32 to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out System.UInt32 value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref System.UInt32 value); - } -} diff --git a/mono/DBusType/UInt64.cs b/mono/DBusType/UInt64.cs deleted file mode 100644 index ef689f2a..00000000 --- a/mono/DBusType/UInt64.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Reflection.Emit; - -using DBus; - -namespace DBus.DBusType -{ - /// - /// 64-bit unsigned integer. - /// - public class UInt64 : IDBusType - { - public const char Code = 't'; - private System.UInt64 val; - - private UInt64() - { - } - - public UInt64(System.UInt64 val, Service service) - { - this.val = val; - } - - public UInt64(IntPtr iter, Service service) - { - dbus_message_iter_get_basic (iter, out this.val); - } - - public void Append(IntPtr iter) - { - if (!dbus_message_iter_append_basic (iter, (int) Code, ref val)) - throw new ApplicationException("Failed to append UINT64 argument:" + val); - } - - public static bool Suits(System.Type type) - { - if (type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.UInt64)) { - return true; - } - - switch (type.ToString()) { - case "System.UInt64": - case "System.UInt64&": - return true; - } - - return false; - } - - public static void EmitMarshalIn(ILGenerator generator, Type type) - { - if (type.IsByRef) { - generator.Emit(OpCodes.Ldind_I8); - } - } - - public static void EmitMarshalOut(ILGenerator generator, Type type, bool isReturn) - { - generator.Emit(OpCodes.Unbox, type); - generator.Emit(OpCodes.Ldind_I8); - if (!isReturn) { - generator.Emit(OpCodes.Stind_I8); - } - } - - public object Get() - { - return this.val; - } - - public object Get(System.Type type) - { - if (type.IsEnum) { - return Enum.ToObject(type, this.val); - } - - switch (type.ToString()) - { - case "System.UInt64": - case "System.UInt64&": - return this.val; - default: - throw new ArgumentException("Cannot cast DBus.Type.UInt64 to type '" + type.ToString() + "'"); - } - } - - [DllImport("dbus-1")] - private extern static void dbus_message_iter_get_basic (IntPtr iter, out System.UInt64 value); - - [DllImport("dbus-1")] - private extern static bool dbus_message_iter_append_basic (IntPtr iter, int type, ref System.UInt64 value); - } -} diff --git a/mono/Error.cs b/mono/Error.cs deleted file mode 100644 index d89a013a..00000000 --- a/mono/Error.cs +++ /dev/null @@ -1,60 +0,0 @@ -namespace DBus -{ - - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - // FIXME add code to verify that size of DBus.Error - // matches the C code. - - [StructLayout (LayoutKind.Sequential)] - internal struct Error - { - internal IntPtr name; - internal IntPtr message; - private int dummies; - private IntPtr padding1; - - public void Init() - { - dbus_error_init(ref this); - } - - public void Free() - { - dbus_error_free(ref this); - } - - public string Message - { - get - { - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(message); - } - } - - public string Name - { - get - { - return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(name); - } - } - - public bool IsSet - { - get - { - return (name != IntPtr.Zero); - } - } - - - [DllImport ("dbus-1", EntryPoint="dbus_error_init")] - private extern static void dbus_error_init (ref Error error); - - [DllImport ("dbus-1", EntryPoint="dbus_error_free")] - private extern static void dbus_error_free (ref Error error); - } -} diff --git a/mono/ErrorMessage.cs b/mono/ErrorMessage.cs deleted file mode 100644 index 773a05b6..00000000 --- a/mono/ErrorMessage.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class ErrorMessage : Message - { - public ErrorMessage() : base(MessageType.Error) - { - } - - internal ErrorMessage(IntPtr rawMessage, Service service) : base(rawMessage, service) - { - } - - public ErrorMessage(Service service) : base(MessageType.Error, service) - { - } - - public new string Name - { - get { - if (this.name == null) { - this.name = Marshal.PtrToStringAnsi(dbus_message_get_error_name(RawMessage)); - } - - return this.name; - } - - set { - if (value != this.name) { - dbus_message_set_error_name(RawMessage, value); - this.name = value; - } - } - } - - [DllImport("dbus-1")] - private extern static bool dbus_message_set_error_name(IntPtr rawMessage, string name); - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_get_error_name(IntPtr rawMessage); - } -} diff --git a/mono/Handler.cs b/mono/Handler.cs deleted file mode 100644 index 87092f90..00000000 --- a/mono/Handler.cs +++ /dev/null @@ -1,172 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - using System.Reflection; - using System.Collections; - - internal enum Result - { - Handled = 0, - NotYetHandled = 1, - NeedMemory = 2 - } - - internal class Handler - { - private string path = null; - private Introspector introspector = null; - private object handledObject = null; - private DBusObjectPathVTable vTable; - private Connection connection; - private Service service; - - // We need to hold extra references to these callbacks so that they don't - // get garbage collected before they are called back into from unmanaged - // code. - private DBusObjectPathUnregisterFunction unregister_func; - private DBusObjectPathMessageFunction message_func; - - public Handler(object handledObject, - string path, - Service service) - { - Service = service; - Connection = service.Connection; - HandledObject = handledObject; - this.path = path; - - // Create the vTable and register the path - this.unregister_func = new DBusObjectPathUnregisterFunction (Unregister_Called); - this.message_func = new DBusObjectPathMessageFunction (Message_Called); - - vTable = new DBusObjectPathVTable (this.unregister_func, this.message_func); - Connection.RegisterObjectPath (Path, vTable); - RegisterSignalHandlers(); - } - - private void RegisterSignalHandlers() - { - ProxyBuilder proxyBuilder = new ProxyBuilder(Service, HandledObject.GetType(), Path); - - foreach (DictionaryEntry interfaceEntry in this.introspector.InterfaceProxies) { - InterfaceProxy interfaceProxy = (InterfaceProxy) interfaceEntry.Value; - foreach (DictionaryEntry signalEntry in interfaceProxy.Signals) { - EventInfo eventE = (EventInfo) signalEntry.Value; - Delegate del = Delegate.CreateDelegate(eventE.EventHandlerType, proxyBuilder.GetSignalProxy(), "Proxy_" + eventE.Name); - eventE.AddEventHandler(HandledObject, del); - } - } - } - - public object HandledObject - { - get { - return this.handledObject; - } - - set { - this.handledObject = value; - - // Register the methods - this.introspector = Introspector.GetIntrospector(value.GetType()); - } - } - - public void Unregister_Called(IntPtr rawConnection, - IntPtr userData) - { - if (service != null) { - service.UnregisterObject(HandledObject); - } - - path = null; - } - - private int Message_Called(IntPtr rawConnection, - IntPtr rawMessage, - IntPtr userData) - { - Message message = Message.Wrap(rawMessage, Service); - Result res = Result.NotYetHandled; - - switch (message.Type) { - case Message.MessageType.MethodCall: - res = HandleMethod ((MethodCall) message); - break; - - case Message.MessageType.Signal: - // We're not interested in signals here because we're the ones - // that generate them! - break; - } - - message.Dispose (); - - return (int) res; - } - - private Result HandleMethod(MethodCall methodCall) - { - methodCall.Service = service; - - InterfaceProxy interfaceProxy = this.introspector.GetInterface(methodCall.InterfaceName); - if (interfaceProxy == null || !interfaceProxy.HasMethod(methodCall.Key)) { - // No such interface here. - return Result.NotYetHandled; - } - - MethodInfo method = interfaceProxy.GetMethod(methodCall.Key); - - Message.Push (methodCall); - - // Now call the method. FIXME: Error handling - object [] args = methodCall.Arguments.GetParameters(method); - object retVal = method.Invoke(this.handledObject, args); - - Message.Pop (); - - // Create the reply and send it - MethodReturn methodReturn = new MethodReturn(methodCall); - methodReturn.Arguments.AppendResults(method, retVal, args); - methodReturn.Send(); - - return Result.Handled; - } - - internal string Path - { - get - { - return path; - } - } - - internal Connection Connection - { - get - { - return connection; - } - - set - { - this.connection = value; - } - } - - public Service Service - { - get - { - return service; - } - - set - { - this.service = value; - } - } - } -} diff --git a/mono/InterfaceAttribute.cs b/mono/InterfaceAttribute.cs deleted file mode 100644 index 2a6e9bb0..00000000 --- a/mono/InterfaceAttribute.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace DBus -{ - [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)] - public class InterfaceAttribute : Attribute - { - private string interfaceName; - - public InterfaceAttribute(string interfaceName) - { - this.interfaceName = interfaceName; - } - - public string InterfaceName - { - get - { - return this.interfaceName; - } - } - } -} diff --git a/mono/InterfaceProxy.cs b/mono/InterfaceProxy.cs deleted file mode 100644 index 50697738..00000000 --- a/mono/InterfaceProxy.cs +++ /dev/null @@ -1,121 +0,0 @@ -namespace DBus -{ - using System; - using System.Collections; - using System.Reflection; - - internal class InterfaceProxy - { - private static Hashtable interfaceProxies = new Hashtable(); - private Hashtable methods = null; - private Hashtable signals = null; - - private string interfaceName; - - private InterfaceProxy(Type type) - { - object[] attributes = type.GetCustomAttributes(typeof(InterfaceAttribute), true); - InterfaceAttribute interfaceAttribute = (InterfaceAttribute) attributes[0]; - this.interfaceName = interfaceAttribute.InterfaceName; - AddMethods(type); - AddSignals(type); - } - - // Add all the events with Signal attributes - private void AddSignals(Type type) - { - this.signals = new Hashtable(); - foreach (EventInfo signal in type.GetEvents(BindingFlags.Public | - BindingFlags.Instance | - BindingFlags.DeclaredOnly)) { - object[] attributes = signal.GetCustomAttributes(typeof(SignalAttribute), false); - if (attributes.GetLength(0) > 0) { - MethodInfo invoke = signal.EventHandlerType.GetMethod("Invoke"); - signals.Add(signal.Name + " " + GetSignature(invoke), signal); - } - } - } - - // Add all the methods with Method attributes - private void AddMethods(Type type) - { - this.methods = new Hashtable(); - foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | - BindingFlags.Instance | - BindingFlags.DeclaredOnly)) { - object[] attributes = method.GetCustomAttributes(typeof(MethodAttribute), false); - if (attributes.GetLength(0) > 0) { - methods.Add(method.Name + " " + GetSignature(method), method); - } - } - } - - - public static InterfaceProxy GetInterface(Type type) - { - if (!interfaceProxies.Contains(type)) { - interfaceProxies[type] = new InterfaceProxy(type); - } - - return (InterfaceProxy) interfaceProxies[type]; - } - - public bool HasMethod(string key) - { - return this.Methods.Contains(key); - } - - public bool HasSignal(string key) - { - return this.Signals.Contains(key); - } - - public EventInfo GetSignal(string key) - { - return (EventInfo) this.Signals[key]; - } - - public MethodInfo GetMethod(string key) - { - return (MethodInfo) this.Methods[key]; - } - - public static string GetSignature(MethodInfo method) - { - ParameterInfo[] pars = method.GetParameters(); - string key = ""; - - foreach (ParameterInfo par in pars) { - if (!par.IsOut) { - Type dbusType = Arguments.MatchType(par.ParameterType); - key += Arguments.GetCode(dbusType); - } - } - - return key; - } - - public Hashtable Methods - { - get { - return this.methods; - } - } - - public Hashtable Signals - { - get { - return this.signals; - } - } - - public string InterfaceName - { - get { - return this.interfaceName; - } - } - } -} - - diff --git a/mono/Introspector.cs b/mono/Introspector.cs deleted file mode 100644 index 8e97abc6..00000000 --- a/mono/Introspector.cs +++ /dev/null @@ -1,81 +0,0 @@ -namespace DBus -{ - - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - using System.Collections; - using System.Reflection; - - internal class Introspector - { - private Type type; - private static Hashtable introspectors = new Hashtable(); - private Hashtable interfaceProxies = null; - - public static Introspector GetIntrospector(Type type) - { - if (!introspectors.Contains(type)) { - introspectors[type] = new Introspector(type); - } - - return (Introspector) introspectors[type]; - } - - private Introspector(Type type) - { - interfaceProxies = new Hashtable(); - AddType(type); - this.type = type; - } - - private void AddType(Type type) - { - if (type == typeof(object)) { - // Base case - return; - } - - object[] attributes = type.GetCustomAttributes(typeof(InterfaceAttribute), false); - if (attributes.Length >= 1) { - // This is a D-BUS interface so add it to the hashtable - InterfaceProxy interfaceProxy = InterfaceProxy.GetInterface(type); - interfaceProxies.Add(interfaceProxy.InterfaceName, interfaceProxy); - } - - AddType(type.BaseType); - } - - public InterfaceProxy GetInterface(string interfaceName) { - if (interfaceProxies.Contains(interfaceName)) { - return (InterfaceProxy) interfaceProxies[interfaceName]; - } else { - return null; - } - } - - public Hashtable InterfaceProxies - { - get { - return this.interfaceProxies; - } - } - - public ConstructorInfo Constructor - { - get { - ConstructorInfo ret = this.type.GetConstructor(new Type[0]); - if (ret != null) { - return ret; - } else { - return typeof(object).GetConstructor(new Type[0]); - } - } - } - - public override string ToString() - { - return this.type.ToString(); - } - } -} diff --git a/mono/Makefile.am b/mono/Makefile.am deleted file mode 100644 index 239a3869..00000000 --- a/mono/Makefile.am +++ /dev/null @@ -1,76 +0,0 @@ -SUBDIRS=. doc example - -TARGET=$(ASSEMBLY) -NOINST_EXES=test-dbus-sharp.exe -ASSEMBLY_NAME=dbus-sharp -GACUTIL=gacutil - -DBUS_SHARP_FILES= \ - $(srcdir)/Arguments.cs \ - $(srcdir)/Bus.cs \ - $(srcdir)/BusDriver.cs \ - $(srcdir)/Connection.cs \ - $(srcdir)/DBusException.cs \ - $(srcdir)/Error.cs \ - $(srcdir)/ErrorMessage.cs \ - $(srcdir)/Handler.cs \ - $(srcdir)/InterfaceAttribute.cs \ - $(srcdir)/InterfaceProxy.cs \ - $(srcdir)/Introspector.cs \ - $(srcdir)/Message.cs \ - $(srcdir)/MethodAttribute.cs \ - $(srcdir)/MethodCall.cs \ - $(srcdir)/MethodReturn.cs \ - $(srcdir)/ProxyBuilder.cs \ - $(srcdir)/Server.cs \ - $(srcdir)/Service.cs \ - $(srcdir)/Signal.cs \ - $(srcdir)/SignalAttribute.cs \ - $(srcdir)/DBusType/IDBusType.cs \ - $(srcdir)/DBusType/Array.cs \ - $(srcdir)/DBusType/Boolean.cs \ - $(srcdir)/DBusType/Byte.cs \ - $(srcdir)/DBusType/Double.cs \ - $(srcdir)/DBusType/Int16.cs \ - $(srcdir)/DBusType/Int32.cs \ - $(srcdir)/DBusType/Int64.cs \ - $(srcdir)/DBusType/ObjectPath.cs \ - $(srcdir)/DBusType/String.cs \ - $(srcdir)/DBusType/UInt16.cs \ - $(srcdir)/DBusType/UInt32.cs \ - $(srcdir)/DBusType/UInt64.cs - -TEST_DBUS_SHARP_FILES=Test.cs - -ASSEMBLY=$(ASSEMBLY_NAME).dll - -DISTCLEANFILES=AssemblyInfo.cs $(ASSEMBLY).config $(ASSEMBLY) $(ASSEMBLY).mdb - -all-am: $(TARGET) - -dbus-sharp.dll: $(DBUS_SHARP_FILES) - $(CSC) --debug --unsafe --target library -o dbus-sharp.dll $(DBUS_SHARP_FILES) AssemblyInfo.cs - -test-dbus-sharp.exe: $(TEST_DBUS_SHARP_FILES) - $(CSC) --debug --unsafe --target exe -L . -r dbus-sharp.dll -pkg:gtk-sharp -o test-dbus-sharp.exe $(TEST_DBUS_SHARP_FILES) - -clean: - rm -f $(TARGET) $(TARGET).mdb $(NOINST_EXES) $(NOINST_EXES:%=%.mdb) - -install-data-local: - @if test -n '$(TARGET)'; then \ - echo "$(GACUTIL) /i $(ASSEMBLY) /f /package dbus-sharp /gacdir $(DESTDIR)$(libdir)"; \ - $(GACUTIL) /i $(ASSEMBLY) /f /package dbus-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir) || exit 1; \ - fi - -uninstall-local: - @if test -n '$(TARGET)'; then \ - echo "$(GACUTIL) /u $(ASSEMBLY_NAME) /package dbus-sharp /gacdir $(DESTDIR)$(libdir)"; \ - $(GACUTIL) /u $(ASSEMBLY_NAME) /package dbus-sharp /gacdir $(libdir) /root $(DESTDIR)$(libdir) || exit 1; \ - fi - -EXTRA_DIST= \ - $(DBUS_SHARP_FILES) \ - AssemblyInfo.cs.in \ - $(ASSEMBLY).config.in \ - dbus-sharp.snk diff --git a/mono/Message.cs b/mono/Message.cs deleted file mode 100644 index f9556b5d..00000000 --- a/mono/Message.cs +++ /dev/null @@ -1,437 +0,0 @@ -namespace DBus -{ - - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - using System.Collections; - - public class Message : IDisposable - { - private static Stack stack = new Stack (); - - static public Message Current { - get - { - return stack.Count > 0 ? (Message) stack.Peek () : null; - } - } - - static internal void Push (Message message) - { - stack.Push (message); - } - - static internal void Pop () - { - stack.Pop (); - } - - - /// - /// A pointer to the underlying Message structure - /// - private IntPtr rawMessage; - - /// - /// The current slot number - /// - private static int slot = -1; - - // Keep in sync with C - public enum MessageType - { - Invalid = 0, - MethodCall = 1, - MethodReturn = 2, - Error = 3, - Signal = 4 - } - - private Arguments arguments = null; - - protected Service service = null; - protected string pathName = null; - protected string interfaceName = null; - protected string name = null; - private string key= null; - - protected Message() - { - // An empty constructor for the sake of sub-classes which know how to construct theirselves. - } - - protected Message(IntPtr rawMessage, Service service) - { - RawMessage = rawMessage; - this.service = service; - } - - protected Message(MessageType messageType) - { - // the assignment bumps the refcount - RawMessage = dbus_message_new((int) messageType); - - if (RawMessage == IntPtr.Zero) { - throw new OutOfMemoryException(); - } - - dbus_message_unref(RawMessage); - } - - protected Message(MessageType messageType, Service service) : this(messageType) - { - this.service = service; - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - public void Dispose (bool disposing) - { - if (disposing) { - if (this.arguments != null) - this.arguments.Dispose (); - } - - RawMessage = IntPtr.Zero; // free the native object - } - - ~Message() - { - Dispose (false); - } - - public static Message Wrap(IntPtr rawMessage, Service service) - { - if (slot > -1) { - // If we already have a Message object associated with this rawMessage then return it - IntPtr rawThis = dbus_message_get_data(rawMessage, slot); - if (rawThis != IntPtr.Zero && ((GCHandle)rawThis).Target == typeof(DBus.Message)) - return (DBus.Message) ((GCHandle)rawThis).Target; - } - // If it doesn't exist then create a new Message around it - Message message = null; - MessageType messageType = (MessageType) dbus_message_get_type(rawMessage); - - switch (messageType) { - case MessageType.Signal: - message = new Signal(rawMessage, service); - break; - case MessageType.MethodCall: - message = new MethodCall(rawMessage, service); - break; - case MessageType.MethodReturn: - message = new MethodReturn(rawMessage, service); - break; - case MessageType.Error: - message = new ErrorMessage(rawMessage, service); - break; - default: - throw new ApplicationException("Unknown message type to wrap: " + messageType); - } - - return message; - } - - internal IntPtr RawMessage - { - get - { - return rawMessage; - } - set - { - if (value == rawMessage) - return; - - if (rawMessage != IntPtr.Zero) - { - // Get the reference to this - IntPtr rawThis = dbus_message_get_data(rawMessage, Slot); - Debug.Assert (rawThis != IntPtr.Zero); - - // Blank over the reference - dbus_message_set_data(rawMessage, Slot, IntPtr.Zero, IntPtr.Zero); - - // Free the reference - ((GCHandle) rawThis).Free(); - - // Unref the connection - dbus_message_unref(rawMessage); - } - - this.rawMessage = value; - - if (rawMessage != IntPtr.Zero) - { - GCHandle rawThis; - - dbus_message_ref(rawMessage); - - // We store a weak reference to the C# object on the C object - rawThis = GCHandle.Alloc(this, GCHandleType.WeakTrackResurrection); - - dbus_message_set_data(rawMessage, Slot, (IntPtr) rawThis, IntPtr.Zero); - } - } - } - - public void Send(ref int serial) - { - if (!dbus_connection_send (Service.Connection.RawConnection, RawMessage, ref serial)) - throw new OutOfMemoryException (); - - Service.Connection.Flush(); - } - - public void Send() - { - int ignored = 0; - Send(ref ignored); - } - - public void SendWithReply() - { - IntPtr rawPendingCall = IntPtr.Zero; - - if (!dbus_connection_send_with_reply (Service.Connection.RawConnection, RawMessage, rawPendingCall, Service.Connection.Timeout)) - throw new OutOfMemoryException(); - } - - public MethodReturn SendWithReplyAndBlock() - { - Error error = new Error(); - error.Init(); - - IntPtr rawMessage = dbus_connection_send_with_reply_and_block(Service.Connection.RawConnection, - RawMessage, - Service.Connection.Timeout, - ref error); - - if (rawMessage != IntPtr.Zero) { - MethodReturn methodReturn = new MethodReturn(rawMessage, Service); - // Ownership of a ref is passed onto us from - // dbus_connection_send_with_reply_and_block(). It gets reffed as - // a result of being passed into the MethodReturn ctor, so unref - // the extra one here. - dbus_message_unref (rawMessage); - - return methodReturn; - } else { - throw new DBusException(error); - } - } - - public MessageType Type - { - get - { - return (MessageType) dbus_message_get_type(RawMessage); - } - } - - public Service Service - { - set - { - if (this.service != null && (value.Name != this.service.Name)) { - if (!dbus_message_set_destination(RawMessage, value.Name)) { - throw new OutOfMemoryException(); - } - } - - this.service = value; - } - get - { - return this.service; - } - } - - protected virtual string PathName - { - set - { - if (value != this.pathName) - { - if (!dbus_message_set_path(RawMessage, value)) { - throw new OutOfMemoryException(); - } - - this.pathName = value; - } - } - get - { - if (this.pathName == null) { - this.pathName = Marshal.PtrToStringAnsi(dbus_message_get_path(RawMessage)); - } - - return this.pathName; - } - } - - protected virtual string InterfaceName - { - set - { - if (value != this.interfaceName) - { - dbus_message_set_interface (RawMessage, value); - this.interfaceName = value; - } - } - get - { - if (this.interfaceName == null) { - this.interfaceName = Marshal.PtrToStringAnsi(dbus_message_get_interface(RawMessage)); - } - - return this.interfaceName; - } - } - - protected virtual string Name - { - set { - if (value != this.name) { - dbus_message_set_member(RawMessage, value); - this.name = value; - } - } - get { - if (this.name == null) { - this.name = Marshal.PtrToStringAnsi(dbus_message_get_member(RawMessage)); - } - - return this.name; - } - } - - public string Key - { - get { - if (this.key == null) { - this.key = Name + " " + Arguments; - } - - return this.key; - } - } - - public Arguments Arguments - { - get - { - if (this.arguments == null) { - this.arguments = new Arguments(this); - } - - return this.arguments; - } - } - - public string Sender - { - get - { - return Marshal.PtrToStringAnsi(dbus_message_get_sender(RawMessage)); - } - } - - public string Destination - { - get - { - return Marshal.PtrToStringAnsi(dbus_message_get_destination(RawMessage)); - } - } - - protected int Slot - { - get - { - if (slot == -1) - { - // We need to initialize the slot - if (!dbus_message_allocate_data_slot (ref slot)) - throw new OutOfMemoryException (); - - Debug.Assert (slot >= 0); - } - - return slot; - } - } - - [DllImport ("dbus-1", EntryPoint="dbus_message_new")] - protected extern static IntPtr dbus_message_new (int messageType); - - [DllImport ("dbus-1", EntryPoint="dbus_message_unref")] - protected extern static void dbus_message_unref (IntPtr ptr); - - [DllImport ("dbus-1", EntryPoint="dbus_message_ref")] - protected extern static void dbus_message_ref (IntPtr ptr); - - [DllImport ("dbus-1", EntryPoint="dbus_message_allocate_data_slot")] - protected extern static bool dbus_message_allocate_data_slot (ref int slot); - - [DllImport ("dbus-1", EntryPoint="dbus_message_free_data_slot")] - protected extern static void dbus_message_free_data_slot (ref int slot); - - [DllImport ("dbus-1", EntryPoint="dbus_message_set_data")] - protected extern static bool dbus_message_set_data (IntPtr ptr, - int slot, - IntPtr data, - IntPtr free_data_func); - - [DllImport ("dbus-1", EntryPoint="dbus_message_get_data")] - protected extern static IntPtr dbus_message_get_data (IntPtr ptr, - int slot); - - [DllImport ("dbus-1", EntryPoint="dbus_connection_send")] - private extern static bool dbus_connection_send (IntPtr ptr, - IntPtr message, - ref int client_serial); - - [DllImport ("dbus-1", EntryPoint="dbus_connection_send_with_reply")] - private extern static bool dbus_connection_send_with_reply (IntPtr rawConnection, IntPtr rawMessage, IntPtr rawPendingCall, int timeout); - - [DllImport ("dbus-1", EntryPoint="dbus_connection_send_with_reply_and_block")] - private extern static IntPtr dbus_connection_send_with_reply_and_block (IntPtr rawConnection, IntPtr message, int timeout, ref Error error); - - [DllImport("dbus-1")] - private extern static int dbus_message_get_type(IntPtr rawMessage); - - [DllImport("dbus-1")] - private extern static bool dbus_message_set_path(IntPtr rawMessage, string pathName); - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_get_path(IntPtr rawMessage); - - [DllImport("dbus-1")] - private extern static bool dbus_message_set_interface (IntPtr rawMessage, string interfaceName); - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_get_interface(IntPtr rawMessage); - - [DllImport("dbus-1")] - private extern static bool dbus_message_set_member(IntPtr rawMessage, string name); - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_get_member(IntPtr rawMessage); - - [DllImport("dbus-1")] - private extern static bool dbus_message_set_destination(IntPtr rawMessage, string serviceName); - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_get_destination(IntPtr rawMessage); - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_get_sender(IntPtr rawMessage); - } -} diff --git a/mono/MethodAttribute.cs b/mono/MethodAttribute.cs deleted file mode 100644 index db5da24e..00000000 --- a/mono/MethodAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace DBus -{ - [AttributeUsage(AttributeTargets.Method, AllowMultiple=false, Inherited=true)] - public class MethodAttribute : Attribute - { - public MethodAttribute() - { - } - } -} diff --git a/mono/MethodCall.cs b/mono/MethodCall.cs deleted file mode 100644 index ab7a4a36..00000000 --- a/mono/MethodCall.cs +++ /dev/null @@ -1,80 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class MethodCall : Message - { - public MethodCall() : base(MessageType.MethodCall) - { - } - - internal MethodCall(IntPtr rawMessage, Service service) : base(rawMessage, service) - { - } - - public MethodCall(Service service) : base(MessageType.MethodCall, service) - { - } - - public MethodCall(Service service, string pathName, string interfaceName, string name) - { - this.service = service; - - RawMessage = dbus_message_new_method_call(service.Name, pathName, interfaceName, name); - - if (RawMessage == IntPtr.Zero) { - throw new OutOfMemoryException(); - } - - this.pathName = pathName; - this.interfaceName = interfaceName; - this.name = name; - - dbus_message_unref(RawMessage); - } - - public new string PathName - { - get - { - return base.PathName; - } - - set - { - base.PathName = value; - } - } - - public new string InterfaceName - { - get - { - return base.InterfaceName; - } - - set - { - base.InterfaceName = value; - } - } - - public new string Name - { - get - { - return base.Name; - } - - set - { - base.Name = value; - } - } - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_new_method_call(string serviceName, string pathName, string interfaceName, string name); - } -} diff --git a/mono/MethodReturn.cs b/mono/MethodReturn.cs deleted file mode 100644 index 1e7731df..00000000 --- a/mono/MethodReturn.cs +++ /dev/null @@ -1,57 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class MethodReturn : Message - { - private MethodReturn() : base(MessageType.MethodReturn) - { - } - - internal MethodReturn(IntPtr rawMessage, Service service) : base(rawMessage, service) - { - } - - public MethodReturn(MethodCall methodCall) - { - this.service = methodCall.Service; - - RawMessage = dbus_message_new_method_return(methodCall.RawMessage); - - if (RawMessage == IntPtr.Zero) { - throw new OutOfMemoryException(); - } - - dbus_message_unref(RawMessage); - } - - public new string PathName - { - get - { - return base.PathName; - } - } - - public new string InterfaceName - { - get - { - return base.InterfaceName; - } - } - - public new string Name - { - get - { - return base.Name; - } - } - - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_new_method_return(IntPtr rawMessage); - } -} diff --git a/mono/ProxyBuilder.cs b/mono/ProxyBuilder.cs deleted file mode 100644 index 7a3de959..00000000 --- a/mono/ProxyBuilder.cs +++ /dev/null @@ -1,608 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - using System.Collections; - using System.Threading; - using System.Reflection; - using System.Reflection.Emit; - - internal class ProxyBuilder - { - private Service service= null; - private string pathName = null; - private Type type = null; - private Introspector introspector = null; - - private static MethodInfo Service_NameMI = typeof(Service).GetMethod("get_Name", - new Type[0]); - private static MethodInfo Service_ConnectionMI = typeof(Service).GetMethod("get_Connection", - new Type[0]); - private static MethodInfo Service_AddSignalCalledMI = typeof(Service).GetMethod("add_SignalCalled", - new Type[] {typeof(Service.SignalCalledHandler)}); - private static MethodInfo Service_RemoveSignalCalledMI = typeof(Service).GetMethod("remove_SignalCalled", - new Type[] {typeof(Service.SignalCalledHandler)}); - private static MethodInfo Signal_PathNameMI = typeof(Signal).GetMethod("get_PathName", - new Type[0]); - private static MethodInfo Message_ArgumentsMI = typeof(Message).GetMethod("get_Arguments", - new Type[0]); - private static MethodInfo Message_KeyMI = typeof(Message).GetMethod("get_Key", - new Type[0]); - private static MethodInfo Arguments_InitAppendingMI = typeof(Arguments).GetMethod("InitAppending", - new Type[0]); - private static MethodInfo Arguments_AppendMI = typeof(Arguments).GetMethod("Append", - new Type[] {typeof(DBusType.IDBusType)}); - private static MethodInfo Message_SendWithReplyAndBlockMI = typeof(Message).GetMethod("SendWithReplyAndBlock", - new Type[0]); - private static MethodInfo Message_SendMI = typeof(Message).GetMethod("Send", - new Type[0]); - private static MethodInfo Message_DisposeMI = typeof(Message).GetMethod("Dispose", - new Type[0]); - private static MethodInfo Arguments_GetEnumeratorMI = typeof(Arguments).GetMethod("GetEnumerator", - new Type[0]); - private static MethodInfo IEnumerator_MoveNextMI = typeof(System.Collections.IEnumerator).GetMethod("MoveNext", - new Type[0]); - private static MethodInfo IEnumerator_CurrentMI = typeof(System.Collections.IEnumerator).GetMethod("get_Current", - new Type[0]); - private static MethodInfo Type_GetTypeFromHandleMI = typeof(System.Type).GetMethod("GetTypeFromHandle", - new Type[] {typeof(System.RuntimeTypeHandle)}); - private static MethodInfo IDBusType_GetMI = typeof(DBusType.IDBusType).GetMethod("Get", - new Type[] {typeof(System.Type)}); - private static ConstructorInfo MethodCall_C = typeof(MethodCall).GetConstructor(new Type[] {typeof(Service), - typeof(string), - typeof(string), - typeof(string)}); - private static ConstructorInfo Signal_C = typeof(Signal).GetConstructor(new Type[] {typeof(Service), - typeof(string), - typeof(string), - typeof(string)}); - private static ConstructorInfo Service_SignalCalledHandlerC = typeof(Service.SignalCalledHandler).GetConstructor(new Type[] {typeof(object), - typeof(System.IntPtr)}); - private static MethodInfo String_opEqualityMI = typeof(System.String).GetMethod("op_Equality", - new Type[] {typeof(string), - typeof(string)}); - private static MethodInfo MulticastDelegate_opInequalityMI = typeof(System.MulticastDelegate).GetMethod("op_Inequality", - new Type[] {typeof(System.MulticastDelegate), - typeof(System.MulticastDelegate)}); - - - public ProxyBuilder(Service service, Type type, string pathName) - { - this.service = service; - this.pathName = pathName; - this.type = type; - this.introspector = Introspector.GetIntrospector(type); - } - - private MethodInfo BuildSignalCalled(ref TypeBuilder typeB, FieldInfo serviceF, FieldInfo pathF) - { - Type[] parTypes = {typeof(Signal)}; - MethodBuilder methodBuilder = typeB.DefineMethod("Service_SignalCalled", - MethodAttributes.Private | - MethodAttributes.HideBySig, - typeof(void), - parTypes); - - ILGenerator generator = methodBuilder.GetILGenerator(); - - LocalBuilder enumeratorL = generator.DeclareLocal(typeof(System.Collections.IEnumerator)); - enumeratorL.SetLocalSymInfo("enumerator"); - - Label wrongPath = generator.DefineLabel(); - //generator.EmitWriteLine("if (signal.PathName == pathName) {"); - generator.Emit(OpCodes.Ldarg_1); - generator.EmitCall(OpCodes.Callvirt, Signal_PathNameMI, null); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldfld, pathF); - generator.EmitCall(OpCodes.Call, String_opEqualityMI, null); - generator.Emit(OpCodes.Brfalse, wrongPath); - - int localOffset = 1; - - foreach (DictionaryEntry interfaceEntry in this.introspector.InterfaceProxies) { - InterfaceProxy interfaceProxy = (InterfaceProxy) interfaceEntry.Value; - foreach (DictionaryEntry signalEntry in interfaceProxy.Signals) { - EventInfo eventE = (EventInfo) signalEntry.Value; - // This is really cheeky since we need to grab the event as a private field. - FieldInfo eventF = this.type.GetField(eventE.Name, - BindingFlags.NonPublic| - BindingFlags.Instance); - - MethodInfo eventHandler_InvokeMI = eventE.EventHandlerType.GetMethod("Invoke"); - - ParameterInfo[] pars = eventHandler_InvokeMI.GetParameters(); - parTypes = new Type[pars.Length]; - for (int parN = 0; parN < pars.Length; parN++) { - parTypes[parN] = pars[parN].ParameterType; - LocalBuilder parmL = generator.DeclareLocal(parTypes[parN]); - parmL.SetLocalSymInfo(pars[parN].Name); - } - - Label skip = generator.DefineLabel(); - //generator.EmitWriteLine(" if (SelectedIndexChanged != null) {"); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldfld, eventF); - generator.Emit(OpCodes.Ldnull); - generator.EmitCall(OpCodes.Call, MulticastDelegate_opInequalityMI, null); - generator.Emit(OpCodes.Brfalse, skip); - - //generator.EmitWriteLine(" if (signal.Key == 'la i')"); - generator.Emit(OpCodes.Ldarg_1); - generator.EmitCall(OpCodes.Callvirt, Message_KeyMI, null); - generator.Emit(OpCodes.Ldstr, eventE.Name + " " + InterfaceProxy.GetSignature(eventHandler_InvokeMI)); - generator.EmitCall(OpCodes.Call, String_opEqualityMI, null); - generator.Emit(OpCodes.Brfalse, skip); - - //generator.EmitWriteLine("IEnumerator enumerator = signal.Arguments.GetEnumerator()"); - generator.Emit(OpCodes.Ldarg_1); - generator.EmitCall(OpCodes.Callvirt, Message_ArgumentsMI, null); - generator.EmitCall(OpCodes.Callvirt, Arguments_GetEnumeratorMI, null); - generator.Emit(OpCodes.Stloc_0); - - for (int parN = 0; parN < pars.Length; parN++) { - ParameterInfo par = pars[parN]; - if (!par.IsOut) { - EmitSignalIn(generator, par.ParameterType, parN + localOffset, serviceF); - } - } - - //generator.EmitWriteLine(" SelectedIndexChanged(selectedIndex)"); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldfld, eventF); - for (int parN = 0; parN < pars.Length; parN++) { - generator.Emit(OpCodes.Ldloc_S, parN + localOffset); - } - - generator.EmitCall(OpCodes.Callvirt, eventHandler_InvokeMI, null); - - generator.MarkLabel(skip); - //generator.EmitWriteLine(" }"); - - localOffset += pars.Length; - } - } - - generator.MarkLabel(wrongPath); - //generator.EmitWriteLine("}"); - - //generator.EmitWriteLine("return"); - generator.Emit(OpCodes.Ret); - - return methodBuilder; - } - - private void BuildSignalHandler(EventInfo eventE, - InterfaceProxy interfaceProxy, - ref TypeBuilder typeB, - FieldInfo serviceF, - FieldInfo pathF) - { - MethodInfo eventHandler_InvokeMI = eventE.EventHandlerType.GetMethod("Invoke"); - ParameterInfo[] pars = eventHandler_InvokeMI.GetParameters(); - Type[] parTypes = new Type[pars.Length]; - for (int parN = 0; parN < pars.Length; parN++) { - parTypes[parN] = pars[parN].ParameterType; - } - - // Generate the code - MethodBuilder methodBuilder = typeB.DefineMethod("Proxy_" + eventE.Name, - MethodAttributes.Public | - MethodAttributes.HideBySig | - MethodAttributes.Virtual, - typeof(void), - parTypes); - ILGenerator generator = methodBuilder.GetILGenerator(); - - for (int parN = 0; parN < pars.Length; parN++) { - methodBuilder.DefineParameter(parN + 1, pars[parN].Attributes, pars[parN].Name); - } - - // Generate the locals - LocalBuilder methodCallL = generator.DeclareLocal(typeof(MethodCall)); - methodCallL.SetLocalSymInfo("signal"); - - //generator.EmitWriteLine("Signal signal = new Signal(...)"); - generator.Emit(OpCodes.Ldsfld, serviceF); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldfld, pathF); - generator.Emit(OpCodes.Ldstr, interfaceProxy.InterfaceName); - generator.Emit(OpCodes.Ldstr, eventE.Name); - generator.Emit(OpCodes.Newobj, Signal_C); - generator.Emit(OpCodes.Stloc_0); - - //generator.EmitWriteLine("signal.Arguments.InitAppending()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_ArgumentsMI, null); - generator.EmitCall(OpCodes.Callvirt, Arguments_InitAppendingMI, null); - - for (int parN = 0; parN < pars.Length; parN++) { - ParameterInfo par = pars[parN]; - if (!par.IsOut) { - EmitIn(generator, par.ParameterType, parN, serviceF); - } - } - - //generator.EmitWriteLine("signal.Send()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_SendMI, null); - - //generator.EmitWriteLine("signal.Dispose()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_DisposeMI, null); - - //generator.EmitWriteLine("return"); - generator.Emit(OpCodes.Ret); - } - - private void BuildMethod(MethodInfo method, - InterfaceProxy interfaceProxy, - ref TypeBuilder typeB, - FieldInfo serviceF, - FieldInfo pathF) - { - ParameterInfo[] pars = method.GetParameters(); - Type[] parTypes = new Type[pars.Length]; - for (int parN = 0; parN < pars.Length; parN++) { - parTypes[parN] = pars[parN].ParameterType; - } - - // Generate the code - MethodBuilder methodBuilder = typeB.DefineMethod(method.Name, - MethodAttributes.Public | - MethodAttributes.HideBySig | - MethodAttributes.Virtual, - method.ReturnType, - parTypes); - ILGenerator generator = methodBuilder.GetILGenerator(); - - for (int parN = 0; parN < pars.Length; parN++) { - methodBuilder.DefineParameter(parN + 1, pars[parN].Attributes, pars[parN].Name); - } - - // Generate the locals - LocalBuilder methodCallL = generator.DeclareLocal(typeof(MethodCall)); - methodCallL.SetLocalSymInfo("methodCall"); - LocalBuilder replyL = generator.DeclareLocal(typeof(MethodReturn)); - replyL.SetLocalSymInfo("reply"); - LocalBuilder enumeratorL = generator.DeclareLocal(typeof(System.Collections.IEnumerator)); - enumeratorL.SetLocalSymInfo("enumerator"); - - if (method.ReturnType != typeof(void)) { - LocalBuilder retvalL = generator.DeclareLocal(method.ReturnType); - retvalL.SetLocalSymInfo("retval"); - } - - //generator.EmitWriteLine("MethodCall methodCall = new MethodCall(...)"); - generator.Emit(OpCodes.Ldsfld, serviceF); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldfld, pathF); - generator.Emit(OpCodes.Ldstr, interfaceProxy.InterfaceName); - generator.Emit(OpCodes.Ldstr, method.Name); - generator.Emit(OpCodes.Newobj, MethodCall_C); - generator.Emit(OpCodes.Stloc_0); - - //generator.EmitWriteLine("methodCall.Arguments.InitAppending()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_ArgumentsMI, null); - generator.EmitCall(OpCodes.Callvirt, Arguments_InitAppendingMI, null); - - for (int parN = 0; parN < pars.Length; parN++) { - ParameterInfo par = pars[parN]; - if (!par.IsOut) { - EmitIn(generator, par.ParameterType, parN, serviceF); - } - } - - //generator.EmitWriteLine("MethodReturn reply = methodCall.SendWithReplyAndBlock()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_SendWithReplyAndBlockMI, null); - generator.Emit(OpCodes.Stloc_1); - - //generator.EmitWriteLine("IEnumerator enumeartor = reply.Arguments.GetEnumerator()"); - generator.Emit(OpCodes.Ldloc_1); - generator.EmitCall(OpCodes.Callvirt, Message_ArgumentsMI, null); - generator.EmitCall(OpCodes.Callvirt, Arguments_GetEnumeratorMI, null); - generator.Emit(OpCodes.Stloc_2); - - // handle the return value - if (method.ReturnType != typeof(void)) { - EmitOut(generator, method.ReturnType, 0); - } - - for (int parN = 0; parN < pars.Length; parN++) { - ParameterInfo par = pars[parN]; - if (par.IsOut || par.ParameterType.ToString().EndsWith("&")) { - EmitOut(generator, par.ParameterType, parN); - } - } - - // Clean up after ourselves - //generator.EmitWriteLine("methodCall.Dispose()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_DisposeMI, null); - - //generator.EmitWriteLine("reply.Dispose()"); - generator.Emit(OpCodes.Ldloc_1); - generator.EmitCall(OpCodes.Callvirt, Message_DisposeMI, null); - - if (method.ReturnType != typeof(void)) { - generator.Emit(OpCodes.Ldloc_3); - } - - generator.Emit(OpCodes.Ret); - - // Generate the method - typeB.DefineMethodOverride(methodBuilder, method); - } - - private void EmitSignalIn(ILGenerator generator, Type parType, int parN, FieldInfo serviceF) - { - //generator.EmitWriteLine("enumerator.MoveNext()"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, IEnumerator_MoveNextMI, null); - - Type outParType = Arguments.MatchType(parType); - //generator.EmitWriteLine("int selectedIndex = (int) ((DBusType.IDBusType) enumerator.Current).Get(typeof(int))"); - generator.Emit(OpCodes.Pop); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, IEnumerator_CurrentMI, null); - generator.Emit(OpCodes.Castclass, typeof(DBusType.IDBusType)); - generator.Emit(OpCodes.Ldtoken, parType); - generator.EmitCall(OpCodes.Call, Type_GetTypeFromHandleMI, null); - generator.EmitCall(OpCodes.Callvirt, IDBusType_GetMI, null); - // Call the DBusType EmitMarshalOut to make it emit itself - object[] pars = new object[] {generator, parType, true}; - outParType.InvokeMember("EmitMarshalOut", BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod, null, null, pars, null); - generator.Emit(OpCodes.Stloc_S, parN); - } - - - private void EmitIn(ILGenerator generator, Type parType, int parN, FieldInfo serviceF) - { - Type inParType = Arguments.MatchType(parType); - //generator.EmitWriteLine("methodCall.Arguments.Append(...)"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Message_ArgumentsMI, null); - generator.Emit(OpCodes.Ldarg_S, parN + 1); - - // Call the DBusType EmitMarshalIn to make it emit itself - object[] pars = new object[] {generator, parType}; - inParType.InvokeMember("EmitMarshalIn", BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod, null, null, pars, null); - - generator.Emit(OpCodes.Ldsfld, serviceF); - generator.Emit(OpCodes.Newobj, Arguments.GetDBusTypeConstructor(inParType, parType)); - generator.EmitCall(OpCodes.Callvirt, Arguments_AppendMI, null); - } - - private void EmitOut(ILGenerator generator, Type parType, int parN) - { - Type outParType = Arguments.MatchType(parType); - //generator.EmitWriteLine("enumerator.MoveNext()"); - generator.Emit(OpCodes.Ldloc_2); - generator.EmitCall(OpCodes.Callvirt, IEnumerator_MoveNextMI, null); - - //generator.EmitWriteLine("return (" + parType + ") ((DBusType.IDBusType) enumerator.Current).Get(typeof(" + parType + "))"); - generator.Emit(OpCodes.Pop); - if (parN > 0) { - generator.Emit(OpCodes.Ldarg_S, parN + 1); - } - - generator.Emit(OpCodes.Ldloc_2); - generator.EmitCall(OpCodes.Callvirt, IEnumerator_CurrentMI, null); - generator.Emit(OpCodes.Castclass, typeof(DBusType.IDBusType)); - generator.Emit(OpCodes.Ldtoken, parType); - generator.EmitCall(OpCodes.Call, Type_GetTypeFromHandleMI, null); - generator.EmitCall(OpCodes.Callvirt, IDBusType_GetMI, null); - - // Call the DBusType EmitMarshalOut to make it emit itself - object[] pars = new object[] {generator, parType, parN == 0}; - outParType.InvokeMember("EmitMarshalOut", BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod, null, null, pars, null); - - if (parN == 0) { - generator.Emit(OpCodes.Stloc_3); - } - } - - public void BuildConstructor(ref TypeBuilder typeB, FieldInfo serviceF, FieldInfo pathF, MethodInfo signalCalledMI, FieldInfo deleF) - { - Type[] pars = {typeof(Service), typeof(string)}; - ConstructorBuilder constructor = typeB.DefineConstructor(MethodAttributes.RTSpecialName | - MethodAttributes.Public, - CallingConventions.Standard, pars); - - ILGenerator generator = constructor.GetILGenerator(); - - LocalBuilder handlerL = generator.DeclareLocal (typeof (Service.SignalCalledHandler)); - handlerL.SetLocalSymInfo ("handler"); - - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Call, this.introspector.Constructor); - //generator.EmitWriteLine("service = myService"); - generator.Emit(OpCodes.Ldarg_1); - generator.Emit(OpCodes.Stsfld, serviceF); - //generator.EmitWriteLine("this.pathName = pathName"); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldarg_2); - generator.Emit(OpCodes.Stfld, pathF); - - //generator.EmitWriteLine("handler = new Service.SignalCalledHandler(Service_SignalCalled)"); - generator.Emit(OpCodes.Ldarg_1); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldftn, signalCalledMI); - generator.Emit(OpCodes.Newobj, Service_SignalCalledHandlerC); - generator.Emit(OpCodes.Stloc_0); - - //generator.EmitWriteLine("this.delegate_created = handler"); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldloc_0); - generator.Emit(OpCodes.Stfld, deleF); - - //generator.EmitWriteLine("myService.SignalCalled += handler"); - generator.Emit(OpCodes.Ldloc_0); - generator.EmitCall(OpCodes.Callvirt, Service_AddSignalCalledMI, null); - - //generator.EmitWriteLine("return"); - generator.Emit(OpCodes.Ret); - } - - public void BuildSignalConstructor(ref TypeBuilder typeB, FieldInfo serviceF, FieldInfo pathF) - { - Type[] pars = {typeof(Service), typeof(string)}; - ConstructorBuilder constructor = typeB.DefineConstructor(MethodAttributes.RTSpecialName | - MethodAttributes.Public, - CallingConventions.Standard, pars); - - ILGenerator generator = constructor.GetILGenerator(); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Call, this.introspector.Constructor); - //generator.EmitWriteLine("service = myService"); - generator.Emit(OpCodes.Ldarg_1); - generator.Emit(OpCodes.Stsfld, serviceF); - //generator.EmitWriteLine("this.pathName = pathName"); - generator.Emit(OpCodes.Ldarg_0); - generator.Emit(OpCodes.Ldarg_2); - generator.Emit(OpCodes.Stfld, pathF); - - //generator.EmitWriteLine("return"); - generator.Emit(OpCodes.Ret); - } - - public void BuildFinalizer (TypeBuilder tb, FieldInfo serviceF, FieldInfo deleF) - { - // Note that this is a *HORRIBLE* example of how to build a finalizer - // It doesn't use the try/finally to chain to Object::Finalize. However, - // because that is always going to be a nop, lets just ignore that here. - // If you are trying to find the right code, look at what mcs does ;-). - - MethodBuilder mb = tb.DefineMethod("Finalize", - MethodAttributes.Family | - MethodAttributes.HideBySig | - MethodAttributes.Virtual, - typeof (void), - new Type [0]); - ILGenerator generator = mb.GetILGenerator(); - - //generator.EmitWriteLine("this.service.SignalCalled -= this.delegate_created"); - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldfld, serviceF); - generator.Emit (OpCodes.Ldarg_0); - generator.Emit (OpCodes.Ldfld, deleF); - generator.EmitCall (OpCodes.Callvirt, Service_RemoveSignalCalledMI, null); - generator.Emit (OpCodes.Ret); - } - - public object GetSignalProxy() - { - Type proxyType = Service.ProxyAssembly.GetType(ObjectName + ".SignalProxy"); - - if (proxyType == null) { - // Build the type - TypeBuilder typeB = Service.Module.DefineType(ObjectName + ".SignalProxy", - TypeAttributes.Public, - this.type); - - FieldBuilder serviceF = typeB.DefineField("service", - typeof(Service), - FieldAttributes.Private | - FieldAttributes.Static); - FieldBuilder pathF = typeB.DefineField("pathName", - typeof(string), - FieldAttributes.Private); - - BuildSignalConstructor(ref typeB, serviceF, pathF); - - // Build the signal handlers - foreach (DictionaryEntry interfaceEntry in this.introspector.InterfaceProxies) { - InterfaceProxy interfaceProxy = (InterfaceProxy) interfaceEntry.Value; - foreach (DictionaryEntry signalEntry in interfaceProxy.Signals) { - EventInfo eventE = (EventInfo) signalEntry.Value; - BuildSignalHandler(eventE, interfaceProxy, ref typeB, serviceF, pathF); - } - } - - proxyType = typeB.CreateType(); - - // Uncomment the following line to produce a DLL of the - // constructed assembly which can then be examined using - // monodis. Note that in order for this to work you should copy - // the client assembly as a dll file so that monodis can pick it - // up. - //Service.ProxyAssembly.Save("proxy.dll"); - } - - Type [] parTypes = new Type[] {typeof(Service), typeof(string)}; - object [] pars = new object[] {Service, pathName}; - - ConstructorInfo constructor = proxyType.GetConstructor(parTypes); - object instance = constructor.Invoke(pars); - return instance; - } - - - public object GetProxy() - { - Type proxyType = Service.ProxyAssembly.GetType(ObjectName + ".Proxy"); - - if (proxyType == null) { - // Build the type - TypeBuilder typeB = Service.Module.DefineType(ObjectName + ".Proxy", TypeAttributes.Public, this.type); - - FieldBuilder serviceF = typeB.DefineField("service", - typeof(Service), - FieldAttributes.Private | - FieldAttributes.Static); - FieldBuilder pathF = typeB.DefineField("pathName", - typeof(string), - FieldAttributes.Private); - FieldBuilder deleF = typeB.DefineField("delegate_created", - typeof(Service.SignalCalledHandler), - FieldAttributes.Private); - BuildFinalizer (typeB, serviceF, deleF); - - MethodInfo signalCalledMI = BuildSignalCalled(ref typeB, serviceF, pathF); - BuildConstructor(ref typeB, serviceF, pathF, signalCalledMI, deleF); - - // Build the methods - foreach (DictionaryEntry interfaceEntry in this.introspector.InterfaceProxies) { - InterfaceProxy interfaceProxy = (InterfaceProxy) interfaceEntry.Value; - foreach (DictionaryEntry methodEntry in interfaceProxy.Methods) { - MethodInfo method = (MethodInfo) methodEntry.Value; - BuildMethod(method, interfaceProxy, ref typeB, serviceF, pathF); - } - } - - proxyType = typeB.CreateType(); - - // Uncomment the following line to produce a DLL of the - // constructed assembly which can then be examined using - // monodis. Note that in order for this to work you should copy - // the client assembly as a dll file so that monodis can pick it - // up. - //Service.ProxyAssembly.Save(Service.Name + ".proxy.dll"); - } - - Type [] parTypes = new Type[] {typeof(Service), typeof(string)}; - object [] pars = new object[] {Service, pathName}; - - ConstructorInfo constructor = proxyType.GetConstructor(parTypes); - object instance = constructor.Invoke(pars); - return instance; - } - - private Service Service - { - get { - return this.service; - } - } - - private string ObjectName - { - get { - return this.introspector.ToString(); - } - } - } -} - diff --git a/mono/README b/mono/README deleted file mode 100644 index 2d1b08b6..00000000 --- a/mono/README +++ /dev/null @@ -1,118 +0,0 @@ -D-BUS Mono Bindings -=== - -These bindings are a 'thick' wrapper around the D-BUS API. For now -they rely on the main loop provided by the GLib bindings but this -dependancy will be removed in the near future. - -The wrapper serves two main functions: firstly, it has the know-how to -introspect live objects passed to it by a server and service requests -to those objects via the D-BUS. Secondly, it can create a proxy for -clients who can pretend they are making calls to the regular -objects. This latter piece of magic is implemented using -Reflection.Emit to create an assembly on-the-fly containing -sub-classes of the classes the client thinks it's really using. These -sub-classes simply marshal each method's parameters off to the D-BUS, -demarshal the results and return them to the client as if nothing -happened. - -Usage -=== - -A server do should something like this: - - namespace Foo - { - using System; - using DBus; - using Gtk; - - public class MyServer - { - public static int Main(string [] args) - { - Application.Init(); - -1 Connection connection = Bus.GetSessionBus(); -2 Service service = new Service(connection, "org.foo"); -3 MyObject myObject = new MyObject(); -4 service.RegisterObject(myObject, "/org/foo/MyObject"); - - Application.Run(); - - return 0; - } - } - } - -In line 1 we get a connection to the session bus. Then, in line 2 we -create a service which will listen for requests to org.foo to -service. In line 3 we create a MyObject object and register it with an -object path in line 4. It's almost that simple. All that's missing is -to mark MyObject in such a way that dbus-sharp knows how to export -it. This is done using the attributes, Interface and Method, -as in the following example: - - namespace Foo - { - using System; - using DBus; - - [Interface("org.foo.MyObject")] - public class MyObject - { - [Method] - public virtual string Echo(string message) - { - return "Reply: " + message; - } - } - } - -Note that the Methods should also be declared virtual in order for -the client to use same class declaration. - -Now for the client: - - namespace Foo - { - using System; - using DBus; - - public class MyClient - { - public static int Main(string [] args) - { -1 Connection connection = Bus.GetSessionBus(); -2 Service service = Service.Get(connection, "org.foo"); -3 MyObject myObject = (MyObject) - service.GetObject(typeof(MyObject), "/org/foo/MyObject"); -4 System.Console.WriteLine(testObject.Echo("Hello world!")); - - return 0; - } - } - } - -Here we start off the same by getting a connection to the session -bus. This time though, in line 2, we get the existing service rather -than creating it. In line 3, we ask the service to get the object -"/org/foo/MyObject" as registered by the server and that return it as -a MyObject. Once obtained we can use it like any normal object as in -line 4. This supposes, of course, that you've just written MyObject -and happen to have it readily available. If that were not the case, -for example if you wanted to call a method on one of the well-known -services, then you will need to write a stub class, like the MyObject -class above, which has the method calls you need correctly defined but -needn't actually have any implementation. - - -Working Example -=== - -The example directory contains a working example similar to that -described above. It uses the session bus so first run dbus-launch and -then export DBUS_SESSION_BUS_ADDRESS, as displayed by dbus-launch, to -two terminals, one to run the server and one for the client. Then, -start the server in one terminal, the client in the other and cross -your fingers. diff --git a/mono/Server.cs b/mono/Server.cs deleted file mode 100644 index e39b7ca2..00000000 --- a/mono/Server.cs +++ /dev/null @@ -1,148 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class Server - { - private IntPtr rawServer; - - /// - /// The current slot number - /// - private static int slot = -1; - - private string address = null; - - private Server(IntPtr rawServer) - { - RawServer = rawServer; - } - - public Server(string address) - { - Error error = new Error(); - error.Init(); - RawServer = dbus_server_listen(address, ref error); - if (RawServer != IntPtr.Zero){ - dbus_server_unref(RawServer); - } else { - throw new DBusException(error); - } - } - - ~Server() - { - if (RawServer != IntPtr.Zero) { - dbus_server_unref(rawServer); - } - - RawServer = IntPtr.Zero; - } - - public string Address - { - get - { - if (address == null) { - address = dbus_server_get_address(rawServer); - } - - return address; - } - } - - private int Slot - { - get - { - if (slot == -1) - { - // We need to initialize the slot - if (!dbus_server_allocate_data_slot (ref slot)) - throw new OutOfMemoryException (); - - Debug.Assert (slot >= 0); - } - - return slot; - } - } - - internal IntPtr RawServer - { - get - { - return rawServer; - } - set - { - if (value == rawServer) - return; - - if (rawServer != IntPtr.Zero) - { - // Get the reference to this - IntPtr rawThis = dbus_server_get_data (rawServer, Slot); - Debug.Assert (rawThis != IntPtr.Zero); - - // Blank over the reference - dbus_server_set_data (rawServer, Slot, IntPtr.Zero, IntPtr.Zero); - - // Free the reference - ((GCHandle) rawThis).Free(); - - // Unref the connection - dbus_server_unref(rawServer); - } - - this.rawServer = value; - - if (rawServer != IntPtr.Zero) - { - GCHandle rawThis; - - dbus_server_ref (rawServer); - - // We store a weak reference to the C# object on the C object - rawThis = GCHandle.Alloc (this, GCHandleType.WeakTrackResurrection); - - dbus_server_set_data(rawServer, Slot, (IntPtr) rawThis, IntPtr.Zero); - } - } - } - - [DllImport ("dbus-1", EntryPoint="dbus_server_listen")] - private extern static IntPtr dbus_server_listen(string address, ref Error error); - - [DllImport ("dbus-1", EntryPoint="dbus_server_unref")] - private extern static IntPtr dbus_server_unref(IntPtr rawServer); - - [DllImport ("dbus-1", EntryPoint="dbus_server_ref")] - private extern static void dbus_server_ref(IntPtr rawServer); - - [DllImport ("dbus-1", EntryPoint="dbus_server_disconnect")] - private extern static void dbus_server_disconnect(IntPtr rawServer); - - [DllImport ("dbus-1", EntryPoint="dbus_server_get_address")] - private extern static string dbus_server_get_address(IntPtr rawServer); - - [DllImport ("dbus-1", EntryPoint="dbus_server_set_data")] - private extern static bool dbus_server_set_data(IntPtr rawServer, - int slot, - IntPtr data, - IntPtr freeDataFunc); - - [DllImport ("dbus-1", EntryPoint="dbus_server_get_data")] - private extern static IntPtr dbus_server_get_data(IntPtr rawServer, - int slot); - - [DllImport ("dbus-1", EntryPoint="dbus_server_allocate_data_slot")] - private extern static bool dbus_server_allocate_data_slot (ref int slot); - - [DllImport ("dbus-1", EntryPoint="dbus_server_free_data_slot")] - private extern static void dbus_server_free_data_slot (ref int slot); - - } -} diff --git a/mono/Service.cs b/mono/Service.cs deleted file mode 100644 index 40703a53..00000000 --- a/mono/Service.cs +++ /dev/null @@ -1,191 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - using System.Collections; - using System.Threading; - using System.Reflection; - using System.Reflection.Emit; - - public class Service - { - private Connection connection; - private string name; - private bool local = false; - private Hashtable registeredHandlers = new Hashtable(); - private DBusHandleMessageFunction filterCalled; - public delegate void SignalCalledHandler(Signal signal); - public event SignalCalledHandler SignalCalled; - private static AssemblyBuilder proxyAssembly; - private ModuleBuilder module = null; - - // Add a match for signals. FIXME: Can we filter the service? - private const string MatchRule = "type='signal'"; - - internal Service(string name, Connection connection) - { - this.name = name; - this.connection = connection; - AddFilter(); - } - - public Service(Connection connection, string name) - { - Error error = new Error(); - error.Init(); - - // This isn't used for now - uint flags = 0; - - if (dbus_bus_request_name (connection.RawConnection, name, flags, ref error) == -1) { - throw new DBusException(error); - } - - this.connection = connection; - this.name = name; - this.local = true; - } - - public static bool HasOwner(Connection connection, string name) - { - Error error = new Error(); - error.Init(); - - if (dbus_bus_name_has_owner(connection.RawConnection, - name, - ref error)) { - return true; - } else { - if (error.IsSet) { - throw new DBusException(error); - } - return false; - } - } - - public static Service Get(Connection connection, string name) - { - if (HasOwner(connection, name)) { - return new Service(name, connection); - } else { - throw new ApplicationException("Name '" + name + "' does not exist."); - } - } - - public void UnregisterObject(object handledObject) - { - registeredHandlers.Remove(handledObject); - } - - public void RegisterObject(object handledObject, - string pathName) - { - Handler handler = new Handler(handledObject, pathName, this); - registeredHandlers.Add(handledObject, handler); - } - - internal Handler GetHandler(object handledObject) - { - if (!registeredHandlers.Contains(handledObject)) { - throw new ArgumentException("No handler registered for object: " + handledObject); - } - - return (Handler) registeredHandlers[handledObject]; - } - - public object GetObject(Type type, string pathName) - { - ProxyBuilder builder = new ProxyBuilder(this, type, pathName); - object proxy = builder.GetProxy(); - return proxy; - } - - private void AddFilter() - { - // Setup the filter function - this.filterCalled = new DBusHandleMessageFunction(Service_FilterCalled); - Connection.AddFilter (this.filterCalled); - // Add a match for signals. FIXME: Can we filter the service? - Connection.AddMatch ("type='signal'"); - } - - private int Service_FilterCalled(IntPtr rawConnection, - IntPtr rawMessage, - IntPtr userData) - { - Message message = Message.Wrap(rawMessage, this); - - if (message.Type == Message.MessageType.Signal) { - // We're only interested in signals - Signal signal = (Signal) message; - if (SignalCalled != null) { - Message.Push (message); - SignalCalled(signal); - Message.Pop (); - } - } - - message.Dispose (); - - return (int) Result.NotYetHandled; - } - - public string Name - { - get - { - return this.name; - } - } - - public Connection Connection - { - get - { - return connection; - } - - set - { - this.connection = value; - } - } - - internal AssemblyBuilder ProxyAssembly - { - get { - if (proxyAssembly == null){ - AssemblyName assemblyName = new AssemblyName(); - assemblyName.Name = "DBusProxy"; - proxyAssembly = Thread.GetDomain().DefineDynamicAssembly(assemblyName, - AssemblyBuilderAccess.RunAndSave); - } - - return proxyAssembly; - } - } - - internal ModuleBuilder Module - { - get { - if (this.module == null) { - this.module = ProxyAssembly.DefineDynamicModule(Name, Name + ".proxy.dll", true); - } - - return this.module; - } - } - - [DllImport("dbus-1")] - private extern static int dbus_bus_request_name(IntPtr rawConnection, - string serviceName, - uint flags, ref Error error); - - [DllImport("dbus-1")] - private extern static bool dbus_bus_name_has_owner(IntPtr rawConnection, - string serviceName, - ref Error error); - - } -} diff --git a/mono/Signal.cs b/mono/Signal.cs deleted file mode 100644 index 10191f9d..00000000 --- a/mono/Signal.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace DBus -{ - using System; - using System.Runtime.InteropServices; - using System.Diagnostics; - - public class Signal : Message - { - public Signal() : base(MessageType.Signal) - { - } - - internal Signal(IntPtr rawMessage, Service service) : base(rawMessage, service) - { - } - - public Signal(Service service) : base(MessageType.Signal, service) - { - } - - public Signal(Service service, string pathName, string interfaceName, string name) - { - this.service = service; - - RawMessage = dbus_message_new_signal(pathName, interfaceName, name); - - if (RawMessage == IntPtr.Zero) { - throw new OutOfMemoryException(); - } - - this.pathName = pathName; - this.interfaceName = interfaceName; - this.name = name; - - dbus_message_unref(RawMessage); - } - - public new string PathName - { - get - { - return base.PathName; - } - - set - { - base.PathName = value; - } - } - - public new string InterfaceName - { - get - { - return base.InterfaceName; - } - - set - { - base.InterfaceName = value; - } - } - - public new string Name - { - get - { - return base.Name; - } - - set - { - base.Name = value; - } - } - [DllImport("dbus-1")] - private extern static IntPtr dbus_message_new_signal(string pathName, string interfaceName, string name); - } -} diff --git a/mono/SignalAttribute.cs b/mono/SignalAttribute.cs deleted file mode 100644 index 4835444b..00000000 --- a/mono/SignalAttribute.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace DBus -{ - [AttributeUsage(AttributeTargets.Event, AllowMultiple=false, Inherited=true)] public class SignalAttribute : Attribute - { - public SignalAttribute() - { - } - } -} diff --git a/mono/TODO b/mono/TODO deleted file mode 100644 index e44c2a92..00000000 --- a/mono/TODO +++ /dev/null @@ -1,8 +0,0 @@ -- Clean up memory leakages. Call _unref functions etc. - -- Convert strings to/from UTF-8 - -- Implement own main loop. The current implementation depends on the - GLib mainloop. - -- Get test working. Probably a threading issue. diff --git a/mono/Test.cs b/mono/Test.cs deleted file mode 100644 index cb482cb0..00000000 --- a/mono/Test.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Threading; -using DBus; -using Gtk; - -namespace DBus.Test -{ - public class Test - { - public static Service service = null; - public static Connection connection = null; - - public static int Main(string [] args) - { - TestServer testServer = new TestServer(); - Thread serverThread = new Thread(new ThreadStart(testServer.StartServer)); - serverThread.Start(); - - connection = Bus.GetSessionBus(); - service = Service.Get(connection, "org.freedesktop.Test"); - Thread.Sleep (1000); - - TestObject testObject = (TestObject) service.GetObject(typeof(TestObject), "/org/freedesktop/Test/TestObject"); - - Console.WriteLine ("Got object [{0}]", testObject); - - System.Console.WriteLine(testObject.Test1("Hello")); - - Console.WriteLine ("Got object [{0}]", testObject); - - //RunTests(testObject); - - return 0; - } - - public static void RunTests(TestObject testObject) - { - System.Console.WriteLine(testObject.Test1("Hello")); - } - } - - public class TestServer - { - public Connection connection; - public Service service; - - public TestServer() - { - Application.Init(); - - System.Console.WriteLine("Starting server..."); - - connection = Bus.GetSessionBus(); - service = new Service(connection, "org.freedesktop.Test"); - TestObject testObject = new TestObject(); - service.RegisterObject(testObject, "/org/freedesktop/Test/TestObject"); - - System.Console.WriteLine("Foo!"); - } - - public void StartServer() - { - Application.Run(); - } - } - - [Interface("org.freedesktop.Test.TestObject")] - public class TestObject - { - [Method] - public virtual int Test1(string x) - { - System.Console.WriteLine("Called: " + x); - return 5; - } - } -} diff --git a/mono/dbus-sharp.dll.config.in b/mono/dbus-sharp.dll.config.in deleted file mode 100644 index 2c6d570d..00000000 --- a/mono/dbus-sharp.dll.config.in +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/mono/dbus-sharp.snk b/mono/dbus-sharp.snk deleted file mode 100644 index b28b3935..00000000 Binary files a/mono/dbus-sharp.snk and /dev/null differ diff --git a/mono/doc/.cvsignore b/mono/doc/.cvsignore deleted file mode 100644 index 731c2076..00000000 --- a/mono/doc/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile -Makefile.in -dbus-sharp-docs.zip -dbus-sharp-docs.tree diff --git a/mono/doc/Makefile.am b/mono/doc/Makefile.am deleted file mode 100644 index 7f87c25c..00000000 --- a/mono/doc/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -if ENABLE_MONODOC -TARGETS = dbus-sharp-docs.zip dbus-sharp-docs.tree dbus-sharp-docs.source -DOCDIR = `$(MONODOC) --get-sourcesdir` - -install-data-local: - install -d -m 755 $(DESTDIR)/`monodoc --get-sourcesdir` - install -m 644 $(srcdir)/dbus-sharp-docs.source $(DESTDIR)/`monodoc --get-sourcesdir` - install -m 644 dbus-sharp-docs.tree $(DESTDIR)/`monodoc --get-sourcesdir` - install -m 644 dbus-sharp-docs.zip $(DESTDIR)/`monodoc --get-sourcesdir` - -uninstall-local: - rm -f $(DESTDIR)/`monodoc --get-sourcesdir`/dbus-sharp-docs.source - rm -f $(DESTDIR)/`monodoc --get-sourcesdir`/dbus-sharp-docs.tree - rm -f $(DESTDIR)/`monodoc --get-sourcesdir`/dbus-sharp-docs.zip -else -TARGETS = -DOCDIR = $(datadir) -endif - -noinst_DATA = $(TARGETS) - -ASSEMBLER = $(MONODOC) --assemble -UPDATER = $(MONODOC) --update - -dbus-sharp-docs.zip: dbus-sharp-docs.tree - -dbus-sharp-docs.tree: $(srcdir)/en/*/*.xml $(srcdir)/en/*.xml - $(ASSEMBLER) --ecma $(srcdir)/en -o dbus-sharp-docs - -update: - $(UPDATER) ../dbus-sharp.dll -o ./en -f - -CLEANFILES = dbus-sharp-docs.zip dbus-sharp-docs.tree - -EXTRA_DIST = dbus-sharp-docs.source -if ENABLE_MONODOC -EXTRA_DIST += dbus-sharp-docs.tree dbus-sharp-docs.zip -endif - -dist-hook: - mkdir -p $(distdir)/en - cp $(srcdir)/en/*.xml $(distdir)/en/ - mkdir -p $(distdir)/en/DBus - cp $(srcdir)/en/DBus/*.xml $(distdir)/en/DBus/ - mkdir -p $(distdir)/en/DBus.DBusType - cp $(srcdir)/en/DBus.DBusType/*.xml $(distdir)/en/DBus.DBusType/ - diff --git a/mono/doc/dbus-sharp-docs.source b/mono/doc/dbus-sharp-docs.source deleted file mode 100644 index 4bf4c4a8..00000000 --- a/mono/doc/dbus-sharp-docs.source +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/mono/doc/en/DBus.DBusType.xml b/mono/doc/en/DBus.DBusType.xml deleted file mode 100644 index 72e01252..00000000 --- a/mono/doc/en/DBus.DBusType.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Types for the D-BUS binding for .NET. - - - Types used by the D-BUS library. - - - - diff --git a/mono/doc/en/DBus.DBusType/Array.xml b/mono/doc/en/DBus.DBusType/Array.xml deleted file mode 100644 index f5e0e87d..00000000 --- a/mono/doc/en/DBus.DBusType/Array.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Boolean.xml b/mono/doc/en/DBus.DBusType/Boolean.xml deleted file mode 100644 index 34ed0e10..00000000 --- a/mono/doc/en/DBus.DBusType/Boolean.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Byte.xml b/mono/doc/en/DBus.DBusType/Byte.xml deleted file mode 100644 index 0f094f9b..00000000 --- a/mono/doc/en/DBus.DBusType/Byte.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Custom.xml b/mono/doc/en/DBus.DBusType/Custom.xml deleted file mode 100644 index d4ac9fb8..00000000 --- a/mono/doc/en/DBus.DBusType/Custom.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Dict.xml b/mono/doc/en/DBus.DBusType/Dict.xml deleted file mode 100644 index 8e80ea05..00000000 --- a/mono/doc/en/DBus.DBusType/Dict.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Double.xml b/mono/doc/en/DBus.DBusType/Double.xml deleted file mode 100644 index 86709fcc..00000000 --- a/mono/doc/en/DBus.DBusType/Double.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/IDBusType.xml b/mono/doc/en/DBus.DBusType/IDBusType.xml deleted file mode 100644 index 9cf7e672..00000000 --- a/mono/doc/en/DBus.DBusType/IDBusType.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Int32.xml b/mono/doc/en/DBus.DBusType/Int32.xml deleted file mode 100644 index 6a06139e..00000000 --- a/mono/doc/en/DBus.DBusType/Int32.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Int64.xml b/mono/doc/en/DBus.DBusType/Int64.xml deleted file mode 100644 index c2356c31..00000000 --- a/mono/doc/en/DBus.DBusType/Int64.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/Nil.xml b/mono/doc/en/DBus.DBusType/Nil.xml deleted file mode 100644 index 6f758ad4..00000000 --- a/mono/doc/en/DBus.DBusType/Nil.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/ObjectPath.xml b/mono/doc/en/DBus.DBusType/ObjectPath.xml deleted file mode 100644 index 26aa4a9f..00000000 --- a/mono/doc/en/DBus.DBusType/ObjectPath.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/String.xml b/mono/doc/en/DBus.DBusType/String.xml deleted file mode 100644 index 2902e73d..00000000 --- a/mono/doc/en/DBus.DBusType/String.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/UInt32.xml b/mono/doc/en/DBus.DBusType/UInt32.xml deleted file mode 100644 index 378aedeb..00000000 --- a/mono/doc/en/DBus.DBusType/UInt32.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.DBusType/UInt64.xml b/mono/doc/en/DBus.DBusType/UInt64.xml deleted file mode 100644 index 01832dc5..00000000 --- a/mono/doc/en/DBus.DBusType/UInt64.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - DBus.DBusType.IDBusType - - - - - - - Field - - System.Char - - - - - To be added - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - To be added - a - To be added - - - - - Method - - System.Object - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus.xml b/mono/doc/en/DBus.xml deleted file mode 100644 index 9d278014..00000000 --- a/mono/doc/en/DBus.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - D-BUS binding for .NET. - - - D-BUS is a message bus system, a simple way for applications - to talk to one another. - - - The message bus daemon forms the hub of a wheel. Each spoke - of the wheel is a one-to-one connection to an application - using libdbus. An application sends a message to the bus - daemon over its spoke, and the bus daemon forwards the - message to other connected applications as appropriate. Think - of the daemon as a router. - - - The bus daemon has multiple instances on a typical - computer. The first instance is a machine-global singleton, - that is, a system daemon similar to sendmail or Apache. This - instance has heavy security restrictions on what messages it - will accept, and is used for systemwide communication. The - other instances are created one per user login session. These - instances allow applications in the user's session to - communicate with one another. - - - The systemwide and per-user daemons are separate. Normal - within-session IPC does not involve the systemwide message - bus process and vice versa. - - - - diff --git a/mono/doc/en/DBus/Arguments.xml b/mono/doc/en/DBus/Arguments.xml deleted file mode 100644 index 31cc4143..00000000 --- a/mono/doc/en/DBus/Arguments.xml +++ /dev/null @@ -1,253 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - System.Collections.IEnumerable - - - - - - - Method - - System.Boolean - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Type - - - - - - To be added - a - a - To be added - - - - - Method - - System.Object[] - - - - - - To be added - a - a - To be added - - - - - Method - - System.Object[] - - - - - - To be added - a - a - To be added - - - - - Method - - System.Reflection.ConstructorInfo - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Char - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Void - - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Object[] - - - - - - To be added - a - a - To be added - - - - - Method - - System.String - - - - To be added - a - To be added - - - - - Method - - DBus.DBusType.IDBusType - - - - To be added - a - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - System.Collections.IEnumerator - - - - To be added - a - To be added - - - - - Property - - System.Collections.Hashtable - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Bus.xml b/mono/doc/en/DBus/Bus.xml deleted file mode 100644 index b4469a17..00000000 --- a/mono/doc/en/DBus/Bus.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - - - - Method - - DBus.Connection - - - - To be added - a - To be added - - - - - Method - - DBus.Connection - - - - To be added - a - To be added - - - - - Constructor - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Connection.xml b/mono/doc/en/DBus/Connection.xml deleted file mode 100644 index 149468e7..00000000 --- a/mono/doc/en/DBus/Connection.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Property - - System.Int32 - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Custom.xml b/mono/doc/en/DBus/Custom.xml deleted file mode 100644 index fa09aa5e..00000000 --- a/mono/doc/en/DBus/Custom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.ValueType - - - - - - - Field - - System.String - - - - - To be added - To be added - - - - - Field - - System.Byte[] - - - - - To be added - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/DBusException.xml b/mono/doc/en/DBus/DBusException.xml deleted file mode 100644 index 388f1796..00000000 --- a/mono/doc/en/DBus/DBusException.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.ApplicationException - - - - System.Runtime.Serialization.ISerializable - - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/ErrorMessage.xml b/mono/doc/en/DBus/ErrorMessage.xml deleted file mode 100644 index 47060c91..00000000 --- a/mono/doc/en/DBus/ErrorMessage.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - DBus.Message - - - - - - - Constructor - - - - To be added - a - To be added - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/InterfaceAttribute.xml b/mono/doc/en/DBus/InterfaceAttribute.xml deleted file mode 100644 index ced4e154..00000000 --- a/mono/doc/en/DBus/InterfaceAttribute.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Attribute - - - - - System.AttributeUsageAttribute - - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Message.xml b/mono/doc/en/DBus/Message.xml deleted file mode 100644 index 4d28c349..00000000 --- a/mono/doc/en/DBus/Message.xml +++ /dev/null @@ -1,431 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - - - - Field - - DBus.Service - - - - - To be added - To be added - - - - - Field - - System.String - - - - - To be added - To be added - - - - - Field - - System.String - - - - - To be added - To be added - - - - - Field - - System.String - - - - - To be added - To be added - - - - - Method - - DBus.Message - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.IntPtr - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Boolean - - - - - - To be added - a - a - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Boolean - - - - - - - - - To be added - a - a - a - a - a - To be added - - - - - Method - - System.IntPtr - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - System.Void - - - - - - To be added - a - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Method - - DBus.MethodReturn - - - - To be added - a - To be added - - - - - Constructor - - - - To be added - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Property - - DBus.Message+MessageType - - - - To be added - a - To be added - - - - - Property - - DBus.Service - - - - To be added - a - To be added - - - - - Property - - System.String - - - To be added - a - To be added - - - - - Property - - System.String - - - To be added - a - To be added - - - - - Property - - System.String - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - DBus.Arguments - - - - To be added - a - To be added - - - - - Property - - System.Int32 - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/MessageType.xml b/mono/doc/en/DBus/MessageType.xml deleted file mode 100644 index 33e06c7f..00000000 --- a/mono/doc/en/DBus/MessageType.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Enum - - - - System.IComparable - - - System.IConvertible - - - System.IFormattable - - - - - - - Field - - DBus.Message+MessageType - - - - - To be added - To be added - - - - - Field - - DBus.Message+MessageType - - - - - To be added - To be added - - - - - Field - - DBus.Message+MessageType - - - - - To be added - To be added - - - - - Field - - DBus.Message+MessageType - - - - - To be added - To be added - - - - - Field - - DBus.Message+MessageType - - - - - To be added - To be added - - - - - Field - - System.Int32 - - - - - To be added - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/MethodAttribute.xml b/mono/doc/en/DBus/MethodAttribute.xml deleted file mode 100644 index 8f6b7759..00000000 --- a/mono/doc/en/DBus/MethodAttribute.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Attribute - - - - - System.AttributeUsageAttribute - - - - - - Constructor - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/MethodCall.xml b/mono/doc/en/DBus/MethodCall.xml deleted file mode 100644 index 06dc2e2a..00000000 --- a/mono/doc/en/DBus/MethodCall.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - DBus.Message - - - - - - - Constructor - - - - To be added - a - To be added - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - - - To be added - a - a - a - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/MethodReturn.xml b/mono/doc/en/DBus/MethodReturn.xml deleted file mode 100644 index 641a07c2..00000000 --- a/mono/doc/en/DBus/MethodReturn.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - DBus.Message - - - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Server.xml b/mono/doc/en/DBus/Server.xml deleted file mode 100644 index 8e51d025..00000000 --- a/mono/doc/en/DBus/Server.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - - - - Method - - System.Void - - - - To be added - To be added - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Service.xml b/mono/doc/en/DBus/Service.xml deleted file mode 100644 index 7aecb373..00000000 --- a/mono/doc/en/DBus/Service.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Object - - - - - - - Method - - System.Boolean - - - - - - - To be added - a - a - a - To be added - - - - - Method - - DBus.Service - - - - - - - To be added - a - a - a - To be added - - - - - Method - - System.Void - - - - - - - To be added - a - a - To be added - - - - - Method - - System.Object - - - - - - - To be added - a - a - a - To be added - - - - - Constructor - - - - - - - To be added - a - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - DBus.Connection - - - - To be added - a - To be added - - - - - Event - - DBus.Service+SignalCalledHandler - - - - To be added - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/Signal.xml b/mono/doc/en/DBus/Signal.xml deleted file mode 100644 index 2d0f85cf..00000000 --- a/mono/doc/en/DBus/Signal.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - DBus.Message - - - - - - - Constructor - - - - To be added - a - To be added - - - - - Constructor - - - - - - To be added - a - a - To be added - - - - - Constructor - - - - - - - - - To be added - a - a - a - a - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - - Property - - System.String - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/SignalAttribute.xml b/mono/doc/en/DBus/SignalAttribute.xml deleted file mode 100644 index 25ba5c5b..00000000 --- a/mono/doc/en/DBus/SignalAttribute.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Attribute - - - - - System.AttributeUsageAttribute - - - - - - Constructor - - - - To be added - a - To be added - - - - \ No newline at end of file diff --git a/mono/doc/en/DBus/SignalCalledHandler.xml b/mono/doc/en/DBus/SignalCalledHandler.xml deleted file mode 100644 index 5ee8b3b8..00000000 --- a/mono/doc/en/DBus/SignalCalledHandler.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - dbus-sharp - - - 0.0.0.0 - neutral - - - Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - - To be added - To be added - - - System.Delegate - - - - System.ICloneable - - - System.Runtime.Serialization.ISerializable - - - - - - System.Void - - - - - \ No newline at end of file diff --git a/mono/example/.cvsignore b/mono/example/.cvsignore deleted file mode 100644 index fb4e561d..00000000 --- a/mono/example/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -.deps -Makefile.in -Makefile -*.exe diff --git a/mono/example/BusListener.cs b/mono/example/BusListener.cs deleted file mode 100644 index d999360f..00000000 --- a/mono/example/BusListener.cs +++ /dev/null @@ -1,44 +0,0 @@ -namespace Foo -{ - using System; - using DBus; - using Gtk; - - public class BusListener - { - - static void OnNameOwnerChanged (string name, - string oldOwner, - string newOwner) - { - if (oldOwner == "") - Console.WriteLine ("{0} created by {1}", - name, newOwner); - else if (newOwner == "") - Console.WriteLine ("{0} released by {1}", - name, oldOwner); - else - Console.WriteLine ("{0} transfered from {1} to {2}", - name, oldOwner, newOwner); - } - - public static int Main (string [] args) - { - Application.Init (); - - Connection connection; - connection = Bus.GetSessionBus (); - - BusDriver driver = BusDriver.New (connection); - driver.NameOwnerChanged += new NameOwnerChangedHandler (OnNameOwnerChanged); - - Console.WriteLine ("Listening for name owner changes..."); - - Application.Run (); - - return 0; - } - } - - -} diff --git a/mono/example/EchoClient.cs b/mono/example/EchoClient.cs deleted file mode 100644 index dc20771a..00000000 --- a/mono/example/EchoClient.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Foo -{ - using System; - using DBus; - - public class EchoClient - { - public static int Main(string [] args) - { - Connection connection = Bus.GetSessionBus(); - Service service = Service.Get(connection, "org.freedesktop.Test"); - Echoer echoer = (Echoer) - service.GetObject(typeof(Echoer), "/org/freedesktop/Test/Echoer"); - System.Console.WriteLine(echoer.Echo("Hello world!")); - - return 0; - } - } -} diff --git a/mono/example/EchoServer.cs b/mono/example/EchoServer.cs deleted file mode 100644 index 243a2730..00000000 --- a/mono/example/EchoServer.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Foo -{ - using System; - using DBus; - using Gtk; - - public class EchoServer - { - public static int Main(string [] args) - { - Application.Init(); - - Connection connection = Bus.GetSessionBus(); - Service service = new Service(connection, "org.freedesktop.Test"); - Echoer echoer = new Echoer(); - service.RegisterObject(echoer, "/org/freedesktop/Test/Echoer"); - - Application.Run(); - - return 0; - } - } -} diff --git a/mono/example/Echoer.cs b/mono/example/Echoer.cs deleted file mode 100644 index bc5a843d..00000000 --- a/mono/example/Echoer.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Foo -{ - using System; - using DBus; - - [Interface("org.freedesktop.Test.Echoer")] - public class Echoer - { - [Method] - public virtual string Echo(string message) - { - System.Console.WriteLine("I received: " + message); - return "Reply: " + message; - } - } -} diff --git a/mono/example/Makefile.am b/mono/example/Makefile.am deleted file mode 100644 index 9a8ed68e..00000000 --- a/mono/example/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -NOINST_EXES=echo-server.exe echo-client.exe bus-listener.exe -DISTCLEANFILES=$(NOINST_EXES) $(NOINST_EXES:%=%.mdb) - -all: $(NOINST_EXES) - -echo-server.exe: EchoServer.cs Echoer.cs - $(CSC) --debug --target exe -L .. -r:../dbus-sharp.dll -pkg:gtk-sharp -o echo-server.exe $(srcdir)/EchoServer.cs $(srcdir)/Echoer.cs - -echo-client.exe: EchoClient.cs Echoer.cs - $(CSC) --debug --target exe -L .. -r:../dbus-sharp.dll -o echo-client.exe $(srcdir)/EchoClient.cs $(srcdir)/Echoer.cs - -bus-listener.exe: BusListener.cs - $(CSC) --debug --target exe -L .. -r:../dbus-sharp.dll -pkg:gtk-sharp -o bus-listener.exe $(srcdir)/BusListener.cs - - -clean: - rm -f $(NOINST_EXES) $(NOINST_EXES:%=%.mdb) - -install: all - -EXTRA_DIST=EchoServer.cs EchoClient.cs Echoer.cs BusListener.cs - diff --git a/python/.cvsignore b/python/.cvsignore deleted file mode 100644 index cce7eeaf..00000000 --- a/python/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -.deps -Makefile.in -Makefile -dbus_bindings.pxd -*.lo -*.la -dbus_bindings.c -dbus_glib_bindings.c -*.pyc -.libs diff --git a/python/Makefile.am b/python/Makefile.am deleted file mode 100644 index ea261cb1..00000000 --- a/python/Makefile.am +++ /dev/null @@ -1,56 +0,0 @@ -SUBDIRS=examples - -INCLUDES=-I$(srcdir)/$(top_builddir) -I$(srcdir)/$(top_builddir)/dbus $(DBUS_CLIENT_CFLAGS) $(PYTHON_INCLUDES) -DDBUS_COMPILATION=1 - -dbusmoduledir = $(pyexecdir) -dbusmodule_PYTHON = dbus.pth - -dbusdir = $(pyexecdir)/dbus -dbus_PYTHON = \ - __init__.py \ - _dbus.py \ - decorators.py \ - exceptions.py \ - service.py \ - proxies.py \ - _util.py \ - types.py \ - matchrules.py \ - glib.py \ - introspect_parser.py - -dbusbindingsdir = $(pyexecdir)/dbus -dbusbindings_LTLIBRARIES = dbus_bindings.la dbus_glib_bindings.la - -dbus_bindings_la_LDFLAGS = -module -avoid-version -fPIC -export-symbols-regex initdbus_bindings -dbus_bindings_la_LIBADD = $(top_builddir)/dbus/libdbus-1.la -nodist_dbus_bindings_la_SOURCES = dbus_bindings.c - -dbus_glib_bindings_la_LDFLAGS = -module -avoid-version -fPIC -export-symbols-regex initdbus_glib_bindings -dbus_glib_bindings_la_LIBADD = $(top_builddir)/dbus/libdbus-1.la $(top_builddir)/glib/libdbus-glib-1.la -dbus_glib_bindings_la_CFLAGS = $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) -nodist_dbus_glib_bindings_la_SOURCES = dbus_glib_bindings.c - - -EXTRA_DIST = \ - dbus_h_wrapper.h \ - dbus_bindings.pyx \ - dbus_glib_bindings.pyx \ - dbus_bindings.pxd.in \ - extract.py - -CLEANFILES = \ - dbus_bindings.pxd \ - dbus_bindings.c \ - dbus_glib_bindings.c - - -dbus_bindings.pxd: $(srcdir)/dbus_bindings.pxd.in $(srcdir)/extract.py - -$(PYTHON) $(srcdir)/extract.py $(srcdir)/dbus_bindings.pxd.in -I$(srcdir)/$(top_builddir) -I$(srcdir) > $@.tmp && mv $@.tmp $@ - -dbus_bindings.c: $(srcdir)/dbus_bindings.pyx dbus_bindings.pxd - pyrexc $(srcdir)/dbus_bindings.pyx -I. -o ./dbus_bindings.c - -dbus_glib_bindings.c: $(srcdir)/dbus_glib_bindings.pyx dbus_bindings.pxd - pyrexc $(srcdir)/dbus_glib_bindings.pyx -I. -o ./dbus_glib_bindings.c - diff --git a/python/__init__.py b/python/__init__.py deleted file mode 100644 index 7d937831..00000000 --- a/python/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from _dbus import * -from types import * - -version = (0, 51, 0) -_dbus_main_loop_setup_function = None diff --git a/python/_dbus.py b/python/_dbus.py deleted file mode 100644 index 7e17d9f6..00000000 --- a/python/_dbus.py +++ /dev/null @@ -1,308 +0,0 @@ - -"""Module for high-level communication over the FreeDesktop.org Bus (DBus) - -DBus allows you to share and access remote objects between processes -running on the desktop, and also to access system services (such as -the print spool). - -To use DBus, first get a Bus object, which provides a connection to one -of a few standard dbus-daemon instances that might be running. From the -Bus you can get a RemoteService. A service is provided by an application or -process connected to the Bus, and represents a set of objects. Once you -have a RemoteService you can get a RemoteObject that implements a specific interface -(an interface is just a standard group of member functions). Then you can call -those member functions directly. - -You can think of a complete method call as looking something like: - -Bus:SESSION -> Service:org.gnome.Evolution -> Object:/org/gnome/Evolution/Inbox -> Interface: org.gnome.Evolution.MailFolder -> Method: Forward('message1', 'seth@gnome.org') - -This communicates over the SESSION Bus to the org.gnome.Evolution process to call the -Forward method of the /org/gnome/Evolution/Inbox object (which provides the -org.gnome.Evolution.MailFolder interface) with two string arguments. - -For example, the dbus-daemon itself provides a service and some objects: - -# Get a connection to the desktop-wide SESSION bus -bus = dbus.Bus(dbus.Bus.TYPE_SESSION) - -# Get the service provided by the dbus-daemon named org.freedesktop.DBus -dbus_service = bus.get_service('org.freedesktop.DBus') - -# Get a reference to the desktop bus' standard object, denoted -# by the path /org/freedesktop/DBus. The object /org/freedesktop/DBus -# implements the 'org.freedesktop.DBus' interface -dbus_object = dbus_service.get_object('/org/freedesktop/DBus', - 'org.freedesktop.DBus') - -# One of the member functions in the org.freedesktop.DBus interface -# is ListServices(), which provides a list of all the other services -# registered on this bus. Call it, and print the list. -print(dbus_object.ListServices()) -""" - -import dbus -import dbus_bindings -import weakref - -from proxies import * -from exceptions import * -from matchrules import * - -class Bus(object): - """A connection to a DBus daemon. - - One of three possible standard buses, the SESSION, SYSTEM, - or STARTER bus - """ - TYPE_SESSION = dbus_bindings.BUS_SESSION - TYPE_SYSTEM = dbus_bindings.BUS_SYSTEM - TYPE_STARTER = dbus_bindings.BUS_STARTER - - """bus_type=[Bus.TYPE_SESSION | Bus.TYPE_SYSTEM | Bus.TYPE_STARTER] - """ - - ProxyObjectClass = ProxyObject - - START_REPLY_SUCCESS = dbus_bindings.DBUS_START_REPLY_SUCCESS - START_REPLY_ALREADY_RUNNING = dbus_bindings.DBUS_START_REPLY_ALREADY_RUNNING - - _shared_instances = weakref.WeakValueDictionary() - - def __new__(cls, bus_type=TYPE_SESSION, use_default_mainloop=True, private=False): - if (not private and bus_type in cls._shared_instances): - return cls._shared_instances[bus_type] - - # this is a bit odd, but we create instances of the subtypes - # so we can return the shared instances if someone tries to - # construct one of them (otherwise we'd eg try and return an - # instance of Bus from __new__ in SessionBus). why are there - # three ways to construct this class? we just don't know. - if bus_type == cls.TYPE_SESSION: - subclass = SessionBus - elif bus_type == cls.TYPE_SYSTEM: - subclass = SystemBus - elif bus_type == cls.TYPE_STARTER: - subclass = StarterBus - else: - raise ValueError('invalid bus_type %s' % bus_type) - - bus = object.__new__(subclass) - - bus._bus_type = bus_type - bus._bus_names = weakref.WeakValueDictionary() - bus._match_rule_tree = SignalMatchTree() - - # FIXME: if you get a starter and a system/session bus connection - # in the same process, it's the same underlying connection that - # is returned by bus_get, but we initialise it twice - bus._connection = dbus_bindings.bus_get(bus_type, private) - bus._connection.add_filter(bus._signal_func) - - if use_default_mainloop: - func = getattr(dbus, "_dbus_mainloop_setup_function", None) - if func: - func(bus) - - if not private: - cls._shared_instances[bus_type] = bus - - return bus - - def __init__(self, *args, **keywords): - # do nothing here because this can get called multiple times on the - # same object if __new__ returns a shared instance - pass - - def close(self): - self._connection.close() - - def get_connection(self): - return self._connection - - def get_session(private=False): - """Static method that returns the session bus""" - return SessionBus(private=private) - - get_session = staticmethod(get_session) - - def get_system(private=False): - """Static method that returns the system bus""" - return SystemBus(private=private) - - get_system = staticmethod(get_system) - - - def get_starter(private=False): - """Static method that returns the starter bus""" - return StarterBus(private=private) - - get_starter = staticmethod(get_starter) - - - def get_object(self, named_service, object_path): - """Get a proxy object to call over the bus""" - return self.ProxyObjectClass(self, named_service, object_path) - - def _create_args_dict(self, keywords): - args_dict = None - for (key, value) in keywords.iteritems(): - if key.startswith('arg'): - try: - snum = key[3:] - num = int(snum) - - if not args_dict: - args_dict = {} - - args_dict[num] = value - except ValueError: - raise TypeError("Invalid arg index %s"%snum) - elif key in ("sender_keyword", "path_keyword"): - pass - else: - raise TypeError("Unknown keyword %s"%(key)) - - return args_dict - - def add_signal_receiver(self, handler_function, - signal_name=None, - dbus_interface=None, - named_service=None, - path=None, - **keywords): - - args_dict = self._create_args_dict(keywords) - - if (named_service and named_service[0] != ':'): - bus_object = self.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') - named_service = bus_object.GetNameOwner(named_service, dbus_interface='org.freedesktop.DBus') - - match_rule = SignalMatchRule(signal_name, dbus_interface, named_service, path) - - for kw in ("sender_keyword", "path_keyword"): - if kw in keywords: - setattr(match_rule, kw, keywords[kw]) - else: - setattr(match_rule, kw, None) - - if args_dict: - match_rule.add_args_match(args_dict) - - match_rule.add_handler(handler_function) - - self._match_rule_tree.add(match_rule) - - dbus_bindings.bus_add_match(self._connection, repr(match_rule)) - - def remove_signal_receiver(self, handler_function, - signal_name=None, - dbus_interface=None, - named_service=None, - path=None, - **keywords): - - args_dict = self._create_args_dict(keywords) - - if (named_service and named_service[0] != ':'): - bus_object = self.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') - named_service = bus_object.GetNameOwner(named_service, dbus_interface='org.freedesktop.DBus') - - match_rule = SignalMatchRule(signal_name, dbus_interface, named_service, path) - - if (args_dict): - match_rule.add_args_match(args_dict) - - if (handler_function): - match_rule.add_handler(handler_function) - - self._match_rule_tree.remove(match_rule) - - #TODO we leak match rules in the lower level bindings. We need to ref count them - - def get_unix_user(self, named_service): - """Get the unix user for the given named_service on this Bus""" - return dbus_bindings.bus_get_unix_user(self._connection, named_service) - - def _signal_func(self, connection, message): - if (message.get_type() != dbus_bindings.MESSAGE_TYPE_SIGNAL): - return dbus_bindings.HANDLER_RESULT_NOT_YET_HANDLED - - dbus_interface = message.get_interface() - named_service = message.get_sender() - path = message.get_path() - signal_name = message.get_member() - - match_rule = SignalMatchRule(signal_name, dbus_interface, named_service, path) - - self._match_rule_tree.exec_matches(match_rule, message) - - def start_service_by_name(self, named_service): - return dbus_bindings.bus_start_service_by_name(self._connection, named_service) - - def __repr__(self): - if self._bus_type == self.TYPE_SESSION: - name = 'SESSION' - elif self._bus_type == self.TYPE_SYSTEM: - name = 'SYSTEM' - elif self._bus_type == self.TYPE_STARTER: - name = 'STARTER' - else: - assert False, 'Unable to represent unknown bus type.' - - return '' % (name, id(self)) - __str__ = __repr__ - -class SystemBus(Bus): - """The system-wide message bus - """ - def __new__(cls, use_default_mainloop=True, private=False): - return Bus.__new__(cls, Bus.TYPE_SYSTEM, use_default_mainloop, private) - -class SessionBus(Bus): - """The session (current login) message bus - """ - def __new__(cls, use_default_mainloop=True, private=False): - return Bus.__new__(cls, Bus.TYPE_SESSION, use_default_mainloop, private) - -class StarterBus(Bus): - """The bus that activated this process (if - this process was launched by DBus activation) - """ - def __new__(cls, use_default_mainloop=True, private=False): - return Bus.__new__(cls, Bus.TYPE_STARTER, use_default_mainloop, private) - -class Interface: - """An interface into a remote object - - An Interface can be used to wrap ProxyObjects - so that calls can be routed to their correct - dbus interface - """ - - def __init__(self, object, dbus_interface): - self._obj = object - self._dbus_interface = dbus_interface - - def connect_to_signal(self, signal_name, handler_function, dbus_interface = None, **keywords): - if not dbus_interface: - dbus_interface = self._dbus_interface - - self._obj.connect_to_signal(signal_name, handler_function, dbus_interface, **keywords) - - def __getattr__(self, member, **keywords): - if (keywords.has_key('dbus_interface')): - _dbus_interface = keywords['dbus_interface'] - else: - _dbus_interface = self._dbus_interface - - if member == '__call__': - return object.__call__ - else: - ret = self._obj.__getattr__(member, dbus_interface=_dbus_interface) - return ret - - def __repr__(self): - return ''%( - self._obj, self._dbus_interface, id(self)) - __str__ = __repr__ diff --git a/python/_util.py b/python/_util.py deleted file mode 100644 index c254178e..00000000 --- a/python/_util.py +++ /dev/null @@ -1,13 +0,0 @@ -import re -from exceptions import ValidationException - -def _validate_interface_or_name(value): - elements = value.split('.') - if len(elements) <= 1: - raise ValidationException("%s must contain at least two elements seperated by a period ('.')"%(value)) - - validate = re.compile('[A-Za-z][\w_]*') - for element in elements: - if not validate.match(element): - raise ValidationException("Element %s of %s has invalid characters"%(element ,value)) - diff --git a/python/dbus.pth b/python/dbus.pth deleted file mode 100644 index e2182f1e..00000000 --- a/python/dbus.pth +++ /dev/null @@ -1 +0,0 @@ -dbus diff --git a/python/dbus_bindings.pxd.in b/python/dbus_bindings.pxd.in deleted file mode 100644 index f1707208..00000000 --- a/python/dbus_bindings.pxd.in +++ /dev/null @@ -1,8 +0,0 @@ -#include "dbus_h_wrapper.h" - -cdef class Connection: - cdef DBusConnection *conn - - cdef __cinit__(self, address, DBusConnection *_conn) - cdef _set_conn(self, DBusConnection *conn) - cdef DBusConnection *_get_conn(self) diff --git a/python/dbus_bindings.pyx b/python/dbus_bindings.pyx deleted file mode 100644 index c29dea2d..00000000 --- a/python/dbus_bindings.pyx +++ /dev/null @@ -1,1849 +0,0 @@ -# -*- Mode: Python -*- - -# jdahlin is the most coolest and awesomest person in the world -# and wrote all the good parts of this code. all the bad parts -# where python conditionals have a ( ) around them, thus violating -# PEP-8 were written by the lame wannabe python programmer seth - -#FIXME: find memory leaks that I am sure exist - -cdef extern from "sys/types.h": - ctypedef size_t - ctypedef __int64_t - ctypedef __uint64_t - -cdef extern from "stdlib.h": - cdef void *malloc(size_t size) - cdef void free(void *ptr) - cdef void *calloc(size_t nmemb, size_t size) - -cdef extern from "Python.h": - void Py_XINCREF (object) - void Py_XDECREF (object) - object PyString_FromStringAndSize(char *, int) - ctypedef void *PyGILState_STATE - void PyErr_Clear() - PyGILState_STATE PyGILState_Ensure() - void PyGILState_Release(PyGILState_STATE) - -ctypedef struct DBusError: - char *name - char *message - unsigned int dummy1 - unsigned int dummy2 - unsigned int dummy3 - unsigned int dummy4 - unsigned int dummy5 - void *padding1 - -ctypedef struct DBusMessageIter: - void *dummy1 - void *dummy2 - dbus_uint32_t dummy3 - int dummy4 - int dummy5 - int dummy6 - int dummy7 - int dummy8 - int dummy9 - int dummy10 - int dummy11 - int pad1 - int pad2 - void *pad3 - -ctypedef struct DBusObjectPathVTable: - DBusObjectPathUnregisterFunction unregister_function - DBusObjectPathMessageFunction message_function - void (* dbus_internal_pad1) (void *) - void (* dbus_internal_pad2) (void *) - void (* dbus_internal_pad3) (void *) - void (* dbus_internal_pad4) (void *) - -class DBusException(Exception): - pass - -class ConnectionError(Exception): - pass - -class ObjectPath(str): - def __init__(self, value): - str.__init__(self, value) - -class ByteArray(str): - def __init__(self, value): - str.__init__(self, value) - -class SignatureIter(object): - def __init__(self, string): - object.__init__(self) - self.remaining = string - - def next(self): - if self.remaining == '': - raise StopIteration - - signature = self.remaining - block_depth = 0 - block_type = None - end = len(signature) - - for marker in range(0, end): - cur_sig = ord(signature[marker]) - - if cur_sig == TYPE_ARRAY: - pass - elif cur_sig == DICT_ENTRY_BEGIN or cur_sig == STRUCT_BEGIN: - if block_type == None: - block_type = cur_sig - - if block_type == cur_sig: - block_depth = block_depth + 1 - - elif cur_sig == DICT_ENTRY_END: - if block_type == DICT_ENTRY_BEGIN: - block_depth = block_depth - 1 - - if block_depth == 0: - end = marker - break - - elif cur_sig == STRUCT_END: - if block_type == STRUCT_BEGIN: - block_depth = block_depth - 1 - - if block_depth == 0: - end = marker - break - - else: - if block_depth == 0: - end = marker - break - - end = end + 1 - self.remaining = signature[end:] - return Signature(signature[0:end]) - -class Signature(str): - """An iterable method signature. Iterating gives the signature of each - argument in turn.""" - def __init__(self, value): - return str.__init__(self, value) - - def __iter__(self): - return SignatureIter(self) - -class VariantSignature(object): - """A fake method signature which when iterated, is an endless stream - of variants (handy with zip()). It has no string representation.""" - def __iter__(self): - return self - - def next(self): - return 'v' - -class Byte(int): - def __init__(self, value): - int.__init__(self, value) - -class Boolean(int): - def __init__(self, value): - int.__init__(self, value) - -class Int16(int): - def __init__(self, value): - int.__init__(self, value) - -class UInt16(int): - def __init__(self, value): - if value < 0: - raise TypeError('Unsigned integers must not have a negitive value') - int.__init__(self, value) - -class Int32(int): - def __init__(self, value): - int.__init__(self, value) - -class UInt32(long): - def __init__(self, value): - if value < 0: - raise TypeError('Unsigned integers must not have a negitive value') - long.__init__(self, value) - -class Int64(long): - def __init__(self, value): - long.__init__(self, value) - -class UInt64(long): - def __init__(self, value): - if value < 0: - raise TypeError('Unsigned integers must not have a negitive value') - long.__init__(self, value) - -class Double(float): - def __init__(self, value): - float.__init__(self, value) - -class String(unicode): - def __init__(self, value): - unicode.__init__(self, value) - -class Array(list): - def __init__(self, value, type=None, signature=None): - if signature and type: - raise TypeError('Can not mix type and signature arguments in a D-BUS Array') - - self.type = type - self.signature = signature - list.__init__(self, value) - -class Variant: - def __init__(self, value, type=None, signature=None): - self.value = value - if signature and type: - raise TypeError('Can not mix type and signature arguments in a D-BUS Variant') - - self.type = type - self.signature = signature - - def __repr__(self): - return repr(self.value) - - def __str__(self): - return str(self.value) - -class Struct(tuple): - def __init__(self, value): - tuple.__init__(self, value) - -class Dictionary(dict): - def __init__(self, value, key_type=None, value_type=None, signature=None): - if key_type and not value_type: - raise TypeError('When specifying a key_type you must also have a value_type in a D-BUS Dictionary') - elif value_type and not key_type: - raise TypeError('When specifying a value_type you must also have a key_type in a D-BUS Dictionary') - elif key_type and signature: - raise TypeError('Can not mix type arguments with signature arguments in a D-BUS Dictionary') - - self.key_type = key_type - self.value_type = value_type - self.signature = signature - dict.__init__(self, value) - -#forward delcerations -cdef class Message -cdef class PendingCall -cdef class Watch -cdef class MessageIter - -cdef void _GIL_safe_cunregister_function_handler (DBusConnection *connection, - void *user_data): - cdef Connection conn - - tup = user_data - assert (type(tup) == tuple) - function = tup[1] - conn = Connection() - conn.__cinit__(None, connection) - - args = (conn) - function(*args) - Py_XDECREF(tup) - -cdef void cunregister_function_handler (DBusConnection *connection, - void *user_data): - cdef PyGILState_STATE gil - gil = PyGILState_Ensure() - try: - _GIL_safe_cunregister_function_handler (connection, user_data); - finally: - PyGILState_Release(gil) - - - -cdef DBusHandlerResult _GIL_safe_cmessage_function_handler ( - DBusConnection *connection, - DBusMessage *msg, - void *user_data): - cdef Connection conn - cdef Message message - - tup = user_data - assert (type(tup) == tuple) - function = tup[0] - message = EmptyMessage() - - #we don't own the message so we need to ref it - dbus_message_ref(msg) - message._set_msg(msg) - conn = Connection() - conn.__cinit__(None, connection) - args = (conn, - message) - - retval = function(*args) - - if (retval == None): - retval = DBUS_HANDLER_RESULT_HANDLED - return retval - -cdef DBusHandlerResult cmessage_function_handler (DBusConnection *connection, - DBusMessage *msg, - void *user_data): - cdef PyGILState_STATE gil - gil = PyGILState_Ensure() - try: - return _GIL_safe_cmessage_function_handler (connection, msg, user_data); - finally: - PyGILState_Release(gil) - - -cdef class Connection: - def __init__(self, address=None, Connection _conn=None): - cdef DBusConnection *c_conn - cdef char *c_address - c_conn=NULL - self.conn = NULL - if (_conn != None): - c_conn = _conn.conn - - if (address != None or _conn != None): - self.__cinit__(c_address, c_conn) - - # hack to be able to pass in a c pointer to the constructor - # while still alowing python programs to create a Connection object - cdef __cinit__(self, address, DBusConnection *_conn): - cdef DBusError error - dbus_error_init(&error) - if _conn != NULL: - self.conn = _conn - dbus_connection_ref(self.conn) - else: - self.conn = dbus_connection_open(address, - &error) - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free (&error) - raise DBusException, errormsg - - def __dealloc__(self): - if self.conn != NULL: - dbus_connection_unref(self.conn) - - cdef _set_conn(self, DBusConnection *conn): - self.conn = conn - - cdef DBusConnection *_get_conn(self): - return self.conn - - def get_unique_name(self): - return bus_get_unique_name(self) - - def close(self): - dbus_connection_close(self.conn) - - def get_is_connected(self): - return dbus_connection_get_is_connected(self.conn) - - def get_is_authenticated(self): - return dbus_connection_get_is_authenticated(self.conn) - - def flush(self): - dbus_connection_flush(self.conn) - - def borrow_message(self): - cdef Message m - m = EmptyMessage() - m._set_msg(dbus_connection_borrow_message(self.conn)) - return m - - def return_message(self, Message message): - cdef DBusMessage *msg - msg = message._get_msg() - dbus_connection_return_message(self.conn, msg) - - def steal_borrowed_message(self, Message message): - cdef DBusMessage *msg - msg = message._get_msg() - dbus_connection_steal_borrowed_message(self.conn, - msg) - - def pop_message(self): - cdef DBusMessage *msg - cdef Message m - - msg = dbus_connection_pop_message(self.conn) - if msg != NULL: - m = EmptyMessage() - m._set_msg(msg) - else: - m = None - return m - - def get_dispatch_status(self): - return dbus_connection_get_dispatch_status(self.conn) - - def dispatch(self): - return dbus_connection_dispatch(self.conn) - - def send(self, Message message): - #cdef dbus_uint32_t client_serial - #if type(message) != Message: - # raise TypeError - cdef DBusMessage *msg - msg = message._get_msg() - retval = dbus_connection_send(self.conn, - msg, - NULL) - return retval - - def send_with_reply_handlers(self, Message message, timeout_milliseconds, reply_handler, error_handler): - retval = False - try: - (retval, pending_call) = self.send_with_reply(message, timeout_milliseconds) - if pending_call: - pending_call.set_notify(reply_handler, error_handler) - except Exception, e: - error_handler(e) - - return (retval, pending_call) - - def send_with_reply(self, Message message, timeout_milliseconds): - cdef dbus_bool_t retval - cdef DBusPendingCall *cpending_call - cdef DBusMessage *msg - cdef PendingCall pending_call - - cpending_call = NULL - - msg = message._get_msg() - - retval = dbus_connection_send_with_reply(self.conn, - msg, - &cpending_call, - timeout_milliseconds) - - if (cpending_call != NULL): - pending_call = PendingCall() - pending_call.__cinit__(cpending_call) - else: - pending_call = None - - return (retval, pending_call) - - def send_with_reply_and_block(self, Message message, - timeout_milliseconds=-1): - cdef DBusMessage * retval - cdef DBusError error - cdef DBusMessage *msg - cdef Message m - - dbus_error_init(&error) - - msg = message._get_msg() - - retval = dbus_connection_send_with_reply_and_block( - self.conn, - msg, - timeout_milliseconds, - &error) - - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free (&error) - raise DBusException, errormsg - - assert(retval != NULL) - - m = EmptyMessage() - m._set_msg(retval) - - return m - - def set_watch_functions(self, add_function, remove_function, data): - pass - - def set_timeout_functions(self, add_function, remove_function, data): - pass - - def set_wakeup_main_function(self, wakeup_main_function, data): - pass - - # FIXME: set_dispatch_status_function, get_unix_user, set_unix_user_function - - def add_filter(self, filter_function): - user_data = (filter_function,) - Py_XINCREF(user_data) - - return dbus_connection_add_filter(self.conn, - cmessage_function_handler, - user_data, - NULL) - - - #FIXME: remove_filter - # this is pretty tricky, we want to only remove the filter - # if we truly have no more calls to our message_function_handler...ugh - - def set_data(self, slot, data): - pass - - def get_data(self, slot): - pass - - def set_max_message_size(self, size): - dbus_connection_set_max_message_size(self.conn, size) - - def get_max_message_size(self): - return dbus_connection_get_max_message_size(self.conn) - - def set_max_received_size(self, size): - dbus_connection_set_max_received_size(self.conn, size) - - def get_max_received_size(self): - return dbus_connection_get_max_received_size(self.conn) - - def get_outgoing_size(self): - return dbus_connection_get_outgoing_size(self.conn) - - # preallocate_send, free_preallocated_send, send_preallocated - - def register_object_path(self, path, unregister_cb, message_cb): - cdef DBusObjectPathVTable cvtable - - cvtable.unregister_function = cunregister_function_handler - cvtable.message_function = cmessage_function_handler - - user_data = (message_cb, unregister_cb) - Py_XINCREF(user_data) - - return dbus_connection_register_object_path(self.conn, path, &cvtable, - user_data) - - def register_fallback(self, path, unregister_cb, message_cb): - cdef DBusObjectPathVTable cvtable - - cvtable.unregister_function = cunregister_function_handler - cvtable.message_function = cmessage_function_handler - - user_data = (message_cb, unregister_cb) - Py_XINCREF(user_data) - - return dbus_connection_register_fallback(self.conn, path, &cvtable, - user_data) - - #FIXME: unregister_object_path , see problems with remove_filter - - def list_registered (self, parent_path): - cdef char **cchild_entries - cdef dbus_bool_t retval - - retval = dbus_connection_list_registered(self.conn, parent_path, &cchild_entries) - - if (not retval): - #FIXME: raise out of memory exception? - return None - - i = 0 - child_entries = [] - - while (cchild_entries[i] != NULL): - child_entries.append(cchild_entries[i]) - i = i + 1 - - dbus_free_string_array(cchild_entries) - - return child_entries - -cdef void _GIL_safe_pending_call_notification (DBusPendingCall *pending_call, - void *user_data): - cdef DBusMessage *dbus_message - cdef Message message - - (reply_handler, error_handler) = user_data - - dbus_message = dbus_pending_call_steal_reply(pending_call) - message = EmptyMessage() - message._set_msg(dbus_message) - - type = message.get_type() - - if type == MESSAGE_TYPE_METHOD_RETURN: - args = message.get_args_list() - reply_handler(*args) - elif type == MESSAGE_TYPE_ERROR: - args = message.get_args_list() - if len(args) > 0: - error_handler(DBusException(args[0])) - else: - error_handler(DBusException("")) - else: - error_handler(DBusException('Unexpected Message Type: ' + message.type_to_name(type))) - - dbus_pending_call_unref(pending_call) - Py_XDECREF(user_data) - -cdef void _pending_call_notification(DBusPendingCall *pending_call, - void *user_data): - cdef PyGILState_STATE gil - gil = PyGILState_Ensure() - try: - _GIL_safe_pending_call_notification (pending_call, user_data); - finally: - PyGILState_Release(gil) - -cdef void _pending_call_free_user_data(void *data): - call_tuple = data - Py_XDECREF(call_tuple) - -cdef class PendingCall: - cdef DBusPendingCall *pending_call - - def __init__(self, PendingCall _pending_call=None): - self.pending_call = NULL - if (_pending_call != None): - self.__cinit__(_pending_call.pending_call) - - cdef void __cinit__(self, DBusPendingCall *_pending_call): - self.pending_call = _pending_call - dbus_pending_call_ref(self.pending_call) - - def __dealloc__(self): - if self.pending_call != NULL: - dbus_pending_call_unref(self.pending_call) - - cdef DBusPendingCall *_get_pending_call(self): - return self.pending_call - - def cancel(self): - dbus_pending_call_cancel(self.pending_call) - - def get_completed(self): - return dbus_pending_call_get_completed(self.pending_call) - - def get_reply(self): - cdef Message message - message = EmptyMessage() - message._set_msg(dbus_pending_call_steal_reply(self.pending_call)) - return message - - def block(self): - dbus_pending_call_block(self.pending_call) - - def set_notify(self, reply_handler, error_handler): - user_data = (reply_handler, error_handler) - Py_XINCREF(user_data) - dbus_pending_call_ref(self.pending_call) - dbus_pending_call_set_notify(self.pending_call, _pending_call_notification, - user_data, _pending_call_free_user_data) - - -cdef class Watch: - cdef DBusWatch* watch - - def __init__(self): - pass - - cdef __cinit__(self, DBusWatch *cwatch): - self.watch = cwatch - - def get_fd(self): - return dbus_watch_get_fd(self.watch) - - # FIXME: not picked up correctly by extract.py - #def get_flags(self): - # return dbus_watch_get_flags(self.watch) - - def handle(self, flags): - return dbus_watch_handle(self.watch, flags) - - def get_enabled(self): - return dbus_watch_get_enabled(self.watch) - -cdef class MessageIter: - cdef DBusMessageIter *iter - cdef DBusMessageIter real_iter - cdef dbus_uint32_t level - - def __init__(self, level=0): - self.iter = &self.real_iter - self.level = level - if(self.level > 32): - raise TypeError, 'Type recurion is too deep' - - cdef __cinit__(self, DBusMessageIter *iter): - self.real_iter = iter[0] - - cdef DBusMessageIter *_get_iter(self): - return self.iter - - def has_next(self): - return dbus_message_iter_has_next(self.iter) - - def next(self): - return dbus_message_iter_next(self.iter) - - def get(self, arg_type=None): - if(arg_type == None): - arg_type = self.get_arg_type() - - if arg_type == TYPE_INVALID: - raise TypeError, 'Invalid arg type in MessageIter' - elif arg_type == TYPE_STRING: - retval = self.get_string() - elif arg_type == TYPE_INT16: - retval = self.get_int16() - elif arg_type == TYPE_UINT16: - retval = self.get_uint16() - elif arg_type == TYPE_INT32: - retval = self.get_int32() - elif arg_type == TYPE_UINT32: - retval = self.get_uint32() - elif arg_type == TYPE_INT64: - retval = self.get_int64() - elif arg_type == TYPE_UINT64: - retval = self.get_uint64() - elif arg_type == TYPE_DOUBLE: - retval = self.get_double() - elif arg_type == TYPE_BYTE: - retval = self.get_byte() - elif arg_type == TYPE_BOOLEAN: - retval = self.get_boolean() - elif arg_type == TYPE_SIGNATURE: - retval = self.get_signature() - elif arg_type == TYPE_ARRAY: - array_type = self.get_element_type() - if array_type == TYPE_DICT_ENTRY: - retval = self.get_dict() - else: - retval = self.get_array(array_type) - elif arg_type == TYPE_OBJECT_PATH: - retval = self.get_object_path() - elif arg_type == TYPE_STRUCT: - retval = self.get_struct() - elif arg_type == TYPE_VARIANT: - retval = self.get_variant() - elif arg_type == TYPE_DICT_ENTRY: - raise TypeError, 'Dictionary Entries can only appear as part of an array container' - else: - raise TypeError, 'Unknown arg type %d in MessageIter' % (arg_type) - - return retval - - def get_arg_type(self): - return dbus_message_iter_get_arg_type(self.iter) - - def get_element_type(self): - return dbus_message_iter_get_element_type(self.iter) - - def get_byte(self): - cdef unsigned char c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_boolean(self): - cdef dbus_bool_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - - if c_val: - return True - else: - return False - - def get_signature(self): - signature_string = self.get_string() - return Signature(signature_string) - - def get_int16(self): - cdef dbus_int16_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - - return c_val - - def get_uint16(self): - cdef dbus_uint16_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_int32(self): - cdef dbus_int32_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_uint32(self): - cdef dbus_uint32_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_int64(self): - cdef dbus_int64_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_uint64(self): - cdef dbus_uint64_t c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_double(self): - cdef double c_val - dbus_message_iter_get_basic(self.iter, &c_val) - return c_val - - def get_string(self): - cdef char *c_str - dbus_message_iter_get_basic(self.iter, &c_str) - ret = c_str.decode('utf8') - - return ret - - def get_object_path(self): - object_path_string = self.get_string() - return ObjectPath(object_path_string) - - def get_dict(self): - cdef DBusMessageIter c_dict_iter - cdef MessageIter dict_iter - level = self.level + 1 - - dbus_message_iter_recurse(self.iter, &c_dict_iter) - dict_iter = MessageIter(level) - dict_iter.__cinit__(&c_dict_iter) - - python_dict = {} - cur_arg_type = dict_iter.get_arg_type() - while cur_arg_type == TYPE_DICT_ENTRY: - if cur_arg_type != TYPE_DICT_ENTRY: - raise TypeError, "Dictionary elements must be of type TYPE_DICT_ENTRY '%s != %s'" % (TYPE_DICT_ENTRY, cur_arg_type) - - dict_entry = dict_iter.get_struct() - if len(dict_entry) != 2: - raise TypeError, "Dictionary entries must be structs of two elements. This entry had %i elements.'" % (len(dict_entry)) - - python_dict[dict_entry[0]] = dict_entry[1] - - dict_iter.next() - cur_arg_type = dict_iter.get_arg_type() - - return python_dict - - def get_array(self, type): - cdef DBusMessageIter c_array_iter - cdef MessageIter array_iter - level = self.level + 1 - - dbus_message_iter_recurse(self.iter, &c_array_iter) - array_iter = MessageIter(level) - array_iter.__cinit__(&c_array_iter) - - python_list = [] - cur_arg_type = array_iter.get_arg_type() - while cur_arg_type != TYPE_INVALID: - if cur_arg_type != type: - raise TypeError, "Array elements must be of the same type '%s != %s'" % (type, cur_arg_type) - - value = array_iter.get(type) - python_list.append(value) - - array_iter.next() - cur_arg_type = array_iter.get_arg_type() - - return python_list - - def get_variant(self): - cdef DBusMessageIter c_var_iter - cdef MessageIter var_iter - level = self.level + 1 - - dbus_message_iter_recurse(self.iter, &c_var_iter) - var_iter = MessageIter(level) - var_iter.__cinit__(&c_var_iter) - - return var_iter.get() - - def get_struct(self): - cdef DBusMessageIter c_struct_iter - cdef MessageIter struct_iter - level = self.level + 1 - - dbus_message_iter_recurse(self.iter, &c_struct_iter) - struct_iter = MessageIter(level) - struct_iter.__cinit__(&c_struct_iter) - - python_list = [] - while struct_iter.get_arg_type() != TYPE_INVALID: - value = struct_iter.get() - python_list.append(value) - - struct_iter.next() - - return tuple(python_list) - - def python_value_to_dbus_sig(self, value, level = 0): - - if(level > 32): - raise TypeError, 'Type recurion is too deep' - - level = level + 1 - - ptype = type(value) - ret = "" - if ptype == bool: - ret = TYPE_BOOLEAN - ret = str(chr(ret)) - elif ptype == int: - ret = TYPE_INT32 - ret = str(chr(ret)) - elif ptype == long: - ret = TYPE_INT64 - ret = str(chr(ret)) - elif (ptype == str or ptype == unicode): - ret = TYPE_STRING - ret = str(chr(ret)) - elif ptype == float: - ret = TYPE_DOUBLE - ret = str(chr(ret)) - elif ptype == dict: - dict_list = value.items() - key, value = dict_list[0] - - ret = str(chr(TYPE_ARRAY)) + str(chr(DICT_ENTRY_BEGIN)) - ret = ret + self.python_value_to_dbus_sig(key, level) - ret = ret + self.python_value_to_dbus_sig(value, level) - ret = ret + str(chr(DICT_ENTRY_END)) - - elif ptype == tuple: - ret = str(chr(STRUCT_BEGIN)) - for item in value: - ret = ret + self.python_value_to_dbus_sig(item, level) - ret = ret + str(chr(STRUCT_END)) - elif ptype == list: - ret = str(chr(TYPE_ARRAY)) - ret = ret + self.python_value_to_dbus_sig(value[0], level) - elif isinstance(value, ObjectPath) or value == ObjectPath: - - ret = TYPE_OBJECT_PATH - ret = str(chr(ret)) - elif isinstance(value, ByteArray) or value == ByteArray: - ret = str(chr(TYPE_ARRAY)) + str(chr(TYPE_BYTE)) - elif isinstance(value, Signature) or value == Signature: - ret = TYPE_SIGNATURE - ret = str(chr(ret)) - elif isinstance(value, Byte) or value == Byte: - ret = TYPE_BYTE - ret = str(chr(ret)) - elif isinstance(value, Boolean) or value == Boolean: - ret = TYPE_BOOLEAN - ret = str(chr(ret)) - elif isinstance(value, Int16) or value == Int16: - ret = TYPE_INT16 - ret = str(chr(ret)) - elif isinstance(value, UInt16) or value == UInt16: - ret = TYPE_UINT16 - ret = str(chr(ret)) - elif isinstance(value, Int32) or value == Int32: - ret = TYPE_INT32 - ret = str(chr(ret)) - elif isinstance(value, UInt32) or value == UInt32: - ret = TYPE_UINT32 - ret = str(chr(ret)) - elif isinstance(value, Int64) or value == Int64: - ret = TYPE_INT64 - ret = str(chr(ret)) - elif isinstance(value, UInt64) or value == UInt64: - ret = TYPE_UINT64 - ret = str(chr(ret)) - elif isinstance(value, Double) or value == Double: - ret = TYPE_DOUBLE - ret = str(chr(ret)) - elif isinstance(value, String) or value == String: - ret = TYPE_STRING - ret = str(chr(ret)) - elif isinstance(value, Array): - ret = str(chr(TYPE_ARRAY)) - if value.type == None: - if value.signature: - ret = ret + value.signature - else: - ret = ret + self.python_value_to_dbus_sig(value[0], level) - else: - ret = ret + self.python_value_to_dbus_sig(value.type, level) - - elif isinstance(value, Struct) or value == Struct: - ret = str(chr(STRUCT_BEGIN)) - for item in value: - ret = ret + self.python_value_to_dbus_sig(item, level) - ret = ret + str(chr(STRUCT_END)) - elif isinstance(value, Dictionary): - ret = str(chr(TYPE_ARRAY)) + str(chr(DICT_ENTRY_BEGIN)) - - if value.key_type and value.value_type: - ret = ret + self.python_value_to_dbus_sig(value.key_type, level) - ret = ret + self.python_value_to_dbus_sig(value.value_type, level) - elif value.signature: - ret = ret + value.signature - else: - dict_list = value.items() - - key, val = dict_list[0] - ret = ret + self.python_value_to_dbus_sig(key, level) - ret = ret + self.python_value_to_dbus_sig(val, level) - - ret = ret + str(chr(DICT_ENTRY_END)) - elif isinstance(value, Variant) or value == Variant: - ret = ret + str(chr(TYPE_VARIANT)) - else: - raise TypeError, "Argument of unknown type '%s'" % (ptype) - - return ret - - def append_strict(self, value, sig): - - if sig == TYPE_INVALID or sig == None: - raise TypeError, 'Invalid arg type sent to append_strict' - - sig_type = ord(sig[0]) - - if sig_type == TYPE_STRING: - retval = self.append_string(value) - elif sig_type == TYPE_INT16: - retval = self.append_int16(value) - elif sig_type == TYPE_UINT16: - retval = self.append_uint16(value) - elif sig_type == TYPE_INT32: - retval = self.append_int32(value) - elif sig_type == TYPE_UINT32: - retval = self.append_uint32(value) - elif sig_type == TYPE_INT64: - retval = self.append_int64(value) - elif sig_type == TYPE_UINT64: - retval = self.append_uint64(value) - elif sig_type == TYPE_DOUBLE: - retval = self.append_double(value) - elif sig_type == TYPE_BYTE: - retval = self.append_byte(value) - elif sig_type == TYPE_BOOLEAN: - retval = self.append_boolean(value) - elif sig_type == TYPE_SIGNATURE: - retval = self.append_signature(value) - elif sig_type == TYPE_ARRAY: - if len(sig) < 2: - raise TypeError, "Invalid array signature in append_strict. Arrays must be followed by a type." - - array_type = ord(sig[1]) - if array_type == DICT_ENTRY_BEGIN: - if ord(sig[-1]) != DICT_ENTRY_END: - raise TypeError, "Invalid dict entry in append_strict. No termination in signature %s."%(sig) - - tmp_sig = sig[2:-1] - retval = self.append_dict(Dictionary(value, signature=tmp_sig)) - else: - tmp_sig = sig[1:] - retval = self.append_array(Array(value, signature=tmp_sig)) - elif sig_type == TYPE_OBJECT_PATH: - retval = self.append_object_path(value) - elif sig_type == STRUCT_BEGIN: - if ord(sig[-1]) != STRUCT_END: - raise TypeError, "Invalid struct entry in append_strict. No termination in signature %s." % (sig) - - tmp_sig = sig[1:-1] - retval = self.append_struct(value, signature = tmp_sig) - elif sig_type == TYPE_VARIANT: - if isinstance(value, Variant): - retval = self.append_variant(value) - else: - retval = self.append_variant(Variant(value)) - elif sig_type == DICT_ENTRY_BEGIN: - raise TypeError, "Signiture is invalid in append_strict. A dict entry must be part of an array." - else: - raise TypeError, "Argument of unknown type '%s' in append_strict" % (sig) - - return retval - - def append(self, value): - value_type = type(value) - if value_type == bool: - retval = self.append_boolean(value) - elif value_type == int: - retval = self.append_int32(value) - elif value_type == long: - retval = self.append_int64(value) - elif (value_type == str or value_type == unicode): - retval = self.append_string(value) - elif value_type == float: - retval = self.append_double(value) - elif value_type == dict: - retval = self.append_dict(value) - elif value_type == tuple: - retval = self.append_struct(value) - elif value_type == list: - retval = self.append_array(value) - #elif value_type == None.__class__: - # retval = self.append_nil() - elif isinstance(value, ObjectPath): - retval = self.append_object_path(value) - elif isinstance(value, ByteArray): - retval = self.append_array(value) - elif isinstance(value, Signature): - retval = self.append_signature(value) - elif isinstance(value, Byte): - retval = self.append_byte(value) - elif isinstance(value, Boolean): - retval = self.append_boolean(value) - elif isinstance(value, Int16): - retval = self.append_int16(value) - elif isinstance(value, UInt16): - retval = self.append_uint16(value) - elif isinstance(value, Int32): - retval = self.append_int32(value) - elif isinstance(value, UInt32): - retval = self.append_uint32(value) - elif isinstance(value, Int64): - retval = self.append_int64(value) - elif isinstance(value, UInt64): - retval = self.append_uint64(value) - elif isinstance(value, Double): - retval = self.append_double(value) - elif isinstance(value, String): - retval = self.append_string(value) - elif isinstance(value, Array): - retval = self.append_array(value) - elif isinstance(value, Struct): - retval = self.append_struct(value) - elif isinstance(value, Dictionary): - retval = self.append_dict(value) - elif isinstance(value, Variant): - retval = self.append_variant(value) - else: - raise TypeError, "Argument of unknown type '%s'" % (value_type) - - return retval - - def append_boolean(self, value): - cdef dbus_bool_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_BOOLEAN, &c_value) - - def append_byte(self, value): - cdef char b - if type(value) == str and len(value) == 1: - b = ord(value) - elif type(value) == Byte: - b = value - else: - raise TypeError - - return dbus_message_iter_append_basic(self.iter, TYPE_BYTE, &b) - - def append_int16(self, value): - cdef dbus_int16_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_INT16, &c_value) - - def append_uint16(self, value): - cdef dbus_uint16_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_UINT16, &c_value) - - def append_int32(self, value): - cdef dbus_int32_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_INT32, &c_value) - - def append_uint32(self, value): - cdef dbus_uint32_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_UINT32, &c_value) - - def append_int64(self, value): - cdef dbus_int64_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_INT64, &c_value) - - def append_uint64(self, value): - cdef dbus_uint64_t c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_UINT64, &c_value) - - def append_double(self, value): - cdef double c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_DOUBLE, &c_value) - - def append_string(self, value): - cdef char *c_value - tmp = value.encode('utf8') - c_value = tmp - return dbus_message_iter_append_basic(self.iter, TYPE_STRING, &c_value) - - def append_object_path(self, value): - cdef char *c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_OBJECT_PATH, &c_value) - - def append_signature(self, value): - cdef char *c_value - c_value = value - return dbus_message_iter_append_basic(self.iter, TYPE_SIGNATURE, &c_value) - - - def append_dict(self, python_dict): - cdef DBusMessageIter c_dict_iter, c_dict_entry_iter - cdef MessageIter dict_iter, dict_entry_iter - - level = self.level + 1 - - key = None - value = None - - sig = str(chr(DICT_ENTRY_BEGIN)) - - if isinstance(python_dict, Dictionary): - key = python_dict.key_type - value = python_dict.value_type - signature = python_dict.signature - - dict_list = python_dict.items() - - if signature: - sig = sig + signature - else: - if not (key and value): - key, value = dict_list[0] - - sig = sig + self.python_value_to_dbus_sig(key) - sig = sig + self.python_value_to_dbus_sig(value) - - sig = sig + str(chr(DICT_ENTRY_END)) - - dbus_message_iter_open_container(self.iter, TYPE_ARRAY, sig, &c_dict_iter) - dict_iter = MessageIter(level) - dict_iter.__cinit__(&c_dict_iter) - - for key, value in dict_list: - dbus_message_iter_open_container(dict_iter.iter, TYPE_DICT_ENTRY, sig, &c_dict_entry_iter) - dict_entry_iter = MessageIter(level) - dict_entry_iter.__cinit__(&c_dict_entry_iter) - - if signature: - signature_iter = iter(Signature(signature)) - tmp_sig = signature_iter.next() - if not dict_entry_iter.append_strict(key, tmp_sig): - dbus_message_iter_close_container(dict_iter.iter, dict_entry_iter.iter) - dbus_message_iter_close_container(self.iter, dict_iter.iter) - return False - - tmp_sig = signature_iter.next() - if not dict_entry_iter.append_strict(value, tmp_sig): - dbus_message_iter_close_container(dict_iter.iter, dict_entry_iter.iter) - dbus_message_iter_close_container(self.iter, dict_iter.iter) - return False - - else: - if not dict_entry_iter.append(key): - dbus_message_iter_close_container(dict_iter.iter, dict_entry_iter.iter) - dbus_message_iter_close_container(self.iter, dict_iter.iter) - return False - - if not dict_entry_iter.append(value): - dbus_message_iter_close_container(dict_iter.iter, dict_entry_iter.iter) - dbus_message_iter_close_container(self.iter, dict_iter.iter) - return False - - dbus_message_iter_close_container(dict_iter.iter, dict_entry_iter.iter) - - dbus_message_iter_close_container(self.iter, dict_iter.iter) - - return True - - def append_struct(self, python_struct, signature = None): - cdef DBusMessageIter c_struct_iter - cdef MessageIter struct_iter - - level = self.level + 1 - dbus_message_iter_open_container(self.iter, TYPE_STRUCT, NULL, &c_struct_iter) - struct_iter = MessageIter(level) - struct_iter.__cinit__(&c_struct_iter) - - signature_iter = iter(Signature(signature)) - for item in python_struct: - if signature: - sig = signature_iter.next() - - if sig == '': - dbus_message_iter_close_container(self.iter, struct_iter.iter) - return False - - if not struct_iter.append_strict(item, sig): - dbus_message_iter_close_container(self.iter, struct_iter.iter) - return False - else: - if not struct_iter.append(item): - dbus_message_iter_close_container(self.iter, struct_iter.iter) - return False - - dbus_message_iter_close_container(self.iter, struct_iter.iter) - - return True - - def append_array(self, python_list): - cdef DBusMessageIter c_array_iter - cdef MessageIter array_iter - - level = self.level + 1 - - sig = None - if isinstance(python_list, Array): - if python_list.type: - sig = self.python_value_to_dbus_sig(python_list.type) - elif python_list.signature: - sig = python_list.signature - else: - sig = self.python_value_to_dbus_sig(python_list[0]) - else: - sig = self.python_value_to_dbus_sig(python_list[0]) - - dbus_message_iter_open_container(self.iter, TYPE_ARRAY, sig, &c_array_iter) - array_iter = MessageIter(level) - array_iter.__cinit__(&c_array_iter) - - length = len(python_list) - for item in python_list: - if not array_iter.append_strict(item, sig): - dbus_message_iter_close_container(self.iter, array_iter.iter) - return False - - dbus_message_iter_close_container(self.iter, array_iter.iter) - - return True - - def append_variant(self, value): - cdef DBusMessageIter c_variant_iter - cdef MessageIter variant_iter - - level = self.level + 1 - - if value.signature: - sig = value.signature - elif value.type: - sig = self.python_value_to_dbus_sig(value.type) - else: - sig = self.python_value_to_dbus_sig(value.value) - - dbus_message_iter_open_container(self.iter, TYPE_VARIANT, sig, &c_variant_iter) - - variant_iter = MessageIter(level) - variant_iter.__cinit__(&c_variant_iter) - - if not variant_iter.append(value.value): - dbus_message_iter_close_container(self.iter, variant_iter.iter) - return False - - dbus_message_iter_close_container(self.iter, variant_iter.iter) - return True - - def __str__(self): - cdef DBusMessageIter c_array_iter - cdef MessageIter array_iter - - value_at_iter = True - retval = "" - while (value_at_iter): - type = self.get_arg_type() - if type == TYPE_INVALID: - break - elif type == TYPE_STRING: - str = iter.get_string() - arg = 'string:%s\n' % (str) - elif type == TYPE_OBJECT_PATH: - path = iter.get_object_path() - arg = 'object_path:%s\n' % (path) - elif type == TYPE_INT16: - num = iter.get_int16() - arg = 'int16:%d\n' % (num) - elif type == TYPE_UINT16: - num = iter.get_uint16() - arg = 'uint16:%u\n' % (num) - elif type == TYPE_INT32: - num = iter.get_int32() - arg = 'int32:%d\n' % (num) - elif type == TYPE_UINT32: - num = iter.get_uint32() - arg = 'uint32:%u\n' % (num) - elif type == TYPE_INT64: - num = iter.get_int64() - arg = 'int64:%d\n' % (num) - elif type == TYPE_UINT64: - num = iter.get_uint64() - arg = 'uint64:%u\n' % (num) - elif type == TYPE_DOUBLE: - num = iter.get_double() - arg = 'double:%f\n' % (num) - elif type == TYPE_BYTE: - num = iter.get_byte() - arg = 'byte:%x(%s)\n' % (num, str(chr(num))) - elif type == TYPE_BOOLEAN: - bool = iter.get_boolean() - if (bool): - str = "true" - else: - str = "false" - arg = 'boolean:%s\n' % (str) - elif type == TYPE_ARRAY: - dbus_message_iter_recurse(self.iter, &c_array_iter) - array_iter = MessageIter(self.level + 1) - array_iter.__cinit__(&c_array_iter) - if array_iter.has_next(): - arg = 'array [' + str(array_iter) + ']' - else: - arg = 'array []' - else: - arg = '(unknown arg type %d)\n' % type - - retval = retval + arg - value_at_iter = self.next() - - return retval - - -(MESSAGE_TYPE_INVALID, MESSAGE_TYPE_METHOD_CALL, MESSAGE_TYPE_METHOD_RETURN, MESSAGE_TYPE_ERROR, MESSAGE_TYPE_SIGNAL) = range(5) -(TYPE_INVALID, TYPE_BYTE, TYPE_BOOLEAN, TYPE_INT16, TYPE_UINT16, TYPE_INT32, TYPE_UINT32, TYPE_INT64, TYPE_UINT64, TYPE_DOUBLE, TYPE_STRING, TYPE_OBJECT_PATH, TYPE_SIGNATURE, TYPE_ARRAY, TYPE_STRUCT, STRUCT_BEGIN, STRUCT_END, TYPE_VARIANT, TYPE_DICT_ENTRY, DICT_ENTRY_BEGIN, DICT_ENTRY_END) = (0, ord('y'), ord('b'), ord('n'), ord('q'), ord('i'), ord('u'), ord('x'), ord('t'), ord('d'), ord('s'), ord('o'), ord('g'), ord('a'), ord('r'), ord('('), ord(')'), ord('v'), ord('e'), ord('{'), ord('}')) -(HANDLER_RESULT_HANDLED, HANDLER_RESULT_NOT_YET_HANDLED, HANDLER_RESULT_NEED_MEMORY) = range(3) - -cdef class Message: - cdef DBusMessage *msg - - def __init__(self, message_type=MESSAGE_TYPE_INVALID, - service=None, path=None, dbus_interface=None, method=None, - Message method_call=None, - name=None, - Message reply_to=None, error_name=None, error_message=None, - _create=1): - - self.msg = NULL - - cdef char *cservice - cdef char *ciface - cdef DBusMessage *cmsg - - ciface = NULL - if (dbus_interface != None): - ciface = dbus_interface - - cservice = NULL - if (service != None): - cservice = service - - if _create: - if message_type == MESSAGE_TYPE_METHOD_CALL: - self.msg = dbus_message_new_method_call(cservice, path, ciface, method) - elif message_type == MESSAGE_TYPE_METHOD_RETURN: - cmsg = method_call._get_msg() - self.msg = dbus_message_new_method_return(cmsg) - elif message_type == MESSAGE_TYPE_SIGNAL: - self.msg = dbus_message_new_signal(path, ciface, name) - elif message_type == MESSAGE_TYPE_ERROR: - cmsg = reply_to._get_msg() - self.msg = dbus_message_new_error(cmsg, error_name, error_message) - - - def __dealloc__(self): - if self.msg != NULL: - dbus_message_unref(self.msg) - - def type_to_name(self, type): - if type == MESSAGE_TYPE_SIGNAL: - return "signal" - elif type == MESSAGE_TYPE_METHOD_CALL: - return "method call" - elif type == MESSAGE_TYPE_METHOD_RETURN: - return "method return" - elif type == MESSAGE_TYPE_ERROR: - return "error" - else: - return "(unknown message type)" - - def __str__(self): - message_type = self.get_type() - sender = self.get_sender() - - if sender == None: - sender = "(no sender)" - - if (message_type == MESSAGE_TYPE_METHOD_CALL) or (message_type == MESSAGE_TYPE_SIGNAL): - retval = '%s interface=%s; member=%s; sender=%s' % (self.type_to_name(message_type), - self.get_interface(), - self.get_member(), - sender) - elif message_type == MESSAGE_TYPE_METHOD_RETURN: - retval = '%s sender=%s' % (self.type_to_name(message_type), - sender) - elif message_type == MESSAGE_TYPE_ERROR: - retval = '%s name=%s; sender=%s' % (self.type_to_name(message_type), - self.get_error_name(), - sender) - else: - retval = "Message of unknown type %d" % (message_type) - - - # FIXME: should really use self.convert_to_tuple() here - - iter = self.get_iter() - - retval = retval + "\n" + str(iter) - - return retval - - cdef _set_msg(self, DBusMessage *msg): - self.msg = msg - - cdef DBusMessage *_get_msg(self): - return self.msg - - def get_iter(self, append=False): - cdef DBusMessageIter iter - cdef MessageIter message_iter - cdef DBusMessage *msg - - msg = self._get_msg() - - if append: - dbus_message_iter_init_append(msg, &iter) - else: - dbus_message_iter_init(msg, &iter) - - message_iter = MessageIter(0) - message_iter.__cinit__(&iter) - - return message_iter - - def get_args_list(self): - retval = [ ] - - iter = self.get_iter() - try: - retval.append(iter.get()) - except TypeError, e: - return [ ] - - value_at_iter = iter.next() - while (value_at_iter): - retval.append(iter.get()) - value_at_iter = iter.next() - - return retval - - # FIXME: implement dbus_message_copy? - - def get_type(self): - return dbus_message_get_type(self.msg) - - def set_path(self, object_path): - return dbus_message_set_path(self.msg, object_path) - - def get_path(self): - return dbus_message_get_path(self.msg) - - def set_interface(self, interface): - return dbus_message_set_interface(self.msg, interface) - - def get_interface(self): - return dbus_message_get_interface(self.msg) - - def set_member(self, member): - return dbus_message_set_member(self.msg, member) - - def get_member(self): - return dbus_message_get_member(self.msg) - - def set_error_name(self, name): - return dbus_message_set_error_name(self.msg, name) - - def get_error_name(self): - return dbus_message_get_error_name(self.msg) - - def set_destination(self, destination): - return dbus_message_set_destination(self.msg, destination) - - def get_destination(self): - return dbus_message_get_destination(self.msg) - - def set_sender(self, sender): - return dbus_message_set_sender(self.msg, sender) - - def get_sender(self): - cdef char *sender - sender = dbus_message_get_sender(self.msg) - if (sender == NULL): - return None - else: - return sender - - def set_no_reply(self, no_reply): - dbus_message_set_no_reply(self.msg, no_reply) - - def get_no_reply(self): - return dbus_message_get_no_reply(self.msg) - - def is_method_call(self, interface, method): - return dbus_message_is_method_call(self.msg, interface, method) - - def is_signal(self, interface, signal_name): - return dbus_message_is_signal(self.msg, interface, signal_name) - - def is_error(self, error_name): - return dbus_message_is_error(self.msg, error_name) - - def has_destination(self, service): - return dbus_message_has_destination(self.msg, service) - - def has_sender(self, service): - return dbus_message_has_sender(self.msg, service) - - def get_serial(self): - return dbus_message_get_serial(self.msg) - - def set_reply_serial(self, reply_serial): - return dbus_message_set_reply_serial(self.msg, reply_serial) - - def get_reply_serial(self): - return dbus_message_get_reply_serial(self.msg) - - #FIXME: dbus_message_get_path_decomposed - - # FIXME: all the different dbus_message_*args* methods - -class Signal(Message): - def __init__(self, spath, sinterface, sname): - Message.__init__(self, MESSAGE_TYPE_SIGNAL, path=spath, dbus_interface=sinterface, name=sname) - -class EmptyMessage(Message): - def __init__(self): - Message.__init__(self, _create=False) - -class MethodCall(Message): - def __init__(self, mpath, minterface, mmethod): - Message.__init__(self, MESSAGE_TYPE_METHOD_CALL, path=mpath, dbus_interface=minterface, method=mmethod) - -class MethodReturn(Message): - def __init__(self, method_call): - Message.__init__(self, MESSAGE_TYPE_METHOD_RETURN, method_call=method_call) - -class Error(Message): - def __init__(self, reply_to, error_name, error_message): - Message.__init__(self, MESSAGE_TYPE_ERROR, reply_to=reply_to, error_name=error_name, error_message=error_message) - -cdef class Server: - cdef DBusServer *server - def __init__(self, address): - cdef DBusError error - dbus_error_init(&error) - self.server = dbus_server_listen(address, - &error) - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free (&error) - raise DBusException, errormsg - - def disconnect(self): - dbus_server_disconnect(self.server) - - def get_is_connected(self): - return dbus_server_get_is_connected(self.server) - -# def set_new_connection_function(self, function, data): -# dbus_server_set_new_connection_function(self.conn, function, -# data, NULL) - -# def set_watch_functions(self, add_function, remove_function, data): -# dbus_server_set_watch_functions(self.server, -# add_function, remove_function, -# data, NULL) - -# def set_timeout_functions(self, add_function, remove_function, data): -# dbus_server_set_timeout_functions(self.server, -# add_function, remove_function, -# data, NULL) - -# def handle_watch(self, watch, condition): -# dbus_server_handle_watch(self.conn, watch, condition) - -BUS_SESSION = DBUS_BUS_SESSION -BUS_SYSTEM = DBUS_BUS_SYSTEM -BUS_STARTER = DBUS_BUS_STARTER - -def bus_get (bus_type, private=False): - cdef DBusError error - cdef Connection conn - cdef DBusConnection *connection - - dbus_error_init(&error) - if private: - connection = dbus_bus_get_private(bus_type, - &error) - else: - connection = dbus_bus_get(bus_type, - &error) - - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - conn = Connection() - conn.__cinit__(None, connection) - return conn - -def bus_get_unique_name(Connection connection): - cdef DBusConnection *conn - conn = connection._get_conn() - return dbus_bus_get_unique_name(conn) - -def bus_get_unix_user(Connection connection, service_name): - cdef DBusError error - dbus_error_init(&error) - cdef int retval - cdef DBusConnection *conn - - conn = connection._get_conn() - retval = dbus_bus_get_unix_user(conn, service_name, &error) - - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - return retval - -# these are defines, not enums, so they aren't auto generated -DBUS_START_REPLY_SUCCESS = 0 -DBUS_START_REPLY_ALREADY_RUNNING = 1 - -def bus_start_service_by_name(Connection connection, service_name, flags=0): - cdef DBusError error - dbus_error_init(&error) - cdef dbus_bool_t retval - cdef dbus_uint32_t results - cdef DBusConnection *conn - - conn = connection._get_conn() - - retval = dbus_bus_start_service_by_name(conn, service_name, flags, &results, &error) - - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - return (retval, results) - -def bus_register(Connection connection): - cdef DBusError error - dbus_error_init(&error) - cdef dbus_bool_t retval - cdef DBusConnection *conn - - conn = connection._get_conn() - retval = dbus_bus_register(conn, - &error) - if dbus_error_is_set(&error): - msg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - return retval - -NAME_FLAG_ALLOW_REPLACEMENT = 0x1 -NAME_FLAG_REPLACE_EXISTING = 0x2 -NAME_FLAG_DO_NOT_QUEUE = 0x4 - -REQUEST_NAME_REPLY_PRIMARY_OWNER = 1 -REQUEST_NAME_REPLY_IN_QUEUE = 2 -REQUEST_NAME_REPLY_EXISTS = 3 -REQUEST_NAME_REPLY_ALREADY_OWNER = 4 - -def bus_request_name(Connection connection, service_name, flags=0): - cdef DBusError error - dbus_error_init(&error) - cdef int retval - cdef DBusConnection *conn - - conn = connection._get_conn() - retval = dbus_bus_request_name(conn, - service_name, - flags, - &error) - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - return retval - -RELEASE_NAME_REPLY_RELEASED = 1 -RELEASE_NAME_REPLY_NON_EXISTENT = 2 -RELEASE_NAME_REPLY_NOT_OWNER = 3 - -def bus_release_name(Connection connection, service_name): - cdef DBusError error - dbus_error_init(&error) - cdef int retval - cdef DBusConnection *conn - - conn = connection._get_conn() - retval = dbus_bus_release_name(conn, - service_name, - &error) - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - return retval - -def bus_name_has_owner(Connection connection, service_name): - cdef DBusError error - dbus_error_init(&error) - cdef dbus_bool_t retval - cdef DBusConnection *conn - - conn = connection._get_conn() - retval = dbus_bus_name_has_owner(conn, - service_name, - &error) - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - - return retval - -def bus_add_match(Connection connection, rule): - cdef DBusError error - cdef DBusConnection *conn - - dbus_error_init(&error) - - conn = connection._get_conn() - dbus_bus_add_match (conn, rule, &error) - - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - -def bus_remove_match(Connection connection, rule): - cdef DBusError error - cdef DBusConnection *conn - - dbus_error_init(&error) - - conn = connection._get_conn() - dbus_bus_remove_match (conn, rule, &error) - - if dbus_error_is_set(&error): - errormsg = error.message - dbus_error_free(&error) - raise DBusException, errormsg - diff --git a/python/dbus_glib_bindings.pyx b/python/dbus_glib_bindings.pyx deleted file mode 100644 index 3e2e33bd..00000000 --- a/python/dbus_glib_bindings.pyx +++ /dev/null @@ -1,17 +0,0 @@ -cimport dbus_bindings -import dbus_bindings - -cdef extern from "dbus-glib.h": - ctypedef struct GMainContext - cdef void dbus_g_thread_init () - -cdef extern from "dbus-glib-lowlevel.h": - cdef void dbus_connection_setup_with_g_main (dbus_bindings.DBusConnection *connection, - GMainContext *context) -def setup_with_g_main(conn): - cdef dbus_bindings.Connection connection - connection = conn - dbus_connection_setup_with_g_main(connection._get_conn(), NULL) - -def gthreads_init (): - dbus_g_thread_init () diff --git a/python/dbus_h_wrapper.h b/python/dbus_h_wrapper.h deleted file mode 100644 index 2e218c8c..00000000 --- a/python/dbus_h_wrapper.h +++ /dev/null @@ -1,3 +0,0 @@ -#define DBUS_API_SUBJECT_TO_CHANGE 1 -#include - diff --git a/python/decorators.py b/python/decorators.py deleted file mode 100644 index c9bc17fa..00000000 --- a/python/decorators.py +++ /dev/null @@ -1,83 +0,0 @@ -import _util -import inspect -import dbus_bindings - -def method(dbus_interface, in_signature=None, out_signature=None, async_callbacks=None, sender_keyword=None): - _util._validate_interface_or_name(dbus_interface) - - def decorator(func): - args = inspect.getargspec(func)[0] - args.pop(0) - - if async_callbacks: - if type(async_callbacks) != tuple: - raise TypeError('async_callbacks must be a tuple of (keyword for return callback, keyword for error callback)') - if len(async_callbacks) != 2: - raise ValueError('async_callbacks must be a tuple of (keyword for return callback, keyword for error callback)') - args.remove(async_callbacks[0]) - args.remove(async_callbacks[1]) - - if sender_keyword: - args.remove(sender_keyword) - - if in_signature: - in_sig = tuple(dbus_bindings.Signature(in_signature)) - - if len(in_sig) > len(args): - raise ValueError, 'input signature is longer than the number of arguments taken' - elif len(in_sig) < len(args): - raise ValueError, 'input signature is shorter than the number of arguments taken' - - func._dbus_is_method = True - func._dbus_async_callbacks = async_callbacks - func._dbus_interface = dbus_interface - func._dbus_in_signature = in_signature - func._dbus_out_signature = out_signature - func._dbus_sender_keyword = sender_keyword - func._dbus_args = args - return func - - return decorator - -def signal(dbus_interface, signature=None): - _util._validate_interface_or_name(dbus_interface) - def decorator(func): - def emit_signal(self, *args, **keywords): - func(self, *args, **keywords) - message = dbus_bindings.Signal(self._object_path, dbus_interface, func.__name__) - iter = message.get_iter(True) - - if emit_signal._dbus_signature: - signature = tuple(dbus_bindings.Signature(emit_signal._dbus_signature)) - for (arg, sig) in zip(args, signature): - iter.append_strict(arg, sig) - else: - for arg in args: - iter.append(arg) - - self._connection.send(message) - - args = inspect.getargspec(func)[0] - args.pop(0) - - if signature: - sig = tuple(dbus_bindings.Signature(signature)) - - if len(sig) > len(args): - raise ValueError, 'signal signature is longer than the number of arguments provided' - elif len(sig) < len(args): - raise ValueError, 'signal signature is shorter than the number of arguments provided' - - emit_signal.__name__ = func.__name__ - emit_signal.__doc__ = func.__doc__ - emit_signal._dbus_is_signal = True - emit_signal._dbus_interface = dbus_interface - emit_signal._dbus_signature = signature - emit_signal._dbus_args = args - return emit_signal - - return decorator - -def explicitly_pass_message(func): - func._dbus_pass_message = True - return func diff --git a/python/examples/.cvsignore b/python/examples/.cvsignore deleted file mode 100644 index 282522db..00000000 --- a/python/examples/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/python/examples/Makefile.am b/python/examples/Makefile.am deleted file mode 100644 index f7a1b22e..00000000 --- a/python/examples/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -NULL= - -EXTRA_DIST = \ - example-service.py \ - example-client.py \ - example-signal-emitter.py \ - example-signal-recipient.py \ - gconf-proxy-client.py \ - gconf-proxy-service.py \ - gconf-proxy-service2.py \ - list-system-services.py \ - $(NULL) - diff --git a/python/examples/example-client.py b/python/examples/example-client.py deleted file mode 100644 index 3d170bd4..00000000 --- a/python/examples/example-client.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -import dbus - -bus = dbus.SessionBus() -remote_object = bus.get_object("org.designfu.SampleService", "/SomeObject") -iface = dbus.Interface(remote_object, "org.designfu.SampleInterface") - -hello_reply_list = remote_object.HelloWorld("Hello from example-client.py!", dbus_interface = "org.designfu.SampleInterface") - -hello_reply_tuple = iface.GetTuple() - -hello_reply_dict = iface.GetDict() - -print (hello_reply_list) - -print str(hello_reply_tuple) - -print str(hello_reply_dict) - -print remote_object.Introspect(dbus_interface="org.freedesktop.DBus.Introspectable") - diff --git a/python/examples/example-service.py b/python/examples/example-service.py deleted file mode 100644 index cb25d203..00000000 --- a/python/examples/example-service.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python - -import dbus -import dbus.service -import dbus.glib -import gobject - -class SomeObject(dbus.service.Object): - def __init__(self, bus_name, object_path="/SomeObject"): - dbus.service.Object.__init__(self, bus_name, object_path) - - @dbus.service.method("org.designfu.SampleInterface") - def HelloWorld(self, hello_message): - print (str(hello_message)) - return ["Hello", " from example-service.py"] - - @dbus.service.method("org.designfu.SampleInterface") - def GetTuple(self): - return ("Hello Tuple", " from example-service.py") - - @dbus.service.method("org.designfu.SampleInterface") - def GetDict(self): - return {"first": "Hello Dict", "second": " from example-service.py"} - -session_bus = dbus.SessionBus() -name = dbus.service.BusName("org.designfu.SampleService", bus=session_bus) -object = SomeObject(name) - -mainloop = gobject.MainLoop() -mainloop.run() diff --git a/python/examples/example-signal-emitter.py b/python/examples/example-signal-emitter.py deleted file mode 100644 index 02eff893..00000000 --- a/python/examples/example-signal-emitter.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python - -import dbus -import dbus.service -import dbus.glib -import gobject - -class TestObject(dbus.service.Object): - def __init__(self, bus_name, object_path='/org/designfu/TestService/object'): - dbus.service.Object.__init__(self, bus_name, object_path) - - @dbus.service.signal('org.designfu.TestService') - def HelloSignal(self, message): - # The signal is emitted when this method exits - # You can have code here if you wish - pass - - @dbus.service.method('org.designfu.TestService') - def emitHelloSignal(self): - #you emit signals by calling the signal's skeleton method - self.HelloSignal('Hello') - return 'Signal emitted' - -session_bus = dbus.SessionBus() -name = dbus.service.BusName('org.designfu.TestService', bus=session_bus) -object = TestObject(name) - -loop = gobject.MainLoop() -loop.run() diff --git a/python/examples/example-signal-recipient.py b/python/examples/example-signal-recipient.py deleted file mode 100644 index a06d4943..00000000 --- a/python/examples/example-signal-recipient.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python - -import dbus -import dbus.decorators -import dbus.glib -import gobject - -def handle_reply(msg): - print msg - -def handle_error(e): - print str(e) - -def emit_signal(): - #call the emitHelloSignal method - object.emitHelloSignal(dbus_interface="org.designfu.TestService") - #reply_handler = handle_reply, error_handler = handle_error) - return True - -bus = dbus.SessionBus() -object = bus.get_object("org.designfu.TestService","/org/designfu/TestService/object") - -def hello_signal_handler(hello_string): - print ("Received signal and it says: " + hello_string) - -@dbus.decorators.explicitly_pass_message -def catchall_signal_handler(*args, **keywords): - #The dbus.handler directive passes in the special __dbus_message__ variable - dbus_message = keywords["dbus_message"] - print "Caught signal " + dbus_message.get_member() - for arg in args: - print " " + str(arg) - -def catchall_hello_signals_handler(hello_string): - print ("Received a hello signal and it says ") + hello_string - -@dbus.decorators.explicitly_pass_message -def catchall_testservice_interface_handler(hello_string, dbus_message): - print "org.designfu.TestService interface says " + hello_string + " when it sent signal " + dbus_message.get_member() - -object.connect_to_signal("HelloSignal", hello_signal_handler, dbus_interface="org.designfu.TestService", arg0="Hello") - -#lets make a catchall -bus.add_signal_receiver(catchall_signal_handler) -bus.add_signal_receiver(catchall_hello_signals_handler, dbus_interface = "org.designfu.TestService", signal_name = "HelloSignal") -bus.add_signal_receiver(catchall_testservice_interface_handler, dbus_interface = "org.designfu.TestService") - - -gobject.timeout_add(2000, emit_signal) - -# Tell the remote object to emit the signal - -loop = gobject.MainLoop() -loop.run() diff --git a/python/examples/gconf-proxy-client.py b/python/examples/gconf-proxy-client.py deleted file mode 100644 index f763e3fa..00000000 --- a/python/examples/gconf-proxy-client.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -import dbus - -gconf_key = "/desktop/gnome/file_views/icon_theme" - -bus = dbus.SessionBus() -gconf_service = bus.get_service("org.gnome.GConf") -gconf_key_object = gconf_service.get_object("/org/gnome/GConf" + gconf_key, "org.gnome.GConf") - -value = gconf_key_object.getString() - -print ("Value of GConf key %s is %s" % (gconf_key, value)) diff --git a/python/examples/gconf-proxy-service.py b/python/examples/gconf-proxy-service.py deleted file mode 100644 index a899cf21..00000000 --- a/python/examples/gconf-proxy-service.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -#FIXME: Doesn't work with the new bindings -import dbus - -import gobject -import gconf - -class GConfService(dbus.Service): - - def __init__(self): - dbus.Service.__init__(self, "org.gnome.GConf", dbus.SessionBus()) - - gconf_object_tree = self.GConfObjectTree(self) - - class GConfObjectTree(dbus.ObjectTree): - def __init__(self, service): - dbus.ObjectTree.__init__(self, "/org/gnome/GConf", service, dbus_methods=[ self.getString, self.setString, self.getInt, self.setInt ]) - - self.client = gconf.client_get_default() - - def getString(self, message, object_path): - print ("getString called on GConf key %s" % (object_path)) - return self.client.get_string(object_path) - - def setString(self, message, object_path, new_value): - print ("setString called on GConf key %s" % (object_path)) - self.client.set_string(object_path, new_value) - - def getInt(self, message, object_path): - print ("getInt called on GConf key %s" % (object_path)) - return self.client.get_int(object_path) - - def setInt(self, message, object_path, new_value): - print ("setInt called on GConf key %s" % (object_path)) - self.client.set_int(object_path, new_value) - -gconf_service = GConfService() - -print ("GConf Proxy service started.") -print ("Run 'gconf-proxy-client.py' to fetch a GConf key through the proxy...") - -mainloop = gobject.MainLoop() -mainloop.run() diff --git a/python/examples/gconf-proxy-service2.py b/python/examples/gconf-proxy-service2.py deleted file mode 100644 index 5731ab28..00000000 --- a/python/examples/gconf-proxy-service2.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -#FIXME: doesn't work with the new bindings -import dbus - -import gobject -import gconf - -class GConfService(dbus.Service): - - def __init__(self): - dbus.Service.__init__(self, "org.gnome.GConf", dbus.SessionBus()) - - gconf_object_tree = self.GConfObjectTree(self) - - class GConfObjectTree(dbus.ObjectTree): - def __init__(self, service): - dbus.ObjectTree.__init__(self, "/org/gnome/GConf", service) - - self.client = gconf.client_get_default() - - def object_method_called(self, message, object_path, method_name, argument_list): - print ("Method %s called on GConf key %s" % (method_name, object_path)) - - if "getString" == method_name: - return self.client.get_string(object_path) - elif "setString" == method_name: - self.client.set_int(object_path, argument_list[0]) - elif "getInt" == method_name: - return self.client.get_int(object_path) - elif "setInt" == method_name: - self.client.set_int(object_path, argument_list[0]) - -gconf_service = GConfService() - -print ("GConf Proxy service started.") -print ("Run 'gconf-proxy-client.py' to fetch a GConf key through the proxy...") - -mainloop = gobject.MainLoop() -mainloop.run() diff --git a/python/examples/list-system-services.py b/python/examples/list-system-services.py deleted file mode 100644 index 4cad8717..00000000 --- a/python/examples/list-system-services.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -"""Lists services on the system bus -""" - -import dbus - -# Get a connection to the SYSTEM bus -bus = dbus.SystemBus() - -# Get a reference to the desktop bus' standard object, denoted -# by the path /org/freedesktop/DBus. -dbus_object = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus') - -# The object /org/freedesktop/DBus -# implements the 'org.freedesktop.DBus' interface -dbus_iface = dbus.Interface(dbus_object, 'org.freedesktop.DBus') - -# One of the member functions in the org.freedesktop.DBus interface -# is ListServices(), which provides a list of all the other services -# registered on this bus. Call it, and print the list. -print dbus_object.ListNames() diff --git a/python/exceptions.py b/python/exceptions.py deleted file mode 100644 index 2b01b96e..00000000 --- a/python/exceptions.py +++ /dev/null @@ -1,29 +0,0 @@ -import dbus_bindings - -DBusException = dbus_bindings.DBusException -ConnectionError = dbus_bindings.ConnectionError - -class MissingErrorHandlerException(DBusException): - def __init__(self): - DBusException.__init__(self, "error_handler not defined: if you define a reply_handler you must also define an error_handler") - -class MissingReplyHandlerException(DBusException): - def __init__(self): - DBusException.__init__(self, "reply_handler not defined: if you define an error_handler you must also define a reply_handler") - -class ValidationException(DBusException): - def __init__(self, msg=''): - DBusException.__init__(self, "Error validating string: %s"%msg) - -class IntrospectionParserException(DBusException): - def __init__(self, msg=''): - DBusException.__init__(self, "Error parsing introspect data: %s"%msg) - -class UnknownMethodException(DBusException): - def __init__(self, method): - DBusException.__init__(self, "Unknown method: %s"%method) - -class NameExistsException(DBusException): - def __init__(self, name): - DBusException.__init__(self, "Bus name already exists: %s"%name) - diff --git a/python/extract.py b/python/extract.py deleted file mode 100644 index 3cdb9755..00000000 --- a/python/extract.py +++ /dev/null @@ -1,234 +0,0 @@ -import commands -import re -import string -import sys - -def clean_func(buf): - buf = strip_comments(buf) - pat = re.compile(r"""\\\n""", re.MULTILINE) - buf = pat.sub('',buf) - pat = re.compile(r"""^[#].*?$""", re.MULTILINE) - buf = pat.sub('',buf) - pat = re.compile(r"""^(typedef|struct|enum)(\s|.|\n)*?;\s*""", re.MULTILINE) - buf = pat.sub('',buf) - pat = re.compile(r"""\s+""", re.MULTILINE) - buf = pat.sub(' ',buf) - pat = re.compile(r""";\s*""", re.MULTILINE) - buf = pat.sub('\n',buf) - buf = buf.lstrip() - #pat=re.compile(r'\s+([*|&]+)\s*(\w+)') - pat = re.compile(r' \s+ ([*|&]+) \s* (\w+)',re.VERBOSE) - buf = pat.sub(r'\1 \2', buf) - pat = re.compile(r'\s+ (\w+) \[ \s* \]',re.VERBOSE) - buf = pat.sub(r'[] \1', buf) -# buf = string.replace(buf, 'G_CONST_RETURN ', 'const-') - buf = string.replace(buf, 'const ', '') - return buf - -def strip_comments(buf): - parts = [] - lastpos = 0 - while 1: - pos = string.find(buf, '/*', lastpos) - if pos >= 0: - parts.append(buf[lastpos:pos]) - pos = string.find(buf, '*/', pos) - if pos >= 0: - lastpos = pos + 2 - else: - break - else: - parts.append(buf[lastpos:]) - break - return string.join(parts, '') - -def find_enums(buf): - enums = [] - buf = strip_comments(buf) - buf = re.sub('\n', ' ', buf) - - enum_pat = re.compile(r'enum\s*{([^}]*)}\s*([A-Z][A-Za-z]*)(\s|;)') - splitter = re.compile(r'\s*,\s', re.MULTILINE) - pos = 0 - while pos < len(buf): - m = enum_pat.search(buf, pos) - if not m: break - - name = m.group(2) - vals = m.group(1) - isflags = string.find(vals, '<<') >= 0 - entries = [] - for val in splitter.split(vals): - if not string.strip(val): continue - entries.append(string.split(val)[0]) - enums.append((name, isflags, entries)) - - pos = m.end() - return enums - -#typedef unsigned int dbus_bool_t; -#typedef struct { -# -# } -#typedef struct FooStruct FooStruct; -# typedef void (* DBusAddWatchFunction) (DBusWatch *watch, -# void *data); - -def find_typedefs(buf): - typedefs = [] - buf = re.sub('\n', ' ', strip_comments(buf)) - typedef_pat = re.compile( - r"""typedef\s*(?P\w*) - \s* - ([(]\s*\*\s*(?P[\w* ]*)[)]|{([^}]*)}|) - \s* - (?P[(](?P[\s\w*,_]*)[)]|[\w ]*)""", - re.MULTILINE | re.VERBOSE) - pat = re.compile(r"""\s+""", re.MULTILINE) - pos = 0 - while pos < len(buf): - m = typedef_pat.search(buf, pos) - if not m: - break - if m.group('type') == 'enum': - pos = m.end() - continue - if m.group('args2') != None: - args = pat.sub(' ', m.group('args2')) - - current = '%s (* %s) (%s)' % (m.group('type'), - m.group('callback'), - args) - else: - current = '%s %s' % (m.group('type'), m.group('args1')) - typedefs.append(current) - pos = m.end() - return typedefs - -proto_pat = re.compile(r""" -(?P(-|\w|\&|\*|\s)+\s*) # return type -\s+ # skip whitespace -(?P\w+)\s*[(] # match the function name until the opening ( -(?P.*?)[)] # group the function arguments -""", re.IGNORECASE|re.VERBOSE) -arg_split_pat = re.compile("\s*,\s*") - - -def find_functions(buf): - functions = [] - buf = clean_func(buf) - buf = string.split(buf,'\n') - for p in buf: - if len(p) == 0: - continue - m = proto_pat.match(p) - if m == None: - continue - - func = m.group('func') - ret = m.group('ret') - args = m.group('args') - args = arg_split_pat.split(args) -# for i in range(len(args)): -# spaces = string.count(args[i], ' ') -# if spaces > 1: -# args[i] = string.replace(args[i], ' ', '-', spaces - 1) - - functions.append((func, ret, args)) - return functions - -class Writer: - def __init__(self, filename, enums, typedefs, functions): - if not (enums or typedefs or functions): - return - print 'cdef extern from "%s":' % filename - - self.output_enums(enums) - self.output_typedefs(typedefs) - self.output_functions(functions) - - print ' pass' - print - - def output_enums(self, enums): - for enum in enums: - print ' ctypedef enum %s:' % enum[0] - if enum[1] == 0: - for item in enum[2]: - print ' %s' % item - else: - i = 0 - for item in enum[2]: - print ' %s' % item -# print ' %s = 1 << %d' % (item, i) - i += 1 - print - def output_typedefs(self, typedefs): - for typedef in typedefs: - if typedef.find('va_list') != -1: - continue - - parts = typedef.split() - if parts[0] == 'struct': - if parts[-2] == parts[-1]: - parts = parts[:-1] - print ' ctypedef %s' % ' '.join(parts) - else: - print ' ctypedef %s' % typedef - - def output_functions(self, functions): - for func, ret, args in functions: - if func[0] == '_': - continue - - str = ', '.join(args) - if str.find('...') != -1: - continue - if str.find('va_list') != -1: - continue - if str.strip() == 'void': - continue - print ' %-20s %s (%s)' % (ret, func, str) - -def do_buffer(name, buffer): - functions = find_functions(buffer) - typedefs = find_typedefs(buffer) - enums = find_enums(buffer) - - Writer(name, enums, typedefs, functions) - -def do_header(filename, name=None): - if name == None: - name = filename - - buffer = "" - for line in open(filename).readlines(): - if line[0] == '#': - continue - buffer += line - - print '# -- %s -- ' % filename - do_buffer(name, buffer) - -filename = sys.argv[1] - -if filename.endswith('.h'): - do_header(filename) - raise SystemExit - -cppflags = "" - -for flag in sys.argv[2:]: - cppflags = cppflags + " " + flag - -fd = open(filename) - -for line in fd.readlines(): - if line.startswith('#include'): - filename = line.split(' ')[1][1:-2] - command = "echo '%s'|cpp %s" % (line, cppflags) - sys.stderr.write('running %s' % (command)) - output = commands.getoutput(command) - do_buffer(filename, output) - else: - print line[:-1] diff --git a/python/glib.py b/python/glib.py deleted file mode 100644 index e1c3d9ca..00000000 --- a/python/glib.py +++ /dev/null @@ -1,17 +0,0 @@ -import dbus -import dbus_glib_bindings - -def _setup_with_g_main(conn): - dbus_glib_bindings.setup_with_g_main(conn._connection) - -_dbus_gthreads_initialized = False -def threads_init(): - global _dbus_gthreads_initialized - if not _dbus_gthreads_initialized: - dbus_glib_bindings.gthreads_init() - _dbus_gthreads_initialized = True - -def init_threads(): - threads_init() - -setattr(dbus, "_dbus_mainloop_setup_function", _setup_with_g_main) diff --git a/python/introspect_parser.py b/python/introspect_parser.py deleted file mode 100644 index 47c9806e..00000000 --- a/python/introspect_parser.py +++ /dev/null @@ -1,51 +0,0 @@ -import libxml2 -import cStringIO -import exceptions - -def process_introspection_data(data): - method_map = {} - - XMLREADER_START_ELEMENT_NODE_TYPE = 1 - XMLREADER_END_ELEMENT_NODE_TYPE = 15 - - stream = cStringIO.StringIO(data.encode('utf-8')) - input_source = libxml2.inputBuffer(stream) - reader = input_source.newTextReader("urn:introspect") - - ret = reader.Read() - current_iface = None - current_method = None - current_sigstr = '' - - while ret == 1: - name = reader.LocalName() - if reader.NodeType() == XMLREADER_START_ELEMENT_NODE_TYPE: - if (not current_iface and not current_method and name == 'interface'): - current_iface = reader.GetAttribute('name') - elif (current_iface and not current_method and name == 'method'): - current_method = reader.GetAttribute('name') - if reader.IsEmptyElement(): - method_map[current_iface + '.' + current_method] = '' - current_method = None - current_sigstr = '' - - elif (current_iface and current_method and name == 'arg'): - direction = reader.GetAttribute('direction') - - if not direction or direction == 'in': - current_sigstr = current_sigstr + reader.GetAttribute('type') - - elif reader.NodeType() == XMLREADER_END_ELEMENT_NODE_TYPE: - if (current_iface and not current_method and name == 'interface'): - current_iface = None - if (current_iface and current_method and name == 'method'): - method_map[current_iface + '.' + current_method] = current_sigstr - current_method = None - current_sigstr = '' - - ret = reader.Read() - - if ret != 0: - raise exceptions.IntrospectionParserException(data) - - return method_map diff --git a/python/matchrules.py b/python/matchrules.py deleted file mode 100644 index 023a5b76..00000000 --- a/python/matchrules.py +++ /dev/null @@ -1,232 +0,0 @@ -from exceptions import DBusException - -class SignalMatchNode: - def __init__(self): - self.wildcard = None - self.finite = {} - self.rules = [] - - def add(self, key, leaf=None): - node = None - - if key: - if self.finite.has_key(key): - node = self.finite[key] - else: - node = SignalMatchNode() - self.finite[key] = node - else: - if self.wildcard: - node = self.wildcard - else: - node = SignalMatchNode() - self.wildcard = node - - node.rules.append(leaf) - return node - - def get_matches(self, key): - result = [] - if self.wildcard: - result.append(self.wildcard) - - if self.finite.has_key(key): - result.append(self.finite[key]) - - return result - - def get_match(self, key): - if key: - if self.finite.has_key(key): - return self.finite[key] - else: - return None - - return self.wildcard - - def has_children(self): - if self.wildcard or len(self.finite.iterkeys()) > 0: - return True - return False - - def remove_child(self, child, key=None): - if self.wildcard == child: - self.wildcard = None - elif self.finite.has_key(key): - del self.finite[key] - -class SignalMatchTree: - """This class creates an ordered tree of SignalMatchRules - to speed searchs. Left branches are wildcard elements - and all other branches are concreet elements. - """ - def __init__(self): - self._tree = SignalMatchNode() - - def add(self, rule): - interface = self._tree.add(rule.sender) - signal = interface.add(rule.dbus_interface) - path = signal.add(rule.signal_name) - path.add(rule.path, leaf=rule) - - def exec_matches(self, match_rule, message): - args = message.get_args_list() - - sender_matches = self._tree.get_matches(match_rule.sender) - for sender_node in sender_matches: - interface_matches = sender_node.get_matches(match_rule.dbus_interface) - for interface_node in interface_matches: - signal_matches = interface_node.get_matches(match_rule.signal_name) - for signal_node in signal_matches: - path_matches = signal_node.get_matches(match_rule.path) - for path_node in path_matches: - if(path_node.rules): - for rule in path_node.rules: - if (rule.match_args_from_list(args)): - rule.execute(message, args) - - def remove(self, rule): - try: - sender = self._tree.get_match(rule.sender) - interface = sender.get_match(rule.dbus_interface) - signal = interface.get_match(rule.signal_name) - path = signal.get_match(rule.path) - - rule_matches = [] - for _rule in path.rules: - if _rule.is_match(rule): - rule_matches.append(_rule) - - for _rule in rule_matches: - path.rules.remove(_rule) - - #clean up tree - if len(path.rules) == 0: - signal.remove_child(path, key = rule.path) - if not signal.has_children(): - interface.remove_child(signal, key = rule.signal_name) - if not interface.has_children(): - sender.remove_child(interface, key = rule.dbus_interface) - if not sender.has_children(): - self._tree.remove_child(sender, key = rule.sender) - - except: - raise DBusException ("Trying to remove unkown rule: %s"%str(rule)) - -class SignalMatchRule: - """This class represents a dbus rule used to filter signals. - When a rule matches a filter, the signal is propagated to the handler_funtions - """ - def __init__(self, signal_name, dbus_interface, sender, path): - self.handler_functions = [] - - self.signal_name = signal_name - self.dbus_interface = dbus_interface - self.sender = sender - self.path = path - self.args = None - - def add_args_match(self, args): - self.args = args - - def execute(self, message, args=None): - keywords = {} - - if self.sender_keyword is not None: - keywords[self.sender_keyword] = message.get_sender() - if self.path_keyword is not None: - keywords[self.path_keyword] = message.get_path() - - # optimization just in case we already extracted the args - if not args: - args = message.get_args_list() - - for handler in self.handler_functions: - if getattr(handler, "_dbus_pass_message", False): - keywords["dbus_message"] = message - - if len(keywords) == 0: - handler(*args) - else: - handler(*args, **keywords) - - def add_handler(self, handler): - self.handler_functions.append(handler) - - #matches only those arguments listed by self - def match_args_from_list(self, args_list): - if not self.args: - return True - - last_index = len(args_list) - 1 - for (index, value) in self.args.iteritems(): - if index > last_index: - return False - - if not (args_list[index] == value): - return False - - return True - - #does exact matching - def match_args_from_rule(self, rule): - if self.args == rule.args: - return True - - if self.args == None or rule.args == None: - return False - - my_args_list = self.args.items() - match_args_list = rule.args.iterms() - - if len(my_args_list) != len(match_args_list): - return False - - for (key, value) in my_args_list: - if rule.args.get(key) != value: - return False - - return True - - def is_match(self, rule): - if (self.signal_name == rule.signal_name and - self.dbus_interface == rule.dbus_interface and - self.sender == rule.sender and - self.path == rule.path and - self.match_args_from_rule(rule)): - if rule.handler_functions == []: - return True - - _funcs_copy_a = self.handler_functions[0:] - _funcs_copy_b = rule.handler_functions[0:] - _funcs_copy_a.sort() - _funcs_copy_b.sort() - - return _funcs_copy_a == _funcs_copy_b - - return False - - def __repr__(self): - """Returns a custom representation of this DBusMatchRule that can - be used with dbus_bindings - """ - repr = "type='signal'" - if (self.dbus_interface): - repr = repr + ",interface='%s'" % (self.dbus_interface) - - if (self.sender): - repr = repr + ",sender='%s'" % (self.sender) - - if (self.path): - repr = repr + ",path='%s'" % (self.path) - - if (self.signal_name): - repr = repr + ",member='%s'" % (self.signal_name) - - if (self.args): - my_args_list = self.args.items() - my_args_list.sort() - for (index, value) in my_args_list: - repr = repr + ",arg%i='%s'" % (index, value) - - return repr diff --git a/python/proxies.py b/python/proxies.py deleted file mode 100644 index 80e9ac27..00000000 --- a/python/proxies.py +++ /dev/null @@ -1,222 +0,0 @@ -import dbus_bindings -import introspect_parser -import sys -from exceptions import MissingReplyHandlerException, MissingErrorHandlerException, IntrospectionParserException - -class DeferedMethod: - """A DeferedMethod - - This is returned instead of ProxyMethod when we are defering DBus calls - while waiting for introspection data to be returned - """ - def __init__(self, proxy_method): - self._proxy_method = proxy_method - self._method_name = proxy_method._method_name - - def __call__(self, *args, **keywords): - reply_handler = None - if keywords.has_key('reply_handler'): - reply_handler = keywords['reply_handler'] - - #block for now even on async - # FIXME: put ret in async queue in future if we have a reply handler - - self._proxy_method._proxy._pending_introspect.block() - ret = self._proxy_method (*args, **keywords) - - return ret - -class ProxyMethod: - """A proxy Method. - - Typically a member of a ProxyObject. Calls to the - method produce messages that travel over the Bus and are routed - to a specific named Service. - """ - def __init__(self, proxy, connection, named_service, object_path, method_name, iface): - self._proxy = proxy - self._connection = connection - self._named_service = named_service - self._object_path = object_path - self._method_name = method_name - self._dbus_interface = iface - - def __call__(self, *args, **keywords): - timeout = -1 - if keywords.has_key('timeout'): - timeout = keywords['timeout'] - - reply_handler = None - if keywords.has_key('reply_handler'): - reply_handler = keywords['reply_handler'] - - error_handler = None - if keywords.has_key('error_handler'): - error_handler = keywords['error_handler'] - - ignore_reply = False - if keywords.has_key('ignore_reply'): - ignore_reply = keywords['ignore_reply'] - - - if not(reply_handler and error_handler): - if reply_handler: - raise MissingErrorHandlerException() - elif error_handler: - raise MissingReplyHandlerException() - - dbus_interface = self._dbus_interface - if keywords.has_key('dbus_interface'): - dbus_interface = keywords['dbus_interface'] - - tmp_iface = '' - if dbus_interface: - tmp_iface = dbus_interface + '.' - - key = tmp_iface + self._method_name - - introspect_sig = None - if self._proxy._introspect_method_map.has_key (key): - introspect_sig = self._proxy._introspect_method_map[key] - - message = dbus_bindings.MethodCall(self._object_path, dbus_interface, self._method_name) - message.set_destination(self._named_service) - - # Add the arguments to the function - iter = message.get_iter(True) - - if introspect_sig: - for (arg, sig) in zip(args, dbus_bindings.Signature(introspect_sig)): - iter.append_strict(arg, sig) - else: - for arg in args: - iter.append(arg) - - if ignore_reply: - result = self._connection.send(message) - args_tuple = (result,) - elif reply_handler: - result = self._connection.send_with_reply_handlers(message, timeout, reply_handler, error_handler) - args_tuple = result - else: - reply_message = self._connection.send_with_reply_and_block(message, timeout) - args_tuple = reply_message.get_args_list() - - if len(args_tuple) == 0: - return - elif len(args_tuple) == 1: - return args_tuple[0] - else: - return args_tuple - - -class ProxyObject: - """A proxy to the remote Object. - - A ProxyObject is provided by the Bus. ProxyObjects - have member functions, and can be called like normal Python objects. - """ - ProxyMethodClass = ProxyMethod - DeferedMethodClass = DeferedMethod - - INTROSPECT_STATE_DONT_INTROSPECT = 0 - INTROSPECT_STATE_INTROSPECT_IN_PROGRESS = 1 - INTROSPECT_STATE_INTROSPECT_DONE = 2 - - def __init__(self, bus, named_service, object_path, introspect=True): - self._bus = bus - self._named_service = named_service - self._object_path = object_path - - #PendingCall object for Introspect call - self._pending_introspect = None - #queue of async calls waiting on the Introspect to return - self._pending_introspect_queue = [] - #dictionary mapping method names to their input signatures - self._introspect_method_map = {} - - if not introspect: - self._introspect_state = self.INTROSPECT_STATE_DONT_INTROSPECT - else: - self._introspect_state = self.INTROSPECT_STATE_INTROSPECT_IN_PROGRESS - - (result, self._pending_introspect) = self._Introspect() - - - def connect_to_signal(self, signal_name, handler_function, dbus_interface=None, **keywords): - self._bus.add_signal_receiver(handler_function, - signal_name=signal_name, - dbus_interface=dbus_interface, - named_service=self._named_service, - path=self._object_path, - **keywords) - - def _Introspect(self): - message = dbus_bindings.MethodCall(self._object_path, 'org.freedesktop.DBus.Introspectable', 'Introspect') - message.set_destination(self._named_service) - - result = self._bus.get_connection().send_with_reply_handlers(message, -1, - self._introspect_reply_handler, - self._introspect_error_handler) - return result - - def _introspect_execute_queue(self): - for call in self._pending_introspect_queue: - (member, iface, args, keywords) = call - - introspect_sig = None - - tmp_iface = '' - if iface: - tmp_iface = iface + '.' - - key = tmp_iface + '.' + member - if self._introspect_method_map.has_key (key): - introspect_sig = self._introspect_method_map[key] - - - call_object = self.ProxyMethodClass(self._bus.get_connection(), - self._named_service, - self._object_path, - iface, - member, - introspect_sig) - - call_object(args, keywords) - - def _introspect_reply_handler(self, data): - try: - self._introspect_method_map = introspect_parser.process_introspection_data(data) - except IntrospectionParserException, e: - self._introspect_error_handler(e) - return - - self._introspect_state = self.INTROSPECT_STATE_INTROSPECT_DONE - #self._introspect_execute_queue() - - def _introspect_error_handler(self, error): - self._introspect_state = self.INTROSPECT_STATE_DONT_INTROSPECT - self._introspect_execute_queue() - sys.stderr.write("Introspect error: " + str(error) + "\n") - - def __getattr__(self, member, dbus_interface=None): - if member == '__call__': - return object.__call__ - elif member.startswith('__') and member.endswith('__'): - raise AttributeError(member) - else: - ret = self.ProxyMethodClass(self, self._bus.get_connection(), - self._named_service, - self._object_path, member, - dbus_interface) - - if self._introspect_state == self.INTROSPECT_STATE_INTROSPECT_IN_PROGRESS: - ret = self.DeferedMethodClass(ret) - - return ret - - def __repr__(self): - return ''%( - self._bus, self._named_service, self._object_path , id(self)) - __str__ = __repr__ - diff --git a/python/service.py b/python/service.py deleted file mode 100644 index 9148a357..00000000 --- a/python/service.py +++ /dev/null @@ -1,370 +0,0 @@ -import dbus_bindings -import _dbus -import operator -import traceback - -from exceptions import NameExistsException -from exceptions import UnknownMethodException -from decorators import method -from decorators import signal - -class BusName(object): - """A base class for exporting your own Named Services across the Bus - """ - def __new__(cls, name, bus=None): - # get default bus - if bus == None: - bus = _dbus.Bus() - - # see if this name is already defined, return it if so - if name in bus._bus_names: - return bus._bus_names[name] - - # otherwise register the name - retval = dbus_bindings.bus_request_name(bus.get_connection(), name) - - # TODO: more intelligent tracking of bus name states? - if retval == dbus_bindings.REQUEST_NAME_REPLY_PRIMARY_OWNER: - pass - elif retval == dbus_bindings.REQUEST_NAME_REPLY_IN_QUEUE: - # queueing can happen by default, maybe we should - # track this better or let the user know if they're - # queued or not? - pass - elif retval == dbus_bindings.REQUEST_NAME_REPLY_EXISTS: - raise NameExistsException(name) - elif retval == dbus_bindings.REQUEST_NAME_REPLY_ALREADY_OWNER: - # if this is a shared bus which is being used by someone - # else in this process, this can happen legitimately - pass - else: - raise RuntimeError('requesting bus name %s returned unexpected value %s' % (name, retval)) - - # and create the object - bus_name = object.__new__(cls) - bus_name._bus = bus - bus_name._name = name - - # cache instance - bus._bus_names[name] = bus_name - - return bus_name - - # do nothing because this is called whether or not the bus name - # object was retrieved from the cache or created new - def __init__(self, *args, **keywords): - pass - - # we can delete the low-level name here because these objects - # are guaranteed to exist only once for each bus name - def __del__(self): - dbus_bindings.bus_release_name(self._bus.get_connection(), self._name) - pass - - def get_bus(self): - """Get the Bus this Service is on""" - return self._bus - - def get_name(self): - """Get the name of this service""" - return self._name - - def __repr__(self): - return '' % (self._name, self._bus, id(self)) - __str__ = __repr__ - - -def _method_lookup(self, method_name, dbus_interface): - """Walks the Python MRO of the given class to find the method to invoke. - - Returns two methods, the one to call, and the one it inherits from which - defines its D-Bus interface name, signature, and attributes. - """ - parent_method = None - candidate_class = None - successful = False - - # split up the cases when we do and don't have an interface because the - # latter is much simpler - if dbus_interface: - # search through the class hierarchy in python MRO order - for cls in self.__class__.__mro__: - # if we haven't got a candidate class yet, and we find a class with a - # suitably named member, save this as a candidate class - if (not candidate_class and method_name in cls.__dict__): - if ("_dbus_is_method" in cls.__dict__[method_name].__dict__ - and "_dbus_interface" in cls.__dict__[method_name].__dict__): - # however if it is annotated for a different interface - # than we are looking for, it cannot be a candidate - if cls.__dict__[method_name]._dbus_interface == dbus_interface: - candidate_class = cls - parent_method = cls.__dict__[method_name] - successful = True - break - else: - pass - else: - candidate_class = cls - - # if we have a candidate class, carry on checking this and all - # superclasses for a method annoated as a dbus method - # on the correct interface - if (candidate_class and method_name in cls.__dict__ - and "_dbus_is_method" in cls.__dict__[method_name].__dict__ - and "_dbus_interface" in cls.__dict__[method_name].__dict__ - and cls.__dict__[method_name]._dbus_interface == dbus_interface): - # the candidate class has a dbus method on the correct interface, - # or overrides a method that is, success! - parent_method = cls.__dict__[method_name] - successful = True - break - - else: - # simpler version of above - for cls in self.__class__.__mro__: - if (not candidate_class and method_name in cls.__dict__): - candidate_class = cls - - if (candidate_class and method_name in cls.__dict__ - and "_dbus_is_method" in cls.__dict__[method_name].__dict__): - parent_method = cls.__dict__[method_name] - successful = True - break - - if successful: - return (candidate_class.__dict__[method_name], parent_method) - else: - if dbus_interface: - raise UnknownMethodException('%s is not a valid method of interface %s' % (method_name, dbus_interface)) - else: - raise UnknownMethodException('%s is not a valid method' % method_name) - - -def _method_reply_return(connection, message, method_name, signature, *retval): - reply = dbus_bindings.MethodReturn(message) - iter = reply.get_iter(append=True) - - # do strict adding if an output signature was provided - if signature: - if len(signature) > len(retval): - raise TypeError('output signature %s is longer than the number of values returned by %s' % - (signature, method_name)) - elif len(retval) > len(signature): - raise TypeError('output signature %s is shorter than the number of values returned by %s' % - (signature, method_name)) - else: - for (value, sig) in zip(retval, signature): - iter.append_strict(value, sig) - - # no signature, try and guess the return type by inspection - else: - for value in retval: - iter.append(value) - - connection.send(reply) - - -def _method_reply_error(connection, message, exception): - if '_dbus_error_name' in exception.__dict__: - name = exception._dbus_error_name - elif exception.__module__ == '__main__': - name = 'org.freedesktop.DBus.Python.%s' % exception.__class__.__name__ - else: - name = 'org.freedesktop.DBus.Python.%s.%s' % (exception.__module__, exception.__class__.__name__) - - contents = traceback.format_exc() - reply = dbus_bindings.Error(message, name, contents) - - connection.send(reply) - - -class InterfaceType(type): - def __init__(cls, name, bases, dct): - # these attributes are shared between all instances of the Interface - # object, so this has to be a dictionary that maps class names to - # the per-class introspection/interface data - class_table = getattr(cls, '_dbus_class_table', {}) - cls._dbus_class_table = class_table - interface_table = class_table[cls.__module__ + '.' + name] = {} - - # merge all the name -> method tables for all the interfaces - # implemented by our base classes into our own - for b in bases: - base_name = b.__module__ + '.' + b.__name__ - if getattr(b, '_dbus_class_table', False): - for (interface, method_table) in class_table[base_name].iteritems(): - our_method_table = interface_table.setdefault(interface, {}) - our_method_table.update(method_table) - - # add in all the name -> method entries for our own methods/signals - for func in dct.values(): - if getattr(func, '_dbus_interface', False): - method_table = interface_table.setdefault(func._dbus_interface, {}) - method_table[func.__name__] = func - - super(InterfaceType, cls).__init__(name, bases, dct) - - # methods are different to signals, so we have two functions... :) - def _reflect_on_method(cls, func): - args = func._dbus_args - - if func._dbus_in_signature: - # convert signature into a tuple so length refers to number of - # types, not number of characters. the length is checked by - # the decorator to make sure it matches the length of args. - in_sig = tuple(dbus_bindings.Signature(func._dbus_in_signature)) - else: - # magic iterator which returns as many v's as we need - in_sig = dbus_bindings.VariantSignature() - - if func._dbus_out_signature: - out_sig = dbus_bindings.Signature(func._dbus_out_signature) - else: - # its tempting to default to dbus_bindings.Signature('v'), but - # for methods that return nothing, providing incorrect - # introspection data is worse than providing none at all - out_sig = [] - - reflection_data = ' \n' % (func.__name__) - for pair in zip(in_sig, args): - reflection_data += ' \n' % pair - for type in out_sig: - reflection_data += ' \n' % type - reflection_data += ' \n' - - return reflection_data - - def _reflect_on_signal(cls, func): - args = func._dbus_args - - if func._dbus_signature: - # convert signature into a tuple so length refers to number of - # types, not number of characters - sig = tuple(dbus_bindings.Signature(func._dbus_signature)) - else: - # magic iterator which returns as many v's as we need - sig = dbus_bindings.VariantSignature() - - reflection_data = ' \n' % (func.__name__) - for pair in zip(sig, args): - reflection_data = reflection_data + ' \n' % pair - reflection_data = reflection_data + ' \n' - - return reflection_data - -class Interface(object): - __metaclass__ = InterfaceType - -class Object(Interface): - """A base class for exporting your own Objects across the Bus. - - Just inherit from Object and provide a list of methods to share - across the Bus - """ - def __init__(self, bus_name, object_path): - self._object_path = object_path - self._name = bus_name - self._bus = bus_name.get_bus() - - self._connection = self._bus.get_connection() - - self._connection.register_object_path(object_path, self._unregister_cb, self._message_cb) - - def _unregister_cb(self, connection): - print ("Unregister") - - def _message_cb(self, connection, message): - try: - # lookup candidate method and parent method - method_name = message.get_member() - interface_name = message.get_interface() - (candidate_method, parent_method) = _method_lookup(self, method_name, interface_name) - - # set up method call parameters - args = message.get_args_list() - keywords = {} - - # iterate signature into list of complete types - if parent_method._dbus_out_signature: - signature = tuple(dbus_bindings.Signature(parent_method._dbus_out_signature)) - else: - signature = None - - # set up async callback functions - if parent_method._dbus_async_callbacks: - (return_callback, error_callback) = parent_method._dbus_async_callbacks - keywords[return_callback] = lambda *retval: _method_reply_return(connection, message, method_name, signature, *retval) - keywords[error_callback] = lambda exception: _method_reply_error(connection, message, exception) - - # include the sender if desired - if parent_method._dbus_sender_keyword: - keywords[parent_method._dbus_sender_keyword] = message.get_sender() - - # call method - retval = candidate_method(self, *args, **keywords) - - # we're done - the method has got callback functions to reply with - if parent_method._dbus_async_callbacks: - return - - # otherwise we send the return values in a reply. if we have a - # signature, use it to turn the return value into a tuple as - # appropriate - if parent_method._dbus_out_signature: - # if we have zero or one return values we want make a tuple - # for the _method_reply_return function, otherwise we need - # to check we're passing it a sequence - if len(signature) == 0: - if retval == None: - retval = () - else: - raise TypeError('%s has an empty output signature but did not return None' % - method_name) - elif len(signature) == 1: - retval = (retval,) - else: - if operator.isSequenceType(retval): - # multi-value signature, multi-value return... proceed unchanged - pass - else: - raise TypeError('%s has multiple output values in signature %s but did not return a sequence' % - (method_name, signature)) - - # no signature, so just turn the return into a tuple and send it as normal - else: - signature = None - if retval == None: - retval = () - else: - retval = (retval,) - - _method_reply_return(connection, message, method_name, signature, *retval) - except Exception, exception: - # send error reply - _method_reply_error(connection, message, exception) - - @method('org.freedesktop.DBus.Introspectable', in_signature='', out_signature='s') - def Introspect(self): - reflection_data = '\n' - reflection_data += '\n' % (self._object_path) - - interfaces = self._dbus_class_table[self.__class__.__module__ + '.' + self.__class__.__name__] - for (name, funcs) in interfaces.iteritems(): - reflection_data += ' \n' % (name) - - for func in funcs.values(): - if getattr(func, '_dbus_is_method', False): - reflection_data += self.__class__._reflect_on_method(func) - elif getattr(func, '_dbus_is_signal', False): - reflection_data += self.__class__._reflect_on_signal(func) - - reflection_data += ' \n' - - reflection_data += '\n' - - return reflection_data - - def __repr__(self): - return '' % (self._object_path, self._name, id(self)) - __str__ = __repr__ - diff --git a/python/types.py b/python/types.py deleted file mode 100644 index f3d348c6..00000000 --- a/python/types.py +++ /dev/null @@ -1,19 +0,0 @@ -import dbus_bindings - -ObjectPath = dbus_bindings.ObjectPath -ByteArray = dbus_bindings.ByteArray -Signature = dbus_bindings.Signature -Byte = dbus_bindings.Byte -Boolean = dbus_bindings.Boolean -Int16 = dbus_bindings.Int16 -UInt16 = dbus_bindings.UInt16 -Int32 = dbus_bindings.Int32 -UInt32 = dbus_bindings.UInt32 -Int64 = dbus_bindings.Int64 -UInt64 = dbus_bindings.UInt64 -Double = dbus_bindings.Double -String = dbus_bindings.String -Array = dbus_bindings.Array -Struct = dbus_bindings.Struct -Dictionary = dbus_bindings.Dictionary -Variant = dbus_bindings.Variant diff --git a/qt/.cvsignore b/qt/.cvsignore deleted file mode 100644 index f6454f28..00000000 --- a/qt/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.da -*.gcov -*.moc diff --git a/qt/Doxyfile b/qt/Doxyfile deleted file mode 100644 index a57ca5c6..00000000 --- a/qt/Doxyfile +++ /dev/null @@ -1,1261 +0,0 @@ -# Doxyfile 1.4.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = QtDBus - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.62 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/api - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, -# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, -# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, -# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, -# Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = "value=\li \a" - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = YES - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = YES - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = YES - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -FILE_PATTERNS = *.cpp \ - *.h - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = ./selftests - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = Makefile.* \ - ChangeLog \ - CHANGES \ - CHANGES.* \ - README \ - README.* \ - *.png \ - AUTHORS \ - DESIGN \ - DESIGN.* \ - *.desktop \ - DESKTOP* \ - COMMENTS \ - HOWTO \ - magic \ - NOTES \ - TODO \ - THANKS - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = examples - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = QDBus - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3dbus - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = NO - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = YES - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = DBUS_BEGIN_DECLS= \ - DBUS_END_DECLS= \ - DOXYGEN_SHOULD_SKIP_THIS \ - _DBUS_DEFINE_GLOBAL_LOCK(name)= \ - _DBUS_GNUC_PRINTF(from,to)= \ - Q_DECLARE_FLAGS(flags,theenum)= \ - Q_QDOC - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = ./qt.tag=http://doc.trolltech.com/4.1 - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 640 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that a graph may be further truncated if the graph's -# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH -# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), -# the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/qt/Makefile.am b/qt/Makefile.am deleted file mode 100644 index 83d3d9ff..00000000 --- a/qt/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -DIST_SUBDIRS = dbus src tools examples - -if HAVE_QT -QT_SUBDIRS = src tools examples -endif - -SUBDIRS = $(QT_SUBDIRS) - -EXTRA_DIST = qt-dbus.qdocconf diff --git a/qt/README b/qt/README deleted file mode 100644 index efa2799d..00000000 --- a/qt/README +++ /dev/null @@ -1,10 +0,0 @@ -These are the Qt4 D-Bus bindings. - -They are being maintained by Trolltech AS. As we are currently -considering placing this code in a future version of Qt, we would like -to ask any contributors to contact us before submitting code to this -repository. - - -For more information, please contact - Thiago Macieira diff --git a/qt/dbus/Makefile.am b/qt/dbus/Makefile.am deleted file mode 100644 index 071234d9..00000000 --- a/qt/dbus/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -EXTRA_DIST = qdbusabstractadaptor.h \ - qdbusabstractadaptor_p.h \ - qdbusabstractinterface.h \ - qdbusabstractinterface_p.h \ - qdbusbus.h \ - qdbusconnection.h \ - qdbusconnection_p.h \ - qdbuserror.h \ - qdbus.h \ - qdbusinterface.h \ - qdbusinterface_p.h \ - qdbusintrospection_p.h \ - qdbusmacros.h \ - qdbusmarshall_p.h \ - qdbusmessage.h \ - qdbusmessage_p.h \ - qdbusmetaobject_p.h \ - qdbusreply.h \ - qdbusserver.h \ - qdbustypehelper_p.h \ - qdbustype_p.h \ - qdbusutil.h \ - qdbusxmlparser_p.h diff --git a/qt/dbus/qdbus.h b/qt/dbus/qdbus.h deleted file mode 100644 index 9fbc27aa..00000000 --- a/qt/dbus/qdbus.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbus.h" diff --git a/qt/dbus/qdbusabstractadaptor.h b/qt/dbus/qdbusabstractadaptor.h deleted file mode 100644 index 94cc3a22..00000000 --- a/qt/dbus/qdbusabstractadaptor.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusabstractadaptor.h" diff --git a/qt/dbus/qdbusabstractadaptor_p.h b/qt/dbus/qdbusabstractadaptor_p.h deleted file mode 100644 index d55bef36..00000000 --- a/qt/dbus/qdbusabstractadaptor_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusabstractadaptor_p.h" diff --git a/qt/dbus/qdbusabstractinterface.h b/qt/dbus/qdbusabstractinterface.h deleted file mode 100644 index e7ab181a..00000000 --- a/qt/dbus/qdbusabstractinterface.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusabstractinterface.h" diff --git a/qt/dbus/qdbusabstractinterface_p.h b/qt/dbus/qdbusabstractinterface_p.h deleted file mode 100644 index 5f6e7d5d..00000000 --- a/qt/dbus/qdbusabstractinterface_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusabstractinterface_p.h" diff --git a/qt/dbus/qdbusbus.h b/qt/dbus/qdbusbus.h deleted file mode 100644 index eb849ac8..00000000 --- a/qt/dbus/qdbusbus.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusbus.h" diff --git a/qt/dbus/qdbusconnection.h b/qt/dbus/qdbusconnection.h deleted file mode 100644 index 99ac3239..00000000 --- a/qt/dbus/qdbusconnection.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusconnection.h" diff --git a/qt/dbus/qdbusconnection_p.h b/qt/dbus/qdbusconnection_p.h deleted file mode 100644 index aaabb231..00000000 --- a/qt/dbus/qdbusconnection_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusconnection_p.h" diff --git a/qt/dbus/qdbuserror.h b/qt/dbus/qdbuserror.h deleted file mode 100644 index 680395a1..00000000 --- a/qt/dbus/qdbuserror.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbuserror.h" diff --git a/qt/dbus/qdbusinterface.h b/qt/dbus/qdbusinterface.h deleted file mode 100644 index c7024c8b..00000000 --- a/qt/dbus/qdbusinterface.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusinterface.h" diff --git a/qt/dbus/qdbusinterface_p.h b/qt/dbus/qdbusinterface_p.h deleted file mode 100644 index 95384483..00000000 --- a/qt/dbus/qdbusinterface_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusinterface_p.h" diff --git a/qt/dbus/qdbusintrospection_p.h b/qt/dbus/qdbusintrospection_p.h deleted file mode 100644 index 210ed1ea..00000000 --- a/qt/dbus/qdbusintrospection_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusintrospection_p.h" diff --git a/qt/dbus/qdbusmacros.h b/qt/dbus/qdbusmacros.h deleted file mode 100644 index dcd725e9..00000000 --- a/qt/dbus/qdbusmacros.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusmacros.h" diff --git a/qt/dbus/qdbusmarshall_p.h b/qt/dbus/qdbusmarshall_p.h deleted file mode 100644 index 1e911852..00000000 --- a/qt/dbus/qdbusmarshall_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusmarshall_p.h" diff --git a/qt/dbus/qdbusmessage.h b/qt/dbus/qdbusmessage.h deleted file mode 100644 index e993c1f9..00000000 --- a/qt/dbus/qdbusmessage.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusmessage.h" diff --git a/qt/dbus/qdbusmessage_p.h b/qt/dbus/qdbusmessage_p.h deleted file mode 100644 index 2b942017..00000000 --- a/qt/dbus/qdbusmessage_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusmessage_p.h" diff --git a/qt/dbus/qdbusmetaobject_p.h b/qt/dbus/qdbusmetaobject_p.h deleted file mode 100644 index 37a6e300..00000000 --- a/qt/dbus/qdbusmetaobject_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusmetaobject_p.h" diff --git a/qt/dbus/qdbusreply.h b/qt/dbus/qdbusreply.h deleted file mode 100644 index 8c87a715..00000000 --- a/qt/dbus/qdbusreply.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusreply.h" diff --git a/qt/dbus/qdbusserver.h b/qt/dbus/qdbusserver.h deleted file mode 100644 index a8ca4ed4..00000000 --- a/qt/dbus/qdbusserver.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusserver.h" diff --git a/qt/dbus/qdbustype_p.h b/qt/dbus/qdbustype_p.h deleted file mode 100644 index 1f946019..00000000 --- a/qt/dbus/qdbustype_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbustype_p.h" diff --git a/qt/dbus/qdbustypehelper_p.h b/qt/dbus/qdbustypehelper_p.h deleted file mode 100644 index 1e3c3427..00000000 --- a/qt/dbus/qdbustypehelper_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbustypehelper_p.h" diff --git a/qt/dbus/qdbusutil.h b/qt/dbus/qdbusutil.h deleted file mode 100644 index 1b9dbd0f..00000000 --- a/qt/dbus/qdbusutil.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusutil.h" diff --git a/qt/dbus/qdbusxmlparser_p.h b/qt/dbus/qdbusxmlparser_p.h deleted file mode 100644 index f3e11008..00000000 --- a/qt/dbus/qdbusxmlparser_p.h +++ /dev/null @@ -1 +0,0 @@ -#include "../src/qdbusxmlparser_p.h" diff --git a/qt/examples/.cvsignore b/qt/examples/.cvsignore deleted file mode 100644 index f6454f28..00000000 --- a/qt/examples/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.da -*.gcov -*.moc diff --git a/qt/examples/Makefile.am b/qt/examples/Makefile.am deleted file mode 100644 index 0d4c6eba..00000000 --- a/qt/examples/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -INCLUDES=-I$(top_srcdir)/qt $(DBUS_CLIENT_CFLAGS) $(DBUS_QT_CFLAGS) -DDBUS_COMPILATION -LDADD = ../src/libdbus-qt4-1.la - -if HAVE_QT_GUI -chat_LDADD = $(LDADD) $(DBUS_QT_GUI_LIBS) -dist_chat_SOURCES = chat.cpp chat.h chatadaptor.cpp -nodist_chat_SOURCES = chatinterface.cpp -chat.o: ui_chatmainwindow.h ui_chatsetnickname.h chatinterface.h chatadaptor.h chat.moc chatadaptor.moc -ui_chatmainwindow.h: chatmainwindow.ui -ui_chatsetnickname.h: chatsetnickname.ui -chatinterface.cpp chatinterface.h: com.trolltech.ChatInterface.xml - ../tools/dbusidl2cpp -m -p chatinterface $? - $(QT_MOC) -o chatinterface.moc chatinterface.h - -CHAT=chat -endif - - -noinst_PROGRAMS = hello listnames ping pong complexping complexpong $(CHAT) -hello_SOURCES = hello.cpp -listnames_SOURCES = listnames.cpp - -ping_SOURCES = ping.cpp -pong_SOURCES = pong.cpp pong.h -pong.o: pong.moc - -complexping_SOURCES = complexping.cpp complexping.h -complexpong_SOURCES = complexpong.cpp complexpong.h -complexpong.o: complexpong.moc -complexping.o: complexping.moc - -EXTRA_DIST = ping-common.h chatmainwindow.ui chatsetnickname.ui com.trolltech.ChatInterface.xml chatadaptor.h - -CLEANFILES = chat.moc chatadaptor.moc complexping.moc complexpong.moc pong.moc \ - chatinterface.cpp chatinterface.h chatinterface.moc \ - ui_chatmainwindow.h ui_chatsetnickname.h - -%.moc: %.h - $(QT_MOC) $< > $@ -ui_%.h: %.ui - $(QT_UIC) -o $@ $? - diff --git a/qt/examples/chat.cpp b/qt/examples/chat.cpp deleted file mode 100644 index 86ff873b..00000000 --- a/qt/examples/chat.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "chat.h" -#include -#include - -#include "chatadaptor.h" -#include "chatinterface.h" - -ChatMainWindow::ChatMainWindow() - : m_nickname(QLatin1String("nickname")) -{ - setupUi(this); - sendButton->setEnabled(false); - - connect(messageLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(textChangedSlot(QString))); - connect(sendButton, SIGNAL(clicked(bool)), this, SLOT(sendClickedSlot())); - connect(actionChangeNickname, SIGNAL(triggered(bool)), this, SLOT(changeNickname())); - connect(actionAboutQt, SIGNAL(triggered(bool)), this, SLOT(aboutQt())); - connect(qApp, SIGNAL(lastWindowClosed()), this, SLOT(exiting())); - - // add our D-Bus interface and connect to D-Bus - new ChatInterfaceAdaptor(this); - QDBus::systemBus().registerObject("/", this); - - com::trolltech::ChatInterface *iface; - iface = QDBus::systemBus().findInterface(QString(), QString()); - connect(iface, SIGNAL(message(QString,QString)), this, SLOT(messageSlot(QString,QString))); - connect(iface, SIGNAL(action(QString,QString)), this, SLOT(actionSlot(QString,QString))); - - NicknameDialog dialog; - dialog.cancelButton->setVisible(false); - dialog.exec(); - m_nickname = dialog.nickname->text().trimmed(); - emit action(m_nickname, QLatin1String("joins the chat")); -} - -ChatMainWindow::~ChatMainWindow() -{ -} - -void ChatMainWindow::rebuildHistory() -{ - QString history = m_messages.join( QLatin1String("\n" ) ); - chatHistory->setPlainText(history); -} - -void ChatMainWindow::messageSlot(const QString &nickname, const QString &text) -{ - QString msg( QLatin1String("<%1> %2") ); - msg = msg.arg(nickname, text); - m_messages.append(msg); - - if (m_messages.count() > 100) - m_messages.removeFirst(); - rebuildHistory(); -} - -void ChatMainWindow::actionSlot(const QString &nickname, const QString &text) -{ - QString msg( QLatin1String("* %1 %2") ); - msg = msg.arg(nickname, text); - m_messages.append(msg); - - if (m_messages.count() > 100) - m_messages.removeFirst(); - rebuildHistory(); -} - -void ChatMainWindow::textChangedSlot(const QString &newText) -{ - sendButton->setEnabled(!newText.isEmpty()); -} - -void ChatMainWindow::sendClickedSlot() -{ - emit message(m_nickname, messageLineEdit->text()); - messageLineEdit->setText(QString()); -} - -void ChatMainWindow::changeNickname() -{ - NicknameDialog dialog(this); - if (dialog.exec() == QDialog::Accepted) { - QString old = m_nickname; - m_nickname = dialog.nickname->text().trimmed(); - emit action(old, QString("is now known as %1").arg(m_nickname)); - } -} - -void ChatMainWindow::aboutQt() -{ - QMessageBox::aboutQt(this); -} - -void ChatMainWindow::exiting() -{ - emit action(m_nickname, QLatin1String("leaves the chat")); -} - -NicknameDialog::NicknameDialog(QWidget *parent) - : QDialog(parent) -{ - setupUi(this); -} - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - ChatMainWindow chat; - chat.show(); - return app.exec(); -} - -#include "chat.moc" diff --git a/qt/examples/chat.h b/qt/examples/chat.h deleted file mode 100644 index b0e50a35..00000000 --- a/qt/examples/chat.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef CHAT_H -#define CHAT_H - -#include -#include -#include "ui_chatmainwindow.h" -#include "ui_chatsetnickname.h" - -class ChatMainWindow: public QMainWindow, Ui::ChatMainWindow -{ - Q_OBJECT - QString m_nickname; - QStringList m_messages; -public: - ChatMainWindow(); - ~ChatMainWindow(); - - void rebuildHistory(); - -signals: - void message(const QString &nickname, const QString &text); - void action(const QString &nickname, const QString &text); - -private slots: - void messageSlot(const QString &nickname, const QString &text); - void actionSlot(const QString &nickname, const QString &text); - void textChangedSlot(const QString &newText); - void sendClickedSlot(); - void changeNickname(); - void aboutQt(); - void exiting(); -}; - -class NicknameDialog: public QDialog, public Ui::NicknameDialog -{ - Q_OBJECT -public: - NicknameDialog(QWidget *parent = 0); -}; - -#endif diff --git a/qt/examples/chatadaptor.cpp b/qt/examples/chatadaptor.cpp deleted file mode 100644 index 525b9aad..00000000 --- a/qt/examples/chatadaptor.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file was generated by dbusidl2cpp version 0.3 - * when processing input file /home/tjmaciei/src/kde4/playground/libs/qt-dbus/examples/com.trolltech.ChatInterface.xml - * - * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved. - * - * This is an auto-generated file. - */ - -#include "chatadaptor.h" -#include -#include -#include -#include -#include -#include -#include - -/* - * Implementation of adaptor class ChatInterfaceAdaptor - */ - -ChatInterfaceAdaptor::ChatInterfaceAdaptor(QObject *parent) - : QDBusAbstractAdaptor(parent) -{ - // constructor - setAutoRelaySignals(true); -} - -ChatInterfaceAdaptor::~ChatInterfaceAdaptor() -{ - // destructor -} - - -#include "chatadaptor.moc" diff --git a/qt/examples/chatadaptor.h b/qt/examples/chatadaptor.h deleted file mode 100644 index cbec0120..00000000 --- a/qt/examples/chatadaptor.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file was generated by dbusidl2cpp version 0.3 - * when processing input file /home/tjmaciei/src/kde4/playground/libs/qt-dbus/examples/com.trolltech.ChatInterface.xml - * - * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved. - * - * This is an auto-generated file. - */ - -#ifndef CHATADAPTOR_H_88051142890130 -#define CHATADAPTOR_H_88051142890130 - -#include -#include -class QByteArray; -template class QList; -template class QMap; -class QString; -class QStringList; -class QVariant; - -/* - * Adaptor class for interface com.trolltech.ChatInterface - */ -class ChatInterfaceAdaptor: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.ChatInterface") -public: - ChatInterfaceAdaptor(QObject *parent); - virtual ~ChatInterfaceAdaptor(); - -public: // PROPERTIES -public slots: // METHODS -signals: // SIGNALS - void action(const QString &nickname, const QString &text); - void message(const QString &nickname, const QString &text); -}; - -#endif diff --git a/qt/examples/chatmainwindow.ui b/qt/examples/chatmainwindow.ui deleted file mode 100644 index 0e4461c3..00000000 --- a/qt/examples/chatmainwindow.ui +++ /dev/null @@ -1,188 +0,0 @@ - - - - - ChatMainWindow - - - - 0 - 0 - 800 - 600 - - - - QtDBus Chat - - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - false - - - Messages sent and received from other users - - - true - - - - - - - 0 - - - 6 - - - - - Message: - - - messageLineEdit - - - - - - - - - - - 1 - 0 - 0 - 0 - - - - Sends a message to other people - - - - - - Send - - - - - - - - - - - - - 0 - 0 - 800 - 31 - - - - - Help - - - - - - File - - - - - - - - - - - - Quit - - - Ctrl+Q - - - - - - - - About Qt... - - - - - Change nickname... - - - Ctrl+N - - - - - - chatHistory - messageLineEdit - sendButton - - - - - messageLineEdit - returnPressed() - sendButton - animateClick() - - - 299 - 554 - - - 744 - 551 - - - - - actionQuit - triggered(bool) - ChatMainWindow - close() - - - -1 - -1 - - - 399 - 299 - - - - - diff --git a/qt/examples/chatsetnickname.ui b/qt/examples/chatsetnickname.ui deleted file mode 100644 index fb9894e0..00000000 --- a/qt/examples/chatsetnickname.ui +++ /dev/null @@ -1,149 +0,0 @@ - - - - - NicknameDialog - - - - 0 - 0 - 396 - 105 - - - - - 1 - 1 - 0 - 0 - - - - Set nickname - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - - 1 - 1 - 0 - 0 - - - - New nickname: - - - - - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 131 - 31 - - - - - - - - OK - - - - - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - okButton - clicked() - NicknameDialog - accept() - - - 278 - 253 - - - 96 - 254 - - - - - cancelButton - clicked() - NicknameDialog - reject() - - - 369 - 253 - - - 179 - 282 - - - - - diff --git a/qt/examples/com.trolltech.ChatInterface.xml b/qt/examples/com.trolltech.ChatInterface.xml deleted file mode 100644 index 666a9e35..00000000 --- a/qt/examples/com.trolltech.ChatInterface.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - diff --git a/qt/examples/complexping.cpp b/qt/examples/complexping.cpp deleted file mode 100644 index b977edfc..00000000 --- a/qt/examples/complexping.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include - -#include -#include -#include -#include -#include - -#include "ping-common.h" -#include "complexping.h" - -void Ping::start(const QString &name, const QString &oldValue, const QString &newValue) -{ - Q_UNUSED(oldValue); - - if (name != SERVICE_NAME || newValue.isEmpty()) - return; - - // open stdin for reading - qstdin.open(stdin, QIODevice::ReadOnly); - - // find our remote - iface = QDBus::sessionBus().findInterface(SERVICE_NAME, "/"); - if (!iface) { - fprintf(stderr, "%s\n", - qPrintable(QDBus::sessionBus().lastError().message())); - QCoreApplication::instance()->quit(); - } - - connect(iface, SIGNAL(aboutToQuit()), QCoreApplication::instance(), SLOT(quit())); - - while (true) { - qDebug() << "Ready"; - - QString line = QString::fromLocal8Bit(qstdin.readLine()).trimmed(); - if (line.isEmpty()) { - iface->call("quit"); - return; - } else if (line == "value") { - QVariant reply = iface->property("value"); - if (!reply.isNull()) - qDebug() << "value =" << reply.toString(); - } else if (line.startsWith("value=")) { - iface->setProperty("value", line.mid(6)); - } else { - QDBusReply reply = iface->call("query", line); - if (reply.isSuccess()) - qDebug() << "Reply was:" << reply.value(); - } - - if (iface->lastError().isValid()) - fprintf(stderr, "Call failed: %s\n", qPrintable(iface->lastError().message())); - } -} - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - Ping ping; - ping.connect(QDBus::sessionBus().busService(), - SIGNAL(nameOwnerChanged(QString,QString,QString)), - SLOT(start(QString,QString,QString))); - - QProcess pong; - pong.start("./complexpong"); - - app.exec(); -} - -#include "complexping.moc" diff --git a/qt/examples/complexping.h b/qt/examples/complexping.h deleted file mode 100644 index 4332ef8a..00000000 --- a/qt/examples/complexping.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef COMPLEXPING_H -#define COMPLEXPING_H - -#include - -class Ping: public QObject -{ - Q_OBJECT -public slots: - void start(const QString &, const QString &, const QString &); -public: - QFile qstdin; - QDBusInterface *iface; -}; - -#endif diff --git a/qt/examples/complexpong.cpp b/qt/examples/complexpong.cpp deleted file mode 100644 index ff767407..00000000 --- a/qt/examples/complexpong.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include - -#include -#include -#include - -#include "ping-common.h" -#include "complexpong.h" - -// the property -QString Pong::value() const -{ - return m_value; -} - -void Pong::setValue(const QString &newValue) -{ - m_value = newValue; -} - -void Pong::quit() -{ - QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit())); -} - -QVariant Pong::query(const QString &query) -{ - QString q = query.toLower(); - if (q == "hello") - return "World"; - if (q == "ping") - return "Pong"; - if (q == "the answer to life, the universe and everything") - return 42; - if (q.indexOf("unladen swallow") != -1) { - if (q.indexOf("european") != -1) - return 11.0; - return QByteArray("african or european?"); - } - - return "Sorry, I don't know the answer"; -} - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - QDBusBusService *bus = QDBus::sessionBus().busService(); - - QObject obj; - Pong *pong = new Pong(&obj); - pong->connect(&app, SIGNAL(aboutToQuit()), SIGNAL(aboutToQuit())); - pong->setProperty("value", "initial value"); - QDBus::sessionBus().registerObject("/", &obj); - - if (bus->requestName(SERVICE_NAME, QDBusBusService::AllowReplacingName) != - QDBusBusService::PrimaryOwnerReply) - exit(1); - - app.exec(); - return 0; -} - -#include "complexpong.moc" diff --git a/qt/examples/complexpong.h b/qt/examples/complexpong.h deleted file mode 100644 index c6ad2dbb..00000000 --- a/qt/examples/complexpong.h +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef COMPLEXPONG_H -#define COMPLEXPONG_H - -#include - -class Pong: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.QtDBus.ComplexPong.Pong") - Q_PROPERTY(QString value READ value WRITE setValue) -public: - QString m_value; - QString value() const; - void setValue(const QString &newValue); - - Pong(QObject *obj) : QDBusAbstractAdaptor(obj) - { } -signals: - void aboutToQuit(); -public slots: - QVariant query(const QString &query); - Q_ASYNC void quit(); -}; - -#endif diff --git a/qt/examples/hello.cpp b/qt/examples/hello.cpp deleted file mode 100644 index a287bcb0..00000000 --- a/qt/examples/hello.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include - -#include -#include - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - printf("Hello, World\n"); - return 0; -} diff --git a/qt/examples/listnames.cpp b/qt/examples/listnames.cpp deleted file mode 100644 index 27703f5a..00000000 --- a/qt/examples/listnames.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include -#include - -void method1() -{ - QDBusReply reply = QDBus::sessionBus().busService()->listNames(); - if (reply.isError()) { - qDebug() << "Error:" << reply.error().message(); - exit(1); - } - foreach (QString name, reply.value()) - qDebug() << name; -} - -void method2() -{ - QDBusInterface *dbus_iface; - QDBusConnection &bus = QDBus::sessionBus(); - dbus_iface = bus.findInterface("org.freedesktop.DBus", "/org/freedesktop/DBus", - "org.freedesktop.DBus"); - qDebug() << dbus_iface->call("ListNames").first(); -} - -void method3() -{ - qDebug() << QDBus::sessionBus().busService()->listNames().value(); -} - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - method1(); - method2(); - method3(); - - return 0; -} diff --git a/qt/examples/ping-common.h b/qt/examples/ping-common.h deleted file mode 100644 index 1870275d..00000000 --- a/qt/examples/ping-common.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#define SERVICE_NAME "com.trolltech.QtDBus.PingExample" diff --git a/qt/examples/ping.cpp b/qt/examples/ping.cpp deleted file mode 100644 index ffa53a42..00000000 --- a/qt/examples/ping.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include - -#include -#include - -#include "ping-common.h" - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - QDBusInterface *iface = QDBus::sessionBus().findInterface(SERVICE_NAME, "/"); - if (iface) { - QDBusReply reply = iface->call("ping", argc > 1 ? argv[1] : ""); - if (reply.isSuccess()) { - printf("Reply was: %s\n", qPrintable(reply.value())); - return 0; - } - - fprintf(stderr, "Call failed: %s\n", qPrintable(reply.error().message())); - return 1; - } - - fprintf(stderr, "%s\n", - qPrintable(QDBus::sessionBus().lastError().message())); - return 1; -} diff --git a/qt/examples/pong.cpp b/qt/examples/pong.cpp deleted file mode 100644 index b85f1f0c..00000000 --- a/qt/examples/pong.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include - -#include -#include -#include - -#include "ping-common.h" -#include "pong.h" - -QString Pong::ping(const QString &arg) -{ - QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit())); - return QString("ping(\"%1\") got called").arg(arg); -} - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - QDBusBusService *bus = QDBus::sessionBus().busService(); - if (bus->requestName(SERVICE_NAME, QDBusBusService::AllowReplacingName) != - QDBusBusService::PrimaryOwnerReply) - exit(1); - - Pong pong; - QDBus::sessionBus().registerObject("/", &pong, QDBusConnection::ExportSlots); - - app.exec(); - return 0; -} - -#include "pong.moc" diff --git a/qt/examples/pong.h b/qt/examples/pong.h deleted file mode 100644 index de89598f..00000000 --- a/qt/examples/pong.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef PONG_H -#define PONG_H - -#include - -class Pong: public QObject -{ - Q_OBJECT -public slots: - Q_SCRIPTABLE QString ping(const QString &arg); -}; - -#endif diff --git a/qt/qt-dbus.qdocconf b/qt/qt-dbus.qdocconf deleted file mode 100644 index db9fcd6e..00000000 --- a/qt/qt-dbus.qdocconf +++ /dev/null @@ -1,132 +0,0 @@ -project = QtDBus -description = QtDBus Reference Documentation -url = http://developer.kde.org/~thiago/QtDBus -indexes = $QTDIR/doc/html/qt.index - -outputdir = ../doc/api/html - -language = Cpp -headerdirs = . -sourcedirs = . doc -imagedirs = doc -extraimages.HTML = qt-logo \ - trolltech-logo -sources.fileextensions = "*.cpp *.qdoc" -defines = Q_QDOC \ - QT_.*_SUPPORT \ - QT_.*_LIB \ - QT_COMPAT \ - QT3_SUPPORT \ - Q_WS_.* \ - Q_OS_.* \ - Q_BYTE_ORDER \ - __cplusplus - -macro.key = "\\bold" -macro.menu = "\\bold" -macro.gui = "\\bold" -macro.reg.HTML = "®" -macro.raisedaster.HTML = "*" -macro.BR.HTML = "
" -macro.QD = "\\e{Qt Designer}" -macro.QA = "\\e{Qt Assistant}" -macro.aring.HTML = "å" -macro.Auml.HTML = "Ä" -macro.var = "\\variable" - -Cpp.ignoretokens = QAXFACTORY_EXPORT \ - QDESIGNER_COMPONENTS_LIBRARY \ - QDESIGNER_EXTENSION_LIBRARY \ - QDESIGNER_SDK_LIBRARY \ - QDESIGNER_SHARED_LIBRARY \ - QDESIGNER_UILIB_LIBRARY \ - QM_EXPORT_CANVAS \ - QM_EXPORT_DNS \ - QM_EXPORT_DOM \ - QM_EXPORT_FTP \ - QM_EXPORT_HTTP \ - QM_EXPORT_ICONVIEW \ - QM_EXPORT_NETWORK \ - QM_EXPORT_OPENGL \ - QM_EXPORT_SQL \ - QM_EXPORT_TABLE \ - QM_EXPORT_WORKSPACE \ - QM_EXPORT_XML \ - QT_DESIGNER_STATIC \ - QT_WIDGET_PLUGIN_EXPORT \ - Q_COMPAT_EXPORT \ - Q_CORE_EXPORT \ - Q_EXPLICIT \ - Q_EXPORT \ - Q_EXPORT_CODECS_CN \ - Q_EXPORT_CODECS_JP \ - Q_EXPORT_CODECS_KR \ - Q_EXPORT_PLUGIN \ - Q_GFX_INLINE \ - Q_GUI_EXPORT \ - Q_GUI_EXPORT_STYLE_CDE \ - Q_GUI_EXPORT_STYLE_COMPACT \ - Q_GUI_EXPORT_STYLE_MAC \ - Q_GUI_EXPORT_STYLE_MOTIF \ - Q_GUI_EXPORT_STYLE_MOTIFPLUS \ - Q_GUI_EXPORT_STYLE_PLATINUM \ - Q_GUI_EXPORT_STYLE_POCKETPC \ - Q_GUI_EXPORT_STYLE_SGI \ - Q_GUI_EXPORT_STYLE_WINDOWS \ - Q_GUI_EXPORT_STYLE_WINDOWSXP \ - Q_INLINE_TEMPLATE \ - Q_NETWORK_EXPORT \ - Q_OPENGL_EXPORT \ - Q_OUTOFLINE_TEMPLATE \ - Q_SQL_EXPORT \ - Q_SVG_EXPORT \ - Q_TESTLIB_EXPORT \ - Q_TYPENAME \ - Q_XML_EXPORT \ - QDBUS_EXPORT \ - Q_ASYNC -Cpp.ignoredirectives = Q_DECLARE_HANDLE \ - Q_DECLARE_INTERFACE \ - Q_DECLARE_METATYPE \ - Q_DECLARE_OPERATORS_FOR_FLAGS \ - Q_DECLARE_PRIVATE \ - Q_DECLARE_PUBLIC \ - Q_DECLARE_SHARED \ - Q_DECLARE_TR_FUNCTIONS \ - Q_DECLARE_TYPEINFO \ - Q_DISABLE_COPY \ - Q_DUMMY_COMPARISON_OPERATOR \ - Q_ENUMS \ - Q_FLAGS \ - Q_INTERFACES \ - __attribute__ -HTML.style = "h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }\n" \ - "a:link { color: #004faf; text-decoration: none }\n" \ - "a:visited { color: #672967; text-decoration: none }\n" \ - "td.postheader { font-family: sans-serif }\n" \ - "tr.address { font-family: sans-serif }\n" \ - "body { background: #ffffff; color: black; }\n" \ - "pre { background: #dddddd; }" - -HTML.postheader = "\n" \ - "\n" \ - "\n" \ - "" \ - "\n" \ - "
" \ - "" \ - "  " \ - "" \ - "Home ·" \ - " " \ - "Classes ·" \ - " " \ - "Namespaces" \ - "
" - -HTML.footer = "


\n" \ - "\n" \ - "\n" \ - "\n" \ - "\n" \ - "
Copyright © 2006 Trolltech 
QtDBus \\version
" diff --git a/qt/qt.tag b/qt/qt.tag deleted file mode 100644 index 494fb380..00000000 --- a/qt/qt.tag +++ /dev/null @@ -1,66720 +0,0 @@ - - - Q3Accel - q3accel.html - - Q3Accel - Q3Accel - ( QWidget * parent, const char * name = 0 ) - - - Q3Accel - Q3Accel-2 - ( QWidget * watch, QObject * parent, const char * name = 0 ) - - - activated - activated - ( int id ) - - - activatedAmbiguously - activatedAmbiguously - ( int id ) - - - clear - clear - () - - - connectItem - connectItem - ( int id, const QObject * receiver, const char * member ) - - - count - count - () - - - disconnectItem - disconnectItem - ( int id, const QObject * receiver, const char * member ) - - - findKey - findKey - ( const QKeySequence & key ) - - - insertItem - insertItem - ( const QKeySequence & key, int id = -1 ) - - - isEnabled - isEnabled - () - - - isItemEnabled - isItemEnabled - ( int id ) - - - key - key - ( int id ) - - - removeItem - removeItem - ( int id ) - - - setEnabled - setEnabled - ( bool enable ) - - - setItemEnabled - setItemEnabled - ( int id, bool enable ) - - - setWhatsThis - setWhatsThis - ( int id, const QString & text ) - - - shortcutKey - shortcutKey - ( const QString & str ) - - - whatsThis - whatsThis - ( int id ) - - - keyToString - keyToString - ( QKeySequence k ) - - - stringToKey - stringToKey - ( const QString & s ) - - - - Q3ActionGroup - q3actiongroup.html - - Q3ActionGroup - Q3ActionGroup - ( QObject * parent, const char * name = 0 ) - - - Q3ActionGroup - Q3ActionGroup-2 - ( QObject * parent, const char * name, bool exclusive ) - - - activated - activated - ( Q3Action * action ) - - - add - add - ( Q3Action * action ) - - - addSeparator - addSeparator - () - - - addTo - addTo - ( QWidget * w ) - - - addedTo - addedTo - ( QWidget * actionWidget, QWidget * container, Q3Action * a ) - - - addedTo - addedTo-2 - ( int index, Q3PopupMenu * menu, Q3Action * a ) - - - insert - insert - ( Q3Action * action ) - - - selected - selected - ( Q3Action * action ) - - - - Q3Action - q3action.html - - Q3Action - Q3Action - ( QObject * parent, const char * name = 0 ) - - - Q3Action - Q3Action-2 - ( const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0 ) - - - Q3Action - Q3Action-3 - ( const QIcon & icon, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0 ) - - - Q3Action - Q3Action-4 - ( const QString & text, const QIcon & icon, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0, bool toggle = false ) - - - Q3Action - Q3Action-5 - ( const QString & text, const QString & menuText, QKeySequence accel, QObject * parent, const char * name = 0, bool toggle = false ) - - - Q3Action - Q3Action-6 - ( QObject * parent, const char * name, bool toggle ) - - - activate - activate - () - - - activated - activated - () - - - addTo - addTo - ( QWidget * w ) - - - addedTo - addedTo - ( QWidget * actionWidget, QWidget * container ) - - - addedTo - addedTo-2 - ( int index, Q3PopupMenu * menu ) - - - removeFrom - removeFrom - ( QWidget * w ) - - - setDisabled - setDisabled - ( bool disable ) - - - toggle - toggle - () - - - toggled - toggled - ( bool on ) - - - - Q3AsciiCache - q3asciicache.html - - Q3AsciiCache - Q3AsciiCache-2 - ( int maxCost = 100, int size = 17, bool caseSensitive = true, bool copyKeys = true ) - - - clear - clear - () - - - count - count - () - - - find - find - ( const char * k, bool ref = true ) - - - insert - insert - ( const char * k, const type * d, int c = 1, int p = 0 ) - - - isEmpty - isEmpty - () - - - maxCost - maxCost - () - - - remove - remove - ( const char * k ) - - - setMaxCost - setMaxCost - ( int m ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( const char * k ) - - - totalCost - totalCost - () - - - operator[] - operator-5b-5d - ( const char * k ) - - - - Q3AsciiCacheIterator - q3asciicacheiterator.html - - Q3AsciiCacheIterator - Q3AsciiCacheIterator - ( const Q3AsciiCache<type> & cache ) - - - Q3AsciiCacheIterator - Q3AsciiCacheIterator-2 - ( const Q3AsciiCacheIterator<type> & ci ) - - - atFirst - atFirst - () - - - atLast - atLast - () - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - toLast - toLast - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - operator-- - operator-- - () - - - operator-= - operator--eq - ( uint jump ) - - - operator= - operator-eq - ( const Q3AsciiCacheIterator<type> & ci ) - - - - Q3AsciiDict - q3asciidict.html - - Q3AsciiDict - Q3AsciiDict - ( int size = 17, bool caseSensitive = true, bool copyKeys = true ) - - - Q3AsciiDict - Q3AsciiDict-2 - ( const Q3AsciiDict<type> & dict ) - - - clear - clear - () - - - count - count - () - - - find - find - ( const char * key ) - - - insert - insert - ( const char * key, const type * item ) - - - isEmpty - isEmpty - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - ( const char * key ) - - - replace - replace - ( const char * key, const type * item ) - - - resize - resize - ( uint newsize ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( const char * key ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator= - operator-eq - ( const Q3AsciiDict<type> & dict ) - - - operator[] - operator-5b-5d - ( const char * key ) - - - - Q3AsciiDictIterator - q3asciidictiterator.html - - Q3AsciiDictIterator - Q3AsciiDictIterator - ( const Q3AsciiDict<type> & dict ) - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - - Q3ButtonGroup - q3buttongroup.html - - Q3ButtonGroup - Q3ButtonGroup - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3ButtonGroup - Q3ButtonGroup-2 - ( const QString & title, QWidget * parent = 0, const char * name = 0 ) - - - Q3ButtonGroup - Q3ButtonGroup-3 - ( int strips, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 ) - - - Q3ButtonGroup - Q3ButtonGroup-4 - ( int strips, Qt::Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 ) - - - clicked - clicked - ( int id ) - - - count - count - () - - - find - find - ( int id ) - - - id - id - ( QAbstractButton * button ) - - - insert - insert - ( QAbstractButton * button, int id = -1 ) - - - pressed - pressed - ( int id ) - - - released - released - ( int id ) - - - remove - remove - ( QAbstractButton * button ) - - - selected - selected - () - - - - Q3Button - q3button.html - - Q3Button - Q3Button - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - drawButton - drawButton - ( QPainter * painter ) - - - drawButtonLabel - drawButtonLabel - ( QPainter * painter ) - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - - Q3Cache - q3cache.html - - Q3Cache - Q3Cache-2 - ( int maxCost = 100, int size = 17, bool caseSensitive = true ) - - - clear - clear - () - - - count - count - () - - - find - find - ( const QString & k, bool ref = true ) - - - insert - insert - ( const QString & k, const type * d, int c = 1, int p = 0 ) - - - isEmpty - isEmpty - () - - - maxCost - maxCost - () - - - remove - remove - ( const QString & k ) - - - setMaxCost - setMaxCost - ( int m ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( const QString & k ) - - - totalCost - totalCost - () - - - operator[] - operator-5b-5d - ( const QString & k ) - - - - Q3CacheIterator - q3cacheiterator.html - - Q3CacheIterator - Q3CacheIterator - ( const Q3Cache<type> & cache ) - - - Q3CacheIterator - Q3CacheIterator-2 - ( const Q3CacheIterator<type> & ci ) - - - atFirst - atFirst - () - - - atLast - atLast - () - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - toLast - toLast - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - operator-- - operator-- - () - - - operator-= - operator--eq - ( uint jump ) - - - operator= - operator-eq - ( const Q3CacheIterator<type> & ci ) - - - - Q3CanvasEllipse - q3canvasellipse.html - - Q3CanvasEllipse - Q3CanvasEllipse - ( Q3Canvas * canvas ) - - - Q3CanvasEllipse - Q3CanvasEllipse-2 - ( int width, int height, Q3Canvas * canvas ) - - - Q3CanvasEllipse - Q3CanvasEllipse-3 - ( int width, int height, int startangle, int angle, Q3Canvas * canvas ) - - - angleLength - angleLength - () - - - angleStart - angleStart - () - - - drawShape - drawShape - ( QPainter & p ) - - - height - height - () - - - rtti - rtti - () - - - setAngles - setAngles - ( int start, int length ) - - - setSize - setSize - ( int width, int height ) - - - width - width - () - - - - Q3Canvas - q3canvas.html - - Q3Canvas - Q3Canvas - ( QObject * parent = 0, const char * name = 0 ) - - - Q3Canvas - Q3Canvas-2 - ( int w, int h ) - - - Q3Canvas - Q3Canvas-3 - ( QPixmap p, int h, int v, int tilewidth, int tileheight ) - - - advance - advance - () - - - allItems - allItems - () - - - backgroundColor - backgroundColor - () - - - backgroundPixmap - backgroundPixmap - () - - - chunkSize - chunkSize - () - - - collisions - collisions - ( const QPoint & p ) - - - collisions - collisions-2 - ( const QRect & r ) - - - collisions - collisions-3 - ( const Q3PointArray & chunklist, const Q3CanvasItem * item, bool exact ) - - - drawArea - drawArea - ( const QRect & clip, QPainter * painter, bool dbuf = false ) - - - drawBackground - drawBackground - ( QPainter & painter, const QRect & clip ) - - - drawForeground - drawForeground - ( QPainter & painter, const QRect & clip ) - - - height - height - () - - - onCanvas - onCanvas - ( int x, int y ) - - - onCanvas - onCanvas-2 - ( const QPoint & p ) - - - rect - rect - () - - - resize - resize - ( int w, int h ) - - - resized - resized - () - - - retune - retune - ( int chunksze, int mxclusters = 100 ) - - - setAdvancePeriod - setAdvancePeriod - ( int ms ) - - - setAllChanged - setAllChanged - () - - - setBackgroundColor - setBackgroundColor - ( const QColor & c ) - - - setBackgroundPixmap - setBackgroundPixmap - ( const QPixmap & p ) - - - setChanged - setChanged - ( const QRect & area ) - - - setDoubleBuffering - setDoubleBuffering - ( bool y ) - - - setTile - setTile - ( int x, int y, int tilenum ) - - - setTiles - setTiles - ( QPixmap p, int h, int v, int tilewidth, int tileheight ) - - - setUnchanged - setUnchanged - ( const QRect & area ) - - - setUpdatePeriod - setUpdatePeriod - ( int ms ) - - - size - size - () - - - tile - tile - ( int x, int y ) - - - tileHeight - tileHeight - () - - - tileWidth - tileWidth - () - - - tilesHorizontally - tilesHorizontally - () - - - tilesVertically - tilesVertically - () - - - update - update - () - - - validChunk - validChunk - ( int x, int y ) - - - validChunk - validChunk-2 - ( const QPoint & p ) - - - width - width - () - - - - Q3CanvasItem - q3canvasitem.html - - RttiValues - RttiValues-enum - - - - Q3CanvasItem - Q3CanvasItem - ( Q3Canvas * canvas ) - - - advance - advance - ( int phase ) - - - animated - animated - () - - - boundingRect - boundingRect - () - - - boundingRectAdvanced - boundingRectAdvanced - () - - - canvas - canvas - () - - - collidesWith - collidesWith - ( const Q3CanvasItem * other ) - - - collisions - collisions - ( bool exact ) - - - draw - draw - ( QPainter & painter ) - - - hide - hide - () - - - isActive - isActive - () - - - isEnabled - isEnabled - () - - - isSelected - isSelected - () - - - isVisible - isVisible - () - - - move - move - ( double x, double y ) - - - moveBy - moveBy - ( double dx, double dy ) - - - rtti - rtti - () - - - setActive - setActive - ( bool yes ) - - - setAnimated - setAnimated - ( bool y ) - - - setCanvas - setCanvas - ( Q3Canvas * c ) - - - setEnabled - setEnabled - ( bool yes ) - - - setSelected - setSelected - ( bool yes ) - - - setVelocity - setVelocity - ( double vx, double vy ) - - - setVisible - setVisible - ( bool yes ) - - - setX - setX - ( double x ) - - - setXVelocity - setXVelocity - ( double vx ) - - - setY - setY - ( double y ) - - - setYVelocity - setYVelocity - ( double vy ) - - - setZ - setZ - ( double z ) - - - show - show - () - - - update - update - () - - - x - x - () - - - xVelocity - xVelocity - () - - - y - y - () - - - yVelocity - yVelocity - () - - - z - z - () - - - - Q3CanvasItemList - q3canvasitemlist.html - - operator+ - operator-2b - ( const Q3CanvasItemList & l ) - - - active - active - () - - - enabled - enabled - () - - - selected - selected - () - - - visible - visible - () - - - - Q3CanvasLine - q3canvasline.html - - Q3CanvasLine - Q3CanvasLine - ( Q3Canvas * canvas ) - - - endPoint - endPoint - () - - - rtti - rtti - () - - - setPoints - setPoints - ( int xa, int ya, int xb, int yb ) - - - startPoint - startPoint - () - - - - Q3CanvasPixmapArray - q3canvaspixmaparray.html - - Q3CanvasPixmapArray - Q3CanvasPixmapArray - () - - - Q3CanvasPixmapArray - Q3CanvasPixmapArray-2 - ( const QString & datafilenamepattern, int fc = 0 ) - - - Q3CanvasPixmapArray - Q3CanvasPixmapArray-4 - ( Q3ValueList<QPixmap> list, Q3PointArray hotspots = Q3PointArray() - - - count - count - () - - - image - image - ( int i ) - - - isValid - isValid - () - - - readCollisionMasks - readCollisionMasks - ( const QString & filename ) - - - readPixmaps - readPixmaps - ( const QString & filenamepattern, int fc = 0 ) - - - setImage - setImage - ( int i, Q3CanvasPixmap * p ) - - - Q3CanvasPixmapArray - Q3CanvasPixmapArray-3 - ( Q3PtrList<QPixmap> list, Q3PtrList<QPoint> hotspots ) - - - operator! - operator-not - () - - - - Q3CanvasPixmap - q3canvaspixmap.html - - Q3CanvasPixmap - Q3CanvasPixmap - ( const QString & datafilename ) - - - Q3CanvasPixmap - Q3CanvasPixmap-2 - ( const QImage & image ) - - - Q3CanvasPixmap - Q3CanvasPixmap-3 - ( const QPixmap & pm, const QPoint & offset ) - - - offsetX - offsetX - () - - - offsetY - offsetY - () - - - setOffset - setOffset - ( int x, int y ) - - - - Q3CanvasPolygonalItem - q3canvaspolygonalitem.html - - Q3CanvasPolygonalItem - Q3CanvasPolygonalItem - ( Q3Canvas * canvas ) - - - areaPoints - areaPoints - () - - - areaPointsAdvanced - areaPointsAdvanced - () - - - boundingRect - boundingRect - () - - - brush - brush - () - - - draw - draw - ( QPainter & p ) - - - drawShape - drawShape - ( QPainter & p ) - - - invalidate - invalidate - () - - - isValid - isValid - () - - - pen - pen - () - - - rtti - rtti - () - - - setBrush - setBrush - ( QBrush b ) - - - setPen - setPen - ( QPen p ) - - - setWinding - setWinding - ( bool enable ) - - - winding - winding - () - - - - Q3CanvasPolygon - q3canvaspolygon.html - - Q3CanvasPolygon - Q3CanvasPolygon - ( Q3Canvas * canvas ) - - - areaPoints - areaPoints - () - - - drawShape - drawShape - ( QPainter & p ) - - - points - points - () - - - rtti - rtti - () - - - setPoints - setPoints - ( Q3PointArray pa ) - - - - Q3CanvasRectangle - q3canvasrectangle.html - - Q3CanvasRectangle - Q3CanvasRectangle - ( Q3Canvas * canvas ) - - - Q3CanvasRectangle - Q3CanvasRectangle-2 - ( const QRect & r, Q3Canvas * canvas ) - - - Q3CanvasRectangle - Q3CanvasRectangle-3 - ( int x, int y, int width, int height, Q3Canvas * canvas ) - - - chunks - chunks - () - - - drawShape - drawShape - ( QPainter & p ) - - - height - height - () - - - rect - rect - () - - - rtti - rtti - () - - - setSize - setSize - ( int width, int height ) - - - size - size - () - - - width - width - () - - - - Q3CanvasSpline - q3canvasspline.html - - Q3CanvasSpline - Q3CanvasSpline - ( Q3Canvas * canvas ) - - - closed - closed - () - - - controlPoints - controlPoints - () - - - rtti - rtti - () - - - setControlPoints - setControlPoints - ( Q3PointArray ctrl, bool close = true ) - - - - Q3CanvasSprite - q3canvassprite.html - - FrameAnimationType - FrameAnimationType-enum - - - - Q3CanvasSprite - Q3CanvasSprite - ( Q3CanvasPixmapArray * a, Q3Canvas * canvas ) - - - advance - advance - ( int phase ) - - - bottomEdge - bottomEdge - () - - - bottomEdge - bottomEdge-2 - ( int ny ) - - - boundingRect - boundingRect - () - - - draw - draw - ( QPainter & painter ) - - - frame - frame - () - - - frameCount - frameCount - () - - - height - height - () - - - image - image - () - - - image - image-2 - ( int f ) - - - imageAdvanced - imageAdvanced - () - - - leftEdge - leftEdge - () - - - leftEdge - leftEdge-2 - ( int nx ) - - - move - move - ( double x, double y ) - - - move - move-2 - ( double nx, double ny, int nf ) - - - rightEdge - rightEdge - () - - - rightEdge - rightEdge-2 - ( int nx ) - - - rtti - rtti - () - - - setFrame - setFrame - ( int f ) - - - setFrameAnimation - setFrameAnimation - ( FrameAnimationType type = Cycle, int step = 1, int state = 0 ) - - - setSequence - setSequence - ( Q3CanvasPixmapArray * a ) - - - topEdge - topEdge - () - - - topEdge - topEdge-2 - ( int ny ) - - - width - width - () - - - - Q3CanvasText - q3canvastext.html - - Q3CanvasText - Q3CanvasText - ( Q3Canvas * canvas ) - - - Q3CanvasText - Q3CanvasText-2 - ( const QString & t, Q3Canvas * canvas ) - - - Q3CanvasText - Q3CanvasText-3 - ( const QString & t, QFont f, Q3Canvas * canvas ) - - - boundingRect - boundingRect - () - - - color - color - () - - - draw - draw - ( QPainter & painter ) - - - font - font - () - - - rtti - rtti - () - - - setColor - setColor - ( const QColor & c ) - - - setFont - setFont - ( const QFont & f ) - - - setText - setText - ( const QString & t ) - - - setTextFlags - setTextFlags - ( int f ) - - - text - text - () - - - textFlags - textFlags - () - - - - Q3CanvasView - q3canvasview.html - - Q3CanvasView - Q3CanvasView - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - Q3CanvasView - Q3CanvasView-2 - ( Q3Canvas * canvas, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - canvas - canvas - () - - - drawContents - drawContents - ( QPainter * p, int cx, int cy, int cw, int ch ) - - - inverseWorldMatrix - inverseWorldMatrix - () - - - setCanvas - setCanvas - ( Q3Canvas * canvas ) - - - setWorldMatrix - setWorldMatrix - ( const QMatrix & wm ) - - - sizeHint - sizeHint - () - - - worldMatrix - worldMatrix - () - - - - Q3CheckListItem - q3checklistitem.html - - ToggleState - ToggleState-enum - - - - Type - Type-enum - - - - Q3CheckListItem - Q3CheckListItem - ( Q3CheckListItem * parent, const QString & text, Type tt = RadioButtonController ) - - - Q3CheckListItem - Q3CheckListItem-2 - ( Q3CheckListItem * parent, Q3ListViewItem * after, const QString & text, Type tt = RadioButtonController ) - - - Q3CheckListItem - Q3CheckListItem-3 - ( Q3ListViewItem * parent, const QString & text, Type tt = RadioButtonController ) - - - Q3CheckListItem - Q3CheckListItem-4 - ( Q3ListViewItem * parent, Q3ListViewItem * after, const QString & text, Type tt = RadioButtonController ) - - - Q3CheckListItem - Q3CheckListItem-5 - ( Q3ListView * parent, const QString & text, Type tt = RadioButtonController ) - - - Q3CheckListItem - Q3CheckListItem-6 - ( Q3ListView * parent, Q3ListViewItem * after, const QString & text, Type tt = RadioButtonController ) - - - Q3CheckListItem - Q3CheckListItem-7 - ( Q3ListViewItem * parent, const QString & text, const QPixmap & p ) - - - Q3CheckListItem - Q3CheckListItem-8 - ( Q3ListView * parent, const QString & text, const QPixmap & p ) - - - activate - activate - () - - - isOn - isOn - () - - - isTristate - isTristate - () - - - paintCell - paintCell - ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) - - - paintFocus - paintFocus - ( QPainter * p, const QColorGroup & cg, const QRect & r ) - - - rtti - rtti - () - - - setOn - setOn - ( bool b ) - - - setState - setState - ( ToggleState s ) - - - setTristate - setTristate - ( bool b ) - - - state - state - () - - - stateChange - stateChange - ( bool b ) - - - text - text - () - - - turnOffChild - turnOffChild - () - - - type - type - () - - - - Q3CheckTableItem - q3checktableitem.html - - Q3CheckTableItem - Q3CheckTableItem - ( Q3Table * table, const QString & txt ) - - - isChecked - isChecked - () - - - rtti - rtti - () - - - setChecked - setChecked - ( bool b ) - - - - Q3ColorDrag - q3colordrag.html - - Q3ColorDrag - Q3ColorDrag - ( const QColor & col, QWidget * dragsource = 0, const char * name = 0 ) - - - Q3ColorDrag - Q3ColorDrag-2 - ( QWidget * dragsource = 0, const char * name = 0 ) - - - canDecode - canDecode - ( QMimeSource * source ) - - - decode - decode - ( QMimeSource * source, QColor & color ) - - - setColor - setColor - ( const QColor & color ) - - - - Q3ComboBox - q3combobox.html - - Policy - Policy-enum - - - - Q3ComboBox - Q3ComboBox - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3ComboBox - Q3ComboBox-2 - ( bool rw, QWidget * parent = 0, const char * name = 0 ) - - - activated - activated - ( int index ) - - - activated - activated-2 - ( const QString & string ) - - - autoResize - autoResize - () - - - changeItem - changeItem - ( const QString & t, int index ) - - - changeItem - changeItem-2 - ( const QPixmap & im, int index ) - - - changeItem - changeItem-3 - ( const QPixmap & im, const QString & t, int index ) - - - clear - clear - () - - - clearEdit - clearEdit - () - - - clearValidator - clearValidator - () - - - hide - hide - () - - - highlighted - highlighted - ( int index ) - - - highlighted - highlighted-2 - ( const QString & string ) - - - insertItem - insertItem - ( const QString & t, int index = -1 ) - - - insertItem - insertItem-2 - ( const QPixmap & pixmap, int index = -1 ) - - - insertItem - insertItem-3 - ( const QPixmap & pixmap, const QString & text, int index = -1 ) - - - insertStrList - insertStrList - ( const char ** strings, int numStrings = -1, int index = -1 ) - - - insertStrList - insertStrList-2 - ( const Q3StrList & list, int index = -1 ) - - - insertStrList - insertStrList-3 - ( const Q3StrList * list, int index = -1 ) - - - insertStringList - insertStringList - ( const QStringList & list, int index = -1 ) - - - lineEdit - lineEdit - () - - - listBox - listBox - () - - - pixmap - pixmap - ( int index ) - - - popup - popup - () - - - removeItem - removeItem - ( int index ) - - - setAutoResize - setAutoResize - ( bool ) - - - setEditText - setEditText - ( const QString & newText ) - - - setEnabled - setEnabled - ( bool enable ) - - - setFont - setFont - ( const QFont & font ) - - - setLineEdit - setLineEdit - ( QLineEdit * edit ) - - - setListBox - setListBox - ( Q3ListBox * newListBox ) - - - setPalette - setPalette - ( const QPalette & palette ) - - - setValidator - setValidator - ( const QValidator * v ) - - - text - text - ( int index ) - - - textChanged - textChanged - ( const QString & string ) - - - updateMask - updateMask - () - - - validator - validator - () - - - - Q3ComboTableItem - q3combotableitem.html - - Q3ComboTableItem - Q3ComboTableItem - ( Q3Table * table, const QStringList & list, bool editable = false ) - - - count - count - () - - - currentItem - currentItem - () - - - currentText - currentText - () - - - isEditable - isEditable - () - - - rtti - rtti - () - - - setCurrentItem - setCurrentItem - ( int i ) - - - setCurrentItem - setCurrentItem-2 - ( const QString & s ) - - - setEditable - setEditable - ( bool b ) - - - setStringList - setStringList - ( const QStringList & l ) - - - text - text - ( int i ) - - - - Q3CString - q3cstring.html - - Q3CString - Q3CString - () - - - Q3CString - Q3CString-2 - ( int size ) - - - Q3CString - Q3CString-3 - ( const Q3CString & s ) - - - Q3CString - Q3CString-4 - ( const QByteArray & ba ) - - - Q3CString - Q3CString-5 - ( const char * str ) - - - Q3CString - Q3CString-6 - ( const char * str, uint maxsize ) - - - append - append - ( const char * str ) - - - copy - copy - () - - - leftJustify - leftJustify - ( uint width, char fill = ' ', bool truncate = false ) - - - lower - lower - () - - - rightJustify - rightJustify - ( uint width, char fill = ' ', bool truncate = false ) - - - setExpand - setExpand - ( uint index, char c ) - - - setNum - setNum - ( double n, char f = 'g', int prec = 6 ) - - - setNum - setNum-2 - ( long n ) - - - setNum - setNum-3 - ( ulong n ) - - - setNum - setNum-4 - ( int n ) - - - setNum - setNum-5 - ( uint n ) - - - setNum - setNum-6 - ( short n ) - - - setNum - setNum-7 - ( ushort n ) - - - setNum - setNum-8 - ( float n, char f = 'g', int prec = 6 ) - - - setStr - setStr - ( const char * str ) - - - simplifyWhiteSpace - simplifyWhiteSpace - () - - - sprintf - sprintf - ( const char * format, ... ) - - - stripWhiteSpace - stripWhiteSpace - () - - - toDouble - toDouble - ( bool * ok = 0 ) - - - toFloat - toFloat - ( bool * ok = 0 ) - - - toInt - toInt - ( bool * ok = 0 ) - - - toLong - toLong - ( bool * ok = 0 ) - - - toShort - toShort - ( bool * ok = 0 ) - - - toUInt - toUInt - ( bool * ok = 0 ) - - - toULong - toULong - ( bool * ok = 0 ) - - - toUShort - toUShort - ( bool * ok = 0 ) - - - upper - upper - () - - - operator= - operator-eq - ( const Q3CString & s ) - - - operator= - operator-eq-2 - ( const QByteArray & ba ) - - - operator= - operator-eq-3 - ( const char * str ) - - - - Q3DataBrowser - q3databrowser.html - - Boundary - Boundary-enum - - - - Q3DataBrowser - Q3DataBrowser - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags fl = 0 ) - - - beforeDelete - beforeDelete - ( QSqlRecord * buf ) - - - beforeInsert - beforeInsert - ( QSqlRecord * buf ) - - - beforeUpdate - beforeUpdate - ( QSqlRecord * buf ) - - - boundary - boundary - () - - - clearValues - clearValues - () - - - Confirm - confirmCancel - Q3DataBrowser::confirmCancel( QSql::Op m ) - - - Confirm - confirmEdit - Q3DataBrowser::confirmEdit( QSql::Op m ) - - - currentChanged - currentChanged - ( const QSqlRecord * record ) - - - currentEdited - currentEdited - () - - - cursorChanged - cursorChanged - ( Q3SqlCursor::Mode mode ) - - - del - del - () - - - deleteCurrent - deleteCurrent - () - - - first - first - () - - - firstRecordAvailable - firstRecordAvailable - ( bool available ) - - - form - form - () - - - handleError - handleError - ( const QSqlError & error ) - - - insert - insert - () - - - insertCurrent - insertCurrent - () - - - last - last - () - - - lastRecordAvailable - lastRecordAvailable - ( bool available ) - - - next - next - () - - - nextRecordAvailable - nextRecordAvailable - ( bool available ) - - - prev - prev - () - - - prevRecordAvailable - prevRecordAvailable - ( bool available ) - - - primeDelete - primeDelete - ( QSqlRecord * buf ) - - - primeInsert - primeInsert - ( QSqlRecord * buf ) - - - primeUpdate - primeUpdate - ( QSqlRecord * buf ) - - - readFields - readFields - () - - - refresh - refresh - () - - - seek - seek - ( int i, bool relative = false ) - - - setForm - setForm - ( Q3SqlForm * form ) - - - setSqlCursor - setSqlCursor - ( Q3SqlCursor * cursor, bool autoDelete = false ) - - - sqlCursor - sqlCursor - () - - - update - update - () - - - updateBoundary - updateBoundary - () - - - updateCurrent - updateCurrent - () - - - writeFields - writeFields - () - - - - Q3DataTable - q3datatable.html - - Refresh - Refresh-enum - - - - DateFormat - dateFormat-prop - - - - Q3DataTable - Q3DataTable - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3DataTable - Q3DataTable-2 - ( Q3SqlCursor * cursor, bool autoPopulate = false, QWidget * parent = 0, const char * name = 0 ) - - - addColumn - addColumn - ( const QString & fieldName, const QString & label = QString() - - - adjustColumn - adjustColumn - ( int col ) - - - autoDelete - autoDelete - () - - - beforeDelete - beforeDelete - ( QSqlRecord * buf ) - - - beforeInsert - beforeInsert - ( QSqlRecord * buf ) - - - beforeUpdate - beforeUpdate - ( QSqlRecord * buf ) - - - beginInsert - beginInsert - () - - - beginUpdate - beginUpdate - ( int row, int col, bool replace ) - - - Confirm - confirmCancel - Q3DataTable::confirmCancel( QSql::Op m ) - - - Confirm - confirmEdit - Q3DataTable::confirmEdit( QSql::Op m ) - - - currentChanged - currentChanged - ( QSqlRecord * record ) - - - currentRecord - currentRecord - () - - - cursorChanged - cursorChanged - ( QSql::Op mode ) - - - deleteCurrent - deleteCurrent - () - - - fieldAlignment - fieldAlignment - ( const QSqlField * field ) - - - find - find - ( const QString & str, bool caseSensitive, bool backwards ) - - - handleError - handleError - ( const QSqlError & e ) - - - indexOf - indexOf - ( uint i ) - - - insertCurrent - insertCurrent - () - - - installEditorFactory - installEditorFactory - ( Q3SqlEditorFactory * f ) - - - installPropertyMap - installPropertyMap - ( Q3SqlPropertyMap * m ) - - - paintField - paintField - ( QPainter * p, const QSqlField * field, const QRect & cr, bool selected ) - - - primeDelete - primeDelete - ( QSqlRecord * buf ) - - - primeInsert - primeInsert - ( QSqlRecord * buf ) - - - primeUpdate - primeUpdate - ( QSqlRecord * buf ) - - - refresh - refresh - ( Refresh mode ) - - - refresh - refresh-2 - () - - - removeColumn - removeColumn - ( int col ) - - - repaintCell - repaintCell - ( int row, int col ) - - - reset - reset - () - - - setAutoDelete - setAutoDelete - ( bool enable ) - - - setColumn - setColumn - ( uint col, const QString & fieldName, const QString & label = QString() - - - setColumnWidth - setColumnWidth - ( int col, int w ) - - - setSize - setSize - ( Q3SqlCursor * sql ) - - - setSqlCursor - setSqlCursor - ( Q3SqlCursor * cursor = 0, bool autoPopulate = false, bool autoDelete = false ) - - - sortAscending - sortAscending - ( int col ) - - - sortColumn - sortColumn - ( int col, bool ascending = true, bool wholeRows = false ) - - - sortDescending - sortDescending - ( int col ) - - - sqlCursor - sqlCursor - () - - - text - text - ( int row, int col ) - - - updateCurrent - updateCurrent - () - - - value - value - ( int row, int col ) - - - - Q3DataView - q3dataview.html - - Q3DataView - Q3DataView - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags fl = 0 ) - - - clearValues - clearValues - () - - - form - form - () - - - readFields - readFields - () - - - record - record - () - - - refresh - refresh - ( QSqlRecord * buf ) - - - setForm - setForm - ( Q3SqlForm * form ) - - - setRecord - setRecord - ( QSqlRecord * record ) - - - writeFields - writeFields - () - - - - Q3DateEdit - q3dateedit.html - - Order - Order-enum - - - - Q3DateEdit - Q3DateEdit - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3DateEdit - Q3DateEdit-2 - ( const QDate & date, QWidget * parent = 0, const char * name = 0 ) - - - fix - fix - () - - - sectionFormattedText - sectionFormattedText - ( int sec ) - - - separator - separator - () - - - setDay - setDay - ( int day ) - - - setMonth - setMonth - ( int month ) - - - setRange - setRange - ( const QDate & min, const QDate & max ) - - - setSeparator - setSeparator - ( const QString & s ) - - - setYear - setYear - ( int year ) - - - updateButtons - updateButtons - () - - - valueChanged - valueChanged - ( const QDate & date ) - - - - Q3DateTimeEditBase - q3datetimeeditbase.html - - - Q3DateTimeEdit - q3datetimeedit.html - - Q3DateTimeEdit - Q3DateTimeEdit - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3DateTimeEdit - Q3DateTimeEdit-2 - ( const QDateTime & datetime, QWidget * parent = 0, const char * name = 0 ) - - - autoAdvance - autoAdvance - () - - - dateEdit - dateEdit - () - - - setAutoAdvance - setAutoAdvance - ( bool advance ) - - - timeEdit - timeEdit - () - - - valueChanged - valueChanged - ( const QDateTime & datetime ) - - - - Q3DeepCopy - q3deepcopy.html - - Q3DeepCopy - Q3DeepCopy - () - - - Q3DeepCopy - Q3DeepCopy-2 - ( const T & t ) - - - operator - operator-T - T() - - - operator= - operator-eq - ( const T & t ) - - - - Q3Dict - q3dict.html - - Q3Dict - Q3Dict - ( int size = 17, bool caseSensitive = true ) - - - Q3Dict - Q3Dict-2 - ( const Q3Dict<type> & dict ) - - - clear - clear - () - - - count - count - () - - - find - find - ( const QString & key ) - - - insert - insert - ( const QString & key, const type * item ) - - - isEmpty - isEmpty - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - ( const QString & key ) - - - replace - replace - ( const QString & key, const type * item ) - - - resize - resize - ( uint newsize ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( const QString & key ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator= - operator-eq - ( const Q3Dict<type> & dict ) - - - operator[] - operator-5b-5d - ( const QString & key ) - - - - Q3DictIterator - q3dictiterator.html - - Q3DictIterator - Q3DictIterator - ( const Q3Dict<type> & dict ) - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - - Q3Dns - q3dns.html - - RecordType - RecordType-enum - - - - Q3Dns - Q3Dns - () - - - Q3Dns - Q3Dns-2 - ( const QString & label, RecordType rr = A ) - - - Q3Dns - Q3Dns-3 - ( const QHostAddress & address, RecordType rr = Ptr ) - - - addresses - addresses - () - - - canonicalName - canonicalName - () - - - hostNames - hostNames - () - - - isWorking - isWorking - () - - - label - label - () - - - mailServers - mailServers - () - - - qualifiedNames - qualifiedNames - () - - - recordType - recordType - () - - - resultsReady - resultsReady - () - - - servers - servers - () - - - setLabel - setLabel - ( const QString & label ) - - - setLabel - setLabel-2 - ( const QHostAddress & address ) - - - setRecordType - setRecordType - ( RecordType rr = A ) - - - texts - texts - () - - - - Q3DockArea - q3dockarea.html - - HandlePosition - HandlePosition-enum - - - - Orientation - orientation-prop - - - - Q3DockArea - Q3DockArea - ( Qt::Orientation o, HandlePosition h = Normal, QWidget * parent = 0, const char * name = 0 ) - - - dockWindowList - dockWindowList - () - - - hasDockWindow - hasDockWindow - ( Q3DockWindow * w, int * index = 0 ) - - - isDockWindowAccepted - isDockWindowAccepted - ( Q3DockWindow * dw ) - - - lineUp - lineUp - ( bool keepNewLines ) - - - moveDockWindow - moveDockWindow - ( Q3DockWindow * w, int index = -1 ) - - - moveDockWindow - moveDockWindow-2 - ( Q3DockWindow * w, const QPoint & p, const QRect & r, bool swap ) - - - removeDockWindow - removeDockWindow - ( Q3DockWindow * w, bool makeFloating, bool swap, bool fixNewLines = true ) - - - setAcceptDockWindow - setAcceptDockWindow - ( Q3DockWindow * dw, bool accept ) - - - - Q3DockWindow - q3dockwindow.html - - CloseMode - CloseMode-enum - - - - Place - Place-enum - - - - Q3DockWindow - Q3DockWindow - ( Place p = InDock, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - Q3DockWindow - Q3DockWindow-2 - ( QWidget * parent, const char * name = 0, Qt::WFlags f = 0 ) - - - area - area - () - - - boxLayout - boxLayout - () - - - dock - dock - () - - - fixedExtent - fixedExtent - () - - - isCloseEnabled - isCloseEnabled - () - - - isHorizontalStretchable - isHorizontalStretchable - () - - - isVerticalStretchable - isVerticalStretchable - () - - - Orientation - orientation - Q3DockWindow::orientation() - - - orientationChanged - orientationChanged - ( Qt::Orientation o ) - - - placeChanged - placeChanged - ( Q3DockWindow::Place p ) - - - setFixedExtentHeight - setFixedExtentHeight - ( int h ) - - - setFixedExtentWidth - setFixedExtentWidth - ( int w ) - - - setHorizontalStretchable - setHorizontalStretchable - ( bool b ) - - - setOrientation - setOrientation - ( Qt::Orientation o ) - - - setVerticalStretchable - setVerticalStretchable - ( bool b ) - - - setWidget - setWidget - ( QWidget * w ) - - - undock - undock - ( QWidget * widget ) - - - undock - undock-2 - () - - - visibilityChanged - visibilityChanged - ( bool visible ) - - - widget - widget - () - - - windowTitle - windowTitle - () - - - - Q3DragObject - q3dragobject.html - - DragMode - DragMode-enum - - - - Q3DragObject - Q3DragObject - ( QWidget * dragSource = 0, const char * name = 0 ) - - - drag - drag - () - - - drag - drag-2 - ( DragMode mode ) - - - dragCopy - dragCopy - () - - - dragLink - dragLink - () - - - dragMove - dragMove - () - - - pixmap - pixmap - () - - - pixmapHotSpot - pixmapHotSpot - () - - - setPixmap - setPixmap - ( QPixmap pm, const QPoint & hotspot ) - - - setPixmap - setPixmap-2 - ( QPixmap pm ) - - - source - source - () - - - target - target - () - - - - Q3DropSite - q3dropsite.html - - Q3DropSite - Q3DropSite - ( QWidget * self ) - - - - Q3EditorFactory - q3editorfactory.html - - Q3EditorFactory - Q3EditorFactory - ( QObject * parent = 0 ) - - - createEditor - createEditor - ( QWidget * parent, const QVariant & v ) - - - defaultFactory - defaultFactory - () - - - installDefaultFactory - installDefaultFactory - ( Q3EditorFactory * factory ) - - - - Q3FileDialog - q3filedialog.html - - Mode - Mode-enum - - - - PreviewMode - PreviewMode-enum - - - - ViewMode - ViewMode-enum - - - - Q3FileDialog - Q3FileDialog - ( const QString & dirName, const QString & filter = QString() - - - Q3FileDialog - Q3FileDialog-2 - ( QWidget * parent = 0, const char * name = 0, bool modal = false ) - - - addFilter - addFilter - ( const QString & filter ) - - - addLeftWidget - addLeftWidget - ( QWidget * w ) - - - addRightWidget - addRightWidget - ( QWidget * w ) - - - addToolButton - addToolButton - ( QAbstractButton * b, bool separator = false ) - - - addWidgets - addWidgets - ( QLabel * l, QWidget * w, QPushButton * b ) - - - dir - dir - () - - - dirEntered - dirEntered - ( const QString & directory ) - - - fileHighlighted - fileHighlighted - ( const QString & file ) - - - fileSelected - fileSelected - ( const QString & file ) - - - filesSelected - filesSelected - ( const QStringList & files ) - - - filterSelected - filterSelected - ( const QString & filter ) - - - getExistingDirectory - getExistingDirectory - ( const QString & dir = QString() - - - getOpenFileName - getOpenFileName - ( const QString & startWith = QString() - - - getOpenFileNames - getOpenFileNames - ( const QString & filter = QString() - - - getSaveFileName - getSaveFileName - ( const QString & startWith = QString() - - - iconProvider - iconProvider - () - - - rereadDir - rereadDir - () - - - resortDir - resortDir - () - - - selectAll - selectAll - ( bool b ) - - - setContentsPreview - setContentsPreview - ( QWidget * w, Q3FilePreview * preview ) - - - setDir - setDir - ( const QDir & dir ) - - - setDir - setDir-2 - ( const QString & pathstr ) - - - setFilter - setFilter - ( const QString & newFilter ) - - - setFilters - setFilters - ( const QString & filters ) - - - setFilters - setFilters-2 - ( const char ** types ) - - - setFilters - setFilters-3 - ( const QStringList & types ) - - - setIconProvider - setIconProvider - ( Q3FileIconProvider * provider ) - - - setInfoPreview - setInfoPreview - ( QWidget * w, Q3FilePreview * preview ) - - - setSelectedFilter - setSelectedFilter - ( const QString & mask ) - - - setSelectedFilter - setSelectedFilter-2 - ( int n ) - - - setSelection - setSelection - ( const QString & filename ) - - - setUrl - setUrl - ( const Q3UrlOperator & url ) - - - url - url - () - - - - Q3FileIconProvider - q3fileiconprovider.html - - Q3FileIconProvider - Q3FileIconProvider - ( QObject * parent = 0, const char * name = 0 ) - - - pixmap - pixmap - ( const QFileInfo & info ) - - - - Q3FilePreview - q3filepreview.html - - Q3FilePreview - Q3FilePreview - () - - - previewUrl - previewUrl - ( const Q3Url & url ) - - - - Q3Frame - q3frame.html - - Q3Frame - Q3Frame - ( QWidget * parent, const char * name = 0, Qt::WFlags f = 0 ) - - - drawContents - drawContents - ( QPainter * painter ) - - - drawFrame - drawFrame - ( QPainter * p ) - - - frameChanged - frameChanged - () - - - frameWidth - frameWidth - () - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - resizeEvent - resizeEvent - ( QResizeEvent * event ) - - - - Q3Ftp - q3ftp.html - - Command - Command-enum - - - - Error - Error-enum - - - - State - State-enum - - - - Q3Ftp - Q3Ftp - () - - - Q3Ftp - Q3Ftp-2 - ( QObject * parent, const char * name = 0 ) - - - abort - abort - () - - - bytesAvailable - bytesAvailable - () - - - cd - cd - ( const QString & dir ) - - - clearPendingCommands - clearPendingCommands - () - - - close - close - () - - - commandFinished - commandFinished - ( int id, bool error ) - - - commandStarted - commandStarted - ( int id ) - - - connectToHost - connectToHost - ( const QString & host, Q_UINT16 port = 21 ) - - - currentCommand - currentCommand - () - - - currentDevice - currentDevice - () - - - currentId - currentId - () - - - dataTransferProgress - dataTransferProgress - ( int done, int total ) - - - done - done - ( bool error ) - - - error - error - () - - - errorString - errorString - () - - - get - get - ( const QString & file, QIODevice * dev = 0 ) - - - hasPendingCommands - hasPendingCommands - () - - - list - list - ( const QString & dir = QString() - - - listInfo - listInfo - ( const QUrlInfo & i ) - - - login - login - ( const QString & user = QString() - - - mkdir - mkdir - ( const QString & dir ) - - - put - put - ( QIODevice * dev, const QString & file ) - - - put - put-2 - ( const QByteArray & data, const QString & file ) - - - rawCommand - rawCommand - ( const QString & command ) - - - rawCommandReply - rawCommandReply - ( int replyCode, const QString & detail ) - - - readAll - readAll - () - - - readBlock - readBlock - ( char * data, Q_ULONG maxlen ) - - - readyRead - readyRead - () - - - remove - remove - ( const QString & file ) - - - rename - rename - ( const QString & oldname, const QString & newname ) - - - rmdir - rmdir - ( const QString & dir ) - - - state - state - () - - - stateChanged - stateChanged - ( int state ) - - - - Q3Grid - q3grid.html - - Q3Grid - Q3Grid - ( int n, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - Q3Grid - Q3Grid-2 - ( int n, Qt::Orientation orient, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - setSpacing - setSpacing - ( int space ) - - - - Q3GridView - q3gridview.html - - Q3GridView - Q3GridView - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - cellGeometry - cellGeometry - ( int row, int column ) - - - cellRect - cellRect - () - - - columnAt - columnAt - ( int x ) - - - dimensionChange - dimensionChange - ( int oldNumRows, int oldNumCols ) - - - ensureCellVisible - ensureCellVisible - ( int row, int column ) - - - gridSize - gridSize - () - - - paintCell - paintCell - ( QPainter * p, int row, int col ) - - - paintEmptyArea - paintEmptyArea - ( QPainter * p, int cx, int cy, int cw, int ch ) - - - repaintCell - repaintCell - ( int row, int column, bool erase = true ) - - - rowAt - rowAt - ( int y ) - - - updateCell - updateCell - ( int row, int column ) - - - - Q3GroupBox - q3groupbox.html - - Orientation - orientation-prop - - - - Q3GroupBox - Q3GroupBox - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3GroupBox - Q3GroupBox-2 - ( const QString & title, QWidget * parent = 0, const char * name = 0 ) - - - Q3GroupBox - Q3GroupBox-3 - ( int strips, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 ) - - - Q3GroupBox - Q3GroupBox-4 - ( int strips, Qt::Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 ) - - - addSpace - addSpace - ( int size ) - - - insideMargin - insideMargin - () - - - insideSpacing - insideSpacing - () - - - setColumnLayout - setColumnLayout - ( int strips, Qt::Orientation direction ) - - - setInsideMargin - setInsideMargin - ( int m ) - - - setInsideSpacing - setInsideSpacing - ( int s ) - - - - Q3HBox - q3hbox.html - - Q3HBox - Q3HBox - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - Q3HBox - Q3HBox-2 - ( bool horizontal, QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - setSpacing - setSpacing - ( int space ) - - - setStretchFactor - setStretchFactor - ( QWidget * w, int stretch ) - - - - Q3HButtonGroup - q3hbuttongroup.html - - Q3HButtonGroup - Q3HButtonGroup - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3HButtonGroup - Q3HButtonGroup-2 - ( const QString & title, QWidget * parent = 0, const char * name = 0 ) - - - - Q3Header - q3header.html - - Orientation - orientation-prop - - - - Q3Header - Q3Header - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3Header - Q3Header-2 - ( int n, QWidget * parent = 0, const char * name = 0 ) - - - addLabel - addLabel - ( const QString & s, int size = -1 ) - - - addLabel - addLabel-2 - ( const QIcon & icon, const QString & s, int size = -1 ) - - - adjustHeaderSize - adjustHeaderSize - () - - - cellAt - cellAt - ( int pos ) - - - cellPos - cellPos - ( int i ) - - - cellSize - cellSize - ( int i ) - - - clicked - clicked - ( int section ) - - - headerWidth - headerWidth - () - - - iconSet - iconSet - ( int section ) - - - indexChange - indexChange - ( int section, int fromIndex, int toIndex ) - - - isClickEnabled - isClickEnabled - ( int section = -1 ) - - - isResizeEnabled - isResizeEnabled - ( int section = -1 ) - - - label - label - ( int section ) - - - mapToActual - mapToActual - ( int l ) - - - mapToIndex - mapToIndex - ( int section ) - - - mapToLogical - mapToLogical - ( int a ) - - - mapToSection - mapToSection - ( int index ) - - - moveCell - moveCell - ( int fromIdx, int toIdx ) - - - moveSection - moveSection - ( int section, int toIndex ) - - - moved - moved - ( int fromIndex, int toIndex ) - - - paintSection - paintSection - ( QPainter * p, int index, const QRect & fr ) - - - paintSectionLabel - paintSectionLabel - ( QPainter * p, int index, const QRect & fr ) - - - pressed - pressed - ( int section ) - - - released - released - ( int section ) - - - removeLabel - removeLabel - ( int section ) - - - resizeSection - resizeSection - ( int section, int s ) - - - sRect - sRect - ( int index ) - - - sectionAt - sectionAt - ( int pos ) - - - sectionClicked - sectionClicked - ( int index ) - - - sectionHandleDoubleClicked - sectionHandleDoubleClicked - ( int section ) - - - sectionPos - sectionPos - ( int section ) - - - sectionRect - sectionRect - ( int section ) - - - sectionSize - sectionSize - ( int section ) - - - setCellSize - setCellSize - ( int section, int s ) - - - setClickEnabled - setClickEnabled - ( bool enable, int section = -1 ) - - - setLabel - setLabel - ( int section, const QString & s, int size = -1 ) - - - setLabel - setLabel-2 - ( int section, const QIcon & icon, const QString & s, int size = -1 ) - - - setResizeEnabled - setResizeEnabled - ( bool enable, int section = -1 ) - - - setSortIndicator - setSortIndicator - ( int section, Qt::SortOrder order ) - - - setSortIndicator - setSortIndicator-2 - ( int section, bool ascending = true ) - - - sizeChange - sizeChange - ( int section, int oldSize, int newSize ) - - - SortOrder - sortIndicatorOrder - Q3Header::sortIndicatorOrder() - - - sortIndicatorSection - sortIndicatorSection - () - - - - Q3HttpHeader - q3httpheader.html - - Q3HttpHeader - Q3HttpHeader - () - - - Q3HttpHeader - Q3HttpHeader-2 - ( const Q3HttpHeader & header ) - - - Q3HttpHeader - Q3HttpHeader-3 - ( const QString & str ) - - - contentLength - contentLength - () - - - contentType - contentType - () - - - hasContentLength - hasContentLength - () - - - hasContentType - hasContentType - () - - - hasKey - hasKey - ( const QString & key ) - - - isValid - isValid - () - - - keys - keys - () - - - majorVersion - majorVersion - () - - - minorVersion - minorVersion - () - - - removeValue - removeValue - ( const QString & key ) - - - setContentLength - setContentLength - ( int len ) - - - setContentType - setContentType - ( const QString & type ) - - - setValue - setValue - ( const QString & key, const QString & value ) - - - toString - toString - () - - - value - value - ( const QString & key ) - - - operator= - operator-eq - ( const Q3HttpHeader & h ) - - - - Q3Http - q3http.html - - Error - Error-enum - - - - State - State-enum - - - - Q3Http - Q3Http - () - - - Q3Http - Q3Http-2 - ( QObject * parent, const char * name = 0 ) - - - Q3Http - Q3Http-3 - ( const QString & hostname, Q_UINT16 port = 80, QObject * parent = 0, const char * name = 0 ) - - - abort - abort - () - - - bytesAvailable - bytesAvailable - () - - - clearPendingRequests - clearPendingRequests - () - - - closeConnection - closeConnection - () - - - currentDestinationDevice - currentDestinationDevice - () - - - currentId - currentId - () - - - currentRequest - currentRequest - () - - - currentSourceDevice - currentSourceDevice - () - - - dataReadProgress - dataReadProgress - ( int done, int total ) - - - dataSendProgress - dataSendProgress - ( int done, int total ) - - - done - done - ( bool error ) - - - error - error - () - - - errorString - errorString - () - - - get - get - ( const QString & path, QIODevice * to = 0 ) - - - hasPendingRequests - hasPendingRequests - () - - - head - head - ( const QString & path ) - - - post - post - ( const QString & path, QIODevice * data, QIODevice * to = 0 ) - - - post - post-2 - ( const QString & path, const QByteArray & data, QIODevice * to = 0 ) - - - readAll - readAll - () - - - readBlock - readBlock - ( char * data, Q_ULONG maxlen ) - - - readyRead - readyRead - ( const Q3HttpResponseHeader & resp ) - - - request - request - ( const Q3HttpRequestHeader & header, QIODevice * data = 0, QIODevice * to = 0 ) - - - request - request-2 - ( const Q3HttpRequestHeader & header, const QByteArray & data, QIODevice * to = 0 ) - - - requestFinished - requestFinished - ( int id, bool error ) - - - requestStarted - requestStarted - ( int id ) - - - responseHeaderReceived - responseHeaderReceived - ( const Q3HttpResponseHeader & resp ) - - - setHost - setHost - ( const QString & hostname, Q_UINT16 port = 80 ) - - - state - state - () - - - stateChanged - stateChanged - ( int state ) - - - - Q3HttpRequestHeader - q3httprequestheader.html - - Q3HttpRequestHeader - Q3HttpRequestHeader - () - - - Q3HttpRequestHeader - Q3HttpRequestHeader-2 - ( const QString & method, const QString & path, int majorVer = 1, int minorVer = 1 ) - - - Q3HttpRequestHeader - Q3HttpRequestHeader-3 - ( const Q3HttpRequestHeader & header ) - - - Q3HttpRequestHeader - Q3HttpRequestHeader-4 - ( const QString & str ) - - - majorVersion - majorVersion - () - - - method - method - () - - - minorVersion - minorVersion - () - - - path - path - () - - - setRequest - setRequest - ( const QString & method, const QString & path, int majorVer = 1, int minorVer = 1 ) - - - - Q3HttpResponseHeader - q3httpresponseheader.html - - Q3HttpResponseHeader - Q3HttpResponseHeader-3 - () - - - Q3HttpResponseHeader - Q3HttpResponseHeader-4 - ( const Q3HttpResponseHeader & header ) - - - majorVersion - majorVersion - () - - - minorVersion - minorVersion - () - - - reasonPhrase - reasonPhrase - () - - - statusCode - statusCode - () - - - - Q3IconDrag - q3icondrag.html - - Q3IconDrag - Q3IconDrag - ( QWidget * dragSource, const char * name = 0 ) - - - append - append - ( const Q3IconDragItem & i, const QRect & pr, const QRect & tr ) - - - canDecode - canDecode - ( QMimeSource * e ) - - - encodedData - encodedData - ( const char * mime ) - - - - Q3IconDragItem - q3icondragitem.html - - Q3IconDragItem - Q3IconDragItem - () - - - data - data - () - - - setData - setData - ( const QByteArray & d ) - - - - Q3IconView - q3iconview.html - - Arrangement - Arrangement-enum - - - - ComparisonFlags - ComparisonFlags-typedef - - - - ItemTextPos - ItemTextPos-enum - - - - ResizeMode - ResizeMode-enum - - - - SelectionMode - SelectionMode-enum - - - - StringComparisonMode - StringComparisonMode-enum - - - - Q3IconView - Q3IconView - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - adjustItems - adjustItems - () - - - arrangeItemsInGrid - arrangeItemsInGrid - ( const QSize & grid, bool update = true ) - - - arrangeItemsInGrid - arrangeItemsInGrid-2 - ( bool update = true ) - - - clear - clear - () - - - clearSelection - clearSelection - () - - - clicked - clicked - ( Q3IconViewItem * item ) - - - clicked - clicked-2 - ( Q3IconViewItem * item, const QPoint & pos ) - - - contextMenuRequested - contextMenuRequested - ( Q3IconViewItem * item, const QPoint & pos ) - - - currentChanged - currentChanged - ( Q3IconViewItem * item ) - - - currentItem - currentItem - () - - - doAutoScroll - doAutoScroll - () - - - doubleClicked - doubleClicked - ( Q3IconViewItem * item ) - - - dragObject - dragObject - () - - - drawBackground - drawBackground - ( QPainter * p, const QRect & r ) - - - drawRubber - drawRubber - ( QPainter * p ) - - - dropped - dropped - ( QDropEvent * e, const Q3ValueList<Q3IconDragItem> & lst ) - - - emitSelectionChanged - emitSelectionChanged - ( Q3IconViewItem * i = 0 ) - - - ensureItemVisible - ensureItemVisible - ( Q3IconViewItem * item ) - - - findFirstVisibleItem - findFirstVisibleItem - ( const QRect & r ) - - - findItem - findItem - ( const QPoint & pos ) - - - findItem - findItem-3 - ( const QString & text, ComparisonFlags compare = BeginsWith | Qt::CaseSensitive ) - - - findLastVisibleItem - findLastVisibleItem - ( const QRect & r ) - - - firstItem - firstItem - () - - - index - index - ( const Q3IconViewItem * item ) - - - insertInGrid - insertInGrid - ( Q3IconViewItem * item ) - - - insertItem - insertItem - ( Q3IconViewItem * item, Q3IconViewItem * after = 0L ) - - - invertSelection - invertSelection - () - - - isRenaming - isRenaming - () - - - itemRenamed - itemRenamed - ( Q3IconViewItem * item, const QString & name ) - - - itemRenamed - itemRenamed-2 - ( Q3IconViewItem * item ) - - - lastItem - lastItem - () - - - makeRowLayout - makeRowLayout - ( Q3IconViewItem * begin, int & y, bool & changed ) - - - mouseButtonClicked - mouseButtonClicked - ( int button, Q3IconViewItem * item, const QPoint & pos ) - - - mouseButtonPressed - mouseButtonPressed - ( int button, Q3IconViewItem * item, const QPoint & pos ) - - - moved - moved - () - - - onItem - onItem - ( Q3IconViewItem * item ) - - - onViewport - onViewport - () - - - pressed - pressed - ( Q3IconViewItem * item ) - - - pressed - pressed-2 - ( Q3IconViewItem * item, const QPoint & pos ) - - - repaintItem - repaintItem - ( Q3IconViewItem * item ) - - - repaintSelectedItems - repaintSelectedItems - () - - - returnPressed - returnPressed - ( Q3IconViewItem * item ) - - - rightButtonClicked - rightButtonClicked - ( Q3IconViewItem * item, const QPoint & pos ) - - - rightButtonPressed - rightButtonPressed - ( Q3IconViewItem * item, const QPoint & pos ) - - - selectAll - selectAll - ( bool select ) - - - selectionChanged - selectionChanged - () - - - selectionChanged - selectionChanged-2 - ( Q3IconViewItem * item ) - - - setCurrentItem - setCurrentItem - ( Q3IconViewItem * item ) - - - setSelected - setSelected - ( Q3IconViewItem * item, bool s, bool cb = false ) - - - setSorting - setSorting - ( bool sort, bool ascending = true ) - - - slotUpdate - slotUpdate - () - - - sort - sort - ( bool ascending = true ) - - - startDrag - startDrag - () - - - takeItem - takeItem - ( Q3IconViewItem * item ) - - - - Q3IconViewItem - q3iconviewitem.html - - Q3IconViewItem - Q3IconViewItem - ( Q3IconView * parent ) - - - Q3IconViewItem - Q3IconViewItem-2 - ( Q3IconView * parent, Q3IconViewItem * after ) - - - Q3IconViewItem - Q3IconViewItem-3 - ( Q3IconView * parent, const QString & text ) - - - Q3IconViewItem - Q3IconViewItem-4 - ( Q3IconView * parent, Q3IconViewItem * after, const QString & text ) - - - Q3IconViewItem - Q3IconViewItem-5 - ( Q3IconView * parent, const QString & text, const QPixmap & icon ) - - - Q3IconViewItem - Q3IconViewItem-6 - ( Q3IconView * parent, Q3IconViewItem * after, const QString & text, const QPixmap & icon ) - - - Q3IconViewItem - Q3IconViewItem-7 - ( Q3IconView * parent, const QString & text, const QPicture & picture ) - - - Q3IconViewItem - Q3IconViewItem-8 - ( Q3IconView * parent, Q3IconViewItem * after, const QString & text, const QPicture & picture ) - - - acceptDrop - acceptDrop - ( const QMimeSource * mime ) - - - calcRect - calcRect - ( const QString & text_ = QString() - - - compare - compare - ( Q3IconViewItem * i ) - - - contains - contains - ( const QPoint & pnt ) - - - dragEnabled - dragEnabled - () - - - dragEntered - dragEntered - () - - - dragLeft - dragLeft - () - - - dropEnabled - dropEnabled - () - - - dropped - dropped - ( QDropEvent * e, const Q3ValueList<Q3IconDragItem> & lst ) - - - height - height - () - - - iconView - iconView - () - - - index - index - () - - - intersects - intersects - ( const QRect & r ) - - - isSelectable - isSelectable - () - - - isSelected - isSelected - () - - - key - key - () - - - move - move - ( int x, int y ) - - - move - move-2 - ( const QPoint & pnt ) - - - moveBy - moveBy - ( int dx, int dy ) - - - moveBy - moveBy-2 - ( const QPoint & pnt ) - - - nextItem - nextItem - () - - - paintFocus - paintFocus - ( QPainter * p, const QColorGroup & cg ) - - - paintItem - paintItem - ( QPainter * p, const QColorGroup & cg ) - - - picture - picture - () - - - pixmap - pixmap - () - - - pixmapRect - pixmapRect - ( bool relative = true ) - - - pos - pos - () - - - prevItem - prevItem - () - - - rect - rect - () - - - removeRenameBox - removeRenameBox - () - - - rename - rename - () - - - renameEnabled - renameEnabled - () - - - repaint - repaint - () - - - rtti - rtti - () - - - setDragEnabled - setDragEnabled - ( bool allow ) - - - setDropEnabled - setDropEnabled - ( bool allow ) - - - setItemRect - setItemRect - ( const QRect & r ) - - - setKey - setKey - ( const QString & k ) - - - setPicture - setPicture - ( const QPicture & icon ) - - - setPixmap - setPixmap - ( const QPixmap & icon ) - - - setPixmap - setPixmap-2 - ( const QPixmap & icon, bool recalc, bool redraw = true ) - - - setPixmapRect - setPixmapRect - ( const QRect & r ) - - - setRenameEnabled - setRenameEnabled - ( bool allow ) - - - setSelectable - setSelectable - ( bool enable ) - - - setSelected - setSelected - ( bool s, bool cb ) - - - setSelected - setSelected-2 - ( bool s ) - - - setText - setText - ( const QString & text ) - - - setText - setText-2 - ( const QString & text, bool recalc, bool redraw = true ) - - - setTextRect - setTextRect - ( const QRect & r ) - - - size - size - () - - - text - text - () - - - textRect - textRect - ( bool relative = true ) - - - width - width - () - - - x - x - () - - - y - y - () - - - - Q3ImageDrag - q3imagedrag.html - - Q3ImageDrag - Q3ImageDrag - ( QImage image, QWidget * dragSource = 0, const char * name = 0 ) - - - Q3ImageDrag - Q3ImageDrag-2 - ( QWidget * dragSource = 0, const char * name = 0 ) - - - canDecode - canDecode - ( const QMimeSource * source ) - - - decode - decode - ( const QMimeSource * source, QImage & image ) - - - decode - decode-2 - ( const QMimeSource * source, QPixmap & pixmap ) - - - setImage - setImage - ( QImage image ) - - - - Q3IntCache - q3intcache.html - - Q3IntCache - Q3IntCache-2 - ( int maxCost = 100, int size = 17 ) - - - clear - clear - () - - - count - count - () - - - find - find - ( long k, bool ref = true ) - - - insert - insert - ( long k, const type * d, int c = 1, int p = 0 ) - - - isEmpty - isEmpty - () - - - maxCost - maxCost - () - - - remove - remove - ( long k ) - - - setMaxCost - setMaxCost - ( int m ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( long k ) - - - totalCost - totalCost - () - - - operator[] - operator-5b-5d - ( long k ) - - - - Q3IntCacheIterator - q3intcacheiterator.html - - Q3IntCacheIterator - Q3IntCacheIterator - ( const Q3IntCache<type> & cache ) - - - Q3IntCacheIterator - Q3IntCacheIterator-2 - ( const Q3IntCacheIterator<type> & ci ) - - - atFirst - atFirst - () - - - atLast - atLast - () - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - toLast - toLast - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - operator-- - operator-- - () - - - operator-= - operator--eq - ( uint jump ) - - - operator= - operator-eq - ( const Q3IntCacheIterator<type> & ci ) - - - - Q3IntDict - q3intdict.html - - Q3IntDict - Q3IntDict - ( int size = 17 ) - - - Q3IntDict - Q3IntDict-2 - ( const Q3IntDict<type> & dict ) - - - clear - clear - () - - - count - count - () - - - find - find - ( long key ) - - - insert - insert - ( long key, const type * item ) - - - isEmpty - isEmpty - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - ( long key ) - - - replace - replace - ( long key, const type * item ) - - - resize - resize - ( uint newsize ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( long key ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator= - operator-eq - ( const Q3IntDict<type> & dict ) - - - operator[] - operator-5b-5d - ( long key ) - - - - Q3IntDictIterator - q3intdictiterator.html - - Q3IntDictIterator - Q3IntDictIterator - ( const Q3IntDict<type> & dict ) - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - - Q3ListBox - q3listbox.html - - ComparisonFlags - ComparisonFlags-typedef - - - - LayoutMode - LayoutMode-enum - - - - SelectionMode - SelectionMode-enum - - - - StringComparisonMode - StringComparisonMode-enum - - - - Q3ListBox - Q3ListBox - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - autoBottomScrollBar - autoBottomScrollBar - () - - - autoScroll - autoScroll - () - - - autoScrollBar - autoScrollBar - () - - - autoUpdate - autoUpdate - () - - - bottomScrollBar - bottomScrollBar - () - - - cellHeight - cellHeight - ( int i ) - - - cellHeight - cellHeight-2 - () - - - cellWidth - cellWidth - () - - - cellWidth - cellWidth-2 - ( int i ) - - - centerCurrentItem - centerCurrentItem - () - - - changeItem - changeItem - ( const Q3ListBoxItem * lbi, int index ) - - - changeItem - changeItem-2 - ( const QString & text, int index ) - - - changeItem - changeItem-3 - ( const QPixmap & pixmap, int index ) - - - changeItem - changeItem-4 - ( const QPixmap & pixmap, const QString & text, int index ) - - - clear - clear - () - - - clearSelection - clearSelection - () - - - clicked - clicked - ( Q3ListBoxItem * item ) - - - clicked - clicked-2 - ( Q3ListBoxItem * item, const QPoint & pnt ) - - - contextMenuRequested - contextMenuRequested - ( Q3ListBoxItem * item, const QPoint & pos ) - - - currentChanged - currentChanged - ( Q3ListBoxItem * item ) - - - doLayout - doLayout - () - - - doubleClicked - doubleClicked - ( Q3ListBoxItem * item ) - - - dragSelect - dragSelect - () - - - ensureCurrentVisible - ensureCurrentVisible - () - - - findItem - findItem - ( const QString & text, ComparisonFlags compare = BeginsWith ) - - - findItem - findItem-2 - ( int yPos ) - - - firstItem - firstItem - () - - - highlighted - highlighted - ( int index ) - - - highlighted - highlighted-2 - ( Q3ListBoxItem * item ) - - - highlighted - highlighted-3 - ( const QString & text ) - - - inSort - inSort - ( const Q3ListBoxItem * lbi ) - - - inSort - inSort-2 - ( const QString & text ) - - - index - index - ( const Q3ListBoxItem * lbi ) - - - insertItem - insertItem - ( const Q3ListBoxItem * lbi, int index = -1 ) - - - insertItem - insertItem-2 - ( const Q3ListBoxItem * lbi, const Q3ListBoxItem * after ) - - - insertItem - insertItem-3 - ( const QString & text, int index = -1 ) - - - insertItem - insertItem-4 - ( const QPixmap & pixmap, int index = -1 ) - - - insertItem - insertItem-5 - ( const QPixmap & pixmap, const QString & text, int index = -1 ) - - - insertStrList - insertStrList - ( const char ** strings, int numStrings = -1, int index = -1 ) - - - insertStringList - insertStringList - ( const QStringList & list, int index = -1 ) - - - invertSelection - invertSelection - () - - - isRubberSelecting - isRubberSelecting - () - - - isSelected - isSelected - ( int i ) - - - isSelected - isSelected-2 - ( const Q3ListBoxItem * i ) - - - item - item - ( int index ) - - - itemAt - itemAt - ( const QPoint & p ) - - - itemHeight - itemHeight - ( int index = 0 ) - - - itemRect - itemRect - ( Q3ListBoxItem * item ) - - - itemVisible - itemVisible - ( int index ) - - - itemVisible - itemVisible-2 - ( const Q3ListBoxItem * item ) - - - maxItemWidth - maxItemWidth - () - - - mouseButtonClicked - mouseButtonClicked - ( int button, Q3ListBoxItem * item, const QPoint & pos ) - - - mouseButtonPressed - mouseButtonPressed - ( int button, Q3ListBoxItem * item, const QPoint & pos ) - - - numCols - numCols - () - - - onItem - onItem - ( Q3ListBoxItem * i ) - - - onViewport - onViewport - () - - - paintCell - paintCell - ( QPainter * p, int row, int col ) - - - pixmap - pixmap - ( int index ) - - - pressed - pressed - ( Q3ListBoxItem * item ) - - - pressed - pressed-2 - ( Q3ListBoxItem * item, const QPoint & pnt ) - - - removeItem - removeItem - ( int index ) - - - returnPressed - returnPressed - ( Q3ListBoxItem * item ) - - - rightButtonClicked - rightButtonClicked - ( Q3ListBoxItem * item, const QPoint & point ) - - - rightButtonPressed - rightButtonPressed - ( Q3ListBoxItem * item, const QPoint & point ) - - - scrollBar - scrollBar - () - - - selectAll - selectAll - ( bool select ) - - - selected - selected - ( int index ) - - - selected - selected-2 - ( Q3ListBoxItem * item ) - - - selected - selected-3 - ( const QString & text ) - - - selectedItem - selectedItem - () - - - selectionChanged - selectionChanged - () - - - selectionChanged - selectionChanged-2 - ( Q3ListBoxItem * item ) - - - setAutoBottomScrollBar - setAutoBottomScrollBar - ( bool enable ) - - - setAutoScroll - setAutoScroll - ( bool b ) - - - setAutoScrollBar - setAutoScrollBar - ( bool enable ) - - - setAutoUpdate - setAutoUpdate - ( bool b ) - - - setBottomItem - setBottomItem - ( int index ) - - - setBottomScrollBar - setBottomScrollBar - ( bool enable ) - - - setDragSelect - setDragSelect - ( bool b ) - - - setFixedVisibleLines - setFixedVisibleLines - ( int lines ) - - - setScrollBar - setScrollBar - ( bool enable ) - - - setSelected - setSelected - ( Q3ListBoxItem * item, bool select ) - - - setSelected - setSelected-2 - ( int index, bool select ) - - - setSmoothScrolling - setSmoothScrolling - ( bool b ) - - - smoothScrolling - smoothScrolling - () - - - sort - sort - ( bool ascending = true ) - - - takeItem - takeItem - ( const Q3ListBoxItem * item ) - - - text - text - ( int index ) - - - toggleCurrentItem - toggleCurrentItem - () - - - totalHeight - totalHeight - () - - - totalWidth - totalWidth - () - - - triggerUpdate - triggerUpdate - ( bool doLayout ) - - - updateCellWidth - updateCellWidth - () - - - updateItem - updateItem - ( int index ) - - - updateItem - updateItem-2 - ( Q3ListBoxItem * i ) - - - - Q3ListBoxItem - q3listboxitem.html - - Q3ListBoxItem - Q3ListBoxItem - ( Q3ListBox * listbox = 0 ) - - - Q3ListBoxItem - Q3ListBoxItem-2 - ( Q3ListBox * listbox, Q3ListBoxItem * after ) - - - current - current - () - - - height - height - ( const Q3ListBox * lb ) - - - isCurrent - isCurrent - () - - - isSelectable - isSelectable - () - - - isSelected - isSelected - () - - - listBox - listBox - () - - - next - next - () - - - paint - paint - ( QPainter * p ) - - - pixmap - pixmap - () - - - prev - prev - () - - - rtti - rtti - () - - - selected - selected - () - - - setCustomHighlighting - setCustomHighlighting - ( bool b ) - - - setSelectable - setSelectable - ( bool b ) - - - setText - setText - ( const QString & text ) - - - text - text - () - - - width - width - ( const Q3ListBox * lb ) - - - - Q3ListBoxPixmap - q3listboxpixmap.html - - Q3ListBoxPixmap - Q3ListBoxPixmap - ( Q3ListBox * listbox, const QPixmap & pixmap ) - - - Q3ListBoxPixmap - Q3ListBoxPixmap-2 - ( const QPixmap & pixmap ) - - - Q3ListBoxPixmap - Q3ListBoxPixmap-3 - ( Q3ListBox * listbox, const QPixmap & pixmap, Q3ListBoxItem * after ) - - - Q3ListBoxPixmap - Q3ListBoxPixmap-4 - ( Q3ListBox * listbox, const QPixmap & pix, const QString & text ) - - - Q3ListBoxPixmap - Q3ListBoxPixmap-5 - ( const QPixmap & pix, const QString & text ) - - - Q3ListBoxPixmap - Q3ListBoxPixmap-6 - ( Q3ListBox * listbox, const QPixmap & pix, const QString & text, Q3ListBoxItem * after ) - - - height - height - ( const Q3ListBox * lb ) - - - paint - paint - ( QPainter * painter ) - - - pixmap - pixmap - () - - - width - width - ( const Q3ListBox * lb ) - - - - Q3ListBoxText - q3listboxtext.html - - Q3ListBoxText - Q3ListBoxText - ( Q3ListBox * listbox, const QString & text = QString() - - - Q3ListBoxText - Q3ListBoxText-2 - ( const QString & text = QString() - - - Q3ListBoxText - Q3ListBoxText-3 - ( Q3ListBox * listbox, const QString & text, Q3ListBoxItem * after ) - - - height - height - ( const Q3ListBox * lb ) - - - paint - paint - ( QPainter * painter ) - - - width - width - ( const Q3ListBox * lb ) - - - - Q3ListView - q3listview.html - - ComparisonFlags - ComparisonFlags-typedef - - - - RenameAction - RenameAction-enum - - - - ResizeMode - ResizeMode-enum - - - - SelectionMode - SelectionMode-enum - - - - StringComparisonMode - StringComparisonMode-enum - - - - WidthMode - WidthMode-enum - - - - Q3ListView - Q3ListView - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - addColumn - addColumn - ( const QString & label, int width = -1 ) - - - addColumn - addColumn-2 - ( const QIcon & icon, const QString & label, int width = -1 ) - - - adjustColumn - adjustColumn - ( int col ) - - - clear - clear - () - - - clearSelection - clearSelection - () - - - clicked - clicked - ( Q3ListViewItem * item ) - - - clicked - clicked-2 - ( Q3ListViewItem * item, const QPoint & pnt, int c ) - - - collapsed - collapsed - ( Q3ListViewItem * item ) - - - columnAlignment - columnAlignment - ( int column ) - - - columnText - columnText - ( int c ) - - - columnWidth - columnWidth - ( int c ) - - - columnWidthMode - columnWidthMode - ( int c ) - - - contentsMouseDoubleClickEvent - contentsMouseDoubleClickEvent - ( QMouseEvent * e ) - - - contentsMouseMoveEvent - contentsMouseMoveEvent - ( QMouseEvent * e ) - - - contentsMousePressEvent - contentsMousePressEvent - ( QMouseEvent * e ) - - - contentsMouseReleaseEvent - contentsMouseReleaseEvent - ( QMouseEvent * e ) - - - contextMenuRequested - contextMenuRequested - ( Q3ListViewItem * item, const QPoint & pos, int col ) - - - currentChanged - currentChanged - ( Q3ListViewItem * item ) - - - currentItem - currentItem - () - - - doAutoScroll - doAutoScroll - () - - - doubleClicked - doubleClicked - ( Q3ListViewItem * item ) - - - doubleClicked - doubleClicked-2 - ( Q3ListViewItem * item, const QPoint & point, int column ) - - - dragObject - dragObject - () - - - drawContentsOffset - drawContentsOffset - ( QPainter * p, int ox, int oy, int cx, int cy, int cw, int ch ) - - - dropped - dropped - ( QDropEvent * e ) - - - ensureItemVisible - ensureItemVisible - ( const Q3ListViewItem * i ) - - - eventFilter - eventFilter - ( QObject * o, QEvent * e ) - - - expanded - expanded - ( Q3ListViewItem * item ) - - - findItem - findItem - ( const QString & text, int column, ComparisonFlags compare = ExactMatch | Qt::CaseSensitive ) - - - firstChild - firstChild - () - - - header - header - () - - - hideColumn - hideColumn - ( int column ) - - - insertItem - insertItem - ( Q3ListViewItem * i ) - - - invertSelection - invertSelection - () - - - isOpen - isOpen - ( const Q3ListViewItem * item ) - - - isRenaming - isRenaming - () - - - isSelected - isSelected - ( const Q3ListViewItem * i ) - - - itemAt - itemAt - ( const QPoint & viewPos ) - - - itemPos - itemPos - ( const Q3ListViewItem * item ) - - - itemRect - itemRect - ( const Q3ListViewItem * item ) - - - itemRenamed - itemRenamed - ( Q3ListViewItem * item, int col, const QString & text ) - - - itemRenamed - itemRenamed-2 - ( Q3ListViewItem * item, int col ) - - - lastItem - lastItem - () - - - mouseButtonClicked - mouseButtonClicked - ( int button, Q3ListViewItem * item, const QPoint & pos, int c ) - - - mouseButtonPressed - mouseButtonPressed - ( int button, Q3ListViewItem * item, const QPoint & pos, int c ) - - - onItem - onItem - ( Q3ListViewItem * i ) - - - onViewport - onViewport - () - - - paintEmptyArea - paintEmptyArea - ( QPainter * p, const QRect & rect ) - - - pressed - pressed - ( Q3ListViewItem * item ) - - - pressed - pressed-2 - ( Q3ListViewItem * item, const QPoint & pnt, int c ) - - - removeColumn - removeColumn - ( int index ) - - - removeItem - removeItem - ( Q3ListViewItem * item ) - - - repaintItem - repaintItem - ( const Q3ListViewItem * item ) - - - resizeEvent - resizeEvent - ( QResizeEvent * e ) - - - returnPressed - returnPressed - ( Q3ListViewItem * item ) - - - rightButtonClicked - rightButtonClicked - ( Q3ListViewItem * item, const QPoint & point, int column ) - - - rightButtonPressed - rightButtonPressed - ( Q3ListViewItem * item, const QPoint & point, int column ) - - - selectAll - selectAll - ( bool select ) - - - selectedItem - selectedItem - () - - - selectionChanged - selectionChanged - () - - - selectionChanged - selectionChanged-2 - ( Q3ListViewItem * item ) - - - setColumnAlignment - setColumnAlignment - ( int column, int align ) - - - setColumnText - setColumnText - ( int column, const QString & label ) - - - setColumnText - setColumnText-2 - ( int column, const QIcon & icon, const QString & label ) - - - setColumnWidth - setColumnWidth - ( int column, int w ) - - - setColumnWidthMode - setColumnWidthMode - ( int c, WidthMode mode ) - - - setCurrentItem - setCurrentItem - ( Q3ListViewItem * i ) - - - setOpen - setOpen - ( Q3ListViewItem * item, bool open ) - - - setSelected - setSelected - ( Q3ListViewItem * item, bool selected ) - - - setSelectionAnchor - setSelectionAnchor - ( Q3ListViewItem * item ) - - - setSortColumn - setSortColumn - ( int column ) - - - setSortOrder - setSortOrder - ( Qt::SortOrder order ) - - - setSorting - setSorting - ( int column, bool ascending = true ) - - - sort - sort - () - - - sortColumn - sortColumn - () - - - SortOrder - sortOrder - Q3ListView::sortOrder() - - - spacePressed - spacePressed - ( Q3ListViewItem * item ) - - - startDrag - startDrag - () - - - takeItem - takeItem - ( Q3ListViewItem * i ) - - - triggerUpdate - triggerUpdate - () - - - updateContents - updateContents - () - - - - Q3ListViewItem - q3listviewitem.html - - Q3ListViewItem - Q3ListViewItem - ( Q3ListView * parent ) - - - Q3ListViewItem - Q3ListViewItem-2 - ( Q3ListViewItem * parent ) - - - Q3ListViewItem - Q3ListViewItem-3 - ( Q3ListView * parent, Q3ListViewItem * after ) - - - Q3ListViewItem - Q3ListViewItem-4 - ( Q3ListViewItem * parent, Q3ListViewItem * after ) - - - Q3ListViewItem - Q3ListViewItem-5 - ( Q3ListView * parent, const QString & label1, const QString & label2 = QString() - - - Q3ListViewItem - Q3ListViewItem-6 - ( Q3ListViewItem * parent, const QString & label1, const QString & label2 = QString() - - - Q3ListViewItem - Q3ListViewItem-7 - ( Q3ListView * parent, Q3ListViewItem * after, const QString & label1, const QString & label2 = QString() - - - Q3ListViewItem - Q3ListViewItem-8 - ( Q3ListViewItem * parent, Q3ListViewItem * after, const QString & label1, const QString & label2 = QString() - - - acceptDrop - acceptDrop - ( const QMimeSource * mime ) - - - activate - activate - () - - - activatedPos - activatedPos - ( QPoint & pos ) - - - cancelRename - cancelRename - ( int col ) - - - childCount - childCount - () - - - compare - compare - ( Q3ListViewItem * i, int col, bool ascending ) - - - depth - depth - () - - - dragEnabled - dragEnabled - () - - - dragEntered - dragEntered - () - - - dragLeft - dragLeft - () - - - dropEnabled - dropEnabled - () - - - dropped - dropped - ( QDropEvent * e ) - - - enforceSortOrder - enforceSortOrder - () - - - firstChild - firstChild - () - - - height - height - () - - - insertItem - insertItem - ( Q3ListViewItem * newChild ) - - - invalidateHeight - invalidateHeight - () - - - isEnabled - isEnabled - () - - - isExpandable - isExpandable - () - - - isOpen - isOpen - () - - - isSelectable - isSelectable - () - - - isSelected - isSelected - () - - - isVisible - isVisible - () - - - itemAbove - itemAbove - () - - - itemBelow - itemBelow - () - - - itemPos - itemPos - () - - - key - key - ( int column, bool ascending ) - - - listView - listView - () - - - moveItem - moveItem - ( Q3ListViewItem * after ) - - - multiLinesEnabled - multiLinesEnabled - () - - - nextSibling - nextSibling - () - - - okRename - okRename - ( int col ) - - - paintBranches - paintBranches - ( QPainter * p, const QColorGroup & cg, int w, int y, int h ) - - - paintCell - paintCell - ( QPainter * painter, const QColorGroup & cg, int column, int width, int align ) - - - paintFocus - paintFocus - ( QPainter * p, const QColorGroup & cg, const QRect & r ) - - - parent - parent - () - - - pixmap - pixmap - ( int column ) - - - removeItem - removeItem - ( Q3ListViewItem * item ) - - - renameEnabled - renameEnabled - ( int col ) - - - repaint - repaint - () - - - rtti - rtti - () - - - setDragEnabled - setDragEnabled - ( bool allow ) - - - setDropEnabled - setDropEnabled - ( bool allow ) - - - setEnabled - setEnabled - ( bool b ) - - - setExpandable - setExpandable - ( bool enable ) - - - setHeight - setHeight - ( int height ) - - - setMultiLinesEnabled - setMultiLinesEnabled - ( bool b ) - - - setOpen - setOpen - ( bool o ) - - - setPixmap - setPixmap - ( int column, const QPixmap & pm ) - - - setRenameEnabled - setRenameEnabled - ( int col, bool b ) - - - setSelectable - setSelectable - ( bool enable ) - - - setSelected - setSelected - ( bool s ) - - - setText - setText - ( int column, const QString & text ) - - - setVisible - setVisible - ( bool b ) - - - setup - setup - () - - - sort - sort - () - - - sortChildItems - sortChildItems - ( int column, bool ascending ) - - - startRename - startRename - ( int col ) - - - takeItem - takeItem - ( Q3ListViewItem * item ) - - - text - text - ( int column ) - - - totalHeight - totalHeight - () - - - width - width - ( const QFontMetrics & fm, const Q3ListView * lv, int c ) - - - widthChanged - widthChanged - ( int c = -1 ) - - - - Q3ListViewItemIterator - q3listviewitemiterator.html - - IteratorFlag - IteratorFlag-enum - - - - Q3ListViewItemIterator - Q3ListViewItemIterator - () - - - Q3ListViewItemIterator - Q3ListViewItemIterator-2 - ( Q3ListViewItem * item ) - - - Q3ListViewItemIterator - Q3ListViewItemIterator-3 - ( Q3ListViewItem * item, int iteratorFlags ) - - - Q3ListViewItemIterator - Q3ListViewItemIterator-4 - ( const Q3ListViewItemIterator & it ) - - - Q3ListViewItemIterator - Q3ListViewItemIterator-5 - ( Q3ListView * lv ) - - - Q3ListViewItemIterator - Q3ListViewItemIterator-6 - ( Q3ListView * lv, int iteratorFlags ) - - - current - current - () - - - operator* - operator-2a - () - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator= - operator-eq - ( const Q3ListViewItemIterator & it ) - - - - Q3LocalFs - q3localfs.html - - Q3LocalFs - Q3LocalFs - () - - - - Q3MainWindow - q3mainwindow.html - - DockWindows - DockWindows-enum - - - - Q3MainWindow - Q3MainWindow - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = Qt::WType_TopLevel ) - - - addDockWindow - addDockWindow - ( Q3DockWindow * dockWindow, Qt::Dock edge = Qt::DockTop, bool newLine = false ) - - - addDockWindow - addDockWindow-2 - ( Q3DockWindow * dockWindow, const QString & label, Qt::Dock edge = Qt::DockTop, bool newLine = false ) - - - addToolBar - addToolBar - ( Q3DockWindow * dockWindow, Qt::Dock position = Qt::DockTop, bool newLine = false ) - - - addToolBar - addToolBar-2 - ( Q3DockWindow * dockWindow, const QString & label, Qt::Dock position = Qt::DockTop, bool newLine = false ) - - - appropriate - appropriate - ( Q3DockWindow * dw ) - - - bottomDock - bottomDock - () - - - centralWidget - centralWidget - () - - - childEvent - childEvent - ( QChildEvent * e ) - - - createDockWindowMenu - createDockWindowMenu - ( DockWindows dockWindows = AllDockWindows ) - - - customize - customize - () - - - dockWindowPositionChanged - dockWindowPositionChanged - ( Q3DockWindow * dockWindow ) - - - dockWindows - dockWindows - ( Qt::Dock dock ) - - - dockWindows - dockWindows-2 - () - - - getLocation - getLocation - ( Q3DockWindow * dw, Qt::Dock & dock, int & index, bool & nl, int & extraOffset ) - - - hasDockWindow - hasDockWindow - ( Q3DockWindow * dw ) - - - isCustomizable - isCustomizable - () - - - isDockEnabled - isDockEnabled - ( Qt::Dock dock ) - - - isDockEnabled - isDockEnabled-2 - ( Q3DockArea * area ) - - - isDockEnabled - isDockEnabled-3 - ( Q3DockWindow * dw, Q3DockArea * area ) - - - isDockEnabled - isDockEnabled-4 - ( Q3DockWindow * tb, Qt::Dock dock ) - - - isDockMenuEnabled - isDockMenuEnabled - () - - - leftDock - leftDock - () - - - lineUpDockWindows - lineUpDockWindows - ( bool keepNewLines = false ) - - - lineUpToolBars - lineUpToolBars - ( bool keepNewLines = false ) - - - menuAboutToShow - menuAboutToShow - () - - - menuBar - menuBar - () - - - moveDockWindow - moveDockWindow - ( Q3DockWindow * dockWindow, Qt::Dock edge = Qt::DockTop ) - - - moveDockWindow - moveDockWindow-2 - ( Q3DockWindow * dockWindow, Qt::Dock edge, bool nl, int index, int extraOffset = -1 ) - - - moveToolBar - moveToolBar - ( Q3DockWindow * dockWindow, Qt::Dock position = Qt::DockTop ) - - - moveToolBar - moveToolBar-2 - ( Q3DockWindow * dockWindow, Qt::Dock position, bool nl, int index, int extraOffset = -1 ) - - - pixmapSizeChanged - pixmapSizeChanged - ( bool b ) - - - removeDockWindow - removeDockWindow - ( Q3DockWindow * dockWindow ) - - - removeToolBar - removeToolBar - ( Q3DockWindow * dockWindow ) - - - rightDock - rightDock - () - - - setAppropriate - setAppropriate - ( Q3DockWindow * dw, bool a ) - - - setCentralWidget - setCentralWidget - ( QWidget * w ) - - - setDockEnabled - setDockEnabled - ( Qt::Dock dock, bool enable ) - - - setDockEnabled - setDockEnabled-2 - ( Q3DockWindow * dw, Qt::Dock dock, bool enable ) - - - setDockMenuEnabled - setDockMenuEnabled - ( bool b ) - - - setToolBarsMovable - setToolBarsMovable - ( bool b ) - - - setUpLayout - setUpLayout - () - - - showDockMenu - showDockMenu - ( const QPoint & globalPos ) - - - statusBar - statusBar - () - - - toolBarPositionChanged - toolBarPositionChanged - ( Q3ToolBar * toolbar ) - - - toolBars - toolBars - ( Qt::Dock dock ) - - - toolBarsMovable - toolBarsMovable - () - - - topDock - topDock - () - - - usesTextLabelChanged - usesTextLabelChanged - ( bool b ) - - - whatsThis - whatsThis - () - - - - Q3MemArray - q3memarray.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - Q3MemArray - Q3MemArray - ( int arg1, int arg2 ) - - - Q3MemArray - Q3MemArray-2 - () - - - Q3MemArray - Q3MemArray-3 - ( int size ) - - - Q3MemArray - Q3MemArray-4 - ( const Q3MemArray<type> & a ) - - - Q3MemArray - Q3MemArray-5 - ( const QVector<type> & vector ) - - - assign - assign - ( const Q3MemArray<type> & a ) - - - assign - assign-2 - ( const type * data, uint size ) - - - at - at - ( uint index ) - - - begin - begin - () - - - begin - begin-2 - () - - - bsearch - bsearch - ( const type & v ) - - - contains - contains - ( const type & v ) - - - copy - copy - () - - - count - count - () - - - data - data - () - - - detach - detach - () - - - duplicate - duplicate - ( const Q3MemArray<type> & a ) - - - duplicate - duplicate-2 - ( const type * data, uint size ) - - - end - end - () - - - end - end-2 - () - - - fill - fill - ( const type & v, int size = -1 ) - - - find - find - ( const type & v, uint index = 0 ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - nrefs - nrefs - () - - - resetRawData - resetRawData - ( const type * data, uint size ) - - - resize - resize - ( uint size, Optimization optim ) - - - resize - resize-2 - ( uint size ) - - - setRawData - setRawData - ( const type * data, uint size ) - - - size - size - () - - - sort - sort - () - - - truncate - truncate - ( uint pos ) - - - operator - operator-QVector-lttype-gt - QVector<type>() - - - operator - operator-const-type--2a - const type *() - - - operator!= - operator-not-eq - ( const Q3MemArray<type> & a ) - - - operator= - operator-eq - ( const Q3MemArray<type> & a ) - - - operator== - operator-eq-eq - ( const Q3MemArray<type> & a ) - - - operator[] - operator-5b-5d - ( int index ) - - - - Q3MimeSourceFactory - q3mimesourcefactory.html - - Q3MimeSourceFactory - Q3MimeSourceFactory - () - - - addFactory - addFactory - ( Q3MimeSourceFactory * f ) - - - addFilePath - addFilePath - ( const QString & p ) - - - data - data - ( const QString & abs_name ) - - - data - data-2 - ( const QString & abs_or_rel_name, const QString & context ) - - - defaultFactory - defaultFactory - () - - - filePath - filePath - () - - - makeAbsolute - makeAbsolute - ( const QString & abs_or_rel_name, const QString & context ) - - - removeFactory - removeFactory - ( Q3MimeSourceFactory * f ) - - - setData - setData - ( const QString & abs_name, QMimeSource * data ) - - - setDefaultFactory - setDefaultFactory - ( Q3MimeSourceFactory * factory ) - - - setExtensionType - setExtensionType - ( const QString & ext, const char * mimetype ) - - - setFilePath - setFilePath - ( const QStringList & path ) - - - setFilePath - setFilePath-2 - ( const QString & path ) - - - setImage - setImage - ( const QString & abs_name, const QImage & image ) - - - setPixmap - setPixmap - ( const QString & abs_name, const QPixmap & pixmap ) - - - setText - setText - ( const QString & abs_name, const QString & text ) - - - takeDefaultFactory - takeDefaultFactory - () - - - - Q3MultiLineEdit - q3multilineedit.html - - Alignment - alignment-prop - - - - Q3MultiLineEdit - Q3MultiLineEdit - ( QWidget * parent = 0, const char * name = 0 ) - - - autoUpdate - autoUpdate - () - - - backspace - backspace - () - - - cursorDown - cursorDown - ( bool mark = false ) - - - cursorLeft - cursorLeft - ( bool mark = false, bool wrap = true ) - - - cursorPoint - cursorPoint - () - - - cursorRight - cursorRight - ( bool mark = false, bool wrap = true ) - - - cursorUp - cursorUp - ( bool mark = false ) - - - cursorWordBackward - cursorWordBackward - ( bool mark ) - - - cursorWordForward - cursorWordForward - ( bool mark ) - - - deselect - deselect - () - - - end - end - ( bool mark = false ) - - - getMarkedRegion - getMarkedRegion - ( int * line1, int * col1, int * line2, int * col2 ) - - - hasMarkedText - hasMarkedText - () - - - home - home - ( bool mark = false ) - - - insertAndMark - insertAndMark - ( const QString & str, bool mark ) - - - insertAt - insertAt-2 - ( const QString & s, int line, int col, bool mark ) - - - insertLine - insertLine - ( const QString & txt, int line = -1 ) - - - killLine - killLine - () - - - lineLength - lineLength - ( int row ) - - - markedText - markedText - () - - - maxLines - maxLines - () - - - newLine - newLine - () - - - pageDown - pageDown - ( bool mark = false ) - - - pageUp - pageUp - ( bool mark = false ) - - - removeLine - removeLine - ( int paragraph ) - - - setCursorPosition - setCursorPosition-2 - ( int line, int col, bool mark ) - - - setMaxLines - setMaxLines - ( int max ) - - - textLine - textLine - ( int line ) - - - totalHeight - totalHeight - () - - - totalWidth - totalWidth - () - - - - Q3NetworkOperation - q3networkoperation.html - - Q3NetworkOperation - Q3NetworkOperation - ( Q3NetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 ) - - - Q3NetworkOperation - Q3NetworkOperation-2 - ( Q3NetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 ) - - - arg - arg - ( int num ) - - - errorCode - errorCode - () - - - free - free - () - - - Operation - operation - Q3NetworkOperation::operation() - - - protocolDetail - protocolDetail - () - - - rawArg - rawArg - ( int num ) - - - setArg - setArg - ( int num, const QString & arg ) - - - setErrorCode - setErrorCode - ( int ec ) - - - setProtocolDetail - setProtocolDetail - ( const QString & detail ) - - - setRawArg - setRawArg - ( int num, const QByteArray & arg ) - - - setState - setState - ( Q3NetworkProtocol::State state ) - - - State - state - Q3NetworkOperation::state() - - - - Q3NetworkProtocol - q3networkprotocol.html - - ConnectionState - ConnectionState-enum - - - - Error - Error-enum - - - - Operation - Operation-enum - - - - State - State-enum - - - - Q3NetworkProtocol - Q3NetworkProtocol - () - - - addOperation - addOperation - ( Q3NetworkOperation * op ) - - - autoDelete - autoDelete - () - - - checkConnection - checkConnection - ( Q3NetworkOperation * op ) - - - clearOperationQueue - clearOperationQueue - () - - - connectionStateChanged - connectionStateChanged - ( int state, const QString & data ) - - - createdDirectory - createdDirectory - ( const QUrlInfo & i, Q3NetworkOperation * op ) - - - data - data - ( const QByteArray & data, Q3NetworkOperation * op ) - - - dataTransferProgress - dataTransferProgress - ( int bytesDone, int bytesTotal, Q3NetworkOperation * op ) - - - finished - finished - ( Q3NetworkOperation * op ) - - - getNetworkProtocol - getNetworkProtocol - ( const QString & protocol ) - - - hasOnlyLocalFileSystem - hasOnlyLocalFileSystem - () - - - itemChanged - itemChanged - ( Q3NetworkOperation * op ) - - - newChild - newChild - ( const QUrlInfo & i, Q3NetworkOperation * op ) - - - newChildren - newChildren - ( const Q3ValueList<QUrlInfo> & i, Q3NetworkOperation * op ) - - - operationGet - operationGet - ( Q3NetworkOperation * op ) - - - operationInProgress - operationInProgress - () - - - operationListChildren - operationListChildren - ( Q3NetworkOperation * op ) - - - operationMkDir - operationMkDir - ( Q3NetworkOperation * op ) - - - operationPut - operationPut - ( Q3NetworkOperation * op ) - - - operationRemove - operationRemove - ( Q3NetworkOperation * op ) - - - operationRename - operationRename - ( Q3NetworkOperation * op ) - - - registerNetworkProtocol - registerNetworkProtocol - ( const QString & protocol, Q3NetworkProtocolFactoryBase * protocolFactory ) - - - removed - removed - ( Q3NetworkOperation * op ) - - - setAutoDelete - setAutoDelete - ( bool b, int i = 10000 ) - - - setUrl - setUrl - ( Q3UrlOperator * u ) - - - start - start - ( Q3NetworkOperation * op ) - - - stop - stop - () - - - supportedOperations - supportedOperations - () - - - url - url - () - - - - Q3PaintDeviceMetrics - q3paintdevicemetrics.html - - Q3PaintDeviceMetrics - Q3PaintDeviceMetrics - ( const QPaintDevice * pd ) - - - depth - depth - () - - - height - height - () - - - heightMM - heightMM - () - - - logicalDpiX - logicalDpiX - () - - - logicalDpiY - logicalDpiY - () - - - numColors - numColors - () - - - width - width - () - - - widthMM - widthMM - () - - - - Q3Painter - q3painter.html - - Q3Painter - Q3Painter - () - - - Q3Painter - Q3Painter-2 - ( QPaintDevice * pdev ) - - - drawArc - drawArc - ( const QRect & r, int a, int alen ) - - - drawArc - drawArc-2 - ( int x, int y, int w, int h, int startAngle, int spanAngle ) - - - drawChord - drawChord - ( const QRect & r, int a, int alen ) - - - drawChord - drawChord-2 - ( int x, int y, int w, int h, int startAngle, int spanAngle ) - - - drawEllipse - drawEllipse - ( const QRect & r ) - - - drawEllipse - drawEllipse-2 - ( int x, int y, int width, int height ) - - - drawPie - drawPie - ( const QRect & r, int a, int alen ) - - - drawPie - drawPie-2 - ( int x, int y, int w, int h, int startAngle, int spanAngle ) - - - drawRect - drawRect - ( const QRect & r ) - - - drawRect - drawRect-2 - ( int x, int y, int w, int h ) - - - drawRoundRect - drawRoundRect - ( const QRect & r, int xrnd = 25, int yrnd = 25 ) - - - drawRoundRect - drawRoundRect-2 - ( int x, int y, int w, int h, int xrnd = 25, int yrnd = 25 ) - - - - Q3Picture - q3picture.html - - Q3Picture - Q3Picture - () - - - Q3Picture - Q3Picture-2 - ( const QPicture & other ) - - - load - load - ( QIODevice * device, const char * format = 0 ) - - - load - load-2 - ( const QString & fileName, const char * format = 0 ) - - - save - save - ( QIODevice * device, const char * format = 0 ) - - - save - save-2 - ( const QString & fileName, const char * format = 0 ) - - - - Q3PointArray - q3pointarray.html - - Q3PointArray - Q3PointArray - () - - - Q3PointArray - Q3PointArray-2 - ( const QRect & r, bool closed = false ) - - - Q3PointArray - Q3PointArray-3 - ( const QPolygon & other ) - - - copy - copy - () - - - cubicBezier - cubicBezier - () - - - isNull - isNull - () - - - makeArc - makeArc - ( int x, int y, int w, int h, int a1, int a2 ) - - - makeArc - makeArc-2 - ( int x, int y, int w, int h, int a1, int a2, const QMatrix & xf ) - - - makeEllipse - makeEllipse - ( int x, int y, int w, int h ) - - - - Q3PopupMenu - q3popupmenu.html - - Q3PopupMenu - Q3PopupMenu - ( QWidget * parent = 0, const char * name = 0 ) - - - exec - exec - () - - - exec - exec-2 - ( const QPoint & pos, int indexAtPoint = 0 ) - - - - Q3Process - q3process.html - - Communication - Communication-enum - - - - Q3Process - Q3Process - ( QObject * parent = 0, const char * name = 0 ) - - - Q3Process - Q3Process-2 - ( const QString & arg0, QObject * parent = 0, const char * name = 0 ) - - - Q3Process - Q3Process-3 - ( const QStringList & args, QObject * parent = 0, const char * name = 0 ) - - - addArgument - addArgument - ( const QString & arg ) - - - arguments - arguments - () - - - canReadLineStderr - canReadLineStderr - () - - - canReadLineStdout - canReadLineStdout - () - - - clearArguments - clearArguments - () - - - closeStdin - closeStdin - () - - - communication - communication - () - - - exitStatus - exitStatus - () - - - isRunning - isRunning - () - - - kill - kill - () - - - launch - launch - ( const QByteArray & buf, QStringList * env = 0 ) - - - launch - launch-2 - ( const QString & buf, QStringList * env = 0 ) - - - launchFinished - launchFinished - () - - - normalExit - normalExit - () - - - processExited - processExited - () - - - processIdentifier - processIdentifier - () - - - readLineStderr - readLineStderr - () - - - readLineStdout - readLineStdout - () - - - readStderr - readStderr - () - - - readStdout - readStdout - () - - - readyReadStderr - readyReadStderr - () - - - readyReadStdout - readyReadStdout - () - - - setArguments - setArguments - ( const QStringList & args ) - - - setCommunication - setCommunication - ( int commFlags ) - - - setWorkingDirectory - setWorkingDirectory - ( const QDir & dir ) - - - start - start - ( QStringList * env = 0 ) - - - tryTerminate - tryTerminate - () - - - workingDirectory - workingDirectory - () - - - writeToStdin - writeToStdin - ( const QByteArray & buf ) - - - writeToStdin - writeToStdin-2 - ( const QString & buf ) - - - wroteToStdin - wroteToStdin - () - - - - Q3ProgressBar - q3progressbar.html - - Q3ProgressBar - Q3ProgressBar-3 - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - Q3ProgressBar - Q3ProgressBar-4 - ( int totalSteps, QWidget * parent = 0, Qt::WFlags f = 0 ) - - - reset - reset - () - - - setIndicator - setIndicator - ( QString & indicator, int progress, int totalSteps ) - - - Q3ProgressBar - Q3ProgressBar - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - Q3ProgressBar - Q3ProgressBar-2 - ( int totalSteps, QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - - Q3ProgressDialog - q3progressdialog.html - - Q3ProgressDialog - Q3ProgressDialog-3 - ( QWidget * creator = 0, Qt::WFlags f = 0 ) - - - Q3ProgressDialog - Q3ProgressDialog-4 - ( const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator = 0, Qt::WFlags f = 0 ) - - - cancel - cancel - () - - - canceled - canceled - () - - - forceShow - forceShow - () - - - reset - reset - () - - - setBar - setBar - ( Q3ProgressBar * bar ) - - - setCancelButton - setCancelButton - ( QPushButton * cancelButton ) - - - setCancelButtonText - setCancelButtonText - ( const QString & cancelButtonText ) - - - setLabel - setLabel - ( QLabel * label ) - - - sizeHint - sizeHint - () - - - Q3ProgressDialog - Q3ProgressDialog - ( QWidget * creator, const char * name, bool modal = false, Qt::WFlags f = 0 ) - - - Q3ProgressDialog - Q3ProgressDialog-2 - ( const QString & labelText, const QString & cancelButtonText, int totalSteps, QWidget * creator = 0, const char * name = 0, bool modal = false, Qt::WFlags f = 0 ) - - - - Q3PtrCollection - q3ptrcollection.html - - Item - Item-typedef - - - - Q3PtrCollection - Q3PtrCollection - () - - - Q3PtrCollection - Q3PtrCollection-2 - ( const Q3PtrCollection & source ) - - - autoDelete - autoDelete - () - - - clear - clear - () - - - count - count - () - - - deleteItem - deleteItem - ( Item d ) - - - newItem - newItem - ( Item d ) - - - setAutoDelete - setAutoDelete - ( bool enable ) - - - - Q3PtrDict - q3ptrdict.html - - Q3PtrDict - Q3PtrDict - ( int size = 17 ) - - - Q3PtrDict - Q3PtrDict-2 - ( const Q3PtrDict<type> & dict ) - - - clear - clear - () - - - count - count - () - - - find - find - ( void * key ) - - - insert - insert - ( void * key, const type * item ) - - - isEmpty - isEmpty - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - ( void * key ) - - - replace - replace - ( void * key, const type * item ) - - - resize - resize - ( uint newsize ) - - - size - size - () - - - statistics - statistics - () - - - take - take - ( void * key ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator= - operator-eq - ( const Q3PtrDict<type> & dict ) - - - operator[] - operator-5b-5d - ( void * key ) - - - - Q3PtrDictIterator - q3ptrdictiterator.html - - Q3PtrDictIterator - Q3PtrDictIterator - ( const Q3PtrDict<type> & dict ) - - - count - count - () - - - current - current - () - - - currentKey - currentKey - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - - Q3PtrList - q3ptrlist.html - - Q3PtrList - Q3PtrList - () - - - Q3PtrList - Q3PtrList-2 - ( const Q3PtrList<type> & list ) - - - append - append - ( const type * item ) - - - at - at - ( uint index ) - - - at - at-2 - () - - - clear - clear - () - - - compareItems - compareItems - ( Q3PtrCollection::Item item1, Q3PtrCollection::Item item2 ) - - - contains - contains - ( const type * item ) - - - containsRef - containsRef - ( const type * item ) - - - count - count - () - - - current - current - () - - - currentNode - currentNode - () - - - find - find - ( const type * item ) - - - findNext - findNext - ( const type * item ) - - - findNextRef - findNextRef - ( const type * item ) - - - findRef - findRef - ( const type * item ) - - - first - first - () - - - getFirst - getFirst - () - - - getLast - getLast - () - - - inSort - inSort - ( const type * item ) - - - insert - insert - ( uint index, const type * item ) - - - isEmpty - isEmpty - () - - - last - last - () - - - next - next - () - - - prepend - prepend - ( const type * item ) - - - prev - prev - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - ( uint index ) - - - remove - remove-2 - () - - - remove - remove-3 - ( const type * item ) - - - removeFirst - removeFirst - () - - - removeLast - removeLast - () - - - removeNode - removeNode - ( Q3LNode * node ) - - - removeRef - removeRef - ( const type * item ) - - - replace - replace - ( uint index, const type * item ) - - - sort - sort - () - - - take - take - ( uint index ) - - - take - take-2 - () - - - takeNode - takeNode - ( Q3LNode * node ) - - - toVector - toVector - ( Q3GVector * vec ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator!= - operator-not-eq - ( const Q3PtrList<type> & list ) - - - operator= - operator-eq - ( const Q3PtrList<type> & list ) - - - operator== - operator-eq-eq - ( const Q3PtrList<type> & list ) - - - - Q3PtrListIterator - q3ptrlistiterator.html - - Q3PtrListIterator - Q3PtrListIterator - ( const Q3PtrList<type> & list ) - - - atFirst - atFirst - () - - - atLast - atLast - () - - - count - count - () - - - current - current - () - - - isEmpty - isEmpty - () - - - toFirst - toFirst - () - - - toLast - toLast - () - - - operator - operator-type--2a - type *() - - - operator() - operator-28-29 - () - - - operator* - operator-2a - () - - - operator++ - operator-2b-2b - () - - - operator+= - operator-2b-eq - ( uint jump ) - - - operator-- - operator-- - () - - - operator-= - operator--eq - ( uint jump ) - - - operator= - operator-eq - ( const Q3PtrListIterator<type> & it ) - - - - Q3PtrQueue - q3ptrqueue.html - - Q3PtrQueue - Q3PtrQueue - () - - - Q3PtrQueue - Q3PtrQueue-2 - ( const Q3PtrQueue<type> & queue ) - - - autoDelete - autoDelete - () - - - clear - clear - () - - - count - count - () - - - current - current - () - - - dequeue - dequeue - () - - - enqueue - enqueue - ( const type * d ) - - - head - head - () - - - isEmpty - isEmpty - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - () - - - setAutoDelete - setAutoDelete - ( bool enable ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator - operator-type--2a - type *() - - - operator= - operator-eq - ( const Q3PtrQueue<type> & queue ) - - - - Q3PtrStack - q3ptrstack.html - - Q3PtrStack - Q3PtrStack - () - - - Q3PtrStack - Q3PtrStack-2 - ( const Q3PtrStack<type> & s ) - - - autoDelete - autoDelete - () - - - clear - clear - () - - - count - count - () - - - current - current - () - - - isEmpty - isEmpty - () - - - pop - pop - () - - - push - push - ( const type * d ) - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - () - - - setAutoDelete - setAutoDelete - ( bool enable ) - - - top - top - () - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator - operator-type--2a - type *() - - - operator= - operator-eq - ( const Q3PtrStack<type> & s ) - - - - Q3PtrVector - q3ptrvector.html - - Q3PtrVector - Q3PtrVector - () - - - Q3PtrVector - Q3PtrVector-2 - ( uint size ) - - - Q3PtrVector - Q3PtrVector-3 - ( const Q3PtrVector<type> & v ) - - - at - at - ( uint i ) - - - bsearch - bsearch - ( const type * d ) - - - clear - clear - () - - - compareItems - compareItems - ( Q3PtrCollection::Item d1, Q3PtrCollection::Item d2 ) - - - contains - contains - ( const type * d ) - - - containsRef - containsRef - ( const type * d ) - - - count - count - () - - - data - data - () - - - fill - fill - ( const type * d, int size = -1 ) - - - find - find - ( const type * d, uint i = 0 ) - - - findRef - findRef - ( const type * d, uint i = 0 ) - - - insert - insert - ( uint i, const type * d ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - read - read - ( QDataStream & s, Q3PtrCollection::Item & item ) - - - remove - remove - ( uint i ) - - - resize - resize - ( uint size ) - - - size - size - () - - - sort - sort - () - - - take - take - ( uint i ) - - - write - write - ( QDataStream & s, Q3PtrCollection::Item item ) - - - operator= - operator-eq - ( const Q3PtrVector<type> & v ) - - - operator== - operator-eq-eq - ( const Q3PtrVector<type> & v ) - - - operator[] - operator-5b-5d - ( int i ) - - - - Q3RangeControl - q3rangecontrol.html - - Q3RangeControl - Q3RangeControl - () - - - Q3RangeControl - Q3RangeControl-2 - ( int minValue, int maxValue, int lineStep, int pageStep, int value ) - - - addLine - addLine - () - - - addPage - addPage - () - - - bound - bound - ( int v ) - - - directSetValue - directSetValue - ( int value ) - - - lineStep - lineStepx - () - - - maxValue - maxValue - () - - - minValue - minValue - () - - - pageStep - pageStep - () - - - positionFromValue - positionFromValue - ( int logical_val, int span ) - - - prevValue - prevValue - () - - - rangeChange - rangeChange - () - - - setMaxValue - setMaxValue - ( int maxVal ) - - - setMinValue - setMinValue - ( int minVal ) - - - setRange - setRange - ( int minValue, int maxValue ) - - - setSteps - setSteps - ( int lineStep, int pageStep ) - - - setValue - setValue - ( int value ) - - - stepChange - stepChange - () - - - subtractLine - subtractLine - () - - - subtractPage - subtractPage - () - - - value - value - () - - - valueChange - valueChange - () - - - valueFromPosition - valueFromPosition - ( int pos, int span ) - - - - Q3ScrollView - q3scrollview.html - - ResizePolicy - ResizePolicy-enum - - - - ScrollBarMode - ScrollBarMode-enum - - - - Q3ScrollView - Q3ScrollView - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - addChild - addChild - ( QWidget * child, int x = 0, int y = 0 ) - - - bottomMargin - bottomMargin - () - - - center - center - ( int x, int y ) - - - center - center-2 - ( int x, int y, float xmargin, float ymargin ) - - - childX - childX - ( QWidget * child ) - - - childY - childY - ( QWidget * child ) - - - clipper - clipper - () - - - contentsContextMenuEvent - contentsContextMenuEvent - ( QContextMenuEvent * e ) - - - contentsDragEnterEvent - contentsDragEnterEvent - ( QDragEnterEvent * event ) - - - contentsDragLeaveEvent - contentsDragLeaveEvent - ( QDragLeaveEvent * event ) - - - contentsDragMoveEvent - contentsDragMoveEvent - ( QDragMoveEvent * event ) - - - contentsDropEvent - contentsDropEvent - ( QDropEvent * event ) - - - contentsMouseDoubleClickEvent - contentsMouseDoubleClickEvent - ( QMouseEvent * e ) - - - contentsMouseMoveEvent - contentsMouseMoveEvent - ( QMouseEvent * e ) - - - contentsMousePressEvent - contentsMousePressEvent - ( QMouseEvent * e ) - - - contentsMouseReleaseEvent - contentsMouseReleaseEvent - ( QMouseEvent * e ) - - - contentsMoving - contentsMoving - ( int x, int y ) - - - contentsToViewport - contentsToViewport - ( int x, int y, int & vx, int & vy ) - - - contentsToViewport - contentsToViewport-2 - ( const QPoint & p ) - - - contentsWheelEvent - contentsWheelEvent - ( QWheelEvent * e ) - - - cornerWidget - cornerWidget - () - - - drawContents - drawContents - ( QPainter * p, int clipx, int clipy, int clipw, int cliph ) - - - drawContentsOffset - drawContentsOffset - ( QPainter * p, int offsetx, int offsety, int clipx, int clipy, int clipw, int cliph ) - - - enableClipper - enableClipper - ( bool y ) - - - ensureVisible - ensureVisible - ( int x, int y ) - - - ensureVisible - ensureVisible-2 - ( int x, int y, int xmargin, int ymargin ) - - - eventFilter - eventFilter - ( QObject * obj, QEvent * e ) - - - hasStaticBackground - hasStaticBackground - () - - - horizontalScrollBar - horizontalScrollBar - () - - - horizontalSliderPressed - horizontalSliderPressed - () - - - horizontalSliderReleased - horizontalSliderReleased - () - - - isHorizontalSliderPressed - isHorizontalSliderPressed - () - - - isVerticalSliderPressed - isVerticalSliderPressed - () - - - leftMargin - leftMargin - () - - - moveChild - moveChild - ( QWidget * child, int x, int y ) - - - removeChild - removeChild - ( QWidget * child ) - - - repaintContents - repaintContents - ( int x, int y, int w, int h, bool erase = true ) - - - repaintContents - repaintContents-2 - ( const QRect & r, bool erase = true ) - - - repaintContents - repaintContents-3 - ( bool erase = true ) - - - resizeContents - resizeContents - ( int w, int h ) - - - rightMargin - rightMargin - () - - - scrollBy - scrollBy - ( int dx, int dy ) - - - setContentsPos - setContentsPos - ( int x, int y ) - - - setCornerWidget - setCornerWidget - ( QWidget * corner ) - - - setHBarGeometry - setHBarGeometry - ( QScrollBar & hbar, int x, int y, int w, int h ) - - - setMargins - setMargins - ( int left, int top, int right, int bottom ) - - - setStaticBackground - setStaticBackground - ( bool y ) - - - setVBarGeometry - setVBarGeometry - ( QScrollBar & vbar, int x, int y, int w, int h ) - - - topMargin - topMargin - () - - - updateContents - updateContents - ( int x, int y, int w, int h ) - - - updateContents - updateContents-2 - ( const QRect & r ) - - - updateContents - updateContents-3 - () - - - updateScrollBars - updateScrollBars - () - - - verticalScrollBar - verticalScrollBar - () - - - verticalSliderPressed - verticalSliderPressed - () - - - verticalSliderReleased - verticalSliderReleased - () - - - viewport - viewport - () - - - viewportPaintEvent - viewportPaintEvent - ( QPaintEvent * pe ) - - - viewportResizeEvent - viewportResizeEvent - ( QResizeEvent * event ) - - - viewportSize - viewportSize - ( int x, int y ) - - - viewportToContents - viewportToContents - ( int vx, int vy, int & x, int & y ) - - - viewportToContents - viewportToContents-2 - ( const QPoint & vp ) - - - childIsVisible - childIsVisible - ( QWidget * child ) - - - showChild - showChild - ( QWidget * child, bool y = true ) - - - - Q3Semaphore - q3semaphore.html - - Q3Semaphore - Q3Semaphore - ( int maxcount ) - - - available - available - () - - - total - total - () - - - tryAccess - tryAccess - ( int n ) - - - operator++ - operator-2b-2b - ( int ) - - - operator+= - operator-2b-eq - ( int n ) - - - operator-- - operator-- - ( int ) - - - operator-= - operator--eq - ( int n ) - - - - Q3ServerSocket - q3serversocket.html - - Q3ServerSocket - Q3ServerSocket - ( Q_UINT16 port, int backlog = 1, QObject * parent = 0, const char * name = 0 ) - - - Q3ServerSocket - Q3ServerSocket-2 - ( const QHostAddress & address, Q_UINT16 port, int backlog = 1, QObject * parent = 0, const char * name = 0 ) - - - Q3ServerSocket - Q3ServerSocket-3 - ( QObject * parent = 0, const char * name = 0 ) - - - address - address - () - - - newConnection - newConnection - ( int socket ) - - - ok - ok - () - - - port - port - () - - - setSocket - setSocket - ( int socket ) - - - socket - socket - () - - - socketDevice - socketDevice - () - - - - Q3Shared - q3shared.html - - Q3Shared - Q3Shared - () - - - deref - deref - () - - - ref - ref - () - - - - Q3Signal - q3signal.html - - Q3Signal - Q3Signal - ( QObject * parent = 0, const char * name = 0 ) - - - activate - activate - () - - - connect - connect - ( const QObject * receiver, const char * member ) - - - disconnect - disconnect - ( const QObject * receiver, const char * member = 0 ) - - - setValue - setValue - ( const QVariant & value ) - - - value - value - () - - - block - block - ( bool b ) - - - isBlocked - isBlocked - () - - - parameter - parameter - () - - - setParameter - setParameter - ( int value ) - - - - Q3SimpleRichText - q3simplerichtext.html - - Q3SimpleRichText - Q3SimpleRichText - ( const QString & text, const QFont & fnt, const QString & context = QString() - - - Q3SimpleRichText - Q3SimpleRichText-2 - ( const QString & text, const QFont & fnt, const QString & context, const Q3StyleSheet * sheet, const Q3MimeSourceFactory * factory, int pageBreak = -1, const QColor & linkColor = Qt::blue, bool linkUnderline = true ) - - - adjustSize - adjustSize - () - - - anchorAt - anchorAt - ( const QPoint & pos ) - - - context - context - () - - - draw - draw - ( QPainter * p, int x, int y, const QRect & clipRect, const QColorGroup & cg, const QBrush * paper = 0 ) - - - draw - draw-2 - ( QPainter * p, int x, int y, const QRegion & clipRegion, const QColorGroup & cg, const QBrush * paper = 0 ) - - - height - height - () - - - inText - inText - ( const QPoint & pos ) - - - setDefaultFont - setDefaultFont - ( const QFont & f ) - - - setWidth - setWidth - ( QPainter * p, int w ) - - - setWidth - setWidth-2 - ( int w ) - - - width - width - () - - - widthUsed - widthUsed - () - - - - Q3SocketDevice - q3socketdevice.html - - Error - Error-enum - - - - Protocol - Protocol-enum - - - - Type - Type-enum - - - - Q3SocketDevice - Q3SocketDevice - ( Type type = Stream ) - - - Q3SocketDevice - Q3SocketDevice-2 - ( Type type, Protocol protocol, int dummy ) - - - Q3SocketDevice - Q3SocketDevice-3 - ( int socket, Type type ) - - - accept - accept - () - - - address - address - () - - - addressReusable - addressReusable - () - - - at - at - () - - - at - at-2 - ( Offset offset ) - - - bind - bind - ( const QHostAddress & address, Q_UINT16 port ) - - - blocking - blocking - () - - - bytesAvailable - bytesAvailable - () - - - connect - connect - ( const QHostAddress & addr, Q_UINT16 port ) - - - error - error - () - - - flush - flush - () - - - isValid - isValid - () - - - listen - listen - ( int backlog ) - - - open - open - ( int mode ) - - - peerAddress - peerAddress - () - - - peerPort - peerPort - () - - - port - port - () - - - protocol - protocol - () - - - readBlock - readBlock - ( char * data, Q_ULONG maxlen ) - - - readData - readData - ( char * data, qint64 maxlen ) - - - receiveBufferSize - receiveBufferSize - () - - - sendBufferSize - sendBufferSize - () - - - setAddressReusable - setAddressReusable - ( bool enable ) - - - setBlocking - setBlocking - ( bool enable ) - - - setError - setError - ( Error err ) - - - setReceiveBufferSize - setReceiveBufferSize - ( uint size ) - - - setSendBufferSize - setSendBufferSize - ( uint size ) - - - setSocket - setSocket - ( int socket, Type type ) - - - socket - socket - () - - - type - type - () - - - waitForMore - waitForMore - ( int msecs, bool * timeout = 0 ) - - - writeBlock - writeBlock - ( const char * data, Q_ULONG len ) - - - writeBlock - writeBlock-2 - ( const char * data, Q_ULONG len, const QHostAddress & host, Q_UINT16 port ) - - - writeData - writeData - ( const char * data, qint64 len ) - - - - Q3Socket - q3socket.html - - Error - Error-enum - - - - State - State-enum - - - - Q3Socket - Q3Socket - ( QObject * parent = 0, const char * name = 0 ) - - - address - address - () - - - at - at - () - - - at - at-2 - ( Offset index ) - - - atEnd - atEnd - () - - - bytesAvailable - bytesAvailable - () - - - bytesToWrite - bytesToWrite - () - - - bytesWritten - bytesWritten - ( int nbytes ) - - - canReadLine - canReadLine - () - - - clearPendingData - clearPendingData - () - - - close - close - () - - - connectToHost - connectToHost - ( const QString & host, Q_UINT16 port ) - - - connected - connected - () - - - connectionClosed - connectionClosed - () - - - delayedCloseFinished - delayedCloseFinished - () - - - error - error - ( int error ) - - - flush - flush - () - - - getch - getch - () - - - hostFound - hostFound - () - - - open - open - ( int m ) - - - peerAddress - peerAddress - () - - - peerName - peerName - () - - - peerPort - peerPort - () - - - port - port - () - - - putch - putch - ( int ch ) - - - readBufferSize - readBufferSize - () - - - readData - readData - ( char * data, qint64 maxlen ) - - - readyRead - readyRead - () - - - setReadBufferSize - setReadBufferSize - ( Q_ULONG bufSize ) - - - setSocket - setSocket - ( int socket ) - - - setSocketDevice - setSocketDevice - ( Q3SocketDevice * device ) - - - size - size - () - - - socket - socket - () - - - socketDevice - socketDevice - () - - - state - state - () - - - ungetch - ungetch - ( int ch ) - - - waitForMore - waitForMore - ( int msecs, bool * timeout ) - - - waitForMore - waitForMore-2 - ( int msecs ) - - - writeData - writeData - ( const char * data, qint64 len ) - - - - Q3SqlCursor - q3sqlcursor.html - - Mode - Mode-enum - - - - Q3SqlCursor - Q3SqlCursor - ( const QString & name = QString() - - - Q3SqlCursor - Q3SqlCursor-2 - ( const Q3SqlCursor & other ) - - - append - append - ( const Q3SqlFieldInfo & fieldInfo ) - - - calculateField - calculateField - ( const QString & name ) - - - canDelete - canDelete - () - - - canInsert - canInsert - () - - - canUpdate - canUpdate - () - - - clear - clear - () - - - del - del - ( bool invalidate = true ) - - - del - del-2 - ( const QString & filter, bool invalidate = true ) - - - editBuffer - editBuffer - ( bool copy = false ) - - - exec - exec - ( const QString & sql ) - - - filter - filter - () - - - index - index - ( const QStringList & fieldNames ) - - - index - index-2 - ( const QString & fieldName ) - - - insert - insert - ( int pos, const Q3SqlFieldInfo & fieldInfo ) - - - insert - insert-2 - ( bool invalidate = true ) - - - isCalculated - isCalculated - ( const QString & name ) - - - isNull - isNull - ( int i ) - - - isNull - isNull-2 - ( const QString & name ) - - - isReadOnly - isReadOnly - () - - - isTrimmed - isTrimmed - ( const QString & name ) - - - mode - mode - () - - - name - name - () - - - primaryIndex - primaryIndex - ( bool setFromCursor = true ) - - - primeDelete - primeDelete - () - - - primeInsert - primeInsert - () - - - primeUpdate - primeUpdate - () - - - remove - remove - ( int pos ) - - - select - select - ( const QString & filter, const QSqlIndex & sort = QSqlIndex() - - - select - select-2 - () - - - select - select-3 - ( const QSqlIndex & sort ) - - - select - select-4 - ( const QSqlIndex & filter, const QSqlIndex & sort ) - - - setCalculated - setCalculated - ( const QString & name, bool calculated ) - - - setFilter - setFilter - ( const QString & filter ) - - - setGenerated - setGenerated - ( const QString & name, bool generated ) - - - setGenerated - setGenerated-2 - ( int i, bool generated ) - - - setMode - setMode - ( int mode ) - - - setName - setName - ( const QString & name, bool autopopulate = true ) - - - setPrimaryIndex - setPrimaryIndex - ( const QSqlIndex & idx ) - - - setSort - setSort - ( const QSqlIndex & sort ) - - - setTrimmed - setTrimmed - ( const QString & name, bool trim ) - - - setValue - setValue-2 - ( const QString & name, const QVariant & val ) - - - sort - sort - () - - - toString - toString-2 - ( QSqlRecord * rec, const QString & prefix, const QString & fieldSep, const QString & sep ) - - - toString - toString-3 - ( const QString & prefix, QSqlField * field, const QString & fieldSep ) - - - toString - toString-4 - ( const QSqlIndex & i, QSqlRecord * rec, const QString & prefix, const QString & fieldSep, const QString & sep ) - - - update - update - ( bool invalidate = true ) - - - update - update-2 - ( const QString & filter, bool invalidate = true ) - - - value - value - ( int i ) - - - value - value-2 - ( const QString & name ) - - - operator= - operator-eq - ( const Q3SqlCursor & other ) - - - - Q3SqlEditorFactory - q3sqleditorfactory.html - - Q3SqlEditorFactory - Q3SqlEditorFactory - ( QObject * parent = 0 ) - - - createEditor - createEditor - ( QWidget * parent, const QVariant & variant ) - - - createEditor - createEditor-2 - ( QWidget * parent, const QSqlField * field ) - - - defaultFactory - defaultFactory - () - - - installDefaultFactory - installDefaultFactory - ( Q3SqlEditorFactory * factory ) - - - - Q3SqlFieldInfo - q3sqlfieldinfo.html - - Q3SqlFieldInfo - Q3SqlFieldInfo - ( const QString & name = QString() - - - Q3SqlFieldInfo - Q3SqlFieldInfo-2 - ( const QSqlField & other ) - - - defaultValue - defaultValue - () - - - isCalculated - isCalculated - () - - - isGenerated - isGenerated - () - - - isRequired - isRequired - () - - - isTrim - isTrim - () - - - length - length - () - - - name - name - () - - - precision - precision - () - - - setCalculated - setCalculated - ( bool calculated ) - - - setGenerated - setGenerated - ( bool generated ) - - - setTrim - setTrim - ( bool trim ) - - - toField - toField - () - - - Type - type - Q3SqlFieldInfo::type() - - - typeID - typeID - () - - - operator== - operator-eq-eq - ( const Q3SqlFieldInfo & other ) - - - - Q3SqlForm - q3sqlform.html - - Q3SqlForm - Q3SqlForm - ( QObject * parent = 0 ) - - - clear - clear - () - - - clearValues - clearValues - () - - - count - count - () - - - fieldToWidget - fieldToWidget - ( QSqlField * field ) - - - insert - insert - ( QWidget * widget, const QString & field ) - - - insert - insert-2 - ( QWidget * widget, QSqlField * field ) - - - installPropertyMap - installPropertyMap - ( Q3SqlPropertyMap * pmap ) - - - readField - readField - ( QWidget * widget ) - - - readFields - readFields - () - - - remove - remove - ( QWidget * widget ) - - - remove - remove-2 - ( const QString & field ) - - - setRecord - setRecord - ( QSqlRecord * buf ) - - - widget - widget - ( int i ) - - - widgetToField - widgetToField - ( QWidget * widget ) - - - writeField - writeField - ( QWidget * widget ) - - - writeFields - writeFields - () - - - - Q3SqlPropertyMap - q3sqlpropertymap.html - - Q3SqlPropertyMap - Q3SqlPropertyMap - () - - - defaultMap - defaultMap - () - - - insert - insert - ( const QString & classname, const QString & property ) - - - installDefaultMap - installDefaultMap - ( Q3SqlPropertyMap * map ) - - - property - property - ( QWidget * widget ) - - - remove - remove - ( const QString & classname ) - - - setProperty - setProperty - ( QWidget * widget, const QVariant & value ) - - - - Q3SqlRecordInfo - q3sqlrecordinfo.html - - Q3SqlRecordInfo - Q3SqlRecordInfo - () - - - Q3SqlRecordInfo - Q3SqlRecordInfo-2 - ( const Q3SqlFieldInfoList & other ) - - - Q3SqlRecordInfo - Q3SqlRecordInfo-3 - ( const QSqlRecord & other ) - - - contains - contains - ( const QString & fieldName ) - - - find - find - ( const QString & fieldName ) - - - toRecord - toRecord - () - - - - Q3SqlSelectCursor - q3sqlselectcursor.html - - Q3SqlSelectCursor - Q3SqlSelectCursor - ( const QString & query = QString() - - - Q3SqlSelectCursor - Q3SqlSelectCursor-2 - ( const Q3SqlSelectCursor & other ) - - - - Q3StoredDrag - q3storeddrag.html - - Q3StoredDrag - Q3StoredDrag - ( const char * mimeType, QWidget * dragSource = 0, const char * name = 0 ) - - - encodedData - encodedData - ( const char * format ) - - - setEncodedData - setEncodedData - ( const QByteArray & data ) - - - - Q3StrIList - q3strilist.html - - Q3StrIList - Q3StrIList - ( bool deepCopies = true ) - - - - Q3StrList - q3strlist.html - - Q3StrList - Q3StrList - ( bool deepCopies = true ) - - - Q3StrList - Q3StrList-2 - ( const Q3StrList & list ) - - - Q3StrList - Q3StrList-3 - ( const QList<QByteArray> & list ) - - - operator - operator-QList-ltQByteArray-gt - QList<QByteArray>() - - - operator= - operator-eq - ( const Q3StrList & list ) - - - operator= - operator-eq-2 - ( const QList<QByteArray> & list ) - - - - Q3StrListIterator - q3strlistiterator.html - - - Q3StyleSheet - q3stylesheet.html - - Q3StyleSheet - Q3StyleSheet - ( QObject * parent = 0, const char * name = 0 ) - - - convertFromPlainText - convertFromPlainText - ( const QString & plain, Q3StyleSheetItem::WhiteSpaceMode mode = Q3StyleSheetItem::WhiteSpacePre ) - - - defaultSheet - defaultSheet - () - - - error - error - ( const QString & msg ) - - - escape - escape - ( const QString & plain ) - - - item - item - ( const QString & name ) - - - item - item-2 - ( const QString & name ) - - - mightBeRichText - mightBeRichText - ( const QString & text ) - - - scaleFont - scaleFont - ( QFont & font, int logicalSize ) - - - setDefaultSheet - setDefaultSheet - ( Q3StyleSheet * sheet ) - - - - Q3StyleSheetItem - q3stylesheetitem.html - - DisplayMode - DisplayMode-enum - - - - ListStyle - ListStyle-enum - - - - Margin - Margin-enum - - - - VerticalAlignment - VerticalAlignment-enum - - - - WhiteSpaceMode - WhiteSpaceMode-enum - - - - Q3StyleSheetItem - Q3StyleSheetItem - ( Q3StyleSheet * parent, const QString & name ) - - - Q3StyleSheetItem - Q3StyleSheetItem-2 - ( const Q3StyleSheetItem & other ) - - - alignment - alignment - () - - - allowedInContext - allowedInContext - ( const Q3StyleSheetItem * s ) - - - color - color - () - - - contexts - contexts - () - - - definesFontItalic - definesFontItalic - () - - - definesFontStrikeOut - definesFontStrikeOut - () - - - definesFontUnderline - definesFontUnderline - () - - - displayMode - displayMode - () - - - fontFamily - fontFamily - () - - - fontItalic - fontItalic - () - - - fontSize - fontSize - () - - - fontStrikeOut - fontStrikeOut - () - - - fontUnderline - fontUnderline - () - - - fontWeight - fontWeight - () - - - isAnchor - isAnchor - () - - - lineSpacing - lineSpacing - () - - - listStyle - listStyle - () - - - logicalFontSize - logicalFontSize - () - - - logicalFontSizeStep - logicalFontSizeStep - () - - - margin - margin - ( Margin m ) - - - name - name - () - - - numberOfColumns - numberOfColumns - () - - - selfNesting - selfNesting - () - - - setAlignment - setAlignment - ( int f ) - - - setAnchor - setAnchor - ( bool anc ) - - - setColor - setColor - ( const QColor & c ) - - - setContexts - setContexts - ( const QString & c ) - - - setDisplayMode - setDisplayMode - ( DisplayMode m ) - - - setFontFamily - setFontFamily - ( const QString & fam ) - - - setFontItalic - setFontItalic - ( bool italic ) - - - setFontSize - setFontSize - ( int s ) - - - setFontStrikeOut - setFontStrikeOut - ( bool strikeOut ) - - - setFontUnderline - setFontUnderline - ( bool underline ) - - - setFontWeight - setFontWeight - ( int w ) - - - setListStyle - setListStyle - ( ListStyle s ) - - - setLogicalFontSize - setLogicalFontSize - ( int s ) - - - setLogicalFontSizeStep - setLogicalFontSizeStep - ( int s ) - - - setMargin - setMargin - ( Margin m, int v ) - - - setNumberOfColumns - setNumberOfColumns - ( int ncols ) - - - setSelfNesting - setSelfNesting - ( bool nesting ) - - - setVerticalAlignment - setVerticalAlignment - ( VerticalAlignment valign ) - - - setWhiteSpaceMode - setWhiteSpaceMode - ( WhiteSpaceMode m ) - - - styleSheet - styleSheet - () - - - styleSheet - styleSheet-2 - () - - - verticalAlignment - verticalAlignment - () - - - whiteSpaceMode - whiteSpaceMode - () - - - operator= - operator-eq - ( const Q3StyleSheetItem & other ) - - - - Q3SyntaxHighlighter - q3syntaxhighlighter.html - - Q3SyntaxHighlighter - Q3SyntaxHighlighter - ( Q3TextEdit * textEdit ) - - - currentParagraph - currentParagraph - () - - - highlightParagraph - highlightParagraph - ( const QString & text, int endStateOfLastPara ) - - - rehighlight - rehighlight - () - - - setFormat - setFormat - ( int start, int count, const QFont & font, const QColor & color ) - - - setFormat - setFormat-2 - ( int start, int count, const QColor & color ) - - - setFormat - setFormat-3 - ( int start, int count, const QFont & font ) - - - textEdit - textEdit - () - - - - Q3TabDialog - q3tabdialog.html - - Q3TabDialog - Q3TabDialog - ( QWidget * parent = 0, const char * name = 0, bool modal = false, Qt::WFlags f = 0 ) - - - aboutToShow - aboutToShow - () - - - addTab - addTab - ( QWidget * child, const QString & label ) - - - addTab - addTab-2 - ( QWidget * child, const QIcon & iconset, const QString & label ) - - - applyButtonPressed - applyButtonPressed - () - - - cancelButtonPressed - cancelButtonPressed - () - - - changeTab - changeTab - ( QWidget * w, const QIcon & iconset, const QString & label ) - - - changeTab - changeTab-2 - ( QWidget * w, const QString & label ) - - - currentChanged - currentChanged - ( QWidget * widget ) - - - currentPage - currentPage - () - - - defaultButtonPressed - defaultButtonPressed - () - - - hasApplyButton - hasApplyButton - () - - - hasCancelButton - hasCancelButton - () - - - hasDefaultButton - hasDefaultButton - () - - - hasHelpButton - hasHelpButton - () - - - hasOkButton - hasOkButton - () - - - helpButtonPressed - helpButtonPressed - () - - - insertTab - insertTab - ( QWidget * child, const QString & label, int index = -1 ) - - - insertTab - insertTab-2 - ( QWidget * child, const QIcon & iconset, const QString & label, int index = -1 ) - - - isTabEnabled - isTabEnabled - ( QWidget * w ) - - - removePage - removePage - ( QWidget * w ) - - - selected - selected - ( const QString & name ) - - - setApplyButton - setApplyButton - ( const QString & text ) - - - setApplyButton - setApplyButton-2 - () - - - setCancelButton - setCancelButton - ( const QString & text ) - - - setCancelButton - setCancelButton-2 - () - - - setDefaultButton - setDefaultButton - ( const QString & text ) - - - setDefaultButton - setDefaultButton-2 - () - - - setFont - setFont - ( const QFont & font ) - - - setHelpButton - setHelpButton - ( const QString & text ) - - - setHelpButton - setHelpButton-2 - () - - - setOkButton - setOkButton - ( const QString & text ) - - - setOkButton - setOkButton-2 - () - - - setTabBar - setTabBar - ( QTabBar * tb ) - - - setTabEnabled - setTabEnabled - ( QWidget * w, bool enable ) - - - showPage - showPage - ( QWidget * w ) - - - tabBar - tabBar - () - - - tabLabel - tabLabel - ( QWidget * w ) - - - isTabEnabled - isTabEnabled-2 - ( const char * name ) - - - setTabEnabled - setTabEnabled-2 - ( const char * name, bool enable ) - - - - Q3Table - q3table.html - - EditMode - EditMode-enum - - - - FocusStyle - FocusStyle-enum - - - - SelectionMode - SelectionMode-enum - - - - Q3Table - Q3Table - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3Table - Q3Table-2 - ( int numRows, int numCols, QWidget * parent = 0, const char * name = 0 ) - - - activateNextCell - activateNextCell - () - - - addSelection - addSelection - ( const Q3TableSelection & s ) - - - adjustColumn - adjustColumn - ( int col ) - - - adjustRow - adjustRow - ( int row ) - - - beginEdit - beginEdit - ( int row, int col, bool replace ) - - - cellGeometry - cellGeometry - ( int row, int col ) - - - cellRect - cellRect - ( int row, int col ) - - - cellWidget - cellWidget - ( int row, int col ) - - - clearCell - clearCell - ( int row, int col ) - - - clearCellWidget - clearCellWidget - ( int row, int col ) - - - clearSelection - clearSelection - ( bool repaint = true ) - - - clicked - clicked - ( int row, int col, int button, const QPoint & mousePos ) - - - columnAt - columnAt - ( int x ) - - - columnClicked - columnClicked - ( int col ) - - - columnIndexChanged - columnIndexChanged - ( int section, int fromIndex, int toIndex ) - - - columnPos - columnPos - ( int col ) - - - columnWidth - columnWidth - ( int col ) - - - columnWidthChanged - columnWidthChanged - ( int col ) - - - contentsDragEnterEvent - contentsDragEnterEvent - ( QDragEnterEvent * e ) - - - contentsDragLeaveEvent - contentsDragLeaveEvent - ( QDragLeaveEvent * e ) - - - contentsDragMoveEvent - contentsDragMoveEvent - ( QDragMoveEvent * e ) - - - contentsDropEvent - contentsDropEvent - ( QDropEvent * e ) - - - contextMenuRequested - contextMenuRequested - ( int row, int col, const QPoint & pos ) - - - createEditor - createEditor - ( int row, int col, bool initFromCell ) - - - currEditCol - currEditCol - () - - - currEditRow - currEditRow - () - - - currentChanged - currentChanged - ( int row, int col ) - - - currentColumn - currentColumn - () - - - currentRow - currentRow - () - - - currentSelection - currentSelection - () - - - doubleClicked - doubleClicked - ( int row, int col, int button, const QPoint & mousePos ) - - - dragEnabled - dragEnabled - () - - - dragObject - dragObject - () - - - drawContents - drawContents - ( QPainter * p, int cx, int cy, int cw, int ch ) - - - dropped - dropped - ( QDropEvent * e ) - - - editCell - editCell - ( int row, int col, bool replace = false ) - - - editMode - editMode - () - - - endEdit - endEdit - ( int row, int col, bool accept, bool replace ) - - - ensureCellVisible - ensureCellVisible - ( int row, int col ) - - - hideColumn - hideColumn - ( int col ) - - - hideRow - hideRow - ( int row ) - - - horizontalHeader - horizontalHeader - () - - - indexOf - indexOf - ( int row, int col ) - - - insertColumns - insertColumns - ( int col, int count = 1 ) - - - insertRows - insertRows - ( int row, int count = 1 ) - - - insertWidget - insertWidget - ( int row, int col, QWidget * w ) - - - isColumnHidden - isColumnHidden - ( int col ) - - - isColumnReadOnly - isColumnReadOnly - ( int col ) - - - isColumnSelected - isColumnSelected - ( int col, bool full = false ) - - - isColumnStretchable - isColumnStretchable - ( int col ) - - - isEditing - isEditing - () - - - isRowHidden - isRowHidden - ( int row ) - - - isRowReadOnly - isRowReadOnly - ( int row ) - - - isRowSelected - isRowSelected - ( int row, bool full = false ) - - - isRowStretchable - isRowStretchable - ( int row ) - - - isSelected - isSelected - ( int row, int col ) - - - item - item - ( int row, int col ) - - - paintCell - paintCell - ( QPainter * p, int row, int col, const QRect & cr, bool selected, const QColorGroup & cg ) - - - paintCell - paintCell-2 - ( QPainter * p, int row, int col, const QRect & cr, bool selected ) - - - paintEmptyArea - paintEmptyArea - ( QPainter * p, int cx, int cy, int cw, int ch ) - - - paintFocus - paintFocus - ( QPainter * p, const QRect & cr ) - - - pixmap - pixmap - ( int row, int col ) - - - pressed - pressed - ( int row, int col, int button, const QPoint & mousePos ) - - - removeColumn - removeColumn - ( int col ) - - - removeColumns - removeColumns - ( const Q3MemArray<int> & cols ) - - - removeRow - removeRow - ( int row ) - - - removeRows - removeRows - ( const Q3MemArray<int> & rows ) - - - removeSelection - removeSelection - ( const Q3TableSelection & s ) - - - removeSelection - removeSelection-2 - ( int num ) - - - repaintSelections - repaintSelections - () - - - resizeData - resizeData - ( int len ) - - - rowAt - rowAt - ( int y ) - - - rowHeight - rowHeight - ( int row ) - - - rowHeightChanged - rowHeightChanged - ( int row ) - - - rowIndexChanged - rowIndexChanged - ( int section, int fromIndex, int toIndex ) - - - rowPos - rowPos - ( int row ) - - - selectCells - selectCells - ( int start_row, int start_col, int end_row, int end_col ) - - - selectColumn - selectColumn - ( int col ) - - - selectRow - selectRow - ( int row ) - - - selection - selection - ( int num ) - - - selectionChanged - selectionChanged - () - - - setCellContentFromEditor - setCellContentFromEditor - ( int row, int col ) - - - setCellWidget - setCellWidget - ( int row, int col, QWidget * e ) - - - setColumnLabels - setColumnLabels - ( const QStringList & labels ) - - - setColumnReadOnly - setColumnReadOnly - ( int col, bool ro ) - - - setColumnStretchable - setColumnStretchable - ( int col, bool stretch ) - - - setColumnWidth - setColumnWidth - ( int col, int w ) - - - setCurrentCell - setCurrentCell - ( int row, int col ) - - - setDragEnabled - setDragEnabled - ( bool b ) - - - setEditMode - setEditMode - ( EditMode mode, int row, int col ) - - - setItem - setItem - ( int row, int col, Q3TableItem * item ) - - - setLeftMargin - setLeftMargin - ( int m ) - - - setPixmap - setPixmap - ( int row, int col, const QPixmap & pix ) - - - setRowHeight - setRowHeight - ( int row, int h ) - - - setRowLabels - setRowLabels - ( const QStringList & labels ) - - - setRowReadOnly - setRowReadOnly - ( int row, bool ro ) - - - setRowStretchable - setRowStretchable - ( int row, bool stretch ) - - - setText - setText - ( int row, int col, const QString & text ) - - - setTopMargin - setTopMargin - ( int m ) - - - showColumn - showColumn - ( int col ) - - - showRow - showRow - ( int row ) - - - sortColumn - sortColumn - ( int col, bool ascending = true, bool wholeRows = false ) - - - startDrag - startDrag - () - - - swapCells - swapCells - ( int row1, int col1, int row2, int col2 ) - - - swapColumns - swapColumns - ( int col1, int col2, bool swapHeader = false ) - - - swapRows - swapRows - ( int row1, int row2, bool swapHeader = false ) - - - takeItem - takeItem - ( Q3TableItem * i ) - - - text - text - ( int row, int col ) - - - updateCell - updateCell - ( int row, int col ) - - - updateHeaderStates - updateHeaderStates - () - - - valueChanged - valueChanged - ( int row, int col ) - - - verticalHeader - verticalHeader - () - - - - Q3TableItem - q3tableitem.html - - EditType - EditType-enum - - - - Q3TableItem - Q3TableItem - ( Q3Table * table, EditType et ) - - - Q3TableItem - Q3TableItem-2 - ( Q3Table * table, EditType et, const QString & text ) - - - Q3TableItem - Q3TableItem-3 - ( Q3Table * table, EditType et, const QString & text, const QPixmap & p ) - - - alignment - alignment - () - - - col - col - () - - - colSpan - colSpan - () - - - createEditor - createEditor - () - - - editType - editType - () - - - isEnabled - isEnabled - () - - - isReplaceable - isReplaceable - () - - - key - key - () - - - paint - paint - ( QPainter * p, const QColorGroup & cg, const QRect & cr, bool selected ) - - - pixmap - pixmap - () - - - row - row - () - - - rowSpan - rowSpan - () - - - rtti - rtti - () - - - setCol - setCol - ( int c ) - - - setContentFromEditor - setContentFromEditor - ( QWidget * w ) - - - setEnabled - setEnabled - ( bool b ) - - - setPixmap - setPixmap - ( const QPixmap & p ) - - - setReplaceable - setReplaceable - ( bool b ) - - - setRow - setRow - ( int r ) - - - setSpan - setSpan - ( int rs, int cs ) - - - setText - setText - ( const QString & str ) - - - setWordWrap - setWordWrap - ( bool b ) - - - sizeHint - sizeHint - () - - - table - table - () - - - text - text - () - - - wordWrap - wordWrap - () - - - - Q3TableSelection - q3tableselection.html - - Q3TableSelection - Q3TableSelection - () - - - Q3TableSelection - Q3TableSelection-2 - ( int start_row, int start_col, int end_row, int end_col ) - - - anchorCol - anchorCol - () - - - anchorRow - anchorRow - () - - - bottomRow - bottomRow - () - - - expandTo - expandTo - ( int row, int col ) - - - init - init - ( int row, int col ) - - - isActive - isActive - () - - - isEmpty - isEmpty - () - - - leftCol - leftCol - () - - - numCols - numCols - () - - - numRows - numRows - () - - - rightCol - rightCol - () - - - topRow - topRow - () - - - operator!= - operator-not-eq - ( const Q3TableSelection & s ) - - - operator== - operator-eq-eq - ( const Q3TableSelection & s ) - - - - Q3TextBrowser - q3textbrowser.html - - Q3TextBrowser - Q3TextBrowser - ( QWidget * parent = 0, const char * name = 0 ) - - - anchorClicked - anchorClicked - ( const QString & name, const QString & link ) - - - backward - backward - () - - - backwardAvailable - backwardAvailable - ( bool available ) - - - forward - forward - () - - - forwardAvailable - forwardAvailable - ( bool available ) - - - highlighted - highlighted - ( const QString & link ) - - - home - home - () - - - keyPressEvent - keyPressEvent - ( QKeyEvent * e ) - - - linkClicked - linkClicked - ( const QString & link ) - - - reload - reload - () - - - setText - setText-2 - ( const QString & txt ) - - - sourceChanged - sourceChanged - ( const QString & src ) - - - - Q3TextDrag - q3textdrag.html - - Q3TextDrag - Q3TextDrag - ( const QString & text, QWidget * dragSource = 0, const char * name = 0 ) - - - Q3TextDrag - Q3TextDrag-2 - ( QWidget * dragSource = 0, const char * name = 0 ) - - - canDecode - canDecode - ( const QMimeSource * source ) - - - decode - decode - ( const QMimeSource * source, QString & string ) - - - decode - decode-2 - ( const QMimeSource * source, QString & string, QString & subtype ) - - - setSubtype - setSubtype - ( const QString & subtype ) - - - setText - setText - ( const QString & text ) - - - - Q3TextEdit - q3textedit.html - - CursorAction - CursorAction-enum - - - - KeyboardAction - KeyboardAction-enum - - - - VerticalAlignment - VerticalAlignment-enum - - - - WordWrap - WordWrap-enum - - - - WrapPolicy - WrapPolicy-enum - - - - TextFormat - textFormat-prop - - - - Q3TextEdit - Q3TextEdit - ( const QString & text, const QString & context = QString() - - - Q3TextEdit - Q3TextEdit-2 - ( QWidget * parent = 0, const char * name = 0 ) - - - alignment - alignment - () - - - anchorAt - anchorAt - ( const QPoint & pos, Qt::AnchorAttribute attr = Qt::AnchorHref ) - - - append - append - ( const QString & text ) - - - bold - bold - () - - - charAt - charAt - ( const QPoint & pos, int * para ) - - - clear - clear - () - - - clearParagraphBackground - clearParagraphBackground - ( int para ) - - - clicked - clicked - ( int para, int pos ) - - - color - color - () - - - context - context - () - - - copy - copy - () - - - copyAvailable - copyAvailable - ( bool yes ) - - - createPopupMenu - createPopupMenu - ( const QPoint & pos ) - - - createPopupMenu - createPopupMenu-2 - () - - - currentAlignmentChanged - currentAlignmentChanged - ( int a ) - - - currentColorChanged - currentColorChanged - ( const QColor & c ) - - - currentFont - currentFont - () - - - currentFontChanged - currentFontChanged - ( const QFont & f ) - - - currentVerticalAlignmentChanged - currentVerticalAlignmentChanged - ( Q3TextEdit::VerticalAlignment a ) - - - cursorPositionChanged - cursorPositionChanged-2 - ( int para, int pos ) - - - cut - cut - () - - - del - del - () - - - doKeyboardAction - doKeyboardAction - ( Q3TextEdit::KeyboardAction action ) - - - doubleClicked - doubleClicked - ( int para, int pos ) - - - ensureCursorVisible - ensureCursorVisible - () - - - family - family - () - - - find - find - ( const QString & expr, bool cs, bool wo, bool forward = true, int * para = 0, int * index = 0 ) - - - focusNextPrevChild - focusNextPrevChild - ( bool n ) - - - font - font - () - - - getCursorPosition - getCursorPosition - ( int * para, int * index ) - - - getSelection - getSelection - ( int * paraFrom, int * indexFrom, int * paraTo, int * indexTo, int selNum = 0 ) - - - heightForWidth - heightForWidth - ( int w ) - - - insert - insert - ( const QString & text, uint insertionFlags = CheckNewLines | RemoveSelected ) - - - insert - insert-2 - ( const QString & text, bool indent, bool checkNewLine = true, bool removeSelected = true ) - - - insertAt - insertAt - ( const QString & text, int para, int index ) - - - insertParagraph - insertParagraph - ( const QString & text, int para ) - - - isRedoAvailable - isRedoAvailable - () - - - isUndoAvailable - isUndoAvailable - () - - - italic - italic - () - - - keyPressEvent - keyPressEvent - ( QKeyEvent * e ) - - - lineOfChar - lineOfChar - ( int para, int index ) - - - lines - lines - () - - - linesOfParagraph - linesOfParagraph - ( int para ) - - - mimeSourceFactory - mimeSourceFactory - () - - - modificationChanged - modificationChanged - ( bool m ) - - - moveCursor - moveCursor - ( Q3TextEdit::CursorAction action, bool select ) - - - paragraphAt - paragraphAt - ( const QPoint & pos ) - - - paragraphBackgroundColor - paragraphBackgroundColor - ( int para ) - - - paragraphLength - paragraphLength - ( int para ) - - - paragraphRect - paragraphRect - ( int para ) - - - paragraphs - paragraphs - () - - - paste - paste - () - - - pasteSubType - pasteSubType - ( const QByteArray & subtype ) - - - placeCursor - placeCursor - ( const QPoint & pos, Q3TextCursor * c = 0 ) - - - pointSize - pointSize - () - - - redo - redo - () - - - redoAvailable - redoAvailable - ( bool yes ) - - - removeParagraph - removeParagraph - ( int para ) - - - removeSelectedText - removeSelectedText - ( int selNum = 0 ) - - - removeSelection - removeSelection - ( int selNum = 0 ) - - - repaintChanged - repaintChanged - () - - - returnPressed - returnPressed - () - - - scrollToAnchor - scrollToAnchor - ( const QString & name ) - - - scrollToBottom - scrollToBottom - () - - - selectAll - selectAll - ( bool select = true ) - - - selectionChanged - selectionChanged - () - - - setAlignment - setAlignment - ( int a ) - - - setBold - setBold - ( bool b ) - - - setColor - setColor - ( const QColor & c ) - - - setCurrentFont - setCurrentFont - ( const QFont & f ) - - - setCursorPosition - setCursorPosition - ( int para, int index ) - - - setFamily - setFamily - ( const QString & fontFamily ) - - - setItalic - setItalic - ( bool b ) - - - setMimeSourceFactory - setMimeSourceFactory - ( Q3MimeSourceFactory * factory ) - - - setParagraphBackgroundColor - setParagraphBackgroundColor - ( int para, const QColor & bg ) - - - setPointSize - setPointSize - ( int s ) - - - setSelection - setSelection - ( int paraFrom, int indexFrom, int paraTo, int indexTo, int selNum = 0 ) - - - setSelectionAttributes - setSelectionAttributes - ( int selNum, const QColor & back, bool invertText ) - - - setStyleSheet - setStyleSheet - ( Q3StyleSheet * styleSheet ) - - - setUnderline - setUnderline - ( bool b ) - - - setVerticalAlignment - setVerticalAlignment - ( Q3TextEdit::VerticalAlignment a ) - - - styleSheet - styleSheet - () - - - sync - sync - () - - - syntaxHighlighter - syntaxHighlighter - () - - - textChanged - textChanged - () - - - textCursor - textCursor - () - - - underline - underline - () - - - undo - undo - () - - - undoAvailable - undoAvailable - ( bool yes ) - - - verticalAlignment - verticalAlignment - () - - - zoomIn - zoomIn - ( int range ) - - - zoomIn - zoomIn-2 - () - - - zoomOut - zoomOut - ( int range ) - - - zoomOut - zoomOut-2 - () - - - zoomTo - zoomTo - ( int size ) - - - - Q3TextView - q3textview.html - - - Q3TimeEdit - q3timeedit.html - - Display - Display-enum - - - - Q3TimeEdit - Q3TimeEdit - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3TimeEdit - Q3TimeEdit-2 - ( const QTime & time, QWidget * parent = 0, const char * name = 0 ) - - - sectionFormattedText - sectionFormattedText - ( int sec ) - - - separator - separator - () - - - setHour - setHour - ( int h ) - - - setMinute - setMinute - ( int m ) - - - setRange - setRange - ( const QTime & min, const QTime & max ) - - - setSecond - setSecond - ( int s ) - - - setSeparator - setSeparator - ( const QString & s ) - - - valueChanged - valueChanged - ( const QTime & time ) - - - - Q3ToolBar - q3toolbar.html - - Q3ToolBar - Q3ToolBar - ( const QString & label, Q3MainWindow * parent, Qt::ToolBarDock dock = Qt::DockTop, bool newLine = false, const char * name = 0 ) - - - Q3ToolBar - Q3ToolBar-2 - ( const QString & label, Q3MainWindow * mainWindow, QWidget * parent, bool newLine = false, const char * name = 0, Qt::WFlags f = 0 ) - - - Q3ToolBar - Q3ToolBar-3 - ( Q3MainWindow * parent = 0, const char * name = 0 ) - - - addSeparator - addSeparator - () - - - clear - clear - () - - - mainWindow - mainWindow - () - - - setStretchableWidget - setStretchableWidget - ( QWidget * w ) - - - - Q3UriDrag - q3uridrag.html - - Q3UriDrag - Q3UriDrag - ( const Q3StrList & uris, QWidget * dragSource = 0, const char * name = 0 ) - - - Q3UriDrag - Q3UriDrag-2 - ( QWidget * dragSource = 0, const char * name = 0 ) - - - canDecode - canDecode - ( const QMimeSource * source ) - - - decode - decode - ( const QMimeSource * source, Q3StrList & list ) - - - decodeLocalFiles - decodeLocalFiles - ( const QMimeSource * source, QStringList & list ) - - - decodeToUnicodeUris - decodeToUnicodeUris - ( const QMimeSource * source, QStringList & list ) - - - localFileToUri - localFileToUri - ( const QString & filename ) - - - setFileNames - setFileNames - ( const QStringList & filenames ) - - - setFileNames - setFileNames-2 - ( const QString & name ) - - - setFilenames - setFilenames-2x - ( const QString & name ) - - - setUnicodeUris - setUnicodeUris - ( const QStringList & list ) - - - setUris - setUris - ( const QList<QByteArray> & list ) - - - unicodeUriToUri - unicodeUriToUri - ( const QString & string ) - - - uriToLocalFile - uriToLocalFile - ( const char * string ) - - - uriToUnicodeUri - uriToUnicodeUri - ( const char * string ) - - - setFilenames - setFilenamesx - ( const QStringList & list ) - - - - Q3Url - q3url.html - - Q3Url - Q3Url - () - - - Q3Url - Q3Url-2 - ( const QString & url ) - - - Q3Url - Q3Url-3 - ( const Q3Url & url ) - - - Q3Url - Q3Url-4 - ( const Q3Url & url, const QString & relUrl, bool checkSlash = false ) - - - addPath - addPath - ( const QString & pa ) - - - cdUp - cdUp - () - - - decode - decode - ( QString & url ) - - - dirPath - dirPath - () - - - encode - encode - ( QString & url ) - - - encodedPathAndQuery - encodedPathAndQuery - () - - - fileName - fileName - () - - - hasHost - hasHost - () - - - hasPassword - hasPassword - () - - - hasPath - hasPath - () - - - hasPort - hasPort - () - - - hasRef - hasRef - () - - - hasUser - hasUser - () - - - host - host - () - - - isLocalFile - isLocalFile - () - - - isRelativeUrl - isRelativeUrl - ( const QString & url ) - - - isValid - isValid - () - - - parse - parse - ( const QString & url ) - - - password - password - () - - - path - path - ( bool correct = true ) - - - port - port - () - - - protocol - protocol - () - - - query - query - () - - - ref - ref - () - - - reset - reset - () - - - setEncodedPathAndQuery - setEncodedPathAndQuery - ( const QString & pathAndQuery ) - - - setFileName - setFileName - ( const QString & name ) - - - setHost - setHost - ( const QString & host ) - - - setPassword - setPassword - ( const QString & pass ) - - - setPath - setPath - ( const QString & path ) - - - setPort - setPort - ( int port ) - - - setProtocol - setProtocol - ( const QString & protocol ) - - - setQuery - setQuery - ( const QString & txt ) - - - setRef - setRef - ( const QString & txt ) - - - setUser - setUser - ( const QString & user ) - - - toString - toString - ( bool encodedPath = false, bool forcePrependProtocol = true ) - - - user - user - () - - - operator - operator-QString - QString() - - - operator= - operator-eq - ( const Q3Url & url ) - - - operator= - operator-eq-2 - ( const QString & url ) - - - operator== - operator-eq-eq - ( const Q3Url & url ) - - - operator== - operator-eq-eq-2 - ( const QString & url ) - - - - Q3UrlOperator - q3urloperator.html - - Q3UrlOperator - Q3UrlOperator - () - - - Q3UrlOperator - Q3UrlOperator-2 - ( const QString & url ) - - - Q3UrlOperator - Q3UrlOperator-3 - ( const Q3UrlOperator & url ) - - - Q3UrlOperator - Q3UrlOperator-4 - ( const Q3UrlOperator & url, const QString & relUrl, bool checkSlash = false ) - - - clearEntries - clearEntries - () - - - connectionStateChanged - connectionStateChanged - ( int state, const QString & data ) - - - copy - copy - ( const QString & from, const QString & to, bool move = false, bool toPath = true ) - - - copy - copy-2 - ( const QStringList & files, const QString & dest, bool move = false ) - - - createdDirectory - createdDirectory - ( const QUrlInfo & i, Q3NetworkOperation * op ) - - - data - data - ( const QByteArray & data, Q3NetworkOperation * op ) - - - dataTransferProgress - dataTransferProgress - ( int bytesDone, int bytesTotal, Q3NetworkOperation * op ) - - - deleteNetworkProtocol - deleteNetworkProtocol - () - - - finished - finished - ( Q3NetworkOperation * op ) - - - get - get - ( const QString & location = QString() - - - getNetworkProtocol - getNetworkProtocol - () - - - info - info - ( const QString & entry ) - - - isDir - isDir - ( bool * ok = 0 ) - - - itemChanged - itemChanged - ( Q3NetworkOperation * op ) - - - listChildren - listChildren - () - - - mkdir - mkdir - ( const QString & dirname ) - - - nameFilter - nameFilter - () - - - newChildren - newChildren - ( const Q3ValueList<QUrlInfo> & i, Q3NetworkOperation * op ) - - - put - put - ( const QByteArray & data, const QString & location = QString() - - - remove - remove - ( const QString & filename ) - - - removed - removed - ( Q3NetworkOperation * op ) - - - rename - rename - ( const QString & oldname, const QString & newname ) - - - setNameFilter - setNameFilter - ( const QString & nameFilter ) - - - start - start - ( Q3NetworkOperation * op ) - - - startedNextCopy - startedNextCopy - ( const Q3PtrList<Q3NetworkOperation> & lst ) - - - stop - stop - () - - - operator= - operator-eq - ( const Q3UrlOperator & url ) - - - operator= - operator-eq-2 - ( const QString & url ) - - - - Q3ValueListConstIterator - q3valuelistconstiterator.html - - Q3ValueListConstIterator - Q3ValueListConstIterator - () - - - Q3ValueListConstIterator - Q3ValueListConstIterator-2 - ( const Q3ValueListConstIterator & o ) - - - Q3ValueListConstIterator - Q3ValueListConstIterator-3 - ( const QLinkedList<T>::const_iterator & o ) - - - Q3ValueListConstIterator - Q3ValueListConstIterator-4 - ( const QLinkedList<T>::iterator & o ) - - - - Q3ValueList - q3valuelist.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - const_iterator - const_iterator-typedef - - - - const_pointer - const_pointer-typedef - - - - const_reference - const_reference-typedef - - - - iterator - iterator-typedefx - - - - pointer - pointer-typedef - - - - reference - reference-typedef - - - - size_type - size_type-typedef - - - - value_type - value_type-typedef - - - - Q3ValueList - Q3ValueList - () - - - Q3ValueList - Q3ValueList-2 - ( const Q3ValueList<T> & l ) - - - Q3ValueList - Q3ValueList-3 - ( const QLinkedList<T> & l ) - - - Q3ValueList - Q3ValueList-4 - ( const QList<T> & l ) - - - Q3ValueList - Q3ValueList-5 - ( const std::list<T> & l ) - - - append - append - ( const T & x ) - - - at - at - ( Q3ValueList<T>::size_type i ) - - - at - at-2 - ( Q3ValueList<T>::size_type i ) - - - contains - contains - ( const T & x ) - - - fromLast - fromLast - () - - - fromLast - fromLast-2 - () - - - insert - insert - ( Q3ValueList<T>::Iterator it, const T & x ) - - - insert - insert-2 - ( Q3ValueList<T>::Iterator pos, Q3ValueList<T>::size_type n, const T & x ) - - - prepend - prepend - ( const T & x ) - - - remove - remove - ( Q3ValueList<T>::Iterator it ) - - - remove - remove-2 - ( const T & x ) - - - operator - operator-QList-ltT-gt - QList<T>() - - - operator!= - operator-not-eq - ( const Q3ValueList<T> & l ) - - - operator+ - operator-2b - ( const Q3ValueList<T> & l ) - - - operator+= - operator-2b-eq - ( const Q3ValueList<T> & l ) - - - operator+= - operator-2b-eq-2 - ( const T & x ) - - - operator<< - operator-lt-lt - ( const T & x ) - - - operator= - operator-eq - ( const Q3ValueList<T> & l ) - - - operator= - operator-eq-2 - ( const QList<T> & l ) - - - operator= - operator-eq-3 - ( const std::list<T> & l ) - - - operator== - operator-eq-eq - ( const Q3ValueList<T> & l ) - - - operator== - operator-eq-eq-2 - ( const std::list<T> & l ) - - - operator[] - operator-5b-5d - ( Q3ValueList<T>::size_type i ) - - - operator[] - operator-5b-5d-2 - ( Q3ValueList<T>::size_type i ) - - - - Q3ValueListIterator - q3valuelistiterator.html - - Q3ValueListIterator - Q3ValueListIterator - () - - - Q3ValueListIterator - Q3ValueListIterator-2 - ( const Q3ValueListIterator & o ) - - - Q3ValueListIterator - Q3ValueListIterator-3 - ( const QLinkedList<T>::iterator & o ) - - - - Q3ValueStack - q3valuestack.html - - Q3ValueStack - Q3ValueStack - () - - - pop - pop - () - - - push - push - ( const T & d ) - - - top - top - () - - - top - top-2 - () - - - - Q3ValueVector - q3valuevector.html - - Q3ValueVector - Q3ValueVector - () - - - Q3ValueVector - Q3ValueVector-2 - ( const Q3ValueVector<T> & v ) - - - Q3ValueVector - Q3ValueVector-3 - ( QVector<T>::size_type n, const T & val = T() - - - Q3ValueVector - Q3ValueVector-4 - ( const std::vector<T> & v ) - - - at - at - ( int i, bool * ok = 0 ) - - - at - at-2 - ( int i, bool * ok = 0 ) - - - resize - resize - ( int n, const T & val = T() - - - operator= - operator-eq - ( const Q3ValueVector<T> & v ) - - - operator= - operator-eq-2 - ( const std::vector<T> & v ) - - - - Q3VBox - q3vbox.html - - Q3VBox - Q3VBox - ( QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - - Q3VButtonGroup - q3vbuttongroup.html - - Q3VButtonGroup - Q3VButtonGroup - ( QWidget * parent = 0, const char * name = 0 ) - - - Q3VButtonGroup - Q3VButtonGroup-2 - ( const QString & title, QWidget * parent = 0, const char * name = 0 ) - - - - Q3WhatsThis - q3whatsthis.html - - Q3WhatsThis - Q3WhatsThis - ( QWidget * widget ) - - - add - add - ( QWidget * widget, const QString & text ) - - - clicked - clicked - ( const QString & href ) - - - display - display - ( const QString & text, const QPoint & pos = QCursor::pos() - - - enterWhatsThisMode - enterWhatsThisMode - () - - - inWhatsThisMode - inWhatsThisMode - () - - - leaveWhatsThisMode - leaveWhatsThisMode - ( const QString & text = QString() - - - remove - remove - ( QWidget * widget ) - - - text - text - ( const QPoint & pos ) - - - whatsThisButton - whatsThisButton - ( QWidget * parent ) - - - - Q3WidgetStack - q3widgetstack.html - - Q3WidgetStack - Q3WidgetStack - ( QWidget * parent, const char * name = 0, Qt::WFlags f = 0 ) - - - aboutToShow - aboutToShow - ( int id ) - - - aboutToShow - aboutToShow-2 - ( QWidget * widget ) - - - addWidget - addWidget - ( QWidget * w, int id = -1 ) - - - id - id - ( QWidget * widget ) - - - raiseWidget - raiseWidget - ( int id ) - - - raiseWidget - raiseWidget-2 - ( QWidget * w ) - - - removeWidget - removeWidget - ( QWidget * w ) - - - setChildGeometries - setChildGeometries - () - - - visibleWidget - visibleWidget - () - - - widget - widget - ( int id ) - - - - Q3Wizard - q3wizard.html - - Q3Wizard - Q3Wizard - ( QWidget * parent = 0, const char * name = 0, bool modal = false, Qt::WFlags f = 0 ) - - - addPage - addPage - ( QWidget * page, const QString & title ) - - - appropriate - appropriate - ( QWidget * page ) - - - back - back - () - - - backButton - backButton - () - - - cancelButton - cancelButton - () - - - currentPage - currentPage - () - - - finishButton - finishButton - () - - - help - help - () - - - helpButton - helpButton - () - - - helpClicked - helpClicked - () - - - indexOf - indexOf - ( QWidget * page ) - - - insertPage - insertPage - ( QWidget * page, const QString & title, int index ) - - - layOutButtonRow - layOutButtonRow - ( QHBoxLayout * layout ) - - - layOutTitleRow - layOutTitleRow - ( QHBoxLayout * layout, const QString & title ) - - - next - next - () - - - nextButton - nextButton - () - - - page - page - ( int index ) - - - pageCount - pageCount - () - - - removePage - removePage - ( QWidget * page ) - - - selected - selected - ( const QString & title ) - - - setAppropriate - setAppropriate - ( QWidget * page, bool appropriate ) - - - setBackEnabled - setBackEnabled - ( QWidget * page, bool enable ) - - - setFinishEnabled - setFinishEnabled - ( QWidget * page, bool enable ) - - - setHelpEnabled - setHelpEnabled - ( QWidget * page, bool enable ) - - - setNextEnabled - setNextEnabled - ( QWidget * page, bool enable ) - - - setTitle - setTitle - ( QWidget * page, const QString & title ) - - - showPage - showPage - ( QWidget * page ) - - - title - title - ( QWidget * page ) - - - setFinish - setFinish - ( QWidget * widget, bool finish ) - - - - QAbstractButton - qabstractbutton.html - - QAbstractButton - QAbstractButton - ( QWidget * parent = 0 ) - - - animateClick - animateClick - ( int msec = 100 ) - - - checkStateSet - checkStateSet - () - - - click - click - () - - - clicked - clicked - ( bool checked = false ) - - - group - group - () - - - hitButton - hitButton - ( const QPoint & pos ) - - - nextCheckState - nextCheckState - () - - - pressed - pressed - () - - - released - released - () - - - toggle - toggle - () - - - toggled - toggled - ( bool checked ) - - - QAbstractButton - QAbstractButton-2 - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - accel - accel - () - - - iconSet - iconSet - () - - - isOn - isOn - () - - - isToggleButton - isToggleButton - () - - - pixmap - pixmap - () - - - setAccel - setAccel - ( const QKeySequence & key ) - - - setIconSet - setIconSet - ( const QIcon & icon ) - - - setOn - setOn - ( bool b ) - - - setPixmap - setPixmap - ( const QPixmap & p ) - - - setToggleButton - setToggleButton - ( bool b ) - - - - QAbstractEventDispatcher - qabstracteventdispatcher.html - - EventFilter - EventFilter-typedef - - - - TimerInfo - TimerInfo-typedef - - - - QAbstractEventDispatcher - QAbstractEventDispatcher - ( QObject * parent = 0 ) - - - aboutToBlock - aboutToBlock - () - - - awake - awake - () - - - filterEvent - filterEvent - ( void * message ) - - - flush - flush - () - - - hasPendingEvents - hasPendingEvents - () - - - instance - instance - ( QThread * thread = 0 ) - - - interrupt - interrupt - () - - - processEvents - processEvents - ( QEventLoop::ProcessEventsFlags flags ) - - - registerSocketNotifier - registerSocketNotifier - ( QSocketNotifier * notifier ) - - - registerTimer - registerTimer - ( int interval, QObject * object ) - - - registerTimer - registerTimer-2 - ( int timerId, int interval, QObject * object ) - - - registeredTimers - registeredTimers - ( QObject * object ) - - - setEventFilter - setEventFilter - ( EventFilter filter ) - - - unregisterSocketNotifier - unregisterSocketNotifier - ( QSocketNotifier * notifier ) - - - unregisterTimer - unregisterTimer - ( int timerId ) - - - unregisterTimers - unregisterTimers - ( QObject * object ) - - - wakeUp - wakeUp - () - - - - QAbstractExtensionFactory - qabstractextensionfactory.html - - extension - extension - ( QObject * object, const QString & iid ) - - - - QAbstractExtensionManager - qabstractextensionmanager.html - - extension - extension - ( QObject * object, const QString & iid ) - - - registerExtensions - registerExtensions - ( QAbstractExtensionFactory * factory, const QString & iid ) - - - unregisterExtensions - unregisterExtensions - ( QAbstractExtensionFactory * factory, const QString & iid ) - - - - QAbstractFileEngineHandler - qabstractfileenginehandler.html - - QAbstractFileEngineHandler - QAbstractFileEngineHandler - () - - - create - create - ( const QString & fileName ) - - - - QAbstractFileEngine - qabstractfileengine.html - - FileName - FileName-enum - - - - FileOwner - FileOwner-enum - - - - FileTime - FileTime-enum - - - - QAbstractFileEngine - QAbstractFileEngine - () - - - caseSensitive - caseSensitive - () - - - close - close - () - - - copy - copy - ( const QString & newName ) - - - create - create - ( const QString & fileName ) - - - entryList - entryList - ( QDir::Filters filters, const QStringList & filterNames ) - - - FileError - error - QAbstractFileEngine::error() - - - errorString - errorString - () - - - fileFlags - fileFlags - ( FileFlags type = FileInfoAll ) - - - fileName - fileName - ( FileName file = DefaultName ) - - - fileTime - fileTime - ( FileTime time ) - - - flush - flush - () - - - handle - handle - () - - - isRelativePath - isRelativePath - () - - - isSequential - isSequential - () - - - link - link - ( const QString & newName ) - - - mkdir - mkdir - ( const QString & dirName, bool createParentDirectories ) - - - open - open - ( QIODevice::OpenMode mode ) - - - owner - owner - ( FileOwner owner ) - - - ownerId - ownerId - ( FileOwner owner ) - - - pos - pos - () - - - read - read - ( char * data, qint64 maxlen ) - - - readLine - readLine - ( char * data, qint64 maxlen ) - - - remove - remove - () - - - rename - rename - ( const QString & newName ) - - - rmdir - rmdir - ( const QString & dirName, bool recurseParentDirectories ) - - - seek - seek - ( qint64 offset ) - - - setError - setError - ( QFile::FileError error, const QString & errorString ) - - - setFileName - setFileName - ( const QString & file ) - - - setPermissions - setPermissions - ( uint perms ) - - - setSize - setSize - ( qint64 size ) - - - size - size - () - - - write - write - ( const char * data, qint64 len ) - - - - QAbstractFormBuilder - qabstractformbuilder.html - - QAbstractFormBuilder - QAbstractFormBuilder - () - - - load - load - ( QIODevice * device, QWidget * parent = 0 ) - - - save - save - ( QIODevice * device, QWidget * widget ) - - - setWorkingDirectory - setWorkingDirectory - ( const QDir & directory ) - - - workingDirectory - workingDirectory - () - - - - QAbstractItemDelegate - qabstractitemdelegate.html - - EndEditHint - EndEditHint-enum - - - - QAbstractItemDelegate - QAbstractItemDelegate - ( QObject * parent = 0 ) - - - closeEditor - closeEditor - ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint = NoHint ) - - - commitData - commitData - ( QWidget * editor ) - - - createEditor - createEditor - ( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - editorEvent - editorEvent - ( QEvent * event, QAbstractItemModel * model, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - elidedText - elidedText - ( const QFontMetrics & fontMetrics, int width, Qt::TextElideMode mode, const QString & text ) - - - paint - paint - ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - setEditorData - setEditorData - ( QWidget * editor, const QModelIndex & index ) - - - setModelData - setModelData - ( QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) - - - sizeHint - sizeHint - ( const QStyleOptionViewItem & option, const QModelIndex & index ) - - - updateEditorGeometry - updateEditorGeometry - ( QWidget * editor, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - - QAbstractItemModel - qabstractitemmodel.html - - QAbstractItemModel - QAbstractItemModel - ( QObject * parent = 0 ) - - - beginInsertColumns - beginInsertColumns - ( const QModelIndex & parent, int first, int last ) - - - beginInsertRows - beginInsertRows - ( const QModelIndex & parent, int first, int last ) - - - beginRemoveColumns - beginRemoveColumns - ( const QModelIndex & parent, int first, int last ) - - - beginRemoveRows - beginRemoveRows - ( const QModelIndex & parent, int first, int last ) - - - buddy - buddy - ( const QModelIndex & index ) - - - canFetchMore - canFetchMore - ( const QModelIndex & parent ) - - - changePersistentIndex - changePersistentIndex - ( const QModelIndex & from, const QModelIndex & to ) - - - changePersistentIndexList - changePersistentIndexList - ( const QModelIndexList & from, const QModelIndexList & to ) - - - columnCount - columnCount - ( const QModelIndex & parent = QModelIndex() - - - columnsAboutToBeInserted - columnsAboutToBeInserted - ( const QModelIndex & parent, int start, int end ) - - - columnsAboutToBeRemoved - columnsAboutToBeRemoved - ( const QModelIndex & parent, int start, int end ) - - - columnsInserted - columnsInserted - ( const QModelIndex & parent, int start, int end ) - - - columnsRemoved - columnsRemoved - ( const QModelIndex & parent, int start, int end ) - - - createIndex - createIndex - ( int row, int column, void * ptr = 0 ) - - - createIndex - createIndex-2 - ( int row, int column, int id ) - - - data - data - ( const QModelIndex & index, int role = Qt::DisplayRole ) - - - dataChanged - dataChanged - ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) - - - dropMimeData - dropMimeData - ( const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent ) - - - endInsertColumns - endInsertColumns - () - - - endInsertRows - endInsertRows - () - - - endRemoveColumns - endRemoveColumns - () - - - endRemoveRows - endRemoveRows - () - - - fetchMore - fetchMore - ( const QModelIndex & parent ) - - - ItemFlags - flags - QAbstractItemModel::flags( const QModelIndex & index ) - - - hasChildren - hasChildren - ( const QModelIndex & parent = QModelIndex() - - - hasIndex - hasIndex - ( int row, int column, const QModelIndex & parent = QModelIndex() - - - headerData - headerData - ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) - - - headerDataChanged - headerDataChanged - ( Qt::Orientation orientation, int first, int last ) - - - index - index - ( int row, int column, const QModelIndex & parent = QModelIndex() - - - insertColumn - insertColumn - ( int column, const QModelIndex & parent = QModelIndex() - - - insertColumns - insertColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - insertRow - insertRow - ( int row, const QModelIndex & parent = QModelIndex() - - - insertRows - insertRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - itemData - itemData - ( const QModelIndex & index ) - - - layoutChanged - layoutChanged - () - - - match - match - ( const QModelIndex & start, int role, const QVariant & value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags( Qt::MatchStartsWith | Qt::MatchWrap ) - - - mimeData - mimeData - ( const QModelIndexList & indexes ) - - - mimeTypes - mimeTypes - () - - - modelReset - modelReset - () - - - parent - parent - ( const QModelIndex & index ) - - - removeColumn - removeColumn - ( int column, const QModelIndex & parent = QModelIndex() - - - removeColumns - removeColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - removeRow - removeRow - ( int row, const QModelIndex & parent = QModelIndex() - - - removeRows - removeRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - reset - reset - () - - - revert - revert - () - - - rowCount - rowCount - ( const QModelIndex & parent = QModelIndex() - - - rowsAboutToBeInserted - rowsAboutToBeInserted - ( const QModelIndex & parent, int start, int end ) - - - rowsAboutToBeRemoved - rowsAboutToBeRemoved - ( const QModelIndex & parent, int start, int end ) - - - rowsInserted - rowsInserted - ( const QModelIndex & parent, int start, int end ) - - - rowsRemoved - rowsRemoved - ( const QModelIndex & parent, int start, int end ) - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) - - - setHeaderData - setHeaderData - ( int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole ) - - - setItemData - setItemData - ( const QModelIndex & index, const QMap<int, QVariant> & roles ) - - - sibling - sibling - ( int row, int column, const QModelIndex & index ) - - - sort - sort - ( int column, Qt::SortOrder order = Qt::AscendingOrder ) - - - span - span - ( const QModelIndex & index ) - - - submit - submit - () - - - DropActions - supportedDropActions - QAbstractItemModel::supportedDropActions() - - - - QAbstractItemView - qabstractitemview.html - - CursorAction - CursorAction-enum - - - - DropIndicatorPosition - DropIndicatorPosition-enum - - - - ScrollHint - ScrollHint-enum - - - - SelectionBehavior - SelectionBehavior-enum - - - - SelectionMode - SelectionMode-enum - - - - State - State-enum - - - - TextElideMode - textElideMode-prop - - - - QAbstractItemView - QAbstractItemView - ( QWidget * parent = 0 ) - - - activated - activated - ( const QModelIndex & index ) - - - clearSelection - clearSelection - () - - - clicked - clicked - ( const QModelIndex & index ) - - - closeEditor - closeEditor - ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ) - - - closePersistentEditor - closePersistentEditor - ( const QModelIndex & index ) - - - commitData - commitData - ( QWidget * editor ) - - - currentChanged - currentChanged - ( const QModelIndex & current, const QModelIndex & previous ) - - - currentIndex - currentIndex - () - - - dataChanged - dataChanged - ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) - - - dirtyRegionOffset - dirtyRegionOffset - () - - - doubleClicked - doubleClicked - ( const QModelIndex & index ) - - - dragEnterEvent - dragEnterEvent - ( QDragEnterEvent * event ) - - - dragLeaveEvent - dragLeaveEvent - ( QDragLeaveEvent * event ) - - - dragMoveEvent - dragMoveEvent - ( QDragMoveEvent * event ) - - - dropEvent - dropEvent - ( QDropEvent * event ) - - - dropIndicatorPosition - dropIndicatorPosition - () - - - edit - edit - ( const QModelIndex & index ) - - - edit - edit-2 - ( const QModelIndex & index, EditTrigger trigger, QEvent * event ) - - - editorDestroyed - editorDestroyed - ( QObject * editor ) - - - entered - entered - ( const QModelIndex & index ) - - - executeDelayedItemsLayout - executeDelayedItemsLayout - () - - - focusInEvent - focusInEvent - ( QFocusEvent * event ) - - - focusOutEvent - focusOutEvent - ( QFocusEvent * event ) - - - horizontalOffset - horizontalOffset - () - - - horizontalStepsPerItem - horizontalStepsPerItem - () - - - indexAt - indexAt - ( const QPoint & point ) - - - indexWidget - indexWidget - ( const QModelIndex & index ) - - - isIndexHidden - isIndexHidden - ( const QModelIndex & index ) - - - itemDelegate - itemDelegate - () - - - keyPressEvent - keyPressEvent - ( QKeyEvent * event ) - - - keyboardSearch - keyboardSearch - ( const QString & search ) - - - model - model - () - - - mouseDoubleClickEvent - mouseDoubleClickEvent - ( QMouseEvent * event ) - - - mouseMoveEvent - mouseMoveEvent - ( QMouseEvent * event ) - - - mousePressEvent - mousePressEvent - ( QMouseEvent * event ) - - - mouseReleaseEvent - mouseReleaseEvent - ( QMouseEvent * event ) - - - moveCursor - moveCursor - ( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) - - - openPersistentEditor - openPersistentEditor - ( const QModelIndex & index ) - - - pressed - pressed - ( const QModelIndex & index ) - - - reset - reset - () - - - resizeEvent - resizeEvent - ( QResizeEvent * event ) - - - rootIndex - rootIndex - () - - - rowsAboutToBeRemoved - rowsAboutToBeRemoved - ( const QModelIndex & parent, int start, int end ) - - - rowsInserted - rowsInserted - ( const QModelIndex & parent, int start, int end ) - - - scheduleDelayedItemsLayout - scheduleDelayedItemsLayout - () - - - scrollDirtyRegion - scrollDirtyRegion - ( int dx, int dy ) - - - scrollTo - scrollTo - ( const QModelIndex & index, ScrollHint hint = EnsureVisible ) - - - scrollToBottom - scrollToBottom - () - - - scrollToTop - scrollToTop - () - - - selectAll - selectAll - () - - - selectedIndexes - selectedIndexes - () - - - selectionChanged - selectionChanged - ( const QItemSelection & selected, const QItemSelection & deselected ) - - - SelectionFlags - selectionCommand - QAbstractItemView::selectionCommand( const QModelIndex & index, const QEvent * event = 0 ) - - - selectionModel - selectionModel - () - - - setCurrentIndex - setCurrentIndex - ( const QModelIndex & index ) - - - setDirtyRegion - setDirtyRegion - ( const QRegion & region ) - - - setHorizontalStepsPerItem - setHorizontalStepsPerItem - ( int steps ) - - - setIndexWidget - setIndexWidget - ( const QModelIndex & index, QWidget * widget ) - - - setItemDelegate - setItemDelegate - ( QAbstractItemDelegate * delegate ) - - - setModel - setModel - ( QAbstractItemModel * model ) - - - setRootIndex - setRootIndex - ( const QModelIndex & index ) - - - setSelection - setSelection - ( const QRect & rect, QItemSelectionModel::SelectionFlags flags ) - - - setSelectionModel - setSelectionModel - ( QItemSelectionModel * selectionModel ) - - - setState - setState - ( State state ) - - - setVerticalStepsPerItem - setVerticalStepsPerItem - ( int steps ) - - - sizeHintForColumn - sizeHintForColumn - ( int column ) - - - sizeHintForIndex - sizeHintForIndex - ( const QModelIndex & index ) - - - sizeHintForRow - sizeHintForRow - ( int row ) - - - startDrag - startDrag - ( Qt::DropActions supportedActions ) - - - state - state - () - - - timerEvent - timerEvent - ( QTimerEvent * event ) - - - verticalOffset - verticalOffset - () - - - verticalStepsPerItem - verticalStepsPerItem - () - - - viewOptions - viewOptions - () - - - viewportEntered - viewportEntered - () - - - viewportEvent - viewportEvent - ( QEvent * event ) - - - visualRect - visualRect - ( const QModelIndex & index ) - - - visualRegionForSelection - visualRegionForSelection - ( const QItemSelection & selection ) - - - - QAbstractListModel - qabstractlistmodel.html - - QAbstractListModel - QAbstractListModel - ( QObject * parent = 0 ) - - - index - index - ( int row, int column = 0, const QModelIndex & parent = QModelIndex() - - - - QAbstractPrintDialog - qabstractprintdialog.html - - PrintRange - PrintRange-enum - - - - QAbstractPrintDialog - QAbstractPrintDialog - ( QPrinter * printer, QWidget * parent = 0 ) - - - addEnabledOption - addEnabledOption - ( PrintDialogOption option ) - - - enabledOptions - enabledOptions - () - - - exec - exec - () - - - fromPage - fromPage - () - - - isOptionEnabled - isOptionEnabled - ( PrintDialogOption option ) - - - maxPage - maxPage - () - - - minPage - minPage - () - - - printRange - printRange - () - - - printer - printer - () - - - setEnabledOptions - setEnabledOptions - ( PrintDialogOptions options ) - - - setFromTo - setFromTo - ( int from, int to ) - - - setMinMax - setMinMax - ( int min, int max ) - - - setPrintRange - setPrintRange - ( PrintRange range ) - - - toPage - toPage - () - - - - QAbstractProxyModel - qabstractproxymodel.html - - QAbstractProxyModel - QAbstractProxyModel - ( QObject * parent = 0 ) - - - mapFromSource - mapFromSource - ( const QModelIndex & sourceIndex ) - - - mapSelectionFromSource - mapSelectionFromSource - ( const QItemSelection & sourceSelection ) - - - mapSelectionToSource - mapSelectionToSource - ( const QItemSelection & proxySelection ) - - - mapToSource - mapToSource - ( const QModelIndex & proxyIndex ) - - - setSourceModel - setSourceModel - ( QAbstractItemModel * sourceModel ) - - - sourceModel - sourceModel - () - - - - QAbstractScrollArea - qabstractscrollarea.html - - ScrollBarPolicy - horizontalScrollBarPolicy-prop - - - - ScrollBarPolicy - verticalScrollBarPolicy-prop - - - - QAbstractScrollArea - QAbstractScrollArea - ( QWidget * parent = 0 ) - - - contextMenuEvent - contextMenuEvent - ( QContextMenuEvent * e ) - - - dragEnterEvent - dragEnterEvent - ( QDragEnterEvent * event ) - - - dragLeaveEvent - dragLeaveEvent - ( QDragLeaveEvent * event ) - - - dragMoveEvent - dragMoveEvent - ( QDragMoveEvent * event ) - - - dropEvent - dropEvent - ( QDropEvent * event ) - - - event - event - ( QEvent * e ) - - - horizontalScrollBar - horizontalScrollBar - () - - - keyPressEvent - keyPressEvent - ( QKeyEvent * e ) - - - maximumViewportSize - maximumViewportSize - () - - - mouseDoubleClickEvent - mouseDoubleClickEvent - ( QMouseEvent * e ) - - - mouseMoveEvent - mouseMoveEvent - ( QMouseEvent * e ) - - - mousePressEvent - mousePressEvent - ( QMouseEvent * e ) - - - mouseReleaseEvent - mouseReleaseEvent - ( QMouseEvent * e ) - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - resizeEvent - resizeEvent - ( QResizeEvent * event ) - - - scrollContentsBy - scrollContentsBy - ( int dx, int dy ) - - - setViewportMargins - setViewportMargins - ( int left, int top, int right, int bottom ) - - - verticalScrollBar - verticalScrollBar - () - - - viewport - viewport - () - - - viewportEvent - viewportEvent - ( QEvent * e ) - - - wheelEvent - wheelEvent - ( QWheelEvent * e ) - - - - QAbstractSlider - qabstractslider.html - - SliderAction - SliderAction-enum - - - - SliderChange - SliderChange-enum - - - - Orientation - orientation-prop - - - - QAbstractSlider - QAbstractSlider - ( QWidget * parent = 0 ) - - - actionTriggered - actionTriggered - ( int action ) - - - rangeChanged - rangeChanged - ( int min, int max ) - - - repeatAction - repeatAction - () - - - setRange - setRange - ( int min, int max ) - - - setRepeatAction - setRepeatAction - ( SliderAction action, int thresholdTime = 500, int repeatTime = 50 ) - - - sliderChange - sliderChange - ( SliderChange change ) - - - sliderMoved - sliderMoved - ( int value ) - - - sliderPressed - sliderPressed - () - - - sliderReleased - sliderReleased - () - - - triggerAction - triggerAction - ( SliderAction action ) - - - valueChanged - valueChanged - ( int value ) - - - addLine - addLine - () - - - addPage - addPage - () - - - lineStep - lineStepx - () - - - maxValue - maxValue - () - - - minValue - minValue - () - - - setLineStep - setLineStep - ( int v ) - - - setMaxValue - setMaxValue - ( int v ) - - - setMinValue - setMinValue - ( int v ) - - - setSteps - setSteps - ( int single, int page ) - - - subtractLine - subtractLine - () - - - subtractPage - subtractPage - () - - - - QAbstractSocket - qabstractsocket.html - - NetworkLayerProtocol - NetworkLayerProtocol-enum - - - - SocketError - SocketError-enum - - - - SocketState - SocketState-enum - - - - SocketType - SocketType-enum - - - - QAbstractSocket - QAbstractSocket - ( SocketType socketType, QObject * parent ) - - - abort - abort - () - - - bytesAvailable - bytesAvailable - () - - - bytesToWrite - bytesToWrite - () - - - canReadLine - canReadLine - () - - - close - close - () - - - connectToHost - connectToHost - ( const QString & hostName, quint16 port, OpenMode openMode = ReadWrite ) - - - connectToHost - connectToHost-2 - ( const QHostAddress & address, quint16 port, OpenMode openMode = ReadWrite ) - - - connectToHostImplementation - connectToHostImplementation - ( const QString & hostName, quint16 port, OpenMode openMode = ReadWrite ) - - - connected - connected - () - - - disconnectFromHost - disconnectFromHost - () - - - disconnectFromHostImplementation - disconnectFromHostImplementation - () - - - disconnected - disconnected - () - - - error - error - () - - - error - error-2 - ( QAbstractSocket::SocketError socketError ) - - - flush - flush - () - - - hostFound - hostFound - () - - - isValid - isValid - () - - - localAddress - localAddress - () - - - localPort - localPort - () - - - peerAddress - peerAddress - () - - - peerName - peerName - () - - - peerPort - peerPort - () - - - proxy - proxy - () - - - readBufferSize - readBufferSize - () - - - setLocalAddress - setLocalAddress - ( const QHostAddress & address ) - - - setLocalPort - setLocalPort - ( quint16 port ) - - - setPeerAddress - setPeerAddress - ( const QHostAddress & address ) - - - setPeerName - setPeerName - ( const QString & name ) - - - setPeerPort - setPeerPort - ( quint16 port ) - - - setProxy - setProxy - ( const QNetworkProxy & networkProxy ) - - - setReadBufferSize - setReadBufferSize - ( qint64 size ) - - - setSocketDescriptor - setSocketDescriptor - ( int socketDescriptor, SocketState socketState = ConnectedState, OpenMode openMode = ReadWrite ) - - - setSocketError - setSocketError - ( SocketError socketError ) - - - setSocketState - setSocketState - ( SocketState state ) - - - socketDescriptor - socketDescriptor - () - - - socketType - socketType - () - - - state - state - () - - - stateChanged - stateChanged - ( QAbstractSocket::SocketState socketState ) - - - waitForConnected - waitForConnected - ( int msecs = 30000 ) - - - waitForDisconnected - waitForDisconnected - ( int msecs = 30000 ) - - - Error - Error-enum - - - - State - State-typedef - - - - connectionClosed - connectionClosed - () - - - delayedCloseFinished - delayedCloseFinished - () - - - setSocket - setSocket - ( int socket ) - - - socket - socket - () - - - waitForMore - waitForMore - ( int msecs, bool * timeout = 0 ) - - - - QAbstractSpinBox - qabstractspinbox.html - - ButtonSymbols - ButtonSymbols-enum - - - - Alignment - alignment-prop - - - - QAbstractSpinBox - QAbstractSpinBox - ( QWidget * parent = 0 ) - - - clear - clear - () - - - editingFinished - editingFinished - () - - - fixup - fixup - ( QString & input ) - - - interpretText - interpretText - () - - - lineEdit - lineEdit - () - - - selectAll - selectAll - () - - - setLineEdit - setLineEdit - ( QLineEdit * lineEdit ) - - - stepBy - stepBy - ( int steps ) - - - stepDown - stepDown - () - - - stepEnabled - stepEnabled - () - - - stepUp - stepUp - () - - - State - validate - QAbstractSpinBox::validate( QString & input, int & pos ) - - - - QAbstractTableModel - qabstracttablemodel.html - - QAbstractTableModel - QAbstractTableModel - ( QObject * parent = 0 ) - - - index - index - ( int row, int column, const QModelIndex & parent = QModelIndex() - - - - QAbstractTextDocumentLayout - qabstracttextdocumentlayout.html - - QAbstractTextDocumentLayout - QAbstractTextDocumentLayout - ( QTextDocument * document ) - - - anchorAt - anchorAt - ( const QPointF & position ) - - - blockBoundingRect - blockBoundingRect - ( const QTextBlock & block ) - - - document - document - () - - - documentChanged - documentChanged - ( int position, int charsRemoved, int charsAdded ) - - - documentSize - documentSize - () - - - documentSizeChanged - documentSizeChanged - ( const QSizeF & newSize ) - - - draw - draw - ( QPainter * painter, const PaintContext & context ) - - - drawInlineObject - drawInlineObject - ( QPainter * painter, const QRectF & rect, QTextInlineObject object, int posInDocument, const QTextFormat & format ) - - - format - format - ( int position ) - - - frameBoundingRect - frameBoundingRect - ( QTextFrame * frame ) - - - handlerForObject - handlerForObject - ( int objectType ) - - - hitTest - hitTest - ( const QPointF & point, Qt::HitTestAccuracy accuracy ) - - - pageCount - pageCount - () - - - pageCountChanged - pageCountChanged - ( int newPages ) - - - paintDevice - paintDevice - () - - - positionInlineObject - positionInlineObject - ( QTextInlineObject item, int posInDocument, const QTextFormat & format ) - - - registerHandler - registerHandler - ( int formatType, QObject * component ) - - - resizeInlineObject - resizeInlineObject - ( QTextInlineObject item, int posInDocument, const QTextFormat & format ) - - - setPaintDevice - setPaintDevice - ( QPaintDevice * device ) - - - update - update - ( const QRectF & rect = QRectF( 0., 0., 1000000000., 1000000000. ) - - - - QAbstractTextDocumentLayout::Selection - qabstracttextdocumentlayout-selection.html - - - QAccessibleBridge - qaccessiblebridge.html - - notifyAccessibilityUpdate - notifyAccessibilityUpdate - ( int reason, QAccessibleInterface * interface, int child ) - - - setRootObject - setRootObject - ( QAccessibleInterface * object ) - - - - QAccessibleBridgePlugin - qaccessiblebridgeplugin.html - - QAccessibleBridgePlugin - QAccessibleBridgePlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key ) - - - keys - keys - () - - - - QAccessibleEvent - qaccessibleevent.html - - QAccessibleEvent - QAccessibleEvent - ( Type type, int child ) - - - child - child - () - - - setValue - setValue - ( const QString & text ) - - - value - value - () - - - - QAccessible - qaccessible.html - - Action - Action-enum - - - - Event - Event-enum - - - - InterfaceFactory - InterfaceFactory-typedef - - - - Role - Role-enum - - - - RootObjectHandler - RootObjectHandler-typedef - - - - Text - Text-enum - - - - UpdateHandler - UpdateHandler-typedef - - - - installFactory - installFactory - ( InterfaceFactory factory ) - - - installRootObjectHandler - installRootObjectHandler - ( RootObjectHandler handler ) - - - installUpdateHandler - installUpdateHandler - ( UpdateHandler handler ) - - - isActive - isActive - () - - - queryAccessibleInterface - queryAccessibleInterface - ( QObject * object ) - - - removeFactory - removeFactory - ( InterfaceFactory factory ) - - - setRootObject - setRootObject - ( QObject * object ) - - - updateAccessibility - updateAccessibility - ( QObject * object, int child, Event reason ) - - - - QAccessibleInterface - qaccessibleinterface.html - - actionText - actionText - ( int action, Text t, int child ) - - - childAt - childAt - ( int x, int y ) - - - childCount - childCount - () - - - doAction - doAction - ( int action, int child, const QVariantList & params = QVariantList() - - - indexOfChild - indexOfChild - ( const QAccessibleInterface * child ) - - - isValid - isValid - () - - - navigate - navigate - ( RelationFlag relation, int entry, QAccessibleInterface ** target ) - - - object - object - () - - - rect - rect - ( int child ) - - - relationTo - relationTo - ( int child, const QAccessibleInterface * other, int otherChild ) - - - role - role - ( int child ) - - - setText - setText - ( Text t, int child, const QString & text ) - - - state - state - ( int child ) - - - text - text - ( Text t, int child ) - - - userActionCount - userActionCount - ( int child ) - - - - QAccessibleObject - qaccessibleobject.html - - QAccessibleObject - QAccessibleObject - ( QObject * object ) - - - - QAccessiblePlugin - qaccessibleplugin.html - - QAccessiblePlugin - QAccessiblePlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key, QObject * object ) - - - keys - keys - () - - - - QAccessibleWidget - qaccessiblewidget.html - - QAccessibleWidget - QAccessibleWidget - ( QWidget * w, Role role = Client, const QString & name = QString() - - - addControllingSignal - addControllingSignal - ( const QString & signal ) - - - parentObject - parentObject - () - - - setAccelerator - setAccelerator - ( const QString & accel ) - - - setDescription - setDescription - ( const QString & desc ) - - - setHelp - setHelp - ( const QString & help ) - - - setValue - setValue - ( const QString & value ) - - - widget - widget - () - - - - QActionEvent - qactionevent.html - - QActionEvent - QActionEvent - ( int type, QAction * action, QAction * before = 0 ) - - - action - action - () - - - before - before - () - - - - QActionGroup - qactiongroup.html - - QActionGroup - QActionGroup - ( QObject * parent ) - - - actions - actions - () - - - addAction - addAction - ( QAction * action ) - - - addAction - addAction-2 - ( const QString & text ) - - - addAction - addAction-3 - ( const QIcon & icon, const QString & text ) - - - checkedAction - checkedAction - () - - - hovered - hovered - ( QAction * action ) - - - removeAction - removeAction - ( QAction * action ) - - - setDisabled - setDisabled - ( bool b ) - - - triggered - triggered - ( QAction * action ) - - - add - add - ( QAction * a ) - - - addSeparator - addSeparator - () - - - addTo - addTo - ( QWidget * widget ) - - - selected - selected - ( QAction * action ) - - - - QAction - qaction.html - - ActionEvent - ActionEvent-enum - - - - ShortcutContext - shortcutContext-prop - - - - QAction - QAction - ( QObject * parent ) - - - QAction - QAction-2 - ( const QString & text, QObject * parent ) - - - QAction - QAction-3 - ( const QIcon & icon, const QString & text, QObject * parent ) - - - actionGroup - actionGroup - () - - - activate - activate - ( ActionEvent event ) - - - changed - changed - () - - - data - data - () - - - hover - hover - () - - - hovered - hovered - () - - - isSeparator - isSeparator - () - - - menu - menu - () - - - parentWidget - parentWidget - () - - - setActionGroup - setActionGroup - ( QActionGroup * group ) - - - setData - setData - ( const QVariant & data ) - - - setDisabled - setDisabled - ( bool b ) - - - setMenu - setMenu - ( QMenu * menu ) - - - setSeparator - setSeparator - ( bool b ) - - - showStatusText - showStatusText - ( QWidget * widget = 0 ) - - - toggle - toggle - () - - - toggled - toggled - ( bool checked ) - - - trigger - trigger - () - - - triggered - triggered - ( bool checked = false ) - - - QAction - QAction-4 - ( QObject * parent, const char * name ) - - - QAction - QAction-5 - ( const QString & text, const QKeySequence & shortcut, QObject * parent, const char * name ) - - - QAction - QAction-6 - ( const QIcon & icon, const QString & text, const QKeySequence & shortcut, QObject * parent, const char * name ) - - - accel - accel - () - - - activated - activated - ( int i = 0 ) - - - addTo - addTo - ( QWidget * w ) - - - iconSet - iconSet - () - - - isOn - isOn - () - - - isToggleAction - isToggleAction - () - - - menuText - menuText - () - - - removeFrom - removeFrom - ( QWidget * w ) - - - setAccel - setAccel - ( const QKeySequence & shortcut ) - - - setIconSet - setIconSet - ( const QIcon & i ) - - - setMenuText - setMenuText - ( const QString & text ) - - - setOn - setOn - ( bool b ) - - - setToggleAction - setToggleAction - ( bool b ) - - - - QApplication - qapplication.html - - ColorSpec - ColorSpec-enum - - - - Type - Type-enum - - - - LayoutDirection - layoutDirection-prop - - - - QApplication - QApplication - ( int & argc, char ** argv ) - - - QApplication - QApplication-2 - ( int & argc, char ** argv, bool GUIenabled ) - - - QApplication - QApplication-3 - ( int & argc, char ** argv, Type type ) - - - QApplication - QApplication-4 - ( Display * display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0 ) - - - QApplication - QApplication-5 - ( Display * display, int & argc, char ** argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0 ) - - - aboutQt - aboutQt - () - - - activeModalWidget - activeModalWidget - () - - - activePopupWidget - activePopupWidget - () - - - activeWindow - activeWindow - () - - - allWidgets - allWidgets - () - - - beep - beep - () - - - changeOverrideCursor - changeOverrideCursor - ( const QCursor & cursor ) - - - clipboard - clipboard - () - - - closeAllWindows - closeAllWindows - () - - - colorSpec - colorSpec - () - - - commitData - commitData - ( QSessionManager & manager ) - - - desktop - desktop - () - - - desktopSettingsAware - desktopSettingsAware - () - - - exec - exec - () - - - focusChanged - focusChanged - ( QWidget * old, QWidget * now ) - - - focusWidget - focusWidget - () - - - font - font - ( const QWidget * widget = 0 ) - - - fontMetrics - fontMetrics - () - - - inputContext - inputContext - () - - - isEffectEnabled - isEffectEnabled - ( Qt::UIEffect effect ) - - - isLeftToRight - isLeftToRight - () - - - isRightToLeft - isRightToLeft - () - - - isSessionRestored - isSessionRestored - () - - - KeyboardModifiers - keyboardModifiers - QApplication::keyboardModifiers() - - - keypadNavigationEnabled - keypadNavigationEnabled - () - - - lastWindowClosed - lastWindowClosed - () - - - macEventFilter - macEventFilter - ( EventHandlerCallRef caller, EventRef event ) - - - MouseButtons - mouseButtons - QApplication::mouseButtons() - - - overrideCursor - overrideCursor - () - - - palette - palette - () - - - palette - palette-2 - ( const QWidget * widget ) - - - palette - palette-3 - ( const char * className ) - - - qwsDecoration - qwsDecoration - () - - - qwsEventFilter - qwsEventFilter - ( QWSEvent * event ) - - - qwsSetCustomColors - qwsSetCustomColors - ( QRgb * colorTable, int start, int numColors ) - - - qwsSetDecoration - qwsSetDecoration - ( QDecoration * decoration ) - - - qwsSetDecoration - qwsSetDecoration-2 - ( const QString & decoration ) - - - restoreOverrideCursor - restoreOverrideCursor - () - - - saveState - saveState - ( QSessionManager & manager ) - - - sessionId - sessionId - () - - - sessionKey - sessionKey - () - - - setActiveWindow - setActiveWindow - ( QWidget * active ) - - - setColorSpec - setColorSpec - ( int spec ) - - - setDesktopSettingsAware - setDesktopSettingsAware - ( bool on ) - - - setEffectEnabled - setEffectEnabled - ( Qt::UIEffect effect, bool enable = true ) - - - setFont - setFont - ( const QFont & font, const char * className = 0 ) - - - setInputContext - setInputContext - ( QInputContext * inputContext ) - - - setKeypadNavigationEnabled - setKeypadNavigationEnabled - ( bool enable ) - - - setOverrideCursor - setOverrideCursor - ( const QCursor & cursor ) - - - setPalette - setPalette - ( const QPalette & palette, const char * className = 0 ) - - - setStyle - setStyle - ( QStyle * style ) - - - setStyle - setStyle-2 - ( const QString & style ) - - - style - style - () - - - syncX - syncX - () - - - topLevelAt - topLevelAt - ( const QPoint & point ) - - - topLevelAt - topLevelAt-2 - ( int x, int y ) - - - topLevelWidgets - topLevelWidgets - () - - - type - type - () - - - widgetAt - widgetAt - ( const QPoint & point ) - - - widgetAt - widgetAt-4 - ( int x, int y ) - - - x11EventFilter - x11EventFilter - ( XEvent * event ) - - - x11ProcessEvent - x11ProcessEvent - ( XEvent * event ) - - - ColorMode - ColorMode-typedef - - - - colorMode - colorMode - () - - - flushX - flushX - () - - - hasGlobalMouseTracking - hasGlobalMouseTracking - () - - - Alignment - horizontalAlignment - QApplication::horizontalAlignment( Qt::Alignment align ) - - - MacintoshVersion - macVersion - QApplication::macVersion() - - - mainWidget - mainWidget - () - - - reverseLayout - reverseLayout - () - - - setColorMode - setColorMode - ( ColorMode mode ) - - - setFont - setFont-2 - ( const QFont & font, bool b, const char * className = 0 ) - - - setGlobalMouseTracking - setGlobalMouseTracking - ( bool dummy ) - - - setMainWidget - setMainWidget - ( QWidget * mainWidget ) - - - setOverrideCursor - setOverrideCursor-2 - ( const QCursor & cursor, bool replace ) - - - setPalette - setPalette-2 - ( const QPalette & pal, bool b, const char * className = 0 ) - - - setReverseLayout - setReverseLayout - ( bool reverse ) - - - setWinStyleHighlightColor - setWinStyleHighlightColor - ( const QColor & c ) - - - widgetAt - widgetAt-2 - ( int x, int y, bool child ) - - - widgetAt - widgetAt-3 - ( const QPoint & point, bool child ) - - - winStyleHighlightColor - winStyleHighlightColor - () - - - WindowsVersion - winVersion - QApplication::winVersion() - - - CustomColors - CustomColors-var - - - - NormalColors - NormalColors-var - - - - - QAssistantClient - qassistantclient.html - - QAssistantClient - QAssistantClient - ( const QString & path, QObject * parent = 0 ) - - - assistantClosed - assistantClosed - () - - - assistantOpened - assistantOpened - () - - - closeAssistant - closeAssistant - () - - - error - error - ( const QString & message ) - - - openAssistant - openAssistant - () - - - setArguments - setArguments - ( const QStringList & arguments ) - - - showPage - showPage - ( const QString & page ) - - - - QAxAggregated - qaxaggregated.html - - controllingUnknown - controllingUnknown - () - - - object - object - () - - - queryInterface - queryInterface - ( const QUuid & iid, void ** iface ) - - - widget - widget - () - - - - QAxBase - qaxbase.html - - PropertyBag - PropertyBag-typedef - - - - QAxBase - QAxBase - ( IUnknown * iface = 0 ) - - - asVariant - asVariant - () - - - clear - clear - () - - - disableClassInfo - disableClassInfo - () - - - disableEventSink - disableEventSink - () - - - disableMetaObject - disableMetaObject - () - - - dynamicCall - dynamicCall - ( const char * function, const QVariant & var1 = QVariant() - - - dynamicCall - dynamicCall-2 - ( const char * function, QList<QVariant> & vars ) - - - exception - exception - ( int code, const QString & source, const QString & desc, const QString & help ) - - - generateDocumentation - generateDocumentation - () - - - initialize - initialize - ( IUnknown ** ptr ) - - - initializeActive - initializeActive - ( IUnknown ** ptr ) - - - initializeFromFile - initializeFromFile - ( IUnknown ** ptr ) - - - initializeLicensed - initializeLicensed - ( IUnknown ** ptr ) - - - initializeRemote - initializeRemote - ( IUnknown ** ptr ) - - - isNull - isNull - () - - - propertyBag - propertyBag - () - - - propertyChanged - propertyChanged - ( const QString & name ) - - - propertyWritable - propertyWritable - ( const char * prop ) - - - queryInterface - queryInterface - ( const QUuid & uuid, void ** iface ) - - - querySubObject - querySubObject - ( const char * name, const QVariant & var1 = QVariant() - - - querySubObject - querySubObject-2 - ( const char * name, QList<QVariant> & vars ) - - - setPropertyBag - setPropertyBag - ( const PropertyBag & bag ) - - - setPropertyWritable - setPropertyWritable - ( const char * prop, bool ok ) - - - signal - signal - ( const QString & name, int argc, void * argv ) - - - verbs - verbs - () - - - - QAxBindable - qaxbindable.html - - QAxBindable - QAxBindable - () - - - clientSite - clientSite - () - - - createAggregate - createAggregate - () - - - propertyChanged - propertyChanged - ( const char * property ) - - - readData - readData - ( QIODevice * source, const QString & format ) - - - reportError - reportError - ( int code, const QString & src, const QString & desc, const QString & context = QString() - - - requestPropertyChange - requestPropertyChange - ( const char * property ) - - - writeData - writeData - ( QIODevice * sink ) - - - - QAxFactory - qaxfactory.html - - ServerType - ServerType-enum - - - - QAxFactory - QAxFactory - ( const QUuid & libid, const QUuid & appid ) - - - appID - appID - () - - - classID - classID - ( const QString & key ) - - - createObject - createObject - ( const QString & key ) - - - createObjectWrapper - createObjectWrapper - ( QObject * object, IDispatch ** wrapper ) - - - eventsID - eventsID - ( const QString & key ) - - - exposeToSuperClass - exposeToSuperClass - ( const QString & key ) - - - featureList - featureList - () - - - hasStockEvents - hasStockEvents - ( const QString & key ) - - - interfaceID - interfaceID - ( const QString & key ) - - - isServer - isServer - () - - - isService - isService - () - - - metaObject - metaObject - ( const QString & key ) - - - registerActiveObject - registerActiveObject - ( QObject * object ) - - - registerClass - registerClass - ( const QString & key, QSettings * settings ) - - - serverDirPath - serverDirPath - () - - - serverFilePath - serverFilePath - () - - - startServer - startServer - ( ServerType type = MultipleInstances ) - - - stayTopLevel - stayTopLevel - ( const QString & key ) - - - stopServer - stopServer - () - - - typeLibID - typeLibID - () - - - unregisterClass - unregisterClass - ( const QString & key, QSettings * settings ) - - - validateLicenseKey - validateLicenseKey - ( const QString & key, const QString & licenseKey ) - - - - QAxObject - qaxobject.html - - QAxObject - QAxObject - ( QObject * parent = 0 ) - - - QAxObject - QAxObject-2 - ( const QString & c, QObject * parent = 0 ) - - - QAxObject - QAxObject-3 - ( IUnknown * iface, QObject * parent = 0 ) - - - doVerb - doVerb - ( const QString & verb ) - - - - QAxScriptEngine - qaxscriptengine.html - - State - State-enum - - - - QAxScriptEngine - QAxScriptEngine - ( const QString & language, QAxScript * script ) - - - addItem - addItem - ( const QString & name ) - - - hasIntrospection - hasIntrospection - () - - - isValid - isValid - () - - - queryInterface - queryInterface - ( const QUuid & uuid, void ** iface ) - - - scriptLanguage - scriptLanguage - () - - - setState - setState - ( State st ) - - - state - state - () - - - - QAxScript - qaxscript.html - - FunctionFlags - FunctionFlags-enum - - - - QAxScript - QAxScript - ( const QString & name, QAxScriptManager * manager ) - - - call - call - ( const QString & function, const QVariant & var1 = QVariant() - - - call - call-2 - ( const QString & function, QList<QVariant> & arguments ) - - - entered - entered - () - - - error - error - ( int code, const QString & description, int sourcePosition, const QString & sourceText ) - - - finished - finished - () - - - finished - finished-2 - ( const QVariant & result ) - - - finished - finished-3 - ( int code, const QString & source, const QString & description, const QString & help ) - - - functions - functions - ( FunctionFlags flags = FunctionNames ) - - - load - load - ( const QString & code, const QString & language = QString() - - - scriptCode - scriptCode - () - - - scriptEngine - scriptEngine - () - - - scriptName - scriptName - () - - - stateChanged - stateChanged - ( int state ) - - - - QAxScriptManager - qaxscriptmanager.html - - QAxScriptManager - QAxScriptManager - ( QObject * parent = 0 ) - - - addObject - addObject - ( QAxBase * object ) - - - addObject - addObject-2 - ( QObject * object ) - - - call - call - ( const QString & function, const QVariant & var1 = QVariant() - - - call - call-2 - ( const QString & function, QList<QVariant> & arguments ) - - - error - error - ( QAxScript * script, int code, const QString & description, int sourcePosition, const QString & sourceText ) - - - functions - functions - ( QAxScript::FunctionFlags flags = QAxScript::FunctionNames ) - - - load - load - ( const QString & code, const QString & name, const QString & language ) - - - load - load-2 - ( const QString & file, const QString & name ) - - - registerEngine - registerEngine - ( const QString & name, const QString & extension, const QString & code = QString() - - - script - script - ( const QString & name ) - - - scriptFileFilter - scriptFileFilter - () - - - scriptNames - scriptNames - () - - - - QAxWidget - qaxwidget.html - - QAxWidget - QAxWidget - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - QAxWidget - QAxWidget-2 - ( const QString & c, QWidget * parent = 0, Qt::WFlags f = 0 ) - - - QAxWidget - QAxWidget-3 - ( IUnknown * iface, QWidget * parent = 0, Qt::WFlags f = 0 ) - - - createAggregate - createAggregate - () - - - createHostWindow - createHostWindow - ( bool initialized ) - - - doVerb - doVerb - ( const QString & verb ) - - - translateKeyEvent - translateKeyEvent - ( int message, int keycode ) - - - - QBasicTimer - qbasictimer.html - - QBasicTimer - QBasicTimer - () - - - isActive - isActive - () - - - start - start - ( int msec, QObject * object ) - - - stop - stop - () - - - timerId - timerId - () - - - - QBitArray - qbitarray.html - - QBitArray - QBitArray - () - - - QBitArray - QBitArray-2 - ( int size, bool value = false ) - - - QBitArray - QBitArray-3 - ( const QBitArray & other ) - - - at - at - ( int i ) - - - clear - clear - () - - - clearBit - clearBit - ( int i ) - - - count - count - () - - - count - count-2 - ( bool on ) - - - fill - fill - ( bool value, int size = -1 ) - - - fill - fill-2 - ( bool value, int begin, int end ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - resize - resize - ( int size ) - - - setBit - setBit - ( int i ) - - - setBit - setBit-2 - ( int i, bool value ) - - - size - size - () - - - testBit - testBit - ( int i ) - - - toggleBit - toggleBit - ( int i ) - - - truncate - truncate - ( int pos ) - - - operator!= - operator-not-eq - ( const QBitArray & other ) - - - operator& - operator-and-eq - amp;=( const QBitArray & other ) - - - operator= - operator-eq - ( const QBitArray & other ) - - - operator== - operator-eq-eq - ( const QBitArray & other ) - - - operator[] - operator-5b-5d - ( int i ) - - - operator[] - operator-5b-5d-2 - ( int i ) - - - operator[] - operator-5b-5d-3 - ( uint i ) - - - operator[] - operator-5b-5d-4 - ( uint i ) - - - operator^= - operator-5e-eq - ( const QBitArray & other ) - - - operator|= - operator-7c-eq - ( const QBitArray & other ) - - - operator~ - operator-7e - () - - - - QBitmap - qbitmap.html - - QBitmap - QBitmap - () - - - QBitmap - QBitmap-2 - ( const QPixmap & pixmap ) - - - QBitmap - QBitmap-3 - ( int width, int height ) - - - QBitmap - QBitmap-4 - ( const QSize & size ) - - - QBitmap - QBitmap-5 - ( const QString & fileName, const char * format = 0 ) - - - clear - clear - () - - - fromData - fromData - ( const QSize & size, const uchar * bits, QImage::Format monoFormat = QImage::Format_MonoLSB ) - - - fromImage - fromImage - ( const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - transformed - transformed - ( const QMatrix & matrix ) - - - operator - operator-QVariant - QVariant() - - - operator= - operator-eq - ( const QPixmap & pixmap ) - - - QBitmap - QBitmap-6 - ( int width, int height, bool clear ) - - - QBitmap - QBitmap-7 - ( const QSize & size, bool clear ) - - - QBitmap - QBitmap-8 - ( int width, int height, const uchar * bits, bool isXbitmap = false ) - - - QBitmap - QBitmap-9 - ( const QImage & image ) - - - QBitmap - QBitmap-10 - ( const QSize & size, const uchar * bits, bool isXbitmap = false ) - - - xForm - xForm - ( const QMatrix & matrix ) - - - operator= - operator-eq-2 - ( const QImage & image ) - - - - QBoxLayout - qboxlayout.html - - Direction - Direction-enum - - - - QBoxLayout - QBoxLayout - ( Direction dir, QWidget * parent = 0 ) - - - addLayout - addLayout - ( QLayout * layout, int stretch = 0 ) - - - addSpacing - addSpacing - ( int size ) - - - addStretch - addStretch - ( int stretch = 0 ) - - - addStrut - addStrut - ( int size ) - - - addWidget - addWidget - ( QWidget * widget, int stretch = 0, Qt::Alignment alignment = 0 ) - - - direction - direction - () - - - insertItem - insertItem - ( int index, QLayoutItem * item ) - - - insertLayout - insertLayout - ( int index, QLayout * layout, int stretch = 0 ) - - - insertSpacing - insertSpacing - ( int index, int size ) - - - insertStretch - insertStretch - ( int index, int stretch = 0 ) - - - insertWidget - insertWidget - ( int index, QWidget * widget, int stretch = 0, Qt::Alignment alignment = 0 ) - - - invalidate - invalidate - () - - - setDirection - setDirection - ( Direction direction ) - - - setStretchFactor - setStretchFactor - ( QWidget * widget, int stretch ) - - - setStretchFactor - setStretchFactor-2 - ( QLayout * layout, int stretch ) - - - QBoxLayout - QBoxLayout-2 - ( QWidget * parent, Direction dir, int margin = 0, int spacing = -1, const char * name = 0 ) - - - QBoxLayout - QBoxLayout-3 - ( QLayout * parentLayout, Direction dir, int spacing = -1, const char * name = 0 ) - - - QBoxLayout - QBoxLayout-4 - ( Direction dir, int spacing, const char * name = 0 ) - - - findWidget - findWidget - ( QWidget * widget ) - - - - QBrush - qbrush.html - - QBrush - QBrush - () - - - QBrush - QBrush-2 - ( Qt::BrushStyle style ) - - - QBrush - QBrush-3 - ( const QColor & color, Qt::BrushStyle style = Qt::SolidPattern ) - - - QBrush - QBrush-4 - ( Qt::GlobalColor color, Qt::BrushStyle style = Qt::SolidPattern ) - - - QBrush - QBrush-5 - ( const QColor & color, const QPixmap & pixmap ) - - - QBrush - QBrush-6 - ( Qt::GlobalColor color, const QPixmap & pixmap ) - - - QBrush - QBrush-7 - ( const QPixmap & pixmap ) - - - QBrush - QBrush-8 - ( const QBrush & other ) - - - QBrush - QBrush-9 - ( const QGradient & gradient ) - - - color - color - () - - - gradient - gradient - () - - - isOpaque - isOpaque - () - - - setColor - setColor - ( const QColor & color ) - - - setColor - setColor-2 - ( Qt::GlobalColor color ) - - - setStyle - setStyle - ( Qt::BrushStyle style ) - - - setTexture - setTexture - ( const QPixmap & pixmap ) - - - BrushStyle - style - QBrush::style() - - - texture - texture - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QBrush & brush ) - - - operator= - operator-eq - ( const QBrush & brush ) - - - operator== - operator-eq-eq - ( const QBrush & brush ) - - - pixmap - pixmap - () - - - setPixmap - setPixmap - ( const QPixmap & pixmap ) - - - operator - operator-const-QColor--and - const QColor &() - - - - QBuffer - qbuffer.html - - QBuffer - QBuffer - ( QObject * parent = 0 ) - - - QBuffer - QBuffer-2 - ( QByteArray * byteArray, QObject * parent = 0 ) - - - buffer - buffer - () - - - buffer - buffer-2 - () - - - data - data - () - - - setBuffer - setBuffer - ( QByteArray * byteArray ) - - - setData - setData - ( const QByteArray & data ) - - - setData - setData-2 - ( const char * data, int size ) - - - - QButtonGroup - qbuttongroup.html - - QButtonGroup - QButtonGroup - ( QObject * parent = 0 ) - - - addButton - addButton - ( QAbstractButton * button ) - - - addButton - addButton-2 - ( QAbstractButton * button, int id ) - - - button - button - ( int id ) - - - buttonClicked - buttonClicked - ( QAbstractButton * button ) - - - buttonClicked - buttonClicked-2 - ( int id ) - - - buttons - buttons - () - - - checkedButton - checkedButton - () - - - checkedId - checkedId - () - - - id - id - ( QAbstractButton * button ) - - - removeButton - removeButton - ( QAbstractButton * button ) - - - setId - setId - ( QAbstractButton * button, int id ) - - - insert - insert - ( QAbstractButton * b ) - - - remove - remove - ( QAbstractButton * b ) - - - - QByteArray - qbytearray.html - - QByteArray - QByteArray - () - - - QByteArray - QByteArray-2 - ( const char * str ) - - - QByteArray - QByteArray-3 - ( const char * data, int size ) - - - QByteArray - QByteArray-4 - ( int size, char ch ) - - - QByteArray - QByteArray-5 - ( const QByteArray & other ) - - - append - append - ( const QByteArray & ba ) - - - append - append-2 - ( const QString & str ) - - - append - append-3 - ( const char * str ) - - - append - append-4 - ( char ch ) - - - at - at - ( int i ) - - - capacity - capacity - () - - - chop - chop - ( int n ) - - - clear - clear - () - - - constData - constData - () - - - contains - contains - ( const QByteArray & ba ) - - - contains - contains-2 - ( const char * str ) - - - contains - contains-3 - ( char ch ) - - - count - count - ( const QByteArray & ba ) - - - count - count-2 - ( const char * str ) - - - count - count-3 - ( char ch ) - - - count - count-4 - () - - - data - data - () - - - data - data-2 - () - - - endsWith - endsWith - ( const QByteArray & ba ) - - - endsWith - endsWith-2 - ( const char * str ) - - - endsWith - endsWith-3 - ( char ch ) - - - fill - fill - ( char ch, int size = -1 ) - - - fromBase64 - fromBase64 - ( const QByteArray & base64 ) - - - fromRawData - fromRawData - ( const char * data, int size ) - - - indexOf - indexOf - ( const QByteArray & ba, int from = 0 ) - - - indexOf - indexOf-2 - ( const QString & str, int from = 0 ) - - - indexOf - indexOf-3 - ( const char * str, int from = 0 ) - - - indexOf - indexOf-4 - ( char ch, int from = 0 ) - - - insert - insert - ( int i, const QByteArray & ba ) - - - insert - insert-2 - ( int i, const QString & str ) - - - insert - insert-3 - ( int i, const char * str ) - - - insert - insert-4 - ( int i, char ch ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - lastIndexOf - lastIndexOf - ( const QByteArray & ba, int from = -1 ) - - - lastIndexOf - lastIndexOf-2 - ( const QString & str, int from = -1 ) - - - lastIndexOf - lastIndexOf-3 - ( const char * str, int from = -1 ) - - - lastIndexOf - lastIndexOf-4 - ( char ch, int from = -1 ) - - - left - left - ( int len ) - - - leftJustified - leftJustified - ( int width, char fill = ' ', bool truncate = false ) - - - length - length - () - - - mid - mid - ( int pos, int len = -1 ) - - - number - number - ( int n, int base = 10 ) - - - number - number-2 - ( uint n, int base = 10 ) - - - number - number-3 - ( qlonglong n, int base = 10 ) - - - number - number-4 - ( qulonglong n, int base = 10 ) - - - number - number-5 - ( double n, char f = 'g', int prec = 6 ) - - - prepend - prepend - ( const QByteArray & ba ) - - - prepend - prepend-2 - ( const char * str ) - - - prepend - prepend-3 - ( char ch ) - - - push_back - push_back - ( const QByteArray & other ) - - - push_back - push_back-2 - ( const char * str ) - - - push_back - push_back-3 - ( char ch ) - - - push_front - push_front - ( const QByteArray & other ) - - - push_front - push_front-2 - ( const char * str ) - - - push_front - push_front-3 - ( char ch ) - - - remove - remove - ( int pos, int len ) - - - replace - replace - ( int pos, int len, const QByteArray & after ) - - - replace - replace-2 - ( int pos, int len, const char * after ) - - - replace - replace-3 - ( const QByteArray & before, const QByteArray & after ) - - - replace - replace-4 - ( const char * before, const QByteArray & after ) - - - replace - replace-5 - ( const QByteArray & before, const char * after ) - - - replace - replace-6 - ( const QString & before, const QByteArray & after ) - - - replace - replace-7 - ( const QString & before, const char * after ) - - - replace - replace-8 - ( const char * before, const char * after ) - - - replace - replace-9 - ( char before, const QByteArray & after ) - - - replace - replace-10 - ( char before, const QString & after ) - - - replace - replace-11 - ( char before, const char * after ) - - - replace - replace-12 - ( char before, char after ) - - - reserve - reserve - ( int size ) - - - resize - resize - ( int size ) - - - right - right - ( int len ) - - - rightJustified - rightJustified - ( int width, char fill = ' ', bool truncate = false ) - - - setNum - setNum - ( int n, int base = 10 ) - - - setNum - setNum-2 - ( uint n, int base = 10 ) - - - setNum - setNum-3 - ( short n, int base = 10 ) - - - setNum - setNum-4 - ( ushort n, int base = 10 ) - - - setNum - setNum-5 - ( qlonglong n, int base = 10 ) - - - setNum - setNum-6 - ( qulonglong n, int base = 10 ) - - - setNum - setNum-7 - ( double n, char f = 'g', int prec = 6 ) - - - setNum - setNum-8 - ( float n, char f = 'g', int prec = 6 ) - - - simplified - simplified - () - - - size - size - () - - - split - split - ( char sep ) - - - squeeze - squeeze - () - - - startsWith - startsWith - ( const QByteArray & ba ) - - - startsWith - startsWith-2 - ( const char * str ) - - - startsWith - startsWith-3 - ( char ch ) - - - toBase64 - toBase64 - () - - - toDouble - toDouble - ( bool * ok = 0 ) - - - toFloat - toFloat - ( bool * ok = 0 ) - - - toInt - toInt - ( bool * ok = 0, int base = 10 ) - - - toLong - toLong - ( bool * ok = 0, int base = 10 ) - - - toLongLong - toLongLong - ( bool * ok = 0, int base = 10 ) - - - toLower - toLower - () - - - toShort - toShort - ( bool * ok = 0, int base = 10 ) - - - toUInt - toUInt - ( bool * ok = 0, int base = 10 ) - - - toULong - toULong - ( bool * ok = 0, int base = 10 ) - - - toULongLong - toULongLong - ( bool * ok = 0, int base = 10 ) - - - toUShort - toUShort - ( bool * ok = 0, int base = 10 ) - - - toUpper - toUpper - () - - - trimmed - trimmed - () - - - truncate - truncate - ( int pos ) - - - operator - operator-const-char--2a - const char *() - - - operator - operator-const-void--2a - const void *() - - - operator!= - operator-not-eq - ( const QString & str ) - - - operator+= - operator-2b-eq - ( const QByteArray & ba ) - - - operator+= - operator-2b-eq-2 - ( const QString & str ) - - - operator+= - operator-2b-eq-3 - ( const char * str ) - - - operator+= - operator-2b-eq-4 - ( char ch ) - - - operator< - operator-lt - ( const QString & str ) - - - operator<= - operator-lt-eq - ( const QString & str ) - - - operator= - operator-eq - ( const QByteArray & other ) - - - operator= - operator-eq-2 - ( const char * str ) - - - operator== - operator-eq-eq - ( const QString & str ) - - - operator> - operator-gt - ( const QString & str ) - - - operator>= - operator-gt-eq - ( const QString & str ) - - - operator[] - operator-5b-5d - ( int i ) - - - operator[] - operator-5b-5d-2 - ( int i ) - - - operator[] - operator-5b-5d-3 - ( uint i ) - - - operator[] - operator-5b-5d-4 - ( uint i ) - - - - QByteArrayMatcher - qbytearraymatcher.html - - QByteArrayMatcher - QByteArrayMatcher - () - - - QByteArrayMatcher - QByteArrayMatcher-2 - ( const QByteArray & pattern ) - - - QByteArrayMatcher - QByteArrayMatcher-3 - ( const QByteArrayMatcher & other ) - - - indexIn - indexIn - ( const QByteArray & ba, int from = 0 ) - - - pattern - pattern - () - - - setPattern - setPattern - ( const QByteArray & pattern ) - - - operator= - operator-eq - ( const QByteArrayMatcher & other ) - - - QByteArray - QByteArray-6 - ( int size ) - - - duplicate - duplicate - ( const QByteArray & a ) - - - duplicate - duplicate-2 - ( const char * a, uint n ) - - - find - find - ( char c, int from = 0 ) - - - find - find-2 - ( const char * c, int from = 0 ) - - - find - find-3 - ( const QByteArray & ba, int from = 0 ) - - - find - find-4 - ( const QString & s, int from = 0 ) - - - findRev - findRev - ( char c, int from = -1 ) - - - findRev - findRev-2 - ( const char * c, int from = -1 ) - - - findRev - findRev-3 - ( const QByteArray & ba, int from = -1 ) - - - findRev - findRev-4 - ( const QString & s, int from = -1 ) - - - leftJustify - leftJustify - ( uint width, char fill = ' ', bool truncate = false ) - - - lower - lower - () - - - resetRawData - resetRawData - ( const char * data, uint n ) - - - rightJustify - rightJustify - ( uint width, char fill = ' ', bool truncate = false ) - - - setRawData - setRawData - ( const char * a, uint n ) - - - simplifyWhiteSpace - simplifyWhiteSpace - () - - - stripWhiteSpace - stripWhiteSpace - () - - - upper - upper - () - - - - QCache - qcache.html - - QCache - QCache - ( int maxCost = 100 ) - - - clear - clear - () - - - contains - contains - ( const Key & key ) - - - count - count - () - - - insert - insert - ( const Key & key, T * object, int cost = 1 ) - - - isEmpty - isEmpty - () - - - keys - keys - () - - - maxCost - maxCost - () - - - object - object - ( const Key & key ) - - - remove - remove - ( const Key & key ) - - - setMaxCost - setMaxCost - ( int cost ) - - - size - size - () - - - take - take - ( const Key & key ) - - - totalCost - totalCost - () - - - operator[] - operator-5b-5d - ( const Key & key ) - - - QCache - QCache-2 - ( int maxCost, int dummy ) - - - - QCDEStyle - qcdestyle.html - - QCDEStyle - QCDEStyle - ( bool useHighlightCols = false ) - - - - QChar - qchar.html - - Category - Category-enum - - - - Decomposition - Decomposition-enum - - - - Direction - Direction-enum - - - - Joining - Joining-enum - - - - SpecialCharacter - SpecialCharacter-enum - - - - UnicodeVersion - UnicodeVersion-enum - - - - QChar - QChar - () - - - QChar - QChar-2 - ( char ch ) - - - QChar - QChar-3 - ( uchar ch ) - - - QChar - QChar-4 - ( QLatin1Char ch ) - - - QChar - QChar-5 - ( uchar cell, uchar row ) - - - QChar - QChar-6 - ( ushort code ) - - - QChar - QChar-7 - ( short code ) - - - QChar - QChar-8 - ( uint code ) - - - QChar - QChar-9 - ( int code ) - - - QChar - QChar-10 - ( SpecialCharacter ch ) - - - category - category - () - - - cell - cell - () - - - combiningClass - combiningClass - () - - - decomposition - decomposition - () - - - decompositionTag - decompositionTag - () - - - digitValue - digitValue - () - - - direction - direction - () - - - fromAscii - fromAscii - ( char c ) - - - fromLatin1 - fromLatin1 - ( char c ) - - - hasMirrored - hasMirrored - () - - - isDigit - isDigit - () - - - isLetter - isLetter - () - - - isLetterOrNumber - isLetterOrNumber - () - - - isLower - isLower - () - - - isMark - isMark - () - - - isNull - isNull - () - - - isNumber - isNumber - () - - - isPrint - isPrint - () - - - isPunct - isPunct - () - - - isSpace - isSpace - () - - - isSymbol - isSymbol - () - - - isUpper - isUpper - () - - - joining - joining - () - - - mirroredChar - mirroredChar - () - - - row - row - () - - - toAscii - toAscii - () - - - toLatin1 - toLatin1 - () - - - toLower - toLower - () - - - toUpper - toUpper - () - - - unicode - unicode - () - - - unicode - unicode-2 - () - - - unicodeVersion - unicodeVersion - () - - - ascii - ascii - () - - - latin1 - latin1 - () - - - lower - lower - () - - - mirrored - mirrored - () - - - networkOrdered - networkOrdered - () - - - upper - upper - () - - - - QCheckBox - qcheckbox.html - - QCheckBox - QCheckBox - ( QWidget * parent = 0 ) - - - QCheckBox - QCheckBox-2 - ( const QString & text, QWidget * parent = 0 ) - - - CheckState - checkState - QCheckBox::checkState() - - - setCheckState - setCheckState - ( Qt::CheckState state ) - - - stateChanged - stateChanged - ( int state ) - - - ToggleState - ToggleState-enum - - - - QCheckBox - QCheckBox-3 - ( QWidget * parent, const char * name ) - - - QCheckBox - QCheckBox-4 - ( const QString & text, QWidget * parent, const char * name ) - - - setNoChange - setNoChange - () - - - setState - setState - ( ToggleState state ) - - - state - state - () - - - - QChildEvent - qchildevent.html - - QChildEvent - QChildEvent - ( Type type, QObject * child ) - - - added - added - () - - - child - child - () - - - polished - polished - () - - - removed - removed - () - - - inserted - inserted - () - - - - QClipboard - qclipboard.html - - Mode - Mode-enum - - - - clear - clear - ( Mode mode = Clipboard ) - - - dataChanged - dataChanged - () - - - image - image - ( Mode mode = Clipboard ) - - - mimeData - mimeData - ( Mode mode = Clipboard ) - - - ownsClipboard - ownsClipboard - () - - - ownsSelection - ownsSelection - () - - - pixmap - pixmap - ( Mode mode = Clipboard ) - - - selectionChanged - selectionChanged - () - - - setImage - setImage - ( const QImage & image, Mode mode = Clipboard ) - - - setMimeData - setMimeData - ( QMimeData * src, Mode mode = Clipboard ) - - - setPixmap - setPixmap - ( const QPixmap & pixmap, Mode mode = Clipboard ) - - - setText - setText - ( const QString & text, Mode mode = Clipboard ) - - - supportsSelection - supportsSelection - () - - - text - text - ( Mode mode = Clipboard ) - - - text - text-2 - ( QString & subtype, Mode mode = Clipboard ) - - - data - data - ( Mode mode = Clipboard ) - - - setData - setData - ( QMimeSource * src, Mode mode = Clipboard ) - - - - QCloseEvent - qcloseevent.html - - QCloseEvent - QCloseEvent - () - - - - QColorDialog - qcolordialog.html - - customColor - customColor - ( int i ) - - - customCount - customCount - () - - - getColor - getColor - ( const QColor & initial = Qt::white, QWidget * parent = 0 ) - - - getRgba - getRgba - ( QRgb initial, bool * ok = 0, QWidget * parent = 0 ) - - - setCustomColor - setCustomColor - ( int number, QRgb color ) - - - setStandardColor - setStandardColor - ( int number, QRgb color ) - - - getColor - getColor-2 - ( const QColor & init, QWidget * parent, const char * name ) - - - getRgba - getRgba-2 - ( QRgb rgba, bool * ok, QWidget * parent, const char * name ) - - - - QColorGroup - qcolorgroup.html - - QColorGroup - QColorGroup - () - - - QColorGroup - QColorGroup-2 - ( const QBrush & foreground, const QBrush & button, const QBrush & light, const QBrush & dark, const QBrush & mid, const QBrush & text, const QBrush & bright_text, const QBrush & base, const QBrush & background ) - - - QColorGroup - QColorGroup-3 - ( const QColor & foreground, const QColor & background, const QColor & light, const QColor & dark, const QColor & mid, const QColor & text, const QColor & base ) - - - QColorGroup - QColorGroup-4 - ( const QColorGroup & other ) - - - QColorGroup - QColorGroup-5 - ( const QPalette & pal ) - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QColorGroup & other ) - - - operator== - operator-eq-eq - ( const QColorGroup & other ) - - - background - background - () - - - base - base - () - - - brightText - brightText - () - - - button - button - () - - - buttonText - buttonText - () - - - dark - dark - () - - - foreground - foreground - () - - - highlight - highlight - () - - - highlightedText - highlightedText - () - - - light - light - () - - - link - link - () - - - linkVisited - linkVisited - () - - - mid - mid - () - - - midlight - midlight - () - - - shadow - shadow - () - - - text - text - () - - - - QColor - qcolor.html - - Spec - Spec-enum - - - - QColor - QColor - () - - - QColor - QColor-2 - ( int r, int g, int b, int a = 255 ) - - - QColor - QColor-3 - ( QRgb color ) - - - QColor - QColor-4 - ( const QString & name ) - - - QColor - QColor-5 - ( const char * name ) - - - QColor - QColor-6 - ( const QColor & color ) - - - QColor - QColor-8 - ( Qt::GlobalColor color ) - - - alpha - alpha - () - - - alphaF - alphaF - () - - - black - black - () - - - blackF - blackF - () - - - blue - blue - () - - - blueF - blueF - () - - - colorNames - colorNames - () - - - convertTo - convertTo - ( Spec colorSpec ) - - - cyan - cyan - () - - - cyanF - cyanF - () - - - dark - dark - ( int factor = 200 ) - - - fromCmyk - fromCmyk - ( int c, int m, int y, int k, int a = 255 ) - - - fromCmykF - fromCmykF - ( qreal c, qreal m, qreal y, qreal k, qreal a = 1.0 ) - - - fromHsv - fromHsv - ( int h, int s, int v, int a = 255 ) - - - fromHsvF - fromHsvF - ( qreal h, qreal s, qreal v, qreal a = 1.0 ) - - - fromRgb - fromRgb - ( QRgb rgb ) - - - fromRgb - fromRgb-2 - ( int r, int g, int b, int a = 255 ) - - - fromRgbF - fromRgbF - ( qreal r, qreal g, qreal b, qreal a = 1.0 ) - - - fromRgba - fromRgba - ( QRgb rgba ) - - - getCmyk - getCmyk - ( int * c, int * m, int * y, int * k, int * a = 0 ) - - - getCmykF - getCmykF - ( qreal * c, qreal * m, qreal * y, qreal * k, qreal * a = 0 ) - - - getHsv - getHsv - ( int * h, int * s, int * v, int * a = 0 ) - - - getHsvF - getHsvF - ( qreal * h, qreal * s, qreal * v, qreal * a = 0 ) - - - getRgb - getRgb - ( int * r, int * g, int * b, int * a = 0 ) - - - getRgbF - getRgbF - ( qreal * r, qreal * g, qreal * b, qreal * a = 0 ) - - - green - green - () - - - greenF - greenF - () - - - hue - hue - () - - - hueF - hueF - () - - - isValid - isValid - () - - - light - light - ( int factor = 150 ) - - - magenta - magenta - () - - - magentaF - magentaF - () - - - name - name - () - - - red - red - () - - - redF - redF - () - - - rgb - rgb - () - - - rgba - rgba - () - - - saturation - saturation - () - - - saturationF - saturationF - () - - - setAlpha - setAlpha - ( int alpha ) - - - setAlphaF - setAlphaF - ( qreal alpha ) - - - setBlue - setBlue - ( int blue ) - - - setBlueF - setBlueF - ( qreal blue ) - - - setCmyk - setCmyk - ( int c, int m, int y, int k, int a = 255 ) - - - setCmykF - setCmykF - ( qreal c, qreal m, qreal y, qreal k, qreal a = 1.0 ) - - - setGreen - setGreen - ( int green ) - - - setGreenF - setGreenF - ( qreal green ) - - - setHsv - setHsv - ( int h, int s, int v, int a = 255 ) - - - setHsvF - setHsvF - ( qreal h, qreal s, qreal v, qreal a = 1.0 ) - - - setNamedColor - setNamedColor - ( const QString & name ) - - - setRed - setRed - ( int red ) - - - setRedF - setRedF - ( qreal red ) - - - setRgb - setRgb - ( int r, int g, int b, int a = 255 ) - - - setRgb - setRgb-2 - ( QRgb rgb ) - - - setRgbF - setRgbF - ( qreal r, qreal g, qreal b, qreal a = 1.0 ) - - - setRgba - setRgba - ( QRgb rgba ) - - - spec - spec - () - - - toCmyk - toCmyk - () - - - toHsv - toHsv - () - - - toRgb - toRgb - () - - - value - value - () - - - valueF - valueF - () - - - yellow - yellow - () - - - yellowF - yellowF - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QColor & color ) - - - operator= - operator-eq - ( const QColor & color ) - - - operator= - operator-eq-2 - ( Qt::GlobalColor color ) - - - operator== - operator-eq-eq - ( const QColor & color ) - - - - QColormap - qcolormap.html - - Mode - Mode-enum - - - - QColormap - QColormap - ( const QColormap & colormap ) - - - colorAt - colorAt - ( uint pixel ) - - - colormap - colormap - () - - - depth - depth - () - - - hPal - hPal - () - - - instance - instance - ( int screen = -1 ) - - - mode - mode - () - - - pixel - pixel - ( const QColor & color ) - - - size - size - () - - - QColor - QColor-7 - ( int x, int y, int z, Spec colorSpec ) - - - getRgba - getRgba - ( int * r, int * g, int * b, int * a ) - - - hsv - hsv - ( int * h, int * s, int * v ) - - - pixel - pixel - ( int screen = -1 ) - - - rgb - rgb-2 - ( int * r, int * g, int * b ) - - - setRgba - setRgba-2 - ( int r, int g, int b, int a ) - - - - QComboBox - qcombobox.html - - InsertPolicy - InsertPolicy-enum - - - - SizeAdjustPolicy - SizeAdjustPolicy-enum - - - - CaseSensitivity - autoCompletionCaseSensitivity-prop - - - - QComboBox - QComboBox - ( QWidget * parent = 0 ) - - - activated - activated - ( int index ) - - - activated - activated-2 - ( const QString & text ) - - - addItem - addItem - ( const QString & text, const QVariant & userData = QVariant() - - - addItem - addItem-2 - ( const QIcon & icon, const QString & text, const QVariant & userData = QVariant() - - - addItems - addItems - ( const QStringList & texts ) - - - clear - clear - () - - - clearEditText - clearEditText - () - - - currentIndexChanged - currentIndexChanged - ( int index ) - - - currentIndexChanged - currentIndexChanged-2 - ( const QString & text ) - - - editTextChanged - editTextChanged - ( const QString & text ) - - - findData - findData - ( const QVariant & data, int role = Qt::UserRole, Qt::MatchFlags flags = Qt::MatchExactly | Qt::MatchCaseSensitive ) - - - findText - findText - ( const QString & text, Qt::MatchFlags flags = Qt::MatchExactly | Qt::MatchCaseSensitive ) - - - hidePopup - hidePopup - () - - - highlighted - highlighted - ( int index ) - - - highlighted - highlighted-2 - ( const QString & text ) - - - insertItem - insertItem - ( int index, const QString & text, const QVariant & userData = QVariant() - - - insertItem - insertItem-2 - ( int index, const QIcon & icon, const QString & text, const QVariant & userData = QVariant() - - - insertItems - insertItems - ( int index, const QStringList & list ) - - - itemData - itemData - ( int index, int role = Qt::UserRole ) - - - itemDelegate - itemDelegate - () - - - itemIcon - itemIcon - ( int index ) - - - itemText - itemText - ( int index ) - - - lineEdit - lineEdit - () - - - model - model - () - - - removeItem - removeItem - ( int index ) - - - rootModelIndex - rootModelIndex - () - - - setEditText - setEditText - ( const QString & text ) - - - setItemData - setItemData - ( int index, const QVariant & value, int role = Qt::UserRole ) - - - setItemDelegate - setItemDelegate - ( QAbstractItemDelegate * delegate ) - - - setItemIcon - setItemIcon - ( int index, const QIcon & icon ) - - - setItemText - setItemText - ( int index, const QString & text ) - - - setLineEdit - setLineEdit - ( QLineEdit * edit ) - - - setModel - setModel - ( QAbstractItemModel * model ) - - - setRootModelIndex - setRootModelIndex - ( const QModelIndex & index ) - - - setValidator - setValidator - ( const QValidator * validator ) - - - setView - setView - ( QAbstractItemView * itemView ) - - - showPopup - showPopup - () - - - validator - validator - () - - - view - view - () - - - Policy - Policy-typedef - - - - QComboBox - QComboBox-2 - ( QWidget * parent, const char * name ) - - - QComboBox - QComboBox-3 - ( bool rw, QWidget * parent, const char * name = 0 ) - - - changeItem - changeItem - ( const QString & text, int index ) - - - changeItem - changeItem-2 - ( const QPixmap & pixmap, int index ) - - - changeItem - changeItem-3 - ( const QPixmap & pixmap, const QString & text, int index ) - - - clearEdit - clearEdit - () - - - clearValidator - clearValidator - () - - - currentItem - currentItem - () - - - editable - editable - () - - - insertItem - insertItem-3 - ( const QString & text, int index = -1 ) - - - insertItem - insertItem-4 - ( const QPixmap & pixmap, int index = -1 ) - - - insertItem - insertItem-5 - ( const QPixmap & pixmap, const QString & text, int index = -1 ) - - - insertStringList - insertStringList - ( const QStringList & list, int index = -1 ) - - - insertionPolicy - insertionPolicy - () - - - pixmap - pixmap - ( int index ) - - - popup - popup - () - - - setCurrentItem - setCurrentItem - ( int index ) - - - setCurrentText - setCurrentText - ( const QString & text ) - - - setInsertionPolicy - setInsertionPolicy - ( InsertPolicy policy ) - - - text - text - ( int index ) - - - textChanged - textChanged - ( const QString & text ) - - - - QCommonStyle - qcommonstyle.html - - QCommonStyle - QCommonStyle - () - - - - QConicalGradient - qconicalgradient.html - - QConicalGradient - QConicalGradient - ( const QPointF & center, qreal angle ) - - - QConicalGradient - QConicalGradient-2 - ( qreal cx, qreal cy, qreal angle ) - - - angle - angle - () - - - center - center - () - - - - QConstString - qconststring.html - - QConstString - QConstString - ( const QChar * unicode, int size ) - - - string - string - () - - - - QContextMenuEvent - qcontextmenuevent.html - - Reason - Reason-enum - - - - QContextMenuEvent - QContextMenuEvent - ( Reason reason, const QPoint & pos, const QPoint & globalPos ) - - - QContextMenuEvent - QContextMenuEvent-2 - ( Reason reason, const QPoint & pos ) - - - globalPos - globalPos - () - - - globalX - globalX - () - - - globalY - globalY - () - - - pos - pos - () - - - reason - reason - () - - - x - x - () - - - y - y - () - - - QContextMenuEvent - QContextMenuEvent-3 - ( Reason reason, const QPoint & pos, const QPoint & globalPos, int dummy ) - - - QContextMenuEvent - QContextMenuEvent-4 - ( Reason reason, const QPoint & pos, int dummy ) - - - ButtonState - state - QContextMenuEvent::state() - - - - QCopChannel - qcopchannel.html - - QCopChannel - QCopChannel - ( const QString & channel, QObject * parent = 0 ) - - - channel - channel - () - - - isRegistered - isRegistered - ( const QString & channel ) - - - receive - receive - ( const QString & message, const QByteArray & data ) - - - received - received - ( const QString & message, const QByteArray & data ) - - - send - send - ( const QString & channel, const QString & message, const QByteArray & data ) - - - send - send-2 - ( const QString & channel, const QString & message ) - - - QCopChannel - QCopChannel-2 - ( const QString & channel, QObject * parent, const char * name ) - - - - QCoreApplication - qcoreapplication.html - - Encoding - Encoding-enum - - - - EventFilter - EventFilter-typedef - - - - QCoreApplication - QCoreApplication - ( int & argc, char ** argv ) - - - aboutToQuit - aboutToQuit - () - - - addLibraryPath - addLibraryPath - ( const QString & path ) - - - applicationDirPath - applicationDirPath - () - - - applicationFilePath - applicationFilePath - () - - - arguments - arguments - () - - - closingDown - closingDown - () - - - exec - exec - () - - - exit - exit - ( int returnCode = 0 ) - - - filterEvent - filterEvent - ( void * message, long * result ) - - - flush - flush - () - - - hasPendingEvents - hasPendingEvents - () - - - installTranslator - installTranslator - ( QTranslator * messageFile ) - - - instance - instance - () - - - libraryPaths - libraryPaths - () - - - notify - notify - ( QObject * receiver, QEvent * event ) - - - postEvent - postEvent - ( QObject * receiver, QEvent * event ) - - - processEvents - processEvents - ( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents ) - - - processEvents - processEvents-2 - ( QEventLoop::ProcessEventsFlags flags, int maxtime ) - - - quit - quit - () - - - removeLibraryPath - removeLibraryPath - ( const QString & path ) - - - removePostedEvents - removePostedEvents - ( QObject * receiver ) - - - removeTranslator - removeTranslator - ( QTranslator * messageFile ) - - - sendEvent - sendEvent - ( QObject * receiver, QEvent * event ) - - - sendPostedEvents - sendPostedEvents - ( QObject * receiver, int event_type ) - - - sendPostedEvents - sendPostedEvents-2 - () - - - setEventFilter - setEventFilter - ( EventFilter filter ) - - - setLibraryPaths - setLibraryPaths - ( const QStringList & paths ) - - - startingUp - startingUp - () - - - translate - translate - ( const char * context, const char * sourceText, const char * comment = 0, Encoding encoding = DefaultCodec ) - - - winEventFilter - winEventFilter - ( MSG * msg, long * result ) - - - argc - argc - () - - - argv - argv - () - - - enter_loop - enter_loop - () - - - exit_loop - exit_loop - () - - - lock - lock - () - - - locked - locked - () - - - loopLevel - loopLevel - () - - - processOneEvent - processOneEvent - () - - - tryLock - tryLock - () - - - unlock - unlock - ( bool wakeUpGui = true ) - - - - QCursor - qcursor.html - - QCursor - QCursor - () - - - QCursor - QCursor-2 - ( Qt::CursorShape shape ) - - - QCursor - QCursor-3 - ( const QBitmap & bitmap, const QBitmap & mask, int hotX = -1, int hotY = -1 ) - - - QCursor - QCursor-4 - ( const QPixmap & pixmap, int hotX = -1, int hotY = -1 ) - - - QCursor - QCursor-5 - ( const QCursor & c ) - - - QCursor - QCursor-6 - ( HCURSOR cursor ) - - - QCursor - QCursor-7 - ( Qt::HANDLE handle ) - - - QCursor - QCursor-8 - ( Qt::HANDLE cursor ) - - - bitmap - bitmap - () - - - handle - handle - () - - - HANDLE - handle-2 - QCursor::handle() - - - handle - handle-3 - () - - - hotSpot - hotSpot - () - - - mask - mask - () - - - pixmap - pixmap - () - - - pos - pos - () - - - setPos - setPos - ( int x, int y ) - - - setPos - setPos-2 - ( const QPoint & p ) - - - setShape - setShape - ( Qt::CursorShape shape ) - - - CursorShape - shape - QCursor::shape() - - - operator - operator-QVariant - QVariant() - - - operator= - operator-eq - ( const QCursor & c ) - - - - QCustomEvent - qcustomevent.html - - QCustomEvent - QCustomEvent - ( int type, void * data = 0 ) - - - data - data - () - - - setData - setData - ( void * data ) - - - - QDataStream - qdatastream.html - - ByteOrder - ByteOrder-enum - - - - Status - Status-enum - - - - Version - Version-enum - - - - QDataStream - QDataStream - () - - - QDataStream - QDataStream-2 - ( QIODevice * d ) - - - QDataStream - QDataStream-4 - ( QByteArray * a, QIODevice::OpenMode mode ) - - - QDataStream - QDataStream-5 - ( const QByteArray & a ) - - - atEnd - atEnd - () - - - byteOrder - byteOrder - () - - - device - device - () - - - readBytes - readBytes - ( char *& s, uint & l ) - - - readRawData - readRawData - ( char * s, int len ) - - - resetStatus - resetStatus - () - - - setByteOrder - setByteOrder - ( ByteOrder bo ) - - - setDevice - setDevice - ( QIODevice * d ) - - - setStatus - setStatus - ( Status status ) - - - setVersion - setVersion - ( int v ) - - - skipRawData - skipRawData - ( int len ) - - - status - status - () - - - unsetDevice - unsetDevice - () - - - version - version - () - - - writeBytes - writeBytes - ( const char * s, uint len ) - - - writeRawData - writeRawData - ( const char * s, int len ) - - - operator<< - operator-lt-lt - ( qint8 i ) - - - operator<< - operator-lt-lt-2 - ( bool i ) - - - operator<< - operator-lt-lt-3 - ( quint8 i ) - - - operator<< - operator-lt-lt-4 - ( quint16 i ) - - - operator<< - operator-lt-lt-5 - ( qint16 i ) - - - operator<< - operator-lt-lt-6 - ( qint32 i ) - - - operator<< - operator-lt-lt-7 - ( quint64 i ) - - - operator<< - operator-lt-lt-8 - ( qint64 i ) - - - operator<< - operator-lt-lt-9 - ( quint32 i ) - - - operator<< - operator-lt-lt-10 - ( float f ) - - - operator<< - operator-lt-lt-11 - ( double f ) - - - operator<< - operator-lt-lt-12 - ( const char * s ) - - - operator>> - operator-gt-gt - ( qint8 & i ) - - - operator>> - operator-gt-gt-2 - ( bool & i ) - - - operator>> - operator-gt-gt-3 - ( quint8 & i ) - - - operator>> - operator-gt-gt-4 - ( quint16 & i ) - - - operator>> - operator-gt-gt-5 - ( qint16 & i ) - - - operator>> - operator-gt-gt-6 - ( quint32 & i ) - - - operator>> - operator-gt-gt-7 - ( qint32 & i ) - - - operator>> - operator-gt-gt-8 - ( quint64 & i ) - - - operator>> - operator-gt-gt-9 - ( qint64 & i ) - - - operator>> - operator-gt-gt-10 - ( float & f ) - - - operator>> - operator-gt-gt-11 - ( double & f ) - - - operator>> - operator-gt-gt-12 - ( char *& s ) - - - QDataStream - QDataStream-3 - ( QByteArray * array, int mode ) - - - eof - eof - () - - - isPrintableData - isPrintableData - () - - - readRawBytes - readRawBytes - ( char * str, uint len ) - - - setPrintableData - setPrintableData - ( bool enable ) - - - writeRawBytes - writeRawBytes - ( const char * str, uint len ) - - - - QDateEdit - qdateedit.html - - QDateEdit - QDateEdit - ( QWidget * parent = 0 ) - - - QDateEdit - QDateEdit-2 - ( const QDate & date, QWidget * parent = 0 ) - - - - QDate - qdate.html - - QDate - QDate - () - - - QDate - QDate-2 - ( int y, int m, int d ) - - - addDays - addDays - ( int ndays ) - - - addMonths - addMonths - ( int nmonths ) - - - addYears - addYears - ( int nyears ) - - - currentDate - currentDate-2 - () - - - day - day - () - - - dayOfWeek - dayOfWeek - () - - - dayOfYear - dayOfYear - () - - - daysInMonth - daysInMonth - () - - - daysInYear - daysInYear - () - - - daysTo - daysTo - ( const QDate & d ) - - - fromJulianDay - fromJulianDay - ( int jd ) - - - fromString - fromString - ( const QString & string, Qt::DateFormat format = Qt::TextDate ) - - - fromString - fromString-2 - ( const QString & string, const QString & format ) - - - isLeapYear - isLeapYear - ( int year ) - - - isNull - isNull - () - - - isValid - isValid - () - - - isValid - isValid-2 - ( int y, int m, int d ) - - - longDayName - longDayName - ( int weekday ) - - - longMonthName - longMonthName - ( int month ) - - - month - month - () - - - setYMD - setYMD - ( int y, int m, int d ) - - - shortDayName - shortDayName - ( int weekday ) - - - shortMonthName - shortMonthName - ( int month ) - - - toJulianDay - toJulianDay - () - - - toString - toString - ( const QString & format ) - - - toString - toString-2 - ( Qt::DateFormat format = Qt::TextDate ) - - - weekNumber - weekNumber - ( int * yearNumber = 0 ) - - - year - year - () - - - operator!= - operator-not-eq - ( const QDate & d ) - - - operator< - operator-lt - ( const QDate & d ) - - - operator<= - operator-lt-eq - ( const QDate & d ) - - - operator== - operator-eq-eq - ( const QDate & d ) - - - operator> - operator-gt - ( const QDate & d ) - - - operator>= - operator-gt-eq - ( const QDate & d ) - - - currentDate - currentDate - ( Qt::TimeSpec spec ) - - - dayName - dayName - ( int weekday ) - - - leapYear - leapYear - ( int year ) - - - monthName - monthName - ( int month ) - - - - QDateTimeEdit - qdatetimeedit.html - - QDateTimeEdit - QDateTimeEdit - ( QWidget * parent = 0 ) - - - QDateTimeEdit - QDateTimeEdit-2 - ( const QDateTime & datetime, QWidget * parent = 0 ) - - - QDateTimeEdit - QDateTimeEdit-3 - ( const QDate & date, QWidget * parent = 0 ) - - - QDateTimeEdit - QDateTimeEdit-4 - ( const QTime & time, QWidget * parent = 0 ) - - - dateChanged - dateChanged - ( const QDate & date ) - - - dateTimeChanged - dateTimeChanged - ( const QDateTime & datetime ) - - - dateTimeFromText - dateTimeFromText - ( const QString & text ) - - - sectionText - sectionText - ( Section section ) - - - setDateRange - setDateRange - ( const QDate & min, const QDate & max ) - - - setTimeRange - setTimeRange - ( const QTime & min, const QTime & max ) - - - textFromDateTime - textFromDateTime - ( const QDateTime & dateTime ) - - - timeChanged - timeChanged - ( const QTime & time ) - - - - QDateTime - qdatetime.html - - QDateTime - QDateTime - () - - - QDateTime - QDateTime-2 - ( const QDate & date ) - - - QDateTime - QDateTime-3 - ( const QDate & date, const QTime & time, Qt::TimeSpec spec = Qt::LocalTime ) - - - QDateTime - QDateTime-4 - ( const QDateTime & other ) - - - addDays - addDays - ( int ndays ) - - - addMSecs - addMSecs - ( qint64 msecs ) - - - addMonths - addMonths - ( int nmonths ) - - - addSecs - addSecs - ( int nsecs ) - - - addYears - addYears - ( int nyears ) - - - currentDateTime - currentDateTime - () - - - date - date - () - - - daysTo - daysTo - ( const QDateTime & other ) - - - fromString - fromString - ( const QString & string, Qt::DateFormat format = Qt::TextDate ) - - - fromString - fromString-2 - ( const QString & string, const QString & format ) - - - isNull - isNull - () - - - isValid - isValid - () - - - secsTo - secsTo - ( const QDateTime & other ) - - - setDate - setDate - ( const QDate & date ) - - - setTime - setTime - ( const QTime & time ) - - - setTimeSpec - setTimeSpec - ( Qt::TimeSpec spec ) - - - setTime_t - setTime_t - ( uint seconds ) - - - time - time - () - - - TimeSpec - timeSpec - QDateTime::timeSpec() - - - toLocalTime - toLocalTime - () - - - toString - toString - ( const QString & format ) - - - toString - toString-2 - ( Qt::DateFormat format = Qt::TextDate ) - - - toTimeSpec - toTimeSpec - ( Qt::TimeSpec specification ) - - - toTime_t - toTime_t - () - - - toUTC - toUTC - () - - - operator!= - operator-not-eq - ( const QDateTime & other ) - - - operator< - operator-lt - ( const QDateTime & other ) - - - operator<= - operator-lt-eq - ( const QDateTime & other ) - - - operator= - operator-eq - ( const QDateTime & other ) - - - operator== - operator-eq-eq - ( const QDateTime & other ) - - - operator> - operator-gt - ( const QDateTime & other ) - - - operator>= - operator-gt-eq - ( const QDateTime & other ) - - - currentDateTime - currentDateTime-2 - ( Qt::TimeSpec spec ) - - - setTime_t - setTime_t-2 - ( uint secsSince1Jan1970UTC, Qt::TimeSpec spec ) - - - - QDecorationFactory - qdecorationfactory.html - - create - create - ( const QString & key ) - - - keys - keys - () - - - - QDecoration - qdecoration.html - - DecorationRegion - DecorationRegion-enum - - - - DecorationState - DecorationState-enum - - - - QDecoration - QDecoration - () - - - buildSysMenu - buildSysMenu - ( QWidget * widget, QMenu * menu ) - - - menuTriggered - menuTriggered - ( QWidget * widget, QAction * action ) - - - paint - paint - ( QPainter * painter, const QWidget * widget, int decorationRegion = All, DecorationState state = Normal ) - - - region - region - ( const QWidget * widget, const QRect & rectangle, int decorationRegion = All ) - - - region - region-2 - ( const QWidget * widget, int decorationRegion = All ) - - - regionAt - regionAt - ( const QWidget * widget, const QPoint & point ) - - - regionClicked - regionClicked - ( QWidget * widget, int region ) - - - regionDoubleClicked - regionDoubleClicked - ( QWidget * widget, int region ) - - - startMove - startMove - ( QWidget * widget ) - - - startResize - startResize - ( QWidget * widget ) - - - - QDecorationPlugin - qdecorationplugin.html - - QDecorationPlugin - QDecorationPlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key ) - - - keys - keys - () - - - - QDesignerActionEditorInterface - qdesigneractioneditorinterface.html - - QDesignerActionEditorInterface - QDesignerActionEditorInterface - ( QWidget * parent, Qt::WindowFlags flags = 0 ) - - - core - core - () - - - manageAction - manageAction - ( QAction * action ) - - - setFormWindow - setFormWindow - ( QDesignerFormWindowInterface * formWindow ) - - - unmanageAction - unmanageAction - ( QAction * action ) - - - - QDesignerContainerExtension - qdesignercontainerextension.html - - addWidget - addWidget - ( QWidget * page ) - - - count - count - () - - - currentIndex - currentIndex - () - - - insertWidget - insertWidget - ( int index, QWidget * page ) - - - remove - remove - ( int index ) - - - setCurrentIndex - setCurrentIndex - ( int index ) - - - widget - widget - ( int index ) - - - - QDesignerCustomWidgetCollectionInterface - qdesignercustomwidgetcollectioninterface.html - - customWidgets - customWidgets - () - - - - QDesignerCustomWidgetInterface - qdesignercustomwidgetinterface.html - - codeTemplate - codeTemplate - () - - - createWidget - createWidget - ( QWidget * parent ) - - - domXml - domXml - () - - - group - group - () - - - icon - icon - () - - - includeFile - includeFile - () - - - initialize - initialize - ( QDesignerFormEditorInterface * formEditor ) - - - isContainer - isContainer - () - - - isInitialized - isInitialized - () - - - name - name - () - - - toolTip - toolTip - () - - - whatsThis - whatsThis - () - - - - QDesignerFormEditorInterface - qdesignerformeditorinterface.html - - QDesignerFormEditorInterface - QDesignerFormEditorInterface - ( QObject * parent = 0 ) - - - actionEditor - actionEditor - () - - - extensionManager - extensionManager - () - - - formWindowManager - formWindowManager - () - - - objectInspector - objectInspector - () - - - propertyEditor - propertyEditor - () - - - setActionEditor - setActionEditor - ( QDesignerActionEditorInterface * actionEditor ) - - - setObjectInspector - setObjectInspector - ( QDesignerObjectInspectorInterface * objectInspector ) - - - setPropertyEditor - setPropertyEditor - ( QDesignerPropertyEditorInterface * propertyEditor ) - - - setWidgetBox - setWidgetBox - ( QDesignerWidgetBoxInterface * widgetBox ) - - - topLevel - topLevel - () - - - widgetBox - widgetBox - () - - - - QDesignerFormWindowCursorInterface - qdesignerformwindowcursorinterface.html - - MoveMode - MoveMode-enum - - - - MoveOperation - MoveOperation-enum - - - - current - current - () - - - formWindow - formWindow - () - - - hasSelection - hasSelection - () - - - isWidgetSelected - isWidgetSelected - ( QWidget * widget ) - - - movePosition - movePosition - ( MoveOperation operation, MoveMode mode = MoveAnchor ) - - - position - position - () - - - resetWidgetProperty - resetWidgetProperty - ( QWidget * widget, const QString & name ) - - - selectedWidget - selectedWidget - ( int index ) - - - selectedWidgetCount - selectedWidgetCount - () - - - setPosition - setPosition - ( int position, MoveMode mode = MoveAnchor ) - - - setProperty - setProperty - ( const QString & name, const QVariant & value ) - - - setWidgetProperty - setWidgetProperty - ( QWidget * widget, const QString & name, const QVariant & value ) - - - widget - widget - ( int index ) - - - widgetCount - widgetCount - () - - - - QDesignerFormWindowInterface - qdesignerformwindowinterface.html - - QDesignerFormWindowInterface - QDesignerFormWindowInterface - ( QWidget * parent = 0, Qt::WindowFlags flags = 0 ) - - - aboutToUnmanageWidget - aboutToUnmanageWidget - ( QWidget * widget ) - - - absoluteDir - absoluteDir - () - - - activated - activated - ( QWidget * widget ) - - - addResourceFile - addResourceFile - ( const QString & path ) - - - author - author - () - - - changed - changed - () - - - clearSelection - clearSelection - ( bool update = true ) - - - comment - comment - () - - - contents - contents - () - - - core - core - () - - - cursor - cursor - () - - - emitSelectionChanged - emitSelectionChanged - () - - - exportMacro - exportMacro - () - - - featureChanged - featureChanged - ( Feature feature ) - - - features - features - () - - - fileName - fileName - () - - - fileNameChanged - fileNameChanged - ( const QString & fileName ) - - - findFormWindow - findFormWindow - ( QWidget * widget ) - - - geometryChanged - geometryChanged - () - - - grid - grid - () - - - hasFeature - hasFeature - ( Feature feature ) - - - includeHints - includeHints - () - - - isDirty - isDirty - () - - - isManaged - isManaged - ( QWidget * widget ) - - - layoutDefault - layoutDefault - ( int * margin, int * spacing ) - - - layoutFunction - layoutFunction - ( QString * margin, QString * spacing ) - - - mainContainer - mainContainer - () - - - mainContainerChanged - mainContainerChanged - ( QWidget * mainContainer ) - - - manageWidget - manageWidget - ( QWidget * widget ) - - - pixmapFunction - pixmapFunction - () - - - removeResourceFile - removeResourceFile - ( const QString & path ) - - - resourceFiles - resourceFiles - () - - - resourceFilesChanged - resourceFilesChanged - () - - - selectWidget - selectWidget - ( QWidget * widget, bool select = true ) - - - selectionChanged - selectionChanged - () - - - setAuthor - setAuthor - ( const QString & author ) - - - setComment - setComment - ( const QString & comment ) - - - setContents - setContents - ( QIODevice * device ) - - - setContents - setContents-2 - ( const QString & contents ) - - - setDirty - setDirty - ( bool dirty ) - - - setExportMacro - setExportMacro - ( const QString & exportMacro ) - - - setFeatures - setFeatures - ( Feature features ) - - - setFileName - setFileName - ( const QString & fileName ) - - - setGrid - setGrid - ( const QPoint & grid ) - - - setIncludeHints - setIncludeHints - ( const QStringList & includeHints ) - - - setLayoutDefault - setLayoutDefault - ( int margin, int spacing ) - - - setLayoutFunction - setLayoutFunction - ( const QString & margin, const QString & spacing ) - - - setMainContainer - setMainContainer - ( QWidget * mainContainer ) - - - setPixmapFunction - setPixmapFunction - ( const QString & pixmapFunction ) - - - unmanageWidget - unmanageWidget - ( QWidget * widget ) - - - widgetManaged - widgetManaged - ( QWidget * widget ) - - - widgetRemoved - widgetRemoved - ( QWidget * widget ) - - - widgetUnmanaged - widgetUnmanaged - ( QWidget * widget ) - - - - QDesignerFormWindowManagerInterface - qdesignerformwindowmanagerinterface.html - - QDesignerFormWindowManagerInterface - QDesignerFormWindowManagerInterface - ( QObject * parent = 0 ) - - - actionAdjustSize - actionAdjustSize - () - - - actionBreakLayout - actionBreakLayout - () - - - actionCopy - actionCopy - () - - - actionCut - actionCut - () - - - actionDelete - actionDelete - () - - - actionGridLayout - actionGridLayout - () - - - actionHorizontalLayout - actionHorizontalLayout - () - - - actionLower - actionLower - () - - - actionPaste - actionPaste - () - - - actionRaise - actionRaise - () - - - actionRedo - actionRedo - () - - - actionSelectAll - actionSelectAll - () - - - actionSplitHorizontal - actionSplitHorizontal - () - - - actionSplitVertical - actionSplitVertical - () - - - actionUndo - actionUndo - () - - - actionVerticalLayout - actionVerticalLayout - () - - - activeFormWindow - activeFormWindow - () - - - activeFormWindowChanged - activeFormWindowChanged - ( QDesignerFormWindowInterface * formWindow ) - - - addFormWindow - addFormWindow - ( QDesignerFormWindowInterface * formWindow ) - - - core - core - () - - - createFormWindow - createFormWindow - ( QWidget * parent = 0, Qt::WindowFlags flags = 0 ) - - - formWindow - formWindow - ( int index ) - - - formWindowAdded - formWindowAdded - ( QDesignerFormWindowInterface * formWindow ) - - - formWindowCount - formWindowCount - () - - - formWindowRemoved - formWindowRemoved - ( QDesignerFormWindowInterface * formWindow ) - - - removeFormWindow - removeFormWindow - ( QDesignerFormWindowInterface * formWindow ) - - - setActiveFormWindow - setActiveFormWindow - ( QDesignerFormWindowInterface * formWindow ) - - - - QDesignerMemberSheetExtension - qdesignermembersheetextension.html - - count - count - () - - - declaredInClass - declaredInClass - ( int index ) - - - indexOf - indexOf - ( const QString & name ) - - - inheritedFromWidget - inheritedFromWidget - ( int index ) - - - isSignal - isSignal - ( int index ) - - - isSlot - isSlot - ( int index ) - - - isVisible - isVisible - ( int index ) - - - memberGroup - memberGroup - ( int index ) - - - memberName - memberName - ( int index ) - - - parameterNames - parameterNames - ( int index ) - - - parameterTypes - parameterTypes - ( int index ) - - - setMemberGroup - setMemberGroup - ( int index, const QString & group ) - - - setVisible - setVisible - ( int index, bool visible ) - - - signature - signature - ( int index ) - - - - QDesignerObjectInspectorInterface - qdesignerobjectinspectorinterface.html - - QDesignerObjectInspectorInterface - QDesignerObjectInspectorInterface - ( QWidget * parent, Qt::WindowFlags flags = 0 ) - - - core - core - () - - - setFormWindow - setFormWindow - ( QDesignerFormWindowInterface * formWindow ) - - - - QDesignerPropertyEditorInterface - qdesignerpropertyeditorinterface.html - - QDesignerPropertyEditorInterface - QDesignerPropertyEditorInterface - ( QWidget * parent, Qt::WindowFlags flags = 0 ) - - - core - core - () - - - currentPropertyName - currentPropertyName - () - - - isReadOnly - isReadOnly - () - - - object - object - () - - - propertyChanged - propertyChanged - ( const QString & name, const QVariant & value ) - - - setObject - setObject - ( QObject * object ) - - - setPropertyValue - setPropertyValue - ( const QString & name, const QVariant & value, bool changed = true ) - - - setReadOnly - setReadOnly - ( bool readOnly ) - - - - QDesignerPropertySheetExtension - qdesignerpropertysheetextension.html - - count - count - () - - - hasReset - hasReset - ( int index ) - - - indexOf - indexOf - ( const QString & name ) - - - isAttribute - isAttribute - ( int index ) - - - isChanged - isChanged - ( int index ) - - - isVisible - isVisible - ( int index ) - - - property - property - ( int index ) - - - propertyGroup - propertyGroup - ( int index ) - - - propertyName - propertyName - ( int index ) - - - reset - reset - ( int index ) - - - setAttribute - setAttribute - ( int index, bool attribute ) - - - setChanged - setChanged - ( int index, bool changed ) - - - setProperty - setProperty - ( int index, const QVariant & value ) - - - setPropertyGroup - setPropertyGroup - ( int index, const QString & group ) - - - setVisible - setVisible - ( int index, bool visible ) - - - - QDesignerTaskMenuExtension - qdesignertaskmenuextension.html - - preferredEditAction - preferredEditAction - () - - - taskActions - taskActions - () - - - - QDesignerWidgetBoxInterface - qdesignerwidgetboxinterface.html - - QDesignerWidgetBoxInterface - QDesignerWidgetBoxInterface - ( QWidget * parent = 0, Qt::WindowFlags flags = 0 ) - - - fileName - fileName - () - - - load - load - () - - - save - save - () - - - setFileName - setFileName - ( const QString & fileName ) - - - - QDesktopWidget - qdesktopwidget.html - - QDesktopWidget - QDesktopWidget - () - - - availableGeometry - availableGeometry - ( int screen = -1 ) - - - availableGeometry - availableGeometry-2 - ( const QWidget * widget ) - - - availableGeometry - availableGeometry-3 - ( const QPoint & p ) - - - isVirtualDesktop - isVirtualDesktop - () - - - numScreens - numScreens - () - - - primaryScreen - primaryScreen - () - - - resized - resized - ( int screen ) - - - screen - screen - ( int screen = -1 ) - - - screenGeometry - screenGeometry - ( int screen = -1 ) - - - screenGeometry - screenGeometry-2 - ( const QWidget * widget ) - - - screenGeometry - screenGeometry-3 - ( const QPoint & p ) - - - screenNumber - screenNumber - ( const QWidget * widget = 0 ) - - - screenNumber - screenNumber-2 - ( const QPoint & point ) - - - workAreaResized - workAreaResized - ( int screen ) - - - - QDial - qdial.html - - QDial - QDial - ( QWidget * parent = 0 ) - - - - QDialog - qdialog.html - - DialogCode - DialogCode-enum - - - - QDialog - QDialog - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - accept - accept - () - - - accepted - accepted - () - - - done - done - ( int r ) - - - exec - exec - () - - - extension - extension - () - - - finished - finished - ( int result ) - - - Orientation - orientation - QDialog::orientation() - - - reject - reject - () - - - rejected - rejected - () - - - result - result - () - - - setExtension - setExtension - ( QWidget * extension ) - - - setOrientation - setOrientation - ( Qt::Orientation orientation ) - - - setResult - setResult - ( int i ) - - - showExtension - showExtension - ( bool showIt ) - - - QDialog - QDialog-2 - ( QWidget * parent, const char * name, bool modal = false, Qt::WFlags f = 0 ) - - - QDial - QDial-2 - ( int minValue, int maxValue, int pageStep, int value, QWidget * parent = 0, const char * name = 0 ) - - - QDial - QDial-3 - ( QWidget * parent, const char * name ) - - - dialMoved - dialMoved - ( int value ) - - - dialPressed - dialPressed - () - - - dialReleased - dialReleased - () - - - - QDirectPainter - qdirectpainter.html - - frameBuffer - frameBuffer - () - - - linestep - linestep - () - - - lock - lock - () - - - region - region - () - - - reserveRegion - reserveRegion - ( const QRegion & region ) - - - screenDepth - screenDepth - () - - - screenHeight - screenHeight - () - - - screenWidth - screenWidth - () - - - unlock - unlock - () - - - - QDir - qdir.html - - FilterSpec - FilterSpec-typedef - - - - SortSpec - SortSpec-typedef - - - - QDir - QDir - ( const QDir & dir ) - - - QDir - QDir-2 - ( const QString & path = QString() - - - QDir - QDir-3 - ( const QString & path, const QString & nameFilter, SortFlags sort = SortFlags( Name | IgnoreCase ) - - - absoluteFilePath - absoluteFilePath - ( const QString & fileName ) - - - absolutePath - absolutePath - () - - - addResourceSearchPath - addResourceSearchPath - ( const QString & path ) - - - canonicalPath - canonicalPath - () - - - cd - cd - ( const QString & dirName ) - - - cdUp - cdUp - () - - - cleanPath - cleanPath - ( const QString & path ) - - - convertSeparators - convertSeparators - ( const QString & pathName ) - - - count - count - () - - - current - current - () - - - currentPath - currentPath - () - - - dirName - dirName - () - - - drives - drives - () - - - entryInfoList - entryInfoList - ( const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort ) - - - entryInfoList - entryInfoList-3 - ( Filters filters = NoFilter, SortFlags sort = NoSort ) - - - entryList - entryList - ( const QStringList & nameFilters, Filters filters = NoFilter, SortFlags sort = NoSort ) - - - entryList - entryList-3 - ( Filters filters = NoFilter, SortFlags sort = NoSort ) - - - exists - exists - ( const QString & name ) - - - exists - exists-2 - () - - - filePath - filePath - ( const QString & fileName ) - - - filter - filter - () - - - home - home - () - - - homePath - homePath - () - - - isAbsolute - isAbsolute - () - - - isAbsolutePath - isAbsolutePath - ( const QString & path ) - - - isReadable - isReadable - () - - - isRelative - isRelative - () - - - isRelativePath - isRelativePath - ( const QString & path ) - - - isRoot - isRoot - () - - - makeAbsolute - makeAbsolute - () - - - match - match - ( const QString & filter, const QString & fileName ) - - - match - match-2 - ( const QStringList & filters, const QString & fileName ) - - - mkdir - mkdir - ( const QString & dirName ) - - - mkpath - mkpath - ( const QString & dirPath ) - - - nameFilters - nameFilters - () - - - path - path - () - - - refresh - refresh - () - - - relativeFilePath - relativeFilePath - ( const QString & fileName ) - - - remove - remove - ( const QString & fileName ) - - - rename - rename - ( const QString & oldName, const QString & newName ) - - - rmdir - rmdir - ( const QString & dirName ) - - - rmpath - rmpath - ( const QString & dirPath ) - - - root - root - () - - - rootPath - rootPath - () - - - separator - separator - () - - - setCurrent - setCurrent - ( const QString & path ) - - - setFilter - setFilter - ( Filters filters ) - - - setNameFilters - setNameFilters - ( const QStringList & nameFilters ) - - - setPath - setPath - ( const QString & path ) - - - setSorting - setSorting - ( SortFlags sort ) - - - sorting - sorting - () - - - temp - temp - () - - - tempPath - tempPath - () - - - operator!= - operator-not-eq - ( const QDir & dir ) - - - operator= - operator-eq - ( const QDir & dir ) - - - operator== - operator-eq-eq - ( const QDir & dir ) - - - operator[] - operator-5b-5d - ( int pos ) - - - - QDirModel - qdirmodel.html - - Roles - Roles-enum - - - - QDirModel - QDirModel - ( const QStringList & nameFilters, QDir::Filters filters, QDir::SortFlags sort, QObject * parent = 0 ) - - - QDirModel - QDirModel-2 - ( QObject * parent = 0 ) - - - columnCount - columnCount - ( const QModelIndex & parent ) - - - data - data - ( const QModelIndex & index, int role = Qt::DisplayRole ) - - - dropMimeData - dropMimeData - ( const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent ) - - - fileIcon - fileIcon - ( const QModelIndex & index ) - - - fileInfo - fileInfo - ( const QModelIndex & index ) - - - fileName - fileName - ( const QModelIndex & index ) - - - filePath - filePath - ( const QModelIndex & index ) - - - Filters - filter - QDirModel::filter() - - - ItemFlags - flags - QDirModel::flags( const QModelIndex & index ) - - - hasChildren - hasChildren - ( const QModelIndex & parent ) - - - headerData - headerData - ( int section, Qt::Orientation orientation, int role ) - - - iconProvider - iconProvider - () - - - index - index - ( int row, int column, const QModelIndex & parent = QModelIndex() - - - index - index-2 - ( const QString & path, int column = 0 ) - - - isDir - isDir - ( const QModelIndex & index ) - - - mimeData - mimeData - ( const QModelIndexList & indexes ) - - - mimeTypes - mimeTypes - () - - - mkdir - mkdir - ( const QModelIndex & parent, const QString & name ) - - - nameFilters - nameFilters - () - - - parent - parent - ( const QModelIndex & child ) - - - refresh - refresh - ( const QModelIndex & parent = QModelIndex() - - - remove - remove - ( const QModelIndex & index ) - - - rmdir - rmdir - ( const QModelIndex & index ) - - - rowCount - rowCount - ( const QModelIndex & parent ) - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role ) - - - setFilter - setFilter - ( QDir::Filters filters ) - - - setIconProvider - setIconProvider - ( QFileIconProvider * provider ) - - - setNameFilters - setNameFilters - ( const QStringList & filters ) - - - setSorting - setSorting - ( QDir::SortFlags sort ) - - - sort - sort - ( int column, Qt::SortOrder order ) - - - SortFlags - sorting - QDirModel::sorting() - - - DropActions - supportedDropActions - QDirModel::supportedDropActions() - - - operator= - operator-eq-2 - ( const QString & path ) - - - absFilePath - absFilePath - ( const QString & fileName, bool acceptAbsPath = true ) - - - absPath - absPath - () - - - cleanDirPath - cleanDirPath - ( const QString & name ) - - - convertToAbs - convertToAbs - () - - - currentDirPath - currentDirPath - () - - - entryInfoList - entryInfoList-2 - ( const QString & nameFilter, Filters filters = NoFilter, SortFlags sort = NoSort ) - - - entryList - entryList-2 - ( const QString & nameFilter, Filters filters = NoFilter, SortFlags sort = NoSort ) - - - homeDirPath - homeDirPath - () - - - matchAllDirs - matchAllDirs - () - - - mkdir - mkdir-2 - ( const QString & dirName, bool acceptAbsPath ) - - - nameFilter - nameFilter - () - - - rmdir - rmdir-2 - ( const QString & dirName, bool acceptAbsPath ) - - - rootDirPath - rootDirPath - () - - - setMatchAllDirs - setMatchAllDirs - ( bool on ) - - - setNameFilter - setNameFilter - ( const QString & nameFilter ) - - - - QDockWidget - qdockwidget.html - - DockWidgetAreas - allowedAreas-prop - - - - QDockWidget - QDockWidget - ( const QString & title, QWidget * parent = 0, Qt::WFlags flags = 0 ) - - - QDockWidget - QDockWidget-2 - ( QWidget * parent = 0, Qt::WFlags flags = 0 ) - - - allowedAreasChanged - allowedAreasChanged - ( Qt::DockWidgetAreas allowedAreas ) - - - featuresChanged - featuresChanged - ( QDockWidget::DockWidgetFeatures features ) - - - isAreaAllowed - isAreaAllowed - ( Qt::DockWidgetArea area ) - - - setWidget - setWidget - ( QWidget * widget ) - - - toggleViewAction - toggleViewAction - () - - - topLevelChanged - topLevelChanged - ( bool topLevel ) - - - widget - widget - () - - - - QDomAttr - qdomattr.html - - QDomAttr - QDomAttr - () - - - QDomAttr - QDomAttr-2 - ( const QDomAttr & x ) - - - name - name - () - - - NodeType - nodeType - QDomAttr::nodeType() - - - ownerElement - ownerElement - () - - - setValue - setValue - ( const QString & v ) - - - specified - specified - () - - - value - value - () - - - operator= - operator-eq - ( const QDomAttr & x ) - - - - QDomCDATASection - qdomcdatasection.html - - QDomCDATASection - QDomCDATASection - () - - - QDomCDATASection - QDomCDATASection-2 - ( const QDomCDATASection & x ) - - - NodeType - nodeType - QDomCDATASection::nodeType() - - - operator= - operator-eq - ( const QDomCDATASection & x ) - - - - QDomCharacterData - qdomcharacterdata.html - - QDomCharacterData - QDomCharacterData - () - - - QDomCharacterData - QDomCharacterData-2 - ( const QDomCharacterData & x ) - - - appendData - appendData - ( const QString & arg ) - - - data - data - () - - - deleteData - deleteData - ( unsigned long offset, unsigned long count ) - - - insertData - insertData - ( unsigned long offset, const QString & arg ) - - - length - length - () - - - NodeType - nodeType - QDomCharacterData::nodeType() - - - replaceData - replaceData - ( unsigned long offset, unsigned long count, const QString & arg ) - - - setData - setData - ( const QString & v ) - - - substringData - substringData - ( unsigned long offset, unsigned long count ) - - - operator= - operator-eq - ( const QDomCharacterData & x ) - - - - QDomComment - qdomcomment.html - - QDomComment - QDomComment - () - - - QDomComment - QDomComment-2 - ( const QDomComment & x ) - - - NodeType - nodeType - QDomComment::nodeType() - - - operator= - operator-eq - ( const QDomComment & x ) - - - - QDomDocumentFragment - qdomdocumentfragment.html - - QDomDocumentFragment - QDomDocumentFragment - () - - - QDomDocumentFragment - QDomDocumentFragment-2 - ( const QDomDocumentFragment & x ) - - - NodeType - nodeType - QDomDocumentFragment::nodeType() - - - operator= - operator-eq - ( const QDomDocumentFragment & x ) - - - - QDomDocument - qdomdocument.html - - QDomDocument - QDomDocument - () - - - QDomDocument - QDomDocument-2 - ( const QString & name ) - - - QDomDocument - QDomDocument-3 - ( const QDomDocumentType & doctype ) - - - QDomDocument - QDomDocument-4 - ( const QDomDocument & x ) - - - createAttribute - createAttribute - ( const QString & name ) - - - createAttributeNS - createAttributeNS - ( const QString & nsURI, const QString & qName ) - - - createCDATASection - createCDATASection - ( const QString & value ) - - - createComment - createComment - ( const QString & value ) - - - createDocumentFragment - createDocumentFragment - () - - - createElement - createElement - ( const QString & tagName ) - - - createElementNS - createElementNS - ( const QString & nsURI, const QString & qName ) - - - createEntityReference - createEntityReference - ( const QString & name ) - - - createProcessingInstruction - createProcessingInstruction - ( const QString & target, const QString & data ) - - - createTextNode - createTextNode - ( const QString & value ) - - - doctype - doctype - () - - - documentElement - documentElement - () - - - elementById - elementById - ( const QString & elementId ) - - - elementsByTagName - elementsByTagName - ( const QString & tagname ) - - - elementsByTagNameNS - elementsByTagNameNS - ( const QString & nsURI, const QString & localName ) - - - implementation - implementation - () - - - importNode - importNode - ( const QDomNode & importedNode, bool deep ) - - - NodeType - nodeType - QDomDocument::nodeType() - - - setContent - setContent - ( const QByteArray & data, bool namespaceProcessing, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - setContent - setContent-2 - ( const QString & text, bool namespaceProcessing, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - setContent - setContent-3 - ( QIODevice * dev, bool namespaceProcessing, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - setContent - setContent-4 - ( const QString & text, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - setContent - setContent-5 - ( const QByteArray & buffer, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - setContent - setContent-6 - ( QIODevice * dev, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - setContent - setContent-7 - ( QXmlInputSource * source, QXmlReader * reader, QString * errorMsg = 0, int * errorLine = 0, int * errorColumn = 0 ) - - - toByteArray - toByteArray - ( int indent = 1 ) - - - toString - toString - ( int indent = 1 ) - - - operator= - operator-eq - ( const QDomDocument & x ) - - - - QDomDocumentType - qdomdocumenttype.html - - QDomDocumentType - QDomDocumentType - () - - - QDomDocumentType - QDomDocumentType-2 - ( const QDomDocumentType & n ) - - - entities - entities - () - - - internalSubset - internalSubset - () - - - name - name - () - - - NodeType - nodeType - QDomDocumentType::nodeType() - - - notations - notations - () - - - publicId - publicId - () - - - systemId - systemId - () - - - operator= - operator-eq - ( const QDomDocumentType & n ) - - - - QDomElement - qdomelement.html - - QDomElement - QDomElement - () - - - QDomElement - QDomElement-2 - ( const QDomElement & x ) - - - attribute - attributex - ( const QString & name, const QString & defValue = QString() - - - attributeNS - attributeNS - ( const QString nsURI, const QString & localName, const QString & defValue = QString() - - - attributeNode - attributeNode - ( const QString & name ) - - - attributeNodeNS - attributeNodeNS - ( const QString & nsURI, const QString & localName ) - - - attributes - attributes - () - - - elementsByTagName - elementsByTagName - ( const QString & tagname ) - - - elementsByTagNameNS - elementsByTagNameNS - ( const QString & nsURI, const QString & localName ) - - - hasAttribute - hasAttribute - ( const QString & name ) - - - hasAttributeNS - hasAttributeNS - ( const QString & nsURI, const QString & localName ) - - - NodeType - nodeType - QDomElement::nodeType() - - - removeAttribute - removeAttribute - ( const QString & name ) - - - removeAttributeNS - removeAttributeNS - ( const QString & nsURI, const QString & localName ) - - - removeAttributeNode - removeAttributeNode - ( const QDomAttr & oldAttr ) - - - setAttribute - setAttribute - ( const QString & name, const QString & value ) - - - setAttribute - setAttribute-2 - ( const QString & name, int value ) - - - setAttribute - setAttribute-3 - ( const QString & name, uint value ) - - - setAttribute - setAttribute-4 - ( const QString & name, qlonglong value ) - - - setAttribute - setAttribute-5 - ( const QString & name, qulonglong value ) - - - setAttribute - setAttribute-6 - ( const QString & name, float value ) - - - setAttribute - setAttribute-7 - ( const QString & name, double value ) - - - setAttributeNS - setAttributeNS - ( const QString nsURI, const QString & qName, const QString & value ) - - - setAttributeNS - setAttributeNS-2 - ( const QString nsURI, const QString & qName, int value ) - - - setAttributeNS - setAttributeNS-3 - ( const QString nsURI, const QString & qName, uint value ) - - - setAttributeNS - setAttributeNS-4 - ( const QString nsURI, const QString & qName, qlonglong value ) - - - setAttributeNS - setAttributeNS-5 - ( const QString nsURI, const QString & qName, qulonglong value ) - - - setAttributeNS - setAttributeNS-6 - ( const QString nsURI, const QString & qName, double value ) - - - setAttributeNode - setAttributeNode - ( const QDomAttr & newAttr ) - - - setAttributeNodeNS - setAttributeNodeNS - ( const QDomAttr & newAttr ) - - - setTagName - setTagName - ( const QString & name ) - - - tagName - tagName - () - - - text - text - () - - - operator= - operator-eq - ( const QDomElement & x ) - - - - QDomEntity - qdomentity.html - - QDomEntity - QDomEntity - () - - - QDomEntity - QDomEntity-2 - ( const QDomEntity & x ) - - - NodeType - nodeType - QDomEntity::nodeType() - - - notationName - notationName - () - - - publicId - publicId - () - - - systemId - systemId - () - - - operator= - operator-eq - ( const QDomEntity & x ) - - - - QDomEntityReference - qdomentityreference.html - - QDomEntityReference - QDomEntityReference - () - - - QDomEntityReference - QDomEntityReference-2 - ( const QDomEntityReference & x ) - - - NodeType - nodeType - QDomEntityReference::nodeType() - - - operator= - operator-eq - ( const QDomEntityReference & x ) - - - - QDomImplementation - qdomimplementation.html - - InvalidDataPolicy - InvalidDataPolicy-enum - - - - QDomImplementation - QDomImplementation - () - - - QDomImplementation - QDomImplementation-2 - ( const QDomImplementation & x ) - - - createDocument - createDocument - ( const QString & nsURI, const QString & qName, const QDomDocumentType & doctype ) - - - createDocumentType - createDocumentType - ( const QString & qName, const QString & publicId, const QString & systemId ) - - - hasFeature - hasFeature - ( const QString & feature, const QString & version ) - - - invalidDataPolicy - invalidDataPolicy - () - - - isNull - isNull - () - - - setInvalidDataPolicy - setInvalidDataPolicy - ( InvalidDataPolicy policy ) - - - operator!= - operator-not-eq - ( const QDomImplementation & x ) - - - operator= - operator-eq - ( const QDomImplementation & x ) - - - operator== - operator-eq-eq - ( const QDomImplementation & x ) - - - - QDomNamedNodeMap - qdomnamednodemap.html - - QDomNamedNodeMap - QDomNamedNodeMap - () - - - QDomNamedNodeMap - QDomNamedNodeMap-2 - ( const QDomNamedNodeMap & n ) - - - contains - contains - ( const QString & name ) - - - count - count - () - - - isEmpty - isEmpty - () - - - item - item - ( int index ) - - - length - length - () - - - namedItem - namedItem - ( const QString & name ) - - - namedItemNS - namedItemNS - ( const QString & nsURI, const QString & localName ) - - - removeNamedItem - removeNamedItem - ( const QString & name ) - - - removeNamedItemNS - removeNamedItemNS - ( const QString & nsURI, const QString & localName ) - - - setNamedItem - setNamedItem - ( const QDomNode & newNode ) - - - setNamedItemNS - setNamedItemNS - ( const QDomNode & newNode ) - - - size - size - () - - - operator!= - operator-not-eq - ( const QDomNamedNodeMap & n ) - - - operator= - operator-eq - ( const QDomNamedNodeMap & n ) - - - operator== - operator-eq-eq - ( const QDomNamedNodeMap & n ) - - - - QDomNode - qdomnode.html - - NodeType - NodeType-enum - - - - QDomNode - QDomNode - () - - - QDomNode - QDomNode-2 - ( const QDomNode & n ) - - - appendChild - appendChild - ( const QDomNode & newChild ) - - - attributes - attributes - () - - - childNodes - childNodes - () - - - clear - clear - () - - - cloneNode - cloneNode - ( bool deep = true ) - - - columnNumber - columnNumber - () - - - firstChild - firstChild - () - - - firstChildElement - firstChildElement - ( const QString & tagName = QString() - - - hasAttributes - hasAttributes - () - - - hasChildNodes - hasChildNodes - () - - - insertAfter - insertAfter - ( const QDomNode & newChild, const QDomNode & refChild ) - - - insertBefore - insertBefore - ( const QDomNode & newChild, const QDomNode & refChild ) - - - isAttr - isAttr - () - - - isCDATASection - isCDATASection - () - - - isCharacterData - isCharacterData - () - - - isComment - isComment - () - - - isDocument - isDocument - () - - - isDocumentFragment - isDocumentFragment - () - - - isDocumentType - isDocumentType - () - - - isElement - isElement - () - - - isEntity - isEntity - () - - - isEntityReference - isEntityReference - () - - - isNotation - isNotation - () - - - isNull - isNull - () - - - isProcessingInstruction - isProcessingInstruction - () - - - isSupported - isSupported - ( const QString & feature, const QString & version ) - - - isText - isText - () - - - lastChild - lastChild - () - - - lastChildElement - lastChildElement - ( const QString & tagName = QString() - - - lineNumber - lineNumber - () - - - localName - localName - () - - - namedItem - namedItem - ( const QString & name ) - - - namespaceURI - namespaceURI - () - - - nextSibling - nextSibling - () - - - nextSiblingElement - nextSiblingElement - ( const QString & tagName = QString() - - - nodeName - nodeName - () - - - nodeType - nodeType - () - - - nodeValue - nodeValue - () - - - normalize - normalize - () - - - ownerDocument - ownerDocument - () - - - parentNode - parentNode - () - - - prefix - prefix - () - - - previousSibling - previousSibling - () - - - previousSiblingElement - previousSiblingElement - ( const QString & tagName = QString() - - - removeChild - removeChild - ( const QDomNode & oldChild ) - - - replaceChild - replaceChild - ( const QDomNode & newChild, const QDomNode & oldChild ) - - - save - save - ( QTextStream & str, int indent ) - - - setNodeValue - setNodeValue - ( const QString & v ) - - - setPrefix - setPrefix - ( const QString & pre ) - - - toAttr - toAttr - () - - - toCDATASection - toCDATASection - () - - - toCharacterData - toCharacterData - () - - - toComment - toComment - () - - - toDocument - toDocument - () - - - toDocumentFragment - toDocumentFragment - () - - - toDocumentType - toDocumentType - () - - - toElement - toElement - () - - - toEntity - toEntity - () - - - toEntityReference - toEntityReference - () - - - toNotation - toNotation - () - - - toProcessingInstruction - toProcessingInstruction - () - - - toText - toText - () - - - operator!= - operator-not-eq - ( const QDomNode & n ) - - - operator= - operator-eq - ( const QDomNode & n ) - - - operator== - operator-eq-eq - ( const QDomNode & n ) - - - - QDomNodeList - qdomnodelist.html - - QDomNodeList - QDomNodeList - () - - - QDomNodeList - QDomNodeList-2 - ( const QDomNodeList & n ) - - - at - at - ( int index ) - - - count - count - () - - - isEmpty - isEmpty - () - - - item - item - ( int index ) - - - length - length - () - - - size - size - () - - - operator!= - operator-not-eq - ( const QDomNodeList & n ) - - - operator= - operator-eq - ( const QDomNodeList & n ) - - - operator== - operator-eq-eq - ( const QDomNodeList & n ) - - - - QDomNotation - qdomnotation.html - - QDomNotation - QDomNotation - () - - - QDomNotation - QDomNotation-2 - ( const QDomNotation & x ) - - - NodeType - nodeType - QDomNotation::nodeType() - - - publicId - publicId - () - - - systemId - systemId - () - - - operator= - operator-eq - ( const QDomNotation & x ) - - - - QDomProcessingInstruction - qdomprocessinginstruction.html - - QDomProcessingInstruction - QDomProcessingInstruction - () - - - QDomProcessingInstruction - QDomProcessingInstruction-2 - ( const QDomProcessingInstruction & x ) - - - data - data - () - - - NodeType - nodeType - QDomProcessingInstruction::nodeType() - - - setData - setData - ( const QString & d ) - - - target - target - () - - - operator= - operator-eq - ( const QDomProcessingInstruction & x ) - - - - QDomText - qdomtext.html - - QDomText - QDomText - () - - - QDomText - QDomText-2 - ( const QDomText & x ) - - - NodeType - nodeType - QDomText::nodeType() - - - splitText - splitText - ( int offset ) - - - operator= - operator-eq - ( const QDomText & x ) - - - - QDoubleSpinBox - qdoublespinbox.html - - QDoubleSpinBox - QDoubleSpinBox - ( QWidget * parent = 0 ) - - - setRange - setRange - ( double min, double max ) - - - textFromValue - textFromValue - ( double v ) - - - valueChanged - valueChanged - ( double d ) - - - valueChanged - valueChanged-2 - ( const QString & text ) - - - valueFromText - valueFromText - ( const QString & text ) - - - - QDoubleValidator - qdoublevalidator.html - - QDoubleValidator - QDoubleValidator - ( QObject * parent ) - - - QDoubleValidator - QDoubleValidator-2 - ( double bottom, double top, int decimals, QObject * parent ) - - - setRange - setRange - ( double minimum, double maximum, int decimals = 0 ) - - - State - validate - QDoubleValidator::validate( QString & input, int & pos ) - - - QDoubleValidator - QDoubleValidator-3 - ( QObject * parent, const char * name ) - - - QDoubleValidator - QDoubleValidator-4 - ( double bottom, double top, int decimals, QObject * parent, const char * name ) - - - - QDragEnterEvent - qdragenterevent.html - - QDragEnterEvent - QDragEnterEvent - ( const QPoint & point, Qt::DropActions actions, const QMimeData * data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) - - - - QDrag - qdrag.html - - QDrag - QDrag - ( QWidget * dragSource ) - - - actionChanged - actionChanged - ( Qt::DropAction action ) - - - hotSpot - hotSpot - () - - - mimeData - mimeData - () - - - pixmap - pixmap - () - - - setDragCursor - setDragCursor - ( const QPixmap & cursor, Qt::DropAction action ) - - - setHotSpot - setHotSpot - ( const QPoint & hotspot ) - - - setMimeData - setMimeData - ( QMimeData * data ) - - - setPixmap - setPixmap - ( const QPixmap & pixmap ) - - - source - source - () - - - DropAction - start - QDrag::start( Qt::DropActions request = Qt::CopyAction ) - - - target - target - () - - - targetChanged - targetChanged - ( QWidget * newTarget ) - - - - QDragLeaveEvent - qdragleaveevent.html - - QDragLeaveEvent - QDragLeaveEvent - () - - - - QDragMoveEvent - qdragmoveevent.html - - QDragMoveEvent - QDragMoveEvent - ( const QPoint & pos, Qt::DropActions actions, const QMimeData * data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = DragMove ) - - - accept - accept - ( const QRect & rectangle ) - - - accept - accept-3 - () - - - answerRect - answerRect - () - - - ignore - ignore - ( const QRect & rectangle ) - - - ignore - ignore-2 - () - - - accept - accept-2 - ( bool y ) - - - - QDropEvent - qdropevent.html - - QDropEvent - QDropEvent - ( const QPoint & pos, Qt::DropActions actions, const QMimeData * data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type = Drop ) - - - acceptProposedAction - acceptProposedAction - () - - - DropAction - dropAction - QDropEvent::dropAction() - - - KeyboardModifiers - keyboardModifiers - QDropEvent::keyboardModifiers() - - - mimeData - mimeData - () - - - MouseButtons - mouseButtons - QDropEvent::mouseButtons() - - - pos - pos - () - - - DropActions - possibleActions - QDropEvent::possibleActions() - - - DropAction - proposedAction - QDropEvent::proposedAction() - - - setDropAction - setDropAction - ( Qt::DropAction action ) - - - source - source - () - - - Action - Action-enum - - - - accept - accept-2 - ( bool accept ) - - - acceptAction - acceptAction - ( bool accept = true ) - - - action - action - () - - - data - data - ( const char * f ) - - - encodedData - encodedData - ( const char * format ) - - - format - format - ( int n = 0 ) - - - provides - provides - ( const char * mimeType ) - - - setPoint - setPoint - ( const QPoint & point ) - - - - QErrorMessage - qerrormessage.html - - QErrorMessage - QErrorMessage - ( QWidget * parent = 0 ) - - - qtHandler - qtHandler - () - - - showMessage - showMessage - ( const QString & message ) - - - message - message - ( const QString & message ) - - - - QEvent - qevent.html - - Type - Type-enum - - - - QEvent - QEvent - ( Type type ) - - - accept - accept - () - - - ignore - ignore - () - - - spontaneous - spontaneous - () - - - type - type - () - - - - QEventLoop - qeventloop.html - - QEventLoop - QEventLoop - ( QObject * parent = 0 ) - - - exec - exec - ( ProcessEventsFlags flags = AllEvents ) - - - exit - exit - ( int returnCode = 0 ) - - - isRunning - isRunning - () - - - processEvents - processEvents - ( ProcessEventsFlags flags = AllEvents ) - - - processEvents - processEvents-2 - ( ProcessEventsFlags flags, int maxTime ) - - - quit - quit - () - - - wakeUp - wakeUp - () - - - - QExtensionFactory - qextensionfactory.html - - QExtensionFactory - QExtensionFactory - ( QExtensionManager * parent = 0 ) - - - createExtension - createExtension - ( QObject * object, const QString & iid, QObject * parent ) - - - extension - extension - ( QObject * object, const QString & iid ) - - - extensionManager - extensionManager - () - - - - QExtensionManager - qextensionmanager.html - - QExtensionManager - QExtensionManager - ( QObject * parent = 0 ) - - - extension - extension - ( QObject * object, const QString & iid ) - - - registerExtensions - registerExtensions - ( QAbstractExtensionFactory * factory, const QString & iid = QString() - - - unregisterExtensions - unregisterExtensions - ( QAbstractExtensionFactory * factory, const QString & iid = QString() - - - - QFileDialog - qfiledialog.html - - AcceptMode - AcceptMode-enum - - - - DialogLabel - DialogLabel-enum - - - - FileMode - FileMode-enum - - - - Mode - Mode-typedef - - - - ViewMode - ViewMode-enum - - - - QFileDialog - QFileDialog - ( QWidget * parent, Qt::WFlags flags ) - - - QFileDialog - QFileDialog-2 - ( QWidget * parent = 0, const QString & caption = QString() - - - currentChanged - currentChanged - ( const QString & path ) - - - directory - directory - () - - - filesSelected - filesSelected - ( const QStringList & selected ) - - - filters - filters - () - - - getExistingDirectory - getExistingDirectory - ( QWidget * parent = 0, const QString & caption = QString() - - - getOpenFileName - getOpenFileName - ( QWidget * parent = 0, const QString & caption = QString() - - - getOpenFileNames - getOpenFileNames - ( QWidget * parent = 0, const QString & caption = QString() - - - getSaveFileName - getSaveFileName - ( QWidget * parent = 0, const QString & caption = QString() - - - history - history - () - - - iconProvider - iconProvider - () - - - itemDelegate - itemDelegate - () - - - labelText - labelText - ( DialogLabel label ) - - - selectFile - selectFile - ( const QString & filename ) - - - selectFilter - selectFilter - ( const QString & filter ) - - - selectedFiles - selectedFiles - () - - - selectedFilter - selectedFilter - () - - - setDirectory - setDirectory - ( const QString & directory ) - - - setDirectory - setDirectory-2 - ( const QDir & directory ) - - - setFilter - setFilter - ( const QString & filter ) - - - setFilters - setFilters - ( const QStringList & filters ) - - - setHistory - setHistory - ( const QStringList & paths ) - - - setIconProvider - setIconProvider - ( QFileIconProvider * provider ) - - - setItemDelegate - setItemDelegate - ( QAbstractItemDelegate * delegate ) - - - setLabelText - setLabelText - ( DialogLabel label, const QString & text ) - - - getExistingDirectory - getExistingDirectory-2 - ( const QString & dir, QWidget * parent = 0, const char * name = 0, const QString & caption = QString() - - - getOpenFileName - getOpenFileName-2 - ( const QString & dir, const QString & filter = QString() - - - getOpenFileNames - getOpenFileNames-2 - ( const QString & filter, const QString & dir = QString() - - - getSaveFileName - getSaveFileName-2 - ( const QString & dir, const QString & filter = QString() - - - mode - mode - () - - - selectedFile - selectedFile - () - - - setDir - setDir - ( const QString & directory ) - - - setDir - setDir-2 - ( const QDir & directory ) - - - setMode - setMode - ( FileMode m ) - - - - QFile - qfile.html - - DecoderFn - DecoderFn-typedef - - - - EncoderFn - EncoderFn-typedef - - - - FileError - FileError-enum - - - - PermissionSpec - PermissionSpec-typedef - - - - QFile - QFile-2 - ( const QString & name ) - - - QFile - QFile-3 - ( QObject * parent ) - - - QFile - QFile-4 - ( const QString & name, QObject * parent ) - - - atEnd - atEnd - () - - - copy - copy - ( const QString & newName ) - - - copy - copy-2 - ( const QString & fileName, const QString & newName ) - - - decodeName - decodeName - ( const QByteArray & localFileName ) - - - decodeName - decodeName-2 - ( const char * localFileName ) - - - encodeName - encodeName - ( const QString & fileName ) - - - error - error - () - - - exists - exists - ( const QString & fileName ) - - - exists - exists-2 - () - - - fileName - fileName - () - - - flush - flush - () - - - handle - handle - () - - - isSequential - isSequential - () - - - link - link - ( const QString & linkName ) - - - link - link-2 - ( const QString & fileName, const QString & linkName ) - - - open - open - ( OpenMode mode ) - - - open - open-4 - ( FILE * fh, OpenMode mode ) - - - open - open-5 - ( int fd, OpenMode mode ) - - - permissions - permissions - () - - - permissions - permissions-2 - ( const QString & fileName ) - - - readLink - readLink - ( const QString & fileName ) - - - readLink - readLink-2 - () - - - remove - remove - () - - - remove - remove-2 - ( const QString & fileName ) - - - rename - rename - ( const QString & newName ) - - - rename - rename-2 - ( const QString & oldName, const QString & newName ) - - - resize - resize - ( qint64 sz ) - - - resize - resize-2 - ( const QString & fileName, qint64 sz ) - - - setDecodingFunction - setDecodingFunction - ( DecoderFn function ) - - - setEncodingFunction - setEncodingFunction - ( EncoderFn function ) - - - setFileName - setFileName - ( const QString & name ) - - - setPermissions - setPermissions - ( Permissions permissions ) - - - setPermissions - setPermissions-2 - ( const QString & fileName, Permissions permissions ) - - - size - size - () - - - unsetError - unsetError - () - - - - QFileIconProvider - qfileiconprovider.html - - IconType - IconType-enum - - - - QFileIconProvider - QFileIconProvider - () - - - icon - icon - ( IconType type ) - - - icon - icon-2 - ( const QFileInfo & info ) - - - type - type - ( const QFileInfo & info ) - - - - QFileInfo - qfileinfo.html - - QFileInfo - QFileInfo - () - - - QFileInfo - QFileInfo-2 - ( const QString & file ) - - - QFileInfo - QFileInfo-3 - ( const QFile & file ) - - - QFileInfo - QFileInfo-4 - ( const QDir & dir, const QString & file ) - - - QFileInfo - QFileInfo-5 - ( const QFileInfo & fileinfo ) - - - absoluteDir - absoluteDir - () - - - absoluteFilePath - absoluteFilePath - () - - - absolutePath - absolutePath - () - - - baseName - baseName - () - - - caching - caching - () - - - canonicalFilePath - canonicalFilePath - () - - - canonicalPath - canonicalPath - () - - - completeBaseName - completeBaseName - () - - - completeSuffix - completeSuffix - () - - - created - created - () - - - dir - dir - () - - - exists - exists - () - - - fileName - fileName - () - - - filePath - filePath - () - - - group - group - () - - - groupId - groupId - () - - - isAbsolute - isAbsolute - () - - - isDir - isDir - () - - - isExecutable - isExecutable - () - - - isFile - isFile - () - - - isHidden - isHidden - () - - - isReadable - isReadable - () - - - isRelative - isRelative - () - - - isRoot - isRoot - () - - - isSymLink - isSymLink - () - - - isWritable - isWritable - () - - - lastModified - lastModified - () - - - lastRead - lastRead - () - - - makeAbsolute - makeAbsolute - () - - - owner - owner - () - - - ownerId - ownerId - () - - - path - path - () - - - permission - permission - ( QFile::Permissions permissions ) - - - Permissions - permissions - QFileInfo::permissions() - - - readLink - readLink - () - - - refresh - refresh - () - - - setCaching - setCaching - ( bool enable ) - - - setFile - setFile - ( const QString & file ) - - - setFile - setFile-2 - ( const QFile & file ) - - - setFile - setFile-3 - ( const QDir & dir, const QString & file ) - - - size - size - () - - - suffix - suffix - () - - - operator!= - operator-not-eq - ( const QFileInfo & fileinfo ) - - - operator!= - operator-not-eq-2 - ( const QFileInfo & fileinfo ) - - - operator= - operator-eq - ( const QFileInfo & fileinfo ) - - - operator== - operator-eq-eq - ( const QFileInfo & fileinfo ) - - - operator== - operator-eq-eq-2 - ( const QFileInfo & fileinfo ) - - - absFilePath - absFilePath - () - - - baseName - baseName-2 - ( bool complete ) - - - convertToAbs - convertToAbs - () - - - dir - dir-2 - ( bool absPath ) - - - dirPath - dirPath - ( bool absPath = false ) - - - extension - extension - ( bool complete = true ) - - - permission - permission-2 - ( PermissionSpec permissions ) - - - - QFileOpenEvent - qfileopenevent.html - - file - file - () - - - name - name - () - - - open - open-2 - ( OpenMode flags, FILE * f ) - - - open - open-3 - ( OpenMode flags, int fd ) - - - setName - setName - ( const QString & name ) - - - - QFlag - qflag.html - - QFlag - QFlag - ( int value ) - - - operator - operator-int - int() - - - - QFlags - qflags.html - - enum_type - enum_type-typedef - - - - QFlags - QFlags - ( const QFlags & other ) - - - QFlags - QFlags-2 - ( Enum flag ) - - - QFlags - QFlags-3 - ( Zero zero = 0 ) - - - QFlags - QFlags-4 - ( QFlag value ) - - - operator - operator-int - int() - - - operator! - operator-not - () - - - operator& - operator-and - amp;( int mask ) - - - operator& - operator-and-2 - amp;( uint mask ) - - - operator& - operator-and-3 - amp;( Enum mask ) - - - operator& - operator-and-eq - amp;=( int mask ) - - - operator& - operator-and-eq-2 - amp;=( uint mask ) - - - operator= - operator-eq - ( const QFlags & other ) - - - operator^ - operator-5e - ( QFlags other ) - - - operator^ - operator-5e-2 - ( Enum other ) - - - operator^= - operator-5e-eq - ( QFlags other ) - - - operator^= - operator-5e-eq-2 - ( Enum other ) - - - operator| - operator-7c - ( QFlags other ) - - - operator| - operator-7c-2 - ( Enum other ) - - - operator|= - operator-7c-eq - ( QFlags other ) - - - operator|= - operator-7c-eq-2 - ( Enum other ) - - - operator~ - operator-7e - () - - - - QFocusEvent - qfocusevent.html - - QFocusEvent - QFocusEvent - ( Type type, Qt::FocusReason reason = Qt::OtherFocusReason ) - - - gotFocus - gotFocus - () - - - lostFocus - lostFocus - () - - - FocusReason - reason - QFocusEvent::reason() - - - Reason - Reason-enum - - - - - QFocusFrame - qfocusframe.html - - QFocusFrame - QFocusFrame - ( QWidget * parent = 0 ) - - - setWidget - setWidget - ( QWidget * widget ) - - - widget - widget - () - - - - QFontDatabase - qfontdatabase.html - - WritingSystem - WritingSystem-enum - - - - QFontDatabase - QFontDatabase - () - - - bold - bold - ( const QString & family, const QString & style ) - - - families - families - ( WritingSystem writingSystem = Any ) - - - font - font - ( const QString & family, const QString & style, int pointSize ) - - - isBitmapScalable - isBitmapScalable - ( const QString & family, const QString & style = QString() - - - isFixedPitch - isFixedPitch - ( const QString & family, const QString & style = QString() - - - isScalable - isScalable - ( const QString & family, const QString & style = QString() - - - isSmoothlyScalable - isSmoothlyScalable - ( const QString & family, const QString & style = QString() - - - italic - italic - ( const QString & family, const QString & style ) - - - pointSizes - pointSizes - ( const QString & family, const QString & style = QString() - - - smoothSizes - smoothSizes - ( const QString & family, const QString & style ) - - - standardSizes - standardSizes - () - - - styleString - styleString - ( const QFont & font ) - - - styleString - styleString-2 - ( const QFontInfo & fontInfo ) - - - styles - styles - ( const QString & family ) - - - weight - weight - ( const QString & family, const QString & style ) - - - writingSystemName - writingSystemName - ( WritingSystem writingSystem ) - - - writingSystemSample - writingSystemSample - ( WritingSystem writingSystem ) - - - writingSystems - writingSystems - () - - - - QFontDialog - qfontdialog.html - - getFont - getFont - ( bool * ok, const QFont & initial, QWidget * parent = 0 ) - - - getFont - getFont-2 - ( bool * ok, const QFont & def, QWidget * parent, const char * name ) - - - getFont - getFont-3 - ( bool * ok, QWidget * parent, const char * name ) - - - getFont - getFont-5 - ( bool * ok, QWidget * parent = 0 ) - - - - QFont - qfont.html - - Stretch - Stretch-enum - - - - Style - Style-enum - - - - StyleHint - StyleHint-enum - - - - StyleStrategy - StyleStrategy-enum - - - - Weight - Weight-enum - - - - QFont - QFont - () - - - QFont - QFont-2 - ( const QString & family, int pointSize = -1, int weight = -1, bool italic = false ) - - - QFont - QFont-3 - ( const QFont & font, QPaintDevice * pd ) - - - QFont - QFont-4 - ( const QFont & font ) - - - bold - bold - () - - - defaultFamily - defaultFamily - () - - - exactMatch - exactMatch - () - - - family - family - () - - - fixedPitch - fixedPitch - () - - - fromString - fromString - ( const QString & descrip ) - - - handle - handle - () - - - insertSubstitution - insertSubstitution - ( const QString & familyName, const QString & substituteName ) - - - insertSubstitutions - insertSubstitutions - ( const QString & familyName, const QStringList & substituteNames ) - - - isCopyOf - isCopyOf - ( const QFont & f ) - - - italic - italic - () - - - kerning - kerning - () - - - key - key - () - - - lastResortFamily - lastResortFamily - () - - - lastResortFont - lastResortFont - () - - - overline - overline - () - - - pixelSize - pixelSize - () - - - pointSize - pointSize - () - - - pointSizeF - pointSizeF - () - - - rawMode - rawMode - () - - - rawName - rawName - () - - - removeSubstitution - removeSubstitution - ( const QString & familyName ) - - - resolve - resolve - ( const QFont & other ) - - - setBold - setBold - ( bool enable ) - - - setFamily - setFamily - ( const QString & family ) - - - setFixedPitch - setFixedPitch - ( bool enable ) - - - setItalic - setItalic - ( bool enable ) - - - setKerning - setKerning - ( bool enable ) - - - setOverline - setOverline - ( bool enable ) - - - setPixelSize - setPixelSize - ( int pixelSize ) - - - setPointSize - setPointSize - ( int pointSize ) - - - setPointSizeF - setPointSizeF - ( qreal pointSize ) - - - setRawMode - setRawMode - ( bool enable ) - - - setRawName - setRawName - ( const QString & name ) - - - setStretch - setStretch - ( int factor ) - - - setStrikeOut - setStrikeOut - ( bool enable ) - - - setStyle - setStyle - ( Style style ) - - - setStyleHint - setStyleHint - ( StyleHint hint, StyleStrategy strategy = PreferDefault ) - - - setStyleStrategy - setStyleStrategy - ( StyleStrategy s ) - - - setUnderline - setUnderline - ( bool enable ) - - - setWeight - setWeight - ( int weight ) - - - stretch - stretch - () - - - strikeOut - strikeOut - () - - - style - style - () - - - styleHint - styleHint - () - - - styleStrategy - styleStrategy - () - - - substitute - substitute - ( const QString & familyName ) - - - substitutes - substitutes - ( const QString & familyName ) - - - substitutions - substitutions - () - - - toString - toString - () - - - underline - underline - () - - - weight - weight - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QFont & f ) - - - operator< - operator-lt - ( const QFont & f ) - - - operator= - operator-eq - ( const QFont & font ) - - - operator== - operator-eq-eq - ( const QFont & f ) - - - - QFontInfo - qfontinfo.html - - QFontInfo - QFontInfo - ( const QFont & font ) - - - QFontInfo - QFontInfo-2 - ( const QFontInfo & fi ) - - - bold - bold - () - - - exactMatch - exactMatch - () - - - family - family - () - - - fixedPitch - fixedPitch - () - - - italic - italic - () - - - pixelSize - pixelSize - () - - - pointSize - pointSize - () - - - pointSizeF - pointSizeF - () - - - rawMode - rawMode - () - - - Style - style - QFontInfo::style() - - - StyleHint - styleHint - QFontInfo::styleHint() - - - weight - weight - () - - - operator= - operator-eq - ( const QFontInfo & fi ) - - - - QFontMetricsF - qfontmetricsf.html - - QFontMetricsF - QFontMetricsF - ( const QFont & font ) - - - QFontMetricsF - QFontMetricsF-2 - ( const QFont & font, QPaintDevice * paintdevice ) - - - QFontMetricsF - QFontMetricsF-3 - ( const QFontMetricsF & fm ) - - - ascent - ascent - () - - - boundingRect - boundingRect - ( const QString & text ) - - - boundingRect - boundingRect-2 - ( QChar ch ) - - - boundingRect - boundingRect-3 - ( const QRectF & rect, int flags, const QString & text, int tabstops = 0, int * tabarray = 0 ) - - - descent - descent - () - - - height - height - () - - - inFont - inFont - ( QChar ch ) - - - leading - leading - () - - - leftBearing - leftBearing - ( QChar ch ) - - - lineSpacing - lineSpacing - () - - - lineWidth - lineWidth - () - - - maxWidth - maxWidth - () - - - minLeftBearing - minLeftBearing - () - - - minRightBearing - minRightBearing - () - - - overlinePos - overlinePos - () - - - rightBearing - rightBearing - ( QChar ch ) - - - size - size - ( int flags, const QString & text, int tabstops = 0, int * tabarray = 0 ) - - - strikeOutPos - strikeOutPos - () - - - underlinePos - underlinePos - () - - - width - width - ( const QString & text ) - - - width - width-2 - ( QChar ch ) - - - xHeight - xHeight - () - - - operator!= - operator-not-eq - ( const QFontMetricsF & other ) - - - operator!= - operator-not-eq-2 - ( const QFontMetricsF & other ) - - - operator= - operator-eq - ( const QFontMetricsF & fm ) - - - operator== - operator-eq-eq - ( const QFontMetricsF & other ) - - - operator== - operator-eq-eq-2 - ( const QFontMetricsF & other ) - - - - QFontMetrics - qfontmetrics.html - - QFontMetrics - QFontMetrics - ( const QFont & font ) - - - QFontMetrics - QFontMetrics-2 - ( const QFont & font, QPaintDevice * paintdevice ) - - - QFontMetrics - QFontMetrics-3 - ( const QFontMetrics & fm ) - - - ascent - ascent - () - - - boundingRect - boundingRect - ( QChar ch ) - - - boundingRect - boundingRect-2 - ( const QString & str ) - - - boundingRect - boundingRect-5 - ( int x, int y, int width, int height, int flags, const QString & text, int tabstops = 0, int * tabarray = 0 ) - - - boundingRect - boundingRect-6 - ( const QRect & r, int flgs, const QString & str, int tabstops = 0, int * tabarray = 0 ) - - - charWidth - charWidth - ( const QString & str, int pos ) - - - descent - descent - () - - - height - height - () - - - inFont - inFont - ( QChar ch ) - - - leading - leading - () - - - leftBearing - leftBearing - ( QChar ch ) - - - lineSpacing - lineSpacing - () - - - lineWidth - lineWidth - () - - - maxWidth - maxWidth - () - - - minLeftBearing - minLeftBearing - () - - - minRightBearing - minRightBearing - () - - - overlinePos - overlinePos - () - - - rightBearing - rightBearing - ( QChar ch ) - - - size - size - ( int flgs, const QString & text, int tabstops = 0, int * tabarray = 0 ) - - - strikeOutPos - strikeOutPos - () - - - underlinePos - underlinePos - () - - - width - width - ( const QString & str, int len = -1 ) - - - width - width-2 - ( QChar ch ) - - - xHeight - xHeight - () - - - operator!= - operator-not-eq - ( const QFontMetrics & other ) - - - operator= - operator-eq - ( const QFontMetrics & fm ) - - - operator== - operator-eq-eq - ( const QFontMetrics & other ) - - - operator== - operator-eq-eq-2 - ( const QFontMetrics & other ) - - - boundingRect - boundingRect-3 - ( const QString & text, int len ) - - - boundingRect - boundingRect-4 - ( int x, int y, int w, int h, int flags, const QString & str, int len, int tabstops = 0, int * tabarray = 0 ) - - - size - size-2 - ( int flags, const QString & str, int len, int tabstops = 0, int * tabarray = 0 ) - - - defaultFont - defaultFont - () - - - pointSizeFloat - pointSizeFloat - () - - - setDefaultFont - setDefaultFont - ( const QFont & f ) - - - setPixelSizeFloat - setPixelSizeFloat - ( qreal pixelSize ) - - - setPointSizeFloat - setPointSizeFloat - ( qreal size ) - - - - QFormBuilder - qformbuilder.html - - QFormBuilder - QFormBuilder - () - - - addPluginPath - addPluginPath - ( const QString & pluginPath ) - - - clearPluginPaths - clearPluginPaths - () - - - customWidgets - customWidgets - () - - - pluginPaths - pluginPaths - () - - - setPluginPath - setPluginPath - ( const QStringList & pluginPaths ) - - - - QFrame - qframe.html - - Shadow - Shadow-enum - - - - Shape - Shape-enum - - - - QFrame - QFrame - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - frameStyle - frameStyle - () - - - setFrameStyle - setFrameStyle - ( int style ) - - - Shadow_Mask - Shadow_Mask-var - - - - Shape_Mask - Shape_Mask-var - - - - QFrame - QFrame-2 - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - - QFSFileEngine - qfsfileengine.html - - QFSFileEngine - QFSFileEngine - () - - - QFSFileEngine - QFSFileEngine-2 - ( const QString & file ) - - - currentPath - currentPath - ( const QString & fileName = QString() - - - drives - drives - () - - - fileFlags - fileFlags - ( FileFlags type ) - - - fileName - fileName - ( QAbstractFileEngine::FileName file ) - - - homePath - homePath - () - - - open - open-2 - ( QIODevice::OpenMode flags, FILE * fh ) - - - open - open-3 - ( QIODevice::OpenMode flags, int fd ) - - - ownerId - ownerId - ( QAbstractFileEngine::FileOwner ) - - - rootPath - rootPath - () - - - setCurrentPath - setCurrentPath - ( const QString & path ) - - - tempPath - tempPath - () - - - - QFtp - qftp.html - - Command - Command-enum - - - - Error - Error-enum - - - - State - State-enum - - - - TransferMode - TransferMode-enum - - - - TransferType - TransferType-enum - - - - QFtp - QFtp - ( QObject * parent = 0 ) - - - abort - abort - () - - - bytesAvailable - bytesAvailable - () - - - cd - cd - ( const QString & dir ) - - - clearPendingCommands - clearPendingCommands - () - - - close - close - () - - - commandFinished - commandFinished - ( int id, bool error ) - - - commandStarted - commandStarted - ( int id ) - - - connectToHost - connectToHost - ( const QString & host, quint16 port = 21 ) - - - currentCommand - currentCommand - () - - - currentDevice - currentDevice - () - - - currentId - currentId - () - - - dataTransferProgress - dataTransferProgress - ( qint64 done, qint64 total ) - - - done - done - ( bool error ) - - - error - error - () - - - errorString - errorString - () - - - get - get - ( const QString & file, QIODevice * dev = 0, TransferType type = Binary ) - - - hasPendingCommands - hasPendingCommands - () - - - list - list - ( const QString & dir = QString() - - - listInfo - listInfo - ( const QUrlInfo & i ) - - - login - login - ( const QString & user = QString() - - - mkdir - mkdir - ( const QString & dir ) - - - put - put - ( QIODevice * dev, const QString & file, TransferType type = Binary ) - - - put - put-2 - ( const QByteArray & data, const QString & file, TransferType type = Binary ) - - - rawCommand - rawCommand - ( const QString & command ) - - - rawCommandReply - rawCommandReply - ( int replyCode, const QString & detail ) - - - read - read - ( char * data, qint64 maxlen ) - - - readAll - readAll - () - - - readyRead - readyRead - () - - - remove - remove - ( const QString & file ) - - - rename - rename - ( const QString & oldname, const QString & newname ) - - - rmdir - rmdir - ( const QString & dir ) - - - setProxy - setProxy - ( const QString & host, quint16 port ) - - - setTransferMode - setTransferMode - ( TransferMode mode ) - - - state - state - () - - - stateChanged - stateChanged - ( int state ) - - - QFtp - QFtp-2 - ( QObject * parent, const char * name ) - - - readBlock - readBlock - ( char * data, quint64 maxlen ) - - - - QGenericArgument - qgenericargument.html - - QGenericArgument - QGenericArgument - ( const char * name = 0, const void * data = 0 ) - - - data - data - () - - - name - name - () - - - - QGenericReturnArgument - qgenericreturnargument.html - - QGenericReturnArgument - QGenericReturnArgument - ( const char * name = 0, void * data = 0 ) - - - - QGLColormap - qglcolormap.html - - QGLColormap - QGLColormap - () - - - QGLColormap - QGLColormap-2 - ( const QGLColormap & map ) - - - entryColor - entryColor - ( int idx ) - - - entryRgb - entryRgb - ( int idx ) - - - find - find - ( QRgb color ) - - - findNearest - findNearest - ( QRgb color ) - - - isEmpty - isEmpty - () - - - setEntries - setEntries - ( int count, const QRgb * colors, int base = 0 ) - - - setEntry - setEntry - ( int idx, QRgb color ) - - - setEntry - setEntry-2 - ( int idx, const QColor & color ) - - - size - size - () - - - operator= - operator-eq - ( const QGLColormap & map ) - - - - QGLContext - qglcontext.html - - QGLContext - QGLContext - ( const QGLFormat & format, QPaintDevice * device ) - - - bindTexture - bindTexture - ( const QImage & image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA8 ) - - - bindTexture - bindTexture-2 - ( const QString & fileName ) - - - bindTexture - bindTexture-3 - ( const QPixmap & pixmap, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA8 ) - - - chooseContext - chooseContext - ( const QGLContext * shareContext = 0 ) - - - chooseMacVisual - chooseMacVisual - ( GDHandle ) - - - choosePixelFormat - choosePixelFormat - ( void * dummyPfd, HDC pdc ) - - - chooseVisual - chooseVisual - () - - - create - create - ( const QGLContext * shareContext = 0 ) - - - currentContext - currentContext - () - - - deleteTexture - deleteTexture - ( GLuint id ) - - - device - device - () - - - deviceIsPixmap - deviceIsPixmap - () - - - doneCurrent - doneCurrent - () - - - format - format - () - - - generateFontDisplayLists - generateFontDisplayLists - ( const QFont & font, int listBase ) - - - getProcAddress - getProcAddress - ( const QString & proc ) - - - initialized - initialized - () - - - isSharing - isSharing - () - - - isValid - isValid - () - - - makeCurrent - makeCurrent - () - - - overlayTransparentColor - overlayTransparentColor - () - - - requestedFormat - requestedFormat - () - - - reset - reset - () - - - setFormat - setFormat - ( const QGLFormat & format ) - - - setInitialized - setInitialized - ( bool on ) - - - setTextureCacheLimit - setTextureCacheLimit - ( int size ) - - - setWindowCreated - setWindowCreated - ( bool on ) - - - swapBuffers - swapBuffers - () - - - textureCacheLimit - textureCacheLimit - () - - - windowCreated - windowCreated - () - - - - QGLFormat - qglformat.html - - QGLFormat - QGLFormat - () - - - QGLFormat - QGLFormat-2 - ( QGL::FormatOptions options, int plane = 0 ) - - - QGLFormat - QGLFormat-3 - ( const QGLFormat & other ) - - - accum - accum - () - - - accumBufferSize - accumBufferSize - () - - - alpha - alpha - () - - - alphaBufferSize - alphaBufferSize - () - - - defaultFormat - defaultFormat - () - - - defaultOverlayFormat - defaultOverlayFormat - () - - - depth - depth - () - - - depthBufferSize - depthBufferSize - () - - - directRendering - directRendering - () - - - doubleBuffer - doubleBuffer - () - - - hasOpenGL - hasOpenGL - () - - - hasOpenGLOverlays - hasOpenGLOverlays - () - - - hasOverlay - hasOverlay - () - - - plane - plane - () - - - rgba - rgba - () - - - sampleBuffers - sampleBuffers - () - - - samples - samples - () - - - setAccum - setAccum - ( bool enable ) - - - setAccumBufferSize - setAccumBufferSize - ( int size ) - - - setAlpha - setAlpha - ( bool enable ) - - - setAlphaBufferSize - setAlphaBufferSize - ( int size ) - - - setDefaultFormat - setDefaultFormat - ( const QGLFormat & f ) - - - setDefaultOverlayFormat - setDefaultOverlayFormat - ( const QGLFormat & f ) - - - setDepth - setDepth - ( bool enable ) - - - setDepthBufferSize - setDepthBufferSize - ( int size ) - - - setDirectRendering - setDirectRendering - ( bool enable ) - - - setDoubleBuffer - setDoubleBuffer - ( bool enable ) - - - setOption - setOption - ( QGL::FormatOptions opt ) - - - setOverlay - setOverlay - ( bool enable ) - - - setPlane - setPlane - ( int plane ) - - - setRgba - setRgba - ( bool enable ) - - - setSampleBuffers - setSampleBuffers - ( bool enable ) - - - setSamples - setSamples - ( int numSamples ) - - - setStencil - setStencil - ( bool enable ) - - - setStencilBufferSize - setStencilBufferSize - ( int size ) - - - setStereo - setStereo - ( bool enable ) - - - stencil - stencil - () - - - stencilBufferSize - stencilBufferSize - () - - - stereo - stereo - () - - - testOption - testOption - ( QGL::FormatOptions opt ) - - - operator= - operator-eq - ( const QGLFormat & other ) - - - - QGLPixelBuffer - qglpixelbuffer.html - - QGLPixelBuffer - QGLPixelBuffer - ( const QSize & size, const QGLFormat & format = QGLFormat::defaultFormat() - - - bindTexture - bindTexture - ( const QImage & image, GLenum target = GL_TEXTURE_2D ) - - - bindTexture - bindTexture-2 - ( const QPixmap & pixmap, GLenum target = GL_TEXTURE_2D ) - - - bindTexture - bindTexture-3 - ( const QString & fileName ) - - - bindToDynamicTexture - bindToDynamicTexture - ( GLuint texture_id ) - - - deleteTexture - deleteTexture - ( GLuint texture_id ) - - - doneCurrent - doneCurrent - () - - - format - format - () - - - generateDynamicTexture - generateDynamicTexture - () - - - HANDLE - handle - QGLPixelBuffer::handle() - - - hasOpenGLPbuffers - hasOpenGLPbuffers - () - - - isValid - isValid - () - - - makeCurrent - makeCurrent - () - - - releaseFromDynamicTexture - releaseFromDynamicTexture - () - - - size - size - () - - - toImage - toImage - () - - - updateDynamicTexture - updateDynamicTexture - ( GLuint texture_id ) - - - - QGLWidget - qglwidget.html - - QGLWidget - QGLWidget - ( QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 ) - - - QGLWidget - QGLWidget-2 - ( QGLContext * context, QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 ) - - - QGLWidget - QGLWidget-3 - ( const QGLFormat & format, QWidget * parent = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 ) - - - autoBufferSwap - autoBufferSwap - () - - - bindTexture - bindTexture - ( const QImage & image, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA8 ) - - - bindTexture - bindTexture-2 - ( const QPixmap & pixmap, GLenum target = GL_TEXTURE_2D, GLint format = GL_RGBA8 ) - - - bindTexture - bindTexture-3 - ( const QString & fileName ) - - - colormap - colormap - () - - - context - context - () - - - convertToGLFormat - convertToGLFormat - ( const QImage & img ) - - - deleteTexture - deleteTexture - ( GLuint id ) - - - doneCurrent - doneCurrent - () - - - doubleBuffer - doubleBuffer - () - - - fontDisplayListBase - fontDisplayListBase - ( const QFont & fnt, int listBase = 2000 ) - - - format - format - () - - - glDraw - glDraw - () - - - glInit - glInit - () - - - grabFrameBuffer - grabFrameBuffer - ( bool withAlpha = false ) - - - initializeGL - initializeGL - () - - - initializeOverlayGL - initializeOverlayGL - () - - - isSharing - isSharing - () - - - isValid - isValid - () - - - makeCurrent - makeCurrent - () - - - makeOverlayCurrent - makeOverlayCurrent - () - - - overlayContext - overlayContext - () - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - paintGL - paintGL - () - - - paintOverlayGL - paintOverlayGL - () - - - qglClearColor - qglClearColor - ( const QColor & c ) - - - qglColor - qglColor - ( const QColor & c ) - - - renderPixmap - renderPixmap - ( int w = 0, int h = 0, bool useContext = false ) - - - renderText - renderText - ( int x, int y, const QString & str, const QFont & fnt = QFont() - - - renderText - renderText-2 - ( double x, double y, double z, const QString & str, const QFont & fnt = QFont() - - - resizeEvent - resizeEvent - ( QResizeEvent * event ) - - - resizeGL - resizeGL - ( int width, int height ) - - - resizeOverlayGL - resizeOverlayGL - ( int width, int height ) - - - setAutoBufferSwap - setAutoBufferSwap - ( bool on ) - - - setColormap - setColormap - ( const QGLColormap & cmap ) - - - setMouseTracking - setMouseTracking - ( bool enable ) - - - swapBuffers - swapBuffers - () - - - updateGL - updateGL - () - - - updateOverlayGL - updateOverlayGL - () - - - setFormat - setFormat - ( const QGLFormat & format ) - - - QGLWidget - QGLWidget-4 - ( QWidget * parent, const char * name, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 ) - - - QGLWidget - QGLWidget-5 - ( const QGLFormat & format, QWidget * parent, const char * name, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 ) - - - QGLWidget - QGLWidget-6 - ( QGLContext * context, QWidget * parent, const char * name, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 ) - - - - QGradient - qgradient.html - - Spread - Spread-enum - - - - Type - Type-enum - - - - setColorAt - setColorAt - ( qreal position, const QColor & color ) - - - setSpread - setSpread - ( Spread method ) - - - setStops - setStops - ( const QGradientStops & stopPoints ) - - - spread - spread - () - - - stops - stops - () - - - type - type - () - - - operator== - operator-eq-eq - ( const QGradient & gradient ) - - - - QGridLayout - qgridlayout.html - - QGridLayout - QGridLayout - ( QWidget * parent ) - - - QGridLayout - QGridLayout-2 - () - - - addItem - addItem - ( QLayoutItem * item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment alignment = 0 ) - - - addLayout - addLayout - ( QLayout * layout, int row, int column, Qt::Alignment alignment = 0 ) - - - addLayout - addLayout-2 - ( QLayout * layout, int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 ) - - - addWidget - addWidget - ( QWidget * widget, int row, int column, Qt::Alignment alignment = 0 ) - - - addWidget - addWidget-2 - ( QWidget * widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment = 0 ) - - - cellRect - cellRect - ( int row, int column ) - - - columnCount - columnCount - () - - - columnMinimumWidth - columnMinimumWidth - ( int column ) - - - columnStretch - columnStretch - ( int column ) - - - getItemPosition - getItemPosition - ( int index, int * row, int * column, int * rowSpan, int * columnSpan ) - - - Corner - originCorner - QGridLayout::originCorner() - - - rowCount - rowCount - () - - - rowMinimumHeight - rowMinimumHeight - ( int row ) - - - rowStretch - rowStretch - ( int row ) - - - setColumnMinimumWidth - setColumnMinimumWidth - ( int column, int minSize ) - - - setColumnStretch - setColumnStretch - ( int column, int stretch ) - - - setOriginCorner - setOriginCorner - ( Qt::Corner corner ) - - - setRowMinimumHeight - setRowMinimumHeight - ( int row, int minSize ) - - - setRowStretch - setRowStretch - ( int row, int stretch ) - - - QGridLayout - QGridLayout-3 - ( QWidget * parent, int nRows, int nCols = 1, int margin = 0, int space = -1, const char * name = 0 ) - - - QGridLayout - QGridLayout-4 - ( int nRows, int nCols = 1, int spacing = -1, const char * name = 0 ) - - - QGridLayout - QGridLayout-5 - ( QLayout * parentLayout, int nRows = 1, int nCols = 1, int spacing = -1, const char * name = 0 ) - - - addColSpacing - addColSpacing - ( int col, int minsize ) - - - addMultiCell - addMultiCell - ( QLayoutItem * l, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 ) - - - addMultiCellLayout - addMultiCellLayout - ( QLayout * layout, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 ) - - - addMultiCellWidget - addMultiCellWidget - ( QWidget * widget, int fromRow, int toRow, int fromCol, int toCol, Qt::Alignment align = 0 ) - - - addRowSpacing - addRowSpacing - ( int row, int minsize ) - - - cellGeometry - cellGeometry - ( int row, int column ) - - - colSpacing - colSpacing - ( int col ) - - - colStretch - colStretch - ( int col ) - - - expand - expand - ( int nRows, int nCols ) - - - findWidget - findWidget - ( QWidget * w, int * row, int * column ) - - - numCols - numCols - () - - - numRows - numRows - () - - - Corner - origin - QGridLayout::origin() - - - rowSpacing - rowSpacing - ( int row ) - - - setColSpacing - setColSpacing - ( int col, int minSize ) - - - setColStretch - setColStretch - ( int col, int stretch ) - - - setOrigin - setOrigin - ( Qt::Corner corner ) - - - setRowSpacing - setRowSpacing - ( int row, int minSize ) - - - - QGroupBox - qgroupbox.html - - Alignment - alignment-prop - - - - QGroupBox - QGroupBox - ( QWidget * parent = 0 ) - - - QGroupBox - QGroupBox-2 - ( const QString & title, QWidget * parent = 0 ) - - - toggled - toggled - ( bool on ) - - - QGroupBox - QGroupBox-3 - ( QWidget * parent, const char * name ) - - - QGroupBox - QGroupBox-4 - ( const QString & title, QWidget * parent, const char * name ) - - - - QHash::const_iterator - qhash-const-iterator.html - - const_iterator - const_iterator - () - - - const_iterator - const_iterator-3 - ( const iterator & other ) - - - key - key - () - - - value - value - () - - - operator!= - operator-not-eq - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator== - operator-eq-eq - ( const const_iterator & other ) - - - - QHash - qhash.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - QHash - QHash - () - - - QHash - QHash-2 - ( const QHash<Key, T> & other ) - - - begin - begin - () - - - begin - begin-2 - () - - - capacity - capacity - () - - - clear - clear - () - - - constBegin - constBegin - () - - - constEnd - constEnd - () - - - constFind - constFind - ( const Key & key ) - - - contains - contains - ( const Key & key ) - - - count - count - ( const Key & key ) - - - count - count-2 - () - - - empty - empty - () - - - end - end - () - - - end - end-2 - () - - - erase - erase - ( iterator pos ) - - - find - find - ( const Key & key ) - - - find - find-2 - ( const Key & key ) - - - insert - insert - ( const Key & key, const T & value ) - - - insertMulti - insertMulti - ( const Key & key, const T & value ) - - - isEmpty - isEmpty - () - - - key - key - ( const T & value ) - - - keys - keys - () - - - keys - keys-2 - ( const T & value ) - - - remove - remove - ( const Key & key ) - - - reserve - reserve - ( int size ) - - - size - size - () - - - squeeze - squeeze - () - - - take - take - ( const Key & key ) - - - unite - unite - ( const QHash<Key, T> & other ) - - - value - value - ( const Key & key ) - - - value - value-2 - ( const Key & key, const T & defaultValue ) - - - values - values - () - - - values - values-2 - ( const Key & key ) - - - operator!= - operator-not-eq - ( const QHash<Key, T> & other ) - - - operator= - operator-eq - ( const QHash<Key, T> & other ) - - - operator== - operator-eq-eq - ( const QHash<Key, T> & other ) - - - operator[] - operator-5b-5d - ( const Key & key ) - - - operator[] - operator-5b-5d-2 - ( const Key & key ) - - - - QHash::iterator - qhash-iterator.html - - iterator - iterator - () - - - key - key - () - - - value - value - () - - - operator!= - operator-not-eq - ( const iterator & other ) - - - operator!= - operator-not-eq-2 - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator== - operator-eq-eq - ( const iterator & other ) - - - operator== - operator-eq-eq-2 - ( const const_iterator & other ) - - - - QHashIterator - qhashiterator.html - - QHashIterator - QHashIterator - ( const QHash<Key, T> & hash ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - key - key - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - operator= - operator-eq - ( const QHash<Key, T> & hash ) - - - - QHBoxLayout - qhboxlayout.html - - QHBoxLayout - QHBoxLayout - () - - - QHBoxLayout - QHBoxLayout-2 - ( QWidget * parent ) - - - QHBoxLayout - QHBoxLayout-3 - ( QWidget * parent, int margin, int spacing = -1, const char * name = 0 ) - - - QHBoxLayout - QHBoxLayout-4 - ( QLayout * parentLayout, int spacing = -1, const char * name = 0 ) - - - QHBoxLayout - QHBoxLayout-5 - ( int spacing, const char * name = 0 ) - - - - QHeaderView - qheaderview.html - - ResizeMode - ResizeMode-enum - - - - Alignment - defaultAlignment-prop - - - - QHeaderView - QHeaderView - ( Qt::Orientation orientation, QWidget * parent = 0 ) - - - count - count - () - - - headerDataChanged - headerDataChanged - ( Qt::Orientation orientation, int logicalFirst, int logicalLast ) - - - hiddenSectionCount - hiddenSectionCount - () - - - hideSection - hideSection - ( int logicalIndex ) - - - horizontalOffset - horizontalOffset - () - - - isClickable - isClickable - () - - - isMovable - isMovable - () - - - isSectionHidden - isSectionHidden - ( int logicalIndex ) - - - length - length - () - - - logicalIndex - logicalIndex - ( int visualIndex ) - - - logicalIndexAt - logicalIndexAt - ( int position ) - - - logicalIndexAt - logicalIndexAt-2 - ( int x, int y ) - - - logicalIndexAt - logicalIndexAt-3 - ( const QPoint & pos ) - - - moveSection - moveSection - ( int from, int to ) - - - offset - offset - () - - - Orientation - orientation - QHeaderView::orientation() - - - paintSection - paintSection - ( QPainter * painter, const QRect & rect, int logicalIndex ) - - - resizeMode - resizeMode - ( int logicalIndex ) - - - resizeSection - resizeSection - ( int logicalIndex, int size ) - - - resizeSections - resizeSections - ( QHeaderView::ResizeMode mode ) - - - sectionAutoResize - sectionAutoResize - ( int logicalIndex, QHeaderView::ResizeMode mode ) - - - sectionClicked - sectionClicked - ( int logicalIndex ) - - - sectionCountChanged - sectionCountChanged - ( int oldCount, int newCount ) - - - sectionDoubleClicked - sectionDoubleClicked - ( int logicalIndex ) - - - sectionHandleDoubleClicked - sectionHandleDoubleClicked - ( int logicalIndex ) - - - sectionMoved - sectionMoved - ( int logicalIndex, int oldVisualIndex, int newVisualIndex ) - - - sectionPosition - sectionPosition - ( int logicalIndex ) - - - sectionPressed - sectionPressed - ( int logicalIndex ) - - - sectionResized - sectionResized - ( int logicalIndex, int oldSize, int newSize ) - - - sectionSize - sectionSize - ( int logicalIndex ) - - - sectionSizeFromContents - sectionSizeFromContents - ( int logicalIndex ) - - - sectionSizeHint - sectionSizeHint - ( int logicalIndex ) - - - sectionViewportPosition - sectionViewportPosition - ( int logicalIndex ) - - - sectionsAboutToBeRemoved - sectionsAboutToBeRemoved - ( const QModelIndex & parent, int logicalFirst, int logicalLast ) - - - sectionsHidden - sectionsHidden - () - - - sectionsInserted - sectionsInserted - ( const QModelIndex & parent, int logicalFirst, int logicalLast ) - - - sectionsMoved - sectionsMoved - () - - - setClickable - setClickable - ( bool clickable ) - - - setMovable - setMovable - ( bool movable ) - - - setOffset - setOffset - ( int offset ) - - - setResizeMode - setResizeMode - ( ResizeMode mode ) - - - setResizeMode - setResizeMode-2 - ( int logicalIndex, ResizeMode mode ) - - - setSectionHidden - setSectionHidden - ( int logicalIndex, bool hide ) - - - setSortIndicator - setSortIndicator - ( int logicalIndex, Qt::SortOrder order ) - - - showSection - showSection - ( int logicalIndex ) - - - sizeHint - sizeHint - () - - - SortOrder - sortIndicatorOrder - QHeaderView::sortIndicatorOrder() - - - sortIndicatorSection - sortIndicatorSection - () - - - stretchSectionCount - stretchSectionCount - () - - - verticalOffset - verticalOffset - () - - - visualIndex - visualIndex - ( int logicalIndex ) - - - visualIndexAt - visualIndexAt - ( int position ) - - - - QHelpEvent - qhelpevent.html - - QHelpEvent - QHelpEvent - ( Type type, const QPoint & pos, const QPoint & globalPos ) - - - globalPos - globalPos - () - - - globalX - globalX - () - - - globalY - globalY - () - - - pos - pos - () - - - x - x - () - - - y - y - () - - - - QHideEvent - qhideevent.html - - QHideEvent - QHideEvent - () - - - - QHostAddress - qhostaddress.html - - SpecialAddress - SpecialAddress-enum - - - - QHostAddress - QHostAddress - () - - - QHostAddress - QHostAddress-2 - ( quint32 ip4Addr ) - - - QHostAddress - QHostAddress-3 - ( quint8 * ip6Addr ) - - - QHostAddress - QHostAddress-4 - ( const Q_IPV6ADDR & ip6Addr ) - - - QHostAddress - QHostAddress-5 - ( const sockaddr * sockaddr ) - - - QHostAddress - QHostAddress-6 - ( const QString & address ) - - - QHostAddress - QHostAddress-7 - ( const QHostAddress & address ) - - - QHostAddress - QHostAddress-8 - ( SpecialAddress address ) - - - clear - clear - () - - - isNull - isNull - () - - - NetworkLayerProtocol - protocol - QHostAddress::protocol() - - - scopeId - scopeId - () - - - setAddress - setAddress - ( quint32 ip4Addr ) - - - setAddress - setAddress-2 - ( quint8 * ip6Addr ) - - - setAddress - setAddress-3 - ( const Q_IPV6ADDR & ip6Addr ) - - - setAddress - setAddress-4 - ( const QString & address ) - - - setAddress - setAddress-5 - ( const sockaddr * sockaddr ) - - - setScopeId - setScopeId - ( const QString & id ) - - - toIPv4Address - toIPv4Address - () - - - toIPv6Address - toIPv6Address - () - - - toString - toString - () - - - operator= - operator-eq - ( const QHostAddress & address ) - - - operator= - operator-eq-2 - ( const QString & address ) - - - operator== - operator-eq-eq - ( const QHostAddress & other ) - - - operator== - operator-eq-eq-2 - ( SpecialAddress other ) - - - ip4Addr - ip4Addr - () - - - isIPv4Address - isIPv4Address - () - - - isIPv6Address - isIPv6Address - () - - - isIp4Addr - isIp4Addr - () - - - - QHostInfo - qhostinfo.html - - HostInfoError - HostInfoError-enum - - - - QHostInfo - QHostInfo - ( int id = -1 ) - - - QHostInfo - QHostInfo-2 - ( const QHostInfo & other ) - - - abortHostLookup - abortHostLookup - ( int id ) - - - addresses - addresses - () - - - error - error - () - - - errorString - errorString - () - - - fromName - fromName - ( const QString & name ) - - - hostName - hostName - () - - - localHostName - localHostName - () - - - lookupHost - lookupHost - ( const QString & name, QObject * receiver, const char * member ) - - - lookupId - lookupId - () - - - setAddresses - setAddresses - ( const QList<QHostAddress> & addresses ) - - - setError - setError - ( HostInfoError error ) - - - setErrorString - setErrorString - ( const QString & str ) - - - setHostName - setHostName - ( const QString & hostName ) - - - setLookupId - setLookupId - ( int id ) - - - operator= - operator-eq - ( const QHostInfo & other ) - - - - QHoverEvent - qhoverevent.html - - QHoverEvent - QHoverEvent - ( Type type, const QPoint & pos, const QPoint & oldPos ) - - - oldPos - oldPos - () - - - pos - pos - () - - - - QHttpHeader - qhttpheader.html - - QHttpHeader - QHttpHeader - () - - - QHttpHeader - QHttpHeader-2 - ( const QHttpHeader & header ) - - - QHttpHeader - QHttpHeader-3 - ( const QString & str ) - - - addValue - addValue - ( const QString & key, const QString & value ) - - - allValues - allValues - ( const QString & key ) - - - contentLength - contentLength - () - - - contentType - contentType - () - - - hasContentLength - hasContentLength - () - - - hasContentType - hasContentType - () - - - hasKey - hasKey - ( const QString & key ) - - - isValid - isValid - () - - - keys - keys - () - - - majorVersion - majorVersion - () - - - minorVersion - minorVersion - () - - - removeAllValues - removeAllValues - ( const QString & key ) - - - removeValue - removeValue - ( const QString & key ) - - - setContentLength - setContentLength - ( int len ) - - - setContentType - setContentType - ( const QString & type ) - - - setValue - setValue - ( const QString & key, const QString & value ) - - - setValues - setValues - ( const QList<QPair<QString, QString> > & values ) - - - toString - toString - () - - - value - value - ( const QString & key ) - - - values - values - () - - - operator= - operator-eq - ( const QHttpHeader & h ) - - - - QHttp - qhttp.html - - Error - Error-enum - - - - State - State-enum - - - - QHttp - QHttp - ( QObject * parent = 0 ) - - - QHttp - QHttp-2 - ( const QString & hostName, quint16 port = 80, QObject * parent = 0 ) - - - abort - abort - () - - - bytesAvailable - bytesAvailable - () - - - clearPendingRequests - clearPendingRequests - () - - - close - close - () - - - currentDestinationDevice - currentDestinationDevice - () - - - currentId - currentId - () - - - currentRequest - currentRequest - () - - - currentSourceDevice - currentSourceDevice - () - - - dataReadProgress - dataReadProgress - ( int done, int total ) - - - dataSendProgress - dataSendProgress - ( int done, int total ) - - - done - done - ( bool error ) - - - error - error - () - - - errorString - errorString - () - - - get - get - ( const QString & path, QIODevice * to = 0 ) - - - hasPendingRequests - hasPendingRequests - () - - - head - head - ( const QString & path ) - - - lastResponse - lastResponse - () - - - post - post - ( const QString & path, QIODevice * data, QIODevice * to = 0 ) - - - post - post-2 - ( const QString & path, const QByteArray & data, QIODevice * to = 0 ) - - - read - read - ( char * data, qint64 maxlen ) - - - readAll - readAll - () - - - readyRead - readyRead - ( const QHttpResponseHeader & resp ) - - - request - request - ( const QHttpRequestHeader & header, QIODevice * data = 0, QIODevice * to = 0 ) - - - request - request-2 - ( const QHttpRequestHeader & header, const QByteArray & data, QIODevice * to = 0 ) - - - requestFinished - requestFinished - ( int id, bool error ) - - - requestStarted - requestStarted - ( int id ) - - - responseHeaderReceived - responseHeaderReceived - ( const QHttpResponseHeader & resp ) - - - setHost - setHost - ( const QString & hostName, quint16 port = 80 ) - - - setProxy - setProxy - ( const QString & host, int port, const QString & username = QString() - - - setSocket - setSocket - ( QTcpSocket * socket ) - - - setUser - setUser - ( const QString & userName, const QString & password = QString() - - - state - state - () - - - stateChanged - stateChanged - ( int state ) - - - closeConnection - closeConnection - () - - - readBlock - readBlock - ( char * data, quint64 maxlen ) - - - - QHttpRequestHeader - qhttprequestheader.html - - QHttpRequestHeader - QHttpRequestHeader - () - - - QHttpRequestHeader - QHttpRequestHeader-2 - ( const QString & method, const QString & path, int majorVer = 1, int minorVer = 1 ) - - - QHttpRequestHeader - QHttpRequestHeader-3 - ( const QHttpRequestHeader & header ) - - - QHttpRequestHeader - QHttpRequestHeader-4 - ( const QString & str ) - - - majorVersion - majorVersion - () - - - method - method - () - - - minorVersion - minorVersion - () - - - path - path - () - - - setRequest - setRequest - ( const QString & method, const QString & path, int majorVer = 1, int minorVer = 1 ) - - - operator= - operator-eq - ( const QHttpRequestHeader & header ) - - - - QHttpResponseHeader - qhttpresponseheader.html - - QHttpResponseHeader - QHttpResponseHeader - () - - - QHttpResponseHeader - QHttpResponseHeader-2 - ( const QHttpResponseHeader & header ) - - - QHttpResponseHeader - QHttpResponseHeader-3 - ( const QString & str ) - - - QHttpResponseHeader - QHttpResponseHeader-4 - ( int code, const QString & text = QString() - - - majorVersion - majorVersion - () - - - minorVersion - minorVersion - () - - - reasonPhrase - reasonPhrase - () - - - setStatusLine - setStatusLine - ( int code, const QString & text = QString() - - - statusCode - statusCode - () - - - operator= - operator-eq - ( const QHttpResponseHeader & header ) - - - - QIconDragEvent - qicondragevent.html - - QIconDragEvent - QIconDragEvent - () - - - - QIconEngine - qiconengine.html - - actualSize - actualSize - ( const QSize & size, QIcon::Mode mode, QIcon::State state ) - - - addFile - addFile - ( const QString & fileName, const QSize & size, QIcon::Mode mode, QIcon::State state ) - - - addPixmap - addPixmap - ( const QPixmap & pixmap, QIcon::Mode mode, QIcon::State state ) - - - paint - paint - ( QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state ) - - - pixmap - pixmap - ( const QSize & size, QIcon::Mode mode, QIcon::State state ) - - - - QIconEnginePlugin - qiconengineplugin.html - - QIconEnginePlugin - QIconEnginePlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & filename ) - - - keys - keys - () - - - - QIcon - qicon.html - - Mode - Mode-enum - - - - State - State-enum - - - - QIcon - QIcon - () - - - QIcon - QIcon-2 - ( const QPixmap & pixmap ) - - - QIcon - QIcon-3 - ( const QIcon & other ) - - - QIcon - QIcon-4 - ( const QString & fileName ) - - - QIcon - QIcon-5 - ( QIconEngine * engine ) - - - actualSize - actualSize - ( const QSize & size, Mode mode = Normal, State state = Off ) - - - addFile - addFile - ( const QString & fileName, const QSize & size = QSize() - - - addPixmap - addPixmap - ( const QPixmap & pixmap, Mode mode = Normal, State state = Off ) - - - isNull - isNull - () - - - paint - paint - ( QPainter * painter, const QRect & rect, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) - - - paint - paint-2 - ( QPainter * painter, int x, int y, int w, int h, Qt::Alignment alignment = Qt::AlignCenter, Mode mode = Normal, State state = Off ) - - - pixmap - pixmap - ( const QSize & size, Mode mode = Normal, State state = Off ) - - - pixmap - pixmap-5 - ( int w, int h, Mode mode = Normal, State state = Off ) - - - pixmap - pixmap-6 - ( int extent, Mode mode = Normal, State state = Off ) - - - serialNumber - serialNumber - () - - - operator - operator-QVariant - QVariant() - - - operator= - operator-eq - ( const QIcon & other ) - - - Size - Size-enum - - - - pixmap - pixmap-2 - ( Size size, Mode mode, State state = Off ) - - - pixmap - pixmap-3 - ( Size size, bool enabled, State state = Off ) - - - pixmap - pixmap-4 - () - - - pixmapSize - pixmapSize - ( Size which ) - - - reset - reset - ( const QPixmap & pixmap, Size size ) - - - setPixmap - setPixmap - ( const QPixmap & pixmap, Size size, Mode mode = Normal, State state = Off ) - - - setPixmap - setPixmap-2 - ( const QString & fileName, Size size, Mode mode = Normal, State state = Off ) - - - setPixmapSize - setPixmapSize - ( Size which, const QSize & size ) - - - - QImage - qimage.html - - Format - Format-enum - - - - InvertMode - InvertMode-enum - - - - QImage - QImage - () - - - QImage - QImage-2 - ( const QSize & size, Format format ) - - - QImage - QImage-3 - ( int width, int height, Format format ) - - - QImage - QImage-4 - ( uchar * data, int width, int height, Format format ) - - - QImage - QImage-5 - ( const char * const[] xpm ) - - - QImage - QImage-6 - ( const QString & fileName, const char * format = 0 ) - - - QImage - QImage-7 - ( const char * fileName, const char * format = 0 ) - - - QImage - QImage-8 - ( const QImage & image ) - - - allGray - allGray - () - - - alphaChannel - alphaChannel - () - - - bits - bits - () - - - bits - bits-2 - () - - - bytesPerLine - bytesPerLine - () - - - color - color - ( int i ) - - - colorTable - colorTable - () - - - convertToFormat - convertToFormat - ( Format format, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - convertToFormat - convertToFormat-2 - ( Format format, const QVector<QRgb> & colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - copy - copy - ( const QRect & rectangle = QRect() - - - copy - copy-4 - ( int x, int y, int width, int height ) - - - createAlphaMask - createAlphaMask - ( Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - createHeuristicMask - createHeuristicMask - ( bool clipTight = true ) - - - depth - depth - () - - - dotsPerMeterX - dotsPerMeterX - () - - - dotsPerMeterY - dotsPerMeterY - () - - - fill - fill - ( uint pixelValue ) - - - format - format - () - - - fromData - fromData - ( const uchar * data, int size, const char * format = 0 ) - - - fromData - fromData-2 - ( const QByteArray & data, const char * format = 0 ) - - - hasAlphaChannel - hasAlphaChannel - () - - - height - height - () - - - invertPixels - invertPixels - ( InvertMode mode = InvertRgb ) - - - isGrayscale - isGrayscale - () - - - isNull - isNull - () - - - load - load - ( const QString & fileName, const char * format = 0 ) - - - load - load-2 - ( QIODevice * device, const char * format ) - - - loadFromData - loadFromData - ( const uchar * data, int len, const char * format = 0 ) - - - loadFromData - loadFromData-2 - ( const QByteArray & data, const char * format = 0 ) - - - mirrored - mirrored - ( bool horizontal = false, bool vertical = true ) - - - numBytes - numBytes - () - - - numColors - numColors - () - - - offset - offset - () - - - pixel - pixel - ( int x, int y ) - - - pixelIndex - pixelIndex - ( int x, int y ) - - - rect - rect - () - - - rgbSwapped - rgbSwapped - () - - - save - save - ( const QString & fileName, const char * format, int quality = -1 ) - - - save - save-2 - ( QIODevice * device, const char * format, int quality = -1 ) - - - scaled - scaled - ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) - - - scaled - scaled-2 - ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) - - - scaledToHeight - scaledToHeight - ( int height, Qt::TransformationMode mode = Qt::FastTransformation ) - - - scaledToWidth - scaledToWidth - ( int width, Qt::TransformationMode mode = Qt::FastTransformation ) - - - scanLine - scanLine - ( int i ) - - - scanLine - scanLine-2 - ( int i ) - - - serialNumber - serialNumber - () - - - setAlphaChannel - setAlphaChannel - ( const QImage & alphaChannel ) - - - setColor - setColor - ( int index, QRgb colorValue ) - - - setColorTable - setColorTable - ( const QVector<QRgb> colors ) - - - setDotsPerMeterX - setDotsPerMeterX - ( int x ) - - - setDotsPerMeterY - setDotsPerMeterY - ( int y ) - - - setNumColors - setNumColors - ( int numColors ) - - - setOffset - setOffset - ( const QPoint & offset ) - - - setPixel - setPixel - ( int x, int y, uint index_or_rgb ) - - - setText - setText - ( const QString & key, const QString & text ) - - - size - size - () - - - text - text - ( const QString & key = QString() - - - textKeys - textKeys - () - - - transformed - transformed - ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) - - - trueMatrix - trueMatrix - ( const QMatrix & matrix, int width, int height ) - - - valid - valid - ( int x, int y ) - - - width - width - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QImage & image ) - - - operator= - operator-eq - ( const QImage & image ) - - - operator== - operator-eq-eq - ( const QImage & image ) - - - - QImageIOHandler - qimageiohandler.html - - ImageOption - ImageOption-enum - - - - QImageIOHandler - QImageIOHandler - () - - - canRead - canRead - () - - - currentImageNumber - currentImageNumber - () - - - currentImageRect - currentImageRect - () - - - device - device - () - - - format - format - () - - - imageCount - imageCount - () - - - jumpToImage - jumpToImage - ( int imageNumber ) - - - jumpToNextImage - jumpToNextImage - () - - - loopCount - loopCount - () - - - nextImageDelay - nextImageDelay - () - - - option - option - ( ImageOption option ) - - - read - read - ( QImage * image ) - - - setDevice - setDevice - ( QIODevice * device ) - - - setFormat - setFormat - ( const QByteArray & format ) - - - setFormat - setFormat-2 - ( const QByteArray & format ) - - - setOption - setOption - ( ImageOption option, const QVariant & value ) - - - supportsOption - supportsOption - ( ImageOption option ) - - - write - write - ( const QImage & image ) - - - name - name - () - - - - QImageIOPlugin - qimageioplugin.html - - QImageIOPlugin - QImageIOPlugin - ( QObject * parent = 0 ) - - - capabilities - capabilities - ( QIODevice * device, const QByteArray & format ) - - - create - create - ( QIODevice * device, const QByteArray & format = QByteArray() - - - keys - keys - () - - - setText - setText-2 - ( const char * key, const char * language, const QString & text ) - - - text - text-2 - ( const char * key, const char * language = 0 ) - - - text - text-3 - ( const QImageTextKeyLang & keywordAndLanguage ) - - - textLanguages - textLanguages - () - - - textList - textList - () - - - Endian - Endian-enum - - - - QImage - QImage-9 - ( int width, int height, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian ) - - - QImage - QImage-10 - ( const QSize & size, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian ) - - - QImage - QImage-11 - ( uchar * data, int width, int height, int depth, const QRgb * colortable, int numColors, Endian bitOrder ) - - - QImage - QImage-12 - ( uchar * data, int width, int height, int depth, int bytesPerLine, const QRgb * colortable, int numColors, Endian bitOrder ) - - - QImage - QImage-13 - ( const QByteArray & data ) - - - bitOrder - bitOrder - () - - - convertBitOrder - convertBitOrder - ( Endian bitOrder ) - - - convertDepth - convertDepth - ( int depth, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - convertDepthWithPalette - convertDepthWithPalette - ( int depth, QRgb * palette, int palette_count, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - copy - copy-2 - ( int x, int y, int w, int h, Qt::ImageConversionFlags flags ) - - - copy - copy-3 - ( const QRect & rect, Qt::ImageConversionFlags flags ) - - - create - create - ( int width, int height, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian ) - - - create - create-2 - ( const QSize & size, int depth, int numColors = 0, Endian bitOrder = IgnoreEndian ) - - - hasAlphaBuffer - hasAlphaBuffer - () - - - invertPixels - invertPixels-2 - ( bool invertAlpha ) - - - jumpTable - jumpTable - () - - - jumpTable - jumpTable-2 - () - - - mirror - mirror - ( bool horizontal = false, bool vertical = true ) - - - reset - reset - () - - - scaleHeight - scaleHeight - ( int h ) - - - scaleWidth - scaleWidth - ( int w ) - - - setAlphaBuffer - setAlphaBuffer - ( bool enable ) - - - smoothScale - smoothScale - ( int width, int height, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio ) - - - smoothScale - smoothScale-2 - ( const QSize & size, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio ) - - - swapRGB - swapRGB - () - - - systemBitOrder - systemBitOrder - () - - - systemByteOrder - systemByteOrder - () - - - xForm - xForm - ( const QMatrix & matrix ) - - - ImageConversionFlags - bitBlt - flags = Qt::AutoColor ) - - - - QImageReader - qimagereader.html - - ImageReaderError - ImageReaderError-enum - - - - QImageReader - QImageReader - () - - - QImageReader - QImageReader-2 - ( QIODevice * device, const QByteArray & format = QByteArray() - - - QImageReader - QImageReader-3 - ( const QString & fileName, const QByteArray & format = QByteArray() - - - backgroundColor - backgroundColor - () - - - canRead - canRead - () - - - clipRect - clipRect - () - - - currentImageNumber - currentImageNumber - () - - - currentImageRect - currentImageRect - () - - - device - device - () - - - error - error - () - - - errorString - errorString - () - - - fileName - fileName - () - - - format - format - () - - - imageCount - imageCount - () - - - imageFormat - imageFormat - ( const QString & fileName ) - - - imageFormat - imageFormat-2 - ( QIODevice * device ) - - - jumpToImage - jumpToImage - ( int imageNumber ) - - - jumpToNextImage - jumpToNextImage - () - - - loopCount - loopCount - () - - - nextImageDelay - nextImageDelay - () - - - read - read - () - - - scaledClipRect - scaledClipRect - () - - - scaledSize - scaledSize - () - - - setBackgroundColor - setBackgroundColor - ( const QColor & color ) - - - setClipRect - setClipRect - ( const QRect & rect ) - - - setDevice - setDevice - ( QIODevice * device ) - - - setFileName - setFileName - ( const QString & fileName ) - - - setFormat - setFormat - ( const QByteArray & format ) - - - setScaledClipRect - setScaledClipRect - ( const QRect & rect ) - - - setScaledSize - setScaledSize - ( const QSize & size ) - - - size - size - () - - - supportedImageFormats - supportedImageFormats - () - - - supportsAnimation - supportsAnimation - () - - - text - text - ( const QString & key ) - - - textKeys - textKeys - () - - - - QImageWriter - qimagewriter.html - - ImageWriterError - ImageWriterError-enum - - - - QImageWriter - QImageWriter - () - - - QImageWriter - QImageWriter-2 - ( QIODevice * device, const QByteArray & format ) - - - QImageWriter - QImageWriter-3 - ( const QString & fileName, const QByteArray & format = QByteArray() - - - canWrite - canWrite - () - - - device - device - () - - - error - error - () - - - errorString - errorString - () - - - fileName - fileName - () - - - format - format - () - - - gamma - gamma - () - - - quality - quality - () - - - setDevice - setDevice - ( QIODevice * device ) - - - setFileName - setFileName - ( const QString & fileName ) - - - setFormat - setFormat - ( const QByteArray & format ) - - - setGamma - setGamma - ( float gamma ) - - - setQuality - setQuality - ( int quality ) - - - setText - setText - ( const QString & key, const QString & text ) - - - supportedImageFormats - supportedImageFormats - () - - - write - write - ( const QImage & image ) - - - description - description - () - - - setDescription - setDescription - ( const QString & description ) - - - - QInputContextFactory - qinputcontextfactory.html - - create - create - ( const QString & key, QObject * parent ) - - - description - description - ( const QString & key ) - - - displayName - displayName - ( const QString & key ) - - - keys - keys - () - - - languages - languages - ( const QString & key ) - - - - QInputContext - qinputcontext.html - - StandardFormat - StandardFormat-enum - - - - QInputContext - QInputContext - ( QObject * parent = 0 ) - - - actions - actions - () - - - filterEvent - filterEvent - ( const QEvent * event ) - - - font - font - () - - - identifierName - identifierName - () - - - isComposing - isComposing - () - - - language - language - () - - - mouseHandler - mouseHandler - ( int x, QMouseEvent * event ) - - - reset - reset - () - - - sendEvent - sendEvent - ( const QInputMethodEvent & event ) - - - standardFormat - standardFormat - ( StandardFormat s ) - - - update - update - () - - - widgetDestroyed - widgetDestroyed - ( QWidget * widget ) - - - x11FilterEvent - x11FilterEvent - ( QWidget * keywidget, XEvent * event ) - - - - QInputContextPlugin - qinputcontextplugin.html - - QInputContextPlugin - QInputContextPlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key ) - - - description - description - ( const QString & key ) - - - displayName - displayName - ( const QString & key ) - - - keys - keys - () - - - languages - languages - ( const QString & key ) - - - - QInputDialog - qinputdialog.html - - getDouble - getDouble - ( QWidget * parent, const QString & title, const QString & label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, bool * ok = 0, Qt::WFlags f = 0 ) - - - getInteger - getInteger - ( QWidget * parent, const QString & title, const QString & label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, bool * ok = 0, Qt::WFlags f = 0 ) - - - getItem - getItem - ( QWidget * parent, const QString & title, const QString & label, const QStringList & list, int current = 0, bool editable = true, bool * ok = 0, Qt::WFlags f = 0 ) - - - getText - getText - ( QWidget * parent, const QString & title, const QString & label, QLineEdit::EchoMode mode = QLineEdit::Normal, const QString & text = QString() - - - getDouble - getDouble-2 - ( const QString & title, const QString & label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, bool * ok = 0, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - getInteger - getInteger-2 - ( const QString & title, const QString & label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, bool * ok = 0, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - getItem - getItem-2 - ( const QString & title, const QString & label, const QStringList & list, int current = 0, bool editable = true, bool * ok = 0, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - getText - getText-2 - ( const QString & title, const QString & label, QLineEdit::EchoMode echo = QLineEdit::Normal, const QString & text = QString() - - - - QInputEvent - qinputevent.html - - KeyboardModifiers - modifiers - QInputEvent::modifiers() - - - - QInputMethodEvent::Attribute - qinputmethodevent-attribute.html - - Attribute - Attribute - ( AttributeType type, int start, int length, QVariant value ) - - - - QInputMethodEvent - qinputmethodevent.html - - AttributeType - AttributeType-enum - - - - QInputMethodEvent - QInputMethodEvent - () - - - QInputMethodEvent - QInputMethodEvent-2 - ( const QString & preeditText, const QList<Attribute> & attributes ) - - - QInputMethodEvent - QInputMethodEvent-3 - ( const QInputMethodEvent & other ) - - - attributes - attributes - () - - - commitString - commitString - () - - - preeditString - preeditString - () - - - replacementLength - replacementLength - () - - - replacementStart - replacementStart - () - - - setCommitString - setCommitString - ( const QString & commitString, int replaceFrom = 0, int replaceLength = 0 ) - - - - QIntValidator - qintvalidator.html - - QIntValidator - QIntValidator - ( QObject * parent ) - - - QIntValidator - QIntValidator-2 - ( int minimum, int maximum, QObject * parent ) - - - setRange - setRange - ( int bottom, int top ) - - - State - validate - QIntValidator::validate( QString & input, int & pos ) - - - QIntValidator - QIntValidator-3 - ( QObject * parent, const char * name ) - - - QIntValidator - QIntValidator-4 - ( int minimum, int maximum, QObject * parent, const char * name ) - - - - QIODevice - qiodevice.html - - QIODevice - QIODevice - () - - - QIODevice - QIODevice-2 - ( QObject * parent ) - - - aboutToClose - aboutToClose - () - - - atEnd - atEnd - () - - - bytesAvailable - bytesAvailable - () - - - bytesToWrite - bytesToWrite - () - - - bytesWritten - bytesWritten - ( qint64 bytes ) - - - canReadLine - canReadLine - () - - - close - close - () - - - errorString - errorString - () - - - getChar - getChar - ( char * c ) - - - isOpen - isOpen - () - - - isReadable - isReadable - () - - - isSequential - isSequential - () - - - isTextModeEnabled - isTextModeEnabled - () - - - isWritable - isWritable - () - - - open - open - ( OpenMode mode ) - - - openMode - openMode - () - - - peek - peek - ( char * data, qint64 maxSize ) - - - peek - peek-2 - ( qint64 maxSize ) - - - pos - pos - () - - - putChar - putChar - ( char c ) - - - read - read - ( char * data, qint64 maxSize ) - - - read - read-2 - ( qint64 maxSize ) - - - readAll - readAll - () - - - readData - readData - ( char * data, qint64 maxSize ) - - - readLine - readLine - ( char * data, qint64 maxSize ) - - - readLine - readLine-2 - ( qint64 maxSize = 0 ) - - - readLineData - readLineData - ( char * data, qint64 maxSize ) - - - readyRead - readyRead - () - - - reset - reset - () - - - seek - seek - ( qint64 pos ) - - - setErrorString - setErrorString - ( const QString & str ) - - - setOpenMode - setOpenMode - ( OpenMode openMode ) - - - setTextModeEnabled - setTextModeEnabled - ( bool enabled ) - - - size - size - () - - - ungetChar - ungetChar - ( char c ) - - - waitForBytesWritten - waitForBytesWritten - ( int msecs ) - - - waitForReadyRead - waitForReadyRead - ( int msecs ) - - - write - write - ( const char * data, qint64 maxSize ) - - - write - write-2 - ( const QByteArray & byteArray ) - - - writeData - writeData - ( const char * data, qint64 maxSize ) - - - Offset - Offset-typedef - - - - Status - Status-typedef - - - - at - at - () - - - at - at-2 - ( Offset offset ) - - - flags - flags - () - - - getch - getch - () - - - isAsynchronous - isAsynchronous - () - - - isBuffered - isBuffered - () - - - isCombinedAccess - isCombinedAccess - () - - - isDirectAccess - isDirectAccess - () - - - isInactive - isInactive - () - - - isRaw - isRaw - () - - - isSequentialAccess - isSequentialAccess - () - - - isSynchronous - isSynchronous - () - - - isTranslated - isTranslated - () - - - mode - mode - () - - - putch - putch - ( int ch ) - - - readBlock - readBlock - ( char * data, quint64 size ) - - - resetStatus - resetStatus - () - - - state - state - () - - - status - status - () - - - ungetch - ungetch - ( int ch ) - - - writeBlock - writeBlock - ( const char * data, quint64 size ) - - - writeBlock - writeBlock-2 - ( const QByteArray & data ) - - - - QItemDelegate - qitemdelegate.html - - QItemDelegate - QItemDelegate - ( QObject * parent = 0 ) - - - createEditor - createEditor - ( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - drawCheck - drawCheck - ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, Qt::CheckState state ) - - - drawDecoration - drawDecoration - ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QPixmap & pixmap ) - - - drawDisplay - drawDisplay - ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect, const QString & text ) - - - drawFocus - drawFocus - ( QPainter * painter, const QStyleOptionViewItem & option, const QRect & rect ) - - - eventFilter - eventFilter - ( QObject * object, QEvent * event ) - - - itemEditorFactory - itemEditorFactory - () - - - paint - paint - ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - setEditorData - setEditorData - ( QWidget * editor, const QModelIndex & index ) - - - setItemEditorFactory - setItemEditorFactory - ( QItemEditorFactory * factory ) - - - setModelData - setModelData - ( QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) - - - sizeHint - sizeHint - ( const QStyleOptionViewItem & option, const QModelIndex & index ) - - - updateEditorGeometry - updateEditorGeometry - ( QWidget * editor, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - - QItemEditorCreatorBase - qitemeditorcreatorbase.html - - createWidget - createWidget - ( QWidget * parent ) - - - valuePropertyName - valuePropertyName - () - - - - QItemEditorFactory - qitemeditorfactory.html - - QItemEditorFactory - QItemEditorFactory - () - - - createEditor - createEditor - ( QVariant::Type type, QWidget * parent ) - - - defaultFactory - defaultFactory - () - - - registerEditor - registerEditor - ( QVariant::Type type, QItemEditorCreatorBase * creator ) - - - setDefaultFactory - setDefaultFactory - ( QItemEditorFactory * factory ) - - - valuePropertyName - valuePropertyName - ( QVariant::Type type ) - - - - QItemSelection - qitemselection.html - - QItemSelection - QItemSelection - () - - - QItemSelection - QItemSelection-2 - ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) - - - contains - contains - ( const QModelIndex & index ) - - - indexes - indexes - () - - - merge - merge - ( const QItemSelection & other, QItemSelectionModel::SelectionFlags command ) - - - select - select - ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) - - - split - split - ( const QItemSelectionRange & range, const QItemSelectionRange & other, QItemSelection * result ) - - - - QItemSelectionModel - qitemselectionmodel.html - - QItemSelectionModel - QItemSelectionModel - ( QAbstractItemModel * model ) - - - QItemSelectionModel - QItemSelectionModel-2 - ( QAbstractItemModel * model, QObject * parent ) - - - clear - clear - () - - - columnIntersectsSelection - columnIntersectsSelection - ( int column, const QModelIndex & parent ) - - - currentChanged - currentChanged - ( const QModelIndex & current, const QModelIndex & previous ) - - - currentColumnChanged - currentColumnChanged - ( const QModelIndex & current, const QModelIndex & previous ) - - - currentIndex - currentIndex - () - - - currentRowChanged - currentRowChanged - ( const QModelIndex & current, const QModelIndex & previous ) - - - emitSelectionChanged - emitSelectionChanged - ( const QItemSelection & newSelection, const QItemSelection & oldSelection ) - - - isColumnSelected - isColumnSelected - ( int column, const QModelIndex & parent ) - - - isRowSelected - isRowSelected - ( int row, const QModelIndex & parent ) - - - isSelected - isSelected - ( const QModelIndex & index ) - - - model - model - () - - - reset - reset - () - - - rowIntersectsSelection - rowIntersectsSelection - ( int row, const QModelIndex & parent ) - - - select - select - ( const QModelIndex & index, QItemSelectionModel::SelectionFlags command ) - - - select - select-2 - ( const QItemSelection & selection, QItemSelectionModel::SelectionFlags command ) - - - selectedIndexes - selectedIndexes - () - - - selection - selection - () - - - selectionChanged - selectionChanged - ( const QItemSelection & selected, const QItemSelection & deselected ) - - - setCurrentIndex - setCurrentIndex - ( const QModelIndex & index, QItemSelectionModel::SelectionFlags command ) - - - - QItemSelectionRange - qitemselectionrange.html - - QItemSelectionRange - QItemSelectionRange - () - - - QItemSelectionRange - QItemSelectionRange-2 - ( const QItemSelectionRange & other ) - - - QItemSelectionRange - QItemSelectionRange-3 - ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) - - - QItemSelectionRange - QItemSelectionRange-4 - ( const QModelIndex & index ) - - - bottom - bottom - () - - - bottomRight - bottomRight - () - - - contains - contains - ( const QModelIndex & index ) - - - height - height - () - - - indexes - indexes - () - - - intersect - intersect - ( const QItemSelectionRange & other ) - - - intersects - intersects - ( const QItemSelectionRange & other ) - - - isValid - isValid - () - - - left - left - () - - - model - model - () - - - parent - parent - () - - - right - right - () - - - top - top - () - - - topLeft - topLeft - () - - - width - width - () - - - operator!= - operator-not-eq - ( const QItemSelectionRange & other ) - - - operator== - operator-eq-eq - ( const QItemSelectionRange & other ) - - - - QKbdDriverFactory - qkbddriverfactory.html - - create - create - ( const QString & key, const QString & device ) - - - keys - keys - () - - - - QKbdDriverPlugin - qkbddriverplugin.html - - QKbdDriverPlugin - QKbdDriverPlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key, const QString & device ) - - - keys - keys - () - - - - QKeyEvent - qkeyevent.html - - QKeyEvent - QKeyEvent - ( Type type, int key, Qt::KeyboardModifiers modifiers, const QString & text = QString() - - - count - count - () - - - isAutoRepeat - isAutoRepeat - () - - - key - key - () - - - KeyboardModifiers - modifiers - QKeyEvent::modifiers() - - - text - text - () - - - QKeyEvent - QKeyEvent-2 - ( Type type, int key, int ascii, int modifiers, const QString & text = QString() - - - ascii - ascii - () - - - ButtonState - state - QKeyEvent::state() - - - ButtonState - stateAfter - QKeyEvent::stateAfter() - - - - QKeySequence - qkeysequence.html - - SequenceFormat - SequenceFormat-enum - - - - SequenceMatch - SequenceMatch-enum - - - - QKeySequence - QKeySequence - () - - - QKeySequence - QKeySequence-2 - ( const QString & key ) - - - QKeySequence - QKeySequence-3 - ( int k1, int k2 = 0, int k3 = 0, int k4 = 0 ) - - - QKeySequence - QKeySequence-4 - ( const QKeySequence & keysequence ) - - - count - count - () - - - fromString - fromString - ( const QString & str, SequenceFormat format = PortableText ) - - - isEmpty - isEmpty - () - - - matches - matches - ( const QKeySequence & seq ) - - - mnemonic - mnemonic - ( const QString & text ) - - - toString - toString - ( SequenceFormat format = PortableText ) - - - operator - operator-QString - QString() - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QKeySequence & other ) - - - operator< - operator-lt - ( const QKeySequence & other ) - - - operator<= - operator-lt-eq - ( const QKeySequence & other ) - - - operator= - operator-eq - ( const QKeySequence & other ) - - - operator== - operator-eq-eq - ( const QKeySequence & other ) - - - operator> - operator-gt - ( const QKeySequence & other ) - - - operator>= - operator-gt-eq - ( const QKeySequence & other ) - - - operator[] - operator-5b-5d - ( uint index ) - - - operator - operator-int - int() - - - - QLabel - qlabel.html - - Alignment - alignment-prop - - - - TextFormat - textFormat-prop - - - - QLabel - QLabel - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - QLabel - QLabel-2 - ( const QString & text, QWidget * parent = 0, Qt::WFlags f = 0 ) - - - buddy - buddy - () - - - clear - clear - () - - - movie - movie - () - - - picture - picture - () - - - setBuddy - setBuddy - ( QWidget * buddy ) - - - setMovie - setMovie - ( QMovie * movie ) - - - setNum - setNum - ( int num ) - - - setNum - setNum-2 - ( double num ) - - - setPicture - setPicture - ( const QPicture & picture ) - - - QLabel - QLabel-3 - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - QLabel - QLabel-4 - ( const QString & text, QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - QLabel - QLabel-5 - ( QWidget * buddy, const QString & text, QWidget * parent = 0, const char * name = 0, Qt::WFlags f = 0 ) - - - setAlignment - setAlignment-2 - ( int alignment ) - - - - QLatin1Char - qlatin1char.html - - QLatin1Char - QLatin1Char - ( char c ) - - - toLatin1 - toLatin1 - () - - - unicode - unicode - () - - - - QLatin1String - qlatin1string.html - - QLatin1String - QLatin1String - ( const char * str ) - - - latin1 - latin1 - () - - - operator!= - operator-not-eq - ( const QString & other ) - - - operator< - operator-lt - ( const QString & other ) - - - operator<= - operator-lt-eq - ( const QString & other ) - - - operator= - operator-eq - ( const QLatin1String & other ) - - - operator== - operator-eq-eq - ( const QString & other ) - - - operator> - operator-gt - ( const QString & other ) - - - operator>= - operator-gt-eq - ( const QString & other ) - - - - QLayout - qlayout.html - - SizeConstraint - SizeConstraint-enum - - - - QLayout - QLayout - ( QWidget * parent ) - - - QLayout - QLayout-2 - () - - - activate - activate - () - - - addChildLayout - addChildLayout - ( QLayout * l ) - - - addChildWidget - addChildWidget - ( QWidget * w ) - - - addItem - addItem - ( QLayoutItem * item ) - - - addWidget - addWidget - ( QWidget * w ) - - - alignmentRect - alignmentRect - ( const QRect & r ) - - - closestAcceptableSize - closestAcceptableSize - ( const QWidget * widget, const QSize & size ) - - - count - count - () - - - Orientations - expandingDirections - QLayout::expandingDirections() - - - indexOf - indexOf - ( QWidget * widget ) - - - isEnabled - isEnabled - () - - - itemAt - itemAt - ( int index ) - - - maximumSize - maximumSize - () - - - menuBar - menuBar - () - - - minimumSize - minimumSize - () - - - parentWidget - parentWidget - () - - - removeItem - removeItem - ( QLayoutItem * item ) - - - removeWidget - removeWidget - ( QWidget * widget ) - - - setAlignment - setAlignment - ( QWidget * w, Qt::Alignment alignment ) - - - setAlignment - setAlignment-2 - ( QLayout * l, Qt::Alignment alignment ) - - - setEnabled - setEnabled - ( bool enable ) - - - setMenuBar - setMenuBar - ( QWidget * widget ) - - - takeAt - takeAt - ( int index ) - - - update - update - () - - - - QLayoutItem - qlayoutitem.html - - QLayoutItem - QLayoutItem - ( Qt::Alignment alignment = 0 ) - - - Alignment - alignment - QLayoutItem::alignment() - - - Orientations - expandingDirections - QLayoutItem::expandingDirections() - - - geometry - geometry - () - - - hasHeightForWidth - hasHeightForWidth - () - - - heightForWidth - heightForWidth - ( int w ) - - - invalidate - invalidate - () - - - isEmpty - isEmpty - () - - - layout - layout - () - - - maximumSize - maximumSize - () - - - minimumHeightForWidth - minimumHeightForWidth - ( int w ) - - - minimumSize - minimumSize - () - - - setAlignment - setAlignment - ( Qt::Alignment alignment ) - - - setGeometry - setGeometry - ( const QRect & r ) - - - sizeHint - sizeHint - () - - - spacerItem - spacerItem - () - - - widget - widget - () - - - QLayout - QLayout-4 - ( QWidget * parent, int margin, int spacing = -1, const char * name = 0 ) - - - QLayout - QLayout-5 - ( QLayout * parentLayout, int spacing = -1, const char * name = 0 ) - - - QLayout - QLayout-6 - ( int spacing, const char * name = 0 ) - - - add - add - ( QWidget * widget ) - - - autoAdd - autoAdd - () - - - defaultBorder - defaultBorder - () - - - deleteAllItems - deleteAllItems - () - - - freeze - freeze - ( int w = 0, int h = 0 ) - - - isTopLevel - isTopLevel - () - - - iterator - iterator - () - - - mainWidget - mainWidget - () - - - remove - remove - ( QWidget * widget ) - - - resizeMode - resizeMode - () - - - setAutoAdd - setAutoAdd - ( bool a ) - - - setResizeMode - setResizeMode - ( SizeConstraint constraint ) - - - - QLCDNumber - qlcdnumber.html - - Mode - Mode-enum - - - - SegmentStyle - SegmentStyle-enum - - - - QLCDNumber - QLCDNumber - ( QWidget * parent = 0 ) - - - QLCDNumber - QLCDNumber-2 - ( uint numDigits, QWidget * parent = 0 ) - - - checkOverflow - checkOverflow - ( double num ) - - - checkOverflow - checkOverflow-2 - ( int num ) - - - overflow - overflow - () - - - setBinMode - setBinMode - () - - - setDecMode - setDecMode - () - - - setHexMode - setHexMode - () - - - setOctMode - setOctMode - () - - - QLCDNumber - QLCDNumber-3 - ( QWidget * parent, const char * name ) - - - QLCDNumber - QLCDNumber-4 - ( uint numDigits, QWidget * parent, const char * name ) - - - - QLibrary - qlibrary.html - - QLibrary - QLibrary - ( QObject * parent = 0 ) - - - QLibrary - QLibrary-2 - ( const QString & fileName, QObject * parent = 0 ) - - - QLibrary - QLibrary-3 - ( const QString & fileName, int verNum, QObject * parent = 0 ) - - - isLibrary - isLibrary - ( const QString & fileName ) - - - isLoaded - isLoaded - () - - - load - load - () - - - resolve - resolve - ( const char * symbol ) - - - resolve - resolve-2 - ( const QString & fileName, const char * symbol ) - - - resolve - resolve-3 - ( const QString & fileName, int verNum, const char * symbol ) - - - setFileNameAndVersion - setFileNameAndVersion - ( const QString & fileName, int versionNumber ) - - - unload - unload - () - - - - QLibraryInfo - qlibraryinfo.html - - LibraryLocation - LibraryLocation-enum - - - - buildKey - buildKey - () - - - licensedProducts - licensedProducts - () - - - licensee - licensee - () - - - location - location - ( LibraryLocation loc ) - - - library - library - () - - - setAutoUnload - setAutoUnload - ( bool b ) - - - - QLinearGradient - qlineargradient.html - - QLinearGradient - QLinearGradient - ( const QPointF & start, const QPointF & finalStop ) - - - QLinearGradient - QLinearGradient-2 - ( qreal x1, qreal y1, qreal x2, qreal y2 ) - - - finalStop - finalStop - () - - - start - start - () - - - - QLineEdit - qlineedit.html - - EchoMode - EchoMode-enum - - - - Alignment - alignment-prop - - - - QLineEdit - QLineEdit - ( QWidget * parent = 0 ) - - - QLineEdit - QLineEdit-2 - ( const QString & contents, QWidget * parent = 0 ) - - - backspace - backspace - () - - - clear - clear - () - - - contextMenuEvent - contextMenuEvent - ( QContextMenuEvent * event ) - - - copy - copy - () - - - createStandardContextMenu - createStandardContextMenu - () - - - cursorBackward - cursorBackward - ( bool mark, int steps = 1 ) - - - cursorForward - cursorForward - ( bool mark, int steps = 1 ) - - - cursorPositionAt - cursorPositionAt - ( const QPoint & pos ) - - - cursorPositionChanged - cursorPositionChanged - ( int old, int new ) - - - cursorWordBackward - cursorWordBackward - ( bool mark ) - - - cursorWordForward - cursorWordForward - ( bool mark ) - - - cut - cut - () - - - del - del - () - - - deselect - deselect - () - - - editingFinished - editingFinished - () - - - end - end - ( bool mark ) - - - home - home - ( bool mark ) - - - insert - insert - ( const QString & newText ) - - - keyPressEvent - keyPressEvent - ( QKeyEvent * event ) - - - minimumSizeHint - minimumSizeHint - () - - - paste - paste - () - - - redo - redo - () - - - returnPressed - returnPressed - () - - - selectAll - selectAll - () - - - selectionChanged - selectionChanged - () - - - selectionStart - selectionStart - () - - - setSelection - setSelection - ( int start, int length ) - - - setValidator - setValidator - ( const QValidator * v ) - - - sizeHint - sizeHint - () - - - textChanged - textChanged - ( const QString & text ) - - - textEdited - textEdited - ( const QString & text ) - - - undo - undo - () - - - validator - validator - () - - - QLineEdit - QLineEdit-3 - ( QWidget * parent, const char * name ) - - - QLineEdit - QLineEdit-4 - ( const QString & contents, QWidget * parent, const char * name ) - - - QLineEdit - QLineEdit-5 - ( const QString & contents, const QString & inputMask, QWidget * parent = 0, const char * name = 0 ) - - - characterAt - characterAt - ( int xpos, QChar * chr ) - - - clearModified - clearModified - () - - - clearValidator - clearValidator - () - - - cursorLeft - cursorLeft - ( bool mark, int steps = 1 ) - - - cursorRight - cursorRight - ( bool mark, int steps = 1 ) - - - edited - edited - () - - - frame - frame - () - - - getSelection - getSelection - ( int * start, int * end ) - - - hasMarkedText - hasMarkedText - () - - - lostFocus - lostFocus - () - - - markedText - markedText - () - - - repaintArea - repaintArea - ( int a, int b ) - - - setEdited - setEdited - ( bool on ) - - - validateAndSet - validateAndSet - ( const QString & newText, int newPos, int newMarkAnchor, int newMarkDrag ) - - - - QLineF - qlinef.html - - IntersectType - IntersectType-enum - - - - QLineF - QLineF - () - - - QLineF - QLineF-2 - ( const QPointF & p1, const QPointF & p2 ) - - - QLineF - QLineF-3 - ( qreal x1, qreal y1, qreal x2, qreal y2 ) - - - QLineF - QLineF-4 - ( const QLine & line ) - - - p1 - p1 - () - - - p2 - p2 - () - - - x1 - x1 - () - - - x2 - x2 - () - - - y1 - y1 - () - - - y2 - y2 - () - - - angle - angle - ( const QLineF & line ) - - - dx - dx - () - - - dy - dy - () - - - intersect - intersect - ( const QLineF & line, QPointF * intersectionPoint ) - - - isNull - isNull - () - - - length - length - () - - - normalVector - normalVector - () - - - pointAt - pointAt - ( qreal t ) - - - setLength - setLength - ( qreal length ) - - - toLine - toLine - () - - - translate - translate - ( const QPointF & offset ) - - - translate - translate-2 - ( qreal dx, qreal dy ) - - - unitVector - unitVector - () - - - operator!= - operator-not-eq - ( const QLineF & line ) - - - operator== - operator-eq-eq - ( const QLineF & line ) - - - - QLine - qline.html - - QLine - QLine - () - - - QLine - QLine-2 - ( const QPoint & p1, const QPoint & p2 ) - - - QLine - QLine-3 - ( int x1, int y1, int x2, int y2 ) - - - p1 - p1 - () - - - p2 - p2 - () - - - x1 - x1 - () - - - x2 - x2 - () - - - y1 - y1 - () - - - y2 - y2 - () - - - dx - dx - () - - - dy - dy - () - - - isNull - isNull - () - - - translate - translate - ( const QPoint & offset ) - - - translate - translate-2 - ( int dx, int dy ) - - - operator!= - operator-not-eq - ( const QLine & line ) - - - operator== - operator-eq-eq - ( const QLine & line ) - - - - QLinkedList::const_iterator - qlinkedlist-const-iterator.html - - const_iterator - const_iterator - () - - - const_iterator - const_iterator-3 - ( const const_iterator & other ) - - - const_iterator - const_iterator-4 - ( iterator other ) - - - operator!= - operator-not-eq - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator= - operator-eq - ( const const_iterator & other ) - - - operator== - operator-eq-eq - ( const const_iterator & other ) - - - - QLinkedList - qlinkedlist.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - const_pointer - const_pointer-typedef - - - - const_reference - const_reference-typedef - - - - pointer - pointer-typedef - - - - reference - reference-typedef - - - - size_type - size_type-typedef - - - - value_type - value_type-typedef - - - - QLinkedList - QLinkedList - () - - - QLinkedList - QLinkedList-2 - ( const QLinkedList<T> & other ) - - - append - append - ( const T & value ) - - - back - back - () - - - back - back-2 - () - - - begin - begin - () - - - begin - begin-2 - () - - - clear - clear - () - - - constBegin - constBegin - () - - - constEnd - constEnd - () - - - contains - contains - ( const T & value ) - - - count - count - ( const T & value ) - - - count - count-2 - () - - - empty - empty - () - - - end - end - () - - - end - end-2 - () - - - erase - erase - ( iterator pos ) - - - erase - erase-2 - ( iterator begin, iterator end ) - - - first - first - () - - - first - first-2 - () - - - fromStdList - fromStdList - ( const std::list<T> & list ) - - - front - front - () - - - front - front-2 - () - - - insert - insert - ( iterator before, const T & value ) - - - isEmpty - isEmpty - () - - - last - last - () - - - last - last-2 - () - - - pop_back - pop_back - () - - - pop_front - pop_front - () - - - prepend - prepend - ( const T & value ) - - - push_back - push_back - ( const T & value ) - - - push_front - push_front - ( const T & value ) - - - removeAll - removeAll - ( const T & value ) - - - removeFirst - removeFirst - () - - - removeLast - removeLast - () - - - size - size - () - - - takeFirst - takeFirst - () - - - takeLast - takeLast - () - - - list - toStdList - <T> QLinkedList::toStdList() - - - operator!= - operator-not-eq - ( const QLinkedList<T> & other ) - - - operator+ - operator-2b - ( const QLinkedList<T> & other ) - - - operator+= - operator-2b-eq - ( const QLinkedList<T> & other ) - - - operator+= - operator-2b-eq-2 - ( const T & value ) - - - operator<< - operator-lt-lt - ( const QLinkedList<T> & other ) - - - operator<< - operator-lt-lt-2 - ( const T & value ) - - - operator= - operator-eq - ( const QLinkedList<T> & other ) - - - operator== - operator-eq-eq - ( const QLinkedList<T> & other ) - - - - QLinkedList::iterator - qlinkedlist-iterator.html - - iterator - iterator - () - - - iterator - iterator-3 - ( const iterator & other ) - - - operator!= - operator-not-eq - ( const iterator & other ) - - - operator!= - operator-not-eq-2 - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator= - operator-eq - ( const iterator & other ) - - - operator== - operator-eq-eq - ( const iterator & other ) - - - operator== - operator-eq-eq-2 - ( const const_iterator & other ) - - - - QLinkedListIterator - qlinkedlistiterator.html - - QLinkedListIterator - QLinkedListIterator - ( const QLinkedList<T> & list ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - toBack - toBack - () - - - toFront - toFront - () - - - operator= - operator-eq - ( const QLinkedList<T> & list ) - - - find - find - ( iterator from, const T & t ) - - - find - find-2 - ( const T & t ) - - - find - find-3 - ( const_iterator from, const T & t ) - - - find - find-4 - ( const T & t ) - - - findIndex - findIndex - ( const T & t ) - - - remove - remove - ( iterator pos ) - - - - QLinuxFbScreen - qlinuxfbscreen.html - - QLinuxFbScreen - QLinuxFbScreen - ( int displayId ) - - - cache - cache - ( int amount ) - - - clearCache - clearCache - ( QScreen * instance, int clientId ) - - - deleteEntry - deleteEntry - ( uchar * memoryBlock ) - - - set - set - ( unsigned int index, unsigned int red, unsigned int green, unsigned int blue ) - - - uncache - uncache - ( uchar * memoryBlock ) - - - useOffscreen - useOffscreen - () - - - - QList::const_iterator - qlist-const-iterator.html - - const_iterator - const_iterator - () - - - const_iterator - const_iterator-3 - ( const const_iterator & other ) - - - const_iterator - const_iterator-4 - ( const iterator & other ) - - - operator!= - operator-not-eq - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator- - operator--2 - ( const_iterator other ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator< - operator-lt - ( const const_iterator & other ) - - - operator<= - operator-lt-eq - ( const const_iterator & other ) - - - operator== - operator-eq-eq - ( const const_iterator & other ) - - - operator> - operator-gt - ( const const_iterator & other ) - - - operator>= - operator-gt-eq - ( const const_iterator & other ) - - - operator[] - operator-5b-5d - ( int j ) - - - - QList - qlist.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - const_pointer - const_pointer-typedef - - - - const_reference - const_reference-typedef - - - - pointer - pointer-typedef - - - - reference - reference-typedef - - - - size_type - size_type-typedef - - - - value_type - value_type-typedef - - - - QList - QList - () - - - QList - QList-2 - ( const QList<T> & other ) - - - append - append - ( const T & value ) - - - at - at - ( int i ) - - - back - back - () - - - back - back-2 - () - - - begin - begin - () - - - begin - begin-2 - () - - - clear - clear - () - - - constBegin - constBegin - () - - - constEnd - constEnd - () - - - contains - contains - ( const T & value ) - - - count - count - ( const T & value ) - - - count - count-2 - () - - - empty - empty - () - - - end - end - () - - - end - end-2 - () - - - erase - erase - ( iterator pos ) - - - erase - erase-2 - ( iterator begin, iterator end ) - - - first - first - () - - - first - first-2 - () - - - fromSet - fromSet - ( const QSet<T> & set ) - - - fromStdList - fromStdList - ( const std::list<T> & list ) - - - fromVector - fromVector - ( const QVector<T> & vector ) - - - front - front - () - - - front - front-2 - () - - - indexOf - indexOf - ( const T & value, int from = 0 ) - - - insert - insert - ( int i, const T & value ) - - - insert - insert-2 - ( iterator before, const T & value ) - - - isEmpty - isEmpty - () - - - last - last - () - - - last - last-2 - () - - - lastIndexOf - lastIndexOf - ( const T & value, int from = -1 ) - - - mid - mid - ( int pos, int length = -1 ) - - - move - move - ( int from, int to ) - - - pop_back - pop_back - () - - - pop_front - pop_front - () - - - prepend - prepend - ( const T & value ) - - - push_back - push_back - ( const T & value ) - - - push_front - push_front - ( const T & value ) - - - removeAll - removeAll - ( const T & value ) - - - removeAt - removeAt - ( int i ) - - - removeFirst - removeFirst - () - - - removeLast - removeLast - () - - - replace - replace - ( int i, const T & value ) - - - size - size - () - - - swap - swap - ( int i, int j ) - - - takeAt - takeAt - ( int i ) - - - takeFirst - takeFirst - () - - - takeLast - takeLast - () - - - toSet - toSet - () - - - list - toStdList - <T> QList::toStdList() - - - toVector - toVector - () - - - value - value - ( int i ) - - - value - value-2 - ( int i, const T & defaultValue ) - - - operator!= - operator-not-eq - ( const QList<T> & other ) - - - operator+ - operator-2b - ( const QList<T> & other ) - - - operator+= - operator-2b-eq - ( const QList<T> & other ) - - - operator+= - operator-2b-eq-2 - ( const T & value ) - - - operator<< - operator-lt-lt - ( const QList<T> & other ) - - - operator<< - operator-lt-lt-2 - ( const T & value ) - - - operator= - operator-eq - ( const QList<T> & other ) - - - operator== - operator-eq-eq - ( const QList<T> & other ) - - - operator[] - operator-5b-5d - ( int i ) - - - operator[] - operator-5b-5d-2 - ( int i ) - - - - QList::iterator - qlist-iterator.html - - iterator - iterator - () - - - iterator - iterator-3 - ( const iterator & other ) - - - operator!= - operator-not-eq - ( const iterator & other ) - - - operator!= - operator-not-eq-2 - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator- - operator--2 - ( iterator other ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator< - operator-lt - ( const iterator & other ) - - - operator< - operator-lt-2 - ( const const_iterator & other ) - - - operator<= - operator-lt-eq - ( const iterator & other ) - - - operator<= - operator-lt-eq-2 - ( const const_iterator & other ) - - - operator== - operator-eq-eq - ( const iterator & other ) - - - operator== - operator-eq-eq-2 - ( const const_iterator & other ) - - - operator> - operator-gt - ( const iterator & other ) - - - operator> - operator-gt-2 - ( const const_iterator & other ) - - - operator>= - operator-gt-eq - ( const iterator & other ) - - - operator>= - operator-gt-eq-2 - ( const const_iterator & other ) - - - operator[] - operator-5b-5d - ( int j ) - - - - QListIterator - qlistiterator.html - - QListIterator - QListIterator - ( const QList<T> & list ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - toBack - toBack - () - - - toFront - toFront - () - - - operator= - operator-eq - ( const QList<T> & list ) - - - find - find - ( const T & t ) - - - find - find-2 - ( const T & t ) - - - find - find-3 - ( iterator from, const T & t ) - - - find - find-4 - ( const_iterator from, const T & t ) - - - findIndex - findIndex - ( const T & t ) - - - remove - remove - ( iterator pos ) - - - remove - remove-2 - ( const T & t ) - - - - QListView - qlistview.html - - Flow - Flow-enum - - - - LayoutMode - LayoutMode-enum - - - - Movement - Movement-enum - - - - ResizeMode - ResizeMode-enum - - - - ViewMode - ViewMode-enum - - - - QListView - QListView - ( QWidget * parent = 0 ) - - - clearPropertyFlags - clearPropertyFlags - () - - - event - event - ( QEvent * e ) - - - isRowHidden - isRowHidden - ( int row ) - - - rectForIndex - rectForIndex - ( const QModelIndex & index ) - - - setPositionForIndex - setPositionForIndex - ( const QPoint & position, const QModelIndex & index ) - - - setRowHidden - setRowHidden - ( int row, bool hide ) - - - - QListWidget - qlistwidget.html - - QListWidget - QListWidget - ( QWidget * parent = 0 ) - - - addItem - addItem - ( const QString & label ) - - - addItem - addItem-2 - ( QListWidgetItem * item ) - - - addItems - addItems - ( const QStringList & labels ) - - - clear - clear - () - - - closePersistentEditor - closePersistentEditor - ( QListWidgetItem * item ) - - - currentItem - currentItem - () - - - currentItemChanged - currentItemChanged - ( QListWidgetItem * current, QListWidgetItem * previous ) - - - currentRowChanged - currentRowChanged - ( int currentRow ) - - - currentTextChanged - currentTextChanged - ( const QString & currentText ) - - - dropMimeData - dropMimeData - ( int index, const QMimeData * data, Qt::DropAction action ) - - - editItem - editItem - ( QListWidgetItem * item ) - - - event - event - ( QEvent * e ) - - - findItems - findItems - ( const QString & text, Qt::MatchFlags flags ) - - - indexFromItem - indexFromItem - ( QListWidgetItem * item ) - - - insertItem - insertItem - ( int row, QListWidgetItem * item ) - - - insertItem - insertItem-2 - ( int row, const QString & label ) - - - insertItems - insertItems - ( int row, const QStringList & labels ) - - - isItemHidden - isItemHidden - ( const QListWidgetItem * item ) - - - isItemSelected - isItemSelected - ( const QListWidgetItem * item ) - - - item - item - ( int row ) - - - itemActivated - itemActivated - ( QListWidgetItem * item ) - - - itemAt - itemAt - ( const QPoint & p ) - - - itemAt - itemAt-2 - ( int x, int y ) - - - itemChanged - itemChanged - ( QListWidgetItem * item ) - - - itemClicked - itemClicked - ( QListWidgetItem * item ) - - - itemDoubleClicked - itemDoubleClicked - ( QListWidgetItem * item ) - - - itemEntered - itemEntered - ( QListWidgetItem * item ) - - - itemFromIndex - itemFromIndex - ( const QModelIndex & index ) - - - itemPressed - itemPressed - ( QListWidgetItem * item ) - - - itemSelectionChanged - itemSelectionChanged - () - - - itemWidget - itemWidget - ( QListWidgetItem * item ) - - - items - items - ( const QMimeData * data ) - - - mimeData - mimeData - ( const QList<QListWidgetItem *> items ) - - - mimeTypes - mimeTypes - () - - - openPersistentEditor - openPersistentEditor - ( QListWidgetItem * item ) - - - row - row - ( const QListWidgetItem * item ) - - - scrollToItem - scrollToItem - ( const QListWidgetItem * item, QAbstractItemView::ScrollHint hint = EnsureVisible ) - - - selectedItems - selectedItems - () - - - setCurrentItem - setCurrentItem - ( QListWidgetItem * item ) - - - setItemHidden - setItemHidden - ( const QListWidgetItem * item, bool hide ) - - - setItemSelected - setItemSelected - ( const QListWidgetItem * item, bool select ) - - - setItemWidget - setItemWidget - ( QListWidgetItem * item, QWidget * widget ) - - - sortItems - sortItems - ( Qt::SortOrder order = Qt::AscendingOrder ) - - - DropActions - supportedDropActions - QListWidget::supportedDropActions() - - - takeItem - takeItem - ( int row ) - - - visualItemRect - visualItemRect - ( const QListWidgetItem * item ) - - - - QListWidgetItem - qlistwidgetitem.html - - QListWidgetItem - QListWidgetItem - ( QListWidget * parent = 0, int type = Type ) - - - QListWidgetItem - QListWidgetItem-2 - ( const QString & text, QListWidget * parent = 0, int type = Type ) - - - QListWidgetItem - QListWidgetItem-3 - ( const QIcon & icon, const QString & text, QListWidget * parent = 0, int type = Type ) - - - QListWidgetItem - QListWidgetItem-4 - ( const QListWidgetItem & other ) - - - backgroundColor - backgroundColor - () - - - CheckState - checkState - QListWidgetItem::checkState() - - - clone - clone - () - - - data - data - ( int role ) - - - ItemFlags - flags - QListWidgetItem::flags() - - - font - font - () - - - icon - icon - () - - - listWidget - listWidget - () - - - read - read - ( QDataStream & in ) - - - setBackgroundColor - setBackgroundColor - ( const QColor & color ) - - - setCheckState - setCheckState - ( Qt::CheckState state ) - - - setData - setData - ( int role, const QVariant & value ) - - - setFlags - setFlags - ( Qt::ItemFlags flags ) - - - setFont - setFont - ( const QFont & font ) - - - setIcon - setIcon - ( const QIcon & icon ) - - - setSizeHint - setSizeHint - ( const QSize & size ) - - - setStatusTip - setStatusTip - ( const QString & statusTip ) - - - setText - setText - ( const QString & text ) - - - setTextAlignment - setTextAlignment - ( int alignment ) - - - setTextColor - setTextColor - ( const QColor & color ) - - - setToolTip - setToolTip - ( const QString & toolTip ) - - - setWhatsThis - setWhatsThis - ( const QString & whatsThis ) - - - sizeHint - sizeHint - () - - - statusTip - statusTip - () - - - text - text - () - - - textAlignment - textAlignment - () - - - textColor - textColor - () - - - toolTip - toolTip - () - - - type - type - () - - - whatsThis - whatsThis - () - - - write - write - ( QDataStream & out ) - - - operator< - operator-lt - ( const QListWidgetItem & other ) - - - operator= - operator-eq - ( const QListWidgetItem & other ) - - - Type - Type-var - - - - UserType - UserType-var - - - - - QLocale - qlocale.html - - Country - Country-enum - - - - FormatType - FormatType-enum - - - - Language - Language-enum - - - - QLocale - QLocale - () - - - QLocale - QLocale-2 - ( const QString & name ) - - - QLocale - QLocale-3 - ( Language language, Country country = AnyCountry ) - - - QLocale - QLocale-4 - ( const QLocale & other ) - - - c - c - () - - - country - country - () - - - countryToString - countryToString - ( Country country ) - - - dateFormat - dateFormat - ( FormatType format = LongFormat ) - - - decimalPoint - decimalPoint - () - - - exponential - exponential - () - - - groupSeparator - groupSeparator - () - - - language - language - () - - - languageToString - languageToString - ( Language language ) - - - name - name - () - - - negativeSign - negativeSign - () - - - percent - percent - () - - - setDefault - setDefault - ( const QLocale & locale ) - - - system - system - () - - - timeFormat - timeFormat - ( FormatType format = LongFormat ) - - - toDouble - toDouble - ( const QString & s, bool * ok = 0 ) - - - toFloat - toFloat - ( const QString & s, bool * ok = 0 ) - - - toInt - toInt - ( const QString & s, bool * ok = 0, int base = 0 ) - - - toLongLong - toLongLong - ( const QString & s, bool * ok = 0, int base = 0 ) - - - toShort - toShort - ( const QString & s, bool * ok = 0, int base = 0 ) - - - toString - toString - ( qlonglong i ) - - - toString - toString-2 - ( const QDate & date, const QString & format ) - - - toString - toString-3 - ( const QDate & date, FormatType format = LongFormat ) - - - toString - toString-4 - ( const QTime & time, const QString & format ) - - - toString - toString-5 - ( const QTime & time, FormatType format = LongFormat ) - - - toString - toString-6 - ( qulonglong i ) - - - toString - toString-7 - ( double i, char f = 'g', int prec = 6 ) - - - toString - toString-8 - ( short i ) - - - toString - toString-9 - ( ushort i ) - - - toString - toString-10 - ( int i ) - - - toString - toString-11 - ( uint i ) - - - toString - toString-12 - ( float i, char f = 'g', int prec = 6 ) - - - toUInt - toUInt - ( const QString & s, bool * ok = 0, int base = 0 ) - - - toULongLong - toULongLong - ( const QString & s, bool * ok = 0, int base = 0 ) - - - toUShort - toUShort - ( const QString & s, bool * ok = 0, int base = 0 ) - - - zeroDigit - zeroDigit - () - - - operator!= - operator-not-eq - ( const QLocale & other ) - - - operator= - operator-eq - ( const QLocale & other ) - - - operator== - operator-eq-eq - ( const QLocale & other ) - - - - QMacMime - qmacmime.html - - QMacMime - QMacMime - ( char t ) - - - all - all - ( QMacMimeType t ) - - - canConvert - canConvert - ( const QString & mime, int flav ) - - - convertFromMime - convertFromMime - ( const QString & mime, QVariant data, int flav ) - - - convertToMime - convertToMime - ( const QString & mime, QList<QByteArray> data, int flav ) - - - convertor - convertor - ( QMacMimeType t, const QString & mime, int flav ) - - - convertorName - convertorName - () - - - countFlavors - countFlavors - () - - - flavor - flavor - ( int index ) - - - flavorFor - flavorFor - ( const QString & mime ) - - - flavorToMime - flavorToMime - ( QMacMimeType t, int flav ) - - - mimeFor - mimeFor - ( int flav ) - - - - QMacStyle - qmacstyle.html - - FocusRectPolicy - FocusRectPolicy-enum - - - - WidgetSizePolicy - WidgetSizePolicy-enum - - - - QMacStyle - QMacStyle - () - - - focusRectPolicy - focusRectPolicy - ( const QWidget * w ) - - - setFocusRectPolicy - setFocusRectPolicy - ( QWidget * w, FocusRectPolicy policy ) - - - setWidgetSizePolicy - setWidgetSizePolicy - ( const QWidget * w, WidgetSizePolicy policy ) - - - widgetSizePolicy - widgetSizePolicy - ( const QWidget * w ) - - - - QMainWindow - qmainwindow.html - - ToolButtonStyle - toolButtonStyle-prop - - - - QMainWindow - QMainWindow - ( QWidget * parent = 0, Qt::WFlags flags = 0 ) - - - addDockWidget - addDockWidget - ( Qt::DockWidgetArea area, QDockWidget * dockwidget ) - - - addDockWidget - addDockWidget-2 - ( Qt::DockWidgetArea area, QDockWidget * dockwidget, Qt::Orientation orientation ) - - - addToolBar - addToolBar - ( Qt::ToolBarArea area, QToolBar * toolbar ) - - - addToolBar - addToolBar-2 - ( QToolBar * toolbar ) - - - addToolBar - addToolBar-3 - ( const QString & title ) - - - addToolBarBreak - addToolBarBreak - ( Qt::ToolBarArea area = Qt::TopToolBarArea ) - - - centralWidget - centralWidget - () - - - DockWidgetArea - corner - QMainWindow::corner( Qt::Corner corner ) - - - createPopupMenu - createPopupMenu - () - - - DockWidgetArea - dockWidgetArea - QMainWindow::dockWidgetArea( QDockWidget * dockwidget ) - - - iconSizeChanged - iconSizeChanged - ( const QSize & iconSize ) - - - insertToolBar - insertToolBar - ( QToolBar * before, QToolBar * toolbar ) - - - insertToolBarBreak - insertToolBarBreak - ( QToolBar * before ) - - - menuBar - menuBar - () - - - removeDockWidget - removeDockWidget - ( QDockWidget * dockwidget ) - - - removeToolBar - removeToolBar - ( QToolBar * toolbar ) - - - restoreState - restoreState - ( const QByteArray & state, int version = 0 ) - - - saveState - saveState - ( int version = 0 ) - - - setCentralWidget - setCentralWidget - ( QWidget * widget ) - - - setCorner - setCorner - ( Qt::Corner corner, Qt::DockWidgetArea area ) - - - setMenuBar - setMenuBar - ( QMenuBar * menuBar ) - - - setStatusBar - setStatusBar - ( QStatusBar * statusbar ) - - - splitDockWidget - splitDockWidget - ( QDockWidget * first, QDockWidget * second, Qt::Orientation orientation ) - - - statusBar - statusBar - () - - - ToolBarArea - toolBarArea - QMainWindow::toolBarArea( QToolBar * toolbar ) - - - toolButtonStyleChanged - toolButtonStyleChanged - ( Qt::ToolButtonStyle toolButtonStyle ) - - - QMainWindow - QMainWindow-2 - ( QWidget * parent, const char * name, Qt::WFlags flags = 0 ) - - - - QMap::const_iterator - qmap-const-iterator.html - - const_iterator - const_iterator - () - - - const_iterator - const_iterator-3 - ( const iterator & other ) - - - key - key - () - - - value - value - () - - - operator!= - operator-not-eq - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator== - operator-eq-eq - ( const const_iterator & other ) - - - data - data - () - - - - QMap - qmap.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - QMap - QMap - () - - - QMap - QMap-2 - ( const QMap<Key, T> & other ) - - - QMap - QMap-3 - ( const std::map<Key, T> & other ) - - - begin - begin - () - - - begin - begin-2 - () - - - clear - clear - () - - - constBegin - constBegin - () - - - constEnd - constEnd - () - - - constFind - constFind - ( const Key & key ) - - - contains - contains - ( const Key & key ) - - - count - count - ( const Key & key ) - - - count - count-2 - () - - - empty - empty - () - - - end - end - () - - - end - end-2 - () - - - erase - erase - ( iterator pos ) - - - find - find - ( const Key & key ) - - - find - find-2 - ( const Key & key ) - - - insert - insert - ( const Key & key, const T & value ) - - - insertMulti - insertMulti - ( const Key & key, const T & value ) - - - isEmpty - isEmpty - () - - - key - key - ( const T & value ) - - - keys - keys - () - - - keys - keys-2 - ( const T & value ) - - - lowerBound - lowerBound - ( const Key & key ) - - - lowerBound - lowerBound-2 - ( const Key & key ) - - - remove - remove - ( const Key & key ) - - - size - size - () - - - take - take - ( const Key & key ) - - - map - toStdMap - <Key, T> QMap::toStdMap() - - - unite - unite - ( const QMap<Key, T> & other ) - - - upperBound - upperBound - ( const Key & key ) - - - upperBound - upperBound-2 - ( const Key & key ) - - - value - value - ( const Key & key ) - - - value - value-2 - ( const Key & key, const T & defaultValue ) - - - values - values - () - - - values - values-2 - ( const Key & key ) - - - operator!= - operator-not-eq - ( const QMap<Key, T> & other ) - - - operator= - operator-eq - ( const QMap<Key, T> & other ) - - - operator== - operator-eq-eq - ( const QMap<Key, T> & other ) - - - operator[] - operator-5b-5d - ( const Key & key ) - - - operator[] - operator-5b-5d-2 - ( const Key & key ) - - - - QMap::iterator - qmap-iterator.html - - iterator - iterator - () - - - key - key - () - - - value - value - () - - - operator!= - operator-not-eq - ( const iterator & other ) - - - operator!= - operator-not-eq-2 - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator== - operator-eq-eq - ( const iterator & other ) - - - operator== - operator-eq-eq-2 - ( const const_iterator & other ) - - - - QMapIterator - qmapiterator.html - - QMapIterator - QMapIterator - ( const QMap<Key, T> & map ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - key - key - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - operator= - operator-eq - ( const QMap<Key, T> & map ) - - - data - data - () - - - erase - erase-2 - ( const Key & key ) - - - insert - insert-2 - ( const Key & key, const T & value, bool overwrite ) - - - remove - remove-2 - ( iterator it ) - - - replace - replace - ( const Key & key, const T & value ) - - - - QMatrix - qmatrix.html - - QMatrix - QMatrix - () - - - QMatrix - QMatrix-2 - ( qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy ) - - - QMatrix - QMatrix-3 - ( const QMatrix & matrix ) - - - m11 - m11 - () - - - m12 - m12 - () - - - m21 - m21 - () - - - m22 - m22 - () - - - det - det - () - - - dx - dx - () - - - dy - dy - () - - - inverted - inverted - ( bool * invertible = 0 ) - - - isIdentity - isIdentity - () - - - isInvertible - isInvertible - () - - - map - map - ( qreal x, qreal y, qreal * tx, qreal * ty ) - - - map - map-3 - ( int x, int y, int * tx, int * ty ) - - - map - map-4 - ( const QPointF & point ) - - - map - map-5 - ( const QPoint & point ) - - - map - map-6 - ( const QLineF & line ) - - - map - map-7 - ( const QLine & line ) - - - map - map-8 - ( const QPolygonF & polygon ) - - - map - map-9 - ( const QPolygon & polygon ) - - - map - map-10 - ( const QRegion & region ) - - - map - map-11 - ( const QPainterPath & path ) - - - mapRect - mapRect - ( const QRectF & rectangle ) - - - mapRect - mapRect-2 - ( const QRect & rectangle ) - - - mapToPolygon - mapToPolygon - ( const QRect & rectangle ) - - - reset - reset - () - - - rotate - rotate - ( qreal degrees ) - - - scale - scale - ( qreal sx, qreal sy ) - - - setMatrix - setMatrix - ( qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy ) - - - shear - shear - ( qreal sh, qreal sv ) - - - translate - translate - ( qreal dx, qreal dy ) - - - operator!= - operator-not-eq - ( const QMatrix & matrix ) - - - operator* - operator-2a - ( const QMatrix & matrix ) - - - operator*= - operator-2a-eq - ( const QMatrix & matrix ) - - - operator= - operator-eq - ( const QMatrix & matrix ) - - - operator== - operator-eq-eq - ( const QMatrix & matrix ) - - - invert - invert - ( bool * invertible = 0 ) - - - map - map-2 - ( const QRect & rect ) - - - mapToRegion - mapToRegion - ( const QRect & rectangle ) - - - - QMenuBar - qmenubar.html - - QMenuBar - QMenuBar - ( QWidget * parent = 0 ) - - - activeAction - activeAction - () - - - addAction - addAction - ( const QString & text ) - - - addAction - addAction-2 - ( const QString & text, const QObject * receiver, const char * member ) - - - addMenu - addMenu - ( QMenu * menu ) - - - addMenu - addMenu-2 - ( const QString & title ) - - - addMenu - addMenu-3 - ( const QIcon & icon, const QString & title ) - - - addSeparator - addSeparator - () - - - clear - clear - () - - - hovered - hovered - ( QAction * action ) - - - insertMenu - insertMenu - ( QAction * before, QMenu * menu ) - - - setActiveAction - setActiveAction - ( QAction * act ) - - - triggered - triggered - ( QAction * action ) - - - Separator - Separator-enum - - - - QMenuBar - QMenuBar-2 - ( QWidget * parent, const char * name ) - - - accel - accel - ( int id ) - - - activateItemAt - activateItemAt - ( int index ) - - - activated - activated - ( int itemId ) - - - autoGeometry - autoGeometry - () - - - changeItem - changeItem - ( int id, const QString & text ) - - - changeItem - changeItem-2 - ( int id, const QPixmap & pixmap ) - - - changeItem - changeItem-3 - ( int id, const QIcon & icon, const QString & text ) - - - connectItem - connectItem - ( int id, const QObject * receiver, const char * member ) - - - count - count - () - - - disconnectItem - disconnectItem - ( int id, const QObject * receiver, const char * member ) - - - findItem - findItem - ( int id ) - - - frameWidth - frameWidth - () - - - highlighted - highlighted - ( int itemId ) - - - iconSet - iconSet - ( int id ) - - - idAt - idAt - ( int index ) - - - indexOf - indexOf - ( int id ) - - - insertItem - insertItem - ( const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0, int id = -1, int index = -1 ) - - - insertItem - insertItem-2 - ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0, int id = -1, int index = -1 ) - - - insertItem - insertItem-3 - ( const QPixmap & pixmap, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0, int id = -1, int index = -1 ) - - - insertItem - insertItem-4 - ( const QString & text, int id = -1, int index = -1 ) - - - insertItem - insertItem-5 - ( const QIcon & icon, const QString & text, int id = -1, int index = -1 ) - - - insertItem - insertItem-6 - ( const QString & text, QMenu * popup, int id = -1, int index = -1 ) - - - insertItem - insertItem-7 - ( const QIcon & icon, const QString & text, QMenu * popup, int id = -1, int index = -1 ) - - - insertItem - insertItem-8 - ( const QPixmap & pixmap, int id = -1, int index = -1 ) - - - insertItem - insertItem-9 - ( const QPixmap & pixmap, QMenu * popup, int id = -1, int index = -1 ) - - - insertSeparator - insertSeparator - ( int index = -1 ) - - - isItemActive - isItemActive - ( int id ) - - - isItemChecked - isItemChecked - ( int id ) - - - isItemEnabled - isItemEnabled - ( int id ) - - - isItemVisible - isItemVisible - ( int id ) - - - itemAtPos - itemAtPos - ( const QPoint & p ) - - - itemParameter - itemParameter - ( int id ) - - - itemRect - itemRect - ( int index ) - - - pixmap - pixmap - ( int id ) - - - removeItem - removeItem - ( int id ) - - - removeItemAt - removeItemAt - ( int index ) - - - separator - separator - () - - - setAccel - setAccel - ( const QKeySequence & key, int id ) - - - setAutoGeometry - setAutoGeometry - ( bool b ) - - - setItemChecked - setItemChecked - ( int id, bool check ) - - - setItemEnabled - setItemEnabled - ( int id, bool enable ) - - - setItemParameter - setItemParameter - ( int id, int param ) - - - setItemVisible - setItemVisible - ( int id, bool visible ) - - - setSeparator - setSeparator - ( Separator sep ) - - - setWhatsThis - setWhatsThis - ( int id, const QString & w ) - - - text - text - ( int id ) - - - whatsThis - whatsThis - ( int id ) - - - - QMenu - qmenu.html - - QMenu - QMenu - ( QWidget * parent = 0 ) - - - QMenu - QMenu-2 - ( const QString & title, QWidget * parent = 0 ) - - - aboutToShow - aboutToShow - () - - - actionAt - actionAt - ( const QPoint & pt ) - - - actionGeometry - actionGeometry - ( QAction * act ) - - - activeAction - activeAction - () - - - addAction - addAction - ( const QString & text ) - - - addAction - addAction-2 - ( const QIcon & icon, const QString & text ) - - - addAction - addAction-3 - ( const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0 ) - - - addAction - addAction-4 - ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0 ) - - - addMenu - addMenu - ( QMenu * menu ) - - - addMenu - addMenu-2 - ( const QString & title ) - - - addMenu - addMenu-3 - ( const QIcon & icon, const QString & title ) - - - addSeparator - addSeparator - () - - - clear - clear - () - - - columnCount - columnCount - () - - - defaultAction - defaultAction - () - - - exec - exec - () - - - exec - exec-2 - ( const QPoint & p, QAction * action = 0 ) - - - exec - exec-3 - ( QList<QAction *> actions, const QPoint & pos, QAction * at = 0 ) - - - hideTearOffMenu - hideTearOffMenu - () - - - hovered - hovered - ( QAction * action ) - - - insertMenu - insertMenu - ( QAction * before, QMenu * menu ) - - - insertSeparator - insertSeparator - ( QAction * before ) - - - isTearOffMenuVisible - isTearOffMenuVisible - () - - - menuAction - menuAction - () - - - popup - popup - ( const QPoint & p, QAction * atAction = 0 ) - - - setActiveAction - setActiveAction - ( QAction * act ) - - - setDefaultAction - setDefaultAction - ( QAction * act ) - - - triggered - triggered - ( QAction * action ) - - - - QMenuItem - qmenuitem.html - - QMenuItem - QMenuItem - () - - - id - id - () - - - signalValue - signalValue - () - - - aboutToHide - aboutToHide - () - - - accel - accel - ( int id ) - - - activateItemAt - activateItemAt - ( int index ) - - - activated - activated - ( int itemId ) - - - changeItem - changeItem - ( int id, const QString & text ) - - - changeItem - changeItem-2 - ( int id, const QPixmap & pixmap ) - - - changeItem - changeItem-3 - ( int id, const QIcon & icon, const QString & text ) - - - columns - columns - () - - - connectItem - connectItem - ( int id, const QObject * receiver, const char * member ) - - - count - count - () - - - disconnectItem - disconnectItem - ( int id, const QObject * receiver, const char * member ) - - - findItem - findItem - ( int id ) - - - findPopup - findPopup - ( QMenu * popup, int * index ) - - - frameWidth - frameWidth - () - - - highlighted - highlighted - ( int itemId ) - - - iconSet - iconSet - ( int id ) - - - idAt - idAt - ( int index ) - - - indexOf - indexOf - ( int id ) - - - insertItem - insertItem - ( const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0, int id = -1, int index = -1 ) - - - insertItem - insertItem-2 - ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0, int id = -1, int index = -1 ) - - - insertItem - insertItem-3 - ( const QPixmap & pixmap, const QObject * receiver, const char * member, const QKeySequence & shortcut = 0, int id = -1, int index = -1 ) - - - insertItem - insertItem-4 - ( const QString & text, int id = -1, int index = -1 ) - - - insertItem - insertItem-5 - ( const QIcon & icon, const QString & text, int id = -1, int index = -1 ) - - - insertItem - insertItem-6 - ( const QString & text, QMenu * popup, int id = -1, int index = -1 ) - - - insertItem - insertItem-7 - ( const QIcon & icon, const QString & text, QMenu * popup, int id = -1, int index = -1 ) - - - insertItem - insertItem-8 - ( const QPixmap & pixmap, int id = -1, int index = -1 ) - - - insertItem - insertItem-9 - ( const QPixmap & pixmap, QMenu * popup, int id = -1, int index = -1 ) - - - insertItem - insertItem-10 - ( QMenuItem * item, int id = -1, int index = -1 ) - - - insertSeparator - insertSeparator-2 - ( int index = -1 ) - - - insertTearOffHandle - insertTearOffHandle - ( int a = 0, int b = 0 ) - - - isCheckable - isCheckable - () - - - isItemActive - isItemActive - ( int id ) - - - isItemChecked - isItemChecked - ( int id ) - - - isItemEnabled - isItemEnabled - ( int id ) - - - isItemVisible - isItemVisible - ( int id ) - - - itemAtPos - itemAtPos - ( const QPoint & p, bool ignoreSeparator = true ) - - - itemFont - itemFont - ( int id ) - - - itemGeometry - itemGeometry - ( int index ) - - - itemHeight - itemHeight - ( int index ) - - - itemHeight - itemHeight-2 - ( QMenuItem * mi ) - - - itemParameter - itemParameter - ( int id ) - - - pixmap - pixmap - ( int id ) - - - popup - popup-2 - ( const QPoint & pos, int indexAtPoint ) - - - removeItem - removeItem - ( int id ) - - - removeItemAt - removeItemAt - ( int index ) - - - setAccel - setAccel - ( const QKeySequence & key, int id ) - - - setActiveItem - setActiveItem - ( int id ) - - - setCheckable - setCheckable - ( bool checkable ) - - - setId - setId - ( int index, int id ) - - - setItemChecked - setItemChecked - ( int id, bool check ) - - - setItemEnabled - setItemEnabled - ( int id, bool enable ) - - - setItemFont - setItemFont - ( int id, const QFont & font ) - - - setItemParameter - setItemParameter - ( int id, int param ) - - - setItemVisible - setItemVisible - ( int id, bool visible ) - - - setWhatsThis - setWhatsThis - ( int id, const QString & w ) - - - text - text - ( int id ) - - - whatsThis - whatsThis - ( int id ) - - - - QMessageBox - qmessagebox.html - - Button - Button-enum - - - - Icon - Icon-enum - - - - TextFormat - textFormat-prop - - - - QMessageBox - QMessageBox - ( QWidget * parent = 0 ) - - - QMessageBox - QMessageBox-2 - ( const QString & caption, const QString & text, Icon icon, int button0, int button1, int button2, QWidget * parent = 0, Qt::WFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint ) - - - about - about - ( QWidget * parent, const QString & caption, const QString & text ) - - - aboutQt - aboutQt - ( QWidget * parent, const QString & caption = QString() - - - buttonText - buttonText - ( int button ) - - - critical - critical - ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1, int button2 = 0 ) - - - critical - critical-2 - ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString() - - - information - information - ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1 = 0, int button2 = 0 ) - - - information - information-2 - ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString() - - - question - question - ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1 = 0, int button2 = 0 ) - - - question - question-2 - ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString() - - - setButtonText - setButtonText - ( int button, const QString & text ) - - - standardIcon - standardIcon-2 - ( Icon icon ) - - - warning - warning - ( QWidget * parent, const QString & caption, const QString & text, int button0, int button1, int button2 = 0 ) - - - warning - warning-2 - ( QWidget * parent, const QString & caption, const QString & text, const QString & button0Text = QString() - - - QMessageBox - QMessageBox-3 - ( const QString & caption, const QString & text, Icon icon, int button0, int button1, int button2, QWidget * parent, const char * name, bool modal, Qt::WFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint ) - - - QMessageBox - QMessageBox-4 - ( QWidget * parent, const char * name ) - - - message - message - ( const QString & caption, const QString & text, const QString & buttonText = QString() - - - query - query - ( const QString & caption, const QString & text, const QString & yesButtonText = QString() - - - standardIcon - standardIcon - ( Icon icon, Qt::GUIStyle style ) - - - - QMetaClassInfo - qmetaclassinfo.html - - name - name - () - - - value - value - () - - - - QMetaEnum - qmetaenum.html - - isFlag - isFlag - () - - - isValid - isValid - () - - - key - key - ( int index ) - - - keyCount - keyCount - () - - - keyToValue - keyToValue - ( const char * key ) - - - keysToValue - keysToValue - ( const char * keys ) - - - name - name - () - - - scope - scope - () - - - value - value - ( int index ) - - - valueToKey - valueToKey - ( int value ) - - - valueToKeys - valueToKeys - ( int value ) - - - - QMetaMethod - qmetamethod.html - - MethodType - MethodType-enum - - - - access - access - () - - - methodType - methodType - () - - - parameterNames - parameterNames - () - - - parameterTypes - parameterTypes - () - - - signature - signature - () - - - tag - tag - () - - - typeName - typeName - () - - - - QMetaObject - qmetaobject.html - - checkConnectArgs - checkConnectArgs - ( const char * signal, const char * method ) - - - classInfo - classInfo - ( int index ) - - - classInfoCount - classInfoCount - () - - - classInfoOffset - classInfoOffset - () - - - className - className - () - - - connectSlotsByName - connectSlotsByName - ( QObject * o ) - - - enumerator - enumerator - ( int index ) - - - enumeratorCount - enumeratorCount - () - - - enumeratorOffset - enumeratorOffset - () - - - indexOfClassInfo - indexOfClassInfo - ( const char * name ) - - - indexOfEnumerator - indexOfEnumerator - ( const char * name ) - - - indexOfMethod - indexOfMethod - ( const char * method ) - - - indexOfProperty - indexOfProperty - ( const char * name ) - - - indexOfSignal - indexOfSignal - ( const char * signal ) - - - indexOfSlot - indexOfSlot - ( const char * slot ) - - - invokeMethod - invokeMethod - ( QObject * obj, const char * member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0 = QGenericArgument( 0 ) - - - invokeMethod - invokeMethod-2 - ( QObject * obj, const char * member, QGenericReturnArgument ret, QGenericArgument val0 = QGenericArgument( 0 ) - - - invokeMethod - invokeMethod-3 - ( QObject * obj, const char * member, Qt::ConnectionType type, QGenericArgument val0 = QGenericArgument( 0 ) - - - invokeMethod - invokeMethod-4 - ( QObject * obj, const char * member, QGenericArgument val0 = QGenericArgument( 0 ) - - - method - method - ( int index ) - - - methodCount - methodCount - () - - - methodOffset - methodOffset - () - - - normalizedSignature - normalizedSignature - ( const char * method ) - - - property - property - ( int index ) - - - propertyCount - propertyCount - () - - - propertyOffset - propertyOffset - () - - - superClass - superClass - () - - - - QMetaProperty - qmetaproperty.html - - enumerator - enumerator - () - - - isDesignable - isDesignable - ( const QObject * object = 0 ) - - - isEditable - isEditable - ( const QObject * object = 0 ) - - - isEnumType - isEnumType - () - - - isFlagType - isFlagType - () - - - isReadable - isReadable - () - - - isResettable - isResettable - () - - - isScriptable - isScriptable - ( const QObject * object = 0 ) - - - isStored - isStored - ( const QObject * object = 0 ) - - - isUser - isUser - ( const QObject * object = 0 ) - - - isValid - isValid - () - - - isWritable - isWritable - () - - - name - name - () - - - read - read - ( const QObject * object ) - - - reset - reset - ( QObject * object ) - - - Type - type - QMetaProperty::type() - - - typeName - typeName - () - - - write - write - ( QObject * object, const QVariant & value ) - - - - QMetaType - qmetatype.html - - Type - Type-enum - - - - construct - construct - ( int type, const void * copy ) - - - destroy - destroy - ( int type, void * data ) - - - isRegistered - isRegistered - ( int type ) - - - load - load - ( QDataStream & stream, int type, void * data ) - - - save - save - ( QDataStream & stream, int type, const void * data ) - - - type - type - ( const char * typeName ) - - - typeName - typeName - ( int type ) - - - - QMimeData - qmimedata.html - - QMimeData - QMimeData - () - - - clear - clear - () - - - colorData - colorData - () - - - data - data - ( const QString & mimetype ) - - - formats - formats - () - - - hasColor - hasColor - () - - - hasFormat - hasFormat - ( const QString & mimetype ) - - - hasHtml - hasHtml - () - - - hasImage - hasImage - () - - - hasText - hasText - () - - - hasUrls - hasUrls - () - - - html - html - () - - - imageData - imageData - () - - - retrieveData - retrieveData - ( const QString & mimetype, QVariant::Type type ) - - - setColorData - setColorData - ( const QVariant & color ) - - - setData - setData - ( const QString & mimetype, const QByteArray & data ) - - - setHtml - setHtml - ( const QString & html ) - - - setImageData - setImageData - ( const QVariant & image ) - - - setText - setText - ( const QString & text ) - - - setUrls - setUrls - ( const QList<QUrl> & urls ) - - - text - text - () - - - urls - urls - () - - - - QMimeSource - qmimesource.html - - encodedData - encodedData - ( const char * format ) - - - format - format - ( int i = 0 ) - - - provides - provides - ( const char * mimeType ) - - - - QModelIndex - qmodelindex.html - - QModelIndex - QModelIndex - () - - - QModelIndex - QModelIndex-2 - ( const QModelIndex & other ) - - - child - child - ( int row, int column ) - - - column - column - () - - - data - data - ( int role = Qt::DisplayRole ) - - - internalId - internalId - () - - - internalPointer - internalPointer - () - - - isValid - isValid - () - - - model - model - () - - - parent - parent - () - - - row - row - () - - - sibling - sibling - ( int row, int column ) - - - operator!= - operator-not-eq - ( const QModelIndex & other ) - - - operator< - operator-lt - ( const QModelIndex & other ) - - - operator== - operator-eq-eq - ( const QModelIndex & other ) - - - - QMotifStyle - qmotifstyle.html - - QMotifStyle - QMotifStyle - ( bool useHighlightCols = false ) - - - eventFilter - eventFilter - ( QObject * o, QEvent * e ) - - - setUseHighlightColors - setUseHighlightColors - ( bool arg ) - - - useHighlightColors - useHighlightColors - () - - - - QMouseDriverFactory - qmousedriverfactory.html - - create - create - ( const QString & key, const QString & device ) - - - keys - keys - () - - - - QMouseDriverPlugin - qmousedriverplugin.html - - QMouseDriverPlugin - QMouseDriverPlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key, const QString & device ) - - - keys - keys - () - - - - QMouseEvent - qmouseevent.html - - QMouseEvent - QMouseEvent - ( Type type, const QPoint & position, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) - - - QMouseEvent - QMouseEvent-2 - ( Type type, const QPoint & pos, const QPoint & globalPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers ) - - - MouseButton - button - QMouseEvent::button() - - - MouseButtons - buttons - QMouseEvent::buttons() - - - globalPos - globalPos - () - - - globalX - globalX - () - - - globalY - globalY - () - - - pos - pos - () - - - x - x - () - - - y - y - () - - - QMouseEvent - QMouseEvent-3 - ( Type type, const QPoint & pos, Qt::ButtonState button, int state ) - - - QMouseEvent - QMouseEvent-4 - ( Type type, const QPoint & pos, const QPoint & globalPos, Qt::ButtonState button, int state ) - - - ButtonState - state - QMouseEvent::state() - - - ButtonState - stateAfter - QMouseEvent::stateAfter() - - - - QMoveEvent - qmoveevent.html - - QMoveEvent - QMoveEvent - ( const QPoint & pos, const QPoint & oldPos ) - - - oldPos - oldPos - () - - - pos - pos - () - - - - QMovie - qmovie.html - - CacheMode - CacheMode-enum - - - - MovieState - MovieState-enum - - - - QMovie - QMovie - ( QObject * parent = 0 ) - - - QMovie - QMovie-2 - ( QIODevice * device, const QByteArray & format = QByteArray() - - - QMovie - QMovie-3 - ( const QString & fileName, const QByteArray & format = QByteArray() - - - backgroundColor - backgroundColor - () - - - currentFrameNumber - currentFrameNumber - () - - - currentImage - currentImage - () - - - currentPixmap - currentPixmap - () - - - device - device - () - - - error - error - ( QImageReader::ImageReaderError error ) - - - fileName - fileName - () - - - finished - finished - () - - - format - format - () - - - frameChanged - frameChanged - ( int frameNumber ) - - - frameCount - frameCount - () - - - frameRect - frameRect - () - - - isValid - isValid - () - - - jumpToFrame - jumpToFrame - ( int frameNumber ) - - - jumpToNextFrame - jumpToNextFrame - () - - - loopCount - loopCount - () - - - nextFrameDelay - nextFrameDelay - () - - - resized - resized - ( const QSize & size ) - - - scaledSize - scaledSize - () - - - setBackgroundColor - setBackgroundColor - ( const QColor & color ) - - - setDevice - setDevice - ( QIODevice * device ) - - - setFileName - setFileName - ( const QString & fileName ) - - - setFormat - setFormat - ( const QByteArray & format ) - - - setPaused - setPaused - ( bool paused ) - - - setScaledSize - setScaledSize - ( const QSize & size ) - - - start - start - () - - - started - started - () - - - state - state - () - - - stateChanged - stateChanged - ( QMovie::MovieState state ) - - - stop - stop - () - - - supportedFormats - supportedFormats - () - - - updated - updated - ( const QRect & rect ) - - - finished - finished-2 - () - - - frameImage - frameImage - () - - - frameNumber - frameNumber - () - - - framePixmap - framePixmap - () - - - isNull - isNull - () - - - pause - pause - () - - - paused - paused - () - - - restart - restart - () - - - running - running - () - - - step - step - () - - - unpause - unpause - () - - - - QMultiHash - qmultihash.html - - QMultiHash - QMultiHash - () - - - QMultiHash - QMultiHash-2 - ( const QHash<Key, T> & other ) - - - insert - insert - ( const Key & key, const T & value ) - - - replace - replace - ( const Key & key, const T & value ) - - - operator+ - operator-2b - ( const QMultiHash & other ) - - - operator+= - operator-2b-eq - ( const QMultiHash & other ) - - - - QMultiMap - qmultimap.html - - QMultiMap - QMultiMap - () - - - QMultiMap - QMultiMap-2 - ( const QMap<Key, T> & other ) - - - insert - insert - ( const Key & key, const T & value ) - - - replace - replace - ( const Key & key, const T & value ) - - - operator+ - operator-2b - ( const QMultiMap & other ) - - - operator+= - operator-2b-eq - ( const QMultiMap & other ) - - - - QMutableHashIterator - qmutablehashiterator.html - - QMutableHashIterator - QMutableHashIterator - ( QHash<Key, T> & hash ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - key - key - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - remove - remove - () - - - setValue - setValue - ( const T & value ) - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - value - value-2 - () - - - operator= - operator-eq - ( QHash<Key, T> & hash ) - - - - QMutableLinkedListIterator - qmutablelinkedlistiterator.html - - QMutableLinkedListIterator - QMutableLinkedListIterator - ( QLinkedList<T> & list ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - insert - insert - ( const T & value ) - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - remove - remove - () - - - setValue - setValue - ( const T & value ) - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - value - value-2 - () - - - operator= - operator-eq - ( QLinkedList<T> & list ) - - - - QMutableListIterator - qmutablelistiterator.html - - QMutableListIterator - QMutableListIterator - ( QList<T> & list ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - insert - insert - ( const T & value ) - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - remove - remove - () - - - setValue - setValue - ( const T & value ) - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - value - value-2 - () - - - operator= - operator-eq - ( QList<T> & list ) - - - - QMutableMapIterator - qmutablemapiterator.html - - QMutableMapIterator - QMutableMapIterator - ( QMap<Key, T> & map ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - key - key - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - remove - remove - () - - - setValue - setValue - ( const T & value ) - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - value - value-2 - () - - - operator= - operator-eq - ( QMap<Key, T> & map ) - - - - QMutableVectorIterator - qmutablevectoriterator.html - - QMutableVectorIterator - QMutableVectorIterator - ( QVector<T> & vector ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - insert - insert - ( const T & value ) - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - remove - remove - () - - - setValue - setValue - ( const T & value ) - - - toBack - toBack - () - - - toFront - toFront - () - - - value - value - () - - - value - value-2 - () - - - operator= - operator-eq - ( QVector<T> & vector ) - - - - QMutex - qmutex.html - - RecursionMode - RecursionMode-enum - - - - QMutex - QMutex - ( RecursionMode mode = NonRecursive ) - - - lock - lock - () - - - tryLock - tryLock - () - - - unlock - unlock - () - - - - QMutexLocker - qmutexlocker.html - - QMutexLocker - QMutexLocker - ( QMutex * mutex ) - - - mutex - mutex - () - - - relock - relock - () - - - unlock - unlock - () - - - QMutex - QMutex-2 - ( bool recursive ) - - - locked - locked - () - - - - QNetworkProxy - qnetworkproxy.html - - ProxyType - ProxyType-enum - - - - QNetworkProxy - QNetworkProxy - () - - - QNetworkProxy - QNetworkProxy-2 - ( ProxyType type, const QString & hostName = QString() - - - QNetworkProxy - QNetworkProxy-3 - ( const QNetworkProxy & other ) - - - applicationProxy - applicationProxy - () - - - hostName - hostName - () - - - password - password - () - - - port - port - () - - - setApplicationProxy - setApplicationProxy - ( const QNetworkProxy & networkProxy ) - - - setHostName - setHostName - ( const QString & hostName ) - - - setPassword - setPassword - ( const QString & password ) - - - setPort - setPort - ( quint16 port ) - - - setType - setType - ( QNetworkProxy::ProxyType type ) - - - setUser - setUser - ( const QString & user ) - - - ProxyType - type - QNetworkProxy::type() - - - user - user - () - - - operator= - operator-eq - ( const QNetworkProxy & other ) - - - - QObjectCleanupHandler - qobjectcleanuphandler.html - - QObjectCleanupHandler - QObjectCleanupHandler - () - - - add - add - ( QObject * object ) - - - clear - clear - () - - - isEmpty - isEmpty - () - - - remove - remove - ( QObject * object ) - - - - QObject - qobject.html - - QObject - QObject - ( QObject * parent = 0 ) - - - blockSignals - blockSignals - ( bool block ) - - - childEvent - childEvent - ( QChildEvent * event ) - - - children - children - () - - - connect - connect - ( const QObject * sender, const char * signal, const QObject * receiver, const char * method, Qt::ConnectionType type = Qt::AutoCompatConnection ) - - - connect - connect-2 - ( const QObject * sender, const char * signal, const char * method, Qt::ConnectionType type = Qt::AutoCompatConnection ) - - - connectNotify - connectNotify - ( const char * signal ) - - - customEvent - customEvent - ( QEvent * event ) - - - deleteLater - deleteLater - () - - - destroyed - destroyed - ( QObject * obj = 0 ) - - - disconnect - disconnect - ( const QObject * sender, const char * signal, const QObject * receiver, const char * method ) - - - disconnect - disconnect-2 - ( const char * signal = 0, const QObject * receiver = 0, const char * method = 0 ) - - - disconnect - disconnect-3 - ( const QObject * receiver, const char * method = 0 ) - - - disconnectNotify - disconnectNotify - ( const char * signal ) - - - dumpObjectInfo - dumpObjectInfo - () - - - dumpObjectTree - dumpObjectTree - () - - - event - event - ( QEvent * e ) - - - eventFilter - eventFilter - ( QObject * watched, QEvent * event ) - - - findChild - findChild - ( const QString & name = QString() - - - findChildren - findChildren - ( const QString & name = QString() - - - findChildren - findChildren-2 - ( const QRegExp & regExp ) - - - inherits - inherits - ( const char * className ) - - - installEventFilter - installEventFilter - ( QObject * filterObj ) - - - isWidgetType - isWidgetType - () - - - killTimer - killTimer - ( int id ) - - - metaObject - metaObject - () - - - moveToThread - moveToThread - ( QThread * targetThread ) - - - parent - parent - () - - - property - property - ( const char * name ) - - - receivers - receivers - ( const char * signal ) - - - removeEventFilter - removeEventFilter - ( QObject * obj ) - - - sender - sender - () - - - setParent - setParent - ( QObject * parent ) - - - setProperty - setProperty - ( const char * name, const QVariant & value ) - - - signalsBlocked - signalsBlocked - () - - - startTimer - startTimer - ( int interval ) - - - thread - thread - () - - - timerEvent - timerEvent - ( QTimerEvent * event ) - - - tr - tr - ( const char * sourceText, const char * comment ) - - - trUtf8 - trUtf8 - ( const char * sourceText, const char * comment ) - - - QObject - QObject-3 - ( QObject * parent, const char * name ) - - - checkConnectArgs - checkConnectArgs - ( const char * signal, const QObject * object, const char * method ) - - - child - child - ( const char * objName, const char * inheritsClass = 0, bool recursiveSearch = true ) - - - className - className - () - - - insertChild - insertChild - ( QObject * object ) - - - isA - isA - ( const char * className ) - - - name - name - () - - - name - name-2 - ( const char * defaultName ) - - - normalizeSignalSlot - normalizeSignalSlot - ( const char * signalSlot ) - - - removeChild - removeChild - ( QObject * object ) - - - setName - setName - ( const char * name ) - - - - QPageSetupDialog - qpagesetupdialog.html - - QPageSetupDialog - QPageSetupDialog - ( QPrinter * printer, QWidget * parent = 0 ) - - - printer - printer - () - - - - QPaintDevice - qpaintdevice.html - - PaintDeviceMetric - PaintDeviceMetric-enum - - - - QPaintDevice - QPaintDevice - () - - - depth - depth - () - - - height - height - () - - - heightMM - heightMM - () - - - logicalDpiX - logicalDpiX - () - - - logicalDpiY - logicalDpiY - () - - - metric - metric - ( PaintDeviceMetric metric ) - - - numColors - numColors - () - - - paintEngine - paintEngine - () - - - paintingActive - paintingActive - () - - - physicalDpiX - physicalDpiX - () - - - physicalDpiY - physicalDpiY - () - - - width - width - () - - - widthMM - widthMM - () - - - x11AppCells - x11AppCells - ( int screen = -1 ) - - - HANDLE - x11AppColormap - QPaintDevice::x11AppColormap( int screen = -1 ) - - - x11AppDefaultColormap - x11AppDefaultColormap - ( int screen = -1 ) - - - x11AppDefaultVisual - x11AppDefaultVisual - ( int screen = -1 ) - - - x11AppDepth - x11AppDepth - ( int screen = -1 ) - - - x11AppDisplay - x11AppDisplay - () - - - x11AppDpiX - x11AppDpiX - ( int screen = -1 ) - - - x11AppDpiY - x11AppDpiY - ( int screen = -1 ) - - - HANDLE - x11AppRootWindow - QPaintDevice::x11AppRootWindow( int screen = -1 ) - - - x11AppScreen - x11AppScreen - () - - - x11AppVisual - x11AppVisual - ( int screen = -1 ) - - - x11Cells - x11Cells - () - - - HANDLE - x11Colormap - QPaintDevice::x11Colormap() - - - x11DefaultColormap - x11DefaultColormap - () - - - x11DefaultVisual - x11DefaultVisual - () - - - x11Depth - x11Depth - () - - - x11Display - x11Display - () - - - x11Screen - x11Screen - () - - - x11SetAppDpiX - x11SetAppDpiX - ( int dpi, int screen ) - - - x11SetAppDpiY - x11SetAppDpiY - ( int dpi, int screen ) - - - x11Visual - x11Visual - () - - - - QPaintEngine - qpaintengine.html - - PolygonDrawMode - PolygonDrawMode-enum - - - - Type - Type-enum - - - - QPaintEngine - QPaintEngine - ( PaintEngineFeatures caps = 0 ) - - - begin - begin - ( QPaintDevice * pdev ) - - - drawEllipse - drawEllipse - ( const QRectF & rect ) - - - drawEllipse - drawEllipse-2 - ( const QRect & rect ) - - - drawImage - drawImage - ( const QRectF & rectangle, const QImage & image, const QRectF & sr, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - drawLines - drawLines - ( const QLineF * lines, int lineCount ) - - - drawLines - drawLines-2 - ( const QLine * lines, int lineCount ) - - - drawPath - drawPath - ( const QPainterPath & path ) - - - drawPixmap - drawPixmap - ( const QRectF & r, const QPixmap & pm, const QRectF & sr ) - - - drawPoints - drawPoints - ( const QPointF * points, int pointCount ) - - - drawPoints - drawPoints-2 - ( const QPoint * points, int pointCount ) - - - drawPolygon - drawPolygon - ( const QPointF * points, int pointCount, PolygonDrawMode mode ) - - - drawPolygon - drawPolygon-2 - ( const QPoint * points, int pointCount, PolygonDrawMode mode ) - - - drawRects - drawRects - ( const QRectF * rects, int rectCount ) - - - drawRects - drawRects-2 - ( const QRect * rects, int rectCount ) - - - drawTextItem - drawTextItem - ( const QPointF & p, const QTextItem & textItem ) - - - drawTiledPixmap - drawTiledPixmap - ( const QRectF & rect, const QPixmap & pixmap, const QPointF & p ) - - - end - end - () - - - hasFeature - hasFeature - ( PaintEngineFeatures feature ) - - - isActive - isActive - () - - - paintDevice - paintDevice - () - - - painter - painter - () - - - setActive - setActive - ( bool state ) - - - type - type - () - - - updateState - updateState - ( const QPaintEngineState & state ) - - - - QPaintEngineState - qpaintenginestate.html - - backgroundBrush - backgroundBrush - () - - - BGMode - backgroundMode - QPaintEngineState::backgroundMode() - - - brush - brush - () - - - brushOrigin - brushOrigin - () - - - ClipOperation - clipOperation - QPaintEngineState::clipOperation() - - - clipPath - clipPath - () - - - clipRegion - clipRegion - () - - - CompositionMode - compositionMode - QPaintEngineState::compositionMode() - - - font - font - () - - - isClipEnabled - isClipEnabled - () - - - matrix - matrix - () - - - painter - painter - () - - - pen - pen - () - - - RenderHints - renderHints - QPaintEngineState::renderHints() - - - DirtyFlags - state - QPaintEngineState::state() - - - - QPainter - qpainter.html - - CompositionMode - CompositionMode-enum - - - - QPainter - QPainter - () - - - QPainter - QPainter-2 - ( QPaintDevice * device ) - - - background - background - () - - - BGMode - backgroundMode - QPainter::backgroundMode() - - - begin - begin - ( QPaintDevice * device ) - - - boundingRect - boundingRect - ( const QRectF & rectangle, int flags, const QString & text ) - - - boundingRect - boundingRect-4 - ( const QRect & rectangle, int flags, const QString & text ) - - - boundingRect - boundingRect-5 - ( int x, int y, int w, int h, int flags, const QString & text ) - - - boundingRect - boundingRect-6 - ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() - - - brush - brush - () - - - brushOrigin - brushOrigin - () - - - clipPath - clipPath - () - - - clipRegion - clipRegion - () - - - compositionMode - compositionMode - () - - - device - device - () - - - deviceMatrix - deviceMatrix - () - - - drawArc - drawArc - ( const QRectF & rectangle, int startAngle, int spanAngle ) - - - drawArc - drawArc-2 - ( const QRect & rectangle, int startAngle, int spanAngle ) - - - drawArc - drawArc-3 - ( int x, int y, int width, int height, int startAngle, int spanAngle ) - - - drawChord - drawChord - ( const QRectF & rectangle, int startAngle, int spanAngle ) - - - drawChord - drawChord-2 - ( const QRect & rectangle, int startAngle, int spanAngle ) - - - drawChord - drawChord-3 - ( int x, int y, int width, int height, int startAngle, int spanAngle ) - - - drawConvexPolygon - drawConvexPolygon - ( const QPointF * points, int pointCount ) - - - drawConvexPolygon - drawConvexPolygon-2 - ( const QPoint * points, int pointCount ) - - - drawConvexPolygon - drawConvexPolygon-3 - ( const QPolygonF & polygon ) - - - drawConvexPolygon - drawConvexPolygon-4 - ( const QPolygon & polygon ) - - - drawEllipse - drawEllipse - ( const QRectF & rectangle ) - - - drawEllipse - drawEllipse-2 - ( const QRect & rectangle ) - - - drawEllipse - drawEllipse-3 - ( int x, int y, int width, int height ) - - - drawImage - drawImage - ( const QRectF & target, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - drawImage - drawImage-2 - ( const QRect & target, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - drawImage - drawImage-3 - ( const QPointF & point, const QImage & image ) - - - drawImage - drawImage-4 - ( const QPoint & point, const QImage & image ) - - - drawImage - drawImage-5 - ( const QPointF & point, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - drawImage - drawImage-6 - ( const QPoint & point, const QImage & image, const QRect & source, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - drawImage - drawImage-7 - ( const QRectF & rectangle, const QImage & image ) - - - drawImage - drawImage-8 - ( const QRect & rectangle, const QImage & image ) - - - drawImage - drawImage-9 - ( int x, int y, const QImage & image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - drawLine - drawLine - ( const QLineF & line ) - - - drawLine - drawLine-2 - ( const QLine & line ) - - - drawLine - drawLine-3 - ( const QPoint & p1, const QPoint & p2 ) - - - drawLine - drawLine-4 - ( const QPointF & p1, const QPointF & p2 ) - - - drawLine - drawLine-5 - ( int x1, int y1, int x2, int y2 ) - - - drawLines - drawLines - ( const QLineF * lines, int lineCount ) - - - drawLines - drawLines-2 - ( const QLine * lines, int lineCount ) - - - drawLines - drawLines-3 - ( const QPointF * pointPairs, int lineCount ) - - - drawLines - drawLines-4 - ( const QPoint * pointPairs, int lineCount ) - - - drawLines - drawLines-5 - ( const QVector<QPointF> & pointPairs ) - - - drawLines - drawLines-6 - ( const QVector<QPoint> & pointPairs ) - - - drawLines - drawLines-7 - ( const QVector<QLineF> & lines ) - - - drawLines - drawLines-8 - ( const QVector<QLine> & lines ) - - - drawPath - drawPath - ( const QPainterPath & path ) - - - drawPicture - drawPicture - ( const QPointF & point, const QPicture & picture ) - - - drawPicture - drawPicture-2 - ( const QPoint & point, const QPicture & picture ) - - - drawPicture - drawPicture-3 - ( int x, int y, const QPicture & picture ) - - - drawPie - drawPie - ( const QRectF & rectangle, int startAngle, int spanAngle ) - - - drawPie - drawPie-2 - ( const QRect & rectangle, int startAngle, int spanAngle ) - - - drawPie - drawPie-3 - ( int x, int y, int width, int height, int startAngle, int spanAngle ) - - - drawPixmap - drawPixmap - ( const QRectF & target, const QPixmap & pixmap, const QRectF & source ) - - - drawPixmap - drawPixmap-2 - ( const QRect & target, const QPixmap & pixmap, const QRect & source ) - - - drawPixmap - drawPixmap-3 - ( const QPointF & point, const QPixmap & pixmap, const QRectF & source ) - - - drawPixmap - drawPixmap-4 - ( const QPoint & point, const QPixmap & pixmap, const QRect & source ) - - - drawPixmap - drawPixmap-5 - ( const QPointF & point, const QPixmap & pixmap ) - - - drawPixmap - drawPixmap-6 - ( const QPoint & point, const QPixmap & pixmap ) - - - drawPixmap - drawPixmap-7 - ( int x, int y, const QPixmap & pixmap ) - - - drawPixmap - drawPixmap-8 - ( const QRect & rectangle, const QPixmap & pixmap ) - - - drawPixmap - drawPixmap-9 - ( int x, int y, int width, int height, const QPixmap & pixmap ) - - - drawPixmap - drawPixmap-10 - ( int x, int y, int w, int h, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) - - - drawPixmap - drawPixmap-11 - ( int x, int y, const QPixmap & pixmap, int sx, int sy, int sw, int sh ) - - - drawPoint - drawPoint - ( const QPointF & position ) - - - drawPoint - drawPoint-2 - ( const QPoint & position ) - - - drawPoint - drawPoint-3 - ( int x, int y ) - - - drawPoints - drawPoints - ( const QPointF * points, int pointCount ) - - - drawPoints - drawPoints-2 - ( const QPoint * points, int pointCount ) - - - drawPoints - drawPoints-3 - ( const QPolygonF & points ) - - - drawPoints - drawPoints-4 - ( const QPolygon & points ) - - - drawPolygon - drawPolygon - ( const QPointF * points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill ) - - - drawPolygon - drawPolygon-2 - ( const QPoint * points, int pointCount, Qt::FillRule fillRule = Qt::OddEvenFill ) - - - drawPolygon - drawPolygon-5 - ( const QPolygonF & points, Qt::FillRule fillRule = Qt::OddEvenFill ) - - - drawPolygon - drawPolygon-6 - ( const QPolygon & points, Qt::FillRule fillRule = Qt::OddEvenFill ) - - - drawPolyline - drawPolyline - ( const QPointF * points, int pointCount ) - - - drawPolyline - drawPolyline-2 - ( const QPoint * points, int pointCount ) - - - drawPolyline - drawPolyline-4 - ( const QPolygonF & points ) - - - drawPolyline - drawPolyline-5 - ( const QPolygon & points ) - - - drawRect - drawRect - ( const QRectF & rectangle ) - - - drawRect - drawRect-2 - ( const QRect & rectangle ) - - - drawRect - drawRect-3 - ( int x, int y, int width, int height ) - - - drawRects - drawRects - ( const QRectF * rectangles, int rectCount ) - - - drawRects - drawRects-2 - ( const QRect * rectangles, int rectCount ) - - - drawRects - drawRects-3 - ( const QVector<QRectF> & rectangles ) - - - drawRects - drawRects-4 - ( const QVector<QRect> & rectangles ) - - - drawRoundRect - drawRoundRect - ( const QRectF & r, int xRnd = 25, int yRnd = 25 ) - - - drawRoundRect - drawRoundRect-2 - ( const QRect & r, int xRnd = 25, int yRnd = 25 ) - - - drawRoundRect - drawRoundRect-3 - ( int x, int y, int w, int h, int xRnd = 25, int yRnd = 25 ) - - - drawText - drawText - ( const QPointF & position, const QString & text ) - - - drawText - drawText-8 - ( const QPoint & position, const QString & text ) - - - drawText - drawText-9 - ( const QRectF & rectangle, int flags, const QString & text, QRectF * boundingRect = 0 ) - - - drawText - drawText-10 - ( const QRect & rectangle, int flags, const QString & text, QRect * boundingRect = 0 ) - - - drawText - drawText-11 - ( int x, int y, const QString & text ) - - - drawText - drawText-12 - ( int x, int y, int width, int height, int flags, const QString & text, QRect * boundingRect = 0 ) - - - drawText - drawText-13 - ( const QRectF & rectangle, const QString & text, const QTextOption & option = QTextOption() - - - drawTiledPixmap - drawTiledPixmap - ( const QRectF & rectangle, const QPixmap & pixmap, const QPointF & position = QPointF() - - - drawTiledPixmap - drawTiledPixmap-2 - ( const QRect & rectangle, const QPixmap & pixmap, const QPoint & position = QPoint() - - - drawTiledPixmap - drawTiledPixmap-3 - ( int x, int y, int width, int height, const QPixmap & pixmap, int sx = 0, int sy = 0 ) - - - end - end - () - - - eraseRect - eraseRect - ( const QRectF & rectangle ) - - - eraseRect - eraseRect-2 - ( const QRect & rectangle ) - - - eraseRect - eraseRect-3 - ( int x, int y, int width, int height ) - - - fillPath - fillPath - ( const QPainterPath & path, const QBrush & brush ) - - - fillRect - fillRect - ( const QRectF & rectangle, const QBrush & brush ) - - - fillRect - fillRect-2 - ( const QRect & rectangle, const QBrush & brush ) - - - fillRect - fillRect-3 - ( int x, int y, int width, int height, const QBrush & brush ) - - - font - font - () - - - fontInfo - fontInfo - () - - - fontMetrics - fontMetrics - () - - - hasClipping - hasClipping - () - - - initFrom - initFrom - ( const QWidget * widget ) - - - isActive - isActive - () - - - LayoutDirection - layoutDirection - QPainter::layoutDirection() - - - matrix - matrix - () - - - matrixEnabled - matrixEnabled - () - - - paintEngine - paintEngine - () - - - pen - pen - () - - - redirected - redirected - ( const QPaintDevice * device, QPoint * offset = 0 ) - - - renderHints - renderHints - () - - - resetMatrix - resetMatrix - () - - - restore - restore - () - - - restoreRedirected - restoreRedirected - ( const QPaintDevice * device ) - - - rotate - rotate - ( qreal angle ) - - - save - save - () - - - scale - scale - ( qreal sx, qreal sy ) - - - setBackground - setBackground - ( const QBrush & brush ) - - - setBackgroundMode - setBackgroundMode - ( Qt::BGMode mode ) - - - setBrush - setBrush - ( const QBrush & brush ) - - - setBrush - setBrush-2 - ( Qt::BrushStyle style ) - - - setBrushOrigin - setBrushOrigin - ( const QPointF & position ) - - - setBrushOrigin - setBrushOrigin-2 - ( const QPoint & position ) - - - setBrushOrigin - setBrushOrigin-3 - ( int x, int y ) - - - setClipPath - setClipPath - ( const QPainterPath & path, Qt::ClipOperation operation = Qt::ReplaceClip ) - - - setClipRect - setClipRect - ( const QRectF & rectangle, Qt::ClipOperation operation = Qt::ReplaceClip ) - - - setClipRect - setClipRect-2 - ( int x, int y, int width, int height, Qt::ClipOperation operation = Qt::ReplaceClip ) - - - setClipRect - setClipRect-3 - ( const QRect & rectangle, Qt::ClipOperation operation = Qt::ReplaceClip ) - - - setClipRegion - setClipRegion - ( const QRegion & region, Qt::ClipOperation operation = Qt::ReplaceClip ) - - - setClipping - setClipping - ( bool enable ) - - - setCompositionMode - setCompositionMode - ( CompositionMode mode ) - - - setFont - setFont - ( const QFont & font ) - - - setLayoutDirection - setLayoutDirection - ( Qt::LayoutDirection direction ) - - - setMatrix - setMatrix - ( const QMatrix & matrix, bool combine = false ) - - - setMatrixEnabled - setMatrixEnabled - ( bool enable ) - - - setPen - setPen - ( const QPen & pen ) - - - setPen - setPen-2 - ( const QColor & color ) - - - setPen - setPen-3 - ( Qt::PenStyle style ) - - - setRedirected - setRedirected - ( const QPaintDevice * device, QPaintDevice * replacement, const QPoint & offset = QPoint() - - - setRenderHint - setRenderHint - ( RenderHint hint, bool on = true ) - - - setViewTransformEnabled - setViewTransformEnabled - ( bool enable ) - - - setViewport - setViewport - ( const QRect & rectangle ) - - - setViewport - setViewport-2 - ( int x, int y, int width, int height ) - - - setWindow - setWindow - ( const QRect & rectangle ) - - - setWindow - setWindow-2 - ( int x, int y, int width, int height ) - - - shear - shear - ( qreal sh, qreal sv ) - - - strokePath - strokePath - ( const QPainterPath & path, const QPen & pen ) - - - translate - translate - ( const QPointF & offset ) - - - translate - translate-2 - ( const QPoint & offset ) - - - translate - translate-3 - ( qreal dx, qreal dy ) - - - viewTransformEnabled - viewTransformEnabled - () - - - viewport - viewport - () - - - window - window - () - - - - QPainterPath::Element - qpainterpath-element.html - - isCurveTo - isCurveTo - () - - - isLineTo - isLineTo - () - - - isMoveTo - isMoveTo - () - - - operator - operator-QPointF - QPointF() - - - type - type-varx - - - - x - x-var - - - - y - y-var - - - - - QPainterPath - qpainterpath.html - - ElementType - ElementType-enum - - - - QPainterPath - QPainterPath - () - - - QPainterPath - QPainterPath-2 - ( const QPointF & startPoint ) - - - QPainterPath - QPainterPath-3 - ( const QPainterPath & path ) - - - addEllipse - addEllipse - ( const QRectF & boundingRectangle ) - - - addEllipse - addEllipse-2 - ( qreal x, qreal y, qreal width, qreal height ) - - - addPath - addPath - ( const QPainterPath & path ) - - - addPolygon - addPolygon - ( const QPolygonF & polygon ) - - - addRect - addRect - ( const QRectF & rectangle ) - - - addRect - addRect-2 - ( qreal x, qreal y, qreal width, qreal height ) - - - addRegion - addRegion - ( const QRegion & region ) - - - addText - addText - ( const QPointF & point, const QFont & font, const QString & text ) - - - addText - addText-2 - ( qreal x, qreal y, const QFont & font, const QString & text ) - - - arcTo - arcTo - ( const QRectF & rectangle, qreal startAngle, qreal sweepLength ) - - - arcTo - arcTo-2 - ( qreal x, qreal y, qreal width, qreal height, qreal startAngle, qreal sweepLength ) - - - boundingRect - boundingRect - () - - - closeSubpath - closeSubpath - () - - - connectPath - connectPath - ( const QPainterPath & path ) - - - contains - contains - ( const QPointF & point ) - - - contains - contains-2 - ( const QRectF & rectangle ) - - - controlPointRect - controlPointRect - () - - - cubicTo - cubicTo - ( const QPointF & c1, const QPointF & c2, const QPointF & endPoint ) - - - cubicTo - cubicTo-2 - ( qreal c1X, qreal c1Y, qreal c2X, qreal c2Y, qreal endPointX, qreal endPointY ) - - - currentPosition - currentPosition - () - - - Element - elementAt - & QPainterPath::elementAt( int index ) - - - elementCount - elementCount - () - - - FillRule - fillRule - QPainterPath::fillRule() - - - intersects - intersects - ( const QRectF & rectangle ) - - - isEmpty - isEmpty - () - - - lineTo - lineTo - ( const QPointF & endPoint ) - - - lineTo - lineTo-2 - ( qreal x, qreal y ) - - - moveTo - moveTo - ( const QPointF & point ) - - - moveTo - moveTo-2 - ( qreal x, qreal y ) - - - quadTo - quadTo - ( const QPointF & c, const QPointF & endPoint ) - - - quadTo - quadTo-2 - ( qreal cx, qreal cy, qreal endPointX, qreal endPointY ) - - - setFillRule - setFillRule - ( Qt::FillRule fillRule ) - - - toFillPolygon - toFillPolygon - ( const QMatrix & matrix = QMatrix() - - - toFillPolygons - toFillPolygons - ( const QMatrix & matrix = QMatrix() - - - toReversed - toReversed - () - - - toSubpathPolygons - toSubpathPolygons - ( const QMatrix & matrix = QMatrix() - - - operator!= - operator-not-eq - ( const QPainterPath & path ) - - - operator= - operator-eq - ( const QPainterPath & path ) - - - operator== - operator-eq-eq - ( const QPainterPath & path ) - - - - QPainterPathStroker - qpainterpathstroker.html - - QPainterPathStroker - QPainterPathStroker - () - - - PenCapStyle - capStyle - QPainterPathStroker::capStyle() - - - createStroke - createStroke - ( const QPainterPath & path ) - - - curveThreshold - curveThreshold - () - - - dashPattern - dashPattern - () - - - PenJoinStyle - joinStyle - QPainterPathStroker::joinStyle() - - - miterLimit - miterLimit - () - - - setCapStyle - setCapStyle - ( Qt::PenCapStyle style ) - - - setCurveThreshold - setCurveThreshold - ( qreal threshold ) - - - setDashPattern - setDashPattern - ( Qt::PenStyle style ) - - - setDashPattern - setDashPattern-2 - ( const QVector<qreal> & dashPattern ) - - - setJoinStyle - setJoinStyle - ( Qt::PenJoinStyle style ) - - - setMiterLimit - setMiterLimit - ( qreal limit ) - - - setWidth - setWidth - ( qreal width ) - - - width - width - () - - - backgroundColor - backgroundColor - () - - - begin - begin-2 - ( QPaintDevice * device, const QWidget * init ) - - - boundingRect - boundingRect-2 - ( const QRect & rectangle, int flags, const QString & text, int length ) - - - boundingRect - boundingRect-3 - ( int x, int y, int width, int height, int flags, const QString & text, int length ) - - - drawConvexPolygon - drawConvexPolygon-5 - ( const QPolygonF & polygon, int index, int count = -1 ) - - - drawConvexPolygon - drawConvexPolygon-6 - ( const QPolygon & polygon, int index, int count = -1 ) - - - drawCubicBezier - drawCubicBezier - ( const QPolygon & controlPoints, int index = 0 ) - - - drawLineSegments - drawLineSegments - ( const QPolygon & polygon, int index = 0, int count = -1 ) - - - drawPoints - drawPoints-5 - ( const QPolygon & polygon, int index, int count = -1 ) - - - drawPolygon - drawPolygon-3 - ( const QPolygonF & polygon, bool winding, int index = 0, int count = -1 ) - - - drawPolygon - drawPolygon-4 - ( const QPolygon & polygon, bool winding, int index = 0, int count = -1 ) - - - drawPolyline - drawPolyline-3 - ( const QPolygon & polygon, int index, int count = -1 ) - - - drawText - drawText-2 - ( int x, int y, const QString & text, int pos, int length ) - - - drawText - drawText-3 - ( const QPoint & point, const QString & text, int pos, int length ) - - - drawText - drawText-4 - ( int x, int y, const QString & text, int length ) - - - drawText - drawText-5 - ( const QPoint & point, const QString & text, int length ) - - - drawText - drawText-6 - ( const QRect & rectangle, int flags, const QString & text, int length, QRect * br = 0 ) - - - drawText - drawText-7 - ( int x, int y, int width, int height, int flags, const QString & text, int length, QRect * br = 0 ) - - - hasViewXForm - hasViewXForm - () - - - hasWorldXForm - hasWorldXForm - () - - - redirect - redirect - ( QPaintDevice * pdev, QPaintDevice * replacement ) - - - redirect - redirect-2 - ( QPaintDevice * pdev ) - - - resetXForm - resetXForm - () - - - setBackgroundColor - setBackgroundColor - ( const QColor & color ) - - - setViewXForm - setViewXForm - ( bool enabled ) - - - setWorldMatrix - setWorldMatrix - ( const QMatrix & wm, bool combine = false ) - - - setWorldXForm - setWorldXForm - ( bool enabled ) - - - translationX - translationX - () - - - translationY - translationY - () - - - worldMatrix - worldMatrix - () - - - xForm - xForm - ( const QPoint & point ) - - - xForm - xForm-2 - ( const QRect & rectangle ) - - - xForm - xForm-3 - ( const QPolygon & polygon ) - - - xForm - xForm-4 - ( const QPolygon & polygon, int index, int count ) - - - xFormDev - xFormDev - ( const QPoint & point ) - - - xFormDev - xFormDev-2 - ( const QRect & rectangle ) - - - xFormDev - xFormDev-3 - ( const QPolygon & polygon ) - - - xFormDev - xFormDev-4 - ( const QPolygon & polygon, int index, int count ) - - - - QPaintEvent - qpaintevent.html - - QPaintEvent - QPaintEvent - ( const QRegion & paintRegion ) - - - QPaintEvent - QPaintEvent-2 - ( const QRect & paintRect ) - - - rect - rect - () - - - region - region - () - - - QPaintEvent - QPaintEvent-3 - ( const QRegion & paintRegion, const QRect & paintRect ) - - - erased - erased - () - - - - QPair - qpair.html - - first_type - first_type-typedef - - - - second_type - second_type-typedef - - - - QPair - QPair - () - - - QPair - QPair-2 - ( const T1 & value1, const T2 & value2 ) - - - operator= - operator-eq - ( const QPair<T1, T2> & other ) - - - first - first-var - - - - second - second-var - - - - - QPalette - qpalette.html - - ColorGroup - ColorGroup-enum - - - - ColorRole - ColorRole-enum - - - - QPalette - QPalette - () - - - QPalette - QPalette-2 - ( const QColor & button ) - - - QPalette - QPalette-3 - ( Qt::GlobalColor button ) - - - QPalette - QPalette-4 - ( const QColor & button, const QColor & window ) - - - QPalette - QPalette-5 - ( const QBrush & windowText, const QBrush & button, const QBrush & light, const QBrush & dark, const QBrush & mid, const QBrush & text, const QBrush & bright_text, const QBrush & base, const QBrush & window ) - - - QPalette - QPalette-8 - ( const QPalette & p ) - - - alternateBase - alternateBase - () - - - base - base - () - - - brightText - brightText - () - - - brush - brush - ( ColorGroup gr, ColorRole cr ) - - - brush - brush-2 - ( ColorRole r ) - - - button - button - () - - - buttonText - buttonText - () - - - color - color - ( ColorGroup gr, ColorRole r ) - - - color - color-2 - ( ColorRole r ) - - - currentColorGroup - currentColorGroup - () - - - dark - dark - () - - - highlight - highlight - () - - - highlightedText - highlightedText - () - - - isCopyOf - isCopyOf - ( const QPalette & p ) - - - isEqual - isEqual - ( ColorGroup cg1, ColorGroup cg2 ) - - - light - light - () - - - link - link - () - - - linkVisited - linkVisited - () - - - mid - mid - () - - - midlight - midlight - () - - - resolve - resolve - ( const QPalette & other ) - - - serialNumber - serialNumber - () - - - setBrush - setBrush - ( ColorRole cr, const QBrush & brush ) - - - setBrush - setBrush-2 - ( ColorGroup cg, ColorRole cr, const QBrush & b ) - - - setColor - setColor - ( ColorGroup gr, ColorRole r, const QColor & c ) - - - setColor - setColor-2 - ( ColorRole r, const QColor & c ) - - - setColorGroup - setColorGroup - ( ColorGroup cg, const QBrush & windowText, const QBrush & button, const QBrush & light, const QBrush & dark, const QBrush & mid, const QBrush & text, const QBrush & bright_text, const QBrush & base, const QBrush & window ) - - - setCurrentColorGroup - setCurrentColorGroup - ( ColorGroup cg ) - - - shadow - shadow - () - - - text - text - () - - - window - window - () - - - windowText - windowText - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QPalette & p ) - - - operator= - operator-eq - ( const QPalette & p ) - - - operator== - operator-eq-eq - ( const QPalette & p ) - - - QPalette - QPalette-6 - ( const QColor & windowText, const QColor & window, const QColor & light, const QColor & dark, const QColor & mid, const QColor & text, const QColor & base ) - - - background - background - () - - - foreground - foreground - () - - - QPalette - QPalette-7 - ( const QColorGroup & active, const QColorGroup & disabled, const QColorGroup & inactive ) - - - active - active - () - - - copy - copy - () - - - disabled - disabled - () - - - inactive - inactive - () - - - normal - normal - () - - - setActive - setActive - ( const QColorGroup & colorGroup ) - - - setDisabled - setDisabled - ( const QColorGroup & colorGroup ) - - - setInactive - setInactive - ( const QColorGroup & colorGroup ) - - - setNormal - setNormal - ( const QColorGroup & colorGroup ) - - - - QPen - qpen.html - - QPen - QPen - () - - - QPen - QPen-2 - ( Qt::PenStyle style ) - - - QPen - QPen-3 - ( const QColor & color ) - - - QPen - QPen-4 - ( const QBrush & brush, qreal width, Qt::PenStyle style = Qt::SolidLine, Qt::PenCapStyle cap = Qt::SquareCap, Qt::PenJoinStyle join = Qt::BevelJoin ) - - - QPen - QPen-5 - ( const QPen & pen ) - - - brush - brush - () - - - PenCapStyle - capStyle - QPen::capStyle() - - - color - color - () - - - dashPattern - dashPattern - () - - - isSolid - isSolid - () - - - PenJoinStyle - joinStyle - QPen::joinStyle() - - - miterLimit - miterLimit - () - - - setBrush - setBrush - ( const QBrush & brush ) - - - setCapStyle - setCapStyle - ( Qt::PenCapStyle style ) - - - setColor - setColor - ( const QColor & color ) - - - setDashPattern - setDashPattern - ( const QVector<qreal> & pattern ) - - - setJoinStyle - setJoinStyle - ( Qt::PenJoinStyle style ) - - - setMiterLimit - setMiterLimit - ( qreal limit ) - - - setStyle - setStyle - ( Qt::PenStyle style ) - - - setWidth - setWidth - ( int width ) - - - setWidthF - setWidthF - ( qreal width ) - - - PenStyle - style - QPen::style() - - - width - width - () - - - widthF - widthF - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QPen & pen ) - - - operator= - operator-eq - ( const QPen & pen ) - - - operator== - operator-eq-eq - ( const QPen & pen ) - - - - QPersistentModelIndex - qpersistentmodelindex.html - - QPersistentModelIndex - QPersistentModelIndex-2 - ( const QModelIndex & index ) - - - QPersistentModelIndex - QPersistentModelIndex-3 - ( const QPersistentModelIndex & other ) - - - child - child - ( int row, int column ) - - - column - column - () - - - data - data - ( int role = Qt::DisplayRole ) - - - isValid - isValid - () - - - model - model - () - - - parent - parent - () - - - row - row - () - - - sibling - sibling - ( int row, int column ) - - - operator - operator-const-QModelIndex--and - const QModelIndex &() - - - operator!= - operator-not-eq - ( const QModelIndex & other ) - - - operator< - operator-lt - ( const QPersistentModelIndex & other ) - - - operator= - operator-eq - ( const QPersistentModelIndex & other ) - - - operator= - operator-eq-2 - ( const QModelIndex & other ) - - - operator== - operator-eq-eq - ( const QPersistentModelIndex & other ) - - - operator== - operator-eq-eq-2 - ( const QModelIndex & other ) - - - - QPictureFormatPlugin - qpictureformatplugin.html - - QPictureFormatPlugin - QPictureFormatPlugin - ( QObject * parent = 0 ) - - - installIOHandler - installIOHandler - ( const QString & format ) - - - keys - keys - () - - - loadPicture - loadPicture - ( const QString & format, const QString & fileName, QPicture * picture ) - - - savePicture - savePicture - ( const QString & format, const QString & fileName, const QPicture & picture ) - - - - QPicture - qpicture.html - - QPicture - QPicture - ( int formatVersion = -1 ) - - - QPicture - QPicture-2 - ( const QPicture & pic ) - - - boundingRect - boundingRect - () - - - data - data - () - - - inputFormatList - inputFormatList - () - - - inputFormats - inputFormats - () - - - isNull - isNull - () - - - load - load - ( const QString & fileName, const char * format = 0 ) - - - load - load-2 - ( QIODevice * dev, const char * format = 0 ) - - - metric - metric - ( PaintDeviceMetric m ) - - - outputFormatList - outputFormatList - () - - - outputFormats - outputFormats - () - - - pictureFormat - pictureFormat - ( const QString & fileName ) - - - play - play - ( QPainter * painter ) - - - save - save - ( const QString & fileName, const char * format = 0 ) - - - save - save-2 - ( QIODevice * dev, const char * format = 0 ) - - - setBoundingRect - setBoundingRect - ( const QRect & r ) - - - setData - setData - ( const char * data, uint size ) - - - size - size - () - - - operator= - operator-eq - ( const QPicture & p ) - - - - QPictureIO - qpictureio.html - - QPictureIO - QPictureIO - () - - - QPictureIO - QPictureIO-2 - ( QIODevice * ioDevice, const char * format ) - - - QPictureIO - QPictureIO-3 - ( const QString & fileName, const char * format ) - - - defineIOHandler - defineIOHandler - ( const char * format, const char * header, const char * flags, picture_io_handler readPicture, picture_io_handler writePicture ) - - - description - description - () - - - fileName - fileName - () - - - format - format - () - - - gamma - gamma - () - - - inputFormats - inputFormats - () - - - ioDevice - ioDevice - () - - - outputFormats - outputFormats - () - - - parameters - parameters - () - - - picture - picture - () - - - pictureFormat - pictureFormat - ( const QString & fileName ) - - - pictureFormat - pictureFormat-2 - ( QIODevice * d ) - - - quality - quality - () - - - read - read - () - - - setDescription - setDescription - ( const QString & description ) - - - setFileName - setFileName - ( const QString & fileName ) - - - setFormat - setFormat - ( const char * format ) - - - setGamma - setGamma - ( float gamma ) - - - setIODevice - setIODevice - ( QIODevice * ioDevice ) - - - setParameters - setParameters - ( const char * parameters ) - - - setPicture - setPicture - ( const QPicture & picture ) - - - setQuality - setQuality - ( int q ) - - - setStatus - setStatus - ( int status ) - - - status - status - () - - - write - write - () - - - copy - copy - () - - - - QPixmapCache - qpixmapcache.html - - cacheLimit - cacheLimit - () - - - clear - clear - () - - - find - find - ( const QString & key, QPixmap & pm ) - - - insert - insert - ( const QString & key, const QPixmap & pm ) - - - remove - remove - ( const QString & key ) - - - setCacheLimit - setCacheLimit - ( int n ) - - - find - find-2 - ( const QString & key ) - - - - QPixmap - qpixmap.html - - HBitmapFormat - HBitmapFormat-enum - - - - QPixmap - QPixmap - () - - - QPixmap - QPixmap-2 - ( int width, int height ) - - - QPixmap - QPixmap-3 - ( const QString & fileName, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - QPixmap - QPixmap-4 - ( const char * const[] xpm ) - - - QPixmap - QPixmap-5 - ( const QPixmap & pixmap ) - - - QPixmap - QPixmap-9 - ( const QSize & size ) - - - alphaChannel - alphaChannel - () - - - copy - copy - ( const QRect & rectangle = QRect() - - - copy - copy-2 - ( int x, int y, int width, int height ) - - - createHeuristicMask - createHeuristicMask - ( bool clipTight = true ) - - - createMaskFromColor - createMaskFromColor - ( const QColor & maskColor ) - - - defaultDepth - defaultDepth - () - - - depth - depth - () - - - detach - detach - () - - - fill - fill - ( const QColor & fillColor = Qt::white ) - - - fill - fill-2 - ( const QWidget * widget, const QPoint & offset ) - - - fill - fill-3 - ( const QWidget * widget, int x, int y ) - - - fromImage - fromImage - ( const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - fromWinHBITMAP - fromWinHBITMAP - ( HBITMAP bitmap, HBitmapFormat format = NoAlpha ) - - - grabWidget - grabWidget - ( QWidget * widget, const QRect & rectangle ) - - - grabWidget - grabWidget-2 - ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) - - - grabWindow - grabWindow - ( WId window, int x = 0, int y = 0, int width = -1, int height = -1 ) - - - HANDLE - handle - QPixmap::handle() - - - hasAlpha - hasAlpha - () - - - hasAlphaChannel - hasAlphaChannel - () - - - height - height - () - - - isNull - isNull - () - - - isQBitmap - isQBitmap - () - - - load - load - ( const QString & fileName, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - loadFromData - loadFromData - ( const uchar * data, uint len, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - loadFromData - loadFromData-3 - ( const QByteArray & data, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - mask - mask - () - - - rect - rect - () - - - save - save - ( const QString & fileName, const char * format, int quality = -1 ) - - - save - save-2 - ( QIODevice * device, const char * format, int quality = -1 ) - - - scaled - scaled - ( const QSize & size, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) - - - scaled - scaled-2 - ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) - - - scaledToHeight - scaledToHeight - ( int height, Qt::TransformationMode mode = Qt::FastTransformation ) - - - scaledToWidth - scaledToWidth - ( int width, Qt::TransformationMode mode = Qt::FastTransformation ) - - - serialNumber - serialNumber - () - - - setAlphaChannel - setAlphaChannel - ( const QPixmap & alphaChannel ) - - - setMask - setMask - ( const QBitmap & newmask ) - - - size - size - () - - - toImage - toImage - () - - - toWinHBITMAP - toWinHBITMAP - ( HBitmapFormat format = NoAlpha ) - - - transformed - transformed - ( const QMatrix & matrix, Qt::TransformationMode mode = Qt::FastTransformation ) - - - trueMatrix - trueMatrix - ( const QMatrix & matrix, int width, int height ) - - - width - width - () - - - x11Info - x11Info - () - - - HANDLE - x11PictureHandle - QPixmap::x11PictureHandle() - - - operator - operator-QVariant - QVariant() - - - operator! - operator-not - () - - - operator= - operator-eq - ( const QPixmap & pixmap ) - - - ColorMode - ColorMode-enum - - - - QPixmap - QPixmap-6 - ( const QString & fileName, const char * format, ColorMode mode ) - - - QPixmap - QPixmap-7 - ( const QImage & image ) - - - convertFromImage - convertFromImage - ( const QImage & image, ColorMode mode ) - - - convertFromImage - convertFromImage-2 - ( const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor ) - - - convertToImage - convertToImage - () - - - load - load-2 - ( const QString & fileName, const char * format, ColorMode mode ) - - - loadFromData - loadFromData-2 - ( const uchar * buf, uint len, const char * format, ColorMode mode ) - - - resize - resize - ( int width, int height ) - - - resize - resize-2 - ( const QSize & size ) - - - selfMask - selfMask - () - - - xForm - xForm - ( const QMatrix & matrix ) - - - operator - operator-QImage - QImage() - - - operator= - operator-eq-2 - ( const QImage & image ) - - - - QPlastiqueStyle - qplastiquestyle.html - - QPlastiqueStyle - QPlastiqueStyle - () - - - - QPluginLoader - qpluginloader.html - - QPluginLoader - QPluginLoader - ( QObject * parent = 0 ) - - - QPluginLoader - QPluginLoader-2 - ( const QString & fileName, QObject * parent = 0 ) - - - instance - instance - () - - - isLoaded - isLoaded - () - - - load - load - () - - - staticInstances - staticInstances - () - - - unload - unload - () - - - - QPointer - qpointer.html - - QPointer - QPointer - () - - - QPointer - QPointer-2 - ( T * p ) - - - QPointer - QPointer-3 - ( const QPointer<T> & p ) - - - isNull - isNull - () - - - operator - operator-T--2a - T *() - - - operator* - operator-2a - () - - - operator-& - operator--gt - gt;() - - - operator= - operator-eq - ( const QPointer<T> & p ) - - - operator= - operator-eq-2 - ( T * p ) - - - - QPointF - qpointf.html - - QPointF - QPointF - () - - - QPointF - QPointF-2 - ( const QPoint & point ) - - - QPointF - QPointF-3 - ( qreal x, qreal y ) - - - isNull - isNull - () - - - rx - rx - () - - - ry - ry - () - - - setX - setX - ( qreal x ) - - - setY - setY - ( qreal y ) - - - toPoint - toPoint - () - - - x - x - () - - - y - y - () - - - operator*= - operator-2a-eq - ( qreal factor ) - - - operator+= - operator-2b-eq - ( const QPointF & point ) - - - operator-= - operator--eq - ( const QPointF & point ) - - - operator/= - operator-2f-eq - ( qreal divisor ) - - - - QPoint - qpoint.html - - QPoint - QPoint - () - - - QPoint - QPoint-2 - ( int x, int y ) - - - isNull - isNull - () - - - manhattanLength - manhattanLength - () - - - rx - rx - () - - - ry - ry - () - - - setX - setX - ( int x ) - - - setY - setY - ( int y ) - - - x - x - () - - - y - y - () - - - operator*= - operator-2a-eq - ( qreal factor ) - - - operator+= - operator-2b-eq - ( const QPoint & point ) - - - operator-= - operator--eq - ( const QPoint & point ) - - - operator/= - operator-2f-eq - ( qreal divisor ) - - - - QPolygonF - qpolygonf.html - - QPolygonF - QPolygonF - () - - - QPolygonF - QPolygonF-2 - ( int size ) - - - QPolygonF - QPolygonF-3 - ( const QPolygonF & polygon ) - - - QPolygonF - QPolygonF-4 - ( const QVector<QPointF> & points ) - - - QPolygonF - QPolygonF-5 - ( const QRectF & rectangle ) - - - QPolygonF - QPolygonF-6 - ( const QPolygon & polygon ) - - - boundingRect - boundingRect - () - - - isClosed - isClosed - () - - - toPolygon - toPolygon - () - - - translate - translate - ( const QPointF & offset ) - - - translate - translate-2 - ( qreal dx, qreal dy ) - - - - QPolygon - qpolygon.html - - QPolygon - QPolygon - () - - - QPolygon - QPolygon-2 - ( int size ) - - - QPolygon - QPolygon-3 - ( const QPolygon & polygon ) - - - QPolygon - QPolygon-4 - ( const QVector<QPoint> & points ) - - - QPolygon - QPolygon-5 - ( const QRect & rectangle, bool closed = false ) - - - boundingRect - boundingRect - () - - - point - point - ( int index, int * x, int * y ) - - - point - point-2 - ( int index ) - - - putPoints - putPoints - ( int index, int nPoints, int firstx, int firsty, ... ) - - - putPoints - putPoints-3 - ( int index, int nPoints, const QPolygon & fromPolygon, int fromIndex = 0 ) - - - setPoint - setPoint - ( int index, int x, int y ) - - - setPoint - setPoint-2 - ( int index, const QPoint & point ) - - - setPoints - setPoints - ( int nPoints, const int * points ) - - - setPoints - setPoints-2 - ( int nPoints, int firstx, int firsty, ... ) - - - translate - translate - ( int dx, int dy ) - - - translate - translate-2 - ( const QPoint & offset ) - - - operator - operator-QVariant - QVariant() - - - - QPrintDialog - qprintdialog.html - - QPrintDialog - QPrintDialog - ( QPrinter * printer, QWidget * parent = 0 ) - - - - QPrintEngine - qprintengine.html - - PrintEnginePropertyKey - PrintEnginePropertyKey-enum - - - - abort - abort - () - - - metric - metric - ( QPaintDevice::PaintDeviceMetric id ) - - - newPage - newPage - () - - - PrinterState - printerState - QPrintEngine::printerState() - - - property - property - ( PrintEnginePropertyKey key ) - - - setProperty - setProperty - ( PrintEnginePropertyKey key, const QVariant & value ) - - - - QPrinter - qprinter.html - - ColorMode - ColorMode-enum - - - - Orientation - Orientation-enum - - - - OutputFormat - OutputFormat-enum - - - - PageOrder - PageOrder-enum - - - - PageSize - PageSize-enum - - - - PaperSource - PaperSource-enum - - - - PrintRange - PrintRange-enum - - - - PrinterMode - PrinterMode-enum - - - - PrinterState - PrinterState-enum - - - - QPrinter - QPrinter - ( PrinterMode mode = ScreenResolution ) - - - abort - abort - () - - - collateCopies - collateCopies - () - - - colorMode - colorMode - () - - - creator - creator - () - - - docName - docName - () - - - fontEmbeddingEnabled - fontEmbeddingEnabled - () - - - fromPage - fromPage - () - - - fullPage - fullPage - () - - - newPage - newPage - () - - - numCopies - numCopies - () - - - orientation - orientation - () - - - outputFileName - outputFileName - () - - - outputFormat - outputFormat - () - - - pageOrder - pageOrder - () - - - pageRect - pageRect - () - - - pageSize - pageSize - () - - - paintEngine - paintEngine - () - - - paperRect - paperRect - () - - - paperSource - paperSource - () - - - printEngine - printEngine - () - - - printProgram - printProgram - () - - - printRange - printRange - () - - - printerName - printerName - () - - - printerSelectionOption - printerSelectionOption - () - - - printerState - printerState - () - - - resolution - resolution - () - - - setCollateCopies - setCollateCopies - ( bool collate ) - - - setColorMode - setColorMode - ( ColorMode newColorMode ) - - - setCreator - setCreator - ( const QString & creator ) - - - setDocName - setDocName - ( const QString & name ) - - - setEngines - setEngines - ( QPrintEngine * printEngine, QPaintEngine * paintEngine ) - - - setFontEmbeddingEnabled - setFontEmbeddingEnabled - ( bool enable ) - - - setFromTo - setFromTo - ( int from, int to ) - - - setFullPage - setFullPage - ( bool fp ) - - - setNumCopies - setNumCopies - ( int numCopies ) - - - setOrientation - setOrientation - ( Orientation orientation ) - - - setOutputFileName - setOutputFileName - ( const QString & fileName ) - - - setOutputFormat - setOutputFormat - ( OutputFormat format ) - - - setPageOrder - setPageOrder - ( PageOrder pageOrder ) - - - setPageSize - setPageSize - ( PageSize newPageSize ) - - - setPaperSource - setPaperSource - ( PaperSource source ) - - - setPrintProgram - setPrintProgram - ( const QString & printProg ) - - - setPrintRange - setPrintRange - ( PrintRange range ) - - - setPrinterName - setPrinterName - ( const QString & name ) - - - setPrinterSelectionOption - setPrinterSelectionOption - ( const QString & option ) - - - setResolution - setResolution - ( int dpi ) - - - setWinPageSize - setWinPageSize - ( int pageSize ) - - - supportedResolutions - supportedResolutions - () - - - toPage - toPage - () - - - winPageSize - winPageSize - () - - - PrinterOption - PrinterOption-enum - - - - aborted - aborted - () - - - collateCopiesEnabled - collateCopiesEnabled - () - - - isOptionEnabled - isOptionEnabled - ( PrinterOption option ) - - - margins - margins - ( uint * top, uint * left, uint * bottom, uint * right ) - - - margins - margins-2 - () - - - maxPage - maxPage - () - - - minPage - minPage - () - - - outputToFile - outputToFile - () - - - pageSetup - pageSetup - ( QWidget * parent = 0 ) - - - printSetup - printSetup - ( QWidget * parent = 0 ) - - - setCollateCopiesEnabled - setCollateCopiesEnabled - ( bool enable ) - - - setMinMax - setMinMax - ( int minPage, int maxPage ) - - - setOptionEnabled - setOptionEnabled - ( PrinterOption option, bool enable ) - - - setOutputToFile - setOutputToFile - ( bool enable ) - - - setup - setup - ( QWidget * parent = 0 ) - - - - QProcess - qprocess.html - - ExitStatus - ExitStatus-enum - - - - ProcessChannel - ProcessChannel-enum - - - - ProcessChannelMode - ProcessChannelMode-enum - - - - ProcessError - ProcessError-enum - - - - ProcessState - ProcessState-enum - - - - QProcess - QProcess - ( QObject * parent = 0 ) - - - close - close - () - - - closeReadChannel - closeReadChannel - ( ProcessChannel channel ) - - - closeWriteChannel - closeWriteChannel - () - - - environment - environment - () - - - ProcessError - error - QProcess::error() - - - error - error-2 - ( QProcess::ProcessError error ) - - - execute - execute - ( const QString & program, const QStringList & arguments ) - - - execute - execute-2 - ( const QString & program ) - - - exitCode - exitCode - () - - - ExitStatus - exitStatus - QProcess::exitStatus() - - - finished - finished - ( int exitCode, QProcess::ExitStatus exitStatus ) - - - kill - kill - () - - - pid - pid - () - - - readAllStandardError - readAllStandardError - () - - - readAllStandardOutput - readAllStandardOutput - () - - - readChannel - readChannel - () - - - readChannelMode - readChannelMode - () - - - readyReadStandardError - readyReadStandardError - () - - - readyReadStandardOutput - readyReadStandardOutput - () - - - setEnvironment - setEnvironment - ( const QStringList & environment ) - - - setProcessState - setProcessState - ( ProcessState state ) - - - setReadChannel - setReadChannel - ( ProcessChannel channel ) - - - setReadChannelMode - setReadChannelMode - ( ProcessChannelMode mode ) - - - setWorkingDirectory - setWorkingDirectory - ( const QString & dir ) - - - setupChildProcess - setupChildProcess - () - - - start - start - ( const QString & program, const QStringList & arguments, OpenMode mode = ReadWrite ) - - - start - start-2 - ( const QString & program, OpenMode mode = ReadWrite ) - - - startDetached - startDetached - ( const QString & program, const QStringList & arguments ) - - - startDetached - startDetached-2 - ( const QString & program ) - - - started - started - () - - - ProcessState - state - QProcess::state() - - - stateChanged - stateChanged - ( QProcess::ProcessState newState ) - - - systemEnvironment - systemEnvironment - () - - - terminate - terminate - () - - - waitForFinished - waitForFinished - ( int msecs = 30000 ) - - - waitForStarted - waitForStarted - ( int msecs = 30000 ) - - - workingDirectory - workingDirectory - () - - - finished - finished-2 - ( int exitCode ) - - - - QProgressBar - qprogressbar.html - - Direction - Direction-enum - - - - Alignment - alignment-prop - - - - Orientation - orientation-prop - - - - QProgressBar - QProgressBar - ( QWidget * parent = 0 ) - - - reset - reset - () - - - setRange - setRange - ( int minimum, int maximum ) - - - valueChanged - valueChanged - ( int value ) - - - - QProgressDialog - qprogressdialog.html - - QProgressDialog - QProgressDialog - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - QProgressDialog - QProgressDialog-2 - ( const QString & labelText, const QString & cancelButtonText, int minimum, int maximum, QWidget * parent = 0, Qt::WFlags f = 0 ) - - - cancel - cancel - () - - - canceled - canceled - () - - - forceShow - forceShow - () - - - reset - reset - () - - - setBar - setBar - ( QProgressBar * bar ) - - - setCancelButton - setCancelButton - ( QPushButton * cancelButton ) - - - setCancelButtonText - setCancelButtonText - ( const QString & cancelButtonText ) - - - setLabel - setLabel - ( QLabel * label ) - - - setRange - setRange - ( int minimum, int maximum ) - - - sizeHint - sizeHint - () - - - - QProxyModel - qproxymodel.html - - QProxyModel - QProxyModel - ( QObject * parent = 0 ) - - - columnCount - columnCount - ( const QModelIndex & parent ) - - - data - data - ( const QModelIndex & index, int role ) - - - dropMimeData - dropMimeData - ( const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent ) - - - fetchMore - fetchMore - ( const QModelIndex & parent ) - - - ItemFlags - flags - QProxyModel::flags( const QModelIndex & index ) - - - hasChildren - hasChildren - ( const QModelIndex & parent ) - - - headerData - headerData - ( int section, Qt::Orientation orientation, int role ) - - - index - index - ( int row, int column, const QModelIndex & parent ) - - - insertColumns - insertColumns - ( int column, int count, const QModelIndex & parent ) - - - insertRows - insertRows - ( int row, int count, const QModelIndex & parent ) - - - match - match - ( const QModelIndex & start, int role, const QVariant & value, int hits, Qt::MatchFlags flags ) - - - mimeData - mimeData - ( const QModelIndexList & indexes ) - - - mimeTypes - mimeTypes - () - - - model - model - () - - - parent - parent - ( const QModelIndex & child ) - - - revert - revert - () - - - rowCount - rowCount - ( const QModelIndex & parent ) - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role ) - - - setHeaderData - setHeaderData - ( int section, Qt::Orientation orientation, const QVariant & value, int role ) - - - setModel - setModel - ( QAbstractItemModel * model ) - - - sort - sort - ( int column, Qt::SortOrder order ) - - - span - span - ( const QModelIndex & index ) - - - submit - submit - () - - - DropActions - supportedDropActions - QProxyModel::supportedDropActions() - - - - QPushButton - qpushbutton.html - - QPushButton - QPushButton - ( QWidget * parent = 0 ) - - - QPushButton - QPushButton-2 - ( const QString & text, QWidget * parent = 0 ) - - - QPushButton - QPushButton-3 - ( const QIcon & icon, const QString & text, QWidget * parent = 0 ) - - - menu - menu - () - - - setMenu - setMenu - ( QMenu * menu ) - - - showMenu - showMenu - () - - - QPushButton - QPushButton-4 - ( QWidget * parent, const char * name ) - - - QPushButton - QPushButton-5 - ( const QString & text, QWidget * parent, const char * name ) - - - QPushButton - QPushButton-6 - ( const QIcon & icon, const QString & text, QWidget * parent, const char * name ) - - - isMenuButton - isMenuButton - () - - - openPopup - openPopup - () - - - popup - popup - () - - - setPopup - setPopup - ( QMenu * popup ) - - - - QQueue - qqueue.html - - QQueue - QQueue - () - - - dequeue - dequeue - () - - - enqueue - enqueue - ( const T & t ) - - - head - head - () - - - head - head-2 - () - - - - QRadialGradient - qradialgradient.html - - QRadialGradient - QRadialGradient - ( const QPointF & center, qreal radius, const QPointF & focalPoint = QPointF() - - - QRadialGradient - QRadialGradient-2 - ( qreal cx, qreal cy, qreal radius, qreal fx = 0, qreal fy = 0 ) - - - center - center - () - - - focalPoint - focalPoint - () - - - radius - radius - () - - - - QRadioButton - qradiobutton.html - - QRadioButton - QRadioButton - ( QWidget * parent = 0 ) - - - QRadioButton - QRadioButton-2 - ( const QString & text, QWidget * parent = 0 ) - - - QRadioButton - QRadioButton-3 - ( QWidget * parent, const char * name ) - - - QRadioButton - QRadioButton-4 - ( const QString & text, QWidget * parent, const char * name ) - - - - QReadLocker - qreadlocker.html - - QReadLocker - QReadLocker - ( QReadWriteLock * lock ) - - - readWriteLock - readWriteLock - () - - - relock - relock - () - - - unlock - unlock - () - - - - QReadWriteLock - qreadwritelock.html - - QReadWriteLock - QReadWriteLock - () - - - lockForRead - lockForRead - () - - - lockForWrite - lockForWrite - () - - - tryLockForRead - tryLockForRead - () - - - tryLockForWrite - tryLockForWrite - () - - - unlock - unlock - () - - - - QRectF - qrectf.html - - QRectF - QRectF - () - - - QRectF - QRectF-2 - ( const QPointF & topLeft, const QSizeF & size ) - - - QRectF - QRectF-3 - ( qreal x, qreal y, qreal width, qreal height ) - - - QRectF - QRectF-4 - ( const QRect & rectangle ) - - - adjust - adjust - ( qreal dx1, qreal dy1, qreal dx2, qreal dy2 ) - - - adjusted - adjusted - ( qreal dx1, qreal dy1, qreal dx2, qreal dy2 ) - - - bottom - bottom - () - - - bottomLeft - bottomLeft - () - - - bottomRight - bottomRight - () - - - center - center - () - - - contains - contains - ( const QPointF & point ) - - - contains - contains-2 - ( qreal x, qreal y ) - - - contains - contains-3 - ( const QRectF & rectangle ) - - - getCoords - getCoords - ( qreal * x1, qreal * y1, qreal * x2, qreal * y2 ) - - - getRect - getRect - ( qreal * x, qreal * y, qreal * width, qreal * height ) - - - height - height - () - - - intersect - intersect - ( const QRectF & rectangle ) - - - intersects - intersects - ( const QRectF & rectangle ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - isValid - isValid - () - - - left - left - () - - - moveBottom - moveBottom - ( qreal y ) - - - moveBottomLeft - moveBottomLeft - ( const QPointF & position ) - - - moveBottomRight - moveBottomRight - ( const QPointF & position ) - - - moveCenter - moveCenter - ( const QPointF & position ) - - - moveLeft - moveLeft - ( qreal x ) - - - moveRight - moveRight - ( qreal x ) - - - moveTo - moveTo - ( qreal x, qreal y ) - - - moveTo - moveTo-2 - ( const QPointF & position ) - - - moveTop - moveTop - ( qreal y ) - - - moveTopLeft - moveTopLeft - ( const QPointF & position ) - - - moveTopRight - moveTopRight - ( const QPointF & position ) - - - normalized - normalized - () - - - right - right - () - - - setBottom - setBottom - ( qreal y ) - - - setBottomLeft - setBottomLeft - ( const QPointF & position ) - - - setBottomRight - setBottomRight - ( const QPointF & position ) - - - setCoords - setCoords - ( qreal x1, qreal y1, qreal x2, qreal y2 ) - - - setHeight - setHeight - ( qreal height ) - - - setLeft - setLeft - ( qreal x ) - - - setRect - setRect - ( qreal x, qreal y, qreal width, qreal height ) - - - setRight - setRight - ( qreal x ) - - - setSize - setSize - ( const QSizeF & size ) - - - setTop - setTop - ( qreal y ) - - - setTopLeft - setTopLeft - ( const QPointF & position ) - - - setTopRight - setTopRight - ( const QPointF & position ) - - - setWidth - setWidth - ( qreal width ) - - - setX - setX - ( qreal x ) - - - setY - setY - ( qreal y ) - - - size - size - () - - - toRect - toRect - () - - - top - top - () - - - topLeft - topLeft - () - - - topRight - topRight - () - - - translate - translate - ( qreal dx, qreal dy ) - - - translate - translate-2 - ( const QPointF & offset ) - - - translated - translated - ( qreal dx, qreal dy ) - - - translated - translated-2 - ( const QPointF & offset ) - - - unite - unite - ( const QRectF & rectangle ) - - - width - width - () - - - x - x - () - - - y - y - () - - - operator& - operator-and - amp;( const QRectF & rectangle ) - - - operator& - operator-and-eq - amp;=( const QRectF & rectangle ) - - - operator| - operator-7c - ( const QRectF & rectangle ) - - - operator|= - operator-7c-eq - ( const QRectF & rectangle ) - - - - QRect - qrect.html - - QRect - QRect - () - - - QRect - QRect-2 - ( const QPoint & topLeft, const QPoint & bottomRight ) - - - QRect - QRect-3 - ( const QPoint & topLeft, const QSize & size ) - - - QRect - QRect-4 - ( int x, int y, int width, int height ) - - - adjust - adjust - ( int dx1, int dy1, int dx2, int dy2 ) - - - adjusted - adjusted - ( int dx1, int dy1, int dx2, int dy2 ) - - - bottom - bottom - () - - - bottomLeft - bottomLeft - () - - - bottomRight - bottomRight - () - - - center - center - () - - - contains - contains - ( const QPoint & point, bool proper = false ) - - - contains - contains-2 - ( int x, int y, bool proper ) - - - contains - contains-3 - ( int x, int y ) - - - contains - contains-4 - ( const QRect & rectangle, bool proper = false ) - - - getCoords - getCoords - ( int * x1, int * y1, int * x2, int * y2 ) - - - getRect - getRect - ( int * x, int * y, int * width, int * height ) - - - height - height - () - - - intersect - intersect - ( const QRect & rectangle ) - - - intersects - intersects - ( const QRect & rectangle ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - isValid - isValid - () - - - left - left - () - - - moveBottom - moveBottom - ( int y ) - - - moveBottomLeft - moveBottomLeft - ( const QPoint & position ) - - - moveBottomRight - moveBottomRight - ( const QPoint & position ) - - - moveCenter - moveCenter - ( const QPoint & position ) - - - moveLeft - moveLeft - ( int x ) - - - moveRight - moveRight - ( int x ) - - - moveTo - moveTo - ( int x, int y ) - - - moveTo - moveTo-2 - ( const QPoint & position ) - - - moveTop - moveTop - ( int y ) - - - moveTopLeft - moveTopLeft - ( const QPoint & position ) - - - moveTopRight - moveTopRight - ( const QPoint & position ) - - - normalized - normalized - () - - - right - right - () - - - setBottom - setBottom - ( int y ) - - - setBottomLeft - setBottomLeft - ( const QPoint & position ) - - - setBottomRight - setBottomRight - ( const QPoint & position ) - - - setCoords - setCoords - ( int x1, int y1, int x2, int y2 ) - - - setHeight - setHeight - ( int height ) - - - setLeft - setLeft - ( int x ) - - - setRect - setRect - ( int x, int y, int width, int height ) - - - setRight - setRight - ( int x ) - - - setSize - setSize - ( const QSize & size ) - - - setTop - setTop - ( int y ) - - - setTopLeft - setTopLeft - ( const QPoint & position ) - - - setTopRight - setTopRight - ( const QPoint & position ) - - - setWidth - setWidth - ( int width ) - - - setX - setX - ( int x ) - - - setY - setY - ( int y ) - - - size - size - () - - - top - top - () - - - topLeft - topLeft - () - - - topRight - topRight - () - - - translate - translate - ( int dx, int dy ) - - - translate - translate-2 - ( const QPoint & offset ) - - - translated - translated - ( int dx, int dy ) - - - translated - translated-2 - ( const QPoint & offset ) - - - unite - unite - ( const QRect & rectangle ) - - - width - width - () - - - x - x - () - - - y - y - () - - - operator& - operator-and - amp;( const QRect & rectangle ) - - - operator& - operator-and-eq - amp;=( const QRect & rectangle ) - - - operator| - operator-7c - ( const QRect & rectangle ) - - - operator|= - operator-7c-eq - ( const QRect & rectangle ) - - - addCoords - addCoords - ( int dx1, int dy1, int dx2, int dy2 ) - - - coords - coords - ( int * x1, int * y1, int * x2, int * y2 ) - - - moveBy - moveBy - ( int dx, int dy ) - - - moveBy - moveBy-2 - ( const QPoint & p ) - - - normalize - normalize - () - - - rBottom - rBottom - () - - - rLeft - rLeft - () - - - rRight - rRight - () - - - rTop - rTop - () - - - rect - rect - ( int * x, int * y, int * width, int * height ) - - - - QRegExp - qregexp.html - - CaretMode - CaretMode-enum - - - - PatternSyntax - PatternSyntax-enum - - - - QRegExp - QRegExp - () - - - QRegExp - QRegExp-2 - ( const QString & pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive, PatternSyntax syntax = RegExp ) - - - QRegExp - QRegExp-3 - ( const QRegExp & rx ) - - - cap - cap - ( int nth = 0 ) - - - capturedTexts - capturedTexts - () - - - CaseSensitivity - caseSensitivity - QRegExp::caseSensitivity() - - - errorString - errorString - () - - - escape - escape - ( const QString & str ) - - - exactMatch - exactMatch - ( const QString & str ) - - - indexIn - indexIn - ( const QString & str, int offset = 0, CaretMode caretMode = CaretAtZero ) - - - isEmpty - isEmpty - () - - - isMinimal - isMinimal - () - - - isValid - isValid - () - - - lastIndexIn - lastIndexIn - ( const QString & str, int offset = -1, CaretMode caretMode = CaretAtZero ) - - - matchedLength - matchedLength - () - - - numCaptures - numCaptures - () - - - pattern - pattern - () - - - patternSyntax - patternSyntax - () - - - pos - pos - ( int nth = 0 ) - - - setCaseSensitivity - setCaseSensitivity - ( Qt::CaseSensitivity cs ) - - - setMinimal - setMinimal - ( bool minimal ) - - - setPattern - setPattern - ( const QString & pattern ) - - - setPatternSyntax - setPatternSyntax - ( PatternSyntax syntax ) - - - operator!= - operator-not-eq - ( const QRegExp & rx ) - - - operator= - operator-eq - ( const QRegExp & rx ) - - - operator== - operator-eq-eq - ( const QRegExp & rx ) - - - QRegExp - QRegExp-4 - ( const QString & pattern, bool cs, bool wildcard = false ) - - - caseSensitive - caseSensitive - () - - - minimal - minimal - () - - - search - search - ( const QString & str, int from = 0, CaretMode caretMode = CaretAtZero ) - - - searchRev - searchRev - ( const QString & str, int from = -1, CaretMode caretMode = CaretAtZero ) - - - setCaseSensitive - setCaseSensitive - ( bool sensitive ) - - - setWildcard - setWildcard - ( bool wildcard ) - - - wildcard - wildcard - () - - - - QRegExpValidator - qregexpvalidator.html - - QRegExpValidator - QRegExpValidator - ( QObject * parent ) - - - QRegExpValidator - QRegExpValidator-2 - ( const QRegExp & rx, QObject * parent ) - - - State - validate - QRegExpValidator::validate( QString & input, int & pos ) - - - QRegExpValidator - QRegExpValidator-3 - ( QObject * parent, const char * name ) - - - QRegExpValidator - QRegExpValidator-4 - ( const QRegExp & rx, QObject * parent, const char * name ) - - - - QRegion - qregion.html - - RegionType - RegionType-enum - - - - QRegion - QRegion - () - - - QRegion - QRegion-2 - ( int x, int y, int w, int h, RegionType t = Rectangle ) - - - QRegion - QRegion-3 - ( const QPolygon & a, Qt::FillRule fillRule = Qt::OddEvenFill ) - - - QRegion - QRegion-5 - ( const QRegion & r ) - - - QRegion - QRegion-6 - ( const QBitmap & bm ) - - - QRegion - QRegion-7 - ( const QRect & r, RegionType t = Rectangle ) - - - boundingRect - boundingRect - () - - - contains - contains - ( const QPoint & p ) - - - contains - contains-2 - ( const QRect & r ) - - - eor - eor - ( const QRegion & r ) - - - handle - handle - () - - - handle - handle-2 - () - - - handle - handle-3 - () - - - intersect - intersect - ( const QRegion & r ) - - - isEmpty - isEmpty - () - - - rects - rects - () - - - subtract - subtract - ( const QRegion & r ) - - - translate - translate - ( int dx, int dy ) - - - translate - translate-2 - ( const QPoint & point ) - - - translated - translated - ( int dx, int dy ) - - - translated - translated-2 - ( const QPoint & p ) - - - unite - unite - ( const QRegion & r ) - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QRegion & other ) - - - operator& - operator-and - amp;( const QRegion & r ) - - - operator& - operator-and-eq - amp;=( const QRegion & r ) - - - operator+ - operator-2b - ( const QRegion & r ) - - - operator+= - operator-2b-eq - ( const QRegion & r ) - - - operator- - operator- - ( const QRegion & r ) - - - operator-= - operator--eq - ( const QRegion & r ) - - - operator= - operator-eq - ( const QRegion & r ) - - - operator== - operator-eq-eq - ( const QRegion & r ) - - - operator^ - operator-5e - ( const QRegion & r ) - - - operator^= - operator-5e-eq - ( const QRegion & r ) - - - operator| - operator-7c - ( const QRegion & r ) - - - operator|= - operator-7c-eq - ( const QRegion & r ) - - - QRegion - QRegion-4 - ( const QPolygon & pa, bool winding ) - - - isNull - isNull - () - - - - QResizeEvent - qresizeevent.html - - QResizeEvent - QResizeEvent - ( const QSize & size, const QSize & oldSize ) - - - oldSize - oldSize - () - - - size - size - () - - - - QRubberBand - qrubberband.html - - Shape - Shape-enum - - - - QRubberBand - QRubberBand - ( Shape s, QWidget * p = 0 ) - - - move - move - ( int x, int y ) - - - move - move-2 - ( const QPoint & p ) - - - resize - resize - ( int width, int height ) - - - resize - resize-2 - ( const QSize & size ) - - - setGeometry - setGeometry - ( const QRect & rect ) - - - setGeometry - setGeometry-2 - ( int x, int y, int width, int height ) - - - shape - shape - () - - - - QScreenCursor - qscreencursor.html - - - QScreenDriverFactory - qscreendriverfactory.html - - create - create - ( const QString & key, int displayId ) - - - keys - keys - () - - - - QScreenDriverPlugin - qscreendriverplugin.html - - QScreenDriverPlugin - QScreenDriverPlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key, int displayId ) - - - keys - keys - () - - - - QScreen - qscreen.html - - PixelType - PixelType-enum - - - - QScreen - QScreen - ( int displayId ) - - - alloc - alloc - ( unsigned int red, unsigned int green, unsigned int blue ) - - - base - base - () - - - blank - blank - ( bool on ) - - - blit - blit - ( const QImage & image, const QPoint & topLeft, const QRegion & region ) - - - clut - clut - () - - - connect - connect - ( const QString & displaySpec ) - - - depth - depth - () - - - deviceHeight - deviceHeight - () - - - deviceWidth - deviceWidth - () - - - disconnect - disconnect - () - - - exposeRegion - exposeRegion - ( QRegion region, int windowIndex ) - - - height - height - () - - - initDevice - initDevice - () - - - isInterlaced - isInterlaced - () - - - isTransformed - isTransformed - () - - - lastOp - lastOp - () - - - linestep - linestep - () - - - mapFromDevice - mapFromDevice - ( const QSize & size ) - - - mapFromDevice - mapFromDevice-2 - ( const QPoint & point, const QSize & screenSize ) - - - mapFromDevice - mapFromDevice-3 - ( const QRect & rectangle, const QSize & screenSize ) - - - mapFromDevice - mapFromDevice-4 - ( const QImage & image ) - - - mapFromDevice - mapFromDevice-5 - ( const QRegion & region, const QSize & screenSize ) - - - mapToDevice - mapToDevice - ( const QSize & size ) - - - mapToDevice - mapToDevice-2 - ( const QPoint & point, const QSize & screenSize ) - - - mapToDevice - mapToDevice-3 - ( const QRect & rectangle, const QSize & screenSize ) - - - mapToDevice - mapToDevice-4 - ( const QImage & image ) - - - mapToDevice - mapToDevice-5 - ( const QRegion & region, const QSize & screenSize ) - - - numCols - numCols - () - - - onCard - onCard - ( const unsigned char * buffer ) - - - onCard - onCard-2 - ( const unsigned char * buffer, ulong & offset ) - - - opType - opType - () - - - pixelType - pixelType - () - - - pixmapDepth - pixmapDepth - () - - - pixmapLinestepAlignment - pixmapLinestepAlignment - () - - - pixmapOffsetAlignment - pixmapOffsetAlignment - () - - - restore - restore - () - - - save - save - () - - - screenSize - screenSize - () - - - setDirty - setDirty - ( const QRect & rectangle ) - - - setMode - setMode - ( int width, int height, int depth ) - - - shutdownDevice - shutdownDevice - () - - - solidFill - solidFill - ( const QColor & color, const QRegion & region ) - - - supportsDepth - supportsDepth - ( int depth ) - - - totalSize - totalSize - () - - - transformOrientation - transformOrientation - () - - - width - width - () - - - - QScrollArea - qscrollarea.html - - QScrollArea - QScrollArea - ( QWidget * parent = 0 ) - - - ensureVisible - ensureVisible - ( int x, int y, int xmargin = 50, int ymargin = 50 ) - - - setWidget - setWidget - ( QWidget * widget ) - - - takeWidget - takeWidget - () - - - widget - widget - () - - - - QScrollBar - qscrollbar.html - - QScrollBar - QScrollBar - ( QWidget * parent = 0 ) - - - QScrollBar - QScrollBar-2 - ( Qt::Orientation orientation, QWidget * parent = 0 ) - - - QScrollBar - QScrollBar-3 - ( QWidget * parent, const char * name ) - - - QScrollBar - QScrollBar-4 - ( Qt::Orientation orientation, QWidget * parent, const char * name ) - - - QScrollBar - QScrollBar-5 - ( int minimum, int maximum, int lineStep, int pageStep, int value, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 ) - - - draggingSlider - draggingSlider - () - - - - QSemaphore - qsemaphore.html - - QSemaphore - QSemaphore - ( int n = 0 ) - - - acquire - acquire - ( int n = 1 ) - - - available - available - () - - - release - release - ( int n = 1 ) - - - tryAcquire - tryAcquire - ( int n = 1 ) - - - - QSessionManager - qsessionmanager.html - - RestartHint - RestartHint-enum - - - - allowsErrorInteraction - allowsErrorInteraction - () - - - allowsInteraction - allowsInteraction - () - - - cancel - cancel - () - - - discardCommand - discardCommand - () - - - isPhase2 - isPhase2 - () - - - release - release - () - - - requestPhase2 - requestPhase2 - () - - - restartCommand - restartCommand - () - - - restartHint - restartHint - () - - - sessionId - sessionId - () - - - sessionKey - sessionKey - () - - - setDiscardCommand - setDiscardCommand - ( const QStringList & list ) - - - setManagerProperty - setManagerProperty - ( const QString & name, const QStringList & value ) - - - setManagerProperty - setManagerProperty-2 - ( const QString & name, const QString & value ) - - - setRestartCommand - setRestartCommand - ( const QStringList & command ) - - - setRestartHint - setRestartHint - ( RestartHint hint ) - - - - QSet::const_iterator - qset-const-iterator.html - - const_iterator - const_iterator - () - - - const_iterator - const_iterator-3 - ( const const_iterator & other ) - - - operator!= - operator-not-eq - ( const const_iterator & other ) - - - operator* - operator-2a - () - - - operator+ - operator-2b - ( int j ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int j ) - - - operator- - operator- - ( int j ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int j ) - - - operator-& - operator--gt - gt;() - - - operator= - operator-eq - ( const const_iterator & other ) - - - operator== - operator-eq-eq - ( const const_iterator & other ) - - - - QSet - qset.html - - ConstIterator - ConstIterator-typedef - - - - QSet - QSet - () - - - QSet - QSet-2 - ( const QSet<T> & other ) - - - begin - begin - () - - - capacity - capacity - () - - - clear - clear - () - - - constBegin - constBegin - () - - - constEnd - constEnd - () - - - contains - contains - ( const T & value ) - - - count - count - () - - - empty - empty - () - - - end - end - () - - - fromList - fromList - ( const QList<T> & list ) - - - insert - insert - ( const T & value ) - - - intersect - intersect - ( const QSet<T> & other ) - - - isEmpty - isEmpty - () - - - remove - remove - ( const T & value ) - - - reserve - reserve - ( int size ) - - - size - size - () - - - squeeze - squeeze - () - - - subtract - subtract - ( const QSet<T> & other ) - - - toList - toList - () - - - unite - unite - ( const QSet<T> & other ) - - - values - values - () - - - operator!= - operator-not-eq - ( const QSet<T> & other ) - - - operator& - operator-and - amp;( const QSet<T> & other ) - - - operator& - operator-and-eq - amp;=( const QSet<T> & other ) - - - operator& - operator-and-eq-2 - amp;=( const T & value ) - - - operator+ - operator-2b - ( const QSet<T> & other ) - - - operator+= - operator-2b-eq - ( const QSet<T> & other ) - - - operator+= - operator-2b-eq-2 - ( const T & value ) - - - operator- - operator- - ( const QSet<T> & other ) - - - operator-= - operator--eq - ( const QSet<T> & other ) - - - operator-= - operator--eq-2 - ( const T & value ) - - - operator<< - operator-lt-lt - ( const T & value ) - - - operator= - operator-eq - ( const QSet<T> & other ) - - - operator== - operator-eq-eq - ( const QSet<T> & other ) - - - operator| - operator-7c - ( const QSet<T> & other ) - - - operator|= - operator-7c-eq - ( const QSet<T> & other ) - - - operator|= - operator-7c-eq-2 - ( const T & value ) - - - - QSetIterator - qsetiterator.html - - QSetIterator - QSetIterator - ( const QSet<T> & set ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - toBack - toBack - () - - - toFront - toFront - () - - - operator= - operator-eq - ( const QSet<T> & set ) - - - - QSettings - qsettings.html - - Format - Format-enum - - - - ReadFunc - ReadFunc-typedef - - - - Scope - Scope-enum - - - - SettingsMap - SettingsMap-typedef - - - - Status - Status-enum - - - - WriteFunc - WriteFunc-typedef - - - - QSettings - QSettings - ( const QString & organization, const QString & application = QString() - - - QSettings - QSettings-2 - ( Scope scope, const QString & organization, const QString & application = QString() - - - QSettings - QSettings-3 - ( Format format, Scope scope, const QString & organization, const QString & application = QString() - - - QSettings - QSettings-4 - ( const QString & fileName, Format format, QObject * parent = 0 ) - - - QSettings - QSettings-5 - ( QObject * parent = 0 ) - - - allKeys - allKeys - () - - - beginGroup - beginGroup - ( const QString & prefix ) - - - beginReadArray - beginReadArray - ( const QString & prefix ) - - - beginWriteArray - beginWriteArray - ( const QString & prefix, int size = -1 ) - - - childGroups - childGroups - () - - - childKeys - childKeys - () - - - clear - clear - () - - - contains - contains - ( const QString & key ) - - - endArray - endArray - () - - - endGroup - endGroup - () - - - fallbacksEnabled - fallbacksEnabled - () - - - fileName - fileName - () - - - group - group - () - - - isWritable - isWritable - () - - - registerFormat - registerFormat - ( const QString & extension, ReadFunc readFunc, WriteFunc writeFunc, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive ) - - - remove - remove - ( const QString & key ) - - - setArrayIndex - setArrayIndex - ( int i ) - - - setFallbacksEnabled - setFallbacksEnabled - ( bool b ) - - - setPath - setPath - ( Format format, Scope scope, const QString & path ) - - - setValue - setValue - ( const QString & key, const QVariant & value ) - - - status - status - () - - - sync - sync - () - - - value - value - ( const QString & key, const QVariant & defaultValue = QVariant() - - - setSystemIniPath - setSystemIniPath - ( const QString & dir ) - - - setUserIniPath - setUserIniPath - ( const QString & dir ) - - - System - System-enum - - - - entryList - entryList - ( const QString & key ) - - - insertSearchPath - insertSearchPath - ( System system, const QString & path ) - - - readBoolEntry - readBoolEntry - ( const QString & key, bool defaultValue = false, bool * ok = 0 ) - - - readDoubleEntry - readDoubleEntry - ( const QString & key, double defaultValue = 0, bool * ok = 0 ) - - - readEntry - readEntry - ( const QString & key, const QString & defaultValue = QString() - - - readListEntry - readListEntry - ( const QString & key, bool * ok = 0 ) - - - readListEntry - readListEntry-2 - ( const QString & key, QChar separator, bool * ok = 0 ) - - - readNumEntry - readNumEntry - ( const QString & key, int defaultValue = 0, bool * ok = 0 ) - - - removeEntry - removeEntry - ( const QString & key ) - - - removeSearchPath - removeSearchPath - ( System system, const QString & path ) - - - resetGroup - resetGroup - () - - - setPath - setPath-2 - ( const QString & organization, const QString & application, Scope scope = Global ) - - - subkeyList - subkeyList - ( const QString & key ) - - - writeEntry - writeEntry - ( const QString & key, bool value ) - - - writeEntry - writeEntry-2 - ( const QString & key, double value ) - - - writeEntry - writeEntry-3 - ( const QString & key, int value ) - - - writeEntry - writeEntry-4 - ( const QString & key, const char * value ) - - - writeEntry - writeEntry-5 - ( const QString & key, const QString & value ) - - - writeEntry - writeEntry-6 - ( const QString & key, const QStringList & value ) - - - writeEntry - writeEntry-7 - ( const QString & key, const QStringList & value, QChar separator ) - - - - QSharedData - qshareddata.html - - QSharedData - QSharedData - () - - - QSharedData - QSharedData-2 - ( const QSharedData & other ) - - - - QSharedDataPointer - qshareddatapointer.html - - QSharedDataPointer - QSharedDataPointer - () - - - QSharedDataPointer - QSharedDataPointer-2 - ( T * sharedData ) - - - QSharedDataPointer - QSharedDataPointer-3 - ( const QSharedDataPointer<T> & other ) - - - constData - constData - () - - - data - data - () - - - data - data-2 - () - - - detach - detach - () - - - operator - operator-T--2a - T *() - - - operator - operator-const-T--2a - const T *() - - - operator! - operator-not - () - - - operator!= - operator-not-eq - ( const QSharedDataPointer<T> & other ) - - - operator* - operator-2a - () - - - operator* - operator-2a-2 - () - - - operator-& - operator--gt - gt;() - - - operator-& - operator--gt-2 - gt;() - - - operator= - operator-eq - ( const QSharedDataPointer<T> & other ) - - - operator= - operator-eq-2 - ( T * sharedData ) - - - operator== - operator-eq-eq - ( const QSharedDataPointer<T> & other ) - - - - QShortcutEvent - qshortcutevent.html - - QShortcutEvent - QShortcutEvent - ( const QKeySequence & key, int id, bool ambiguous = false ) - - - isAmbiguous - isAmbiguous - () - - - key - key - () - - - shortcutId - shortcutId - () - - - - QShortcut - qshortcut.html - - ShortcutContext - context-prop - - - - QShortcut - QShortcut - ( QWidget * parent ) - - - QShortcut - QShortcut-2 - ( const QKeySequence & key, QWidget * parent, const char * member = 0, const char * ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut ) - - - activated - activated - () - - - activatedAmbiguously - activatedAmbiguously - () - - - id - id - () - - - parentWidget - parentWidget - () - - - - QShowEvent - qshowevent.html - - QShowEvent - QShowEvent - () - - - - QSignalMapper - qsignalmapper.html - - QSignalMapper - QSignalMapper - ( QObject * parent = 0 ) - - - map - map - () - - - map - map-2 - ( QObject * sender ) - - - mapped - mapped - ( int i ) - - - mapped - mapped-2 - ( const QString & text ) - - - mapped - mapped-3 - ( QWidget * widget ) - - - mapped - mapped-4 - ( QObject * object ) - - - mapping - mapping - ( int id ) - - - mapping - mapping-2 - ( const QString & id ) - - - mapping - mapping-3 - ( QWidget * widget ) - - - mapping - mapping-4 - ( QObject * object ) - - - removeMappings - removeMappings - ( QObject * sender ) - - - setMapping - setMapping - ( QObject * sender, int id ) - - - setMapping - setMapping-2 - ( QObject * sender, const QString & text ) - - - setMapping - setMapping-3 - ( QObject * sender, QWidget * widget ) - - - setMapping - setMapping-4 - ( QObject * sender, QObject * object ) - - - QSignalMapper - QSignalMapper-2 - ( QObject * parent, const char * name ) - - - - QSignalSpy - qsignalspy.html - - QSignalSpy - QSignalSpy - ( QObject * object, const char * signal ) - - - isValid - isValid - () - - - signal - signal - () - - - - QSizeF - qsizef.html - - QSizeF - QSizeF - () - - - QSizeF - QSizeF-2 - ( const QSize & size ) - - - QSizeF - QSizeF-3 - ( qreal width, qreal height ) - - - boundedTo - boundedTo - ( const QSizeF & otherSize ) - - - expandedTo - expandedTo - ( const QSizeF & otherSize ) - - - height - height - () - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - isValid - isValid - () - - - rheight - rheight - () - - - rwidth - rwidth - () - - - scale - scale - ( qreal width, qreal height, Qt::AspectRatioMode mode ) - - - scale - scale-2 - ( const QSizeF & size, Qt::AspectRatioMode mode ) - - - setHeight - setHeight - ( qreal height ) - - - setWidth - setWidth - ( qreal width ) - - - toSize - toSize - () - - - transpose - transpose - () - - - width - width - () - - - operator*= - operator-2a-eq - ( qreal factor ) - - - operator+= - operator-2b-eq - ( const QSizeF & size ) - - - operator-= - operator--eq - ( const QSizeF & size ) - - - operator/= - operator-2f-eq - ( qreal divisor ) - - - - QSizeGrip - qsizegrip.html - - QSizeGrip - QSizeGrip - ( QWidget * parent ) - - - mouseMoveEvent - mouseMoveEvent - ( QMouseEvent * event ) - - - mousePressEvent - mousePressEvent - ( QMouseEvent * event ) - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - QSizeGrip - QSizeGrip-2 - ( QWidget * parent, const char * name ) - - - - QSize - qsize.html - - QSize - QSize - () - - - QSize - QSize-2 - ( int width, int height ) - - - boundedTo - boundedTo - ( const QSize & otherSize ) - - - expandedTo - expandedTo - ( const QSize & otherSize ) - - - height - height - () - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - isValid - isValid - () - - - rheight - rheight - () - - - rwidth - rwidth - () - - - scale - scale - ( int width, int height, Qt::AspectRatioMode mode ) - - - scale - scale-2 - ( const QSize & size, Qt::AspectRatioMode mode ) - - - setHeight - setHeight - ( int height ) - - - setWidth - setWidth - ( int width ) - - - transpose - transpose - () - - - width - width - () - - - operator*= - operator-2a-eq - ( qreal factor ) - - - operator+= - operator-2b-eq - ( const QSize & size ) - - - operator-= - operator--eq - ( const QSize & size ) - - - operator/= - operator-2f-eq - ( qreal divisor ) - - - - QSizePolicy - qsizepolicy.html - - Policy - Policy-enum - - - - PolicyFlag - PolicyFlag-enum - - - - QSizePolicy - QSizePolicy - () - - - QSizePolicy - QSizePolicy-2 - ( Policy horizontal, Policy vertical ) - - - Orientations - expandingDirections - QSizePolicy::expandingDirections() - - - hasHeightForWidth - hasHeightForWidth - () - - - horizontalPolicy - horizontalPolicy - () - - - horizontalStretch - horizontalStretch - () - - - setHeightForWidth - setHeightForWidth - ( bool dependent ) - - - setHorizontalPolicy - setHorizontalPolicy - ( Policy policy ) - - - setHorizontalStretch - setHorizontalStretch - ( uchar stretchFactor ) - - - setVerticalPolicy - setVerticalPolicy - ( Policy policy ) - - - setVerticalStretch - setVerticalStretch - ( uchar stretchFactor ) - - - transpose - transpose - () - - - verticalPolicy - verticalPolicy - () - - - verticalStretch - verticalStretch - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QSizePolicy & other ) - - - operator== - operator-eq-eq - ( const QSizePolicy & other ) - - - ExpandData - ExpandData-enum - - - - SizeType - SizeType-typedef - - - - QSizePolicy - QSizePolicy-3 - ( Policy horizontal, Policy vertical, bool dependent ) - - - QSizePolicy - QSizePolicy-4 - ( Policy horizontal, Policy vertical, uchar horizontalStretch, uchar verticalStretch, bool dependent = false ) - - - Orientations - expanding - QSizePolicy::expanding() - - - horData - horData - () - - - horStretch - horStretch - () - - - mayGrowHorizontally - mayGrowHorizontally - () - - - mayGrowVertically - mayGrowVertically - () - - - mayShrinkHorizontally - mayShrinkHorizontally - () - - - mayShrinkVertically - mayShrinkVertically - () - - - setHorData - setHorData - ( Policy policy ) - - - setHorStretch - setHorStretch - ( uchar stretch ) - - - setVerData - setVerData - ( Policy policy ) - - - setVerStretch - setVerStretch - ( uchar stretch ) - - - verData - verData - () - - - verStretch - verStretch - () - - - - QSlider - qslider.html - - TickPosition - TickPosition-enum - - - - QSlider - QSlider - ( QWidget * parent = 0 ) - - - QSlider - QSlider-2 - ( Qt::Orientation orientation, QWidget * parent = 0 ) - - - QSlider - QSlider-3 - ( QWidget * parent, const char * name ) - - - QSlider - QSlider-4 - ( Qt::Orientation orientation, QWidget * parent, const char * name ) - - - QSlider - QSlider-5 - ( int minValue, int maxValue, int pageStep, int value, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 ) - - - addStep - addStep - () - - - setTickmarks - setTickmarks - ( TickPosition position ) - - - subtractStep - subtractStep - () - - - tickmarks - tickmarks - () - - - - QSocketNotifier - qsocketnotifier.html - - Type - Type-enum - - - - QSocketNotifier - QSocketNotifier - ( int socket, Type type, QObject * parent = 0 ) - - - activated - activated - ( int socket ) - - - isEnabled - isEnabled - () - - - setEnabled - setEnabled - ( bool enable ) - - - socket - socket - () - - - type - type - () - - - QSocketNotifier - QSocketNotifier-2 - ( int socket, Type type, QObject * parent, const char * name ) - - - - QSortFilterProxyModel - qsortfilterproxymodel.html - - CaseSensitivity - filterCaseSensitivity-prop - - - - QSortFilterProxyModel - QSortFilterProxyModel - ( QObject * parent = 0 ) - - - clear - clear - () - - - filterAcceptsColumn - filterAcceptsColumn - ( int source_column, const QModelIndex & source_parent ) - - - filterAcceptsRow - filterAcceptsRow - ( int source_row, const QModelIndex & source_parent ) - - - lessThan - lessThan - ( const QModelIndex & left, const QModelIndex & right ) - - - mapFromSource - mapFromSource - ( const QModelIndex & sourceIndex ) - - - mapToSource - mapToSource - ( const QModelIndex & proxyIndex ) - - - setFilterFixedString - setFilterFixedString - ( const QString & pattern ) - - - setFilterWildcard - setFilterWildcard - ( const QString & pattern ) - - - - QSound - qsound.html - - QSound - QSound - ( const QString & filename, QObject * parent = 0 ) - - - fileName - fileName - () - - - isAvailable - isAvailable - () - - - isFinished - isFinished - () - - - loops - loops - () - - - loopsRemaining - loopsRemaining - () - - - play - play - ( const QString & filename ) - - - play - play-2 - () - - - setLoops - setLoops - ( int number ) - - - stop - stop - () - - - QSound - QSound-2 - ( const QString & filename, QObject * parent, const char * name ) - - - available - available - () - - - - QSpacerItem - qspaceritem.html - - QSpacerItem - QSpacerItem - ( int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum ) - - - changeSize - changeSize - ( int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum ) - - - isEmpty - isEmpty - () - - - spacerItem - spacerItem - () - - - - QSpinBox - qspinbox.html - - QSpinBox - QSpinBox - ( QWidget * parent = 0 ) - - - setRange - setRange - ( int min, int max ) - - - textFromValue - textFromValue - ( int v ) - - - valueChanged - valueChanged - ( int i ) - - - valueChanged - valueChanged-2 - ( const QString & text ) - - - valueFromText - valueFromText - ( const QString & text ) - - - QSpinBox - QSpinBox-2 - ( QWidget * parent, const char * name ) - - - QSpinBox - QSpinBox-3 - ( int min, int max, int step, QWidget * parent, const char * name = 0 ) - - - maxValue - maxValue - () - - - minValue - minValue - () - - - setLineStep - setLineStep - ( int step ) - - - setMaxValue - setMaxValue - ( int val ) - - - setMinValue - setMinValue - ( int val ) - - - - QSplashScreen - qsplashscreen.html - - QSplashScreen - QSplashScreen - ( const QPixmap & pixmap = QPixmap() - - - QSplashScreen - QSplashScreen-2 - ( QWidget * parent, const QPixmap & pixmap = QPixmap() - - - clearMessage - clearMessage - () - - - drawContents - drawContents - ( QPainter * painter ) - - - finish - finish - ( QWidget * mainWin ) - - - messageChanged - messageChanged - ( const QString & message ) - - - pixmap - pixmap - () - - - repaint - repaint - () - - - setPixmap - setPixmap - ( const QPixmap & pixmap ) - - - showMessage - showMessage - ( const QString & message, int alignment = Qt::AlignLeft, const QColor & color = Qt::black ) - - - clear - clear - () - - - message - message - ( const QString & message, int alignment = Qt::AlignLeft, const QColor & color = Qt::black ) - - - - QSplitterHandle - qsplitterhandle.html - - QSplitterHandle - QSplitterHandle - ( Qt::Orientation orientation, QSplitter * parent ) - - - closestLegalPosition - closestLegalPosition - ( int pos ) - - - moveSplitter - moveSplitter - ( int pos ) - - - opaqueResize - opaqueResize - () - - - Orientation - orientation - QSplitterHandle::orientation() - - - setOrientation - setOrientation - ( Qt::Orientation orientation ) - - - splitter - splitter - () - - - - QSplitter - qsplitter.html - - Orientation - orientation-prop - - - - QSplitter - QSplitter - ( QWidget * parent = 0 ) - - - QSplitter - QSplitter-2 - ( Qt::Orientation orientation, QWidget * parent = 0 ) - - - addWidget - addWidget - ( QWidget * widget ) - - - closestLegalPosition - closestLegalPosition - ( int pos, int index ) - - - count - count - () - - - createHandle - createHandle - () - - - getRange - getRange - ( int index, int * min, int * max ) - - - handle - handle - ( int index ) - - - indexOf - indexOf - ( QWidget * widget ) - - - insertWidget - insertWidget - ( int index, QWidget * widget ) - - - isCollapsible - isCollapsible - ( int index ) - - - moveSplitter - moveSplitter - ( int pos, int index ) - - - refresh - refresh - () - - - restoreState - restoreState - ( const QByteArray & state ) - - - saveState - saveState - () - - - setCollapsible - setCollapsible - ( int index, bool collapse ) - - - setRubberBand - setRubberBand - ( int pos ) - - - setSizes - setSizes - ( const QList<int> & list ) - - - setStretchFactor - setStretchFactor - ( int index, int stretch ) - - - sizes - sizes - () - - - splitterMoved - splitterMoved - ( int pos, int index ) - - - widget - widget - ( int index ) - - - ResizeMode - ResizeMode-enum - - - - QSplitter - QSplitter-3 - ( QWidget * parent, const char * name ) - - - QSplitter - QSplitter-4 - ( Qt::Orientation orientation, QWidget * parent, const char * name ) - - - moveToFirst - moveToFirst - ( QWidget * widget ) - - - moveToLast - moveToLast - ( QWidget * widget ) - - - setCollapsible - setCollapsible-2 - ( QWidget * widget, bool collapsible ) - - - setResizeMode - setResizeMode - ( QWidget * widget, ResizeMode mode ) - - - - QSqlDatabase - qsqldatabase.html - - QSqlDatabase - QSqlDatabase - () - - - QSqlDatabase - QSqlDatabase-2 - ( const QSqlDatabase & other ) - - - QSqlDatabase - QSqlDatabase-3 - ( const QString & type ) - - - QSqlDatabase - QSqlDatabase-4 - ( QSqlDriver * driver ) - - - addDatabase - addDatabase - ( const QString & type, const QString & connectionName = QLatin1String( defaultConnection ) - - - addDatabase - addDatabase-2 - ( QSqlDriver * driver, const QString & connectionName = QLatin1String( defaultConnection ) - - - cloneDatabase - cloneDatabase - ( const QSqlDatabase & other, const QString & connectionName ) - - - close - close - () - - - commit - commit - () - - - connectOptions - connectOptions - () - - - connectionNames - connectionNames - () - - - contains - contains - ( const QString & connectionName = QLatin1String( defaultConnection ) - - - database - database - ( const QString & connectionName = QLatin1String( defaultConnection ) - - - databaseName - databaseName - () - - - driver - driver - () - - - driverName - driverName - () - - - drivers - drivers - () - - - exec - exec - ( const QString & query = QString() - - - hostName - hostName - () - - - isDriverAvailable - isDriverAvailable - ( const QString & name ) - - - isOpen - isOpen - () - - - isOpenError - isOpenError - () - - - isValid - isValid - () - - - lastError - lastError - () - - - open - open - () - - - open - open-2 - ( const QString & user, const QString & password ) - - - password - password - () - - - port - port - () - - - primaryIndex - primaryIndex - ( const QString & tablename ) - - - record - record - ( const QString & tablename ) - - - registerSqlDriver - registerSqlDriver - ( const QString & name, QSqlDriverCreatorBase * creator ) - - - removeDatabase - removeDatabase - ( const QString & connectionName ) - - - rollback - rollback - () - - - setConnectOptions - setConnectOptions - ( const QString & options = QString() - - - setDatabaseName - setDatabaseName - ( const QString & name ) - - - setHostName - setHostName - ( const QString & host ) - - - setPassword - setPassword - ( const QString & password ) - - - setPort - setPort - ( int port ) - - - setUserName - setUserName - ( const QString & name ) - - - tables - tables - ( QSql::TableType type = QSql::Tables ) - - - transaction - transaction - () - - - userName - userName - () - - - operator= - operator-eq - ( const QSqlDatabase & other ) - - - record - record-2 - ( const QSqlQuery & query ) - - - recordInfo - recordInfo - ( const QString & tablename ) - - - recordInfo - recordInfo-2 - ( const QSqlQuery & query ) - - - - QSqlDriverCreatorBase - qsqldrivercreatorbase.html - - createObject - createObject - () - - - - QSqlDriverCreator - qsqldrivercreator.html - - - QSqlDriver - qsqldriver.html - - DriverFeature - DriverFeature-enum - - - - IdentifierType - IdentifierType-enum - - - - StatementType - StatementType-enum - - - - QSqlDriver - QSqlDriver - ( QObject * parent = 0 ) - - - beginTransaction - beginTransaction - () - - - close - close - () - - - commitTransaction - commitTransaction - () - - - createResult - createResult - () - - - escapeIdentifier - escapeIdentifier - ( const QString & identifier, IdentifierType type ) - - - formatValue - formatValue-2 - ( const QSqlField & field, bool trimStrings = false ) - - - handle - handle - () - - - hasFeature - hasFeature - ( DriverFeature feature ) - - - isOpen - isOpen - () - - - isOpenError - isOpenError - () - - - lastError - lastError - () - - - open - open - ( const QString & db, const QString & user = QString() - - - primaryIndex - primaryIndex - ( const QString & tableName ) - - - record - record - ( const QString & tableName ) - - - rollbackTransaction - rollbackTransaction - () - - - setLastError - setLastError - ( const QSqlError & error ) - - - setOpen - setOpen - ( bool open ) - - - setOpenError - setOpenError - ( bool error ) - - - sqlStatement - sqlStatement - ( StatementType type, const QString & tableName, const QSqlRecord & rec, bool preparedStatement ) - - - tables - tables - ( QSql::TableType tableType ) - - - - QSqlDriverPlugin - qsqldriverplugin.html - - QSqlDriverPlugin - QSqlDriverPlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key ) - - - keys - keys - () - - - formatValue - formatValue - ( const QSqlField * field, bool trimStrings = false ) - - - nullText - nullText - () - - - record - record-2 - ( const QSqlQuery & query ) - - - recordInfo - recordInfo - ( const QString & tablename ) - - - recordInfo - recordInfo-2 - ( const QSqlQuery & query ) - - - - QSqlError - qsqlerror.html - - ErrorType - ErrorType-enum - - - - QSqlError - QSqlError - ( const QString & driverText = QString() - - - QSqlError - QSqlError-2 - ( const QSqlError & other ) - - - databaseText - databaseText - () - - - driverText - driverText - () - - - isValid - isValid - () - - - number - number - () - - - setDatabaseText - setDatabaseText - ( const QString & databaseText ) - - - setDriverText - setDriverText - ( const QString & driverText ) - - - setNumber - setNumber - ( int number ) - - - setType - setType - ( ErrorType type ) - - - text - text - () - - - type - type - () - - - operator= - operator-eq - ( const QSqlError & other ) - - - - QSqlField - qsqlfield.html - - RequiredStatus - RequiredStatus-enum - - - - QSqlField - QSqlField - ( const QString & fieldName = QString() - - - QSqlField - QSqlField-2 - ( const QSqlField & other ) - - - clear - clear - () - - - defaultValue - defaultValue - () - - - isAutoValue - isAutoValue - () - - - isGenerated - isGenerated - () - - - isNull - isNull - () - - - isReadOnly - isReadOnly - () - - - isValid - isValid - () - - - length - length - () - - - name - name - () - - - precision - precision - () - - - requiredStatus - requiredStatus - () - - - setAutoValue - setAutoValue - ( bool autoVal ) - - - setDefaultValue - setDefaultValue - ( const QVariant & value ) - - - setGenerated - setGenerated - ( bool gen ) - - - setLength - setLength - ( int fieldLength ) - - - setName - setName - ( const QString & name ) - - - setPrecision - setPrecision - ( int precision ) - - - setReadOnly - setReadOnly - ( bool readOnly ) - - - setRequired - setRequired - ( bool required ) - - - setRequiredStatus - setRequiredStatus - ( RequiredStatus required ) - - - setType - setType - ( QVariant::Type type ) - - - setValue - setValue - ( const QVariant & value ) - - - Type - type - QSqlField::type() - - - value - value - () - - - operator!= - operator-not-eq - ( const QSqlField & other ) - - - operator= - operator-eq - ( const QSqlField & other ) - - - operator== - operator-eq-eq - ( const QSqlField & other ) - - - setNull - setNull - () - - - Location - Location-enum - - - - TableType - TableType-enum - - - - - QSqlIndex - qsqlindex.html - - QSqlIndex - QSqlIndex - ( const QString & cursorname = QString() - - - QSqlIndex - QSqlIndex-2 - ( const QSqlIndex & other ) - - - append - append - ( const QSqlField & field ) - - - append - append-2 - ( const QSqlField & field, bool desc ) - - - cursorName - cursorName - () - - - isDescending - isDescending - ( int i ) - - - name - name - () - - - setCursorName - setCursorName - ( const QString & cursorName ) - - - setDescending - setDescending - ( int i, bool desc ) - - - setName - setName - ( const QString & name ) - - - operator= - operator-eq - ( const QSqlIndex & other ) - - - toString - toString - ( const QString & prefix = QString() - - - toStringList - toStringList - ( const QString & prefix = QString() - - - Confirm - Confirm-enum - - - - Op - Op-enum - - - - - QSqlQuery - qsqlquery.html - - QSqlQuery - QSqlQuery - ( QSqlResult * result ) - - - QSqlQuery - QSqlQuery-2 - ( const QString & query = QString() - - - QSqlQuery - QSqlQuery-3 - ( QSqlDatabase db ) - - - QSqlQuery - QSqlQuery-4 - ( const QSqlQuery & other ) - - - addBindValue - addBindValue - ( const QVariant & val, QSql::ParamType paramType = QSql::In ) - - - at - at - () - - - bindValue - bindValue - ( const QString & placeholder, const QVariant & val, QSql::ParamType paramType = QSql::In ) - - - bindValue - bindValue-2 - ( int pos, const QVariant & val, QSql::ParamType paramType = QSql::In ) - - - boundValue - boundValue - ( const QString & placeholder ) - - - boundValue - boundValue-2 - ( int pos ) - - - boundValues - boundValues - () - - - clear - clear - () - - - driver - driver - () - - - exec - exec - ( const QString & query ) - - - exec - exec-2 - () - - - executedQuery - executedQuery - () - - - first - first - () - - - isActive - isActive - () - - - isForwardOnly - isForwardOnly - () - - - isNull - isNull - ( int field ) - - - isSelect - isSelect - () - - - isValid - isValid - () - - - last - last - () - - - lastError - lastError - () - - - lastInsertId - lastInsertId - () - - - lastQuery - lastQuery - () - - - next - next - () - - - numRowsAffected - numRowsAffected - () - - - prepare - prepare - ( const QString & query ) - - - previous - previous - () - - - record - record - () - - - result - result - () - - - seek - seek - ( int index, bool relative = false ) - - - setForwardOnly - setForwardOnly - ( bool forward ) - - - size - size - () - - - value - value - ( int index ) - - - operator= - operator-eq - ( const QSqlQuery & other ) - - - - QSqlQueryModel - qsqlquerymodel.html - - QSqlQueryModel - QSqlQueryModel - ( QObject * parent = 0 ) - - - canFetchMore - canFetchMore - ( const QModelIndex & parent = QModelIndex() - - - clear - clear - () - - - data - data - ( const QModelIndex & item, int role = Qt::DisplayRole ) - - - fetchMore - fetchMore - ( const QModelIndex & parent = QModelIndex() - - - headerData - headerData - ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) - - - indexInQuery - indexInQuery - ( const QModelIndex & item ) - - - insertColumns - insertColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - lastError - lastError - () - - - query - query - () - - - queryChange - queryChange - () - - - record - record - ( int row ) - - - record - record-2 - () - - - removeColumns - removeColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - rowCount - rowCount - ( const QModelIndex & parent = QModelIndex() - - - setHeaderData - setHeaderData - ( int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole ) - - - setLastError - setLastError - ( const QSqlError & error ) - - - setQuery - setQuery - ( const QSqlQuery & query ) - - - setQuery - setQuery-2 - ( const QString & query, const QSqlDatabase & db = QSqlDatabase() - - - prev - prev - () - - - - QSqlRecord - qsqlrecord.html - - QSqlRecord - QSqlRecord - () - - - QSqlRecord - QSqlRecord-2 - ( const QSqlRecord & other ) - - - append - append - ( const QSqlField & field ) - - - clear - clear - () - - - clearValues - clearValues - () - - - contains - contains - ( const QString & name ) - - - count - count - () - - - field - field - ( int index ) - - - field - field-2 - ( const QString & name ) - - - fieldName - fieldName - ( int index ) - - - indexOf - indexOf - ( const QString & name ) - - - insert - insert - ( int pos, const QSqlField & field ) - - - isEmpty - isEmpty - () - - - isGenerated - isGenerated - ( const QString & name ) - - - isGenerated - isGenerated-2 - ( int index ) - - - isNull - isNull - ( const QString & name ) - - - isNull - isNull-2 - ( int index ) - - - remove - remove - ( int pos ) - - - replace - replace - ( int pos, const QSqlField & field ) - - - setGenerated - setGenerated - ( const QString & name, bool generated ) - - - setGenerated - setGenerated-2 - ( int index, bool generated ) - - - setNull - setNull - ( int index ) - - - setNull - setNull-2 - ( const QString & name ) - - - setValue - setValue - ( int index, const QVariant & val ) - - - setValue - setValue-2 - ( const QString & name, const QVariant & val ) - - - value - value - ( int index ) - - - value - value-2 - ( const QString & name ) - - - operator!= - operator-not-eq - ( const QSqlRecord & other ) - - - operator= - operator-eq - ( const QSqlRecord & other ) - - - operator== - operator-eq-eq - ( const QSqlRecord & other ) - - - fieldPtr - fieldPtr - ( int index ) - - - fieldPtr - fieldPtr-2 - ( const QString & name ) - - - position - position - ( const QString & name ) - - - toString - toString - ( const QString & prefix = QString() - - - toStringList - toStringList - ( const QString & prefix = QString() - - - - QSqlRelationalDelegate - qsqlrelationaldelegate.html - - QSqlRelationalDelegate - QSqlRelationalDelegate - ( QObject * parent = 0 ) - - - - QSqlRelationalTableModel - qsqlrelationaltablemodel.html - - QSqlRelationalTableModel - QSqlRelationalTableModel - ( QObject * parent = 0, QSqlDatabase db = QSqlDatabase() - - - relation - relation - ( int column ) - - - relationModel - relationModel - ( int column ) - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) - - - setRelation - setRelation - ( int column, const QSqlRelation & relation ) - - - - QSqlRelation - qsqlrelation.html - - QSqlRelation - QSqlRelation - () - - - QSqlRelation - QSqlRelation-2 - ( const QString & tableName, const QString & indexColumn, const QString & displayColumn ) - - - displayColumn - displayColumn - () - - - indexColumn - indexColumn - () - - - isValid - isValid - () - - - tableName - tableName - () - - - - QSqlResult - qsqlresult.html - - BindingSyntax - BindingSyntax-enum - - - - QSqlResult - QSqlResult - ( const QSqlDriver * db ) - - - addBindValue - addBindValue - ( const QVariant & val, QSql::ParamType paramType ) - - - at - at - () - - - bindValue - bindValue - ( int index, const QVariant & val, QSql::ParamType paramType ) - - - bindValue - bindValue-2 - ( const QString & placeholder, const QVariant & val, QSql::ParamType paramType ) - - - ParamType - bindValueType - QSqlResult::bindValueType( int index ) - - - ParamType - bindValueType-2 - QSqlResult::bindValueType( const QString & placeholder ) - - - bindingSyntax - bindingSyntax - () - - - boundValue - boundValue - ( int index ) - - - boundValue - boundValue-2 - ( const QString & placeholder ) - - - boundValueCount - boundValueCount - () - - - boundValueName - boundValueName - ( int index ) - - - boundValues - boundValues - () - - - clear - clear - () - - - data - data - ( int index ) - - - driver - driver - () - - - exec - exec - () - - - executedQuery - executedQuery - () - - - fetch - fetch - ( int index ) - - - fetchFirst - fetchFirst - () - - - fetchLast - fetchLast - () - - - fetchNext - fetchNext - () - - - fetchPrevious - fetchPrevious - () - - - handle - handle - () - - - hasOutValues - hasOutValues - () - - - isActive - isActive - () - - - isForwardOnly - isForwardOnly - () - - - isNull - isNull - ( int index ) - - - isSelect - isSelect - () - - - isValid - isValid - () - - - lastError - lastError - () - - - lastInsertId - lastInsertId - () - - - lastQuery - lastQuery - () - - - numRowsAffected - numRowsAffected - () - - - prepare - prepare - ( const QString & query ) - - - record - record - () - - - reset - reset - ( const QString & query ) - - - savePrepare - savePrepare - ( const QString & query ) - - - setActive - setActive - ( bool active ) - - - setAt - setAt - ( int index ) - - - setForwardOnly - setForwardOnly - ( bool forward ) - - - setLastError - setLastError - ( const QSqlError & error ) - - - setQuery - setQuery - ( const QString & query ) - - - setSelect - setSelect - ( bool select ) - - - size - size - () - - - - QSqlTableModel - qsqltablemodel.html - - EditStrategy - EditStrategy-enum - - - - QSqlTableModel - QSqlTableModel - ( QObject * parent = 0, QSqlDatabase db = QSqlDatabase() - - - beforeDelete - beforeDelete - ( int row ) - - - beforeInsert - beforeInsert - ( QSqlRecord & record ) - - - beforeUpdate - beforeUpdate - ( int row, QSqlRecord & record ) - - - database - database - () - - - deleteRowFromTable - deleteRowFromTable - ( int row ) - - - editStrategy - editStrategy - () - - - fieldIndex - fieldIndex - ( const QString & fieldName ) - - - filter - filter - () - - - indexInQuery - indexInQuery - ( const QModelIndex & item ) - - - insertRecord - insertRecord - ( int row, const QSqlRecord & record ) - - - insertRowIntoTable - insertRowIntoTable - ( const QSqlRecord & values ) - - - insertRows - insertRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - isDirty - isDirty - ( const QModelIndex & index ) - - - orderByClause - orderByClause - () - - - primaryKey - primaryKey - () - - - primeInsert - primeInsert - ( int row, QSqlRecord & record ) - - - removeColumns - removeColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - removeRows - removeRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - revert - revert - () - - - revertAll - revertAll - () - - - revertRow - revertRow - ( int row ) - - - select - select - () - - - selectStatement - selectStatement - () - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) - - - setEditStrategy - setEditStrategy - ( EditStrategy strategy ) - - - setFilter - setFilter - ( const QString & filter ) - - - setPrimaryKey - setPrimaryKey - ( const QSqlIndex & key ) - - - setQuery - setQuery - ( const QSqlQuery & query ) - - - setRecord - setRecord - ( int row, const QSqlRecord & record ) - - - setSort - setSort - ( int column, Qt::SortOrder order ) - - - setTable - setTable - ( const QString & tableName ) - - - sort - sort - ( int column, Qt::SortOrder order ) - - - submit - submit - () - - - submitAll - submitAll - () - - - tableName - tableName - () - - - updateRowInTable - updateRowInTable - ( int row, const QSqlRecord & values ) - - - - QStackedLayout - qstackedlayout.html - - QStackedLayout - QStackedLayout - () - - - QStackedLayout - QStackedLayout-2 - ( QWidget * parent ) - - - QStackedLayout - QStackedLayout-3 - ( QLayout * parentLayout ) - - - addWidget - addWidget - ( QWidget * widget ) - - - currentChanged - currentChanged - ( int index ) - - - currentWidget - currentWidget - () - - - insertWidget - insertWidget - ( int index, QWidget * widget ) - - - setCurrentWidget - setCurrentWidget - ( QWidget * widget ) - - - widget - widget - ( int index ) - - - widgetRemoved - widgetRemoved - ( int index ) - - - - QStackedWidget - qstackedwidget.html - - QStackedWidget - QStackedWidget - ( QWidget * parent = 0 ) - - - addWidget - addWidget - ( QWidget * widget ) - - - currentChanged - currentChanged - ( int index ) - - - currentWidget - currentWidget - () - - - indexOf - indexOf - ( QWidget * widget ) - - - insertWidget - insertWidget - ( int index, QWidget * widget ) - - - removeWidget - removeWidget - ( QWidget * widget ) - - - setCurrentWidget - setCurrentWidget - ( QWidget * widget ) - - - widget - widget - ( int index ) - - - widgetRemoved - widgetRemoved - ( int index ) - - - - QStack - qstack.html - - QStack - QStack - () - - - pop - pop - () - - - push - push - ( const T & t ) - - - top - top - () - - - top - top-2 - () - - - - QStandardItemModel - qstandarditemmodel.html - - QStandardItemModel - QStandardItemModel - ( QObject * parent = 0 ) - - - QStandardItemModel - QStandardItemModel-2 - ( int rows, int columns, QObject * parent = 0 ) - - - clear - clear - () - - - columnCount - columnCount - ( const QModelIndex & parent = QModelIndex() - - - data - data - ( const QModelIndex & index, int role = Qt::DisplayRole ) - - - ItemFlags - flags - QStandardItemModel::flags( const QModelIndex & index ) - - - hasChildren - hasChildren - ( const QModelIndex & parent = QModelIndex() - - - index - index - ( int row, int column, const QModelIndex & parent = QModelIndex() - - - insertColumns - insertColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - insertRows - insertRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - parent - parent - ( const QModelIndex & child ) - - - removeColumns - removeColumns - ( int column, int count, const QModelIndex & parent = QModelIndex() - - - removeRows - removeRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - rowCount - rowCount - ( const QModelIndex & parent = QModelIndex() - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) - - - - QStatusBar - qstatusbar.html - - QStatusBar - QStatusBar - ( QWidget * parent = 0 ) - - - addPermanentWidget - addPermanentWidget - ( QWidget * widget, int stretch = 0 ) - - - addWidget - addWidget - ( QWidget * widget, int stretch = 0 ) - - - clearMessage - clearMessage - () - - - currentMessage - currentMessage - () - - - hideOrShow - hideOrShow - () - - - messageChanged - messageChanged - ( const QString & message ) - - - reformat - reformat - () - - - removeWidget - removeWidget - ( QWidget * widget ) - - - showMessage - showMessage - ( const QString & message, int timeout = 0 ) - - - QStatusBar - QStatusBar-2 - ( QWidget * parent, const char * name ) - - - addWidget - addWidget-2 - ( QWidget * widget, int stretch, bool permanent ) - - - clear - clear - () - - - message - message - ( const QString & message, int timeout = 0 ) - - - - QStatusTipEvent - qstatustipevent.html - - QStatusTipEvent - QStatusTipEvent - ( const QString & tip ) - - - tip - tip - () - - - - QString - qstring.html - - NormalizationForm - NormalizationForm-enum - - - - SplitBehavior - SplitBehavior-enum - - - - QString - QString - () - - - QString - QString-2 - ( const QChar * unicode, int size ) - - - QString - QString-3 - ( QChar ch ) - - - QString - QString-4 - ( int size, QChar ch ) - - - QString - QString-5 - ( const QLatin1String & str ) - - - QString - QString-6 - ( const QString & other ) - - - QString - QString-7 - ( const char * str ) - - - QString - QString-8 - ( const QByteArray & ba ) - - - append - append - ( const QString & str ) - - - append - append-2 - ( const QLatin1String & str ) - - - append - append-3 - ( const QByteArray & ba ) - - - append - append-4 - ( const char * str ) - - - append - append-5 - ( QChar ch ) - - - arg - arg - ( const QString & a, int fieldWidth = 0, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-2 - ( const QString & a1, const QString & a2 ) - - - arg - arg-3 - ( const QString & a1, const QString & a2, const QString & a3 ) - - - arg - arg-4 - ( const QString & a1, const QString & a2, const QString & a3, const QString & a4 ) - - - arg - arg-5 - ( int a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-6 - ( uint a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-7 - ( long a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-8 - ( ulong a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-9 - ( qlonglong a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-10 - ( qulonglong a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-11 - ( short a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-12 - ( ushort a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-13 - ( QChar a, int fieldWidth = 0, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-14 - ( char a, int fieldWidth = 0, const QChar & fillChar = QLatin1Char( ' ' ) - - - arg - arg-15 - ( double a, int fieldWidth = 0, char fmt = 'g', int prec = -1, const QChar & fillChar = QLatin1Char( ' ' ) - - - at - at - ( int i ) - - - capacity - capacity - () - - - chop - chop - ( int n ) - - - clear - clear - () - - - compare - compare - ( const QString & s1, const QString & s2 ) - - - compare - compare-2 - ( const QString & other ) - - - constData - constData - () - - - contains - contains - ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - contains - contains-4 - ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - contains - contains-5 - ( const QRegExp & rx ) - - - count - count - ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - count - count-2 - ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - count - count-3 - ( const QRegExp & rx ) - - - count - count-4 - () - - - data - data - () - - - data - data-2 - () - - - endsWith - endsWith - ( const QString & s, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - endsWith - endsWith-3 - ( const QLatin1String & s, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - endsWith - endsWith-4 - ( const QChar & c, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - fill - fill - ( QChar ch, int size = -1 ) - - - fromAscii - fromAscii - ( const char * str, int size = -1 ) - - - fromLatin1 - fromLatin1 - ( const char * str, int size = -1 ) - - - fromLocal8Bit - fromLocal8Bit - ( const char * str, int size = -1 ) - - - fromRawData - fromRawData - ( const QChar * unicode, int size ) - - - fromStdString - fromStdString - ( const std::string & str ) - - - fromStdWString - fromStdWString - ( const std::wstring & str ) - - - fromUtf8 - fromUtf8 - ( const char * str, int size = -1 ) - - - fromUtf16 - fromUtf16 - ( const ushort * unicode, int size = -1 ) - - - indexOf - indexOf - ( const QString & str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - indexOf - indexOf-2 - ( QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - indexOf - indexOf-3 - ( const QRegExp & rx, int from = 0 ) - - - insert - insert - ( int i, const QString & str ) - - - insert - insert-2 - ( int i, const QLatin1String & str ) - - - insert - insert-3 - ( int i, const QChar * unicode, int size ) - - - insert - insert-4 - ( int i, QChar ch ) - - - isEmpty - isEmpty - () - - - isNull - isNull - () - - - lastIndexOf - lastIndexOf - ( const QString & str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - lastIndexOf - lastIndexOf-2 - ( QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - lastIndexOf - lastIndexOf-3 - ( const QRegExp & rx, int from = -1 ) - - - left - left - ( int len ) - - - leftJustified - leftJustified - ( int width, QChar fill = QLatin1Char( ' ' ) - - - length - length - () - - - localeAwareCompare - localeAwareCompare - ( const QString & s1, const QString & s2 ) - - - localeAwareCompare - localeAwareCompare-2 - ( const QString & other ) - - - mid - mid - ( int i, int len = -1 ) - - - normalized - normalized - ( NormalizationForm form ) - - - normalized - normalized-2 - ( NormalizationForm form, QChar::UnicodeVersion version ) - - - number - number - ( long n, int base = 10 ) - - - number - number-2 - ( ulong n, int base = 10 ) - - - number - number-3 - ( int n, int base = 10 ) - - - number - number-4 - ( uint n, int base = 10 ) - - - number - number-5 - ( qlonglong n, int base = 10 ) - - - number - number-6 - ( qulonglong n, int base = 10 ) - - - number - number-7 - ( double n, char f = 'g', int prec = 6 ) - - - prepend - prepend - ( const QString & str ) - - - prepend - prepend-2 - ( const QLatin1String & str ) - - - prepend - prepend-3 - ( const QByteArray & ba ) - - - prepend - prepend-4 - ( const char * str ) - - - prepend - prepend-5 - ( QChar ch ) - - - push_back - push_back - ( const QString & other ) - - - push_back - push_back-2 - ( QChar ch ) - - - push_front - push_front - ( const QString & other ) - - - push_front - push_front-2 - ( QChar ch ) - - - remove - remove - ( int pos, int len ) - - - remove - remove-4 - ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - remove - remove-5 - ( QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - remove - remove-6 - ( const QRegExp & rx ) - - - replace - replace - ( int pos, int len, const QString & after ) - - - replace - replace-6 - ( int pos, int len, const QChar * unicode, int size ) - - - replace - replace-7 - ( int pos, int len, QChar after ) - - - replace - replace-8 - ( const QString & before, const QString & after, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - replace - replace-9 - ( QChar ch, const QString & after, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - replace - replace-10 - ( QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - replace - replace-11 - ( const QRegExp & rx, const QString & after ) - - - reserve - reserve - ( int size ) - - - resize - resize - ( int size ) - - - right - right - ( int len ) - - - rightJustified - rightJustified - ( int width, QChar fill = QLatin1Char( ' ' ) - - - section - section - ( QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault ) - - - section - section-2 - ( const QString & sep, int start, int end = -1, SectionFlags flags = SectionDefault ) - - - section - section-3 - ( const QRegExp & reg, int start, int end = -1, SectionFlags flags = SectionDefault ) - - - setNum - setNum - ( int n, int base = 10 ) - - - setNum - setNum-2 - ( uint n, int base = 10 ) - - - setNum - setNum-3 - ( long n, int base = 10 ) - - - setNum - setNum-4 - ( ulong n, int base = 10 ) - - - setNum - setNum-5 - ( qlonglong n, int base = 10 ) - - - setNum - setNum-6 - ( qulonglong n, int base = 10 ) - - - setNum - setNum-7 - ( short n, int base = 10 ) - - - setNum - setNum-8 - ( ushort n, int base = 10 ) - - - setNum - setNum-9 - ( double n, char f = 'g', int prec = 6 ) - - - setNum - setNum-10 - ( float n, char f = 'g', int prec = 6 ) - - - setUnicode - setUnicode - ( const QChar * unicode, int size ) - - - setUtf16 - setUtf16 - ( const ushort * unicode, int size ) - - - simplified - simplified - () - - - size - size - () - - - split - split - ( const QString & sep, SplitBehavior behavior = KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - split - split-2 - ( const QChar & sep, SplitBehavior behavior = KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - split - split-3 - ( const QRegExp & rx, SplitBehavior behavior = KeepEmptyParts ) - - - sprintf - sprintf - ( const char * cformat, ... ) - - - squeeze - squeeze - () - - - startsWith - startsWith - ( const QString & s, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - startsWith - startsWith-3 - ( const QLatin1String & s, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - startsWith - startsWith-4 - ( const QChar & c, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - toAscii - toAscii - () - - - toDouble - toDouble - ( bool * ok = 0 ) - - - toFloat - toFloat - ( bool * ok = 0 ) - - - toInt - toInt - ( bool * ok = 0, int base = 10 ) - - - toLatin1 - toLatin1 - () - - - toLocal8Bit - toLocal8Bit - () - - - toLong - toLong - ( bool * ok = 0, int base = 10 ) - - - toLongLong - toLongLong - ( bool * ok = 0, int base = 10 ) - - - toLower - toLower - () - - - toShort - toShort - ( bool * ok = 0, int base = 10 ) - - - string - toStdString - QString::toStdString() - - - wstring - toStdWString - QString::toStdWString() - - - toUInt - toUInt - ( bool * ok = 0, int base = 10 ) - - - toULong - toULong - ( bool * ok = 0, int base = 10 ) - - - toULongLong - toULongLong - ( bool * ok = 0, int base = 10 ) - - - toUShort - toUShort - ( bool * ok = 0, int base = 10 ) - - - toUpper - toUpper - () - - - toUtf8 - toUtf8 - () - - - trimmed - trimmed - () - - - truncate - truncate - ( int pos ) - - - unicode - unicode - () - - - utf16 - utf16 - () - - - vsprintf - vsprintf - ( const char * cformat, va_list ap ) - - - operator!= - operator-not-eq - ( const QString & other ) - - - operator!= - operator-not-eq-2 - ( const QLatin1String & other ) - - - operator!= - operator-not-eq-3 - ( const QByteArray & other ) - - - operator!= - operator-not-eq-4 - ( const char * other ) - - - operator+= - operator-2b-eq - ( const QString & other ) - - - operator+= - operator-2b-eq-2 - ( const QLatin1String & str ) - - - operator+= - operator-2b-eq-3 - ( const QByteArray & ba ) - - - operator+= - operator-2b-eq-4 - ( const char * str ) - - - operator+= - operator-2b-eq-5 - ( char ch ) - - - operator+= - operator-2b-eq-6 - ( QChar ch ) - - - operator< - operator-lt - ( const QString & other ) - - - operator< - operator-lt-2 - ( const QLatin1String & other ) - - - operator< - operator-lt-3 - ( const QByteArray & other ) - - - operator< - operator-lt-4 - ( const char * other ) - - - operator<= - operator-lt-eq - ( const QString & other ) - - - operator<= - operator-lt-eq-2 - ( const QLatin1String & other ) - - - operator<= - operator-lt-eq-3 - ( const QByteArray & other ) - - - operator<= - operator-lt-eq-4 - ( const char * other ) - - - operator= - operator-eq - ( const QString & other ) - - - operator= - operator-eq-3 - ( const QLatin1String & str ) - - - operator= - operator-eq-4 - ( const QByteArray & ba ) - - - operator= - operator-eq-5 - ( const char * str ) - - - operator= - operator-eq-6 - ( char ch ) - - - operator= - operator-eq-7 - ( QChar ch ) - - - operator== - operator-eq-eq - ( const QString & other ) - - - operator== - operator-eq-eq-2 - ( const QLatin1String & other ) - - - operator== - operator-eq-eq-3 - ( const QByteArray & other ) - - - operator== - operator-eq-eq-4 - ( const char * other ) - - - operator> - operator-gt - ( const QString & other ) - - - operator> - operator-gt-2 - ( const QLatin1String & other ) - - - operator> - operator-gt-3 - ( const QByteArray & other ) - - - operator> - operator-gt-4 - ( const char * other ) - - - operator>= - operator-gt-eq - ( const QString & other ) - - - operator>= - operator-gt-eq-2 - ( const QLatin1String & other ) - - - operator>= - operator-gt-eq-3 - ( const QByteArray & other ) - - - operator>= - operator-gt-eq-4 - ( const char * other ) - - - operator[] - operator-5b-5d - ( int i ) - - - operator[] - operator-5b-5d-2 - ( int i ) - - - operator[] - operator-5b-5d-3 - ( uint i ) - - - operator[] - operator-5b-5d-4 - ( uint i ) - - - - QStringList - qstringlist.html - - QStringList - QStringList - () - - - QStringList - QStringList-2 - ( const QString & str ) - - - QStringList - QStringList-3 - ( const QStringList & other ) - - - QStringList - QStringList-4 - ( const QList<QString> & other ) - - - contains - contains - ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - filter - filter - ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - filter - filter-2 - ( const QRegExp & rx ) - - - indexOf - indexOf - ( const QRegExp & rx, int from = 0 ) - - - join - join - ( const QString & sep ) - - - lastIndexOf - lastIndexOf - ( const QRegExp & rx, int from = -1 ) - - - replaceInStrings - replaceInStrings - ( const QString & before, const QString & after, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - replaceInStrings - replaceInStrings-2 - ( const QRegExp & rx, const QString & after ) - - - sort - sort - () - - - operator+ - operator-2b - ( const QStringList & other ) - - - operator<< - operator-lt-lt - ( const QString & str ) - - - operator<< - operator-lt-lt-2 - ( const QStringList & other ) - - - - QStringListModel - qstringlistmodel.html - - QStringListModel - QStringListModel - ( QObject * parent = 0 ) - - - QStringListModel - QStringListModel-2 - ( const QStringList & strings, QObject * parent = 0 ) - - - data - data - ( const QModelIndex & index, int role ) - - - ItemFlags - flags - QStringListModel::flags( const QModelIndex & index ) - - - insertRows - insertRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - removeRows - removeRows - ( int row, int count, const QModelIndex & parent = QModelIndex() - - - rowCount - rowCount - ( const QModelIndex & parent = QModelIndex() - - - setData - setData - ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) - - - setStringList - setStringList - ( const QStringList & strings ) - - - stringList - stringList - () - - - fromLast - fromLast - () - - - fromLast - fromLast-2 - () - - - grep - grep - ( const QString & str, bool cs = true ) - - - grep - grep-2 - ( const QRegExp & rx ) - - - gres - gres - ( const QRegExp & rx, const QString & after ) - - - gres - gres-2 - ( const QString & before, const QString & after, bool cs = true ) - - - split - split - ( const QRegExp & sep, const QString & str, bool allowEmptyEntries = false ) - - - split - split-2 - ( const QChar & sep, const QString & str, bool allowEmptyEntries = false ) - - - split - split-3 - ( const QString & sep, const QString & str, bool allowEmptyEntries = false ) - - - - QStringMatcher - qstringmatcher.html - - QStringMatcher - QStringMatcher - () - - - QStringMatcher - QStringMatcher-2 - ( const QString & pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive ) - - - QStringMatcher - QStringMatcher-3 - ( const QStringMatcher & other ) - - - CaseSensitivity - caseSensitivity - QStringMatcher::caseSensitivity() - - - indexIn - indexIn - ( const QString & str, int from = 0 ) - - - pattern - pattern - () - - - setCaseSensitivity - setCaseSensitivity - ( Qt::CaseSensitivity cs ) - - - setPattern - setPattern - ( const QString & pattern ) - - - operator= - operator-eq - ( const QStringMatcher & other ) - - - - QString::Null - qstring-null.html - - ascii - ascii - () - - - constref - constref - ( uint i ) - - - contains - contains-2 - ( QChar c, bool cs ) - - - contains - contains-3 - ( const QString & s, bool cs ) - - - copy - copy - () - - - endsWith - endsWith-2 - ( const QString & s, bool cs ) - - - find - find - ( QChar c, int i = 0, bool cs = true ) - - - find - find-2 - ( const QString & s, int i = 0, bool cs = true ) - - - find - find-3 - ( const QRegExp & rx, int i = 0 ) - - - findRev - findRev - ( QChar c, int i = -1, bool cs = true ) - - - findRev - findRev-2 - ( const QString & s, int i = -1, bool cs = true ) - - - findRev - findRev-3 - ( const QRegExp & rx, int i = -1 ) - - - fromUcs2 - fromUcs2 - ( const ushort * unicode, int size = -1 ) - - - latin1 - latin1 - () - - - leftJustify - leftJustify - ( int width, QChar fill = QLatin1Char( ' ' ) - - - local8Bit - local8Bit - () - - - lower - lower - () - - - ref - ref - ( uint i ) - - - remove - remove-2 - ( QChar c, bool cs ) - - - remove - remove-3 - ( const QString & s, bool cs ) - - - replace - replace-2 - ( QChar c, const QString & after, bool cs ) - - - replace - replace-3 - ( const QString & before, const QString & after, bool cs ) - - - replace - replace-4 - ( char c, const QString & after, bool cs ) - - - replace - replace-5 - ( char c, const QString & after, Qt::CaseSensitivity cs ) - - - rightJustify - rightJustify - ( int width, QChar fill = QLatin1Char( ' ' ) - - - setAscii - setAscii - ( const char * str, int len = -1 ) - - - setLatin1 - setLatin1 - ( const char * str, int len = -1 ) - - - setLength - setLength - ( int nl ) - - - setUnicodeCodes - setUnicodeCodes - ( const ushort * unicode_as_ushorts, int size ) - - - simplifyWhiteSpace - simplifyWhiteSpace - () - - - startsWith - startsWith-2 - ( const QString & s, bool cs ) - - - stripWhiteSpace - stripWhiteSpace - () - - - ucs2 - ucs2 - () - - - upper - upper - () - - - utf8 - utf8 - () - - - operator - operator-const-char--2a - const char *() - - - - QStyleFactory - qstylefactory.html - - create - create - ( const QString & key ) - - - keys - keys - () - - - - QStyleHintReturn - qstylehintreturn.html - - HintReturnType - HintReturnType-enum - - - - QStyleHintReturn - QStyleHintReturn - ( int version = QStyleOption::Version, int type = SH_Default ) - - - Type - Type-var - - - - Version - Version-var - - - - type - type-varx - - - - version - version-varx - - - - - QStyleHintReturnMask - qstylehintreturnmask.html - - QStyleHintReturnMask - QStyleHintReturnMask - () - - - Type - Type-var - - - - Version - Version-var - - - - region - region-var - - - - - QStyle - qstyle.html - - ComplexControl - ComplexControl-enum - - - - ContentsType - ContentsType-enum - - - - ControlElement - ControlElement-enum - - - - PixelMetric - PixelMetric-enum - - - - PrimitiveElement - PrimitiveElement-enum - - - - StandardPixmap - StandardPixmap-enum - - - - StyleHint - StyleHint-enum - - - - SubElement - SubElement-enum - - - - QStyle - QStyle-2 - () - - - alignedRect - alignedRect - ( Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize & size, const QRect & rectangle ) - - - drawComplexControl - drawComplexControl - ( ComplexControl control, const QStyleOptionComplex * option, QPainter * painter, const QWidget * widget = 0 ) - - - drawControl - drawControl - ( ControlElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0 ) - - - drawItemPixmap - drawItemPixmap - ( QPainter * painter, const QRect & rect, int alignment, const QPixmap & pixmap ) - - - drawItemText - drawItemText - ( QPainter * painter, const QRect & rect, int alignment, const QPalette & pal, bool enabled, const QString & text, QPalette::ColorRole textRole = QPalette::NoRole ) - - - drawPrimitive - drawPrimitive - ( PrimitiveElement elem, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0 ) - - - generatedIconPixmap - generatedIconPixmap - ( QIcon::Mode iconMode, const QPixmap & pixmap, const QStyleOption * option ) - - - hitTestComplexControl - hitTestComplexControl - ( ComplexControl control, const QStyleOptionComplex * option, const QPoint & pos, const QWidget * widget = 0 ) - - - itemPixmapRect - itemPixmapRect - ( const QRect & rect, int alignment, const QPixmap & pixmap ) - - - itemTextRect - itemTextRect - ( const QFontMetrics & metrics, const QRect & rect, int alignment, bool enabled, const QString & text ) - - - pixelMetric - pixelMetric - ( PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) - - - polish - polish - ( QWidget * widget ) - - - polish - polish-2 - ( QApplication * app ) - - - polish - polish-3 - ( QPalette & pal ) - - - sizeFromContents - sizeFromContents - ( ContentsType type, const QStyleOption * option, const QSize & contentsSize, const QWidget * widget = 0 ) - - - sliderPositionFromValue - sliderPositionFromValue - ( int min, int max, int logicalValue, int span, bool upsideDown = false ) - - - sliderValueFromPosition - sliderValueFromPosition - ( int min, int max, int pos, int span, bool upsideDown = false ) - - - standardIcon - standardIcon - ( StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) - - - standardIconImplementation - standardIconImplementation - ( StandardPixmap standardIcon, const QStyleOption * option = 0, const QWidget * widget = 0 ) - - - standardPalette - standardPalette - () - - - standardPixmap - standardPixmap - ( StandardPixmap standardPixmap, const QStyleOption * option = 0, const QWidget * widget = 0 ) - - - styleHint - styleHint - ( StyleHint hint, const QStyleOption * option = 0, const QWidget * widget = 0, QStyleHintReturn * returnData = 0 ) - - - subControlRect - subControlRect - ( ComplexControl control, const QStyleOptionComplex * option, SubControl subControl, const QWidget * widget = 0 ) - - - subElementRect - subElementRect - ( SubElement element, const QStyleOption * option, const QWidget * widget = 0 ) - - - unpolish - unpolish - ( QWidget * widget ) - - - unpolish - unpolish-2 - ( QApplication * app ) - - - Alignment - visualAlignment - QStyle::visualAlignment( Qt::LayoutDirection direction, Qt::Alignment alignment ) - - - visualPos - visualPos - ( Qt::LayoutDirection direction, const QRect & boundingRect, const QPoint & logicalPos ) - - - visualRect - visualRect - ( Qt::LayoutDirection direction, const QRect & boundingRect, const QRect & logicalRect ) - - - - QStyleOptionButton - qstyleoptionbutton.html - - QStyleOptionButton - QStyleOptionButton - () - - - QStyleOptionButton - QStyleOptionButton-2 - ( const QStyleOptionButton & other ) - - - Type - Type-var - - - - Version - Version-var - - - - features - features-var - - - - icon - icon-var - - - - iconSize - iconSize-var - - - - text - text-var - - - - - QStyleOptionComboBox - qstyleoptioncombobox.html - - QStyleOptionComboBox - QStyleOptionComboBox - () - - - QStyleOptionComboBox - QStyleOptionComboBox-2 - ( const QStyleOptionComboBox & other ) - - - Type - Type-var - - - - Version - Version-var - - - - currentIcon - currentIcon-var - - - - currentText - currentText-var - - - - editable - editable-var - - - - frame - frame-var - - - - iconSize - iconSize-var - - - - popupRect - popupRect-var - - - - - QStyleOptionComplex - qstyleoptioncomplex.html - - QStyleOptionComplex - QStyleOptionComplex - ( int version = QStyleOptionComplex::Version, int type = SO_Complex ) - - - QStyleOptionComplex - QStyleOptionComplex-2 - ( const QStyleOptionComplex & other ) - - - Type - Type-var - - - - Version - Version-var - - - - SubControls - activeSubControls-var - QStyleOptionComplex::activeSubControls - - - SubControls - subControls-var - QStyleOptionComplex::subControls - - - - QStyleOptionDockWidget - qstyleoptiondockwidget.html - - QStyleOptionDockWidget - QStyleOptionDockWidget - () - - - QStyleOptionDockWidget - QStyleOptionDockWidget-2 - ( const QStyleOptionDockWidget & other ) - - - Type - Type-var - - - - Version - Version-var - - - - closable - closable-var - - - - floatable - floatable-var - - - - movable - movable-var - - - - title - title-var - - - - - QStyleOptionFocusRect - qstyleoptionfocusrect.html - - QStyleOptionFocusRect - QStyleOptionFocusRect - () - - - QStyleOptionFocusRect - QStyleOptionFocusRect-2 - ( const QStyleOptionFocusRect & other ) - - - Type - Type-var - - - - Version - Version-var - - - - backgroundColor - backgroundColor-var - - - - - QStyleOptionFrame - qstyleoptionframe.html - - QStyleOptionFrame - QStyleOptionFrame - () - - - QStyleOptionFrame - QStyleOptionFrame-2 - ( const QStyleOptionFrame & other ) - - - Type - Type-var - - - - Version - Version-var - - - - lineWidth - lineWidth-var - - - - midLineWidth - midLineWidth-var - - - - - QStyleOptionFrameV2 - qstyleoptionframev2.html - - QStyleOptionFrameV2 - QStyleOptionFrameV2 - () - - - QStyleOptionFrameV2 - QStyleOptionFrameV2-2 - ( const QStyleOptionFrameV2 & other ) - - - QStyleOptionFrameV2 - QStyleOptionFrameV2-3 - ( const QStyleOptionFrame & other ) - - - operator= - operator-eq - ( const QStyleOptionFrame & other ) - - - - QStyleOptionGroupBox - qstyleoptiongroupbox.html - - QStyleOptionGroupBox - QStyleOptionGroupBox - () - - - QStyleOptionGroupBox - QStyleOptionGroupBox-2 - ( const QStyleOptionGroupBox & other ) - - - lineWidth - lineWidth-var - - - - midLineWidth - midLineWidth-var - - - - text - text-var - - - - Alignment - textAlignment-var - QStyleOptionGroupBox::textAlignment - - - textColor - textColor-var - - - - - QStyleOptionHeader - qstyleoptionheader.html - - SectionPosition - SectionPosition-enum - - - - SelectedPosition - SelectedPosition-enum - - - - SortIndicator - SortIndicator-enum - - - - QStyleOptionHeader - QStyleOptionHeader - () - - - QStyleOptionHeader - QStyleOptionHeader-2 - ( const QStyleOptionHeader & other ) - - - Type - Type-var - - - - Version - Version-var - - - - icon - icon-var - - - - Alignment - iconAlignment-var - QStyleOptionHeader::iconAlignment - - - Orientation - orientation-var - QStyleOptionHeader::orientation - - - position - position-var - - - - section - section-var - - - - selectedPosition - selectedPosition-var - - - - sortIndicator - sortIndicator-var - - - - text - text-var - - - - Alignment - textAlignment-var - QStyleOptionHeader::textAlignment - - - - QStyleOption - qstyleoption.html - - OptionType - OptionType-enum - - - - QStyleOption - QStyleOption - ( int version = QStyleOption::Version, int type = SO_Default ) - - - QStyleOption - QStyleOption-2 - ( const QStyleOption & other ) - - - initFrom - initFrom - ( const QWidget * widget ) - - - operator= - operator-eq - ( const QStyleOption & other ) - - - Type - Type-var - - - - Version - Version-var - - - - LayoutDirection - direction-var - QStyleOption::direction - - - fontMetrics - fontMetrics-var - - - - palette - palette-var - - - - rect - rect-var - - - - State - state-var - QStyleOption::state - - - type - type-varx - - - - version - version-varx - - - - - QStyleOptionMenuItem - qstyleoptionmenuitem.html - - CheckType - CheckType-enum - - - - MenuItemType - MenuItemType-enum - - - - QStyleOptionMenuItem - QStyleOptionMenuItem - () - - - QStyleOptionMenuItem - QStyleOptionMenuItem-2 - ( const QStyleOptionMenuItem & other ) - - - Type - Type-var - - - - Version - Version-var - - - - checkType - checkType-var - - - - checked - checked-var - - - - font - font-var - - - - icon - icon-var - - - - maxIconWidth - maxIconWidth-var - - - - menuHasCheckableItems - menuHasCheckableItems-var - - - - menuItemType - menuItemType-var - - - - menuRect - menuRect-var - - - - tabWidth - tabWidth-var - - - - text - text-var - - - - init - init - ( const QWidget * widget ) - - - - QStyleOptionProgressBar - qstyleoptionprogressbar.html - - QStyleOptionProgressBar - QStyleOptionProgressBar - () - - - QStyleOptionProgressBar - QStyleOptionProgressBar-2 - ( const QStyleOptionProgressBar & other ) - - - Type - Type-var - - - - Version - Version-var - - - - maximum - maximum-var - - - - minimum - minimum-var - - - - progress - progress-var - - - - text - text-var - - - - Alignment - textAlignment-var - QStyleOptionProgressBar::textAlignment - - - textVisible - textVisible-var - - - - - QStyleOptionProgressBarV2 - qstyleoptionprogressbarv2.html - - QStyleOptionProgressBarV2 - QStyleOptionProgressBarV2 - () - - - QStyleOptionProgressBarV2 - QStyleOptionProgressBarV2-2 - ( const QStyleOptionProgressBar & other ) - - - QStyleOptionProgressBarV2 - QStyleOptionProgressBarV2-3 - ( const QStyleOptionProgressBarV2 & other ) - - - operator= - operator-eq - ( const QStyleOptionProgressBar & other ) - - - bottomToTop - bottomToTop-var - - - - invertedAppearance - invertedAppearance-var - - - - Orientation - orientation-var - QStyleOptionProgressBarV2::orientation - - - - QStyleOptionQ3DockWindow - qstyleoptionq3dockwindow.html - - QStyleOptionQ3DockWindow - QStyleOptionQ3DockWindow - () - - - QStyleOptionQ3DockWindow - QStyleOptionQ3DockWindow-2 - ( const QStyleOptionQ3DockWindow & other ) - - - Type - Type-var - - - - Version - Version-var - - - - closeEnabled - closeEnabled-var - - - - docked - docked-var - - - - - QStyleOptionQ3ListView - qstyleoptionq3listview.html - - QStyleOptionQ3ListView - QStyleOptionQ3ListView - () - - - QStyleOptionQ3ListView - QStyleOptionQ3ListView-2 - ( const QStyleOptionQ3ListView & other ) - - - Type - Type-var - - - - Version - Version-var - - - - itemMargin - itemMargin-var - - - - items - items-var - - - - rootIsDecorated - rootIsDecorated-var - - - - sortColumn - sortColumn-var - - - - treeStepSize - treeStepSize-var - - - - ColorRole - viewportBGRole-var - QStyleOptionQ3ListView::viewportBGRole - - - viewportPalette - viewportPalette-var - - - - - QStyleOptionQ3ListViewItem - qstyleoptionq3listviewitem.html - - QStyleOptionQ3ListViewItem - QStyleOptionQ3ListViewItem - () - - - QStyleOptionQ3ListViewItem - QStyleOptionQ3ListViewItem-2 - ( const QStyleOptionQ3ListViewItem & other ) - - - Type - Type-var - - - - Version - Version-var - - - - childCount - childCount-var - - - - features - features-var - - - - height - height-var - - - - itemY - itemY-var - - - - totalHeight - totalHeight-var - - - - - QStyleOptionRubberBand - qstyleoptionrubberband.html - - QStyleOptionRubberBand - QStyleOptionRubberBand - () - - - QStyleOptionRubberBand - QStyleOptionRubberBand-2 - ( const QStyleOptionRubberBand & other ) - - - Type - Type-var - - - - Version - Version-var - - - - opaque - opaque-var - - - - Shape - shape-var - QStyleOptionRubberBand::shape - - - - QStyleOptionSlider - qstyleoptionslider.html - - QStyleOptionSlider - QStyleOptionSlider - () - - - QStyleOptionSlider - QStyleOptionSlider-2 - ( const QStyleOptionSlider & other ) - - - Type - Type-var - - - - Version - Version-var - - - - dialWrapping - dialWrapping-var - - - - maximum - maximum-var - - - - minimum - minimum-var - - - - notchTarget - notchTarget-var - - - - Orientation - orientation-var - QStyleOptionSlider::orientation - - - pageStep - pageStep-var - - - - singleStep - singleStep-var - - - - sliderPosition - sliderPosition-var - - - - sliderValue - sliderValue-var - - - - tickInterval - tickInterval-var - - - - TickPosition - tickPosition-var - QStyleOptionSlider::tickPosition - - - upsideDown - upsideDown-var - - - - - QStyleOptionSpinBox - qstyleoptionspinbox.html - - QStyleOptionSpinBox - QStyleOptionSpinBox - () - - - QStyleOptionSpinBox - QStyleOptionSpinBox-2 - ( const QStyleOptionSpinBox & other ) - - - Type - Type-var - - - - Version - Version-var - - - - ButtonSymbols - buttonSymbols-var - QStyleOptionSpinBox::buttonSymbols - - - frame - frame-var - - - - StepEnabled - stepEnabled-var - QStyleOptionSpinBox::stepEnabled - - - - QStyleOptionTabBarBase - qstyleoptiontabbarbase.html - - QStyleOptionTabBarBase - QStyleOptionTabBarBase - () - - - QStyleOptionTabBarBase - QStyleOptionTabBarBase-2 - ( const QStyleOptionTabBarBase & other ) - - - Type - Type-var - - - - Version - Version-var - - - - selectedTabRect - selectedTabRect-var - - - - Shape - shape-var - QStyleOptionTabBarBase::shape - - - tabBarRect - tabBarRect-var - - - - - QStyleOptionTab - qstyleoptiontab.html - - SelectedPosition - SelectedPosition-enum - - - - TabPosition - TabPosition-enum - - - - QStyleOptionTab - QStyleOptionTab - () - - - QStyleOptionTab - QStyleOptionTab-2 - ( const QStyleOptionTab & other ) - - - Type - Type-var - - - - Version - Version-var - - - - cornerWidgets - cornerWidgets-var - - - - icon - icon-var - - - - position - position-var - - - - row - row-var - - - - selectedPosition - selectedPosition-var - - - - Shape - shape-var - QStyleOptionTab::shape - - - text - text-var - - - - - QStyleOptionTabV2 - qstyleoptiontabv2.html - - QStyleOptionTabV2 - QStyleOptionTabV2 - () - - - QStyleOptionTabV2 - QStyleOptionTabV2-2 - ( const QStyleOptionTabV2 & other ) - - - QStyleOptionTabV2 - QStyleOptionTabV2-3 - ( const QStyleOptionTab & other ) - - - operator= - operator-eq - ( const QStyleOptionTab & other ) - - - iconSize - iconSize-var - - - - - QStyleOptionTabWidgetFrame - qstyleoptiontabwidgetframe.html - - QStyleOptionTabWidgetFrame - QStyleOptionTabWidgetFrame - () - - - QStyleOptionTabWidgetFrame - QStyleOptionTabWidgetFrame-2 - ( const QStyleOptionTabWidgetFrame & other ) - - - Type - Type-var - - - - Version - Version-var - - - - leftCornerWidgetSize - leftCornerWidgetSize-var - - - - lineWidth - lineWidth-var - - - - midLineWidth - midLineWidth-var - - - - rightCornerWidgetSize - rightCornerWidgetSize-var - - - - Shape - shape-var - QStyleOptionTabWidgetFrame::shape - - - tabBarSize - tabBarSize-var - - - - - QStyleOptionTitleBar - qstyleoptiontitlebar.html - - QStyleOptionTitleBar - QStyleOptionTitleBar - () - - - QStyleOptionTitleBar - QStyleOptionTitleBar-2 - ( const QStyleOptionTitleBar & other ) - - - Type - Type-var - - - - Version - Version-var - - - - icon - icon-var - - - - text - text-var - - - - WFlags - titleBarFlags-var - QStyleOptionTitleBar::titleBarFlags - - - titleBarState - titleBarState-var - - - - - QStyleOptionToolBar - qstyleoptiontoolbar.html - - ToolBarPosition - ToolBarPosition-enum - - - - QStyleOptionToolBar - QStyleOptionToolBar - () - - - QStyleOptionToolBar - QStyleOptionToolBar-2 - ( const QStyleOptionToolBar & other ) - - - features - features-var - - - - lineWidth - lineWidth-var - - - - midLineWidth - midLineWidth-var - - - - positionOfLine - positionOfLine-var - - - - positionWithinLine - positionWithinLine-var - - - - ToolBarArea - toolBarArea-var - QStyleOptionToolBar::toolBarArea - - - - QStyleOptionToolBox - qstyleoptiontoolbox.html - - QStyleOptionToolBox - QStyleOptionToolBox - () - - - QStyleOptionToolBox - QStyleOptionToolBox-2 - ( const QStyleOptionToolBox & other ) - - - Type - Type-var - - - - Version - Version-var - - - - icon - icon-var - - - - text - text-var - - - - - QStyleOptionToolButton - qstyleoptiontoolbutton.html - - QStyleOptionToolButton - QStyleOptionToolButton - () - - - QStyleOptionToolButton - QStyleOptionToolButton-2 - ( const QStyleOptionToolButton & other ) - - - Type - Type-var - - - - Version - Version-var - - - - ArrowType - arrowType-var - QStyleOptionToolButton::arrowType - - - features - features-var - - - - font - font-var - - - - icon - icon-var - - - - iconSize - iconSize-var - - - - pos - pos-var - - - - text - text-var - - - - ToolButtonStyle - toolButtonStyle-var - QStyleOptionToolButton::toolButtonStyle - - - - QStyleOptionViewItem - qstyleoptionviewitem.html - - Position - Position-enum - - - - QStyleOptionViewItem - QStyleOptionViewItem - () - - - QStyleOptionViewItem - QStyleOptionViewItem-2 - ( const QStyleOptionViewItem & other ) - - - Type - Type-var - - - - Version - Version-var - - - - Alignment - decorationAlignment-var - QStyleOptionViewItem::decorationAlignment - - - decorationPosition - decorationPosition-var - - - - decorationSize - decorationSize-var - - - - Alignment - displayAlignment-var - QStyleOptionViewItem::displayAlignment - - - font - font-var - - - - showDecorationSelected - showDecorationSelected-var - - - - TextElideMode - textElideMode-var - QStyleOptionViewItem::textElideMode - - - - QStylePainter - qstylepainter.html - - QStylePainter - QStylePainter - () - - - QStylePainter - QStylePainter-2 - ( QWidget * widget ) - - - QStylePainter - QStylePainter-3 - ( QPaintDevice * pd, QWidget * widget ) - - - begin - begin - ( QWidget * widget ) - - - begin - begin-2 - ( QPaintDevice * pd, QWidget * widget ) - - - drawComplexControl - drawComplexControl - ( QStyle::ComplexControl cc, const QStyleOptionComplex & option ) - - - drawControl - drawControl - ( QStyle::ControlElement ce, const QStyleOption & option ) - - - drawItemPixmap - drawItemPixmap - ( const QRect & rect, int flags, const QPixmap & pixmap ) - - - drawItemText - drawItemText - ( const QRect & rect, int flags, const QPalette & pal, bool enabled, const QString & text, QPalette::ColorRole textRole = QPalette::NoRole ) - - - drawPrimitive - drawPrimitive - ( QStyle::PrimitiveElement pe, const QStyleOption & option ) - - - style - style - () - - - - QStylePlugin - qstyleplugin.html - - QStylePlugin - QStylePlugin - ( QObject * parent = 0 ) - - - create - create - ( const QString & key ) - - - keys - keys - () - - - - QSvgRenderer - qsvgrenderer.html - - QSvgRenderer - QSvgRenderer - ( QObject * parent = 0 ) - - - QSvgRenderer - QSvgRenderer-2 - ( const QString & filename, QObject * parent = 0 ) - - - QSvgRenderer - QSvgRenderer-3 - ( const QByteArray & contents, QObject * parent = 0 ) - - - animated - animated - () - - - currentFrame - currentFrame - () - - - defaultSize - defaultSize - () - - - isValid - isValid - () - - - load - load - ( const QString & filename ) - - - load - load-2 - ( const QByteArray & contents ) - - - render - render - ( QPainter * painter ) - - - repaintNeeded - repaintNeeded - () - - - setCurrentFrame - setCurrentFrame - ( int ) - - - - QSvgWidget - qsvgwidget.html - - QSvgWidget - QSvgWidget - ( QWidget * parent = 0 ) - - - QSvgWidget - QSvgWidget-2 - ( const QString & file, QWidget * parent = 0 ) - - - load - load - ( const QString & file ) - - - load - load-2 - ( const QByteArray & contents ) - - - renderer - renderer - () - - - - QSyntaxHighlighter - qsyntaxhighlighter.html - - QSyntaxHighlighter - QSyntaxHighlighter - ( QObject * parent ) - - - QSyntaxHighlighter - QSyntaxHighlighter-2 - ( QTextDocument * parent ) - - - QSyntaxHighlighter - QSyntaxHighlighter-3 - ( QTextEdit * parent ) - - - currentBlockState - currentBlockState - () - - - currentBlockUserData - currentBlockUserData - () - - - document - document - () - - - format - format - ( int position ) - - - highlightBlock - highlightBlock - ( const QString & text ) - - - previousBlockState - previousBlockState - () - - - setCurrentBlockState - setCurrentBlockState - ( int newState ) - - - setCurrentBlockUserData - setCurrentBlockUserData - ( QTextBlockUserData * data ) - - - setDocument - setDocument - ( QTextDocument * doc ) - - - setFormat - setFormat - ( int start, int count, const QTextCharFormat & format ) - - - setFormat - setFormat-2 - ( int start, int count, const QColor & color ) - - - setFormat - setFormat-3 - ( int start, int count, const QFont & font ) - - - - QSysInfo - qsysinfo.html - - Endian - Endian-enum - - - - MacVersion - MacVersion-enum - - - - WinVersion - WinVersion-enum - - - - MacintoshVersion - MacintoshVersion-var - - - - WindowsVersion - WindowsVersion-var - - - - WordSize - WordSize-var - - - - - QTabBar - qtabbar.html - - Shape - Shape-enum - - - - QTabBar - QTabBar - ( QWidget * parent = 0 ) - - - addTab - addTab - ( const QString & text ) - - - addTab - addTab-2 - ( const QIcon & icon, const QString & text ) - - - currentChanged - currentChanged - ( int index ) - - - insertTab - insertTab - ( int index, const QString & text ) - - - insertTab - insertTab-2 - ( int index, const QIcon & icon, const QString & text ) - - - isTabEnabled - isTabEnabled - ( int index ) - - - removeTab - removeTab - ( int index ) - - - setTabData - setTabData - ( int index, const QVariant & data ) - - - setTabEnabled - setTabEnabled - ( int index, bool enabled ) - - - setTabIcon - setTabIcon - ( int index, const QIcon & icon ) - - - setTabText - setTabText - ( int index, const QString & text ) - - - setTabTextColor - setTabTextColor - ( int index, const QColor & color ) - - - setTabToolTip - setTabToolTip - ( int index, const QString & tip ) - - - setTabWhatsThis - setTabWhatsThis - ( int index, const QString & text ) - - - tabData - tabData - ( int index ) - - - tabIcon - tabIcon - ( int index ) - - - tabInserted - tabInserted - ( int index ) - - - tabLayoutChange - tabLayoutChange - () - - - tabRect - tabRect - ( int index ) - - - tabRemoved - tabRemoved - ( int index ) - - - tabSizeHint - tabSizeHint - ( int index ) - - - tabText - tabText - ( int index ) - - - tabTextColor - tabTextColor - ( int index ) - - - tabToolTip - tabToolTip - ( int index ) - - - tabWhatsThis - tabWhatsThis - ( int index ) - - - selected - selected - ( int index ) - - - setCurrentTab - setCurrentTab - ( int index ) - - - - QTabletEvent - qtabletevent.html - - PointerType - PointerType-enum - - - - TabletDevice - TabletDevice-enum - - - - QTabletEvent - QTabletEvent - ( Type type, const QPoint & pos, const QPoint & globalPos, const QPointF & hiResGlobalPos, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers keyState, qint64 uniqueID ) - - - device - device - () - - - globalPos - globalPos - () - - - globalX - globalX - () - - - globalY - globalY - () - - - hiResGlobalPos - hiResGlobalPos - () - - - hiResGlobalX - hiResGlobalX - () - - - hiResGlobalY - hiResGlobalY - () - - - pointerType - pointerType - () - - - pos - pos - () - - - pressure - pressure - () - - - rotation - rotation - () - - - tangentialPressure - tangentialPressure - () - - - uniqueId - uniqueId - () - - - x - x - () - - - xTilt - xTilt - () - - - y - y - () - - - yTilt - yTilt - () - - - z - z - () - - - - QTableView - qtableview.html - - PenStyle - gridStyle-prop - - - - QTableView - QTableView - ( QWidget * parent = 0 ) - - - columnAt - columnAt - ( int x ) - - - columnCountChanged - columnCountChanged - ( int oldCount, int newCount ) - - - columnMoved - columnMoved - ( int column, int oldIndex, int newIndex ) - - - columnResized - columnResized - ( int column, int oldWidth, int newWidth ) - - - columnViewportPosition - columnViewportPosition - ( int column ) - - - columnWidth - columnWidth - ( int column ) - - - hideColumn - hideColumn - ( int column ) - - - hideRow - hideRow - ( int row ) - - - horizontalHeader - horizontalHeader - () - - - horizontalOffset - horizontalOffset - () - - - indexAt - indexAt - ( const QPoint & pos ) - - - isColumnHidden - isColumnHidden - ( int column ) - - - isRowHidden - isRowHidden - ( int row ) - - - moveCursor - moveCursor - ( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - resizeColumnToContents - resizeColumnToContents - ( int column ) - - - resizeColumnsToContents - resizeColumnsToContents - () - - - resizeRowToContents - resizeRowToContents - ( int row ) - - - resizeRowsToContents - resizeRowsToContents - () - - - rowAt - rowAt - ( int y ) - - - rowCountChanged - rowCountChanged - ( int oldCount, int newCount ) - - - rowHeight - rowHeight - ( int row ) - - - rowMoved - rowMoved - ( int row, int oldIndex, int newIndex ) - - - rowResized - rowResized - ( int row, int oldHeight, int newHeight ) - - - rowViewportPosition - rowViewportPosition - ( int row ) - - - selectColumn - selectColumn - ( int column ) - - - selectRow - selectRow - ( int row ) - - - setColumnHidden - setColumnHidden - ( int column, bool hide ) - - - setColumnWidth - setColumnWidth - ( int column, int width ) - - - setHorizontalHeader - setHorizontalHeader - ( QHeaderView * header ) - - - setRowHeight - setRowHeight - ( int row, int height ) - - - setRowHidden - setRowHidden - ( int row, bool hide ) - - - setSelection - setSelection - ( const QRect & rect, QItemSelectionModel::SelectionFlags flags ) - - - setVerticalHeader - setVerticalHeader - ( QHeaderView * header ) - - - showColumn - showColumn - ( int column ) - - - showRow - showRow - ( int row ) - - - sizeHintForColumn - sizeHintForColumn - ( int column ) - - - sizeHintForRow - sizeHintForRow - ( int row ) - - - sortByColumn - sortByColumn - ( int column ) - - - verticalHeader - verticalHeader - () - - - verticalOffset - verticalOffset - () - - - - QTableWidget - qtablewidget.html - - QTableWidget - QTableWidget - ( QWidget * parent = 0 ) - - - QTableWidget - QTableWidget-2 - ( int rows, int columns, QWidget * parent = 0 ) - - - cellActivated - cellActivated - ( int row, int column ) - - - cellChanged - cellChanged - ( int row, int column ) - - - cellClicked - cellClicked - ( int row, int column ) - - - cellDoubleClicked - cellDoubleClicked - ( int row, int column ) - - - cellEntered - cellEntered - ( int row, int column ) - - - cellPressed - cellPressed - ( int row, int column ) - - - cellWidget - cellWidget - ( int row, int column ) - - - clear - clear - () - - - closePersistentEditor - closePersistentEditor - ( QTableWidgetItem * item ) - - - column - column - ( const QTableWidgetItem * item ) - - - currentCellChanged - currentCellChanged - ( int currentRow, int currentColumn, int previousRow, int previousColumn ) - - - currentColumn - currentColumn - () - - - currentItem - currentItem - () - - - currentItemChanged - currentItemChanged - ( QTableWidgetItem * current, QTableWidgetItem * previous ) - - - currentRow - currentRow - () - - - dropMimeData - dropMimeData - ( int row, int column, const QMimeData * data, Qt::DropAction action ) - - - editItem - editItem - ( QTableWidgetItem * item ) - - - event - event - ( QEvent * e ) - - - findItems - findItems - ( const QString & text, Qt::MatchFlags flags ) - - - horizontalHeaderItem - horizontalHeaderItem - ( int column ) - - - indexFromItem - indexFromItem - ( QTableWidgetItem * item ) - - - insertColumn - insertColumn - ( int column ) - - - insertRow - insertRow - ( int row ) - - - isItemSelected - isItemSelected - ( const QTableWidgetItem * item ) - - - item - item - ( int row, int column ) - - - itemActivated - itemActivated - ( QTableWidgetItem * item ) - - - itemAt - itemAt - ( const QPoint & point ) - - - itemAt - itemAt-2 - ( int ax, int ay ) - - - itemChanged - itemChanged - ( QTableWidgetItem * item ) - - - itemClicked - itemClicked - ( QTableWidgetItem * item ) - - - itemDoubleClicked - itemDoubleClicked - ( QTableWidgetItem * item ) - - - itemEntered - itemEntered - ( QTableWidgetItem * item ) - - - itemFromIndex - itemFromIndex - ( const QModelIndex & index ) - - - itemPressed - itemPressed - ( QTableWidgetItem * item ) - - - itemPrototype - itemPrototype - () - - - itemSelectionChanged - itemSelectionChanged - () - - - items - items - ( const QMimeData * data ) - - - mimeData - mimeData - ( const QList<QTableWidgetItem *> items ) - - - mimeTypes - mimeTypes - () - - - openPersistentEditor - openPersistentEditor - ( QTableWidgetItem * item ) - - - removeColumn - removeColumn - ( int column ) - - - removeRow - removeRow - ( int row ) - - - row - row - ( const QTableWidgetItem * item ) - - - scrollToItem - scrollToItem - ( const QTableWidgetItem * item, QAbstractItemView::ScrollHint hint = EnsureVisible ) - - - selectedItems - selectedItems - () - - - selectedRanges - selectedRanges - () - - - setCellWidget - setCellWidget - ( int row, int column, QWidget * widget ) - - - setCurrentCell - setCurrentCell - ( int row, int column ) - - - setCurrentItem - setCurrentItem - ( QTableWidgetItem * item ) - - - setHorizontalHeaderItem - setHorizontalHeaderItem - ( int column, QTableWidgetItem * item ) - - - setHorizontalHeaderLabels - setHorizontalHeaderLabels - ( const QStringList & labels ) - - - setItem - setItem - ( int row, int column, QTableWidgetItem * item ) - - - setItemPrototype - setItemPrototype - ( const QTableWidgetItem * item ) - - - setItemSelected - setItemSelected - ( const QTableWidgetItem * item, bool select ) - - - setRangeSelected - setRangeSelected - ( const QTableWidgetSelectionRange & range, bool select ) - - - setVerticalHeaderItem - setVerticalHeaderItem - ( int row, QTableWidgetItem * item ) - - - setVerticalHeaderLabels - setVerticalHeaderLabels - ( const QStringList & labels ) - - - sortItems - sortItems - ( int column, Qt::SortOrder order = Qt::AscendingOrder ) - - - DropActions - supportedDropActions - QTableWidget::supportedDropActions() - - - takeHorizontalHeaderItem - takeHorizontalHeaderItem - ( int column ) - - - takeItem - takeItem - ( int row, int column ) - - - takeVerticalHeaderItem - takeVerticalHeaderItem - ( int row ) - - - verticalHeaderItem - verticalHeaderItem - ( int row ) - - - visualColumn - visualColumn - ( int logicalColumn ) - - - visualItemRect - visualItemRect - ( const QTableWidgetItem * item ) - - - visualRow - visualRow - ( int logicalRow ) - - - - QTableWidgetItem - qtablewidgetitem.html - - QTableWidgetItem - QTableWidgetItem - ( int type = Type ) - - - QTableWidgetItem - QTableWidgetItem-2 - ( const QString & text, int type = Type ) - - - QTableWidgetItem - QTableWidgetItem-3 - ( const QTableWidgetItem & other ) - - - backgroundColor - backgroundColor - () - - - CheckState - checkState - QTableWidgetItem::checkState() - - - clone - clone - () - - - data - data - ( int role ) - - - ItemFlags - flags - QTableWidgetItem::flags() - - - font - font - () - - - icon - icon - () - - - read - read - ( QDataStream & in ) - - - setBackgroundColor - setBackgroundColor - ( const QColor & color ) - - - setCheckState - setCheckState - ( Qt::CheckState state ) - - - setData - setData - ( int role, const QVariant & value ) - - - setFlags - setFlags - ( Qt::ItemFlags flags ) - - - setFont - setFont - ( const QFont & font ) - - - setIcon - setIcon - ( const QIcon & icon ) - - - setSizeHint - setSizeHint - ( const QSize & size ) - - - setStatusTip - setStatusTip - ( const QString & statusTip ) - - - setText - setText - ( const QString & text ) - - - setTextAlignment - setTextAlignment - ( int alignment ) - - - setTextColor - setTextColor - ( const QColor & color ) - - - setToolTip - setToolTip - ( const QString & toolTip ) - - - setWhatsThis - setWhatsThis - ( const QString & whatsThis ) - - - sizeHint - sizeHint - () - - - statusTip - statusTip - () - - - tableWidget - tableWidget - () - - - text - text - () - - - textAlignment - textAlignment - () - - - textColor - textColor - () - - - toolTip - toolTip - () - - - type - type - () - - - whatsThis - whatsThis - () - - - write - write - ( QDataStream & out ) - - - operator< - operator-lt - ( const QTableWidgetItem & other ) - - - operator= - operator-eq - ( const QTableWidgetItem & other ) - - - Type - Type-var - - - - UserType - UserType-var - - - - - QTableWidgetSelectionRange - qtablewidgetselectionrange.html - - QTableWidgetSelectionRange - QTableWidgetSelectionRange - () - - - QTableWidgetSelectionRange - QTableWidgetSelectionRange-2 - ( int top, int left, int bottom, int right ) - - - QTableWidgetSelectionRange - QTableWidgetSelectionRange-3 - ( const QTableWidgetSelectionRange & other ) - - - bottomRow - bottomRow - () - - - columnCount - columnCount - () - - - leftColumn - leftColumn - () - - - rightColumn - rightColumn - () - - - rowCount - rowCount - () - - - topRow - topRow - () - - - - QTabWidget - qtabwidget.html - - TabPosition - TabPosition-enum - - - - TabShape - TabShape-enum - - - - QTabWidget - QTabWidget - ( QWidget * parent = 0 ) - - - addTab - addTab - ( QWidget * child, const QString & label ) - - - addTab - addTab-2 - ( QWidget * child, const QIcon & icon, const QString & label ) - - - cornerWidget - cornerWidget - ( Qt::Corner corner = Qt::TopRightCorner ) - - - currentChanged - currentChanged - ( int index ) - - - currentWidget - currentWidget - () - - - indexOf - indexOf - ( QWidget * w ) - - - insertTab - insertTab - ( int index, QWidget * w, const QString & label ) - - - insertTab - insertTab-4 - ( int index, QWidget * w, const QIcon & icon, const QString & label ) - - - isTabEnabled - isTabEnabled - ( int index ) - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - removeTab - removeTab - ( int index ) - - - setCornerWidget - setCornerWidget - ( QWidget * widget, Qt::Corner corner = Qt::TopRightCorner ) - - - setCurrentWidget - setCurrentWidget - ( QWidget * widget ) - - - setTabBar - setTabBar - ( QTabBar * tb ) - - - setTabEnabled - setTabEnabled - ( int index, bool enable ) - - - setTabIcon - setTabIcon - ( int index, const QIcon & icon ) - - - setTabText - setTabText - ( int index, const QString & label ) - - - setTabToolTip - setTabToolTip - ( int index, const QString & tip ) - - - setTabWhatsThis - setTabWhatsThis - ( int index, const QString & text ) - - - tabBar - tabBar - () - - - tabIcon - tabIcon - ( int index ) - - - tabInserted - tabInserted - ( int index ) - - - tabRemoved - tabRemoved - ( int index ) - - - tabText - tabText - ( int index ) - - - tabToolTip - tabToolTip - ( int index ) - - - tabWhatsThis - tabWhatsThis - ( int index ) - - - widget - widget - ( int index ) - - - QTabWidget - QTabWidget-2 - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - changeTab - changeTab - ( QWidget * widget, const QString & label ) - - - changeTab - changeTab-2 - ( QWidget * widget, const QIcon & icon, const QString & label ) - - - currentChanged - currentChanged-2 - ( QWidget * widget ) - - - currentPage - currentPage - () - - - currentPageIndex - currentPageIndex - () - - - insertTab - insertTab-2 - ( QWidget * widget, const QString & label, int index = -1 ) - - - insertTab - insertTab-3 - ( QWidget * widget, const QIcon & icon, const QString & label, int index = -1 ) - - - isTabEnabled - isTabEnabled-2 - ( QWidget * widget ) - - - label - label - ( int index ) - - - margin - margin - () - - - page - page - ( int index ) - - - removePage - removePage - ( QWidget * widget ) - - - removeTabToolTip - removeTabToolTip - ( QWidget * widget ) - - - setCurrentPage - setCurrentPage - ( int index ) - - - setMargin - setMargin - ( int margin ) - - - setTabEnabled - setTabEnabled-2 - ( QWidget * widget, bool b ) - - - setTabIconSet - setTabIconSet - ( QWidget * widget, const QIcon & icon ) - - - setTabLabel - setTabLabel - ( QWidget * widget, const QString & label ) - - - setTabToolTip - setTabToolTip-2 - ( QWidget * widget, const QString & tip ) - - - showPage - showPage - ( QWidget * widget ) - - - tabIconSet - tabIconSet - ( QWidget * widget ) - - - tabLabel - tabLabel - ( QWidget * widget ) - - - tabToolTip - tabToolTip-2 - ( QWidget * widget ) - - - - QTcpServer - qtcpserver.html - - QTcpServer - QTcpServer - ( QObject * parent = 0 ) - - - close - close - () - - - errorString - errorString - () - - - hasPendingConnections - hasPendingConnections - () - - - incomingConnection - incomingConnection - ( int socketDescriptor ) - - - isListening - isListening - () - - - listen - listen - ( const QHostAddress & address = QHostAddress::Any, quint16 port = 0 ) - - - maxPendingConnections - maxPendingConnections - () - - - newConnection - newConnection - () - - - nextPendingConnection - nextPendingConnection - () - - - proxy - proxy - () - - - serverAddress - serverAddress - () - - - SocketError - serverError - QTcpServer::serverError() - - - serverPort - serverPort - () - - - setMaxPendingConnections - setMaxPendingConnections - ( int numConnections ) - - - setProxy - setProxy - ( const QNetworkProxy & networkProxy ) - - - setSocketDescriptor - setSocketDescriptor - ( int socketDescriptor ) - - - socketDescriptor - socketDescriptor - () - - - waitForNewConnection - waitForNewConnection - ( int msec = 0, bool * timedOut = 0 ) - - - - QTcpSocket - qtcpsocket.html - - QTcpSocket - QTcpSocket - ( QObject * parent = 0 ) - - - - QTemporaryFile - qtemporaryfile.html - - QTemporaryFile - QTemporaryFile - () - - - QTemporaryFile - QTemporaryFile-2 - ( const QString & templateName ) - - - QTemporaryFile - QTemporaryFile-3 - ( QObject * parent ) - - - QTemporaryFile - QTemporaryFile-4 - ( const QString & templateName, QObject * parent ) - - - autoRemove - autoRemove - () - - - createLocalFile - createLocalFile - ( QFile & file ) - - - createLocalFile - createLocalFile-2 - ( const QString & fileName ) - - - fileName - fileName - () - - - fileTemplate - fileTemplate - () - - - open - open - () - - - setAutoRemove - setAutoRemove - ( bool b ) - - - setFileTemplate - setFileTemplate - ( const QString & name ) - - - - QTestEventList - qtesteventlist.html - - QTestEventList - QTestEventList - () - - - QTestEventList - QTestEventList-2 - ( const QTestEventList & other ) - - - addDelay - addDelay - ( int msecs ) - - - addKeyClick - addKeyClick - ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addKeyClick - addKeyClick-2 - ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addKeyClicks - addKeyClicks - ( const QString & keys, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addKeyPress - addKeyPress - ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addKeyPress - addKeyPress-2 - ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addKeyRelease - addKeyRelease - ( Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addKeyRelease - addKeyRelease-2 - ( char ascii, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1 ) - - - addMouseClick - addMouseClick - ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint() - - - addMouseDClick - addMouseDClick - ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint() - - - addMouseMove - addMouseMove - ( QPoint pos = QPoint() - - - addMousePress - addMousePress - ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint() - - - addMouseRelease - addMouseRelease - ( Qt::MouseButton button, Qt::KeyboardModifiers modifiers = 0, QPoint pos = QPoint() - - - clear - clear - () - - - simulate - simulate - ( QWidget * w ) - - - KeyAction - KeyAction-enum - - - - MouseAction - MouseAction-enum - - - - SkipMode - SkipMode-enum - - - - TestFailMode - TestFailMode-enum - - - - addColumn - addColumn - ( const char * name, T * dummy = 0 ) - - - currentDataTag - currentDataTag - () - - - currentTestFailed - currentTestFailed - () - - - currentTestFunction - currentTestFunction - () - - - ignoreMessage - ignoreMessage - ( QtMsgType type, const char * message ) - - - keyClick - keyClick - ( QWidget * widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyClick - keyClick-2 - ( QWidget * widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyClicks - keyClicks - ( QWidget * widget, const QString & sequence, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyEvent - keyEvent - ( KeyAction action, QWidget * widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyEvent - keyEvent-2 - ( KeyAction action, QWidget * widget, char ascii, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyPress - keyPress - ( QWidget * widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyPress - keyPress-2 - ( QWidget * widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyRelease - keyRelease - ( QWidget * widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - keyRelease - keyRelease-2 - ( QWidget * widget, char key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1 ) - - - mouseClick - mouseClick - ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint() - - - mouseDClick - mouseDClick - ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint() - - - mouseMove - mouseMove - ( QWidget * widget, QPoint pos = QPoint() - - - mousePress - mousePress - ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint() - - - mouseRelease - mouseRelease - ( QWidget * widget, Qt::MouseButton button, Qt::KeyboardModifiers modifier = 0, QPoint pos = QPoint() - - - newRow - newRow - ( const char * dataTag ) - - - qExec - qExec - ( QObject * testObject, int argc = 0, char ** argv = 0 ) - - - qSleep - qSleep - ( int ms ) - - - qWait - qWait - ( int ms ) - - - toString - toString - ( const T & value ) - - - toString - toString-4 - ( const QLatin1String & string ) - - - toString - toString-5 - ( const QString & string ) - - - toString - toString-6 - ( const QTime & time ) - - - toString - toString-7 - ( const QDate & date ) - - - toString - toString-8 - ( const QDateTime & dateTime ) - - - toString - toString-9 - ( const QChar & character ) - - - - QTextBlockFormat - qtextblockformat.html - - QTextBlockFormat - QTextBlockFormat - () - - - Alignment - alignment - QTextBlockFormat::alignment() - - - bottomMargin - bottomMargin - () - - - indent - indent - () - - - isValid - isValid - () - - - leftMargin - leftMargin - () - - - nonBreakableLines - nonBreakableLines - () - - - rightMargin - rightMargin - () - - - setAlignment - setAlignment - ( Qt::Alignment alignment ) - - - setBottomMargin - setBottomMargin - ( qreal margin ) - - - setIndent - setIndent - ( int indentation ) - - - setLeftMargin - setLeftMargin - ( qreal margin ) - - - setNonBreakableLines - setNonBreakableLines - ( bool b ) - - - setRightMargin - setRightMargin - ( qreal margin ) - - - setTextIndent - setTextIndent - ( qreal indent ) - - - setTopMargin - setTopMargin - ( qreal margin ) - - - textIndent - textIndent - () - - - topMargin - topMargin - () - - - - QTextBlockGroup - qtextblockgroup.html - - QTextBlockGroup - QTextBlockGroup - ( QTextDocument * document ) - - - blockFormatChanged - blockFormatChanged - ( const QTextBlock & block ) - - - blockInserted - blockInserted - ( const QTextBlock & block ) - - - blockList - blockList - () - - - blockRemoved - blockRemoved - ( const QTextBlock & block ) - - - - QTextBlock - qtextblock.html - - Iterator - Iterator-typedef - - - - QTextBlock - QTextBlock-3 - ( const QTextBlock & other ) - - - begin - begin - () - - - blockFormat - blockFormat - () - - - blockFormatIndex - blockFormatIndex - () - - - charFormat - charFormat - () - - - charFormatIndex - charFormatIndex - () - - - contains - contains - ( int position ) - - - document - document - () - - - end - end - () - - - isValid - isValid - () - - - layout - layout - () - - - length - length - () - - - next - next - () - - - position - position - () - - - previous - previous - () - - - setUserData - setUserData - ( QTextBlockUserData * data ) - - - setUserState - setUserState - ( int state ) - - - text - text - () - - - textList - textList - () - - - userData - userData - () - - - userState - userState - () - - - operator!= - operator-not-eq - ( const QTextBlock & other ) - - - operator< - operator-lt - ( const QTextBlock & other ) - - - operator= - operator-eq - ( const QTextBlock & other ) - - - operator== - operator-eq-eq - ( const QTextBlock & other ) - - - - QTextBlock::iterator - qtextblock-iterator.html - - iterator - iterator-2 - () - - - iterator - iterator-3 - ( const iterator & other ) - - - atEnd - atEnd - () - - - fragment - fragment - () - - - operator!= - operator-not-eq - ( const iterator & other ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator== - operator-eq-eq - ( const iterator & other ) - - - - QTextBlockUserData - qtextblockuserdata.html - - - QTextBrowser - qtextbrowser.html - - QTextBrowser - QTextBrowser - ( QWidget * parent = 0 ) - - - anchorClicked - anchorClicked - ( const QUrl & link ) - - - backward - backward - () - - - backwardAvailable - backwardAvailable - ( bool available ) - - - forward - forward - () - - - forwardAvailable - forwardAvailable - ( bool available ) - - - highlighted - highlighted - ( const QUrl & link ) - - - highlighted - highlighted-2 - ( const QString & link ) - - - home - home - () - - - keyPressEvent - keyPressEvent - ( QKeyEvent * ev ) - - - loadResource - loadResource - ( int type, const QUrl & name ) - - - reload - reload - () - - - sourceChanged - sourceChanged - ( const QUrl & src ) - - - QTextBrowser - QTextBrowser-2 - ( QWidget * parent, const char * name ) - - - - QTextCharFormat - qtextcharformat.html - - VerticalAlignment - VerticalAlignment-enum - - - - QTextCharFormat - QTextCharFormat - () - - - anchorHref - anchorHref - () - - - anchorName - anchorName - () - - - font - font - () - - - fontFamily - fontFamily - () - - - fontFixedPitch - fontFixedPitch - () - - - fontItalic - fontItalic - () - - - fontOverline - fontOverline - () - - - fontPointSize - fontPointSize - () - - - fontStrikeOut - fontStrikeOut - () - - - fontUnderline - fontUnderline - () - - - fontWeight - fontWeight - () - - - isAnchor - isAnchor - () - - - isValid - isValid - () - - - setAnchor - setAnchor - ( bool anchor ) - - - setAnchorHref - setAnchorHref - ( const QString & value ) - - - setAnchorName - setAnchorName - ( const QString & name ) - - - setFont - setFont - ( const QFont & font ) - - - setFontFamily - setFontFamily - ( const QString & family ) - - - setFontFixedPitch - setFontFixedPitch - ( bool fixedPitch ) - - - setFontItalic - setFontItalic - ( bool italic ) - - - setFontOverline - setFontOverline - ( bool overline ) - - - setFontPointSize - setFontPointSize - ( qreal size ) - - - setFontStrikeOut - setFontStrikeOut - ( bool strikeOut ) - - - setFontUnderline - setFontUnderline - ( bool underline ) - - - setFontWeight - setFontWeight - ( int weight ) - - - setTableCellColumnSpan - setTableCellColumnSpan - ( int tableCellColumnSpan ) - - - setTableCellRowSpan - setTableCellRowSpan - ( int tableCellRowSpan ) - - - setTextOutline - setTextOutline - ( const QPen & pen ) - - - setUnderlineColor - setUnderlineColor - ( const QColor & color ) - - - setVerticalAlignment - setVerticalAlignment - ( VerticalAlignment alignment ) - - - tableCellColumnSpan - tableCellColumnSpan - () - - - tableCellRowSpan - tableCellRowSpan - () - - - textOutline - textOutline - () - - - underlineColor - underlineColor - () - - - verticalAlignment - verticalAlignment - () - - - - QTextCodec::ConverterState - qtextcodec-converterstate.html - - ConverterState - ConverterState - ( ConversionFlags flags = DefaultConversion ) - - - - QTextCodec - qtextcodec.html - - QTextCodec - QTextCodec - () - - - aliases - aliases - () - - - availableCodecs - availableCodecs - () - - - availableMibs - availableMibs - () - - - canEncode - canEncode - ( QChar ch ) - - - canEncode - canEncode-2 - ( const QString & s ) - - - codecForCStrings - codecForCStrings - () - - - codecForLocale - codecForLocale - () - - - codecForMib - codecForMib - ( int mib ) - - - codecForName - codecForName - ( const QByteArray & name ) - - - codecForName - codecForName-2 - ( const char * name ) - - - codecForTr - codecForTr - () - - - convertFromUnicode - convertFromUnicode - ( const QChar * input, int number, ConverterState * state ) - - - convertToUnicode - convertToUnicode - ( const char * chars, int len, ConverterState * state ) - - - fromUnicode - fromUnicode - ( const QString & str ) - - - fromUnicode - fromUnicode-2 - ( const QChar * input, int number, ConverterState * state = 0 ) - - - makeDecoder - makeDecoder - () - - - makeEncoder - makeEncoder - () - - - mibEnum - mibEnum - () - - - name - name - () - - - setCodecForCStrings - setCodecForCStrings - ( QTextCodec * c ) - - - setCodecForLocale - setCodecForLocale - ( QTextCodec * c ) - - - setCodecForTr - setCodecForTr - ( QTextCodec * c ) - - - toUnicode - toUnicode - ( const QByteArray & a ) - - - toUnicode - toUnicode-2 - ( const char * input, int size, ConverterState * state = 0 ) - - - toUnicode - toUnicode-4 - ( const char * chars ) - - - - QTextCodecPlugin - qtextcodecplugin.html - - QTextCodecPlugin - QTextCodecPlugin - ( QObject * parent = 0 ) - - - aliases - aliases - () - - - createForMib - createForMib - ( int mib ) - - - createForName - createForName - ( const QByteArray & name ) - - - mibEnums - mibEnums - () - - - names - names - () - - - codecForContent - codecForContent - ( const char * str, int size ) - - - codecForIndex - codecForIndex - ( int i ) - - - codecForName - codecForName-3 - ( const char * hint, int accuracy ) - - - fromUnicode - fromUnicode-3 - ( const QString & uc, int & lenInOut ) - - - locale - locale - () - - - mimeName - mimeName - () - - - toUnicode - toUnicode-3 - ( const QByteArray & a, int len ) - - - - QTextCursor - qtextcursor.html - - MoveMode - MoveMode-enum - - - - MoveOperation - MoveOperation-enum - - - - SelectionType - SelectionType-enum - - - - QTextCursor - QTextCursor - () - - - QTextCursor - QTextCursor-2 - ( QTextDocument * document ) - - - QTextCursor - QTextCursor-4 - ( QTextFrame * frame ) - - - QTextCursor - QTextCursor-5 - ( const QTextBlock & block ) - - - QTextCursor - QTextCursor-7 - ( const QTextCursor & cursor ) - - - anchor - anchor - () - - - atBlockEnd - atBlockEnd - () - - - atBlockStart - atBlockStart - () - - - atEnd - atEnd - () - - - atStart - atStart - () - - - beginEditBlock - beginEditBlock - () - - - block - block - () - - - blockCharFormat - blockCharFormat - () - - - blockFormat - blockFormat - () - - - charFormat - charFormat - () - - - clearSelection - clearSelection - () - - - createList - createList - ( const QTextListFormat & format ) - - - createList - createList-2 - ( QTextListFormat::Style style ) - - - currentFrame - currentFrame - () - - - currentList - currentList - () - - - currentTable - currentTable - () - - - deleteChar - deleteChar - () - - - deletePreviousChar - deletePreviousChar - () - - - endEditBlock - endEditBlock - () - - - hasComplexSelection - hasComplexSelection - () - - - hasSelection - hasSelection - () - - - insertBlock - insertBlock - () - - - insertBlock - insertBlock-2 - ( const QTextBlockFormat & format ) - - - insertBlock - insertBlock-3 - ( const QTextBlockFormat & format, const QTextCharFormat & charFormat ) - - - insertFragment - insertFragment - ( const QTextDocumentFragment & fragment ) - - - insertFrame - insertFrame - ( const QTextFrameFormat & format ) - - - insertImage - insertImage - ( const QTextImageFormat & format ) - - - insertImage - insertImage-2 - ( const QString & name ) - - - insertList - insertList - ( const QTextListFormat & format ) - - - insertList - insertList-2 - ( QTextListFormat::Style style ) - - - insertTable - insertTable - ( int rows, int columns, const QTextTableFormat & format ) - - - insertTable - insertTable-2 - ( int rows, int columns ) - - - insertText - insertText - ( const QString & text ) - - - insertText - insertText-2 - ( const QString & text, const QTextCharFormat & format ) - - - isCopyOf - isCopyOf - ( const QTextCursor & other ) - - - isNull - isNull - () - - - joinPreviousEditBlock - joinPreviousEditBlock - () - - - mergeBlockCharFormat - mergeBlockCharFormat - ( const QTextCharFormat & modifier ) - - - mergeBlockFormat - mergeBlockFormat - ( const QTextBlockFormat & modifier ) - - - mergeCharFormat - mergeCharFormat - ( const QTextCharFormat & modifier ) - - - movePosition - movePosition - ( MoveOperation operation, MoveMode mode = MoveAnchor, int n = 1 ) - - - position - position - () - - - removeSelectedText - removeSelectedText - () - - - select - select - ( SelectionType selection ) - - - selectedTableCells - selectedTableCells - ( int * firstRow, int * numRows, int * firstColumn, int * numColumns ) - - - selectedText - selectedText - () - - - selection - selection - () - - - selectionEnd - selectionEnd - () - - - selectionStart - selectionStart - () - - - setBlockCharFormat - setBlockCharFormat - ( const QTextCharFormat & format ) - - - setBlockFormat - setBlockFormat - ( const QTextBlockFormat & format ) - - - setCharFormat - setCharFormat - ( const QTextCharFormat & format ) - - - setPosition - setPosition - ( int pos, MoveMode m = MoveAnchor ) - - - operator!= - operator-not-eq - ( const QTextCursor & other ) - - - operator< - operator-lt - ( const QTextCursor & other ) - - - operator<= - operator-lt-eq - ( const QTextCursor & other ) - - - operator= - operator-eq - ( const QTextCursor & cursor ) - - - operator== - operator-eq-eq - ( const QTextCursor & other ) - - - operator> - operator-gt - ( const QTextCursor & other ) - - - operator>= - operator-gt-eq - ( const QTextCursor & other ) - - - - QTextDecoder - qtextdecoder.html - - QTextDecoder - QTextDecoder - ( const QTextCodec * codec ) - - - toUnicode - toUnicode - ( const char * chars, int len ) - - - toUnicode - toUnicode-2 - ( const QByteArray & ba ) - - - - QTextDocumentFragment - qtextdocumentfragment.html - - QTextDocumentFragment - QTextDocumentFragment - () - - - QTextDocumentFragment - QTextDocumentFragment-2 - ( const QTextDocument * document ) - - - QTextDocumentFragment - QTextDocumentFragment-3 - ( const QTextCursor & cursor ) - - - QTextDocumentFragment - QTextDocumentFragment-4 - ( const QTextDocumentFragment & other ) - - - fromHtml - fromHtml - ( const QString & text ) - - - fromPlainText - fromPlainText - ( const QString & plainText ) - - - isEmpty - isEmpty - () - - - toHtml - toHtml - () - - - toPlainText - toPlainText - () - - - operator= - operator-eq - ( const QTextDocumentFragment & other ) - - - - QTextDocument - qtextdocument.html - - MetaInformation - MetaInformation-enum - - - - ResourceType - ResourceType-enum - - - - QTextDocument - QTextDocument - ( QObject * parent = 0 ) - - - QTextDocument - QTextDocument-2 - ( const QString & text, QObject * parent = 0 ) - - - addResource - addResource - ( int type, const QUrl & name, const QVariant & resource ) - - - allFormats - allFormats - () - - - begin - begin - () - - - clear - clear - () - - - clone - clone - ( QObject * parent = 0 ) - - - contentsChange - contentsChange - ( int position, int charsRemoved, int charsAdded ) - - - contentsChanged - contentsChanged - () - - - createObject - createObject - ( const QTextFormat & format ) - - - cursorPositionChanged - cursorPositionChanged - ( const QTextCursor & cursor ) - - - documentLayout - documentLayout - () - - - end - end - () - - - find - find - ( const QString & expr, const QTextCursor & cursor, FindFlags options = 0 ) - - - find - find-2 - ( const QString & expr, int position = 0, FindFlags options = 0 ) - - - findBlock - findBlock - ( int pos ) - - - isEmpty - isEmpty - () - - - isRedoAvailable - isRedoAvailable - () - - - isUndoAvailable - isUndoAvailable - () - - - loadResource - loadResource - ( int type, const QUrl & name ) - - - markContentsDirty - markContentsDirty - ( int position, int length ) - - - metaInformation - metaInformation - ( MetaInformation info ) - - - modificationChanged - modificationChanged - ( bool changed ) - - - object - object - ( int objectIndex ) - - - objectForFormat - objectForFormat - ( const QTextFormat & f ) - - - pageCount - pageCount - () - - - print - print - ( QPrinter * printer ) - - - redo - redo - () - - - redoAvailable - redoAvailable - ( bool available ) - - - resource - resource - ( int type, const QUrl & name ) - - - rootFrame - rootFrame - () - - - setDocumentLayout - setDocumentLayout - ( QAbstractTextDocumentLayout * layout ) - - - setHtml - setHtml - ( const QString & html ) - - - setMetaInformation - setMetaInformation - ( MetaInformation info, const QString & string ) - - - setPlainText - setPlainText - ( const QString & text ) - - - toHtml - toHtml - ( const QByteArray & encoding = QByteArray() - - - toPlainText - toPlainText - () - - - undo - undo - () - - - undoAvailable - undoAvailable - ( bool available ) - - - - QTextEdit - qtextedit.html - - CursorAction - CursorAction-enum - - - - LineWrapMode - LineWrapMode-enum - - - - WrapMode - wordWrapMode-prop - - - - QTextEdit - QTextEdit - ( QWidget * parent = 0 ) - - - QTextEdit - QTextEdit-2 - ( const QString & text, QWidget * parent = 0 ) - - - Alignment - alignment - QTextEdit::alignment() - - - anchorAt - anchorAt - ( const QPoint & pos ) - - - append - append - ( const QString & text ) - - - canInsertFromMimeData - canInsertFromMimeData - ( const QMimeData * source ) - - - clear - clear - () - - - contextMenuEvent - contextMenuEvent - ( QContextMenuEvent * e ) - - - copy - copy - () - - - copyAvailable - copyAvailable - ( bool yes ) - - - createMimeDataFromSelection - createMimeDataFromSelection - () - - - createStandardContextMenu - createStandardContextMenu - () - - - currentCharFormat - currentCharFormat - () - - - currentCharFormatChanged - currentCharFormatChanged - ( const QTextCharFormat & f ) - - - currentFont - currentFont - () - - - cursorForPosition - cursorForPosition - ( const QPoint & pos ) - - - cursorPositionChanged - cursorPositionChanged - () - - - cursorRect - cursorRect - ( const QTextCursor & cursor ) - - - cursorRect - cursorRect-2 - () - - - cut - cut - () - - - document - document - () - - - ensureCursorVisible - ensureCursorVisible - () - - - find - find - ( const QString & exp, QTextDocument::FindFlags options = 0 ) - - - fontFamily - fontFamily - () - - - fontItalic - fontItalic - () - - - fontPointSize - fontPointSize - () - - - fontUnderline - fontUnderline - () - - - fontWeight - fontWeight - () - - - insertFromMimeData - insertFromMimeData - ( const QMimeData * source ) - - - insertHtml - insertHtml - ( const QString & text ) - - - insertPlainText - insertPlainText - ( const QString & text ) - - - loadResource - loadResource - ( int type, const QUrl & name ) - - - mergeCurrentCharFormat - mergeCurrentCharFormat - ( const QTextCharFormat & modifier ) - - - paste - paste - () - - - redoAvailable - redoAvailable - ( bool available ) - - - scrollToAnchor - scrollToAnchor - ( const QString & name ) - - - selectAll - selectAll - () - - - selectionChanged - selectionChanged - () - - - setAlignment - setAlignment - ( Qt::Alignment a ) - - - setCurrentCharFormat - setCurrentCharFormat - ( const QTextCharFormat & format ) - - - setCurrentFont - setCurrentFont - ( const QFont & f ) - - - setDocument - setDocument - ( QTextDocument * document ) - - - setFontFamily - setFontFamily - ( const QString & fontFamily ) - - - setFontItalic - setFontItalic - ( bool italic ) - - - setFontPointSize - setFontPointSize - ( qreal s ) - - - setFontUnderline - setFontUnderline - ( bool underline ) - - - setFontWeight - setFontWeight - ( int w ) - - - setPlainText - setPlainText - ( const QString & text ) - - - setTextColor - setTextColor - ( const QColor & c ) - - - setTextCursor - setTextCursor - ( const QTextCursor & cursor ) - - - textChanged - textChanged - () - - - textColor - textColor - () - - - textCursor - textCursor - () - - - toPlainText - toPlainText - () - - - undoAvailable - undoAvailable - ( bool available ) - - - zoomIn - zoomIn - ( int range = 1 ) - - - zoomOut - zoomOut - ( int range = 1 ) - - - KeyboardAction - KeyboardAction-enum - - - - QTextEdit - QTextEdit-4 - ( QWidget * parent, const char * name ) - - - bold - bold - () - - - color - color - () - - - currentColorChanged - currentColorChanged - ( const QColor & color ) - - - currentFontChanged - currentFontChanged - ( const QFont & font ) - - - doKeyboardAction - doKeyboardAction - ( KeyboardAction action ) - - - family - family - () - - - find - find-2 - ( const QString & exp, bool cs, bool wo ) - - - hasSelectedText - hasSelectedText - () - - - insert - insert - ( const QString & text ) - - - isModified - isModified - () - - - isRedoAvailable - isRedoAvailable - () - - - isUndoAvailable - isUndoAvailable - () - - - italic - italic - () - - - moveCursor - moveCursor - ( CursorAction action, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor ) - - - moveCursor - moveCursor-2 - ( CursorAction action, bool select ) - - - pointSize - pointSize - () - - - redo - redo - () - - - selectedText - selectedText - () - - - setBold - setBold - ( bool b ) - - - setColor - setColor - ( const QColor & color ) - - - setFamily - setFamily - ( const QString & family ) - - - setItalic - setItalic - ( bool i ) - - - setModified - setModified - ( bool m = true ) - - - setPointSize - setPointSize - ( int size ) - - - setText - setText - ( const QString & text ) - - - setTextFormat - setTextFormat - ( Qt::TextFormat f ) - - - setUnderline - setUnderline - ( bool b ) - - - sync - sync - () - - - text - text - () - - - TextFormat - textFormat - QTextEdit::textFormat() - - - underline - underline - () - - - undo - undo - () - - - - QTextEncoder - qtextencoder.html - - QTextEncoder - QTextEncoder - ( const QTextCodec * codec ) - - - fromUnicode - fromUnicode - ( const QString & str ) - - - fromUnicode - fromUnicode-2 - ( const QChar * uc, int len ) - - - fromUnicode - fromUnicode-3 - ( const QString & uc, int & lenInOut ) - - - - QTextFormat - qtextformat.html - - FormatType - FormatType-enum - - - - ObjectTypes - ObjectTypes-enum - - - - Property - Property-enum - - - - QTextFormat - QTextFormat - () - - - QTextFormat - QTextFormat-2 - ( int type ) - - - QTextFormat - QTextFormat-3 - ( const QTextFormat & other ) - - - background - background - () - - - boolProperty - boolProperty - ( int propertyId ) - - - brushProperty - brushProperty - ( int propertyId ) - - - clearBackground - clearBackground - () - - - clearForeground - clearForeground - () - - - clearProperty - clearProperty - ( int propertyId ) - - - colorProperty - colorProperty - ( int propertyId ) - - - doubleProperty - doubleProperty - ( int propertyId ) - - - foreground - foreground - () - - - hasProperty - hasProperty - ( int propertyId ) - - - intProperty - intProperty - ( int propertyId ) - - - isBlockFormat - isBlockFormat - () - - - isCharFormat - isCharFormat - () - - - isFrameFormat - isFrameFormat - () - - - isImageFormat - isImageFormat - () - - - isListFormat - isListFormat - () - - - isTableFormat - isTableFormat - () - - - isValid - isValid - () - - - LayoutDirection - layoutDirection - QTextFormat::layoutDirection() - - - lengthProperty - lengthProperty - ( int propertyId ) - - - lengthVectorProperty - lengthVectorProperty - ( int propertyId ) - - - merge - merge - ( const QTextFormat & other ) - - - objectIndex - objectIndex - () - - - objectType - objectType - () - - - penProperty - penProperty - ( int propertyId ) - - - properties - properties - () - - - property - property - ( int propertyId ) - - - setBackground - setBackground - ( const QBrush & brush ) - - - setForeground - setForeground - ( const QBrush & brush ) - - - setLayoutDirection - setLayoutDirection - ( Qt::LayoutDirection direction ) - - - setObjectIndex - setObjectIndex - ( int index ) - - - setObjectType - setObjectType - ( int type ) - - - setProperty - setProperty - ( int propertyId, const QVariant & value ) - - - setProperty - setProperty-2 - ( int propertyId, const QVector<QTextLength> & value ) - - - stringProperty - stringProperty - ( int propertyId ) - - - toBlockFormat - toBlockFormat - () - - - toCharFormat - toCharFormat - () - - - toFrameFormat - toFrameFormat - () - - - toImageFormat - toImageFormat - () - - - toListFormat - toListFormat - () - - - toTableFormat - toTableFormat - () - - - type - type - () - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QTextFormat & other ) - - - operator= - operator-eq - ( const QTextFormat & other ) - - - operator== - operator-eq-eq - ( const QTextFormat & other ) - - - - QTextFragment - qtextfragment.html - - QTextFragment - QTextFragment-2 - () - - - QTextFragment - QTextFragment-3 - ( const QTextFragment & other ) - - - charFormat - charFormat - () - - - charFormatIndex - charFormatIndex - () - - - contains - contains - ( int position ) - - - isValid - isValid - () - - - length - length - () - - - position - position - () - - - text - text - () - - - operator!= - operator-not-eq - ( const QTextFragment & other ) - - - operator< - operator-lt - ( const QTextFragment & other ) - - - operator= - operator-eq - ( const QTextFragment & other ) - - - operator== - operator-eq-eq - ( const QTextFragment & other ) - - - - QTextFrameFormat - qtextframeformat.html - - Position - Position-enum - - - - QTextFrameFormat - QTextFrameFormat - () - - - border - border - () - - - height - height - () - - - isValid - isValid - () - - - margin - margin - () - - - padding - padding - () - - - position - position - () - - - setBorder - setBorder - ( qreal width ) - - - setHeight - setHeight - ( const QTextLength & height ) - - - setHeight - setHeight-2 - ( qreal height ) - - - setMargin - setMargin - ( qreal margin ) - - - setPadding - setPadding - ( qreal width ) - - - setPosition - setPosition - ( Position policy ) - - - setWidth - setWidth - ( const QTextLength & width ) - - - setWidth - setWidth-2 - ( qreal width ) - - - width - width - () - - - - QTextFrame - qtextframe.html - - Iterator - Iterator-typedef - - - - QTextFrame - QTextFrame - ( QTextDocument * document ) - - - begin - begin - () - - - childFrames - childFrames - () - - - end - end - () - - - firstCursorPosition - firstCursorPosition - () - - - firstPosition - firstPosition - () - - - frameFormat - frameFormat - () - - - lastCursorPosition - lastCursorPosition - () - - - lastPosition - lastPosition - () - - - parentFrame - parentFrame - () - - - setFrameFormat - setFrameFormat - ( const QTextFrameFormat & format ) - - - - QTextFrame::iterator - qtextframe-iterator.html - - iterator - iterator-2 - () - - - iterator - iterator-3 - ( const iterator & other ) - - - atEnd - atEnd - () - - - currentBlock - currentBlock - () - - - currentFrame - currentFrame - () - - - parentFrame - parentFrame - () - - - operator!= - operator-not-eq - ( const iterator & other ) - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator= - operator-eq - ( const iterator & other ) - - - operator== - operator-eq-eq - ( const iterator & other ) - - - - QTextImageFormat - qtextimageformat.html - - QTextImageFormat - QTextImageFormat - () - - - height - height - () - - - isValid - isValid - () - - - name - name - () - - - setHeight - setHeight - ( qreal height ) - - - setName - setName - ( const QString & name ) - - - setWidth - setWidth - ( qreal width ) - - - width - width - () - - - - QTextInlineObject - qtextinlineobject.html - - QTextInlineObject - QTextInlineObject - ( int i, QTextEngine * e ) - - - ascent - ascent - () - - - descent - descent - () - - - format - format - () - - - formatIndex - formatIndex - () - - - height - height - () - - - isValid - isValid - () - - - rect - rect - () - - - setAscent - setAscent - ( qreal a ) - - - setDescent - setDescent - ( qreal d ) - - - setWidth - setWidth - ( qreal w ) - - - LayoutDirection - textDirection - QTextInlineObject::textDirection() - - - textPosition - textPosition - () - - - width - width - () - - - - QTextIStream - qtextistream.html - - QTextIStream - QTextIStream - ( const QString * string ) - - - QTextIStream - QTextIStream-2 - ( QByteArray * byteArray ) - - - QTextIStream - QTextIStream-3 - ( FILE * file ) - - - - QTextLayout::FormatRange - qtextlayout-formatrange.html - - - QTextLayout - qtextlayout.html - - CursorMode - CursorMode-enum - - - - QTextLayout - QTextLayout - () - - - QTextLayout - QTextLayout-2 - ( const QString & text ) - - - QTextLayout - QTextLayout-3 - ( const QString & text, const QFont & font, QPaintDevice * paintdevice = 0 ) - - - additionalFormats - additionalFormats - () - - - beginLayout - beginLayout - () - - - boundingRect - boundingRect - () - - - cacheEnabled - cacheEnabled - () - - - clearAdditionalFormats - clearAdditionalFormats - () - - - createLine - createLine - () - - - draw - draw - ( QPainter * p, const QPointF & pos, const QVector<FormatRange> & selections = QVector<FormatRange>() - - - drawCursor - drawCursor - ( QPainter * painter, const QPointF & position, int cursorPosition ) - - - endLayout - endLayout - () - - - font - font - () - - - isValidCursorPosition - isValidCursorPosition - ( int pos ) - - - lineAt - lineAt - ( int i ) - - - lineCount - lineCount - () - - - lineForTextPosition - lineForTextPosition - ( int pos ) - - - maximumWidth - maximumWidth - () - - - minimumWidth - minimumWidth - () - - - nextCursorPosition - nextCursorPosition - ( int oldPos, CursorMode mode = SkipCharacters ) - - - position - position - () - - - preeditAreaPosition - preeditAreaPosition - () - - - preeditAreaText - preeditAreaText - () - - - previousCursorPosition - previousCursorPosition - ( int oldPos, CursorMode mode = SkipCharacters ) - - - setAdditionalFormats - setAdditionalFormats - ( const QList<FormatRange> & formatList ) - - - setCacheEnabled - setCacheEnabled - ( bool enable ) - - - setFont - setFont - ( const QFont & font ) - - - setPosition - setPosition - ( const QPointF & p ) - - - setPreeditArea - setPreeditArea - ( int position, const QString & text ) - - - setText - setText - ( const QString & string ) - - - setTextOption - setTextOption - ( const QTextOption & option ) - - - text - text - () - - - textOption - textOption - () - - - - QTextLength - qtextlength.html - - Type - Type-enum - - - - QTextLength - QTextLength - () - - - QTextLength - QTextLength-2 - ( Type type, qreal value ) - - - rawValue - rawValue - () - - - type - type - () - - - value - value - ( qreal maximumLength ) - - - operator - operator-QVariant - QVariant() - - - operator!= - operator-not-eq - ( const QTextLength & other ) - - - operator== - operator-eq-eq - ( const QTextLength & other ) - - - - QTextLine - qtextline.html - - CursorPosition - CursorPosition-enum - - - - Edge - Edge-enum - - - - QTextLine - QTextLine - () - - - ascent - ascent - () - - - cursorToX - cursorToX - ( int * cursorPos, Edge edge = Leading ) - - - cursorToX - cursorToX-2 - ( int cursorPos, Edge edge = Leading ) - - - descent - descent - () - - - draw - draw - ( QPainter * painter, const QPointF & position, const QTextLayout::FormatRange * selection = 0 ) - - - height - height - () - - - isValid - isValid - () - - - lineNumber - lineNumber - () - - - naturalTextRect - naturalTextRect - () - - - naturalTextWidth - naturalTextWidth - () - - - rect - rect - () - - - setLineWidth - setLineWidth - ( qreal width ) - - - setNumColumns - setNumColumns - ( int numColumns ) - - - setPosition - setPosition - ( const QPointF & pos ) - - - textLength - textLength - () - - - textStart - textStart - () - - - width - width - () - - - x - x - () - - - xToCursor - xToCursor - ( qreal x, CursorPosition cpos = CursorBetweenCharacters ) - - - y - y - () - - - - QTextListFormat - qtextlistformat.html - - Style - Style-enum - - - - QTextListFormat - QTextListFormat - () - - - indent - indent - () - - - isValid - isValid - () - - - setIndent - setIndent - ( int indentation ) - - - setStyle - setStyle - ( Style style ) - - - style - style - () - - - - QTextList - qtextlist.html - - add - add - ( const QTextBlock & block ) - - - count - count - () - - - format - format - () - - - item - item - ( int i ) - - - itemNumber - itemNumber - ( const QTextBlock & block ) - - - itemText - itemText - ( const QTextBlock & block ) - - - remove - remove - ( const QTextBlock & block ) - - - removeItem - removeItem - ( int i ) - - - setFormat - setFormat - ( const QTextListFormat & format ) - - - isEmpty - isEmpty - () - - - - QTextObject - qtextobject.html - - QTextObject - QTextObject - ( QTextDocument * document ) - - - document - document - () - - - format - format - () - - - formatIndex - formatIndex - () - - - objectIndex - objectIndex - () - - - setFormat - setFormat - ( const QTextFormat & format ) - - - - QTextOption - qtextoption.html - - WrapMode - WrapMode-enum - - - - QTextOption - QTextOption - () - - - QTextOption - QTextOption-2 - ( Qt::Alignment alignment ) - - - QTextOption - QTextOption-3 - ( const QTextOption & other ) - - - Alignment - alignment - QTextOption::alignment() - - - flags - flags - () - - - setAlignment - setAlignment - ( Qt::Alignment alignment ) - - - setFlags - setFlags - ( Flags flags ) - - - setTabArray - setTabArray - ( QList<qreal> tabStops ) - - - setTabStop - setTabStop - ( qreal tabStop ) - - - setTextDirection - setTextDirection - ( Qt::LayoutDirection direction ) - - - setUseDesignMetrics - setUseDesignMetrics - ( bool enable ) - - - setWrapMode - setWrapMode - ( WrapMode mode ) - - - tabArray - tabArray - () - - - tabStop - tabStop - () - - - LayoutDirection - textDirection - QTextOption::textDirection() - - - useDesignMetrics - useDesignMetrics - () - - - wrapMode - wrapMode - () - - - operator= - operator-eq - ( const QTextOption & other ) - - - - QTextOStream - qtextostream.html - - QTextOStream - QTextOStream - ( QString * string ) - - - QTextOStream - QTextOStream-2 - ( QByteArray * byteArray ) - - - QTextOStream - QTextOStream-3 - ( FILE * file ) - - - - QTextStream - qtextstream.html - - FieldAlignment - FieldAlignment-enum - - - - RealNumberNotation - RealNumberNotation-enum - - - - Status - Status-enum - - - - QTextStream - QTextStream - () - - - QTextStream - QTextStream-2 - ( QIODevice * device ) - - - QTextStream - QTextStream-3 - ( FILE * fileHandle, QIODevice::OpenMode openMode = QIODevice::ReadWrite ) - - - QTextStream - QTextStream-4 - ( QString * string, QIODevice::OpenMode openMode = QIODevice::ReadWrite ) - - - QTextStream - QTextStream-5 - ( QByteArray * array, QIODevice::OpenMode openMode = QIODevice::ReadWrite ) - - - QTextStream - QTextStream-6 - ( const QByteArray & array, QIODevice::OpenMode openMode = QIODevice::ReadOnly ) - - - atEnd - atEnd - () - - - autoDetectUnicode - autoDetectUnicode - () - - - codec - codec - () - - - device - device - () - - - fieldAlignment - fieldAlignment - () - - - fieldWidth - fieldWidth - () - - - flush - flush - () - - - generateByteOrderMark - generateByteOrderMark - () - - - integerBase - integerBase - () - - - numberFlags - numberFlags - () - - - padChar - padChar - () - - - read - read - ( qint64 maxlen ) - - - readAll - readAll - () - - - readLine - readLine - ( qint64 maxlen = 0 ) - - - realNumberNotation - realNumberNotation - () - - - realNumberPrecision - realNumberPrecision - () - - - reset - reset - () - - - resetStatus - resetStatus - () - - - seek - seek - ( qint64 pos ) - - - setAutoDetectUnicode - setAutoDetectUnicode - ( bool enabled ) - - - setCodec - setCodec - ( QTextCodec * codec ) - - - setCodec - setCodec-2 - ( const char * codecName ) - - - setDevice - setDevice - ( QIODevice * device ) - - - setFieldAlignment - setFieldAlignment - ( FieldAlignment mode ) - - - setFieldWidth - setFieldWidth - ( int width ) - - - setGenerateByteOrderMark - setGenerateByteOrderMark - ( bool generate ) - - - setIntegerBase - setIntegerBase - ( int base ) - - - setNumberFlags - setNumberFlags - ( NumberFlags flags ) - - - setPadChar - setPadChar - ( QChar ch ) - - - setRealNumberNotation - setRealNumberNotation - ( RealNumberNotation notation ) - - - setRealNumberPrecision - setRealNumberPrecision - ( int precision ) - - - setStatus - setStatus - ( Status status ) - - - setString - setString - ( QString * string, QIODevice::OpenMode openMode = QIODevice::ReadWrite ) - - - skipWhiteSpace - skipWhiteSpace - () - - - status - status - () - - - string - string - () - - - operator<< - operator-lt-lt - ( QChar c ) - - - operator<< - operator-lt-lt-2 - ( signed short i ) - - - operator<< - operator-lt-lt-3 - ( float f ) - - - operator<< - operator-lt-lt-4 - ( const QString & string ) - - - operator<< - operator-lt-lt-6 - ( char c ) - - - operator<< - operator-lt-lt-7 - ( unsigned short i ) - - - operator<< - operator-lt-lt-8 - ( signed int i ) - - - operator<< - operator-lt-lt-9 - ( unsigned int i ) - - - operator<< - operator-lt-lt-10 - ( signed long i ) - - - operator<< - operator-lt-lt-11 - ( unsigned long i ) - - - operator<< - operator-lt-lt-12 - ( qlonglong i ) - - - operator<< - operator-lt-lt-13 - ( qulonglong i ) - - - operator<< - operator-lt-lt-14 - ( double f ) - - - operator<< - operator-lt-lt-15 - ( const QByteArray & array ) - - - operator<< - operator-lt-lt-16 - ( const char * string ) - - - operator<< - operator-lt-lt-17 - ( const void * ptr ) - - - operator>> - operator-gt-gt - ( QChar & c ) - - - operator>> - operator-gt-gt-2 - ( signed short & i ) - - - operator>> - operator-gt-gt-3 - ( float & f ) - - - operator>> - operator-gt-gt-4 - ( QString & str ) - - - operator>> - operator-gt-gt-5 - ( char & c ) - - - operator>> - operator-gt-gt-6 - ( unsigned short & i ) - - - operator>> - operator-gt-gt-7 - ( signed int & i ) - - - operator>> - operator-gt-gt-8 - ( unsigned int & i ) - - - operator>> - operator-gt-gt-9 - ( signed long & i ) - - - operator>> - operator-gt-gt-10 - ( unsigned long & i ) - - - operator>> - operator-gt-gt-11 - ( qlonglong & i ) - - - operator>> - operator-gt-gt-12 - ( qulonglong & i ) - - - operator>> - operator-gt-gt-13 - ( double & f ) - - - operator>> - operator-gt-gt-14 - ( QByteArray & array ) - - - operator>> - operator-gt-gt-15 - ( char * c ) - - - Encoding - Encoding-enum - - - - fill - fill - ( int f ) - - - flags - flags - () - - - flags - flags-2 - ( int f ) - - - precision - precision - ( int p ) - - - read - read-2 - () - - - setEncoding - setEncoding - ( Encoding encoding ) - - - setf - setf - ( int bits ) - - - setf - setf-2 - ( int bits, int mask ) - - - unsetDevice - unsetDevice - () - - - unsetf - unsetf - ( int bits ) - - - width - width - ( int w ) - - - adjustfield - adjustfield-var - - - - basefield - basefield-var - - - - bin - bin-var - - - - dec - dec-var - - - - fixed - fixed-var - - - - floatfield - floatfield-var - - - - hex - hex-var - - - - internal - internal-var - - - - left - left-var - - - - oct - oct-var - - - - right - right-var - - - - scientific - scientific-var - - - - showbase - showbase-var - - - - showpoint - showpoint-var - - - - showpos - showpos-var - - - - skipws - skipws-var - - - - uppercase - uppercase-var - - - - - QTextTableCell - qtexttablecell.html - - QTextTableCell - QTextTableCell - () - - - QTextTableCell - QTextTableCell-2 - ( const QTextTableCell & other ) - - - iterator - begin - QTextTableCell::begin() - - - column - column - () - - - columnSpan - columnSpan - () - - - iterator - end - QTextTableCell::end() - - - firstCursorPosition - firstCursorPosition - () - - - format - format - () - - - isValid - isValid - () - - - lastCursorPosition - lastCursorPosition - () - - - row - row - () - - - rowSpan - rowSpan - () - - - operator!= - operator-not-eq - ( const QTextTableCell & other ) - - - operator= - operator-eq - ( const QTextTableCell & other ) - - - operator== - operator-eq-eq - ( const QTextTableCell & other ) - - - - QTextTableFormat - qtexttableformat.html - - QTextTableFormat - QTextTableFormat - () - - - Alignment - alignment - QTextTableFormat::alignment() - - - cellPadding - cellPadding - () - - - cellSpacing - cellSpacing - () - - - clearColumnWidthConstraints - clearColumnWidthConstraints - () - - - columnWidthConstraints - columnWidthConstraints - () - - - columns - columns - () - - - isValid - isValid - () - - - setAlignment - setAlignment - ( Qt::Alignment alignment ) - - - setCellPadding - setCellPadding - ( qreal padding ) - - - setCellSpacing - setCellSpacing - ( qreal spacing ) - - - setColumnWidthConstraints - setColumnWidthConstraints - ( const QVector<QTextLength> & constraints ) - - - setColumns - setColumns - ( int columns ) - - - - QTextTable - qtexttable.html - - cellAt - cellAt - ( int row, int column ) - - - cellAt - cellAt-2 - ( int position ) - - - cellAt - cellAt-3 - ( const QTextCursor & cursor ) - - - columns - columns - () - - - format - format - () - - - insertColumns - insertColumns - ( int index, int columns ) - - - insertRows - insertRows - ( int index, int rows ) - - - mergeCells - mergeCells - ( int row, int column, int numRows, int numCols ) - - - mergeCells - mergeCells-2 - ( const QTextCursor & cursor ) - - - removeColumns - removeColumns - ( int index, int columns ) - - - removeRows - removeRows - ( int index, int rows ) - - - resize - resize - ( int rows, int columns ) - - - rowEnd - rowEnd - ( const QTextCursor & cursor ) - - - rowStart - rowStart - ( const QTextCursor & cursor ) - - - rows - rows - () - - - setFormat - setFormat - ( const QTextTableFormat & format ) - - - splitCell - splitCell - ( int row, int column, int numRows, int numCols ) - - - - QThread - qthread.html - - Priority - Priority-enum - - - - QThread - QThread - ( QObject * parent = 0 ) - - - currentThread - currentThread - () - - - HANDLE - currentThreadId - QThread::currentThreadId() - - - exec - exec - () - - - exit - exit - ( int returnCode = 0 ) - - - finished - finished - () - - - isFinished - isFinished - () - - - isRunning - isRunning - () - - - msleep - msleep - ( unsigned long msecs ) - - - priority - priority - () - - - quit - quit - () - - - run - run - () - - - setPriority - setPriority - ( Priority priority ) - - - setStackSize - setStackSize - ( uint stackSize ) - - - setTerminationEnabled - setTerminationEnabled - ( bool enabled = true ) - - - sleep - sleep - ( unsigned long secs ) - - - stackSize - stackSize - () - - - start - start - ( QThread::Priority = InheritPriority ) - - - started - started - () - - - terminate - terminate - () - - - terminated - terminated - () - - - usleep - usleep - ( unsigned long usecs ) - - - wait - wait - ( unsigned long time = ULONG_MAX ) - - - finished - finished-2 - () - - - running - running - () - - - - QThreadStorage - qthreadstorage.html - - QThreadStorage - QThreadStorage - () - - - hasLocalData - hasLocalData - () - - - localData - localData - () - - - localData - localData-2 - () - - - setLocalData - setLocalData - ( T data ) - - - AnchorAttribute - AnchorAttribute-enum - - - - ArrowType - ArrowType-enum - - - - AspectRatioMode - AspectRatioMode-enum - - - - BGMode - BGMode-enum - - - - BrushStyle - BrushStyle-enum - - - - CaseSensitivity - CaseSensitivity-enum - - - - CheckState - CheckState-enum - - - - ClipOperation - ClipOperation-enum - - - - ConnectionType - ConnectionType-enum - - - - ContextMenuPolicy - ContextMenuPolicy-enum - - - - Corner - Corner-enum - - - - CursorShape - CursorShape-enum - - - - DayOfWeek - DayOfWeek-enum - - - - Dock - Dock-enum - - - - FillRule - FillRule-enum - - - - FocusPolicy - FocusPolicy-enum - - - - FocusReason - FocusReason-enum - - - - GlobalColor - GlobalColor-enum - - - - HANDLE - HANDLE-typedef - - - - HitTestAccuracy - HitTestAccuracy-enum - - - - InputMethodQuery - InputMethodQuery-enum - - - - ItemDataRole - ItemDataRole-enum - - - - Key - Key-enum - - - - LayoutDirection - LayoutDirection-enum - - - - Modifier - Modifier-enum - - - - PenCapStyle - PenCapStyle-enum - - - - PenJoinStyle - PenJoinStyle-enum - - - - PenStyle - PenStyle-enum - - - - ScrollBarPolicy - ScrollBarPolicy-enum - - - - ShortcutContext - ShortcutContext-enum - - - - SortOrder - SortOrder-enum - - - - TextElideMode - TextElideMode-enum - - - - TextFlag - TextFlag-enum - - - - TextFormat - TextFormat-enum - - - - TimeSpec - TimeSpec-enum - - - - ToolButtonStyle - ToolButtonStyle-enum - - - - TransformationMode - TransformationMode-enum - - - - UIEffect - UIEffect-enum - - - - WFlags - WFlags-typedef - - - - WhiteSpaceMode - WhiteSpaceMode-enum - - - - WidgetAttribute - WidgetAttribute-enum - - - - WindowModality - WindowModality-enum - - - - convertFromPlainText - convertFromPlainText - ( const QString & plain, WhiteSpaceMode mode = WhiteSpacePre ) - - - escape - escape - ( const QString & plain ) - - - mightBeRichText - mightBeRichText - ( const QString & text ) - - - - QTimeEdit - qtimeedit.html - - QTimeEdit - QTimeEdit - ( QWidget * parent = 0 ) - - - QTimeEdit - QTimeEdit-2 - ( const QTime & time, QWidget * parent = 0 ) - - - - QTime - qtime.html - - QTime - QTime - () - - - QTime - QTime-2 - ( int h, int m, int s = 0, int ms = 0 ) - - - addMSecs - addMSecs - ( int ms ) - - - addSecs - addSecs - ( int nsecs ) - - - currentTime - currentTime-2 - () - - - elapsed - elapsed - () - - - fromString - fromString - ( const QString & string, Qt::DateFormat format = Qt::TextDate ) - - - fromString - fromString-2 - ( const QString & string, const QString & format ) - - - hour - hour - () - - - isNull - isNull - () - - - isValid - isValid - () - - - isValid - isValid-2 - ( int h, int m, int s, int ms = 0 ) - - - minute - minute - () - - - msec - msec - () - - - msecsTo - msecsTo - ( const QTime & t ) - - - restart - restart - () - - - second - second - () - - - secsTo - secsTo - ( const QTime & t ) - - - setHMS - setHMS - ( int h, int m, int s, int ms = 0 ) - - - start - start - () - - - toString - toString - ( const QString & format ) - - - toString - toString-2 - ( Qt::DateFormat f = Qt::TextDate ) - - - operator!= - operator-not-eq - ( const QTime & t ) - - - operator< - operator-lt - ( const QTime & t ) - - - operator<= - operator-lt-eq - ( const QTime & t ) - - - operator== - operator-eq-eq - ( const QTime & t ) - - - operator> - operator-gt - ( const QTime & t ) - - - operator>= - operator-gt-eq - ( const QTime & t ) - - - currentTime - currentTime - ( Qt::TimeSpec spec ) - - - - QTimerEvent - qtimerevent.html - - QTimerEvent - QTimerEvent - ( int timerId ) - - - timerId - timerId - () - - - - QTimer - qtimer.html - - QTimer - QTimer - ( QObject * parent = 0 ) - - - isActive - isActive - () - - - singleShot - singleShot - ( int msec, QObject * receiver, const char * member ) - - - start - start - ( int msec ) - - - start - start-2 - () - - - stop - stop - () - - - timeout - timeout - () - - - timerId - timerId - () - - - QTimer - QTimer-2 - ( QObject * parent, const char * name ) - - - changeInterval - changeInterval - ( int msec ) - - - start - start-3 - ( int msec, bool sshot ) - - - - QToolBar - qtoolbar.html - - ToolBarAreas - allowedAreas-prop - - - - Orientation - orientation-prop - - - - ToolButtonStyle - toolButtonStyle-prop - - - - QToolBar - QToolBar - ( const QString & title, QWidget * parent = 0 ) - - - QToolBar - QToolBar-2 - ( QWidget * parent = 0 ) - - - actionAt - actionAt - ( const QPoint & p ) - - - actionAt - actionAt-2 - ( int x, int y ) - - - actionTriggered - actionTriggered - ( QAction * action ) - - - addAction - addAction - ( const QString & text ) - - - addAction - addAction-2 - ( const QIcon & icon, const QString & text ) - - - addAction - addAction-3 - ( const QString & text, const QObject * receiver, const char * member ) - - - addAction - addAction-4 - ( const QIcon & icon, const QString & text, const QObject * receiver, const char * member ) - - - addSeparator - addSeparator - () - - - addWidget - addWidget - ( QWidget * widget ) - - - allowedAreasChanged - allowedAreasChanged - ( Qt::ToolBarAreas allowedAreas ) - - - clear - clear - () - - - iconSizeChanged - iconSizeChanged - ( const QSize & iconSize ) - - - insertSeparator - insertSeparator - ( QAction * before ) - - - insertWidget - insertWidget - ( QAction * before, QWidget * widget ) - - - isAreaAllowed - isAreaAllowed - ( Qt::ToolBarArea area ) - - - movableChanged - movableChanged - ( bool movable ) - - - orientationChanged - orientationChanged - ( Qt::Orientation orientation ) - - - toggleViewAction - toggleViewAction - () - - - toolButtonStyleChanged - toolButtonStyleChanged - ( Qt::ToolButtonStyle toolButtonStyle ) - - - QToolBar - QToolBar-3 - ( QWidget * parent, const char * name ) - - - label - label - () - - - setLabel - setLabel - ( const QString & label ) - - - - QToolBox - qtoolbox.html - - QToolBox - QToolBox - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - addItem - addItem - ( QWidget * widget, const QIcon & iconSet, const QString & text ) - - - addItem - addItem-2 - ( QWidget * w, const QString & text ) - - - currentChanged - currentChanged - ( int index ) - - - currentWidget - currentWidget - () - - - indexOf - indexOf - ( QWidget * widget ) - - - insertItem - insertItem - ( int index, QWidget * widget, const QIcon & icon, const QString & text ) - - - insertItem - insertItem-2 - ( int index, QWidget * widget, const QString & text ) - - - isItemEnabled - isItemEnabled - ( int index ) - - - itemIcon - itemIcon - ( int index ) - - - itemInserted - itemInserted - ( int index ) - - - itemRemoved - itemRemoved - ( int index ) - - - itemText - itemText - ( int index ) - - - itemToolTip - itemToolTip - ( int index ) - - - removeItem - removeItem - ( int index ) - - - setCurrentWidget - setCurrentWidget - ( QWidget * widget ) - - - setItemEnabled - setItemEnabled - ( int index, bool enabled ) - - - setItemIcon - setItemIcon - ( int index, const QIcon & icon ) - - - setItemText - setItemText - ( int index, const QString & text ) - - - setItemToolTip - setItemToolTip - ( int index, const QString & toolTip ) - - - widget - widget - ( int index ) - - - QToolBox - QToolBox-2 - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - currentItem - currentItem - () - - - item - item - ( int index ) - - - itemIconSet - itemIconSet - ( int index ) - - - itemLabel - itemLabel - ( int index ) - - - removeItem - removeItem-2 - ( QWidget * widget ) - - - setCurrentItem - setCurrentItem - ( QWidget * widget ) - - - setItemIconSet - setItemIconSet - ( int index, const QIcon & icon ) - - - setItemLabel - setItemLabel - ( int index, const QString & text ) - - - - QToolButton - qtoolbutton.html - - ToolButtonPopupMode - ToolButtonPopupMode-enum - - - - ArrowType - arrowType-prop - - - - ToolButtonStyle - toolButtonStyle-prop - - - - QToolButton - QToolButton - ( QWidget * parent = 0 ) - - - defaultAction - defaultAction - () - - - menu - menu - () - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - setDefaultAction - setDefaultAction - ( QAction * action ) - - - setMenu - setMenu - ( QMenu * menu ) - - - showMenu - showMenu - () - - - triggered - triggered - ( QAction * action ) - - - TextPosition - TextPosition-enum - - - - QToolButton - QToolButton-3 - ( QWidget * parent, const char * name ) - - - QToolButton - QToolButton-4 - ( Qt::ArrowType type, QWidget * parent, const char * name ) - - - QToolButton - QToolButton-5 - ( const QIcon & icon, const QString & textLabel, const QString & statusTip, QObject * receiver, const char * slot, QWidget * parent, const char * name = 0 ) - - - iconSet - iconSet - () - - - iconSet - iconSet-2 - ( bool on ) - - - offIconSet - offIconSet - () - - - onIconSet - onIconSet - () - - - openPopup - openPopup - () - - - popup - popup - () - - - popupDelay - popupDelay - () - - - setIconSet - setIconSet - ( const QIcon & icon ) - - - setIconSet - setIconSet-2 - ( const QIcon & set, bool on ) - - - setOffIconSet - setOffIconSet - ( const QIcon & set ) - - - setOnIconSet - setOnIconSet - ( const QIcon & set ) - - - setPixmap - setPixmap - ( const QPixmap & pixmap ) - - - setPopup - setPopup - ( QMenu * popup ) - - - setPopupDelay - setPopupDelay - ( int delay ) - - - setTextLabel - setTextLabel - ( const QString & text, bool tooltip = true ) - - - setTextPosition - setTextPosition - ( QToolButton::TextPosition pos ) - - - setUsesBigPixmap - setUsesBigPixmap - ( bool enable ) - - - setUsesTextLabel - setUsesTextLabel - ( bool enable ) - - - textLabel - textLabel - () - - - textPosition - textPosition - () - - - usesBigPixmap - usesBigPixmap - () - - - usesTextLabel - usesTextLabel - () - - - - QToolTip - qtooltip.html - - palette - palette - () - - - showText - showText - ( const QPoint & pos, const QString & text, QWidget * w = 0 ) - - - add - add - ( QWidget * widget, const QString & text ) - - - add - add-2 - ( QWidget * widget, const QRect & rect, const QString & text ) - - - remove - remove - ( QWidget * widget ) - - - BackgroundMode - BackgroundMode-enum - - - - ButtonState - ButtonState-typedef - - - - ButtonState_enum - ButtonState_enum-enum - - - - GUIStyle - GUIStyle-enum - - - - MacintoshVersion - MacintoshVersion-enum - - - - PaintUnit - PaintUnit-enum - - - - ScaleMode - ScaleMode-typedef - - - - TextFlags - TextFlags-typedef - - - - ToolBarDock - ToolBarDock-typedef - - - - WindowsVersion - WindowsVersion-enum - - - - - QTransformedScreen - qtransformedscreen.html - - Transformation - Transformation-enum - - - - QTransformedScreen - QTransformedScreen - ( int displayId ) - - - setTransformation - setTransformation - ( Transformation transformation ) - - - transformation - transformation - () - - - - QTranslator - qtranslator.html - - QTranslator - QTranslator - ( QObject * parent = 0 ) - - - isEmpty - isEmpty - () - - - load - load - ( const QString & filename, const QString & directory = QString() - - - load - load-2 - ( const uchar * data, int len ) - - - translate - translate - ( const char * context, const char * sourceText, const char * comment = 0 ) - - - QTranslator - QTranslator-2 - ( QObject * parent, const char * name ) - - - find - find - ( const char * context, const char * sourceText, const char * comment = 0 ) - - - - QTreeView - qtreeview.html - - QTreeView - QTreeView - ( QWidget * parent = 0 ) - - - collapse - collapse - ( const QModelIndex & index ) - - - collapsed - collapsed - ( const QModelIndex & index ) - - - columnAt - columnAt - ( int x ) - - - columnCountChanged - columnCountChanged - ( int oldCount, int newCount ) - - - columnMoved - columnMoved - () - - - columnResized - columnResized - ( int column, int oldSize, int newSize ) - - - columnViewportPosition - columnViewportPosition - ( int column ) - - - columnWidth - columnWidth - ( int column ) - - - doItemsLayout - doItemsLayout - () - - - drawBranches - drawBranches - ( QPainter * painter, const QRect & rect, const QModelIndex & index ) - - - drawRow - drawRow - ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) - - - expand - expand - ( const QModelIndex & index ) - - - expanded - expanded - ( const QModelIndex & index ) - - - header - header - () - - - hideColumn - hideColumn - ( int column ) - - - horizontalOffset - horizontalOffset - () - - - indexAbove - indexAbove - ( const QModelIndex & index ) - - - indexBelow - indexBelow - ( const QModelIndex & index ) - - - indexRowSizeHint - indexRowSizeHint - ( const QModelIndex & index ) - - - isColumnHidden - isColumnHidden - ( int column ) - - - isExpanded - isExpanded - ( const QModelIndex & index ) - - - isRowHidden - isRowHidden - ( int row, const QModelIndex & parent ) - - - moveCursor - moveCursor - ( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) - - - resizeColumnToContents - resizeColumnToContents - ( int column ) - - - rowsAboutToBeRemoved - rowsAboutToBeRemoved - ( const QModelIndex & parent, int start, int end ) - - - rowsInserted - rowsInserted - ( const QModelIndex & parent, int start, int end ) - - - rowsRemoved - rowsRemoved - ( const QModelIndex & parent, int start, int end ) - - - scrollContentsBy - scrollContentsBy - ( int dx, int dy ) - - - scrollTo - scrollTo - ( const QModelIndex & index, ScrollHint hint = EnsureVisible ) - - - selectAll - selectAll - () - - - setColumnHidden - setColumnHidden - ( int column, bool hide ) - - - setExpanded - setExpanded - ( const QModelIndex & index, bool expanded ) - - - setHeader - setHeader - ( QHeaderView * header ) - - - setRowHidden - setRowHidden - ( int row, const QModelIndex & parent, bool hide ) - - - setSelection - setSelection - ( const QRect & rect, QItemSelectionModel::SelectionFlags command ) - - - showColumn - showColumn - ( int column ) - - - sizeHintForColumn - sizeHintForColumn - ( int column ) - - - sortByColumn - sortByColumn - ( int column ) - - - verticalOffset - verticalOffset - () - - - visualRect - visualRect - ( const QModelIndex & index ) - - - visualRegionForSelection - visualRegionForSelection - ( const QItemSelection & selection ) - - - - QTreeWidget - qtreewidget.html - - QTreeWidget - QTreeWidget - ( QWidget * parent = 0 ) - - - addTopLevelItem - addTopLevelItem - ( QTreeWidgetItem * item ) - - - addTopLevelItems - addTopLevelItems - ( const QList<QTreeWidgetItem *> & items ) - - - clear - clear - () - - - closePersistentEditor - closePersistentEditor - ( QTreeWidgetItem * item, int column = 0 ) - - - collapseItem - collapseItem - ( const QTreeWidgetItem * item ) - - - currentColumn - currentColumn - () - - - currentItem - currentItem - () - - - currentItemChanged - currentItemChanged - ( QTreeWidgetItem * current, QTreeWidgetItem * previous ) - - - dropMimeData - dropMimeData - ( QTreeWidgetItem * parent, int index, const QMimeData * data, Qt::DropAction action ) - - - editItem - editItem - ( QTreeWidgetItem * item, int column = 0 ) - - - event - event - ( QEvent * e ) - - - expandItem - expandItem - ( const QTreeWidgetItem * item ) - - - findItems - findItems - ( const QString & text, Qt::MatchFlags flags, int column = 0 ) - - - headerItem - headerItem - () - - - indexFromItem - indexFromItem - ( QTreeWidgetItem * item, int column = 0 ) - - - indexOfTopLevelItem - indexOfTopLevelItem - ( QTreeWidgetItem * item ) - - - insertTopLevelItem - insertTopLevelItem - ( int index, QTreeWidgetItem * item ) - - - insertTopLevelItems - insertTopLevelItems - ( int index, const QList<QTreeWidgetItem *> & items ) - - - isItemExpanded - isItemExpanded - ( const QTreeWidgetItem * item ) - - - isItemHidden - isItemHidden - ( const QTreeWidgetItem * item ) - - - isItemSelected - isItemSelected - ( const QTreeWidgetItem * item ) - - - itemActivated - itemActivated - ( QTreeWidgetItem * item, int column ) - - - itemAt - itemAt - ( const QPoint & p ) - - - itemAt - itemAt-2 - ( int x, int y ) - - - itemChanged - itemChanged - ( QTreeWidgetItem * item, int column ) - - - itemClicked - itemClicked - ( QTreeWidgetItem * item, int column ) - - - itemCollapsed - itemCollapsed - ( QTreeWidgetItem * item ) - - - itemDoubleClicked - itemDoubleClicked - ( QTreeWidgetItem * item, int column ) - - - itemEntered - itemEntered - ( QTreeWidgetItem * item, int column ) - - - itemExpanded - itemExpanded - ( QTreeWidgetItem * item ) - - - itemFromIndex - itemFromIndex - ( const QModelIndex & index ) - - - itemPressed - itemPressed - ( QTreeWidgetItem * item, int column ) - - - itemSelectionChanged - itemSelectionChanged - () - - - itemWidget - itemWidget - ( QTreeWidgetItem * item, int column ) - - - items - items - ( const QMimeData * data ) - - - mimeData - mimeData - ( const QList<QTreeWidgetItem *> items ) - - - mimeTypes - mimeTypes - () - - - openPersistentEditor - openPersistentEditor - ( QTreeWidgetItem * item, int column = 0 ) - - - scrollToItem - scrollToItem - ( const QTreeWidgetItem * item, QAbstractItemView::ScrollHint hint = EnsureVisible ) - - - selectedItems - selectedItems - () - - - setCurrentItem - setCurrentItem - ( QTreeWidgetItem * item ) - - - setCurrentItem - setCurrentItem-2 - ( QTreeWidgetItem * item, int column ) - - - setHeaderItem - setHeaderItem - ( QTreeWidgetItem * item ) - - - setHeaderLabels - setHeaderLabels - ( const QStringList & labels ) - - - setItemExpanded - setItemExpanded - ( const QTreeWidgetItem * item, bool expand ) - - - setItemHidden - setItemHidden - ( const QTreeWidgetItem * item, bool hide ) - - - setItemSelected - setItemSelected - ( const QTreeWidgetItem * item, bool select ) - - - setItemWidget - setItemWidget - ( QTreeWidgetItem * item, int column, QWidget * widget ) - - - sortColumn - sortColumn - () - - - sortItems - sortItems - ( int column, Qt::SortOrder order ) - - - DropActions - supportedDropActions - QTreeWidget::supportedDropActions() - - - takeTopLevelItem - takeTopLevelItem - ( int index ) - - - topLevelItem - topLevelItem - ( int index ) - - - visualItemRect - visualItemRect - ( const QTreeWidgetItem * item ) - - - - QTreeWidgetItem - qtreewidgetitem.html - - QTreeWidgetItem - QTreeWidgetItem - ( int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-2 - ( const QStringList & strings, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-3 - ( QTreeWidget * parent, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-4 - ( QTreeWidget * parent, const QStringList & strings, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-5 - ( QTreeWidget * parent, QTreeWidgetItem * preceding, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-6 - ( QTreeWidgetItem * parent, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-7 - ( QTreeWidgetItem * parent, const QStringList & strings, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-8 - ( QTreeWidgetItem * parent, QTreeWidgetItem * preceding, int type = Type ) - - - QTreeWidgetItem - QTreeWidgetItem-9 - ( const QTreeWidgetItem & other ) - - - addChild - addChild - ( QTreeWidgetItem * child ) - - - addChildren - addChildren - ( const QList<QTreeWidgetItem *> & children ) - - - backgroundColor - backgroundColor - ( int column ) - - - CheckState - checkState - QTreeWidgetItem::checkState( int column ) - - - child - child - ( int index ) - - - childCount - childCount - () - - - clone - clone - () - - - columnCount - columnCount - () - - - data - data - ( int column, int role ) - - - ItemFlags - flags - QTreeWidgetItem::flags() - - - font - font - ( int column ) - - - icon - icon - ( int column ) - - - indexOfChild - indexOfChild - ( QTreeWidgetItem * child ) - - - insertChild - insertChild - ( int index, QTreeWidgetItem * child ) - - - insertChildren - insertChildren - ( int index, const QList<QTreeWidgetItem *> & children ) - - - parent - parent - () - - - read - read - ( QDataStream & in ) - - - setBackgroundColor - setBackgroundColor - ( int column, const QColor & color ) - - - setCheckState - setCheckState - ( int column, Qt::CheckState state ) - - - setData - setData - ( int column, int role, const QVariant & value ) - - - setFlags - setFlags - ( Qt::ItemFlags flags ) - - - setFont - setFont - ( int column, const QFont & font ) - - - setIcon - setIcon - ( int column, const QIcon & icon ) - - - setSizeHint - setSizeHint - ( int column, const QSize & size ) - - - setStatusTip - setStatusTip - ( int column, const QString & statusTip ) - - - setText - setText - ( int column, const QString & text ) - - - setTextAlignment - setTextAlignment - ( int column, int alignment ) - - - setTextColor - setTextColor - ( int column, const QColor & color ) - - - setToolTip - setToolTip - ( int column, const QString & toolTip ) - - - setWhatsThis - setWhatsThis - ( int column, const QString & whatsThis ) - - - sizeHint - sizeHint - ( int column ) - - - statusTip - statusTip - ( int column ) - - - takeChild - takeChild - ( int index ) - - - takeChildren - takeChildren - () - - - text - text - ( int column ) - - - textAlignment - textAlignment - ( int column ) - - - textColor - textColor - ( int column ) - - - toolTip - toolTip - ( int column ) - - - treeWidget - treeWidget - () - - - type - type - () - - - whatsThis - whatsThis - ( int column ) - - - write - write - ( QDataStream & out ) - - - operator< - operator-lt - ( const QTreeWidgetItem & other ) - - - operator= - operator-eq - ( const QTreeWidgetItem & other ) - - - Type - Type-var - - - - UserType - UserType-var - - - - - QTreeWidgetItemIterator - qtreewidgetitemiterator.html - - QTreeWidgetItemIterator - QTreeWidgetItemIterator - ( const QTreeWidgetItemIterator & it ) - - - QTreeWidgetItemIterator - QTreeWidgetItemIterator-2 - ( QTreeWidget * widget, IteratorFlags flags = All ) - - - QTreeWidgetItemIterator - QTreeWidgetItemIterator-3 - ( QTreeWidgetItem * item, IteratorFlags flags = All ) - - - operator* - operator-2a - () - - - operator++ - operator-2b-2b - () - - - operator++ - operator-2b-2b-2 - ( int ) - - - operator+= - operator-2b-eq - ( int n ) - - - operator-- - operator-- - () - - - operator-- - operator---2 - ( int ) - - - operator-= - operator--eq - ( int n ) - - - operator= - operator-eq - ( const QTreeWidgetItemIterator & it ) - - - - QUdpSocket - qudpsocket.html - - QUdpSocket - QUdpSocket - ( QObject * parent = 0 ) - - - bind - bind - ( const QHostAddress & address, quint16 port ) - - - bind - bind-2 - ( const QHostAddress & address, quint16 port, BindMode mode ) - - - bind - bind-3 - ( quint16 port = 0 ) - - - bind - bind-4 - ( quint16 port, BindMode mode ) - - - hasPendingDatagrams - hasPendingDatagrams - () - - - pendingDatagramSize - pendingDatagramSize - () - - - readDatagram - readDatagram - ( char * data, qint64 maxSize, QHostAddress * address = 0, quint16 * port = 0 ) - - - writeDatagram - writeDatagram - ( const char * data, qint64 size, const QHostAddress & address, quint16 port ) - - - writeDatagram - writeDatagram-2 - ( const QByteArray & datagram, const QHostAddress & host, quint16 port ) - - - - QUiLoader - quiloader.html - - QUiLoader - QUiLoader - ( QObject * parent = 0 ) - - - addPluginPath - addPluginPath - ( const QString & path ) - - - availableWidgets - availableWidgets - () - - - clearPluginPaths - clearPluginPaths - () - - - createAction - createAction - ( QObject * parent = 0, const QString & name = QString() - - - createActionGroup - createActionGroup - ( QObject * parent = 0, const QString & name = QString() - - - createLayout - createLayout - ( const QString & className, QObject * parent = 0, const QString & name = QString() - - - createWidget - createWidget - ( const QString & className, QWidget * parent = 0, const QString & name = QString() - - - load - load - ( QIODevice * device, QWidget * parentWidget = 0 ) - - - pluginPaths - pluginPaths - () - - - - QUrl - qurl.html - - ParsingMode - ParsingMode-enum - - - - QUrl - QUrl - () - - - QUrl - QUrl-2 - ( const QString & url ) - - - QUrl - QUrl-3 - ( const QUrl & other ) - - - QUrl - QUrl-4 - ( const QString & url, ParsingMode parsingMode ) - - - addQueryItem - addQueryItem - ( const QString & key, const QString & value ) - - - allQueryItemValues - allQueryItemValues - ( const QString & key ) - - - authority - authority - () - - - clear - clear - () - - - encodedQuery - encodedQuery - () - - - fragment - fragment - () - - - fromEncoded - fromEncoded - ( const QByteArray & input ) - - - fromEncoded - fromEncoded-2 - ( const QByteArray & input, ParsingMode parsingMode ) - - - fromLocalFile - fromLocalFile - ( const QString & localFile ) - - - fromPercentEncoding - fromPercentEncoding - ( const QByteArray & input ) - - - fromPunycode - fromPunycode - ( const QByteArray & pc ) - - - hasQueryItem - hasQueryItem - ( const QString & key ) - - - host - host - () - - - isEmpty - isEmpty - () - - - isParentOf - isParentOf - ( const QUrl & childUrl ) - - - isRelative - isRelative - () - - - isValid - isValid - () - - - password - password - () - - - path - path - () - - - port - port - () - - - port - port-2 - ( int defaultPort ) - - - queryItemValue - queryItemValue - ( const QString & key ) - - - queryItems - queryItems - () - - - queryPairDelimiter - queryPairDelimiter - () - - - queryValueDelimiter - queryValueDelimiter - () - - - removeAllQueryItems - removeAllQueryItems - ( const QString & key ) - - - removeQueryItem - removeQueryItem - ( const QString & key ) - - - resolved - resolved - ( const QUrl & relative ) - - - scheme - scheme - () - - - setAuthority - setAuthority - ( const QString & authority ) - - - setEncodedQuery - setEncodedQuery - ( const QByteArray & query ) - - - setEncodedUrl - setEncodedUrl - ( const QByteArray & encodedUrl ) - - - setEncodedUrl - setEncodedUrl-2 - ( const QByteArray & encodedUrl, ParsingMode parsingMode ) - - - setFragment - setFragment - ( const QString & fragment ) - - - setHost - setHost - ( const QString & host ) - - - setPassword - setPassword - ( const QString & password ) - - - setPath - setPath - ( const QString & path ) - - - setPort - setPort - ( int port ) - - - setQueryDelimiters - setQueryDelimiters - ( char valueDelimiter, char pairDelimiter ) - - - setQueryItems - setQueryItems - ( const QList<QPair<QString, QString> > & query ) - - - setScheme - setScheme - ( const QString & scheme ) - - - setUrl - setUrl - ( const QString & url ) - - - setUrl - setUrl-2 - ( const QString & url, ParsingMode parsingMode ) - - - setUserInfo - setUserInfo - ( const QString & userInfo ) - - - setUserName - setUserName - ( const QString & userName ) - - - toEncoded - toEncoded - ( FormattingOptions options = None ) - - - toLocalFile - toLocalFile - () - - - toPercentEncoding - toPercentEncoding - ( const QString & input, const QByteArray & exclude = QByteArray() - - - toPunycode - toPunycode - ( const QString & uc ) - - - toString - toString - ( FormattingOptions options = None ) - - - userInfo - userInfo - () - - - userName - userName - () - - - operator!= - operator-not-eq - ( const QUrl & url ) - - - operator= - operator-eq - ( const QUrl & url ) - - - operator= - operator-eq-2 - ( const QString & url ) - - - operator== - operator-eq-eq - ( const QUrl & url ) - - - - QUrlInfo - qurlinfo.html - - PermissionSpec - PermissionSpec-enum - - - - QUrlInfo - QUrlInfo - () - - - QUrlInfo - QUrlInfo-2 - ( const QUrlInfo & ui ) - - - QUrlInfo - QUrlInfo-3 - ( const QString & name, int permissions, const QString & owner, const QString & group, qint64 size, const QDateTime & lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable ) - - - QUrlInfo - QUrlInfo-4 - ( const QUrl & url, int permissions, const QString & owner, const QString & group, qint64 size, const QDateTime & lastModified, const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, bool isWritable, bool isReadable, bool isExecutable ) - - - equal - equal - ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy ) - - - greaterThan - greaterThan - ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy ) - - - group - group - () - - - isDir - isDir - () - - - isExecutable - isExecutable - () - - - isFile - isFile - () - - - isReadable - isReadable - () - - - isSymLink - isSymLink - () - - - isValid - isValid - () - - - isWritable - isWritable - () - - - lastModified - lastModified - () - - - lastRead - lastRead - () - - - lessThan - lessThan - ( const QUrlInfo & i1, const QUrlInfo & i2, int sortBy ) - - - name - name - () - - - owner - owner - () - - - permissions - permissions - () - - - setDir - setDir - ( bool b ) - - - setFile - setFile - ( bool b ) - - - setGroup - setGroup - ( const QString & s ) - - - setLastModified - setLastModified - ( const QDateTime & dt ) - - - setName - setName - ( const QString & name ) - - - setOwner - setOwner - ( const QString & s ) - - - setPermissions - setPermissions - ( int p ) - - - setReadable - setReadable - ( bool b ) - - - setSize - setSize - ( qint64 size ) - - - setSymLink - setSymLink - ( bool b ) - - - setWritable - setWritable - ( bool b ) - - - size - size - () - - - operator= - operator-eq - ( const QUrlInfo & ui ) - - - operator== - operator-eq-eq - ( const QUrlInfo & i ) - - - addPath - addPath - ( const QString & p ) - - - cdUp - cdUp - () - - - decode - decode - ( QString & url ) - - - dirPath - dirPath - () - - - encode - encode - ( QString & url ) - - - fileName - fileName - () - - - hasHost - hasHost - () - - - hasPassword - hasPassword - () - - - hasPath - hasPath - () - - - hasPort - hasPort - () - - - hasRef - hasRef - () - - - hasUser - hasUser - () - - - isRelativeUrl - isRelativeUrl - ( const QString & url ) - - - protocol - protocol - () - - - query - query - () - - - ref - ref - () - - - reset - reset - () - - - setFileName - setFileName - ( const QString & txt ) - - - setProtocol - setProtocol - ( const QString & s ) - - - setQuery - setQuery - ( const QString & txt ) - - - setRef - setRef - ( const QString & txt ) - - - setUser - setUser - ( const QString & s ) - - - user - user - () - - - operator - operator-QString - QString() - - - - QUuid - quuid.html - - Variant - Variant-enum - - - - Version - Version-enum - - - - QUuid - QUuid - () - - - QUuid - QUuid-2 - ( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) - - - QUuid - QUuid-3 - ( const QString & text ) - - - QUuid - QUuid-5 - ( const GUID & guid ) - - - createUuid - createUuid - () - - - isNull - isNull - () - - - toString - toString - () - - - Variant - variant - QUuid::variant() - - - Version - version - QUuid::version() - - - operator - operator-GUID - GUID() - - - operator - operator-QString - QString() - - - operator!= - operator-not-eq - ( const QUuid & other ) - - - operator!= - operator-not-eq-2 - ( const GUID & guid ) - - - operator< - operator-lt - ( const QUuid & other ) - - - operator= - operator-eq - ( const GUID & guid ) - - - operator== - operator-eq-eq - ( const QUuid & other ) - - - operator== - operator-eq-eq-2 - ( const GUID & guid ) - - - operator> - operator-gt - ( const QUuid & other ) - - - - QValidator - qvalidator.html - - State - State-enum - - - - QValidator - QValidator - ( QObject * parent ) - - - fixup - fixup - ( QString & input ) - - - validate - validate - ( QString & input, int & pos ) - - - QValidator - QValidator-2 - ( QObject * parent, const char * name ) - - - - QVariant - qvariant.html - - Type - Type-enum - - - - QVariant - QVariant - () - - - QVariant - QVariant-2 - ( Type type ) - - - QVariant - QVariant-3 - ( int typeOrUserType, const void * copy ) - - - QVariant - QVariant-4 - ( const QVariant & p ) - - - QVariant - QVariant-5 - ( QDataStream & s ) - - - QVariant - QVariant-6 - ( int val ) - - - QVariant - QVariant-7 - ( uint val ) - - - QVariant - QVariant-8 - ( qlonglong val ) - - - QVariant - QVariant-9 - ( qulonglong val ) - - - QVariant - QVariant-10 - ( bool val ) - - - QVariant - QVariant-11 - ( double val ) - - - QVariant - QVariant-12 - ( const char * val ) - - - QVariant - QVariant-13 - ( const QByteArray & val ) - - - QVariant - QVariant-14 - ( const QBitArray & val ) - - - QVariant - QVariant-15 - ( const QString & val ) - - - QVariant - QVariant-16 - ( const QLatin1String & val ) - - - QVariant - QVariant-17 - ( const QStringList & val ) - - - QVariant - QVariant-18 - ( const QChar & c ) - - - QVariant - QVariant-19 - ( const QDate & val ) - - - QVariant - QVariant-20 - ( const QTime & val ) - - - QVariant - QVariant-21 - ( const QDateTime & val ) - - - QVariant - QVariant-22 - ( const QList<QVariant> & val ) - - - QVariant - QVariant-23 - ( const QMap<QString, QVariant> & val ) - - - QVariant - QVariant-24 - ( const QSize & val ) - - - QVariant - QVariant-25 - ( const QSizeF & val ) - - - QVariant - QVariant-26 - ( const QPoint & val ) - - - QVariant - QVariant-27 - ( const QPointF & val ) - - - QVariant - QVariant-28 - ( const QLine & val ) - - - QVariant - QVariant-29 - ( const QLineF & val ) - - - QVariant - QVariant-30 - ( const QRect & val ) - - - QVariant - QVariant-31 - ( const QRectF & val ) - - - QVariant - QVariant-32 - ( const QUrl & val ) - - - QVariant - QVariant-33 - ( const QLocale & l ) - - - QVariant - QVariant-34 - ( const QRegExp & regExp ) - - - canConvert - canConvert - ( Type t ) - - - canConvert - canConvert-2 - () - - - clear - clear - () - - - convert - convert - ( Type t ) - - - fromValue - fromValue - ( const T & value ) - - - isNull - isNull - () - - - isValid - isValid - () - - - nameToType - nameToType - ( const char * name ) - - - setValue - setValue - ( const T & value ) - - - toBitArray - toBitArray - () - - - toBool - toBool - () - - - toByteArray - toByteArray - () - - - toChar - toChar - () - - - toDate - toDate - () - - - toDateTime - toDateTime - () - - - toDouble - toDouble - ( bool * ok = 0 ) - - - toInt - toInt - ( bool * ok = 0 ) - - - toLine - toLine - () - - - toLineF - toLineF - () - - - toList - toList - () - - - toLocale - toLocale - () - - - toLongLong - toLongLong - ( bool * ok = 0 ) - - - toMap - toMap - () - - - toPoint - toPoint - () - - - toPointF - toPointF - () - - - toRect - toRect - () - - - toRectF - toRectF - () - - - toRegExp - toRegExp - () - - - toSize - toSize - () - - - toSizeF - toSizeF - () - - - toString - toString - () - - - toStringList - toStringList - () - - - toTime - toTime - () - - - toUInt - toUInt - ( bool * ok = 0 ) - - - toULongLong - toULongLong - ( bool * ok = 0 ) - - - toUrl - toUrl - () - - - type - type - () - - - typeName - typeName - () - - - typeToName - typeToName - ( Type typ ) - - - userType - userType - () - - - value - value - () - - - operator!= - operator-not-eq - ( const QVariant & v ) - - - operator= - operator-eq - ( const QVariant & variant ) - - - operator== - operator-eq-eq - ( const QVariant & v ) - - - QVariant - QVariant-35 - ( bool b, int dummy ) - - - asBitArray - asBitArray - () - - - asBool - asBool - () - - - asByteArray - asByteArray - () - - - asCString - asCString - () - - - asDate - asDate - () - - - asDateTime - asDateTime - () - - - asDouble - asDouble - () - - - asInt - asInt - () - - - asList - asList - () - - - asLongLong - asLongLong - () - - - asMap - asMap - () - - - asPoint - asPoint - () - - - asRect - asRect - () - - - asSize - asSize - () - - - asString - asString - () - - - asStringList - asStringList - () - - - asTime - asTime - () - - - asUInt - asUInt - () - - - asULongLong - asULongLong - () - - - canCast - canCast - ( Type t ) - - - cast - cast - ( Type t ) - - - toCString - toCString - () - - - - QVarLengthArray - qvarlengtharray.html - - QVarLengthArray - QVarLengthArray - ( int size = 0 ) - - - QVarLengthArray - QVarLengthArray-2 - ( const QVarLengthArray<T, Prealloc> & other ) - - - append - append - ( const T & t ) - - - append - append-2 - ( const T * buf, int size ) - - - capacity - capacity - () - - - clear - clear - () - - - constData - constData - () - - - count - count - () - - - data - data - () - - - data - data-2 - () - - - isEmpty - isEmpty - () - - - reserve - reserve - ( int size ) - - - resize - resize - ( int size ) - - - size - size - () - - - operator= - operator-eq - ( const QVarLengthArray<T, Prealloc> & other ) - - - operator[] - operator-5b-5d - ( int i ) - - - operator[] - operator-5b-5d-2 - ( int i ) - - - - QVBoxLayout - qvboxlayout.html - - QVBoxLayout - QVBoxLayout - () - - - QVBoxLayout - QVBoxLayout-2 - ( QWidget * parent ) - - - QVBoxLayout - QVBoxLayout-3 - ( QWidget * parent, int margin, int spacing = -1, const char * name = 0 ) - - - QVBoxLayout - QVBoxLayout-4 - ( QLayout * parentLayout, int spacing = -1, const char * name = 0 ) - - - QVBoxLayout - QVBoxLayout-5 - ( int spacing, const char * name = 0 ) - - - - QVector - qvector.html - - ConstIterator - ConstIterator-typedef - - - - Iterator - Iterator-typedef - - - - const_iterator - const_iterator-typedef - - - - iterator - iterator-typedefx - - - - QVector - QVector - () - - - QVector - QVector-2 - ( int size ) - - - QVector - QVector-3 - ( int size, const T & value ) - - - QVector - QVector-4 - ( const QVector<T> & other ) - - - append - append - ( const T & value ) - - - at - at - ( int i ) - - - back - back - () - - - back - back-2 - () - - - begin - begin - () - - - begin - begin-2 - () - - - capacity - capacity - () - - - clear - clear - () - - - constBegin - constBegin - () - - - constData - constData - () - - - constEnd - constEnd - () - - - contains - contains - ( const T & value ) - - - count - count - ( const T & value ) - - - count - count-2 - () - - - data - data - () - - - data - data-2 - () - - - empty - empty - () - - - end - end - () - - - end - end-2 - () - - - erase - erase - ( iterator pos ) - - - erase - erase-2 - ( iterator begin, iterator end ) - - - fill - fill - ( const T & value, int size = -1 ) - - - first - first - () - - - first - first-2 - () - - - fromList - fromList - ( const QList<T> & list ) - - - fromStdVector - fromStdVector - ( const std::vector<T> & vector ) - - - front - front - () - - - front - front-2 - () - - - indexOf - indexOf - ( const T & value, int from = 0 ) - - - insert - insert - ( int i, const T & value ) - - - insert - insert-2 - ( iterator before, int count, const T & value ) - - - insert - insert-3 - ( int i, int count, const T & value ) - - - insert - insert-4 - ( iterator before, const T & value ) - - - isEmpty - isEmpty - () - - - last - last - () - - - last - last-2 - () - - - lastIndexOf - lastIndexOf - ( const T & value, int from = -1 ) - - - mid - mid - ( int pos, int length = -1 ) - - - pop_back - pop_back - () - - - pop_front - pop_front - () - - - prepend - prepend - ( const T & value ) - - - push_back - push_back - ( const T & value ) - - - push_front - push_front - ( const T & value ) - - - remove - remove - ( int i ) - - - remove - remove-2 - ( int i, int count ) - - - replace - replace - ( int i, const T & value ) - - - reserve - reserve - ( int size ) - - - resize - resize - ( int size ) - - - size - size - () - - - squeeze - squeeze - () - - - toList - toList - () - - - vector - toStdVector - <T> QVector::toStdVector() - - - value - value - ( int i ) - - - value - value-2 - ( int i, const T & defaultValue ) - - - operator!= - operator-not-eq - ( const QVector<T> & other ) - - - operator+ - operator-2b - ( const QVector<T> & other ) - - - operator+= - operator-2b-eq - ( const QVector<T> & other ) - - - operator+= - operator-2b-eq-2 - ( const T & value ) - - - operator<< - operator-lt-lt - ( const T & value ) - - - operator<< - operator-lt-lt-2 - ( const QVector<T> & other ) - - - operator= - operator-eq - ( const QVector<T> & other ) - - - operator== - operator-eq-eq - ( const QVector<T> & other ) - - - operator[] - operator-5b-5d - ( int i ) - - - operator[] - operator-5b-5d-2 - ( int i ) - - - - QVectorIterator - qvectoriterator.html - - QVectorIterator - QVectorIterator - ( const QVector<T> & vector ) - - - findNext - findNext - ( const T & value ) - - - findPrevious - findPrevious - ( const T & value ) - - - hasNext - hasNext - () - - - hasPrevious - hasPrevious - () - - - next - next - () - - - peekNext - peekNext - () - - - peekPrevious - peekPrevious - () - - - previous - previous - () - - - toBack - toBack - () - - - toFront - toFront - () - - - operator= - operator-eq - ( const QVector<T> & vector ) - - - - QVFbScreen - qvfbscreen.html - - QVFbScreen - QVFbScreen - ( int displayId ) - - - - QVNCScreen - qvncscreen.html - - QVNCScreen - QVNCScreen - ( int displayId ) - - - - QWaitCondition - qwaitcondition.html - - QWaitCondition - QWaitCondition - () - - - wait - wait - ( QMutex * mutex, unsigned long time = ULONG_MAX ) - - - wakeAll - wakeAll - () - - - wakeOne - wakeOne - () - - - - QWhatsThisClickedEvent - qwhatsthisclickedevent.html - - QWhatsThisClickedEvent - QWhatsThisClickedEvent - ( const QString & href ) - - - href - href - () - - - - QWhatsThis - qwhatsthis.html - - createAction - createAction - ( QObject * parent = 0 ) - - - enterWhatsThisMode - enterWhatsThisMode - () - - - hideText - hideText - () - - - inWhatsThisMode - inWhatsThisMode - () - - - leaveWhatsThisMode - leaveWhatsThisMode - () - - - showText - showText - ( const QPoint & pos, const QString & text, QWidget * w = 0 ) - - - add - add - ( QWidget * w, const QString & s ) - - - remove - remove - ( QWidget * w ) - - - whatsThisButton - whatsThisButton - ( QWidget * parent ) - - - - QWheelEvent - qwheelevent.html - - QWheelEvent - QWheelEvent - ( const QPoint & pos, int delta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::Orientation orient = Qt::Vertical ) - - - QWheelEvent - QWheelEvent-2 - ( const QPoint & pos, const QPoint & globalPos, int delta, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::Orientation orient = Qt::Vertical ) - - - MouseButtons - buttons - QWheelEvent::buttons() - - - delta - delta - () - - - globalPos - globalPos - () - - - globalX - globalX - () - - - globalY - globalY - () - - - Orientation - orientation - QWheelEvent::orientation() - - - pos - pos - () - - - x - x - () - - - y - y - () - - - QWheelEvent - QWheelEvent-3 - ( const QPoint & pos, int delta, int state, Qt::Orientation orient = Qt::Vertical ) - - - QWheelEvent - QWheelEvent-4 - ( const QPoint & pos, const QPoint & globalPos, int delta, int state, Qt::Orientation orient = Qt::Vertical ) - - - ButtonState - state - QWheelEvent::state() - - - - QWidget - qwidget.html - - ContextMenuPolicy - contextMenuPolicy-prop - - - - FocusPolicy - focusPolicy-prop - - - - LayoutDirection - layoutDirection-prop - - - - WindowFlags - windowFlags-prop - - - - WindowModality - windowModality-prop - - - - QWidget - QWidget - ( QWidget * parent = 0, Qt::WFlags f = 0 ) - - - actionEvent - actionEvent - ( QActionEvent * event ) - - - actions - actions - () - - - activateWindow - activateWindow - () - - - addAction - addAction - ( QAction * action ) - - - addActions - addActions - ( QList<QAction *> actions ) - - - adjustSize - adjustSize - () - - - ColorRole - backgroundRole - QWidget::backgroundRole() - - - changeEvent - changeEvent - ( QEvent * event ) - - - childAt - childAt - ( int x, int y ) - - - childAt - childAt-4 - ( const QPoint & p ) - - - clearFocus - clearFocus - () - - - clearMask - clearMask - () - - - close - close - () - - - closeEvent - closeEvent - ( QCloseEvent * event ) - - - contentsRect - contentsRect - () - - - contextMenuEvent - contextMenuEvent - ( QContextMenuEvent * event ) - - - create - create - ( WId window = 0, bool initializeWindow = true, bool destroyOldWindow = true ) - - - customContextMenuRequested - customContextMenuRequested - ( const QPoint & pos ) - - - destroy - destroy - ( bool destroyWindow = true, bool destroySubWindows = true ) - - - dragEnterEvent - dragEnterEvent - ( QDragEnterEvent * event ) - - - dragLeaveEvent - dragLeaveEvent - ( QDragLeaveEvent * event ) - - - dragMoveEvent - dragMoveEvent - ( QDragMoveEvent * event ) - - - dropEvent - dropEvent - ( QDropEvent * event ) - - - ensurePolished - ensurePolished - () - - - enterEvent - enterEvent - ( QEvent * event ) - - - event - event - ( QEvent * event ) - - - find - find - ( WId id ) - - - focusInEvent - focusInEvent - ( QFocusEvent * event ) - - - focusNextChild - focusNextChild - () - - - focusNextPrevChild - focusNextPrevChild - ( bool next ) - - - focusOutEvent - focusOutEvent - ( QFocusEvent * event ) - - - focusPreviousChild - focusPreviousChild - () - - - focusProxy - focusProxy - () - - - focusWidget - focusWidget - () - - - fontInfo - fontInfo - () - - - fontMetrics - fontMetrics - () - - - ColorRole - foregroundRole - QWidget::foregroundRole() - - - getContentsMargins - getContentsMargins - ( int * left, int * top, int * right, int * bottom ) - - - getDC - getDC - () - - - grabKeyboard - grabKeyboard - () - - - grabMouse - grabMouse - () - - - grabMouse - grabMouse-2 - ( const QCursor & cursor ) - - - grabShortcut - grabShortcut - ( const QKeySequence & key, Qt::ShortcutContext context = Qt::WindowShortcut ) - - - hasEditFocus - hasEditFocus - () - - - heightForWidth - heightForWidth - ( int w ) - - - hide - hide - () - - - hideEvent - hideEvent - ( QHideEvent * event ) - - - inputContext - inputContext - () - - - inputMethodEvent - inputMethodEvent - ( QInputMethodEvent * event ) - - - inputMethodQuery - inputMethodQuery - ( Qt::InputMethodQuery query ) - - - insertAction - insertAction - ( QAction * before, QAction * action ) - - - insertActions - insertActions - ( QAction * before, QList<QAction *> actions ) - - - isAncestorOf - isAncestorOf - ( const QWidget * child ) - - - isEnabledTo - isEnabledTo - ( QWidget * ancestor ) - - - isHidden - isHidden - () - - - isVisibleTo - isVisibleTo - ( QWidget * ancestor ) - - - isWindow - isWindow - () - - - keyPressEvent - keyPressEvent - ( QKeyEvent * event ) - - - keyReleaseEvent - keyReleaseEvent - ( QKeyEvent * event ) - - - keyboardGrabber - keyboardGrabber - () - - - layout - layout - () - - - leaveEvent - leaveEvent - ( QEvent * event ) - - - lower - lower - () - - - macEvent - macEvent - ( EventHandlerCallRef caller, EventRef event ) - - - mapFrom - mapFrom - ( QWidget * parent, const QPoint & pos ) - - - mapFromGlobal - mapFromGlobal - ( const QPoint & pos ) - - - mapFromParent - mapFromParent - ( const QPoint & pos ) - - - mapTo - mapTo - ( QWidget * parent, const QPoint & pos ) - - - mapToGlobal - mapToGlobal - ( const QPoint & pos ) - - - mapToParent - mapToParent - ( const QPoint & pos ) - - - mask - mask - () - - - metric - metric - ( PaintDeviceMetric m ) - - - mouseDoubleClickEvent - mouseDoubleClickEvent - ( QMouseEvent * event ) - - - mouseGrabber - mouseGrabber - () - - - mouseMoveEvent - mouseMoveEvent - ( QMouseEvent * event ) - - - mousePressEvent - mousePressEvent - ( QMouseEvent * event ) - - - mouseReleaseEvent - mouseReleaseEvent - ( QMouseEvent * event ) - - - moveEvent - moveEvent - ( QMoveEvent * event ) - - - nextInFocusChain - nextInFocusChain - () - - - overrideWindowFlags - overrideWindowFlags - ( Qt::WindowFlags flags ) - - - paintEngine - paintEngine - () - - - paintEvent - paintEvent - ( QPaintEvent * event ) - - - parentWidget - parentWidget - () - - - qwsEvent - qwsEvent - ( QWSEvent * event ) - - - raise - raise - () - - - releaseDC - releaseDC - ( HDC hdc ) - - - releaseKeyboard - releaseKeyboard - () - - - releaseMouse - releaseMouse - () - - - releaseShortcut - releaseShortcut - ( int id ) - - - removeAction - removeAction - ( QAction * action ) - - - repaint - repaint - () - - - repaint - repaint-6 - ( int x, int y, int w, int h ) - - - repaint - repaint-7 - ( const QRect & r ) - - - repaint - repaint-8 - ( const QRegion & rgn ) - - - resetInputContext - resetInputContext - () - - - resizeEvent - resizeEvent - ( QResizeEvent * event ) - - - scroll - scroll - ( int dx, int dy ) - - - scroll - scroll-2 - ( int dx, int dy, const QRect & r ) - - - setAttribute - setAttribute - ( Qt::WidgetAttribute attribute, bool on = true ) - - - setBackgroundRole - setBackgroundRole - ( QPalette::ColorRole role ) - - - setContentsMargins - setContentsMargins - ( int left, int top, int right, int bottom ) - - - setDisabled - setDisabled - ( bool disable ) - - - setEditFocus - setEditFocus - ( bool on ) - - - setFixedHeight - setFixedHeight - ( int h ) - - - setFixedSize - setFixedSize - ( const QSize & s ) - - - setFixedSize - setFixedSize-2 - ( int w, int h ) - - - setFixedWidth - setFixedWidth - ( int w ) - - - setFocus - setFocus - ( Qt::FocusReason reason ) - - - setFocus - setFocus-2 - () - - - setFocusProxy - setFocusProxy - ( QWidget * w ) - - - setForegroundRole - setForegroundRole - ( QPalette::ColorRole role ) - - - setHidden - setHidden - ( bool hidden ) - - - setInputContext - setInputContext - ( QInputContext * context ) - - - setLayout - setLayout - ( QLayout * layout ) - - - setMask - setMask - ( const QBitmap & bitmap ) - - - setMask - setMask-2 - ( const QRegion & region ) - - - setParent - setParent - ( QWidget * parent ) - - - setParent - setParent-2 - ( QWidget * parent, Qt::WFlags f ) - - - setShortcutEnabled - setShortcutEnabled - ( int id, bool enable = true ) - - - setStyle - setStyle - ( QStyle * style ) - - - setTabOrder - setTabOrder - ( QWidget * first, QWidget * second ) - - - setWindowRole - setWindowRole - ( const QString & role ) - - - setWindowState - setWindowState - ( Qt::WindowStates windowState ) - - - show - show - () - - - showEvent - showEvent - ( QShowEvent * event ) - - - showFullScreen - showFullScreen - () - - - showMaximized - showMaximized - () - - - showMinimized - showMinimized - () - - - showNormal - showNormal - () - - - stackUnder - stackUnder - ( QWidget * w ) - - - style - style - () - - - tabletEvent - tabletEvent - ( QTabletEvent * event ) - - - testAttribute - testAttribute - ( Qt::WidgetAttribute attribute ) - - - underMouse - underMouse - () - - - update - update - () - - - update - update-2 - ( int x, int y, int w, int h ) - - - update - update-3 - ( const QRect & r ) - - - update - update-4 - ( const QRegion & rgn ) - - - updateGeometry - updateGeometry - () - - - updateMicroFocus - updateMicroFocus - () - - - visibleRegion - visibleRegion - () - - - wheelEvent - wheelEvent - ( QWheelEvent * event ) - - - winEvent - winEvent - ( MSG * message, long * result ) - - - winId - winId - () - - - window - window - () - - - windowRole - windowRole - () - - - WindowStates - windowState - QWidget::windowState() - - - WindowType - windowType - QWidget::windowType() - - - x11Event - x11Event - ( XEvent * event ) - - - x11Info - x11Info - () - - - HANDLE - x11PictureHandle - QWidget::x11PictureHandle() - - - - QWidgetItem - qwidgetitem.html - - QWidgetItem - QWidgetItem - ( QWidget * widget ) - - - isEmpty - isEmpty - () - - - widget - widget - () - - - isEnabledToTLW - isEnabledToTLW - () - - - isTopLevel - isTopLevel - () - - - languageChange - languageChange - () - - - topLevelWidget - topLevelWidget - () - - - BackgroundOrigin - BackgroundOrigin-enum - - - - QWidget - QWidget-3 - ( QWidget * parent, const char * name, Qt::WFlags f = 0 ) - - - BackgroundMode - backgroundMode - QWidget::backgroundMode() - - - backgroundOffset - backgroundOffset - () - - - backgroundOrigin - backgroundOrigin - () - - - caption - caption - () - - - childAt - childAt-2 - ( int x, int y, bool includeThis ) - - - childAt - childAt-3 - ( const QPoint & p, bool includeThis ) - - - close - close-2 - ( bool alsoDelete ) - - - colorGroup - colorGroup - () - - - constPolish - constPolish - () - - - drawText - drawText - ( const QPoint & p, const QString & s ) - - - drawText - drawText-2 - ( int x, int y, const QString & s ) - - - erase - erase - () - - - erase - erase-2 - ( int x, int y, int w, int h ) - - - erase - erase-3 - ( const QRect & rect ) - - - erase - erase-4 - ( const QRegion & rgn ) - - - hasMouse - hasMouse - () - - - icon - icon - () - - - iconText - iconText - () - - - iconify - iconify - () - - - isDesktop - isDesktop - () - - - isDialog - isDialog - () - - - isInputMethodEnabled - isInputMethodEnabled - () - - - isPopup - isPopup - () - - - isShown - isShown - () - - - isUpdatesEnabled - isUpdatesEnabled - () - - - isVisibleToTLW - isVisibleToTLW - () - - - ownCursor - ownCursor - () - - - ownFont - ownFont - () - - - ownPalette - ownPalette - () - - - parentWidget - parentWidget-2 - ( bool sameWindow ) - - - polish - polish - () - - - recreate - recreate - ( QWidget * parent, Qt::WFlags f, const QPoint & p, bool showIt = false ) - - - repaint - repaint-2 - ( bool b ) - - - repaint - repaint-3 - ( int x, int y, int w, int h, bool b ) - - - repaint - repaint-4 - ( const QRect & r, bool b ) - - - repaint - repaint-5 - ( const QRegion & rgn, bool b ) - - - reparent - reparent - ( QWidget * parent, Qt::WFlags f, const QPoint & p, bool showIt = false ) - - - reparent - reparent-2 - ( QWidget * parent, const QPoint & p, bool showIt = false ) - - - setActiveWindow - setActiveWindow - () - - - setBackgroundColor - setBackgroundColor - ( const QColor & color ) - - - setBackgroundMode - setBackgroundMode - ( Qt::BackgroundMode widgetBackground, Qt::BackgroundMode paletteBackground = Qt::PaletteBackground ) - - - setBackgroundOrigin - setBackgroundOrigin - ( BackgroundOrigin background ) - - - setBackgroundPixmap - setBackgroundPixmap - ( const QPixmap & pixmap ) - - - setCaption - setCaption - ( const QString & c ) - - - setEraseColor - setEraseColor - ( const QColor & color ) - - - setErasePixmap - setErasePixmap - ( const QPixmap & pixmap ) - - - setFont - setFont-2 - ( const QFont & f, bool b ) - - - setIcon - setIcon - ( const QPixmap & i ) - - - setIconText - setIconText - ( const QString & it ) - - - setInputMethodEnabled - setInputMethodEnabled - ( bool enabled ) - - - setKeyCompression - setKeyCompression - ( bool b ) - - - setPalette - setPalette-2 - ( const QPalette & p, bool b ) - - - setPaletteBackgroundColor - setPaletteBackgroundColor - ( const QColor & color ) - - - setPaletteBackgroundPixmap - setPaletteBackgroundPixmap - ( const QPixmap & pixmap ) - - - setPaletteForegroundColor - setPaletteForegroundColor - ( const QColor & color ) - - - setShown - setShown - ( bool shown ) - - - setSizePolicy - setSizePolicy-2 - ( QSizePolicy::Policy hor, QSizePolicy::Policy ver, bool hfw ) - - - setStyle - setStyle-2 - ( const QString & style ) - - - unsetFont - unsetFont - () - - - unsetPalette - unsetPalette - () - - - visibleRect - visibleRect - () - - - wmapper - wmapper - () - - - - QWindowsMime - qwindowsmime.html - - QWindowsMime - QWindowsMime - () - - - canConvertFromMime - canConvertFromMime - ( const FORMATETC & formatetc, const QMimeData * mimeData ) - - - canConvertToMime - canConvertToMime - ( const QString & mimeType, IDataObject * pDataObj ) - - - convertFromMime - convertFromMime - ( const FORMATETC & formatetc, const QMimeData * mimeData, STGMEDIUM * pmedium ) - - - convertToMime - convertToMime - ( const QString & mimeType, IDataObject * pDataObj, QVariant::Type preferredType ) - - - formatsForMime - formatsForMime - ( const QString & mimeType, const QMimeData * mimeData ) - - - mimeForFormat - mimeForFormat - ( const FORMATETC & formatetc ) - - - registerMimeType - registerMimeType - ( const QString & mime ) - - - - QWindowsStyle - qwindowsstyle.html - - QWindowsStyle - QWindowsStyle - () - - - - QWindowStateChangeEvent - qwindowstatechangeevent.html - - WindowStates - oldState - QWindowStateChangeEvent::oldState() - - - - QWindowsXPStyle - qwindowsxpstyle.html - - QWindowsXPStyle - QWindowsXPStyle - () - - - - QWorkspace - qworkspace.html - - WindowOrder - WindowOrder-enum - - - - QWorkspace - QWorkspace - ( QWidget * parent = 0 ) - - - activateNextWindow - activateNextWindow - () - - - activatePreviousWindow - activatePreviousWindow - () - - - activeWindow - activeWindow - () - - - addWindow - addWindow - ( QWidget * w, Qt::WFlags flags = 0 ) - - - arrangeIcons - arrangeIcons - () - - - cascade - cascade - () - - - closeActiveWindow - closeActiveWindow - () - - - closeAllWindows - closeAllWindows - () - - - setActiveWindow - setActiveWindow - ( QWidget * w ) - - - tile - tile - () - - - windowActivated - windowActivated - ( QWidget * w ) - - - windowList - windowList - ( WindowOrder order = CreationOrder ) - - - QWorkspace - QWorkspace-2 - ( QWidget * parent, const char * name ) - - - setPaletteBackgroundColor - setPaletteBackgroundColor - ( const QColor & c ) - - - setPaletteBackgroundPixmap - setPaletteBackgroundPixmap - ( const QPixmap & pm ) - - - - QWriteLocker - qwritelocker.html - - QWriteLocker - QWriteLocker - ( QReadWriteLock * lock ) - - - readWriteLock - readWriteLock - () - - - relock - relock - () - - - unlock - unlock - () - - - - QWSCalibratedMouseHandler - qwscalibratedmousehandler.html - - calibrate - calibrate - ( const QWSPointerCalibrationData * data ) - - - clearCalibration - clearCalibration - () - - - readCalibration - readCalibration - () - - - sendFiltered - sendFiltered - ( const QPoint & position, int state ) - - - setFilterSize - setFilterSize - ( int size ) - - - transform - transform - ( const QPoint & position ) - - - writeCalibration - writeCalibration - () - - - - QWSClient - qwsclient.html - - clientId - clientId - () - - - identity - identity - () - - - - QWSEvent - qwsevent.html - - Type - Type-enum - - - - - QWSInputMethod - qwsinputmethod.html - - UpdateType - UpdateType-enum - - - - QWSInputMethod - QWSInputMethod - () - - - filter - filter - ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) - - - filter - filter-2 - ( const QPoint & position, int state, int wheel ) - - - inputResolutionShift - inputResolutionShift - () - - - mouseHandler - mouseHandler - ( int offset, int state ) - - - queryResponse - queryResponse - ( int property, const QVariant & result ) - - - reset - reset - () - - - sendCommitString - sendCommitString - ( const QString & commitString, int replaceFromPosition = 0, int replaceLength = 0 ) - - - sendEvent - sendEvent - ( const QInputMethodEvent * ) - - - sendMouseEvent - sendMouseEvent - ( const QPoint & position, int state, int wheel ) - - - sendPreeditString - sendPreeditString - ( const QString & preeditString, int cursorPosition, int selectionLength = 0 ) - - - sendQuery - sendQuery - ( int property ) - - - setInputResolution - setInputResolution - ( bool isHigh ) - - - updateHandler - updateHandler - ( int type ) - - - sendIMEvent - sendIMEvent - ( QWSServer::IMState state, const QString & text, int cursorPosition, int selectionLength = 0 ) - - - - QWSKeyboardHandler - qwskeyboardhandler.html - - QWSKeyboardHandler - QWSKeyboardHandler - () - - - beginAutoRepeat - beginAutoRepeat - ( int unicode, int keycode, Qt::KeyboardModifiers modifier ) - - - endAutoRepeat - endAutoRepeat - () - - - processKeyEvent - processKeyEvent - ( int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat ) - - - transformDirKey - transformDirKey - ( int keycode ) - - - - QWSMouseHandler - qwsmousehandler.html - - QWSMouseHandler - QWSMouseHandler - ( const QString & driver = QString() - - - calibrate - calibrate - ( const QWSPointerCalibrationData * data ) - - - clearCalibration - clearCalibration - () - - - limitToScreen - limitToScreen - ( QPoint & position ) - - - mouseChanged - mouseChanged - ( const QPoint & position, int state, int wheel = 0 ) - - - pos - pos - () - - - resume - resume - () - - - suspend - suspend - () - - - - QWSPointerCalibrationData - qwspointercalibrationdata.html - - Location - Location-enum - - - - - QWSScreenSaver - qwsscreensaver.html - - restore - restore - () - - - save - save - ( int level ) - - - - QWSServer - qwsserver.html - - IMMouse - IMMouse-enum - - - - WindowEvent - WindowEvent-enum - - - - addKeyboardFilter - addKeyboardFilter - ( KeyboardFilter * filter ) - - - backgroundBrush - backgroundBrush - () - - - clientWindows - clientWindows - () - - - closeKeyboard - closeKeyboard - () - - - closeMouse - closeMouse - () - - - enablePainting - enablePainting - ( bool enable ) - - - isCursorVisible - isCursorVisible - () - - - keyMap - keyMap - () - - - keyboardHandler - keyboardHandler - () - - - markedText - markedText - ( const QString & selection ) - - - mouseHandler - mouseHandler - () - - - newChannel - newChannel - ( const QString & channel ) - - - openKeyboard - openKeyboard - () - - - openMouse - openMouse - () - - - processKeyEvent - processKeyEvent - ( int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat ) - - - refresh - refresh - () - - - refresh - refresh-2 - ( QRegion & region ) - - - removeKeyboardFilter - removeKeyboardFilter - () - - - removedChannel - removedChannel - ( const QString & channel ) - - - resumeMouse - resumeMouse - () - - - screenSaverActivate - screenSaverActivate - ( bool activate ) - - - screenSaverActive - screenSaverActive - () - - - sendIMEvent - sendIMEvent - ( const QInputMethodEvent * event ) - - - sendIMQuery - sendIMQuery - ( int property ) - - - sendKeyEvent - sendKeyEvent - ( int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat ) - - - setBackground - setBackground - ( const QBrush & brush ) - - - setCurrentInputMethod - setCurrentInputMethod - ( QWSInputMethod * method ) - - - setCursorVisible - setCursorVisible - ( bool visible ) - - - setDefaultKeyboard - setDefaultKeyboard - ( const char * keyboardDriver ) - - - setDefaultMouse - setDefaultMouse - ( const char * mouseDriver ) - - - setKeyboardHandler - setKeyboardHandler - ( QWSKeyboardHandler * handler ) - - - setMaxWindowRect - setMaxWindowRect - ( const QRect & rectangle ) - - - setMouseHandler - setMouseHandler - ( QWSMouseHandler * handler ) - - - setScreenSaver - setScreenSaver - ( QWSScreenSaver * screenSaver ) - - - setScreenSaverInterval - setScreenSaverInterval - ( int milliseconds ) - - - setScreenSaverIntervals - setScreenSaverIntervals - ( int * intervals ) - - - suspendMouse - suspendMouse - () - - - windowAt - windowAt - ( const QPoint & position ) - - - windowEvent - windowEvent - ( QWSWindow * window, QWSServer::WindowEvent eventType ) - - - - QWSServer::KeyboardFilter - qwsserver-keyboardfilter.html - - filter - filter - ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ) - - - - QWSServer::KeyMap - qwsserver-keymap.html - - ctrl_unicode - ctrl_unicode-var - - - - key_code - key_code-var - - - - shift_unicode - shift_unicode-var - - - - unicode - unicode-var - - - - IMState - IMState-enum - - - - QWSServer - QWSServer-2 - ( int flags, QObject * parent, const char * name ) - - - setDesktopBackground - setDesktopBackground - ( const QImage & img ) - - - setDesktopBackground - setDesktopBackground-2 - ( const QColor & c ) - - - - QWSTslibMouseHandler - qwstslibmousehandler.html - - - QWSWindow - qwswindow.html - - caption - caption - () - - - client - client - () - - - isFullyObscured - isFullyObscured - () - - - isOpaque - isOpaque - () - - - isVisible - isVisible - () - - - name - name - () - - - opacity - opacity - () - - - requestedRegion - requestedRegion - () - - - winId - winId - () - - - - QX11EmbedContainer - qx11embedcontainer.html - - Error - Error-enum - - - - QX11EmbedContainer - QX11EmbedContainer - ( QWidget * parent = 0 ) - - - clientClosed - clientClosed - () - - - clientIsEmbedded - clientIsEmbedded - () - - - clientWinId - clientWinId - () - - - discardClient - discardClient - () - - - embedClient - embedClient - ( WId id ) - - - error - error - () - - - error - error-2 - ( QX11EmbedContainer::Error error ) - - - - QX11EmbedWidget - qx11embedwidget.html - - Error - Error-enum - - - - QX11EmbedWidget - QX11EmbedWidget - ( QWidget * parent = 0 ) - - - containerClosed - containerClosed - () - - - containerWinId - containerWinId - () - - - embedInto - embedInto - ( WId id ) - - - embedded - embedded - () - - - error - error - () - - - error - error-2 - ( QX11EmbedWidget::Error error ) - - - - QX11Info - qx11info.html - - QX11Info - QX11Info - () - - - QX11Info - QX11Info-2 - ( const QX11Info & other ) - - - appCells - appCells - ( int screen = -1 ) - - - appClass - appClass - () - - - HANDLE - appColormap - QX11Info::appColormap( int screen = -1 ) - - - appDefaultColormap - appDefaultColormap - ( int screen = -1 ) - - - appDefaultVisual - appDefaultVisual - ( int screen = -1 ) - - - appDepth - appDepth - ( int screen = -1 ) - - - appDpiX - appDpiX - ( int screen = -1 ) - - - appDpiY - appDpiY - ( int screen = -1 ) - - - HANDLE - appRootWindow - QX11Info::appRootWindow( int screen = -1 ) - - - appScreen - appScreen - () - - - appTime - appTime - () - - - appUserTime - appUserTime - () - - - appVisual - appVisual - ( int screen = -1 ) - - - cells - cells - () - - - HANDLE - colormap - QX11Info::colormap() - - - defaultColormap - defaultColormap - () - - - defaultVisual - defaultVisual - () - - - depth - depth - () - - - display - display - () - - - screen - screen - () - - - setAppDpiX - setAppDpiX - ( int screen, int xdpi ) - - - setAppDpiY - setAppDpiY - ( int screen, int ydpi ) - - - setAppTime - setAppTime - ( unsigned long time ) - - - setAppUserTime - setAppUserTime - ( unsigned long time ) - - - visual - visual - () - - - operator= - operator-eq - ( const QX11Info & other ) - - - - QXmlAttributes - qxmlattributes.html - - QXmlAttributes - QXmlAttributes - () - - - append - append - ( const QString & qName, const QString & uri, const QString & localPart, const QString & value ) - - - clear - clear - () - - - count - count - () - - - index - index - ( const QString & qName ) - - - index - index-2 - ( const QString & uri, const QString & localPart ) - - - length - length - () - - - localName - localName - ( int index ) - - - qName - qName - ( int index ) - - - type - type - ( int index ) - - - type - type-2 - ( const QString & qName ) - - - type - type-3 - ( const QString & uri, const QString & localName ) - - - uri - uri - ( int index ) - - - value - value - ( int index ) - - - value - value-2 - ( const QString & qName ) - - - value - value-3 - ( const QString & uri, const QString & localName ) - - - - QXmlContentHandler - qxmlcontenthandler.html - - characters - characters - ( const QString & ch ) - - - endDocument - endDocument - () - - - endElement - endElement - ( const QString & namespaceURI, const QString & localName, const QString & qName ) - - - endPrefixMapping - endPrefixMapping - ( const QString & prefix ) - - - errorString - errorString - () - - - ignorableWhitespace - ignorableWhitespace - ( const QString & ch ) - - - processingInstruction - processingInstruction - ( const QString & target, const QString & data ) - - - setDocumentLocator - setDocumentLocator - ( QXmlLocator * locator ) - - - skippedEntity - skippedEntity - ( const QString & name ) - - - startDocument - startDocument - () - - - startElement - startElement - ( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts ) - - - startPrefixMapping - startPrefixMapping - ( const QString & prefix, const QString & uri ) - - - - QXmlDeclHandler - qxmldeclhandler.html - - attributeDecl - attributeDecl - ( const QString & eName, const QString & aName, const QString & type, const QString & valueDefault, const QString & value ) - - - errorString - errorString - () - - - externalEntityDecl - externalEntityDecl - ( const QString & name, const QString & publicId, const QString & systemId ) - - - internalEntityDecl - internalEntityDecl - ( const QString & name, const QString & value ) - - - - QXmlDefaultHandler - qxmldefaulthandler.html - - QXmlDefaultHandler - QXmlDefaultHandler - () - - - - QXmlDTDHandler - qxmldtdhandler.html - - errorString - errorString - () - - - notationDecl - notationDecl - ( const QString & name, const QString & publicId, const QString & systemId ) - - - unparsedEntityDecl - unparsedEntityDecl - ( const QString & name, const QString & publicId, const QString & systemId, const QString & notationName ) - - - - QXmlEntityResolver - qxmlentityresolver.html - - errorString - errorString - () - - - resolveEntity - resolveEntity - ( const QString & publicId, const QString & systemId, QXmlInputSource *& ret ) - - - - QXmlErrorHandler - qxmlerrorhandler.html - - error - error - ( const QXmlParseException & exception ) - - - errorString - errorString - () - - - fatalError - fatalError - ( const QXmlParseException & exception ) - - - warning - warning - ( const QXmlParseException & exception ) - - - - QXmlInputSource - qxmlinputsource.html - - QXmlInputSource - QXmlInputSource - () - - - QXmlInputSource - QXmlInputSource-2 - ( QIODevice * dev ) - - - data - data - () - - - fetchData - fetchData - () - - - fromRawData - fromRawData - ( const QByteArray & data, bool beginning = false ) - - - next - next - () - - - reset - reset - () - - - setData - setData - ( const QString & dat ) - - - setData - setData-2 - ( const QByteArray & dat ) - - - QXmlInputSource - QXmlInputSource-3 - ( QFile & file ) - - - QXmlInputSource - QXmlInputSource-4 - ( QTextStream & stream ) - - - - QXmlLexicalHandler - qxmllexicalhandler.html - - comment - comment - ( const QString & ch ) - - - endCDATA - endCDATA - () - - - endDTD - endDTD - () - - - endEntity - endEntity - ( const QString & name ) - - - errorString - errorString - () - - - startCDATA - startCDATA - () - - - startDTD - startDTD - ( const QString & name, const QString & publicId, const QString & systemId ) - - - startEntity - startEntity - ( const QString & name ) - - - - QXmlLocator - qxmllocator.html - - QXmlLocator - QXmlLocator - () - - - columnNumber - columnNumber - () - - - lineNumber - lineNumber - () - - - - QXmlNamespaceSupport - qxmlnamespacesupport.html - - QXmlNamespaceSupport - QXmlNamespaceSupport - () - - - popContext - popContext - () - - - prefix - prefix - ( const QString & uri ) - - - prefixes - prefixes - () - - - prefixes - prefixes-2 - ( const QString & uri ) - - - processName - processName - ( const QString & qname, bool isAttribute, QString & nsuri, QString & localname ) - - - pushContext - pushContext - () - - - reset - reset - () - - - setPrefix - setPrefix - ( const QString & pre, const QString & uri ) - - - splitName - splitName - ( const QString & qname, QString & prefix, QString & localname ) - - - uri - uri - ( const QString & prefix ) - - - - QXmlParseException - qxmlparseexception.html - - QXmlParseException - QXmlParseException - ( const QString & name = QString() - - - columnNumber - columnNumber - () - - - lineNumber - lineNumber - () - - - message - message - () - - - publicId - publicId - () - - - systemId - systemId - () - - - - QXmlReader - qxmlreader.html - - DTDHandler - DTDHandler - () - - - contentHandler - contentHandler - () - - - declHandler - declHandler - () - - - entityResolver - entityResolver - () - - - errorHandler - errorHandler - () - - - feature - feature - ( const QString & name, bool * ok = 0 ) - - - hasFeature - hasFeature - ( const QString & name ) - - - hasProperty - hasProperty - ( const QString & name ) - - - lexicalHandler - lexicalHandler - () - - - parse - parse-2 - ( const QXmlInputSource * input ) - - - property - property - ( const QString & name, bool * ok = 0 ) - - - setContentHandler - setContentHandler - ( QXmlContentHandler * handler ) - - - setDTDHandler - setDTDHandler - ( QXmlDTDHandler * handler ) - - - setDeclHandler - setDeclHandler - ( QXmlDeclHandler * handler ) - - - setEntityResolver - setEntityResolver - ( QXmlEntityResolver * handler ) - - - setErrorHandler - setErrorHandler - ( QXmlErrorHandler * handler ) - - - setFeature - setFeature - ( const QString & name, bool value ) - - - setLexicalHandler - setLexicalHandler - ( QXmlLexicalHandler * handler ) - - - setProperty - setProperty - ( const QString & name, void * value ) - - - parse - parse - ( const QXmlInputSource & input ) - - - - QXmlSimpleReader - qxmlsimplereader.html - - QXmlSimpleReader - QXmlSimpleReader - () - - - parse - parse-3 - ( const QXmlInputSource * input, bool incremental ) - - - parseContinue - parseContinue - () - - - setFeature - setFeature - ( const QString & name, bool enable ) - - - diff --git a/qt/src/.cvsignore b/qt/src/.cvsignore deleted file mode 100644 index f6454f28..00000000 --- a/qt/src/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.da -*.gcov -*.moc diff --git a/qt/src/Makefile.am b/qt/src/Makefile.am deleted file mode 100644 index 90c0f8e6..00000000 --- a/qt/src/Makefile.am +++ /dev/null @@ -1,71 +0,0 @@ -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_QT_CFLAGS) -DDBUS_COMPILATION - -lib_LTLIBRARIES=libdbus-qt4-1.la - -dbusincludedir=$(includedir)/dbus-1.0/dbus -dbusinclude_HEADERS= \ - qdbusbus.h \ - qdbusmacros.h \ - qdbuserror.h \ - qdbusmessage.h \ - qdbusserver.h \ - qdbusconnection.h \ - qdbusabstractinterface.h \ - qdbusinterface.h \ - qdbusutil.h \ - qdbusabstractadaptor.h \ - qdbusreply.h \ - qdbustypehelper_p.h \ - qdbus.h - -noinst_HEADERS= \ - qdbusabstractadaptor_p.h \ - qdbusabstractinterface_p.h \ - qdbusconnection_p.h \ - qdbusinterface_p.h \ - qdbusintrospection_p.h \ - qdbusmarshall_p.h \ - qdbusmessage_p.h \ - qdbusmetaobject_p.h \ - qdbustype_p.h \ - qdbusxmlparser_p.h - -MOCS = qdbusabstractadaptor.moc qdbusserver.moc qdbusconnection_p.moc qdbusconnection_p.moc qdbusabstractadaptor_p.moc qdbusbus.moc qdbusabstractinterface.moc -CLEANFILES = $(MOCS) -BUILT_SOURCES = $(MOCS) - -libdbus_qt4_1_la_SOURCES = \ - qdbusbus.cpp \ - qdbusconnection.cpp \ - qdbuserror.cpp \ - qdbusintegrator.cpp \ - qdbusmarshall.cpp \ - qdbusmessage.cpp \ - qdbusserver.cpp \ - qdbustype.cpp \ - qdbusabstractinterface.cpp \ - qdbusinterface.cpp \ - qdbusxmlparser.cpp \ - qdbusutil.cpp \ - qdbusintrospection.cpp \ - qdbusabstractadaptor.cpp \ - qdbusthread.cpp \ - qdbusinternalfilters.cpp \ - qdbusmetaobject.cpp \ - qdbusmisc.cpp \ - qdbusxmlgenerator.cpp - -qdbusabstractadaptor.lo: qdbusabstractadaptor.moc qdbusabstractadaptor_p.moc -qdbusabstractinterface.lo: qdbusabstractinterface.moc -qdbusbus.lo: qdbusbus.moc -qdbusserver.lo: qdbusserver.moc -qdbusintegrator.lo: qdbusconnection_p.moc - -libdbus_qt4_1_la_LIBADD= $(DBUS_QT_LIBS) $(top_builddir)/dbus/libdbus-1.la -libdbus_qt4_1_la_LDFLAGS= -version-info 1:0 -no-undefined -libdbus_qt4_1_la_CPPFLAGS= -DQDBUS_MAKEDLL - -EXTRA_DIST = qdbus.h - -%.moc: %.h - $(QT_MOC) $< > $@ diff --git a/qt/src/qdbus.h b/qt/src/qdbus.h deleted file mode 100644 index 60c35825..00000000 --- a/qt/src/qdbus.h +++ /dev/null @@ -1,52 +0,0 @@ -/* qdbus.h precompiled header - * - * Copyright (C) 2005 Harald Fernengel - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef QDBUS_H -#define QDBUS_H - -#include - -#if !defined(DBUS_COMPILATION) -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#else -# include "qdbusabstractadaptor.h" -# include "qdbusabstractinterface.h" -# include "qdbusbus.h" -# include "qdbusconnection.h" -# include "qdbuserror.h" -# include "qdbusinterface.h" -# include "qdbusmessage.h" -# include "qdbusreply.h" -# include "qdbusserver.h" -# include "qdbusutil.h" -#endif - -#endif diff --git a/qt/src/qdbusabstractadaptor.cpp b/qt/src/qdbusabstractadaptor.cpp deleted file mode 100644 index 4592b29a..00000000 --- a/qt/src/qdbusabstractadaptor.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/* -*- mode: C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusabstractadaptor.h" - -#include -#include - -#include "qdbusconnection.h" - -#include "qdbusconnection_p.h" // for qDBusParametersForMethod -#include "qdbusabstractadaptor_p.h" - -struct QDBusAdaptorInit -{ - QSignalSpyCallbackSet callbacks; - QDBusAdaptorInit() - { - extern void qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet &callback_set); - callbacks.signal_begin_callback = QDBusAdaptorConnector::signalBeginCallback; - callbacks.signal_end_callback = QDBusAdaptorConnector::signalEndCallback; - callbacks.slot_begin_callback = 0; - callbacks.slot_end_callback = 0; - qt_register_signal_spy_callbacks(callbacks); - - //QDBusAdaptorConnector::id = QObject::registerUserData(); - } -}; - -Q_GLOBAL_STATIC(QDBusAdaptorInit, qAdaptorInit) - -QDBusAdaptorConnector *qDBusFindAdaptorConnector(QObject *obj) -{ - (void)qAdaptorInit(); - - if (!obj) - return 0; - QDBusAdaptorConnector *connector = qFindChild(obj); - if (connector) - connector->polish(); - return connector; -} - -QDBusAdaptorConnector *qDBusFindAdaptorConnector(QDBusAbstractAdaptor *adaptor) -{ - return qDBusFindAdaptorConnector(adaptor->parent()); -} - -QDBusAdaptorConnector *qDBusCreateAdaptorConnector(QObject *obj) -{ - (void)qAdaptorInit(); - - QDBusAdaptorConnector *connector = qDBusFindAdaptorConnector(obj); - if (connector) - return connector; - return new QDBusAdaptorConnector(obj); -} - -QString QDBusAbstractAdaptorPrivate::retrieveIntrospectionXml(QDBusAbstractAdaptor *adaptor) -{ - return adaptor->d->xml; -} - -void QDBusAbstractAdaptorPrivate::saveIntrospectionXml(QDBusAbstractAdaptor *adaptor, - const QString &xml) -{ - adaptor->d->xml = xml; -} - -/*! - \page usingannotations.html Using annotations in adaptors - - It is currently not possible to specify arbitrary annotations in adaptors. -*/ - -/*! - \class QDBusAbstractAdaptor - \brief Abstract adaptor for D-Bus adaptor classes. - - The QDBusAbstractAdaptor class is the starting point for all objects intending to provide - interfaces to the external world using D-Bus. This is accomplished by attaching a one or more - classes derived from QDBusAbstractAdaptor to a normal QObject and then registering that QObject - with QDBusConnection::registerObject. QDBusAbstractAdaptor objects are intended to be - light-weight wrappers, mostly just relaying calls into the real object (see object()) and the - signals from it. - - Each QDBusAbstractAdaptor-derived class should define the D-Bus interface it is implementing - using the Q_CLASSINFO macro in the class definition. - - QDBusAbstractAdaptor uses the standard QObject mechanism of signals, slots and properties to - determine what signals, methods and properties to export to the bus. Any signal emitted by - QDBusAbstractAdaptor-derived classes will be automatically be relayed through any D-Bus - connections the object is registered on. - - Classes derived from QDBusAbstractAdaptor must be created on the heap using the \a new operator - and must not be deleted by the user (they will be deleted automatically when the object they are - connected to is also deleted). - - \sa {usingadaptors.html}{Using adaptors}, QDBusConnection -*/ - -/*! - Constructs a QDBusAbstractAdaptor with \a obj as the parent object. -*/ -QDBusAbstractAdaptor::QDBusAbstractAdaptor(QObject* obj) - : QObject(obj), d(new QDBusAbstractAdaptorPrivate) -{ - QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(obj); - - connector->waitingForPolish = true; - QTimer::singleShot(0, connector, SLOT(polish())); -} - -/*! - Destroys the adaptor. - - \warning Adaptors are destroyed automatically when the real object they refer to is - destroyed. Do not delete the adaptors yourself. -*/ -QDBusAbstractAdaptor::~QDBusAbstractAdaptor() -{ - delete d; -} - -/*! - Returns the QObject that we're the adaptor for. This is the same object that was passed as an - argument to the QDBusAbstractAdaptor constructor. -*/ -QObject* QDBusAbstractAdaptor::object() const -{ - return parent(); -} - -/*! - Toggles automatic signal relaying from the real object (see object()). - - Automatic signal relaying consists of signal-to-signal connection of the signals on the parent - that have the exact same method signatue in both classes. - - If \a enable is set to true, connect the signals; if set to false, disconnect all signals. -*/ -void QDBusAbstractAdaptor::setAutoRelaySignals(bool enable) -{ - const QMetaObject *us = metaObject(); - const QMetaObject *them = parent()->metaObject(); - for (int idx = staticMetaObject.methodCount(); idx < us->methodCount(); ++idx) { - QMetaMethod mm = us->method(idx); - - if (mm.methodType() != QMetaMethod::Signal) - continue; - - // try to connect/disconnect to a signal on the parent that has the same method signature - QByteArray sig = QMetaObject::normalizedSignature(mm.signature()); - if (them->indexOfSignal(sig) == -1) - continue; - sig.prepend(QSIGNAL_CODE + '0'); - parent()->disconnect(sig, this, sig); - if (enable) - connect(parent(), sig, sig); - } -} - -QDBusAdaptorConnector::QDBusAdaptorConnector(QObject *obj) - : QObject(obj), waitingForPolish(false), lastSignalIdx(0), argv(0) -{ -} - -QDBusAdaptorConnector::~QDBusAdaptorConnector() -{ -} - -void QDBusAdaptorConnector::addAdaptor(QDBusAbstractAdaptor *adaptor) -{ - // find the interface name - const QMetaObject *mo = adaptor->metaObject(); - while (mo != &QDBusAbstractAdaptor::staticMetaObject) { - int ciend = mo->classInfoCount(); - for (int i = mo->classInfoOffset(); i < ciend; ++i) { - QMetaClassInfo mci = mo->classInfo(i); - if (strcmp(mci.name(), QCLASSINFO_DBUS_INTERFACE) == 0 && *mci.value()) { - // find out if this interface exists first - QString interface = QString::fromUtf8(mci.value()); - AdaptorMap::Iterator it = qLowerBound(adaptors.begin(), adaptors.end(), interface); - if (it != adaptors.end() && it->interface == interface) { - // exists. Replace it (though it's probably the same) - it->adaptor = adaptor; - it->metaObject = mo; - } else { - // create a new one - AdaptorData entry; - entry.interface = interface; - entry.adaptor = adaptor; - entry.metaObject = mo; - adaptors << entry; - } - } - } - - mo = mo->superClass(); - } - - // connect the adaptor's signals to our relaySlot slot - mo = adaptor->metaObject(); - for (int i = QDBusAbstractAdaptor::staticMetaObject.methodCount(); - i < mo->methodCount(); ++i) { - QMetaMethod mm = mo->method(i); - - if (mm.methodType() != QMetaMethod::Signal) - continue; - - QByteArray sig = mm.signature(); - sig.prepend(QSIGNAL_CODE + '0'); - disconnect(adaptor, sig, this, SLOT(relaySlot())); - connect(adaptor, sig, this, SLOT(relaySlot())); - } -} - -void QDBusAdaptorConnector::polish() -{ - if (!waitingForPolish) - return; // avoid working multiple times if multiple adaptors were added - - waitingForPolish = false; - const QObjectList &objs = parent()->children(); - foreach (QObject *obj, objs) { - QDBusAbstractAdaptor *adaptor = qobject_cast(obj); - if (adaptor) - addAdaptor(adaptor); - } - - // sort the adaptor list - qSort(adaptors); -} - -void QDBusAdaptorConnector::relaySlot() -{ - relay(sender()); -} - -void QDBusAdaptorConnector::relay(QObject *senderObj) -{ - // we're being called because there is a signal being emitted that we must relay - Q_ASSERT(lastSignalIdx); - Q_ASSERT(argv); - Q_ASSERT(senderMetaObject); - - if (senderMetaObject != senderObj->metaObject()) { - qWarning("Inconsistency detected: QDBusAdaptorConnector::relay got called with unexpected sender object!"); - } else { - QMetaMethod mm = senderMetaObject->method(lastSignalIdx); - QObject *object = static_cast(senderObj)->parent(); - - // break down the parameter list - QList types; - int inputCount = qDBusParametersForMethod(mm, types); - if (inputCount == -1) - // invalid signal signature - // qDBusParametersForMethod has already complained - return; - if (inputCount + 1 != types.count() || - types.at(inputCount) == QDBusConnectionPrivate::messageMetaType) { - // invalid signal signature - // qDBusParametersForMethod has not yet complained about this one - qWarning("Cannot relay signal %s::%s", senderMetaObject->className(), mm.signature()); - return; - } - - QByteArray signature = QMetaObject::normalizedSignature(mm.signature()); - signature.truncate(signature.indexOf('(')); // remove parameter decoration - - QVariantList args; - for (int i = 1; i < types.count(); ++i) - args << QVariant(types.at(i), argv[i]); - - // find all the interfaces this signal belongs to - for (const QMetaObject *mo = senderMetaObject; mo != &QDBusAbstractAdaptor::staticMetaObject; - mo = mo->superClass()) { - if (lastSignalIdx < mo->methodOffset()) - break; - - for (int i = mo->classInfoOffset(); i < mo->classInfoCount(); ++i) { - QMetaClassInfo mci = mo->classInfo(i); - if (qstrcmp(mci.name(), QCLASSINFO_DBUS_INTERFACE) == 0 && *mci.value()) - // now emit the signal with all the information - emit relaySignal(object, mci.value(), signature.constData(), args); - } - } - } -} - -void QDBusAdaptorConnector::signalBeginCallback(QObject *caller, int method_index, void **argv) -{ - QDBusAbstractAdaptor *adaptor = qobject_cast(caller); - if (adaptor) { - QDBusAdaptorConnector *data = qDBusFindAdaptorConnector(adaptor); - data->lastSignalIdx = method_index; - data->argv = argv; - data->senderMetaObject = caller->metaObject(); - data->polish(); // make sure it's polished - } -} - -void QDBusAdaptorConnector::signalEndCallback(QObject *caller, int) -{ - QDBusAbstractAdaptor *adaptor = qobject_cast(caller); - if (adaptor) { - QDBusAdaptorConnector *data = qDBusFindAdaptorConnector(adaptor); - data->lastSignalIdx = 0; - data->argv = 0; - data->senderMetaObject = 0; - } -} - -#include "qdbusabstractadaptor.moc" -#include "qdbusabstractadaptor_p.moc" diff --git a/qt/src/qdbusabstractadaptor.h b/qt/src/qdbusabstractadaptor.h deleted file mode 100644 index 16fbf5d9..00000000 --- a/qt/src/qdbusabstractadaptor.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- mode: C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSABSTRACTADAPTOR_H -#define QDBUSABSTRACTADAPTOR_H - -#include -#include "qdbusmacros.h" - -class QDBusAbstractAdaptorPrivate; -class QDBUS_EXPORT QDBusAbstractAdaptor: public QObject -{ - Q_OBJECT -protected: - QDBusAbstractAdaptor(QObject *parent); - -public: - ~QDBusAbstractAdaptor(); - - Q_DECL_DEPRECATED QObject *object() const; - -protected: - void setAutoRelaySignals(bool enable); - -private: - friend class QDBusAbstractAdaptorPrivate; - QDBusAbstractAdaptorPrivate *d; -}; - -#endif diff --git a/qt/src/qdbusabstractadaptor_p.h b/qt/src/qdbusabstractadaptor_p.h deleted file mode 100644 index 71bfb582..00000000 --- a/qt/src/qdbusabstractadaptor_p.h +++ /dev/null @@ -1,127 +0,0 @@ -/* -*- mode: C++; set-fill-width: 100 -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSABSTRACTADAPTORPRIVATE_H -#define QDBUSABSTRACTADAPTORPRIVATE_H - -#include -#include -#include -#include -#include -#include - -#define QCLASSINFO_DBUS_INTERFACE "D-Bus Interface" -#define QCLASSINFO_DBUS_INTROSPECTION "D-Bus Introspection" - -class QDBusAbstractAdaptor; -class QDBusAdaptorConnector; -class QDBusAdaptorManager; -class QDBusConnectionPrivate; - -#if QT_VERSION < 0x040200 -/* mirrored in qobject_p.h, DON'T CHANGE without prior warning */ -struct QSignalSpyCallbackSet -{ - typedef void (*BeginCallback)(QObject *caller, int method_index, void **argv); - typedef void (*EndCallback)(QObject *caller, int method_index); - BeginCallback signal_begin_callback, - slot_begin_callback; - EndCallback signal_end_callback, - slot_end_callback; -}; -#else -# error Qt 4.2.0 is supposed to have a better solution! - CHOKE! -#endif // Qt 4.2.0 - -class QDBusAbstractAdaptorPrivate -{ -public: - QString xml; - - static QString retrieveIntrospectionXml(QDBusAbstractAdaptor *adaptor); - static void saveIntrospectionXml(QDBusAbstractAdaptor *adaptor, const QString &xml); -}; - -class QDBusAdaptorConnector: public QObject -{ - Q_OBJECT -public: // typedefs - struct AdaptorData - { - QString interface; - QDBusAbstractAdaptor *adaptor; - const QMetaObject *metaObject; - - inline bool operator<(const AdaptorData &other) const - { return interface < other.interface; } - inline bool operator<(const QString &other) const - { return interface < other; } - }; - typedef QVector AdaptorMap; - -public: // methods - explicit QDBusAdaptorConnector(QObject *parent); - ~QDBusAdaptorConnector(); - - void addAdaptor(QDBusAbstractAdaptor *adaptor); - void relay(QObject *sender); - -public slots: - void relaySlot(); - void polish(); - -signals: - void relaySignal(QObject *obj, const char *interface, const char *name, const QVariantList &args); - -public: // member variables - AdaptorMap adaptors; - bool waitingForPolish : 1; - - int lastSignalIdx; - void **argv; - const QMetaObject *senderMetaObject; - -public: // static members - static void signalBeginCallback(QObject *caller, int method_index, void **argv); - static void signalEndCallback(QObject *caller, int method_index); - //static int id; -}; - -extern QDBusAdaptorConnector *qDBusFindAdaptorConnector(QObject *object); -extern QDBusAdaptorConnector *qDBusCreateAdaptorConnector(QObject *object); - -#endif // QDBUSABSTRACTADAPTORPRIVATE_H diff --git a/qt/src/qdbusabstractinterface.cpp b/qt/src/qdbusabstractinterface.cpp deleted file mode 100644 index 1b038141..00000000 --- a/qt/src/qdbusabstractinterface.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2005 Thiago Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusabstractinterface.h" - -#include "qdbusabstractinterface_p.h" -#include "qdbusmetaobject_p.h" -#include "qdbusconnection_p.h" - -QVariant QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp) const -{ - // try to read this property - QDBusMessage msg = QDBusMessage::methodCall(service, path, - QLatin1String(DBUS_INTERFACE_PROPERTIES), - QLatin1String("Get")); - msg << interface << QString::fromUtf8(mp.name()); - QDBusMessage reply = connp->sendWithReply(msg, QDBusConnection::NoUseEventLoop); - - if (reply.type() == QDBusMessage::ReplyMessage && reply.count() == 1 && - reply.signature() == QLatin1String("v")) { - QVariant value = QDBusTypeHelper::fromVariant(reply.at(0)); - - // make sure the type is right - if (qstrcmp(mp.typeName(), value.typeName()) == 0) { - if (mp.type() == QVariant::LastType) - // QVariant is special in this context - return QDBusTypeHelper::fromVariant(value); - - return value; - } - } - - // there was an error... - if (reply.type() == QDBusMessage::ErrorMessage) - lastError = reply; - else if (reply.signature() != QLatin1String("v")) { - QString errmsg = QLatin1String("Invalid signature `%1' in return from call to " - DBUS_INTERFACE_PROPERTIES); - lastError = QDBusError(QDBusError::InvalidSignature, errmsg.arg(reply.signature())); - } else { - QString errmsg = QLatin1String("Unexpected type `%1' when retrieving property " - "`%2 %3.%4'"); - lastError = QDBusError(QDBusError::InvalidSignature, - errmsg.arg(QLatin1String(reply.at(0).typeName()), - QLatin1String(mp.typeName()), - interface, QString::fromUtf8(mp.name()))); - } - - return QVariant(); -} - -void QDBusAbstractInterfacePrivate::setProperty(const QMetaProperty &mp, const QVariant &value) -{ - // send the value - QDBusMessage msg = QDBusMessage::methodCall(service, path, - QLatin1String(DBUS_INTERFACE_PROPERTIES), - QLatin1String("Set")); - msg.setSignature(QLatin1String("ssv")); - msg << interface << QString::fromUtf8(mp.name()) << value; - QDBusMessage reply = connp->sendWithReply(msg, QDBusConnection::NoUseEventLoop); - - if (reply.type() != QDBusMessage::ReplyMessage) - lastError = reply; -} - -/*! - \class QDBusAbstractInterface - \brief Base class for all D-Bus interfaces in the QtDBus binding, allowing access to remote interfaces. - - Generated-code classes also derive from QDBusAbstractInterface, all methods described here are also - valid for generated-code classes. In addition to those described here, generated-code classes - provide member functions for the remote methods, which allow for compile-time checking of the - correct parameters and return values, as well as property type-matching and signal - parameter-matching. - - \sa {dbusidl2cpp.html}{The dbusidl2cpp compiler}, QDBusInterface -*/ - -/*! - \enum QDBusAbstractInterface::CallMode - - Specifies how a call should be placed. The valid options are: - \value NoWaitForReply place the call but don't wait for the reply (the reply's contents - will be discarded) - \value NoUseEventLoop don't use an event loop to wait for a reply, but instead block on - network operations while waiting. This option means the - user-interface may not be updated for the duration of the call. - \value UseEventLoop use the Qt event loop to wait for a reply. This option means the - user-interface will update, but it also means other events may - happen, like signal delivery and other D-Bus method calls. - - When using UseEventLoop, applications must be prepared for reentrancy in any function. -*/ - -/*! - \internal -*/ -QDBusAbstractInterface::QDBusAbstractInterface(QDBusAbstractInterfacePrivate* d) -#if QT_VERSION < 0x040200 - : d_ptr(d) -{ - d_ptr->q_ptr = this; -} -#endif - -/*! - Releases this object's resources. -*/ -QDBusAbstractInterface::~QDBusAbstractInterface() -{ - delete d_ptr; -} - -/*! - Returns true if this is a valid reference to a remote object. It returns false if - there was an error during the creation of this interface (for instance, if the remote - application does not exist). - - Note: when dealing with remote objects, it is not always possible to determine if it - exists when creating a QDBusInterface or QDBusInterfacePtr object. -*/ -bool QDBusAbstractInterface::isValid() const -{ - return d_func()->isValid; -} - -/*! - Returns the connection this interface is assocated with. -*/ -QDBusConnection QDBusAbstractInterface::connection() const -{ - return d_func()->conn; -} - -/*! - Returns the name of the service this interface is associated with. -*/ -QString QDBusAbstractInterface::service() const -{ - return d_func()->service; -} - -/*! - Returns the object path that this interface is associated with. -*/ -QString QDBusAbstractInterface::path() const -{ - return d_func()->path; -} - -/*! - Returns the name of this interface. -*/ -QString QDBusAbstractInterface::interface() const -{ - return d_func()->interface; -} - -/*! - Returns the error the last operation produced, or an invalid error if the last operation did not - produce an error. -*/ -QDBusError QDBusAbstractInterface::lastError() const -{ - return d_func()->lastError; -} - -/*! - Places a call to the remote method specified by \a method on this interface, using \a args as - arguments. This function returns the message that was received as a reply, which can be a normal - QDBusMessage::ReplyMessage (indicating success) or QDBusMessage::ErrorMessage (if the call - failed). The \a mode parameter specifies how this call should be placed. - - If the call succeeds, lastError() will be cleared; otherwise, it will contain the error this - call produced. - - Normally, you should place calls using call(). - - \warning If you use \c UseEventLoop, your code must be prepared to deal with any reentrancy: - other method calls and signals may be delivered before this function returns, as well - as other Qt queued signals and events. - - \threadsafe -*/ -QDBusMessage QDBusAbstractInterface::callWithArgs(const QString& method, const QList& args, - CallMode mode) -{ - Q_D(QDBusAbstractInterface); - - QString m = method, sig; - // split out the signature from the method - int pos = method.indexOf(QLatin1Char('.')); - if (pos != -1) { - m.truncate(pos); - sig = method.mid(pos + 1); - } - - if (mode == AutoDetect) { - // determine if this a sync or async call - mode = NoUseEventLoop; - const QMetaObject *mo = metaObject(); - QByteArray match = m.toLatin1() + '('; - - for (int i = staticMetaObject.methodCount(); i < mo->methodCount(); ++i) { - QMetaMethod mm = mo->method(i); - if (QByteArray(mm.signature()).startsWith(match)) { - // found a method with the same name as what we're looking for - // hopefully, nobody is overloading asynchronous and synchronous methods with - // the same name - - QList tags = QByteArray(mm.tag()).split(' '); - if (tags.contains("async") || tags.contains("Q_ASYNC")) - mode = NoWaitForReply; - - break; - } - } - } - - QDBusMessage msg = QDBusMessage::methodCall(service(), path(), interface(), m); - msg.setSignature(sig); - msg.QList::operator=(args); - - QDBusMessage reply; - if (mode != NoWaitForReply) - reply = d->conn.sendWithReply(msg, mode == UseEventLoop ? - QDBusConnection::UseEventLoop : QDBusConnection::NoUseEventLoop); - else - d->conn.send(msg); - - d->lastError = reply; // will clear if reply isn't an error - - // ensure that there is at least one element - if (reply.isEmpty()) - reply << QVariant(); - - return reply; -} - -/*! - \overload - Places a call to the remote method specified by \a method on this interface, using \a args as - arguments. This function will return immediately after queueing the call. The reply from the - remote function or any errors emitted by it will be delivered to the \a slot slot on object \a - receiver. - - This function returns true if the queueing succeeded: it does not indicate that the call - succeeded. If it failed, the slot will be called with an error message. lastError() will not be - set under those circumstances. - - \sa QDBusError, QDBusMessage -*/ -bool QDBusAbstractInterface::callWithArgs(const QString &method, QObject *receiver, const char *slot, - const QList &args) -{ - Q_D(QDBusAbstractInterface); - - QString m = method, sig; - // split out the signature from the method - int pos = method.indexOf(QLatin1Char('.')); - if (pos != -1) { - m.truncate(pos); - sig = method.mid(pos + 1); - } - - QDBusMessage msg = QDBusMessage::methodCall(service(), path(), interface(), m); - msg.setSignature(sig); - msg.QList::operator=(args); - - d->lastError = 0; // clear - return d->conn.sendWithReplyAsync(msg, receiver, slot); -} - -/*! - \internal - Catch signal connections. -*/ -void QDBusAbstractInterface::connectNotify(const char *signal) -{ - // someone connecting to one of our signals - Q_D(QDBusAbstractInterface); - - d->connp->connectRelay(d->service, d->path, d->interface, this, signal); -} - -/*! - \internal - Catch signal disconnections. -*/ -void QDBusAbstractInterface::disconnectNotify(const char *signal) -{ - // someone disconnecting from one of our signals - Q_D(QDBusAbstractInterface); - - d->connp->disconnectRelay(d->service, d->path, d->interface, this, signal); -} - -/*! - \internal - Get the value of the property \a propname. -*/ -QVariant QDBusAbstractInterface::internalPropGet(const char *propname) const -{ - // assume this property exists and is readable - // we're only called from generated code anyways - - int idx = metaObject()->indexOfProperty(propname); - if (idx != -1) - return d_func()->property(metaObject()->property(idx)); - qWarning("QDBusAbstractInterface::internalPropGet called with unknown property '%s'", propname); - return QVariant(); // error -} - -/*! - \internal - Set the value of the property \a propname to \a value. -*/ -void QDBusAbstractInterface::internalPropSet(const char *propname, const QVariant &value) -{ - Q_D(QDBusAbstractInterface); - - // assume this property exists and is writeable - // we're only called from generated code anyways - - int idx = metaObject()->indexOfProperty(propname); - if (idx != -1) - d->setProperty(metaObject()->property(idx), value); - else - qWarning("QDBusAbstractInterface::internalPropGet called with unknown property '%s'", propname); -} - -/*! - \overload - \fn QDBusMessage QDBusAbstractInterface::call(const QString &method) - - Calls the method \a method on this interface and passes the parameters to this function to the - method. - - The parameters to \c call are passed on to the remote function via D-Bus as input - arguments. Output arguments are returned in the QDBusMessage reply. If the reply is an error - reply, lastError() will also be set to the contents of the error message. - - This function is implemented by actually 9 different function overloads called \c call, so you - can pass up to 8 parameters to your function call, which can be of any type accepted by QtDBus - (see the \l {allowedparameters.html}{allowed parameters} page for information on what types are - accepted). - - It can be used the following way: - - \code - QString value = retrieveValue(); - QDBusMessage reply; - - QDBusReply api = interface->call(QLatin1String("GetAPIVersion")); - if (api >= 14) - reply = interface->call(QLatin1String("ProcessWorkUnicode"), value); - else - reply = interface->call(QLatin1String("ProcessWork"), QLatin1String("UTF-8"), value.toUtf8()); - \endcode - - This example illustrates function calling with 0, 1 and 2 parameters and illustrates different - parameter types passed in each (the first call to \c "ProcessWorkUnicode" will contain one - Unicode string, the second call to \c "ProcessWork" will contain one string and one byte array). - - \warning This function reenters the Qt event loop in order to wait for the reply, excluding user - input. During the wait, it may deliver signals and other method calls to your - application. Therefore, it must be prepared to handle a reentrancy whenever a call is - placed with call(). -*/ - -#include "qdbusabstractinterface.moc" diff --git a/qt/src/qdbusabstractinterface.h b/qt/src/qdbusabstractinterface.h deleted file mode 100644 index aa6d00d7..00000000 --- a/qt/src/qdbusabstractinterface.h +++ /dev/null @@ -1,257 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2005 Thiago Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSABSTRACTINTERFACE_H -#define QDBUSABSTRACTINTERFACE_H - -#include -#include -#include -#include - -#include "qdbusmessage.h" -#include "qdbustypehelper_p.h" - -class QDBusConnection; -class QDBusError; - -class QDBusAbstractInterfacePrivate; -class QDBUS_EXPORT QDBusAbstractInterface: public QObject -{ - Q_OBJECT - -public: - enum CallMode { - NoWaitForReply, - UseEventLoop, - NoUseEventLoop, - AutoDetect - }; - -public: - virtual ~QDBusAbstractInterface(); - bool isValid() const; - - QDBusConnection connection() const; - - QString service() const; - QString path() const; - QString interface() const; - - QDBusError lastError() const; - - QDBusMessage callWithArgs(const QString &method, const QList &args = QList(), - CallMode mode = AutoDetect); - bool callWithArgs(const QString &method, QObject *receiver, const char *slot, - const QList &args = QList()); - - inline QDBusMessage call(const QString &m) - { - return callWithArgs(m); - } - - inline QDBusMessage call(CallMode mode, const QString &m) - { - return callWithArgs(m, QList(), mode); - } - -#ifndef Q_QDOC -private: - template inline QVariant qvfv(const T &t) - { return QDBusTypeHelper::toVariant(t); } - -public: - template - inline QDBusMessage call(const QString &m, const T1 &t1) - { - QList args; - args << qvfv(t1); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2) - { - QList args; - args << qvfv(t1) << qvfv(t2); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2, const T3 &t3) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5) << qvfv(t6); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5) << qvfv(t6) - << qvfv(t7); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(const QString &m, const T1 &t1, const T2 &t2, const T3 &t3, - const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, const T8 &t8) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5) << qvfv(t6) - << qvfv(t7) << qvfv(t8); - return callWithArgs(m, args); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1) - { - QList args; - args << qvfv(t1); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2) - { - QList args; - args << qvfv(t1) << qvfv(t2); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2, - const T3 &t3) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2, - const T3 &t3, const T4 &t4) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2, - const T3 &t3, const T4 &t4, const T5 &t5) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2, - const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5) << qvfv(t6); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2, - const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5) << qvfv(t6) - << qvfv(t7); - return callWithArgs(m, args, mode); - } - - template - inline QDBusMessage call(CallMode mode, const QString &m, const T1 &t1, const T2 &t2, - const T3 &t3, const T4 &t4, const T5 &t5, const T6 &t6, const T7 &t7, - const T8 &t8) - { - QList args; - args << qvfv(t1) << qvfv(t2) << qvfv(t3) - << qvfv(t4) << qvfv(t5) << qvfv(t6) - << qvfv(t7) << qvfv(t8); - return callWithArgs(m, args, mode); - } -#endif - -protected: - QDBusAbstractInterface(QDBusAbstractInterfacePrivate *); - void connectNotify(const char *signal); - void disconnectNotify(const char *signal); - QVariant internalPropGet(const char *propname) const; - void internalPropSet(const char *propname, const QVariant &value); - -private: - friend class QDBusInterface; - QDBusAbstractInterfacePrivate *d_ptr; // remove for Qt 4.2.0 - - Q_DECLARE_PRIVATE(QDBusAbstractInterface) - Q_DISABLE_COPY(QDBusAbstractInterface) -}; - -#endif diff --git a/qt/src/qdbusabstractinterface_p.h b/qt/src/qdbusabstractinterface_p.h deleted file mode 100644 index 43807071..00000000 --- a/qt/src/qdbusabstractinterface_p.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * - * Copyright (C) 2006 Thiago José Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSABSTRACTINTERFACEPRIVATE_H -#define QDBUSABSTRACTINTERFACEPRIVATE_H - -#include "qdbusabstractinterface.h" -#include "qdbusconnection.h" -#include "qdbuserror.h" - -#define ANNOTATION_NO_WAIT "org.freedesktop.DBus.Method.NoReply" - -class QDBusAbstractInterfacePrivate//: public QObjectPrivate -{ -public: - Q_DECLARE_PUBLIC(QDBusAbstractInterface) - - QDBusAbstractInterface *q_ptr; // remove in Qt 4.2 - QDBusConnection conn; - QDBusConnectionPrivate *connp; - QString service; - QString path; - QString interface; - mutable QDBusError lastError; - bool isValid; - - inline QDBusAbstractInterfacePrivate(const QDBusConnection& con, QDBusConnectionPrivate *conp, - const QString &serv, const QString &p, const QString &iface) - : conn(con), connp(conp), service(serv), path(p), interface(iface), isValid(true) - { } - virtual ~QDBusAbstractInterfacePrivate() { } - - // these functions do not check if the property is valid - QVariant property(const QMetaProperty &mp) const; - void setProperty(const QMetaProperty &mp, const QVariant &value); -}; - - -#endif diff --git a/qt/src/qdbusbus.cpp b/qt/src/qdbusbus.cpp deleted file mode 100644 index f46966b4..00000000 --- a/qt/src/qdbusbus.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * This file was generated by dbusidl2cpp version 0.3 - * when processing input file - - * - * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved. - * - * This file has been hand-edited! Be careful when re-generating it! - * - */ - -#include "qdbusbus.h" - -#include -#include -#include -#include -#include -#include - -/* - * Implementation of interface class QDBusBusService - */ - -/*! - \class QDBusBusService - \brief Provides access to the D-Bus bus daemon service. - -*/ - -/*! - \enum QDBusBusService::RequestNameOption - - Flags for requesting a name on the bus. - - \value AllowReplacingName Allow another application requesting the same name to take the name - from this application. - \value ReplaceExistingName If another application already has the name and allows replacing, - take the name and assign it to us. - \value DoNotQueueName Without this flag, if an application requests a name that is already - owned and does not allow replacing, it will be queued until the - name is given up. If this flag is given, no queueing will be - performed and the requestName() call will simply fail. -*/ - -/*! - \enum QDBusBusService::RequestNameReply - - The possible return values from requestName(): - - \value PrimaryOwnerReply The caller is now the primary owner of the name. - \value InQueueReply The caller is in queue for the name, but does not own it. - \value NameExistsReply The name exists and could not be replaced, or the caller did - specify DoNotQueueName. - \value AlreadyOwnerReply The caller tried to request a name that it already owns. -*/ - -/*! - \enum QDBusBusService::ReleaseNameReply - - The possible return values from releaseName(): - - \value NameReleasedReply The caller released his claim on the name. - \value NameNonExistentReply The caller tried to release a name that did not exist. - \value NotOwnerReply The caller tried to release a name that it did not own or was not in - queue for. -*/ - -/*! - \enum QDBusBusService::StartServiceReply - - The possible return values from startServiceByName(): - - \value Success The service was successfully started. - \value AlreadyRunning The service was already running. -*/ - -/*! - \internal -*/ -const char *QDBusBusService::staticInterfaceName() -{ return "org.freedesktop.DBus"; } - - -/*! - \internal -*/ -QDBusBusService::QDBusBusService(QDBusAbstractInterfacePrivate *p) - : QDBusAbstractInterface(p) -{ - connect(this, SIGNAL(NameAcquired(QString)), this, SIGNAL(nameAcquired(QString))); - connect(this, SIGNAL(NameLost(QString)), this, SIGNAL(nameLost(QString))); - connect(this, SIGNAL(NameOwnerChanged(QString,QString,QString)), - this, SIGNAL(nameOwnerChanged(QString,QString,QString))); -} - -/*! - \internal -*/ -QDBusBusService::~QDBusBusService() -{ -} - -/*! - \fn QDBusBusService::hello() - \internal - Sends a "Hello" request to the bus service. You do not want to call this. -*/ -QDBusReply QDBusBusService::Hello() -{ - return call(QLatin1String("Hello")); -} - -/*! - \fn QDBusBusService::nameOwner(const QString &name) - Returns the unique connection name of the primary owner of the name \a name. If the requested - name doesn't have an owner, returns a org.freedesktop.DBus.Error.NameHasNoOwner error. -*/ -QDBusReply QDBusBusService::GetNameOwner(const QString &name) -{ - return call(QLatin1String("GetNameOwner.s"), name); -} - -/*! - \fn QDBusBusService::listNames() - Lists all names currently existing on the bus. -*/ -QDBusReply QDBusBusService::ListNames() -{ - return call(QLatin1String("ListNames")); -} - -/*! - \fn QDBusBusService::listQueuedOwners(const QString &serviceName) - Returns a list of all unique connection names in queue for the service name \a service. -*/ -QDBusReply QDBusBusService::ListQueuedOwners(const QString &serviceName) -{ - return call(QLatin1String("ListQueuedOwners.s"), serviceName); -} - -/*! - \fn QDBusBusService::nameHasOwner(const QString &serviceName) - Returns true if the service name \a service has an owner. -*/ -QDBusReply QDBusBusService::NameHasOwner(const QString &serviceName) -{ - return call(QLatin1String("NameHasOwner.s"), serviceName); -} - -/*! - \fn QDBusBusService::addMatch(const QString &rule) - Adds the rule \a rule for requesting messages from the bus. - - \sa removeMatch() -*/ -QDBusReply QDBusBusService::AddMatch(const QString &rule) -{ - return call(QLatin1String("AddMatch.s"), rule); -} - -/*! - \fn QDBusBusService::removeMatch(const QString &rule) - Removes the rule \a rule, that had previously been added with addMatch(). -*/ -QDBusReply QDBusBusService::RemoveMatch(const QString &rule) -{ - return call(QLatin1String("RemoveMatch.s"), rule); -} - -/*! - \fn QDBusBusService::connectionSELinuxSecurityContext(const QString &serviceName) - Returns the SELinux security context of the process currently holding the bus service \a - service. -*/ -QDBusReply QDBusBusService::GetConnectionSELinuxSecurityContext(const QString &serviceName) -{ - return call(QLatin1String("GetConnectionSELinuxSecurityContext.s"), serviceName); -} - -/*! - \fn QDBusBusService::connectionUnixProcessID(const QString &serviceName) - Returns the Unix Process ID (PID) for the process currently holding the bus service \a service. -*/ -QDBusReply QDBusBusService::GetConnectionUnixProcessID(const QString &serviceName) -{ - return call(QLatin1String("GetConnectionUnixProcessID.s"), serviceName); -} - -/*! - \fn QDBusBusService::connectionUnixUser(const QString &serviceName) - Returns the Unix User ID (UID) for the process currently holding the bus service \a service. -*/ -QDBusReply QDBusBusService::GetConnectionUnixUser(const QString &serviceName) -{ - return call(QLatin1String("GetConnectionUnixUser.s"), serviceName); -} - -/*! - \fn QDBusBusService::reloadConfig() - Asks the D-Bus server daemon to reload its configuration. -*/ -QDBusReply QDBusBusService::ReloadConfig() -{ - return call(QLatin1String("ReloadConfig")); -} - -inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::StartServiceReply *) -{ return QVariant::Int; } - -/*! - \fn QDBusBusService::startServiceByName(const QString &name, uint flags) - Requests that the bus start the service given by the name \a name. - - The \a flags parameter is currently not used. -*/ -QDBusReply -QDBusBusService::StartServiceByName(const QString &name, uint flags) -{ - return call(QLatin1String("StartServiceByName.su"), name, flags); -} - -inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::RequestNameReply *) -{ return QVariant::Int; } - -/*! - \fn QDBusBusService::requestName(const QString &serviceName, RequestNameOptions flags) - Requests the bus service name \a service from the bus. The \a flags parameter specifies how the - bus server daemon should act when the same name is requested by two different applications. - - \sa releaseName() -*/ -QDBusReply -QDBusBusService::RequestName(const QString &serviceName, RequestNameOptions flags) -{ - return call(QLatin1String("RequestName.su"), serviceName, uint(int(flags))); -} - -inline QDBUS_EXPORT int qDBusMetaTypeId(QDBusBusService::ReleaseNameReply *) -{ return QVariant::Int; } - -/*! - \fn QDBusBusService::releaseName(const QString &serviceName) - Releases the claim on the bus service name \a service, that had been previously requested with - requestName(). If this application had ownership of the name, it will be released for other - applications to claim. If it only had the name queued, it gives up its position in the queue. -*/ -QDBusReply -QDBusBusService::ReleaseName(const QString &serviceName) -{ - return call(QLatin1String("ReleaseName.s"), serviceName); -} - -// signals -/*! - \fn QDBusBusService::nameAcquired(const QString &serviceName) - - This signal is emitted by the D-Bus bus server when the bus service name (unique connection name - or well-known service name) given by \a service is acquired by this application. - - Name acquisition happens after the application requested a name using requestName(). -*/ - -/*! - \fn QDBusBusService::nameLost(const QString &serviceName) - - This signal is emitted by the D-Bus bus server when the application loses ownership of the bus - service name given by \a service. -*/ - -/*! - \fn QDBusBusService::nameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner) - - This signal is emitted by the D-Bus bus server whenever a name ownership change happens in the - bus, including apparition and disparition of names. - - This signal means the application \a oldOwner lost ownership of bus name \a name to application - \a newOwner. If \a oldOwner is an empty string, it means the name \a name has just been created; - if \a newOwner is empty, the name \a name has no current owner. -*/ - -#include "qdbusbus.moc" diff --git a/qt/src/qdbusbus.h b/qt/src/qdbusbus.h deleted file mode 100644 index 0240e65f..00000000 --- a/qt/src/qdbusbus.h +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/* - * This file was generated by dbusidl2cpp version 0.3 - * when processing input file - - * - * dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved. - * - * This file has been hand-edited! Be careful when re-generating it! - * - */ - -#ifndef QDBUSBUS_H -#define QDBUSBUS_H - -#include - -#include "qdbusabstractinterface.h" -#include "qdbusreply.h" - -class QDBusConnection; -class QString; -class QByteArray; - -/* - * Proxy class for interface org.freedesktop.DBus - */ -class QDBUS_EXPORT QDBusBusService: public QDBusAbstractInterface -{ - Q_OBJECT - friend class QDBusConnection; - static inline const char *staticInterfaceName(); - - explicit QDBusBusService(QDBusAbstractInterfacePrivate *p); - - ~QDBusBusService(); - -public: - // taken out of http://dbus.freedesktop.org/doc/dbus-specification.html - // update if the standard updates - enum RequestNameOption { - QueueName = 0x0, - AllowReplacingName = 0x1, - ReplaceExistingName = 0x2, - DoNotQueueName = 0x4 - }; - Q_DECLARE_FLAGS(RequestNameOptions, RequestNameOption) - - enum RequestNameReply { - PrimaryOwnerReply = 1, - InQueueReply = 2, - NameExistsReply = 3, - AlreadyOwnerReply = 4 - }; - - enum ReleaseNameReply { - NameReleasedReply = 1, - NameNonExistentReply = 2, - NotOwnerReply = 3 - }; - - enum StartServiceReply { - Success = 1, - AlreadyRunning = 2 - }; - -#ifndef Q_QDOC - // D-Bus names -public: // METHODS - QDBusReply Hello(); - QDBusReply ReloadConfig(); - - QDBusReply ListNames(); - - QDBusReply NameHasOwner(const QString &service); - QDBusReply GetNameOwner(const QString &name); - QDBusReply ReleaseName(const QString &service); - QDBusReply RequestName(const QString &service, RequestNameOptions flags); - QDBusReply ListQueuedOwners(const QString &service); - - QDBusReply AddMatch(const QString &rule); - QDBusReply RemoveMatch(const QString &rule); - - QDBusReply GetConnectionSELinuxSecurityContext(const QString &service); - QDBusReply GetConnectionUnixProcessID(const QString &service); - QDBusReply GetConnectionUnixUser(const QString &service); - - QDBusReply StartServiceByName(const QString &name, uint flags); - -Q_SIGNALS: // SIGNALS - void NameAcquired(const QString &service); - void NameLost(const QString &service); - void NameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner); -#endif - - // Qt-style naming -public Q_SLOTS: - QDBusReply hello() - { return Hello(); } - QDBusReply reloadConfig() - { return ReloadConfig(); } - - QDBusReply listNames() - { return ListNames(); } - - QDBusReply nameHasOwner(const QString &serviceName) - { return NameHasOwner(serviceName); } - QDBusReply nameOwner(const QString &name) - { return GetNameOwner(name); } - QDBusReply releaseName(const QString &serviceName) - { return ReleaseName(serviceName); } - QDBusReply requestName(const QString &serviceName, RequestNameOptions flags = QueueName) - { return RequestName(serviceName, flags); } - QDBusReply listQueuedOwners(const QString &serviceName) - { return ListQueuedOwners(serviceName); } - - QDBusReply addMatch(const QString &rule) - { return AddMatch(rule); } - QDBusReply removeMatch(const QString &rule) - { return RemoveMatch(rule); } - - QDBusReply connectionSELinuxSecurityContext(const QString &serviceName) - { return GetConnectionSELinuxSecurityContext(serviceName); } - QDBusReply connectionUnixProcessID(const QString &serviceName) - { return GetConnectionUnixProcessID(serviceName); } - QDBusReply connectionUnixUser(const QString &serviceName) - { return GetConnectionUnixUser(serviceName); } - - QDBusReply startServiceByName(const QString &name, uint flags) - { return StartServiceByName(name, flags); } - -Q_SIGNALS: - void nameAcquired(const QString &service); - void nameLost(const QString &service); - void nameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner); -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusBusService::RequestNameOptions) - -#endif diff --git a/qt/src/qdbusconnection.cpp b/qt/src/qdbusconnection.cpp deleted file mode 100644 index 7049857d..00000000 --- a/qt/src/qdbusconnection.cpp +++ /dev/null @@ -1,768 +0,0 @@ -/* qdbusconnection.cpp - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include - -#include "qdbusbus.h" -#include "qdbusconnection.h" -#include "qdbuserror.h" -#include "qdbusmessage.h" -#include "qdbusconnection_p.h" -#include "qdbusinterface_p.h" -#include "qdbusutil.h" - -class QDBusConnectionManager -{ -public: - QDBusConnectionManager() {} - ~QDBusConnectionManager(); - void bindToApplication(); - QDBusConnectionPrivate *connection(const QString &name) const; - void removeConnection(const QString &name); - void setConnection(const QString &name, QDBusConnectionPrivate *c); - -private: - mutable QMutex mutex; - QHash connectionHash; -}; - -Q_GLOBAL_STATIC(QDBusConnectionManager, manager) - -QDBusConnectionPrivate *QDBusConnectionManager::connection(const QString &name) const -{ - QMutexLocker locker(&mutex); - return connectionHash.value(name, 0); -} - -void QDBusConnectionManager::removeConnection(const QString &name) -{ - QMutexLocker locker(&mutex); - - QDBusConnectionPrivate *d = 0; - d = connectionHash.take(name); - if (d && !d->ref.deref()) - delete d; -} - -QDBusConnectionManager::~QDBusConnectionManager() -{ - for (QHash::const_iterator it = connectionHash.constBegin(); - it != connectionHash.constEnd(); ++it) { - delete it.value(); - } - connectionHash.clear(); -} - -void QDBusConnectionManager::bindToApplication() -{ - QMutexLocker locker(&mutex); - for (QHash::const_iterator it = connectionHash.constBegin(); - it != connectionHash.constEnd(); ++it) { - (*it)->bindToApplication(); - } -} - -QDBUS_EXPORT void qDBusBindToApplication(); -void qDBusBindToApplication() -{ - manager()->bindToApplication(); -} - -void QDBusConnectionManager::setConnection(const QString &name, QDBusConnectionPrivate *c) -{ - connectionHash[name] = c; - c->name = name; -} - -/*! - \fn QDBusConnection QDBus::sessionBus() - \relates QDBusConnection - - Returns a QDBusConnection object opened with the session bus. The object reference returned - by this function is valid until the QCoreApplication's destructor is run, when the - connection will be closed and the object, deleted. -*/ -/*! - \fn QDBusConnection QDBus::systemBus() - \relates QDBusConnection - - Returns a QDBusConnection object opened with the system bus. The object reference returned - by this function is valid until the QCoreApplication's destructor is run, when the - connection will be closed and the object, deleted. -*/ - -/*! - \class QDBusConnection - \brief A connection to the D-Bus bus daemon. - - This class is the initial point in a D-Bus session. Using it, you can get access to remote - objects, interfaces; connect remote signals to your object's slots; register objects, etc. - - D-Bus connections are created using the QDBusConnection::addConnection() function, which opens a - connection to the server daemon and does the initial handshaking, associating that connection - with a name. Further attempts to connect using the same name will return the same - connection. - - The connection is then torn down using the QDBusConnection::closeConnection() function. - - As a convenience for the two most common connection types, the QDBus::sessionBus() and - QDBus::systemBus() functions return open connections to the session server daemon and the system - server daemon, respectively. Those connections are opened when first used and are closed when - the QCoreApplication destructor is run. - - D-Bus also supports peer-to-peer connections, without the need for a bus server daemon. Using - this facility, two applications can talk to each other and exchange messages. This can be - achieved by passing an address to QDBusConnection::addConnection() - function, which was opened by another D-Bus application using QDBusServer. -*/ - -/*! - \enum QDBusConnection::BusType - Specifies the type of the bus connection. The valid bus types are: - - \value SessionBus the session bus, associated with the running desktop session - \value SystemBus the system bus, used to communicate with system-wide processes - \value ActivationBus the activation bus, whose purpose I have no idea... - - On the Session Bus, one can find other applications by the same user that are sharing the same - desktop session (hence the name). On the System Bus, however, processes shared for the whole - system are usually found. -*/ - -/*! - \enum QDBusConnection::WaitMode - Specifies the call waiting mode. - - \value UseEventLoop use the Qt Event Loop to wait for the reply - \value NoUseEventLoop don't use the event loop - - The \c UseEventLoop option allows for the application to continue to update its UI while the - call is performed, but it also opens up the possibility for reentrancy: socket notifiers may - fire, signals may be delivered and other D-Bus calls may be processed. The \c NoUseEventLoop - does not use the event loop, thus being safe from those problems, but it may block the - application for a noticeable period of time, in case the remote application fails to respond. - - Also note that calls that go back to the local application can only be placed in \c UseEventLoop - mode. -*/ - -/*! - \enum QDBusConnection::RegisterOption - Specifies the options for registering objects with the connection. The possible values are: - - \value ExportAdaptors export the contents of adaptors found in this object - - \value ExportSlots export this object's scriptable slots - \value ExportSignals export this object's scriptable signals - \value ExportProperties export this object's scriptable properties - \value ExportContents shorthand form for ExportSlots | ExportSignals | - ExportProperties - - \value ExportAllSlots export all of this object's slots, including - non-scriptable ones - \value ExportAllSignals export all of this object's signals, including - non-scriptable ones - \value ExportAllProperties export all of this object's properties, including - non-scriptable ones - \value ExportAllContents export all of this object's slots, signals and - properties, including non-scriptable ones - - \value ExportChildObjects export this object's child objects - - \warning It is currently not possible to export signals from objects. If you pass the flag - ExportSignals or ExportAllSignals, the registerObject() function will print a warning. - - \sa registerObject(), QDBusAbstractAdaptor, {usingadaptors.html}{Using adaptors} -*/ - -/*! - \enum QDBusConnection::UnregisterMode - The mode for unregistering an object path: - - \value UnregisterNode unregister this node only: do not unregister child objects - \value UnregisterTree unregister this node and all its sub-tree - - Note, however, if this object was registered with the ExportChildObjects option, UnregisterNode - will unregister the child objects too. -*/ - -/*! - Creates a QDBusConnection object attached to the connection with name \a name. - - This does not open the connection. You have to call QDBusConnection::addConnection to open it. -*/ -QDBusConnection::QDBusConnection(const QString &name) -{ - d = manager()->connection(name); - if (d) - d->ref.ref(); -} - -/*! - Creates a copy of the \a other connection. -*/ -QDBusConnection::QDBusConnection(const QDBusConnection &other) -{ - d = other.d; - if (d) - d->ref.ref(); -} - -/*! - Disposes of this object. This does not close the connection: you have to call - QDBusConnection::closeConnection to do that. -*/ -QDBusConnection::~QDBusConnection() -{ - if (d && !d->ref.deref()) - delete d; -} - -/*! - Creates a copy of the connection \a other in this object. The connection this object referenced - before the copy is not spontaneously disconnected. See QDBusConnection::closeConnection for more - information. -*/ -QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other) -{ - if (other.d) - other.d->ref.ref(); - QDBusConnectionPrivate *old = static_cast( - q_atomic_set_ptr(&d, other.d)); - if (old && !old->ref.deref()) - delete old; - - return *this; -} - -/*! - Opens a connection of type \a type to one of the known busses and associate with it the - connection name \a name. Returns a QDBusConnection object associated with that connection. -*/ -QDBusConnection QDBusConnection::addConnection(BusType type, const QString &name) -{ -// Q_ASSERT_X(QCoreApplication::instance(), "QDBusConnection::addConnection", -// "Cannot create connection without a Q[Core]Application instance"); - - QDBusConnectionPrivate *d = manager()->connection(name); - if (d || name.isEmpty()) - return QDBusConnection(name); - - d = new QDBusConnectionPrivate; - DBusConnection *c = 0; - switch (type) { - case SystemBus: - c = dbus_bus_get_private(DBUS_BUS_SYSTEM, &d->error); - break; - case SessionBus: - c = dbus_bus_get_private(DBUS_BUS_SESSION, &d->error); - break; - case ActivationBus: - c = dbus_bus_get_private(DBUS_BUS_STARTER, &d->error); - break; - } - d->setConnection(c); //setConnection does the error handling for us - - manager()->setConnection(name, d); - - QDBusConnection retval(name); - - // create the bus service - QDBusAbstractInterfacePrivate *p; - p = retval.findInterface_helper(QLatin1String(DBUS_SERVICE_DBUS), - QLatin1String(DBUS_PATH_DBUS), - DBUS_INTERFACE_DBUS); - if (p) { - d->busService = new QDBusBusService(p); - d->busService->setParent(d); // auto-deletion - d->ref.deref(); // busService has a increased the refcounting to us - } - - return retval; -} - -/*! - Opens a peer-to-peer connection on address \a address and associate with it the - connection name \a name. Returns a QDBusConnection object associated with that connection. -*/ -QDBusConnection QDBusConnection::addConnection(const QString &address, - const QString &name) -{ -// Q_ASSERT_X(QCoreApplication::instance(), "QDBusConnection::addConnection", -// "Cannot create connection without a Q[Core]Application instance"); - - QDBusConnectionPrivate *d = manager()->connection(name); - if (d || name.isEmpty()) - return QDBusConnection(name); - - d = new QDBusConnectionPrivate; - // setConnection does the error handling for us - d->setConnection(dbus_connection_open(address.toUtf8().constData(), &d->error)); - - manager()->setConnection(name, d); - - QDBusConnection retval(name); - - // create the bus service - QDBusAbstractInterfacePrivate *p; - p = retval.findInterface_helper(QLatin1String(DBUS_SERVICE_DBUS), - QLatin1String(DBUS_PATH_DBUS), - DBUS_INTERFACE_DBUS); - if (p) { - d->busService = new QDBusBusService(p); - d->busService->setParent(d); // auto-deletion - d->ref.deref(); // busService has a increased the refcounting to us - } - - return retval; -} - -/*! - Closes the connection of name \a name. - - Note that if there are still QDBusConnection objects associated with the same connection, the - connection will not be closed until all references are dropped. However, no further references - can be created using the QDBusConnection::QDBusConnection constructor. -*/ -void QDBusConnection::closeConnection(const QString &name) -{ - manager()->removeConnection(name); -} - -/*! - Sends the \a message over this connection, without waiting for a reply. This is suitable for - errors, signals, and return values as well as calls whose return values are not necessary. - - Returns true if the message was queued successfully, false otherwise. -*/ -bool QDBusConnection::send(const QDBusMessage &message) const -{ - if (!d || !d->connection) - return false; - return d->send(message) != 0; -} - -/*! - Sends the \a message over this connection and returns immediately after queueing it. When the - reply is received, the slot \a method is called in the object \a receiver. This function is - suitable for method calls only. - - This function guarantees that the slot will be called exactly once with the reply, as long as - the parameter types match. If they don't, the reply cannot be delivered. - - Returns the identification of the message that was sent or 0 if nothing was sent. -*/ -int QDBusConnection::sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, - const char *method) const -{ - if (!d || !d->connection) - return 0; - - return d->sendWithReplyAsync(message, receiver, method); -} - -/*! - Sends the \a message over this connection and blocks, waiting for a reply. This function is - suitable for method calls only. It returns the reply message as its return value, which will be - either of type QDBusMessage::ReplyMessage or QDBusMessage::ErrorMessage. - - See the QDBusInterface::call function for a more friendly way of placing calls. - - \warning If \a mode is \c UseEventLoop, this function will reenter the Qt event loop in order to - wait for the reply. During the wait, it may deliver signals and other method calls to - your application. Therefore, it must be prepared to handle a reentrancy whenever a call - is placed with sendWithReply. -*/ -QDBusMessage QDBusConnection::sendWithReply(const QDBusMessage &message, WaitMode mode) const -{ - if (!d || !d->connection) - return QDBusMessage(); - return d->sendWithReply(message, mode); -} - -/*! - Connects the signal specified by the \a service, \a path, \a interface and \a name parameters to - the slot \a slot in object \a receiver. The arguments \a service and \a path can be empty, - denoting a connection to any signal of the \a interface - \a name pair, from any remote - application. - - Returns true if the connection was successful. - - \warning The signal will only be delivered to the slot if the parameters match. This verification - can be done only when the signal is received, not at connection time. -*/ -bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface, - const QString &name, QObject *receiver, const char *slot) -{ - return connect(service, path, interface, name, QString(), receiver, slot); -} - -/*! - \overload - Connects the signal to the slot \a slot in object \a receiver. Unlike the other - QDBusConnection::connect overload, this function allows one to specify the parameter signature - to be connected using the \a signature variable. The function will then verify that this - signature can be delivered to the slot specified by \a slot and return false otherwise. -*/ -bool QDBusConnection::connect(const QString &service, const QString &path, const QString& interface, - const QString &name, const QString &signature, - QObject *receiver, const char *slot) -{ - if (!receiver || !slot || !d || !d->connection || !QDBusUtil::isValidInterfaceName(interface)) - return false; - - QString source; - if (!service.isEmpty()) { - source = d->getNameOwner(service); - if (source.isEmpty()) - return false; - } - - // check the slot - QDBusConnectionPrivate::SignalHook hook; - QString key; - hook.signature = signature; - if (!d->prepareHook(hook, key, source, path, interface, name, receiver, slot, 0, false)) - return false; // don't connect - - // avoid duplicating: - QWriteLocker locker(&d->lock); - QDBusConnectionPrivate::SignalHookHash::ConstIterator it = d->signalHooks.find(key); - for ( ; it != d->signalHooks.constEnd() && it.key() == key; ++it) { - const QDBusConnectionPrivate::SignalHook &entry = it.value(); - if (entry.sender == hook.sender && - entry.path == hook.path && - entry.signature == hook.signature && - entry.obj == hook.obj && - entry.midx == hook.midx) { - // no need to compare the parameters if it's the same slot - return true; // already there - } - } - - - d->connectSignal(key, hook); - return true; -} - -/*! - Registers the object \a object at path \a path and returns true if the registration was - successful. The \a options parameter specifies how much of the object \a object will be exposed - through D-Bus. - - This function does not replace existing objects: if there is already an object registered at - path \a path, this function will return false. Use unregisterObject() to unregister it first. - - You cannot register an object as a child object of an object that was registered with - QDBusConnection::ExportChildObjects. -*/ -bool QDBusConnection::registerObject(const QString &path, QObject *object, RegisterOptions options) -{ - Q_ASSERT_X(QDBusUtil::isValidObjectPath(path), "QDBusConnection::registerObject", - "Invalid object path given"); - if (!d || !d->connection || !object || !options || !QDBusUtil::isValidObjectPath(path)) - return false; - - if (options & ExportSignals) { - qWarning("Cannot export signals from objects. Use an adaptor for that purpose."); - return false; - } - - QStringList pathComponents = path.split(QLatin1Char('/')); - if (pathComponents.last().isEmpty()) - pathComponents.removeLast(); - QWriteLocker locker(&d->lock); - - // lower-bound search for where this object should enter in the tree - QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode; - int i = 1; - while (node) { - if (pathComponents.count() == i) { - // this node exists - // consider it free if there's no object here and the user is not trying to - // replace the object sub-tree - if ((options & ExportChildObjects && !node->children.isEmpty()) || node->obj) - return false; - - // we can add the object here - node->obj = object; - node->flags = options; - - d->registerObject(node); - qDebug("REGISTERED FOR %s", path.toLocal8Bit().constData()); - return true; - } - - // find the position where we'd insert the node - QVector::Iterator it = - qLowerBound(node->children.begin(), node->children.end(), pathComponents.at(i)); - if (it != node->children.constEnd() && it->name == pathComponents.at(i)) { - // match: this node exists - node = it->node; - - // are we allowed to go deeper? - if (node->flags & ExportChildObjects) { - // we're not - qDebug("Cannot register object at %s because %s exports its own child objects", - qPrintable(path), qPrintable(pathComponents.at(i))); - return false; - } - } else { - // add entry - QDBusConnectionPrivate::ObjectTreeNode::Data entry; - entry.name = pathComponents.at(i); - entry.node = new QDBusConnectionPrivate::ObjectTreeNode; - node->children.insert(it, entry); - - node = entry.node; - } - - // iterate - ++i; - } - - Q_ASSERT_X(false, "QDBusConnection::registerObject", "The impossible happened"); - return false; -} - -/*! - Unregisters an object that was registered with the registerObject() at the object path given by - \a path and, if \a mode is QDBusConnection::UnregisterTree, all of its sub-objects too. - - Note that you cannot unregister objects that were not registered with registerObject(). -*/ -void QDBusConnection::unregisterObject(const QString &path, UnregisterMode mode) -{ - if (!d || !d->connection || !QDBusUtil::isValidObjectPath(path)) - return; - - QStringList pathComponents = path.split(QLatin1Char('/')); - QWriteLocker locker(&d->lock); - QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode; - int i = 1; - - // find the object - while (node) { - if (pathComponents.count() == i) { - // found it - node->obj = 0; - node->flags = 0; - - if (mode == UnregisterTree) { - // clear the sub-tree as well - node->clear(); // can't disconnect the objects because we really don't know if they can - // be found somewhere else in the path too - } - - return; - } - - QVector::ConstIterator it = - qLowerBound(node->children.constBegin(), node->children.constEnd(), pathComponents.at(i)); - if (it == node->children.constEnd() || it->name != pathComponents.at(i)) - break; // node not found - - node = it->node; - ++i; - } -} - -/*! - Returns a dynamic QDBusInterface associated with the interface \a interface on object at path \a - path on service \a service. - - This function creates a new object. It is your resposibility to ensure it is properly deleted - (you can use all normal QObject deletion mechanisms, including the QObject::deleteLater() slot - and QObject::setParent()). - - If the searching for this interface on the remote object failed, this function returns 0. -*/ -QDBusInterface *QDBusConnection::findInterface(const QString& service, const QString& path, - const QString& interface) -{ - Q_ASSERT_X(QDBusUtil::isValidBusName(service), - "QDBusConnection::findInterface", "Invalid service name"); - Q_ASSERT_X(QDBusUtil::isValidObjectPath(path), - "QDBusConnection::findInterface", "Invalid object path given"); - Q_ASSERT_X(interface.isEmpty() || QDBusUtil::isValidInterfaceName(interface), - "QDBusConnection::findInterface", "Invalid interface name"); - if (!d) - return 0; - - QDBusInterfacePrivate *p = d->findInterface(service, path, interface); - QDBusInterface *retval = new QDBusInterface(p); - retval->setParent(d); - return retval; -} - -/*! - \fn QDBusConnection::findInterface(const QString &service, const QString &path) - Returns an interface of type \c Interface associated with the object on path \a path at service - \a service. - - \c Interface must be a class generated by \l {dbusidl2cpp.html}. - - This function creates a new object. It is your resposibility to ensure it is properly deleted - (you can use all normal QObject deletion mechanisms, including the QObject::deleteLater() slot - and QObject::setParent()). -*/ - -/*! - Returns a QDBusBusService object that represents the D-Bus bus service on this connection. - - This function returns 0 for peer-to-peer connections. -*/ -QDBusBusService *QDBusConnection::busService() const -{ - if (!d) - return 0; - return d->busService; -} - -QDBusAbstractInterfacePrivate * -QDBusConnection::findInterface_helper(const QString &service, const QString &path, - const char *iface) -{ - QString interface = QLatin1String(iface); - // service and path can be empty here, but interface can't - Q_ASSERT_X(service.isEmpty() || QDBusUtil::isValidBusName(service), - "QDBusConnection::findInterface", "Invalid service name"); - Q_ASSERT_X(path.isEmpty() || QDBusUtil::isValidObjectPath(path), - "QDBusConnection::findInterface", "Invalid object path given"); - Q_ASSERT_X(QDBusUtil::isValidInterfaceName(interface), - "QDBusConnection::findInterface", "Invalid interface class!"); - if (!d) - return 0; - - QString owner; - if (!service.isEmpty()) { - // check if it's there first -- FIXME: add binding mode - owner = d->getNameOwner(service); - if (owner.isEmpty()) { - QDBusAbstractInterfacePrivate *p; - p = new QDBusAbstractInterfacePrivate(*this, d, service, path, interface); - p->isValid = false; - p->lastError = d->lastError; - return p; - } - } - - return new QDBusAbstractInterfacePrivate(*this, d, owner, path, interface); -} - -/*! - Returns true if this QDBusConnection object is connected. - - If it isn't connected, calling QDBusConnection::addConnection on the same connection name - will not make be connected. You need to call the QDBusConnection constructor again. -*/ -bool QDBusConnection::isConnected( ) const -{ - return d && d->connection && dbus_connection_get_is_connected(d->connection); -} - -/*! - Returns the last error that happened in this connection. - - This function is provided for low-level code. If you're using QDBusInterface::call, error codes are - reported by its return value. - - \sa QDBusInterface, QDBusMessage -*/ -QDBusError QDBusConnection::lastError() const -{ - return d ? d->lastError : QDBusError(); -} - -/*! - Returns the unique connection name for this connection, if this QDBusConnection object is - connected, or an empty QString otherwise. - - A Unique Connection Name is a string in the form ":x.xxx" (where x are decimal digits) that is - assigned by the D-Bus server daemon upon connection. It uniquely identifies this client in the - bus. - - This function returns an empty QString for peer-to-peer connections. -*/ -QString QDBusConnection::baseService() const -{ - return d && d->connection ? - QString::fromUtf8(dbus_bus_get_unique_name(d->connection)) - : QString(); -} - -Q_GLOBAL_STATIC(QMutex, defaultBussesMutex) -static const char sessionBusName[] = "qt_default_session_bus"; -static const char systemBusName[] = "qt_default_system_bus"; -static QDBusConnection *sessionBus = 0; -static QDBusConnection *systemBus = 0; - -static void closeConnections() -{ - QMutexLocker locker(defaultBussesMutex()); - delete sessionBus; - delete systemBus; - QDBusConnection::closeConnection(QLatin1String(sessionBusName)); - QDBusConnection::closeConnection(QLatin1String(systemBusName)); - sessionBus = systemBus = 0; -} - -static QDBusConnection *openConnection(QDBusConnection::BusType type) -{ - QMutexLocker locker(defaultBussesMutex()); - qAddPostRoutine(closeConnections); - - if (type == QDBusConnection::SystemBus) { - if (systemBus) - // maybe it got created before we locked the mutex - return systemBus; - systemBus = new QDBusConnection(QDBusConnection::addConnection(QDBusConnection::SystemBus, - QLatin1String(systemBusName))); - return systemBus; - } else { - if (sessionBus) - // maybe it got created before we locked the mutex - return sessionBus; - sessionBus = new QDBusConnection(QDBusConnection::addConnection(QDBusConnection::SessionBus, - QLatin1String(sessionBusName))); - return sessionBus; - } -} - -namespace QDBus { - QDBusConnection &sessionBus() - { - if (::sessionBus) return *::sessionBus; - return *openConnection(QDBusConnection::SessionBus); - } - - QDBusConnection &systemBus() - { - if (::systemBus) return *::systemBus; - return *openConnection(QDBusConnection::SystemBus); - } -} - diff --git a/qt/src/qdbusconnection.h b/qt/src/qdbusconnection.h deleted file mode 100644 index 61a3439e..00000000 --- a/qt/src/qdbusconnection.h +++ /dev/null @@ -1,124 +0,0 @@ -/* qdbusconnection.h QDBusConnection object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSCONNECTION_H -#define QDBUSCONNECTION_H - -#include "qdbusmacros.h" -#include - -class QDBusAbstractInterfacePrivate; -class QDBusInterface; -class QDBusError; -class QDBusMessage; -class QDBusBusService; -class QObject; - -class QDBusConnectionPrivate; -class QDBUS_EXPORT QDBusConnection -{ -public: - enum BusType { SessionBus, SystemBus, ActivationBus }; - enum WaitMode { UseEventLoop, NoUseEventLoop }; - enum RegisterOption { - ExportAdaptors = 0x01, - - ExportSlots = 0x10, - ExportSignals = 0x20, - ExportProperties = 0x40, - ExportContents = 0xf0, - - ExportAllSlots = 0x110, - ExportAllSignals = 0x220, - ExportAllProperties = 0x440, - ExportAllContents = 0xff0, - - ExportChildObjects = 0x1000 - }; - enum UnregisterMode { - UnregisterNode, - UnregisterTree - }; - - Q_DECLARE_FLAGS(RegisterOptions, RegisterOption) - - QDBusConnection(const QString &name); - QDBusConnection(const QDBusConnection &other); - ~QDBusConnection(); - - QDBusConnection &operator=(const QDBusConnection &other); - - bool isConnected() const; - QString baseService() const; - QDBusError lastError() const; - - bool send(const QDBusMessage &message) const; - QDBusMessage sendWithReply(const QDBusMessage &message, WaitMode mode = NoUseEventLoop) const; - int sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, - const char *slot) const; - - bool connect(const QString &service, const QString &path, const QString &interface, - const QString &name, QObject *receiver, const char *slot); - bool connect(const QString &service, const QString &path, const QString &interface, - const QString &name, const QString& signature, - QObject *receiver, const char *slot); - - bool registerObject(const QString &path, QObject *object, - RegisterOptions options = ExportAdaptors); - void unregisterObject(const QString &path, UnregisterMode mode = UnregisterNode); - - template - inline Interface *findInterface(const QString &service, const QString &path); - QDBusInterface *findInterface(const QString& service, const QString& path, - const QString& interface = QString()); - - QDBusBusService *busService() const; - - static QDBusConnection addConnection(BusType type, const QString &name); - static QDBusConnection addConnection(const QString &address, const QString &name); - static void closeConnection(const QString &name); - -private: - QDBusAbstractInterfacePrivate *findInterface_helper(const QString &, const QString &, - const char*); - QDBusConnectionPrivate *d; -}; - -template -inline Interface *QDBusConnection::findInterface(const QString &service, const QString &path) -{ - register QDBusAbstractInterfacePrivate *d_ptr; - d_ptr = findInterface_helper(service, path, Interface::staticInterfaceName()); - if (d_ptr) - return new Interface(d_ptr); - return 0; -} - -namespace QDBus { - QDBUS_EXPORT QDBusConnection &sessionBus(); - QDBUS_EXPORT QDBusConnection &systemBus(); -} - -Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::RegisterOptions) -#endif diff --git a/qt/src/qdbusconnection_p.h b/qt/src/qdbusconnection_p.h deleted file mode 100644 index bab0b65d..00000000 --- a/qt/src/qdbusconnection_p.h +++ /dev/null @@ -1,245 +0,0 @@ -/* qdbusconnection_p.h QDBusConnection private object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSCONNECTION_P_H -#define QDBUSCONNECTION_P_H - -#include "qdbuserror.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "qdbusmessage.h" - -class QDBusMessage; -class QSocketNotifier; -class QTimerEvent; -class QDBusObjectPrivate; -class CallDeliveryEvent; -class QMetaMethod; -class QDBusInterfacePrivate; -struct QDBusMetaObject; -class QDBusAbstractInterface; -class QDBusBusService; - -class QDBusConnectionPrivate: public QObject -{ - Q_OBJECT -public: - // structs and enums - enum ConnectionMode { InvalidMode, ServerMode, ClientMode }; - - struct Watcher - { - Watcher(): watch(0), read(0), write(0) {} - DBusWatch *watch; - QSocketNotifier *read; - QSocketNotifier *write; - }; - - struct SignalHook - { - inline SignalHook() : obj(0), midx(-1) { } - QString sender, path, signature; - QObject* obj; - int midx; - QList params; - }; - - struct ObjectTreeNode - { - struct Data - { - QString name; - ObjectTreeNode *node; - - inline bool operator<(const QString &other) const - { return name < other; } - }; - - inline ObjectTreeNode() : obj(0), flags(0) { } - inline ~ObjectTreeNode() { clear(); } - inline void clear() - { - foreach (const Data &entry, children) { - entry.node->clear(); - delete entry.node; - } - children.clear(); - } - - QObject* obj; - int flags; - QVector children; - }; - -public: - // typedefs - typedef QMultiHash WatcherHash; - typedef QHash TimeoutHash; - typedef QMultiHash SignalHookHash; - typedef QHash MetaObjectHash; - -public: - // public methods - QDBusConnectionPrivate(QObject *parent = 0); - ~QDBusConnectionPrivate(); - - void bindToApplication(); - - void setConnection(DBusConnection *connection); - void setServer(DBusServer *server); - void closeConnection(); - void timerEvent(QTimerEvent *e); - - QString getNameOwner(const QString &service); - - int send(const QDBusMessage &message) const; - QDBusMessage sendWithReply(const QDBusMessage &message, int mode); - int sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, - const char *method); - void connectSignal(const QString &key, const SignalHook &hook); - void registerObject(const ObjectTreeNode *node); - void connectRelay(const QString &service, const QString &path, const QString &interface, - QDBusAbstractInterface *receiver, const char *signal); - void disconnectRelay(const QString &service, const QString &path, const QString &interface, - QDBusAbstractInterface *receiver, const char *signal); - - bool handleSignal(const QString &key, const QDBusMessage &msg); - bool handleSignal(const QDBusMessage &msg); - bool handleObjectCall(const QDBusMessage &message); - bool handleError(); - - bool activateSignal(const SignalHook& hook, const QDBusMessage &msg); - bool activateCall(QObject* object, int flags, const QDBusMessage &msg); - bool activateObject(const ObjectTreeNode *node, const QDBusMessage &msg); - bool activateInternalFilters(const ObjectTreeNode *node, const QDBusMessage &msg); - - void postCallDeliveryEvent(CallDeliveryEvent *data); - CallDeliveryEvent *postedCallDeliveryEvent(); - void deliverCall(const CallDeliveryEvent &data) const; - - QDBusInterfacePrivate *findInterface(const QString &service, const QString &path, - const QString &interface); - -protected: - virtual void customEvent(QEvent *event); - -private: - QDBusMetaObject *findMetaObject(const QString &service, const QString &path, - const QString &interface); - -public slots: - // public slots - void doDispatch(); - void socketRead(int); - void socketWrite(int); - void objectDestroyed(QObject *o); - void relaySignal(QObject *obj, const char *interface, const char *name, const QVariantList &args); - -public: - // public member variables - QString name; // this connection's name - - DBusError error; - QDBusError lastError; - - QAtomic ref; - QReadWriteLock lock; - ConnectionMode mode; - DBusConnection *connection; - DBusServer *server; - QDBusBusService *busService; - - WatcherHash watchers; - TimeoutHash timeouts; - SignalHookHash signalHooks; - QList pendingTimeouts; - - ObjectTreeNode rootNode; - MetaObjectHash cachedMetaObjects; - - QMutex callDeliveryMutex; - CallDeliveryEvent *callDeliveryState; // protected by the callDeliveryMutex mutex - -public: - // static methods - static int messageMetaType; - static int registerMessageMetaType(); - static int findSlot(QObject *obj, const QByteArray &normalizedName, QList& params); - static bool prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key, - const QString &service, const QString &path, - const QString &interface, const QString &name, - QObject *receiver, const char *signal, int minMIdx, - bool buildSignature); - static DBusHandlerResult messageFilter(DBusConnection *, DBusMessage *, void *); - static void messageResultReceived(DBusPendingCall *, void *); -}; - -class QDBusReplyWaiter: public QEventLoop -{ - Q_OBJECT -public: - QDBusMessage replyMsg; - -public slots: - void reply(const QDBusMessage &msg); -}; - -// in qdbusmisc.cpp -extern int qDBusParametersForMethod(const QMetaMethod &mm, QList& metaTypes); -extern int qDBusNameToTypeId(const char *name); -extern bool qDBusCheckAsyncTag(const char *tag); - -// in qdbusinternalfilters.cpp -extern QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode *node); -extern void qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode *node, - const QDBusMessage &msg); -extern void qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode *node, - const QDBusMessage &msg); -extern void qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode *node, - const QDBusMessage &msg); - -#endif diff --git a/qt/src/qdbuserror.cpp b/qt/src/qdbuserror.cpp deleted file mode 100644 index ee6ce12c..00000000 --- a/qt/src/qdbuserror.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/* qdbuserror.h QDBusError object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbuserror.h" - -#include -#include - -#include -#include "qdbusmessage.h" - -struct ErrorMessageMapping -{ - ErrorMessageMapping(); - QVarLengthArray messages; - - inline const char *get(QDBusError::KnownErrors code) const - { - if (code <= QDBusError::Other || code > QDBusError::qKnownErrorsMax) - return messages[int(QDBusError::Other) - 1]; - return messages[int(code) - 1]; - } - - inline QDBusError::KnownErrors get(const char *name) const - { - if (!name || !*name) - return QDBusError::NoError; - for (int i = QDBusError::Other; i <= QDBusError::qKnownErrorsMax; ++i) - if (strcmp(name, messages[i - 1]) == 0) - return QDBusError::KnownErrors(i); - return QDBusError::Other; - } -}; - -static const char errorMessages_string[] = - // in the same order as KnownErrors! - "other\0" // Other -- shouldn't happen - DBUS_ERROR_FAILED "\0" // Failed - DBUS_ERROR_NO_MEMORY "\0" // NoMemory - DBUS_ERROR_SERVICE_UNKNOWN "\0" // ServiceUnknown - DBUS_ERROR_NO_REPLY "\0" // NoReply - DBUS_ERROR_BAD_ADDRESS "\0" // BadAddress - DBUS_ERROR_NOT_SUPPORTED "\0" // NotSupported - DBUS_ERROR_LIMITS_EXCEEDED "\0" // LimitsExceeded - DBUS_ERROR_ACCESS_DENIED "\0" // AccessDenied - DBUS_ERROR_NO_SERVER "\0" // NoServer - DBUS_ERROR_TIMEOUT "\0" // Timeout - DBUS_ERROR_NO_NETWORK "\0" // NoNetwork - DBUS_ERROR_ADDRESS_IN_USE "\0" // AddressInUse - DBUS_ERROR_DISCONNECTED "\0" // Disconnected - DBUS_ERROR_INVALID_ARGS "\0" // InvalidArgs - DBUS_ERROR_UNKNOWN_METHOD "\0" // UnknownMethod - DBUS_ERROR_TIMED_OUT "\0" // TimedOut - DBUS_ERROR_INVALID_SIGNATURE "\0" // InvalidSignature - "com.trolltech.QtDBus.Error.UnknownInterface\0" // UnknownInterface - "com.trolltech.QtDBus.Error.InternalError\0" // InternalError - "\0"; - -ErrorMessageMapping::ErrorMessageMapping() - : messages(int(QDBusError::qKnownErrorsMax)) -{ - // create the list: - const char *p = errorMessages_string; - int i = 0; - while (*p) { - messages[i] = p; - p += strlen(p) + 1; - ++i; - } -} - -Q_GLOBAL_STATIC(ErrorMessageMapping, errorMessages) - -/*! - \class QDBusError - \brief Represents an error received from the D-Bus bus or from remote applications found in the bus. - - When dealing with the D-Bus bus service or with remote applications over D-Bus, a number of - error conditions can happen. This error conditions are sometimes signalled by a returned error - value or by a QDBusError. - - C++ and Java exceptions are a valid analogy for D-Bus errors: instead of returning normally with - a return value, remote applications and the bus may decide to throw an error condition. However, - the QtDBus implementation does not use the C++ exception-throwing mechanism, so you will receive - QDBusErrors in the return reply (see QDBusReply::error()). - - QDBusError objects are used to inspect the error name and message as received from the bus and - remote applications. You should not create such objects yourself to signal error conditions when - called from D-Bus: instead, use QDBusMessage::error and QDBusConnection::send. - - \sa QDBusConnection::send(), QDBusMessage, QDBusReply -*/ - -/*! - \enum QDBusError::KnownErrors - - In order to facilitate verification of the most common D-Bus errors generated by the D-Bus - implementation and by the bus daemon itself, QDBusError can be compared to a set of pre-defined - values: - - \value NoError QDBusError is invalid (i.e., the call succeeded) - \value Other QDBusError contains an error that is one of the well-known ones - \value Failed The call failed (\c org.freedesktop.DBus.Error.Failed) - \value NoMemory Out of memory (\c org.freedesktop.DBus.Error.NoMemory) - \value ServiceUnknown The called service is not known - (\c org.freedesktop.DBus.Error.ServiceUnknown) - \value NoReply The called method did not reply within the specified timeout - (\c org.freedesktop.DBus.Error.NoReply) - \value BadAddress The address given is not valid - (\c org.freedesktop.DBus.Error.BadAddress) - \value NotSupported The call/operation is not supported - (\c org.freedesktop.DBus.Error.NotSupported) - \value LimitsExceeded The limits allocated to this process/call/connection exceeded the - pre-defined values (\c org.freedesktop.DBus.Error.LimitsExceeded) - \value AccessDenied The call/operation tried to access a resource it isn't allowed to - (\c org.freedesktop.DBus.Error.AccessDenied) - \value NoServer \e {Documentation doesn't say what this is for} - (\c org.freedesktop.DBus.Error.NoServer) - \value Timeout \e {Documentation doesn't say what this is for or how it's used} - (\c org.freedesktop.DBus.Error.Timeout) - \value NoNetwork \e {Documentation doesn't say what this is for} - (\c org.freedesktop.DBus.Error.NoNetwork) - \value AddressInUse QDBusServer tried to bind to an address that is already in use - (\c org.freedesktop.DBus.Error.AddressInUse) - \value Disconnected The call/process/message was sent after QDBusConnection disconnected - (\c org.freedesktop.DBus.Error.Disconnected) - \value InvalidArgs The arguments passed to this call/operation are not valid - (\c org.freedesktop.DBus.Error.InvalidArgs) - \value UnknownMethod The method called was not found in this object/interface with the - given parameters (\c org.freedesktop.DBus.Error.UnknownMethod) - \value TimedOut \e {Documentation doesn't say...} - (\c org.freedesktop.DBus.Error.TimedOut) - \value InvalidSignature The type signature is not valid or compatible - (\c org.freedesktop.DBus.Error.InvalidSignature) - \value UnknownInterface The interface is not known - \value InternalError An internal error occurred - (\c com.trolltech.QtDBus.Error.InternalError) - -*/ - -/*! - \internal - Constructs a QDBusError from a DBusError structure. -*/ -QDBusError::QDBusError(const DBusError *error) - : code(NoError) -{ - if (!error || !dbus_error_is_set(error)) - return; - - code = errorMessages()->get(error->name); - nm = QString::fromUtf8(error->name); - msg = QString::fromUtf8(error->message); -} - -/*! - \internal - Constructs a QDBusError from a QDBusMessage. -*/ -QDBusError::QDBusError(const QDBusMessage &qdmsg) - : code(Other) -{ - if (qdmsg.type() != QDBusMessage::ErrorMessage) - return; - - nm = qdmsg.name(); - if (qdmsg.count()) - msg = qdmsg[0].toString(); - code = errorMessages()->get(nm.toUtf8().constData()); -} - -/*! - \internal - Constructs a QDBusError from a well-known error code -*/ -QDBusError::QDBusError(KnownErrors error, const QString &mess) - : code(error) -{ - nm = QLatin1String(errorMessages()->get(error)); - msg = mess; -} - -/*! - \fn QDBusError::name() const - Returns this error's name. Error names are similar to D-Bus Interface names, like - "org.freedesktop.DBus.InvalidArgs". -*/ - -/*! - \fn QDBusError::message() const - Returns the message that the callee associated with this error. Error messages are - implementation defined and usually contain a human-readable error code, though this does not - mean it is suitable for your end-users. -*/ - -/*! - \fn QDBusError::isValid() const - Returns true if this is a valid error condition (i.e., if there was an error), false otherwise. -*/ - -/*! - \fn QDBusError::operator==(KnownErrors error) const - Compares this QDBusError against the well-known error code \a error and returns true if they - match. -*/ - -/*! - \fn operator==(QDBusError::KnownErrors p1, const QDBusError &p2) - \relates QDBusError - - Compares the QDBusError \a p2 against the well-known error code \a p1 and returns true if they - match. -*/ - -#ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug dbg, const QDBusError &msg) -{ - dbg.nospace() << "QDBusError(" << msg.name() << ", " << msg.message() << ")"; - return dbg.space(); -} -#endif - - diff --git a/qt/src/qdbuserror.h b/qt/src/qdbuserror.h deleted file mode 100644 index e7aacdb0..00000000 --- a/qt/src/qdbuserror.h +++ /dev/null @@ -1,93 +0,0 @@ -/* qdbuserror.h QDBusError object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSERROR_H -#define QDBUSERROR_H - -#include "qdbusmacros.h" -#include - -struct DBusError; -class QDBusMessage; - -class QDBUS_EXPORT QDBusError -{ -public: - enum KnownErrors { - NoError = 0, - Other = 1, - Failed, - NoMemory, - ServiceUnknown, - NoReply, - BadAddress, - NotSupported, - LimitsExceeded, - AccessDenied, - NoServer, - Timeout, - NoNetwork, - AddressInUse, - Disconnected, - InvalidArgs, - UnknownMethod, - TimedOut, - InvalidSignature, - UnknownInterface, - InternalError, - -#ifndef Q_QDOC - // don't use this one! - qKnownErrorsMax = InternalError -#endif - }; - - QDBusError(const DBusError *error = 0); - QDBusError(const QDBusMessage& msg); - QDBusError(KnownErrors error, const QString &message); - - inline QString name() const { return nm; } - inline QString message() const { return msg; } - inline bool isValid() const { return !nm.isNull() && !msg.isNull(); } - - inline bool operator==(KnownErrors error) const - { return code == error; } - -private: - KnownErrors code; - QString nm, msg; -}; - -inline bool operator==(QDBusError::KnownErrors p1, const QDBusError &p2) -{ return p2 == p1; } -inline bool operator!=(QDBusError::KnownErrors p1, const QDBusError &p2) -{ return !(p2 == p1); } -inline bool operator!=(const QDBusError &p1, QDBusError::KnownErrors p2) -{ return !(p1 == p2); } - -#ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug, const QDBusError &); -#endif - -#endif diff --git a/qt/src/qdbusintegrator.cpp b/qt/src/qdbusintegrator.cpp deleted file mode 100644 index 509e110f..00000000 --- a/qt/src/qdbusintegrator.cpp +++ /dev/null @@ -1,1554 +0,0 @@ -/* qdbusintegrator.cpp QDBusConnection private implementation - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "qdbusconnection_p.h" -#include "qdbusinterface_p.h" -#include "qdbusmessage.h" -#include "qdbusabstractadaptor.h" -#include "qdbusabstractadaptor_p.h" -#include "qdbustypehelper_p.h" -#include "qdbusutil.h" -#include "qdbustype_p.h" - -#ifndef USE_OUTSIDE_DISPATCH -# define USE_OUTSIDE_DISPATCH 0 -#endif - -int QDBusConnectionPrivate::messageMetaType = 0; - -typedef void (*QDBusSpyHook)(const QDBusMessage&); -typedef QVarLengthArray QDBusSpyHookList; -Q_GLOBAL_STATIC(QDBusSpyHookList, qDBusSpyHookList) - -struct QDBusPendingCall -{ - QPointer receiver; - QList metaTypes; - int methodIdx; - DBusPendingCall *pending; - const QDBusConnectionPrivate *connection; -}; - -class CallDeliveryEvent: public QEvent -{ -public: - CallDeliveryEvent() - : QEvent(QEvent::User), object(0), flags(0), slotIdx(-1) - { } - - const QDBusConnectionPrivate *conn; - QPointer object; - QDBusMessage message; - QList metaTypes; - - int flags; - int slotIdx; -}; - -static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data) -{ - Q_ASSERT(timeout); - Q_ASSERT(data); - - // qDebug("addTimeout %d", dbus_timeout_get_interval(timeout)); - - QDBusConnectionPrivate *d = static_cast(data); - - if (!dbus_timeout_get_enabled(timeout)) - return true; - - if (!QCoreApplication::instance()) { - d->pendingTimeouts.append(timeout); - return true; - } - int timerId = d->startTimer(dbus_timeout_get_interval(timeout)); - if (!timerId) - return false; - - d->timeouts[timerId] = timeout; - return true; -} - -static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data) -{ - Q_ASSERT(timeout); - Q_ASSERT(data); - - // qDebug("removeTimeout"); - - QDBusConnectionPrivate *d = static_cast(data); - d->pendingTimeouts.removeAll(timeout); - - QDBusConnectionPrivate::TimeoutHash::iterator it = d->timeouts.begin(); - while (it != d->timeouts.end()) { - if (it.value() == timeout) { - d->killTimer(it.key()); - it = d->timeouts.erase(it); - } else { - ++it; - } - } -} - -static void qDBusToggleTimeout(DBusTimeout *timeout, void *data) -{ - Q_ASSERT(timeout); - Q_ASSERT(data); - - //qDebug("ToggleTimeout"); - - qDBusRemoveTimeout(timeout, data); - qDBusAddTimeout(timeout, data); -} - -static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data) -{ - Q_ASSERT(watch); - Q_ASSERT(data); - - QDBusConnectionPrivate *d = static_cast(data); - - int flags = dbus_watch_get_flags(watch); - int fd = dbus_watch_get_fd(watch); - - QDBusConnectionPrivate::Watcher watcher; - if (flags & DBUS_WATCH_READABLE) { - //qDebug("addReadWatch %d", fd); - watcher.watch = watch; - if (QCoreApplication::instance()) { - watcher.read = new QSocketNotifier(fd, QSocketNotifier::Read, d); - watcher.read->setEnabled(dbus_watch_get_enabled(watch)); - d->connect(watcher.read, SIGNAL(activated(int)), SLOT(socketRead(int))); - } - } - if (flags & DBUS_WATCH_WRITABLE) { - //qDebug("addWriteWatch %d", fd); - watcher.watch = watch; - if (QCoreApplication::instance()) { - watcher.write = new QSocketNotifier(fd, QSocketNotifier::Write, d); - watcher.write->setEnabled(dbus_watch_get_enabled(watch)); - d->connect(watcher.write, SIGNAL(activated(int)), SLOT(socketWrite(int))); - } - } - d->watchers.insertMulti(fd, watcher); - - return true; -} - -static void qDBusRemoveWatch(DBusWatch *watch, void *data) -{ - Q_ASSERT(watch); - Q_ASSERT(data); - - //qDebug("remove watch"); - - QDBusConnectionPrivate *d = static_cast(data); - int fd = dbus_watch_get_fd(watch); - - QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd); - while (i != d->watchers.end() && i.key() == fd) { - if (i.value().watch == watch) { - delete i.value().read; - delete i.value().write; - d->watchers.erase(i); - return; - } - ++i; - } -} - -static void qDBusToggleWatch(DBusWatch *watch, void *data) -{ - Q_ASSERT(watch); - Q_ASSERT(data); - - QDBusConnectionPrivate *d = static_cast(data); - int fd = dbus_watch_get_fd(watch); - - QDBusConnectionPrivate::WatcherHash::iterator i = d->watchers.find(fd); - while (i != d->watchers.end() && i.key() == fd) { - if (i.value().watch == watch) { - bool enabled = dbus_watch_get_enabled(watch); - int flags = dbus_watch_get_flags(watch); - - //qDebug("toggle watch %d to %d (write: %d, read: %d)", dbus_watch_get_fd(watch), enabled, flags & DBUS_WATCH_WRITABLE, flags & DBUS_WATCH_READABLE); - - if (flags & DBUS_WATCH_READABLE && i.value().read) - i.value().read->setEnabled(enabled); - if (flags & DBUS_WATCH_WRITABLE && i.value().write) - i.value().write->setEnabled(enabled); - return; - } - ++i; - } -} - -static void qDBusNewConnection(DBusServer *server, DBusConnection *c, void *data) -{ - Q_ASSERT(data); Q_ASSERT(server); Q_ASSERT(c); - Q_UNUSED(data); Q_UNUSED(server); Q_UNUSED(c); - - qDebug("SERVER: GOT A NEW CONNECTION"); // TODO -} - -extern QDBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook); -void qDBusAddSpyHook(QDBusSpyHook hook) -{ - qDBusSpyHookList()->append(hook); -} - -#if USE_OUTSIDE_DISPATCH -# define HANDLED DBUS_HANDLER_RESULT_HANDLED_OUTSIDE_DISPATCH -static DBusHandlerResult qDBusSignalFilterOutside(DBusConnection *connection, - DBusMessage *message, void *data) -{ - Q_ASSERT(data); - Q_UNUSED(connection); - Q_UNUSED(message); - - QDBusConnectionPrivate *d = static_cast(data); - if (d->mode == QDBusConnectionPrivate::InvalidMode) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; // internal error, actually - - CallDeliveryEvent *e = d->postedCallDeliveryEvent(); - - d->deliverCall(*e); - delete e; - - return DBUS_HANDLER_RESULT_HANDLED; -} -#else -# define HANDLED DBUS_HANDLER_RESULT_HANDLED -#endif - -extern "C" { -static DBusHandlerResult -qDBusSignalFilter(DBusConnection *connection, DBusMessage *message, void *data) -{ - return QDBusConnectionPrivate::messageFilter(connection, message, data); -} -} - -DBusHandlerResult QDBusConnectionPrivate::messageFilter(DBusConnection *connection, - DBusMessage *message, void *data) -{ - Q_ASSERT(data); - Q_UNUSED(connection); - - QDBusConnectionPrivate *d = static_cast(data); - if (d->mode == QDBusConnectionPrivate::InvalidMode) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - - QDBusMessage amsg = QDBusMessage::fromDBusMessage(message, QDBusConnection(d->name)); - qDebug() << "got message:" << amsg; - - const QDBusSpyHookList *list = qDBusSpyHookList(); - for (int i = 0; i < list->size(); ++i) { - qDebug() << "calling the message spy hook"; - (*(*list)[i])(amsg); - } - - bool handled = false; - int msgType = dbus_message_get_type(message); - if (msgType == DBUS_MESSAGE_TYPE_SIGNAL) { - handled = d->handleSignal(amsg); - } else if (msgType == DBUS_MESSAGE_TYPE_METHOD_CALL) { - handled = d->handleObjectCall(amsg); - } - - return handled ? HANDLED : - DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -static void huntAndDestroy(QObject *needle, QDBusConnectionPrivate::ObjectTreeNode *haystack) -{ - foreach (const QDBusConnectionPrivate::ObjectTreeNode::Data &entry, haystack->children) - huntAndDestroy(needle, entry.node); - - if (needle == haystack->obj) { - haystack->obj = 0; - haystack->flags = 0; - } -} - -static void huntAndEmit(DBusConnection *connection, DBusMessage *msg, - QObject *needle, QDBusConnectionPrivate::ObjectTreeNode *haystack, - const QString &path = QString()) -{ - foreach (const QDBusConnectionPrivate::ObjectTreeNode::Data &entry, haystack->children) - huntAndEmit(connection, msg, needle, entry.node, path + QLatin1String("/") + entry.name); - - if (needle == haystack->obj && haystack->flags & QDBusConnection::ExportAdaptors) { - QByteArray p = path.toLatin1(); - if (p.isEmpty()) - p = "/"; - //qDebug() << p; - DBusMessage *msg2 = dbus_message_copy(msg); - dbus_message_set_path(msg2, p); - dbus_connection_send(connection, msg2, 0); - dbus_message_unref(msg2); - } -} - -static bool typesMatch(int metaId, int variantType) -{ - if (metaId == int(variantType)) - return true; - - if (variantType == QVariant::Int && metaId == QMetaType::Short) - return true; - - if (variantType == QVariant::UInt && (metaId == QMetaType::UShort || - metaId == QMetaType::UChar)) - return true; - - if (variantType == QVariant::List) { - if (metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId() || - metaId == QDBusTypeHelper::listId()) - return true; - } - - return false; // no match -} - -static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags, - const QDBusTypeList &types, QList& metaTypes) -{ - // find the first slot - const QMetaObject *super = mo; - while (super != &QObject::staticMetaObject && - super != &QDBusAbstractAdaptor::staticMetaObject) - super = super->superClass(); - - int attributeMask = (flags & QDBusConnection::ExportAllSlots) ? - 0 : QMetaMethod::Scriptable; - - for (int idx = super->methodCount() ; idx <= mo->methodCount(); ++idx) { - QMetaMethod mm = mo->method(idx); - - // check access: - if (mm.access() != QMetaMethod::Public) - continue; - - // check type: - // unnecessary, since slots are never public: - //if (mm.methodType() != QMetaMethod::Slot) - // continue; - - // check name: - QByteArray sig = QMetaObject::normalizedSignature(mm.signature()); - int paren = sig.indexOf('('); - if (paren != name.length() || !sig.startsWith( name )) - continue; - - int returnType = qDBusNameToTypeId(mm.typeName()); - bool isAsync = qDBusCheckAsyncTag(mm.tag()); - - // consistency check: - if (isAsync && returnType != QMetaType::Void) - continue; - - int inputCount = qDBusParametersForMethod(mm, metaTypes); - if (inputCount == -1) - continue; // problem parsing - - metaTypes[0] = returnType; - bool hasMessage = false; - if (inputCount > 0 && - metaTypes.at(inputCount) == QDBusConnectionPrivate::messageMetaType) { - // "no input parameters" is allowed as long as the message meta type is there - hasMessage = true; - --inputCount; - } - - // try to match the parameters - if (inputCount != types.count()) - continue; // not enough parameters - - bool matches = true; - int i; - for (i = 0; i < types.count(); ++i) - if ( !typesMatch(metaTypes.at(i + 1), types.at(i).qvariantType()) ) { - matches = false; - break; - } - - if (!matches) - continue; // we didn't match them all - - // consistency check: - if (isAsync && metaTypes.count() > i + 1 + (hasMessage ? 1 : 0)) - continue; - - if (hasMessage && (mm.attributes() & attributeMask) != attributeMask) - continue; // not exported - - // if we got here, this slot matched - return idx; - } - - // no slot matched - return -1; -} - -static CallDeliveryEvent* prepareReply(QObject *object, int idx, const QList &metaTypes, - const QDBusMessage &msg) -{ - Q_ASSERT(object); - - int n = metaTypes.count() - 1; - if (metaTypes[n] == QDBusConnectionPrivate::messageMetaType) - --n; - - // check that types match - for (int i = 0; i < n; ++i) - if (!typesMatch(metaTypes.at(i + 1), msg.at(i).type())) - return 0; // no match - - // we can deliver - // prepare for the call - CallDeliveryEvent *data = new CallDeliveryEvent; - data->object = object; - data->flags = 0; - data->message = msg; - data->metaTypes = metaTypes; - data->slotIdx = idx; - - return data; -} - -bool QDBusConnectionPrivate::activateSignal(const QDBusConnectionPrivate::SignalHook& hook, - const QDBusMessage &msg) -{ - // This is called by QDBusConnectionPrivate::handleSignal to deliver a signal - // that was received from D-Bus - // - // Signals are delivered to slots if the parameters match - // Slots can have less parameters than there are on the message - // Slots can optionally have one final parameter that is a QDBusMessage - // Slots receive read-only copies of the message (i.e., pass by value or by const-ref) - CallDeliveryEvent *call = prepareReply(hook.obj, hook.midx, hook.params, msg); - if (call) { - postCallDeliveryEvent(call); - return true; - } - return false; -} - -bool QDBusConnectionPrivate::activateCall(QObject* object, int flags, - const QDBusMessage &msg) -{ - // This is called by QDBusConnectionPrivate::handleObjectCall to place a call - // to a slot on the object. - // - // The call is delivered to the first slot that matches the following conditions: - // - has the same name as the message's target name - // - ALL of the message's types are found in slot's parameter list - // - optionally has one more parameter of type QDBusMessage - // If none match, then the slot of the same name as the message target and with - // the first type of QDBusMessage is delivered. - // - // Because the marshalling of D-Bus data into QVariant loses the information on - // the original types, the message signature is used to determine the original type. - // Aside from that, the "int" and "unsigned" types will be tried as well. - // - // The D-Bus specification requires that all MethodCall messages be replied to, unless the - // caller specifically waived this requirement. This means that we inspect if the user slot - // generated a reply and, if it didn't, we will. Obviously, if the user slot doesn't take a - // QDBusMessage parameter, it cannot generate a reply. - // - // When a return message is generated, the slot's return type, if any, will be placed - // in the message's first position. If there are non-const reference parameters to the - // slot, they must appear at the end and will be placed in the subsequent message - // positions. - - if (!object) - return false; - - QList metaTypes; - int idx; - - { - const QMetaObject *mo = object->metaObject(); - QDBusTypeList typeList(msg.signature().toUtf8()); - QByteArray memberName = msg.name().toUtf8(); - - // find a slot that matches according to the rules above - idx = ::findSlot(mo, memberName, flags, typeList, metaTypes); - if (idx == -1) { - // try with no parameters, but with a QDBusMessage - idx = ::findSlot(mo, memberName, flags, QDBusTypeList(), metaTypes); - if (metaTypes.count() != 2 || metaTypes.at(1) != messageMetaType) - return false; - } - } - - // found the slot to be called - // prepare for the call: - CallDeliveryEvent *call = new CallDeliveryEvent; - - // parameters: - call->object = object; - call->flags = flags; - call->message = msg; - - // save our state: - call->metaTypes = metaTypes; - call->slotIdx = idx; - - postCallDeliveryEvent(call); - - // ready - return true; -} - -void QDBusConnectionPrivate::postCallDeliveryEvent(CallDeliveryEvent *data) -{ - Q_ASSERT(data); - data->conn = this; -#if USE_OUTSIDE_DISPATCH - callDeliveryMutex.lock(); - callDeliveryState = data; -#else - QCoreApplication::postEvent( this, data ); -#endif -} - -CallDeliveryEvent *QDBusConnectionPrivate::postedCallDeliveryEvent() -{ - CallDeliveryEvent *e = callDeliveryState; - Q_ASSERT(e && e->conn == this); - - // release it: - callDeliveryState = 0; - callDeliveryMutex.unlock(); - - return e; -} - -void QDBusConnectionPrivate::deliverCall(const CallDeliveryEvent& data) const -{ - // resume state: - const QList& metaTypes = data.metaTypes; - const QDBusMessage& msg = data.message; - - QVarLengthArray params; - params.reserve(metaTypes.count()); - - QVariantList auxParameters; - // let's create the parameter list - - // first one is the return type -- add it below - params.append(0); - - // add the input parameters - int i; - for (i = 1; i <= msg.count(); ++i) { - int id = metaTypes[i]; - if (id == QDBusConnectionPrivate::messageMetaType) - break; - - if (id == int(msg.at(i - 1).userType())) - // no conversion needed - params.append(const_cast( msg.at(i - 1).constData() )); - else { - // convert to what the function expects - auxParameters.append(QVariant()); - - const QVariant &in = msg.at(i - 1); - QVariant &out = auxParameters[auxParameters.count() - 1]; - - bool isOk = true; - if (id == QVariant::List) { - int mid = in.userType(); - // the only conversion possible here is from a specialised QList to QVariantList - if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else if (mid == QDBusTypeHelper::listId()) - out = qVariantFromValue(QDBusTypeHelper::toVariantList(in)); - else - isOk = false; - } else if (in.type() == QVariant::UInt) { - if (id == QMetaType::UChar) { - uchar uc = in.toUInt(); - out = qVariantFromValue(uc); - } else if (id == QMetaType::UShort) { - ushort us = in.toUInt(); - out = qVariantFromValue(us); - } else { - isOk = false; - } - } else if (in.type() == QVariant::Int) { - if (id == QMetaType::Short) { - short s = in.toInt(); - out = qVariantFromValue(s); - } else { - isOk = false; - } - } else { - isOk = false; - } - - if (!isOk) - qFatal("Internal error: got invalid meta type %d when trying to convert to meta type %d", - in.userType(), id); - - params.append( const_cast(out.constData()) ); - } - } - - bool takesMessage = false; - if (metaTypes.count() > i && metaTypes[i] == QDBusConnectionPrivate::messageMetaType) { - params.append(const_cast(static_cast(&msg))); - takesMessage = true; - ++i; - } - - // output arguments - QVariantList outputArgs; - void *null = 0; - if (metaTypes[0] != QMetaType::Void) { - QVariant arg(metaTypes[0], null); - outputArgs.append( arg ); - params[0] = const_cast(outputArgs.at( outputArgs.count() - 1 ).constData()); - } - for ( ; i < metaTypes.count(); ++i) { - QVariant arg(metaTypes[i], null); - outputArgs.append( arg ); - params.append( const_cast(outputArgs.at( outputArgs.count() - 1 ).constData()) ); - } - - // make call: - bool fail; - if (data.object.isNull()) - fail = true; - else - fail = data.object->qt_metacall(QMetaObject::InvokeMetaMethod, - data.slotIdx, params.data()) >= 0; - - // do we create a reply? Only if the caller is waiting for a reply and one hasn't been sent - // yet. - if (!msg.noReply() && !msg.wasRepliedTo()) { - if (!fail) { - // normal reply - QDBusMessage reply = QDBusMessage::methodReply(msg); - reply += outputArgs; - - qDebug() << "Automatically sending reply:" << reply; - send(reply); - } - else { - // generate internal error - QDBusMessage reply = QDBusMessage::error(msg, QDBusError(QDBusError::InternalError, - QLatin1String("Failed to deliver message"))); - qWarning("Internal error: Failed to deliver message"); - send(reply); - } - } - - return; -} - -void QDBusConnectionPrivate::customEvent(QEvent *e) -{ - // nothing else should be sending custom events at us - CallDeliveryEvent* call = static_cast(e); - - // self check: - Q_ASSERT(call->conn == this); - - deliverCall(*call); -} - -QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) - : QObject(p), ref(1), mode(InvalidMode), connection(0), server(0), busService(0) -{ - extern bool qDBusInitThreads(); - static const int msgType = registerMessageMetaType(); - static const bool threads = qDBusInitThreads(); - static const bool metatypes = QDBusMetaTypeId::innerInitialize(); - - Q_UNUSED(msgType); - Q_UNUSED(threads); - Q_UNUSED(metatypes); - - dbus_error_init(&error); - - rootNode.flags = 0; -} - -QDBusConnectionPrivate::~QDBusConnectionPrivate() -{ - if (dbus_error_is_set(&error)) - dbus_error_free(&error); - - closeConnection(); - rootNode.clear(); // free resources - qDeleteAll(cachedMetaObjects); -} - -void QDBusConnectionPrivate::closeConnection() -{ - QWriteLocker locker(&lock); - ConnectionMode oldMode = mode; - mode = InvalidMode; // prevent reentrancy - if (oldMode == ServerMode) { - if (server) { - dbus_server_disconnect(server); - dbus_server_unref(server); - server = 0; - } - } else if (oldMode == ClientMode) { - if (connection) { - dbus_connection_close(connection); - // send the "close" message - while (dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) - ; - dbus_connection_unref(connection); - connection = 0; - } - } -} - -bool QDBusConnectionPrivate::handleError() -{ - lastError = QDBusError(&error); - if (dbus_error_is_set(&error)) - dbus_error_free(&error); - return lastError.isValid(); -} - -void QDBusConnectionPrivate::bindToApplication() -{ - // Yay, now that we have an application we are in business - Q_ASSERT_X(QCoreApplication::instance(), "QDBusConnection", - "qDBusBindToApplication called without an application"); - moveToThread(QCoreApplication::instance()->thread()); - - // Re-add all watchers - WatcherHash oldWatchers = watchers; - watchers.clear(); - QHashIterator it(oldWatchers); - while (it.hasNext()) { - it.next(); - if (!it.value().read && !it.value().write) { - qDBusAddWatch(it.value().watch, this); - } else { - watchers.insertMulti(it.key(), it.value()); - } - } - - // Re-add all timeouts - while (!pendingTimeouts.isEmpty()) - qDBusAddTimeout(pendingTimeouts.takeFirst(), this); -} - -void QDBusConnectionPrivate::timerEvent(QTimerEvent *e) -{ - DBusTimeout *timeout = timeouts.value(e->timerId(), 0); - dbus_timeout_handle(timeout); -} - -void QDBusConnectionPrivate::doDispatch() -{ - if (mode == ClientMode) - while (dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS); -} - -void QDBusConnectionPrivate::socketRead(int fd) -{ - QHashIterator it(watchers); - while (it.hasNext()) { - it.next(); - if (it.key() == fd && it.value().read && it.value().read->isEnabled()) { - if (!dbus_watch_handle(it.value().watch, DBUS_WATCH_READABLE)) - qDebug("OUT OF MEM"); - } - } - - doDispatch(); -} - -void QDBusConnectionPrivate::socketWrite(int fd) -{ - QHashIterator it(watchers); - while (it.hasNext()) { - it.next(); - if (it.key() == fd && it.value().write && it.value().write->isEnabled()) { - if (!dbus_watch_handle(it.value().watch, DBUS_WATCH_WRITABLE)) - qDebug("OUT OF MEM"); - } - } -} - -void QDBusConnectionPrivate::objectDestroyed(QObject *obj) -{ - QWriteLocker locker(&lock); - huntAndDestroy(obj, &rootNode); - - SignalHookHash::iterator sit = signalHooks.begin(); - while (sit != signalHooks.end()) { - if (static_cast(sit.value().obj) == obj) - sit = signalHooks.erase(sit); - else - ++sit; - } - - obj->disconnect(this); -} - -void QDBusConnectionPrivate::relaySignal(QObject *obj, const char *interface, const char *memberName, - const QVariantList &args) -{ - QReadLocker locker(&lock); - QDBusMessage message = QDBusMessage::signal(QLatin1String("/"), QLatin1String(interface), - QLatin1String(memberName)); - message += args; - DBusMessage *msg = message.toDBusMessage(); - if (!msg) { - qWarning("Could not emit signal %s.%s", interface, memberName); - return; - } - - //qDebug() << "Emitting signal" << message; - //qDebug() << "for paths:"; - dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything - huntAndEmit(connection, msg, obj, &rootNode); - dbus_message_unref(msg); -} - -int QDBusConnectionPrivate::registerMessageMetaType() -{ - int tp = messageMetaType = qRegisterMetaType("QDBusMessage"); - return tp; -} - -int QDBusConnectionPrivate::findSlot(QObject* obj, const QByteArray &normalizedName, - QList ¶ms) -{ - int midx = obj->metaObject()->indexOfMethod(normalizedName); - if (midx == -1) { - qWarning("No such slot '%s' while connecting D-Bus", normalizedName.constData()); - return -1; - } - - int inputCount = qDBusParametersForMethod(obj->metaObject()->method(midx), params); - if ( inputCount == -1 || inputCount + 1 != params.count() ) - return -1; // failed to parse or invalid arguments or output arguments - - return midx; -} - -bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key, - const QString &service, const QString &path, - const QString &interface, const QString &name, - QObject *receiver, const char *signal, int minMIdx, - bool buildSignature) -{ - QByteArray normalizedName = QMetaObject::normalizedSignature(signal + 1); - hook.midx = findSlot(receiver, normalizedName, hook.params); - if (hook.midx < minMIdx) - return false; - - hook.sender = service; - hook.path = path; - hook.obj = receiver; - - // build the D-Bus signal name and signature - QString mname = name; - if (mname.isEmpty()) { - normalizedName.truncate(normalizedName.indexOf('(')); - mname = QString::fromUtf8(normalizedName); - } - key = mname; - key.reserve(interface.length() + 1 + mname.length()); - key += QLatin1Char(':'); - key += interface; - - if (buildSignature) { - hook.signature.clear(); - for (int i = 1; i < hook.params.count(); ++i) - if (hook.params.at(i) != messageMetaType) - hook.signature += QLatin1String( QDBusType::dbusSignature( QVariant::Type(hook.params.at(i)) ) ); - } - - return true; // connect to this signal -} - -bool QDBusConnectionPrivate::activateInternalFilters(const ObjectTreeNode *node, const QDBusMessage &msg) -{ - // object may be null - - if (msg.interface().isEmpty() || msg.interface() == QLatin1String(DBUS_INTERFACE_INTROSPECTABLE)) { - if (msg.method() == QLatin1String("Introspect") && msg.signature().isEmpty()) - qDBusIntrospectObject(node, msg); - if (msg.interface() == QLatin1String(DBUS_INTERFACE_INTROSPECTABLE)) - return true; - } - - if (node->obj && (msg.interface().isEmpty() || - msg.interface() == QLatin1String(DBUS_INTERFACE_PROPERTIES))) { - if (msg.method() == QLatin1String("Get") && msg.signature() == QLatin1String("ss")) - qDBusPropertyGet(node, msg); - else if (msg.method() == QLatin1String("Set") && msg.signature() == QLatin1String("ssv")) - qDBusPropertySet(node, msg); - - if (msg.interface() == QLatin1String(DBUS_INTERFACE_PROPERTIES)) - return true; - } - - return false; -} - -bool QDBusConnectionPrivate::activateObject(const ObjectTreeNode *node, const QDBusMessage &msg) -{ - // This is called by QDBusConnectionPrivate::handleObjectCall to place a call to a slot - // on the object. - // - // The call is routed through the adaptor sub-objects if we have any - - // object may be null - - QDBusAdaptorConnector *connector; - if (node->flags & QDBusConnection::ExportAdaptors && - (connector = qDBusFindAdaptorConnector(node->obj))) { - int newflags = node->flags | QDBusConnection::ExportAllSlots; - - if (msg.interface().isEmpty()) { - // place the call in all interfaces - // let the first one that handles it to work - foreach (const QDBusAdaptorConnector::AdaptorData &entry, connector->adaptors) - if (activateCall(entry.adaptor, newflags, msg)) - return true; - } else { - // check if we have an interface matching the name that was asked: - QDBusAdaptorConnector::AdaptorMap::ConstIterator it; - it = qLowerBound(connector->adaptors.constBegin(), connector->adaptors.constEnd(), - msg.interface()); - if (it != connector->adaptors.constEnd() && it->interface == msg.interface()) - if (activateCall(it->adaptor, newflags, msg)) - return true; - } - } - - // no adaptors matched - // try our standard filters - if (activateInternalFilters(node, msg)) - return true; - - // try the object itself: - if (node->flags & QDBusConnection::ExportSlots && activateCall(node->obj, node->flags, msg)) - return true; -#if 0 - // nothing matched - qDebug("Call failed: no match for %s%s%s at %s", - qPrintable(msg.interface()), msg.interface().isEmpty() ? "" : ".", - qPrintable(msg.name()), - qPrintable(msg.path())); -#endif - return false; -} - -template -static bool applyForObject(QDBusConnectionPrivate::ObjectTreeNode *root, const QString &fullpath, - Func& functor) -{ - // walk the object tree - QStringList path = fullpath.split(QLatin1Char('/')); - if (path.last().isEmpty()) - path.removeLast(); // happens if path is "/" - int i = 1; - QDBusConnectionPrivate::ObjectTreeNode *node = root; - - // try our own tree first - while (node && !(node->flags & QDBusConnection::ExportChildObjects) ) { - if (i == path.count()) { - // found our object - functor(node); - return true; - } - - QVector::ConstIterator it = - qLowerBound(node->children.constBegin(), node->children.constEnd(), path.at(i)); - if (it != node->children.constEnd() && it->name == path.at(i)) - // match - node = it->node; - else - node = 0; - - ++i; - } - - // any object in the tree can tell us to switch to its own object tree: - if (node && node->flags & QDBusConnection::ExportChildObjects) { - QObject *obj = node->obj; - - while (obj) { - if (i == path.count()) { - // we're at the correct level - QDBusConnectionPrivate::ObjectTreeNode fakenode(*node); - fakenode.obj = obj; - functor(&fakenode); - return true; - } - - const QObjectList children = obj->children(); - - // find a child with the proper name - QObject *next = 0; - foreach (QObject *child, children) - if (child->objectName() == path.at(i)) { - next = child; - break; - } - - if (!next) - break; - - ++i; - obj = next; - } - } - - // object not found - return false; -} - -struct qdbus_activateObject -{ - QDBusConnectionPrivate *self; - const QDBusMessage &msg; - bool returnVal; - inline qdbus_activateObject(QDBusConnectionPrivate *s, const QDBusMessage &m) - : self(s), msg(m) - { } - - inline void operator()(QDBusConnectionPrivate::ObjectTreeNode *node) - { returnVal = self->activateObject(node, msg); } -}; - -bool QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg) -{ - QReadLocker locker(&lock); - - qdbus_activateObject apply(this, msg); - if (applyForObject(&rootNode, msg.path(), apply)) - return apply.returnVal; - - qDebug("Call failed: no object found at %s", qPrintable(msg.path())); - return false; -} - -bool QDBusConnectionPrivate::handleSignal(const QString &key, const QDBusMessage& msg) -{ - bool result = false; - SignalHookHash::const_iterator it = signalHooks.find(key); - //qDebug("looking for: %s", path.toLocal8Bit().constData()); - //qDebug() << signalHooks.keys(); - for ( ; it != signalHooks.constEnd() && it.key() == key; ++it) { - const SignalHook &hook = it.value(); - if ( !hook.sender.isEmpty() && hook.sender != msg.sender() ) - continue; - if ( !hook.path.isEmpty() && hook.path != msg.path() ) - continue; - if ( !hook.signature.isEmpty() && hook.signature != msg.signature() ) - continue; - if ( hook.signature.isEmpty() && !hook.signature.isNull() && !msg.signature().isEmpty()) - continue; - - // yes, |= - result |= activateSignal(hook, msg); - } - return result; -} - -bool QDBusConnectionPrivate::handleSignal(const QDBusMessage& msg) -{ - QString key = msg.member(); - key.reserve(key.length() + 1 + msg.interface().length()); - key += QLatin1Char(':'); - key += msg.interface(); - - QReadLocker locker(&lock); - bool result = handleSignal(key, msg); // one try - - key.truncate(msg.member().length() + 1); // keep the ':' - result |= handleSignal(key, msg); // second try - return result; -} - -static dbus_int32_t server_slot = -1; - -void QDBusConnectionPrivate::setServer(DBusServer *s) -{ - if (!server) { - handleError(); - return; - } - - server = s; - mode = ServerMode; - - dbus_server_allocate_data_slot(&server_slot); - if (server_slot < 0) - return; - - dbus_server_set_watch_functions(server, qDBusAddWatch, qDBusRemoveWatch, - qDBusToggleWatch, this, 0); // ### check return type? - dbus_server_set_timeout_functions(server, qDBusAddTimeout, qDBusRemoveTimeout, - qDBusToggleTimeout, this, 0); - dbus_server_set_new_connection_function(server, qDBusNewConnection, this, 0); - - dbus_server_set_data(server, server_slot, this, 0); -} - -void QDBusConnectionPrivate::setConnection(DBusConnection *dbc) -{ - if (!dbc) { - handleError(); - return; - } - - connection = dbc; - mode = ClientMode; - - dbus_connection_set_exit_on_disconnect(connection, false); - dbus_connection_set_watch_functions(connection, qDBusAddWatch, qDBusRemoveWatch, - qDBusToggleWatch, this, 0); - dbus_connection_set_timeout_functions(connection, qDBusAddTimeout, qDBusRemoveTimeout, - qDBusToggleTimeout, this, 0); -// dbus_bus_add_match(connection, "type='signal',interface='com.trolltech.dbus.Signal'", &error); -// dbus_bus_add_match(connection, "type='signal'", &error); - - dbus_bus_add_match(connection, "type='signal'", &error); - if (handleError()) { - closeConnection(); - return; - } - - const char *service = dbus_bus_get_unique_name(connection); - if (service) { - QVarLengthArray filter; - filter.append("destination='", 13); - filter.append(service, qstrlen(service)); - filter.append("\'\0", 2); - - dbus_bus_add_match(connection, filter.constData(), &error); - if (handleError()) { - closeConnection(); - return; - } - } else { - qWarning("QDBusConnectionPrivate::SetConnection: Unable to get base service"); - } - -#if USE_OUTSIDE_DISPATCH - dbus_connection_add_filter_outside(connection, qDBusSignalFilter, qDBusSignalFilterOutside, this, 0); -#else - dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0); -#endif - - //qDebug("base service: %s", service); - - // schedule a dispatch: - QMetaObject::invokeMethod(this, "doDispatch", Qt::QueuedConnection); -} - -extern "C"{ -static void qDBusResultReceived(DBusPendingCall *pending, void *user_data) -{ - QDBusConnectionPrivate::messageResultReceived(pending, user_data); -} -} - -void QDBusConnectionPrivate::messageResultReceived(DBusPendingCall *pending, void *user_data) -{ - QDBusPendingCall *call = reinterpret_cast(user_data); - QDBusConnectionPrivate *connection = const_cast(call->connection); - Q_ASSERT(call->pending == pending); - - if (!call->receiver.isNull() && call->methodIdx != -1) { - DBusMessage *reply = dbus_pending_call_steal_reply(pending); - - // Deliver the return values of a remote function call. - // - // There is only one connection and it is specified by idx - // The slot must have the same parameter types that the message does - // The slot may have less parameters than the message - // The slot may optionally have one final parameter that is QDBusMessage - // The slot receives read-only copies of the message (i.e., pass by value or by const-ref) - - QDBusMessage msg = QDBusMessage::fromDBusMessage(reply, QDBusConnection(connection->name)); - qDebug() << "got message: " << msg; - CallDeliveryEvent *e = prepareReply(call->receiver, call->methodIdx, call->metaTypes, msg); - if (e) - connection->postCallDeliveryEvent(e); - else - qDebug() << "Deliver failed!"; - } - dbus_pending_call_unref(pending); - delete call; -} - -int QDBusConnectionPrivate::send(const QDBusMessage& message) const -{ - DBusMessage *msg = message.toDBusMessage(); - if (!msg) - return 0; - - dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything - - qDebug() << "sending message:" << message; - bool isOk = dbus_connection_send(connection, msg, 0); - int serial = 0; - if (isOk) - serial = dbus_message_get_serial(msg); - - dbus_message_unref(msg); - return serial; -} - -QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message, - int sendMode) -{ - if (!QCoreApplication::instance() || sendMode == QDBusConnection::NoUseEventLoop) { - DBusMessage *msg = message.toDBusMessage(); - if (!msg) - return QDBusMessage(); - - qDebug() << "sending message:" << message; - DBusMessage *reply = dbus_connection_send_with_reply_and_block(connection, msg, - -1, &error); - handleError(); - dbus_message_unref(msg); - - if (lastError.isValid()) - return QDBusMessage::fromError(lastError); - - QDBusMessage amsg = QDBusMessage::fromDBusMessage(reply, QDBusConnection(name)); - qDebug() << "got message:" << amsg; - - if (dbus_connection_get_dispatch_status(connection) == DBUS_DISPATCH_DATA_REMAINS) - QMetaObject::invokeMethod(this, "doDispatch", Qt::QueuedConnection); - return amsg; - } else { // use the event loop - QDBusReplyWaiter waiter; - if (sendWithReplyAsync(message, &waiter, SLOT(reply(const QDBusMessage&))) > 0) { - // enter the event loop and wait for a reply - waiter.exec(QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents); - - lastError = waiter.replyMsg; // set or clear error - return waiter.replyMsg; - } - - return QDBusMessage(); - } -} - -int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, - const char *method) -{ - if (!receiver || !method || !*method) - // would not be able to deliver a reply - return send(message); - - int slotIdx = -1; - QList metaTypes; - QByteArray normalizedName = QMetaObject::normalizedSignature(method + 1); - slotIdx = findSlot(receiver, normalizedName, metaTypes); - if (slotIdx == -1) - // would not be able to deliver a reply - return send(message); - - DBusMessage *msg = message.toDBusMessage(); - if (!msg) - return 0; - - qDebug() << "sending message:" << message; - DBusPendingCall *pending = 0; - if (dbus_connection_send_with_reply(connection, msg, &pending, message.timeout())) { - if (slotIdx != -1) { - QDBusPendingCall *pcall = new QDBusPendingCall; - pcall->receiver = receiver; - pcall->metaTypes = metaTypes; - pcall->methodIdx = slotIdx; - pcall->connection = this; - pcall->pending = dbus_pending_call_ref(pending); - dbus_pending_call_set_notify(pending, qDBusResultReceived, pcall, 0); - } - dbus_pending_call_unref(pending); - return dbus_message_get_serial(msg); - } - - return 0; -} - -void QDBusConnectionPrivate::connectSignal(const QString &key, const SignalHook &hook) -{ - signalHooks.insertMulti(key, hook); - connect(hook.obj, SIGNAL(destroyed(QObject*)), SLOT(objectDestroyed(QObject*))); -} - -void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node) -{ - connect(node->obj, SIGNAL(destroyed(QObject*)), SLOT(objectDestroyed(QObject*))); - - if (node->flags & QDBusConnection::ExportAdaptors) { - QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(node->obj); - - // disconnect and reconnect to avoid duplicates - connector->disconnect(SIGNAL(relaySignal(QObject*,const char*,const char*,QVariantList)), - this, SLOT(relaySignal(QObject*,const char*,const char*,QVariantList))); - connect(connector, SIGNAL(relaySignal(QObject*,const char*,const char*,QVariantList)), - SLOT(relaySignal(QObject*,const char*,const char*,QVariantList))); - } -} - -void QDBusConnectionPrivate::connectRelay(const QString &service, const QString &path, - const QString &interface, - QDBusAbstractInterface *receiver, - const char *signal) -{ - // this function is called by QDBusAbstractInterface when one of its signals is connected - // we set up a relay from D-Bus into it - SignalHook hook; - QString key; - if (!prepareHook(hook, key, service, path, interface, QString(), receiver, signal, - QDBusAbstractInterface::staticMetaObject.methodCount(), true)) - return; // don't connect - - // add it to our list: - QWriteLocker locker(&lock); - SignalHookHash::ConstIterator it = signalHooks.find(key); - SignalHookHash::ConstIterator end = signalHooks.constEnd(); - for ( ; it != end && it.key() == key; ++it) { - const SignalHook &entry = it.value(); - if (entry.sender == hook.sender && - entry.path == hook.path && - entry.signature == hook.signature && - entry.obj == hook.obj && - entry.midx == hook.midx) - return; // already there, no need to re-add - } - - connectSignal(key, hook); -} - -void QDBusConnectionPrivate::disconnectRelay(const QString &service, const QString &path, - const QString &interface, - QDBusAbstractInterface *receiver, - const char *signal) -{ - // this function is called by QDBusAbstractInterface when one of its signals is disconnected - // we remove relay from D-Bus into it - SignalHook hook; - QString key; - if (!prepareHook(hook, key, service, path, interface, QString(), receiver, signal, - QDBusAbstractInterface::staticMetaObject.methodCount(), true)) - return; // don't connect - - // remove it from our list: - QWriteLocker locker(&lock); - SignalHookHash::Iterator it = signalHooks.find(key); - SignalHookHash::Iterator end = signalHooks.end(); - for ( ; it != end && it.key() == key; ++it) { - const SignalHook &entry = it.value(); - if (entry.sender == hook.sender && - entry.path == hook.path && - entry.signature == hook.signature && - entry.obj == hook.obj && - entry.midx == hook.midx) { - // found it - signalHooks.erase(it); - return; - } - } - - qWarning("QDBusConnectionPrivate::disconnectRelay called for a signal that was not found"); -} - -QString QDBusConnectionPrivate::getNameOwner(const QString& serviceName) -{ - if (QDBusUtil::isValidUniqueConnectionName(serviceName)) - return serviceName; - if (!connection || !QDBusUtil::isValidBusName(serviceName)) - return QString(); - - QDBusMessage msg = QDBusMessage::methodCall(QLatin1String(DBUS_SERVICE_DBUS), - QLatin1String(DBUS_PATH_DBUS), QLatin1String(DBUS_INTERFACE_DBUS), - QLatin1String("GetNameOwner")); - msg << serviceName; - QDBusMessage reply = sendWithReply(msg, QDBusConnection::NoUseEventLoop); - if (!lastError.isValid() && reply.type() == QDBusMessage::ReplyMessage) - return reply.first().toString(); - return QString(); -} - -QDBusInterfacePrivate * -QDBusConnectionPrivate::findInterface(const QString &service, - const QString &path, - const QString &interface) -{ - // check if it's there first -- FIXME: add binding mode - QDBusMetaObject *mo = 0; - QString owner = getNameOwner(service); - if (connection && !owner.isEmpty() && QDBusUtil::isValidObjectPath(path) && - (interface.isEmpty() || QDBusUtil::isValidInterfaceName(interface))) - // always call here with the unique connection name - mo = findMetaObject(owner, path, interface); - - QDBusInterfacePrivate *p = new QDBusInterfacePrivate(QDBusConnection(name), this, owner, path, interface, mo); - - if (!mo) { - // invalid object - p->isValid = false; - p->lastError = lastError; - if (!lastError.isValid()) { - // try to determine why we couldn't get the data - if (!connection) - p->lastError = QDBusError(QDBusError::Disconnected, - QLatin1String("Not connected to D-Bus server")); - else if (owner.isEmpty()) - p->lastError = QDBusError(QDBusError::ServiceUnknown, - QString(QLatin1String("Service %1 is unknown")).arg(service)); -#if 0 // caught by Q_ASSERT in QDBusConnection::findInterface - else if (!QDBusUtil::isValidObjectPath(path)) - p->lastError = QDBusError(QDBusError::InvalidArgs, - QString(QLatin1String("Object path %1 is invalid")).arg(path)); - else if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) - p->lastError = QDBusError(QDBusError::InvalidArgs, - QString(QLatin1String("Interface %1 is invalid")).arg(interface)); -#endif - else - p->lastError = QDBusError(QDBusError::Other, QLatin1String("Unknown error")); - } - } - - return p; -} - -struct qdbus_Introspect -{ - QString xml; - inline void operator()(QDBusConnectionPrivate::ObjectTreeNode *node) - { xml = qDBusIntrospectObject(node); } -}; - -QDBusMetaObject * -QDBusConnectionPrivate::findMetaObject(const QString &service, const QString &path, - const QString &interface) -{ - // service must be a unique connection name - if (!interface.isEmpty()) { - QReadLocker locker(&lock); - QDBusMetaObject *mo = cachedMetaObjects.value(interface, 0); - if (mo) - return mo; - } - if (service == QString::fromUtf8(dbus_bus_get_unique_name(connection))) { - // it's one of our own - QWriteLocker locker(&lock); - QDBusMetaObject *mo = 0; - if (!interface.isEmpty()) - mo = cachedMetaObjects.value(interface, 0); - if (mo) - // maybe it got created when we switched from read to write lock - return mo; - - qdbus_Introspect apply; - if (!applyForObject(&rootNode, path, apply)) { - lastError = QDBusError(QDBusError::InvalidArgs, - QString(QLatin1String("No object at %1")).arg(path)); - return 0; // no object at path - } - - // release the lock and return - return QDBusMetaObject::createMetaObject(interface, apply.xml, cachedMetaObjects, lastError); - } - - // not local: introspect the target object: - QDBusMessage msg = QDBusMessage::methodCall(service, path, - QLatin1String(DBUS_INTERFACE_INTROSPECTABLE), - QLatin1String("Introspect")); - - - QDBusMessage reply = sendWithReply(msg, QDBusConnection::NoUseEventLoop); - - // it doesn't exist yet, we have to create it - QWriteLocker locker(&lock); - QDBusMetaObject *mo = 0; - if (!interface.isEmpty()) - mo = cachedMetaObjects.value(interface, 0); - if (mo) - // maybe it got created when we switched from read to write lock - return mo; - - QString xml; - if (reply.type() == QDBusMessage::ReplyMessage) - // fetch the XML description - xml = reply.first().toString(); - else { - lastError = reply; - if (reply.type() != QDBusMessage::ErrorMessage || lastError != QDBusError::UnknownMethod) - return 0; // error - } - - // release the lock and return - return QDBusMetaObject::createMetaObject(interface, xml, cachedMetaObjects, lastError); -} - -void QDBusReplyWaiter::reply(const QDBusMessage &msg) -{ - replyMsg = msg; - QTimer::singleShot(0, this, SLOT(quit())); -} - -#include "qdbusconnection_p.moc" diff --git a/qt/src/qdbusinterface.cpp b/qt/src/qdbusinterface.cpp deleted file mode 100644 index 72097077..00000000 --- a/qt/src/qdbusinterface.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusinterface.h" - -#include -#include - -#include "qdbusinterface_p.h" -#include "qdbusconnection_p.h" - -/*! - \class QDBusInterface - \brief Proxy class for interfaces on remote objects. - - QDBusInterface is a generic accessor class that is used to place calls to remote objects, - connect to signals exported by remote objects and get/set the value of remote properties. This - class is useful for dynamic access to remote objects: that is, when you do not have a generated - code that represents the remote interface. - - Calls are usually placed by using the call() function, which constructs the message, sends it - over the bus, waits for the reply and decodes the reply. Signals are connected to by using the - normal QObject::connect() function. Finally, properties are accessed using the - QObject::property() and QObject::setProperty() functions. -*/ - -QDBusInterface::QDBusInterface(QDBusInterfacePrivate *p) - : QDBusAbstractInterface(p) -{ -} - -/*! - Destroy the object interface and frees up any resource used. -*/ -QDBusInterface::~QDBusInterface() -{ - // resources are freed in QDBusInterfacePrivate::~QDBusInterfacePrivate() -} - -/*! - \internal - Overrides QObject::metaObject to return our own copy. -*/ -const QMetaObject *QDBusInterface::metaObject() const -{ - return d_func()->isValid ? d_func()->metaObject : &QDBusAbstractInterface::staticMetaObject; -} - -/*! - \internal - Override QObject::qt_metacast to catch the interface name too. -*/ -void *QDBusInterface::qt_metacast(const char *_clname) -{ - if (!_clname) return 0; - if (!strcmp(_clname, "QDBusInterface")) - return static_cast(const_cast(this)); - if (d_func()->interface.toLatin1() == _clname) - return static_cast(const_cast(this)); - return QDBusAbstractInterface::qt_metacast(_clname); -} - -/*! - \internal - Dispatch the call through the private. -*/ -int QDBusInterface::qt_metacall(QMetaObject::Call _c, int _id, void **_a) -{ - _id = QDBusAbstractInterface::qt_metacall(_c, _id, _a); - if (_id < 0 || !d_func()->isValid) - return _id; - return d_func()->metacall(_c, _id, _a); -} - -int QDBusInterfacePrivate::metacall(QMetaObject::Call c, int id, void **argv) -{ - Q_Q(QDBusInterface); - - if (c == QMetaObject::InvokeMetaMethod) { - int offset = metaObject->methodOffset(); - QMetaMethod mm = metaObject->method(id + offset); - - if (mm.methodType() == QMetaMethod::Signal) { - // signal relay from D-Bus world to Qt world - QMetaObject::activate(q, metaObject, id, argv); - - } else if (mm.methodType() == QMetaMethod::Slot) { - // method call relay from Qt world to D-Bus world - // get D-Bus equivalent signature - QString methodName = QLatin1String(metaObject->dbusNameForMethod(id)); - const int *inputTypes = metaObject->inputTypesForMethod(id); - const int *outputTypes = metaObject->outputTypesForMethod(id); - - int inputTypesCount = *inputTypes; - int outputTypesCount = *outputTypes++; - - // we will assume that the input arguments were passed correctly - QVariantList args; - for (int i = 1; i <= inputTypesCount; ++i) - args << QVariant(inputTypes[i], argv[i]); - - // make the call - QPointer qq = q; - QDBusMessage reply = q->callWithArgs(methodName, args); - args.clear(); - - // access to "this" or to "q" below this point must check for "qq" - // we may have been deleted! - - // check if we got the right number of parameters back: - bool success = false; - if (reply.count() == outputTypesCount) { - // copy the values out - for (int i = 0; i < outputTypesCount; ++i) { - // treat the return value specially, since it may be null: - if (i == 0 && argv[0] == 0) - continue; - - // ensure that the types are correct: - const QVariant &item = reply.at(i); - if (outputTypes[i] != item.userType()) { - success = false; - break; - } - - if (i == 0) - QDBusMetaObject::assign(argv[0], item); - else - QDBusMetaObject::assign(argv[inputTypesCount + i], item); - } - } - - // bail out, something weird happened - if (!success && !qq.isNull()) { - QString errmsg = QLatin1String("Invalid signature `%1' in return from call to %2.%3"); - lastError = QDBusError(QDBusError::InvalidSignature, - errmsg.arg(reply.signature(), interface, methodName)); - } - - // done - return -1; - } - } else if (c == QMetaObject::ReadProperty) { - // Qt doesn't support non-readable properties - // we have to re-check - QMetaProperty mp = metaObject->property(id + metaObject->propertyOffset()); - if (!mp.isReadable()) - return -1; // don't read - - QVariant value = property(mp); - if (value.type() == QVariant::Invalid) - // an error occurred -- property already set lastError - return -1; - else if (mp.type() == QVariant::LastType) - // QVariant is special in this context - *reinterpret_cast(argv[0]) = value; - else - QDBusMetaObject::assign(argv[0], value); - - return -1; // handled - } else if (c == QMetaObject::WriteProperty) { - // QMetaProperty::write has already checked that we're writable - // it has also checked that the type is right - QVariant value(metaObject->propertyMetaType(id), argv[0]); - QMetaProperty mp = metaObject->property(id + metaObject->propertyOffset()); - - setProperty(mp, value); - return -1; - } - return id; -} - -QDBusInterfacePtr::QDBusInterfacePtr(QDBusConnection &conn, const QString &service, const QString &path, - const QString &iface) - : d(conn.findInterface(service, path, iface)) -{ -} - -QDBusInterfacePtr::QDBusInterfacePtr(const QString &service, const QString &path, const QString &iface) - : d(QDBus::sessionBus().findInterface(service, path, iface)) -{ -} - diff --git a/qt/src/qdbusinterface.h b/qt/src/qdbusinterface.h deleted file mode 100644 index 0b4d1874..00000000 --- a/qt/src/qdbusinterface.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSINTERFACE_H -#define QDBUSINTERFACE_H - -#include "qdbusabstractinterface.h" - -class QDBusInterfacePrivate; -class QDBUS_EXPORT QDBusInterface: public QDBusAbstractInterface -{ - friend class QDBusConnection; -private: - QDBusInterface(QDBusInterfacePrivate *p); - -public: - ~QDBusInterface(); - - virtual const QMetaObject *metaObject() const; - virtual void *qt_metacast(const char *); - virtual int qt_metacall(QMetaObject::Call, int, void **); - -private: - Q_DECLARE_PRIVATE(QDBusInterface) - Q_DISABLE_COPY(QDBusInterface) -}; - -struct QDBUS_EXPORT QDBusInterfacePtr -{ - QDBusInterfacePtr(QDBusInterface *iface) : d(iface) { } - QDBusInterfacePtr(QDBusConnection &conn, const QString &service, const QString &path, - const QString &interface = QString()); - QDBusInterfacePtr(const QString &service, const QString &path, const QString &interface = QString()); - ~QDBusInterfacePtr() { delete d; } - - QDBusInterface *interface() { return d; } - QDBusInterface *operator->() { return d; } -private: - QDBusInterface *const d; - Q_DISABLE_COPY(QDBusInterfacePtr) -}; - -#endif diff --git a/qt/src/qdbusinterface_p.h b/qt/src/qdbusinterface_p.h deleted file mode 100644 index 25cb9ffa..00000000 --- a/qt/src/qdbusinterface_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSINTERFACEPRIVATE_H -#define QDBUSINTERFACEPRIVATE_H - -#include "qdbusabstractinterface_p.h" -#include "qdbusmetaobject_p.h" -#include "qdbusinterface.h" - -class QDBusInterfacePrivate: public QDBusAbstractInterfacePrivate -{ -public: - Q_DECLARE_PUBLIC(QDBusInterface) - - QDBusMetaObject *metaObject; - - inline QDBusInterfacePrivate(const QDBusConnection &con, QDBusConnectionPrivate *conp, - const QString &serv, const QString &p, const QString &iface, - QDBusMetaObject *mo = 0) - : QDBusAbstractInterfacePrivate(con, conp, serv, p, iface), metaObject(mo) - { - } - ~QDBusInterfacePrivate() - { - if (metaObject && !metaObject->cached) - delete metaObject; - } - - int metacall(QMetaObject::Call c, int id, void **argv); -}; - -#endif diff --git a/qt/src/qdbusinternalfilters.cpp b/qt/src/qdbusinternalfilters.cpp deleted file mode 100644 index ed210744..00000000 --- a/qt/src/qdbusinternalfilters.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/* -*- mode: C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusconnection_p.h" - -#include -#include -#include -#include - -#include "qdbusabstractadaptor.h" -#include "qdbusabstractadaptor_p.h" -#include "qdbusconnection.h" -#include "qdbusmessage.h" -#include "qdbustypehelper_p.h" -#include "qdbusutil.h" - -// defined in qdbusxmlgenerator.cpp -extern QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, - const QMetaObject *base, int flags); - -static const char introspectableInterfaceXml[] = - " \n" - " \n" - " \n" - " \n" - " \n"; - -static const char propertiesInterfaceXml[] = - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n" - " \n"; - -static QString generateSubObjectXml(QObject *object) -{ - QString retval; - foreach (QObject *child, object->children()) { - QString name = child->objectName(); - if (!name.isEmpty()) - retval += QString(QLatin1String(" \n")) - .arg(name); - } - return retval; -} - -QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode *node) -{ - // object may be null - - QString xml_data(QLatin1String(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE)); - xml_data += QLatin1String("\n"); - - if (node->obj) { - if (node->flags & QDBusConnection::ExportContents) { - const QMetaObject *mo = node->obj->metaObject(); - for ( ; mo != &QObject::staticMetaObject; mo = mo->superClass()) - xml_data += qDBusGenerateMetaObjectXml(QString(), mo, mo->superClass(), - node->flags); - } - - // does this object have adaptors? - QDBusAdaptorConnector *connector; - if (node->flags & QDBusConnection::ExportAdaptors && - (connector = qDBusFindAdaptorConnector(node->obj))) { - - // trasverse every adaptor in this object - QDBusAdaptorConnector::AdaptorMap::ConstIterator it = connector->adaptors.constBegin(); - QDBusAdaptorConnector::AdaptorMap::ConstIterator end = connector->adaptors.constEnd(); - for ( ; it != end; ++it) { - // add the interface: - QString ifaceXml = QDBusAbstractAdaptorPrivate::retrieveIntrospectionXml(it->adaptor); - if (ifaceXml.isEmpty()) { - // add the interface's contents: - ifaceXml += qDBusGenerateMetaObjectXml(it->interface, it->metaObject, - &QDBusAbstractAdaptor::staticMetaObject, - QDBusConnection::ExportAllContents); - - QDBusAbstractAdaptorPrivate::saveIntrospectionXml(it->adaptor, ifaceXml); - } - - xml_data += ifaceXml; - } - } - - xml_data += QLatin1String( introspectableInterfaceXml ); - xml_data += QLatin1String( propertiesInterfaceXml ); - } - - if (node->flags & QDBusConnection::ExportChildObjects) { - xml_data += generateSubObjectXml(node->obj); - } else { - // generate from the object tree - foreach (const QDBusConnectionPrivate::ObjectTreeNode::Data &entry, node->children) { - if (entry.node && (entry.node->obj || !entry.node->children.isEmpty())) - xml_data += QString(QLatin1String(" \n")) - .arg(entry.name); - } - } - - xml_data += QLatin1String("\n"); - return xml_data; -} - -void qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode *node, - const QDBusMessage &msg) -{ - // now send it - QDBusMessage reply = QDBusMessage::methodReply(msg); - reply << qDBusIntrospectObject(node); - msg.connection().send(reply); -} - -// implement the D-Bus interface org.freedesktop.DBus.Properties - -static void sendPropertyError(const QDBusMessage &msg, const QString &interface_name) -{ - QDBusMessage error = QDBusMessage::error(msg, QLatin1String(DBUS_ERROR_INVALID_ARGS), - QString::fromLatin1("Interface %1 was not found in object %2") - .arg(interface_name) - .arg(msg.path())); - msg.connection().send(error); -} - -void qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode *node, const QDBusMessage &msg) -{ - Q_ASSERT(msg.count() == 2); - QString interface_name = msg.at(0).toString(); - QByteArray property_name = msg.at(1).toString().toUtf8(); - - QDBusAdaptorConnector *connector; - QVariant value; - if (node->flags & QDBusConnection::ExportAdaptors && - (connector = qDBusFindAdaptorConnector(node->obj))) { - - // find the class that implements interface_name - QDBusAdaptorConnector::AdaptorMap::ConstIterator it; - it = qLowerBound(connector->adaptors.constBegin(), connector->adaptors.constEnd(), - interface_name); - if (it != connector->adaptors.constEnd() && it->interface == interface_name) - value = it->adaptor->property(property_name); - } - - if (!value.isValid() && node->flags & QDBusConnection::ExportProperties) { - // try the object itself - int pidx = node->obj->metaObject()->indexOfProperty(property_name); - if (pidx != -1) { - QMetaProperty mp = node->obj->metaObject()->property(pidx); - if (mp.isScriptable() || (node->flags & QDBusConnection::ExportAllProperties) == - QDBusConnection::ExportAllProperties) - value = mp.read(node->obj); - } - } - - if (!value.isValid()) { - // the property was not found - sendPropertyError(msg, interface_name); - return; - } - - QDBusMessage reply = QDBusMessage::methodReply(msg); - reply.setSignature(QLatin1String("v")); - reply << value; - msg.connection().send(reply); -} - -void qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode *node, const QDBusMessage &msg) -{ - Q_ASSERT(msg.count() == 3); - QString interface_name = msg.at(0).toString(); - QByteArray property_name = msg.at(1).toString().toUtf8(); - QVariant value = QDBusTypeHelper::fromVariant(msg.at(2)); - - QDBusAdaptorConnector *connector; - if (node->flags & QDBusConnection::ExportAdaptors && - (connector = qDBusFindAdaptorConnector(node->obj))) { - - // find the class that implements interface_name - QDBusAdaptorConnector::AdaptorMap::ConstIterator it; - it = qLowerBound(connector->adaptors.constBegin(), connector->adaptors.constEnd(), - interface_name); - if (it != connector->adaptors.end() && it->interface == interface_name) - if (it->adaptor->setProperty(property_name, value)) { - msg.connection().send(QDBusMessage::methodReply(msg)); - return; - } - } - - if (node->flags & QDBusConnection::ExportProperties) { - // try the object itself - int pidx = node->obj->metaObject()->indexOfProperty(property_name); - if (pidx != -1) { - QMetaProperty mp = node->obj->metaObject()->property(pidx); - if (mp.isScriptable() || (node->flags & QDBusConnection::ExportAllProperties) == - QDBusConnection::ExportAllProperties) { - - if (mp.write(node->obj, value)) { - msg.connection().send(QDBusMessage::methodReply(msg)); - return; - } - } - } - } - - // the property was not found or not written to - sendPropertyError(msg, interface_name); -} diff --git a/qt/src/qdbusintrospection.cpp b/qt/src/qdbusintrospection.cpp deleted file mode 100644 index 20acbd21..00000000 --- a/qt/src/qdbusintrospection.cpp +++ /dev/null @@ -1,403 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusintrospection_p.h" -#include "qdbusxmlparser_p.h" - -/*! - \class QDBusIntrospection - \brief Information about introspected objects and interfaces on D-Bus. - \internal - - This class provides structures and methods for parsing the XML introspection data for D-Bus. - Normally, you don't have to use the methods provided here: QDBusInterface and QDBusObject will - do that for you. - - But they may prove useful if the XML data was obtained through other means (like parsing a file). -*/ - -/*! - \class QDBusIntrospection::Argument - \brief One argument to a D-Bus method or signal. - - This struct represents one argument passed to a method or received from a method or signal in - D-Bus. The struct does not contain information on the direction (input or output). -*/ - -/*! - \var QDBusIntrospection::Argument::type - The argument type. -*/ - -/*! - \var QDBusIntrospection::Argument::name - The argument name. The argument name is optional, so this may be a null QString. -*/ - -/*! - \fn QDBusIntrospection::Argument::operator==(const Argument &other) const - Compares this object against \a other and return true if they are the same. -*/ - -/*! - \class QDBusIntrospection::Method - \brief Information about one method. - - This struct represents one method discovered through introspection. A method is composed of - its \a name, its input arguments, its output arguments, and, optionally, annotations. There are no - "in-out" arguments. -*/ - -/*! - \var QDBusIntrospection::Method::name - The method's name. -*/ - -/*! - \var QDBusIntrospection::Method::inputArgs - A list of the method's input arguments. -*/ - -/*! - \var QDBusIntrospection::Method::outputArgs - A list of the method's output arguments (i.e., return values). -*/ - -/*! - \var QDBusIntrospection::Method::annotations - The annotations associated with the method. Each annotation is a pair of strings, where the key - is of the same format as a D-Bus interface name. The value is arbitrary. -*/ - -/*! - \fn QDBusIntrospection::Method::operator==(const Method &other) const - Compares this object against \a other and return true if they are the same. -*/ - -/*! - \class QDBusIntrospection::Signal - \brief Information about one signal. - - This struct represents one signal discovered through introspection. A signal is composed of - its \a name, its output arguments, and, optionally, annotations. -*/ - -/*! - \var QDBusIntrospection::Signal::name - The signal's name. -*/ - -/*! - \var QDBusIntrospection::Signal::outputArgs - A list of the signal's arguments. -*/ - -/*! - \var QDBusIntrospection::Signal::annotations - The annotations associated with the signal. Each annotation is a pair of strings, where the key - is of the same format as a D-Bus interface name. The value is arbitrary. -*/ - -/*! - \fn QDBusIntrospection::Signal::operator==(const Signal& other) const - Compares this object against \a other and return true if they are the same. -*/ - -/*! - \class QDBusIntrospection::Property - \brief Information about one property. - - This struct represents one property discovered through introspection. A property is composed of - its \a name, its \a type, its \a access rights, and, optionally, annotations. -*/ - -/*! - \var QDBusIntrospection::Property::name - The property's name. -*/ - -/*! - \var QDBusIntrospection::Property::type - The property's type. -*/ - -/*! - \enum QDBusIntrospection::Property::Access - The possible access rights for a property: - \value Read - \value Write - \value ReadWrite -*/ - -/*! - \var QDBusIntrospection::Property::access - The property's access rights. -*/ - -/*! - \var QDBusIntrospection::Property::annotations - The annotations associated with the property. Each annotation is a pair of strings, where the key - is of the same format as a D-Bus interface name. The value is arbitrary. -*/ - -/*! - \fn QDBusIntrospection::Property::operator==(const Property &other) const - Compares this object against \a other and return true if they are the same. -*/ - -/*! - \class QDBusIntrospection::Interface - \brief Information about one interface on the bus. - - Each interface on D-Bus has an unique \a name, identifying where that interface was defined. - Interfaces may have annotations, methods, signals and properties, but none are mandatory. -*/ - -/*! - \var QDBusIntrospection::Interface::name - The interface's name. -*/ - -/*! - \var QDBusIntrospection::Interface::introspection - The XML document fragment describing this interface. - - If parsed again through parseInterface, the object returned should have the same contents as - this object. -*/ - -/*! - \var QDBusIntrospection::Interface::annotations - The annotations associated with the interface. Each annotation is a pair of strings, where the key - is of the same format as a D-Bus interface name. The value is arbitrary. -*/ - -/*! - \var QDBusIntrospection::Interface::methods - The methods available in this interface. Note that method names are not unique (i.e., methods - can be overloaded with multiple arguments types). -*/ - -/*! - \var QDBusIntrospection::Interface::signals_ - The signals available in this interface. Note that signal names are not unique (i.e., signals - can be overloaded with multiple argument types). - - This member is called "signals_" because "signals" is a reserved keyword in Qt. -*/ - -/*! - \var QDBusIntrospection::Interface::properties - The properties available in this interface. Property names are unique. -*/ - -/*! - \fn QDBusIntrospection::Interface::operator==(const Interface &other) const - Compares this object against \a other and return true if they are the same. - - Note that two interfaces are considered to be the same if they have the same name. The internal - structures in the objects are not compared. -*/ - -/*! - \class QDBusIntrospection::Object - \brief Information about one object on the bus. - - An object on the D-Bus bus is represented by its service and path on the service but, unlike - interfaces, objects are mutable. That is, their contents can change with time. Therefore, - while the (service, path) pair uniquely identifies an object, the information contained in - this struct may no longer represent the object. - - An object can contain interfaces and child (sub) objects. -*/ - -/*! - \var QDBusIntrospection::Object::service - The object's service name. - - \sa parseObject(), parseObjectTree() -*/ - -/*! - \var QDBusIntrospection::Object::path - The object's path on the service. This is an absolute path. - - \sa parseObject(), parseObjectTree() -*/ - -/*! - \var QDBusIntrospection::Object::introspection - The XML document fragment describing this object, its interfaces and sub-objects at the time - of the parsing. - - The result of parseObject with this XML data should be the same as the Object struct. -*/ - -/*! - \var QDBusIntrospection::Object::interfaces - The list of interface names in this object. -*/ - -/*! - \var QDBusIntrospection::Object::childObjects - The list of child object names in this object. Note that this is a relative name, not an - absolute path. To obtain the absolute path, concatenate with \l - {QDBusIntrospection::Object::path}{path}. -*/ - -/*! - \class QDBusIntrospection::ObjectTree - \brief Complete information about one object node and its descendency. - - This struct contains the same data as QDBusIntrospection::Object, plus the actual data for the - interfaces and child (sub) objects that was available in the XML document. -*/ - -/*! - \var QDBusIntrospection::ObjectTree::interfaceData - A map of interfaces and their names. -*/ - -/*! - \var QDBusIntrospection::ObjectTree::childObjectData - A map of object paths and their data. The map key contains the relative path to the object. - - Note this map contains only the child notes that do have information about the sub-object's - contents. If the XML data did not contain the information, only the object name will be listed - in childObjects, but not in childObjectData. -*/ - -/*! - \typedef QDBusIntrospection::Annotations - Contains a QMap of an annotation pair. The annotation's name is stored in the QMap key and - must be unique. The annotation's value is stored in the QMap's value and is arbitrary. -*/ - -/*! - \typedef QDBusIntrospection::Arguments - Contains a list of arguments to either a Method or a Signal. The arguments' order is important. -*/ - -/*! - \typedef QDBusIntrospection::Methods - Contains a QMap of methods and their names. The method's name is stored in the map's key and - is not necessarily unique. The order in which multiple methods with the same name are stored - in this map is undefined. -*/ - -/*! - \typedef QDBusIntrospection::Signals - Contains a QMap of signals and their names. The signal's name is stored in the map's key and - is not necessarily unique. The order in which multiple signals with the same name are stored - in this map is undefined. -*/ - -/*! - \typedef QDBusIntrospection::Properties - Contains a QMap of properties and their names. Each property must have a unique name. -*/ - -/*! - \typedef QDBusIntrospection::Interfaces - Contains a QMap of interfaces and their names. Each interface has a unique name. -*/ - -/*! - \typedef QDBusIntrospection::Objects - Contains a QMap of objects and their paths relative to their immediate parent. - - \sa parseObjectTree() -*/ - -/*! - Parses the XML document fragment (given by \a xml) containing one interface. - - The first element tag in this XML data must be either \ or \. If it is - \, then the \ tag must be a child tag of the \ one. - - If there are multiple interfaces in this XML data, it is undefined which one will be - returned. -*/ -QDBusIntrospection::Interface -QDBusIntrospection::parseInterface(const QString &xml) -{ - // be lazy - Interfaces ifs = parseInterfaces(xml); - if (ifs.isEmpty()) - return Interface(); - - // return the first in map order (probably alphabetical order) - return *ifs.constBegin().value(); -} - -/*! - Parses the XML document fragment (given by \a xml) containing several interfaces. - - If the first element tag in this document fragment is \, the interfaces parsed will - be those found as child elements of the \ tag. -*/ -QDBusIntrospection::Interfaces -QDBusIntrospection::parseInterfaces(const QString &xml) -{ - QString null; - QDBusXmlParser parser(null, null, xml); - return parser.interfaces(); -} - -/*! - Parses the XML document fragment (given by \a xml) containing one object, found at the service - \a service and path \a path. - - The first element tag in this document must be \. If that tag does not contain - a name attribute, the \a path argument will be used to determine the path of this - object node. - - This function does not parse the interfaces contained in the node, nor sub-object's contents. - It will only list their names. If you need to know their contents, use parseObjectTree. -*/ -QDBusIntrospection::Object -QDBusIntrospection::parseObject(const QString &xml, const QString &service, const QString &path) -{ - QDBusXmlParser parser(service, path, xml); - QSharedDataPointer retval = parser.object(); - if (!retval) - return QDBusIntrospection::Object(); - return *retval; -} - -/*! - Parses the XML document fragment (given by \a xml) containing one object node and returns all - the information about the interfaces and sub-objects, found at the service \a service and path - \a path. - - The Objects map returned will contain the absolute path names in the key. -*/ -QDBusIntrospection::ObjectTree -QDBusIntrospection::parseObjectTree(const QString &xml, const QString &service, const QString &path) -{ - QDBusXmlParser parser(service, path, xml); - QSharedDataPointer retval = parser.objectTree(); - if (!retval) - return QDBusIntrospection::ObjectTree(); - return *retval; -} diff --git a/qt/src/qdbusintrospection_p.h b/qt/src/qdbusintrospection_p.h deleted file mode 100644 index 0e4e9015..00000000 --- a/qt/src/qdbusintrospection_p.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSINTROSPECTION_H -#define QDBUSINTROSPECTION_H - -#include -#include -#include -#include -#include -#include -#include "qdbusmacros.h" - -class QDBUS_EXPORT QDBusIntrospection -{ -public: - // forward declarations - struct Argument; - struct Method; - struct Signal; - struct Property; - struct Interface; - struct Object; - struct ObjectTree; - - // typedefs - typedef QMap Annotations; - typedef QList Arguments; - typedef QMultiMap Methods; - typedef QMultiMap Signals; - typedef QMap Properties; - typedef QMap > Interfaces; - typedef QMap > Objects; - -public: - // the structs - - struct Argument - { - QString type; - QString name; - - inline bool operator==(const Argument& other) const - { return name == other.name && type == other.type; } - }; - - struct Method - { - QString name; - Arguments inputArgs; - Arguments outputArgs; - Annotations annotations; - - inline bool operator==(const Method& other) const - { return name == other.name && annotations == other.annotations && - inputArgs == other.inputArgs && outputArgs == other.outputArgs; } - }; - - struct Signal - { - QString name; - Arguments outputArgs; - Annotations annotations; - - inline bool operator==(const Signal& other) const - { return name == other.name && annotations == other.annotations && - outputArgs == other.outputArgs; } - }; - - struct Property - { - enum Access { Read, Write, ReadWrite }; - QString name; - QString type; - Access access; - Annotations annotations; - - inline bool operator==(const Property& other) const - { return access == other.access && name == other.name && - annotations == other.annotations && type == other.type; } - }; - - struct Interface: public QSharedData - { - QString name; - QString introspection; - - Annotations annotations; - Methods methods; - Signals signals_; - Properties properties; - - inline bool operator==(const Interface &other) const - { return !name.isEmpty() && name == other.name; } - }; - - struct Object: public QSharedData - { - QString service; - QString path; - QString introspection; - - QStringList interfaces; - QStringList childObjects; - }; - - struct ObjectTree: public Object - { - Interfaces interfaceData; - Objects childObjectData; - }; - -public: - static Interface parseInterface(const QString &xml); - static Interfaces parseInterfaces(const QString &xml); - static Object parseObject(const QString &xml, const QString &service = QString(), - const QString &path = QString()); - static ObjectTree parseObjectTree(const QString &xml, - const QString &service, - const QString &path); - -private: - QDBusIntrospection(); -}; - -#endif diff --git a/qt/src/qdbusmacros.h b/qt/src/qdbusmacros.h deleted file mode 100644 index 0af5b5b3..00000000 --- a/qt/src/qdbusmacros.h +++ /dev/null @@ -1,60 +0,0 @@ -/* qdbusmessage.h QDBusMessage object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -/*! - \file qdbusmacros.h -*/ - -#ifndef QDBUSMACROS_H -#define QDBUSMACROS_H - -#include -#include -#include - -#ifdef QT_NO_MEMBER_TEMPLATES -# error Sorry, you need a compiler with support for template member functions to compile QtDBus. -#endif - -#if defined(QDBUS_MAKEDLL) -# define QDBUS_EXPORT Q_DECL_EXPORT -#else -# define QDBUS_EXPORT Q_DECL_IMPORT -#endif - -#ifndef Q_MOC_RUN -# define Q_ASYNC -#endif - -#ifdef Q_CC_MSVC -#include -#include -#include -#include -class QDBusType; -inline uint qHash(const QVariant&) { Q_ASSERT(0); return 0; } -inline uint qHash(const QDBusType&) { Q_ASSERT(0); return 0; } -#endif - -#endif diff --git a/qt/src/qdbusmarshall.cpp b/qt/src/qdbusmarshall.cpp deleted file mode 100644 index 0d90fcd5..00000000 --- a/qt/src/qdbusmarshall.cpp +++ /dev/null @@ -1,582 +0,0 @@ -/* qdbusmarshall.cpp - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusmarshall_p.h" -#include "qdbustype_p.h" -#include "qdbustypehelper_p.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -static QVariant qFetchParameter(DBusMessageIter *it); - -template -inline T qIterGet(DBusMessageIter *it) -{ - T t; - dbus_message_iter_get_basic(it, &t); - return t; -} - -template<> -inline QVariant qIterGet(DBusMessageIter *it) -{ - DBusMessageIter sub; - dbus_message_iter_recurse(it, &sub); - return QDBusTypeHelper::toVariant(qFetchParameter(&sub)); -} - -template -inline QVariant qFetchList(DBusMessageIter *arrayIt) -{ - QList list; - - DBusMessageIter it; - dbus_message_iter_recurse(arrayIt, &it); - if (dbus_message_iter_get_array_len(&it) == 0) - return QDBusTypeHelper >::toVariant(list); - - do { - list.append( static_cast( qIterGet(&it) ) ); - } while (dbus_message_iter_next(&it)); - - return QDBusTypeHelper >::toVariant(list); -} - -static QStringList qFetchStringList(DBusMessageIter *arrayIt) -{ - QStringList list; - - DBusMessageIter it; - dbus_message_iter_recurse(arrayIt, &it); - if (dbus_message_iter_get_array_len(&it) == 0) - return list; - - do { - list.append(QString::fromUtf8(qIterGet(&it))); - } while (dbus_message_iter_next(&it)); - - return list; -} - -static QVariant qFetchParameter(DBusMessageIter *it) -{ - switch (dbus_message_iter_get_arg_type(it)) { - case DBUS_TYPE_BYTE: - return qVariantFromValue(qIterGet(it)); - case DBUS_TYPE_INT16: - return qVariantFromValue(qIterGet(it)); - case DBUS_TYPE_UINT16: - return qVariantFromValue(qIterGet(it)); - case DBUS_TYPE_INT32: - return qIterGet(it); - case DBUS_TYPE_UINT32: - return qIterGet(it); - case DBUS_TYPE_DOUBLE: - return qIterGet(it); - case DBUS_TYPE_BOOLEAN: - return bool(qIterGet(it)); - case DBUS_TYPE_INT64: - return static_cast(qIterGet(it)); - case DBUS_TYPE_UINT64: - return static_cast(qIterGet(it)); - case DBUS_TYPE_STRING: - case DBUS_TYPE_OBJECT_PATH: - case DBUS_TYPE_SIGNATURE: - return QString::fromUtf8(qIterGet(it)); - case DBUS_TYPE_VARIANT: - return qIterGet(it); - case DBUS_TYPE_ARRAY: { - int arrayType = dbus_message_iter_get_element_type(it); - switch (arrayType) - { - case DBUS_TYPE_BYTE: { - // QByteArray - DBusMessageIter sub; - dbus_message_iter_recurse(it, &sub); - int len = dbus_message_iter_get_array_len(&sub); - char* data; - dbus_message_iter_get_fixed_array(&sub,&data,&len); - return QByteArray(data,len); - } - case DBUS_TYPE_INT16: - return qFetchList(it); - case DBUS_TYPE_UINT16: - return qFetchList(it); - case DBUS_TYPE_INT32: - return qFetchList(it); - case DBUS_TYPE_UINT32: - return qFetchList(it); - case DBUS_TYPE_BOOLEAN: - return qFetchList(it); - case DBUS_TYPE_DOUBLE: - return qFetchList(it); - case DBUS_TYPE_INT64: - return qFetchList(it); - case DBUS_TYPE_UINT64: - return qFetchList(it); - case DBUS_TYPE_STRING: - case DBUS_TYPE_OBJECT_PATH: - case DBUS_TYPE_SIGNATURE: - return qFetchStringList(it); - case DBUS_TYPE_VARIANT: - return qFetchList(it); - case DBUS_TYPE_DICT_ENTRY: { - // ### support other types of maps? - QMap map; - DBusMessageIter sub; - - dbus_message_iter_recurse(it, &sub); - if (dbus_message_iter_get_array_len(&sub) == 0) - // empty map - return map; - - do { - DBusMessageIter itemIter; - dbus_message_iter_recurse(&sub, &itemIter); - Q_ASSERT(dbus_message_iter_has_next(&itemIter)); - QString key = qFetchParameter(&itemIter).toString(); - dbus_message_iter_next(&itemIter); - map.insertMulti(key, qFetchParameter(&itemIter)); - } while (dbus_message_iter_next(&sub)); - return map; - } - } - } - // fall through - // common handling for structs and lists of lists (for now) - case DBUS_TYPE_STRUCT: { - QList list; - DBusMessageIter sub; - dbus_message_iter_recurse(it, &sub); - if (dbus_message_iter_get_array_len(&sub) == 0) - return list; - do { - list.append(qFetchParameter(&sub)); - } while (dbus_message_iter_next(&sub)); - return list; - } - - default: - qWarning("Don't know how to handle type %d '%c'", dbus_message_iter_get_arg_type(it), dbus_message_iter_get_arg_type(it)); - return QVariant(); - break; - } -} - -void QDBusMarshall::messageToList(QList &list, DBusMessage *message) -{ - Q_ASSERT(message); - - DBusMessageIter it; - if (!dbus_message_iter_init(message, &it)) - return; - - do { - list.append(qFetchParameter(&it)); - } while (dbus_message_iter_next(&it)); -} - -// convert the variant to the given type and return true if it worked. -// if the type is not known, guess it from the variant and set. -// return false if conversion failed. -static bool checkType(QVariant &var, QDBusType &type) -{ - if (!type.isValid()) { - // guess it from the variant - type = QDBusType::guessFromVariant(var); - return type.isValid(); - } - - int id = var.userType(); - - if (type.dbusType() == DBUS_TYPE_VARIANT) { - // this is a non symmetrical operation: - // nest a QVariant if we want variant and it isn't so - if (id != QDBusTypeHelper::id()) { - QVariant tmp = var; - var = QDBusTypeHelper::toVariant(tmp); - } - return true; - } - - switch (id) { - case QVariant::Bool: - case QMetaType::Short: - case QMetaType::UShort: - case QMetaType::UChar: - case QVariant::Int: - case QVariant::UInt: - case QVariant::LongLong: - case QVariant::ULongLong: - case QVariant::Double: - case QVariant::String: - if (type.isBasic()) - // QVariant can handle this on its own - return true; - - // cannot handle this - qWarning("Invalid conversion from %s to '%s'", var.typeName(), - type.dbusSignature().constData()); - var.clear(); - return false; - - case QVariant::ByteArray: - // make sure it's an "ARRAY of BYTE" - if (type.qvariantType() != QVariant::ByteArray) { - qWarning("Invalid conversion from %s to '%s'", var.typeName(), - type.dbusSignature().constData()); - var.clear(); - return false; - } - return true; - - case QVariant::StringList: - // make sure it's "ARRAY of STRING" - if (type.qvariantType() != QVariant::StringList) { - qWarning("Invalid conversion from %s to '%s'", var.typeName(), - type.dbusSignature().constData()); - var.clear(); - return false; - } - return true; - - case QVariant::List: - // could be either struct or array - if (type.dbusType() != DBUS_TYPE_ARRAY && type.dbusType() != DBUS_TYPE_STRUCT) { - qWarning("Invalid conversion from %s to '%s'", var.typeName(), - type.dbusSignature().constData()); - var.clear(); - return false; - } - - return true; - - case QVariant::Map: - if (!type.isMap()) { - qWarning("Invalid conversion from %s to '%s'", var.typeName(), - type.dbusSignature().constData()); - var.clear(); - return false; - } - - return true; - - case QVariant::Invalid: { - // create an empty variant - void *null = 0; - var = QVariant(type.qvariantType(), null); - break; - } - - default: - if (id == QDBusTypeHelper::id()) { - // if we got here, it means the match above for DBUS_TYPE_VARIANT didn't work - qWarning("Invalid conversion from nested variant to '%s'", - type.dbusSignature().constData()); - return false; - } else if (type.dbusType() == DBUS_TYPE_ARRAY) { - int subType = type.arrayElement().dbusType(); - if ((id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_BOOLEAN) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_INT16) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_UINT16) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_INT32) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_UINT32) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_INT64) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_UINT64) || - (id == QDBusTypeHelper::listId() && subType == DBUS_TYPE_DOUBLE)) - return true; - } - - qWarning("Invalid conversion from %s to '%s'", var.typeName(), - type.dbusSignature().constData()); - return false; - } - - qWarning("Found unknown QVariant type %d (%s) when converting to DBus", (int)var.type(), - var.typeName()); - var.clear(); - return false; -} - -static bool qVariantToIteratorInternal(DBusMessageIter *it, const QVariant &var, - const QDBusType &type); - -static bool qListToIterator(DBusMessageIter *it, const QList &list, - const QDBusTypeList &typelist); - -template -static void qIterAppend(DBusMessageIter *it, const QDBusType &type, T arg) -{ - dbus_message_iter_append_basic(it, type.dbusType(), &arg); -} - -template -static void qAppendListToMessage(DBusMessageIter *it, const QDBusType &subType, - const QVariant &var) -{ - QList list = QDBusTypeHelper >::fromVariant(var); - foreach (const QtType &item, list) - qIterAppend(it, subType, static_cast(item)); -} - -static bool qAppendArrayToMessage(DBusMessageIter *it, const QDBusType &subType, - const QVariant &var) -{ - bool ok = false; - DBusMessageIter sub; - dbus_message_iter_open_container(it, DBUS_TYPE_ARRAY, subType.dbusSignature(), &sub); - - switch (var.type()) - { - case QVariant::StringList: { - const QStringList list = var.toStringList(); - foreach (QString str, list) - qIterAppend(&sub, subType, str.toUtf8().constData()); - ok = true; - break; - } - - case QVariant::ByteArray: { - const QByteArray array = var.toByteArray(); - const char* cdata = array.constData(); - dbus_message_iter_append_fixed_array(&sub, DBUS_TYPE_BYTE, &cdata, array.length()); - ok = true; - break; - } - - case QVariant::Map: { - const QVariantMap map = var.toMap(); - const QDBusTypeList& subTypes = subType.subTypes(); - - ok = true; - for (QMap::const_iterator mit = map.constBegin(); - ok && mit != map.constEnd(); ++mit) { - DBusMessageIter itemIterator; - dbus_message_iter_open_container(&sub, DBUS_TYPE_DICT_ENTRY, 0, &itemIterator); - - // let the string be converted to QVariant - if (!qVariantToIteratorInternal(&itemIterator, mit.key(), subTypes[0])) - ok = false; - else if (!qVariantToIteratorInternal(&itemIterator, mit.value(), subTypes[1])) - ok = false; - - dbus_message_iter_close_container(&sub, &itemIterator); - } - break; - } - - case QVariant::List: { - const QVariantList list = var.toList(); - ok = true; - foreach (QVariant v, list) - if (!qVariantToIteratorInternal(&sub, v, subType)) { - ok = false; - break; - } - break; - } - - default: { - int id = var.userType(); - ok = true; - if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); -#if 0 // never reached, since QVariant::List mached - else if (id == QDBusTypeHelper::listId()) - qAppendListToMessage(&sub, subType, var); -#endif - else { - qFatal("qAppendArrayToMessage got unknown type!"); - ok = false; - } - break; - } - } - - dbus_message_iter_close_container(it, &sub); - return ok; -} - -static bool qAppendStructToMessage(DBusMessageIter *it, const QDBusTypeList &typeList, - const QVariantList &list) -{ - DBusMessageIter sub; - dbus_message_iter_open_container(it, DBUS_TYPE_STRUCT, NULL, &sub); - bool ok = qListToIterator(&sub, list, typeList); - dbus_message_iter_close_container(it, &sub); - return ok; -} - -static bool qAppendVariantToMessage(DBusMessageIter *it, const QDBusType &type, - const QVariant &var) -{ - Q_UNUSED(type); // type is 'v' - - QVariant arg = var; - if (var.userType() == QDBusTypeHelper::id()) - arg = QDBusTypeHelper::fromVariant(var); // extract the inner variant - - QDBusType t = QDBusType::guessFromVariant(arg); - if (!t.isValid()) - return false; - - // now add this variant - DBusMessageIter sub; - dbus_message_iter_open_container(it, DBUS_TYPE_VARIANT, t.dbusSignature(), &sub); - qVariantToIteratorInternal(&sub, arg, t); - dbus_message_iter_close_container(it, &sub); - - return true; // success -} - -static bool qVariantToIterator(DBusMessageIter *it, QVariant var, QDBusType type) -{ - if (!var.isValid()) { - qWarning("QDBusMarshall: invalid QVariant entry found"); - return false; - } - if (!checkType(var, type)) - // warning has been printed - return false; // type checking failed - - return qVariantToIteratorInternal(it, var, type); -} - -static bool qVariantToIteratorInternal(DBusMessageIter *it, const QVariant &var, - const QDBusType &type) -{ - switch (type.dbusType()) { - case DBUS_TYPE_BYTE: - qIterAppend( it, type, QDBusTypeHelper::fromVariant(var) ); - break; - case DBUS_TYPE_BOOLEAN: - qIterAppend( it, type, static_cast(var.toBool()) ); - break; - case DBUS_TYPE_INT16: - qIterAppend( it, type, QDBusTypeHelper::fromVariant(var) ); - break; - case DBUS_TYPE_UINT16: - qIterAppend( it, type, QDBusTypeHelper::fromVariant(var) ); - break; - case DBUS_TYPE_INT32: - qIterAppend( it, type, static_cast(var.toInt()) ); - break; - case DBUS_TYPE_UINT32: - qIterAppend( it, type, static_cast(var.toUInt()) ); - break; - case DBUS_TYPE_INT64: - qIterAppend( it, type, static_cast(var.toLongLong()) ); - break; - case DBUS_TYPE_UINT64: - qIterAppend( it, type, static_cast(var.toULongLong()) ); - break; - case DBUS_TYPE_DOUBLE: - qIterAppend( it, type, var.toDouble() ); - break; - case DBUS_TYPE_STRING: - case DBUS_TYPE_OBJECT_PATH: - case DBUS_TYPE_SIGNATURE: - qIterAppend( it, type, var.toString().toUtf8().constData() ); - break; - - // compound types: - case DBUS_TYPE_ARRAY: - // could be many things - return qAppendArrayToMessage( it, type.arrayElement(), var ); - - case DBUS_TYPE_VARIANT: - return qAppendVariantToMessage( it, type, var ); - - case DBUS_TYPE_STRUCT: - return qAppendStructToMessage( it, type.subTypes(), var.toList() ); - - case DBUS_TYPE_DICT_ENTRY: - qFatal("qVariantToIterator got a DICT_ENTRY!"); - return false; - - default: - qWarning("Found unknown DBus type '%s'", type.dbusSignature().constData()); - return false; - } - - return true; -} - -bool qListToIterator(DBusMessageIter *it, const QList &list) -{ - for (int i = 0; i < list.count(); ++i) - if (!qVariantToIterator(it, list.at(i), QDBusType())) - return false; - - return true; -} - -bool qListToIterator(DBusMessageIter *it, const QList &list, const QDBusTypeList &types) -{ - if (list.count() < types.count()) { - qWarning("QDBusMarshall: too few parameters"); - return false; - } - - for (int i = 0; i < types.count(); ++i) - if (!qVariantToIterator(it, list.at(i), types.at(i))) - return false; - - return true; -} - -void QDBusMarshall::listToMessage(const QList &list, DBusMessage *msg, - const QString &signature) -{ - Q_ASSERT(msg); - DBusMessageIter it; - dbus_message_iter_init_append(msg, &it); - - if (signature.isEmpty()) - (void) qListToIterator(&it, list); - else - (void) qListToIterator(&it, list, QDBusTypeList(signature.toUtf8())); -} diff --git a/qt/src/qdbusmarshall_p.h b/qt/src/qdbusmarshall_p.h deleted file mode 100644 index 7a2d46f5..00000000 --- a/qt/src/qdbusmarshall_p.h +++ /dev/null @@ -1,57 +0,0 @@ -/* qdbusmarshall_p.h QDBusMarshall object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSMARSHALLPRIVATE_H -#define QDBUSMARSHALLPRIVATE_H - -struct DBusMessage; - -template class QList; -class QVariant; -class QString; - -/*! - \internal -*/ -class QDBusMarshall -{ -public: - static void listToMessage(const QList &list, DBusMessage *message, - const QString& signature); - static void messageToList(QList &list, DBusMessage *message); -}; - -#endif diff --git a/qt/src/qdbusmessage.cpp b/qt/src/qdbusmessage.cpp deleted file mode 100644 index ec24100e..00000000 --- a/qt/src/qdbusmessage.cpp +++ /dev/null @@ -1,704 +0,0 @@ -/* qdbusmessage.cpp - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusmessage.h" - -#include -#include - -#include - -#include "qdbuserror.h" -#include "qdbusmarshall_p.h" -#include "qdbusmessage_p.h" -#include "qdbustypehelper_p.h" - -QDBusMessagePrivate::QDBusMessagePrivate() - : connection(QString()), msg(0), reply(0), type(DBUS_MESSAGE_TYPE_INVALID), - timeout(-1), ref(1), repliedTo(false) -{ -} - -QDBusMessagePrivate::~QDBusMessagePrivate() -{ - if (msg) - dbus_message_unref(msg); - if (reply) - dbus_message_unref(reply); -} - -/////////////// -/*! - \class QDBusMessage - \brief Represents one message sent or received over the DBus bus. - - This object can represent any of four different types of messages possible on the bus - (see MessageType) - - Method calls - - Method return values - - Signal emissions - - Error codes - - Objects of this type are created with the four static functions signal, methodCall, - methodReply and error. -*/ - -/*! - \enum QDBusMessage::MessageType - The possible message types: - - \value MethodCallMessage a message representing an outgoing or incoming method call - \value SignalMessage a message representing an outgoing or incoming signal emission - \value ReplyMessage a message representing the return values of a method call - \value ErrorMessage a message representing an error condition in response to a method call - \value InvalidMessage an invalid message: this is never set on messages received from D-Bus -*/ - -/*! - Constructs a new DBus message representing a signal emission. A DBus signal is emitted - from one application and is received by all applications that are listening for that signal - from that interface. - - The signal will be constructed to represent a signal coming from the path \a path, interface \a - interface and signal name \a name. - - The QDBusMessage object that is returned can be sent with QDBusConnection::send(). -*/ -QDBusMessage QDBusMessage::signal(const QString &path, const QString &interface, - const QString &name) -{ - QDBusMessage message; - message.d_ptr->type = DBUS_MESSAGE_TYPE_SIGNAL; - message.d_ptr->path = path; - message.d_ptr->interface = interface; - message.d_ptr->name = name; - - return message; -} - -/*! - Constructs a new DBus message representing a method call. A method call always informs - its destination address (\a service, \a path, \a interface and \a method). - - The DBus bus allows calling a method on a given remote object without specifying the - destination interface, if the method name is unique. However, if two interfaces on the - remote object export the same method name, the result is undefined (one of the two may be - called or an error may be returned). - - When using DBus in a peer-to-peer context (i.e., not on a bus), the \a service parameter is - optional. - - The QDBusObject and QDBusInterface classes provide a simpler abstraction to synchronous - method calling. - - This function returns a QDBusMessage object that can be sent with QDBusConnection::send(), - QDBusConnection::sendWithReply(), or QDBusConnection::sendWithReplyAsync(). -*/ -QDBusMessage QDBusMessage::methodCall(const QString &service, const QString &path, - const QString &interface, const QString &method) -{ - QDBusMessage message; - message.d_ptr->type = DBUS_MESSAGE_TYPE_METHOD_CALL; - message.d_ptr->service = service; - message.d_ptr->path = path; - message.d_ptr->interface = interface; - message.d_ptr->name = method; - - return message; -} - -/*! - Constructs a new DBus message representing the return values from a called method. The \a other - variable represents the method call that the reply will be for. - - This function returns a QDBusMessage object that can be sent with QDBusConnection::send(). -*/ -QDBusMessage QDBusMessage::methodReply(const QDBusMessage &other) -{ - Q_ASSERT(other.d_ptr->msg); - - QDBusMessage message; - message.d_ptr->connection = other.d_ptr->connection; - message.d_ptr->type = DBUS_MESSAGE_TYPE_METHOD_RETURN; - message.d_ptr->reply = dbus_message_ref(other.d_ptr->msg); - other.d_ptr->repliedTo = true; - - return message; -} - -/*! - Constructs a DBus message representing an error condition described by the \a name - parameter. The \a msg parameter is optional and may contain a human-readable description of the - error. The \a other variable represents the method call that this error relates to. - - This function returns a QDBusMessage object that can be sent with QDBusMessage::send(). -*/ -QDBusMessage QDBusMessage::error(const QDBusMessage &other, const QString &name, - const QString &msg) -{ - Q_ASSERT(other.d_ptr->msg); - - QDBusMessage message; - message.d_ptr->connection = other.d_ptr->connection; - message.d_ptr->type = DBUS_MESSAGE_TYPE_ERROR; - message.d_ptr->name = name; - message.d_ptr->message = msg; - message.d_ptr->reply = dbus_message_ref(other.d_ptr->msg); - other.d_ptr->repliedTo = true; - - return message; -} - -/*! - \overload - Constructs a DBus message representing an error, where \a other is the method call that - generated this error and \a error is the error code. -*/ -QDBusMessage QDBusMessage::error(const QDBusMessage &other, const QDBusError &error) -{ - Q_ASSERT(other.d_ptr->msg); - - QDBusMessage message; - message.d_ptr->connection = other.d_ptr->connection; - message.d_ptr->type = DBUS_MESSAGE_TYPE_ERROR; - message.d_ptr->name = error.name(); - message.d_ptr->message = error.message(); - message.d_ptr->reply = dbus_message_ref(other.d_ptr->msg); - other.d_ptr->repliedTo = true; - - return message; -} - -/*! - Constructs an empty, invalid QDBusMessage object. - - \sa methodCall(), methodReply(), signal(), error() -*/ -QDBusMessage::QDBusMessage() -{ - d_ptr = new QDBusMessagePrivate; -} - -/*! - Constructs a copy of the object given by \a other. -*/ -QDBusMessage::QDBusMessage(const QDBusMessage &other) - : QList(other) -{ - d_ptr = other.d_ptr; - d_ptr->ref.ref(); -} - -/*! - Disposes of the object and frees any resources that were being held. -*/ -QDBusMessage::~QDBusMessage() -{ - if (!d_ptr->ref.deref()) - delete d_ptr; -} - -/*! - Copies the contents of the object given by \a other. -*/ -QDBusMessage &QDBusMessage::operator=(const QDBusMessage &other) -{ - QList::operator=(other); - qAtomicAssign(d_ptr, other.d_ptr); - return *this; -} - -static inline const char *data(const QByteArray &arr) -{ - return arr.isEmpty() ? 0 : arr.constData(); -} - -/*! - \internal - Constructs a DBusMessage object from this object. The returned value must be de-referenced - with dbus_message_unref. -*/ -DBusMessage *QDBusMessage::toDBusMessage() const -{ - DBusMessage *msg = 0; - - switch (d_ptr->type) { - case DBUS_MESSAGE_TYPE_METHOD_CALL: - msg = dbus_message_new_method_call(data(d_ptr->service.toUtf8()), data(d_ptr->path.toUtf8()), - data(d_ptr->interface.toUtf8()), data(d_ptr->name.toUtf8())); - break; - case DBUS_MESSAGE_TYPE_SIGNAL: - msg = dbus_message_new_signal(data(d_ptr->path.toUtf8()), data(d_ptr->interface.toUtf8()), - data(d_ptr->name.toUtf8())); - break; - case DBUS_MESSAGE_TYPE_METHOD_RETURN: - msg = dbus_message_new_method_return(d_ptr->reply); - break; - case DBUS_MESSAGE_TYPE_ERROR: - msg = dbus_message_new_error(d_ptr->reply, data(d_ptr->name.toUtf8()), data(d_ptr->message.toUtf8())); - break; - } - if (!msg) - return 0; - - QDBusMarshall::listToMessage(*this, msg, d_ptr->signature); - return msg; -} - -/*! - \internal - Constructs a QDBusMessage by parsing the given DBusMessage object. -*/ -QDBusMessage QDBusMessage::fromDBusMessage(DBusMessage *dmsg, const QDBusConnection &connection) -{ - QDBusMessage message; - if (!dmsg) - return message; - - message.d_ptr->connection = connection; - message.d_ptr->type = dbus_message_get_type(dmsg); - message.d_ptr->path = QString::fromUtf8(dbus_message_get_path(dmsg)); - message.d_ptr->interface = QString::fromUtf8(dbus_message_get_interface(dmsg)); - message.d_ptr->name = message.d_ptr->type == DBUS_MESSAGE_TYPE_ERROR ? - QString::fromUtf8(dbus_message_get_error_name(dmsg)) : - QString::fromUtf8(dbus_message_get_member(dmsg)); - message.d_ptr->service = QString::fromUtf8(dbus_message_get_sender(dmsg)); - message.d_ptr->signature = QString::fromUtf8(dbus_message_get_signature(dmsg)); - message.d_ptr->msg = dbus_message_ref(dmsg); - - QDBusMarshall::messageToList(message, dmsg); - return message; -} - -/*! - Creates a QDBusMessage that represents the same error as the QDBusError object. -*/ -QDBusMessage QDBusMessage::fromError(const QDBusError &error) -{ - QDBusMessage message; - message.d_ptr->type = DBUS_MESSAGE_TYPE_ERROR; - message.d_ptr->name = error.name(); - message << error.message(); - return message; -} - -/*! - Returns the path of the object that this message is being sent to (in the case of a - method call) or being received from (for a signal). -*/ -QString QDBusMessage::path() const -{ - return d_ptr->path; -} - -/*! - Returns the interface of the method being called (in the case of a method call) or of - the signal being received from. -*/ -QString QDBusMessage::interface() const -{ - return d_ptr->interface; -} - -/*! - Returns the name of the signal that was emitted or the name of the error that was - received. - \sa member() -*/ -QString QDBusMessage::name() const -{ - return d_ptr->name; -} - -/*! - \fn QDBusMessage::member() const - Returns the name of the method being called. -*/ - -/*! - \fn QDBusMessage::method() const - \overload - Returns the name of the method being called. -*/ - -/*! - Returns the name of the service or the bus address of the remote method call. -*/ -QString QDBusMessage::service() const -{ - return d_ptr->service; -} - -/*! - \fn QDBusMessage::sender() const - Returns the unique name of the remote sender. -*/ - -/*! - Returns the timeout (in milliseconds) for this message to be processed. -*/ -int QDBusMessage::timeout() const -{ - return d_ptr->timeout; -} - -/*! - Sets the timeout for this message to be processed, given by \a ms, in milliseconds. -*/ -void QDBusMessage::setTimeout(int ms) -{ - qAtomicDetach(d_ptr); - d_ptr->timeout = ms; -} - -/*! - Returns the flag that indicates if this message should see a reply or not. This is only - meaningful for MethodCall messages: any other kind of message cannot have replies and this - function will always return false for them. -*/ -bool QDBusMessage::noReply() const -{ - if (!d_ptr->msg) - return false; - return dbus_message_get_no_reply(d_ptr->msg); -} - -/*! - Returns the unique serial number assigned to this message - or 0 if the message was not sent yet. - */ -int QDBusMessage::serialNumber() const -{ - if (!d_ptr->msg) - return 0; - return dbus_message_get_serial(d_ptr->msg); -} - -/*! - Returns the unique serial number assigned to the message - that triggered this reply message. - - If this message is not a reply to another message, 0 - is returned. - - */ -int QDBusMessage::replySerialNumber() const -{ - if (!d_ptr->msg) - return 0; - return dbus_message_get_reply_serial(d_ptr->msg); -} - -/*! - Returns true if this is a MethodCall message and a reply for it has been generated using - QDBusMessage::methodReply or QDBusMessage::error. -*/ -bool QDBusMessage::wasRepliedTo() const -{ - return d_ptr->repliedTo; -} - -/*! - Returns the signature of the signal that was received or for the output arguments - of a method call. -*/ -QString QDBusMessage::signature() const -{ - return d_ptr->signature; -} - -/*! - Sets the signature for the output arguments of this method call to be the value of \a - sig. This function has no meaning in other types of messages or when dealing with received - method calls. - - A message's signature indicate the type of the parameters to - be marshalled over the bus. If there are more arguments than entries in the signature, the - tailing arguments will be silently dropped and not sent. If there are less arguments, - default values will be inserted (default values are those created by QVariant::convert - when a variant of type QVariant::Invalid is converted to the type). - -*/ -void QDBusMessage::setSignature(const QString &sig) -{ - qAtomicDetach(d_ptr); - d_ptr->signature = sig; -} - -/*! - Returns the connection this message was received on or an unconnected QDBusConnection object if - this isn't a message that has been received. -*/ -QDBusConnection QDBusMessage::connection() const -{ - return d_ptr->connection; -} - -/*! - Returns the message type. -*/ -QDBusMessage::MessageType QDBusMessage::type() const -{ - switch (d_ptr->type) { - case DBUS_MESSAGE_TYPE_METHOD_CALL: - return MethodCallMessage; - case DBUS_MESSAGE_TYPE_METHOD_RETURN: - return ReplyMessage; - case DBUS_MESSAGE_TYPE_ERROR: - return ErrorMessage; - case DBUS_MESSAGE_TYPE_SIGNAL: - return SignalMessage; - default: - return InvalidMessage; - } -} - -// Document QDBusReply here -/*! - \class QDBusReply - \brief The reply for a method call to a remote object. - - A QDBusReply object is a subset of the QDBusMessage object that represents a method call's - reply. It contains only the first output argument or the error code and is used by - QDBusInterface-derived classes to allow returning the error code as the function's return - argument. - - It can be used in the following manner: - \code - QDBusReply reply = interface->call("RemoteMethod"); - if (reply.isSuccess()) - // use the returned value - useValue(reply.value()); - else - // call failed. Show an error condition. - showError(reply.error()); - \endcode - - If the remote method call cannot fail, you can skip the error checking: - \code - QString reply = interface->call("RemoteMethod"); - \endcode - - However, if it does fail under those conditions, the value returned by QDBusReply::value() is - undefined. It may be undistinguishable from a valid return value. - - QDBusReply objects are used for remote calls that have no output arguments or return values - (i.e., they have a "void" return type). In this case, you can only test if the reply succeeded - or not, by calling isError() and isSuccess(), and inspecting the error condition by calling - error(). You cannot call value(). - - \sa QDBusMessage, QDBusInterface -*/ - -/*! - \fn QDBusReply::QDBusReply(const QDBusMessage &reply) - Automatically construct a QDBusReply object from the reply message \a reply, extracting the - first return value from it if it is a success reply. -*/ - -/*! - \fn QDBusReply::QDBusReply(const QDBusError &error) - Constructs an error reply from the D-Bus error code given by \a error. -*/ - -/*! - \fn QDBusReply::isError() const - Returns true if this reply is an error reply. You can extract the error contents using the - error() function. -*/ - -/*! - \fn QDBusReply::isSuccess() const - Returns true if this reply is a normal error reply (not an error). You can extract the returned - value with value() -*/ - -/*! - \fn QDBusReply::error() - Returns the error code that was returned from the remote function call. If the remote call did - not return an error (i.e., if it succeeded), then the QDBusError object that is returned will - not be a valid error code (QDBusError::isValid() will return false). -*/ - -/*! - \fn QDBusReply::value() - Returns the remote function's calls return value. If the remote call returned with an error, - the return value of this function is undefined and may be undistinguishable from a valid return - value. - - This function is not available if the remote call returns \c void. -*/ - -/*! - \fn QDBusReply::operator Type() - Returns the same as value(). - - This function is not available if the remote call returns \c void. -*/ - -/*! - \internal - \fn QDBusReply::fromVariant(const QDBusReply &variantReply) - Converts the QDBusReply object to this type by converting the variant contained in - \a variantReply to the template's type and copying the error condition. - - If the QVariant in variantReply is not convertible to this type, it will assume an undefined - value. -*/ - -#ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug dbg, QDBusMessage::MessageType t) -{ - switch (t) - { - case QDBusMessage::MethodCallMessage: - return dbg << "MethodCall"; - case QDBusMessage::ReplyMessage: - return dbg << "MethodReturn"; - case QDBusMessage::SignalMessage: - return dbg << "Signal"; - case QDBusMessage::ErrorMessage: - return dbg << "Error"; - default: - return dbg << "Invalid"; - } -} - -static void debugVariantList(QDebug dbg, const QVariantList &list); -static void debugVariantMap(QDebug dbg, const QVariantMap &map); - -static void debugVariant(QDebug dbg, const QVariant &v) -{ - dbg.nospace() << v.typeName() << "("; - switch (v.userType()) - { - case QVariant::Bool: - dbg.nospace() << v.toBool(); - break; - case QMetaType::UChar: - dbg.nospace() << qvariant_cast(v); - break; - case QMetaType::Short: - dbg.nospace() << qvariant_cast(v); - break; - case QMetaType::UShort: - dbg.nospace() << qvariant_cast(v); - break; - case QVariant::Int: - dbg.nospace() << v.toInt(); - break; - case QVariant::UInt: - dbg.nospace() << v.toUInt(); - break; - case QVariant::LongLong: - dbg.nospace() << v.toLongLong(); - break; - case QVariant::ULongLong: - dbg.nospace() << v.toULongLong(); - break; - case QVariant::Double: - dbg.nospace() << v.toDouble(); - break; - case QVariant::String: - dbg.nospace() << v.toString(); - break; - case QVariant::ByteArray: - dbg.nospace() << v.toByteArray(); - break; - case QVariant::StringList: - dbg.nospace() << v.toStringList(); - break; - case QVariant::List: - debugVariantList(dbg, v.toList()); - break; - case QVariant::Map: - debugVariantMap(dbg, v.toMap()); - break; - - default: { - int id = v.userType(); - if (id == QDBusTypeHelper::id()) - debugVariant(dbg, QDBusTypeHelper::fromVariant(v)); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else if (id == QDBusTypeHelper::listId()) - dbg.nospace() << QDBusTypeHelper >::fromVariant(v); - else - dbg.nospace() << "unknown"; - } - } - dbg.nospace() << ")"; -} - -static void debugVariantList(QDebug dbg, const QVariantList &list) -{ - bool first = true; - QVariantList::ConstIterator it = list.constBegin(); - QVariantList::ConstIterator end = list.constEnd(); - for ( ; it != end; ++it) { - if (!first) - dbg.nospace() << ", "; - debugVariant(dbg, *it); - first = false; - } -} - -static void debugVariantMap(QDebug dbg, const QVariantMap &map) -{ - QVariantMap::ConstIterator it = map.constBegin(); - QVariantMap::ConstIterator end = map.constEnd(); - for ( ; it != end; ++it) { - dbg << "(" << it.key() << ", "; - debugVariant(dbg, it.value()); - dbg << ") "; - } -} - -QDebug operator<<(QDebug dbg, const QDBusMessage &msg) -{ - dbg.nospace() << "QDBusMessage(type=" << msg.type() - << ", service=" << msg.service() - << ", path=" << msg.path() - << ", interface=" << msg.interface() - << ", name=" << msg.name() - << ", signature=" << msg.signature() - << ", contents=("; - debugVariantList(dbg, msg); - dbg.nospace() << " ) )"; - return dbg.space(); -} -#endif - diff --git a/qt/src/qdbusmessage.h b/qt/src/qdbusmessage.h deleted file mode 100644 index a36d3983..00000000 --- a/qt/src/qdbusmessage.h +++ /dev/null @@ -1,99 +0,0 @@ -/* qdbusmessage.h QDBusMessage object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSMESSAGE_H -#define QDBUSMESSAGE_H - -#include "qdbusmacros.h" -#include "qdbuserror.h" -#include -#include - -#include - -class QDBusMessagePrivate; -class QDBusConnection; -class QDBusConnectionPrivate; -struct DBusMessage; - -class QDBUS_EXPORT QDBusMessage: public QList -{ - //friend class QDBusConnection; - friend class QDBusConnectionPrivate; -public: - enum { DefaultTimeout = -1, NoTimeout = INT_MAX}; - enum MessageType { InvalidMessage, MethodCallMessage, ReplyMessage, - ErrorMessage, SignalMessage }; - - QDBusMessage(); - QDBusMessage(const QDBusMessage &other); - ~QDBusMessage(); - - QDBusMessage &operator=(const QDBusMessage &other); - - static QDBusMessage signal(const QString &path, const QString &interface, - const QString &name); - static QDBusMessage methodCall(const QString &destination, const QString &path, - const QString &interface, const QString &method); - static QDBusMessage methodReply(const QDBusMessage &other); - static QDBusMessage error(const QDBusMessage &other, const QString &name, - const QString &message = QString()); - static QDBusMessage error(const QDBusMessage &other, const QDBusError &error); - - QString path() const; - QString interface() const; - QString name() const; - inline QString member() const { return name(); } - inline QString method() const { return name(); } - QString service() const; - inline QString sender() const { return service(); } - MessageType type() const; - - int timeout() const; - void setTimeout(int ms); - - bool noReply() const; - - QString signature() const; - void setSignature(const QString &signature); - - QDBusConnection connection() const; - - int serialNumber() const; - int replySerialNumber() const; - bool wasRepliedTo() const; - -private: - DBusMessage *toDBusMessage() const; - static QDBusMessage fromDBusMessage(DBusMessage *dmsg, const QDBusConnection &connection); - static QDBusMessage fromError(const QDBusError& error); - QDBusMessagePrivate *d_ptr; -}; - -#ifndef QT_NO_DEBUG_STREAM -QDebug operator<<(QDebug, const QDBusMessage &); -#endif - -#endif - diff --git a/qt/src/qdbusmessage_p.h b/qt/src/qdbusmessage_p.h deleted file mode 100644 index ea958b24..00000000 --- a/qt/src/qdbusmessage_p.h +++ /dev/null @@ -1,50 +0,0 @@ -/* qdbusmessage.h QDBusMessage private object - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSMESSAGE_P_H -#define QDBUSMESSAGE_P_H - -#include -#include -#include "qdbusconnection.h" -struct DBusMessage; - -class QDBusMessagePrivate -{ -public: - QDBusMessagePrivate(); - ~QDBusMessagePrivate(); - - QString service, path, interface, name, message, signature; - QDBusConnection connection; - DBusMessage *msg; - DBusMessage *reply; - int type; - int timeout; - QAtomic ref; - - mutable bool repliedTo : 1; -}; - -#endif diff --git a/qt/src/qdbusmetaobject.cpp b/qt/src/qdbusmetaobject.cpp deleted file mode 100644 index 60675d5d..00000000 --- a/qt/src/qdbusmetaobject.cpp +++ /dev/null @@ -1,689 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusmetaobject_p.h" - -#include -#include -#include -#include - -#include "qdbusutil.h" -#include "qdbuserror.h" -#include "qdbusintrospection_p.h" -#include "qdbusabstractinterface_p.h" - -class QDBusMetaObjectGenerator -{ -public: - QDBusMetaObjectGenerator(const QString &interface, - const QDBusIntrospection::Interface *parsedData); - void write(QDBusMetaObject *obj); - void writeWithoutXml(QDBusMetaObject *obj); - -private: - struct Method { - QByteArray parameters; - QByteArray typeName; - QByteArray tag; - QByteArray inputSignature; - QByteArray outputSignature; - QVarLengthArray inputTypes; - QVarLengthArray outputTypes; - int flags; - }; - - struct Property { - QByteArray typeName; - QByteArray signature; - int type; - int flags; - }; - - enum PropertyFlags { - Invalid = 0x00000000, - Readable = 0x00000001, - Writable = 0x00000002, - Resettable = 0x00000004, - EnumOrFlag = 0x00000008, - StdCppSet = 0x00000100, - // Override = 0x00000200, - Designable = 0x00001000, - ResolveDesignable = 0x00002000, - Scriptable = 0x00004000, - ResolveScriptable = 0x00008000, - Stored = 0x00010000, - ResolveStored = 0x00020000, - Editable = 0x00040000, - ResolveEditable = 0x00080000, - User = 0x00100000, - ResolveUser = 0x00200000 - }; - - enum MethodFlags { - AccessPrivate = 0x00, - AccessProtected = 0x01, - AccessPublic = 0x02, - AccessMask = 0x03, //mask - - MethodMethod = 0x00, - MethodSignal = 0x04, - MethodSlot = 0x08, - MethodTypeMask = 0x0c, - - MethodCompatibility = 0x10, - MethodCloned = 0x20, - MethodScriptable = 0x40 - }; - - QMap methods; - QMap properties; - - const QDBusIntrospection::Interface *data; - QString interface; - - void parseMethods(); - void parseSignals(); - void parseProperties(); -}; - -static const int intsPerProperty = 2; -static const int intsPerMethod = 4; - -// ### from kernel/qmetaobject.cpp (Qt 4.1.2): -struct QDBusMetaObjectPrivate -{ - int revision; - int className; - int classInfoCount, classInfoData; - int methodCount, methodData; - int propertyCount, propertyData; - int enumeratorCount, enumeratorData; - - // this is specific for QDBusMetaObject: - int propertyDBusData; - int methodDBusData; -}; - -QDBusMetaObjectGenerator::QDBusMetaObjectGenerator(const QString &interfaceName, - const QDBusIntrospection::Interface *parsedData) - : data(parsedData), interface(interfaceName) -{ - if (data) { - parseProperties(); - parseSignals(); // call parseSignals first so that slots override signals - parseMethods(); - } -} - -void QDBusMetaObjectGenerator::parseMethods() -{ - foreach (const QDBusIntrospection::Method &m, data->methods) { - Method mm; - - QByteArray prototype = m.name.toLatin1(); - prototype += '('; - - bool ok = true; - - // build the input argument list - foreach (const QDBusIntrospection::Argument &arg, m.inputArgs) { - int typeId = QDBusUtil::signatureToType(arg.type); - if (typeId == QVariant::Invalid) { - ok = false; - break; - } - - mm.inputSignature += arg.type.toLatin1(); - mm.inputTypes.append(typeId); - - mm.parameters.append(arg.name.toLatin1()); - mm.parameters.append(','); - - prototype.append( QVariant::typeToName( QVariant::Type(typeId) ) ); - prototype.append(','); - } - if (!ok) continue; - - // build the output argument list: - for (int i = 0; i < m.outputArgs.count(); ++i) { - const QDBusIntrospection::Argument &arg = m.outputArgs.at(i); - - int typeId = QDBusUtil::signatureToType(arg.type); - if (typeId == QVariant::Invalid) { - ok = false; - break; - } - - mm.outputSignature += arg.type.toLatin1(); - mm.outputTypes.append(typeId); - - if (i == 0) { - // return value - mm.typeName = QVariant::typeToName( QVariant::Type(typeId) ); - } else { - // non-const ref parameter - mm.parameters.append(arg.name.toLatin1()); - mm.parameters.append(','); - - prototype.append( QVariant::typeToName( QVariant::Type(typeId) ) ); - prototype.append("&,"); - } - } - if (!ok) continue; - - // convert the last commas: - if (!mm.parameters.isEmpty()) { - mm.parameters.truncate(mm.parameters.length() - 1); - prototype[prototype.length() - 1] = ')'; - } else { - prototype.append(')'); - } - - // check the async tag - if (m.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true")) - mm.tag = "Q_ASYNC"; - - // meta method flags - mm.flags = AccessPublic | MethodSlot | MethodScriptable; - - // add - methods.insert(QMetaObject::normalizedSignature(prototype), mm); - } -} - -void QDBusMetaObjectGenerator::parseSignals() -{ - foreach (const QDBusIntrospection::Signal &s, data->signals_) { - Method mm; - - QByteArray prototype = s.name.toLatin1(); - prototype += '('; - - bool ok = true; - - // build the output argument list - foreach (const QDBusIntrospection::Argument &arg, s.outputArgs) { - int typeId = QDBusUtil::signatureToType(arg.type); - if (typeId == QVariant::Invalid) { - ok = false; - break; - } - - mm.inputSignature += arg.type.toLatin1(); - mm.inputTypes.append(typeId); - - mm.parameters.append(arg.name.toLatin1()); - mm.parameters.append(','); - - prototype.append( QVariant::typeToName( QVariant::Type(typeId) ) ); - prototype.append(','); - } - if (!ok) continue; - - // convert the last commas: - if (!mm.parameters.isEmpty()) { - mm.parameters.truncate(mm.parameters.length() - 1); - prototype[prototype.length() - 1] = ')'; - } else { - prototype.append(')'); - } - - // meta method flags - mm.flags = AccessProtected | MethodSignal | MethodScriptable; - - // add - methods.insert(QMetaObject::normalizedSignature(prototype), mm); - } -} - -void QDBusMetaObjectGenerator::parseProperties() -{ - foreach (const QDBusIntrospection::Property &p, data->properties) { - Property mp; - mp.type = QDBusUtil::signatureToType(p.type); - if (mp.type == QVariant::Invalid) - continue; - - QByteArray name = p.name.toLatin1(); - mp.signature = p.type.toLatin1(); - mp.typeName = QVariant::typeToName( QVariant::Type(mp.type) ); - - // build the flags: - mp.flags = StdCppSet | Scriptable | Stored; - if (p.access != QDBusIntrospection::Property::Write) - mp.flags |= Readable; - if (p.access != QDBusIntrospection::Property::Read) - mp.flags |= Writable; - - if (mp.typeName == "QVariant") - mp.flags |= 0xff << 24; - else if (mp.type < 0xff) - // encode the type in the flags - mp.flags |= mp.type << 24; - - // add the property: - properties.insert(name, mp); - } -} - -void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) -{ - // this code here is mostly copied from qaxbase.cpp - // with a few modifications to make it cleaner - - QString className = interface; - className.replace(QLatin1Char('.'), QLatin1String("::")); - if (className.isEmpty()) - className = QLatin1String("QDBusInterface"); - - QVarLengthArray idata; - idata.resize(sizeof(QDBusMetaObjectPrivate) / sizeof(int)); - - QDBusMetaObjectPrivate *header = reinterpret_cast(idata.data()); - header->revision = 1; - header->className = 0; - header->classInfoCount = 0; - header->classInfoData = 0; - header->methodCount = methods.count(); - header->methodData = idata.size(); - header->propertyCount = properties.count(); - header->propertyData = header->methodData + header->methodCount * 5; - header->enumeratorCount = 0; - header->enumeratorData = 0; - header->propertyDBusData = header->propertyData + header->propertyCount * 3; - header->methodDBusData = header->propertyDBusData + header->propertyCount * intsPerProperty; - - int data_size = idata.size() + - (header->methodCount * (5+intsPerMethod)) + - (header->propertyCount * (3+intsPerProperty)); - foreach (const Method &mm, methods) - data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count(); - idata.resize(data_size + 1); - - char null('\0'); - QByteArray stringdata = className.toLatin1(); - stringdata += null; - stringdata.reserve(8192); - - int offset = header->methodData; - int signatureOffset = header->methodDBusData; - int typeidOffset = header->methodDBusData + header->methodCount * intsPerMethod; - idata[typeidOffset++] = 0; // eod - - // add each method: - for (QMap::ConstIterator it = methods.constBegin(); - it != methods.constEnd(); ++it) { - // form "prototype\0parameters\0typeName\0tag\0inputSignature\0outputSignature" - const Method &mm = it.value(); - - idata[offset++] = stringdata.length(); - stringdata += it.key(); // prototype - stringdata += null; - idata[offset++] = stringdata.length(); - stringdata += mm.parameters; - stringdata += null; - idata[offset++] = stringdata.length(); - stringdata += mm.typeName; - stringdata += null; - idata[offset++] = stringdata.length(); - stringdata += mm.tag; - stringdata += null; - idata[offset++] = mm.flags; - - idata[signatureOffset++] = stringdata.length(); - stringdata += mm.inputSignature; - stringdata += null; - idata[signatureOffset++] = stringdata.length(); - stringdata += mm.outputSignature; - stringdata += null; - - idata[signatureOffset++] = typeidOffset; - idata[typeidOffset++] = mm.inputTypes.count(); - memcpy(idata.data() + typeidOffset, mm.inputTypes.data(), mm.inputTypes.count() * sizeof(int)); - typeidOffset += mm.inputTypes.count(); - - idata[signatureOffset++] = typeidOffset; - idata[typeidOffset++] = mm.outputTypes.count(); - memcpy(idata.data() + typeidOffset, mm.outputTypes.data(), mm.outputTypes.count() * sizeof(int)); - typeidOffset += mm.outputTypes.count(); - } - - Q_ASSERT(offset == header->propertyData); - Q_ASSERT(signatureOffset == header->methodDBusData + header->methodCount * intsPerMethod); - Q_ASSERT(typeidOffset == idata.size()); - - // add each property - signatureOffset = header->propertyDBusData; - for (QMap::ConstIterator it = properties.constBegin(); - it != properties.constEnd(); ++it) { - const Property &mp = it.value(); - - // form is "name\0typeName\0signature\0" - idata[offset++] = stringdata.length(); - stringdata += it.key(); // name - stringdata += null; - idata[offset++] = stringdata.length(); - stringdata += mp.typeName; - stringdata += null; - idata[offset++] = mp.flags; - - idata[signatureOffset++] = stringdata.length(); - stringdata += mp.signature; - stringdata += null; - idata[signatureOffset++] = mp.type; - } - - Q_ASSERT(offset == header->propertyDBusData); - Q_ASSERT(signatureOffset == header->methodDBusData); - - char *string_data = new char[stringdata.length()]; - memcpy(string_data, stringdata, stringdata.length()); - - uint *uint_data = new uint[idata.size()]; - memcpy(uint_data, idata.data(), idata.size() * sizeof(int)); - - // put the metaobject together - obj->d.data = uint_data; - obj->d.extradata = 0; - obj->d.stringdata = string_data; - obj->d.superdata = &QDBusAbstractInterface::staticMetaObject; -} - -#if 0 -void QDBusMetaObjectGenerator::writeWithoutXml(const QString &interface) -{ - // no XML definition - QString tmp(interface); - tmp.replace(QLatin1Char('.'), QLatin1String("::")); - QByteArray name(tmp.toLatin1()); - - QDBusMetaObjectPrivate *header = new QDBusMetaObjectPrivate; - memset(header, 0, sizeof *header); - header->revision = 1; - // leave the rest with 0 - - char *stringdata = new char[name.length() + 1]; - stringdata[name.length()] = '\0'; - - d.data = reinterpret_cast(header); - d.extradata = 0; - d.stringdata = stringdata; - d.superdata = &QDBusAbstractInterface::staticMetaObject; - cached = false; -} -#endif - -///////// -// class QDBusMetaObject - -QDBusMetaObject *QDBusMetaObject::createMetaObject(const QString &interface, const QString &xml, - QHash &cache, - QDBusError &error) -{ - error = QDBusError(); - QDBusIntrospection::Interfaces parsed = QDBusIntrospection::parseInterfaces(xml); - - QDBusMetaObject *we = 0; - QDBusIntrospection::Interfaces::ConstIterator it = parsed.constBegin(); - QDBusIntrospection::Interfaces::ConstIterator end = parsed.constEnd(); - for ( ; it != end; ++it) { - // check if it's in the cache - QDBusMetaObject *obj = cache.value(it.key(), 0); - if (!obj) { - // not in cache; create - obj = new QDBusMetaObject; - QDBusMetaObjectGenerator generator(it.key(), it.value().constData()); - generator.write(obj); - - if ( (obj->cached = !it.key().startsWith( QLatin1String("local.") )) ) - // cache it - cache.insert(it.key(), obj); - - } - - if (it.key() == interface) - // it's us - we = obj; - } - - if (we) - return we; - // still nothing? - - if (parsed.isEmpty()) { - // object didn't return introspection - we = new QDBusMetaObject; - QDBusMetaObjectGenerator generator(interface, 0); - generator.write(we); - we->cached = false; - return we; - } else if (interface.isEmpty()) { - // merge all interfaces - it = parsed.constBegin(); - QDBusIntrospection::Interface merged = *it.value().constData(); - - for (++it; it != end; ++it) { - merged.annotations.unite(it.value()->annotations); - merged.methods.unite(it.value()->methods); - merged.signals_.unite(it.value()->signals_); - merged.properties.unite(it.value()->properties); - } - - merged.name = QLatin1String("local.Merged"); - merged.introspection.clear(); - - we = new QDBusMetaObject; - QDBusMetaObjectGenerator generator(merged.name, &merged); - generator.write(we); - we->cached = false; - return we; - } - - // mark as an error - error = QDBusError(QDBusError::UnknownInterface, - QString( QLatin1String("Interface '%1' was not found") ) - .arg(interface)); - return 0; -} - -QDBusMetaObject::QDBusMetaObject() -{ -} - -inline const QDBusMetaObjectPrivate *priv(const uint* data) -{ - return reinterpret_cast(data); -} - -const char *QDBusMetaObject::dbusNameForMethod(int id) const -{ - //id -= methodOffset(); - if (id >= 0 && id < priv(d.data)->methodCount) { - int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return d.stringdata + d.data[handle]; - } - return 0; -} - -const char *QDBusMetaObject::inputSignatureForMethod(int id) const -{ - //id -= methodOffset(); - if (id >= 0 && id < priv(d.data)->methodCount) { - int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return d.stringdata + d.data[handle + 1]; - } - return 0; -} - -const char *QDBusMetaObject::outputSignatureForMethod(int id) const -{ - //id -= methodOffset(); - if (id >= 0 && id < priv(d.data)->methodCount) { - int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return d.stringdata + d.data[handle + 2]; - } - return 0; -} - -const int *QDBusMetaObject::inputTypesForMethod(int id) const -{ - //id -= methodOffset(); - if (id >= 0 && id < priv(d.data)->methodCount) { - int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return reinterpret_cast(d.data + d.data[handle + 3]); - } - return 0; -} - -const int *QDBusMetaObject::outputTypesForMethod(int id) const -{ - //id -= methodOffset(); - if (id >= 0 && id < priv(d.data)->methodCount) { - int handle = priv(d.data)->methodDBusData + id*intsPerMethod; - return reinterpret_cast(d.data + d.data[handle + 4]); - } - return 0; -} - -int QDBusMetaObject::propertyMetaType(int id) const -{ - //id -= propertyOffset(); - if (id >= 0 && id < priv(d.data)->propertyCount) { - int handle = priv(d.data)->propertyDBusData + id*intsPerProperty; - return d.data[handle + 1]; - } - return 0; -} - -template -static inline void assign_helper(void *ptr, const QVariant &value) -{ - *reinterpret_cast(ptr) = qvariant_cast(value); -} - -void QDBusMetaObject::assign(void *ptr, const QVariant &value) -{ - switch (value.userType()) - { - case QVariant::Bool: - assign_helper(ptr, value); - return; - - case QMetaType::UChar: - assign_helper(ptr, value); - return; - - case QMetaType::Short: - assign_helper(ptr, value); - return; - - case QMetaType::UShort: - assign_helper(ptr, value); - return; - - case QVariant::Int: - assign_helper(ptr, value); - return; - - case QVariant::UInt: - assign_helper(ptr, value); - return; - - case QVariant::LongLong: - assign_helper(ptr, value); - return; - - case QVariant::ULongLong: - assign_helper(ptr, value); - return; - - case QVariant::Double: - assign_helper(ptr, value); - return; - - case QVariant::String: - assign_helper(ptr, value); - return; - - case QVariant::ByteArray: - assign_helper(ptr, value); - return; - - case QVariant::List: - assign_helper(ptr, value); - return; - - case QVariant::Map: - assign_helper(ptr, value); - return; - - default: - ; - } -} - -bool QDBusMetaTypeId::initialized = false; -int QDBusMetaTypeId::variant = 0; -int QDBusMetaTypeId::boollist = 0; -int QDBusMetaTypeId::shortlist = 0; -int QDBusMetaTypeId::ushortlist = 0; -int QDBusMetaTypeId::intlist = 0; -int QDBusMetaTypeId::uintlist = 0; -int QDBusMetaTypeId::longlonglist = 0; -int QDBusMetaTypeId::ulonglonglist = 0; -int QDBusMetaTypeId::doublelist = 0; - -bool QDBusMetaTypeId::innerInitialize() -{ - variant = qRegisterMetaType("QVariant"); - boollist = qRegisterMetaType >("QList"); - shortlist = qRegisterMetaType >("QList"); - ushortlist = qRegisterMetaType >("QList"); - intlist = qRegisterMetaType >("QList"); - uintlist = qRegisterMetaType >("QList"); - longlonglist = qRegisterMetaType >("QList"); - ulonglonglist = qRegisterMetaType >("QList"); - doublelist = qRegisterMetaType >("QList"); - initialized = true; - return true; -} - -int qDBusMetaTypeId(QVariant *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::variant; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::boollist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::shortlist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::ushortlist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::intlist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::uintlist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::longlonglist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::ulonglonglist; } -int qDBusMetaTypeId(QList *) -{ QDBusMetaTypeId::initialize(); return QDBusMetaTypeId::doublelist; } diff --git a/qt/src/qdbusmetaobject_p.h b/qt/src/qdbusmetaobject_p.h deleted file mode 100644 index 746240d1..00000000 --- a/qt/src/qdbusmetaobject_p.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSMETAOBJECTPRIVATE_H -#define QDBUSMETAOBJECTPRIVATE_H - -#include -#include "qdbusmacros.h" - -class QDBusError; - -struct QDBusMetaObjectPrivate; -struct QDBUS_EXPORT QDBusMetaObject: public QMetaObject -{ - bool cached; - - static QDBusMetaObject *createMetaObject(const QString &interface, const QString &xml, - QHash &map, - QDBusError &error); - ~QDBusMetaObject() - { - delete [] d.stringdata; - delete [] d.data; - } - - // methods (slots & signals): - const char *dbusNameForMethod(int id) const; - const char *inputSignatureForMethod(int id) const; - const char *outputSignatureForMethod(int id) const; - const int *inputTypesForMethod(int id) const; - const int *outputTypesForMethod(int id) const; - - // properties: - int propertyMetaType(int id) const; - - // helper function: - static void assign(void *, const QVariant &value); - -private: - QDBusMetaObject(); -}; - -struct QDBusMetaTypeId -{ - static bool innerInitialize(); - static bool initialized; - static inline void initialize() - { - if (initialized) return; - innerInitialize(); - } - - static int variant; - static int boollist; - static int shortlist; - static int ushortlist; - static int intlist; - static int uintlist; - static int longlonglist; - static int ulonglonglist; - static int doublelist; -}; - -#endif diff --git a/qt/src/qdbusmisc.cpp b/qt/src/qdbusmisc.cpp deleted file mode 100644 index 9aaf9f24..00000000 --- a/qt/src/qdbusmisc.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* qdbusmisc.cpp Miscellaneous routines that didn't fit anywhere else - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include - -#include -#include - -#include "qdbusconnection_p.h" -#include "qdbustypehelper_p.h" - -bool qDBusCheckAsyncTag(const char *tag) -{ - if (!tag || !*tag) - return false; - - const char *p = strstr(tag, "async"); - if (p != NULL && - (p == tag || *(p-1) == ' ') && - (p[5] == '\0' || p[5] == ' ')) - return true; - - p = strstr(tag, "Q_ASYNC"); - if (p != NULL && - (p == tag || *(p-1) == ' ') && - (p[7] == '\0' || p[7] == ' ')) - return true; - - return false; -} - -int qDBusNameToTypeId(const char *name) -{ - int id = static_cast( QVariant::nameToType(name) ); - if (id == QVariant::UserType) - id = QMetaType::type(name); - - switch (id) { - case QVariant::Bool: - case QVariant::Int: - case QVariant::UInt: - case QVariant::Char: - case QMetaType::Short: - case QMetaType::UShort: - case QMetaType::UChar: - case QVariant::LongLong: - case QVariant::ULongLong: - case QVariant::Double: - case QVariant::String: - case QVariant::Date: - case QVariant::Time: - case QVariant::DateTime: - case QVariant::Map: - case QVariant::StringList: - case QVariant::ByteArray: - case QVariant::List: - return id; - - default: - if (id == QDBusConnectionPrivate::registerMessageMetaType() || - id == QDBusTypeHelper::id() || - id == QDBusTypeHelper::listId() || - id == QDBusTypeHelper::listId() || - id == QDBusTypeHelper::listId() || - id == QDBusTypeHelper::listId() || - id == QDBusTypeHelper::listId() || - id == QDBusTypeHelper::listId() || - id == QDBusTypeHelper::listId()) - return id; - - return 0; // invalid - } -} - -// calculates the metatypes for the method -// the slot must have the parameters in the following form: -// - zero or more value or const-ref parameters of any kind -// - zero or one const ref of QDBusMessage -// - zero or more non-const ref parameters -// No parameter may be a template. -// this function returns -1 if the parameters don't match the above form -// this function returns the number of *input* parameters, including the QDBusMessage one if any -// this function does not check the return type, so metaTypes[0] is always 0 and always present -// metaTypes.count() >= retval + 1 in all cases -// -// sig must be the normalised signature for the method -int qDBusParametersForMethod(const QMetaMethod &mm, QList& metaTypes) -{ - QList parameterTypes = mm.parameterTypes(); - metaTypes.clear(); - - metaTypes.append(0); // return type - int inputCount = 0; - bool seenMessage = false; - foreach (QByteArray type, parameterTypes) { - if (type.endsWith('*')) { - //qWarning("Could not parse the method '%s'", mm.signature()); - // pointer? - return -1; - } - - if (type.endsWith('&')) { - type.truncate(type.length() - 1); - int id = qDBusNameToTypeId(type); - if (id == 0) { - //qWarning("Could not parse the method '%s'", mm.signature()); - // invalid type in method parameter list - return -1; - } - - metaTypes.append( id ); - seenMessage = true; // it cannot appear anymore anyways - continue; - } - - if (seenMessage) { // && !type.endsWith('&') - //qWarning("Could not parse the method '%s'", mm.signature()); - // non-output parameters after message or after output params - return -1; // not allowed - } - - int id = qDBusNameToTypeId(type); - if (id == 0) { - //qWarning("Could not parse the method '%s'", mm.signature()); - // invalid type in method parameter list - return -1; - } - metaTypes.append(id); - ++inputCount; - - if (id == QDBusConnectionPrivate::registerMessageMetaType()) - seenMessage = true; - } - - return inputCount; -} diff --git a/qt/src/qdbusreply.h b/qt/src/qdbusreply.h deleted file mode 100644 index d7e83122..00000000 --- a/qt/src/qdbusreply.h +++ /dev/null @@ -1,132 +0,0 @@ -/* qdbusreply.h QDBusReply object - a reply from D-Bus - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSREPLY_H -#define QDBUSREPLY_H - -#include -#include - -#include "qdbusmacros.h" -#include "qdbusmessage.h" -#include "qdbuserror.h" - -#include "qdbustypehelper_p.h" - -template -class QDBusReply -{ - typedef T Type; -public: - inline QDBusReply(const QDBusMessage &reply) - : m_data(Type()) - { - *this = reply; - } - inline QDBusReply& operator=(const QDBusMessage& reply) - { - m_error = reply; - if (isSuccess()) - m_data = QDBusTypeHelper::fromVariant(reply.at(0)); - else - m_data = Type(); - return *this; - } - - inline QDBusReply(const QDBusError &dbusError = QDBusError()) - : m_error(dbusError), m_data(Type()) - { - } - inline QDBusReply& operator=(const QDBusError& dbusError) - { - m_error = dbusError; - m_data = Type(); - return *this; - } - - inline QDBusReply& operator=(const QDBusReply& other) - { - m_error = other.m_error; - m_data = other.m_data; - return *this; - } - - inline bool isError() const { return m_error.isValid(); } - inline bool isSuccess() const { return !m_error.isValid(); } - - inline const QDBusError& error() { return m_error; } - - inline Type value() const - { - return m_data; - } - - inline operator Type () const - { - return m_data; - } - - static QDBusReply fromVariant(const QDBusReply &variantReply) - { - QDBusReply retval; - retval.m_error = variantReply.m_error; - if (retval.isSuccess()) { - retval.m_data = qvariant_cast(variantReply.m_data); - if (!qVariantCanConvert(variantReply.m_data)) - retval.m_error = QDBusError(QDBusError::InvalidSignature, - QLatin1String("Unexpected reply signature")); - } - return retval; - } - -private: - QDBusError m_error; - Type m_data; -}; - -# ifndef Q_QDOC -// specialize for void: -template<> -class QDBUS_EXPORT QDBusReply -{ -public: - inline QDBusReply(const QDBusMessage &reply) - : m_error(reply) - { - } - inline QDBusReply(const QDBusError &dbusError) - : m_error(dbusError) - { - } - - inline bool isError() const { return m_error.isValid(); } - inline bool isSuccess() const { return !m_error.isValid(); } - - inline const QDBusError& error() { return m_error; } - -private: - QDBusError m_error; -}; -# endif - -#endif diff --git a/qt/src/qdbusserver.cpp b/qt/src/qdbusserver.cpp deleted file mode 100644 index 4f5b5105..00000000 --- a/qt/src/qdbusserver.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* qdbusserver.cpp - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusserver.h" -#include "qdbusconnection_p.h" - -QDBusServer::QDBusServer(const QString &addr, QObject *p) - : QObject(p) -{ - d = new QDBusConnectionPrivate(this); - - if (addr.isEmpty()) - return; - - d->setServer(dbus_server_listen(addr.toUtf8().constData(), &d->error)); -} - -bool QDBusServer::isConnected() const -{ - return d->server && dbus_server_get_is_connected(d->server); -} - -QDBusError QDBusServer::lastError() const -{ - return d->lastError; -} - -QString QDBusServer::address() const -{ - QString addr; - if (d->server) { - char *c = dbus_server_get_address(d->server); - addr = QString::fromUtf8(c); - dbus_free(c); - } - - return addr; -} - -#include "qdbusserver.moc" diff --git a/qt/src/qdbusserver.h b/qt/src/qdbusserver.h deleted file mode 100644 index 55607860..00000000 --- a/qt/src/qdbusserver.h +++ /dev/null @@ -1,48 +0,0 @@ -/* qdbusserver.h QDBusServer object - * - * Copyright (C) 2005 Harald Fernengel - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef QDBUSSERVER_H -#define QDBUSSERVER_H - -#include "qdbusmacros.h" -#include -#include - -class QDBusConnectionPrivate; -class QDBusError; - -class QDBUS_EXPORT QDBusServer: public QObject -{ - Q_OBJECT -public: - QDBusServer(const QString &address, QObject *parent = 0); - - bool isConnected() const; - QDBusError lastError() const; - QString address() const; - -private: - Q_DISABLE_COPY(QDBusServer) - QDBusConnectionPrivate *d; -}; - -#endif diff --git a/qt/src/qdbusthread.cpp b/qt/src/qdbusthread.cpp deleted file mode 100644 index f45a0096..00000000 --- a/qt/src/qdbusthread.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* qdbusintegrator.cpp QDBusConnection private implementation - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include - -#include - -struct DBusMutex: public QMutex -{ - inline DBusMutex() - : QMutex( QMutex::NonRecursive ) - { } - - static DBusMutex* mutex_new() - { - return new DBusMutex; - } - - static void mutex_free(DBusMutex *mutex) - { - delete mutex; - } - - static dbus_bool_t mutex_lock(DBusMutex *mutex) - { - mutex->lock(); - return true; - } - - static dbus_bool_t mutex_unlock(DBusMutex *mutex) - { - mutex->unlock(); - return true; - } -}; - -struct DBusCondVar: public QWaitCondition -{ - inline DBusCondVar() - { } - - static DBusCondVar* condvar_new() - { - return new DBusCondVar; - } - - static void condvar_free(DBusCondVar *cond) - { - delete cond; - } - - static void condvar_wait(DBusCondVar *cond, DBusMutex *mutex) - { - cond->wait(mutex); - } - - static dbus_bool_t condvar_wait_timeout(DBusCondVar *cond, DBusMutex *mutex, int msec) - { - return cond->wait(mutex, msec); - } - - static void condvar_wake_one(DBusCondVar *cond) - { - cond->wakeOne(); - } - - static void condvar_wake_all(DBusCondVar *cond) - { - cond->wakeAll(); - } -}; - -bool qDBusInitThreads() -{ - static DBusThreadFunctions fcn = { - DBUS_THREAD_FUNCTIONS_ALL_MASK, - DBusMutex::mutex_new, - DBusMutex::mutex_free, - DBusMutex::mutex_lock, - DBusMutex::mutex_unlock, - DBusCondVar::condvar_new, - DBusCondVar::condvar_free, - DBusCondVar::condvar_wait, - DBusCondVar::condvar_wait_timeout, - DBusCondVar::condvar_wake_one, - DBusCondVar::condvar_wake_all, - 0, 0, 0, 0, 0, 0, 0, 0 - }; - - dbus_threads_init(&fcn); - return true; -} - - diff --git a/qt/src/qdbustype.cpp b/qt/src/qdbustype.cpp deleted file mode 100644 index 7f17a372..00000000 --- a/qt/src/qdbustype.cpp +++ /dev/null @@ -1,847 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2005 Thiago Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbustype_p.h" -#include "qdbustypehelper_p.h" -#include - -#include - -class QDBusTypePrivate: public QSharedData -{ -public: - int code; - mutable int qvariantType; - mutable QByteArray signature; - QDBusTypeList subTypes; - - inline QDBusTypePrivate() - : code(0), qvariantType(QVariant::Invalid) - { } -}; - -/*! - \class QDBusType - \brief Represents one single D-Bus type. - \internal - - D-Bus provides a set of primitive types that map to normal, C++ types and to QString, as well as - the possibility to extend the set with the so-called "container" types. The available types are - as follows: - - - Primitive (or basic): integers of 16, 32 and 64 bits, both signed and unsigned; byte (8 bits); - double-precision floating point and Unicode strings - - Arrays: a homogeneous, ordered list of zero or more entries - - Maps: an unordered list of (key, value) pairs, where key must be a primitive type and value - can be any D-Bus type - - Structs: an ordered list of a fixed number of entries of any type - - Variants: a "wildcard" container that can assume the value of any other type, including - structs and arrays - - Any type can be placed inside an array (including other arrays), but only entries of the same - type can be placed inside the same array. The analogous type for D-Bus arrays are the Qt - #QList template classes. - - Structs have a fixed number of entries and each entry has a fixed type. They are analogous to C - and C++ structs (hence the name). - - Maps or dictionaries are analogous to the Qt #QMap template class, with the additional - restriction that the key type must be a primitive one. D-Bus implements maps by using arrays of - a special type (a "dictionary entry"), so inspecting a QDBusType of a Map will reveal that it is - an array (see isArray()). - - Variants contain exactly one entry, but the type can vary freely. It is analogous to the Qt - class #QVariant, but the QtDBus implementation uses #QDBusVariant to represent D-Bus Variants. -*/ - -/*! - Constructs an empty (invalid) type. -*/ -QDBusType::QDBusType() - : d(0) -{ -} - -/*! - Constructs the type based on the D-Bus type given by \a type. -*/ -QDBusType::QDBusType(int type) -{ - char c[2] = { type, 0 }; - *this = QDBusType(c); -} - -/*! - Constructs the type based on the QVariant type given by \a type. - - \sa QVariant::Type -*/ -QDBusType::QDBusType(QVariant::Type type) -{ - const char *sig = dbusSignature(type); - - // it never returns NULL - // but it may return an empty string: - if (sig[0] == '\0') - return; - - if (qstrlen(sig) > 2) { - *this = QDBusType(sig); - } else { - d = new QDBusTypePrivate; - d->qvariantType = type; - d->code = sig[0]; - if (sig[1] == '\0') - // single-letter type - return; - else { - // two-letter type - // must be an array - d->code = sig[0]; - QDBusType t; - t.d = new QDBusTypePrivate; - t.d->code = sig[1]; - d->subTypes << t; - } - } -} - -/*! - Parses the D-Bus signature given by \a signature and constructs the type it represents. -*/ -QDBusType::QDBusType(const char* signature) -{ - if ( !dbus_signature_validate_single(signature, 0) ) - return; - - DBusSignatureIter iter; - dbus_signature_iter_init(&iter, signature); - *this = QDBusType(&iter); - if (d) - d->signature = signature; -} - -/*! - \overload - Parses the D-Bus signature given by \a str and constructs the type it represents. -*/ -QDBusType::QDBusType(const QString& str) -{ - *this = QDBusType( str.toUtf8().constData() ); -} - -/*! - \overload - Parses the D-Bus signature given by \a str and constructs the type it represents. -*/ -QDBusType::QDBusType(const QByteArray& str) -{ - *this = QDBusType( str.constData() ); -} - -/*! - \internal - Creates a QDBusType object based on the current element pointed to by \a iter. -*/ -QDBusType::QDBusType(DBusSignatureIter* iter) - : d(new QDBusTypePrivate) -{ - if ( dbus_type_is_container( d->code = dbus_signature_iter_get_current_type(iter) ) ) { - // we have to recurse - if ( d->code == DBUS_TYPE_VARIANT ) - return; // no we don't. dbus_type_is_container lies to us - - // we have to recurse - DBusSignatureIter subiter; - dbus_signature_iter_recurse(iter, &subiter); - - d->subTypes = QDBusTypeList(&subiter); - - // sanity checking: - if ( d->code == DBUS_TYPE_ARRAY ) - Q_ASSERT_X(d->subTypes.size() == 1, "QDBusType", - "more than one element in array"); - else if (d->code == DBUS_TYPE_DICT_ENTRY ) - Q_ASSERT_X(d->subTypes.size() == 2, "QDBusType", - "maps must have exactly two elements"); - } -} - -/*! - Copies the type from the object \a other. -*/ -QDBusType::QDBusType(const QDBusType& other) - : d(other.d) -{ -} - -/*! - Release the resources associated with this type. -*/ -QDBusType::~QDBusType() -{ -} - -/*! - Copies the type from the object given by \a other. -*/ -QDBusType& QDBusType::operator=(const QDBusType& other) -{ - d = other.d; - return *this; -} - -/*! - Returns the DBus type for this type. -*/ -int QDBusType::dbusType() const -{ - return d ? d->code : DBUS_TYPE_INVALID; -} - -/*! - Returns the DBus signature for this type and subtypes. -*/ -QByteArray QDBusType::dbusSignature() const -{ - if (!d) - return QByteArray(); - - if (!d->signature.isEmpty()) - return d->signature; - - if (d->subTypes.isEmpty()) - return d->signature = QByteArray(1, d->code); - - QByteArray retval; - switch (d->code) { - // can only be array, map or struct - - case DBUS_TYPE_ARRAY: - Q_ASSERT_X(d->subTypes.size() == 1, "QDBusType::dbusSignature", - "more than one element in array"); - - retval += DBUS_TYPE_ARRAY; - retval += d->subTypes.at(0).dbusSignature(); - break; - - case DBUS_TYPE_DICT_ENTRY: { - Q_ASSERT_X(d->subTypes.size() == 2, "QDBusType::dbusSignature", - "maps must have exactly two elements"); - - QByteArray value = d->subTypes.at(1).dbusSignature(); - char key = d->subTypes.at(0).dbusType(); - - Q_ASSERT(key != DBUS_TYPE_INVALID); - Q_ASSERT(!value.isEmpty()); - - retval.reserve(value.length() + 3); - retval = DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING; - retval += key; - retval += value; - retval += DBUS_DICT_ENTRY_END_CHAR; - break; - } - - case DBUS_TYPE_STRUCT: - retval = d->subTypes.dbusSignature(); - retval.prepend(DBUS_STRUCT_BEGIN_CHAR); - retval.append(DBUS_STRUCT_END_CHAR); - break; - - default: - Q_ASSERT_X(false, "QDBusType::dbusSignature", "invalid container type"); - } - - d->signature = retval; - return retval; -} - -/*! - Returns the QVariant::Type for this entry. -*/ -int QDBusType::qvariantType() const -{ - if (d && d->qvariantType != QVariant::Invalid) - return d->qvariantType; - - if (!d) - return QVariant::Invalid; - - return d->qvariantType = qvariantType(dbusSignature().constData()); -} - -/*! - Returns true if this type is a valid one. -*/ -bool QDBusType::isValid() const -{ - return d && d->code != DBUS_TYPE_INVALID; -} - -/*! - Returns true if this type is a basic one. -*/ -bool QDBusType::isBasic() const -{ - return d && dbus_type_is_basic(d->code); -} - -/*! - Returns true if this type is a container. -*/ -bool QDBusType::isContainer() const -{ - return d && dbus_type_is_container(d->code); -} - -/*! - Returns the subtypes of this type, if this is a container. - - \sa isContainer() -*/ -QDBusTypeList QDBusType::subTypes() const -{ - if (d) - return d->subTypes; - return QDBusTypeList(); -} - -/*! - Returns true if this type is an array. - - \sa isContainer(), arrayElement() -*/ -bool QDBusType::isArray() const -{ - return dbusType() == DBUS_TYPE_ARRAY; -} - -/*! - This is a convenience function that returns the element type of an array. - If this object is not an array, it returns an invalid QDBusType. - - \sa isArray() -*/ -QDBusType QDBusType::arrayElement() const -{ - if (isArray() && d->subTypes.count() == 1) - return d->subTypes.first(); - return QDBusType(); -} - -/*! - Returns true if this type is a map (i.e., an array of dictionary entries). - - \sa isContainer(), isArray(), arrayElement() -*/ -bool QDBusType::isMap() const -{ - return arrayElement().dbusType() == DBUS_TYPE_DICT_ENTRY; -} - -/*! - If this object is a map, returns the (basic) type that corresponds to the key type. - If this object is not a map, returns an invalid QDBusType. - - \sa isMap() -*/ -QDBusType QDBusType::mapKey() const -{ - if (isMap()) - return arrayElement().d->subTypes.first(); - return QDBusType(); -} - -/*! - If this object is a map, returns the type that corresponds to the value type. - If this object is not a map, returns an invalid QDBusType. - - \sa isMap() -*/ -QDBusType QDBusType::mapValue() const -{ - if (isMap()) - return arrayElement().d->subTypes.at(1); - return QDBusType(); -} - -/*! - Returns true if this type is the same one as \a other. -*/ -bool QDBusType::operator==(const QDBusType& other) const -{ - if (!d && !other.d) - return true; - if (!d || !other.d) - return false; - return d->code == other.d->code && d->subTypes == other.d->subTypes; -} - -/*! - \fn QDBusType::operator!=(const QDBusType &other) const - Returns true if the this type and the one given by \a other are different. -*/ - -/*! - Converts the DBus type code \a type to QVariant::Type. -*/ -int QDBusType::qvariantType(int type) -{ - char c[2] = { type, 0 }; - return qvariantType(c); -} - -/*! - Converts the DBus type signature \a signature to QVariant::Type. -*/ -int QDBusType::qvariantType(const char* signature) -{ - if (!signature) - return QVariant::Invalid; - - // three special cases that don't validate as single: - if (qstrlen(signature) == 1) { - if (signature[0] == DBUS_TYPE_STRUCT) - return QVariant::List; - else if (signature[0] == DBUS_TYPE_DICT_ENTRY) - return QVariant::Map; - else if (signature[0] == DBUS_TYPE_ARRAY) - return QVariant::List; - } - - // now we can validate - if ( !dbus_signature_validate_single(signature, 0) ) - return QVariant::Invalid; - - switch (signature[0]) - { - case DBUS_TYPE_BOOLEAN: - return QVariant::Bool; - - case DBUS_TYPE_BYTE: - return QMetaType::UChar; - - case DBUS_TYPE_INT16: - return QMetaType::Short; - - case DBUS_TYPE_UINT16: - return QMetaType::UShort; - - case DBUS_TYPE_INT32: - return QVariant::Int; - - case DBUS_TYPE_UINT32: - return QVariant::UInt; - - case DBUS_TYPE_INT64: - return QVariant::LongLong; - - case DBUS_TYPE_UINT64: - return QVariant::ULongLong; - - case DBUS_TYPE_DOUBLE: - return QVariant::Double; - - case DBUS_TYPE_STRING: - case DBUS_TYPE_OBJECT_PATH: - case DBUS_TYPE_SIGNATURE: - return QVariant::String; - - case DBUS_STRUCT_BEGIN_CHAR: - return QVariant::List; // change to QDBusStruct in the future - - case DBUS_TYPE_VARIANT: - return QDBusTypeHelper::id(); - - case DBUS_TYPE_ARRAY: // special case - switch (signature[1]) { - case DBUS_TYPE_BOOLEAN: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_BYTE: - return QVariant::ByteArray; - - case DBUS_TYPE_INT16: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_UINT16: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_INT32: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_UINT32: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_INT64: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_UINT64: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_DOUBLE: - return QDBusTypeHelper::listId(); - - case DBUS_TYPE_STRING: - case DBUS_TYPE_OBJECT_PATH: - case DBUS_TYPE_SIGNATURE: - return QVariant::StringList; - - case DBUS_TYPE_VARIANT: - return QVariant::List; - - case DBUS_DICT_ENTRY_BEGIN_CHAR: - return QVariant::Map; - - default: - return QVariant::List; - } - default: - return QVariant::Invalid; - - } -} - -/*! - Converts the QVariant::Type \a t to a DBus type code. -*/ -int QDBusType::dbusType(QVariant::Type t) -{ - switch (t) - { - case QVariant::Bool: - return DBUS_TYPE_BOOLEAN; - - case QVariant::Int: - return DBUS_TYPE_INT32; - - case QVariant::UInt: - return DBUS_TYPE_UINT32; - - case QVariant::LongLong: - return DBUS_TYPE_INT64; - - case QVariant::ULongLong: - return DBUS_TYPE_UINT64; - - case QVariant::Double: - return DBUS_TYPE_DOUBLE; - - // from QMetaType: - case QMetaType::Short: - return DBUS_TYPE_INT16; - - case QMetaType::UShort: - return DBUS_TYPE_UINT16; - - case QMetaType::UChar: - return DBUS_TYPE_BYTE; - - case QVariant::String: - return DBUS_TYPE_STRING; - - case QVariant::Map: - // internal type information has been lost - return DBUS_TYPE_DICT_ENTRY; - - case QVariant::List: - case QVariant::StringList: - case QVariant::ByteArray: - // could also be a struct... - return DBUS_TYPE_ARRAY; - - case QVariant::UserType: - return DBUS_TYPE_INVALID; // invalid - - default: - break; // avoid compiler warnings - } - - if (int(t) == QDBusTypeHelper::id()) - return DBUS_TYPE_VARIANT; - - return DBUS_TYPE_INVALID; -} - -/*! - Converts the QVariant::Type \a t to a DBus type signature. -*/ -const char* QDBusType::dbusSignature(QVariant::Type t) -{ - switch (t) - { - case QVariant::Bool: - return DBUS_TYPE_BOOLEAN_AS_STRING; - - case QVariant::Int: - return DBUS_TYPE_INT32_AS_STRING; - - case QVariant::UInt: - return DBUS_TYPE_UINT32_AS_STRING; - - case QMetaType::Short: - return DBUS_TYPE_INT16_AS_STRING; - - case QMetaType::UShort: - return DBUS_TYPE_UINT16_AS_STRING; - - case QMetaType::UChar: - return DBUS_TYPE_BYTE_AS_STRING; - - case QVariant::LongLong: - return DBUS_TYPE_INT64_AS_STRING; - - case QVariant::ULongLong: - return DBUS_TYPE_UINT64_AS_STRING; - - case QVariant::Double: - return DBUS_TYPE_DOUBLE_AS_STRING; - - case QVariant::String: - return DBUS_TYPE_STRING_AS_STRING; - - case QVariant::Map: - // internal type information has been lost - return DBUS_TYPE_ARRAY_AS_STRING - DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING - DBUS_TYPE_STRING_AS_STRING - DBUS_TYPE_VARIANT_AS_STRING - DBUS_DICT_ENTRY_END_CHAR_AS_STRING; // a{sv} - - case QVariant::StringList: - return DBUS_TYPE_ARRAY_AS_STRING - DBUS_TYPE_STRING_AS_STRING; // as - - case QVariant::ByteArray: - return DBUS_TYPE_ARRAY_AS_STRING - DBUS_TYPE_BYTE_AS_STRING; // ay - - case QVariant::List: - // not a string list - // internal list data has been lost - // could also be a struct... - return DBUS_TYPE_ARRAY_AS_STRING - DBUS_TYPE_VARIANT_AS_STRING; // av - - default: - if (int(t) == QDBusTypeHelper::id()) - return DBUS_TYPE_VARIANT_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BOOLEAN_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_INT16_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_UINT16_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_INT32_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_UINT32_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_INT64_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_UINT64_AS_STRING; - if (int(t) == QDBusTypeHelper::listId()) - return DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_DOUBLE_AS_STRING; - - return DBUS_TYPE_INVALID_AS_STRING; - } -} - -/*! - \enum QDBusType::VariantListMode - Defines how the guessFromVariant() function will behave when the QVariant is of type - QVariant::List. -*/ - -/*! - Guesses the DBus type from the given \a variant. -*/ -QDBusType QDBusType::guessFromVariant(const QVariant& variant, VariantListMode mode) -{ - if (variant.type() == QVariant::List) { - // investigate deeper - QDBusType t; - t.d = new QDBusTypePrivate; - const QVariantList list = variant.toList(); - - t.d->code = DBUS_TYPE_ARRAY; - if (!list.isEmpty()) { - // check if all elements have the same type - QVariant::Type type = list.first().type(); - foreach (const QVariant& v, list) - if (type != v.type()) { - // at least one is different - type = QVariant::Invalid; - break; - } - - if (type != QVariant::Invalid) { - // all are of the same type - t.d->subTypes << guessFromVariant(list.first()); - return t; - } - } else { - // an array of "something" - t.d->subTypes << QDBusType('v'); - return t; - } - - // treat it as a struct - t.d->code = DBUS_TYPE_STRUCT; - foreach (const QVariant& v, list) - t.d->subTypes << guessFromVariant(v, mode); - - return t; - } - else if (variant.type() == QVariant::Map) { - // investigate deeper - QDBusType t, t2, t3; - t2.d = new QDBusTypePrivate; - t2.d->code = DBUS_TYPE_DICT_ENTRY; - - // the key - t3.d = new QDBusTypePrivate; - t3.d->code = DBUS_TYPE_STRING; - t2.d->subTypes << t3; - - const QVariantMap map = variant.toMap(); - if (!map.isEmpty()) { - // check if all elements have the same type - QVariantMap::const_iterator it = map.constBegin(), - end = map.constEnd(); - QVariant::Type type = it.value().type(); - for ( ; it != end; ++it) - if (type != it.value().type()) { - // at least one is different - type = QVariant::Invalid; - break; - } - - if (type != QVariant::Invalid) - t2.d->subTypes << guessFromVariant(map.constBegin().value()); - else { - // multiple types - t3.d->code = DBUS_TYPE_VARIANT; - t2.d->subTypes << t3; - } - } - else { - // information lost - t3.d->code = DBUS_TYPE_VARIANT; - t2.d->subTypes << t3; - } - - t.d = new QDBusTypePrivate; - t.d->code = DBUS_TYPE_ARRAY; - t.d->subTypes << t2; - return t; - } - else - return QDBusType( QVariant::Type( variant.userType() ) ); -} - -/*! - \class QDBusTypeList - \brief A list of DBus types. - \internal - - Represents zero or more DBus types in sequence, such as those used in argument lists - or in subtypes of structs and maps. -*/ - -/*! - \fn QDBusTypeList::QDBusTypeList() - - Default constructor. - */ - -/*! - \fn QDBusTypeList::QDBusTypeList(const QDBusTypeList& other) - - Copy constructor: copies the type list from \a other. -*/ - -/*! - \fn QDBusTypeList::QDBusTypeList(const QList& other) - - Copy constructor: copies the type list from \a other. -*/ - -/*! - Constructs a type list by parsing the given \a signature. -*/ -QDBusTypeList::QDBusTypeList(const char* signature) -{ - if (!signature || !*signature) - return; // empty - - // validate it first - if ( !dbus_signature_validate(signature, 0) ) - return; - - // split it into components - DBusSignatureIter iter; - dbus_signature_iter_init(&iter, signature); - - do { - *this << QDBusType(&iter); - } while (dbus_signature_iter_next(&iter)); -} - -/*! - \internal - Constructs a type list by parsing the elements on this iterator level. -*/ -QDBusTypeList::QDBusTypeList(DBusSignatureIter* iter) -{ - do { - QDBusType item(iter); - if (!item.isValid()) { - clear(); - return; - } - - *this << item; - } while (dbus_signature_iter_next(iter)); -} - -/*! - Returns true if this type list can represent the inner components of a map. -*/ -bool QDBusTypeList::canBeMap() const -{ - return size() == 2 && at(0).isBasic(); -} - -/*! - Reconstructs the type signature that this type list represents. -*/ -QByteArray QDBusTypeList::dbusSignature() const -{ - QByteArray retval; - foreach (QDBusType t, *this) - retval += t.dbusSignature(); - return retval; -} diff --git a/qt/src/qdbustype_p.h b/qt/src/qdbustype_p.h deleted file mode 100644 index b719960e..00000000 --- a/qt/src/qdbustype_p.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2005 Thiago Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSTYPE_H -#define QDBUSTYPE_H - -#include -#include -#include -#include -#include "qdbusmacros.h" -#include - -// forward declaration -class QDBusTypeList; - -class QDBusTypePrivate; -class QDBUS_EXPORT QDBusType -{ -public: - QDBusType(); - explicit QDBusType(int type); - explicit QDBusType(QVariant::Type type); - explicit QDBusType(const char* signature); - explicit QDBusType(DBusSignatureIter*); - explicit QDBusType(const QString& str); - explicit QDBusType(const QByteArray& str); - QDBusType(const QDBusType& other); - - ~QDBusType(); - - QDBusType& operator=(const QDBusType& other); - - int qvariantType() const; - - int dbusType() const; - QByteArray dbusSignature() const; - bool isValid() const; - bool isBasic() const; - bool isContainer() const; - - QDBusTypeList subTypes() const; - - bool isArray() const; - QDBusType arrayElement() const; - - bool isMap() const; - QDBusType mapKey() const; - QDBusType mapValue() const; - - bool operator==(const QDBusType& other) const; - inline bool operator!=(const QDBusType &other) const - { return !(*this == other); } - - static int qvariantType(int type); - static int qvariantType(const char* signature); - static int dbusType(QVariant::Type); - static const char* dbusSignature(QVariant::Type); - - enum VariantListMode { - ListIsArray, - ListIsStruct - }; - static QDBusType guessFromVariant(const QVariant &variant, VariantListMode = ListIsArray); - -private: - QSharedDataPointer d; -}; - -class QDBUS_EXPORT QDBusTypeList: public QList -{ -public: - inline QDBusTypeList() { } - inline QDBusTypeList(const QDBusTypeList& other) - : QList(other) - { } - inline QDBusTypeList(const QList& other) - : QList(other) - { } - QDBusTypeList(const char* signature); - QDBusTypeList(DBusSignatureIter*); - - bool canBeMap() const; - - QByteArray dbusSignature() const; -}; - -#endif // QDBUSTYPE_H diff --git a/qt/src/qdbustypehelper_p.h b/qt/src/qdbustypehelper_p.h deleted file mode 100644 index 7ebd7f3e..00000000 --- a/qt/src/qdbustypehelper_p.h +++ /dev/null @@ -1,231 +0,0 @@ -/* qdbuslisthelper_p.h Helper class to convert to and from QVariantList - * - * Copyright (C) 2005 Harald Fernengel - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the public API. This header file may -// change from version to version without notice, or even be -// removed. -// -// We mean it. -// -// - -#ifndef QDBUSTYPEHELPERPRIVATE_H -#define QDBUSTYPEHELPERPRIVATE_H - -#include -#include -#include - -// we're going to support all D-Bus primitive types here: -// uchar -- not needed: QByteArray -// bool -// short -// ushort -// int -// uint -// qlonglong -// qulonglong -// double -// QString -- not needed: QStringList -// QList -- not possible: will use QVariant -// QVariant -// QDBusStruct -- not yet existant -// QMap -- not possible: will use QVariant - -inline QDBUS_EXPORT int qDBusMetaTypeId(bool *) { return QVariant::Bool; } -inline QDBUS_EXPORT int qDBusMetaTypeId(uchar *) { return QMetaType::UChar; } -inline QDBUS_EXPORT int qDBusMetaTypeId(short *) { return QMetaType::Short; } -inline QDBUS_EXPORT int qDBusMetaTypeId(ushort *) { return QMetaType::UShort; } -inline QDBUS_EXPORT int qDBusMetaTypeId(int *) { return QVariant::Int; } -inline QDBUS_EXPORT int qDBusMetaTypeId(uint *) { return QVariant::UInt; } -inline QDBUS_EXPORT int qDBusMetaTypeId(qlonglong *) { return QVariant::LongLong; } -inline QDBUS_EXPORT int qDBusMetaTypeId(qulonglong *) { return QVariant::ULongLong; } -inline QDBUS_EXPORT int qDBusMetaTypeId(double *) { return QVariant::Double; } -inline QDBUS_EXPORT int qDBusMetaTypeId(QString *) { return QVariant::String; } -QDBUS_EXPORT int qDBusMetaTypeId(QVariant *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -inline QDBUS_EXPORT int qDBusMetaTypeId(QByteArray *) { return QVariant::ByteArray; } -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -QDBUS_EXPORT int qDBusMetaTypeId(QList *); -inline QDBUS_EXPORT int qDBusMetaTypeId(QStringList *) { return QVariant::StringList; } -inline QDBUS_EXPORT int qDBusMetaTypeId(QVariantList *) { return QVariant::List; } -inline QDBUS_EXPORT int qDBusMetaTypeId(QVariantMap *) { return QVariant::Map; } - -// implement the copy mechanism -template -struct QDBusTypeHelper -{ - typedef T Type; - typedef QList List; - - static inline int id() - { - Type* t = 0; - return qDBusMetaTypeId(t); - } - - static inline int listId() - { - List *l = 0; - return qDBusMetaTypeId(l); - } - - static inline QVariant toVariant(const Type &t) - { - return QVariant(id(), &t); - } - - static bool canSpecialConvert(const QVariant &); - static Type specialConvert(const QVariant &); - - static inline Type fromVariant(const QVariant &v) - { - if (canSpecialConvert(v)) - return specialConvert(v); - - QVariant copy(v); - if (copy.convert( QVariant::Type(id()) )) - return *reinterpret_cast(copy.constData()); - return Type(); - } - - static inline QVariantList toVariantList(const List list) - { - QVariantList tmp; - Q_FOREACH (const Type &t, list) - tmp.append(toVariant(t)); - return tmp; - } - - static inline QVariantList toVariantList(const QVariant &v) - { - return toVariantList(QDBusTypeHelper::fromVariant(v)); - } - - static inline List fromVariantList(const QVariantList list) - { - List tmp; - Q_FOREACH (const QVariant &v, list) - tmp.append(fromVariant(v)); - return tmp; - } -}; - -template<> -struct QDBusTypeHelper -{ - static inline int id() - { - QVariant *t = 0; - return qDBusMetaTypeId(t); - } - - static inline int listId() - { - return QVariant::List; - } - - static inline QVariant toVariant(const QVariant &t) - { - return QVariant(id(), &t); - } - - static inline QVariant fromVariant(const QVariant &v) - { - if (v.userType() == id()) - return *reinterpret_cast(v.constData()); - return v; - } - - static inline QVariantList toVariantList(const QVariantList &list) - { - return list; - } - - static inline QVariantList fromVariantList(const QVariantList &list) - { - return list; - } -}; - -#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_NO_CAST_TO_ASCII) -template<> -struct QDBusTypeHelper -{ - static inline int id() - { return QVariant::String; } - - static inline QVariant toVariant(const char *t) - { return QVariant(t); } - - static inline QByteArray fromVariant(const QVariant &v) - { return v.toString().toAscii(); } -}; - -template<> -struct QDBusTypeHelper -{ - static inline int id() - { return QVariant::String; } - - static inline QVariant toVariant(const char *t) - { return QVariant(t); } - - static inline QByteArray fromVariant(const QVariant &v) - { return v.toString().toAscii(); } -}; -#endif - -// support three exceptions: uchar, short and ushort -// we have to do this as long as QVariant can't convert to/from the integer metatypes -template<> inline bool QDBusTypeHelper::canSpecialConvert(const QVariant &v) -{ return v.userType() < int(QVariant::UserType); } -template<> inline short QDBusTypeHelper::specialConvert(const QVariant &v) -{ return v.toInt(); } - -template<> inline bool QDBusTypeHelper::canSpecialConvert(const QVariant &v) -{ return v.userType() < int(QVariant::UserType); } -template<> inline ushort QDBusTypeHelper::specialConvert(const QVariant &v) -{ return v.toUInt(); } - -template<> inline bool QDBusTypeHelper::canSpecialConvert(const QVariant &v) -{ return v.userType() < int(QVariant::UserType); } -template<> inline uchar QDBusTypeHelper::specialConvert(const QVariant &v) -{ return v.toUInt(); } - -template inline bool QDBusTypeHelper::canSpecialConvert(const QVariant &) -{ return false; } -template inline T QDBusTypeHelper::specialConvert(const QVariant &) -{ return T(); } - -#endif diff --git a/qt/src/qdbusutil.cpp b/qt/src/qdbusutil.cpp deleted file mode 100644 index 22ce3a81..00000000 --- a/qt/src/qdbusutil.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusutil.h" - -#include - -#include -#include - -#include "qdbustype_p.h" - -/*! - \namespace QDBusUtil - The QDBusUtil namespace contains a few functions that are of general use when dealing with D-Bus - strings. -*/ -namespace QDBusUtil -{ - /*! - \fn QDBusUtil::isValidInterfaceName(const QString &ifaceName) - Returns true if this is \a ifaceName is a valid interface name. - - Valid interface names must: - - not be empty - - not exceed 255 characters in length - - be composed of dot-separated string components that contain only ASCII letters, digits - and the underscore ("_") character - - contain at least two such components - */ - bool isValidInterfaceName(const QString& ifaceName) - { - if (ifaceName.isEmpty() || ifaceName.length() > DBUS_MAXIMUM_NAME_LENGTH) - return false; - - QStringList parts = ifaceName.split(QLatin1Char('.')); - if (parts.count() < 2) - return false; // at least two parts - - foreach (QString part, parts) - if (!isValidMemberName(part)) - return false; - - return true; - } - - /*! - \fn QDBusUtil::isValidUniqueConnectionName(const QString &connName) - Returns true if \a connName is a valid unique connection name. - - Unique connection names start with a colon (":") and are followed by a list of dot-separated - components composed of ASCII letters, digits, the hypen or the underscore ("_") character. - */ - bool isValidUniqueConnectionName(const QString &connName) - { - if (connName.isEmpty() || connName.length() > DBUS_MAXIMUM_NAME_LENGTH || - !connName.startsWith(QLatin1Char(':'))) - return false; - - QStringList parts = connName.mid(1).split(QLatin1Char('.')); - if (parts.count() < 1) - return false; - - QRegExp regex(QLatin1String("[a-zA-Z0-9_-]+")); - foreach (QString part, parts) - if (!regex.exactMatch(part)) - return false; - - return true; - } - - /*! - \fn QDBusUtil::isValidBusName(const QString &busName) - Returns true if \a busName is a valid bus name. - - A valid bus name is either a valid unique connection name or follows the rules: - - is not empty - - does not exceed 255 characters in length - - be composed of dot-separated string components that contain only ASCII letters, digits, - hyphens or underscores ("_"), but don't start with a digit - - contains at least two such elements - - \sa isValidUniqueConnectionName() - */ - bool isValidBusName(const QString &busName) - { - if (busName.isEmpty() || busName.length() > DBUS_MAXIMUM_NAME_LENGTH) - return false; - - if (busName.startsWith(QLatin1Char(':'))) - return isValidUniqueConnectionName(busName); - - QStringList parts = busName.split(QLatin1Char('.')); - if (parts.count() < 1) - return false; - - QRegExp regex(QLatin1String("[a-zA-Z_-][a-zA-Z0-9_-]*")); - foreach (QString part, parts) - if (!regex.exactMatch(part)) - return false; - - return true; - } - - /*! - \fn QDBusUtil::isValidMemberName(const QString &memberName) - Returns true if \a memberName is a valid member name. A valid member name does not exceed - 255 characters in length, is not empty, is composed only of ASCII letters, digits and - underscores, but does not start with a digit. - */ - bool isValidMemberName(const QString &memberName) - { - if (memberName.isEmpty() || memberName.length() > DBUS_MAXIMUM_NAME_LENGTH) - return false; - - QRegExp regex(QLatin1String("[a-zA-Z_][a-zA-Z0-9_]*")); - return regex.exactMatch(memberName); - } - - /*! - \fn QDBusUtil::isValidErrorName(const QString &errorName) - Returns true if \a errorName is a valid error name. Valid error names are valid interface - names and vice-versa, so this function is actually an alias for isValidInterfaceName. - */ - bool isValidErrorName(const QString &errorName) - { - return isValidInterfaceName(errorName); - } - - /*! - \fn QDBusUtil::isValidObjectPath(const QString &path) - Returns true if \a path is valid object path. - - Valid object paths follow the rules: - - start with the slash character ("/") - - do not end in a slash, unless the path is just the initial slash - - do not contain any two slashes in sequence - - contain slash-separated parts, each of which is composed of ASCII letters, digits and - underscores ("_") - */ - bool isValidObjectPath(const QString &path) - { - if (path == QLatin1String("/")) - return true; - - if (!path.startsWith(QLatin1Char('/')) || path.indexOf(QLatin1String("//")) != -1 || - path.endsWith(QLatin1Char('/'))) - return false; - - QStringList parts = path.split(QLatin1Char('/')); - Q_ASSERT(parts.count() >= 1); - parts.removeFirst(); // it starts with /, so we get an empty first part - - QRegExp regex(QLatin1String("[a-zA-Z0-9_]+")); - foreach (QString part, parts) - if (!regex.exactMatch(part)) - return false; - - return true; - } - - /*! - \fn QDBusUtil::isValidSignature(const QString &signature) - Returns true if \a signature is a valid D-Bus type signature for one or more types. - This function returns true if it can all of \a signature into valid, individual types and no - characters remain in \a signature. - - \sa isValidSingleSignature() - */ - bool isValidSignature(const QString &signature) - { - return dbus_signature_validate(signature.toUtf8(), 0); - } - - /*! - \fn QDBusUtil::isValidSingleSignature(const QString &signature) - Returns true if \a signature is a valid D-Bus type signature for exactly one full type. This - function tries to convert the type signature into a D-Bus type and, if it succeeds and no - characters remain in the signature, it returns true. - */ - bool isValidSingleSignature(const QString &signature) - { - return dbus_signature_validate_single(signature.toUtf8(), 0); - } - - /*! - \fn QDBusUtil::signatureToType(const QString &signature) - Returns the Qt meta type id for the given D-Bus signature for exactly one full type, given - by \a signature. - - \sa isValidSingleSignature(), typeToSignature(), QVariant::type(), QVariant::userType() - */ - QVariant::Type signatureToType(const QString &signature) - { - return QVariant::Type( QDBusType::qvariantType(signature.toLatin1().constData()) ); - } - - /*! - \fn QDBusUtil::typeToSignature(QVariant::Type type) - Returns the D-Bus signature equivalent to the supplied meta type id \a type. - - \sa isValidSingleSignature(), signatureToType(), QVariant::type(), QVariant::userType() - */ - const char *typeToSignature(QVariant::Type type) - { - return QDBusType::dbusSignature( type ); - } - -} // namespace QDBusUtil diff --git a/qt/src/qdbusutil.h b/qt/src/qdbusutil.h deleted file mode 100644 index dd2b4df9..00000000 --- a/qt/src/qdbusutil.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSUTIL_H -#define QDBUSUTIL_H - -#include -#include - -#include "qdbusmacros.h" - -namespace QDBusUtil -{ - QDBUS_EXPORT bool isValidInterfaceName(const QString &ifaceName); - - QDBUS_EXPORT bool isValidUniqueConnectionName(const QString &busName); - - QDBUS_EXPORT bool isValidBusName(const QString &busName); - - QDBUS_EXPORT bool isValidMemberName(const QString &memberName); - - QDBUS_EXPORT bool isValidErrorName(const QString &errorName); - - QDBUS_EXPORT bool isValidObjectPath(const QString &path); - - QDBUS_EXPORT bool isValidSignature(const QString &signature); - - QDBUS_EXPORT bool isValidSingleSignature(const QString &signature); - - QDBUS_EXPORT QVariant::Type signatureToType(const QString &signature); - - QDBUS_EXPORT const char *typeToSignature(QVariant::Type type); -} - -#endif diff --git a/qt/src/qdbusxmlgenerator.cpp b/qt/src/qdbusxmlgenerator.cpp deleted file mode 100644 index 135b8d1c..00000000 --- a/qt/src/qdbusxmlgenerator.cpp +++ /dev/null @@ -1,200 +0,0 @@ -/* -*- mode: C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include - -#include "qdbusinterface_p.h" // for ANNOTATION_NO_WAIT -#include "qdbusabstractadaptor_p.h" // for QCLASSINFO_DBUS_* -#include "qdbusconnection_p.h" // for the flags -#include "qdbusutil.h" - -extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, - const QMetaObject *base, int flags); - -// implement the D-Bus org.freedesktop.DBus.Introspectable interface -// we do that by analysing the metaObject of all the adaptor interfaces - -static QString generateInterfaceXml(const QMetaObject *mo, int flags, int methodOffset, int propOffset) -{ - QString retval; - - // start with properties: - if (flags & QDBusConnection::ExportProperties) { - for (int i = propOffset; i < mo->propertyCount(); ++i) { - static const char *accessvalues[] = {0, "read", "write", "readwrite"}; - - QMetaProperty mp = mo->property(i); - - if (!mp.isScriptable() && (flags & QDBusConnection::ExportAllProperties) != - QDBusConnection::ExportAllProperties) - continue; - - int access = 0; - if (mp.isReadable()) - access |= 1; - if (mp.isWritable()) - access |= 2; - - int typeId = qDBusNameToTypeId(mp.typeName()); - if (!typeId) - continue; - - retval += QString(QLatin1String(" \n")) - .arg(QLatin1String(mp.name())) - .arg(QLatin1String( QDBusUtil::typeToSignature( QVariant::Type(typeId) ))) - .arg(QLatin1String( accessvalues[access] )); - } - } - - // now add methods: - for (int i = methodOffset; i < mo->methodCount(); ++i) { - QMetaMethod mm = mo->method(i); - QByteArray signature = mm.signature(); - int paren = signature.indexOf('('); - - bool isSignal; - if (mm.methodType() == QMetaMethod::Signal) - // adding a signal - isSignal = true; - else if (mm.methodType() == QMetaMethod::Slot && mm.access() == QMetaMethod::Public) - isSignal = false; - else - continue; // neither signal nor public slot - - if ((isSignal && !(flags & QDBusConnection::ExportSignals)) || - (!isSignal && !(flags & QDBusConnection::ExportSlots))) - continue; - - QString xml = QString(QLatin1String(" <%1 name=\"%2\">\n")) - .arg(isSignal ? QLatin1String("signal") : QLatin1String("method")) - .arg(QLatin1String(signature.left(paren))); - - // check the return type first - int typeId = qDBusNameToTypeId(mm.typeName()); - if (typeId) - xml += QString(QLatin1String(" \n")) - .arg(QLatin1String(QDBusUtil::typeToSignature( QVariant::Type(typeId) ))); - else if (*mm.typeName()) - continue; // wasn't a valid type - - QList names = mm.parameterNames(); - QList types; - int inputCount = qDBusParametersForMethod(mm, types); - if (inputCount == -1) - continue; // invalid form - if (isSignal && inputCount + 1 != types.count()) - continue; // signal with output arguments? - if (isSignal && types.at(inputCount) == QDBusConnectionPrivate::messageMetaType) - continue; // signal with QDBusMessage argument? - - int j; - bool isScriptable = mm.attributes() & QMetaMethod::Scriptable; - for (j = 1; j < types.count(); ++j) { - // input parameter for a slot or output for a signal - if (types.at(j) == QDBusConnectionPrivate::messageMetaType) { - isScriptable = true; - continue; - } - - QString name; - if (!names.at(j - 1).isEmpty()) - name = QString(QLatin1String("name=\"%1\" ")).arg(QLatin1String(names.at(j - 1))); - - bool isOutput = isSignal || j > inputCount; - - xml += QString(QLatin1String(" \n")) - .arg(name) - .arg(QLatin1String(QDBusUtil::typeToSignature( QVariant::Type(types.at(j)) ))) - .arg(isOutput ? QLatin1String("out") : QLatin1String("in")); - } - - if (!isScriptable) { - // check if this was added by other means - if (isSignal && (flags & QDBusConnection::ExportAllSignals) != QDBusConnection::ExportAllSignals) - continue; - if (!isSignal && (flags & QDBusConnection::ExportAllSlots) != QDBusConnection::ExportAllSlots) - continue; - } - - if (qDBusCheckAsyncTag(mm.tag())) - // add the no-reply annotation - xml += QLatin1String(" \n"); - - retval += xml; - retval += QString(QLatin1String(" \n")) - .arg(isSignal ? QLatin1String("signal") : QLatin1String("method")); - } - - return retval; -} - -QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, const QMetaObject *base, - int flags) -{ - if (interface.isEmpty()) { - // generate the interface name from the meta object - int idx = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTERFACE); - if (idx >= mo->classInfoOffset()) { - interface = QLatin1String(mo->classInfo(idx).value()); - } else { - interface = QLatin1String(mo->className()); - interface.replace(QLatin1String("::"), QLatin1String(".")); - - if (interface.startsWith( QLatin1String("QDBus") )) { - interface.prepend( QLatin1String("com.trolltech.QtDBus.") ); - } else if (interface.startsWith( QLatin1Char('Q') ) && - interface.length() >= 2 && interface.at(1).isUpper()) { - // assume it's Qt - interface.prepend( QLatin1String("com.trolltech.Qt.") ); - } else if (!QCoreApplication::instance() || - QCoreApplication::instance()->applicationName().isEmpty()) { - interface.prepend( QLatin1String("local.") ); - } else { - interface.prepend(QLatin1Char('.')).prepend( QCoreApplication::instance()->applicationName() ); - QStringList domainName = - QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'), - QString::SkipEmptyParts); - if (domainName.isEmpty()) - interface.prepend("local."); - else - foreach (const QString &part, domainName) - interface.prepend(QLatin1Char('.')).prepend(part); - } - } - } - - QString xml; - int idx = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTROSPECTION); - if (idx >= mo->classInfoOffset()) - return QString::fromUtf8(mo->classInfo(idx).value()); - else - xml = generateInterfaceXml(mo, flags, base->methodCount(), base->propertyCount()); - - if (xml.isEmpty()) - return QString(); // don't add an empty interface - return QString(QLatin1String(" \n%2 \n")) - .arg(interface, xml); -} diff --git a/qt/src/qdbusxmlparser.cpp b/qt/src/qdbusxmlparser.cpp deleted file mode 100644 index 359967bf..00000000 --- a/qt/src/qdbusxmlparser.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2005 Thiago Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "qdbusxmlparser_p.h" -#include "qdbusinterface.h" -#include "qdbusinterface_p.h" -#include "qdbusconnection_p.h" -#include "qdbusutil.h" - -#include -#include -#include -#include - -static QDBusIntrospection::Annotations -parseAnnotations(const QDomElement& elem) -{ - QDBusIntrospection::Annotations retval; - QDomNodeList list = elem.elementsByTagName(QLatin1String("annotation")); - for (int i = 0; i < list.count(); ++i) - { - QDomElement ann = list.item(i).toElement(); - if (ann.isNull()) - continue; - - QString name = ann.attribute(QLatin1String("name")), - value = ann.attribute(QLatin1String("value")); - - if (!QDBusUtil::isValidInterfaceName(name)) { - qWarning("Invalid D-BUS annotation '%s' found while parsing introspection", - qPrintable(name)); - continue; - } - - retval.insert(name, value); - } - - return retval; -} - -static QDBusIntrospection::Arguments -parseArgs(const QDomElement& elem, const QLatin1String& direction, bool acceptEmpty = false) -{ - QDBusIntrospection::Arguments retval; - QDomNodeList list = elem.elementsByTagName(QLatin1String("arg")); - for (int i = 0; i < list.count(); ++i) - { - QDomElement arg = list.item(i).toElement(); - if (arg.isNull()) - continue; - - if ((acceptEmpty && !arg.hasAttribute(QLatin1String("direction"))) || - arg.attribute(QLatin1String("direction")) == direction) { - - QDBusIntrospection::Argument argData; - if (arg.hasAttribute(QLatin1String("name"))) - argData.name = arg.attribute(QLatin1String("name")); // can be empty - argData.type = arg.attribute(QLatin1String("type")); - if (!QDBusUtil::isValidSingleSignature(argData.type)) { - qWarning("Invalid D-BUS type signature '%s' found while parsing introspection", - qPrintable(argData.type)); - continue; - } - - retval << argData; - } - } - return retval; -} - -QDBusXmlParser::QDBusXmlParser(const QString& service, const QString& path, - const QString& xmlData) - : m_service(service), m_path(path) -{ - QDomDocument doc; - doc.setContent(xmlData); - m_node = doc.firstChildElement(QLatin1String("node")); -} - -QDBusXmlParser::QDBusXmlParser(const QString& service, const QString& path, - const QDomElement& node) - : m_service(service), m_path(path), m_node(node) -{ -} - -QDBusIntrospection::Interfaces -QDBusXmlParser::interfaces() const -{ - QDBusIntrospection::Interfaces retval; - - if (m_node.isNull()) - return retval; - - QDomNodeList interfaceList = m_node.elementsByTagName(QLatin1String("interface")); - for (int i = 0; i < interfaceList.count(); ++i) - { - QDomElement iface = interfaceList.item(i).toElement(); - QString ifaceName = iface.attribute(QLatin1String("name")); - if (iface.isNull()) - continue; // for whatever reason - if (!QDBusUtil::isValidInterfaceName(ifaceName)) { - qWarning("Invalid D-BUS interface name '%s' found while parsing introspection", - qPrintable(ifaceName)); - continue; - } - - QDBusIntrospection::Interface *ifaceData = new QDBusIntrospection::Interface; - ifaceData->name = ifaceName; - { - // save the data - QTextStream ts(&ifaceData->introspection); - iface.save(ts,2); - } - - // parse annotations - ifaceData->annotations = parseAnnotations(iface); - - // parse methods - QDomNodeList list = iface.elementsByTagName(QLatin1String("method")); - for (int j = 0; j < list.count(); ++j) - { - QDomElement method = list.item(j).toElement(); - QString methodName = method.attribute(QLatin1String("name")); - if (method.isNull()) - continue; - if (!QDBusUtil::isValidMemberName(methodName)) { - qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", - qPrintable(methodName), qPrintable(ifaceName)); - continue; - } - - QDBusIntrospection::Method methodData; - methodData.name = methodName; - - // parse arguments - methodData.inputArgs = parseArgs(method, QLatin1String("in")); - methodData.outputArgs = parseArgs(method, QLatin1String("out")); - methodData.annotations = parseAnnotations(method); - - // add it - ifaceData->methods.insert(methodName, methodData); - } - - // parse signals - list = iface.elementsByTagName(QLatin1String("signal")); - for (int j = 0; j < list.count(); ++j) - { - QDomElement signal = list.item(j).toElement(); - QString signalName = signal.attribute(QLatin1String("name")); - if (signal.isNull()) - continue; - if (!QDBusUtil::isValidMemberName(signalName)) { - qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", - qPrintable(signalName), qPrintable(ifaceName)); - continue; - } - - QDBusIntrospection::Signal signalData; - signalData.name = signalName; - - // parse data - signalData.outputArgs = parseArgs(signal, QLatin1String("out"), true); - signalData.annotations = parseAnnotations(signal); - - // add it - ifaceData->signals_.insert(signalName, signalData); - } - - // parse properties - list = iface.elementsByTagName(QLatin1String("property")); - for (int j = 0; j < list.count(); ++j) - { - QDomElement property = list.item(j).toElement(); - QString propertyName = property.attribute(QLatin1String("name")); - if (property.isNull()) - continue; - if (!QDBusUtil::isValidMemberName(propertyName)) { - qWarning("Invalid D-BUS member name '%s' found in interface '%s' while parsing introspection", - qPrintable(propertyName), qPrintable(ifaceName)); - continue; - } - - QDBusIntrospection::Property propertyData; - - // parse data - propertyData.name = propertyName; - propertyData.type = property.attribute(QLatin1String("type")); - propertyData.annotations = parseAnnotations(property); - - if (!QDBusUtil::isValidSingleSignature(propertyData.type)) { - // cannot be! - qWarning("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection", - qPrintable(propertyData.type), qPrintable(ifaceName), - qPrintable(propertyName)); - continue; - } - - QString access = property.attribute(QLatin1String("access")); - if (access == QLatin1String("read")) - propertyData.access = QDBusIntrospection::Property::Read; - else if (access == QLatin1String("write")) - propertyData.access = QDBusIntrospection::Property::Write; - else if (access == QLatin1String("readwrite")) - propertyData.access = QDBusIntrospection::Property::ReadWrite; - else { - qWarning("Invalid D-BUS property access '%s' found in property '%s.%s' while parsing introspection", - qPrintable(access), qPrintable(ifaceName), - qPrintable(propertyName)); - continue; // invalid one! - } - - // add it - ifaceData->properties.insert(propertyName, propertyData); - } - - // add it - retval.insert(ifaceName, QSharedDataPointer(ifaceData)); - } - - return retval; -} - -QSharedDataPointer -QDBusXmlParser::object() const -{ - if (m_node.isNull()) - return QSharedDataPointer(); - - QDBusIntrospection::Object* objData; - objData = new QDBusIntrospection::Object; - objData->service = m_service; - objData->path = m_path; - - // check if we have anything to process - if (objData->introspection.isNull() && !m_node.firstChild().isNull()) { - // yes, introspect this object - QTextStream ts(&objData->introspection); - m_node.save(ts,2); - - QDomNodeList objects = m_node.elementsByTagName(QLatin1String("node")); - for (int i = 0; i < objects.count(); ++i) { - QDomElement obj = objects.item(i).toElement(); - QString objName = obj.attribute(QLatin1String("name")); - if (obj.isNull()) - continue; // for whatever reason - if (!QDBusUtil::isValidObjectPath(m_path + QLatin1Char('/') + objName)) { - qWarning("Invalid D-BUS object path '%s/%s' found while parsing introspection", - qPrintable(m_path), qPrintable(objName)); - continue; - } - - objData->childObjects.append(objName); - } - - QDomNodeList interfaceList = m_node.elementsByTagName(QLatin1String("interface")); - for (int i = 0; i < interfaceList.count(); ++i) { - QDomElement iface = interfaceList.item(i).toElement(); - QString ifaceName = iface.attribute(QLatin1String("name")); - if (iface.isNull()) - continue; - if (!QDBusUtil::isValidInterfaceName(ifaceName)) { - qWarning("Invalid D-BUS interface name '%s' found while parsing introspection", - qPrintable(ifaceName)); - continue; - } - - objData->interfaces.append(ifaceName); - } - } else { - objData->introspection = QLatin1String("\n"); - } - - QSharedDataPointer retval; - retval = objData; - return retval; -} - -QSharedDataPointer -QDBusXmlParser::objectTree() const -{ - QSharedDataPointer retval; - - if (m_node.isNull()) - return retval; - - retval = new QDBusIntrospection::ObjectTree; - - retval->service = m_service; - retval->path = m_path; - - QTextStream ts(&retval->introspection); - m_node.save(ts,2); - - // interfaces are easy: - retval->interfaceData = interfaces(); - retval->interfaces = retval->interfaceData.keys(); - - // sub-objects are slightly more difficult: - QDomNodeList objects = m_node.elementsByTagName(QLatin1String("node")); - for (int i = 0; i < objects.count(); ++i) { - QDomElement obj = objects.item(i).toElement(); - QString objName = obj.attribute(QLatin1String("name")); - if (obj.isNull() || objName.isEmpty()) - continue; // for whatever reason - - // check if we have anything to process - if (!obj.firstChild().isNull()) { - // yes, introspect this object - QString xml; - QTextStream ts2(&xml); - obj.save(ts2,0); - - // parse it - QString objAbsName = m_path; - if (!objAbsName.endsWith(QLatin1Char('/'))) - objAbsName.append(QLatin1Char('/')); - objAbsName += objName; - - QDBusXmlParser parser(m_service, objAbsName, obj); - retval->childObjectData.insert(objName, parser.objectTree()); - } - - retval->childObjects << objName; - } - - return QSharedDataPointer( retval ); -} - diff --git a/qt/src/qdbusxmlparser_p.h b/qt/src/qdbusxmlparser_p.h deleted file mode 100644 index 8f4f69b1..00000000 --- a/qt/src/qdbusxmlparser_p.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2005 Thiago Macieira - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef QDBUSXMLPARSER_H -#define QDBUSXMLPARSER_H - -#include -#include -#include "qdbusmacros.h" -#include "qdbusintrospection_p.h" - -/*! - \internal -*/ -class QDBusXmlParser -{ - QString m_service; - QString m_path; - QDomElement m_node; - -public: - QDBusXmlParser(const QString& service, const QString& path, - const QString& xmlData); - QDBusXmlParser(const QString& service, const QString& path, - const QDomElement& node); - - QDBusIntrospection::Interfaces interfaces() const; - QSharedDataPointer object() const; - QSharedDataPointer objectTree() const; -}; - -#endif diff --git a/qt/tools/.cvsignore b/qt/tools/.cvsignore deleted file mode 100644 index f6454f28..00000000 --- a/qt/tools/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.da -*.gcov -*.moc diff --git a/qt/tools/Makefile.am b/qt/tools/Makefile.am deleted file mode 100644 index 4da3870f..00000000 --- a/qt/tools/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDES=-I$(top_srcdir)/qt $(DBUS_CLIENT_CFLAGS) $(DBUS_QT_CFLAGS) -DDBUS_COMPILATION -bin_PROGRAMS = dbusidl2cpp dbuscpp2xml dbus - -dbusidl2cpp_SOURCES = dbusidl2cpp.cpp -dbusidl2cpp_LDFLAGS = -no-undefined -dbusidl2cpp_LDADD = $(DBUS_QT_LIBS) ../src/libdbus-qt4-1.la - -dbuscpp2xml_SOURCES = dbuscpp2xml.cpp -dbuscpp2xml_LDFLAGS = -no-undefined -dbuscpp2xml_LDADD = $(DBUS_QT_LIBS) ../src/libdbus-qt4-1.la - -dbus_SOURCES = dbus.cpp -dbus_LDADD = $(DBUS_QT_LIBS) ../src/libdbus-qt4-1.la diff --git a/qt/tools/dbus.cpp b/qt/tools/dbus.cpp deleted file mode 100644 index f628db95..00000000 --- a/qt/tools/dbus.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include - -#include -#include -#include -#include -#include -#include - -Q_DECLARE_METATYPE(QVariant) -QDBusConnection *connection; - -void listObjects(const QString &service, const QString &path) -{ - QDBusInterfacePtr iface(*connection, service, path.isEmpty() ? "/" : path, - "org.freedesktop.DBus.Introspectable"); - if (!iface->isValid()) { - QDBusError err(iface->lastError()); - fprintf(stderr, "Cannot introspect object %s at %s:\n%s (%s)\n", - qPrintable(path.isEmpty() ? "/" : path), qPrintable(service), - qPrintable(err.name()), qPrintable(err.message())); - exit(1); - } - QDBusReply xml = iface->call("Introspect"); - - if (xml.isError()) - return; // silently - - QDomDocument doc; - doc.setContent(xml); - QDomElement node = doc.documentElement(); - QDomElement child = node.firstChildElement(); - while (!child.isNull()) { - if (child.tagName() == QLatin1String("node")) { - QString sub = path + '/' + child.attribute("name"); - printf("%s\n", qPrintable(sub)); - listObjects(service, sub); - } - child = child.nextSiblingElement(); - } -} - -void listInterface(const QString &service, const QString &path, const QString &interface) -{ - QDBusInterfacePtr iface(*connection, service, path, interface); - if (!iface->isValid()) { - QDBusError err(iface->lastError()); - fprintf(stderr, "Interface '%s' not available in object %s at %s:\n%s (%s)\n", - qPrintable(interface), qPrintable(path), qPrintable(service), - qPrintable(err.name()), qPrintable(err.message())); - exit(1); - } - const QMetaObject *mo = iface->metaObject(); - - // properties - for (int i = mo->propertyOffset(); i < mo->propertyCount(); ++i) { - QMetaProperty mp = mo->property(i); - printf("property "); - - if (mp.isReadable() && mp.isWritable()) - printf("readwrite"); - else if (mp.isReadable()) - printf("read"); - else - printf("write"); - - printf(" %s %s.%s\n", mp.typeName(), qPrintable(interface), mp.name()); - } - - // methods (signals and slots) - for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { - QMetaMethod mm = mo->method(i); - - QByteArray signature = mm.signature(); - signature.truncate(signature.indexOf('(')); - printf("%s %s%s%s %s.%s(", - mm.methodType() == QMetaMethod::Signal ? "signal" : "method", - mm.tag(), *mm.tag() ? " " : "", - *mm.typeName() ? mm.typeName() : "void", - qPrintable(interface), signature.constData()); - - QList types = mm.parameterTypes(); - QList names = mm.parameterNames(); - bool first = true; - for (int i = 0; i < types.count(); ++i) { - printf("%s%s", - first ? "" : ", ", - types.at(i).constData()); - if (!names.at(i).isEmpty()) - printf(" %s", names.at(i).constData()); - first = false; - } - printf(")\n"); - } -} - -void listAllInterfaces(const QString &service, const QString &path) -{ - QDBusInterfacePtr iface(*connection, service, path, "org.freedesktop.DBus.Introspectable"); - if (!iface->isValid()) { - QDBusError err(iface->lastError()); - fprintf(stderr, "Cannot introspect object %s at %s:\n%s (%s)\n", - qPrintable(path), qPrintable(service), - qPrintable(err.name()), qPrintable(err.message())); - exit(1); - } - QDBusReply xml = iface->call("Introspect"); - - if (xml.isError()) - return; // silently - - QDomDocument doc; - doc.setContent(xml); - QDomElement node = doc.documentElement(); - QDomElement child = node.firstChildElement(); - while (!child.isNull()) { - if (child.tagName() == QLatin1String("interface")) { - QString ifaceName = child.attribute("name"); - if (QDBusUtil::isValidInterfaceName(ifaceName)) - listInterface(service, path, ifaceName); - else { - qWarning("Invalid D-BUS interface name '%s' found while parsing introspection", - qPrintable(ifaceName)); - } - } - child = child.nextSiblingElement(); - } -} - -QStringList readList(int &argc, const char *const *&argv) -{ - --argc; - ++argv; - - QStringList retval; - while (argc && QLatin1String(argv[0]) != ")") - retval += QString::fromLocal8Bit(argv[0]); - - return retval; -} - -void placeCall(const QString &service, const QString &path, const QString &interface, - const QString &member, int argc, const char *const *argv) -{ - QDBusInterfacePtr iface(*connection, service, path, interface); - if (!iface->isValid()) { - QDBusError err(iface->lastError()); - fprintf(stderr, "Interface '%s' not available in object %s at %s:\n%s (%s)\n", - qPrintable(interface), qPrintable(path), qPrintable(service), - qPrintable(err.name()), qPrintable(err.message())); - exit(1); - } - - const QMetaObject *mo = iface->metaObject(); - QByteArray match = member.toLatin1(); - match += '('; - - int midx = -1; - for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) { - QMetaMethod mm = mo->method(i); - QByteArray signature = mm.signature(); - if (signature.startsWith(match)) { - midx = i; - break; - } - } - - if (midx == -1) { - fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n", - qPrintable(interface), qPrintable(member), qPrintable(path), - qPrintable(service)); - exit(1); - } - - QMetaMethod mm = mo->method(midx); - QList types = mm.parameterTypes(); - - QVariantList params; - for (int i = 0; argc && i < types.count(); ++i) { - int id = QVariant::nameToType(types.at(i)); - if ((id == QVariant::UserType || id == QVariant::Map) && types.at(i) != "QVariant") { - fprintf(stderr, "Sorry, can't pass arg of type %s yet\n", - types.at(i).constData()); - exit(1); - } - if (id == QVariant::UserType) - id = QMetaType::type(types.at(i)); - - Q_ASSERT(id); - - QVariant p; - if ((id == QVariant::List || id == QVariant::StringList) && QLatin1String("(") == argv[0]) - p = readList(argc, argv); - else - p = QString::fromLocal8Bit(argv[0]); - - if (id < int(QVariant::UserType)) { - // avoid calling it for QVariant - p.convert( QVariant::Type(id) ); - if (p.type() == QVariant::Invalid) { - fprintf(stderr, "Could not convert '%s' to type '%s'.\n", - argv[0], types.at(i).constData()); - exit(1); - } - } else if (types.at(i) == "QVariant") { - QVariant tmp(id, p.constData()); - p = tmp; - } - params += p; - --argc; - ++argv; - } - if (params.count() != types.count()) { - fprintf(stderr, "Invalid number of parameters\n"); - exit(1); - } - - QDBusMessage reply = iface->callWithArgs(member, params, QDBusInterface::NoUseEventLoop); - if (reply.type() == QDBusMessage::ErrorMessage) { - QDBusError err = reply; - printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); - exit(2); - } else if (reply.type() != QDBusMessage::ReplyMessage) { - fprintf(stderr, "Invalid reply type %d\n", int(reply.type())); - exit(1); - } - - foreach (QVariant v, reply) { - if (v.userType() == QVariant::StringList) { - foreach (QString s, v.toStringList()) - printf("%s\n", qPrintable(s)); - } else { - if (v.userType() == qMetaTypeId()) - v = qvariant_cast(v); - printf("%s\n", qPrintable(v.toString())); - } - } - - exit(0); -} - -bool splitInterfaceAndName(const QString &interfaceAndName, const char *type, - QString &interface, QString &member) -{ - interface = interfaceAndName; - int pos = interface.lastIndexOf(QLatin1Char('.')); - if (pos != -1) { - member = interface.mid(pos + 1); - interface.truncate(pos); - } - - if (!QDBusUtil::isValidInterfaceName(interface)) { - fprintf(stderr, "Interface '%s' is not a valid interface name.\n", qPrintable(interface)); - return false; - } else if (!QDBusUtil::isValidMemberName(member)) { - fprintf(stderr, "%s name '%s' is not a valid member name.\n", type, qPrintable(member)); - return false; - } - return true; -} - -void getProperty(const QString &service, const QString &path, const QString &interfaceAndName) -{ - QString property; - QString interface; - if (!splitInterfaceAndName(interfaceAndName, "Property", interface, property)) - exit(1); - - QDBusInterfacePtr iface(*connection, service, path, interface); - QVariant reply = iface->property(property.toLatin1()); - if (reply.isNull()) { - QDBusError error = iface->lastError(); - fprintf(stderr, "Could not get property '%s' on interface '%s': %s (%s)\n", - qPrintable(property), qPrintable(interface), qPrintable(error.name()), - qPrintable(error.message())); - exit(1); - } - - printf("%s\n", qPrintable(reply.toString())); -} - -void setProperty(const QString &service, const QString &path, const QString &interfaceAndName, - const QString &valueStr) -{ - QString property; - QString interface; - if (!splitInterfaceAndName(interfaceAndName, "Property", interface, property)) - exit(1); - - QDBusInterfacePtr iface(*connection, service, path, interface); - iface->setProperty(property.toLatin1(), valueStr); -} - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - if (argc >= 1 && qstrcmp(argv[1], "--system") == 0) { - connection = &QDBus::systemBus(); - --argc; - ++argv; - } else - connection = &QDBus::sessionBus(); - - if (!connection->isConnected()) { - fprintf(stderr, "Could not connect to D-Bus server: %s: %s\n", - qPrintable(connection->lastError().name()), - qPrintable(connection->lastError().message())); - return 1; - } - QDBusBusService *bus = connection->busService(); - - if (argc == 1) { - QStringList names = bus->ListNames(); - foreach (QString name, names) - printf("%s\n", qPrintable(name)); - exit(0); - } - - QString service = QLatin1String(argv[1]); - if (!QDBusUtil::isValidBusName(service)) { - fprintf(stderr, "Service '%s' is not a valid name.\n", qPrintable(service)); - exit(1); - } - if (!bus->NameHasOwner(service)) { - fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service)); - exit(1); - } - - if (argc == 2) { - printf("/\n"); - listObjects(service, QString()); - exit(0); - } - - QString path = QLatin1String(argv[2]); - if (!QDBusUtil::isValidObjectPath(path)) { - fprintf(stderr, "Path '%s' is not a valid path name.\n", qPrintable(path)); - exit(1); - } - if (argc == 3) { - listAllInterfaces(service, path); - exit(0); - } - - QString interface = QLatin1String(argv[3]); - QString member; - int pos = interface.lastIndexOf(QLatin1Char('.')); - if (pos == -1) { - member = interface; - interface.clear(); - } else { - member = interface.mid(pos + 1); - interface.truncate(pos); - } - if (!interface.isEmpty() && !QDBusUtil::isValidInterfaceName(interface)) { - fprintf(stderr, "Interface '%s' is not a valid interface name.\n", qPrintable(interface)); - exit(1); - } - if (!QDBusUtil::isValidMemberName(member)) { - fprintf(stderr, "Method name '%s' is not a valid member name.\n", qPrintable(member)); - exit(1); - } - - if (interface.isEmpty()) { - if (member.toLower() == QLatin1String("get") && argc == 5) { - getProperty(service, path, QLatin1String(argv[4])); - return 0; - } else if (member.toLower() == QLatin1String("set") && argc == 6) { - setProperty(service, path, QLatin1String(argv[4]), QLatin1String(argv[5])); - return 0; - } - } - placeCall(service, path, interface, member, argc - 4, argv + 4); -} - diff --git a/qt/tools/dbuscpp2xml.cpp b/qt/tools/dbuscpp2xml.cpp deleted file mode 100644 index 02e5825b..00000000 --- a/qt/tools/dbuscpp2xml.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "../src/qdbusconnection.h" // for the Export* flags - -// copied from dbus-protocol.h: -static const char docTypeHeader[] = - "\n"; - -// in qdbusxmlgenerator.cpp -extern QDBUS_EXPORT QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, - const QMetaObject *base, int flags); - -#define PROGRAMNAME "dbuscpp2xml" -#define PROGRAMVERSION "0.1" -#define PROGRAMCOPYRIGHT "Copyright (C) 2006 Trolltech AS. All rights reserved." - -static const char cmdlineOptions[] = "psmaPSMAo:hV"; -static const char *outputFile; -static int flags; - -static const char help[] = - "Usage: " PROGRAMNAME " [options...] [files...]\n" - "Parses the C++ source or header file containing a QObject-derived class and\n" - "produces the D-Bus Introspection XML." - "\n" - "Options:\n" - " -p|-s|-m Only parse scriptable Properties, Signals and Methods (slots)\n" - " -P|-S|-M Parse all Properties, Signals and Methods (slots)\n" - " -a Output all scriptable contents (equivalent to -psm)\n" - " -A Output all contents (equivalent to -PSM)\n" - " -o Write the output to file \n" - " -h Show this information\n" - " -V Show the program version and quit.\n" - "\n"; - -class MocParser -{ - void parseError(); - QByteArray readLine(); - void loadIntData(uint *&data); - void loadStringData(char *&stringdata); - - QIODevice *input; - const char *filename; - int lineNumber; -public: - ~MocParser(); - void parse(const char *filename, QIODevice *input, int lineNumber = 0); - - QList objects; -}; - -void MocParser::parseError() -{ - fprintf(stderr, PROGRAMNAME ": error parsing input file '%s' line %d \n", filename, lineNumber); - exit(1); -} - -QByteArray MocParser::readLine() -{ - ++lineNumber; - return input->readLine(); -} - -void MocParser::loadIntData(uint *&data) -{ - data = 0; // initialise - QVarLengthArray array; - QRegExp rx(QLatin1String("(\\d+|0x[0-9abcdef]+)"), Qt::CaseInsensitive); - - while (!input->atEnd()) { - QString line = QLatin1String(readLine()); - int pos = line.indexOf(QLatin1String("//")); - if (pos != -1) - line.truncate(pos); // drop comments - - if (line == QLatin1String("};\n")) { - // end of data - data = new uint[array.count()]; - memcpy(data, array.data(), array.count() * sizeof(*data)); - return; - } - - pos = 0; - while ((pos = rx.indexIn(line, pos)) != -1) { - QString num = rx.cap(1); - if (num.startsWith(QLatin1String("0x"))) - array.append(num.mid(2).toUInt(0, 16)); - else - array.append(num.toUInt()); - pos += rx.matchedLength(); - } - } - - parseError(); -} - -void MocParser::loadStringData(char *&stringdata) -{ - stringdata = 0; - QVarLengthArray array; - - while (!input->atEnd()) { - QByteArray line = readLine(); - if (line == "};\n") { - // end of data - stringdata = new char[array.count()]; - memcpy(stringdata, array.data(), array.count() * sizeof(*stringdata)); - return; - } - - int start = line.indexOf('"'); - if (start == -1) - parseError(); - - int len = line.length() - 1; - line.truncate(len); // drop ending \n - if (line.at(len - 1) != '"') - parseError(); - - --len; - ++start; - for ( ; start < len; ++start) - if (line.at(start) == '\\') { - // parse escaped sequence - ++start; - if (start == len) - parseError(); - - QChar c(QLatin1Char(line.at(start))); - if (!c.isDigit()) { - switch (c.toLatin1()) { - case 'a': - array.append('\a'); - break; - case 'b': - array.append('\b'); - break; - case 'f': - array.append('\f'); - break; - case 'n': - array.append('\n'); - break; - case 'r': - array.append('\r'); - break; - case 't': - array.append('\t'); - break; - case 'v': - array.append('\v'); - break; - case '\\': - case '?': - case '\'': - case '"': - array.append(c.toLatin1()); - break; - - case 'x': - if (start + 2 <= len) - parseError(); - array.append(char(line.mid(start + 1, 2).toInt(0, 16))); - break; - - default: - array.append(c.toLatin1()); - fprintf(stderr, PROGRAMNAME ": warning: invalid escape sequence '\\%c' found in input", - c.toLatin1()); - } - } else { - // octal - QRegExp octal(QLatin1String("([0-7]+)")); - if (octal.indexIn(QLatin1String(line), start) == -1) - parseError(); - array.append(char(octal.cap(1).toInt(0, 8))); - } - } else { - array.append(line.at(start)); - } - } - - parseError(); -} - -void MocParser::parse(const char *fname, QIODevice *io, int lineNum) -{ - filename = fname; - input = io; - lineNumber = lineNum; - - while (!input->atEnd()) { - QByteArray line = readLine(); - if (line.startsWith("static const uint qt_meta_data_")) { - // start of new class data - uint *data; - loadIntData(data); - - // find the start of the string data - do { - line = readLine(); - if (input->atEnd()) - parseError(); - } while (!line.startsWith("static const char qt_meta_stringdata_")); - - char *stringdata; - loadStringData(stringdata); - - QMetaObject mo; - mo.d.superdata = &QObject::staticMetaObject; - mo.d.stringdata = stringdata; - mo.d.data = data; - mo.d.extradata = 0; - objects.append(mo); - } - } - - fname = 0; - input = 0; -} - -MocParser::~MocParser() -{ - foreach (QMetaObject mo, objects) { - delete const_cast(mo.d.stringdata); - delete const_cast(mo.d.data); - } -} - -static void showHelp() -{ - printf("%s", help); - exit(0); -} - -static void showVersion() -{ - printf("%s version %s\n", PROGRAMNAME, PROGRAMVERSION); - printf("D-Bus QObject-to-XML converter\n"); - exit(0); -} - -static void parseCmdLine(int argc, char **argv) -{ - int c; - opterr = true; - while ((c = getopt(argc, argv, cmdlineOptions)) != -1) - switch (c) - { - case 'p': - flags |= QDBusConnection::ExportProperties; - break; - - case 's': - flags |= QDBusConnection::ExportSignals; - break; - - case 'm': - flags |= QDBusConnection::ExportSlots; - break; - - case 'a': - flags |= QDBusConnection::ExportContents; - break; - - case 'P': - flags |= QDBusConnection::ExportAllProperties; - break; - - case 'S': - flags |= QDBusConnection::ExportAllSignals; - break; - - case 'M': - flags |= QDBusConnection::ExportAllSlots; - break; - - case 'A': - flags |= QDBusConnection::ExportAllContents; - break; - - case 'o': - outputFile = optarg; - break; - - case 'h': - showHelp(); - break; - - case 'V': - showVersion(); - break; - - case '?': - exit(1); - default: - abort(); - } - - if (flags == 0) - flags = QDBusConnection::ExportAllContents; -} - -int main(int argc, char **argv) -{ - MocParser parser; - parseCmdLine(argc, argv); - - for (int i = optind; i < argc; ++i) { - FILE *in = fopen(argv[i], "r"); - if (in == 0) { - fprintf(stderr, PROGRAMNAME ": could not open '%s': %s\n", - argv[i], strerror(errno)); - return 1; - } - - QFile f; - f.open(in, QIODevice::ReadOnly); - f.readLine(); - - QByteArray line = f.readLine(); - if (line.contains("Meta object code from reading C++ file")) - // this is a moc-generated file - parser.parse(argv[i], &f, 3); - else { - // run moc on this file - QProcess proc; - proc.start(QLatin1String("moc"), QStringList() << QFile::decodeName(argv[i])); - - if (!proc.waitForStarted()) { - fprintf(stderr, PROGRAMNAME ": could not execute moc! Aborting.\n"); - return 1; - } - - proc.closeWriteChannel(); - - if (!proc.waitForFinished() || proc.exitStatus() != QProcess::NormalExit || - proc.exitCode() != 0) { - // output the moc errors: - fprintf(stderr, "%s", proc.readAllStandardError().constData()); - fprintf(stderr, PROGRAMNAME ": exit code %d from moc. Aborting\n", proc.exitCode()); - return 1; - } - fprintf(stderr, "%s", proc.readAllStandardError().constData()); - - parser.parse(argv[i], &proc, 1); - } - - f.close(); - fclose(in); - } - - FILE *output = stdout; - if (outputFile != 0) { - output = fopen(outputFile, "w"); - if (output == 0) { - fprintf(stderr, PROGRAMNAME ": could not open output file '%s': %s", - outputFile, strerror(errno)); - return 1; - } - } - - fprintf(output, "%s\n", docTypeHeader); - foreach (QMetaObject mo, parser.objects) { - QString xml = qDBusGenerateMetaObjectXml(QString(), &mo, &QObject::staticMetaObject, - flags); - fprintf(output, "%s", qPrintable(xml)); - } - fprintf(output, "\n"); - - if (output != stdout) - fclose(output); -} - diff --git a/qt/tools/dbusidl2cpp.cpp b/qt/tools/dbusidl2cpp.cpp deleted file mode 100644 index ab61e672..00000000 --- a/qt/tools/dbusidl2cpp.cpp +++ /dev/null @@ -1,972 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "../src/qdbusmetaobject_p.h" -#include "../src/qdbusintrospection_p.h" - -#define PROGRAMNAME "dbusidl2cpp" -#define PROGRAMVERSION "0.5" -#define PROGRAMCOPYRIGHT "Copyright (C) 2006 Trolltech AS. All rights reserved." - -#define ANNOTATION_NO_WAIT "org.freedesktop.DBus.Method.NoReply" - -static const char cmdlineOptions[] = "a:c:hmNp:vV"; -static const char *globalClassName; -static const char *proxyFile; -static const char *adaptorFile; -static const char *inputFile; -static bool skipNamespaces; -static bool verbose; -static bool includeMocs; -static QStringList wantedInterfaces; - -static const char help[] = - "Usage: " PROGRAMNAME " [options...] [idl-or-xml-file] [interfaces...]\n" - "Produces the C++ code to implement the interfaces defined in the input file.\n" - "If no options are given, the code is written to the standard output.\n" - "\n" - "Options:\n" - " -a Write the adaptor code to \n" - " -c Use as the class name for the generated classes\n" - " -h Show this information\n" - " -m Generate #include \"filename.moc\" statements in the .cpp files\n" - " -N Don't use namespaces\n" - " -p Write the proxy code to \n" - " -v Be verbose.\n" - " -V Show the program version and quit.\n" - "\n" - "If the file name given to the options -a and -p does not end in .cpp or .h, the\n" - "program will automatically append the suffixes and produce both files.\n" - "You can also use a colon (:) to separate the header name from the source file\n" - "name, as in '-a filename_p.h:filename.cpp'.\n"; - -static const char includeList[] = - "#include \n" - "#include \n" - "#include \n" - "#include \n" - "#include \n" - "#include \n"; - -static const char forwardDeclarations[] = - "class QByteArray;\n" - "template class QList;\n" - "template class QMap;\n" - "class QString;\n" - "class QStringList;\n" - "class QVariant;\n"; - -static void showHelp() -{ - printf("%s", help); - exit(0); -} - -static void showVersion() -{ - printf("%s version %s\n", PROGRAMNAME, PROGRAMVERSION); - printf("D-Bus binding tool for Qt\n"); - exit(0); -} - -static void parseCmdLine(int argc, char **argv) -{ - int c; - opterr = true; - while ((c = getopt(argc, argv, cmdlineOptions)) != -1) - switch (c) - { - case 'a': - adaptorFile = optarg; - break; - - case 'c': - globalClassName = optarg; - break; - - case 'v': - verbose = true; - break; - - case 'm': - includeMocs = true; - break; - - case 'N': - skipNamespaces = true; - break; - - case 'h': - showHelp(); - break; - - case 'V': - showVersion(); - break; - - case 'p': - proxyFile = optarg; - break; - - case '?': - exit(1); - default: - abort(); - } - - if (optind != argc) - inputFile = argv[optind++]; - - while (optind != argc) - wantedInterfaces << QString::fromLocal8Bit(argv[optind++]); -} - -static QDBusIntrospection::Interfaces readInput() -{ - QFile input(QFile::decodeName(inputFile)); - if (inputFile && qstrcmp(inputFile, "-") != 0) - input.open(QIODevice::ReadOnly); - else - input.open(stdin, QIODevice::ReadOnly); - - QByteArray data = input.readAll(); - - // check if the input is already XML - data = data.trimmed(); - if (data.startsWith("") << endl - << " *" << endl - << " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << endl - << " *" << endl - << " * This is an auto-generated file." << endl; - - if (changesWillBeLost) - ts << " * Do not edit! All changes made to it will be lost." << endl; - - ts << " */" << endl - << endl; - - return ts; -} - -enum ClassType { Proxy, Adaptor }; -static QString classNameForInterface(const QString &interface, ClassType classType) -{ - if (globalClassName) - return QLatin1String(globalClassName); - - QStringList parts = interface.split(QLatin1Char('.')); - - QString retval; - if (classType == Proxy) - foreach (QString part, parts) { - part[0] = part[0].toUpper(); - retval += part; - } - else { - retval = parts.last(); - retval[0] = retval[0].toUpper(); - } - - if (classType == Proxy) - retval += QLatin1String("Interface"); - else - retval += QLatin1String("Adaptor"); - - return retval; -} - -static QByteArray qtTypeName(const QString &signature) -{ - QVariant::Type type = QDBusUtil::signatureToType(signature); - if (type == QVariant::Invalid) - qFatal("Got unknown type `%s'", qPrintable(signature)); - - return QVariant::typeToName(type); -} - -static QString nonConstRefArg(const QByteArray &arg) -{ - return QLatin1String(arg + " &"); -} - -static QString templateArg(const QByteArray &arg) -{ - if (!arg.endsWith('>')) - return QLatin1String(arg); - - return QLatin1String(arg + ' '); -} - -static QString constRefArg(const QByteArray &arg) -{ - if (!arg.startsWith('Q')) - return QLatin1String(arg + ' '); - else - return QString( QLatin1String("const %1 &") ).arg( QLatin1String(arg) ); -} - -static QStringList makeArgNames(const QDBusIntrospection::Arguments &inputArgs, - const QDBusIntrospection::Arguments &outputArgs = - QDBusIntrospection::Arguments()) -{ - QStringList retval; - for (int i = 0; i < inputArgs.count(); ++i) { - const QDBusIntrospection::Argument &arg = inputArgs.at(i); - QString name = arg.name; - if (name.isEmpty()) - name = QString( QLatin1String("in%1") ).arg(i); - while (retval.contains(name)) - name += QLatin1String("_"); - retval << name; - } - for (int i = 0; i < outputArgs.count(); ++i) { - const QDBusIntrospection::Argument &arg = outputArgs.at(i); - QString name = arg.name; - if (name.isEmpty()) - name = QString( QLatin1String("out%1") ).arg(i); - while (retval.contains(name)) - name += QLatin1String("_"); - retval << name; - } - return retval; -} - -static void writeArgList(QTextStream &ts, const QStringList &argNames, - const QDBusIntrospection::Arguments &inputArgs, - const QDBusIntrospection::Arguments &outputArgs = QDBusIntrospection::Arguments()) -{ - // input args: - bool first = true; - int argPos = 0; - for (int i = 0; i < inputArgs.count(); ++i) { - const QDBusIntrospection::Argument &arg = inputArgs.at(i); - QString type = constRefArg(qtTypeName(arg.type)); - - if (!first) - ts << ", "; - ts << type << argNames.at(argPos++); - first = false; - } - - argPos++; - - // output args - // yes, starting from 1 - for (int i = 1; i < outputArgs.count(); ++i) { - const QDBusIntrospection::Argument &arg = outputArgs.at(i); - QString name = arg.name; - - if (!first) - ts << ", "; - ts << nonConstRefArg(qtTypeName(arg.type)) << argNames.at(argPos++); - first = false; - } -} - -static QString propertyGetter(const QDBusIntrospection::Property &property) -{ - QString getter = property.annotations.value(QLatin1String("com.trolltech.QtDBus.propertyGetter")); - if (getter.isEmpty()) { - getter = property.name; - getter[0] = getter[0].toLower(); - } - return getter; -} - -static QString propertySetter(const QDBusIntrospection::Property &property) -{ - QString setter = property.annotations.value(QLatin1String("com.trolltech.QtDBus.propertySetter")); - if (setter.isEmpty()) { - setter = QLatin1String("set") + property.name; - setter[3] = setter[3].toUpper(); - } - return setter; -} - -static QString stringify(const QString &data) -{ - QString retval; - int i; - for (i = 0; i < data.length(); ++i) { - retval += QLatin1Char('\"'); - for ( ; i < data.length() && data[i] != QLatin1Char('\n'); ++i) - if (data[i] == QLatin1Char('\"')) - retval += QLatin1String("\\\""); - else - retval += data[i]; - retval += QLatin1String("\\n\"\n"); - } - return retval; -} - -static void writeProxy(const char *filename, const QDBusIntrospection::Interfaces &interfaces) -{ - // open the file - QString headerName = header(filename); - QFile file(headerName); - if (!headerName.isEmpty()) - file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); - else - file.open(stdout, QIODevice::WriteOnly | QIODevice::Text); - QTextStream hs(&file); - - QString cppName = cpp(filename); - QByteArray cppData; - QTextStream cs(&cppData); - - // write the header: - writeHeader(hs, true); - - // include guards: - QString includeGuard; - if (!headerName.isEmpty()) { - includeGuard = headerName.toUpper().replace(QLatin1Char('.'), QLatin1Char('_')); - int pos = includeGuard.lastIndexOf(QLatin1Char('/')); - if (pos != -1) - includeGuard = includeGuard.mid(pos + 1); - } else { - includeGuard = QLatin1String("QDBUSIDL2CPP_PROXY"); - } - includeGuard = QString(QLatin1String("%1_%2%3")) - .arg(includeGuard) - .arg(getpid()) - .arg(QDateTime::currentDateTime().toTime_t()); - hs << "#ifndef " << includeGuard << endl - << "#define " << includeGuard << endl - << endl; - - // include our stuff: - hs << "#include " << endl - << includeList - << "#include " << endl - << endl; - - if (cppName != headerName) { - writeHeader(cs, false); - cs << "#include \"" << headerName << "\"" << endl - << endl; - } - - foreach (const QDBusIntrospection::Interface *interface, interfaces) { - QString className = classNameForInterface(interface->name, Proxy); - - // comment: - hs << "/*" << endl - << " * Proxy class for interface " << interface->name << endl - << " */" << endl; - cs << "/*" << endl - << " * Implementation of interface class " << className << endl - << " */" << endl - << endl; - - // class header: - hs << "class " << className << ": public QDBusAbstractInterface" << endl - << "{" << endl - << " Q_OBJECT" << endl; - - // the interface name - hs << "public:" << endl - << " static inline const char *staticInterfaceName()" << endl - << " { return \"" << interface->name << "\"; }" << endl - << endl; - - // constructors/destructors: - hs << "public:" << endl - << " explicit " << className << "(QDBusAbstractInterfacePrivate *p);" << endl - << endl - << " ~" << className << "();" << endl - << endl; - cs << className << "::" << className << "(QDBusAbstractInterfacePrivate *p)" << endl - << " : QDBusAbstractInterface(p)" << endl - << "{" << endl - << "}" << endl - << endl - << className << "::~" << className << "()" << endl - << "{" << endl - << "}" << endl - << endl; - - // properties: - foreach (const QDBusIntrospection::Property &property, interface->properties) { - QByteArray type = qtTypeName(property.type); - QString templateType = templateArg(type); - QString constRefType = constRefArg(type); - QString getter = propertyGetter(property); - QString setter = propertySetter(property); - - hs << " Q_PROPERTY(" << type << " " << property.name; - - // getter: - if (property.access != QDBusIntrospection::Property::Write) - // it's readble - hs << " READ " << getter; - - // setter - if (property.access != QDBusIntrospection::Property::Read) - // it's writeable - hs << " WRITE " << setter; - - hs << ")" << endl; - - // getter: - if (property.access != QDBusIntrospection::Property::Write) { - hs << " inline " << type << " " << getter << "() const" << endl; - if (type != "QVariant") - hs << " { return qvariant_cast< " << type << " >(internalPropGet(\"" - << property.name << "\")); }" << endl; - else - hs << " { return internalPropGet(\"" << property.name << "\"); }" << endl; - } - - // setter: - if (property.access != QDBusIntrospection::Property::Read) { - hs << " inline void " << setter << "(" << constRefArg(type) << "value)" << endl - << " { internalPropSet(\"" << property.name - << "\", qVariantFromValue(value)); }" << endl; - } - - hs << endl; - } - - // methods: - hs << "public Q_SLOTS: // METHODS" << endl; - foreach (const QDBusIntrospection::Method &method, interface->methods) { - bool isAsync = - method.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true"); - if (isAsync && !method.outputArgs.isEmpty()) { - fprintf(stderr, "warning: method %s in interface %s is marked 'async' but has output arguments.\n", - qPrintable(method.name), qPrintable(interface->name)); - continue; - } - - hs << " inline "; - - if (method.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == QLatin1String("true")) - hs << "Q_DECL_DEPRECATED "; - - if (isAsync) - hs << "Q_ASYNC void "; - else if (method.outputArgs.isEmpty()) - hs << "QDBusReply "; - else { - hs << "QDBusReply<" << templateArg(qtTypeName(method.outputArgs.first().type)) << "> "; - } - - hs << method.name << "("; - - QStringList argNames = makeArgNames(method.inputArgs, method.outputArgs); - writeArgList(hs, argNames, method.inputArgs, method.outputArgs); - - hs << ")" << endl - << " {" << endl; - - if (method.outputArgs.count() > 1) - hs << " QDBusMessage reply = call(QLatin1String(\""; - else if (!isAsync) - hs << " return call(QLatin1String(\""; - else - hs << " call(NoWaitForReply, QLatin1String(\""; - - // rebuild the method input signature: - QString signature = QLatin1String("."); - foreach (const QDBusIntrospection::Argument &arg, method.inputArgs) - signature += arg.type; - if (signature.length() == 1) - signature.clear(); - hs << method.name << signature << "\")"; - - int argPos = 0; - for (int i = 0; i < method.inputArgs.count(); ++i) - hs << ", " << argNames.at(argPos++); - - // close the QDBusIntrospection::call call - hs << ");" << endl; - - argPos++; - if (method.outputArgs.count() > 1) { - hs << " if (reply.type() == QDBusMessage::ReplyMessage) {" << endl; - - // yes, starting from 1 - for (int i = 1; i < method.outputArgs.count(); ++i) - hs << " " << argNames.at(argPos++) << " = qvariant_cast<" - << templateArg(qtTypeName(method.outputArgs.at(i).type)) - << ">(reply.at(" << i << "));" << endl; - hs << " }" << endl - << " return reply;" << endl; - } - - // close the function: - hs << " }" << endl - << endl; - } - - hs << "Q_SIGNALS: // SIGNALS" << endl; - foreach (const QDBusIntrospection::Signal &signal, interface->signals_) { - hs << " "; - if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == - QLatin1String("true")) - hs << "Q_DECL_DEPRECATED "; - - hs << "void " << signal.name << "("; - - QStringList argNames = makeArgNames(signal.outputArgs); - writeArgList(hs, argNames, signal.outputArgs); - - hs << ");" << endl; // finished for header - } - - // close the class: - hs << "};" << endl - << endl; - } - - if (!skipNamespaces) { - QStringList last; - QDBusIntrospection::Interfaces::ConstIterator it = interfaces.constBegin(); - do - { - QStringList current; - QString name; - if (it != interfaces.constEnd()) { - current = it->constData()->name.split(QLatin1Char('.')); - name = current.takeLast(); - } - - int i = 0; - while (i < current.count() && i < last.count() && current.at(i) == last.at(i)) - ++i; - - // i parts matched - // close last.count() - i namespaces: - for (int j = i; j < last.count(); ++j) - hs << QString((last.count() - j - 1 + i) * 2, QLatin1Char(' ')) << "}" << endl; - - // open current.count() - i namespaces - for (int j = i; j < current.count(); ++j) - hs << QString(j * 2, QLatin1Char(' ')) << "namespace " << current.at(j) << " {" << endl; - - // add this class: - if (!name.isEmpty()) { - hs << QString(current.count() * 2, QLatin1Char(' ')) - << "typedef ::" << classNameForInterface(it->constData()->name, Proxy) - << " " << name << ";" << endl; - } - - if (it == interfaces.constEnd()) - break; - ++it; - last = current; - } while (true); - } - - // close the include guard - hs << "#endif" << endl; - - if (includeMocs) - cs << endl - << "#include \"" << filename << ".moc\"" << endl; - - cs.flush(); - hs.flush(); - if (headerName == cppName) - file.write(cppData); - else { - // write to cpp file - QFile f(cppName); - f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); - f.write(cppData); - } -} - -static void writeAdaptor(const char *filename, const QDBusIntrospection::Interfaces &interfaces) -{ - // open the file - QString headerName = header(filename); - QFile file(headerName); - if (!headerName.isEmpty()) - file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); - else - file.open(stdout, QIODevice::WriteOnly | QIODevice::Text); - QTextStream hs(&file); - - QString cppName = cpp(filename); - QByteArray cppData; - QTextStream cs(&cppData); - - // write the headers - writeHeader(hs, false); - - // include guards: - QString includeGuard; - if (!headerName.isEmpty()) { - includeGuard = headerName.toUpper().replace(QLatin1Char('.'), QLatin1Char('_')); - int pos = includeGuard.lastIndexOf(QLatin1Char('/')); - if (pos != -1) - includeGuard = includeGuard.mid(pos + 1); - } else { - includeGuard = QLatin1String("QDBUSIDL2CPP_ADAPTOR"); - } - includeGuard = QString(QLatin1String("%1_%2%3")) - .arg(includeGuard) - .arg(getpid()) - .arg(QDateTime::currentDateTime().toTime_t()); - hs << "#ifndef " << includeGuard << endl - << "#define " << includeGuard << endl - << endl; - - // include our stuff: - hs << "#include " << endl; - if (cppName == headerName) - hs << "#include " << endl - << "#include " << endl; - hs << "#include " << endl; - - if (cppName != headerName) { - writeHeader(cs, false); - cs << "#include \"" << headerName << "\"" << endl - << "#include " << endl - << includeList - << endl; - hs << forwardDeclarations; - } else { - hs << includeList; - } - - hs << endl; - - foreach (const QDBusIntrospection::Interface *interface, interfaces) { - QString className = classNameForInterface(interface->name, Adaptor); - - // comment: - hs << "/*" << endl - << " * Adaptor class for interface " << interface->name << endl - << " */" << endl; - cs << "/*" << endl - << " * Implementation of adaptor class " << className << endl - << " */" << endl - << endl; - - // class header: - hs << "class " << className << ": public QDBusAbstractAdaptor" << endl - << "{" << endl - << " Q_OBJECT" << endl - << " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << endl - << " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << endl - << stringify(interface->introspection) - << " \"\")" << endl - << "public:" << endl - << " " << className << "(QObject *parent);" << endl - << " virtual ~" << className << "();" << endl - << endl; - - // constructor/destructor - cs << className << "::" << className << "(QObject *parent)" << endl - << " : QDBusAbstractAdaptor(parent)" << endl - << "{" << endl - << " // constructor" << endl - << " setAutoRelaySignals(true);" << endl - << "}" << endl - << endl - << className << "::~" << className << "()" << endl - << "{" << endl - << " // destructor" << endl - << "}" << endl - << endl; - - hs << "public: // PROPERTIES" << endl; - foreach (const QDBusIntrospection::Property &property, interface->properties) { - QByteArray type = qtTypeName(property.type); - QString constRefType = constRefArg(type); - QString getter = propertyGetter(property); - QString setter = propertySetter(property); - - hs << " Q_PROPERTY(" << type << " " << property.name; - if (property.access != QDBusIntrospection::Property::Write) - hs << " READ " << getter; - if (property.access != QDBusIntrospection::Property::Read) - hs << " WRITE " << setter; - hs << ")" << endl; - - // getter: - if (property.access != QDBusIntrospection::Property::Write) { - hs << " " << type << " " << getter << "() const;" << endl; - cs << type << " " - << className << "::" << getter << "() const" << endl - << "{" << endl - << " // get the value of property " << property.name << endl - << " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << endl - << "}" << endl - << endl; - } - - // setter - if (property.access != QDBusIntrospection::Property::Read) { - hs << " void " << setter << "(" << constRefType << "value);" << endl; - cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << endl - << "{" << endl - << " // set the value of property " << property.name << endl - << " parent()->setProperty(\"" << property.name << "\", value);" << endl - << "}" << endl - << endl; - } - - hs << endl; - } - - hs << "public Q_SLOTS: // METHODS" << endl; - foreach (const QDBusIntrospection::Method &method, interface->methods) { - bool isAsync = - method.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true"); - if (isAsync && !method.outputArgs.isEmpty()) { - fprintf(stderr, "warning: method %s in interface %s is marked 'async' but has output arguments.\n", - qPrintable(method.name), qPrintable(interface->name)); - continue; - } - - hs << " "; - if (method.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == - QLatin1String("true")) - hs << "Q_DECL_DEPRECATED "; - - QByteArray returnType; - if (isAsync) { - hs << "Q_ASYNC void "; - cs << "void "; - } else if (method.outputArgs.isEmpty()) { - hs << "void "; - cs << "void "; - } else { - returnType = qtTypeName(method.outputArgs.first().type); - hs << returnType << " "; - cs << returnType << " "; - } - - QString name = method.name; - hs << name << "("; - cs << className << "::" << name << "("; - - QStringList argNames = makeArgNames(method.inputArgs, method.outputArgs); - writeArgList(hs, argNames, method.inputArgs, method.outputArgs); - writeArgList(cs, argNames, method.inputArgs, method.outputArgs); - - hs << ");" << endl; // finished for header - cs << ")" << endl - << "{" << endl - << " // handle method call " << interface->name << "." << method.name << endl; - - // create the return type - int j = method.inputArgs.count(); - if (!returnType.isEmpty()) - cs << " " << returnType << " " << argNames.at(j) << ";" << endl; - - // make the call - if (method.inputArgs.count() <= 10 && method.outputArgs.count() <= 1) { - // we can use QMetaObject::invokeMethod - static const char invoke[] = " QMetaObject::invokeMethod(parent(), \""; - cs << invoke << name << "\""; - - if (!method.outputArgs.isEmpty()) - cs << ", Q_RETURN_ARG(" - << qtTypeName(method.outputArgs.at(0).type) - << ", " - << argNames.at(method.inputArgs.count()) - << ")"; - - for (int i = 0; i < method.inputArgs.count(); ++i) - cs << ", Q_ARG(" - << qtTypeName(method.inputArgs.at(i).type) - << ", " - << argNames.at(i) - << ")"; - - cs << ");" << endl; - } - - cs << endl - << " // Alternative:" << endl - << " //"; - if (!method.outputArgs.isEmpty()) - cs << argNames.at(method.inputArgs.count()) << " = "; - cs << "static_cast(parent())->" << name << "("; - - int argPos = 0; - bool first = true; - for (int i = 0; i < method.inputArgs.count(); ++i) { - cs << (first ? "" : ", ") << argNames.at(argPos++); - first = false; - } - ++argPos; // skip retval, if any - for (int i = 1; i < method.outputArgs.count(); ++i) { - cs << (first ? "" : ", ") << argNames.at(argPos++); - first = false; - } - - cs << ");" << endl; - if (!method.outputArgs.isEmpty()) - cs << " return " << argNames.at(method.inputArgs.count()) << ";" << endl; - cs << "}" << endl - << endl; - } - - hs << "Q_SIGNALS: // SIGNALS" << endl; - foreach (const QDBusIntrospection::Signal &signal, interface->signals_) { - hs << " "; - if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == - QLatin1String("true")) - hs << "Q_DECL_DEPRECATED "; - - hs << "void " << signal.name << "("; - - QStringList argNames = makeArgNames(signal.outputArgs); - writeArgList(hs, argNames, signal.outputArgs); - - hs << ");" << endl; // finished for header - } - - // close the class: - hs << "};" << endl - << endl; - } - - // close the include guard - hs << "#endif" << endl; - - if (includeMocs) - cs << endl - << "#include \"" << filename << ".moc\"" << endl; - - cs.flush(); - hs.flush(); - if (headerName == cppName) - file.write(cppData); - else { - // write to cpp file - QFile f(cppName); - f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); - f.write(cppData); - } -} - -int main(int argc, char **argv) -{ - parseCmdLine(argc, argv); - - QDBusIntrospection::Interfaces interfaces = readInput(); - cleanInterfaces(interfaces); - - if (proxyFile || (!proxyFile && !adaptorFile)) - writeProxy(proxyFile, interfaces); - - if (adaptorFile) - writeAdaptor(adaptorFile, interfaces); - - return 0; -} - -/*! - \page dbusidl2cpp.html - \title QtDBus IDL compiler (dbusidl2cpp) - - The QtDBus IDL compiler is a tool that can be used to parse interface descriptions and produce - static code representing those interfaces, which can then be used to make calls to remote - objects or implement said interfaces. - - \c dbusidl2dcpp has two modes of operation, that correspond to the two possible outputs it can - produce: the interface (proxy) class or the adaptor class.The latter consists of both a C++ - header and a source file, which are meant to be edited and adapted to your needs. - - The \c dbusidl2dcpp tool is not meant to be run every time you compile your - application. Instead, it's meant to be used when developing the code or when the interface - changes. - - The adaptor classes generated by \c dbusidl2cpp are just a skeleton that must be completed. It - generates, by default, calls to slots with the same name on the object the adaptor is attached - to. However, you may modify those slots or the property accessor functions to suit your needs. -*/ diff --git a/qt3/.cvsignore b/qt3/.cvsignore deleted file mode 100644 index f6454f28..00000000 --- a/qt3/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.da -*.gcov -*.moc diff --git a/qt3/Makefile.am b/qt3/Makefile.am deleted file mode 100644 index 01b619a0..00000000 --- a/qt3/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -if HAVE_QT3 -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_QT3_CXXFLAGS) - -dbusincludedir=$(includedir)/dbus-1.0/dbus - -lib_LTLIBRARIES=libdbus-qt-1.la - -dbusinclude_HEADERS= \ - dbus-qt.h message.h connection.h \ - server.h - -libdbus_qt_1_la_SOURCES = \ - $(top_srcdir)/qt3/dbus-qthread.cpp \ - $(top_srcdir)/qt3/message.cpp \ - $(top_srcdir)/qt3/connection.cpp \ - $(top_srcdir)/qt3/integrator.cpp \ - $(top_srcdir)/qt3/server.cpp \ - $(top_srcdir)/qt3/connection.h \ - $(top_srcdir)/qt3/integrator.h \ - $(top_srcdir)/qt3/server.h - - -$(top_srcdir)/qt3/connection.cpp: connection.moc -$(top_srcdir)/qt3/integrator.cpp: integrator.moc -$(top_srcdir)/qt3/server.cpp: server.moc -$(top_srcdir)/qt3/connection.h: connection.moc -$(top_srcdir)/qt3/integrator.h: integrator.moc -$(top_srcdir)/qt3/server.h: server.moc - -CLEANFILES=connection.moc integrator.moc server.moc - -libdbus_qt_1_la_LIBADD= $(DBUS_QT3_LIBS) $(top_builddir)/dbus/libdbus-1.la -libdbus_qt_1_la_LDFLAGS= -version-info 1:0 -no-undefined - -%.moc: %.h - $(QT3_MOC) $< > $@ -endif diff --git a/qt3/connection.cpp b/qt3/connection.cpp deleted file mode 100644 index f426d698..00000000 --- a/qt3/connection.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- -/* connection.cpp: Qt wrapper for DBusConnection - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.0 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "connection.h" - -using namespace DBusQt; - -#include "integrator.h" -using Internal::Integrator; - -struct Connection::Private -{ - Private( Connection *qq ); - void setConnection( DBusConnection *c ); - DBusConnection *connection; - int connectionSlot; - DBusError error; - Integrator *integrator; - int timeout; - Connection *q; -}; - -Connection::Private::Private( Connection *qq ) - : connection( 0 ), connectionSlot( 0 ), integrator( 0 ), - timeout( -1 ), q( qq ) -{ - dbus_error_init( &error ); -} - -void Connection::Private::setConnection( DBusConnection *c ) -{ - if (!c) { - qDebug( "error: %s, %s", error.name, error.message ); - dbus_error_free( &error ); - return; - } - connection = c; - integrator = new Integrator( c, q ); - connect( integrator, SIGNAL(readReady()), q, SLOT(dispatchRead()) ); -} - -Connection::Connection( QObject *parent ) - : QObject( parent ) -{ - d = new Private( this ); -} - -Connection::Connection( const QString& host, QObject *parent ) - : QObject( parent ) -{ - d = new Private( this ); - - if ( !host.isEmpty() ) - init( host ); -} - -Connection::Connection( DBusBusType type, QObject* parent ) - : QObject( parent ) -{ - d = new Private( this ); - d->setConnection( dbus_bus_get(type, &d->error) ); -} - -void Connection::init( const QString& host ) -{ - d->setConnection( dbus_connection_open( host.ascii(), &d->error) ); - //dbus_connection_allocate_data_slot( &d->connectionSlot ); - //dbus_connection_set_data( d->connection, d->connectionSlot, 0, 0 ); -} - -bool Connection::isConnected() const -{ - return dbus_connection_get_is_connected( d->connection ); -} - -bool Connection::isAuthenticated() const -{ - return dbus_connection_get_is_authenticated( d->connection ); -} - -void Connection::open( const QString& host ) -{ - if ( host.isEmpty() ) return; - - init( host ); -} - -void Connection::close() -{ - dbus_connection_disconnect( d->connection ); -} - -void Connection::flush() -{ - dbus_connection_flush( d->connection ); -} - -void Connection::dispatchRead() -{ - while ( dbus_connection_dispatch( d->connection ) == DBUS_DISPATCH_DATA_REMAINS ) - ; -} - -DBusConnection* Connection::connection() const -{ - return d->connection; -} - -Connection::Connection( DBusConnection *connection, QObject *parent ) - : QObject( parent ) -{ - d = new Private(this); - d->setConnection(connection); -} - -void Connection::send( const Message &m ) -{ - dbus_connection_send(d->connection, m.message(), 0); -} - -void Connection::sendWithReply( const Message& ) -{ -} - -Message Connection::sendWithReplyAndBlock( const Message &m ) -{ - DBusMessage *reply; - reply = dbus_connection_send_with_reply_and_block( d->connection, m.message(), d->timeout, &d->error ); - if (dbus_error_is_set(&d->error)) { - qDebug("error: %s, %s", d->error.name, d->error.message); - dbus_error_free(&d->error); - } - return Message( reply ); -} - -void* Connection::virtual_hook( int, void* ) -{ -} - -void Connection::dbus_connection_setup_with_qt_main (DBusConnection *connection) -{ - d->setConnection( connection ); -} - - - -///////////////////////////////////////////////////////// - -#include "connection.moc" diff --git a/qt3/connection.h b/qt3/connection.h deleted file mode 100644 index 7cb922e3..00000000 --- a/qt3/connection.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- -/* connection.h: Qt wrapper for DBusConnection - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_QT_CONNECTION_H -#define DBUS_QT_CONNECTION_H - -#include "message.h" - -#include -#include - -#include "dbus/dbus.h" - -namespace DBusQt { - namespace Internal { - class Integrator; - } - - class Connection : public QObject - { - Q_OBJECT - public: - Connection( QObject *parent =0 ); - Connection( const QString& host, - QObject *parent = 0 ); - Connection( DBusBusType type, QObject* parent = 0 ); - - bool isConnected() const; - bool isAuthenticated() const; - - Message borrowMessage(); - Message popMessage(); - void stealBorrowMessage( const Message& ); - void dbus_connection_setup_with_qt_main (DBusConnection *connection); - - public slots: - void open( const QString& ); - void close(); - void flush(); - void send( const Message& ); - void sendWithReply( const Message& ); - Message sendWithReplyAndBlock( const Message& ); - - protected slots: - void dispatchRead(); - - protected: - void init( const QString& host ); - virtual void *virtual_hook( int id, void *data ); - - private: - friend class Internal::Integrator; - DBusConnection *connection() const; - Connection( DBusConnection *connection, QObject *parent ); - - private: - struct Private; - Private *d; - }; - -} - - -#endif diff --git a/qt3/dbus-qt.h b/qt3/dbus-qt.h deleted file mode 100644 index 179f5355..00000000 --- a/qt3/dbus-qt.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* - * dbus-qt.h Qt integration - * - * Copyright (C) 2002 DBus Developers - * - * Licensed under the Academic Free License version 2.1 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - * 02111-1307 USA - * - */ -#ifndef DBUS_QT_H -#define DBUS_QT_H - -#include -/* - * Two approaches - one presented below a DBusQtConnection - * object which is a Qt wrapper around DBusConnection -class DBusQtConnection : public QObject { - Q_OBJECT -public: - DBusQtConnection( const char *address=0, QObject *parent=0, - const char *name=0 ); - - bool open( const char *address ); - bool isConnected() const; - int numMessages() const; - -public slots: - void disconnect(); - void flush(); - void sendMessage( DBusMessage *message ); - -signals: - void message( DBusMessage* message ); - void error( const char* error ); -private: - DBusConnection *mConnection; - QSocketNotifier *mReadNotifier; - QSocketNotifier *mWriteNotifier; -}; - * - * Second approach is to have a static Qt dispatcher like: -class DBusQtNotifier : public QObject { - Q_OBJECT -public: - static DBusQtNotifier* dbus_qt_notifier(); - void addConnection(DBusConnection* connection); -signals: - void message (DBusConnection* connection, DBusMessage* message); - -private: - DBusQtNotifier(QObject *parent); -private slots: - void processNotifiers( int socket ); -private: - //implemented in terms of QSocketNotifiers - QAsciiDict mReadNotifiers; - QAsciiDict mWriteNotifiers; -}; - * - * First one gives us a full wrapper for DBusConnection (the Qt way), - * the other exposes DBusConnection, so would be easier to maintain - * and keep up while DBus evolves. - * - */ - -#endif /* DBUS_QT_H */ diff --git a/qt3/dbus-qthread.cpp b/qt3/dbus-qthread.cpp deleted file mode 100644 index 72ccb155..00000000 --- a/qt3/dbus-qthread.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-qthread.cpp Qt threads integration - * - * Copyright (C) 2002 Zack Rusin - * - * Licensed under the Academic Free License version 2.0 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include - -#if defined(QT_THREAD_SUPPORT) - -static DBusMutex * dbus_qmutex_new (void); -static void dbus_qmutex_free (DBusMutex *mutex); -static dbus_bool_t dbus_qmutex_lock (DBusMutex *mutex); -static dbus_bool_t dbus_qmutex_unlock (DBusMutex *mutex); - -static DBusCondVar*dbus_qcondvar_new (void); -static void dbus_qcondvar_free (DBusCondVar *cond); -static void dbus_qcondvar_wait (DBusCondVar *cond, - DBusMutex *mutex); -static dbus_bool_t dbus_qcondvar_wait_timeout (DBusCondVar *cond, - DBusMutex *mutex. - int timeout_msec); -static void dbus_qcondvar_wake_one (DBusCondVar *cond); -static void dbus_qcondvar_wake_all (DBusCondVar *cond); - - -static const DBusThreadFunctions functions = -{ - DBUS_THREAD_FUNCTIONS_NEW_MASK | - DBUS_THREAD_FUNCTIONS_FREE_MASK | - DBUS_THREAD_FUNCTIONS_LOCK_MASK | - DBUS_THREAD_FUNCTIONS_UNLOCK_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK | - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK| - DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK, - dbus_qmutex_new, - dbus_qmutex_free, - dbus_qmutex_lock, - dbus_qmutex_unlock - dbus_qcondvar_new, - dbus_qcondvar_free, - dbus_qcondvar_wait, - dbus_qcondvar_wait_timeout, - dbus_qcondvar_wake_one, - dbus_qcondvar_wake_all -}; - -static DBusMutex * -dbus_qmutex_new (void) -{ - QMutex *mutex; - mutex = new QMutex; - return static_cast( mutex ); -} - -static void -dbus_qmutex_free (DBusMutex *mutex) -{ - QMutex * qmutex = static_cast(mutex); - delete mutex; -} - -static dbus_bool_t -dbus_qmutex_lock (DBusMutex *mutex) -{ - QMutex *qmutex = static_cast(mutex); - qmutex->lock(); - return TRUE; -} - -static dbus_bool_t -dbus_qmutex_unlock (DBusMutex *mutex) -{ - QMutex *qmutex = static_cast(mutex); - qmutex->unlock(); - return TRUE; -} - -static DBusCondVar* -dbus_qcondvar_new (void) -{ - QWaitCondition *cond; - cond = new QWaitCondition; - return static_cast( cond ); -} - -static void -dbus_qcondvar_free (DBusCondVar *cond) -{ - QWaitCondition *qcond = static_cast(cond); - delete qcond; -} - -static void -dbus_qcondvar_wait (DBusCondVar *cond, - DBusMutex *mutex) -{ - QWaitCondition *qcond = static_cast(cond); - QMutex *qmutex = static_cast(mutex); - - qcond->wait (qmutex); -} - -static dbus_bool_t -dbus_gcondvar_wait_timeout (DBusCondVar *cond, - DBusMutex *mutex, - int timeout_msec) -{ - QWaitCondition *qcond = static_cast(cond); - QMutex *qmutex = static_cast(mutex); - - return qcond->wait (qmutex, timout_msec); -} - -static void -dbus_qcondvar_wake_one (DBusCondVar *cond) -{ - QWaitCondition *qcond = static_cast(cond); - - qcond->wakeOne (qmutex); -} - -static void -dbus_qcondvar_wake_all (DBusCondVar *cond) -{ - QWaitCondition *qcond = static_cast(cond); - - qcond->wakeAll (qmutex); -} - -extern "C" { - -void -dbus_qthread_init (void) -{ - //Do we want to do anything else here? - dbus_threads_init (&functions); -} - -} - -#endif // QT_THREAD_SUPPORT diff --git a/qt3/integrator.cpp b/qt3/integrator.cpp deleted file mode 100644 index fff32b39..00000000 --- a/qt3/integrator.cpp +++ /dev/null @@ -1,244 +0,0 @@ -// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- -/* integrator.h: integrates D-BUS into Qt event loop - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.0 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "integrator.h" -#include "connection.h" - -#include -#include -#include -#include - -namespace DBusQt -{ -namespace Internal { - -struct Watch { - Watch(): readSocket( 0 ), writeSocket( 0 ) { } - - DBusWatch *watch; - QSocketNotifier *readSocket; - QSocketNotifier *writeSocket; -}; - -////////////////////////////////////////////////////////////// -dbus_bool_t dbusAddWatch( DBusWatch *watch, void *data ) -{ - Integrator *con = static_cast( data ); - con->addWatch( watch ); - return true; -} -void dbusRemoveWatch( DBusWatch *watch, void *data ) -{ - Integrator *con = static_cast( data ); - con->removeWatch( watch ); -} - -void dbusToggleWatch( DBusWatch *watch, void *data ) -{ - Integrator *itg = static_cast( data ); - if ( dbus_watch_get_enabled( watch ) ) - itg->addWatch( watch ); - else - itg->removeWatch( watch ); -} - -dbus_bool_t dbusAddTimeout( DBusTimeout *timeout, void *data ) -{ - if ( !dbus_timeout_get_enabled(timeout) ) - return true; - - Integrator *itg = static_cast( data ); - itg->addTimeout( timeout ); - return true; -} - -void dbusRemoveTimeout( DBusTimeout *timeout, void *data ) -{ - Integrator *itg = static_cast( data ); - itg->removeTimeout( timeout ); -} - -void dbusToggleTimeout( DBusTimeout *timeout, void *data ) -{ - Integrator *itg = static_cast( data ); - - if ( dbus_timeout_get_enabled( timeout ) ) - itg->addTimeout( timeout ); - else - itg->removeTimeout( timeout ); -} - -void dbusWakeupMain( void* ) -{ -} - -void dbusNewConnection( DBusServer *server, - DBusConnection *new_connection, - void *data ) -{ - Integrator *itg = static_cast( data ); - itg->handleConnection( new_connection ); -} -///////////////////////////////////////////////////////////// - -Timeout::Timeout( QObject *parent, DBusTimeout *t ) - : QObject( parent ), m_timeout( t ) -{ - m_timer = new QTimer( this ); - connect( m_timer, SIGNAL(timeout()), - SLOT(slotTimeout()) ); -} - -void Timeout::slotTimeout() -{ - emit timeout( m_timeout ); -} - -void Timeout::start() -{ - m_timer->start( dbus_timeout_get_interval( m_timeout ) ); -} - -Integrator::Integrator( DBusConnection *conn, QObject *parent ) - : QObject( parent ), m_connection( conn ) -{ - m_timeouts.setAutoDelete( true ); - - dbus_connection_set_watch_functions( m_connection, - dbusAddWatch, - dbusRemoveWatch, - dbusToggleWatch, - this, 0 ); - dbus_connection_set_timeout_functions( m_connection, - dbusAddTimeout, - dbusRemoveTimeout, - dbusToggleTimeout, - this, 0 ); - dbus_connection_set_wakeup_main_function( m_connection, - dbusWakeupMain, - this, 0 ); -} - -Integrator::Integrator( DBusServer *server, QObject *parent ) - : QObject( parent ), m_server( server ) -{ - m_connection = reinterpret_cast( m_server ); - m_timeouts.setAutoDelete( true ); - - dbus_server_set_watch_functions( m_server, - dbusAddWatch, - dbusRemoveWatch, - dbusToggleWatch, - this, 0 ); - dbus_server_set_timeout_functions( m_server, - dbusAddTimeout, - dbusRemoveTimeout, - dbusToggleTimeout, - this, 0 ); - dbus_server_set_new_connection_function( m_server, - dbusNewConnection, - this, 0 ); -} - -void Integrator::slotRead( int fd ) -{ - QIntDictIterator it( m_watches ); - for ( ; it.current(); ++it ) - dbus_watch_handle ( it.current()->watch, DBUS_WATCH_READABLE ); - - emit readReady(); -} - -void Integrator::slotWrite( int fd ) -{ - QIntDictIterator it( m_watches ); - for ( ; it.current(); ++it ) - dbus_watch_handle ( it.current()->watch, DBUS_WATCH_WRITABLE ); -} - -void Integrator::slotTimeout( DBusTimeout *timeout ) -{ - dbus_timeout_handle( timeout ); -} - -void Integrator::addWatch( DBusWatch *watch ) -{ - if ( !dbus_watch_get_enabled( watch ) ) - return; - - Watch *qtwatch = new Watch; - qtwatch->watch = watch; - - int flags = dbus_watch_get_flags( watch ); - int fd = dbus_watch_get_fd( watch ); - - if ( flags & DBUS_WATCH_READABLE ) { - qtwatch->readSocket = new QSocketNotifier( fd, QSocketNotifier::Read, this ); - QObject::connect( qtwatch->readSocket, SIGNAL(activated(int)), SLOT(slotRead(int)) ); - } - - if (flags & DBUS_WATCH_WRITABLE) { - qtwatch->writeSocket = new QSocketNotifier( fd, QSocketNotifier::Write, this ); - QObject::connect( qtwatch->writeSocket, SIGNAL(activated(int)), SLOT(slotWrite(int)) ); - } - - m_watches.insert( fd, qtwatch ); -} - -void Integrator::removeWatch( DBusWatch *watch ) -{ - int key = dbus_watch_get_fd( watch ); - - Watch *qtwatch = m_watches.take( key ); - - if ( qtwatch ) { - delete qtwatch->readSocket; qtwatch->readSocket = 0; - delete qtwatch->writeSocket; qtwatch->writeSocket = 0; - delete qtwatch; - } -} - -void Integrator::addTimeout( DBusTimeout *timeout ) -{ - Timeout *mt = new Timeout( this, timeout ); - m_timeouts.insert( timeout, mt ); - connect( mt, SIGNAL(timeout(DBusTimeout*)), - SLOT(slotTimeout(DBusTimeout*)) ); - mt->start(); -} - -void Integrator::removeTimeout( DBusTimeout *timeout ) -{ - m_timeouts.remove( timeout ); -} - -void Integrator::handleConnection( DBusConnection *c ) -{ - Connection *con = new Connection( c, this ); - emit newConnection( con ); -} - -}//end namespace Internal -}//end namespace DBusQt - -#include "integrator.moc" diff --git a/qt3/integrator.h b/qt3/integrator.h deleted file mode 100644 index 70e2a7f2..00000000 --- a/qt3/integrator.h +++ /dev/null @@ -1,92 +0,0 @@ -// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- -/* integrator.h: integrates D-BUS into Qt event loop - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_QT_INTEGRATOR_H -#define DBUS_QT_INTEGRATOR_H - -#include - -#include -#include - -#include "dbus/dbus.h" - -class QTimer; - -namespace DBusQt -{ - class Connection; - - namespace Internal - { - struct Watch; - - class Timeout : public QObject - { - Q_OBJECT - public: - Timeout( QObject *parent, DBusTimeout *t ); - public: - void start(); - signals: - void timeout( DBusTimeout* ); - protected slots: - void slotTimeout(); - private: - QTimer *m_timer; - DBusTimeout *m_timeout; - }; - - class Integrator : public QObject - { - Q_OBJECT - public: - Integrator( DBusConnection *connection, QObject *parent ); - Integrator( DBusServer *server, QObject *parent ); - - signals: - void readReady(); - void newConnection( Connection* ); - - protected slots: - void slotRead( int ); - void slotWrite( int ); - void slotTimeout( DBusTimeout *timeout ); - - public: - void addWatch( DBusWatch* ); - void removeWatch( DBusWatch* ); - - void addTimeout( DBusTimeout* ); - void removeTimeout( DBusTimeout* ); - - void handleConnection( DBusConnection* ); - private: - QIntDict m_watches; - QPtrDict m_timeouts; - DBusConnection *m_connection; - DBusServer *m_server; - }; - } -} - -#endif diff --git a/qt3/message.cpp b/qt3/message.cpp deleted file mode 100644 index 256c2b23..00000000 --- a/qt3/message.cpp +++ /dev/null @@ -1,561 +0,0 @@ -/* -*- mode: C++; c-file-style: "gnu" -*- */ -/* message.cpp: Qt wrapper for DBusMessage - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.0 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "message.h" - -#include - -#include - -namespace DBusQt { - -struct Message::iterator::IteratorData { - DBusMessageIter *iter; - QVariant var; - bool end; - DBusMessage *mesg; -}; - -/** - * Iterator. - */ -Message::iterator::iterator() -{ - d = new IteratorData; - d->iter = 0; d->end = true; -} - -/** - * Constructs iterator for the message. - * @param msg message whose fields we want to iterate - */ -Message::iterator::iterator( DBusMessage* msg ) -{ - d = new IteratorData; - d->mesg = msg; - d->iter = static_cast( malloc( sizeof(DBusMessageIter) ) ); - dbus_message_iter_init( d->mesg, d->iter ); - if ( !d->iter ) { - qDebug("No iterator??"); - } - fillVar(); - d->end = false; -} - -/** - * Copy constructor for the iterator. - * @param itr iterator - */ -Message::iterator::iterator( const iterator& itr ) -{ - d = new IteratorData; - d->iter = itr.d->iter; - d->var = itr.d->var; - d->end = itr.d->end; -} - -/** - * Destructor. - */ -Message::iterator::~iterator() -{ - free( d->iter ); - delete d; d=0; -} - -/** - * Creates an iterator equal to the @p itr iterator - * @param itr other iterator - * @return - */ -Message::iterator& -Message::iterator::operator=( const iterator& itr ) -{ - IteratorData *tmp = new IteratorData; - tmp->iter = itr.d->iter; - tmp->var = itr.d->var; - tmp->end = itr.d->end; - delete d; d=tmp; - return *this; -} - -/** - * Returns the constant QVariant held by the iterator. - * @return the constant reference to QVariant held by this iterator - */ -const QVariant& -Message::iterator::operator*() const -{ - return d->var; -} - -/** - * Returns the QVariant held by the iterator. - * @return reference to QVariant held by this iterator - */ -QVariant& -Message::iterator::operator*() -{ - return d->var; -} - -/** - * Moves to the next field and return a reference to itself after - * incrementing. - * @return reference to self after incrementing - */ -Message::iterator& -Message::iterator::operator++() -{ - if ( d->end ) - return *this; - - if ( dbus_message_iter_next( d->iter ) ) { - fillVar(); - } else { - d->end = true; - d->var = QVariant(); - } - return *this; -} - -/** - * Moves to the next field and returns self before incrementing. - * @return self before incrementing - */ -Message::iterator -Message::iterator::operator++(int) -{ - iterator itr( *this ); - operator++(); - return itr; -} - -/** - * Compares this iterator to @p it iterator. - * @param it the iterator to which we're comparing this one to - * @return true if they're equal, false otherwise - */ -bool -Message::iterator::operator==( const iterator& it ) -{ - if ( d->end == it.d->end ) { - if ( d->end == true ) { - return true; - } else { - return d->var == it.d->var; - } - } else - return false; -} - -/** - * Compares two iterators. - * @param it The other iterator. - * @return true if two iterators are not equal, false - * otherwise - */ -bool -Message::iterator::operator!=( const iterator& it ) -{ - return !operator==( it ); -} - -QVariant Message::iterator::marshallBaseType( DBusMessageIter* i ) -{ - QVariant ret; - switch (dbus_message_iter_get_arg_type(i)) { - case DBUS_TYPE_INT32: - { - dbus_int32_t v; - dbus_message_iter_get_basic (i, &v); - ret = QVariant( v ); - } - break; - case DBUS_TYPE_UINT32: - { - dbus_uint32_t v; - dbus_message_iter_get_basic (i, &v); - ret = QVariant( v ); - } - break; - case DBUS_TYPE_DOUBLE: - { - double v; - dbus_message_iter_get_basic (i, &v); - ret = QVariant( v ); - } - break; - case DBUS_TYPE_STRING: - { - const char *v; - dbus_message_iter_get_basic (i, &v); - ret = QVariant( v ); - } - break; - default: - ret = QVariant(); - break; - } - return ret; -} - -/** - * Fills QVariant based on what current DBusMessageIter helds. - */ -void -Message::iterator::fillVar() -{ - switch ( dbus_message_iter_get_arg_type( d->iter ) ) { - case DBUS_TYPE_INT32: - case DBUS_TYPE_UINT32: - case DBUS_TYPE_DOUBLE: - case DBUS_TYPE_STRING: - d->var = marshallBaseType( d->iter ); - break; - case DBUS_TYPE_ARRAY: { - switch ( dbus_message_iter_get_element_type( d->iter ) ) { - case DBUS_TYPE_STRING: { - QStringList tempList; - DBusMessageIter sub; - dbus_message_iter_recurse (d->iter, &sub); - while (dbus_message_iter_get_arg_type (&sub) != DBUS_TYPE_INVALID) - { - const char *v; - dbus_message_iter_get_basic (&sub, &v); - tempList.append( QString( v ) ); - dbus_message_iter_next (&sub); - } - d->var = QVariant( tempList ); - break; - } - default: - qDebug( "Array of type not implemented" ); - d->var = QVariant(); - break; - } - break; - } -#if 0 - /* DICT is gone for now, but expected to be reintroduced, or else - * reintroduced as a flag on the introspection data that can - * apply to array of struct of two fields - */ - case DBUS_TYPE_DICT: { - qDebug( "Got a hash!" ); - QMap tempMap; - DBusMessageIter dictIter; - dbus_message_iter_init_dict_iterator( d->iter, &dictIter ); - do { - char *key = dbus_message_iter_get_dict_key( &dictIter ); - tempMap[key] = marshallBaseType( &dictIter ); - dbus_free( key ); - dbus_message_iter_next( &dictIter ); - } while( dbus_message_iter_has_next( &dictIter ) ); - d->var = QVariant( tempMap ); - break; - qDebug( "Hash/Dict type not implemented" ); - d->var = QVariant(); - break; - } -#endif - default: - qDebug( "not implemented" ); - d->var = QVariant(); - break; - } -} - -/** - * Returns a QVariant help by this iterator. - * @return QVariant held by this iterator - */ -QVariant -Message::iterator::var() const -{ - return d->var; -} - -struct Message::Private { - DBusMessage *msg; -}; - -Message::Message( DBusMessage *m ) -{ - d = new Private; - d->msg = m; -} - -/** - * - */ -Message::Message( int messageType ) -{ - d = new Private; - d->msg = dbus_message_new( messageType ); -} - -/** - * Constructs a new Message with the given service and name. - * @param service service service that the message should be sent to - * @param name name of the message - */ -Message::Message( const QString& service, const QString& path, - const QString& interface, const QString& method ) -{ - d = new Private; - d->msg = dbus_message_new_method_call( service.latin1(), path.latin1(), - interface.latin1(), method.latin1() ); -} - -/** - * Constructs a message that is a reply to some other - * message. - * @param name the name of the message - * @param replayingTo original_message the message which the created - * message is a reply to. - */ -Message::Message( const Message& replayingTo ) -{ - d = new Private; - d->msg = dbus_message_new_method_return( replayingTo.d->msg ); -} - -Message:: Message( const QString& path, const QString& interface, - const QString& name ) -{ - d = new Private; - d->msg = dbus_message_new_signal( path.ascii(), interface.ascii(), - name.ascii() ); -} - -Message::Message( const Message& replayingTo, const QString& errorName, - const QString& errorMessage ) -{ - d = new Private; - d->msg = dbus_message_new_error( replayingTo.d->msg, errorName.utf8(), - errorMessage.utf8() ); -} - -Message Message::operator=( const Message& other ) -{ - //FIXME: ref the other.d->msg instead of copying it? -} -/** - * Destructs message. - */ -Message::~Message() -{ - if ( d->msg ) { - dbus_message_unref( d->msg ); - } - delete d; d=0; -} - -int Message::type() const -{ - return dbus_message_get_type( d->msg ); -} - -void Message::setPath( const QString& path ) -{ - dbus_message_set_path( d->msg, path.ascii() ); -} - -QString Message::path() const -{ - return dbus_message_get_path( d->msg ); -} - -void Message::setInterface( const QString& iface ) -{ - dbus_message_set_interface( d->msg, iface.ascii() ); -} - -QString Message::interface() const -{ - return dbus_message_get_interface( d->msg ); -} - -void Message::setMember( const QString& member ) -{ - dbus_message_set_member( d->msg, member.ascii() ); -} - -QString Message::member() const -{ - return dbus_message_get_member( d->msg ); -} - -void Message::setErrorName( const QString& err ) -{ - dbus_message_set_error_name( d->msg, err ); -} - -QString Message::errorName() const -{ - return dbus_message_get_error_name( d->msg ); -} - -void Message::setDestination( const QString& dest ) -{ - dbus_message_set_destination( d->msg, dest ); -} - -QString Message::destination() const -{ - return dbus_message_get_destination( d->msg ); -} - -/** - * Sets the message sender. - * @param sender the sender - * @return false if unsuccessful - */ -bool -Message::setSender( const QString& sender ) -{ - return dbus_message_set_sender( d->msg, sender.latin1() ); -} - -/** - * Returns sender of this message. - * @return sender - */ -QString -Message::sender() const -{ - return dbus_message_get_sender( d->msg ); -} - -QString Message::signature() const -{ - return dbus_message_get_signature( d->msg ); -} - - -/** - * Returns the starting iterator for the fields of this - * message. - * @return starting iterator - */ -Message::iterator -Message::begin() const -{ - return iterator( d->msg ); -} - -/** - * Returns the ending iterator for the fields of this - * message. - * @return ending iterator - */ -Message::iterator -Message::end() const -{ - return iterator(); -} - -/** - * Returns the field at position @p i - * @param i position of the wanted field - * @return QVariant at position @p i or an empty QVariant - */ -QVariant -Message::at( int i ) -{ - iterator itr( d->msg ); - - while ( i-- ) { - if ( itr == end() ) - return QVariant();//nothing there - ++itr; - } - return *itr; -} - -/** - * The underlying DBusMessage of this class. - * @return DBusMessage pointer. - */ -DBusMessage* -Message::message() const -{ - return d->msg; -} - -Message& Message::operator<<( bool b ) -{ - const dbus_bool_t right_size_bool = b; - dbus_message_append_args( d->msg, DBUS_TYPE_BOOLEAN, &right_size_bool, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( Q_INT8 byte ) -{ - dbus_message_append_args( d->msg, DBUS_TYPE_BYTE, &byte, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( Q_INT32 num ) -{ - dbus_message_append_args( d->msg, DBUS_TYPE_INT32, &num, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( Q_UINT32 num ) -{ - dbus_message_append_args( d->msg, DBUS_TYPE_UINT32, &num, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( Q_INT64 num ) -{ - dbus_message_append_args( d->msg, DBUS_TYPE_INT64, &num, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( Q_UINT64 num ) -{ - dbus_message_append_args( d->msg, DBUS_TYPE_UINT64, &num, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( double num ) -{ - dbus_message_append_args( d->msg, DBUS_TYPE_DOUBLE, &num, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( const QString& str ) -{ - const char *u = str.utf8(); - dbus_message_append_args( d->msg, DBUS_TYPE_STRING, &u, - DBUS_TYPE_INVALID ); -} - -Message& Message::operator<<( const QVariant& custom ) -{ - //FIXME: imeplement -} - -} diff --git a/qt3/message.h b/qt3/message.h deleted file mode 100644 index 5e26b819..00000000 --- a/qt3/message.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- mode: C++; c-file-style: "gnu" -*- */ -/* message.h: Qt wrapper for DBusMessage - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_QT_MESSAGE_H -#define DBUS_QT_MESSAGE_H - -#include -#include -#include - -#include "dbus/dbus.h" - -namespace DBusQt { - - class Message - { - public: - class iterator { - public: - iterator(); - iterator( const iterator& ); - iterator( DBusMessage* msg ); - ~iterator(); - - iterator& operator=( const iterator& ); - const QVariant& operator*() const; - QVariant& operator*(); - iterator& operator++(); - iterator operator++(int); - bool operator==( const iterator& it ); - bool operator!=( const iterator& it ); - - QVariant var() const; - protected: - QVariant marshallBaseType( DBusMessageIter* i ); - void fillVar(); - struct IteratorData; - IteratorData *d; - }; - - Message( int messageType ); - Message( DBusMessage * );//hide this one from the public implementation - Message( const QString& service, const QString& path, - const QString& interface, const QString& method ); - Message( const Message& replayingTo ); - Message( const QString& path, const QString& interface, - const QString& name ); - Message( const Message& replayingTo, const QString& errorName, - const QString& errorMessage ); - - Message operator=( const Message& other ); - - virtual ~Message(); - - int type() const; - - void setPath( const QString& ); - QString path() const; - - void setInterface( const QString& ); - QString interface() const; - - void setMember( const QString& ); - QString member() const; - - void setErrorName( const QString& ); - QString errorName() const; - - void setDestination( const QString& ); - QString destination() const; - - bool setSender( const QString& sender ); - QString sender() const; - - QString signature() const; - - iterator begin() const; - iterator end() const; - - QVariant at( int i ); - - - public: - Message& operator<<( bool ); - Message& operator<<( Q_INT8 ); - Message& operator<<( Q_INT32 ); - Message& operator<<( Q_UINT32 ); - Message& operator<<( Q_INT64 ); - Message& operator<<( Q_UINT64 ); - Message& operator<<( double ); - Message& operator<<( const QString& ); - Message& operator<<( const QVariant& ); - //Message& operator<<(); - //Message& operator<<(); - //Message& operator<<(); - //Message& operator<<(); - //Message& operator<<(); - //Message& operator<<(); - //Message& operator<<(); - - protected: - friend class Connection; - DBusMessage* message() const; - - private: - struct Private; - Private *d; - }; - -} - -#endif diff --git a/qt3/server.cpp b/qt3/server.cpp deleted file mode 100644 index 5d6c3ba1..00000000 --- a/qt3/server.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- -/* server.h: Qt wrapper for DBusServer - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.0 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "server.h" -#include "connection.h" - -#include "integrator.h" -using DBusQt::Internal::Integrator; - -namespace DBusQt -{ - -struct Server::Private { - Private() : integrator( 0 ), server( 0 ) - {} - - Integrator *integrator; - DBusServer *server; - DBusError error; -}; - -Server::Server( const QString& addr, QObject *parent ) - : QObject( parent ) -{ - d = new Private; - - if ( !addr.isEmpty() ) { - init( addr ); - } -} - -Server::~Server() -{ - delete d; -} - -bool Server::isConnected() const -{ - return dbus_server_get_is_connected( d->server ); -} - -void Server::disconnect() -{ - dbus_server_disconnect( d->server ); -} - -QString Server::address() const -{ - //FIXME: leak? - return dbus_server_get_address( d->server ); -} - -void Server::listen( const QString& addr ) -{ - if ( !d->server ) { - init( addr ); - } -} - -void Server::init( const QString& addr ) -{ - d->server = dbus_server_listen( addr.ascii(), &d->error ); - d->integrator = new Integrator( d->server, this ); - connect( d->integrator, SIGNAL(newConnection(Connection*)), - SIGNAL(newConnection(Connection*)) ); -} - -} - - -#include "server.moc" diff --git a/qt3/server.h b/qt3/server.h deleted file mode 100644 index 36c729ab..00000000 --- a/qt3/server.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- -/* server.h: Qt wrapper for DBusServer - * - * Copyright (C) 2003 Zack Rusin - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_QT_SERVER_H -#define DBUS_QT_SERVER_H - -#include - -#include "dbus/dbus.h" - -namespace DBusQt -{ - class Connection; - class Server : public QObject - { - Q_OBJECT - public: - Server( const QString& addr = QString::null, QObject *parent=0 ); - ~Server(); - - bool isConnected() const; - QString address() const; - - public slots: - void listen( const QString& addr ); - void disconnect(); - signals: - void newConnection( Connection* ); - - private: - void init( const QString& addr ); - private: - struct Private; - Private *d; - }; -} - -#endif diff --git a/test/Makefile.am b/test/Makefile.am index e419fb8c..b4863c7a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,16 +1,5 @@ - -if HAVE_GLIB - GLIB_SUBDIR=glib -endif -if HAVE_PYTHON - PYTHON_SUBDIR=python -endif -if HAVE_QTESTLIB - QT_SUBDIR=qt -endif - -SUBDIRS=name-test $(GLIB_SUBDIR) $(PYTHON_SUBDIR) $(QT_SUBDIR) -DIST_SUBDIRS=glib python qt name-test +SUBDIRS=name-test +DIST_SUBDIRS=name-test INCLUDES=-I$(top_srcdir) $(DBUS_TEST_CFLAGS) diff --git a/test/data/valid-service-files/debug-glib.service.in b/test/data/valid-service-files/debug-glib.service.in deleted file mode 100644 index 199fd808..00000000 --- a/test/data/valid-service-files/debug-glib.service.in +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.freedesktop.DBus.TestSuiteGLibService -Exec=@TEST_GLIB_SERVICE_BINARY@ diff --git a/test/data/valid-service-files/debug-python.service.in b/test/data/valid-service-files/debug-python.service.in deleted file mode 100644 index 9dca726b..00000000 --- a/test/data/valid-service-files/debug-python.service.in +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.freedesktop.DBus.TestSuitePythonService -Exec=@TEST_PYTHON_SERVICE_BINARY@ diff --git a/test/glib/Makefile.am b/test/glib/Makefile.am deleted file mode 100644 index aebaf37c..00000000 --- a/test/glib/Makefile.am +++ /dev/null @@ -1,80 +0,0 @@ -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) -DDBUS_COMPILATION - -## note that TESTS has special meaning (stuff to use in make check) -## so if adding tests not to be run in make check, don't add them to -## TESTS -if DBUS_BUILD_TESTS -TESTS_ENVIRONMENT=DBUS_TOP_BUILDDIR=$(ABSOLUTE_TOP_BUILDDIR) -TESTS=run-test.sh -else -TESTS= -endif - -EXTRA_DIST=run-test.sh test-service-glib.xml my-object-marshal.list test-service-glib.xml - -if DBUS_BUILD_TESTS - -if HAVE_GLIB_THREADS -THREAD_APPS=test-thread-server test-thread-client test-profile - -test_thread_server_SOURCES= \ - test-thread-server.c \ - test-thread.h - -test_thread_server_LDADD= $(DBUS_GLIB_THREADS_LIBS) $(top_builddir)/glib/libdbus-glib-1.la - -test_thread_client_SOURCES= \ - test-thread-client.c \ - test-thread.h - -test_thread_client_LDADD= $(DBUS_GLIB_THREADS_LIBS) $(top_builddir)/glib/libdbus-glib-1.la -endif - -## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we -## build even when not doing "make check" -noinst_PROGRAMS= test-dbus-glib test-service-glib $(THREAD_APPS) - -test_dbus_glib_SOURCES= \ - my-object-marshal.c \ - test-dbus-glib.c - -test_dbus_glib_LDADD= $(DBUS_GLIB_TOOL_LIBS) $(top_builddir)/glib/libdbus-glib-1.la $(top_builddir)/glib/libdbus-gtool.la - -BUILT_SOURCES = test-service-glib-glue.h test-service-glib-bindings.h my-object-marshal.c my-object-marshal.h - -test_service_glib_SOURCES= \ - my-object-marshal.c \ - test-service-glib.c - -test-service-glib-glue.h: test-service-glib.xml $(top_builddir)/glib/dbus-binding-tool - $(top_builddir)/glib/dbus-binding-tool --prefix=my_object --mode=glib-server --output=test-service-glib-glue.h $(srcdir)/test-service-glib.xml - -test-service-glib-bindings.h: test-service-glib.xml $(top_builddir)/glib/dbus-binding-tool - $(top_builddir)/glib/dbus-binding-tool --prefix=my_object --mode=glib-client --output=test-service-glib-bindings.h $(srcdir)/test-service-glib.xml - -my-object-marshal.c: Makefile my-object-marshal.list - @GLIB_GENMARSHAL@ --prefix=my_object_marshal $(srcdir)/my-object-marshal.list --header --body > my-object-marshal.c - -my-object-marshal.h: Makefile my-object-marshal.list - @GLIB_GENMARSHAL@ --prefix=my_object_marshal $(srcdir)/my-object-marshal.list --header > my-object-marshal.h - - -CLEANFILES = $(BUILT_SOURCES) - -test_service_glib_LDADD= $(top_builddir)/glib/libdbus-glib-1.la $(DBUS_GLIB_THREADS_LIBS) - -else -### not building tests - -if HAVE_GLIB_THREADS -noinst_PROGRAMS=test-profile -endif - -endif - -if HAVE_GLIB_THREADS -test_profile_SOURCES= \ - test-profile.c - -test_profile_LDADD= $(DBUS_GLIB_THREADS_LIBS) $(top_builddir)/glib/libdbus-glib-1.la -endif diff --git a/test/glib/my-object-marshal.list b/test/glib/my-object-marshal.list deleted file mode 100644 index 48cbfad4..00000000 --- a/test/glib/my-object-marshal.list +++ /dev/null @@ -1,2 +0,0 @@ -NONE:STRING,INT,STRING -NONE:STRING,BOXED diff --git a/test/glib/run-test.sh b/test/glib/run-test.sh deleted file mode 100755 index 86f1aee8..00000000 --- a/test/glib/run-test.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/bash - -SCRIPTNAME=$0 -MODE=$1 - -## so the tests can complain if you fail to use the script to launch them -export DBUS_TEST_GLIB_RUN_TEST_SCRIPT=1 - -# Rerun ourselves with tmp session bus if we're not already -if test -z "$DBUS_TEST_GLIB_IN_RUN_TEST"; then - DBUS_TEST_GLIB_IN_RUN_TEST=1 - export DBUS_TEST_GLIB_IN_RUN_TEST - exec $DBUS_TOP_BUILDDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE -fi - -if test x$MODE = xprofile ; then - echo "profiling type $PROFILE_TYPE" - sleep 2 ## this lets the bus get started so its startup time doesn't affect the profile too much - if test x$PROFILE_TYPE = x ; then - PROFILE_TYPE=all - fi - libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/glib/test-profile $PROFILE_TYPE || die "test-profile failed" -elif test x$MODE = xviewer ; then - echo "Launching dbus-viewer" - ARGS= - if test x$DEBUG = x ; then - ARGS="--services org.freedesktop.DBus org.freedesktop.DBus.TestSuiteGLibService" - fi - libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/tools/dbus-viewer $ARGS || die "could not run dbus-viewer" -elif test x$MODE = xwait ; then - echo "Waiting DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" - sleep 86400 -else - echo "running test-dbus-glib" - libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/glib/test-dbus-glib || die "test-dbus-glib failed" -fi diff --git a/test/glib/test-dbus-glib.c b/test/glib/test-dbus-glib.c deleted file mode 100644 index ebcfaeaa..00000000 --- a/test/glib/test-dbus-glib.c +++ /dev/null @@ -1,1621 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -#include -#include -#include -#include -#include "test-service-glib-bindings.h" -#include -#include -#include -#include -#include "my-object-marshal.h" - -static GMainLoop *loop = NULL; -static const char *await_terminating_service = NULL; -static int n_times_foo_received = 0; -static int n_times_frobnicate_received = 0; -static int n_times_frobnicate_received_2 = 0; -static int n_times_sig0_received = 0; -static int n_times_sig1_received = 0; -static int n_times_sig2_received = 0; -static guint exit_timeout = 0; -static gboolean proxy_destroyed = FALSE; -static gboolean proxy_destroy_and_nameowner = FALSE; -static gboolean proxy_destroy_and_nameowner_complete = FALSE; - -static void lose (const char *fmt, ...) G_GNUC_NORETURN G_GNUC_PRINTF (1, 2); -static void lose_gerror (const char *prefix, GError *error) G_GNUC_NORETURN; - -static void -unset_and_free_gvalue (gpointer val) -{ - g_value_unset (val); - g_free (val); -} - -static gboolean -timed_exit (gpointer loop) -{ - g_print ("timed exit!\n"); - g_main_loop_quit (loop); - return TRUE; -} - -static void -proxy_destroyed_cb (DBusGProxy *proxy, gpointer user_data) -{ - proxy_destroyed = TRUE; - if (proxy_destroy_and_nameowner && !proxy_destroy_and_nameowner_complete && await_terminating_service == NULL) - { - g_source_remove (exit_timeout); - g_main_loop_quit (loop); - proxy_destroy_and_nameowner_complete = TRUE; - } -} - -static void -name_owner_changed (DBusGProxy *proxy, - const char *name, - const char *prev_owner, - const char *new_owner, - gpointer user_data) -{ - g_print ("(signal NameOwnerChanged) name owner changed for %s from %s to %s\n", - name, prev_owner, new_owner); - if (await_terminating_service && - !strcmp (name, await_terminating_service) - && !strcmp ("", new_owner)) - { - g_print ("Caught expected ownership loss for %s\n", name); - await_terminating_service = NULL; - if (proxy_destroy_and_nameowner && !proxy_destroy_and_nameowner_complete && proxy_destroyed) - { - g_source_remove (exit_timeout); - g_main_loop_quit (loop); - proxy_destroy_and_nameowner_complete = TRUE; - } - else if (!proxy_destroy_and_nameowner) - { - g_source_remove (exit_timeout); - g_main_loop_quit (loop); - } - } -} - -static void -foo_signal_handler (DBusGProxy *proxy, - double d, - void *user_data) -{ - n_times_foo_received += 1; - - g_print ("Got Foo signal\n"); - - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static void -frobnicate_signal_handler (DBusGProxy *proxy, - int val, - void *user_data) -{ - n_times_frobnicate_received += 1; - - g_assert (val == 42); - g_print ("Got Frobnicate signal\n"); - - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static void -frobnicate_signal_handler_2 (DBusGProxy *proxy, - int val, - void *user_data) -{ - n_times_frobnicate_received_2 += 1; - - g_assert (val == 42); - g_print ("Got Frobnicate signal (again)\n"); -} - -static void -sig0_signal_handler (DBusGProxy *proxy, - const char *str0, - int val, - const char *str1, - void *user_data) -{ - n_times_sig0_received += 1; - - g_assert (!strcmp (str0, "foo")); - - g_assert (val == 22); - - g_assert (!strcmp (str1, "moo")); - - g_print ("Got Sig0 signal\n"); - - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static void -sig1_signal_handler (DBusGProxy *proxy, - const char *str0, - GValue *value, - void *user_data) -{ - n_times_sig1_received += 1; - - g_assert (!strcmp (str0, "baz")); - - g_assert (G_VALUE_HOLDS_STRING (value)); - - g_assert (!strcmp (g_value_get_string (value), "bar")); - - g_print ("Got Sig1 signal\n"); - - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static void -sig2_signal_handler (DBusGProxy *proxy, - GHashTable *table, - void *user_data) -{ - n_times_sig2_received += 1; - - g_assert (g_hash_table_size (table) == 2); - - g_assert (g_hash_table_lookup (table, "baz") != NULL); - g_assert (!strcmp (g_hash_table_lookup (table, "baz"), "cow")); - g_assert (g_hash_table_lookup (table, "bar") != NULL); - g_assert (!strcmp (g_hash_table_lookup (table, "bar"), "foo")); - - g_print ("Got Sig2 signal\n"); - - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static DBusGProxyCall *echo_call; -static guint n_times_echo_cb_entered; -static void -echo_received_cb (DBusGProxy *proxy, - DBusGProxyCall *call, - gpointer data) -{ - GError *error; - char *echo_data; - - g_assert (call == echo_call); - g_assert (data == NULL); - - error = NULL; - echo_data = NULL; - n_times_echo_cb_entered++; - - if (!dbus_g_proxy_end_call (proxy, call, &error, - G_TYPE_STRING, - &echo_data, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete async Echo", error); - g_assert (echo_data != NULL); - g_print ("Async echo gave \"%s\"\n", echo_data); - g_free (echo_data); - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static void -increment_received_cb (DBusGProxy *proxy, - DBusGProxyCall *call, - gpointer data) -{ - GError *error; - guint val; - - g_assert (!strcmp (data, "moo")); - - error = NULL; - if (!dbus_g_proxy_end_call (proxy, call, &error, - G_TYPE_UINT, &val, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete (async) Increment call", error); - - if (val != 43) - lose ("Increment call returned %d, should be 43", val); - - g_print ("Async increment gave \"%d\"\n", val); - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - -static void -increment_async_cb (DBusGProxy *proxy, guint val, GError *error, gpointer data) -{ - if (error) - lose_gerror ("Failed to complete (wrapped async) Increment call", error); - - if (data != NULL) - lose ("(wrapped async) Increment call gave unexpected data"); - if (val != 43) - lose ("(wrapped async) Increment call returned %d, should be 43", val); - - g_print ("(wrapped async) increment gave \"%d\"\n", val); - g_main_loop_quit (loop); - g_source_remove (exit_timeout); -} - - -static void -lose (const char *str, ...) -{ - va_list args; - - va_start (args, str); - - vfprintf (stderr, str, args); - fputc ('\n', stderr); - - va_end (args); - - exit (1); -} - -static void -lose_gerror (const char *prefix, GError *error) -{ - if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) - lose ("%s (%s): %s", prefix, dbus_g_error_get_name (error), - error->message); - else - lose ("%s: %s", prefix, error->message); -} - -static void -run_mainloop (void) -{ - GMainContext *ctx; - - ctx = g_main_loop_get_context (loop); - - while (g_main_context_pending (ctx)) - g_main_context_iteration (ctx, FALSE); -} - -int -main (int argc, char **argv) -{ - DBusGConnection *connection; - GError *error; - DBusGProxy *driver; - DBusGProxy *proxy; - DBusGProxy *proxy2; - char **name_list; - guint name_list_len; - guint i; - DBusGProxyCall *call; - guint32 result; - char *v_STRING_2; - guint32 v_UINT32_2; - double v_DOUBLE_2; - - g_type_init (); - - g_log_set_always_fatal (G_LOG_LEVEL_WARNING); - - loop = g_main_loop_new (NULL, FALSE); - - error = NULL; - connection = dbus_g_bus_get (DBUS_BUS_SESSION, - &error); - if (connection == NULL) - lose_gerror ("Failed to open connection to bus", error); - - /* should always get the same one */ - g_assert (connection == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); - g_assert (connection == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); - g_assert (connection == dbus_g_bus_get (DBUS_BUS_SESSION, NULL)); - - /* Create a proxy object for the "bus driver" */ - - driver = dbus_g_proxy_new_for_name (connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - - dbus_g_proxy_add_signal (driver, - "NameOwnerChanged", - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (driver, - "NameOwnerChanged", - G_CALLBACK (name_owner_changed), - NULL, - NULL); - /* Call ListNames method */ - - error = NULL; - if (!dbus_g_proxy_call (driver, "ListNames", &error, - G_TYPE_INVALID, - G_TYPE_STRV, &name_list, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete ListNames call", error); - - g_print ("Names on the message bus:\n"); - i = 0; - name_list_len = g_strv_length (name_list); - while (i < name_list_len) - { - g_assert (name_list[i] != NULL); - g_print (" %s\n", name_list[i]); - ++i; - } - g_assert (name_list[i] == NULL); - - g_strfreev (name_list); - - g_print ("calling ThisMethodDoesNotExist\n"); - /* Test handling of unknown method */ - if (dbus_g_proxy_call (driver, "ThisMethodDoesNotExist", &error, - G_TYPE_STRING, - "blah blah blah blah blah", - G_TYPE_INT, - 10, - G_TYPE_INVALID, G_TYPE_INVALID) != FALSE) - lose ("Calling nonexistent method succeeded!"); - - g_print ("Got EXPECTED error from calling unknown method: %s\n", error->message); - g_clear_error (&error); - - run_mainloop (); - - /* Activate a service */ - g_print ("Activating echo service\n"); - if (!dbus_g_proxy_call (driver, "StartServiceByName", &error, - G_TYPE_STRING, - "org.freedesktop.DBus.TestSuiteEchoService", - G_TYPE_UINT, 0, - G_TYPE_INVALID, - G_TYPE_UINT, &result, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Activate call", error); - - g_print ("Starting echo service result = 0x%x\n", result); - - /* Activate a service again */ - g_print ("Activating echo service again\n"); - if (!dbus_g_proxy_call (driver, "StartServiceByName", &error, - G_TYPE_STRING, - "org.freedesktop.DBus.TestSuiteEchoService", - G_TYPE_UINT, - 0, - G_TYPE_INVALID, - G_TYPE_UINT, &result, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Activate call", error); - - g_print ("Duplicate start of echo service = 0x%x\n", result); - - /* Talk to the new service */ - - g_print ("Creating proxy for echo service\n"); - proxy = dbus_g_proxy_new_for_name_owner (connection, - "org.freedesktop.DBus.TestSuiteEchoService", - "/org/freedesktop/TestSuite", - "org.freedesktop.TestSuite", - &error); - - if (proxy == NULL) - lose_gerror ("Failed to create proxy for name owner", error); - - run_mainloop (); - - g_print ("Calling Echo\n"); - if (!dbus_g_proxy_call (proxy, "Echo", &error, - G_TYPE_STRING, "my string hello", - G_TYPE_INVALID, - G_TYPE_STRING, &v_STRING_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Echo call", error); - - g_print ("String echoed = \"%s\"\n", v_STRING_2); - g_free (v_STRING_2); - - g_print ("Calling Echo (async)\n"); - echo_call = dbus_g_proxy_begin_call (proxy, "Echo", - echo_received_cb, NULL, NULL, - G_TYPE_STRING, "my string hello", - G_TYPE_INVALID); - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - /* Test oneway call and signal handling */ - - g_print ("Testing Foo emission\n"); - dbus_g_proxy_add_signal (proxy, "Foo", G_TYPE_DOUBLE, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (proxy, "Foo", - G_CALLBACK (foo_signal_handler), - NULL, NULL); - - dbus_g_proxy_call_no_reply (proxy, "EmitFoo", - G_TYPE_INVALID); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_foo_received != 1) - lose ("Foo signal received %d times, should have been 1", n_times_foo_received); - - /* Activate test servie */ - g_print ("Activating TestSuiteGLibService\n"); - error = NULL; - if (!dbus_g_proxy_call (driver, "StartServiceByName", &error, - G_TYPE_STRING, - "org.freedesktop.DBus.TestSuiteGLibService", - G_TYPE_UINT, - 0, - G_TYPE_INVALID, - G_TYPE_UINT, &result, - G_TYPE_INVALID)) { - lose_gerror ("Failed to complete Activate call", error); - } - - g_print ("TestSuiteGLibService activated\n"); - - if (getenv ("DBUS_GLIB_TEST_SLEEP_AFTER_ACTIVATION")) - g_usleep (8 * G_USEC_PER_SEC); - - g_object_unref (G_OBJECT (proxy)); - - run_mainloop (); - - proxy = dbus_g_proxy_new_for_name_owner (connection, - "org.freedesktop.DBus.TestSuiteGLibService", - "/org/freedesktop/DBus/Tests/MyTestObject", - "org.freedesktop.DBus.Tests.MyObject", - &error); - - if (proxy == NULL) - lose_gerror ("Failed to create proxy for name owner", error); - - g_print ("Calling DoNothing\n"); - if (!dbus_g_proxy_call (proxy, "DoNothing", &error, - G_TYPE_INVALID, G_TYPE_INVALID)) - lose_gerror ("Failed to complete DoNothing call", error); - - g_print ("Calling Increment\n"); - error = NULL; - if (!dbus_g_proxy_call (proxy, "Increment", &error, - G_TYPE_UINT, 42, - G_TYPE_INVALID, - G_TYPE_UINT, &v_UINT32_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Increment call", error); - if (v_UINT32_2 != 43) - lose ("Increment call returned %d, should be 43", v_UINT32_2); - - v_UINT32_2 = 0; - g_print ("Calling Increment (async)\n"); - call = dbus_g_proxy_begin_call (proxy, "Increment", - increment_received_cb, g_strdup ("moo"), g_free, - G_TYPE_UINT, 42, - G_TYPE_INVALID); - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - g_print ("Calling IncrementRetval\n"); - error = NULL; - v_UINT32_2 = 0; - if (!dbus_g_proxy_call (proxy, "IncrementRetval", &error, - G_TYPE_UINT, 42, - G_TYPE_INVALID, - G_TYPE_UINT, &v_UINT32_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Increment call", error); - if (v_UINT32_2 != 43) - lose ("IncrementRetval call returned %d, should be 43", v_UINT32_2); - - g_print ("Calling IncrementRetvalError\n"); - error = NULL; - v_UINT32_2 = 0; - if (!dbus_g_proxy_call (proxy, "IncrementRetvalError", &error, - G_TYPE_UINT, 5, - G_TYPE_INVALID, - G_TYPE_UINT, &v_UINT32_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Increment call", error); - if (v_UINT32_2 != 6) - lose ("IncrementRetval call returned %d, should be 6", v_UINT32_2); - - g_print ("Calling ThrowError\n"); - if (dbus_g_proxy_call (proxy, "ThrowError", &error, - G_TYPE_INVALID, G_TYPE_INVALID) != FALSE) - lose ("ThrowError call unexpectedly succeeded!"); - - if (!dbus_g_error_has_name (error, "org.freedesktop.DBus.Tests.MyObject.Foo")) - lose ("ThrowError call returned unexpected error \"%s\": %s", dbus_g_error_get_name (error), - error->message); - - g_print ("ThrowError failed (as expected) returned error: %s\n", error->message); - g_clear_error (&error); - - g_print ("Calling IncrementRetvalError (for error)\n"); - error = NULL; - v_UINT32_2 = 0; - if (dbus_g_proxy_call (proxy, "IncrementRetvalError", &error, - G_TYPE_UINT, 20, - G_TYPE_INVALID, - G_TYPE_UINT, &v_UINT32_2, - G_TYPE_INVALID) != FALSE) - lose ("IncrementRetvalError call unexpectedly succeeded!"); - if (!dbus_g_error_has_name (error, "org.freedesktop.DBus.Tests.MyObject.Foo")) - lose ("IncrementRetvalError call returned unexpected error \"%s\": %s", dbus_g_error_get_name (error), error->message); - g_clear_error (&error); - - error = NULL; - g_print ("Calling Uppercase\n"); - if (!dbus_g_proxy_call (proxy, "Uppercase", &error, - G_TYPE_STRING, "foobar", - G_TYPE_INVALID, - G_TYPE_STRING, &v_STRING_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Uppercase call", error); - if (strcmp ("FOOBAR", v_STRING_2) != 0) - lose ("Uppercase call returned unexpected string %s", v_STRING_2); - g_free (v_STRING_2); - - run_mainloop (); - - g_print ("Calling ManyArgs\n"); - if (!dbus_g_proxy_call (proxy, "ManyArgs", &error, - G_TYPE_UINT, 26, - G_TYPE_STRING, "bazwhee", - G_TYPE_DOUBLE, G_PI, - G_TYPE_INVALID, - G_TYPE_DOUBLE, &v_DOUBLE_2, - G_TYPE_STRING, &v_STRING_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete ManyArgs call", error); - if (v_DOUBLE_2 < 55 || v_DOUBLE_2 > 56) - lose ("ManyArgs call returned unexpected double value %f", v_DOUBLE_2); - if (strcmp ("BAZWHEE", v_STRING_2) != 0) - lose ("ManyArgs call returned unexpected string %s", v_STRING_2); - g_free (v_STRING_2); - - g_print ("Calling (wrapped) do_nothing\n"); - if (!org_freedesktop_DBus_Tests_MyObject_do_nothing (proxy, &error)) - lose_gerror ("Failed to complete (wrapped) DoNothing call", error); - - g_print ("Calling (wrapped) increment\n"); - if (!org_freedesktop_DBus_Tests_MyObject_increment (proxy, 42, &v_UINT32_2, &error)) - lose_gerror ("Failed to complete (wrapped) Increment call", error); - - if (v_UINT32_2 != 43) - lose ("(wrapped) increment call returned %d, should be 43", v_UINT32_2); - - g_print ("Calling (wrapped async) increment\n"); - if (!org_freedesktop_DBus_Tests_MyObject_increment_async (proxy, 42, increment_async_cb, NULL)) - lose_gerror ("Failed to complete (wrapped) Increment call", error); - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - v_UINT32_2 = 0; - if (!org_freedesktop_DBus_Tests_MyObject_async_increment (proxy, 42, &v_UINT32_2, &error)) - lose_gerror ("Failed to complete (wrapped) AsyncIncrement call", error); - - if (v_UINT32_2 != 43) - lose ("(wrapped) async increment call returned %d, should be 43", v_UINT32_2); - - g_print ("Calling (wrapped) throw_error\n"); - if (org_freedesktop_DBus_Tests_MyObject_throw_error (proxy, &error) != FALSE) - lose ("(wrapped) ThrowError call unexpectedly succeeded!"); - - g_print ("(wrapped) ThrowError failed (as expected) returned error: %s\n", error->message); - g_clear_error (&error); - - if (org_freedesktop_DBus_Tests_MyObject_async_throw_error (proxy, &error) != FALSE) - lose ("(wrapped) AsyncThrowError call unexpectedly succeeded!"); - - g_print ("(wrapped) AsyncThrowError failed (as expected) returned error: %s\n", error->message); - g_clear_error (&error); - - g_print ("Calling (wrapped) uppercase\n"); - if (!org_freedesktop_DBus_Tests_MyObject_uppercase (proxy, "foobar", &v_STRING_2, &error)) - lose_gerror ("Failed to complete (wrapped) Uppercase call", error); - if (strcmp ("FOOBAR", v_STRING_2) != 0) - lose ("(wrapped) Uppercase call returned unexpected string %s", v_STRING_2); - g_free (v_STRING_2); - - g_print ("Calling (wrapped) many_args\n"); - if (!org_freedesktop_DBus_Tests_MyObject_many_args (proxy, 26, "bazwhee", G_PI, - &v_DOUBLE_2, &v_STRING_2, &error)) - lose_gerror ("Failed to complete (wrapped) ManyArgs call", error); - - if (v_DOUBLE_2 < 55 || v_DOUBLE_2 > 56) - - lose ("(wrapped) ManyArgs call returned unexpected double value %f", v_DOUBLE_2); - - if (strcmp ("BAZWHEE", v_STRING_2) != 0) - lose ("(wrapped) ManyArgs call returned unexpected string %s", v_STRING_2); - g_free (v_STRING_2); - - { - guint32 arg0; - char *arg1; - gint32 arg2; - guint32 arg3; - guint32 arg4; - char *arg5; - - g_print ("Calling (wrapped) many_return\n"); - if (!org_freedesktop_DBus_Tests_MyObject_many_return (proxy, &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &error)) - lose_gerror ("Failed to complete (wrapped) ManyReturn call", error); - - if (arg0 != 42) - lose ("(wrapped) ManyReturn call returned unexpected guint32 value %u", arg0); - - if (strcmp ("42", arg1) != 0) - lose ("(wrapped) ManyReturn call returned unexpected string %s", arg1); - g_free (arg1); - - if (arg2 != -67) - lose ("(wrapped) ManyReturn call returned unexpected gint32 value %u", arg2); - - if (arg3 != 2) - lose ("(wrapped) ManyReturn call returned unexpected guint32 value %u", arg3); - - if (arg4 != 26) - lose ("(wrapped) ManyReturn call returned unexpected guint32 value %u", arg4); - - if (strcmp ("hello world", arg5)) - lose ("(wrapped) ManyReturn call returned unexpected string %s", arg5); - g_free (arg5); - } - - run_mainloop (); - - { - GValue value = {0, }; - - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, "foo"); - - g_print ("Calling (wrapped) stringify, with string\n"); - if (!org_freedesktop_DBus_Tests_MyObject_stringify (proxy, - &value, - &v_STRING_2, - &error)) - lose_gerror ("Failed to complete (wrapped) stringify call", error); - if (strcmp ("foo", v_STRING_2) != 0) - lose ("(wrapped) stringify call returned unexpected string %s", v_STRING_2); - g_free (v_STRING_2); - - g_value_unset (&value); - g_value_init (&value, G_TYPE_INT); - g_value_set_int (&value, 42); - - g_print ("Calling (wrapped) stringify, with int\n"); - if (!org_freedesktop_DBus_Tests_MyObject_stringify (proxy, - &value, - &v_STRING_2, - &error)) - lose_gerror ("Failed to complete (wrapped) stringify call 2", error); - if (strcmp ("42", v_STRING_2) != 0) - lose ("(wrapped) stringify call 2 returned unexpected string %s", v_STRING_2); - g_value_unset (&value); - g_free (v_STRING_2); - - g_value_init (&value, G_TYPE_INT); - g_value_set_int (&value, 88); - g_print ("Calling (wrapped) stringify, with another int\n"); - if (!org_freedesktop_DBus_Tests_MyObject_stringify (proxy, - &value, - NULL, - &error)) - lose_gerror ("Failed to complete (wrapped) stringify call 3", error); - g_value_unset (&value); - - g_print ("Calling (wrapped) unstringify, for string\n"); - if (!org_freedesktop_DBus_Tests_MyObject_unstringify (proxy, - "foo", - &value, - &error)) - lose_gerror ("Failed to complete (wrapped) unstringify call", error); - if (!G_VALUE_HOLDS_STRING (&value)) - lose ("(wrapped) unstringify call returned unexpected value type %d", (int) G_VALUE_TYPE (&value)); - if (strcmp (g_value_get_string (&value), "foo")) - lose ("(wrapped) unstringify call returned unexpected string %s", - g_value_get_string (&value)); - - g_value_unset (&value); - - g_print ("Calling (wrapped) unstringify, for int\n"); - if (!org_freedesktop_DBus_Tests_MyObject_unstringify (proxy, - "10", - &value, - &error)) - lose_gerror ("Failed to complete (wrapped) unstringify call", error); - if (!G_VALUE_HOLDS_INT (&value)) - lose ("(wrapped) unstringify call returned unexpected value type %d", (int) G_VALUE_TYPE (&value)); - if (g_value_get_int (&value) != 10) - lose ("(wrapped) unstringify call returned unexpected integer %d", - g_value_get_int (&value)); - - g_value_unset (&value); - } - - run_mainloop (); - - { - GArray *array; - guint32 arraylen; - - array = g_array_new (FALSE, TRUE, sizeof (guint32)); - - arraylen = 0; - g_print ("Calling (wrapped) zero-length recursive1\n"); - if (!org_freedesktop_DBus_Tests_MyObject_recursive1 (proxy, array, - &arraylen, &error)) - lose_gerror ("Failed to complete (wrapped) zero-length recursive1 call", error); - if (arraylen != 0) - lose ("(wrapped) zero-length recursive1 call returned invalid length %u", arraylen); - } - - { - GArray *array; - guint32 val; - guint32 arraylen; - - array = g_array_new (FALSE, TRUE, sizeof (guint32)); - val = 42; - g_array_append_val (array, val); - val = 69; - g_array_append_val (array, val); - val = 88; - g_array_append_val (array, val); - val = 26; - g_array_append_val (array, val); - val = 2; - g_array_append_val (array, val); - - arraylen = 0; - g_print ("Calling (wrapped) recursive1\n"); - if (!org_freedesktop_DBus_Tests_MyObject_recursive1 (proxy, array, - &arraylen, &error)) - lose_gerror ("Failed to complete (wrapped) recursive1 call", error); - if (arraylen != 5) - lose ("(wrapped) recursive1 call returned invalid length %u", arraylen); - } - - { - GArray *array = NULL; - guint32 *arrayvals; - - g_print ("Calling (wrapped) recursive2\n"); - if (!org_freedesktop_DBus_Tests_MyObject_recursive2 (proxy, 2, &array, &error)) - lose_gerror ("Failed to complete (wrapped) Recursive2 call", error); - - if (array == NULL) - lose ("(wrapped) Recursive2 call returned NULL"); - if (array->len != 5) - lose ("(wrapped) Recursive2 call returned unexpected array length %u", array->len); - - arrayvals = (guint32*) array->data; - if (arrayvals[0] != 42) - lose ("(wrapped) Recursive2 call returned unexpected value %d in position 0", arrayvals[0]); - if (arrayvals[1] != 26) - lose ("(wrapped) Recursive2 call returned unexpected value %d in position 1", arrayvals[1]); - if (arrayvals[4] != 2) - lose ("(wrapped) Recursive2 call returned unexpected value %d in position 4", arrayvals[4]); - - g_array_free (array, TRUE); - } - - run_mainloop (); - - { - char **strs; - char **strs_ret; - - strs = g_new0 (char *, 4); - strs[0] = "hello"; - strs[1] = "HellO"; - strs[2] = "HELLO"; - strs[3] = NULL; - - strs_ret = NULL; - g_print ("Calling (wrapped) many_uppercase\n"); - if (!org_freedesktop_DBus_Tests_MyObject_many_uppercase (proxy, strs, &strs_ret, &error)) - lose_gerror ("Failed to complete (wrapped) ManyUppercase call", error); - g_assert (strs_ret != NULL); - if (strcmp ("HELLO", strs_ret[0]) != 0) - lose ("(wrapped) ManyUppercase call returned unexpected string %s", strs_ret[0]); - if (strcmp ("HELLO", strs_ret[1]) != 0) - lose ("(wrapped) ManyUppercase call returned unexpected string %s", strs_ret[1]); - if (strcmp ("HELLO", strs_ret[2]) != 0) - lose ("(wrapped) ManyUppercase call returned unexpected string %s", strs_ret[2]); - - g_free (strs); - g_strfreev (strs_ret); - } - - { - GHashTable *table; - guint len; - - table = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (table, "moooo", "b"); - g_hash_table_insert (table, "xxx", "cow!"); - - len = 0; - g_print ("Calling (wrapped) str_hash_len\n"); - if (!org_freedesktop_DBus_Tests_MyObject_str_hash_len (proxy, table, &len, &error)) - lose_gerror ("(wrapped) StrHashLen call failed", error); - if (len != 13) - lose ("(wrapped) StrHashLen returned unexpected length %u", len); - g_hash_table_destroy (table); - } - - { - GHashTable *table; - const char *val; - - g_print ("Calling (wrapped) get_hash\n"); - if (!org_freedesktop_DBus_Tests_MyObject_get_hash (proxy, &table, &error)) - lose_gerror ("(wrapped) GetHash call failed", error); - val = g_hash_table_lookup (table, "foo"); - if (val == NULL || strcmp ("bar", val)) - lose ("(wrapped) StrHashLen returned invalid value %s for key \"foo\"", - val ? val : "(null)"); - val = g_hash_table_lookup (table, "baz"); - if (val == NULL || strcmp ("whee", val)) - lose ("(wrapped) StrHashLen returned invalid value %s for key \"whee\"", - val ? val : "(null)"); - val = g_hash_table_lookup (table, "cow"); - if (val == NULL || strcmp ("crack", val)) - lose ("(wrapped) StrHashLen returned invalid value %s for key \"cow\"", - val ? val : "(null)"); - if (g_hash_table_size (table) != 3) - lose ("(wrapped) StrHashLen returned unexpected hash size %u", - g_hash_table_size (table)); - - g_hash_table_destroy (table); - } - - run_mainloop (); - - { - GValueArray *vals; - GValueArray *vals_ret; - GValue *val; - - vals = g_value_array_new (3); - - g_value_array_append (vals, NULL); - g_value_init (g_value_array_get_nth (vals, vals->n_values - 1), G_TYPE_STRING); - g_value_set_string (g_value_array_get_nth (vals, 0), "foo"); - - g_value_array_append (vals, NULL); - g_value_init (g_value_array_get_nth (vals, vals->n_values - 1), G_TYPE_UINT); - g_value_set_uint (g_value_array_get_nth (vals, vals->n_values - 1), 42); - - g_value_array_append (vals, NULL); - g_value_init (g_value_array_get_nth (vals, vals->n_values - 1), G_TYPE_VALUE); - val = g_new0 (GValue, 1); - g_value_init (val, G_TYPE_UCHAR); - g_value_set_uchar (val, '!'); - g_value_set_boxed (g_value_array_get_nth (vals, vals->n_values - 1), val); - - vals_ret = NULL; - g_print ("Calling SendCar\n"); - if (!dbus_g_proxy_call (proxy, "SendCar", &error, - G_TYPE_VALUE_ARRAY, vals, - G_TYPE_INVALID, - G_TYPE_VALUE_ARRAY, &vals_ret, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete SendCar call", error); - - g_assert (vals_ret != NULL); - g_assert (vals_ret->n_values == 2); - - g_assert (G_VALUE_HOLDS_UINT (g_value_array_get_nth (vals_ret, 0))); - g_assert (g_value_get_uint (g_value_array_get_nth (vals_ret, 0)) == 43); - - g_assert (G_VALUE_TYPE (g_value_array_get_nth (vals_ret, 1)) == DBUS_TYPE_G_OBJECT_PATH); - g_assert (!strcmp ("/org/freedesktop/DBus/Tests/MyTestObject2", - g_value_get_boxed (g_value_array_get_nth (vals_ret, 1)))); - - g_value_array_free (vals); - g_value_array_free (vals_ret); - } - - { - GValue *val; - GHashTable *table; - GHashTable *ret_table; - - table = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, unset_and_free_gvalue); - - val = g_new0 (GValue, 1); - g_value_init (val, G_TYPE_UINT); - g_value_set_uint (val, 42); - g_hash_table_insert (table, g_strdup ("foo"), val); - - val = g_new0 (GValue, 1); - g_value_init (val, G_TYPE_STRING); - g_value_set_string (val, "hello"); - g_hash_table_insert (table, g_strdup ("bar"), val); - - ret_table = NULL; - g_print ("Calling ManyStringify\n"); - if (!dbus_g_proxy_call (proxy, "ManyStringify", &error, - dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), table, - G_TYPE_INVALID, - dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &ret_table, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete ManyStringify call", error); - - g_assert (ret_table != NULL); - g_assert (g_hash_table_size (ret_table) == 2); - - val = g_hash_table_lookup (ret_table, "foo"); - g_assert (val != NULL); - g_assert (G_VALUE_HOLDS_STRING (val)); - g_assert (!strcmp ("42", g_value_get_string (val))); - - val = g_hash_table_lookup (ret_table, "bar"); - g_assert (val != NULL); - g_assert (G_VALUE_HOLDS_STRING (val)); - g_assert (!strcmp ("hello", g_value_get_string (val))); - - g_hash_table_destroy (table); - g_hash_table_destroy (ret_table); - } - - { - GPtrArray *in_array; - GPtrArray *out_array; - char **strs; - GArray *uints; - - in_array = g_ptr_array_new (); - - strs = g_new0 (char *, 3); - strs[0] = "foo"; - strs[1] = "bar"; - strs[2] = NULL; - g_ptr_array_add (in_array, strs); - - strs = g_new0 (char *, 4); - strs[0] = "baz"; - strs[1] = "whee"; - strs[2] = "moo"; - strs[3] = NULL; - g_ptr_array_add (in_array, strs); - - out_array = NULL; - g_print ("Calling RecArrays\n"); - if (!dbus_g_proxy_call (proxy, "RecArrays", &error, - dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRV), in_array, - G_TYPE_INVALID, - dbus_g_type_get_collection ("GPtrArray", - dbus_g_type_get_collection ("GPtrArray", - G_TYPE_UINT)), &out_array, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete RecArrays call", error); - g_free (g_ptr_array_index (in_array, 0)); - g_free (g_ptr_array_index (in_array, 1)); - - g_assert (out_array); - g_assert (out_array->len == 2); - uints = g_ptr_array_index (out_array, 0); - g_assert (uints); - g_assert (uints->len == 3); - g_assert (g_array_index (uints, guint, 0) == 10); - g_assert (g_array_index (uints, guint, 1) == 42); - g_assert (g_array_index (uints, guint, 2) == 27); - g_array_free (uints, TRUE); - uints = g_ptr_array_index (out_array, 1); - g_assert (uints); - g_assert (uints->len == 1); - g_assert (g_array_index (uints, guint, 0) == 30); - g_array_free (uints, TRUE); - g_ptr_array_free (out_array, TRUE); - } - - { - guint val; - char *ret_path; - DBusGProxy *ret_proxy; - - g_print ("Calling (wrapped) objpath\n"); - if (!dbus_g_proxy_call (proxy, "Objpath", &error, - DBUS_TYPE_G_PROXY, proxy, G_TYPE_INVALID, - DBUS_TYPE_G_PROXY, &ret_proxy, G_TYPE_INVALID)) - lose_gerror ("Failed to complete Objpath call", error); - if (strcmp ("/org/freedesktop/DBus/Tests/MyTestObject2", - dbus_g_proxy_get_path (ret_proxy)) != 0) - lose ("(wrapped) objpath call returned unexpected proxy %s", - dbus_g_proxy_get_path (ret_proxy)); - - g_print ("Doing get/increment val tests\n"); - val = 1; - if (!org_freedesktop_DBus_Tests_MyObject_get_val (ret_proxy, &val, &error)) - lose_gerror ("Failed to complete (wrapped) GetVal call", error); - if (val != 0) - lose ("(wrapped) GetVal returned invalid value %d", val); - - if (!org_freedesktop_DBus_Tests_MyObject_increment_val (ret_proxy, &error)) - lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); - - if (!org_freedesktop_DBus_Tests_MyObject_increment_val (ret_proxy, &error)) - lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); - - if (!org_freedesktop_DBus_Tests_MyObject_increment_val (ret_proxy, &error)) - lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); - - if (!org_freedesktop_DBus_Tests_MyObject_get_val (ret_proxy, &val, &error)) - lose_gerror ("Failed to complete (wrapped) GetVal call", error); - if (val != 3) - lose ("(wrapped) GetVal returned invalid value %d", val); - - if (!org_freedesktop_DBus_Tests_MyObject_get_val (proxy, &val, &error)) - lose_gerror ("Failed to complete (wrapped) GetVal call", error); - if (val != 0) - lose ("(wrapped) GetVal returned invalid value %d", val); - - if (!org_freedesktop_DBus_Tests_MyObject_increment_val (proxy, &error)) - lose_gerror ("Failed to complete (wrapped) IncrementVal call", error); - - if (!org_freedesktop_DBus_Tests_MyObject_get_val (proxy, &val, &error)) - lose_gerror ("Failed to complete (wrapped) GetVal call", error); - if (val != 1) - lose ("(wrapped) GetVal returned invalid value %d", val); - - if (!org_freedesktop_DBus_Tests_MyObject_get_val (ret_proxy, &val, &error)) - lose_gerror ("Failed to complete (wrapped) GetVal call", error); - if (val != 3) - lose ("(wrapped) GetVal returned invalid value %d", val); - - g_object_unref (G_OBJECT (ret_proxy)); - - g_print ("Calling objpath again\n"); - ret_proxy = NULL; - - if (!dbus_g_proxy_call (proxy, "Objpath", &error, - DBUS_TYPE_G_OBJECT_PATH, - dbus_g_proxy_get_path (proxy), - G_TYPE_INVALID, - DBUS_TYPE_G_OBJECT_PATH, - &ret_path, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Objpath call 2", error); - if (strcmp ("/org/freedesktop/DBus/Tests/MyTestObject2", ret_path) != 0) - lose ("Objpath call 2 returned unexpected path %s", - ret_path); - - ret_proxy = dbus_g_proxy_new_for_name_owner (connection, - "org.freedesktop.DBus.TestSuiteGLibService", - ret_path, - "org.freedesktop.DBus.Tests.FooObject", - &error); - g_free (ret_path); - - val = 0; - if (!org_freedesktop_DBus_Tests_FooObject_get_value (ret_proxy, &val, &error)) - lose_gerror ("Failed to complete (wrapped) GetValue call", error); - if (val != 3) - lose ("(wrapped) GetValue returned invalid value %d", val); - } - - run_mainloop (); - - { - GPtrArray *objs; - guint i; - - g_print ("Calling GetObjs\n"); - - if (!dbus_g_proxy_call (proxy, "GetObjs", &error, G_TYPE_INVALID, - dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH), - &objs, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete GetObjs call", error); - if (objs->len != 2) - lose ("GetObjs call returned unexpected number of objects %d, expected 2", - objs->len); - - if (strcmp ("/org/freedesktop/DBus/Tests/MyTestObject", - g_ptr_array_index (objs, 0)) != 0) - lose ("GetObjs call returned unexpected path \"%s\" in position 0; expected /org/freedesktop/DBus/Tests/MyTestObject", (char*) g_ptr_array_index (objs, 0)); - - if (strcmp ("/org/freedesktop/DBus/Tests/MyTestObject2", - g_ptr_array_index (objs, 1)) != 0) - lose ("GetObjs call returned unexpected path \"%s\" in position 1; expected /org/freedesktop/DBus/Tests/MyTestObject2", (char*) g_ptr_array_index (objs, 1)); - - for (i = 0; i < objs->len; i++) - g_free (g_ptr_array_index (objs, i)); - g_ptr_array_free (objs, TRUE); - } - - { - GValue *variant; - GArray *array; - gint i; - - g_print ("Calling ProcessVariantOfArrayOfInts123\n"); - - array = g_array_sized_new (FALSE, FALSE, sizeof(gint), 3); - i = 1; - g_array_append_val (array, i); - i++; - g_array_append_val (array, i); - i++; - g_array_append_val (array, i); - - variant = g_new0 (GValue, 1); - g_value_init (variant, dbus_g_type_get_collection ("GArray", G_TYPE_INT)); - g_value_set_boxed_take_ownership (variant, array); - - if (!dbus_g_proxy_call (proxy, "ProcessVariantOfArrayOfInts123", &error, - G_TYPE_VALUE, variant, - G_TYPE_INVALID, - G_TYPE_INVALID)) - lose_gerror ("Failed to send a vairant of array of ints 1, 2 and 3!", error); - - g_value_unset (variant); - } - - for (i=0; i<3; i++) - { - gchar *val; - GHashTable *table; - GHashTable *subtable; - GHashTable *ret_table; - - table = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) (g_free), - (GDestroyNotify) (g_hash_table_destroy)); - - subtable = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) (g_free), - (GDestroyNotify) (g_free)); - g_hash_table_insert (subtable, g_strdup ("foo"), g_strdup("1")); - g_hash_table_insert (subtable, g_strdup ("bar"), g_strdup("2")); - g_hash_table_insert (subtable, g_strdup ("baz"), g_strdup("3")); - - g_hash_table_insert (table, g_strdup("dict1"), subtable); - - subtable = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) (g_free), - (GDestroyNotify) (g_free)); - g_hash_table_insert (subtable, g_strdup ("foo"), g_strdup("4")); - g_hash_table_insert (subtable, g_strdup ("bar"), g_strdup("5")); - g_hash_table_insert (subtable, g_strdup ("baz"), g_strdup("6")); - - g_hash_table_insert (table, g_strdup("dict2"), subtable); - - subtable = NULL; - - ret_table = NULL; - - g_print ("Calling DictOfDicts\n"); - if (!dbus_g_proxy_call (proxy, "DictOfDicts", &error, - dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, - dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, - G_TYPE_STRING)), table, - G_TYPE_INVALID, - dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, - dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, - G_TYPE_STRING)), &ret_table, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete DictOfDicts call", error); - - g_assert (ret_table != NULL); - g_assert (g_hash_table_size (ret_table) == 2); - - subtable = g_hash_table_lookup (ret_table, "dict1"); - g_assert(subtable); - g_assert (g_hash_table_size (subtable) == 3); - - val = g_hash_table_lookup (subtable, "foo"); - g_assert (val != NULL); - g_assert (!strcmp ("dict1 1", val)); - - val = g_hash_table_lookup (subtable, "bar"); - g_assert (val != NULL); - g_assert (!strcmp ("dict1 2", val)); - - val = g_hash_table_lookup (subtable, "baz"); - g_assert (val != NULL); - g_assert (!strcmp ("dict1 3", val)); - - subtable = g_hash_table_lookup (ret_table, "dict2"); - g_assert(subtable); - g_assert (g_hash_table_size (subtable) == 3); - - val = g_hash_table_lookup (subtable, "foo"); - g_assert (val != NULL); - g_assert (!strcmp ("dict2 4", val)); - - val = g_hash_table_lookup (subtable, "bar"); - g_assert (val != NULL); - g_assert (!strcmp ("dict2 5", val)); - - val = g_hash_table_lookup (subtable, "baz"); - g_assert (val != NULL); - g_assert (!strcmp ("dict2 6", val)); - - g_hash_table_destroy (table); - g_hash_table_destroy (ret_table); - - g_mem_profile (); - } - - - - /* Signal handling tests */ - - g_print ("Testing signal handling\n"); - dbus_g_proxy_add_signal (proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (proxy, "Frobnicate", - G_CALLBACK (frobnicate_signal_handler), - NULL, NULL); - - g_print ("Calling EmitFrobnicate\n"); - if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, - G_TYPE_INVALID, G_TYPE_INVALID)) - lose_gerror ("Failed to complete EmitFrobnicate call", error); - - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_frobnicate_received != 1) - lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); - - g_print ("Calling EmitFrobnicate again\n"); - if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, - G_TYPE_INVALID, G_TYPE_INVALID)) - lose_gerror ("Failed to complete EmitFrobnicate call", error); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_frobnicate_received != 2) - lose ("Frobnicate signal received %d times, should have been 2", n_times_frobnicate_received); - - g_object_unref (G_OBJECT (proxy)); - - run_mainloop (); - - g_print ("Creating proxy for FooObject interface\n"); - proxy = dbus_g_proxy_new_for_name_owner (connection, - "org.freedesktop.DBus.TestSuiteGLibService", - "/org/freedesktop/DBus/Tests/MyTestObject", - "org.freedesktop.DBus.Tests.FooObject", - &error); - - if (proxy == NULL) - lose_gerror ("Failed to create proxy for name owner", error); - - dbus_g_object_register_marshaller (my_object_marshal_VOID__STRING_INT_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INVALID); - - dbus_g_object_register_marshaller (my_object_marshal_VOID__STRING_BOXED, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); - - dbus_g_proxy_add_signal (proxy, "Sig0", G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (proxy, "Sig1", G_TYPE_STRING, G_TYPE_VALUE, G_TYPE_INVALID); - dbus_g_proxy_add_signal (proxy, "Sig2", DBUS_TYPE_G_STRING_STRING_HASHTABLE, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (proxy, "Sig0", - G_CALLBACK (sig0_signal_handler), - NULL, NULL); - dbus_g_proxy_connect_signal (proxy, "Sig1", - G_CALLBACK (sig1_signal_handler), - NULL, NULL); - dbus_g_proxy_connect_signal (proxy, "Sig2", - G_CALLBACK (sig2_signal_handler), - NULL, NULL); - - g_print ("Calling FooObject EmitSignals\n"); - dbus_g_proxy_call_no_reply (proxy, "EmitSignals", G_TYPE_INVALID); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_sig0_received != 1) - lose ("Sig0 signal received %d times, should have been 1", n_times_sig0_received); - if (n_times_sig1_received != 1) - lose ("Sig1 signal received %d times, should have been 1", n_times_sig1_received); - - g_print ("Calling FooObject EmitSignals and EmitSignal2\n"); - dbus_g_proxy_call_no_reply (proxy, "EmitSignal2", G_TYPE_INVALID); - dbus_g_connection_flush (connection); - - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_sig2_received != 1) - lose ("Sig2 signal received %d times, should have been 1", n_times_sig2_received); - - g_print ("Calling FooObject EmitSignals two more times\n"); - dbus_g_proxy_call_no_reply (proxy, "EmitSignals", G_TYPE_INVALID); - dbus_g_proxy_call_no_reply (proxy, "EmitSignals", G_TYPE_INVALID); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_sig0_received != 3) - lose ("Sig0 signal received %d times, should have been 3", n_times_sig0_received); - if (n_times_sig1_received != 3) - lose ("Sig1 signal received %d times, should have been 3", n_times_sig1_received); - - /* Terminate again */ - g_print ("Terminating service\n"); - await_terminating_service = "org.freedesktop.DBus.TestSuiteGLibService"; - dbus_g_proxy_call_no_reply (proxy, "Terminate", G_TYPE_INVALID); - - proxy_destroyed = FALSE; - proxy_destroy_and_nameowner = TRUE; - proxy_destroy_and_nameowner_complete = FALSE; - - g_signal_connect (G_OBJECT (proxy), - "destroy", - G_CALLBACK (proxy_destroyed_cb), - NULL); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (await_terminating_service != NULL) - lose ("Didn't see name loss for \"org.freedesktop.DBus.TestSuiteGLibService\""); - if (!proxy_destroyed) - lose ("Didn't get proxy_destroyed"); - g_print ("Proxy destroyed successfully\n"); - - /* Don't need to unref, proxy was destroyed */ - - run_mainloop (); - - /* Create a new proxy for the name; should not be associated */ - proxy = dbus_g_proxy_new_for_name (connection, - "org.freedesktop.DBus.TestSuiteGLibService", - "/org/freedesktop/DBus/Tests/MyTestObject", - "org.freedesktop.DBus.Tests.MyObject"); - g_assert (proxy != NULL); - - proxy_destroyed = FALSE; - proxy_destroy_and_nameowner = FALSE; - proxy_destroy_and_nameowner_complete = FALSE; - - g_signal_connect (G_OBJECT (proxy), - "destroy", - G_CALLBACK (proxy_destroyed_cb), - NULL); - - if (!dbus_g_proxy_call (driver, "GetNameOwner", &error, - G_TYPE_STRING, - "org.freedesktop.DBus.TestSuiteGLibService", - G_TYPE_INVALID, - G_TYPE_STRING, - &v_STRING_2, - G_TYPE_INVALID)) { - if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NAME_HAS_NO_OWNER) - g_print ("Got expected error \"org.freedesktop.DBus.Error.NameHasNoOwner\"\n"); - else - lose_gerror ("Unexpected error from GetNameOwner", error); - } else - lose ("GetNameOwner unexpectedly succeeded!"); - g_clear_error (&error); - - /* This will have the side-effect of activating the service, thus - * causing a NameOwnerChanged, which should let our name proxy - * get signals - */ - g_print ("Calling Uppercase for name proxy\n"); - if (!dbus_g_proxy_call (proxy, "Uppercase", &error, - G_TYPE_STRING, "bazwhee", - G_TYPE_INVALID, - G_TYPE_STRING, &v_STRING_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Uppercase call", error); - g_free (v_STRING_2); - - if (getenv ("DBUS_GLIB_TEST_SLEEP_AFTER_ACTIVATION1")) - g_usleep (8 * G_USEC_PER_SEC); - - dbus_g_proxy_add_signal (proxy, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (proxy, "Frobnicate", - G_CALLBACK (frobnicate_signal_handler), - NULL, NULL); - - g_print ("Calling EmitFrobnicate\n"); - if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, - G_TYPE_INVALID, G_TYPE_INVALID)) - lose_gerror ("Failed to complete EmitFrobnicate call", error); - - n_times_frobnicate_received = 0; - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_frobnicate_received != 1) - lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); - - /* Now terminate the service, then start it again (implicitly) and wait for signals */ - g_print ("Terminating service (2)\n"); - await_terminating_service = "org.freedesktop.DBus.TestSuiteGLibService"; - dbus_g_proxy_call_no_reply (proxy, "Terminate", G_TYPE_INVALID); - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - if (await_terminating_service != NULL) - lose ("Didn't see name loss for \"org.freedesktop.DBus.TestSuiteGLibService\""); - - if (proxy_destroyed) - lose ("Unexpectedly got proxy_destroyed!"); - - n_times_frobnicate_received = 0; - - g_print ("Calling EmitFrobnicate (2)\n"); - if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, - G_TYPE_INVALID, G_TYPE_INVALID)) - lose_gerror ("Failed to complete EmitFrobnicate call", error); - - if (getenv ("DBUS_GLIB_TEST_SLEEP_AFTER_ACTIVATION2")) - g_usleep (8 * G_USEC_PER_SEC); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_frobnicate_received != 1) - lose ("Frobnicate signal received %d times, should have been 1", n_times_frobnicate_received); - - if (proxy_destroyed) - lose ("Unexpectedly got proxy_destroyed!"); - - /* Create another proxy for the name; should be associated immediately */ - proxy2 = dbus_g_proxy_new_for_name (connection, - "org.freedesktop.DBus.TestSuiteGLibService", - "/org/freedesktop/DBus/Tests/MyTestObject", - "org.freedesktop.DBus.Tests.MyObject"); - g_assert (proxy2 != NULL); - - dbus_g_proxy_add_signal (proxy2, "Frobnicate", G_TYPE_INT, G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (proxy2, "Frobnicate", - G_CALLBACK (frobnicate_signal_handler_2), - NULL, NULL); - - g_print ("Calling EmitFrobnicate (3)\n"); - if (!dbus_g_proxy_call (proxy, "EmitFrobnicate", &error, - G_TYPE_INVALID, G_TYPE_INVALID)) - lose_gerror ("Failed to complete EmitFrobnicate call", error); - - dbus_g_connection_flush (connection); - exit_timeout = g_timeout_add (5000, timed_exit, loop); - g_main_loop_run (loop); - - if (n_times_frobnicate_received != 2) - lose ("Frobnicate signal received %d times for 1st proxy, should have been 2", n_times_frobnicate_received); - if (n_times_frobnicate_received_2 != 1) - lose ("Frobnicate signal received %d times for 2nd proxy, should have been 1", n_times_frobnicate_received_2); - - g_object_unref (G_OBJECT (proxy)); - g_object_unref (G_OBJECT (proxy2)); - - run_mainloop (); - - /* Test introspection */ - proxy = dbus_g_proxy_new_for_name_owner (connection, - "org.freedesktop.DBus.TestSuiteGLibService", - "/org/freedesktop/DBus/Tests/MyTestObject", - "org.freedesktop.DBus.Introspectable", - &error); - if (proxy == NULL) - lose_gerror ("Failed to create proxy for name owner", error); - - g_print ("Testing introspect\n"); - if (!dbus_g_proxy_call (proxy, "Introspect", &error, - G_TYPE_INVALID, - G_TYPE_STRING, &v_STRING_2, - G_TYPE_INVALID)) - lose_gerror ("Failed to complete Introspect call", error); - - /* Could just do strcmp(), but that seems more fragile */ - { - NodeInfo *node; - GSList *elt; - gboolean found_introspectable; - gboolean found_properties; - gboolean found_myobject; - gboolean found_fooobject; - - node = description_load_from_string (v_STRING_2, strlen (v_STRING_2), &error); - if (!node) - lose_gerror ("Failed to parse introspection data: %s", error); - - found_introspectable = FALSE; - found_properties = FALSE; - found_myobject = FALSE; - found_fooobject = FALSE; - for (elt = node_info_get_interfaces (node); elt ; elt = elt->next) - { - InterfaceInfo *iface = elt->data; - - if (!found_introspectable && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Introspectable") == 0) - found_introspectable = TRUE; - else if (!found_properties && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Properties") == 0) - found_properties = TRUE; - else if (!found_myobject && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Tests.MyObject") == 0) - { - GSList *elt; - gboolean found_manyargs; - - found_myobject = TRUE; - - found_manyargs = FALSE; - for (elt = interface_info_get_methods (iface); elt; elt = elt->next) - { - MethodInfo *method; - - method = elt->data; - if (strcmp (method_info_get_name (method), "ManyArgs") == 0) - { - found_manyargs = TRUE; - break; - } - } - if (!found_manyargs) - lose ("Missing method org.freedesktop.DBus.Tests.MyObject.ManyArgs"); - } - else if (!found_fooobject && strcmp (interface_info_get_name (iface), "org.freedesktop.DBus.Tests.FooObject") == 0) - found_fooobject = TRUE; - else - lose ("Unexpected or duplicate interface %s", interface_info_get_name (iface)); - } - - if (!(found_introspectable && found_myobject && found_properties)) - lose ("Missing interface"); - } - g_free (v_STRING_2); - - g_object_unref (G_OBJECT (driver)); - - g_print ("Successfully completed %s\n", argv[0]); - - return 0; -} diff --git a/test/glib/test-profile.c b/test/glib/test-profile.c deleted file mode 100644 index 9f63b36b..00000000 --- a/test/glib/test-profile.c +++ /dev/null @@ -1,1150 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* test-profile.c Program that does basic message-response for timing; doesn't really use glib bindings - * - * Copyright (C) 2003, 2004 Red Hat Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef HAVE_SOCKLEN_T -#define socklen_t int -#endif - -#define _DBUS_ZERO(object) (memset (&(object), '\0', sizeof ((object)))) -#define _DBUS_MAX_SUN_PATH_LENGTH 99 - -/* Note that if you set threads > 1 you get a bogus profile since the - * clients start blocking on the server, so the client write() will go - * higher in the profile the larger the number of threads. - */ -#define N_CLIENT_THREADS 1 -/* It seems like at least 750000 or so iterations reduces the variability to sane levels */ -#define N_ITERATIONS 2000 -#define N_PROGRESS_UPDATES 20 -/* Don't make PAYLOAD_SIZE too huge because it gets used as a static buffer size */ -#define PAYLOAD_SIZE 0 - -#define ECHO_SERVICE "org.freedesktop.EchoTestServer" -#define ECHO_PATH "/org/freedesktop/EchoTest" -#define ECHO_INTERFACE "org.freedesktop.EchoTest" -#define ECHO_PING_METHOD "Ping" - -static const char *messages_address; -static const char *plain_sockets_address; -static unsigned char *payload; -static int echo_call_size; -static int echo_return_size; - -typedef struct ProfileRunVTable ProfileRunVTable; - -typedef struct -{ - const ProfileRunVTable *vtable; - int iterations; - GMainLoop *loop; -} ClientData; - -typedef struct -{ - const ProfileRunVTable *vtable; - int handled; - GMainLoop *loop; - int n_clients; -} ServerData; - -struct ProfileRunVTable -{ - const char *name; - gboolean fake_malloc_overhead; - void* (* init_server) (ServerData *sd); - void (* stop_server) (ServerData *sd, - void *server); - void* (* client_thread_func) (void *data); /* Data has to be the vtable */ - - /* this is so different runs show up in the profiler with - * different backtrace - */ - void (* main_loop_run_func) (GMainLoop *loop); -}; - -/* Note, this is all crack-a-rific; it isn't using DBusGProxy and thus is - * a major pain - */ -static void -send_echo_method_call (DBusConnection *connection) -{ - DBusMessage *message; - const char *hello = "Hello World!"; - dbus_int32_t i32 = 123456; - - message = dbus_message_new_method_call (ECHO_SERVICE, - ECHO_PATH, - ECHO_INTERFACE, - ECHO_PING_METHOD); - dbus_message_append_args (message, - DBUS_TYPE_STRING, &hello, - DBUS_TYPE_INT32, &i32, -#if PAYLOAD_SIZE > 0 - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, - &payload, PAYLOAD_SIZE, -#endif - DBUS_TYPE_INVALID); - - dbus_connection_send (connection, message, NULL); - dbus_message_unref (message); - dbus_connection_flush (connection); -} - -static void -send_echo_method_return (DBusConnection *connection, - DBusMessage *call_message) -{ - DBusMessage *message; - - message = dbus_message_new_method_return (call_message); - - dbus_connection_send (connection, message, NULL); - dbus_message_unref (message); - dbus_connection_flush (connection); -} - -static DBusHandlerResult -with_or_without_bus_client_filter (DBusConnection *connection, - DBusMessage *message, - ClientData *cd) -{ - if (dbus_message_is_signal (message, - DBUS_INTERFACE_LOCAL, - "Disconnected")) - { - g_printerr ("Client thread disconnected\n"); - exit (1); - } - else if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_RETURN) - { - cd->iterations += 1; - if (cd->iterations >= N_ITERATIONS) - { - g_printerr ("\nCompleted %d iterations\n", N_ITERATIONS); - g_main_loop_quit (cd->loop); - } - else if (cd->iterations % (N_ITERATIONS/N_PROGRESS_UPDATES) == 0) - { - g_printerr ("%d%% ", (int) (cd->iterations/(double)N_ITERATIONS * 100.0)); - } - - send_echo_method_call (connection); - return DBUS_HANDLER_RESULT_HANDLED; - } - - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -static DBusHandlerResult -no_bus_client_filter (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - ClientData *cd = user_data; - - return with_or_without_bus_client_filter (connection, message, cd); -} - -static void* -no_bus_thread_func (void *data) -{ - DBusError error; - GMainContext *context; - DBusConnection *connection; - ClientData cd; - - g_printerr ("Starting client thread %p\n", g_thread_self()); - - dbus_error_init (&error); - connection = dbus_connection_open_private (messages_address, &error); - if (connection == NULL) - { - g_printerr ("could not open connection: %s\n", error.message); - dbus_error_free (&error); - exit (1); - } - - context = g_main_context_new (); - - cd.iterations = 1; - cd.loop = g_main_loop_new (context, FALSE); - - if (!dbus_connection_add_filter (connection, - no_bus_client_filter, &cd, NULL)) - g_error ("no memory"); - - - dbus_connection_setup_with_g_main (connection, context); - - g_printerr ("Client thread sending message to prime pingpong\n"); - send_echo_method_call (connection); - g_printerr ("Client thread sent message\n"); - - g_printerr ("Client thread entering main loop\n"); - g_main_loop_run (cd.loop); - g_printerr ("Client thread %p exiting main loop\n", - g_thread_self()); - - dbus_connection_close (connection); - - g_main_loop_unref (cd.loop); - g_main_context_unref (context); - - return NULL; -} - -static DBusHandlerResult -no_bus_server_filter (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - ServerData *sd = user_data; - - if (dbus_message_is_signal (message, - DBUS_INTERFACE_LOCAL, - "Disconnected")) - { - g_printerr ("Client disconnected from server\n"); - sd->n_clients -= 1; - if (sd->n_clients == 0) - g_main_loop_quit (sd->loop); - } - else if (dbus_message_is_method_call (message, - ECHO_INTERFACE, - ECHO_PING_METHOD)) - { - sd->handled += 1; - send_echo_method_return (connection, message); - return DBUS_HANDLER_RESULT_HANDLED; - } - - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -static void -no_bus_new_connection_callback (DBusServer *server, - DBusConnection *new_connection, - void *user_data) -{ - ServerData *sd = user_data; - - dbus_connection_ref (new_connection); - dbus_connection_setup_with_g_main (new_connection, NULL); - - if (!dbus_connection_add_filter (new_connection, - no_bus_server_filter, sd, NULL)) - g_error ("no memory"); - - sd->n_clients += 1; - - /* FIXME we leak the handler */ -} - -static void* -no_bus_init_server (ServerData *sd) -{ - DBusServer *server; - DBusError error; - - dbus_error_init (&error); - server = dbus_server_listen ("unix:tmpdir="DBUS_TEST_SOCKET_DIR, - &error); - if (server == NULL) - { - g_printerr ("Could not start server: %s\n", - error.message); - exit (1); - } - - messages_address = dbus_server_get_address (server); - - dbus_server_set_new_connection_function (server, - no_bus_new_connection_callback, - sd, NULL); - - dbus_server_setup_with_g_main (server, NULL); - - return server; -} - -static void -no_bus_stop_server (ServerData *sd, - void *server) -{ - dbus_server_disconnect (server); - dbus_server_unref (server); -} - -static void -no_bus_main_loop_run (GMainLoop *loop) -{ - g_main_loop_run (loop); -} - -static const ProfileRunVTable no_bus_vtable = { - "dbus direct without bus", - FALSE, - no_bus_init_server, - no_bus_stop_server, - no_bus_thread_func, - no_bus_main_loop_run -}; - -typedef struct -{ - const ProfileRunVTable *vtable; - ServerData *sd; - GHashTable *client_names; - DBusConnection *connection; -} WithBusServer; - -static DBusHandlerResult -with_bus_client_filter (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - ClientData *cd = user_data; - - return with_or_without_bus_client_filter (connection, message, cd); -} - -static void* -with_bus_thread_func (void *data) -{ - DBusError error; - DBusConnection *connection; - ClientData cd; - const char *address; - GMainContext *context; - - g_printerr ("Starting client thread %p\n", g_thread_self()); - - address = g_getenv ("DBUS_SESSION_BUS_ADDRESS"); - if (address == NULL) - { - g_printerr ("DBUS_SESSION_BUS_ADDRESS not set\n"); - exit (1); - } - - dbus_error_init (&error); - connection = dbus_connection_open_private (address, &error); - if (connection == NULL) - { - g_printerr ("could not open connection to bus: %s\n", error.message); - dbus_error_free (&error); - exit (1); - } - - if (!dbus_bus_register (connection, &error)) - { - g_printerr ("could not register with bus: %s\n", error.message); - dbus_error_free (&error); - exit (1); - } - - context = g_main_context_new (); - - cd.iterations = 1; - cd.loop = g_main_loop_new (context, FALSE); - - if (!dbus_connection_add_filter (connection, - with_bus_client_filter, &cd, NULL)) - g_error ("no memory"); - - dbus_connection_setup_with_g_main (connection, context); - - g_printerr ("Client thread sending message to prime pingpong\n"); - send_echo_method_call (connection); - g_printerr ("Client thread sent message\n"); - - g_printerr ("Client thread entering main loop\n"); - g_main_loop_run (cd.loop); - g_printerr ("Client thread %p exiting main loop\n", - g_thread_self()); - - dbus_connection_close (connection); - - g_main_loop_unref (cd.loop); - g_main_context_unref (context); - - return NULL; -} - -static DBusHandlerResult -with_bus_server_filter (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - WithBusServer *server = user_data; - - if (dbus_message_is_signal (message, - DBUS_INTERFACE_LOCAL, - "Disconnected")) - { - g_printerr ("Server disconnected from message bus\n"); - exit (1); - } - else if (dbus_message_has_sender (message, - DBUS_SERVICE_DBUS) && - dbus_message_is_signal (message, - DBUS_INTERFACE_DBUS, - "NameOwnerChanged")) - { - const char *name, *old_owner, *new_owner; - DBusError error; - - name = NULL; - old_owner = NULL; - new_owner = NULL; - - dbus_error_init (&error); - if (!dbus_message_get_args (message, - &error, - DBUS_TYPE_STRING, &name, - DBUS_TYPE_STRING, &old_owner, - DBUS_TYPE_STRING, &new_owner, - DBUS_TYPE_INVALID)) - { - g_printerr ("dbus_message_get_args(): %s\n", error.message); - exit (1); - } - - if (g_hash_table_lookup (server->client_names, - name) && - *old_owner != '\0' && - *new_owner == '\0') - { - g_hash_table_remove (server->client_names, - name); - server->sd->n_clients -= 1; - if (server->sd->n_clients == 0) - g_main_loop_quit (server->sd->loop); - } - } - else if (dbus_message_is_method_call (message, - ECHO_INTERFACE, - ECHO_PING_METHOD)) - { - const char *sender; - - sender = dbus_message_get_sender (message); - - if (!g_hash_table_lookup (server->client_names, - sender)) - { - g_printerr ("First message from new client %s on bus\n", sender); - - g_hash_table_replace (server->client_names, - g_strdup (sender), - GINT_TO_POINTER (1)); - server->sd->n_clients += 1; - } - - server->sd->handled += 1; - send_echo_method_return (connection, message); - return DBUS_HANDLER_RESULT_HANDLED; - } - - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; -} - -static void* -with_bus_init_server (ServerData *sd) -{ - DBusGConnection *gconnection; - DBusConnection *connection; - GError *gerror; - const char *s; - WithBusServer *server; - char *rule; - - server = g_new0 (WithBusServer, 1); - - server->vtable = sd->vtable; - server->sd = sd; - - s = g_getenv ("DBUS_TEST_GLIB_RUN_TEST_SCRIPT"); - if (s == NULL || - *s != '1') - { - g_printerr ("You have to run with_bus mode with the run-test.sh script\n"); - exit (1); - } - - /* Note that we use the standard global bus connection for the - * server, and the clients open their own connections so they can - * have their own main loops and because I'm not sure "talking to - * yourself" really works yet - */ - gerror = NULL; - gconnection = dbus_g_bus_get (DBUS_BUS_SESSION, &gerror); - if (gconnection == NULL) - { - g_printerr ("could not open connection to bus: %s\n", gerror->message); - g_error_free (gerror); - exit (1); - } - - server->client_names = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, NULL); - - connection = dbus_g_connection_get_connection (gconnection); - - dbus_bus_request_name (connection, - ECHO_SERVICE, - 0, NULL); /* ignore errors because we suck */ - - rule = g_strdup_printf ("type='signal',sender='%s',member='%s'", - DBUS_SERVICE_DBUS, - "NameOwnerChanged"); - - /* ignore errors because we suck */ - dbus_bus_add_match (connection, rule, NULL); - - g_free (rule); - - if (!dbus_connection_add_filter (connection, - with_bus_server_filter, server, NULL)) - g_error ("no memory"); - - server->connection = connection; - server->client_names = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, NULL); - - return server; -} - -static void -with_bus_stop_server (ServerData *sd, - void *serverv) -{ - WithBusServer *server = serverv; - - dbus_connection_remove_filter (server->connection, - with_bus_server_filter, server); - - g_hash_table_destroy (server->client_names); - dbus_connection_unref (server->connection); - - g_free (server); -} - -static void -with_bus_main_loop_run (GMainLoop *loop) -{ - g_main_loop_run (loop); -} - -static const ProfileRunVTable with_bus_vtable = { - "routing via a bus", - FALSE, - with_bus_init_server, - with_bus_stop_server, - with_bus_thread_func, - with_bus_main_loop_run -}; - - -typedef struct -{ - const ProfileRunVTable *vtable; - int listen_fd; - ServerData *sd; - unsigned int source_id; -} PlainSocketServer; - -static void -read_and_drop_on_floor (int fd, - int count, - gboolean fake_malloc_overhead) -{ - int bytes_read; - int val; - char *buf; - char *allocated; - char not_allocated[512+PAYLOAD_SIZE]; - - g_assert (count < (int) sizeof(not_allocated)); - - if (fake_malloc_overhead) - { - allocated = g_malloc (count); - buf = allocated; - } - else - { - allocated = NULL; - buf = not_allocated; - } - - bytes_read = 0; - - while (bytes_read < count) - { - again: - - val = read (fd, buf + bytes_read, count - bytes_read); - - if (val < 0) - { - if (errno == EINTR) - goto again; - else - { - g_printerr ("read() failed thread %p: %s\n", - g_thread_self(), strerror (errno)); - exit (1); - } - } - else - { - bytes_read += val; - } - } - - if (fake_malloc_overhead) - g_free (allocated); - -#if 0 - g_printerr ("%p read %d bytes from fd %d\n", - g_thread_self(), bytes_read, fd); -#endif -} - -static void -write_junk (int fd, - int count, - gboolean fake_malloc_overhead) -{ - int bytes_written; - int val; - char *buf; - char *allocated; - char not_allocated[512+PAYLOAD_SIZE] = { '\0', }; - - g_assert (count < (int) sizeof(not_allocated)); - - if (fake_malloc_overhead) - { - int i; - - allocated = g_malloc (count); - buf = allocated; - - /* Write some stuff into the allocated buffer to simulate - * creating some sort of data - */ - i = 0; - while (i < count) - { - allocated[i] = (char) i; - ++i; - } - } - else - { - allocated = NULL; - buf = not_allocated; - } - - bytes_written = 0; - - while (bytes_written < count) - { - again: - - val = write (fd, buf + bytes_written, count - bytes_written); - - if (val < 0) - { - if (errno == EINTR) - goto again; - else - { - g_printerr ("write() failed thread %p: %s\n", - g_thread_self(), strerror (errno)); - exit (1); - } - } - else - { - bytes_written += val; - } - } - - if (fake_malloc_overhead) - g_free (allocated); - -#if 0 - g_printerr ("%p wrote %d bytes to fd %d\n", - g_thread_self(), bytes_written, fd); -#endif -} - -static gboolean -plain_sockets_talk_to_client_watch (GIOChannel *source, - GIOCondition condition, - gpointer data) -{ - PlainSocketServer *server = data; - int client_fd = g_io_channel_unix_get_fd (source); - - if (condition & G_IO_HUP) - { - g_printerr ("Client disconnected from server\n"); - server->sd->n_clients -= 1; - if (server->sd->n_clients == 0) - g_main_loop_quit (server->sd->loop); - - return FALSE; /* remove watch */ - } - else if (condition & G_IO_IN) - { - server->sd->handled += 1; - - read_and_drop_on_floor (client_fd, echo_call_size, server->vtable->fake_malloc_overhead); - write_junk (client_fd, echo_return_size, server->vtable->fake_malloc_overhead); - } - else - { - g_printerr ("Unexpected IO condition in server thread\n"); - exit (1); - } - - return TRUE; -} - -static gboolean -plain_sockets_new_client_watch (GIOChannel *source, - GIOCondition condition, - gpointer data) -{ - int client_fd; - struct sockaddr addr; - socklen_t addrlen; - GIOChannel *channel; - PlainSocketServer *server = data; - - if (!(condition & G_IO_IN)) - { - g_printerr ("Unexpected IO condition on server socket\n"); - exit (1); - } - - addrlen = sizeof (addr); - - retry: - client_fd = accept (server->listen_fd, &addr, &addrlen); - - if (client_fd < 0) - { - if (errno == EINTR) - goto retry; - else - { - g_printerr ("Failed to accept() connection from client: %s\n", - strerror (errno)); - exit (1); - } - } - - channel = g_io_channel_unix_new (client_fd); - g_io_add_watch (channel, - G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL | G_IO_PRI, - plain_sockets_talk_to_client_watch, - server); - g_io_channel_unref (channel); - - server->sd->n_clients += 1; - - return TRUE; -} - -static void* -plain_sockets_init_server (ServerData *sd) -{ - PlainSocketServer *server; - struct sockaddr_un addr; - static char path[] = "/tmp/dbus-test-profile-XXXXXX"; - char *p; - GIOChannel *channel; - - server = g_new0 (PlainSocketServer, 1); - server->sd = sd; - server->vtable = sd->vtable; /* for convenience */ - - p = path; - while (*p) - { - if (*p == 'X') - *p = 'a' + (int) (26.0*rand()/(RAND_MAX+1.0)); - ++p; - } - - g_printerr ("Socket is %s\n", path); - - server->listen_fd = socket (PF_UNIX, SOCK_STREAM, 0); - - if (server->listen_fd < 0) - { - g_printerr ("Failed to create socket: %s", - strerror (errno)); - exit (1); - } - - _DBUS_ZERO (addr); - addr.sun_family = AF_UNIX; - -#ifdef HAVE_ABSTRACT_SOCKETS - /* remember that abstract names aren't nul-terminated so we rely - * on sun_path being filled in with zeroes above. - */ - addr.sun_path[0] = '\0'; /* this is what says "use abstract" */ - strncpy (&addr.sun_path[1], path, _DBUS_MAX_SUN_PATH_LENGTH - 2); - /* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */ -#else /* HAVE_ABSTRACT_SOCKETS */ - { - struct stat sb; - - if (stat (path, &sb) == 0 && - S_ISSOCK (sb.st_mode)) - unlink (path); - } - - strncpy (addr.sun_path, path, _DBUS_MAX_SUN_PATH_LENGTH - 1); -#endif /* ! HAVE_ABSTRACT_SOCKETS */ - - if (bind (server->listen_fd, (struct sockaddr*) &addr, sizeof (addr)) < 0) - { - g_printerr ("Failed to bind socket \"%s\": %s", - path, strerror (errno)); - exit (1); - } - - if (listen (server->listen_fd, 30 /* backlog */) < 0) - { - g_printerr ("Failed to listen on socket \"%s\": %s", - path, strerror (errno)); - exit (1); - } - - plain_sockets_address = path; - - channel = g_io_channel_unix_new (server->listen_fd); - server->source_id = - g_io_add_watch (channel, - G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL | G_IO_PRI, - plain_sockets_new_client_watch, - server); - g_io_channel_unref (channel); - - return server; -} - -static void -plain_sockets_stop_server (ServerData *sd, - void *server_v) -{ - PlainSocketServer *server = server_v; - - g_source_remove (server->source_id); - - close (server->listen_fd); - g_free (server); - - { - struct stat sb; - - if (stat (plain_sockets_address, &sb) == 0 && - S_ISSOCK (sb.st_mode)) - unlink (plain_sockets_address); - } -} - -static gboolean -plain_sockets_client_side_watch (GIOChannel *source, - GIOCondition condition, - gpointer data) -{ - ClientData *cd = data; - int fd = g_io_channel_unix_get_fd (source); - - if (condition & G_IO_IN) - { - read_and_drop_on_floor (fd, echo_return_size, cd->vtable->fake_malloc_overhead); - } - else if (condition & G_IO_OUT) - { - cd->iterations += 1; - if (cd->iterations >= N_ITERATIONS) - { - g_printerr ("\nCompleted %d iterations\n", N_ITERATIONS); - g_main_loop_quit (cd->loop); - } - else if (cd->iterations % (N_ITERATIONS/N_PROGRESS_UPDATES) == 0) - { - g_printerr ("%d%% ", (int) (cd->iterations/(double)N_ITERATIONS * 100.0)); - } - - write_junk (fd, echo_call_size, cd->vtable->fake_malloc_overhead); - } - else - { - g_printerr ("Unexpected IO condition in client thread\n"); - exit (1); - } - - return TRUE; -} - -static void* -plain_sockets_thread_func (void *data) -{ - GMainContext *context; - ClientData cd; - int fd; - struct sockaddr_un addr; - GIOChannel *channel; - GSource *gsource; - - g_printerr ("Starting client thread %p\n", - g_thread_self()); - - fd = socket (PF_UNIX, SOCK_STREAM, 0); - - if (fd < 0) - { - g_printerr ("Failed to create socket: %s", - strerror (errno)); - exit (1); - } - - _DBUS_ZERO (addr); - addr.sun_family = AF_UNIX; - -#ifdef HAVE_ABSTRACT_SOCKETS - /* remember that abstract names aren't nul-terminated so we rely - * on sun_path being filled in with zeroes above. - */ - addr.sun_path[0] = '\0'; /* this is what says "use abstract" */ - strncpy (&addr.sun_path[1], plain_sockets_address, _DBUS_MAX_SUN_PATH_LENGTH - 2); - /* _dbus_verbose_bytes (addr.sun_path, sizeof (addr.sun_path)); */ -#else /* HAVE_ABSTRACT_SOCKETS */ - strncpy (addr.sun_path, plain_sockets_address, _DBUS_MAX_SUN_PATH_LENGTH - 1); -#endif /* ! HAVE_ABSTRACT_SOCKETS */ - - if (connect (fd, (struct sockaddr*) &addr, sizeof (addr)) < 0) - { - g_printerr ("Failed to connect to socket %s: %s", - plain_sockets_address, strerror (errno)); - exit (1); - } - - context = g_main_context_new (); - - cd.iterations = 1; - cd.loop = g_main_loop_new (context, FALSE); - cd.vtable = data; - - channel = g_io_channel_unix_new (fd); - - gsource = g_io_create_watch (channel, - G_IO_IN | G_IO_OUT | - G_IO_ERR | G_IO_HUP | G_IO_NVAL | G_IO_PRI); - - g_source_set_callback (gsource, - (GSourceFunc)plain_sockets_client_side_watch, - &cd, NULL); - - g_source_attach (gsource, context); - - g_io_channel_unref (channel); - - g_printerr ("Client thread writing to prime pingpong\n"); - write_junk (fd, echo_call_size, cd.vtable->fake_malloc_overhead); - g_printerr ("Client thread done writing primer\n"); - - g_printerr ("Client thread entering main loop\n"); - g_main_loop_run (cd.loop); - g_printerr ("Client thread %p exiting main loop\n", - g_thread_self()); - - g_source_destroy (gsource); - - close (fd); - - g_main_loop_unref (cd.loop); - g_main_context_unref (context); - - return NULL; -} - -static void -plain_sockets_main_loop_run (GMainLoop *loop) -{ - g_main_loop_run (loop); -} - -static const ProfileRunVTable plain_sockets_vtable = { - "plain sockets", - FALSE, - plain_sockets_init_server, - plain_sockets_stop_server, - plain_sockets_thread_func, - plain_sockets_main_loop_run -}; - -static const ProfileRunVTable plain_sockets_with_malloc_vtable = { - "plain sockets with malloc overhead", - TRUE, - plain_sockets_init_server, - plain_sockets_stop_server, - plain_sockets_thread_func, - plain_sockets_main_loop_run -}; - -static double -do_profile_run (const ProfileRunVTable *vtable) -{ - GTimer *timer; - int i; - double secs; - ServerData sd; - void *server; - - g_printerr ("Profiling %s\n", vtable->name); - - sd.handled = 0; - sd.n_clients = 0; - sd.loop = g_main_loop_new (NULL, FALSE); - sd.vtable = vtable; - - server = (* vtable->init_server) (&sd); - - for (i = 0; i < N_CLIENT_THREADS; i++) - { - g_thread_create (vtable->client_thread_func, (void*) vtable, FALSE, NULL); - } - - timer = g_timer_new (); - - g_printerr ("Server thread %p entering main loop\n", - g_thread_self()); - (* vtable->main_loop_run_func) (sd.loop); - g_printerr ("Server thread %p exiting main loop\n", - g_thread_self()); - - secs = g_timer_elapsed (timer, NULL); - g_timer_destroy (timer); - - g_printerr ("%s: %g seconds, %d round trips, %f seconds per pingpong\n", - vtable->name, secs, sd.handled, secs/sd.handled); - - (* vtable->stop_server) (&sd, server); - - g_main_loop_unref (sd.loop); - - return secs; -} - -static void -print_result (const ProfileRunVTable *vtable, - double seconds, - double baseline) -{ - g_printerr (" %g times slower for %s (%g seconds, %f per iteration)\n", - seconds/baseline, vtable->name, - seconds, seconds / N_ITERATIONS); -} - -int -main (int argc, char *argv[]) -{ - g_thread_init (NULL); - dbus_g_thread_init (); - -#ifndef DBUS_DISABLE_ASSERT - g_printerr ("You should probably --disable-asserts before you profile as they have noticeable overhead\n"); -#endif - -#if DBUS_ENABLE_VERBOSE_MODE - g_printerr ("You should probably --disable-verbose-mode before you profile as verbose has noticeable overhead\n"); -#endif - - payload = g_malloc (PAYLOAD_SIZE); - - /* The actual size of the DBusMessage on the wire, as of Nov 23 2004, - * without the payload - */ - echo_call_size = 140 + PAYLOAD_SIZE; - echo_return_size = 32; - - if (argc > 1 && strcmp (argv[1], "plain_sockets") == 0) - do_profile_run (&plain_sockets_vtable); - else if (argc > 1 && strcmp (argv[1], "plain_sockets_with_malloc") == 0) - do_profile_run (&plain_sockets_with_malloc_vtable); - else if (argc > 1 && strcmp (argv[1], "no_bus") == 0) - do_profile_run (&no_bus_vtable); - else if (argc > 1 && strcmp (argv[1], "with_bus") == 0) - do_profile_run (&with_bus_vtable); - else if (argc > 1 && strcmp (argv[1], "all") == 0) - { - double e1, e2, e3, e4; - - e1 = do_profile_run (&plain_sockets_vtable); - e2 = do_profile_run (&plain_sockets_with_malloc_vtable); - e3 = do_profile_run (&no_bus_vtable); - e4 = do_profile_run (&with_bus_vtable); - - g_printerr ("Baseline plain sockets time %g seconds for %d iterations\n", - e1, N_ITERATIONS); - print_result (&plain_sockets_vtable, e1, e1); - print_result (&plain_sockets_with_malloc_vtable, e2, e1); - print_result (&no_bus_vtable, e3, e1); - print_result (&with_bus_vtable, e4, e1); - } - else - { - g_printerr ("Specify profile type plain_sockets, plain_sockets_with_malloc, no_bus, with_bus, all\n"); - exit (1); - } - - /* Make valgrind happy */ - dbus_shutdown (); - - return 0; -} diff --git a/test/glib/test-service-glib.c b/test/glib/test-service-glib.c deleted file mode 100644 index 829cb57d..00000000 --- a/test/glib/test-service-glib.c +++ /dev/null @@ -1,928 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -#include -/* NOTE - outside of D-BUS core this would be - * include - */ -#include "tools/dbus-glib-bindings.h" -#include -#include -#include -#include -#include -#include -#include "my-object-marshal.h" - -typedef struct MyObject MyObject; -typedef struct MyObjectClass MyObjectClass; - -GType my_object_get_type (void); - -struct MyObject -{ - GObject parent; - char *this_is_a_string; - guint val; -}; - -struct MyObjectClass -{ - GObjectClass parent; -}; - -#define MY_TYPE_OBJECT (my_object_get_type ()) -#define MY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MY_TYPE_OBJECT, MyObject)) -#define MY_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MY_TYPE_OBJECT, MyObjectClass)) -#define MY_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MY_TYPE_OBJECT)) -#define MY_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MY_TYPE_OBJECT)) -#define MY_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MY_TYPE_OBJECT, MyObjectClass)) - -G_DEFINE_TYPE(MyObject, my_object, G_TYPE_OBJECT) - -typedef enum -{ - MY_OBJECT_ERROR_FOO, - MY_OBJECT_ERROR_BAR -} MyObjectError; - -#define MY_OBJECT_ERROR (my_object_error_quark ()) - -#define MY_TYPE_ERROR (my_object_error_get_type ()) - -gboolean my_object_do_nothing (MyObject *obj, GError **error); - -gboolean my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error); - -gint32 my_object_increment_retval (MyObject *obj, gint32 x); - -gint32 my_object_increment_retval_error (MyObject *obj, gint32 x, GError **error); - -gboolean my_object_throw_error (MyObject *obj, GError **error); - -gboolean my_object_uppercase (MyObject *obj, const char *str, char **ret, GError **error); - -gboolean my_object_many_args (MyObject *obj, guint32 x, const char *str, double trouble, double *d_ret, char **str_ret, GError **error); - -gboolean my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, const char **arg5, GError **error); - -gboolean my_object_recursive1 (MyObject *obj, GArray *array, guint32 *len_ret, GError **error); -gboolean my_object_recursive2 (MyObject *obj, guint32 reqlen, GArray **array, GError **error); - -gboolean my_object_many_stringify (MyObject *obj, GHashTable *vals, GHashTable **ret, GError **error); - -gboolean my_object_rec_arrays (MyObject *obj, GPtrArray *in, GPtrArray **ret, GError **error); - -gboolean my_object_objpath (MyObject *obj, const char *in, const char **arg1, GError **error); - -gboolean my_object_get_objs (MyObject *obj, GPtrArray **objs, GError **error); - -gboolean my_object_stringify (MyObject *obj, GValue *value, char **ret, GError **error); -gboolean my_object_unstringify (MyObject *obj, const char *str, GValue *value, GError **error); - -gboolean my_object_many_uppercase (MyObject *obj, const char * const *in, char ***out, GError **error); - -gboolean my_object_str_hash_len (MyObject *obj, GHashTable *table, guint *len, GError **error); - -gboolean my_object_send_car (MyObject *obj, GValueArray *invals, GValueArray **outvals, GError **error); - -gboolean my_object_get_hash (MyObject *obj, GHashTable **table, GError **error); - -gboolean my_object_increment_val (MyObject *obj, GError **error); - -gboolean my_object_get_val (MyObject *obj, guint *ret, GError **error); - -gboolean my_object_get_value (MyObject *obj, guint *ret, GError **error); - -gboolean my_object_emit_signals (MyObject *obj, GError **error); -gboolean my_object_emit_signal2 (MyObject *obj, GError **error); - -gboolean my_object_emit_frobnicate (MyObject *obj, GError **error); - -gboolean my_object_echo_variant (MyObject *obj, GValue *variant, GValue *ret, GError **error); - -gboolean my_object_process_variant_of_array_of_ints123 (MyObject *obj, GValue *variant, GError **error); - -gboolean my_object_dict_of_dicts (MyObject *obj, GHashTable *dict, GHashTable **ret, GError **error); - -gboolean my_object_terminate (MyObject *obj, GError **error); - -void my_object_async_increment (MyObject *obj, gint32 x, DBusGMethodInvocation *context); - -void my_object_async_throw_error (MyObject *obj, DBusGMethodInvocation *context); - -#include "test-service-glib-glue.h" - -GQuark my_object_error_quark (void); - -GType my_object_error_get_type (void); - -/* Properties */ -enum -{ - PROP_0, - PROP_THIS_IS_A_STRING -}; - -enum -{ - FROBNICATE, - SIG0, - SIG1, - SIG2, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -static void -my_object_finalize (GObject *object) -{ - MyObject *mobject = MY_OBJECT (object); - - g_free (mobject->this_is_a_string); - - (G_OBJECT_CLASS (my_object_parent_class)->finalize) (object); -} - -static void -my_object_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - MyObject *mobject; - - mobject = MY_OBJECT (object); - - switch (prop_id) - { - case PROP_THIS_IS_A_STRING: - g_free (mobject->this_is_a_string); - mobject->this_is_a_string = g_value_dup_string (value); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -my_object_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - MyObject *mobject; - - mobject = MY_OBJECT (object); - - switch (prop_id) - { - case PROP_THIS_IS_A_STRING: - g_value_set_string (value, mobject->this_is_a_string); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -my_object_init (MyObject *obj) -{ - obj->val = 0; -} - -static void -my_object_class_init (MyObjectClass *mobject_class) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (mobject_class); - - gobject_class->finalize = my_object_finalize; - gobject_class->set_property = my_object_set_property; - gobject_class->get_property = my_object_get_property; - - g_object_class_install_property (gobject_class, - PROP_THIS_IS_A_STRING, - g_param_spec_string ("this_is_a_string", - _("Sample string"), - _("Example of a string property"), - "default value", - G_PARAM_READWRITE)); - signals[FROBNICATE] = - g_signal_new ("frobnicate", - G_OBJECT_CLASS_TYPE (mobject_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, 1, G_TYPE_INT); - - signals[SIG0] = - g_signal_new ("sig0", - G_OBJECT_CLASS_TYPE (mobject_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - my_object_marshal_VOID__STRING_INT_STRING, - G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING); - - signals[SIG1] = - g_signal_new ("sig1", - G_OBJECT_CLASS_TYPE (mobject_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - my_object_marshal_VOID__STRING_BOXED, - G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_VALUE); - - signals[SIG2] = - g_signal_new ("sig2", - G_OBJECT_CLASS_TYPE (mobject_class), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, - g_cclosure_marshal_VOID__BOXED, - G_TYPE_NONE, 1, DBUS_TYPE_G_STRING_STRING_HASHTABLE); -} - -GQuark -my_object_error_quark (void) -{ - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string ("my_object_error"); - - return quark; -} - -/* This should really be standard. */ -#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC } - -GType -my_object_error_get_type (void) -{ - static GType etype = 0; - - if (etype == 0) - { - static const GEnumValue values[] = - { - - ENUM_ENTRY (MY_OBJECT_ERROR_FOO, "Foo"), - ENUM_ENTRY (MY_OBJECT_ERROR_BAR, "Bar"), - { 0, 0, 0 } - }; - - etype = g_enum_register_static ("MyObjectError", values); - } - - return etype; -} - -static GObject *obj; -static GObject *obj2; - -gboolean -my_object_do_nothing (MyObject *obj, GError **error) -{ - return TRUE; -} - -gboolean -my_object_increment (MyObject *obj, gint32 x, gint32 *ret, GError **error) -{ - *ret = x +1; - return TRUE; -} - -gint32 -my_object_increment_retval (MyObject *obj, gint32 x) -{ - return x + 1; -} - -gint32 -my_object_increment_retval_error (MyObject *obj, gint32 x, GError **error) -{ - if (x + 1 > 10) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "%s", - "x is bigger than 9"); - return FALSE; - } - return x + 1; -} - -gboolean -my_object_throw_error (MyObject *obj, GError **error) -{ - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "%s", - "this method always loses"); - return FALSE; -} - -gboolean -my_object_uppercase (MyObject *obj, const char *str, char **ret, GError **error) -{ - *ret = g_ascii_strup (str, -1); - return TRUE; -} - -gboolean -my_object_many_args (MyObject *obj, guint32 x, const char *str, double trouble, double *d_ret, char **str_ret, GError **error) -{ - *d_ret = trouble + (x * 2); - *str_ret = g_ascii_strup (str, -1); - return TRUE; -} - -gboolean -my_object_many_return (MyObject *obj, guint32 *arg0, char **arg1, gint32 *arg2, guint32 *arg3, guint32 *arg4, const char **arg5, GError **error) -{ - *arg0 = 42; - *arg1 = g_strdup ("42"); - *arg2 = -67; - *arg3 = 2; - *arg4 = 26; - *arg5 = "hello world"; /* Annotation specifies as const */ - return TRUE; -} - -gboolean -my_object_stringify (MyObject *obj, GValue *value, char **ret, GError **error) -{ - GValue valstr = {0, }; - - g_value_init (&valstr, G_TYPE_STRING); - if (!g_value_transform (value, &valstr)) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "couldn't transform value"); - return FALSE; - } - *ret = g_value_dup_string (&valstr); - g_value_unset (&valstr); - return TRUE; -} - -gboolean -my_object_unstringify (MyObject *obj, const char *str, GValue *value, GError **error) -{ - if (str[0] == '\0' || !g_ascii_isdigit (str[0])) { - g_value_init (value, G_TYPE_STRING); - g_value_set_string (value, str); - } else { - g_value_init (value, G_TYPE_INT); - g_value_set_int (value, (int) g_ascii_strtoull (str, NULL, 10)); - } - return TRUE; -} - -gboolean -my_object_recursive1 (MyObject *obj, GArray *array, guint32 *len_ret, GError **error) -{ - *len_ret = array->len; - return TRUE; -} - -gboolean -my_object_recursive2 (MyObject *obj, guint32 reqlen, GArray **ret, GError **error) -{ - guint32 val; - GArray *array; - - array = g_array_new (FALSE, TRUE, sizeof (guint32)); - - while (reqlen > 0) { - val = 42; - g_array_append_val (array, val); - val = 26; - g_array_append_val (array, val); - reqlen--; - } - val = 2; - g_array_append_val (array, val); - *ret = array; - return TRUE; -} - -gboolean -my_object_many_uppercase (MyObject *obj, const char * const *in, char ***out, GError **error) -{ - int len; - int i; - - len = g_strv_length ((char**) in); - - *out = g_new0 (char *, len + 1); - for (i = 0; i < len; i++) - { - (*out)[i] = g_ascii_strup (in[i], -1); - } - (*out)[i] = NULL; - - return TRUE; -} - -static void -hash_foreach_stringify (gpointer key, gpointer val, gpointer user_data) -{ - const char *keystr = key; - const GValue *value = val; - GValue *sval; - GHashTable *ret = user_data; - - sval = g_new0 (GValue, 1); - g_value_init (sval, G_TYPE_STRING); - if (!g_value_transform (value, sval)) - g_assert_not_reached (); - - g_hash_table_insert (ret, g_strdup (keystr), sval); -} - -static void -unset_and_free_gvalue (gpointer val) -{ - g_value_unset (val); - g_free (val); -} - -gboolean -my_object_many_stringify (MyObject *obj, GHashTable /* char * -> GValue * */ *vals, GHashTable /* char * -> GValue * */ **ret, GError **error) -{ - *ret = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, unset_and_free_gvalue); - g_hash_table_foreach (vals, hash_foreach_stringify, *ret); - return TRUE; -} - -gboolean -my_object_rec_arrays (MyObject *obj, GPtrArray *in, GPtrArray **ret, GError **error) -{ - char **strs; - GArray *ints; - guint v_UINT; - - if (in->len != 2) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid array len"); - return FALSE; - } - - strs = g_ptr_array_index (in, 0); - if (!*strs || strcmp (*strs, "foo")) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string 0"); - return FALSE; - } - strs++; - if (!*strs || strcmp (*strs, "bar")) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string 1"); - return FALSE; - } - strs++; - if (*strs) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string array len in pos 0"); - return FALSE; - } - strs = g_ptr_array_index (in, 1); - if (!*strs || strcmp (*strs, "baz")) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string 0"); - return FALSE; - } - strs++; - if (!*strs || strcmp (*strs, "whee")) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string 1"); - return FALSE; - } - strs++; - if (!*strs || strcmp (*strs, "moo")) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string 2"); - return FALSE; - } - strs++; - if (*strs) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid string array len in pos 1"); - return FALSE; - } - - *ret = g_ptr_array_new (); - - ints = g_array_new (TRUE, TRUE, sizeof (guint)); - v_UINT = 10; - g_array_append_val (ints, v_UINT); - v_UINT = 42; - g_array_append_val (ints, v_UINT); - v_UINT = 27; - g_array_append_val (ints, v_UINT); - g_ptr_array_add (*ret, ints); - - ints = g_array_new (TRUE, TRUE, sizeof (guint)); - v_UINT = 30; - g_array_append_val (ints, v_UINT); - g_ptr_array_add (*ret, ints); - return TRUE; -} - -gboolean -my_object_objpath (MyObject *obj, const char *incoming, const char **outgoing, GError **error) -{ - if (strcmp (incoming, "/org/freedesktop/DBus/Tests/MyTestObject")) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid incoming object"); - return FALSE; - } - *outgoing = "/org/freedesktop/DBus/Tests/MyTestObject2"; - return TRUE; -} - -gboolean -my_object_get_objs (MyObject *obj, GPtrArray **objs, GError **error) -{ - *objs = g_ptr_array_new (); - - g_ptr_array_add (*objs, g_strdup ("/org/freedesktop/DBus/Tests/MyTestObject")); - g_ptr_array_add (*objs, g_strdup ("/org/freedesktop/DBus/Tests/MyTestObject2")); - - return TRUE; -} - -static void -hash_foreach (gpointer key, gpointer val, gpointer user_data) -{ - const char *keystr = key; - const char *valstr = val; - guint *count = user_data; - - *count += (strlen (keystr) + strlen (valstr)); - g_print ("%s -> %s\n", keystr, valstr); -} - -gboolean -my_object_str_hash_len (MyObject *obj, GHashTable *table, guint *len, GError **error) -{ - *len = 0; - g_hash_table_foreach (table, hash_foreach, len); - return TRUE; -} - -gboolean -my_object_send_car (MyObject *obj, GValueArray *invals, GValueArray **outvals, GError **error) -{ - if (invals->n_values != 3 - || G_VALUE_TYPE (g_value_array_get_nth (invals, 0)) != G_TYPE_STRING - || G_VALUE_TYPE (g_value_array_get_nth (invals, 1)) != G_TYPE_UINT - || G_VALUE_TYPE (g_value_array_get_nth (invals, 2)) != G_TYPE_VALUE) - { - g_set_error (error, - MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "invalid incoming values"); - return FALSE; - } - *outvals = g_value_array_new (2); - g_value_array_append (*outvals, NULL); - g_value_init (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), G_TYPE_UINT); - g_value_set_uint (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), - g_value_get_uint (g_value_array_get_nth (invals, 1)) + 1); - g_value_array_append (*outvals, NULL); - g_value_init (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), DBUS_TYPE_G_OBJECT_PATH); - g_value_set_boxed (g_value_array_get_nth (*outvals, (*outvals)->n_values - 1), - g_strdup ("/org/freedesktop/DBus/Tests/MyTestObject2")); - return TRUE; -} - -gboolean -my_object_get_hash (MyObject *obj, GHashTable **ret, GError **error) -{ - GHashTable *table; - - table = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (table, "foo", "bar"); - g_hash_table_insert (table, "baz", "whee"); - g_hash_table_insert (table, "cow", "crack"); - *ret = table; - return TRUE; -} - -gboolean -my_object_increment_val (MyObject *obj, GError **error) -{ - obj->val++; - return TRUE; -} - -gboolean -my_object_get_val (MyObject *obj, guint *ret, GError **error) -{ - *ret = obj->val; - return TRUE; -} - -gboolean -my_object_get_value (MyObject *obj, guint *ret, GError **error) -{ - *ret = obj->val; - return TRUE; -} - -gboolean -my_object_echo_variant (MyObject *obj, GValue *variant, GValue *ret, GError **error) -{ - GType t; - t = G_VALUE_TYPE(variant); - g_value_init (ret, t); - g_value_copy (variant, ret); - - return TRUE; -} - -gboolean -my_object_process_variant_of_array_of_ints123 (MyObject *obj, GValue *variant, GError **error) -{ - GArray *array; - int i; - int j; - - j = 0; - - array = (GArray *)g_value_get_boxed (variant); - - for (i = 0; i <= 2; i++) - { - j = g_array_index (array, int, i); - if (j != i + 1) - goto error; - } - - return TRUE; - -error: - *error = g_error_new (MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "Error decoding a variant of type ai (i + 1 = %i, j = %i)", - i, j + 1); - return FALSE; -} - - -typedef struct _HashAndString HashAndString; - -struct _HashAndString -{ - GHashTable *hash; - gchar* string; -}; - -static void -hash_foreach_prepend_string (gpointer key, gpointer val, gpointer user_data) -{ - HashAndString *data = (HashAndString*) user_data; - gchar *in = (gchar*) val; - g_hash_table_insert (data->hash, g_strdup ((gchar*) key), - g_strjoin (" ", data->string, in, NULL)); -} - - -static void -hash_foreach_mangle_dict_of_strings (gpointer key, gpointer val, gpointer user_data) -{ - GHashTable *out = (GHashTable*) user_data; - GHashTable *in_dict = (GHashTable *) val; - HashAndString *data = g_new0 (HashAndString, 1); - - data->string = (gchar*) key; - data->hash = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, g_free); - g_hash_table_foreach (in_dict, hash_foreach_prepend_string, data); - - g_hash_table_insert(out, g_strdup ((gchar*) key), data->hash); -} - -gboolean -my_object_dict_of_dicts (MyObject *obj, GHashTable *in, - GHashTable **out, GError **error) -{ - *out = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, - (GDestroyNotify) g_hash_table_destroy); - g_hash_table_foreach (in, hash_foreach_mangle_dict_of_strings, *out); - return TRUE; -} - -gboolean -my_object_emit_frobnicate (MyObject *obj, GError **error) -{ - g_signal_emit (obj, signals[FROBNICATE], 0, 42); - return TRUE; -} - -gboolean -my_object_emit_signals (MyObject *obj, GError **error) -{ - GValue val = {0, }; - - g_signal_emit (obj, signals[SIG0], 0, "foo", 22, "moo"); - - g_value_init (&val, G_TYPE_STRING); - g_value_set_string (&val, "bar"); - g_signal_emit (obj, signals[SIG1], 0, "baz", &val); - g_value_unset (&val); - - return TRUE; -} - -gboolean -my_object_emit_signal2 (MyObject *obj, GError **error) -{ - GHashTable *table; - - table = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (table, "baz", "cow"); - g_hash_table_insert (table, "bar", "foo"); - g_signal_emit (obj, signals[SIG2], 0, table); - g_hash_table_destroy (table); - return TRUE; -} - -typedef struct { - gint32 x; - DBusGMethodInvocation *context; -} IncrementData; - -static gboolean -do_async_increment (IncrementData *data) -{ - gint32 newx = data->x + 1; - dbus_g_method_return (data->context, newx); - g_free (data); - return FALSE; -} - -void -my_object_async_increment (MyObject *obj, gint32 x, DBusGMethodInvocation *context) -{ - IncrementData *data = g_new0 (IncrementData, 1); - data->x = x; - data->context = context; - g_idle_add ((GSourceFunc)do_async_increment, data); -} - -static gboolean -do_async_error (IncrementData *data) -{ - GError *error; - error = g_error_new (MY_OBJECT_ERROR, - MY_OBJECT_ERROR_FOO, - "%s", - "this method always loses"); - dbus_g_method_return_error (data->context, error); - g_free (data); - return FALSE; -} - -void -my_object_async_throw_error (MyObject *obj, DBusGMethodInvocation *context) -{ - IncrementData *data = g_new0(IncrementData, 1); - data->context = context; - g_idle_add ((GSourceFunc)do_async_error, data); -} - - -static GMainLoop *loop; - -gboolean -my_object_terminate (MyObject *obj, GError **error) -{ - g_main_loop_quit (loop); - return TRUE; -} - -#define TEST_SERVICE_NAME "org.freedesktop.DBus.TestSuiteGLibService" - -int -main (int argc, char **argv) -{ - DBusGConnection *connection; - GError *error; - DBusGProxy *driver_proxy; - guint32 request_name_ret; - - g_type_init (); - g_thread_init (NULL); dbus_g_thread_init (); - - dbus_g_object_type_install_info (MY_TYPE_OBJECT, - &dbus_glib_my_object_object_info); - - dbus_g_error_domain_register (MY_OBJECT_ERROR, - NULL, - MY_TYPE_ERROR); - - g_printerr ("Launching test-service-glib\n"); - - loop = g_main_loop_new (NULL, FALSE); - - { - GLogLevelFlags fatal_mask; - - fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); - fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; - g_log_set_always_fatal (fatal_mask); - } - - error = NULL; - connection = dbus_g_bus_get (DBUS_BUS_STARTER, - &error); - if (connection == NULL) - { - g_printerr ("Failed to open connection to bus: %s\n", - error->message); - g_error_free (error); - exit (1); - } - - obj = g_object_new (MY_TYPE_OBJECT, NULL); - obj2 = g_object_new (MY_TYPE_OBJECT, NULL); - - dbus_g_connection_register_g_object (connection, - "/org/freedesktop/DBus/Tests/MyTestObject", - obj); - dbus_g_connection_register_g_object (connection, - "/org/freedesktop/DBus/Tests/MyTestObject2", - obj2); - - driver_proxy = dbus_g_proxy_new_for_name (connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - - if (!org_freedesktop_DBus_request_name (driver_proxy, - TEST_SERVICE_NAME, - 0, &request_name_ret, &error)) - { - g_assert (error != NULL); - g_printerr ("Failed to get name: %s\n", - error->message); - g_clear_error (&error); - exit (1); - } - - if (!(request_name_ret == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)) - { - g_printerr ("Got result code %u from requesting name\n", request_name_ret); - exit (1); - } - - g_printerr ("GLib test service has name '%s'\n", TEST_SERVICE_NAME); - g_printerr ("GLib test service entering main loop\n"); - - g_main_loop_run (loop); - - g_printerr ("Successfully completed %s\n", argv[0]); - - return 0; -} diff --git a/test/glib/test-service-glib.xml b/test/glib/test-service-glib.xml deleted file mode 100644 index 91f1fe9c..00000000 --- a/test/glib/test-service-glib.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/glib/test-thread-client.c b/test/glib/test-thread-client.c deleted file mode 100644 index f63866fc..00000000 --- a/test/glib/test-thread-client.c +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include -#include -#include -#include - -#include "test-thread.h" - -DBusConnection *connection; - -static gpointer -thread_func (gpointer data) -{ - gint32 threadnr = GPOINTER_TO_INT (data); - guint32 counter = 0; - DBusMessageIter iter; - DBusMessage *message; - char *str; - - while (1) - { - message = dbus_message_new_method_call (NULL, - "/org/freedesktop/ThreadTest", - "org.freedesktop.ThreadTest", - "TestMethod"); - - dbus_message_iter_init_append (message, &iter); - - if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &threadnr)) - { - g_print ("thread %d: append threadnr failed\n", threadnr); - } - - if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &counter)) - { - g_print ("thread %d: append counter (%d) failed\n", threadnr, counter); - } - - str = g_strdup_printf ("Thread %d-%d\n", threadnr, counter); - if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &str)) - { - g_print ("thread %d: append string (%s) failed\n", threadnr, str); - } - g_free (str); - - if (!dbus_connection_send (connection, - message, - NULL)) - { - g_print ("thread %d: send message failed\n", threadnr); - } - - dbus_message_unref (message); - - counter ++; - } - - return NULL; -} - -int -main (int argc, char *argv[]) -{ - GMainLoop *loop; - DBusError error; - int i; - - g_thread_init (NULL); - dbus_g_thread_init (); - - if(argc < 2) - { - g_error("Need an address as argv[1]\n"); - return 1; - } - - dbus_error_init (&error); - connection = dbus_connection_open (argv[1], &error); - if (connection == NULL) - { - g_printerr ("could not open connection: %s\n", error.message); - dbus_error_free (&error); - return 1; - } - - dbus_connection_setup_with_g_main (connection, NULL); - - for (i = 0; i < N_TEST_THREADS; i++) - { - g_thread_create (thread_func, GINT_TO_POINTER (i), FALSE, NULL); - } - - loop = g_main_loop_new (NULL, FALSE); - g_main_run (loop); - - return 0; -} - diff --git a/test/glib/test-thread-server.c b/test/glib/test-thread-server.c deleted file mode 100644 index 9b683983..00000000 --- a/test/glib/test-thread-server.c +++ /dev/null @@ -1,209 +0,0 @@ -#include -#include -#include -#include - -#include "test-thread.h" - -typedef struct { - guint32 counters[N_TEST_THREADS]; -} ThreadTestData; - -static ThreadTestData * -thread_test_data_new (void) -{ - ThreadTestData *data; - - data = g_new0 (ThreadTestData, 1); - - return data; -} - -static void -thread_test_data_free (ThreadTestData *data) -{ - g_free (data); -} - -static DBusHandlerResult -filter_test_message (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - ThreadTestData *data = user_data; - DBusMessageIter iter; - gint32 threadnr; - guint32 counter; - const char *str; - char *expected_str; - GString *counter_str; - int i; - - if (!dbus_message_is_method_call (message, "org.freedesktop.ThreadTest", - "TestMethod")) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - - dbus_message_iter_init (message, &iter); - - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_INT32) - { - g_print ("First arg not right type\n"); - goto out; - } - dbus_message_iter_get_basic (&iter, &threadnr); - if (threadnr < 0 || threadnr >= N_TEST_THREADS) - { - g_print ("Invalid thread nr\n"); - goto out; - } - - if (! dbus_message_iter_next (&iter)) - { - g_print ("Couldn't get second arg\n"); - goto out; - } - - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_UINT32) - { - g_print ("Second arg not right type\n"); - goto out; - } - - dbus_message_iter_get_basic (&iter, &counter); - - if (counter != data->counters[threadnr]) - { - g_print ("Thread %d, counter %d, expected %d\n", threadnr, counter, data->counters[threadnr]); - goto out; - } - data->counters[threadnr]++; - - if (! dbus_message_iter_next (&iter)) - { - g_print ("Couldn't get third arg\n"); - goto out; - } - - if (dbus_message_iter_get_arg_type (&iter) != DBUS_TYPE_STRING) - { - g_print ("Third arg not right type\n"); - goto out; - } - - dbus_message_iter_get_basic (&iter, &str); - - if (str == NULL) - { - g_print ("No third arg\n"); - goto out; - } - - expected_str = g_strdup_printf ("Thread %d-%d\n", threadnr, counter); - if (strcmp (expected_str, str) != 0) - { - g_print ("Wrong string '%s', expected '%s'\n", str, expected_str); - goto out; - } - g_free (expected_str); - - if (dbus_message_iter_next (&iter)) - { - g_print ("Extra args on end of message\n"); - goto out; - } - - dbus_connection_flush (connection); - - counter_str = g_string_new (""); - for (i = 0; i < N_TEST_THREADS; i++) - { - g_string_append_printf (counter_str, "%d ", data->counters[i]); - } - g_print ("%s\r", counter_str->str); - g_string_free (counter_str, TRUE); - - out: - return DBUS_HANDLER_RESULT_HANDLED; -} - -static DBusHandlerResult -filter_disconnect (DBusConnection *connection, - DBusMessage *message, - void *user_data) -{ - if (!dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, - "Disconnected")) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - - g_print ("connection disconnected\n"); - dbus_connection_unref (connection); - - return DBUS_HANDLER_RESULT_HANDLED; -} - -static void -new_connection_callback (DBusServer *server, - DBusConnection *new_connection, - void *user_data) -{ - ThreadTestData * data; - - g_print ("new_connection_callback\n"); - - dbus_connection_ref (new_connection); - dbus_connection_setup_with_g_main (new_connection, NULL); - - data = thread_test_data_new (); - - if (!dbus_connection_add_filter (new_connection, - filter_test_message, data, - (DBusFreeFunction) thread_test_data_free)) - goto nomem; - - if (!dbus_connection_add_filter (new_connection, - filter_disconnect, NULL, NULL)) - goto nomem; - - return; - - nomem: - g_error ("no memory to setup new connection"); -} - -int -main (int argc, char *argv[]) -{ - GMainLoop *loop; - DBusServer *server; - DBusError error; - - g_thread_init (NULL); - dbus_g_thread_init (); - - if (argc < 2) - { - fprintf (stderr, "Give the server address as an argument\n"); - return 1; - } - - dbus_error_init (&error); - server = dbus_server_listen (argv[1], &error); - if (server == NULL) - { - fprintf (stderr, "Failed to start server on %s: %s\n", - argv[1], error.message); - dbus_error_free (&error); - return 1; - } - - dbus_server_set_new_connection_function (server, - new_connection_callback, - NULL, NULL); - - dbus_server_setup_with_g_main (server, NULL); - - loop = g_main_loop_new (NULL, FALSE); - g_main_run (loop); - - return 0; -} diff --git a/test/glib/test-thread.h b/test/glib/test-thread.h deleted file mode 100644 index 8c78fba2..00000000 --- a/test/glib/test-thread.h +++ /dev/null @@ -1 +0,0 @@ -#define N_TEST_THREADS 5 diff --git a/test/python/.cvsignore b/test/python/.cvsignore deleted file mode 100644 index f5e130db..00000000 --- a/test/python/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -run-with-tmp-session-bus.conf diff --git a/test/python/Makefile.am b/test/python/Makefile.am deleted file mode 100644 index 5e4da980..00000000 --- a/test/python/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## note that TESTS has special meaning (stuff to use in make check) -## so if adding tests not to be run in make check, don't add them to -## TESTS -if DBUS_BUILD_TESTS -TESTS_ENVIRONMENT=DBUS_TOP_BUILDDIR=$(ABSOLUTE_TOP_BUILDDIR) -TESTS=run-test.sh -else -TESTS= -endif - -EXTRA_DIST=run-test.sh test-service.py test-client.py diff --git a/test/python/run-test.sh b/test/python/run-test.sh deleted file mode 100755 index a50a5f48..00000000 --- a/test/python/run-test.sh +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/bash - -function die() -{ - if ! test -z "$DBUS_SESSION_BUS_PID" ; then - echo "killing message bus "$DBUS_SESSION_BUS_PID >&2 - kill -9 $DBUS_SESSION_BUS_PID - fi - echo $SCRIPTNAME: $* >&2 - - rm $DBUS_TOP_BUILDDIR/python/dbus - - exit 1 -} - - -SCRIPTNAME=$0 -MODE=$1 - -## so the tests can complain if you fail to use the script to launch them -export DBUS_TEST_PYTHON_RUN_TEST_SCRIPT=1 - -# Rerun ourselves with tmp session bus if we're not already -if test -z "$DBUS_TEST_PYTHON_IN_RUN_TEST"; then - DBUS_TEST_PYTHON_IN_RUN_TEST=1 - export DBUS_TEST_PYTHON_IN_RUN_TEST - exec $DBUS_TOP_BUILDDIR/tools/run-with-tmp-session-bus.sh $SCRIPTNAME $MODE -fi - -ln -s $DBUS_TOP_BUILDDIR/python $DBUS_TOP_BUILDDIR/python/dbus -echo "running test-client.py" -#uncomment this if you need to see the output from the service for debugging -#otherwise keep it commented so we can test activation -#libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/python/test-service.py & -#libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/glib/test-service-glib & -#sleep 1 -#ps -#sleep 9 - -libtool --mode=execute $DEBUG $DBUS_TOP_BUILDDIR/test/python/test-client.py || die "test-client.py failed" -rm $DBUS_TOP_BUILDDIR/python/dbus - diff --git a/test/python/test-client.py b/test/python/test-client.py deleted file mode 100755 index f6ef12ba..00000000 --- a/test/python/test-client.py +++ /dev/null @@ -1,306 +0,0 @@ -#!/usr/bin/env python -import sys -import os -import unittest -import time - -builddir = os.environ["DBUS_TOP_BUILDDIR"] -pydir = builddir + "/python" - -sys.path.insert(0, pydir) -sys.path.insert(0, pydir + "/.libs") - -import dbus -import dbus_bindings -import gobject -import dbus.glib -import dbus.service - -if not dbus.__file__.startswith(pydir): - raise Exception("DBus modules are not being picked up from the package") - -if not dbus_bindings.__file__.startswith(pydir): - raise Exception("DBus modules are not being picked up from the package") - -test_types_vals = [1, 12323231, 3.14159265, 99999999.99, - "dude", "123", "What is all the fuss about?", "gob@gob.com", - u'\\u310c\\u310e\\u3114', u'\\u0413\\u0414\\u0415', - u'\\u2200software \\u2203crack', u'\\xf4\\xe5\\xe8', - [1,2,3], ["how", "are", "you"], [1.23,2.3], [1], ["Hello"], - (1,2,3), (1,), (1,"2",3), ("2", "what"), ("you", 1.2), - {1:"a", 2:"b"}, {"a":1, "b":2}, #{"a":(1,"B")}, - {1:1.1, 2:2.2}, [[1,2,3],[2,3,4]], [["a","b"],["c","d"]], - True, False, - dbus.Int16(-10), dbus.UInt16(10), - #([1,2,3],"c", 1.2, ["a","b","c"], {"a": (1,"v"), "b": (2,"d")}) - ] - -class TestDBusBindings(unittest.TestCase): - def setUp(self): - self.bus = dbus.SessionBus() - self.remote_object = self.bus.get_object("org.freedesktop.DBus.TestSuitePythonService", "/org/freedesktop/DBus/TestSuitePythonObject") - self.iface = dbus.Interface(self.remote_object, "org.freedesktop.DBus.TestSuiteInterface") - - def testInterfaceKeyword(self): - #test dbus_interface parameter - print self.remote_object.Echo("dbus_interface on Proxy test Passed", dbus_interface = "org.freedesktop.DBus.TestSuiteInterface") - print self.iface.Echo("dbus_interface on Interface test Passed", dbus_interface = "org.freedesktop.DBus.TestSuiteInterface") - self.assert_(True) - - def testIntrospection(self): - #test introspection - print "\n********* Introspection Test ************" - print self.remote_object.Introspect(dbus_interface="org.freedesktop.DBus.Introspectable") - print "Introspection test passed" - self.assert_(True) - - def testPythonTypes(self): - #test sending python types and getting them back - print "\n********* Testing Python Types ***********" - - for send_val in test_types_vals: - print "Testing %s"% str(send_val) - recv_val = self.iface.Echo(send_val) - self.assertEquals(send_val, recv_val) - - def testBenchmarkIntrospect(self): - print "\n********* Benchmark Introspect ************" - a = time.time() - print a - print self.iface.GetComplexArray() - b = time.time() - print b - print "Delta: %f" % (b - a) - self.assert_(True) - - def testAsyncCalls(self): - #test sending python types and getting them back async - print "\n********* Testing Async Calls ***********" - - - main_loop = gobject.MainLoop() - class async_check: - def __init__(self, test_controler, expected_result, do_exit): - self.expected_result = expected_result - self.do_exit = do_exit - self.test_controler = test_controler - - def callback(self, val): - try: - if self.do_exit: - main_loop.quit() - - self.test_controler.assertEquals(val, self.expected_result) - except Exception, e: - print "%s:\n%s" % (e.__class__, e) - - def error_handler(self, error): - print error - if self.do_exit: - main_loop.quit() - - self.test_controler.assert_(val, False) - - last_type = test_types_vals[-1] - for send_val in test_types_vals: - print "Testing %s"% str(send_val) - check = async_check(self, send_val, last_type == send_val) - recv_val = self.iface.Echo(send_val, - reply_handler = check.callback, - error_handler = check.error_handler) - - main_loop.run() - - def testStrictMarshalling(self): - print "\n********* Testing strict return & signal marshalling ***********" - - # these values are the same as in the server, and the - # methods should only succeed when they are called with - # the right value number, because they have out_signature - # decorations, and return an unmatching type when called - # with a different number - values = ["", ("",""), ("","",""), [], {}, ["",""], ["","",""]] - methods = [ - (self.iface.ReturnOneString, 'SignalOneString', set([0]), set([0])), - (self.iface.ReturnTwoStrings, 'SignalTwoStrings', set([1, 5]), set([5])), - (self.iface.ReturnStruct, 'SignalStruct', set([1, 5]), set([1])), - # all of our test values are sequences so will marshall correctly into an array :P - (self.iface.ReturnArray, 'SignalArray', set(range(len(values))), set([3, 5, 6])), - (self.iface.ReturnDict, 'SignalDict', set([0, 3, 4]), set([4])) - ] - - for (method, signal, success_values, return_values) in methods: - print "\nTrying correct behaviour of", method._method_name - for value in range(len(values)): - try: - ret = method(value) - except Exception, e: - print "%s(%r) raised %s" % (method._method_name, values[value], e.__class__) - - # should fail if it tried to marshal the wrong type - self.assert_(value not in success_values, "%s should succeed when we ask it to return %r\n%s\n%s" % (method._method_name, values[value], e.__class__, e)) - else: - print "%s(%r) returned %r" % (method._method_name, values[value], ret) - - # should only succeed if it's the right return type - self.assert_(value in success_values, "%s should fail when we ask it to return %r" % (method._method_name, values[value])) - - # check the value is right too :D - returns = map(lambda n: values[n], return_values) - self.assert_(ret in returns, "%s should return one of %r" % (method._method_name, returns)) - - print "\nTrying correct emission of", signal - for value in range(len(values)): - try: - self.iface.EmitSignal(signal, value) - except Exception, e: - print "EmitSignal(%s, %r) raised %s" % (signal, values[value], e.__class__) - - # should fail if it tried to marshal the wrong type - self.assert_(value not in success_values, "EmitSignal(%s) should succeed when we ask it to return %r\n%s\n%s" % (signal, values[value], e.__class__, e)) - else: - print "EmitSignal(%s, %r) appeared to succeed" % (signal, values[value]) - - # should only succeed if it's the right return type - self.assert_(value in success_values, "EmitSignal(%s) should fail when we ask it to return %r" % (signal, values[value])) - - # FIXME: wait for the signal here - - print - - def testInheritance(self): - print "\n********* Testing inheritance from dbus.method.Interface ***********" - ret = self.iface.CheckInheritance() - print "CheckInheritance returned %s" % ret - self.assert_(ret, "overriding CheckInheritance from TestInterface failed") - - def testAsyncMethods(self): - print "\n********* Testing asynchronous method implementation *******" - for (async, fail) in ((False, False), (False, True), (True, False), (True, True)): - try: - val = ('a', 1, False, [1,2], {1:2}) - print "calling AsynchronousMethod with %s %s %s" % (async, fail, val) - ret = self.iface.AsynchronousMethod(async, fail, val) - except Exception, e: - print "%s:\n%s" % (e.__class__, e) - self.assert_(fail) - else: - self.assert_(not fail) - print val, ret - self.assert_(val == ret) - - def testBusInstanceCaching(self): - print "\n********* Testing dbus.Bus instance sharing *********" - - # unfortunately we can't test the system bus here - # but the codepaths are the same - for (cls, type, func) in ((dbus.SessionBus, dbus.Bus.TYPE_SESSION, dbus.Bus.get_session), (dbus.StarterBus, dbus.Bus.TYPE_STARTER, dbus.Bus.get_starter)): - print "\nTesting %s:" % cls.__name__ - - share_cls = cls() - share_type = dbus.Bus(bus_type=type) - share_func = func() - - private_cls = cls(private=True) - private_type = dbus.Bus(bus_type=type, private=True) - private_func = func(private=True) - - print " - checking shared instances are the same..." - self.assert_(share_cls == share_type, '%s should equal %s' % (share_cls, share_type)) - self.assert_(share_type == share_func, '%s should equal %s' % (share_type, share_func)) - - print " - checking private instances are distinct from the shared instance..." - self.assert_(share_cls != private_cls, '%s should not equal %s' % (share_cls, private_cls)) - self.assert_(share_type != private_type, '%s should not equal %s' % (share_type, private_type)) - self.assert_(share_func != private_func, '%s should not equal %s' % (share_func, private_func)) - - print " - checking private instances are distinct from each other..." - self.assert_(private_cls != private_type, '%s should not equal %s' % (private_cls, private_type)) - self.assert_(private_type != private_func, '%s should not equal %s' % (private_type, private_func)) - self.assert_(private_func != private_cls, '%s should not equal %s' % (private_func, private_cls)) - - def testSenderName(self): - print '\n******** Testing sender name keyword ********' - myself = self.iface.WhoAmI() - print "I am", myself - - def testBusNameCreation(self): - print '\n******** Testing BusName creation ********' - test = [('org.freedesktop.DBus.Python.TestName', True), - ('org.freedesktop.DBus.Python.TestName', True), - ('org.freedesktop.DBus.Python.InvalidName&^*%$', False)] - # Do some more intelligent handling/testing of queueing vs success? - # ('org.freedesktop.DBus.TestSuitePythonService', False)] - # For some reason this actually succeeds - # ('org.freedesktop.DBus', False)] - - # make a method call to ensure the test service is active - self.iface.Echo("foo") - - names = {} - for (name, succeed) in test: - try: - print "requesting %s" % name - busname = dbus.service.BusName(name) - except Exception, e: - print "%s:\n%s" % (e.__class__, e) - self.assert_(not succeed, 'did not expect registering bus name %s to fail' % name) - else: - print busname - self.assert_(succeed, 'expected registering bus name %s to fail'% name) - if name in names: - self.assert_(names[name] == busname, 'got a new instance for same name %s' % name) - print "instance of %s re-used, good!" % name - else: - names[name] = busname - - del busname - - print - - del names - - bus = dbus.Bus() - ret = dbus.dbus_bindings.bus_name_has_owner(bus._connection, 'org.freedesktop.DBus.Python.TestName') - self.assert_(not ret, 'deleting reference failed to release BusName org.freedesktop.DBus.Python.TestName') - - -class TestDBusPythonToGLibBindings(unittest.TestCase): - def setUp(self): - self.bus = dbus.SessionBus() - self.remote_object = self.bus.get_object("org.freedesktop.DBus.TestSuiteGLibService", "/org/freedesktop/DBus/Tests/MyTestObject") - self.iface = dbus.Interface(self.remote_object, "org.freedesktop.DBus.Tests.MyObject") - - def testIntrospection(self): - #test introspection - print "\n********* Introspection Test ************" - print self.remote_object.Introspect(dbus_interface="org.freedesktop.DBus.Introspectable") - print "Introspection test passed" - self.assert_(True) - - def testCalls(self): - print "\n********* Call Test ************" - result = self.iface.ManyArgs(1000, 'Hello GLib', 2) - print result - self.assert_(result == [2002.0, 'HELLO GLIB']) - - arg0 = {"Dude": 1, "john": "palmieri", "python": 2.4} - result = self.iface.ManyStringify(arg0) - print result - - print "Call test passed" - self.assert_(True) - - def testPythonTypes(self): - print "\n********* Testing Python Types ***********" - - for send_val in test_types_vals: - print "Testing %s"% str(send_val) - recv_val = self.iface.EchoVariant(send_val) - self.assertEquals(send_val, recv_val) - -if __name__ == '__main__': - gobject.threads_init() - dbus.glib.init_threads() - - unittest.main() diff --git a/test/python/test-service.py b/test/python/test-service.py deleted file mode 100755 index e8213805..00000000 --- a/test/python/test-service.py +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env python -import sys -import os - -builddir = os.environ["DBUS_TOP_BUILDDIR"] -pydir = builddir + "/python" - -sys.path.insert(0, pydir) -sys.path.insert(0, pydir + '/.libs') - -import dbus - -if not dbus.__file__.startswith(pydir): - raise Exception("DBus modules are not being picked up from the package") - -import dbus.service -import dbus.glib -import gobject -import random - -class TestInterface(dbus.service.Interface): - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='', out_signature='b') - def CheckInheritance(self): - return False - -class TestObject(dbus.service.Object, TestInterface): - def __init__(self, bus_name, object_path="/org/freedesktop/DBus/TestSuitePythonObject"): - dbus.service.Object.__init__(self, bus_name, object_path) - - """ Echo whatever is sent - """ - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface") - def Echo(self, arg): - return arg - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface") - def GetComplexArray(self): - ret = [] - for i in range(0,100): - ret.append((random.randint(0,100), random.randint(0,100), str(random.randint(0,100)))) - - return dbus.Array(ret, signature="(uus)") - - def returnValue(self, test): - if test == 0: - return "" - elif test == 1: - return "","" - elif test == 2: - return "","","" - elif test == 3: - return [] - elif test == 4: - return {} - elif test == 5: - return ["",""] - elif test == 6: - return ["","",""] - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='u', out_signature='s') - def ReturnOneString(self, test): - return self.returnValue(test) - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='u', out_signature='ss') - def ReturnTwoStrings(self, test): - return self.returnValue(test) - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='u', out_signature='(ss)') - def ReturnStruct(self, test): - return self.returnValue(test) - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='u', out_signature='as') - def ReturnArray(self, test): - return self.returnValue(test) - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='u', out_signature='a{ss}') - def ReturnDict(self, test): - return self.returnValue(test) - - @dbus.service.signal("org.freedesktop.DBus.TestSuiteInterface", signature='s') - def SignalOneString(self, test): - pass - - @dbus.service.signal("org.freedesktop.DBus.TestSuiteInterface", signature='ss') - def SignalTwoStrings(self, test, test2): - pass - - @dbus.service.signal("org.freedesktop.DBus.TestSuiteInterface", signature='(ss)') - def SignalStruct(self, test): - pass - - @dbus.service.signal("org.freedesktop.DBus.TestSuiteInterface", signature='as') - def SignalArray(self, test): - pass - - @dbus.service.signal("org.freedesktop.DBus.TestSuiteInterface", signature='a{ss}') - def SignalDict(self, test): - pass - - @dbus.service.method("org.freedesktop.DBus.TestSuiteInterface", in_signature='su', out_signature='') - def EmitSignal(self, signal, value): - sig = getattr(self, signal, None) - assert(sig != None) - - val = self.returnValue(value) - # make two string case work by passing arguments in by tuple - if (signal == 'SignalTwoStrings' and (value == 1 or value == 5)): - val = tuple(val) - else: - val = tuple([val]) - - sig(*val) - - def CheckInheritance(self): - return True - - @dbus.service.method('org.freedesktop.DBus.TestSuiteInterface', in_signature='bbv', out_signature='v', async_callbacks=('return_cb', 'error_cb')) - def AsynchronousMethod(self, async, fail, variant, return_cb, error_cb): - try: - if async: - gobject.timeout_add(500, self.AsynchronousMethod, False, fail, variant, return_cb, error_cb) - return - else: - if fail: - raise RuntimeError - else: - return_cb(variant) - - return False # do not run again - except Exception, e: - error_cb(e) - - @dbus.service.method('org.freedesktop.DBus.TestSuiteInterface', in_signature='', out_signature='s', sender_keyword='sender') - def WhoAmI(self, sender): - return sender - -session_bus = dbus.SessionBus() -name = dbus.service.BusName("org.freedesktop.DBus.TestSuitePythonService", bus=session_bus) -object = TestObject(name) -loop = gobject.MainLoop() -loop.run() diff --git a/test/qt/.cvsignore b/test/qt/.cvsignore deleted file mode 100644 index f6454f28..00000000 --- a/test/qt/.cvsignore +++ /dev/null @@ -1,11 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -*.lo -*.la -*.bb -*.bbg -*.da -*.gcov -*.moc diff --git a/test/qt/Makefile.am b/test/qt/Makefile.am deleted file mode 100644 index 8ebd3323..00000000 --- a/test/qt/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/qt $(DBUS_CLIENT_CFLAGS) $(DBUS_QT_CFLAGS) $(DBUS_QTESTLIB_CFLAGS) -DDBUS_COMPILATION - -if DBUS_BUILD_TESTS -TEST_BINARIES = tst_headertest tst_qdbusxmlparser tst_qdbusconnection qpong tst_qdbusmarshall tst_qdbusinterface tst_qdbusabstractadaptor tst_hal -TESTS= -else -TEST_BINARIES= -TESTS= -endif - -noinst_PROGRAMS= $(TEST_BINARIES) - -qpong_SOURCES= qpong.cpp -tst_headertest_SOURCES = tst_headertest.cpp -tst_qdbusconnection_SOURCES = tst_qdbusconnection.cpp -tst_qdbusxmlparser_SOURCES = tst_qdbusxmlparser.cpp -tst_qdbusmarshall_SOURCES = tst_qdbusmarshall.cpp -tst_qdbusinterface_SOURCES = tst_qdbusinterface.cpp -tst_qdbusabstractadaptor_SOURCES = tst_qdbusabstractadaptor.cpp common.h -tst_hal_SOURCES = tst_hal.cpp - -qpong.o: qpong.moc -tst_qdbusxmlparser.o: tst_qdbusxmlparser.moc -tst_qdbusmarshall.o: tst_qdbusmarshall.moc -tst_qdbusconnection.o: tst_qdbusconnection.moc -tst_qdbusinterface.o: tst_qdbusinterface.moc -tst_qdbusabstractadaptor.o: tst_qdbusabstractadaptor.moc -tst_hal.o: tst_hal.moc - -%.moc: %.cpp - $(QT_MOC) $< > $@ - -TEST_LIBS=$(DBUS_QTESTLIB_LIBS) $(top_builddir)/qt/src/libdbus-qt4-1.la - -LDADD=$(TEST_LIBS) - -clean-local: - -rm *.moc diff --git a/test/qt/common.h b/test/qt/common.h deleted file mode 100644 index 58beae4e..00000000 --- a/test/qt/common.h +++ /dev/null @@ -1,264 +0,0 @@ -#include // isnan - -Q_DECLARE_METATYPE(QVariant) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -Q_DECLARE_METATYPE(QList) -#ifdef USE_PRIVATE_CODE -#include "../../qt/src/qdbusintrospection_p.h" - -// just to make it easier: -typedef QDBusIntrospection::Interfaces InterfaceMap; -typedef QDBusIntrospection::Objects ObjectMap; -typedef QDBusIntrospection::Arguments ArgumentList; -typedef QDBusIntrospection::Annotations AnnotationsMap; -typedef QDBusIntrospection::Methods MethodMap; -typedef QDBusIntrospection::Signals SignalMap; -typedef QDBusIntrospection::Properties PropertyMap; - -Q_DECLARE_METATYPE(QDBusIntrospection::Method) -Q_DECLARE_METATYPE(QDBusIntrospection::Signal) -Q_DECLARE_METATYPE(QDBusIntrospection::Property) -Q_DECLARE_METATYPE(MethodMap) -Q_DECLARE_METATYPE(SignalMap) -Q_DECLARE_METATYPE(PropertyMap) - -inline QDBusIntrospection::Argument arg(const char* type, const char *name = 0) -{ - QDBusIntrospection::Argument retval; - retval.type = QLatin1String(type); - retval.name = QLatin1String(name); - return retval; -} - -template -inline QMap& operator<<(QMap& map, const T& m) -{ map.insertMulti(m.name, m); return map; } - -inline const char* mapName(const MethodMap&) -{ return "MethodMap"; } - -inline const char* mapName(const SignalMap&) -{ return "SignalMap"; } - -inline const char* mapName(const PropertyMap&) -{ return "PropertyMap"; } - -QString printable(const QDBusIntrospection::Method& m) -{ - QString result = "method " + m.name + "("; - foreach (QDBusIntrospection::Argument arg, m.inputArgs) - result += QString("in %1 %2, ") - .arg(arg.type, arg.name); - foreach (QDBusIntrospection::Argument arg, m.outputArgs) - result += QString("out %1 %2, ") - .arg(arg.type, arg.name); - AnnotationsMap::const_iterator it = m.annotations.begin(); - for ( ; it != m.annotations.end(); ++it) - result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value()); - - result += ")"; - return result; -} - -QString printable(const QDBusIntrospection::Signal& s) -{ - QString result = "signal " + s.name + "("; - foreach (QDBusIntrospection::Argument arg, s.outputArgs) - result += QString("out %1 %2, ") - .arg(arg.type, arg.name); - AnnotationsMap::const_iterator it = s.annotations.begin(); - for ( ; it != s.annotations.end(); ++it) - result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value()); - - result += ")"; - return result; -} - -QString printable(const QDBusIntrospection::Property& p) -{ - QString result; - if (p.access == QDBusIntrospection::Property::Read) - result = "property read %1 %2, "; - else if (p.access == QDBusIntrospection::Property::Write) - result = "property write %1 %2, "; - else - result = "property readwrite %1 %2, "; - result = result.arg(p.type, p.name); - - AnnotationsMap::const_iterator it = p.annotations.begin(); - for ( ; it != p.annotations.end(); ++it) - result += QString("%1 \"%2\", ").arg(it.key()).arg(it.value()); - - return result; -} - -template -char* printableMap(const QMap& map) -{ - QString contents = "\n"; - typename QMap::const_iterator it = map.begin(); - for ( ; it != map.end(); ++it) { - if (it.key() != it.value().name) - contents += it.value().name + ":"; - contents += printable(it.value()); - contents += ";\n"; - } - - QString result("%1(size = %2): {%3}"); - return qstrdup(qPrintable(result - .arg(mapName(map)) - .arg(map.size()) - .arg(contents))); -} - -namespace QTest { - template<> - inline char* toString(const MethodMap& map) - { - return printableMap(map); - } - - template<> - inline char* toString(const SignalMap& map) - { - return printableMap(map); - } - - template<> - inline char* toString(const PropertyMap& map) - { - return printableMap(map); - } -} -#endif -bool compare(const QVariantList &l1, const QVariantList &l2); -bool compare(const QVariantMap &m1, const QVariantMap &m2); -bool compare(const QVariant &v1, const QVariant &v2); - -bool compare(const QList &l1, const QList &l2) -{ - if (l1.count() != l2.count()) - return false; - - QList::ConstIterator it1 = l1.constBegin(); - QList::ConstIterator it2 = l2.constBegin(); - QList::ConstIterator end = l1.constEnd(); - for ( ; it1 != end; ++it1, ++it2) - if (isnan(*it1) && isnan(*it2)) - continue; - else if (*it1 != *it2) - return false; - return true; -} - -bool compare(const QString &s1, const QString &s2) -{ - if (s1.isEmpty() && s2.isEmpty()) - return true; // regardless of whether one of them is null - return s1 == s2; -} - -bool compare(const QByteArray &ba1, const QByteArray &ba2) -{ - if (ba1.isEmpty() && ba2.isEmpty()) - return true; // regardless of whether one of them is null - return ba1 == ba2; -} - -bool compare(const QVariant &v1, const QVariant &v2) -{ - if (v1.userType() != v2.userType()) - return false; - - int id = v1.userType(); - if (id == QVariant::List) - return compare(v1.toList(), v2.toList()); - - else if (id == QVariant::Map) - return compare(v1.toMap(), v2.toMap()); - - else if (id == QVariant::String) - return compare(v1.toString(), v2.toString()); - - else if (id == QVariant::ByteArray) - return compare(v1.toByteArray(), v2.toByteArray()); - - else if (id < int(QVariant::UserType)) // yes, v1.type() - // QVariant can compare - return v1 == v2; - - else if (id == QMetaType::UChar) - return qvariant_cast(v1) == qvariant_cast(v2); - - else if (id == QMetaType::Short) - return qvariant_cast(v1) == qvariant_cast(v2); - - else if (id == QMetaType::UShort) - return qvariant_cast(v1) == qvariant_cast(v2); - - else if (id == qMetaTypeId()) - return compare(qvariant_cast(v1), qvariant_cast(v2)); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v1) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v1) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v1) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v1) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v1) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v1) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return qvariant_cast >(v2) == qvariant_cast >(v2); - - else if (id == qMetaTypeId >()) - return compare(qvariant_cast >(v1), qvariant_cast >(v2)); - - else - return false; // unknown type -} - -bool compare(const QVariantList &l1, const QVariantList &l2) -{ - if (l1.count() != l2.size()) - return false; - QVariantList::ConstIterator i1 = l1.constBegin(); - QVariantList::ConstIterator i2 = l2.constBegin(); - QVariantList::ConstIterator end = l1.constEnd(); - for ( ; i1 != end; ++i1, ++i2) { - if (!compare(*i1, *i2)) - return false; - } - return true; -} - -bool compare(const QVariantMap &m1, const QVariantMap &m2) -{ - if (m1.count() != m2.size()) - return false; - QVariantMap::ConstIterator i1 = m1.constBegin(); - QVariantMap::ConstIterator end = m1.constEnd(); - for ( ; i1 != end; ++i1) { - QVariantMap::ConstIterator i2 = m2.find(i1.key()); - if (i2 == m2.constEnd()) - return false; - if (!compare(*i1, *i2)) - return false; - } - return true; -} diff --git a/test/qt/qpong.cpp b/test/qt/qpong.cpp deleted file mode 100644 index cad04eb6..00000000 --- a/test/qt/qpong.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include - -class Pong: public QObject -{ - Q_OBJECT -public slots: - - void ping(const QDBusMessage &msg) - { - QDBusMessage reply = QDBusMessage::methodReply(msg); - reply << static_cast >(msg); - reply.setSignature(msg.signature()); - if (!msg.connection().send(reply)) - exit(1); - } -}; - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - - QDBusConnection &con = QDBus::sessionBus(); - if (!con.isConnected()) - exit(1); - - if (con.busService()->requestName("org.kde.selftest", QDBusBusService::DoNotQueueName).isError()) - exit(2); - - Pong pong; - con.registerObject("/org/kde/selftest", &pong, QDBusConnection::ExportSlots); - - printf("ready.\n"); - - return app.exec(); -} - -#include "qpong.moc" diff --git a/test/qt/tst_hal.cpp b/test/qt/tst_hal.cpp deleted file mode 100644 index a69daf2f..00000000 --- a/test/qt/tst_hal.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include - -#include -#include - -class tst_Hal: public QObject -{ - Q_OBJECT - -private slots: - void getDevices(); - void lock(); -}; - -class Spy: public QObject -{ - Q_OBJECT -public: - int count; - QDBusConnection &conn; - - Spy(QDBusConnection &c) : count(0), conn(c) - { } - -public slots: - void spySlot(int, const QVariantList&) - { - ++count; - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/acpi_CPU0", - "org.freedesktop.Hal.Device", "GetProperty"); - msg << "info.locked"; - - QDBusMessage reply = conn.sendWithReply(msg); - QVERIFY(!reply.isEmpty()); - } -}; - - -void tst_Hal::getDevices() -{ - QDBusConnection &con = QDBus::systemBus(); - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.Hal", - "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal.Manager", - "GetAllDevices"); - - QDBusMessage reply = con.sendWithReply(msg); - QVERIFY(!reply.isEmpty()); - QVERIFY(reply.type() == QDBusMessage::ReplyMessage); - //qDebug() << reply; -} - -void tst_Hal::lock() -{ - QDBusConnection &con = QDBus::systemBus(); - QVERIFY(con.isConnected()); - - Spy spy( con ); - - con.connect("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/acpi_CPU0", - "org.freedesktop.Hal.Device", "PropertyModified", - &spy, SLOT(spySlot(int, QVariantList))); - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.Hal", - "/org/freedesktop/Hal/devices/acpi_CPU0", "org.freedesktop.Hal.Device", - "Lock"); - msg << "No reason..."; - - QDBusMessage reply = con.sendWithReply(msg); - //QTest::qWait(200); - //qDebug() << reply; - QCOMPARE(spy.count, 3); - QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); -} - -QTEST_MAIN(tst_Hal) - -#include "tst_hal.moc" diff --git a/test/qt/tst_headertest.cpp b/test/qt/tst_headertest.cpp deleted file mode 100644 index eb90c555..00000000 --- a/test/qt/tst_headertest.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#define QT_NO_KEYWORDS -#define signals Choke! -#define slots Choke! -#define emit Choke! -#define foreach Choke! -#define forever Choke! - -#define QT_NO_CAST_FROM_ASCII -#define QT_NO_CAST_TO_ASCII - -#include - -int main(int, char **) -{ - return 0; -} diff --git a/test/qt/tst_qdbusabstractadaptor.cpp b/test/qt/tst_qdbusabstractadaptor.cpp deleted file mode 100644 index d47c5436..00000000 --- a/test/qt/tst_qdbusabstractadaptor.cpp +++ /dev/null @@ -1,989 +0,0 @@ -#include -#include - -#include - -#include - -#include "common.h" - -#ifdef Q_CC_MSVC -#define __PRETTY_FUNCTION__ __FUNCDNAME__ -#endif - -const char *slotSpy; -QString valueSpy; - -namespace QTest { - char *toString(QDBusMessage::MessageType t) - { - switch (t) - { - case QDBusMessage::InvalidMessage: - return qstrdup("InvalidMessage"); - case QDBusMessage::MethodCallMessage: - return qstrdup("MethodCallMessage"); - case QDBusMessage::ReplyMessage: - return qstrdup("ReplyMessage"); - case QDBusMessage::ErrorMessage: - return qstrdup("ErrorMessage"); - case QDBusMessage::SignalMessage: - return qstrdup("SignalMessage"); - default: - return 0; - } - } -} - -class tst_QDBusAbstractAdaptor: public QObject -{ - Q_OBJECT - -private slots: - void methodCalls_data(); - void methodCalls(); - void signalEmissions_data(); - void signalEmissions(); - void sameSignalDifferentPaths(); - void overloadedSignalEmission_data(); - void overloadedSignalEmission(); - void readProperties(); - void writeProperties(); - - void typeMatching_data(); - void typeMatching(); -}; - -class QDBusSignalSpy: public QObject -{ - Q_OBJECT - -public slots: - void slot(const QDBusMessage &msg) - { - ++count; - interface = msg.interface(); - name = msg.name(); - signature = msg.signature(); - value.clear(); - if (msg.count()) - value = msg.at(0); - } - -public: - QDBusSignalSpy() : count(0) { } - - int count; - QString interface; - QString name; - QString signature; - QVariant value; -}; - -class Interface1: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "local.Interface1") -public: - Interface1(QObject *parent) : QDBusAbstractAdaptor(parent) - { } -}; - -class Interface2: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "local.Interface2") - Q_PROPERTY(QString prop1 READ prop1) - Q_PROPERTY(QString prop2 READ prop2 WRITE setProp2) -public: - Interface2(QObject *parent) : QDBusAbstractAdaptor(parent) - { setAutoRelaySignals(true); } - - QString prop1() const - { return __PRETTY_FUNCTION__; } - - QString prop2() const - { return __PRETTY_FUNCTION__; } - - void setProp2(const QString &value) - { slotSpy = __PRETTY_FUNCTION__; valueSpy = value; } - - void emitSignal(const QString &, const QVariant &) - { emit signal(); } - -public slots: - void method() { slotSpy = __PRETTY_FUNCTION__; } - -signals: - void signal(); -}; - -class Interface3: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "local.Interface3") - Q_PROPERTY(QString prop1 READ prop1) - Q_PROPERTY(QString prop2 READ prop2 WRITE setProp2) -public: - Interface3(QObject *parent) : QDBusAbstractAdaptor(parent) - { setAutoRelaySignals(true); } - - QString prop1() const - { return __PRETTY_FUNCTION__; } - - QString prop2() const - { return __PRETTY_FUNCTION__; } - - void setProp2(const QString &value) - { slotSpy = __PRETTY_FUNCTION__; valueSpy = value; } - - void emitSignal(const QString &name, const QVariant &value) - { - if (name == "signalVoid") - emit signalVoid(); - else if (name == "signalInt") - emit signalInt(value.toInt()); - else if (name == "signalString") - emit signalString(value.toString()); - } - -public slots: - void methodVoid() { slotSpy = __PRETTY_FUNCTION__; } - void methodInt(int) { slotSpy = __PRETTY_FUNCTION__; } - void methodString(QString) { slotSpy = __PRETTY_FUNCTION__; } - -signals: - void signalVoid(); - void signalInt(int); - void signalString(const QString &); -}; - -class Interface4: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "local.Interface4") - Q_PROPERTY(QString prop1 READ prop1) - Q_PROPERTY(QString prop2 READ prop2 WRITE setProp2) -public: - Interface4(QObject *parent) : QDBusAbstractAdaptor(parent) - { setAutoRelaySignals(true); } - - QString prop1() const - { return __PRETTY_FUNCTION__; } - - QString prop2() const - { return __PRETTY_FUNCTION__; } - - void setProp2(const QString &value) - { slotSpy = __PRETTY_FUNCTION__; valueSpy = value; } - - void emitSignal(const QString &, const QVariant &value) - { - switch (value.type()) - { - case QVariant::Invalid: - emit signal(); - break; - case QVariant::Int: - emit signal(value.toInt()); - break; - case QVariant::String: - emit signal(value.toString()); - break; - default: - break; - } - } - -public slots: - void method() { slotSpy = __PRETTY_FUNCTION__; } - void method(int) { slotSpy = __PRETTY_FUNCTION__; } - void method(QString) { slotSpy = __PRETTY_FUNCTION__; } - -signals: - void signal(); - void signal(int); - void signal(const QString &); -}; - -class MyObject: public QObject -{ - Q_OBJECT -public: - Interface1 *if1; - Interface2 *if2; - Interface3 *if3; - Interface4 *if4; - - MyObject(int n = 4) - : if1(0), if2(0), if3(0), if4(0) - { - switch (n) - { - case 4: - if4 = new Interface4(this); - case 3: - if3 = new Interface3(this); - case 2: - if2 = new Interface2(this); - case 1: - if1 = new Interface1(this); - } - } -}; - -class TypesInterface: public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "local.TypesInterface") -public: - TypesInterface(QObject *parent) - : QDBusAbstractAdaptor(parent) - { } - - union - { - bool b; - uchar uc; - short s; - ushort us; - int i; - uint ui; - qlonglong ll; - qulonglong ull; - double d; - } dataSpy; - QVariant variantSpy; - QString stringSpy; - QVariantList listSpy; - QStringList stringlistSpy; - QByteArray bytearraySpy; - QVariantMap mapSpy; - -public slots: - void methodBool(bool b) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.b = b; - } - - void methodUChar(uchar uc) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.uc = uc; - } - - void methodShort(short s) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.s = s; - } - - void methodUShort(ushort us) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.us = us; - } - - void methodInt(int i) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.i = i; - } - - void methodUInt(uint ui) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.ui = ui; - } - - void methodLongLong(qlonglong ll) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.ll = ll; - } - - void methodULongLong(qulonglong ull) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.ull = ull; - } - - void methodDouble(double d) - { - slotSpy = __PRETTY_FUNCTION__; - dataSpy.d = d; - } - - void methodString(const QString &s) - { - slotSpy = __PRETTY_FUNCTION__; - stringSpy = s; - } - - void methodVariant(const QVariant &v) - { - slotSpy = __PRETTY_FUNCTION__; - variantSpy = v; - } - - void methodList(const QVariantList &l) - { - slotSpy = __PRETTY_FUNCTION__; - listSpy = l; - } - - void methodStringList(const QStringList &sl) - { - slotSpy = __PRETTY_FUNCTION__; - stringlistSpy = sl; - } - - void methodByteArray(const QByteArray &ba) - { - slotSpy = __PRETTY_FUNCTION__; - bytearraySpy = ba; - } - - void methodMap(const QVariantMap &m) - { - slotSpy = __PRETTY_FUNCTION__; - mapSpy = m; - } - - bool retrieveBool() - { - return dataSpy.b; - } - - uchar retrieveUChar() - { - return dataSpy.uc; - } - - short retrieveShort() - { - return dataSpy.s; - } - - ushort retrieveUShort() - { - return dataSpy.us; - } - - int retrieveInt() - { - return dataSpy.i; - } - - uint retrieveUInt() - { - return dataSpy.ui; - } - - qlonglong retrieveLongLong() - { - return dataSpy.ll; - } - - qulonglong retrieveULongLong() - { - return dataSpy.ull; - } - - double retrieveDouble() - { - return dataSpy.d; - } - - QString retrieveString() - { - return stringSpy; - } - - QVariant retrieveVariant() - { - return variantSpy; - } - - QVariantList retrieveList() - { - return listSpy; - } - - QStringList retrieveStringList() - { - return stringlistSpy; - } - - QByteArray retrieveByteArray() - { - return bytearraySpy; - } - - QVariantMap retrieveMap() - { - return mapSpy; - } -}; - -void tst_QDBusAbstractAdaptor::methodCalls_data() -{ - QTest::addColumn("nInterfaces"); - QTest::newRow("0") << 0; - QTest::newRow("1") << 1; - QTest::newRow("2") << 2; - QTest::newRow("3") << 3; - QTest::newRow("4") << 4; -} - -void tst_QDBusAbstractAdaptor::methodCalls() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - //QDBusInterface *empty = con.findInterface(con.baseService(), "/", QString()); - QDBusInterface *if1 = con.findInterface(con.baseService(), "/", "local.Interface1"); - QDBusInterface *if2 = con.findInterface(con.baseService(), "/", "local.Interface2"); - QDBusInterface *if3 = con.findInterface(con.baseService(), "/", "local.Interface3"); - QDBusInterface *if4 = con.findInterface(con.baseService(), "/", "local.Interface4"); - - QObject deleter; - if1->setParent(&deleter); - if2->setParent(&deleter); - if3->setParent(&deleter); - if4->setParent(&deleter); - - // must fail: no object - //QCOMPARE(empty->call("method").type(), QDBusMessage::ErrorMessage); - QCOMPARE(if1->call(QDBusInterface::UseEventLoop, "method").type(), QDBusMessage::ErrorMessage); - - QFETCH(int, nInterfaces); - MyObject obj(nInterfaces); - con.registerObject("/", &obj); - - // must fail: no such method - QCOMPARE(if1->call(QDBusInterface::UseEventLoop, "method").type(), QDBusMessage::ErrorMessage); - if (!nInterfaces--) - return; - if (!nInterfaces--) - return; - - // simple call: one such method exists - QCOMPARE(if2->call(QDBusInterface::UseEventLoop, "method").type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface2::method()"); - if (!nInterfaces--) - return; - - // multiple methods in multiple interfaces, no name overlap - QCOMPARE(if1->call(QDBusInterface::UseEventLoop, "methodVoid").type(), QDBusMessage::ErrorMessage); - QCOMPARE(if1->call(QDBusInterface::UseEventLoop, "methodInt").type(), QDBusMessage::ErrorMessage); - QCOMPARE(if1->call(QDBusInterface::UseEventLoop, "methodString").type(), QDBusMessage::ErrorMessage); - QCOMPARE(if2->call(QDBusInterface::UseEventLoop, "methodVoid").type(), QDBusMessage::ErrorMessage); - QCOMPARE(if2->call(QDBusInterface::UseEventLoop, "methodInt").type(), QDBusMessage::ErrorMessage); - QCOMPARE(if2->call(QDBusInterface::UseEventLoop, "methodString").type(), QDBusMessage::ErrorMessage); - - QCOMPARE(if3->call(QDBusInterface::UseEventLoop, "methodVoid").type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface3::methodVoid()"); - QCOMPARE(if3->call(QDBusInterface::UseEventLoop, "methodInt", 42).type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface3::methodInt(int)"); - QCOMPARE(if3->call(QDBusInterface::UseEventLoop, "methodString", QString("")).type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface3::methodString(QString)"); - - if (!nInterfaces--) - return; - - // method overloading: different interfaces - QCOMPARE(if4->call(QDBusInterface::UseEventLoop, "method").type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface4::method()"); - - // method overloading: different parameters - QCOMPARE(if4->call(QDBusInterface::UseEventLoop, "method.i", 42).type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface4::method(int)"); - QCOMPARE(if4->call(QDBusInterface::UseEventLoop, "method.s", QString()).type(), QDBusMessage::ReplyMessage); - QCOMPARE(slotSpy, "void Interface4::method(QString)"); - -} - -static void emitSignal(MyObject *obj, const QString &iface, const QString &name, - const QVariant ¶meter) -{ - if (iface.endsWith('2')) - obj->if2->emitSignal(name, parameter); - else if (iface.endsWith('3')) - obj->if3->emitSignal(name, parameter); - else if (iface.endsWith('4')) - obj->if4->emitSignal(name, parameter); - - QTest::qWait(200); -} - -void tst_QDBusAbstractAdaptor::signalEmissions_data() -{ - QTest::addColumn("interface"); - QTest::addColumn("name"); - QTest::addColumn("signature"); - QTest::addColumn("parameter"); - - QTest::newRow("Interface2.signal") << "local.Interface2" << "signal" << QString() << QVariant(); - QTest::newRow("Interface3.signalVoid") << "local.Interface3" << "signalVoid" << QString() << QVariant(); - QTest::newRow("Interface3.signalInt") << "local.Interface3" << "signalInt" << "i" << QVariant(1); - QTest::newRow("Interface3.signalString") << "local.Interface3" << "signalString" << "s" << QVariant("foo"); -} - -void tst_QDBusAbstractAdaptor::signalEmissions() -{ - QFETCH(QString, interface); - QFETCH(QString, name); - QFETCH(QVariant, parameter); - - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - MyObject obj(3); - con.registerObject("/", &obj); - - //QDBusInterface empty = con.findInterface(con.baseService(), "/", QString()); - QDBusInterface *if2 = con.findInterface(con.baseService(), "/", "local.Interface2"); - QDBusInterface *if3 = con.findInterface(con.baseService(), "/", "local.Interface3"); - QObject deleter; - if2->setParent(&deleter); - if3->setParent(&deleter); - - // connect all signals and emit only one - { - QDBusSignalSpy spy; - con.connect(con.baseService(), "/", "local.Interface2", "signal", - &spy, SLOT(slot(QDBusMessage))); - con.connect(con.baseService(), "/", "local.Interface3", "signalVoid", - &spy, SLOT(slot(QDBusMessage))); - con.connect(con.baseService(), "/", "local.Interface3", "signalInt", - &spy, SLOT(slot(QDBusMessage))); - con.connect(con.baseService(), "/", "local.Interface3", "signalString", - &spy, SLOT(slot(QDBusMessage))); - - emitSignal(&obj, interface, name, parameter); - - QCOMPARE(spy.count, 1); - QCOMPARE(spy.interface, interface); - QCOMPARE(spy.name, name); - QTEST(spy.signature, "signature"); - QCOMPARE(spy.value, parameter); - } - - // connect one signal and emit them all - { - QDBusSignalSpy spy; - con.connect(con.baseService(), "/", interface, name, &spy, SLOT(slot(QDBusMessage))); - emitSignal(&obj, "local.Interface2", "signal", QVariant()); - emitSignal(&obj, "local.Interface3", "signalVoid", QVariant()); - emitSignal(&obj, "local.Interface3", "signalInt", QVariant(1)); - emitSignal(&obj, "local.Interface3", "signalString", QVariant("foo")); - - QCOMPARE(spy.count, 1); - QCOMPARE(spy.interface, interface); - QCOMPARE(spy.name, name); - QTEST(spy.signature, "signature"); - QCOMPARE(spy.value, parameter); - } -} - -void tst_QDBusAbstractAdaptor::sameSignalDifferentPaths() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - MyObject obj(2); - - con.registerObject("/p1",&obj); - con.registerObject("/p2",&obj); - - QDBusSignalSpy spy; - con.connect(con.baseService(), "/p1", "local.Interface2", "signal", &spy, SLOT(slot(QDBusMessage))); - obj.if2->emitSignal(QString(), QVariant()); - QTest::qWait(200); - - QCOMPARE(spy.count, 1); - QCOMPARE(spy.interface, QString("local.Interface2")); - QCOMPARE(spy.name, QString("signal")); - QVERIFY(spy.signature.isEmpty()); - - // now connect the other one - spy.count = 0; - con.connect(con.baseService(), "/p2", "local.Interface2", "signal", &spy, SLOT(slot(QDBusMessage))); - obj.if2->emitSignal(QString(), QVariant()); - QTest::qWait(200); - - QCOMPARE(spy.count, 2); -} - -void tst_QDBusAbstractAdaptor::overloadedSignalEmission_data() -{ - QTest::addColumn("signature"); - QTest::addColumn("parameter"); - QTest::newRow("void") << QString("") << QVariant(); - QTest::newRow("int") << "i" << QVariant(1); - QTest::newRow("string") << "s" << QVariant("foo"); -} - -void tst_QDBusAbstractAdaptor::overloadedSignalEmission() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - MyObject obj; - con.registerObject("/", &obj); - - QString interface = "local.Interface4"; - QString name = "signal"; - QFETCH(QVariant, parameter); - //QDBusInterface *if4 = con.findInterface(con.baseService(), "/", interface); - - // connect all signals and emit only one - { - QDBusSignalSpy spy; - con.connect(con.baseService(), "/", "local.Interface4", "signal", "", - &spy, SLOT(slot(QDBusMessage))); - con.connect(con.baseService(), "/", "local.Interface4", "signal", "i", - &spy, SLOT(slot(QDBusMessage))); - con.connect(con.baseService(), "/", "local.Interface4", "signal", "s", - &spy, SLOT(slot(QDBusMessage))); - - emitSignal(&obj, interface, name, parameter); - - QCOMPARE(spy.count, 1); - QCOMPARE(spy.interface, interface); - QCOMPARE(spy.name, name); - QTEST(spy.signature, "signature"); - QCOMPARE(spy.value, parameter); - } - - QFETCH(QString, signature); - // connect one signal and emit them all - { - QDBusSignalSpy spy; - con.connect(con.baseService(), "/", interface, name, signature, &spy, SLOT(slot(QDBusMessage))); - emitSignal(&obj, "local.Interface4", "signal", QVariant()); - emitSignal(&obj, "local.Interface4", "signal", QVariant(1)); - emitSignal(&obj, "local.Interface4", "signal", QVariant("foo")); - - QCOMPARE(spy.count, 1); - QCOMPARE(spy.interface, interface); - QCOMPARE(spy.name, name); - QTEST(spy.signature, "signature"); - QCOMPARE(spy.value, parameter); - } -} - -void tst_QDBusAbstractAdaptor::readProperties() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - MyObject obj; - con.registerObject("/", &obj); - - QDBusInterfacePtr properties(con, con.baseService(), "/", "org.freedesktop.DBus.Properties"); - for (int i = 2; i <= 4; ++i) { - QString name = QString("Interface%1").arg(i); - - for (int j = 1; j <= 2; ++j) { - QString propname = QString("prop%1").arg(j); - QDBusReply reply = - properties->call(QDBusInterface::UseEventLoop, "Get", "local." + name, propname); - QVariant value = reply; - - QCOMPARE(value.userType(), int(QVariant::String)); - QCOMPARE(value.toString(), QString("QString %1::%2() const").arg(name, propname)); - } - } -} - -void tst_QDBusAbstractAdaptor::writeProperties() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - MyObject obj; - con.registerObject("/", &obj); - - QDBusInterfacePtr properties(con, con.baseService(), "/", "org.freedesktop.DBus.Properties"); - for (int i = 2; i <= 4; ++i) { - QString name = QString("Interface%1").arg(i); - - QVariant value(name); - - valueSpy.clear(); - properties->call(QDBusInterface::UseEventLoop, "Set", "local." + name, QString("prop1"), - value); - QVERIFY(valueSpy.isEmpty()); // call mustn't have succeeded - - properties->call(QDBusInterface::UseEventLoop, "Set", "local." + name, QString("prop2"), - value); - QCOMPARE(valueSpy, name); - QCOMPARE(QString(slotSpy), QString("void %1::setProp2(const QString&)").arg(name)); - } -} - -#if 0 -void tst_QDBusAbstractAdaptor::adaptorIntrospection_data() -{ - methodCalls_data(); -} - -void tst_QDBusAbstractAdaptor::adaptorIntrospection() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - QObject obj; - con.registerObject("/", &obj); - - QFETCH(int, nInterfaces); - switch (nInterfaces) - { - case 4: - new Interface4(&obj); - case 3: - new Interface3(&obj); - case 2: - new Interface2(&obj); - case 1: - new Interface1(&obj); - } - - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QVERIFY(dobj.isValid()); - - QString xml = dobj.introspect(); - QVERIFY(!xml.isEmpty()); - - QStringList interfaces = dobj.interfaces(); - QCOMPARE(interfaces.count(), nInterfaces + 2); - switch (nInterfaces) - { - case 4: { - QVERIFY(interfaces.contains("local.Interface4")); - QDBusInterface iface(dobj, "local.Interface4"); - QCOMPARE(iface.methodData(), Interface4::methodData); - QCOMPARE(iface.signalData(), Interface4::signalData); - QCOMPARE(iface.propertyData(), Interface4::propertyData); - } - case 3: { - QVERIFY(interfaces.contains("local.Interface3")); - QDBusInterface iface(dobj, "local.Interface3"); - QCOMPARE(iface.methodData(), Interface3::methodData); - QCOMPARE(iface.signalData(), Interface3::signalData); - QCOMPARE(iface.propertyData(), Interface3::propertyData); - } - case 2: { - QVERIFY(interfaces.contains("local.Interface2")); - QDBusInterface iface(dobj, "local.Interface2"); - QCOMPARE(iface.methodData(), Interface2::methodData); - QCOMPARE(iface.signalData(), Interface2::signalData); - QCOMPARE(iface.propertyData(), Interface2::propertyData); - } - case 1: { - QVERIFY(interfaces.contains("local.Interface1")); - QDBusInterface iface(dobj, "local.Interface1"); - QCOMPARE(iface.methodData(), Interface1::methodData); - QCOMPARE(iface.signalData(), Interface1::signalData); - QCOMPARE(iface.propertyData(), Interface1::propertyData); - } - } -} - -void tst_QDBusAbstractAdaptor::objectTreeIntrospection() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - { - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.isEmpty()); - } - - QObject root; - con.registerObject("/", &root); - { - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.isEmpty()); - } - - QObject p1; - con.registerObject("/p1", &p1); - { - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.contains("p1")); - } - - con.unregisterObject("/"); - { - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.contains("p1")); - } - - con.registerObject("/p1/q/r", &root); - { - QDBusObject dobj = con.findObject(con.baseService(), "/p1"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.contains("q")); - } - { - QDBusObject dobj = con.findObject(con.baseService(), "/p1/q"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.contains("r")); - } - - con.unregisterObject("/p1", QDBusConnection::UnregisterTree); - { - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.isEmpty()); - } - - QObject p2; - con.registerObject("/p2", &p2, QDBusConnection::ExportChildObjects); - { - QDBusObject dobj = con.findObject(con.baseService(), "/"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(!tree.childObjects.contains("p1")); - QVERIFY(tree.childObjects.contains("p2")); - } - - QObject q; - q.setParent(&p2); - { - QDBusObject dobj = con.findObject(con.baseService(), "/p2"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(!tree.childObjects.contains("q")); - } - - q.setObjectName("q"); - { - QDBusObject dobj = con.findObject(con.baseService(), "/p2"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(tree.childObjects.contains("q")); - } - - q.setParent(0); - { - QDBusObject dobj = con.findObject(con.baseService(), "/p2"); - QString xml = dobj.introspect(); - - QDBusIntrospection::Object tree = - QDBusIntrospection::parseObject(xml); - QVERIFY(!tree.childObjects.contains("q")); - } -} -#endif - -static inline QVariant nest(const QVariant& v) -{ - QVariant ret; - qVariantSetValue(ret, v); - return ret; -} - -void tst_QDBusAbstractAdaptor::typeMatching_data() -{ - QTest::addColumn("basename"); - QTest::addColumn("signature"); - QTest::addColumn("value"); - - QTest::newRow("bool") << "Bool" << "b" << QVariant(true); - QTest::newRow("byte") << "UChar" << "y" << qVariantFromValue(uchar(42)); - QTest::newRow("short") << "Short" << "n" << qVariantFromValue(short(-43)); - QTest::newRow("ushort") << "UShort" << "q" << qVariantFromValue(ushort(44)); - QTest::newRow("int") << "Int" << "i" << QVariant(42); - QTest::newRow("uint") << "UInt" << "u" << QVariant(42U); - QTest::newRow("qlonglong") << "LongLong" << "x" << QVariant(Q_INT64_C(42)); - QTest::newRow("qulonglong") << "ULongLong" << "t" << QVariant(Q_UINT64_C(42)); - QTest::newRow("double") << "Double" << "d" << QVariant(2.5); - QTest::newRow("string") << "String" << "s" << QVariant("Hello, World!"); - - QTest::newRow("variant") << "Variant" << "v" << nest(QVariant("Hello again!")); - QTest::newRow("list") << "List" << "av" << QVariant(QVariantList() - << nest(42) - << nest(QString("foo")) - << nest(QByteArray("bar")) - << nest(nest(QString("baz")))); - QTest::newRow("stringlist") << "StringList" << "as" << QVariant(QStringList() << "Hello" << "world"); - QTest::newRow("bytearray") << "ByteArray" << "ay" << QVariant(QByteArray("foo")); - - QVariantMap map; - map["one"] = nest(1); // int - map["The answer to life, the Universe and everything"] = nest(42u); // uint - map["In the beginning..."] = nest(QString("There was nothing")); // string - map["but Unix came and said"] = nest(QByteArray("\"Hello, World\"")); // bytearray - map["two"] = nest(qVariantFromValue(short(2))); // short - QTest::newRow("map") << "Map" << "a{sv}" << QVariant(map); -} - -void tst_QDBusAbstractAdaptor::typeMatching() -{ - QObject obj; - new TypesInterface(&obj); - - QDBusConnection &con = QDBus::sessionBus(); - con.registerObject("/types", &obj); - - QFETCH(QString, basename); - QFETCH(QString, signature); - QFETCH(QVariant, value); - - QDBusMessage reply; - QDBusInterface *iface = con.findInterface(con.baseService(), "/types", "local.TypesInterface"); - - reply = iface->callWithArgs("method" + basename + '.' + signature, QVariantList() << value, - QDBusInterface::UseEventLoop); - QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); - - reply = iface->call(QDBusInterface::UseEventLoop, "retrieve" + basename); - QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); - QCOMPARE(reply.count(), 1); - - const QVariant &retval = reply.at(0); - QCOMPARE(retval.userType(), value.userType()); - QVERIFY(compare(retval, value)); - - iface->deleteLater(); -} - -QTEST_MAIN(tst_QDBusAbstractAdaptor) - -#include "tst_qdbusabstractadaptor.moc" diff --git a/test/qt/tst_qdbusconnection.cpp b/test/qt/tst_qdbusconnection.cpp deleted file mode 100644 index a887cd93..00000000 --- a/test/qt/tst_qdbusconnection.cpp +++ /dev/null @@ -1,257 +0,0 @@ -#include -#include - -#include - -#include - -class MyObject: public QObject -{ - Q_OBJECT -public slots: - void method(const QDBusMessage &msg) { serial = msg.serialNumber(); path = msg.path(); } - -public: - int serial; - QString path; - MyObject() : serial(0) { } -}; - -class tst_QDBusConnection: public QObject -{ - Q_OBJECT - -private slots: - void addConnection(); - void connect(); - void send(); - void sendAsync(); - void sendSignal(); - - void registerObject(); - -public: - bool callMethod(const QDBusConnection &conn, const QString &path); -}; - -class QDBusSpy: public QObject -{ - Q_OBJECT -public slots: - void handlePing(const QString &str) { args.clear(); args << str; } - void asyncReply(const QDBusMessage &msg) { args << msg; serial = msg.replySerialNumber(); } - -public: - QList args; - int serial; -}; - -void tst_QDBusConnection::sendSignal() -{ - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::signal("/org/kde/selftest", "org.kde.selftest", - "Ping"); - msg << QLatin1String("ping"); - - QVERIFY(con.send(msg)); - - QTest::qWait(1000); -} - -void tst_QDBusConnection::send() -{ - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.DBus", - "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames"); - - QDBusMessage reply = con.sendWithReply(msg); - - QCOMPARE(reply.count(), 1); - QCOMPARE(reply.at(0).typeName(), "QStringList"); - QVERIFY(reply.at(0).toStringList().contains(con.baseService())); -} - -void tst_QDBusConnection::sendAsync() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - QDBusSpy spy; - - QDBusMessage msg = QDBusMessage::methodCall("org.freedesktop.DBus", - "/org/freedesktop/DBus", "org.freedesktop.DBus", "ListNames"); - int msgId = con.sendWithReplyAsync(msg, &spy, SLOT(asyncReply(QDBusMessage))); - QVERIFY(msgId != 0); - - QTest::qWait(1000); - - QCOMPARE(spy.args.value(0).typeName(), "QStringList"); - QVERIFY(spy.args.at(0).toStringList().contains(con.baseService())); - QCOMPARE(spy.serial, msgId); -} - -void tst_QDBusConnection::connect() -{ - QDBusSpy spy; - - QDBusConnection &con = QDBus::sessionBus(); - - con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy, - SLOT(handlePing(QString))); - - QDBusMessage msg = QDBusMessage::signal("/org/kde/selftest", "org.kde.selftest", - "ping"); - msg << QLatin1String("ping"); - - QVERIFY(con.send(msg)); - - QTest::qWait(1000); - - QCOMPARE(spy.args.count(), 1); - QCOMPARE(spy.args.at(0).toString(), QString("ping")); -} - -void tst_QDBusConnection::addConnection() -{ - { - QDBusConnection con = QDBusConnection::addConnection( - QDBusConnection::SessionBus, "bubu"); - - QVERIFY(con.isConnected()); - QVERIFY(!con.lastError().isValid()); - - QDBusConnection con2("foo"); - QVERIFY(!con2.isConnected()); - QVERIFY(!con2.lastError().isValid()); - - con2 = con; - QVERIFY(con.isConnected()); - QVERIFY(con2.isConnected()); - QVERIFY(!con.lastError().isValid()); - QVERIFY(!con2.lastError().isValid()); - } - - { - QDBusConnection con("bubu"); - QVERIFY(con.isConnected()); - QVERIFY(!con.lastError().isValid()); - } - - QDBusConnection::closeConnection("bubu"); - - { - QDBusConnection con("bubu"); - QVERIFY(!con.isConnected()); - QVERIFY(!con.lastError().isValid()); - } -} - -void tst_QDBusConnection::registerObject() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - // make sure nothing is using our paths: - QVERIFY(!callMethod(con, "/")); - QVERIFY(!callMethod(con, "/p1")); - QVERIFY(!callMethod(con, "/p2")); - QVERIFY(!callMethod(con, "/p1/q")); - QVERIFY(!callMethod(con, "/p1/q/r")); - - { - // register one object at root: - MyObject obj; - QVERIFY(con.registerObject("/", &obj, QDBusConnection::ExportSlots)); - QVERIFY(callMethod(con, "/")); - QCOMPARE(obj.path, QString("/")); - } - // make sure it's gone - QVERIFY(!callMethod(con, "/")); - - { - // register one at an element: - MyObject obj; - QVERIFY(con.registerObject("/p1", &obj, QDBusConnection::ExportSlots)); - QVERIFY(!callMethod(con, "/")); - QVERIFY(callMethod(con, "/p1")); - QCOMPARE(obj.path, QString("/p1")); - - // re-register it somewhere else - QVERIFY(con.registerObject("/p2", &obj, QDBusConnection::ExportSlots)); - QVERIFY(callMethod(con, "/p1")); - QCOMPARE(obj.path, QString("/p1")); - QVERIFY(callMethod(con, "/p2")); - QCOMPARE(obj.path, QString("/p2")); - } - // make sure it's gone - QVERIFY(!callMethod(con, "/p1")); - QVERIFY(!callMethod(con, "/p2")); - - { - // register at a deep path - MyObject obj; - QVERIFY(con.registerObject("/p1/q/r", &obj, QDBusConnection::ExportSlots)); - QVERIFY(!callMethod(con, "/")); - QVERIFY(!callMethod(con, "/p1")); - QVERIFY(!callMethod(con, "/p1/q")); - QVERIFY(callMethod(con, "/p1/q/r")); - QCOMPARE(obj.path, QString("/p1/q/r")); - } - // make sure it's gone - QVERIFY(!callMethod(con, "/p1/q/r")); - - { - MyObject obj; - QVERIFY(con.registerObject("/p1/q2", &obj, QDBusConnection::ExportSlots)); - QVERIFY(callMethod(con, "/p1/q2")); - QCOMPARE(obj.path, QString("/p1/q2")); - - // try unregistering - con.unregisterObject("/p1/q2"); - QVERIFY(!callMethod(con, "/p1/q2")); - - // register it again - QVERIFY(con.registerObject("/p1/q2", &obj, QDBusConnection::ExportSlots)); - QVERIFY(callMethod(con, "/p1/q2")); - QCOMPARE(obj.path, QString("/p1/q2")); - - // now try removing things around it: - con.unregisterObject("/p2"); - QVERIFY(callMethod(con, "/p1/q2")); // unrelated object shouldn't affect - - con.unregisterObject("/p1"); - QVERIFY(callMethod(con, "/p1/q2")); // unregistering just the parent shouldn't affect it - - con.unregisterObject("/p1/q2/r"); - QVERIFY(callMethod(con, "/p1/q2")); // unregistering non-existing child shouldn't affect it either - - con.unregisterObject("/p1/q"); - QVERIFY(callMethod(con, "/p1/q2")); // unregistering sibling (before) shouldn't affect - - con.unregisterObject("/p1/r"); - QVERIFY(callMethod(con, "/p1/q2")); // unregistering sibling (after) shouldn't affect - - // now remove it: - con.unregisterObject("/p1", QDBusConnection::UnregisterTree); - QVERIFY(!callMethod(con, "/p1/q2")); // we removed the full tree - } -} - -bool tst_QDBusConnection::callMethod(const QDBusConnection &conn, const QString &path) -{ - QDBusMessage msg = QDBusMessage::methodCall(conn.baseService(), path, "local.any", "method"); - QDBusMessage reply = conn.sendWithReply(msg, QDBusConnection::UseEventLoop); - - return reply.type() == QDBusMessage::ReplyMessage; -} - -QTEST_MAIN(tst_QDBusConnection) - -#include "tst_qdbusconnection.moc" - diff --git a/test/qt/tst_qdbusinterface.cpp b/test/qt/tst_qdbusinterface.cpp deleted file mode 100644 index a63b8e0b..00000000 --- a/test/qt/tst_qdbusinterface.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ -#include -#include -#include - -#include -#include - -#include "common.h" - -Q_DECLARE_METATYPE(QVariantList) - -#define TEST_INTERFACE_NAME "com.trolltech.QtDBus.MyObject" -#define TEST_SIGNAL_NAME "somethingHappened" - -class MyObject: public QObject -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.QtDBus.MyObject") - Q_CLASSINFO("D-Bus Introspection", "" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" - "") -public: - MyObject() - { - QObject *subObject = new QObject(this); - subObject->setObjectName("subObject"); - } - -public slots: - - void ping(const QDBusMessage &msg) - { - QDBusMessage reply = QDBusMessage::methodReply(msg); - reply << static_cast >(msg); - if (!msg.connection().send(reply)) - exit(1); - } -}; - -class Spy: public QObject -{ - Q_OBJECT -public: - QString received; - int count; - - Spy() : count(0) - { } - -public slots: - void spySlot(const QString& arg) - { - received = arg; - ++count; - } -}; - -// helper function -void emitSignal(const QString &interface, const QString &name, const QString &arg) -{ - QDBusMessage msg = QDBusMessage::signal("/", interface, name); - msg << arg; - QDBus::sessionBus().send(msg); - - QTest::qWait(200); -} - -class tst_QDBusInterface: public QObject -{ - Q_OBJECT - MyObject obj; -private slots: - void initTestCase(); - - void call_data(); - void call(); - - void introspect(); - - void signal(); -}; - -void tst_QDBusInterface::initTestCase() -{ - QDBusConnection &con = QDBus::sessionBus(); - QVERIFY(con.isConnected()); - - con.registerObject("/", &obj, QDBusConnection::ExportAdaptors | QDBusConnection::ExportSlots | - QDBusConnection::ExportChildObjects); -} - -void tst_QDBusInterface::call_data() -{ - QTest::addColumn("method"); - QTest::addColumn("input"); - QTest::addColumn("output"); - - QVariantList input; - QTest::newRow("empty") << "ping" << input << input; - - input << qVariantFromValue(1); - QTest::newRow("int") << "ping" << input << input; - QTest::newRow("int-int") << "ping.i" << input << input; - QTest::newRow("int-int16") << "ping.n" << input << (QVariantList() << qVariantFromValue(short(1))); - - // try doing some conversions - QVariantList output; - output << qVariantFromValue(1U); - QTest::newRow("int-uint") << "ping.u" << input << output; - -#if QT_VERSION >= 0x040200 - output.clear(); - output << qVariantFromValue(ushort(1)); - QTest::newRow("int-uint16") << "ping.q" << input << output; -#endif - - QTest::newRow("int-int64") << "ping.x" << input << (QVariantList() << qVariantFromValue(Q_INT64_C(1))); - QTest::newRow("int-uint64") << "ping.t" << input << (QVariantList() << qVariantFromValue(Q_UINT64_C(1))); - QTest::newRow("int-double") << "ping.d" << input << (QVariantList() << qVariantFromValue(1.0)); - - output.clear(); - output << QString("1"); - QTest::newRow("int-string") << "ping.s" << input << output; - - // try from string now - input = output; - QTest::newRow("string") << "ping" << input << output; - QTest::newRow("string-string") << "ping.s" << input << output; - - output.clear(); - output << qVariantFromValue(1); - QTest::newRow("string-int") << "ping.i" << input << output; - -#if QT_VERSION >= 0x040200 - output.clear(); - output << qVariantFromValue(short(1)); - QTest::newRow("string-int16") << "ping.n" << input << input; -#endif - - output.clear(); - output << qVariantFromValue(1U); - QTest::newRow("string-uint") << "ping.u" << input << output; - -#if QT_VERSION >= 0x040200 - output.clear(); - output << qVariantFromValue(ushort(1)); - QTest::newRow("string-uint16") << "ping.q" << input << output; -#endif - - QTest::newRow("string-int64") << "ping.x" << input << (QVariantList() << qVariantFromValue(1LL)); - QTest::newRow("string-uint64") << "ping.t" << input << (QVariantList() << qVariantFromValue(1ULL)); - QTest::newRow("string-double") << "ping.d" << input << (QVariantList() << qVariantFromValue(1.0)); - - // two args (must be strings!) - input.clear(); - input << QString("Hello") << QString("World"); - output = input; - QTest::newRow("two-strings") << "ping" << input << output; - QTest::newRow("two-strings") << "ping.ss" << input << output; - - // this should drop one of the arguments - output.removeLast(); - QTest::newRow("last-dropped") << "ping.s" << input << output; -} - -void tst_QDBusInterface::call() -{ - QDBusConnection &con = QDBus::sessionBus(); - QDBusInterface *iface = con.findInterface(con.baseService(), QLatin1String("/"), - TEST_INTERFACE_NAME); - - QFETCH(QString, method); - QFETCH(QVariantList, input); - QFETCH(QVariantList, output); - - QDBusMessage reply; - // try first callWithArgs: - reply = iface->callWithArgs(method, input, QDBusInterface::UseEventLoop); - - QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); - if (!output.isEmpty()) { - QCOMPARE(reply.count(), output.count()); - QVERIFY(compare(reply, output)); - } - - // try the template methods - if (input.isEmpty()) - reply = iface->call(QDBusInterface::UseEventLoop, method); - else if (input.count() == 1) - switch (input.at(0).type()) - { - case QVariant::Int: - reply = iface->call(QDBusInterface::UseEventLoop, method, input.at(0).toInt()); - break; - - case QVariant::UInt: - reply = iface->call(QDBusInterface::UseEventLoop, method, input.at(0).toUInt()); - break; - - case QVariant::String: - reply = iface->call(QDBusInterface::UseEventLoop, method, input.at(0).toString()); - break; - - default: - QFAIL("Unknown type. Please update the test case"); - break; - } - else - reply = iface->call(QDBusInterface::UseEventLoop, method, input.at(0).toString(), input.at(1).toString()); - - QCOMPARE(reply.type(), QDBusMessage::ReplyMessage); - if (!output.isEmpty()) { - QCOMPARE(reply.count(), output.count()); - QVERIFY(compare(reply, output)); - } -} - -void tst_QDBusInterface::introspect() -{ - QDBusConnection &con = QDBus::sessionBus(); - QDBusInterface *iface = con.findInterface(QDBus::sessionBus().baseService(), QLatin1String("/"), - TEST_INTERFACE_NAME); - - const QMetaObject *mo = iface->metaObject(); - - qDebug("Improve to a better testcase of QDBusMetaObject"); - QCOMPARE(mo->methodCount() - mo->methodOffset(), 3); - QVERIFY(mo->indexOfSignal(TEST_SIGNAL_NAME "(QString)") != -1); - - QCOMPARE(mo->propertyCount() - mo->propertyOffset(), 1); - QVERIFY(mo->indexOfProperty("prop1") != -1); - - iface->deleteLater(); -} - -void tst_QDBusInterface::signal() -{ - QDBusConnection &con = QDBus::sessionBus(); - QDBusInterface *iface = con.findInterface(con.baseService(), QLatin1String("/"), - TEST_INTERFACE_NAME); - - QString arg = "So long and thanks for all the fish"; - { - Spy spy; - spy.connect(iface, SIGNAL(somethingHappened(QString)), SLOT(spySlot(QString))); - - emitSignal(TEST_INTERFACE_NAME, TEST_SIGNAL_NAME, arg); - QCOMPARE(spy.count, 1); - QCOMPARE(spy.received, arg); - } - - iface->deleteLater(); -} - -QTEST_MAIN(tst_QDBusInterface) - -#include "tst_qdbusinterface.moc" - diff --git a/test/qt/tst_qdbusmarshall.cpp b/test/qt/tst_qdbusmarshall.cpp deleted file mode 100644 index 306f7b6a..00000000 --- a/test/qt/tst_qdbusmarshall.cpp +++ /dev/null @@ -1,342 +0,0 @@ -#include -#include -#include - -#include "common.h" -#include - -class tst_QDBusMarshall: public QObject -{ - Q_OBJECT - -public slots: - void initTestCase(); - void cleanupTestCase(); - -private slots: - void sendBasic_data(); - void sendBasic(); - - void sendVariant_data(); - void sendVariant(); - - void sendArrays_data(); - void sendArrays(); - - void sendArrayOfArrays_data(); - void sendArrayOfArrays(); - - void sendStringMap_data(); - void sendStringMap(); - - void sendStringMapOfMap_data(); - void sendStringMapOfMap(); - -private: - QProcess proc; -}; - -void tst_QDBusMarshall::initTestCase() -{ - proc.start("./qpong"); - QVERIFY(proc.waitForStarted()); - QTest::qWait(2000); -} - -void tst_QDBusMarshall::cleanupTestCase() -{ - proc.close(); - proc.kill(); -} - -void tst_QDBusMarshall::sendBasic_data() -{ - QTest::addColumn("value"); - QTest::addColumn("sig"); - - // basic types: - QTest::newRow("bool") << QVariant(false) << "b"; - QTest::newRow("bool2") << QVariant(true) << "b"; - QTest::newRow("byte") << qVariantFromValue(uchar(1)) << "y"; - QTest::newRow("int16") << qVariantFromValue(short(2)) << "n"; - QTest::newRow("uint16") << qVariantFromValue(ushort(3)) << "q"; - QTest::newRow("int") << QVariant(1) << "i"; - QTest::newRow("uint") << QVariant(2U) << "u"; - QTest::newRow("int64") << QVariant(Q_INT64_C(3)) << "x"; - QTest::newRow("uint64") << QVariant(Q_UINT64_C(4)) << "t"; - QTest::newRow("double") << QVariant(42.5) << "d"; - QTest::newRow("string") << QVariant("ping") << "s"; - QTest::newRow("emptystring") << QVariant("") << "s"; - QTest::newRow("nullstring") << QVariant(QString()) << "s"; -} - -void tst_QDBusMarshall::sendVariant_data() -{ - sendBasic_data(); - - // add a few more: - QVariant nested(1); - QTest::newRow("variant") << nested << "v"; - - QVariant nested2; - qVariantSetValue(nested2, nested); - QTest::newRow("variant-variant") << nested2 << "v"; -} - -void tst_QDBusMarshall::sendArrays_data() -{ - QTest::addColumn("value"); - QTest::addColumn("sig"); - - // arrays: - QStringList strings; - QTest::newRow("emptystringlist") << QVariant(strings) << "as"; - strings << "hello" << "world"; - QTest::newRow("stringlist") << QVariant(strings) << "as"; - - strings.clear(); - strings << "" << "" << ""; - QTest::newRow("list-of-emptystrings") << QVariant(strings) << "as"; - - strings.clear(); - strings << QString() << QString() << QString() << QString(); - QTest::newRow("list-of-nullstrings") << QVariant(strings) << "as"; - - QByteArray bytearray; - QTest::newRow("nullbytearray") << QVariant(bytearray) << "ay"; - bytearray = ""; // empty, not null - QTest::newRow("emptybytearray") << QVariant(bytearray) << "ay"; - bytearray = "foo"; - QTest::newRow("bytearray") << QVariant(bytearray) << "ay"; - bytearray.clear(); - for (int i = 0; i < 4096; ++i) - bytearray += QByteArray(1024, char(i)); - QTest::newRow("hugebytearray") << QVariant(bytearray) << "ay"; - - QList bools; - QTest::newRow("emptyboollist") << qVariantFromValue(bools) << "ab"; - bools << false << true << false; - QTest::newRow("boollist") << qVariantFromValue(bools) << "ab"; - - QList shorts; - QTest::newRow("emptyshortlist") << qVariantFromValue(shorts) << "an"; - shorts << 42 << -43 << 44 << 45 << -32768 << 32767; - QTest::newRow("shortlist") << qVariantFromValue(shorts) << "an"; - - QList ushorts; - QTest::newRow("emptyushortlist") << qVariantFromValue(ushorts) << "aq"; - ushorts << 12u << 13u << 14u << 15 << 65535; - QTest::newRow("ushortlist") << qVariantFromValue(ushorts) << "aq"; - - QList ints; - QTest::newRow("emptyintlist") << qVariantFromValue(ints) << "ai"; - ints << 42 << -43 << 44 << 45 << 2147483647 << -2147483647-1; - QTest::newRow("intlist") << qVariantFromValue(ints) << "ai"; - - QList uints; - QTest::newRow("emptyuintlist") << qVariantFromValue(uints) << "au"; - uints << uint(12) << uint(13) << uint(14) << 4294967295U; - QTest::newRow("uintlist") << qVariantFromValue(uints) << "au"; - - QList llints; - QTest::newRow("emptyllintlist") << qVariantFromValue(llints) << "ax"; - llints << Q_INT64_C(99) << Q_INT64_C(-100) - << Q_INT64_C(-9223372036854775807)-1 << Q_INT64_C(9223372036854775807); - QTest::newRow("llintlist") << qVariantFromValue(llints) << "ax"; - - QList ullints; - QTest::newRow("emptyullintlist") << qVariantFromValue(ullints) << "at"; - ullints << Q_UINT64_C(66) << Q_UINT64_C(67) - << Q_UINT64_C(18446744073709551615); - QTest::newRow("ullintlist") << qVariantFromValue(ullints) << "at"; - - QList doubles; - QTest::newRow("emptydoublelist") << qVariantFromValue(doubles) << "ad"; - doubles << 1.2 << 2.2 << 4.4 - << -std::numeric_limits::infinity() - << std::numeric_limits::infinity() - << std::numeric_limits::quiet_NaN(); - QTest::newRow("doublelist") << qVariantFromValue(doubles) << "ad"; - - QVariantList variants; - QTest::newRow("emptyvariantlist") << QVariant(variants) << "av"; - variants << QString("Hello") << QByteArray("World") << 42 << -43.0 << 44U << Q_INT64_C(-45) - << Q_UINT64_C(46) << true << qVariantFromValue(short(-47)); - for (int i = 0; i < variants.count(); ++i) { - QVariant tmp = variants.at(i); - qVariantSetValue(variants[i], tmp); - } - QTest::newRow("variantlist") << QVariant(variants) << "av"; -} - -void tst_QDBusMarshall::sendArrayOfArrays_data() -{ - sendArrays_data(); -} - -void tst_QDBusMarshall::sendStringMap_data() -{ - sendBasic_data(); - - QVariant nested; - qVariantSetValue(nested, QVariant(1)); - QTest::newRow("variant") << nested << "v"; - - QVariant nested2; - qVariantSetValue(nested2, nested); - QTest::newRow("variant-variant") << nested2 << "v"; - - sendArrays_data(); -} - -void tst_QDBusMarshall::sendStringMapOfMap_data() -{ - sendStringMap_data(); -} - -void tst_QDBusMarshall::sendBasic() -{ - QFETCH(QVariant, value); - - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.kde.selftest", - "/org/kde/selftest", "org.kde.selftest", "ping"); - msg << value; - - QDBusMessage reply = con.sendWithReply(msg); - // qDebug() << reply; - - QCOMPARE(reply.count(), msg.count()); - QTEST(reply.signature(), "sig"); - for (int i = 0; i < reply.count(); ++i) - QVERIFY(compare(reply.at(i), msg.at(i))); -} - -void tst_QDBusMarshall::sendVariant() -{ - QFETCH(QVariant, value); - QVariant tmp = value; - qVariantSetValue(value, tmp); - - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.kde.selftest", - "/org/kde/selftest", "org.kde.selftest", "ping"); - msg << value; - - QDBusMessage reply = con.sendWithReply(msg); - // qDebug() << reply; - - QCOMPARE(reply.count(), msg.count()); - QCOMPARE(reply.signature(), QString("v")); - for (int i = 0; i < reply.count(); ++i) - QVERIFY(compare(reply.at(i), msg.at(i))); -} - -void tst_QDBusMarshall::sendArrays() -{ - QFETCH(QVariant, value); - - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.kde.selftest", - "/org/kde/selftest", "org.kde.selftest", "ping"); - msg << value; - - QDBusMessage reply = con.sendWithReply(msg); - // qDebug() << reply; - - QCOMPARE(reply.count(), msg.count()); - QTEST(reply.signature(), "sig"); - for (int i = 0; i < reply.count(); ++i) - QVERIFY(compare(reply.at(i), msg.at(i))); -} - -void tst_QDBusMarshall::sendArrayOfArrays() -{ - QFETCH(QVariant, value); - - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.kde.selftest", - "/org/kde/selftest", "org.kde.selftest", "ping"); - msg << QVariant(QVariantList() << value << value); - - QDBusMessage reply = con.sendWithReply(msg); - // qDebug() << reply; - - QCOMPARE(reply.count(), msg.count()); - QFETCH(QString, sig); - QCOMPARE(reply.signature(), "a" + sig); - for (int i = 0; i < reply.count(); ++i) - QVERIFY(compare(reply.at(i), msg.at(i))); -} - -void tst_QDBusMarshall::sendStringMap() -{ - QFETCH(QVariant, value); - - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.kde.selftest", - "/org/kde/selftest", "org.kde.selftest", "ping"); - - QVariantMap map; - map["foo"] = value; - map["bar"] = value; - msg << QVariant(map); - - QDBusMessage reply = con.sendWithReply(msg); - // qDebug() << reply; - - QCOMPARE(reply.count(), msg.count()); - QFETCH(QString, sig); - QCOMPARE(reply.signature(), "a{s" + sig + "}"); - for (int i = 0; i < reply.count(); ++i) - QVERIFY(compare(reply.at(i), msg.at(i))); -} - -void tst_QDBusMarshall::sendStringMapOfMap() -{ - QFETCH(QVariant, value); - - QDBusConnection &con = QDBus::sessionBus(); - - QVERIFY(con.isConnected()); - - QDBusMessage msg = QDBusMessage::methodCall("org.kde.selftest", - "/org/kde/selftest", "org.kde.selftest", "ping"); - - QVariantMap map; - map["foo"] = value; - map["bar"] = value; - - QVariantMap map2; - map2["foo"] = map; - msg << QVariant(map2); - - QDBusMessage reply = con.sendWithReply(msg); - // qDebug() << reply; - - QCOMPARE(reply.count(), msg.count()); - QFETCH(QString, sig); - QCOMPARE(reply.signature(), "a{sa{s" + sig + "}}"); - - for (int i = 0; i < reply.count(); ++i) - QVERIFY(compare(reply.at(i), msg.at(i))); -} - - -QTEST_MAIN(tst_QDBusMarshall) -#include "tst_qdbusmarshall.moc" diff --git a/test/qt/tst_qdbusxmlparser.cpp b/test/qt/tst_qdbusxmlparser.cpp deleted file mode 100644 index bf1ddec5..00000000 --- a/test/qt/tst_qdbusxmlparser.cpp +++ /dev/null @@ -1,578 +0,0 @@ -/* -*- C++ -*- - * - * Copyright (C) 2006 Trolltech AS. All rights reserved. - * Author: Thiago Macieira - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ -#include -#include -#include - -#include - -#define USE_PRIVATE_CODE -#include "common.h" - -class tst_QDBusXmlParser: public QObject -{ - Q_OBJECT - -private: - void parsing_common(const QString&); - -private slots: - void parsing_data(); - void parsing(); - void parsingWithDoctype_data(); - void parsingWithDoctype(); - - void objectWithContent_data(); - void objectWithContent(); - - void methods_data(); - void methods(); - void signals__data(); - void signals_(); - void properties_data(); - void properties(); -}; - -void tst_QDBusXmlParser::parsing_data() -{ - QTest::addColumn("xmlData"); - QTest::addColumn("interfaceCount"); - QTest::addColumn("objectCount"); - - QTest::newRow("null") << QString() << 0 << 0; - QTest::newRow("empty") << QString("") << 0 << 0; - - QTest::newRow("junk") << "" << 0 << 0; - QTest::newRow("interface-inside-junk") << "" - << 0 << 0; - QTest::newRow("object-inside-junk") << "" - << 0 << 0; - - QTest::newRow("zero-interfaces") << "" << 0 << 0; - QTest::newRow("one-interface") << "" << 1 << 0; - - - QTest::newRow("two-interfaces") << "" - "" - << 2 << 0; - - - QTest::newRow("one-object") << "" << 0 << 1; - QTest::newRow("two-objects") << "" << 0 << 2; - - QTest::newRow("i1o1") << "" << 1 << 1; - -} - -void tst_QDBusXmlParser::parsing_common(const QString &xmlData) -{ - QDBusIntrospection::ObjectTree obj = - QDBusIntrospection::parseObjectTree(xmlData, "local.testing", "/"); - QFETCH(int, interfaceCount); - QFETCH(int, objectCount); - QCOMPARE(obj.interfaces.count(), interfaceCount); - QCOMPARE(obj.childObjects.count(), objectCount); - - // also verify the naming - int i = 0; - foreach (QString name, obj.interfaces) - QCOMPARE(name, QString("iface.iface%1").arg(++i)); - - i = 0; - foreach (QString name, obj.childObjects) - QCOMPARE(name, QString("obj%1").arg(++i)); -} - -void tst_QDBusXmlParser::parsing() -{ - QFETCH(QString, xmlData); - - parsing_common(xmlData); -} - -void tst_QDBusXmlParser::parsingWithDoctype_data() -{ - parsing_data(); -} - -void tst_QDBusXmlParser::parsingWithDoctype() -{ - QString docType = "\n"; - QFETCH(QString, xmlData); - - parsing_common(docType + xmlData); -} - -void tst_QDBusXmlParser::objectWithContent_data() -{ - QTest::addColumn("xmlData"); - QTest::addColumn("probedObject"); - QTest::addColumn("interfaceCount"); - QTest::addColumn("objectCount"); - - QTest::newRow("zero") << "" << "obj" << 0 << 0; - - QString xmlData = "" - "" - ""; - QTest::newRow("one-interface") << xmlData << "obj" << 1 << 0; - QTest::newRow("one-interface2") << xmlData << "obj2" << 0 << 0; - - xmlData = "" - "" - "" - ""; - QTest::newRow("two-interfaces") << xmlData << "obj" << 2 << 0; - QTest::newRow("two-interfaces2") << xmlData << "obj2" << 0 << 0; - - xmlData = "" - "" - "" - "" - "" - ""; - QTest::newRow("two-nodes-two-interfaces") << xmlData << "obj" << 2 << 0; - QTest::newRow("two-nodes-one-interface") << xmlData << "obj2" << 1 << 0; - - xmlData = "" - "" - ""; - QTest::newRow("one-object") << xmlData << "obj" << 0 << 1; - QTest::newRow("one-object2") << xmlData << "obj2" << 0 << 0; - - xmlData = "" - "" - "" - ""; - QTest::newRow("two-objects") << xmlData << "obj" << 0 << 2; - QTest::newRow("two-objects2") << xmlData << "obj2" << 0 << 0; - - xmlData = "" - "" - "" - "" - "" - ""; - QTest::newRow("two-nodes-two-objects") << xmlData << "obj" << 0 << 2; - QTest::newRow("two-nodes-one-object") << xmlData << "obj2" << 0 << 1; -} - -void tst_QDBusXmlParser::objectWithContent() -{ - QFETCH(QString, xmlData); - QFETCH(QString, probedObject); - - QDBusIntrospection::ObjectTree tree = - QDBusIntrospection::parseObjectTree(xmlData, "local.testing", "/"); - - const ObjectMap &om = tree.childObjectData; - - if (om.contains(probedObject)) { - const QSharedDataPointer& obj = om.value(probedObject); - QVERIFY(obj != 0); - - QFETCH(int, interfaceCount); - QFETCH(int, objectCount); - - QCOMPARE(obj->interfaces.count(), interfaceCount); - QCOMPARE(obj->childObjects.count(), objectCount); - - // verify the object names - int i = 0; - foreach (QString name, obj->interfaces) - QCOMPARE(name, QString("iface.iface%1").arg(++i)); - - i = 0; - foreach (QString name, obj->childObjects) - QCOMPARE(name, QString("obj%1").arg(++i)); - } -} - -void tst_QDBusXmlParser::methods_data() -{ - QTest::addColumn("xmlDataFragment"); - QTest::addColumn("methodMap"); - - MethodMap map; - QTest::newRow("no-methods") << QString() << map; - - // one method without arguments - QDBusIntrospection::Method method; - method.name = "Foo"; - map << method; - QTest::newRow("one-method") << "" << map; - - // add another method without arguments - method.name = "Bar"; - map << method; - QTest::newRow("two-methods") << "" - "" - << map; - - // invert the order of the XML declaration - QTest::newRow("two-methods-inverse") << "" - "" - << map; - - // add a third, with annotations - method.name = "Baz"; - method.annotations.insert("foo.testing", "nothing to see here"); - map << method; - QTest::newRow("method-with-annotation") << - "" - "" - "" - << map; - - // arguments - map.clear(); - method.annotations.clear(); - - method.name = "Method"; - method.inputArgs << arg("s"); - map << method; - QTest::newRow("one-in") << - "" - "" - "" << map; - - // two arguments - method.inputArgs << arg("v"); - map.clear(); - map << method; - QTest::newRow("two-in") << - "" - "" - "" - "" << map; - - // one invalid arg - QTest::newRow("two-in-one-invalid") << - "" - "" - "" // this line should be ignored - "" - "" << map; - - // one out argument - method.inputArgs.clear(); - method.outputArgs << arg("s"); - map.clear(); - map << method; - QTest::newRow("one-out") << - "" - "" - "" << map; - - // two in and one out - method.inputArgs << arg("s") << arg("v"); - map.clear(); - map << method; - QTest::newRow("two-in-one-out") << - "" - "" - "" - "" - "" << map; - - // let's try an arg with name - method.outputArgs.clear(); - method.inputArgs.clear(); - method.inputArgs << arg("s", "foo"); - map.clear(); - map << method; - QTest::newRow("one-in-with-name") << - "" - "" - "" << map; - - // two args with name - method.inputArgs << arg("i", "bar"); - map.clear(); - map << method; - QTest::newRow("two-in-with-name") << - "" - "" - "" - "" << map; - - // one complex - map.clear(); - method = QDBusIntrospection::Method(); - - // Method1(in STRING arg1, in BYTE arg2, out ARRAY of STRING) - method.inputArgs << arg("s", "arg1") << arg("y", "arg2"); - method.outputArgs << arg("as"); - method.name = "Method1"; - map << method; - - // Method2(in ARRAY of DICT_ENTRY of (STRING,VARIANT) variantMap, in UINT32 index, - // out STRING key, out VARIANT value) - // with annotation "foo.equivalent":"QVariantMap" - method = QDBusIntrospection::Method(); - method.inputArgs << arg("a{sv}", "variantMap") << arg("u", "index"); - method.outputArgs << arg("s", "key") << arg("v", "value"); - method.annotations.insert("foo.equivalent", "QVariantMap"); - method.name = "Method2"; - map << method; - - QTest::newRow("complex") << - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" << map; -} - -void tst_QDBusXmlParser::methods() -{ - QString xmlHeader = "" - "", - xmlFooter = "" - ""; - - QFETCH(QString, xmlDataFragment); - - QDBusIntrospection::Interface iface = - QDBusIntrospection::parseInterface(xmlHeader + xmlDataFragment + xmlFooter); - - QCOMPARE(iface.name, QString("iface.iface1")); - - QFETCH(MethodMap, methodMap); - MethodMap parsedMap = iface.methods; - - QCOMPARE(methodMap.count(), parsedMap.count()); - QCOMPARE(methodMap, parsedMap); -} - -void tst_QDBusXmlParser::signals__data() -{ - QTest::addColumn("xmlDataFragment"); - QTest::addColumn("signalMap"); - - SignalMap map; - QTest::newRow("no-signals") << QString() << map; - - // one signal without arguments - QDBusIntrospection::Signal signal; - signal.name = "Foo"; - map << signal; - QTest::newRow("one-signal") << "" << map; - - // add another signal without arguments - signal.name = "Bar"; - map << signal; - QTest::newRow("two-signals") << "" - "" - << map; - - // invert the order of the XML declaration - QTest::newRow("two-signals-inverse") << "" - "" - << map; - - // add a third, with annotations - signal.name = "Baz"; - signal.annotations.insert("foo.testing", "nothing to see here"); - map << signal; - QTest::newRow("signal-with-annotation") << - "" - "" - "" - << map; - - // one out argument - map.clear(); - signal.annotations.clear(); - signal.outputArgs << arg("s"); - signal.name = "Signal"; - map.clear(); - map << signal; - QTest::newRow("one-out") << - "" - "" - "" << map; - - // without saying which direction it is - QTest::newRow("one-out-no-direction") << - "" - "" - "" << map; - - // two args with name - signal.outputArgs << arg("i", "bar"); - map.clear(); - map << signal; - QTest::newRow("two-out-with-name") << - "" - "" - "" - "" << map; - - // one complex - map.clear(); - signal = QDBusIntrospection::Signal(); - - // Signal1(out ARRAY of STRING) - signal.outputArgs << arg("as"); - signal.name = "Signal1"; - map << signal; - - // Signal2(out STRING key, out VARIANT value) - // with annotation "foo.equivalent":"QVariantMap" - signal = QDBusIntrospection::Signal(); - signal.outputArgs << arg("s", "key") << arg("v", "value"); - signal.annotations.insert("foo.equivalent", "QVariantMap"); - signal.name = "Signal2"; - map << signal; - - QTest::newRow("complex") << - "" - "" - "" - "" - "" - "" - "" - "" << map; -} - -void tst_QDBusXmlParser::signals_() -{ - QString xmlHeader = "" - "", - xmlFooter = "" - ""; - - QFETCH(QString, xmlDataFragment); - - QDBusIntrospection::Interface iface = - QDBusIntrospection::parseInterface(xmlHeader + xmlDataFragment + xmlFooter); - - QCOMPARE(iface.name, QString("iface.iface1")); - - QFETCH(SignalMap, signalMap); - SignalMap parsedMap = iface.signals_; - - QCOMPARE(signalMap.count(), parsedMap.count()); - QCOMPARE(signalMap, parsedMap); -} - -void tst_QDBusXmlParser::properties_data() -{ - QTest::addColumn("xmlDataFragment"); - QTest::addColumn("propertyMap"); - - PropertyMap map; - QTest::newRow("no-signals") << QString() << map; - - // one readable signal - QDBusIntrospection::Property prop; - prop.name = "foo"; - prop.type = "s"; - prop.access = QDBusIntrospection::Property::Read; - map << prop; - QTest::newRow("one-readable") << "" << map; - - // one writable signal - prop.access = QDBusIntrospection::Property::Write; - map.clear(); - map << prop; - QTest::newRow("one-writable") << "" << map; - - // one read- & writable signal - prop.access = QDBusIntrospection::Property::ReadWrite; - map.clear(); - map << prop; - QTest::newRow("one-read-writable") << "" - << map; - - // two, mixed properties - prop.name = "bar"; - prop.type = "i"; - prop.access = QDBusIntrospection::Property::Read; - map << prop; - QTest::newRow("two") << - "" - "" << map; - - // invert the order of the declaration - QTest::newRow("two") << - "" - "" << map; - - // add a third with annotations - prop.name = "baz"; - prop.type = "as"; - prop.access = QDBusIntrospection::Property::Write; - prop.annotations.insert("foo.annotation", "Hello, World"); - prop.annotations.insert("foo.annotation2", "Goodbye, World"); - map << prop; - QTest::newRow("complex") << - "" - "" - "" - "" - "" << map; - - // and now change the order - QTest::newRow("complex2") << - "" - "" - "" - "" - "" << map; -} - -void tst_QDBusXmlParser::properties() -{ - QString xmlHeader = "" - "", - xmlFooter = "" - ""; - - QFETCH(QString, xmlDataFragment); - - QDBusIntrospection::Interface iface = - QDBusIntrospection::parseInterface(xmlHeader + xmlDataFragment + xmlFooter); - - QCOMPARE(iface.name, QString("iface.iface1")); - - QFETCH(PropertyMap, propertyMap); - PropertyMap parsedMap = iface.properties; - - QCOMPARE(propertyMap.count(), parsedMap.count()); - QCOMPARE(propertyMap, parsedMap); -} - -QTEST_MAIN(tst_QDBusXmlParser) - -#include "tst_qdbusxmlparser.moc" diff --git a/tools/Makefile.am b/tools/Makefile.am index 5cd96c55..e653dea3 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,29 +1,6 @@ -INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_X_CFLAGS) $(DBUS_GTK_THREADS_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DDBUS_COMPILATION +INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) $(DBUS_X_CFLAGS) -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DDBUS_COMPILATION -if HAVE_GLIB - -nodist_libdbus_glib_HEADERS = dbus-glib-bindings.h -libdbus_glibdir = $(includedir)/dbus-1.0/dbus - -dbus-glib-bindings.h: dbus-bus-introspect.xml $(top_builddir)/glib/dbus-binding-tool$(EXEEXT) - $(top_builddir)/glib/dbus-binding-tool --mode=glib-client --output=dbus-glib-bindings.h dbus-bus-introspect.xml - -BUILT_SOURCES = dbus-glib-bindings.h dbus-bus-introspect.xml - -endif - -if HAVE_GTK -GTK_TOOLS=dbus-viewer -else -GTK_TOOLS= -endif - -if HAVE_GLIB -dbus-bus-introspect.xml: $(top_builddir)/bus/dbus-daemon$(EXEEXT) dbus-launch$(EXEEXT) dbus-send$(EXEEXT) $(top_builddir)/bus/dbus-daemon$(EXEEXT) Makefile - DBUS_TOP_BUILDDIR=$(top_builddir) $(srcdir)/run-with-tmp-session-bus.sh ./dbus-send --print-reply=literal --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.Introspectable.Introspect > dbus-bus-introspect.xml.tmp && mv dbus-bus-introspect.xml.tmp dbus-bus-introspect.xml -endif - -bin_PROGRAMS=dbus-send dbus-monitor dbus-launch dbus-cleanup-sockets $(GTK_TOOLS) +bin_PROGRAMS=dbus-send dbus-monitor dbus-launch dbus-cleanup-sockets dbus_send_SOURCES= \ dbus-print-message.c \ @@ -41,21 +18,11 @@ dbus_launch_SOURCES= \ dbus_cleanup_sockets_SOURCES= \ dbus-cleanup-sockets.c -dbus_viewer_SOURCES= \ - dbus-names-model.c \ - dbus-names-model.h \ - dbus-tree-view.c \ - dbus-tree-view.h \ - dbus-viewer.c - dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la dbus_launch_LDADD= $(DBUS_X_LIBS) -dbus_viewer_LDADD= $(top_builddir)/glib/libdbus-gtool.la $(DBUS_GTK_THREADS_LIBS) $(DBUS_GLIB_TOOL_LIBS) man_MANS = dbus-send.1 dbus-monitor.1 dbus-launch.1 dbus-cleanup-sockets.1 EXTRA_DIST = $(man_MANS) run-with-tmp-session-bus.sh CLEANFILES = \ - run-with-tmp-session-bus.conf \ - dbus-bus-introspect.xml \ - dbus-glib-bindings.h + run-with-tmp-session-bus.conf diff --git a/tools/dbus-names-model.c b/tools/dbus-names-model.c deleted file mode 100644 index 65faa1b4..00000000 --- a/tools/dbus-names-model.c +++ /dev/null @@ -1,388 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-names-model.c GtkTreeModel for names on the bus - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "dbus-names-model.h" -#include -#include -#include - -enum -{ - MODEL_COLUMN_NAME, - - MODEL_COLUMN_LAST -}; - - -typedef struct NamesModel NamesModel; -typedef struct NamesModelClass NamesModelClass; - -GType names_model_get_type (void); - -struct NamesModel -{ - GtkListStore parent; - DBusGConnection *connection; - DBusGProxy *driver_proxy; - DBusGProxyCall *pending_list_names; -}; - -struct NamesModelClass -{ - GtkListStoreClass parent; -}; - -#define TYPE_NAMES_MODEL (names_model_get_type ()) -#define NAMES_MODEL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_NAMES_MODEL, NamesModel)) -#define NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NAMES_MODEL, NamesModelClass)) -#define IS_NAMES_MODEL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_NAMES_MODEL)) -#define IS_NAMES_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NAMES_MODEL)) -#define NAMES_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NAMES_MODEL, NamesModelClass)) - -static void -have_names_notify (DBusGProxy *proxy, - DBusGProxyCall *call, - void *data) -{ - NamesModel *names_model; - GError *error; - char **names; - int i; - - names_model = NAMES_MODEL (data); - - g_assert (names_model->pending_list_names == call); - g_assert (names_model->driver_proxy); - - names = NULL; - error = NULL; - if (!dbus_g_proxy_end_call (names_model->driver_proxy, - names_model->pending_list_names, - &error, - G_TYPE_STRV, &names, G_TYPE_INVALID)) - { - g_assert (names == NULL); - g_assert (error != NULL); - - g_printerr (_("Failed to load names on the bus: %s\n"), error->message); - g_error_free (error); - return; - } - - i = 0; - while (names[i]) - { - GtkTreeIter iter; - -#if 0 - g_printerr ("%d of %d: %s\n", - i, n_elements, names[i]); -#endif - - gtk_list_store_append (GTK_LIST_STORE (names_model), - &iter); - - gtk_list_store_set (GTK_LIST_STORE (names_model), - &iter, - MODEL_COLUMN_NAME, names[i], - -1); - - ++i; - } - - g_strfreev (names); -} - -static gboolean -names_model_find_name (NamesModel *names_model, - const char *name, - GtkTreeIter *iter_p) -{ - GtkTreeIter iter; - - if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (names_model), - &iter)) - return FALSE; - - do - { - char *s; - - gtk_tree_model_get (GTK_TREE_MODEL (names_model), - &iter, - MODEL_COLUMN_NAME, &s, - -1); - if (s && strcmp (s, name) == 0) - { - *iter_p = iter; - g_free (s); - return TRUE; - } - - g_free (s); - } - while (gtk_tree_model_iter_next (GTK_TREE_MODEL (names_model), - &iter)); - - return FALSE; -} - -static void -name_owner_changed (DBusGProxy *driver_proxy, - const char *name, - const char *old_owner, - const char *new_owner, - void *data) -{ - NamesModel *names_model = NAMES_MODEL (data); - -#if 0 - g_printerr ("Name '%s' changed owner '%s' -> '%s'\n", - name, old_owner, new_owner); -#endif - - if (*new_owner == '\0') - { - /* this name has vanished */ - GtkTreeIter iter; - - if (names_model_find_name (names_model, name, &iter)) - gtk_list_store_remove (GTK_LIST_STORE (names_model), - &iter); - } - else if (*old_owner == '\0') - { - /* this name has been added */ - GtkTreeIter iter; - - if (!names_model_find_name (names_model, name, &iter)) - { - gtk_list_store_append (GTK_LIST_STORE (names_model), - &iter); - - gtk_list_store_set (GTK_LIST_STORE (names_model), - &iter, - MODEL_COLUMN_NAME, name, - -1); - } - } -} - -static void -names_model_reload (NamesModel *names_model) -{ - GtkListStore *list_store; - - list_store = GTK_LIST_STORE (names_model); - - if (names_model->pending_list_names) - { - dbus_g_proxy_cancel_call (names_model->driver_proxy, - names_model->pending_list_names); - names_model->pending_list_names = NULL; - } - - gtk_list_store_clear (list_store); - - if (names_model->connection == NULL) - return; - - names_model->pending_list_names = - dbus_g_proxy_begin_call (names_model->driver_proxy, - "ListNames", - have_names_notify, names_model, NULL, - G_TYPE_INVALID); -} - -static void -names_model_set_connection (NamesModel *names_model, - DBusGConnection *connection) -{ - g_return_if_fail (IS_NAMES_MODEL (names_model)); - - if (connection == names_model->connection) - return; - - if (names_model->connection) - { - dbus_g_proxy_disconnect_signal (names_model->driver_proxy, - "NameOwnerChanged", - G_CALLBACK (name_owner_changed), - names_model); - - g_object_unref (names_model->driver_proxy); - names_model->driver_proxy = NULL; - dbus_g_connection_unref (names_model->connection); - names_model->connection = NULL; - } - - if (connection) - { - names_model->connection = connection; - dbus_g_connection_ref (names_model->connection); - - names_model->driver_proxy = - dbus_g_proxy_new_for_name (names_model->connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - g_assert (names_model->driver_proxy); - - dbus_g_proxy_add_signal (names_model->driver_proxy, - "NameOwnerChanged", - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_STRING, - G_TYPE_INVALID); - - dbus_g_proxy_connect_signal (names_model->driver_proxy, - "NameOwnerChanged", - G_CALLBACK (name_owner_changed), - names_model, - NULL); - } - - names_model_reload (names_model); -} - -G_DEFINE_TYPE(NamesModel, names_model, GTK_TYPE_LIST_STORE) - -/* Properties */ -enum -{ - PROP_0, - PROP_CONNECTION -}; - -static void -names_model_dispose (GObject *object) -{ - NamesModel *names_model = NAMES_MODEL (object); - - names_model_set_connection (names_model, NULL); - - g_assert (names_model->connection == NULL); - g_assert (names_model->driver_proxy == NULL); - g_assert (names_model->pending_list_names == NULL); - - (G_OBJECT_CLASS (names_model_parent_class)->dispose) (object); -} - -static void -names_model_finalize (GObject *object) -{ - NamesModel *names_model = NAMES_MODEL (object); - - g_assert (names_model->connection == NULL); - g_assert (names_model->driver_proxy == NULL); - g_assert (names_model->pending_list_names == NULL); - - (G_OBJECT_CLASS (names_model_parent_class)->finalize) (object); -} - -static void -names_model_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - NamesModel *names_model; - - names_model = NAMES_MODEL (object); - - switch (prop_id) - { - case PROP_CONNECTION: - names_model_set_connection (names_model, g_value_get_boxed (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -names_model_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - NamesModel *names_model; - - names_model = NAMES_MODEL (object); - - switch (prop_id) - { - case PROP_CONNECTION: - g_value_set_boxed (value, names_model->connection); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -names_model_init (NamesModel *names_model) -{ - GtkListStore *list_store; - GType types[MODEL_COLUMN_LAST]; - - list_store = GTK_LIST_STORE (names_model); - - types[0] = G_TYPE_STRING; /* name */ - gtk_list_store_set_column_types (list_store, MODEL_COLUMN_LAST, types); -} - -static void -names_model_class_init (NamesModelClass *names_model_class) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (names_model_class); - - gobject_class->finalize = names_model_finalize; - gobject_class->dispose = names_model_dispose; - gobject_class->set_property = names_model_set_property; - gobject_class->get_property = names_model_get_property; - - g_object_class_install_property (gobject_class, - PROP_CONNECTION, - g_param_spec_boxed ("connection", - _("Bus connection"), - _("Connection to the message bus"), - DBUS_TYPE_G_CONNECTION, - G_PARAM_READWRITE)); -} - -GtkTreeModel* -names_model_new (DBusGConnection *connection) -{ - NamesModel *names_model; - - names_model = g_object_new (TYPE_NAMES_MODEL, - "connection", connection, - NULL); - - return GTK_TREE_MODEL (names_model); -} - diff --git a/tools/dbus-names-model.h b/tools/dbus-names-model.h deleted file mode 100644 index c2b54fc8..00000000 --- a/tools/dbus-names-model.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-names-model.h GtkTreeModel for names on the bus - * - * Copyright (C) 2005 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_NAMES_MODEL_H -#define DBUS_NAMES_MODEL_H - -#include -#include - -GtkTreeModel* names_model_new (DBusGConnection *connection); - -#endif /* DBUS_NAMES_MODEL_H */ diff --git a/tools/dbus-tree-view.c b/tools/dbus-tree-view.c deleted file mode 100644 index 448d770d..00000000 --- a/tools/dbus-tree-view.c +++ /dev/null @@ -1,374 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-tree-view.c GtkTreeView for a D-BUS interface description - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include "dbus-tree-view.h" -#include - -enum -{ - MODEL_COLUMN_INFO, - - MODEL_COLUMN_LAST -}; - -enum -{ - VIEW_COLUMN_NAME, - - VIEW_COLUMN_LAST -}; - -/* We stuff the node tree into a GtkTreeStore, rather - * than bothering to write a custom model - */ -static GtkTreeModel* -model_new (void) -{ - GtkTreeModel *model; - GtkTreeStore *store; - - store = gtk_tree_store_new (MODEL_COLUMN_LAST, - BASE_INFO_TYPE); - - model = GTK_TREE_MODEL (store); - - return model; -} - -static void set_info (GtkTreeModel *model, - GtkTreeIter *root, - BaseInfo *info); - -static void -append_child_list (GtkTreeModel *model, - GtkTreeIter *parent, - GSList *children) -{ - GSList *tmp; - GtkTreeStore *store; - - store = GTK_TREE_STORE (model); - - /* parent may be NULL for root */ - - tmp = children; - while (tmp != NULL) - { - GtkTreeIter iter; - - gtk_tree_store_append (store, &iter, parent); - - set_info (model, &iter, tmp->data); - - tmp = tmp->next; - } -} - -static void -set_info (GtkTreeModel *model, - GtkTreeIter *root, - BaseInfo *info) -{ - GtkTreeStore *store; - GtkTreeIter child; - - store = GTK_TREE_STORE (model); - - /* Remeber that root is NULL for "/" path */ - - /* Clear existing children */ - while (gtk_tree_model_iter_children (model, &child, root)) - gtk_tree_store_remove (store, &child); - - /* Set our new value; we simply discard NodeInfo for "/" at the - * moment. - */ - if (root != NULL) - { - gtk_tree_store_set (store, root, - MODEL_COLUMN_INFO, info, - -1); - } - - /* Fill in new children */ - switch (base_info_get_type (info)) - { - case INFO_TYPE_NODE: - append_child_list (model, root, - node_info_get_interfaces ((NodeInfo*)info)); - append_child_list (model, root, - node_info_get_nodes ((NodeInfo*)info)); - break; - case INFO_TYPE_INTERFACE: - append_child_list (model, root, - interface_info_get_methods ((InterfaceInfo*)info)); - append_child_list (model, root, - interface_info_get_signals ((InterfaceInfo*)info)); - append_child_list (model, root, - interface_info_get_properties ((InterfaceInfo*)info)); - break; - case INFO_TYPE_METHOD: - append_child_list (model, root, - method_info_get_args ((MethodInfo*)info)); - break; - case INFO_TYPE_SIGNAL: - append_child_list (model, root, - signal_info_get_args ((SignalInfo*)info)); - break; - case INFO_TYPE_PROPERTY: - /* no children */ - break; - case INFO_TYPE_ARG: - /* no children */ - break; - } -} - -static void -ensure_tree_node (GtkTreeModel *model, - const char **path, - GtkTreeIter *iter) -{ - GtkTreeStore *store; - int i; - GtkTreeIter child; - GtkTreeIter *parent; - GtkTreeIter prev; - - store = GTK_TREE_STORE (model); - - /* The path[0] == NULL case for path "/" can't happen since no tree - * node is created for that - */ - g_assert (path[0] != NULL); - - parent = NULL; - - i = 0; - while (path[i] != NULL) - { - gboolean found; - - found = FALSE; - - if (gtk_tree_model_iter_children (model, &child, parent)) - { - /* Scan for the right path */ - do - { - BaseInfo *info; - - info = NULL; - gtk_tree_model_get (model, &child, - MODEL_COLUMN_INFO, &info, - -1); - - if (info != NULL && - base_info_get_type (info) == INFO_TYPE_NODE && - strcmp (base_info_get_name (info), path[i]) == 0) - { - /* Found it */ - found = TRUE; - break; - } - } - while (gtk_tree_model_iter_next (model, &child)); - } - - if (!found) - { - NodeInfo *node; - - node = node_info_new (path[i]); - - gtk_tree_store_append (store, &child, parent); - gtk_tree_store_set (store, &child, - MODEL_COLUMN_INFO, node, - -1); - } - - prev = child; - parent = &prev; - - ++i; - } - - g_assert (parent == &prev); - *iter = prev; -} - -static void -model_update (GtkTreeModel *model, - const char **path, - NodeInfo *node) -{ - if (path[0] == NULL) - { - /* Setting '/' */ - - set_info (model, NULL, (BaseInfo*) node); - } - else - { - GtkTreeIter iter; - BaseInfo *old; - - /* Be sure we have the parent node */ - ensure_tree_node (model, path, &iter); - - /* Force the canonical relative path name on the node */ - old = NULL; - gtk_tree_model_get (model, &iter, - MODEL_COLUMN_INFO, &old, - -1); - base_info_set_name ((BaseInfo*) node, - base_info_get_name (old)); - - /* Fill in the new children */ - set_info (model, &iter, (BaseInfo*) node); - } -} - -static void -info_set_func_text (GtkTreeViewColumn *tree_column, - GtkCellRenderer *cell, - GtkTreeModel *model, - GtkTreeIter *iter, - gpointer data) -{ - BaseInfo *info; - GString *str; - - info = NULL; - gtk_tree_model_get (model, iter, - MODEL_COLUMN_INFO, &info, - -1); - - if (info == NULL) - return; - - str = g_string_new (NULL); - - switch (base_info_get_type (info)) - { - case INFO_TYPE_NODE: - g_string_append (str, "path"); - break; - case INFO_TYPE_INTERFACE: - g_string_append (str, "interface"); - break; - case INFO_TYPE_METHOD: - g_string_append (str, "method"); - break; - case INFO_TYPE_SIGNAL: - g_string_append (str, "signal"); - break; - case INFO_TYPE_PROPERTY: - g_string_append (str, "property"); - g_string_append_printf (str, " %s", - property_info_get_type ((PropertyInfo*)info)); - break; - case INFO_TYPE_ARG: - g_string_append_printf (str, "arg %s", - arg_info_get_direction ((ArgInfo*)info) == ARG_IN ? - "in" : "out"); - g_string_append_printf (str, " %s", - arg_info_get_type ((ArgInfo*)info)); - break; - } - - g_string_append (str, " "); - g_string_append (str, base_info_get_name (info)); - - g_object_set (GTK_CELL_RENDERER (cell), - "markup", str->str, - NULL); - - g_string_free (str, TRUE); - - /* base_info_unref (info); */ -} - -GtkWidget* -dbus_tree_view_new (void) -{ - GtkWidget *treeview; - GtkCellRenderer *cell_renderer; - GtkTreeViewColumn *column; - - treeview = gtk_tree_view_new (); - - column = gtk_tree_view_column_new (); - gtk_tree_view_column_set_title (column, _("Name")); - - cell_renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_column_pack_start (column, - cell_renderer, - TRUE); - gtk_tree_view_column_set_cell_data_func (column, cell_renderer, - info_set_func_text, NULL, NULL); - - gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), - column); - - return treeview; -} - -void -dbus_tree_view_update (GtkTreeView *view, - const char **path, - NodeInfo *node) -{ - GtkTreeModel *model; - - g_return_if_fail (GTK_IS_TREE_VIEW (view)); - - model = gtk_tree_view_get_model (view); - - if (model == NULL) - { - model = model_new (); - model_update (model, path, node); - gtk_tree_view_set_model (view, model); - g_object_unref (G_OBJECT (model)); - } - else - { - model_update (model, path, node); - } -} - -void -dbus_tree_view_clear (GtkTreeView *view) -{ - GtkTreeModel *model; - - g_return_if_fail (GTK_IS_TREE_VIEW (view)); - - model = gtk_tree_view_get_model (view); - - if (model != NULL) - gtk_tree_store_clear (GTK_TREE_STORE (model)); -} - diff --git a/tools/dbus-tree-view.h b/tools/dbus-tree-view.h deleted file mode 100644 index e0b82e24..00000000 --- a/tools/dbus-tree-view.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu" -*- */ -/* dbus-tree-view.h GtkTreeView for a D-BUS interface description - * - * Copyright (C) 2003 Red Hat, Inc. - * - * Licensed under the Academic Free License version 2.1 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#ifndef DBUS_TREE_VIEW_H -#define DBUS_TREE_VIEW_H - -#include -#include -#include - -GtkWidget* dbus_tree_view_new (void); -void dbus_tree_view_update (GtkTreeView *view, - const char **path, - NodeInfo *info); -void dbus_tree_view_clear (GtkTreeView *view); - -#endif /* DBUS_TREE_VIEW_H */ -- cgit